diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..e7475401a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,34 @@ +name: Build for all targets +on: + push: + branches: + - master + - devel + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + container: + image: ghcr.io/lnls-dig/openmmc-builder:latest + strategy: + matrix: + build-flags: + - { flags: -DBOARD=afc-bpm -DVERSION=3.1 } + - { flags: -DBOARD=afc-timing -DBOARD_RTM=8sfp } + - { flags: -DBOARD=afc-v4 } + - { flags: -DBOARD=afc-v4 -DDEBUG_PROBE=jlink -DOPENOCD_TRANSPORT=swd } + - { flags: -DBOARD=afc-v4 -DDEBUG_PROBE=cmsis-dap -DOPENOCD_TRANSPORT=swd } + - { flags: -DBOARD=afc-v4 -DDEBUG_PROBE=digilent_jtag_hs3 -DOPENOCD_TRANSPORT=jtag } + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Create build environment + run: mkdir build + - name: Configure CMake + working-directory: build + run: cmake .. -DCMAKE_BUILD_TYPE=RELWITHDEBINFO ${{matrix.build-flags.flags}} + - name: Build for all targets + working-directory: build + run: make diff --git a/.gitignore b/.gitignore index 2920fc0bf..3a8b42a7d 100644 --- a/.gitignore +++ b/.gitignore @@ -56,6 +56,7 @@ CMakeFiles/ Makefile *cmake_install.cmake CMakeCache.txt +build/ #Output files out/* diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 37776b00a..000000000 --- a/.travis.yml +++ /dev/null @@ -1,71 +0,0 @@ -dist: bionic -os: linux - -notifications: - email: false - -language: c - -# blocklist -branches: - except: - - gh-pages - -env: - global: - - BUILD_DIR=build - - RELEASE_DIR=release - jobs: - - BUILD_ARTIFACT='binary' BUILD_TYPE='Release' BOARD='afc-bpm' VERSION='3.0' RTM='' - - BUILD_ARTIFACT='binary' BUILD_TYPE='Release' BOARD='afc-bpm' VERSION='3.1' RTM='' - - BUILD_ARTIFACT='binary' BUILD_TYPE='Release' BOARD='afc-timing' VERSION='' RTM='rtm-8sfp' - -jobs: - include: - - env: BUILD_ARTIFACT='all_binaries' DEPLOY='all_binaries' - - env: BUILD_ARTIFACT='docs' DEPLOY='docs' - -# Install dependencies -addons: - apt: - packages: - - gcc-arm-none-eabi - - libnewlib-arm-none-eabi - - cmake - - doxygen - - doxygen-doc - - doxygen-latex - - doxygen-gui - - graphviz - -# Build and check this project -script: - - ./ci_build.sh - -# Generate documentation -after_success: - - ./ci_gen_doxy.sh - -# Prepare for deploy -before_deploy: - - . ./ci_deploy.sh - -deploy: - - provider: releases - token: $GH_RELEASES_TOKEN - file_glob: true - file: ${OPENMMC_DEPLOYMENT} - skip_cleanup: true - on: - all_branches: true - tags: true - condition: $DEPLOY = "all_binaries" - - - provider: pages - skip_cleanup: true - local_dir: docs/html - token: $GH_TOKEN # Set in the settings page of your repository, as a secure variable - keep_history: false - on: - all_branches: true - condition: $DEPLOY = "docs" diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e63d39f4..5f2a2115a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,7 @@ # Define minimal required version of CMake. -cmake_minimum_required(VERSION 2.8.8) +cmake_minimum_required(VERSION 3.0.0) + +option(DISABLE_WATCHDOG "Disable watchdog module to aid debugging" OFF) #Include text color definitions include( ${CMAKE_SOURCE_DIR}/toolchain/colors.cmake ) @@ -18,7 +20,7 @@ project(openMMC C CXX ASM) #Find a toolchain file if(NOT CMAKE_TOOLCHAIN_FILE) - message(WARNING "${Yellow}No toolchain configuration file specified. Using default option!${ColourReset}") + message(NOTICE "No toolchain configuration file specified. Using default option!") include(${CMAKE_SOURCE_DIR}/toolchain/toolchain-arm-none-eabi.cmake) endif() @@ -57,22 +59,17 @@ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}" CACHE STRING "") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}" CACHE STRING "") set(PROJ_HDRS ${CMAKE_SOURCE_DIR} ) +set(UCONTROLLER_APP_LD_SCRIPT "") add_subdirectory(port/board) add_subdirectory(port/ucontroller) add_subdirectory(FreeRTOS) -add_subdirectory(boot) add_subdirectory(modules) include_directories( ${UCONTROLLER_HDRS} ${PROJ_HDRS} ) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTARGET_CONTROLLER=${TARGET_CONTROLLER} -DTARGET_BOARD_NAME=\"${TARGET_BOARD_NAME}\" ") -if(BENCH_TEST) - set(MODULES_FLAGS "${MODULES_FLAGS} -DBENCH_TEST") - message( STATUS "${Magenta}Bench mode activated! ${ColourReset}") -endif() - # Get Git information git_describe(GIT_TAG "--tags") get_git_head_revision(GIT_REFSPEC GIT_SHA1) @@ -92,44 +89,37 @@ else() message(FATAL_ERROR "${BOARD} not supported!") endif() - - # Linker flags set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES - SUFFIX ".axf" - LINK_FLAGS "-T ${CMAKE_SOURCE_DIR}/linker/${TARGET_CONTROLLER}_app.ld -Wl,-Map=${CMAKE_SOURCE_DIR}/linker/${TARGET_CONTROLLER}_app.map" ) + SUFFIX ".elf" + LINK_FLAGS "-T ${UCONTROLLER_APP_LD_SCRIPT} -Wl,-Map=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TARGET_CONTROLLER}_app.map" + ) # Headers path target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC ${PROJ_HDRS}) # Link libraries -target_link_libraries(${CMAKE_PROJECT_NAME} FreeRTOS c gcc m ${PROJ_LIBS}) - - +target_link_libraries(${CMAKE_PROJECT_NAME} FreeRTOS gcc c ${PROJ_LIBS}) ##Generate binary file add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD - COMMAND ${CMAKE_OBJCOPY} -O binary ${CMAKE_PROJECT_NAME}.axf ${CMAKE_PROJECT_NAME}.bin + COMMAND ${CMAKE_OBJCOPY} -O binary ${CMAKE_PROJECT_NAME}.elf ${CMAKE_PROJECT_NAME}.bin WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - COMMENT "Converting the AXF output to a binary file" + COMMENT "Converting the ELF output to a binary file" ) -#generate bootloader files only for afc cards -if(${BOARD} MATCHES "^(afc)") - add_executable(bootloader ${BOOT_SRCS}) - set_target_properties(bootloader PROPERTIES - SUFFIX ".axf" - LINK_FLAGS "-T ${CMAKE_SOURCE_DIR}/linker/${TARGET_CONTROLLER}_boot.ld -Wl,-Map=${CMAKE_SOURCE_DIR}/linker/${TARGET_CONTROLLER}_boot.map") - # Headers path - target_include_directories(bootloader PUBLIC ${PROJ_HDRS}) - # Link libraries - target_link_libraries(bootloader gcc c m lpcopen) - - add_custom_command(TARGET bootloader POST_BUILD - COMMAND ${CMAKE_OBJCOPY} -O binary bootloader.axf bootloader.bin +##Generate hpm files if bin2hpm is installed + +find_program(BIN2HPM NAMES "bin2hpm") +if(BIN2HPM) + add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD + COMMAND bin2hpm -c 1 -n -m 0x315A -p 0x00 ${CMAKE_PROJECT_NAME}.bin -o ${CMAKE_PROJECT_NAME}.hpm WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - COMMENT "Converting the AXF output to a binary file" - ) + COMMENT "Creating HPM file from binary" + ) + message(STATUS "bin2hpm found in the $PATH, .hpm files will be generated automatically.") +else() + message(NOTICE "bin2hpm not found in the $PATH, .hpm files will not be generated.") endif() -include( ${CMAKE_SOURCE_DIR}/probe/lpclink.cmake ) +include( ${CMAKE_SOURCE_DIR}/probe/openocd.cmake ) diff --git a/FreeRTOS/CMakeLists.txt b/FreeRTOS/CMakeLists.txt index 788145839..b8edb2801 100644 --- a/FreeRTOS/CMakeLists.txt +++ b/FreeRTOS/CMakeLists.txt @@ -32,6 +32,7 @@ set(LIBFREERTOS_SRCS ${LIBFREERTOS_SRCS} timers.c tasks.c event_groups.c + openocd.c ) include_directories(${UCONTROLLER_HDRS}) diff --git a/FreeRTOS/openocd.c b/FreeRTOS/openocd.c new file mode 100644 index 000000000..88c7aa944 --- /dev/null +++ b/FreeRTOS/openocd.c @@ -0,0 +1,20 @@ +/* + * Since at least FreeRTOS V7.5.3 uxTopUsedPriority is no longer + * present in the kernel, so it has to be supplied by other means for + * OpenOCD's threads awareness. + * + * Add this file to your project, and, if you're using --gc-sections, + * ``--undefined=uxTopUsedPriority'' (or + * ``-Wl,--undefined=uxTopUsedPriority'' when using gcc for final + * linking) to your LDFLAGS; same with all the other symbols you need. + */ + +#include "FreeRTOS.h" + +#ifdef __GNUC__ +#define USED __attribute__((used)) +#else +#define USED +#endif + +volatile const int USED uxTopUsedPriority = configMAX_PRIORITIES - 1; diff --git a/README.md b/README.md index 83ebb82e6..b1544c88e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # openMMC -[![Travis build status](https://travis-ci.org/lnls-dig/openMMC.svg?branch=master)](https://travis-ci.org/lnls-dig/openMMC) +[![Continuous Integration Status](https://github.com/lnls-dig/openMMC/actions/workflows/build.yml/badge.svg)](https://github.com/lnls-dig/openMMC/actions) Open Source modular IPM Controller firmware @@ -39,45 +39,82 @@ After creating the build files with CMake, you can compile the firmware using `m make [VERBOSE=1] -Both a `.axf` file and a `.bin` file will be generated in the `out` folder. You can use any one you prefer to program your processor. +Both a `.elf` file and a `.bin` file will be generated in the `out` folder. You can use any one you prefer to program your processor. To clean the compilation files (binaries, objects and dependence files), just run make clean -To make a debug build (to include symbols into axf file, turn off optimizations, etc.) add `-DCMAKE_BUILD_TYPE=Debug` option to `cmake` command. Example: +To make a debug build (to include symbols into elf file, turn off optimizations, etc.) add `-DCMAKE_BUILD_TYPE=Debug` option to `cmake` command. Example: cmake ~/openmmc/ -DBOARD=afc -DVERSION=3.1 -DCMAKE_BUILD_TYPE=Debug ## Programming -After creating the binaries, you can program them to your chip any way you want, using a JTAG cable, ISP Programmer, custom bootloader, etc. -There are 2 program interfaces supported so far: *LPCLink* and *LPCLink2* -In order to select which interface will be used, include the flag `-DDEBUG_PROBE=` when running CMake (this option defaults to `LPCLink`). - cmake ~/openmmc/ -DBOARD=afc -DVERSION=3.1 -DDEBUG_PROBE=LPCLink2 +### OpenOCD +Flashing the MMC microcontroller via SWD/JTAG is supported for CMSIS-DAP and Jlink compatible probes through OpenOCD. You can specify the debug probe with the flag `-DDEBUG_PROBE=`, valid options are `cmsis-dap` (default) and `jlink`. + cmake ~/openmmc/ -DBOARD=afc -DVERSION=3.1 -DDEBUG_PROBE=cmsis-dap -### LPCLink -If you own a *LPCLink* or *LPCLink2* board, you can use it to program the LPC1764 processor via its JTAG interface +This will create a `openocd.cfg` file in `/out`. -**NOTE**: In this case you **must** have the LPCXpresso installed in your machine, since we need to use the binaries for the interface chip on the LPCLink that they provide. +To flash the application firmware only, run -The CMake script should be able to find LPCXpresso path, but if this is not possible, open the `/CMakeLists.txt` and change the following line + make program_app - set(LPCXPRESSO_PATH ) +To flash the bootloader firmware only, run -*NOTE*: You can also use cmake-gui to set this option. + make program_boot -To transfer only the application firmware, run +If you want to erase the whole Flash and flash both firmwares: - make program_app + make program_all -To transfer only the bootloader firmware, run +### LPC-Link1 +It is possible to flash the MMC microcontroller with the LPC-Link1 adapter by using the `probe/lpclink1-flash.sh` script. You will need to have MCUXpresso IDE installed in your computer. This script assumes that the MCUXpresso binaries are located in `/usr/local/mcuxpressoide/ide/binaries/` by default, you can change this path by setting the `MCUXPRESSOIDE_BIN` environment variable. - make program_boot + ./probe/lpclink1-flash.sh firmware.bin LPC1764 0x0000 -If you want to erase the whole Flash and copy both firmwares: +### HPM-Downloader +> :warning: **Disclaimer:** Due to [f06f69f](https://github.com/lnls-dig/openMMC/commit/f06f69f978c11bb8e1a2b12e4846e4bd51f757e4), this alternative is deprecated and ipmitool should be used instead, except when updating the OpenMMC application from older versions. - make program_all +Another option to program the MMC microcontroler is through [HPM-Downloader](https://github.com/lnls-dig/hpm-downloader). +First, download and compile the HPM. In it's root directory, in order to load the firmware, run + + ./bin/hpm-downloader --no-retries --ip --slot --component 1 + +Due to timeout on sending packets, it may fails sometimes, with the Completion Code `0xc3` in the `ACTIVATE_FIRMWARE_UPLOAD` process. If it occurs, just try the same command again, until you receive the `Upgrade success` message. +Now, you have to upload the bootloader, since the old bootloader is incompatible. To succeed this, run + + ./bin/hpm-downloader --ignore-component-check --ip --slot --component 0 + +It's also important to mention that you can use the `--help` command in case of doubt about how to use the HPM commands. Run + + ./bin/hpm-downloader --help + +### ipmitool +After [5631857](https://github.com/lnls-dig/openMMC/commit/563185791c8b51ea026680c98ec0ea9587ea645b), it's possible to program the firmware and the bootloader through [ipmitool](https://codeberg.org/IPMITool/ipmitool), for previous releases, you still need to use [hpm-downloader](https://github.com/lnls-dig/hpm-downloader). In order to use it, you have to install the ipmitool, and then generate .hpm files from `OpenMMC.bin` and `newboot.bin`. To generate `.hpm` files, you will need to use [bin2hpm](https://github.com/MicroTCA-Tech-Lab/bin2hpm). If you have bin2hpm in your `$PATH`, the `.hpm` files will be automatically generated for you, provided you build from [0095b14](https://github.com/lnls-dig/openMMC/commit/0095b14667afe844113725228671d8810b45d9e0) or more recent versions. +After generate the files, you can use the following commands to program the MMC microcontroller. +To upgrade the firmware, use + + ipmitool -I lan -H host_name_mch -A none -T 0x82 -m 0x20 -t (112 + num_slot*2 in hexadecimal) hpm upgrade openMMC.hpm activate + +To upgrade the bootloader, use + + ipmitool -I lan -H host_name_mch -A none -T 0x82 -m 0x20 -t (112 + num_slot*2 in hexadecimal) hpm upgrade newboot.hpm activate + +## Debugging +It is possible to debug the MMC firmware using OpenOCD and GDB. First, connect OpenOCD with the debug probe using the `out/openocd.cfg` file generated by cmake in the build directory: + + openocd -f out/openocd.cfg + +Then open GDB: + + $ arm-none-eabi-gdb out/openMMC.elf + (gdb) target remote localhost:3333 + +Now you can use the typical GDB commands to inspect the program flow and variables. Some useful commands when interacting with a microcontroller trough OpenOCD are listed below: -**NOTE 2**: We only have linker scripts to LPC1764 and LPC1769, so if you wish to compile to a different controller, you'll have to change the `linker/lpc1764_boot.ld` and `linker/lpc1764_app.ld` files, which defines the memory regions, otherwise you'll run into several HardFault errors. + (gdb) monitor reset halt # Resets the microcontroller and immediately halts + (gdb) monitor reset run # Resets the microcontroller and starts executing + (gdb) load # Reload the firmware into flash diff --git a/boot/CMakeLists.txt b/boot/CMakeLists.txt deleted file mode 100644 index 45c70a77c..000000000 --- a/boot/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -set(BOOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -set(BOOT_SRCS ${BOOT_SRCS} - ${UCONTROLLER_SRCS} - ${BOOT_PATH}/boot.c ) - -set(BOOT_SRCS ${BOOT_SRCS} PARENT_SCOPE) - -set(PROJ_HDRS ${PROJ_HDRS} ${BOOT_PATH} PARENT_SCOPE) diff --git a/boot/boot.c b/boot/boot.c deleted file mode 100644 index 9be8d3dc0..000000000 --- a/boot/boot.c +++ /dev/null @@ -1,101 +0,0 @@ -#include "chip.h" -#include "boot.h" -#include "iap.h" - -int main (void) -{ - SystemCoreClockUpdate(); - - bool upgrade = FALSE; - uint32_t upgr_fw_id, user_fw_id; - - Chip_GPIO_Init(LPC_GPIO); - Chip_GPIO_SetPinDIROutput(LPC_GPIO, 1, 9); - - user_fw_id = *(uint32_t*)USER_FLASH_ID_ADDR; - upgr_fw_id = *(uint32_t*)UPGRADE_FLASH_ID_ADDR; - - //if(user_fw_id == 0xFFFFFFFF || ((upgr_fw_id != 0xFFFFFFFF) && (user_fw_id < upgr_fw_id))) { - if(upgr_fw_id != 0xFFFFFFFF) { - upgrade = TRUE; - Chip_GPIO_SetPinState(LPC_GPIO, 1, 9, 0 ); - } - - if (upgrade) { - update_firmware(); - } - - execute_user_code(); - - while (1); -} - -void program_page( uint32_t address, uint32_t * data, uint32_t size ) -{ - uint32_t sector_start = (address & 0xFF000) >> 12; - uint32_t sector_end = ((address+size) & 0xFF000) >> 12; - - if (size % 256) { - /* Data should be a 256 byte boundary */ - return; - } - - if (Chip_IAP_PreSectorForReadWrite( sector_start, sector_end ) != IAP_CMD_SUCCESS) { - return; - } - - Chip_IAP_CopyRamToFlash( address, data, size ); -} - -void erase_sector( uint32_t sector_start, uint32_t sector_end ) -{ - if (Chip_IAP_PreSectorForReadWrite( sector_start, sector_end ) != IAP_CMD_SUCCESS) { - return; - } - - Chip_IAP_EraseSector( sector_start, sector_end ); -} - -void execute_user_code( void ) -{ - USER_ENTRY_PFN user_entry; - - user_entry = (USER_ENTRY_PFN)*((uint32_t*)(USER_FLASH_START_ADDR +4)); - if (user_entry) { - (user_entry)(); - } -} - -void update_firmware( void ) -{ - uint32_t dst = USER_FLASH_START_ADDR; - uint32_t *src = (uint32_t *)UPGRADE_FLASH_START_ADDR; - - uint32_t page[64]; - - for(uint8_t j=0; j<(sizeof(page)/sizeof(uint32_t)); j++) { - page[j] = 0xFFFFFFFF; - } - - uint32_t fw_size = USER_FLASH_END_ADDR - USER_FLASH_START_ADDR; - uint32_t offset; - - - erase_sector( USER_FLASH_START_SECTOR , USER_FLASH_END_SECTOR ); - - for ( offset = 0; offset < fw_size; dst += sizeof(page)) { - /* Populate a page from source address */ - for (uint8_t i = 0; i MD5SUMS - sha1sum *.bin *.axf > SHA1SUMS - cd - -fi - -set +x diff --git a/ci_gen_doxy.sh b/ci_gen_doxy.sh deleted file mode 100755 index 2613872b7..000000000 --- a/ci_gen_doxy.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -# help debug -set -x -set -e -set -o - -if [ "${BUILD_ARTIFACT}" = "docs" ]; then - # remove build directories, as we can't - # use a file pattern in Doxyfile.dox file - # like */build*/* as travis seems to be - # expanding "*". This should be safe, as - # we only run this when BUILD_ARTIFACT is set - # to "docs" and not with "all_binaries", which - # is the release BUILD_ARTIFACT - rm -r $TRAVIS_BUILD_DIR/${BUILD_DIR}* - - # Now generate the documentation - cd $TRAVIS_BUILD_DIR/docs - doxygen Doxyfile.dox - echo "" > html/.nojekyll -fi diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 000000000..129d79880 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,14 @@ +FROM docker.io/debian:12 + +RUN apt-get update +RUN apt-get install -y \ + make \ + gcc-arm-none-eabi \ + libnewlib-arm-none-eabi \ + libstdc++-arm-none-eabi-dev \ + binutils-arm-none-eabi \ + cmake \ + doxygen \ + git \ + g++ +RUN arm-none-eabi-gcc -v diff --git a/docs/Doxyfile.dox b/docs/Doxyfile.dox index 75676db38..9c007a356 100644 --- a/docs/Doxyfile.dox +++ b/docs/Doxyfile.dox @@ -1,4 +1,4 @@ -# Doxyfile 1.8.13 +# Doxyfile 1.9.2 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -17,11 +17,11 @@ # Project related configuration options #--------------------------------------------------------------------------- -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = "openMMC" +PROJECT_NAME = openMMC # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version @@ -180,6 +180,16 @@ SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus @@ -200,6 +210,14 @@ QT_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. @@ -223,20 +241,19 @@ TAB_SIZE = 4 # the documentation. An alias has the form: # name=value # For example adding -# "sideeffect=@par Side Effects:\n" +# "sideeffect=@par Side Effects:^^" # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. +# "Side Effects:". Note that you cannot put \n's in the value part of an alias +# to insert newlines (in the resulting output). You can put ^^ in the value part +# of an alias to insert a newline as if a physical newline was in the original +# file. When you need a literal { or } or , in the value part of an alias you +# have to escape them by means of a backslash (\), this can lead to conflicts +# with the commands \{ and \} for these it is advised to use the version @{ and +# @} or use a double escape (\\{ and \\}) ALIASES = -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all @@ -265,28 +282,40 @@ OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_OUTPUT_VHDL = NO +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: -# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: -# Fortran. In the later case the parser tries to guess whether the code is fixed -# or free formatted code, this is the default for Fortran type files), VHDL. For -# instance to make doxygen treat .inc files as Fortran files (default is PHP), -# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice, +# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. # # Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. +# the files are not read by doxygen. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. +# documentation. See https://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. @@ -298,7 +327,7 @@ MARKDOWN_SUPPORT = YES # to that level are automatically included in the table of contents, even if # they do not have an id attribute. # Note: This feature currently applies only to Markdown headings. -# Minimum value: 0, maximum value: 99, default value: 0. +# Minimum value: 0, maximum value: 99, default value: 5. # This tag requires that the tag MARKDOWN_SUPPORT is set to YES. TOC_INCLUDE_HEADINGS = 0 @@ -328,7 +357,7 @@ BUILTIN_STL_SUPPORT = NO CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. @@ -414,6 +443,19 @@ TYPEDEF_HIDES_STRUCT = NO LOOKUP_CACHE_SIZE = 0 +# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which effectively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 1 + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- @@ -434,6 +476,12 @@ EXTRACT_ALL = YES EXTRACT_PRIVATE = NO +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. @@ -471,6 +519,13 @@ EXTRACT_LOCAL_METHODS = NO EXTRACT_ANON_NSPACES = NO +# If this flag is set to YES, the name of an unnamed parameter in a declaration +# will be determined by the corresponding definition. By default unnamed +# parameters remain unnamed in the output. +# The default value is: YES. + +RESOLVE_UNNAMED_PARAMS = YES + # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation @@ -488,8 +543,8 @@ HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO, these declarations will be -# included in the documentation. +# declarations. If set to NO, these declarations will be included in the +# documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO @@ -508,11 +563,18 @@ HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES, upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. +# With the correct setting of option CASE_SENSE_NAMES doxygen will better be +# able to match the capabilities of the underlying filesystem. In case the +# filesystem is case sensitive (i.e. it supports files in the same directory +# whose names only differ in casing), the option must be set to YES to properly +# deal with such files in case they appear in the input. For filesystems that +# are not case sensitive the option should be be set to NO to properly deal with +# output files written for symbols that only differ in casing, such as for two +# classes, one named CLASS and the other named Class, and to also support +# references to files without having to specify the exact matching casing. On +# Windows (including Cygwin) and MacOS, users should typically set this option +# to NO, whereas on Linux or other Unix flavors it should typically be set to +# YES. # The default value is: system dependent. CASE_SENSE_NAMES = YES @@ -531,6 +593,12 @@ HIDE_SCOPE_NAMES = NO HIDE_COMPOUND_REFERENCE= NO +# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class +# will show which file needs to be included to use the class. +# The default value is: YES. + +SHOW_HEADERFILE = YES + # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. @@ -688,7 +756,8 @@ FILE_VERSION_FILTER = # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. You can # optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. +# will be used as the name of the layout file. See also section "Changing the +# layout of pages" for information. # # Note that if you run doxygen from a directory containing a file called # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE @@ -699,7 +768,7 @@ LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. @@ -734,23 +803,35 @@ WARNINGS = YES WARN_IF_UNDOCUMENTED = YES # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some parameters -# in a documented function, or documenting parameters that don't exist or using -# markup commands wrongly. +# potential errors in the documentation, such as documenting some parameters in +# a documented function twice, or documenting parameters that don't exist or +# using markup commands wrongly. # The default value is: YES. WARN_IF_DOC_ERROR = YES +# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete +# function parameter documentation. If set to NO, doxygen will accept that some +# parameters have no documentation without warning. +# The default value is: YES. + +WARN_IF_INCOMPLETE_DOC = YES + # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return -# value. If set to NO, doxygen will only warn about wrong or incomplete -# parameter documentation, but not about the absence of documentation. +# value. If set to NO, doxygen will only warn about wrong parameter +# documentation, but not about the absence of documentation. If EXTRACT_ALL is +# set to YES then this flag will automatically be disabled. See also +# WARN_IF_INCOMPLETE_DOC # The default value is: NO. WARN_NO_PARAMDOC = NO # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when -# a warning is encountered. +# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS +# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but +# at the end of the doxygen process doxygen will return with a non-zero status. +# Possible values are: NO, YES and FAIL_ON_WARNINGS. # The default value is: NO. WARN_AS_ERROR = NO @@ -787,8 +868,8 @@ INPUT = . \ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of -# possible encodings. +# documentation (see: +# https://www.gnu.org/software/libiconv/) for the list of possible encodings. # The default value is: UTF-8. INPUT_ENCODING = UTF-8 @@ -801,11 +882,15 @@ INPUT_ENCODING = UTF-8 # need to set EXTENSION_MAPPING for the extension otherwise the files are not # read by doxygen. # +# Note the list of default checked file patterns might differ from the list of +# default file extension mappings. +# # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, -# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, -# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, -# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. +# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, +# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C +# comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, +# *.vhdl, *.ucf, *.qsf and *.ice. FILE_PATTERNS = @@ -962,7 +1047,7 @@ INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. +# entity all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO @@ -994,12 +1079,12 @@ SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version +# (see https://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # @@ -1021,25 +1106,6 @@ USE_HTAGS = NO VERBATIM_HEADERS = YES -# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the -# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the -# cost of reduced performance. This can be particularly helpful with template -# rich C++ code for which doxygen's built-in parser lacks the necessary type -# information. -# Note: The availability of this option depends on whether or not doxygen was -# generated with the -Duse-libclang=ON option for CMake. -# The default value is: NO. - -CLANG_ASSISTED_PARSING = NO - -# If clang assisted parsing is enabled you can provide the compiler with command -# line options that you would normally use when invoking the compiler. Note that -# the include paths will already be set by doxygen for the files and directories -# specified with INPUT and INCLUDE_PATH. -# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. - -CLANG_OPTIONS = - #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- @@ -1051,13 +1117,6 @@ CLANG_OPTIONS = ALPHABETICAL_INDEX = YES -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored @@ -1157,8 +1216,8 @@ HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to -# this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# this color. Hue is specified as an angle on a color-wheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. @@ -1167,7 +1226,7 @@ HTML_EXTRA_FILES = HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use grayscales only. A +# in the HTML output. For a value of 0 the output will use gray-scales only. A # value of 255 will produce the most vivid colors. # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1194,6 +1253,17 @@ HTML_COLORSTYLE_GAMMA = 80 HTML_TIMESTAMP = YES +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. @@ -1217,13 +1287,14 @@ HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in +# environment (see: +# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To +# create a documentation set, doxygen will generate a Makefile in the HTML +# output directory. Running make will produce the docset in that directory and +# running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1262,8 +1333,12 @@ DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. +# on Windows. In the beginning of 2021 Microsoft took the original page, with +# a.o. the download links, offline the HTML help workshop was already many years +# in maintenance mode). You can download the HTML help workshop from the web +# archives at Installation executable (see: +# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo +# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe). # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML @@ -1293,7 +1368,7 @@ CHM_FILE = HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated -# (YES) or that it should be included in the master .chm file (NO). +# (YES) or that it should be included in the main .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. @@ -1338,7 +1413,8 @@ QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1346,8 +1422,8 @@ QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1355,30 +1431,30 @@ QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. +# The QHG_LOCATION tag can be used to specify the location (absolute path +# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to +# run qhelpgenerator on the generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = @@ -1421,16 +1497,28 @@ DISABLE_INDEX = NO # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the # HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can -# further fine-tune the look of the index. As an example, the default style -# sheet generated by doxygen has an example that shows how to put an image at -# the root of the tree instead of the PROJECT_NAME. Since the tree basically has -# the same information as the tab index, you could consider setting -# DISABLE_INDEX to YES when enabling this option. +# further fine tune the look of the index (see "Fine-tuning the output"). As an +# example, the default style sheet generated by doxygen has an example that +# shows how to put an image at the root of the tree instead of the PROJECT_NAME. +# Since the tree basically has the same information as the tab index, you could +# consider setting DISABLE_INDEX to YES when enabling this option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_TREEVIEW = YES +# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the +# FULL_SIDEBAR option determines if the side bar is limited to only the treeview +# area (value NO) or if it should extend to the full height of the window (value +# YES). Setting this to YES gives a layout similar to +# https://docs.readthedocs.io with more room for contents, but less room for the +# project logo, title, and description. If either GENERATOR_TREEVIEW or +# DISABLE_INDEX is set to NO, this option has no effect. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FULL_SIDEBAR = NO + # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. # @@ -1455,6 +1543,17 @@ TREEVIEW_WIDTH = 250 EXT_LINKS_IN_WINDOW = NO +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML @@ -1464,7 +1563,7 @@ EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 -# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # @@ -1475,8 +1574,14 @@ FORMULA_FONTSIZE = 10 FORMULA_TRANSPARENT = YES +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering +# https://www.mathjax.org) which uses client side JavaScript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path @@ -1486,11 +1591,29 @@ FORMULA_TRANSPARENT = YES USE_MATHJAX = NO +# With MATHJAX_VERSION it is possible to specify the MathJax version to be used. +# Note that the different versions of MathJax have different requirements with +# regards to the different settings, so it is possible that also other MathJax +# settings have to be changed when switching between the different MathJax +# versions. +# Possible values are: MathJax_2 and MathJax_3. +# The default value is: MathJax_2. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_VERSION = MathJax_2 + # When MathJax is enabled you can set the default output format to be used for -# the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. +# the MathJax output. For more details about the output format see MathJax +# version 2 (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3 +# (see: +# http://docs.mathjax.org/en/latest/web/components/output.html). # Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. +# compatibility. This is the name for Mathjax version 2, for MathJax version 3 +# this will be translated into chtml), NativeMML (i.e. MathML. Only supported +# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This +# is the name for Mathjax version 3, for MathJax version 2 this will be +# translated into HTML-CSS) and SVG. # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1503,22 +1626,29 @@ MATHJAX_FORMAT = HTML-CSS # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. +# MathJax from https://www.mathjax.org before deployment. The default value is: +# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2 +# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3 # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example +# for MathJax version 2 (see +# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions): # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# For example for MathJax version 3 (see +# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html): +# MATHJAX_EXTENSIONS = ams # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1546,7 +1676,7 @@ MATHJAX_CODEFILE = SEARCHENGINE = YES # When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a web server instead of a web client using Javascript. There +# implemented using a web server instead of a web client using JavaScript. There # are two flavors of web server based searching depending on the EXTERNAL_SEARCH # setting. When disabled, doxygen will generate a PHP script for searching and # an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing @@ -1565,7 +1695,8 @@ SERVER_BASED_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). +# Xapian (see: +# https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1578,8 +1709,9 @@ EXTERNAL_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). See the section "External Indexing and -# Searching" for details. +# Xapian (see: +# https://xapian.org/). See the section "External Indexing and Searching" for +# details. # This tag requires that the tag SEARCHENGINE is set to YES. SEARCHENGINE_URL = @@ -1630,21 +1762,35 @@ LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. # -# Note that when enabling USE_PDFLATEX this option is only used for generating -# bitmaps for formulas in the HTML output, but not in the Makefile that is -# written to the output directory. -# The default file is: latex. +# Note that when not enabling USE_PDFLATEX the default is latex when enabling +# USE_PDFLATEX the default is pdflatex and when in the later case latex is +# chosen this is overwritten by pdflatex. For specific output languages the +# default can have been set differently, this depends on the implementation of +# the output language. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate # index for LaTeX. +# Note: This tag is used in the Makefile / make.bat. +# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file +# (.tex). # The default file is: makeindex. # This tag requires that the tag GENERATE_LATEX is set to YES. MAKEINDEX_CMD_NAME = makeindex +# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to +# generate index for LaTeX. In case there is no backslash (\) as first character +# it will be automatically added in the LaTeX code. +# Note: This tag is used in the generated output file (.tex). +# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat. +# The default value is: makeindex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_MAKEINDEX_CMD = makeindex + # If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX # documents. This may be useful for small projects and may help to save some # trees in general. @@ -1674,29 +1820,31 @@ PAPER_TYPE = a4 EXTRA_PACKAGES = -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the -# generated LaTeX document. The header should contain everything until the first -# chapter. If it is left blank doxygen will generate a standard header. See -# section "Doxygen usage" for information on how to let doxygen write the -# default header to a separate file. +# The LATEX_HEADER tag can be used to specify a user-defined LaTeX header for +# the generated LaTeX document. The header should contain everything until the +# first chapter. If it is left blank doxygen will generate a standard header. It +# is highly recommended to start with a default header using +# doxygen -w latex new_header.tex new_footer.tex new_stylesheet.sty +# and then modify the file new_header.tex. See also section "Doxygen usage" for +# information on how to generate the default header that doxygen normally uses. # -# Note: Only use a user-defined header if you know what you are doing! The -# following commands have a special meaning inside the header: $title, -# $datetime, $date, $doxygenversion, $projectname, $projectnumber, -# $projectbrief, $projectlogo. Doxygen will replace $title with the empty -# string, for the replacement values of the other commands the user is referred -# to HTML_HEADER. +# Note: Only use a user-defined header if you know what you are doing! +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. The following +# commands have a special meaning inside the header (and footer): For a +# description of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_HEADER = -# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the -# generated LaTeX document. The footer should contain everything after the last -# chapter. If it is left blank doxygen will generate a standard footer. See +# The LATEX_FOOTER tag can be used to specify a user-defined LaTeX footer for +# the generated LaTeX document. The footer should contain everything after the +# last chapter. If it is left blank doxygen will generate a standard footer. See # LATEX_HEADER for more information on how to generate a default footer and what -# special commands can be used inside the footer. -# -# Note: Only use a user-defined footer if you know what you are doing! +# special commands can be used inside the footer. See also section "Doxygen +# usage" for information on how to generate the default footer that doxygen +# normally uses. Note: Only use a user-defined footer if you know what you are +# doing! # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_FOOTER = @@ -1729,9 +1877,11 @@ LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES -# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate -# the PDF file directly from the LaTeX files. Set this option to YES, to get a -# higher quality PDF documentation. +# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as +# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX +# files. Set this option to YES, to get a higher quality PDF documentation. +# +# See also section LATEX_CMD_NAME for selecting the engine. # The default value is: YES. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1739,8 +1889,7 @@ USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode # command to the generated LaTeX files. This will instruct LaTeX to keep running -# if errors occur, instead of asking the user for help. This option is also used -# when generating formulas in HTML. +# if errors occur, instead of asking the user for help. # The default value is: NO. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1753,19 +1902,9 @@ LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO -# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source -# code with syntax highlighting in the LaTeX output. -# -# Note that which sources are shown also depends on other settings such as -# SOURCE_BROWSER. -# The default value is: NO. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_SOURCE_CODE = NO - # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See -# http://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# https://en.wikipedia.org/wiki/BibTeX and \cite for more info. # The default value is: plain. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1779,6 +1918,14 @@ LATEX_BIB_STYLE = plain LATEX_TIMESTAMP = NO +# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute) +# path from which the emoji images will be read. If a relative path is entered, +# it will be relative to the LATEX_OUTPUT directory. If left blank the +# LATEX_OUTPUT directory will be used. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EMOJI_DIRECTORY = + #--------------------------------------------------------------------------- # Configuration options related to the RTF output #--------------------------------------------------------------------------- @@ -1818,9 +1965,9 @@ COMPACT_RTF = NO RTF_HYPERLINKS = NO -# Load stylesheet definitions from file. Syntax is similar to doxygen's config -# file, i.e. a series of assignments. You only have to provide replacements, -# missing definitions are set to their default value. +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# configuration file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. # # See also section "Doxygen usage" for information on how to generate the # default style sheet that doxygen normally uses. @@ -1829,22 +1976,12 @@ RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is -# similar to doxygen's config file. A template extensions file can be generated -# using doxygen -e rtf extensionFile. +# similar to doxygen's configuration file. A template extensions file can be +# generated using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. RTF_EXTENSIONS_FILE = -# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code -# with syntax highlighting in the RTF output. -# -# Note that which sources are shown also depends on other settings such as -# SOURCE_BROWSER. -# The default value is: NO. -# This tag requires that the tag GENERATE_RTF is set to YES. - -RTF_SOURCE_CODE = NO - #--------------------------------------------------------------------------- # Configuration options related to the man page output #--------------------------------------------------------------------------- @@ -1916,6 +2053,13 @@ XML_OUTPUT = xml XML_PROGRAMLISTING = YES +# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include +# namespace members in file scope as well, matching the HTML output. +# The default value is: NO. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_NS_MEMB_FILE_SCOPE = NO + #--------------------------------------------------------------------------- # Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- @@ -1934,23 +2078,14 @@ GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook -# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the -# program listings (including syntax highlighting and cross-referencing -# information) to the DOCBOOK output. Note that enabling this will significantly -# increase the size of the DOCBOOK output. -# The default value is: NO. -# This tag requires that the tag GENERATE_DOCBOOK is set to YES. - -DOCBOOK_PROGRAMLISTING = NO - #--------------------------------------------------------------------------- # Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an -# AutoGen Definitions (see http://autogen.sf.net) file that captures the -# structure of the code including all documentation. Note that this feature is -# still experimental and incomplete at the moment. +# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures +# the structure of the code including all documentation. Note that this feature +# is still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO @@ -2117,12 +2252,6 @@ EXTERNAL_GROUPS = YES EXTERNAL_PAGES = YES -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of 'which perl'). -# The default file (with absolute path) is: /usr/bin/perl. - -PERL_PATH = /usr/bin/perl - #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- @@ -2136,15 +2265,6 @@ PERL_PATH = /usr/bin/perl CLASS_DIAGRAMS = YES -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see: -# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - # You can include diagrams made with dia in doxygen documentation. Doxygen will # then run dia to produce the diagram and insert it in the documentation. The # DIA_PATH tag allows you to specify the directory where the dia binary resides. @@ -2163,7 +2283,7 @@ HIDE_UNDOC_RELATIONS = YES # http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent # Bell Labs. The other options in this section have no effect if this option is # set to NO -# The default value is: YES. +# The default value is: NO. HAVE_DOT = YES @@ -2242,10 +2362,32 @@ UML_LOOK = NO # but if the number exceeds 15, the total amount of fields shown is limited to # 10. # Minimum value: 0, maximum value: 100, default value: 10. -# This tag requires that the tag HAVE_DOT is set to YES. +# This tag requires that the tag UML_LOOK is set to YES. UML_LIMIT_NUM_FIELDS = 10 +# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and +# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS +# tag is set to YES, doxygen will add type and arguments for attributes and +# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen +# will not generate fields with class member information in the UML graphs. The +# class diagrams will look similar to the default class diagrams but using UML +# notation for the relationships. +# Possible values are: NO, YES and NONE. +# The default value is: NO. +# This tag requires that the tag UML_LOOK is set to YES. + +DOT_UML_DETAILS = NO + +# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters +# to display on a single line. If the actual line length exceeds this threshold +# significantly it will wrapped across multiple lines. Some heuristics are apply +# to avoid ugly line breaks. +# Minimum value: 0, maximum value: 1000, default value: 17. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_WRAP_THRESHOLD = 17 + # If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and # collaboration graphs will show the relations between templates and their # instances. @@ -2319,9 +2461,7 @@ DIRECTORY_GRAPH = YES # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order # to make the SVG files visible in IE 9+ (other browsers do not have this # requirement). -# Possible values are: png, png:cairo, png:cairo:cairo, png:cairo:gd, png:gd, -# png:gd:gd, jpg, jpg:cairo, jpg:cairo:gd, jpg:gd, jpg:gd:gd, gif, gif:cairo, -# gif:cairo:gd, gif:gd, gif:gd:gd, svg, png:gd, png:gd:gd, png:cairo, +# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo, # png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and # png:gdiplus:gdiplus. # The default value is: png. @@ -2352,7 +2492,7 @@ DOT_PATH = # command). # This tag requires that the tag HAVE_DOT is set to YES. -DOTFILE_DIRS = +DOTFILE_DIRS = . # The MSCFILE_DIRS tag can be used to specify one or more directories that # contain msc files that are included in the documentation (see the \mscfile @@ -2437,9 +2577,11 @@ DOT_MULTI_TARGETS = YES GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot +# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate # files that are used to generate the various graphs. +# +# Note: This setting is not only used for dot files but also for msc temporary +# files. # The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. DOT_CLEANUP = YES diff --git a/docs/afc_i2c_buses.dox b/docs/afc_i2c_buses.dox new file mode 100644 index 000000000..0e73b5846 --- /dev/null +++ b/docs/afc_i2c_buses.dox @@ -0,0 +1,13 @@ +/** + * @page AFC_I2C AFC I2C Buses + * + * @tableofcontents + * + * @section AFCv3 + * \dotfile afcv3_i2c_hierarchy.dot "AFCv3.1 I2C Bus hierarchy" + * + * @section AFCv4 + * \dotfile afcv4_cpu_i2c_hierarchy.dot "AFCv4 LPC1768 I2C Bus hierarchy" + * + * \dotfile afcv4_fpga_i2c_hierarchy.dot "AFCv4 FPGA I2C Bus hierarchy" + */ diff --git a/docs/afcv3_i2c_hierarchy.dot b/docs/afcv3_i2c_hierarchy.dot new file mode 100644 index 000000000..899fb9adc --- /dev/null +++ b/docs/afcv3_i2c_hierarchy.dot @@ -0,0 +1,115 @@ +graph afcv3_i2c_hieranchy { + rankdir=LR + FPGA_I2C0 [label="FPGA I2C\n(SCL: IO_L6P_T0_35, SDA: IO_0_35)", shape=rectangle] + FPGA_I2C1 [label="FPGA I2C\n(SCL: IO_0_14, SDA: IO_25_14)", shape=rectangle] + LPC1764_I2C0 [label="LPC1764 I2C0\n(P0.27, P0.28)", shape=rectangle] + LPC1764_I2C1 [label="LPC1764 I2C1\n(P0.0, P0.1)", shape=rectangle] + LPC1764_I2C2 [label="LPC1764 I2C2\n(P0.10, P0.11)", shape=rectangle] + I2CMUX0 [label="I2CMUX0", shape=rectangle] + I2CMUX1 [label="I2CMUX1", shape=rectangle] + I2CMUX2 [label="I2CMUX2", shape=rectangle] + I2CMUX3 [label="I2CMUX3", shape=rectangle] + I2CMUX4 [label="I2CMUX4", shape=rectangle] + I2CMUX5 [label="I2CMUX5", shape=rectangle] + I2CMUX6 [label="I2CMUX6", shape=rectangle] + I2CMUX7 [label="I2CMUX7", shape=rectangle] + + subgraph cluster_i2c_mux { + label = "I2C Mux" + style = dashed + IC79 [label="PCA9547 (IC79) 0x70", shape=rectangle] + } + + subgraph cluster_temp_sensors { + label = "Temperature sensors" + style = dashed + IC30 [label="LM75 (IC30) 0x4C", shape=rectangle] + IC31 [label="LM75 (IC31) 0x4D", shape=rectangle] + IC32 [label="LM75 (IC32) 0x4E", shape=rectangle] + IC33 [label="LM75 (IC33) 0x4F", shape=rectangle] + IC18 [label="MAX6642 (IC18) 0x48", shape=rectangle] + } + + subgraph cluster_rtc { + label = "RTC" + style = dashed + IC9 [label="MCP79410 (IC9)\nEEPROM: 0x57, RTC: 0x6F", shape=rectangle] + } + + subgraph cluster_eeprom { + label = "EEPROM" + style = dashed + IC27 [label="AT24MAC602 (IC27)\nEEPROM: 0x50, SN: 0x58", shape=rectangle] + } + + subgraph cluster_vol_cur_monitor { + label = "Voltage and current monitoring" + style = dashed + IC59 [label="INA220 FMC2_P12V\n(IC59) 0x40", shape=rectangle] + IC60 [label="INA220 FMC2_PVADJ\n(IC60) 0x41", shape=rectangle] + IC61 [label="INA220 FMC1_P12V\n(IC61) 0x45", shape=rectangle] + IC19 [label="INA220 FMC1_PVADJ\n(IC19) 0x42", shape=rectangle] + IC20 [label="INA220 FMC2_P3V3\n(IC20) 0x43", shape=rectangle] + IC21 [label="INA220 FMC1_P3V3\n(IC21) 0x44", shape=rectangle] + } + + subgraph cluster_clk_sw { + label = "Clock switch" + style = dashed + IC8 [label="ADN4604 (IC8) 0x4B", shape=rectangle] + } + + RTM [label="RTM", shape=rectangle] + + subgraph cluster_fmc { + label = "FMC" + style = dashed + FMC2 [label="FMC2", shape=rectangle] + FMC1 [label="FMC1", shape=rectangle] + } + + OSC4 [label="SI57x (OSC4)", shape=rectangle] + IPMB [label="IPMB", shape=rectangle] + + LPC1764_I2C0 -- IPMB + + FPGA_I2C0 -- IC79 + LPC1764_I2C2 -- IC79 + IC79 -- I2CMUX0 + IC79 -- I2CMUX1 + IC79 -- I2CMUX2 + IC79 -- I2CMUX3 + IC79 -- I2CMUX4 + IC79 -- I2CMUX5 + IC79 -- I2CMUX6 + IC79 -- I2CMUX7 + + I2CMUX0 -- FMC1 + + I2CMUX1 -- FMC2 + + I2CMUX2 -- OSC4 + + I2CMUX3 -- RTM + + FPGA_I2C1 -- OSC4 + + LPC1764_I2C1 -- I2CMUX4 + + I2CMUX4 -- IC59 + I2CMUX4 -- IC60 + I2CMUX4 -- IC61 + I2CMUX4 -- IC19 + I2CMUX4 -- IC20 + I2CMUX4 -- IC21 + + I2CMUX4 -- IC30 + I2CMUX4 -- IC31 + I2CMUX4 -- IC32 + I2CMUX4 -- IC33 + I2CMUX4 -- IC18 + + I2CMUX4 -- IC9 + I2CMUX4 -- IC27 + I2CMUX4 -- IC8 +} diff --git a/docs/afcv4_cpu_i2c_hierarchy.dot b/docs/afcv4_cpu_i2c_hierarchy.dot new file mode 100644 index 000000000..7d94e2a72 --- /dev/null +++ b/docs/afcv4_cpu_i2c_hierarchy.dot @@ -0,0 +1,108 @@ +graph afcv4_i2c_hieranchy { + rankdir=LR + LPC1768_I2C0 [label="LPC1768 I2C0\n(P0.27, P0.28)", shape=rectangle] + LPC1768_I2C1 [label="LPC1768 I2C1\n(P0.0, P0.1)", shape=rectangle] + LPC1768_I2C2 [label="LPC1768 I2C2\n(P0.10, P0.11)", shape=rectangle] + I2CMUX0 [label="I2CMUX0", shape=rectangle] + I2CMUX1 [label="I2CMUX1", shape=rectangle] + I2CMUX2 [label="I2CMUX2", shape=rectangle] + I2CMUX3 [label="I2CMUX3", shape=rectangle] + I2CMUX4 [label="I2CMUX4", shape=rectangle] + I2CMUX5 [label="I2CMUX5", shape=rectangle] + I2CMUX6 [label="I2CMUX6", shape=rectangle] + I2CMUX7 [label="I2CMUX7", shape=rectangle] + IPMB [label="IPMB", shape=rectangle] + + subgraph cluster_i2c_mux { + label = "I2C Mux" + style = dashed + IC63 [label="TCA9548 (IC63) 0x71", shape=rectangle] + } + + subgraph cluster_io { + label = "I/O Expander" + style = dashed + IC66 [label="MCP23016 (IC66) 0x20", shape=rectangle] + } + + subgraph cluster_temp_sensors { + label = "Temperature sensors" + style = dashed + IC30 [label="LM75 (IC30) 0x4C", shape=rectangle] + IC31 [label="LM75 (IC31) 0x4D", shape=rectangle] + IC32 [label="LM75 (IC32) 0x4E", shape=rectangle] + IC33 [label="LM75 (IC33) 0x4F", shape=rectangle] + IC18 [label="MAX6642 (IC18) 0x48", shape=rectangle] + } + + subgraph cluster_rtc { + label = "RTC" + style = dashed + IC9 [label="MCP79410 (IC9)\nEEPROM: 0x57, RTC: 0x6F", shape=rectangle] + } + + subgraph cluster_eeprom { + label = "EEPROM" + style = dashed + IC27 [label="AT24MAC602 (IC27)\nEEPROM: 0x50, SN: 0x58", shape=rectangle] + IC71 [label="AT24C64D (IC71) 0x51", shape=rectangle] + } + + subgraph cluster_vol_cur_monitor { + label = "Voltage and current monitoring" + style = dashed + IC6 [label="INA3221 AMC_P12V RTM_P12V\n(IC6) 0x40", shape=rectangle] + IC7 [label="INA3221 FMC1_P3V3 FMC1_P12V\nFMC1_PVADJ (IC7) 0x41", shape=rectangle] + IC8 [label="INA3221 FMC2_P3V3 FMC2_P12V\nFMC2_PVADJ (IC8) 0x42", shape=rectangle] + } + + subgraph cluster_clk_sw { + label = "Clock switch" + style = dashed + IC73 [label="8V54816 (IC73) 0x5B", shape=rectangle] + } + + RTM [label="RTM", shape=rectangle] + + subgraph cluster_fmc { + label = "FMC" + style = dashed + FMC2 [label="FMC2", shape=rectangle] + FMC1 [label="FMC1", shape=rectangle] + } + LPC1768_I2C0 -- IPMB + + LPC1768_I2C1 -- IC63 + IC63 -- I2CMUX0 + IC63 -- I2CMUX1 + IC63 -- I2CMUX2 + IC63 -- I2CMUX3 + IC63 -- I2CMUX4 + IC63 -- I2CMUX5 + IC63 -- I2CMUX6 + IC63 -- I2CMUX7 + + I2CMUX0 -- IC30 + I2CMUX0 -- IC31 + I2CMUX0 -- IC32 + I2CMUX0 -- IC33 + I2CMUX0 -- IC18 + + I2CMUX1 -- IC9 + I2CMUX1 -- IC27 + I2CMUX1 -- IC71 + + I2CMUX3 -- IC6 + I2CMUX3 -- IC7 + I2CMUX3 -- IC8 + + I2CMUX4 -- IC73 + + I2CMUX5 -- RTM + + I2CMUX6 -- FMC2 + + I2CMUX7 -- FMC1 + + LPC1768_I2C2 -- IC66 +} diff --git a/docs/afcv4_fpga_i2c_hierarchy.dot b/docs/afcv4_fpga_i2c_hierarchy.dot new file mode 100644 index 000000000..1a5f210dd --- /dev/null +++ b/docs/afcv4_fpga_i2c_hierarchy.dot @@ -0,0 +1,104 @@ +graph afcv4_i2c_hieranchy { + rankdir=LR + FPGA_I2C0 [label="FPGA I2C\n(SCL: IO_L6P_T0_35, SDA: IO_0_35)", shape=rectangle] + FPGA_I2C1 [label="FPGA I2C\n(SCL: IO_0_14, SDA: IO_25_14)", shape=rectangle] + FPGA_I2C2 [label="FPGA I2C\n(SCL: IO_L17P_T2_32, SDA: IO_0_33)", shape=rectangle] + I2CMUX0 [label="I2CMUX0", shape=rectangle] + I2CMUX1 [label="I2CMUX1", shape=rectangle] + I2CMUX2 [label="I2CMUX2", shape=rectangle] + I2CMUX3 [label="I2CMUX3", shape=rectangle] + I2CMUX4 [label="I2CMUX4", shape=rectangle] + I2CMUX5 [label="I2CMUX5", shape=rectangle] + I2CMUX6 [label="I2CMUX6", shape=rectangle] + I2CMUX7 [label="I2CMUX7", shape=rectangle] + + subgraph cluster_i2c_mux { + label = "I2C Mux" + style = dashed + IC62 [label="TCA9548 (IC62) 0x70", shape=rectangle] + } + + subgraph cluster_temp_sensors { + label = "Temperature sensors" + style = dashed + IC30 [label="LM75 (IC30) 0x4C", shape=rectangle] + IC31 [label="LM75 (IC31) 0x4D", shape=rectangle] + IC32 [label="LM75 (IC32) 0x4E", shape=rectangle] + IC33 [label="LM75 (IC33) 0x4F", shape=rectangle] + IC18 [label="MAX6642 (IC18) 0x48", shape=rectangle] + } + + subgraph cluster_rtc { + label = "RTC" + style = dashed + IC9 [label="MCP79410 (IC9)\nEEPROM: 0x57, RTC: 0x6F", shape=rectangle] + } + + subgraph cluster_eeprom { + label = "EEPROM" + style = dashed + IC27 [label="AT24MAC602 (IC27)\nEEPROM: 0x50, SN: 0x58", shape=rectangle] + IC71 [label="AT24C64D (IC71) 0x51", shape=rectangle] + } + + subgraph cluster_vol_cur_monitor { + label = "Voltage and current monitoring" + style = dashed + IC6 [label="INA3221 AMC_P12V RTM_P12V\n(IC6) 0x40", shape=rectangle] + IC7 [label="INA3221 FMC1_P3V3 FMC1_P12V\nFMC1_PVADJ (IC7) 0x41", shape=rectangle] + IC8 [label="INA3221 FMC2_P3V3 FMC2_P12V\nFMC2_PVADJ (IC8) 0x42", shape=rectangle] + } + + subgraph cluster_clk_sw { + label = "Clock switch" + style = dashed + IC73 [label="8V54816 (IC73) 0x5B", shape=rectangle] + } + + RTM [label="RTM", shape=rectangle] + + subgraph cluster_fmc { + label = "FMC" + style = dashed + FMC2 [label="FMC2", shape=rectangle] + FMC1 [label="FMC1", shape=rectangle] + } + + OSC1 [label="SI57x (OSC1)", shape=rectangle] + OSC2 [label="SI57x (OSC2)", shape=rectangle] + + FPGA_I2C0 -- IC62 + IC62 -- I2CMUX0 + IC62 -- I2CMUX1 + IC62 -- I2CMUX2 + IC62 -- I2CMUX3 + IC62 -- I2CMUX4 + IC62 -- I2CMUX5 + IC62 -- I2CMUX6 + IC62 -- I2CMUX7 + + I2CMUX0 -- IC30 + I2CMUX0 -- IC31 + I2CMUX0 -- IC32 + I2CMUX0 -- IC33 + I2CMUX0 -- IC18 + + I2CMUX1 -- IC9 + I2CMUX1 -- IC27 + I2CMUX1 -- IC71 + + I2CMUX3 -- IC6 + I2CMUX3 -- IC7 + I2CMUX3 -- IC8 + + I2CMUX4 -- IC73 + + I2CMUX5 -- RTM + + I2CMUX6 -- FMC2 + + I2CMUX7 -- FMC1 + + FPGA_I2C1 -- OSC1 + FPGA_I2C2 -- OSC2 +} diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 42cf8ab9f..a79c739a1 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -8,6 +8,7 @@ set(PROJ_SRCS ${PROJ_SRCS} ${MODULE_PATH}/i2c.c) set(PROJ_SRCS ${PROJ_SRCS} ${MODULE_PATH}/led.c) set(PROJ_SRCS ${PROJ_SRCS} ${MODULE_PATH}/ipmb.c ${MODULE_PATH}/ipmi.c) set(PROJ_SRCS ${PROJ_SRCS} ${MODULE_PATH}/printf-stdarg.c) +set(PROJ_SRCS ${PROJ_SRCS} ${MODULE_PATH}/error.c) message(STATUS "Selected modules to compile: ${TARGET_MODULES}") @@ -66,7 +67,7 @@ endif() if (";${TARGET_MODULES};" MATCHES ";HPM;") set(PROJ_SRCS ${PROJ_SRCS} ${MODULE_PATH}/hpm.c ) set(MODULES_FLAGS "${MODULES_FLAGS} -DMODULE_HPM") - if (";${TARGET_MODULES};" MATCHES ";PAYLOAD;") + if (";${TARGET_MODULES};" MATCHES ";FLASH_SPI;") set(PROJ_SRCS ${PROJ_SRCS} ${MODULE_PATH}/flash_spi.c ) set(MODULES_FLAGS "${MODULES_FLAGS} -DMODULE_FLASH_SPI") endif() @@ -77,6 +78,31 @@ if (";${TARGET_MODULES};" MATCHES ";PCA9554;") set(MODULES_FLAGS "${MODULES_FLAGS} -DMODULE_PCA9554") endif() +if (";${TARGET_MODULES};" MATCHES ";CDCE906;") + set(PROJ_SRCS ${PROJ_SRCS} ${MODULE_PATH}/cdce906.c ) + set(MODULES_FLAGS "${MODULES_FLAGS} -DMODULE_CDCE906") +endif() + +if (";${TARGET_MODULES};" MATCHES ";SYSUTILS;") + set(PROJ_SRCS ${PROJ_SRCS} ${MODULE_PATH}/sys_utils.c ) + set(MODULES_FLAGS "${MODULES_FLAGS} -DMODULE_SYSUTILS") +endif() + +if (";${TARGET_MODULES};" MATCHES ";MCP23016;") + set(PROJ_SRCS ${PROJ_SRCS} ${MODULE_PATH}/mcp23016.c ) + set(MODULES_FLAGS "${MODULES_FLAGS} -DMODULE_MCP23016") +endif() + +if (";${TARGET_MODULES};" MATCHES ";IDT_8V54816;") + set(PROJ_SRCS ${PROJ_SRCS} ${MODULE_PATH}/idt_8v54816.c ) + set(MODULES_FLAGS "${MODULES_FLAGS} -DMODULE_IDT_8V54816") +endif() + +if (";${TARGET_MODULES};" MATCHES ";MAX116XX;") + set(PROJ_SRCS ${PROJ_SRCS} ${MODULE_PATH}/max116xx.c ) + set(MODULES_FLAGS "${MODULES_FLAGS} -DMODULE_MAX116XX") +endif() + if (";${TARGET_MODULES};" MATCHES ";RTM;") if (NOT BOARD_RTM) message( FATAL_ERROR "${BoldRed}RTM Module included but no RTM Board specified${ColourReset}") diff --git a/modules/GitSHA1.c.in b/modules/GitSHA1.c.in index 2e9940de5..ac0e33163 100644 --- a/modules/GitSHA1.c.in +++ b/modules/GitSHA1.c.in @@ -2,3 +2,46 @@ #define GIT_TAG "@GIT_TAG@" const char g_GIT_SHA1[] = GIT_SHA1; const char g_GIT_TAG[] = GIT_TAG; + +#include +#include +#include +#include "ipmi.h" + +static void hex_str_to_bin(const char* src, uint8_t* dest, size_t len) +{ + for (size_t i = 0; src[i] && ((i / 2) < len); i++) + { + char c = src[i]; + uint8_t nibble = 0; + if (c >= '0' && c <= '9') + { + nibble = c & 0x0F; + } + else if (c >= 'A' && c <= 'F') + { + nibble = c - 'A' + 0x0A; + } + else if (c >= 'a' && c <= 'f') + { + nibble = c - 'a' + 0x0A; + } + if ((i % 2) == 0) + { + dest[i / 2] &= 0x0F; + dest[i / 2] |= nibble << 4; + } + else + { + dest[i / 2] &= 0xF0; + dest[i / 2] |= nibble; + } + } +} + +IPMI_HANDLER(ipmi_custom_cmd_get_git_hash, NETFN_CUSTOM, IPMI_CUSTOM_CMD_GET_GIT_HASH, ipmi_msg *req, ipmi_msg *rsp) +{ + hex_str_to_bin(GIT_SHA1, rsp->data, 20); + rsp->data_len = 20; + rsp->completion_code = IPMI_CC_OK; +} diff --git a/modules/cdce906.c b/modules/cdce906.c new file mode 100644 index 000000000..a1fe628be --- /dev/null +++ b/modules/cdce906.c @@ -0,0 +1,696 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2021 Augusto Fraga Giachero + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +/** + * @file cdce906.c + * @author Augusto Fraga Giachero + * + * @brief CDCE906 PLL driver functions + * + * @ingroup CDCE906 + */ + +/* FreeRTOS includes */ +#include "FreeRTOS.h" + +/* Project Includes */ +#include "port.h" +#include "cdce906.h" +#include "cdce906_reg.h" +#include "i2c.h" + +static inline void cdce906_get_ssc(cdce906_cfg* cfg, const uint8_t* buff) +{ + uint8_t reg; + + reg = (buff[CDCE906_SSC_MOD_SEL_BYTE] & CDCE906_SSC_MOD_SEL_MASK) >> + CDCE906_SSC_MOD_SEL_SHIFT; + cfg->ssc_mod_amount = (enum cdce906_ssc_mod_amount)reg; + + reg = (buff[CDCE906_SSC_FREQ_SEL_BYTE] & CDCE906_SSC_FREQ_SEL_MASK) >> + CDCE906_SSC_FREQ_SEL_SHIFT; + cfg->ssc_mod_freq = (enum cdce906_ssc_mod_freq)reg; +} + +static inline void cdce906_set_ssc(const cdce906_cfg* cfg, uint8_t* buff) +{ + uint8_t reg; + + reg = (uint8_t)cfg->ssc_mod_amount << CDCE906_SSC_MOD_SEL_SHIFT; + buff[CDCE906_SSC_MOD_SEL_BYTE] |= reg; + + reg = (uint8_t)cfg->ssc_mod_freq << CDCE906_SSC_FREQ_SEL_SHIFT; + buff[CDCE906_SSC_FREQ_SEL_BYTE] |= reg; +} + +static inline void cdce906_get_pll_fvco(cdce906_cfg* cfg, const uint8_t* buff) +{ + if (buff[CDCE906_PLL1_FVCO_BYTE] & CDCE906_PLL1_FVCO_MASK) { + cfg->pll_fvco[0] = CDCE906_PLL_FVCO_180_300MHZ; + } else { + cfg->pll_fvco[0] = CDCE906_PLL_FVCO_80_200MHZ; + } + + if (buff[CDCE906_PLL2_FVCO_BYTE] & CDCE906_PLL2_FVCO_MASK) { + cfg->pll_fvco[1] = CDCE906_PLL_FVCO_180_300MHZ; + } else { + cfg->pll_fvco[1] = CDCE906_PLL_FVCO_80_200MHZ; + } + + if (buff[CDCE906_PLL3_FVCO_BYTE] & CDCE906_PLL3_FVCO_MASK) { + cfg->pll_fvco[2] = CDCE906_PLL_FVCO_180_300MHZ; + } else { + cfg->pll_fvco[2] = CDCE906_PLL_FVCO_80_200MHZ; + } +} + +static inline void cdce906_set_pll_fvco(const cdce906_cfg* cfg, uint8_t* buff) +{ + if (cfg->pll_fvco[0] == CDCE906_PLL_FVCO_180_300MHZ) { + buff[CDCE906_PLL1_FVCO_BYTE] |= CDCE906_PLL1_FVCO_MASK; + } + + if (cfg->pll_fvco[1] == CDCE906_PLL_FVCO_180_300MHZ) { + buff[CDCE906_PLL2_FVCO_BYTE] |= CDCE906_PLL2_FVCO_MASK; + } + + if (cfg->pll_fvco[2] == CDCE906_PLL_FVCO_180_300MHZ) { + buff[CDCE906_PLL3_FVCO_BYTE] |= CDCE906_PLL3_FVCO_MASK; + } +} + +static inline void cdce906_get_pll_mux(cdce906_cfg* cfg, const uint8_t* buff) +{ + if (buff[CDCE906_PLL1_VCO_MUX_BYTE] & CDCE906_PLL1_VCO_MUX_MASK) { + cfg->pll_vco_mux[0] = CDCE906_PLL_VCO_MUX_VCO; + } else { + cfg->pll_vco_mux[0] = CDCE906_PLL_VCO_MUX_PLL; + } + + if (buff[CDCE906_PLL2_VCO_MUX_BYTE] & CDCE906_PLL2_VCO_MUX_MASK) { + cfg->pll_vco_mux[1] = CDCE906_PLL_VCO_MUX_VCO; + } else { + cfg->pll_vco_mux[1] = CDCE906_PLL_VCO_MUX_PLL; + } + + if (buff[CDCE906_PLL3_VCO_MUX_BYTE] & CDCE906_PLL3_VCO_MUX_MASK) { + cfg->pll_vco_mux[2] = CDCE906_PLL_VCO_MUX_VCO; + } else { + cfg->pll_vco_mux[2] = CDCE906_PLL_VCO_MUX_PLL; + } +} + +static inline void cdce906_set_pll_mux(const cdce906_cfg* cfg, uint8_t* buff) +{ + if (cfg->pll_vco_mux[0] == CDCE906_PLL_VCO_MUX_VCO) { + buff[CDCE906_PLL1_VCO_MUX_BYTE] |= CDCE906_PLL1_VCO_MUX_MASK; + } + + if (cfg->pll_vco_mux[1] == CDCE906_PLL_VCO_MUX_VCO) { + buff[CDCE906_PLL2_VCO_MUX_BYTE] |= CDCE906_PLL2_VCO_MUX_MASK; + } + + if (cfg->pll_vco_mux[2] == CDCE906_PLL_VCO_MUX_VCO) { + buff[CDCE906_PLL3_VCO_MUX_BYTE] |= CDCE906_PLL3_VCO_MUX_MASK; + } +} + +static inline void cdce906_get_clksrc(cdce906_cfg* cfg, const uint8_t* buff) +{ + switch(buff[CDCE906_CLKIN_SRC_BYTE] & CDCE906_CLKIN_SRC_MASK) + { + case 0: + cfg->clksrc = CDCE906_CLK_SRC_CRYSTAL; + break; + + case 1 << CDCE906_CLKIN_SRC_SHIFT: + if (buff[CDCE906_CLKSEL_BYTE] & CDCE906_CLKSEL_MASK) { + cfg->clksrc = CDCE906_CLK_SRC_CLKIN1_LVCMOS; + } else { + cfg->clksrc = CDCE906_CLK_SRC_CLKIN0_LVCMOS; + } + break; + + case 2 << CDCE906_CLKIN_SRC_SHIFT: + cfg->clksrc = CDCE906_CLK_SRC_CLKIN_DIFF; + break; + + default: + cfg->clksrc = CDCE906_CLK_SRC_INVALID; + break; + } +} + +static inline void cdce906_set_clksrc(const cdce906_cfg* cfg, uint8_t* buff) +{ + switch(cfg->clksrc) + { + case CDCE906_CLK_SRC_CRYSTAL: + break; + + case CDCE906_CLK_SRC_CLKIN0_LVCMOS: + buff[CDCE906_CLKIN_SRC_BYTE] |= 1 << CDCE906_CLKIN_SRC_SHIFT; + break; + + case CDCE906_CLK_SRC_CLKIN1_LVCMOS: + buff[CDCE906_CLKIN_SRC_BYTE] |= 1 << CDCE906_CLKIN_SRC_SHIFT; + buff[CDCE906_CLKSEL_BYTE] |= CDCE906_CLKSEL_MASK; + break; + + case CDCE906_CLK_SRC_CLKIN_DIFF: + buff[CDCE906_CLKIN_SRC_BYTE] |= 2 << CDCE906_CLKIN_SRC_SHIFT; + break; + + default: + break; + } +} + +static inline void cdce906_get_px_pll_sel(cdce906_cfg* cfg, const uint8_t* buff) +{ + uint8_t px_sel_val[6]; + + px_sel_val[0] = (buff[CDCE906_P0_SW_A_BYTE] & CDCE906_P0_SW_A_MASK) >> CDCE906_P0_SW_A_SHIFT; + px_sel_val[1] = (buff[CDCE906_P1_SW_A_BYTE] & CDCE906_P1_SW_A_MASK) >> CDCE906_P1_SW_A_SHIFT; + px_sel_val[2] = (buff[CDCE906_P2_SW_A_BYTE] & CDCE906_P2_SW_A_MASK) >> CDCE906_P2_SW_A_SHIFT; + px_sel_val[3] = (buff[CDCE906_P3_SW_A_BYTE] & CDCE906_P3_SW_A_MASK) >> CDCE906_P3_SW_A_SHIFT; + px_sel_val[4] = (buff[CDCE906_P4_SW_A_BYTE] & CDCE906_P4_SW_A_MASK) >> CDCE906_P4_SW_A_SHIFT; + px_sel_val[5] = (buff[CDCE906_P5_SW_A_BYTE] & CDCE906_P5_SW_A_MASK) >> CDCE906_P5_SW_A_SHIFT; + + for (int i = 0; i < 6; i++) { + switch(px_sel_val[i]) { + case 0: + cfg->pll_sel[i] = CDCE906_Px_PLL_SEL_BYPASS; + break; + + case 1: + cfg->pll_sel[i] = CDCE906_Px_PLL_SEL_PLL1; + break; + + case 2: + cfg->pll_sel[i] = CDCE906_Px_PLL_SEL_PLL2; + break; + + case 3: + cfg->pll_sel[i] = CDCE906_Px_PLL_SEL_PLL2_SSC; + break; + + case 4: + cfg->pll_sel[i] = CDCE906_Px_PLL_SEL_PLL3; + break; + + default: + cfg->pll_sel[i] = CDCE906_Px_PLL_SEL_INVALID; + break; + } + } +} + +static inline void cdce906_set_px_pll_sel(const cdce906_cfg* cfg, uint8_t* buff) +{ + const uint8_t px_byte[] = {CDCE906_P0_SW_A_BYTE, CDCE906_P1_SW_A_BYTE, CDCE906_P2_SW_A_BYTE, + CDCE906_P3_SW_A_BYTE, CDCE906_P4_SW_A_BYTE, CDCE906_P5_SW_A_BYTE}; + const uint8_t px_shift[] = {CDCE906_P0_SW_A_SHIFT, CDCE906_P1_SW_A_SHIFT, CDCE906_P2_SW_A_SHIFT, + CDCE906_P3_SW_A_SHIFT, CDCE906_P4_SW_A_SHIFT, CDCE906_P5_SW_A_SHIFT}; + + for (int i = 0; i < 6; i++) { + switch(cfg->pll_sel[i]) { + case CDCE906_Px_PLL_SEL_BYPASS: + break; + + case CDCE906_Px_PLL_SEL_PLL1: + buff[px_byte[i]] |= 1 << px_shift[i]; + break; + + case CDCE906_Px_PLL_SEL_PLL2: + buff[px_byte[i]] |= 2 << px_shift[i]; + break; + + case CDCE906_Px_PLL_SEL_PLL2_SSC: + buff[px_byte[i]] |= 3 << px_shift[i]; + break; + + case CDCE906_Px_PLL_SEL_PLL3: + buff[px_byte[i]] |= 4 << px_shift[i]; + break; + + default: + break; + } + } +} + +static inline void cdce906_set_pll_div(const cdce906_cfg* cfg, uint8_t* buff) +{ + const uint8_t div_m_low_byte[] = {CDCE906_PLL1_REF_DIV_M_LOW_BYTE, CDCE906_PLL2_REF_DIV_M_LOW_BYTE, + CDCE906_PLL3_REF_DIV_M_LOW_BYTE}; + const uint8_t div_m_high_byte[] = {CDCE906_PLL1_REF_DIV_M_HIGH_BYTE, CDCE906_PLL2_REF_DIV_M_HIGH_BYTE, + CDCE906_PLL3_REF_DIV_M_HIGH_BYTE}; + const uint8_t div_m_low_shift[] = {CDCE906_PLL1_REF_DIV_M_LOW_SHIFT, CDCE906_PLL2_REF_DIV_M_LOW_SHIFT, + CDCE906_PLL3_REF_DIV_M_LOW_SHIFT}; + const uint8_t div_m_high_shift[] = {CDCE906_PLL1_REF_DIV_M_HIGH_SHIFT, CDCE906_PLL2_REF_DIV_M_HIGH_SHIFT, + CDCE906_PLL3_REF_DIV_M_HIGH_SHIFT}; + const uint8_t div_m_low_mask[] = {CDCE906_PLL1_REF_DIV_M_LOW_MASK, CDCE906_PLL2_REF_DIV_M_LOW_MASK, + CDCE906_PLL3_REF_DIV_M_LOW_MASK}; + const uint8_t div_m_high_mask[] = {CDCE906_PLL1_REF_DIV_M_HIGH_MASK, CDCE906_PLL2_REF_DIV_M_HIGH_MASK, + CDCE906_PLL3_REF_DIV_M_HIGH_MASK}; + const uint8_t div_n_low_byte[] = {CDCE906_PLL1_REF_DIV_N_LOW_BYTE, CDCE906_PLL2_REF_DIV_N_LOW_BYTE, + CDCE906_PLL3_REF_DIV_N_LOW_BYTE}; + const uint8_t div_n_high_byte[] = {CDCE906_PLL1_REF_DIV_N_HIGH_BYTE, CDCE906_PLL2_REF_DIV_N_HIGH_BYTE, + CDCE906_PLL3_REF_DIV_N_HIGH_BYTE}; + const uint8_t div_n_low_shift[] = {CDCE906_PLL1_REF_DIV_N_LOW_SHIFT, CDCE906_PLL2_REF_DIV_N_LOW_SHIFT, + CDCE906_PLL3_REF_DIV_N_LOW_SHIFT}; + const uint8_t div_n_high_shift[] = {CDCE906_PLL1_REF_DIV_N_HIGH_SHIFT, CDCE906_PLL2_REF_DIV_N_HIGH_SHIFT, + CDCE906_PLL3_REF_DIV_N_HIGH_SHIFT}; + const uint8_t div_n_low_mask[] = {CDCE906_PLL1_REF_DIV_N_LOW_MASK, CDCE906_PLL2_REF_DIV_N_LOW_MASK, + CDCE906_PLL3_REF_DIV_N_LOW_MASK}; + const uint8_t div_n_high_mask[] = {CDCE906_PLL1_REF_DIV_N_HIGH_MASK, CDCE906_PLL2_REF_DIV_N_HIGH_MASK, + CDCE906_PLL3_REF_DIV_N_HIGH_MASK}; + + for (int i = 0; i < 3; i++) { + uint8_t div_m_low = cfg->pll_div_m[i] & 0xFF; + uint8_t div_n_low = cfg->pll_div_n[i] & 0xFF; + uint8_t div_m_high = (cfg->pll_div_m[i] & 0x100) >> 8; + uint8_t div_n_high = (cfg->pll_div_n[i] & 0xF00) >> 8; + buff[div_m_low_byte[i]] |= (div_m_low << div_m_low_shift[i]) & div_m_low_mask[i]; + buff[div_m_high_byte[i]] |= (div_m_high << div_m_high_shift[i]) & div_m_high_mask[i]; + buff[div_n_low_byte[i]] |= (div_n_low << div_n_low_shift[i]) & div_n_low_mask[i]; + buff[div_n_high_byte[i]] |= (div_n_high << div_n_high_shift[i]) & div_n_high_mask[i]; + } +} + +static inline void cdce906_get_pll_div(cdce906_cfg* cfg, const uint8_t* buff) +{ + const uint8_t div_m_low_byte[] = {CDCE906_PLL1_REF_DIV_M_LOW_BYTE, CDCE906_PLL2_REF_DIV_M_LOW_BYTE, + CDCE906_PLL3_REF_DIV_M_LOW_BYTE}; + const uint8_t div_m_high_byte[] = {CDCE906_PLL1_REF_DIV_M_HIGH_BYTE, CDCE906_PLL2_REF_DIV_M_HIGH_BYTE, + CDCE906_PLL3_REF_DIV_M_HIGH_BYTE}; + const uint8_t div_m_high_shift[] = {CDCE906_PLL1_REF_DIV_M_HIGH_SHIFT, CDCE906_PLL2_REF_DIV_M_HIGH_SHIFT, + CDCE906_PLL3_REF_DIV_M_HIGH_SHIFT}; + const uint8_t div_m_low_mask[] = {CDCE906_PLL1_REF_DIV_M_LOW_MASK, CDCE906_PLL2_REF_DIV_M_LOW_MASK, + CDCE906_PLL3_REF_DIV_M_LOW_MASK}; + const uint8_t div_m_high_mask[] = {CDCE906_PLL1_REF_DIV_M_HIGH_MASK, CDCE906_PLL2_REF_DIV_M_HIGH_MASK, + CDCE906_PLL3_REF_DIV_M_HIGH_MASK}; + const uint8_t div_n_low_byte[] = {CDCE906_PLL1_REF_DIV_N_LOW_BYTE, CDCE906_PLL2_REF_DIV_N_LOW_BYTE, + CDCE906_PLL3_REF_DIV_N_LOW_BYTE}; + const uint8_t div_n_high_byte[] = {CDCE906_PLL1_REF_DIV_N_HIGH_BYTE, CDCE906_PLL2_REF_DIV_N_HIGH_BYTE, + CDCE906_PLL3_REF_DIV_N_HIGH_BYTE}; + const uint8_t div_n_high_shift[] = {CDCE906_PLL1_REF_DIV_N_HIGH_SHIFT, CDCE906_PLL2_REF_DIV_N_HIGH_SHIFT, + CDCE906_PLL3_REF_DIV_N_HIGH_SHIFT}; + const uint8_t div_n_low_mask[] = {CDCE906_PLL1_REF_DIV_N_LOW_MASK, CDCE906_PLL2_REF_DIV_N_LOW_MASK, + CDCE906_PLL3_REF_DIV_N_LOW_MASK}; + const uint8_t div_n_high_mask[] = {CDCE906_PLL1_REF_DIV_N_HIGH_MASK, CDCE906_PLL2_REF_DIV_N_HIGH_MASK, + CDCE906_PLL3_REF_DIV_N_HIGH_MASK}; + + for (int i = 0; i < 3; i++) { + cfg->pll_div_m[i] = (buff[div_m_low_byte[i]] & div_m_low_mask[i]) | + ((buff[div_m_high_byte[i]] & div_m_high_mask[i]) << (8 - div_m_high_shift[i])); + cfg->pll_div_n[i] = (buff[div_n_low_byte[i]] & div_n_low_mask[i]) | + ((buff[div_n_high_byte[i]] & div_n_high_mask[i]) << (8 - div_n_high_shift[i])); + } +} + +static inline void cdce906_set_yx_px_sel(const cdce906_cfg* cfg, uint8_t* buff) +{ + const uint8_t yx_byte[] = {CDCE906_Y0_SW_B_BYTE, CDCE906_Y1_SW_B_BYTE, CDCE906_Y2_SW_B_BYTE, + CDCE906_Y3_SW_B_BYTE, CDCE906_Y4_SW_B_BYTE, CDCE906_Y5_SW_B_BYTE}; + const uint8_t yx_shift[] = {CDCE906_Y0_SW_B_SHIFT, CDCE906_Y1_SW_B_SHIFT, CDCE906_Y2_SW_B_SHIFT, + CDCE906_Y3_SW_B_SHIFT, CDCE906_Y4_SW_B_SHIFT, CDCE906_Y5_SW_B_SHIFT}; + + for (int i = 0; i < 6; i++) { + switch(cfg->y_p_sel[i]) { + case CDCE906_Yx_Px_SEL_P0: + break; + + case CDCE906_Yx_Px_SEL_P1: + buff[yx_byte[i]] |= 1 << yx_shift[i]; + break; + + case CDCE906_Yx_Px_SEL_P2: + buff[yx_byte[i]] |= 2 << yx_shift[i]; + break; + + case CDCE906_Yx_Px_SEL_P3: + buff[yx_byte[i]] |= 3 << yx_shift[i]; + break; + + case CDCE906_Yx_Px_SEL_P4: + buff[yx_byte[i]] |= 4 << yx_shift[i]; + break; + + case CDCE906_Yx_Px_SEL_P5: + buff[yx_byte[i]] |= 5 << yx_shift[i]; + break; + + default: + break; + } + } +} + +static inline void cdce906_get_yx_px_sel(cdce906_cfg* cfg, const uint8_t* buff) +{ + uint8_t yx_sel_val[6]; + + yx_sel_val[0] = (buff[CDCE906_Y0_SW_B_BYTE] & CDCE906_Y0_SW_B_MASK) >> CDCE906_Y0_SW_B_SHIFT; + yx_sel_val[1] = (buff[CDCE906_Y1_SW_B_BYTE] & CDCE906_Y1_SW_B_MASK) >> CDCE906_Y1_SW_B_SHIFT; + yx_sel_val[2] = (buff[CDCE906_Y2_SW_B_BYTE] & CDCE906_Y2_SW_B_MASK) >> CDCE906_Y2_SW_B_SHIFT; + yx_sel_val[3] = (buff[CDCE906_Y3_SW_B_BYTE] & CDCE906_Y3_SW_B_MASK) >> CDCE906_Y3_SW_B_SHIFT; + yx_sel_val[4] = (buff[CDCE906_Y4_SW_B_BYTE] & CDCE906_Y4_SW_B_MASK) >> CDCE906_Y4_SW_B_SHIFT; + yx_sel_val[5] = (buff[CDCE906_Y5_SW_B_BYTE] & CDCE906_Y5_SW_B_MASK) >> CDCE906_Y5_SW_B_SHIFT; + + for (int i = 0; i < 6; i++) { + switch(yx_sel_val[i]) { + case 0: + cfg->y_p_sel[i] = CDCE906_Yx_Px_SEL_P0; + break; + + case 1: + cfg->y_p_sel[i] = CDCE906_Yx_Px_SEL_P1; + break; + + case 2: + cfg->y_p_sel[i] = CDCE906_Yx_Px_SEL_P2; + break; + + case 3: + cfg->y_p_sel[i] = CDCE906_Yx_Px_SEL_P3; + break; + + case 4: + cfg->y_p_sel[i] = CDCE906_Yx_Px_SEL_P4; + break; + + case 5: + cfg->y_p_sel[i] = CDCE906_Yx_Px_SEL_P5; + break; + + default: + cfg->y_p_sel[i] = CDCE906_Yx_Px_SEL_INVALID; + break; + } + } +} + +static inline void cdce906_set_yx_slew(const cdce906_cfg* cfg, uint8_t* buff) +{ + const uint8_t yx_byte[] = {CDCE906_Y0_SLEW_RATE_BYTE, CDCE906_Y1_SLEW_RATE_BYTE, + CDCE906_Y2_SLEW_RATE_BYTE, CDCE906_Y3_SLEW_RATE_BYTE, + CDCE906_Y4_SLEW_RATE_BYTE, CDCE906_Y5_SLEW_RATE_BYTE}; + const uint8_t yx_shift[] = {CDCE906_Y0_SLEW_RATE_SHIFT, CDCE906_Y1_SLEW_RATE_SHIFT, + CDCE906_Y2_SLEW_RATE_SHIFT, CDCE906_Y3_SLEW_RATE_SHIFT, + CDCE906_Y4_SLEW_RATE_SHIFT, CDCE906_Y5_SLEW_RATE_SHIFT}; + + for (int i = 0; i < 6; i++) { + switch(cfg->y_slew[i]) { + case CDCE906_Yx_SLEW_CFG_NOMINAL: + buff[yx_byte[i]] |= 3 << yx_shift[i]; + break; + + case CDCE906_Yx_SLEW_CFG_NOMINAL_1NS: + buff[yx_byte[i]] |= 2 << yx_shift[i]; + break; + + case CDCE906_Yx_SLEW_CFG_NOMINAL_2NS: + buff[yx_byte[i]] |= 1 << yx_shift[i]; + break; + + case CDCE906_Yx_SLEW_CFG_NOMINAL_3NS: + break; + + default: + break; + } + } +} + +static inline void cdce906_get_yx_slew(cdce906_cfg* cfg, const uint8_t* buff) +{ + uint8_t yx_slew[6]; + + yx_slew[0] = (buff[CDCE906_Y0_SLEW_RATE_BYTE] & CDCE906_Y0_SLEW_RATE_MASK) >> CDCE906_Y0_SLEW_RATE_SHIFT; + yx_slew[1] = (buff[CDCE906_Y1_SLEW_RATE_BYTE] & CDCE906_Y1_SLEW_RATE_MASK) >> CDCE906_Y1_SLEW_RATE_SHIFT; + yx_slew[2] = (buff[CDCE906_Y2_SLEW_RATE_BYTE] & CDCE906_Y2_SLEW_RATE_MASK) >> CDCE906_Y2_SLEW_RATE_SHIFT; + yx_slew[3] = (buff[CDCE906_Y3_SLEW_RATE_BYTE] & CDCE906_Y3_SLEW_RATE_MASK) >> CDCE906_Y3_SLEW_RATE_SHIFT; + yx_slew[4] = (buff[CDCE906_Y4_SLEW_RATE_BYTE] & CDCE906_Y4_SLEW_RATE_MASK) >> CDCE906_Y4_SLEW_RATE_SHIFT; + yx_slew[5] = (buff[CDCE906_Y5_SLEW_RATE_BYTE] & CDCE906_Y5_SLEW_RATE_MASK) >> CDCE906_Y5_SLEW_RATE_SHIFT; + + for (int i = 0; i < 6; i++) { + switch(yx_slew[i]) { + case 0: + cfg->y_slew[i] = CDCE906_Yx_SLEW_CFG_NOMINAL_3NS; + break; + + case 1: + cfg->y_slew[i] = CDCE906_Yx_SLEW_CFG_NOMINAL_2NS; + break; + + case 2: + cfg->y_slew[i] = CDCE906_Yx_SLEW_CFG_NOMINAL_1NS; + break; + + case 3: + cfg->y_slew[i] = CDCE906_Yx_SLEW_CFG_NOMINAL; + break; + + default: + break; + } + } +} + +static inline void cdce906_set_px_div(const cdce906_cfg* cfg, uint8_t* buff) +{ + const uint8_t px_byte[] = {CDCE906_P0_DIV_BYTE, CDCE906_P1_DIV_BYTE, CDCE906_P2_DIV_BYTE, + CDCE906_P3_DIV_BYTE, CDCE906_P4_DIV_BYTE, CDCE906_P5_DIV_BYTE}; + const uint8_t px_shift[] = {CDCE906_P0_DIV_SHIFT, CDCE906_P1_DIV_SHIFT, CDCE906_P2_DIV_SHIFT, + CDCE906_P3_DIV_SHIFT, CDCE906_P4_DIV_SHIFT, CDCE906_P5_DIV_SHIFT}; + const uint8_t px_mask[] = {CDCE906_P0_DIV_MASK, CDCE906_P1_DIV_MASK, CDCE906_P2_DIV_MASK, + CDCE906_P3_DIV_MASK, CDCE906_P4_DIV_MASK, CDCE906_P5_DIV_MASK}; + + for (int i = 0; i < 6; i++) { + buff[px_byte[i]] |= (cfg->p_div[i] << px_shift[i]) & px_mask[i]; + } +} + +static inline void cdce906_get_px_div(cdce906_cfg* cfg, const uint8_t* buff) +{ + const uint8_t px_byte[] = {CDCE906_P0_DIV_BYTE, CDCE906_P1_DIV_BYTE, CDCE906_P2_DIV_BYTE, + CDCE906_P3_DIV_BYTE, CDCE906_P4_DIV_BYTE, CDCE906_P5_DIV_BYTE}; + const uint8_t px_shift[] = {CDCE906_P0_DIV_SHIFT, CDCE906_P1_DIV_SHIFT, CDCE906_P2_DIV_SHIFT, + CDCE906_P3_DIV_SHIFT, CDCE906_P4_DIV_SHIFT, CDCE906_P5_DIV_SHIFT}; + const uint8_t px_mask[] = {CDCE906_P0_DIV_MASK, CDCE906_P1_DIV_MASK, CDCE906_P2_DIV_MASK, + CDCE906_P3_DIV_MASK, CDCE906_P4_DIV_MASK, CDCE906_P5_DIV_MASK}; + + for (int i = 0; i < 6; i++) { + cfg->p_div[i] = (buff[px_byte[i]] & px_mask[i]) >> px_shift[i]; + } +} + +static inline void cdce906_set_yx_out_cfg(const cdce906_cfg* cfg, uint8_t* buff) +{ + const uint8_t yx_en_byte[] = {CDCE906_Y0_EN_BYTE, CDCE906_Y1_EN_BYTE, CDCE906_Y2_EN_BYTE, + CDCE906_Y3_EN_BYTE, CDCE906_Y4_EN_BYTE, CDCE906_Y5_EN_BYTE}; + const uint8_t yx_en_shift[] = {CDCE906_Y0_EN_SHIFT, CDCE906_Y1_EN_SHIFT, CDCE906_Y2_EN_SHIFT, + CDCE906_Y3_EN_SHIFT, CDCE906_Y4_EN_SHIFT, CDCE906_Y5_EN_SHIFT}; + const uint8_t yx_pol_byte[] = {CDCE906_Y0_POL_BYTE, CDCE906_Y1_POL_BYTE, CDCE906_Y2_POL_BYTE, + CDCE906_Y3_POL_BYTE, CDCE906_Y4_POL_BYTE, CDCE906_Y5_POL_BYTE}; + const uint8_t yx_pol_shift[] = {CDCE906_Y0_POL_SHIFT, CDCE906_Y1_POL_SHIFT, CDCE906_Y2_POL_SHIFT, + CDCE906_Y3_POL_SHIFT, CDCE906_Y4_POL_SHIFT, CDCE906_Y5_POL_SHIFT}; + + for (int i = 0; i < 6; i++) { + switch(cfg->y_out[i]) { + case CDCE906_Yx_OUT_CFG_EN: + buff[yx_en_byte[i]] |= 1 << yx_en_shift[i]; + break; + + case CDCE906_Yx_OUT_CFG_EN_INV: + buff[yx_en_byte[i]] |= 1 << yx_en_shift[i]; + buff[yx_pol_byte[i]] |= 1 << yx_pol_shift[i]; + break; + + case CDCE906_Yx_OUT_CFG_DIS_LOW: + break; + + case CDCE906_Yx_OUT_CFG_DIS_HIGH: + buff[yx_pol_byte[i]] |= 1 << yx_pol_shift[i]; + break; + } + } +} + +static inline void cdce906_get_yx_out_cfg(cdce906_cfg* cfg, const uint8_t* buff) +{ + const uint8_t yx_en_byte[] = {CDCE906_Y0_EN_BYTE, CDCE906_Y1_EN_BYTE, CDCE906_Y2_EN_BYTE, + CDCE906_Y3_EN_BYTE, CDCE906_Y4_EN_BYTE, CDCE906_Y5_EN_BYTE}; + const uint8_t yx_en_mask[] = {CDCE906_Y0_EN_MASK, CDCE906_Y1_EN_MASK, CDCE906_Y2_EN_MASK, + CDCE906_Y3_EN_MASK, CDCE906_Y4_EN_MASK, CDCE906_Y5_EN_MASK}; + const uint8_t yx_pol_byte[] = {CDCE906_Y0_POL_BYTE, CDCE906_Y1_POL_BYTE, CDCE906_Y2_POL_BYTE, + CDCE906_Y3_POL_BYTE, CDCE906_Y4_POL_BYTE, CDCE906_Y5_POL_BYTE}; + const uint8_t yx_pol_mask[] = {CDCE906_Y0_POL_MASK, CDCE906_Y1_POL_MASK, CDCE906_Y2_POL_MASK, + CDCE906_Y3_POL_MASK, CDCE906_Y4_POL_MASK, CDCE906_Y5_POL_MASK}; + + for (int i = 0; i < 6; i++) { + if ((buff[yx_en_byte[i]] & yx_en_mask[i]) && !(buff[yx_pol_byte[i]] & yx_pol_mask[i])) { + cfg->y_out[i] = CDCE906_Yx_OUT_CFG_EN; + } else if ((buff[yx_en_byte[i]] & yx_en_mask[i]) && (buff[yx_pol_byte[i]] & yx_pol_mask[i])) { + cfg->y_out[i] = CDCE906_Yx_OUT_CFG_EN_INV; + } else if (!(buff[yx_en_byte[i]] & yx_en_mask[i]) && !(buff[yx_pol_byte[i]] & yx_pol_mask[i])) { + cfg->y_out[i] = CDCE906_Yx_OUT_CFG_DIS_LOW; + } else if (!(buff[yx_en_byte[i]] & yx_en_mask[i]) && (buff[yx_pol_byte[i]] & yx_pol_mask[i])) { + cfg->y_out[i] = CDCE906_Yx_OUT_CFG_DIS_HIGH; + } + } +} + +int cdce906_read_cfg(uint8_t chip_id, cdce906_cfg* cfg) +{ + uint8_t data[27]; + uint8_t i2c_addr; + uint8_t i2c_id; + int i2c_trans = 0; + int ret = 0; + + if (i2c_take_by_chipid(chip_id, &i2c_addr, &i2c_id, (TickType_t)10)) { + i2c_trans = xI2CMasterWriteRead(i2c_id, i2c_addr, 0x00, data, sizeof(data)); + i2c_give(i2c_id); + } + + if (i2c_trans == sizeof(data)) { + /* + * Ignore the first byte from the data buffer as it is the + * number of bytes read, not the register 0 + */ + cdce906_get_clksrc(cfg, &data[1]); + cdce906_get_px_pll_sel(cfg, &data[1]); + cdce906_get_pll_div(cfg, &data[1]); + cdce906_get_yx_px_sel(cfg, &data[1]); + cdce906_get_yx_slew(cfg, &data[1]); + cdce906_get_px_div(cfg, &data[1]); + cdce906_get_yx_out_cfg(cfg, &data[1]); + cdce906_get_pll_fvco(cfg, &data[1]); + cdce906_get_pll_mux(cfg, &data[1]); + cdce906_get_ssc(cfg, &data[1]); + } else { + ret = -1; + } + + return ret; +} + +int cdce906_write_cfg(uint8_t chip_id, const cdce906_cfg* cfg) +{ + uint8_t data[28] = {0, 25, 1}; // Write 25 bytes starting from + // address 0 + uint8_t tmp[2]; + uint8_t i2c_addr; + uint8_t i2c_id; + int i2c_trans = 0; + + cdce906_set_clksrc(cfg, &data[2]); + cdce906_set_px_pll_sel(cfg, &data[2]); + cdce906_set_pll_div(cfg, &data[2]); + cdce906_set_yx_px_sel(cfg, &data[2]); + cdce906_set_yx_slew(cfg, &data[2]); + cdce906_set_px_div(cfg, &data[2]); + cdce906_set_yx_out_cfg(cfg, &data[2]); + cdce906_set_pll_fvco(cfg, &data[2]); + cdce906_set_pll_mux(cfg, &data[2]); + cdce906_set_ssc(cfg, &data[2]); + + /* + * Clear EELOCK bit to avoid permanently locking the EEPROM + */ + data[CDCE906_EELOCK_BYTE + 2] &= 0x7F; + + /* + * Bypass PLL2 to change the SSC configuration on-the-fly + */ + tmp[0] = 0x80 | CDCE906_PLL2_VCO_MUX_BYTE; + tmp[1] = data[CDCE906_PLL2_VCO_MUX_BYTE + 2] | CDCE906_PLL2_VCO_MUX_MASK; + if (i2c_take_by_chipid(chip_id, &i2c_addr, &i2c_id, (TickType_t)10)) { + i2c_trans = xI2CMasterWrite(i2c_id, i2c_addr, tmp, sizeof(tmp)); + i2c_give(i2c_id); + } + + if (i2c_trans != sizeof(tmp)) { + return -1; + } + + /* + * Write the SSC configuration + */ + tmp[0] = 0x80 | CDCE906_SSC_FREQ_SEL_BYTE; + tmp[1] = data[CDCE906_SSC_FREQ_SEL_BYTE + 2]; + if (i2c_take_by_chipid(chip_id, &i2c_addr, &i2c_id, (TickType_t)10)) { + i2c_trans = xI2CMasterWrite(i2c_id, i2c_addr, tmp, sizeof(tmp)); + i2c_give(i2c_id); + } + + if (i2c_trans != sizeof(tmp)) { + return -1; + } + + /* + * Write to all registers except for SSC + */ + if (i2c_take_by_chipid(chip_id, &i2c_addr, &i2c_id, (TickType_t)10)) { + i2c_trans = xI2CMasterWrite(i2c_id, i2c_addr, data, sizeof(data) - 1); + i2c_give(i2c_id); + } + + if (i2c_trans != sizeof(data)) { + return -1; + } + + return 0; +} + +int cdce906_write_eeprom(uint8_t chip_id) +{ + uint8_t data[2]; + uint8_t i2c_addr; + uint8_t i2c_id; + int i2c_trans = 0; + int ret = 0; + + /* + * Byte write operation, address 26 + */ + data[0] = 26 | 0x80; + + /* + * Starts an EEPROM write cycle, keep the default block read size + * (27 bytes) + */ + data[1] = CDCE906_EEWRITE_MASK | 27; + + if (i2c_take_by_chipid(chip_id, &i2c_addr, &i2c_id, (TickType_t)10)) { + i2c_trans = xI2CMasterWrite(i2c_id, i2c_addr, data, sizeof(data)); + i2c_give(i2c_id); + } + + if (i2c_trans != sizeof(data)) { + ret = -1; + } + + return ret; +} diff --git a/modules/cdce906.h b/modules/cdce906.h new file mode 100644 index 000000000..32d815b10 --- /dev/null +++ b/modules/cdce906.h @@ -0,0 +1,177 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2021 Augusto Fraga Giachero + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +/** + * @file cdce906.h + * @author Augusto Fraga Giachero + * + * @brief CDCE906 PLL driver function declarations + * + * @ingroup CDCE906 + */ + +#ifndef CDCE906_H_ +#define CDCE906_H_ + +#include + +enum cdce906_clk_src { + CDCE906_CLK_SRC_CRYSTAL, + CDCE906_CLK_SRC_CLKIN0_LVCMOS, + CDCE906_CLK_SRC_CLKIN1_LVCMOS, + CDCE906_CLK_SRC_CLKIN_DIFF, + CDCE906_CLK_SRC_INVALID, +}; + +enum cdce906_pll_vco_mux { + CDCE906_PLL_VCO_MUX_PLL, + CDCE906_PLL_VCO_MUX_VCO, +}; + +enum cdce906_pll_fvco { + CDCE906_PLL_FVCO_80_200MHZ, + CDCE906_PLL_FVCO_180_300MHZ, +}; + +enum cdce906_s0_cfg { + CDCE906_S0_CFG_POWER_DOWN_CTRL, + CDCE906_S0_CFG_PLL_DIV_BYPASS_CTRL, + CDCE906_S0_CFG_CLKSEL_CTRL, + CDCE906_S0_CFG_I2C_ADDR, +}; + +enum cdce906_s1_cfg { + CDCE906_S1_CFG_Yx_FIXED_OUTPUT_CTRL, + CDCE906_S1_CFG_Yx_TRISTATE_CTRL, + CDCE906_S1_CFG_I2C_ADDR, + CDCE906_S1_CFG_INVALID, +}; + +enum cdce906_px_pll_sel { + CDCE906_Px_PLL_SEL_BYPASS, + CDCE906_Px_PLL_SEL_PLL1, + CDCE906_Px_PLL_SEL_PLL2, + CDCE906_Px_PLL_SEL_PLL2_SSC, + CDCE906_Px_PLL_SEL_PLL3, + CDCE906_Px_PLL_SEL_INVALID, +}; + +enum cdce906_yx_out_cfg { + CDCE906_Yx_OUT_CFG_EN, + CDCE906_Yx_OUT_CFG_EN_INV, + CDCE906_Yx_OUT_CFG_DIS_LOW, + CDCE906_Yx_OUT_CFG_DIS_HIGH, +}; + +enum cdce906_yx_slew_cfg { + CDCE906_Yx_SLEW_CFG_NOMINAL, + CDCE906_Yx_SLEW_CFG_NOMINAL_1NS, + CDCE906_Yx_SLEW_CFG_NOMINAL_2NS, + CDCE906_Yx_SLEW_CFG_NOMINAL_3NS, +}; + +enum cdce906_yx_px_sel { + CDCE906_Yx_Px_SEL_P0, + CDCE906_Yx_Px_SEL_P1, + CDCE906_Yx_Px_SEL_P2, + CDCE906_Yx_Px_SEL_P3, + CDCE906_Yx_Px_SEL_P4, + CDCE906_Yx_Px_SEL_P5, + CDCE906_Yx_Px_SEL_INVALID, +}; + +enum cdce906_ssc_mod_amount { + CDCE906_SSC_MOD_AMOUNT_OFF = 0, + CDCE906_SSC_MOD_AMOUNT_0P1_CENTER, + CDCE906_SSC_MOD_AMOUNT_0P25_CENTER, + CDCE906_SSC_MOD_AMOUNT_0P4_CENTER, + CDCE906_SSC_MOD_AMOUNT_1P0_DOWN, + CDCE906_SSC_MOD_AMOUNT_1P5_DOWN, + CDCE906_SSC_MOD_AMOUNT_2P0_DOWN, + CDCE906_SSC_MOD_AMOUNT_3P0_DOWN, +}; + +enum cdce906_ssc_mod_freq { + CDCE906_SSC_MOD_FREQ_5680 = 0, + CDCE906_SSC_MOD_FREQ_5412, + CDCE906_SSC_MOD_FREQ_5144, + CDCE906_SSC_MOD_FREQ_4876, + CDCE906_SSC_MOD_FREQ_4608, + CDCE906_SSC_MOD_FREQ_4340, + CDCE906_SSC_MOD_FREQ_4072, + CDCE906_SSC_MOD_FREQ_3804, + CDCE906_SSC_MOD_FREQ_3536, + CDCE906_SSC_MOD_FREQ_3286, + CDCE906_SSC_MOD_FREQ_3000, + CDCE906_SSC_MOD_FREQ_2732, + CDCE906_SSC_MOD_FREQ_2464, + CDCE906_SSC_MOD_FREQ_2196, + CDCE906_SSC_MOD_FREQ_1928, + CDCE906_SSC_MOD_FREQ_1660, +}; + +typedef struct { + enum cdce906_clk_src clksrc; + uint16_t pll_div_m[3]; + uint16_t pll_div_n[3]; + enum cdce906_pll_vco_mux pll_vco_mux[3]; + enum cdce906_pll_fvco pll_fvco[3]; + enum cdce906_ssc_mod_amount ssc_mod_amount; + enum cdce906_ssc_mod_freq ssc_mod_freq; + enum cdce906_s0_cfg s0_cfg; + enum cdce906_s1_cfg s1_cfg; + enum cdce906_px_pll_sel pll_sel[6]; + uint8_t p_div[6]; + enum cdce906_yx_slew_cfg y_slew[6]; + enum cdce906_yx_px_sel y_p_sel[6]; + enum cdce906_yx_out_cfg y_out[6]; +} cdce906_cfg; + +/** + * @brief Read the current CDCE906 configuration + * + * @param[in] chip_id Chip ID to communicate + * @param[out] cfg cdce906_cfg struct with the current configuration + * + * @return 0 if successful, non zero if there was an I2C error + */ +int cdce906_read_cfg(uint8_t chip_id, cdce906_cfg* cfg); + +/** + * @brief Write the CDCE906 configuration + * + * @param[in] chip_id Chip ID to communicate + * @param[in] cfg cdce906_cfg struct containing the desired configuration + * + * @return 0 if successful, non zero if there was an I2C error + */ +int cdce906_write_cfg(uint8_t chip_id, const cdce906_cfg* cfg); + +/** + * @brief Save the current CDCE906 configuration to internal eeprom + * + * @param[in] chip_id Chip ID to communicate + * + * @return 0 if successful, non zero if there was an I2C error + */ +int cdce906_write_eeprom(uint8_t chip_id); + +#endif diff --git a/modules/cdce906_reg.h b/modules/cdce906_reg.h new file mode 100644 index 000000000..739cc409e --- /dev/null +++ b/modules/cdce906_reg.h @@ -0,0 +1,294 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2021 Augusto Fraga Giachero + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +/** + * @file cdce906_reg.h + * @author Augusto Fraga Giachero + * + * @brief CDCE906 PLL register definitions + * + * @ingroup CDCE906 + */ + +#ifndef CDCE906_REG_H_ +#define CDCE906_REG_H_ + +#define CDCE906_PLL1_REF_DIV_M_LOW_BYTE 1 +#define CDCE906_PLL1_REF_DIV_M_LOW_SHIFT 0 +#define CDCE906_PLL1_REF_DIV_M_LOW_MASK 0xFF +#define CDCE906_PLL1_REF_DIV_M_HIGH_BYTE 3 +#define CDCE906_PLL1_REF_DIV_M_HIGH_SHIFT 0 +#define CDCE906_PLL1_REF_DIV_M_HIGH_MASK 0x01 + +#define CDCE906_PLL1_REF_DIV_N_LOW_BYTE 2 +#define CDCE906_PLL1_REF_DIV_N_LOW_SHIFT 0 +#define CDCE906_PLL1_REF_DIV_N_LOW_MASK 0xFF +#define CDCE906_PLL1_REF_DIV_N_HIGH_BYTE 3 +#define CDCE906_PLL1_REF_DIV_N_HIGH_SHIFT 1 +#define CDCE906_PLL1_REF_DIV_N_HIGH_MASK 0x1E + +#define CDCE906_PLL2_REF_DIV_M_LOW_BYTE 4 +#define CDCE906_PLL2_REF_DIV_M_LOW_SHIFT 0 +#define CDCE906_PLL2_REF_DIV_M_LOW_MASK 0xFF +#define CDCE906_PLL2_REF_DIV_M_HIGH_BYTE 6 +#define CDCE906_PLL2_REF_DIV_M_HIGH_SHIFT 0 +#define CDCE906_PLL2_REF_DIV_M_HIGH_MASK 0x01 + +#define CDCE906_PLL2_REF_DIV_N_LOW_BYTE 5 +#define CDCE906_PLL2_REF_DIV_N_LOW_SHIFT 0 +#define CDCE906_PLL2_REF_DIV_N_LOW_MASK 0xFF +#define CDCE906_PLL2_REF_DIV_N_HIGH_BYTE 6 +#define CDCE906_PLL2_REF_DIV_N_HIGH_SHIFT 1 +#define CDCE906_PLL2_REF_DIV_N_HIGH_MASK 0x1E + +#define CDCE906_PLL3_REF_DIV_M_LOW_BYTE 7 +#define CDCE906_PLL3_REF_DIV_M_LOW_SHIFT 0 +#define CDCE906_PLL3_REF_DIV_M_LOW_MASK 0xFF +#define CDCE906_PLL3_REF_DIV_M_HIGH_BYTE 9 +#define CDCE906_PLL3_REF_DIV_M_HIGH_SHIFT 0 +#define CDCE906_PLL3_REF_DIV_M_HIGH_MASK 0x01 + +#define CDCE906_PLL3_REF_DIV_N_LOW_BYTE 8 +#define CDCE906_PLL3_REF_DIV_N_LOW_SHIFT 0 +#define CDCE906_PLL3_REF_DIV_N_LOW_MASK 0xFF +#define CDCE906_PLL3_REF_DIV_N_HIGH_BYTE 9 +#define CDCE906_PLL3_REF_DIV_N_HIGH_SHIFT 1 +#define CDCE906_PLL3_REF_DIV_N_HIGH_MASK 0x1E + +#define CDCE906_PLL1_VCO_MUX_BYTE 3 +#define CDCE906_PLL1_VCO_MUX_SHIFT 7 +#define CDCE906_PLL1_VCO_MUX_MASK 0x80 + +#define CDCE906_PLL2_VCO_MUX_BYTE 3 +#define CDCE906_PLL2_VCO_MUX_SHIFT 6 +#define CDCE906_PLL2_VCO_MUX_MASK 0x40 + +#define CDCE906_PLL3_VCO_MUX_BYTE 3 +#define CDCE906_PLL3_VCO_MUX_SHIFT 5 +#define CDCE906_PLL3_VCO_MUX_MASK 0x20 + +#define CDCE906_PLL1_FVCO_BYTE 6 +#define CDCE906_PLL1_FVCO_SHIFT 7 +#define CDCE906_PLL1_FVCO_MASK 0x80 + +#define CDCE906_PLL2_FVCO_BYTE 6 +#define CDCE906_PLL2_FVCO_SHIFT 6 +#define CDCE906_PLL2_FVCO_MASK 0x40 + +#define CDCE906_PLL3_FVCO_BYTE 6 +#define CDCE906_PLL3_FVCO_SHIFT 5 +#define CDCE906_PLL3_FVCO_MASK 0x20 + +#define CDCE906_P0_SW_A_BYTE 9 +#define CDCE906_P0_SW_A_SHIFT 5 +#define CDCE906_P0_SW_A_MASK 0xE0 + +#define CDCE906_P1_SW_A_BYTE 10 +#define CDCE906_P1_SW_A_SHIFT 5 +#define CDCE906_P1_SW_A_MASK 0xE0 + +#define CDCE906_P2_SW_A_BYTE 11 +#define CDCE906_P2_SW_A_SHIFT 0 +#define CDCE906_P2_SW_A_MASK 0x07 + +#define CDCE906_P3_SW_A_BYTE 11 +#define CDCE906_P3_SW_A_SHIFT 3 +#define CDCE906_P3_SW_A_MASK 0x38 + +#define CDCE906_P4_SW_A_BYTE 12 +#define CDCE906_P4_SW_A_SHIFT 0 +#define CDCE906_P4_SW_A_MASK 0x07 + +#define CDCE906_P5_SW_A_BYTE 12 +#define CDCE906_P5_SW_A_SHIFT 3 +#define CDCE906_P5_SW_A_MASK 0x38 + +#define CDCE906_CLKSEL_BYTE 10 +#define CDCE906_CLKSEL_SHIFT 4 +#define CDCE906_CLKSEL_MASK 0x10 + +#define CDCE906_S0_IN_CFG_BYTE 10 +#define CDCE906_S0_IN_CFG_SHIFT 0 +#define CDCE906_S0_IN_CFG_MASK 0x03 + +#define CDCE906_S1_IN_CFG_BYTE 10 +#define CDCE906_S1_IN_CFG_SHIFT 2 +#define CDCE906_S1_IN_CFG_MASK 0x0C + +#define CDCE906_CLKIN_SRC_BYTE 11 +#define CDCE906_CLKIN_SRC_SHIFT 6 +#define CDCE906_CLKIN_SRC_MASK 0xC0 + +#define CDCE906_POWER_DOWN_BYTE 12 +#define CDCE906_POWER_DOWN_SHIFT 6 +#define CDCE906_POWER_DOWN_MASK 0x40 + +#define CDCE906_P0_DIV_BYTE 13 +#define CDCE906_P0_DIV_SHIFT 0 +#define CDCE906_P0_DIV_MASK 0x7F + +#define CDCE906_P1_DIV_BYTE 14 +#define CDCE906_P1_DIV_SHIFT 0 +#define CDCE906_P1_DIV_MASK 0x7F + +#define CDCE906_P2_DIV_BYTE 15 +#define CDCE906_P2_DIV_SHIFT 0 +#define CDCE906_P2_DIV_MASK 0x7F + +#define CDCE906_P3_DIV_BYTE 16 +#define CDCE906_P3_DIV_SHIFT 0 +#define CDCE906_P3_DIV_MASK 0x7F + +#define CDCE906_P4_DIV_BYTE 17 +#define CDCE906_P4_DIV_SHIFT 0 +#define CDCE906_P4_DIV_MASK 0x7F + +#define CDCE906_P5_DIV_BYTE 18 +#define CDCE906_P5_DIV_SHIFT 0 +#define CDCE906_P5_DIV_MASK 0x7F + +#define CDCE906_Y0_POL_BYTE 19 +#define CDCE906_Y0_POL_SHIFT 6 +#define CDCE906_Y0_POL_MASK 0x40 + +#define CDCE906_Y0_SLEW_RATE_BYTE 19 +#define CDCE906_Y0_SLEW_RATE_SHIFT 4 +#define CDCE906_Y0_SLEW_RATE_MASK 0x30 + +#define CDCE906_Y0_EN_BYTE 19 +#define CDCE906_Y0_EN_SHIFT 3 +#define CDCE906_Y0_EN_MASK 0x08 + +#define CDCE906_Y0_SW_B_BYTE 19 +#define CDCE906_Y0_SW_B_SHIFT 0 +#define CDCE906_Y0_SW_B_MASK 0x07 + +#define CDCE906_Y1_POL_BYTE 20 +#define CDCE906_Y1_POL_SHIFT 6 +#define CDCE906_Y1_POL_MASK 0x40 + +#define CDCE906_Y1_SLEW_RATE_BYTE 20 +#define CDCE906_Y1_SLEW_RATE_SHIFT 4 +#define CDCE906_Y1_SLEW_RATE_MASK 0x30 + +#define CDCE906_Y1_EN_BYTE 20 +#define CDCE906_Y1_EN_SHIFT 3 +#define CDCE906_Y1_EN_MASK 0x08 + +#define CDCE906_Y1_SW_B_BYTE 20 +#define CDCE906_Y1_SW_B_SHIFT 0 +#define CDCE906_Y1_SW_B_MASK 0x07 + +#define CDCE906_Y2_POL_BYTE 21 +#define CDCE906_Y2_POL_SHIFT 6 +#define CDCE906_Y2_POL_MASK 0x40 + +#define CDCE906_Y2_SLEW_RATE_BYTE 21 +#define CDCE906_Y2_SLEW_RATE_SHIFT 4 +#define CDCE906_Y2_SLEW_RATE_MASK 0x30 + +#define CDCE906_Y2_EN_BYTE 21 +#define CDCE906_Y2_EN_SHIFT 3 +#define CDCE906_Y2_EN_MASK 0x08 + +#define CDCE906_Y2_SW_B_BYTE 21 +#define CDCE906_Y2_SW_B_SHIFT 0 +#define CDCE906_Y2_SW_B_MASK 0x07 + +#define CDCE906_Y3_POL_BYTE 22 +#define CDCE906_Y3_POL_SHIFT 6 +#define CDCE906_Y3_POL_MASK 0x40 + +#define CDCE906_Y3_SLEW_RATE_BYTE 22 +#define CDCE906_Y3_SLEW_RATE_SHIFT 4 +#define CDCE906_Y3_SLEW_RATE_MASK 0x30 + +#define CDCE906_Y3_EN_BYTE 22 +#define CDCE906_Y3_EN_SHIFT 3 +#define CDCE906_Y3_EN_MASK 0x08 + +#define CDCE906_Y3_SW_B_BYTE 22 +#define CDCE906_Y3_SW_B_SHIFT 0 +#define CDCE906_Y3_SW_B_MASK 0x07 + +#define CDCE906_Y4_POL_BYTE 23 +#define CDCE906_Y4_POL_SHIFT 6 +#define CDCE906_Y4_POL_MASK 0x40 + +#define CDCE906_Y4_SLEW_RATE_BYTE 23 +#define CDCE906_Y4_SLEW_RATE_SHIFT 4 +#define CDCE906_Y4_SLEW_RATE_MASK 0x30 + +#define CDCE906_Y4_EN_BYTE 23 +#define CDCE906_Y4_EN_SHIFT 3 +#define CDCE906_Y4_EN_MASK 0x08 + +#define CDCE906_Y4_SW_B_BYTE 23 +#define CDCE906_Y4_SW_B_SHIFT 0 +#define CDCE906_Y4_SW_B_MASK 0x07 + +#define CDCE906_Y5_POL_BYTE 24 +#define CDCE906_Y5_POL_SHIFT 6 +#define CDCE906_Y5_POL_MASK 0x40 + +#define CDCE906_Y5_SLEW_RATE_BYTE 24 +#define CDCE906_Y5_SLEW_RATE_SHIFT 4 +#define CDCE906_Y5_SLEW_RATE_MASK 0x30 + +#define CDCE906_Y5_EN_BYTE 24 +#define CDCE906_Y5_EN_SHIFT 3 +#define CDCE906_Y5_EN_MASK 0x08 + +#define CDCE906_Y5_SW_B_BYTE 24 +#define CDCE906_Y5_SW_B_SHIFT 0 +#define CDCE906_Y5_SW_B_MASK 0x07 + +#define CDCE906_EEPIP_BYTE 24 +#define CDCE906_EEPIP_SHIFT 7 +#define CDCE906_EEPIP_MASK 0x80 + +#define CDCE906_EELOCK_BYTE 25 +#define CDCE906_EELOCK_SHIFT 7 +#define CDCE906_EELOCK_MASK 0x80 + +#define CDCE906_SSC_MOD_SEL_BYTE 25 +#define CDCE906_SSC_MOD_SEL_SHIFT 4 +#define CDCE906_SSC_MOD_SEL_MASK 0x70 + +#define CDCE906_SSC_FREQ_SEL_BYTE 25 +#define CDCE906_SSC_FREQ_SEL_SHIFT 0 +#define CDCE906_SSC_FREQ_SEL_MASK 0x0F + +#define CDCE906_EEWRITE_BYTE 26 +#define CDCE906_EEWRITE_SHIFT 7 +#define CDCE906_EEWRITE_MASK 0x80 + +#define CDCE906_EECNT_BYTE 26 +#define CDCE906_EECNT_SHIFT 0 +#define CDCE906_EECNT_MASK 0x7F + +enum cdce906_clkin_src { + CDCE906_CLKIN_SRC_CRYSTAL = 0b00, + CDCE906_CLKIN_SRC_LVCMOS = 0b01, + CDCE906_CLKIN_SRC_DIFF = 0b10, +}; + +#endif diff --git a/modules/error.c b/modules/error.c new file mode 100644 index 000000000..dbaf4fbd8 --- /dev/null +++ b/modules/error.c @@ -0,0 +1,55 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2021 Augusto Fraga Giachero + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +/** + * @file error.c + * @author Augusto Fraga Giachero + * + * @brief Error handling functions + * + * @ingroup error + */ +#include +#include "error.h" + +static const char* mmc_error_strings[] = { + [MMC_OK] = "No error", + [MMC_OOM_ERR] = "Out of memory", + [MMC_IO_ERR] = "Input output error", + [MMC_INVALID_ARG_ERR] = "Invalid arguments", + [MMC_RESOURCE_ERR] = "Resource unavailable", + [MMC_TIMEOUT_ERR] = "Timeout", + [MMC_UNKNOWN_ERR] = "Unknown error", +}; + +const char* get_error_str(mmc_err e) +{ + const size_t eindex = (size_t) e; + const char* err_str; + + if (eindex < (sizeof(mmc_error_strings) / sizeof(char*))) { + err_str = mmc_error_strings[eindex]; + } else { + err_str = mmc_error_strings[MMC_UNKNOWN_ERR]; + } + + return err_str; +} diff --git a/modules/error.h b/modules/error.h new file mode 100644 index 000000000..acc144f8c --- /dev/null +++ b/modules/error.h @@ -0,0 +1,62 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2021 Augusto Fraga Giachero + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +#ifndef ERROR_H_ +#define ERROR_H_ + +#include + +/** + * @file error.h + * @author Augusto Fraga Giachero + * + * @brief Error handling functions and codes + * + * @ingroup error + */ + +typedef enum { + MMC_OK, + MMC_OOM_ERR, + MMC_IO_ERR, + MMC_INVALID_ARG_ERR, + MMC_TIMEOUT_ERR, + MMC_RESOURCE_ERR, + MMC_UNKNOWN_ERR, +} mmc_err; + +/** + * @brief Get the corresponding string for an error code + * + * @param[in] e Error code + * + * @return a pointer to a null-terminated string + */ +const char* get_error_str(mmc_err e); + +/** + * @brief Print the file name, line number and error description + * + * @param[in] e Error code + */ +#define PRINT_ERR_LINE(e) printf("%s line %d: %s\n", __FILE__, __LINE__, get_error_str(e)) + +#endif diff --git a/modules/fpga_spi.c b/modules/fpga_spi.c index 1e6feb6ef..0a852db95 100644 --- a/modules/fpga_spi.c +++ b/modules/fpga_spi.c @@ -54,7 +54,7 @@ static void write_fpga_buffer( board_diagnostic_t *diag ) uint32_t *buffer = (uint32_t *)diag; /* Send all bytes sequentially, except the last record (FMC slot status), whose address is 0xFF */ - for( i = 0; i < sizeof(board_diagnostic_t)- 1; i++) { + for( i = 0; i < (sizeof(board_diagnostic_t) / sizeof(uint32_t))- 1; i++) { write_fpga_dword( i, buffer[i] ); } write_fpga_dword( 0xFF, buffer[i] ); diff --git a/modules/fpga_spi.h b/modules/fpga_spi.h index 082623b0b..eb578c536 100644 --- a/modules/fpga_spi.h +++ b/modules/fpga_spi.h @@ -22,6 +22,8 @@ #ifndef FPGA_SPI_H_ #define FPGA_SPI_H_ +#include + #include "sdr.h" #include "utils.h" @@ -84,7 +86,7 @@ typedef struct __attribute__ ((__packed__)) { /** * @brief AFC diagnostic struct sent to FPGA via SPI */ -typedef struct __attribute__ ((__packed__)) { +typedef struct __attribute__ ((__packed__,aligned(4))) { uint32_t cardID[4]; uint32_t slot_id:16, ipmi_addr:16; @@ -93,6 +95,10 @@ typedef struct __attribute__ ((__packed__)) { fmc_diag_t fmc_slot; } board_diagnostic_t; +/* Guarantee buffer can be read as an uint32_t array + * FIXME: use static_assert when moving build to C11 */ +_Static_assert(sizeof(board_diagnostic_t) % sizeof(uint32_t) == 0); + /** * @brief FPGA Diagnostics Task * diff --git a/modules/fru.c b/modules/fru.c index 4a7c4c1ee..2a22a43aa 100644 --- a/modules/fru.c +++ b/modules/fru.c @@ -225,6 +225,10 @@ size_t fru_read( uint8_t id, uint8_t *rx_buff, uint16_t offset, size_t len ) return 0; } + /* + * Read runtime FRU info that is auto-generated + * when there is no valid FRU info in the EEPROM + */ if ( fru[id].runtime ) { for ( i = 0; i < len; i++, j++ ) { if ( j < fru[id].fru_size ) { @@ -234,8 +238,12 @@ size_t fru_read( uint8_t id, uint8_t *rx_buff, uint16_t offset, size_t len ) } } ret_val = i; + + /* + * Read EEPROM FRU info + */ } else { - ret_val = fru[id].cfg.read_f( fru[id].cfg.eeprom_id, offset, rx_buff, len, 0 ); + ret_val = fru[id].cfg.read_f( fru[id].cfg.eeprom_id, offset, rx_buff, len, 10 ); } return ret_val; } @@ -286,7 +294,8 @@ IPMI_HANDLER(ipmi_storage_read_fru_data_cmd, NETFN_STORAGE, IPMI_READ_FRU_DATA_C /* Count byte on the request is "1" based */ uint8_t count = req->data[3]; - if ( (count-1) > IPMI_MSG_MAX_LENGTH ) { + /* Consider header, count, data and checksum */ + if ( (count + IPMB_RESP_HEADER_LENGTH + 2) > IPMI_MSG_MAX_LENGTH ) { rsp->completion_code = IPMI_CC_CANT_RET_NUM_REQ_BYTES; return; } @@ -294,6 +303,17 @@ IPMI_HANDLER(ipmi_storage_read_fru_data_cmd, NETFN_STORAGE, IPMI_READ_FRU_DATA_C offset = (req->data[2] << 8) | (req->data[1]); count = fru_read( fru_id, &(rsp->data[len+1]), offset, count ); + + /* + * If count == 0, it may indicate that the fru_read function + * failed somehow. + */ + + if (count == 0) { + rsp->completion_code = IPMI_CC_UNSPECIFIED_ERROR; + return ; + } + rsp->data[len++] = count; rsp->data_len = len + count; diff --git a/modules/hpm.c b/modules/hpm.c index fbf6328b2..747931673 100644 --- a/modules/hpm.c +++ b/modules/hpm.c @@ -37,7 +37,10 @@ static uint8_t cmd_in_progress; static uint8_t last_cmd_cc; /*Current component under upgrade */ -static uint8_t active_id; +static t_component* active_component = NULL; + +/* Variable used to monitor HPM upload fw block command's block number */ +static uint8_t expected_block_n; /* IPMC Capabilities */ t_ipmc_capabilities ipmc_cap = { @@ -65,6 +68,11 @@ t_component hpm_components[HPM_MAX_COMPONENTS] = { .rollback_backup_support = 0x01 } }, + .hpm_prepare_comp_f = bootloader_hpm_prepare_comp, + .hpm_upload_block_f = bootloader_hpm_upload_block, + .hpm_finish_upload_f = bootloader_hpm_finish_upload, + .hpm_get_upgrade_status_f = bootloader_hpm_get_upgrade_status, + .hpm_activate_firmware_f = bootloader_hpm_activate_firmware }, [HPM_IPMC_COMPONENT_ID] = { .properties = { @@ -207,12 +215,24 @@ IPMI_HANDLER(ipmi_picmg_initiate_upgrade_action, NETFN_GRPEXT, IPMI_PICMG_CMD_HP { uint8_t len = rsp->data_len = 0; - uint8_t comp_id = req->data[1]; - uint8_t upgrade_action = req->data[2]; - - rsp->completion_code = IPMI_CC_UNSPECIFIED_ERROR; - - if (comp_id > 7) { + uint8_t comp_id; + + /* Set the component that'll be upgraded */ + /* + * As specified in the Hardware Platform Management IPM Controller Firmware Upgrade Specification, Table 3-4, + * treat the component selection (req->data[1]) as a bit field. + */ + switch (req->data[1]) { + case 0x01: + comp_id = 0; + break; + case 0x02: + comp_id = 1; + break; + case 0x04: + comp_id = 2; + break; + default: /* Component ID out of range */ rsp->data[len++] = IPMI_PICMG_GRP_EXT; /* Return command-specific completion code: 0x82 (Invalid Component ID) */ @@ -221,8 +241,10 @@ IPMI_HANDLER(ipmi_picmg_initiate_upgrade_action, NETFN_GRPEXT, IPMI_PICMG_CMD_HP return; } - active_id = comp_id; - + uint8_t upgrade_action = req->data[2]; + expected_block_n = 0x00; + rsp->completion_code = IPMI_CC_UNSPECIFIED_ERROR; + active_component = &hpm_components[comp_id]; rsp->data[len++] = IPMI_PICMG_GRP_EXT; switch (upgrade_action) { @@ -230,17 +252,10 @@ IPMI_HANDLER(ipmi_picmg_initiate_upgrade_action, NETFN_GRPEXT, IPMI_PICMG_CMD_HP /* Backup component */ break; case 0x01: - /* Prepare Component */ - if (hpm_components[active_id].hpm_prepare_comp_f) { - rsp->completion_code = hpm_components[active_id].hpm_prepare_comp_f(); - } - break; case 0x02: /* Upload for upgrade */ - /* Set the component that'll be upgraded */ - active_id = comp_id; - if (hpm_components[active_id].hpm_prepare_comp_f) { - rsp->completion_code = hpm_components[active_id].hpm_prepare_comp_f(); + if (active_component->hpm_prepare_comp_f) { + rsp->completion_code = active_component->hpm_prepare_comp_f(); } break; case 0x03: @@ -261,9 +276,9 @@ IPMI_HANDLER(ipmi_picmg_get_upgrade_status, NETFN_GRPEXT, IPMI_PICMG_CMD_HPM_GET { uint8_t len = rsp->data_len = 0; - if (hpm_components[active_id].hpm_get_upgrade_status_f) { + if (active_component->hpm_get_upgrade_status_f) { /* WARNING: This function can't block! */ - last_cmd_cc = hpm_components[active_id].hpm_get_upgrade_status_f(); + last_cmd_cc = active_component->hpm_get_upgrade_status_f(); } else { /* Returning IPMI_CC_OK for debug purposes only, should be IPMI_CC_UNSPECIFIED_ERROR */ last_cmd_cc = IPMI_CC_OK; @@ -295,7 +310,7 @@ IPMI_HANDLER(ipmi_picmg_upload_firmware_block, NETFN_GRPEXT, IPMI_PICMG_CMD_HPM_ uint8_t block_data[HPM_BLOCK_SIZE]; uint8_t block_sz = req->data_len-2; - if (active_id > 7) { + if (active_component == NULL) { /* Component ID out of range */ rsp->data[len++] = IPMI_PICMG_GRP_EXT; /* Return command-specific completion code: 0x81 (Invalid Component ID) */ @@ -308,9 +323,15 @@ IPMI_HANDLER(ipmi_picmg_upload_firmware_block, NETFN_GRPEXT, IPMI_PICMG_CMD_HPM_ /* TODO: perform checksum of the block */ - if (hpm_components[active_id].hpm_upload_block_f) { + if (active_component->hpm_upload_block_f) { /* WARNING: This function can't block! */ - rsp->completion_code = hpm_components[active_id].hpm_upload_block_f(&block_data[0], block_sz); + /* req->data[1] holds the block number */ + if(req->data[1] == expected_block_n) { + rsp->completion_code = active_component->hpm_upload_block_f(&block_data[0], block_sz); + expected_block_n++; + } else { /* Repeated block, ignore it */ + rsp->completion_code = IPMI_CC_OK; + } } else { rsp->completion_code = IPMI_CC_UNSPECIFIED_ERROR; } @@ -331,8 +352,8 @@ IPMI_HANDLER(ipmi_picmg_finish_firmware_upload, NETFN_GRPEXT, IPMI_PICMG_CMD_HPM /* TODO: implement HPM.1 REQ3.59 */ - if ( hpm_components[active_id].hpm_finish_upload_f) { - rsp->completion_code = hpm_components[active_id].hpm_finish_upload_f( image_len ); + if ( active_component->hpm_finish_upload_f) { + rsp->completion_code = active_component->hpm_finish_upload_f( image_len ); } else { rsp->completion_code = IPMI_CC_UNSPECIFIED_ERROR; } @@ -352,8 +373,8 @@ IPMI_HANDLER(ipmi_picmg_activate_firmware, NETFN_GRPEXT, IPMI_PICMG_CMD_HPM_ACTI /* TODO: Compare firmware revisions before activating */ - if (hpm_components[active_id].hpm_activate_firmware_f) { - rsp->completion_code = hpm_components[active_id].hpm_activate_firmware_f(); + if (active_component->hpm_activate_firmware_f) { + rsp->completion_code = active_component->hpm_activate_firmware_f(); } else { rsp->completion_code = IPMI_CC_UNSPECIFIED_ERROR; } diff --git a/modules/hpm.h b/modules/hpm.h index 780c5f54d..53b3af296 100644 --- a/modules/hpm.h +++ b/modules/hpm.h @@ -52,16 +52,21 @@ typedef uint8_t (* t_hpm_prepare_comp)(void); typedef uint8_t (* t_hpm_get_upgrade_status)(void); typedef uint8_t (* t_hpm_activate_firmware)(void); + +/* + * Define the "Get target upgrade capabilities" message struct as define in the + * Hardware Platform Management IPM Controller Firmware Upgrade Specification, Table 3-3 + */ typedef union { struct { - uint8_t upgrade_undesirable:1; - uint8_t automatic_rollback_overridden:1; - uint8_t ipmc_degraded_in_update:1; - uint8_t deferred_activation:1; - uint8_t services_affected:1; - uint8_t manual_rollback:1; - uint8_t automatic_rollback:1; uint8_t self_test:1; + uint8_t automatic_rollback:1; + uint8_t manual_rollback:1; + uint8_t services_affected:1; + uint8_t deferred_activation:1; + uint8_t ipmc_degraded_in_update:1; + uint8_t automatic_rollback_overridden:1; + uint8_t upgrade_undesirable:1; } flags; uint8_t byte; } t_ipmc_capabilities; diff --git a/modules/idt_8v54816.c b/modules/idt_8v54816.c new file mode 100644 index 000000000..7c0c90f74 --- /dev/null +++ b/modules/idt_8v54816.c @@ -0,0 +1,73 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2021 Krzysztof Macias + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +/* FreeRTOS includes */ +#include "FreeRTOS.h" + +/* Project Includes */ +#include "port.h" +#include "idt_8v54816.h" +#include "i2c.h" +#include "i2c_mapping.h" + +uint8_t clock_switch_read_reg(uint8_t *rx_data) +{ + uint8_t i2c_addr, i2c_interface; + uint8_t rx_len = 0; + + if ( i2c_take_by_chipid( CHIP_ID_8V54816, &i2c_addr, &i2c_interface, portMAX_DELAY ) && ( rx_data != NULL ) ) { + + rx_len = xI2CMasterRead( i2c_interface, i2c_addr, rx_data, 16 ); + i2c_give( i2c_interface ); + } + return rx_len; +} + +uint8_t clock_switch_write_reg(uint8_t *tx_data) +{ + uint8_t i2c_interf, i2c_addr; + uint8_t tx_len = 0; + if ( i2c_take_by_chipid( CHIP_ID_8V54816, &i2c_addr, &i2c_interf, portMAX_DELAY) == pdTRUE ) { + tx_len = xI2CMasterWrite( i2c_interf, i2c_addr, tx_data, 16); + i2c_give( i2c_interf ); + } + return tx_len; +} + +uint8_t clock_switch_set_single_channel(uint8_t channel, uint8_t value) +{ + uint8_t data[16] = {0}; + if (clock_switch_read_reg(data)){ + data[channel] = value; + return clock_switch_write_reg(data); + } + return 0; +} + +uint8_t clock_switch_read_single_channel(uint8_t channel, uint8_t *data) +{ + uint8_t all_regs[16] = {0}; + if (clock_switch_read_reg(all_regs)){ + *data = all_regs[channel]; + return 1; + } + return 0; +} diff --git a/modules/idt_8v54816.h b/modules/idt_8v54816.h new file mode 100644 index 000000000..5d6170c19 --- /dev/null +++ b/modules/idt_8v54816.h @@ -0,0 +1,67 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2021 Krzysztof Macias + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +#ifndef IDT_8V54816_H_ +#define IDT_8V54816_H_ + +#include "port.h" + +#define IDT_MASK_SRC 0xF +#define IDT_MASK_POL 1<<5 +#define IDT_MASK_TERM 1<<6 +#define IDT_MASK_DIR 1<<7 + +#define IDT_POL_N 0 +#define IDT_POL_P 1<<5 + +#define IDT_TERM_OFF 0 +#define IDT_TERM_ON 1<<6 + +#define IDT_DIR_IN 0 +#define IDT_DIR_OUT 1<<7 + + +enum IDT_CLK_SRC{ + IDT_SRC_CH0, + IDT_SRC_CH1, + IDT_SRC_CH2, + IDT_SRC_CH3, + IDT_SRC_CH4, + IDT_SRC_CH5, + IDT_SRC_CH6, + IDT_SRC_CH7, + IDT_SRC_CH8, + IDT_SRC_CH9, + IDT_SRC_CH10, + IDT_SRC_CH11, + IDT_SRC_CH12, + IDT_SRC_CH13, + IDT_SRC_CH14, + IDT_SRC_CH15 +}; + +uint8_t clock_switch_read_reg(uint8_t *rx_data); +uint8_t clock_switch_write_reg(uint8_t *tx_data); +uint8_t clock_switch_set_single_channel(uint8_t channel, uint8_t value); +uint8_t clock_switch_read_single_channel(uint8_t channel, uint8_t *data); +uint8_t clock_switch_default_config(); + +#endif diff --git a/modules/ipmb.c b/modules/ipmb.c index 1d6fad99a..a65a9a259 100644 --- a/modules/ipmb.c +++ b/modules/ipmb.c @@ -184,7 +184,7 @@ void IPMB_RXTask ( void *pvParameters ) for ( ;; ) { /* Checks if there's any incoming messages (the task remains blocked here) */ - rx_len = xI2CSlaveReceive( IPMB_I2C, &ipmb_buffer_rx[1], (sizeof(ipmb_buffer_rx)/sizeof(ipmb_buffer_rx[0])), portMAX_DELAY ); + rx_len = xI2CSlaveReceive( IPMB_I2C, &ipmb_buffer_rx[1], IPMI_MSG_MAX_LENGTH - 1, portMAX_DELAY ); if ( rx_len > 0 ) { diff --git a/modules/ipmb.h b/modules/ipmb.h index dcc29dbbd..b67f78e3c 100644 --- a/modules/ipmb.h +++ b/modules/ipmb.h @@ -37,6 +37,11 @@ #include "board_ipmb.h" +/** + * @brief Address out of range of the MicroTCA Carrier's AMC Slot ID + */ +#define IPMB_ADDR_DISCONNECTED 0xA2 + /** * @brief Maximum count of messages to be sent */ diff --git a/modules/ipmi.c b/modules/ipmi.c index aae72afa0..fc5c6e451 100644 --- a/modules/ipmi.c +++ b/modules/ipmi.c @@ -116,7 +116,7 @@ void ipmi_init ( void ) { ipmb_init(); ipmb_register_rxqueue( &ipmi_rxqueue ); - xTaskCreate( IPMITask, (const char*)"IPMI Dispatcher", 100, ( void * ) NULL, tskIPMI_PRIORITY, &TaskIPMI_Handle ); + xTaskCreate( IPMITask, (const char*)"IPMI Dispatcher", 256, ( void * ) NULL, tskIPMI_PRIORITY, &TaskIPMI_Handle ); } /** diff --git a/modules/ipmi.h b/modules/ipmi.h index 930241ba9..74057f311 100644 --- a/modules/ipmi.h +++ b/modules/ipmi.h @@ -467,6 +467,7 @@ * @{ */ #define IPMI_CUSTOM_CMD_MMC_GET_FREE_HEAP 0x01 +#define IPMI_CUSTOM_CMD_GET_GIT_HASH 0x02 /** * @} */ diff --git a/modules/main.c b/modules/main.c index 59c0ffbf2..0590f1a27 100755 --- a/modules/main.c +++ b/modules/main.c @@ -3,6 +3,7 @@ * * Copyright (C) 2015 Henrique Silva * Copyright (C) 2015 Piotr Miedzik + * Copyright (C) 2021 Krzysztof Macias * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,12 +42,19 @@ #ifdef MODULE_RTM #include "rtm.h" #endif +#ifdef MODULE_BOARD_CONFIG +#include "board_config.h" +#endif /*-----------------------------------------------------------*/ int main( void ) { pin_init(); +#ifdef MODULE_BOARD_CONFIG + board_init(); +#endif + #ifdef MODULE_UART_DEBUG uart_init( UART_DEBUG ); #endif @@ -56,15 +64,12 @@ int main( void ) printf("Version: %s\n", g_GIT_TAG); printf("SHA1: %s\n", g_GIT_SHA1); -#ifdef BENCH_TEST - printf("BENCH_TEST mode activated! This will enable some debug functions, be careful!\n"); -#endif - #ifdef MODULE_WATCHDOG watchdog_init(); #endif LED_init(); + i2c_init(); ipmb_addr = get_ipmb_addr( ); @@ -95,6 +100,10 @@ int main( void ) /* NOTE: ipmb_init() is called inside this function */ ipmi_init(); +#ifdef MODULE_BOARD_CONFIG + board_config(); +#endif + /* Start the tasks running. */ vTaskStartScheduler(); diff --git a/modules/max116xx.c b/modules/max116xx.c new file mode 100644 index 000000000..bb0ce19cd --- /dev/null +++ b/modules/max116xx.c @@ -0,0 +1,131 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2021 Augusto Fraga Giachero + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +/** + * @file max116xx.c + * @author Augusto Fraga Giachero + * + * @brief MAX116XX ADC driver + * + * @ingroup MAX116XX + */ + +#include "max116xx.h" +#include "i2c.h" + +mmc_err max116xx_set_config(uint8_t chip_id, const max116xx_cfg* cfg) +{ + uint8_t i2c_addr; + uint8_t i2c_id; + uint8_t tx_len; + uint8_t setup_cfg[2] = {0}; + + if (cfg == NULL) { + return MMC_INVALID_ARG_ERR; + } + + setup_cfg[0] = 0x80 | cfg->ref_sel | cfg->clk_sel | cfg->pol_sel | 0b10; + setup_cfg[1] = cfg->scan_mode | (cfg->channel_sel << 1) | cfg->diff_mode; + + if (i2c_take_by_chipid(chip_id, &i2c_addr, &i2c_id, (TickType_t) 10)) { + tx_len = xI2CMasterWrite(i2c_id, i2c_addr, setup_cfg, sizeof(setup_cfg)); + i2c_give(i2c_id); + } else { + return MMC_TIMEOUT_ERR; + } + + if (tx_len != sizeof(setup_cfg)) { + return MMC_IO_ERR; + } + + return MMC_OK; +} + +mmc_err max116xx_read_uni(uint8_t chip_id, int16_t data[], uint8_t samples) +{ + uint8_t i2c_addr; + uint8_t i2c_id; + uint8_t rx_len = 0; + + if (data == NULL) { + return MMC_INVALID_ARG_ERR; + } + + if (i2c_take_by_chipid(chip_id, &i2c_addr, &i2c_id, (TickType_t) 10)) { + rx_len = xI2CMasterRead(i2c_id, i2c_addr, (uint8_t*)data, (samples * 2)); + i2c_give(i2c_id); + } else { + return MMC_TIMEOUT_ERR; + } + + /* + * Convert from big endian to little endian + */ + for (uint8_t i = 0; i < samples; i++) + { + data[i] = ((data[i] >> 8) & 0x00FF) | ((data[i] << 8) & 0x0300); + } + + if (rx_len != (samples * 2)) { + return MMC_IO_ERR; + } + + return MMC_OK; +} + +mmc_err max116xx_read_bip(uint8_t chip_id, int16_t data[], uint8_t samples) +{ + uint8_t i2c_addr; + uint8_t i2c_id; + uint8_t rx_len = 0; + + if (data == NULL) { + return MMC_INVALID_ARG_ERR; + } + + if (i2c_take_by_chipid(chip_id, &i2c_addr, &i2c_id, (TickType_t) 10)) { + rx_len = xI2CMasterRead(i2c_id, i2c_addr, (uint8_t*)data, (samples * 2)); + i2c_give(i2c_id); + } else { + return MMC_TIMEOUT_ERR; + } + + /* + * Convert from big endian to little endian + */ + for (uint8_t i = 0; i < samples; i++) + { + data[i] = ((data[i] >> 8) & 0x00FF) | ((data[i] << 8) & 0x0300); + + /* + * Sign extend if MSB = 1 + */ + if (data[i] & (1 << 9)) { + data[i] |= 0xFC00; + } + } + + if (rx_len != (samples * 2)) { + return MMC_IO_ERR; + } + + return MMC_OK; +} diff --git a/modules/max116xx.h b/modules/max116xx.h new file mode 100644 index 000000000..f03c81cc1 --- /dev/null +++ b/modules/max116xx.h @@ -0,0 +1,115 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2021 Augusto Fraga Giachero + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +/** + * @file max116xx.h + * @author Augusto Fraga Giachero + * + * @brief MAX116XX ADC driver function declarations + * + * @ingroup MAX116XX + */ + +#ifndef MAX116XX_H_ +#define MAX116XX_H_ + +#include "error.h" +#include "port.h" + +/** + * @brief MAX11606-MAX11611 reference selection enum + */ +enum max116xx_ref_sel { + MAX116XX_REF_VDD = 0b0000000, // VDD as voltage reference, AIN_/REF configured as an analog input + MAX116XX_REF_EXT = 0b0100000, // External reference, AIN_/REF configured as an reference input + MAX116XX_REF_INT_OFF = 0b1000000, // Internal reference off, AIN_/REF configured as an analog input + MAX116XX_REF_INT_ON = 0b1010000, // Internal reference on, AIN_/REF configured as an analog input + MAX116XX_REF_INT_OFF_OUT = 0b1100000, // Internal reference off, AIN_/REF configured as reference output + MAX116XX_REF_INT_ON_OUT = 0b1110000, // Internal reference on, AIN_/REF configured as reference output +}; + +enum max116xx_clk_sel { + MAX116XX_CLK_INT = 0b0000, + MAX116XX_CLK_EXT = 0b1000, +}; + +enum max116xx_pol_sel { + MAX116XX_UNIPOLAR = 0b000, + MAX116XX_BIPOLAR = 0b100, +}; + +enum max116xx_scan_mode { + MAX116XX_SCAN_FROM_AIN0 = 0b000000, + MAX116XX_SCAN_OFF = 0b010000, + MAX116XX_SCAN_UPPER = 0b100000, + MAX116XX_SCAN_OFF_SINGLE_CONV = 0b110000, +}; + +enum max116xx_diff_mode { + MAX116XX_DIFFERENTIAL = 0, + MAX116XX_SINGLE_ENDED = 1, +}; + +/** + * @brief MAX11606-MAX11611 configuration struct + */ +typedef struct { + enum max116xx_ref_sel ref_sel; + enum max116xx_clk_sel clk_sel; + enum max116xx_pol_sel pol_sel; + enum max116xx_scan_mode scan_mode; + uint8_t channel_sel; + enum max116xx_diff_mode diff_mode; +} max116xx_cfg; + +/** + * @brief Configure the MAX11606-MAX11611 ADC + * + * @param[in] chip_id Chip ID to communicate + * @param[in] cfg max116xx_cfg struct with the current configuration + * + * @return MMC_OK if success, an error code otherwise + */ +mmc_err max116xx_set_config(uint8_t chip_id, const max116xx_cfg* cfg); + +/** + * @brief Convert and read single or multiple channels, unipolar mode + * + * @param[in] chip_id Chip ID to communicate + * @param[out] data Array containing the samples, 0 - +1023 range + * @param[in] samples Number of samples requested + * + * @return MMC_OK if success, an error code otherwise + */ +mmc_err max116xx_read_uni(uint8_t chip_id, int16_t data[], uint8_t samples); + +/** + * @brief Convert and read single or multiple channels, bipolar mode + * + * @param[in] chip_id Chip ID to communicate + * @param[out] data Array containing the samples, -512 - +511 range + * @param[in] samples Number of samples requested + * + * @return MMC_OK if success, an error code otherwise + */ +mmc_err max116xx_read_bip(uint8_t chip_id, int16_t data[], uint8_t samples); + +#endif diff --git a/modules/mcp23016.c b/modules/mcp23016.c new file mode 100644 index 000000000..1e8c35074 --- /dev/null +++ b/modules/mcp23016.c @@ -0,0 +1,218 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2021 Krzysztof Macias + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +/** + * @file mcp23016.c + * + * @brief MCP23016 module interface functions implementations + * + * @ingroup MCP23016 + */ + +/* FreeRTOS includes */ +#include "FreeRTOS.h" + +/* Project Includes */ +#include "port.h" +#include "mcp23016.h" +#include "i2c.h" +#include "i2c_mapping.h" + +/** + * @brief MCP23016 General register read + * + * @param[in] reg Selected register + * @param[out] readout Register value read + * + * @return MMC_OK if success, an error code otherwise + */ +static mmc_err mcp23016_read_reg ( uint8_t reg, uint8_t *readout ) +{ + uint8_t i2c_addr; + uint8_t i2c_id; + uint8_t rx_len = 0; + uint8_t data[2] = {0}; + + if (readout == NULL) { + return MMC_INVALID_ARG_ERR; + } + + if( i2c_take_by_chipid( CHIP_ID_MCP23016, &i2c_addr, &i2c_id, (TickType_t) 10) ) { + rx_len = xI2CMasterWriteRead(i2c_id, i2c_addr, reg, data, sizeof(data)); + i2c_give(i2c_id); + } else { + return MMC_TIMEOUT_ERR; + } + + if (rx_len != sizeof(data)) { + return MMC_IO_ERR; + } + + *readout = data[0]; + + return MMC_OK; +} + +/** + * @brief MCP23016 General register write + * + * @param[in] reg Selected register + * @param[in] data Value to write to register + * + * @return MMC_OK if success, an error code otherwise + */ + +static mmc_err mcp23016_write_reg (uint8_t reg, uint8_t data) { + + uint8_t i2c_addr; + uint8_t i2c_id; + uint8_t tx_len = 0; + uint8_t cmd_data[2]; + + cmd_data[0] = reg; + cmd_data[1] = data; + + if( i2c_take_by_chipid( CHIP_ID_MCP23016, &i2c_addr, &i2c_id, (TickType_t) 10) ) { + tx_len = xI2CMasterWrite(i2c_id, i2c_addr, cmd_data, sizeof(cmd_data)); + i2c_give(i2c_id); + } else { + return MMC_TIMEOUT_ERR; + } + + if (tx_len != sizeof(cmd_data)) { + return MMC_IO_ERR; + } + + return MMC_OK; +} + + +/* Pins Read/Write */ +mmc_err mcp23016_read_port( uint8_t port_num, uint8_t *readout ) +{ + return mcp23016_read_reg( MCP23016_GP_REG + port_num, readout ); +} + +mmc_err mcp23016_read_pin( uint8_t port_num, uint8_t pin, uint8_t *status ) +{ + uint8_t pin_read = 0; + mmc_err err; + + err = mcp23016_read_port(port_num, &pin_read ); + + if (status) { + *status = ((pin_read >> pin) & 0x1); + } + + return err; +} + +mmc_err mcp23016_write_port( uint8_t port_num, uint8_t data ) +{ + return mcp23016_write_reg( MCP23016_GP_REG + port_num, data ); +} + +mmc_err mcp23016_write_pin( uint8_t port_num, uint8_t pin, bool data ) +{ + uint8_t output = 0; + mmc_err err; + + err = mcp23016_read_port( port_num, &output ); + + if (err != MMC_OK) { + return err; + } + + output &= ~( 1 << pin ); + output |= ( data << pin ); + + return mcp23016_write_port( port_num, output ); +} + +/* Polarity Control */ +mmc_err mcp23016_set_port_pol( uint8_t port_num, uint8_t pol ) +{ + return mcp23016_write_reg( MCP23016_IPOL_REG + port_num, pol ); +} + +mmc_err mcp23016_get_port_pol( uint8_t port_num, uint8_t *pol ) +{ + return mcp23016_read_reg( MCP23016_IPOL_REG + port_num, pol ); +} + +/* Pins direction (output/input) */ +mmc_err mcp23016_set_port_dir( uint8_t port_num, uint8_t dir ) +{ + return mcp23016_write_reg( MCP23016_IODIR_REG + port_num, dir ); +} + +mmc_err mcp23016_get_port_dir( uint8_t port_num, uint8_t *dir ) +{ + return mcp23016_read_reg( MCP23016_IODIR_REG + port_num, dir ); +} + + +mmc_err mcp23016_read_reg_pair ( uint8_t reg, uint16_t *readout ) { + uint8_t i2c_addr; + uint8_t i2c_id; + uint8_t rx_len = 0; + uint8_t data[2] = {0}; + + if( i2c_take_by_chipid( CHIP_ID_MCP23016, &i2c_addr, &i2c_id, (TickType_t) 10) ) { + rx_len = xI2CMasterWriteRead(i2c_id, i2c_addr, reg, data, sizeof(data)); + i2c_give(i2c_id); + } else { + return MMC_TIMEOUT_ERR; + } + + if (rx_len != sizeof(data)) { + return MMC_IO_ERR; + } + + *readout = (data[0] << 8) | data[1]; + + return MMC_OK; +} + +mmc_err mcp23016_write_reg_pair ( uint8_t reg, uint16_t data ) +{ + uint8_t i2c_addr; + uint8_t i2c_id; + uint8_t cmd_data[3] = { + reg, + (data >> 8) & 0xFF, + (data) & 0xFF + }; + uint8_t tx_len = 0; + + if( i2c_take_by_chipid( CHIP_ID_MCP23016, &i2c_addr, &i2c_id, (TickType_t) 10) ) { + tx_len = xI2CMasterWrite(i2c_id, i2c_addr, cmd_data, sizeof(cmd_data)); + i2c_give(i2c_id); + } else { + return MMC_TIMEOUT_ERR; + } + + if (tx_len != sizeof(cmd_data)) { + return MMC_IO_ERR; + } + + return MMC_OK; +} diff --git a/modules/mcp23016.h b/modules/mcp23016.h new file mode 100644 index 000000000..d4bdb5e87 --- /dev/null +++ b/modules/mcp23016.h @@ -0,0 +1,176 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2021 Krzysztof Macias + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +/** + * @file mcp23016.h + * + * @brief MCP23016 module interface functions declarations + * + * @ingroup MCP23016 + */ + +#ifndef MCP23016_H_ +#define MCP23016_H_ + +#include "error.h" +#include "port.h" + +/** + * @defgroup MCP23016 MCP23016 16-bit I2C/SMBus I/O Expander Module + * @ingroup PERIPH_IC + */ + +/** + * @defgroup MCP23016_REGS MCP23016 Registers + * @ingroup MCP23016 + * @{ + */ + +/** + * @brief MCP23016 General purpose I/O port register (Read/write) + * @note Default register value = 0x00 + */ +#define MCP23016_GP_REG 0x0 + +/** + * @brief MCP23016 Output latch register (Read/write) + * @note Default register value = 0x00 + */ +#define MCP23016_OLAT_REG 0x2 + +/** + * @brief MCP23016 Input polarity port register (Read/write) + * @note Default register value = 0x00 + */ +#define MCP23016_IPOL_REG 0x4 + +/** + * @brief MCP23016 I/O direction register (Read/write) + * @note Default register value = 0xFF + */ +#define MCP23016_IODIR_REG 0x6 + +/** + * @brief MCP23016 Interrupt captured value register (Read only) + * @note Default register value not defined + */ +#define MCP23016_INTCAP_REG 0x8 + +/** + * @brief MCP23016 I/0 control register (Read/write) + * @note Default register value not defined + */ +#define MCP23016_IOCON_REG 0xA + +/** + * @} + */ + + +/* Pins Read/Write */ +/** + * @brief Read port pins status + * + * @param[in] port_num Port number (0, 1) + * @param[out] readout 8-bit value with the status of port pins + * + * @return MMC_OK if success, an error code otherwise + */ +mmc_err mcp23016_read_port( uint8_t port_num, uint8_t *readout ); + +/** + * @brief Read a pin status + * + * @param[in] port_num Port number (0, 1) + * @param[in] pin Selected pin to read + * @param[out] status Pin logical status + * + * @return MMC_OK if success, an error code otherwise + */ +mmc_err mcp23016_read_pin( uint8_t port_num, uint8_t pin, uint8_t *status ); + +/** + * @brief Write port output pins + * + * @param[in] port_num Port number (0, 1) + * @param[in] data 8-bit value with the pins status + * + * @return MMC_OK if success, an error code otherwise + */ +mmc_err mcp23016_write_port( uint8_t port_num, uint8_t data ); + +/** + * @brief Write a output pin + * + * @param[in] port_num Port number (0, 1) + * @param[in] pin Selected pin to write + * @param[in] data Logical status to be set + * + * @return MMC_OK if success, an error code otherwise + */ +mmc_err mcp23016_write_pin( uint8_t port_num, uint8_t pin, bool data ); + +/* Polarity Control */ +/** + * @brief Set port pins polarity + * + * @param[in] port_num Port number (0, 1) + * @param[in] pol Polarity (active-high/low) + * + * @return MMC_OK if success, an error code otherwise + */ +mmc_err mcp23016_set_port_pol( uint8_t port_num, uint8_t pol ); + +/** + * @brief Read port pins polarity + * + * @param[in] port_num Port number (0, 1) + * @param[out] pol Pins polarity (active-high/low) + * + * @return MMC_OK if success, an error code otherwise + */ +mmc_err mcp23016_get_port_pol( uint8_t port_num, uint8_t *pol ); + +/* Pins direction (output/input) */ +/** + * @brief Set port pins direction + * + * @param[in] port_num Port number (0, 1) + * @param[in] dir Pin direction ( 0-Output 1-Input ) + * + * @return MMC_OK if success, an error code otherwise + */ +mmc_err mcp23016_set_port_dir( uint8_t port_num, uint8_t dir ); + +/** + * @brief Read port pins direction + * + * @param[in] port_num Port number (0, 1) + * @param[out] dir Pin direction ( 0-Output 1-Input ) + * + * @return MMC_OK if success, an error code otherwise + */ +mmc_err mcp23016_get_port_dir( uint8_t port_num, uint8_t *dir ); + +mmc_err mcp23016_read_reg_pair( uint8_t reg, uint16_t *readout); +mmc_err mcp23016_write_reg_pair( uint8_t reg, uint16_t data); + +#endif diff --git a/modules/pca9554.c b/modules/pca9554.c index 03138d5f8..be8922db8 100644 --- a/modules/pca9554.c +++ b/modules/pca9554.c @@ -40,12 +40,13 @@ /** * @brief PCA9554 General register read * + * @param[in] chip_id Chip ID to communicate * @param[in] reg Selected register * @param[out] readout Register value read * * @return Number of bytes read (1 if successful, 0 if failure) */ -static uint8_t pca9554_read_reg ( uint8_t reg, uint8_t *readout ) +static uint8_t pca9554_read_reg ( uint8_t chip_id, uint8_t reg, uint8_t *readout ) { uint8_t i2c_addr; uint8_t i2c_id; @@ -55,7 +56,7 @@ static uint8_t pca9554_read_reg ( uint8_t reg, uint8_t *readout ) return 0; } - if( i2c_take_by_chipid( CHIP_ID_RTM_PCA9554, &i2c_addr, &i2c_id, (TickType_t) 10) ) { + if( i2c_take_by_chipid( chip_id, &i2c_addr, &i2c_id, (TickType_t) 10) ) { rx_len = xI2CMasterWriteRead(i2c_id, i2c_addr, reg, readout, 1); i2c_give(i2c_id); } @@ -65,19 +66,20 @@ static uint8_t pca9554_read_reg ( uint8_t reg, uint8_t *readout ) /** * @brief PCA9554 General register write * - * @param reg Selected register - * @param data Value to write to register + * @param[in] chip_id Chip ID to communicate + * @param[in] reg Selected register + * @param[in] data Value to write to register * * @return Number of bytes written */ -static uint8_t pca9554_write_reg ( uint8_t reg, uint8_t data ) +static uint8_t pca9554_write_reg ( uint8_t chip_id, uint8_t reg, uint8_t data ) { uint8_t i2c_addr; uint8_t i2c_id; uint8_t cmd_data[2] = {reg, data}; uint8_t tx_len = 0; - if( i2c_take_by_chipid( CHIP_ID_RTM_PCA9554, &i2c_addr, &i2c_id, (TickType_t) 10) ) { + if( i2c_take_by_chipid( chip_id, &i2c_addr, &i2c_id, (TickType_t) 10) ) { tx_len = xI2CMasterWrite(i2c_id, i2c_addr, cmd_data, sizeof(cmd_data)); i2c_give(i2c_id); } @@ -86,16 +88,16 @@ static uint8_t pca9554_write_reg ( uint8_t reg, uint8_t data ) } /* Pins Read/Write */ -uint8_t pca9554_read_port( uint8_t *readout ) +uint8_t pca9554_read_port( uint8_t chip_id, uint8_t *readout ) { - return pca9554_read_reg( PCA9554_INPUT_REG, readout ); + return pca9554_read_reg( chip_id, PCA9554_INPUT_REG, readout ); } -uint8_t pca9554_read_pin( uint8_t pin, uint8_t *status ) +uint8_t pca9554_read_pin( uint8_t chip_id, uint8_t pin, uint8_t *status ) { uint8_t rx_len, pin_read = 0; - rx_len = pca9554_read_port( &pin_read ); + rx_len = pca9554_read_port( chip_id, &pin_read ); if (status) { *status = ((pin_read >> pin) & 0x1); @@ -104,49 +106,49 @@ uint8_t pca9554_read_pin( uint8_t pin, uint8_t *status ) return rx_len; } -uint8_t pca9554_write_port( uint8_t data ) +uint8_t pca9554_write_port( uint8_t chip_id, uint8_t data ) { - return pca9554_write_reg( PCA9554_OUTPUT_REG, data ); + return pca9554_write_reg( chip_id, PCA9554_OUTPUT_REG, data ); } -uint8_t pca9554_write_pin( uint8_t pin, bool data ) +uint8_t pca9554_write_pin( uint8_t chip_id, uint8_t pin, bool data ) { uint8_t output = 0; - pca9554_read_port( &output ); + pca9554_read_port( chip_id, &output ); output &= ~( 1 << pin ); output |= ( data << pin ); - return pca9554_write_port( output ); + return pca9554_write_port( chip_id, output ); } /* Polarity Control */ -uint8_t pca9554_set_port_pol( uint8_t pol ) +uint8_t pca9554_set_port_pol( uint8_t chip_id, uint8_t pol ) { - return pca9554_write_reg( PCA9554_POLARITY_REG, pol ); + return pca9554_write_reg( chip_id, PCA9554_POLARITY_REG, pol ); } -uint8_t pca9554_set_pin_pol( uint8_t pin, bool pol ) +uint8_t pca9554_set_pin_pol( uint8_t chip_id, uint8_t pin, bool pol ) { uint8_t pol_reg = 0; - pca9554_read_port( &pol_reg ); + pca9554_read_port( chip_id, &pol_reg ); pol_reg &= ~( 1 << pin ); pol_reg |= ( pol << pin ); - return pca9554_set_port_pol( pol_reg ); + return pca9554_set_port_pol( chip_id, pol_reg ); } -uint8_t pca9554_get_port_pol( uint8_t *pol ) +uint8_t pca9554_get_port_pol( uint8_t chip_id, uint8_t *pol ) { - return pca9554_read_reg( PCA9554_POLARITY_REG, pol ); + return pca9554_read_reg( chip_id, PCA9554_POLARITY_REG, pol ); } -uint8_t pca9554_get_pin_pol( uint8_t pin, uint8_t *pol ) +uint8_t pca9554_get_pin_pol( uint8_t chip_id, uint8_t pin, uint8_t *pol ) { uint8_t rx_len; - rx_len = pca9554_get_port_pol( pol ); + rx_len = pca9554_get_port_pol( chip_id, pol ); /* Mask all bits, except the one requested */ *pol = ((*pol >> pin) & 0x1); @@ -155,32 +157,32 @@ uint8_t pca9554_get_pin_pol( uint8_t pin, uint8_t *pol ) } /* Pins direction (output/input) */ -uint8_t pca9554_set_port_dir( uint8_t dir ) +uint8_t pca9554_set_port_dir( uint8_t chip_id, uint8_t dir ) { - return pca9554_write_reg( PCA9554_CFG_REG, dir ); + return pca9554_write_reg( chip_id, PCA9554_CFG_REG, dir ); } -uint8_t pca9554_set_pin_dir( uint8_t pin, bool dir ) +uint8_t pca9554_set_pin_dir( uint8_t chip_id, uint8_t pin, bool dir ) { uint8_t dir_reg = 0; - pca9554_read_port( &dir_reg ); + pca9554_read_port( chip_id, &dir_reg ); dir_reg &= ~( 1 << pin ); dir_reg |= ( dir << pin ); - return pca9554_set_port_dir( dir_reg ); + return pca9554_set_port_dir( chip_id, dir_reg ); } -uint8_t pca9554_get_port_dir( uint8_t *dir ) +uint8_t pca9554_get_port_dir( uint8_t chip_id, uint8_t *dir ) { - return pca9554_read_reg( PCA9554_CFG_REG, dir ); + return pca9554_read_reg( chip_id, PCA9554_CFG_REG, dir ); } -uint8_t pca9554_get_pin_dir( uint8_t pin, uint8_t *dir ) +uint8_t pca9554_get_pin_dir( uint8_t chip_id, uint8_t pin, uint8_t *dir ) { uint8_t rx_len; - rx_len = pca9554_get_port_dir( dir ); + rx_len = pca9554_get_port_dir( chip_id, dir ); /* Mask all bits, except the one requested */ *dir = ((*dir >> pin) & 0x1); diff --git a/modules/pca9554.h b/modules/pca9554.h index bc0feb376..c8cae6e7f 100644 --- a/modules/pca9554.h +++ b/modules/pca9554.h @@ -75,104 +75,129 @@ /** * @brief Read all pins status * - * @return 8-bit value with the pins status + * @param[in] chip_id Chip ID to communicate + * @param[out] readout 8-bit value with the pins status + * + * @return Number of bytes read from the device */ -uint8_t pca9554_read_port( uint8_t *readout ); +uint8_t pca9554_read_port( uint8_t chip_id, uint8_t *readout ); /** * @brief Read a pin status * - * @param pin Selected pin to read + * @param[in] chip_id Chip ID to communicate + * @param[in] pin Selected pin to read + * @param[out] status Pin logical status * - * @return Pin logical status + * @return Number of bytes read from the device */ -uint8_t pca9554_read_pin( uint8_t pin, uint8_t *status ); +uint8_t pca9554_read_pin( uint8_t chip_id, uint8_t pin, uint8_t *status ); /** * @brief Write all output pins * - * @param data 8-bit value with the pins status + * @param[in] chip_id Chip ID to communicate + * @param[in] data 8-bit value with the pins status * - * @return None + * @return Number of bytes written to the device */ -uint8_t pca9554_write_port( uint8_t data ); +uint8_t pca9554_write_port( uint8_t chip_id, uint8_t data ); /** * @brief Write a output pin * - * @param pin Selected pin to write - * @param data Logical status to be set + * @param[in] chip_id Chip ID to communicate + * @param[in] pin Selected pin to write + * @param[in] data Logical status to be set * - * @return None + * @return Number of bytes written to the device */ -uint8_t pca9554_write_pin( uint8_t pin, bool data ); +uint8_t pca9554_write_pin( uint8_t chip_id, uint8_t pin, bool data ); /* Polarity Control */ /** * @brief Set all pins polarity * - * @param pol Polarity (active-high/low) + * @param[in] chip_id Chip ID to communicate + * @param[in] pol Polarity (active-high/low) + * + * @return Number of bytes written to the device */ -uint8_t pca9554_set_port_pol( uint8_t pol ); +uint8_t pca9554_set_port_pol( uint8_t chip_id, uint8_t pol ); /** * @brief Set pin polarity * - * @param pin Selected pin - * @param pol Pin Polarity (active-high/low) + * @param[in] chip_id Chip ID to communicate + * @param[in] pin Selected pin + * @param[in] pol Pin Polarity (active-high/low) + * + * @return Number of bytes written to the device */ -uint8_t pca9554_set_pin_pol( uint8_t pin, bool pol ); +uint8_t pca9554_set_pin_pol( uint8_t chip_id, uint8_t pin, bool pol ); /** * @brief Read all pins polarity * - * @return Pins polarity (active-high/low) + * @param[in] chip_id Chip ID to communicate + * @param[out] pol Pins polarity (active-high/low) + * + * @return Number of bytes written to the device */ -uint8_t pca9554_get_port_pol( uint8_t *pol ); +uint8_t pca9554_get_port_pol( uint8_t chip_id, uint8_t *pol ); /** * @brief Read pin polarity * - * @param pin Selected pin + * @param[in] chip_id Chip ID to communicate + * @param[in] pin Selected pin + * @param[out] pol Pin polarity value * - * @return Pin polarity value + * @return Number of bytes read from the device */ -uint8_t pca9554_get_pin_pol( uint8_t pin, uint8_t *pol ); +uint8_t pca9554_get_pin_pol( uint8_t chip_id, uint8_t pin, uint8_t *pol ); /* Pins direction (output/input) */ /** * @brief Set all pins direction * - * @param dir Pin direction ( 0-Output 1-Input ) + * @param[in] chip_id Chip ID to communicate + * @param[in] dir Pin direction ( 0-Output 1-Input ) * - * @return None + * @return Number of bytes read from the device */ -uint8_t pca9554_set_port_dir( uint8_t dir ); +uint8_t pca9554_set_port_dir( uint8_t chip_id, uint8_t dir ); /** * @brief Set pin direction * - * @param pin Selected pin - * @param dir Pin direction ( 0-Output 1-Input ) + * @param[in] chip_id Chip ID to communicate + * @param[in] pin Selected pin + * @param[in] dir Pin direction ( 0-Output 1-Input ) * - * @return None + * @return Number of bytes written to the device */ -uint8_t pca9554_set_pin_dir( uint8_t pin, bool dir ); +uint8_t pca9554_set_pin_dir( uint8_t chip_id, uint8_t pin, bool dir ); /** * @brief Read all pins direction * - * @return 8-bit value with the pins direction setup + * @param[in] chip_id Chip ID to communicate + * @param[out] dir 8-bit value with the pins direction setup + * + * @return Number of bytes written to the device */ -uint8_t pca9554_get_port_dir( uint8_t *dir ); +uint8_t pca9554_get_port_dir( uint8_t chip_id, uint8_t *dir ); /** * @brief Read pin direction * - * @param pin Selected pin + * @param[in] chip_id Chip ID to communicate + * @param[in] pin Selected pin + * @param[out] dir Pin direction * - * @return Pin direction + * @return Number of bytes read from the device */ -uint8_t pca9554_get_pin_dir( uint8_t pin, uint8_t *dir ); +uint8_t pca9554_get_pin_dir( uint8_t chip_id, uint8_t pin, uint8_t *dir ); #endif diff --git a/modules/printf-stdarg.c b/modules/printf-stdarg.c index e39be77ee..1825315cf 100644 --- a/modules/printf-stdarg.c +++ b/modules/printf-stdarg.c @@ -35,7 +35,14 @@ static void printchar(char **str, int c) **str = c; ++(*str); } - else (void)putchar(c); + else { + if (c == '\n') { + int cr = '\r'; + (void) putchar(cr); + } + (void) putchar(c); + } + } #define PAD_RIGHT 1 diff --git a/modules/sdr.c b/modules/sdr.c index 07555ccc5..32e7284a2 100644 --- a/modules/sdr.c +++ b/modules/sdr.c @@ -109,6 +109,9 @@ void sensor_init( void ) #if defined(MODULE_INA220_CURRENT) || defined(MODULE_INA220_VOLTAGE) ina220_init(); #endif +#if defined(MODULE_INA3221_CURRENT) || defined(MODULE_INA3221_VOLTAGE) + ina3221_init(); +#endif } void sdr_init( void ) @@ -156,6 +159,19 @@ sensor_t * sdr_insert_entry( SDR_TYPE type, void * sdr, TaskHandle_t *monitor_ta return entry; } +sensor_t * sdr_add_settings(uint8_t chipid, void * settings) +{ + sensor_t * sensor; + + for (sensor = sdr_head; sensor != NULL; sensor = sensor->next) { + if (sensor->chipid == chipid) { + sensor->settings = settings; + } + } + + return NULL; +} + sensor_t * find_sensor_by_sdr( void * sdr ) { sensor_t * cur; diff --git a/modules/sdr.h b/modules/sdr.h index 97597e212..8a538f5a3 100644 --- a/modules/sdr.h +++ b/modules/sdr.h @@ -207,6 +207,7 @@ typedef struct sensor_t { uint16_t lower_non_critical_go_high:1; uint16_t lower_non_critical_go_low:1; } asserted_event; + void* settings; struct sensor_t *next; } sensor_t; @@ -234,6 +235,7 @@ void sensor_state_check( sensor_t *sensor ); sensor_t * sdr_insert_entry( SDR_TYPE type, void * sdr, TaskHandle_t *monitor_task, uint8_t diag_id, uint8_t slave_addr); void sdr_remove_entry( sensor_t * entry ); void sdr_pop( void ); +sensor_t * sdr_add_settings(uint8_t chipid, void * settings); sensor_t * find_sensor_by_sdr( void * sdr ); sensor_t * find_sensor_by_id( uint8_t id ); diff --git a/modules/sensors/CMakeLists.txt b/modules/sensors/CMakeLists.txt index 66ad3139e..42c8ac670 100644 --- a/modules/sensors/CMakeLists.txt +++ b/modules/sensors/CMakeLists.txt @@ -28,6 +28,16 @@ if (";${TARGET_MODULES};" MATCHES ";INA220_CURRENT;") set(MODULES_FLAGS "${MODULES_FLAGS} -DMODULE_INA220_CURRENT") endif() +if (";${TARGET_MODULES};" MATCHES ";INA3221_VOLTAGE;") + set(PROJ_SRCS ${PROJ_SRCS} ${SENSOR_PATH}/ina3221.c) + set(MODULES_FLAGS "${MODULES_FLAGS} -DMODULE_INA3221_VOLTAGE") +endif() + +if (";${TARGET_MODULES};" MATCHES ";INA3221_CURRENT;") + set(PROJ_SRCS ${PROJ_SRCS} ${SENSOR_PATH}/ina3221.c) + set(MODULES_FLAGS "${MODULES_FLAGS} -DMODULE_INA3221_CURRENT") +endif() + set(PROJ_SRCS ${PROJ_SRCS} ${SENSOR_PATH} PARENT_SCOPE) set(PROJ_HDRS ${PROJ_HDRS} ${SENSOR_PATH} PARENT_SCOPE) set(MODULES_FLAGS "${MODULES_FLAGS}" PARENT_SCOPE) diff --git a/modules/sensors/hotswap.c b/modules/sensors/hotswap.c index adc76cdeb..4a5cdab6c 100644 --- a/modules/sensors/hotswap.c +++ b/modules/sensors/hotswap.c @@ -41,6 +41,7 @@ #include "fru.h" #include "utils.h" #include "uart_debug.h" +#include "payload.h" #ifdef MODULE_RTM #include "rtm.h" @@ -136,6 +137,11 @@ void vTaskHotSwap( void *Parameters ) continue; } + bool standalone_mode = false; + if (get_ipmb_addr() == IPMB_ADDR_DISCONNECTED) { + standalone_mode = true; + } + if ( new_state_amc ^ old_state_amc ) { if ( new_state_amc == 0 ) { printf("AMC Hotswap handle pressed!\n"); @@ -147,9 +153,9 @@ void vTaskHotSwap( void *Parameters ) hotswap_clear_mask_bit( HOTSWAP_AMC, 1 << (!new_state_amc) ); old_state_amc = new_state_amc; } -#ifdef BENCH_TEST - old_state_amc = new_state_amc; -#endif + if (!standalone_mode) { + old_state_amc = new_state_amc; + } } #ifdef MODULE_RTM @@ -166,23 +172,28 @@ void vTaskHotSwap( void *Parameters ) if ( new_state_rtm ^ old_state_rtm ) { if ( new_state_rtm == 0 ) { printf("RTM Hotswap handle pressed!\n"); -#ifdef BENCH_TEST - payload_send_message(FRU_RTM, PAYLOAD_MESSAGE_RTM_ENABLE); -#endif + + if (!standalone_mode) { + payload_send_message(FRU_RTM, PAYLOAD_MESSAGE_RTM_ENABLE); + } } else { - printf("RTM Hotswap handle released!\n"); -#ifdef BENCH_TEST - payload_send_message(FRU_RTM, PAYLOAD_MESSAGE_QUIESCE); -#endif + printf("RTM Hotswap handle released!\n"); + + if (!standalone_mode) { + payload_send_message(FRU_RTM, PAYLOAD_MESSAGE_QUIESCE); + } + } if ( hotswap_send_event( hotswap_rtm_sensor, new_state_rtm ) == ipmb_error_success ) { hotswap_set_mask_bit( HOTSWAP_RTM, 1 << new_state_rtm ); hotswap_clear_mask_bit( HOTSWAP_RTM, 1 << (!new_state_rtm) ); old_state_rtm = new_state_rtm; } -#ifdef BENCH_TEST - old_state_rtm = new_state_rtm; -#endif + + if (!standalone_mode) { + old_state_rtm = new_state_rtm; + } + } #endif } diff --git a/modules/sensors/ina3221.c b/modules/sensors/ina3221.c new file mode 100644 index 000000000..c6f62898d --- /dev/null +++ b/modules/sensors/ina3221.c @@ -0,0 +1,187 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2015-2016 Henrique Silva + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +/** + * @file ina3221.c + * + * @brief INA3221 interface implementation + * + * @ingroup INA3221 + */ + +/* FreeRTOS Includes */ +#include "FreeRTOS.h" +#include "task.h" + +/* Project Includes */ +#include "port.h" +#include "sdr.h" +#include "task_priorities.h" +#include "i2c.h" +#include "i2c_mapping.h" +#include "fpga_spi.h" +#include "fru.h" +#include "ina3221.h" + +TaskHandle_t vTaskINA3221_Handle; + +static ina3221_data_t ina3221_data[MAX_INA3221_COUNT]; + +void vTaskINA3221( void *Parameters ) +{ + uint8_t chip_num; + uint8_t channel; + TickType_t xLastWakeTime; + /* Task will run every 100ms */ + const TickType_t xFrequency = INA3221_UPDATE_RATE / portTICK_PERIOD_MS; + + sensor_t * ina3221_sensor; + ina3221_data_t * data_ptr; + SDR_type_01h_t * sdr; + + /* Initialise the xLastWakeTime variable with the current time. */ + xLastWakeTime = xTaskGetTickCount(); + + for (;;) { + /* Read all registers from the INA3221s */ + for ( chip_num = 0; chip_num < MAX_INA3221_COUNT; chip_num++) { + + if (!(ina3221_data[chip_num].chipid)){ + break; + } + + if (!(ina3221_read_voltages( &ina3221_data[chip_num] ))) { + break; + } + + for ( uint8_t i = 0; i < 6; i++ ) { + + ina3221_sensor = ina3221_data[chip_num].sensors[i]; + data_ptr = &ina3221_data[chip_num]; + + if (ina3221_sensor == NULL) { + continue; + } + + sdr = (SDR_type_01h_t*)ina3221_sensor->sdr; + channel = sdr->OEM; + + switch ((GET_SENSOR_TYPE(ina3221_sensor))) { + case SENSOR_TYPE_VOLTAGE: + ina3221_sensor->readout_value = data_ptr->regs[2 * channel + 1] >> 6; + break; + case SENSOR_TYPE_CURRENT: + ina3221_sensor->readout_value = (((data_ptr->regs[2 * channel] >> 3) * 40) / ina3221_data[chip_num].config->shunt_resistor[channel]) >> 5; + break; + default: + break; + } + + /* Check for threshold events */ + sensor_state_check(ina3221_sensor); + check_sensor_event(ina3221_sensor); + } + + } + vTaskDelayUntil( &xLastWakeTime, xFrequency ); + } +} + +uint8_t ina3221_read_reg( ina3221_data_t * data, uint8_t reg, uint16_t *read ) +{ + uint8_t i2c_interf, i2c_addr; + uint8_t val[2] = {0}; + uint8_t rx_len = 0; + + if( i2c_take_by_chipid( data->chipid, &i2c_addr, &i2c_interf, portMAX_DELAY) == pdTRUE ) { + + rx_len = xI2CMasterWriteRead( i2c_interf, i2c_addr, reg, &val[0], sizeof(val)/sizeof(val[0]) ); + + i2c_give( i2c_interf ); + + *read = (val[0] << 8) | (val[1]); + } + + return rx_len; +} + +uint8_t ina3221_read_voltages( ina3221_data_t * data ) +{ + uint8_t ret = 0xFF; + /* Read INA3221 Bus Voltage and Shunt Voltage Registers */ + for ( uint8_t i = 0; i < INA3221_VOLTAGE_REGISTERS; i++ ) { + ret &= ina3221_read_reg(data, i + 1, &(data->regs[i]) ); + } + return ret; +} + + +void ina3221_init( void ) +{ + sensor_t *tmp_sensor; + SDR_type_01h_t* sdr; + uint8_t ina_channel_num; + uint8_t chip_num; + uint8_t sens_num; + uint8_t signed_flag; + + xTaskCreate( vTaskINA3221, "INA3221", 200, (void *) NULL, tskINA3221SENSOR_PRIORITY, &vTaskINA3221_Handle); + + /* Iterate through the SDR Table to find all the INA3221 entries */ + for ( tmp_sensor = sdr_head; tmp_sensor != NULL; tmp_sensor = tmp_sensor->next) { + + if ( tmp_sensor->task_handle == NULL ) { + continue; + } + + /* Check if this task should update the selected SDR */ + if ( *(tmp_sensor->task_handle) != vTaskINA3221_Handle ) { + continue; + } + + sdr = (SDR_type_01h_t*)tmp_sensor->sdr; + ina_channel_num = sdr->OEM; + + for (chip_num = 0; chip_num < MAX_INA3221_COUNT; chip_num++) { + + if (tmp_sensor->chipid == ina3221_data[chip_num].chipid + || !(ina3221_data[chip_num].chipid)) { + + if ((GET_SENSOR_TYPE(tmp_sensor)) == SENSOR_TYPE_VOLTAGE ) { + signed_flag = 0; + sens_num = ina_channel_num; + } else if ((GET_SENSOR_TYPE(tmp_sensor)) == SENSOR_TYPE_CURRENT ) { + signed_flag = 1; + sens_num = ina_channel_num + 3; + } else { + break; + } + + ina3221_data[chip_num].chipid = tmp_sensor->chipid; + ina3221_data[chip_num].config = (ina3221_config_t *) tmp_sensor->settings; + ina3221_data[chip_num].sensors[sens_num] = tmp_sensor; + ina3221_data[chip_num].sensors[sens_num]->signed_flag = signed_flag; + + break; + } + } + } +} diff --git a/modules/sensors/ina3221.h b/modules/sensors/ina3221.h new file mode 100644 index 000000000..84224d634 --- /dev/null +++ b/modules/sensors/ina3221.h @@ -0,0 +1,133 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2015-2016 Henrique Silva + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +/** + * @defgroup INA3221 INA3221 - High- or Low-Side, Bidirectional Current and Power Monitor + * @ingroup SENSORS + * + * The INA3221 is a current shunt and power monitor with an I2C- or SMBUS-compatible interface.
+ * The INA3221 monitors both shunt drop and supply voltage. + */ + +/** + * @file ina3221.h + * + * @brief Definitions for INA3221 Current/Voltage Sensor + * + * @ingroup INA3221 + */ + +#ifndef INA3221_H_ +#define INA3221_H_ + +#include "FreeRTOS.h" +#include "port.h" + +#define MAX_INA3221_COUNT 6 +#define INA3221_UPDATE_RATE 100 + +#define INA3221_CHANNEL_1 0 +#define INA3221_CHANNEL_2 1 +#define INA3221_CHANNEL_3 2 + +/** + * @defgroup INA3221_REGS INA3221 Registers + * @ingroup INA3221 + * @{ + */ + +#define INA3221_CONFIG 0x00 +#define INA3221_SHUNT_VOLTAGE 0x01 +#define INA3221_BUS_VOLTAGE 0x02 +#define INA3221_CRITICAL_ALERT_LIMIT 0x07 +#define INA3221_WARNING_ALERT_LIMIT 0x08 +#define INA3221_SHUNT_VOLTAGE_SUM 0x0D +#define INA3221_SHUNT_VOLTAGE_SUM_LIMIT 0x0E +#define INA3221_MASK_ENABLE 0x0F +#define INA3221_POWER_UPPER_VALID 0x10 +#define INA3221_POWER_VALID_LOWER_LIMIT 0x11 +#define INA3221_MANUFACTURER_ID 0xFE +#define INA3221_DIE_ID 0xFF + +/** + * @} + */ + +/* Operating modes */ +#define INA3221_MODE_POWER_DOWN 0x0 +#define INA3221_MODE_SHUNT_TRIG 0x1 +#define INA3221_MODE_BUS_TRIG 0x2 +#define INA3221_MODE_SHUNT_BUS_TRIG 0x3 +#define INA3221_MODE_SHUNT_CONT 0x5 +#define INA3221_MODE_BUS_CONT 0x6 +#define INA3221_MODE_SHUNT_BUS_CONT 0x7 + +/** + * @brief INA3221 Register Count + */ +#define INA3221_VOLTAGE_REGISTERS 6 + +#define INA3221_MAX_DELAY 10 /* worst case delay in ms */ + +#define INA3221_RSHUNT_DEFAULT 2 + +typedef union { + struct { +#ifdef BF_MS_FIRST + uint16_t mode:3; + uint16_t shunt_voltage_conversion_time:3; + uint16_t bus_voltage_conversion_time:3; + uint16_t averaging_mode:3; + uint16_t channel_enable_mode:3; + uint16_t reset:1; +#else + uint16_t reset:1; + uint16_t channel_enable_mode:3; + uint16_t averaging_mode:3; + uint16_t bus_voltage_conversion_time:3; + uint16_t shunt_voltage_conversion_time:3; + uint16_t mode:3; +#endif + } cfg_struct; + uint16_t cfg_word; +} ina3221_config_reg_t; + +typedef struct { + uint16_t shunt_resistor[3]; /* mOhm */ +} ina3221_config_t; + +typedef struct { + uint8_t chipid; + sensor_t * sensors[6]; + const ina3221_config_t * config; + uint32_t rshunt; + ina3221_config_reg_t curr_reg_config; + uint16_t regs[INA3221_VOLTAGE_REGISTERS]; +} ina3221_data_t; + +extern TaskHandle_t vTaskINA3221_Handle; + +uint8_t ina3221_read_reg( ina3221_data_t * data, uint8_t reg, uint16_t *read ); +uint8_t ina3221_read_voltages( ina3221_data_t * data ); +void ina3221_init( void ); +void vTaskINA3221( void* Parameters ); + +#endif diff --git a/modules/sensors/sensors.h b/modules/sensors/sensors.h index 4b656380a..8737f3267 100644 --- a/modules/sensors/sensors.h +++ b/modules/sensors/sensors.h @@ -36,10 +36,16 @@ #ifndef SENSORS_H_ #define SENSORS_H_ +#include "port.h" + #if defined(MODULE_INA220_VOLTAGE) || defined(MODULE_INA220_CURRENT) #include "ina220.h" #endif +#if defined(MODULE_INA3221_VOLTAGE) || defined(MODULE_INA3221_CURRENT) +#include "ina3221.h" +#endif + #ifdef MODULE_HOTSWAP #include "hotswap.h" #endif diff --git a/modules/sys_utils.c b/modules/sys_utils.c new file mode 100644 index 000000000..6a56a05eb --- /dev/null +++ b/modules/sys_utils.c @@ -0,0 +1,60 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2021 Augusto Fraga Giachero + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +/** + * @file sys_utils.c + * @author Augusto Fraga Giachero + * + * @brief System utilities functions + * + * @ingroup sysutils + */ + +/* FreeRTOS includes */ +#include "FreeRTOS.h" +#include "timers.h" + +/* Project includes */ +#include "port.h" + +static void sys_reset_callback(TimerHandle_t timer) +{ + xTimerDelete(timer, 0); + mcu_reset(); +} + +int sys_schedule_reset(int period_ms) +{ + TimerHandle_t timer_sys_rst; + int ret = 0; + + timer_sys_rst = xTimerCreate("System Reset", pdMS_TO_TICKS(period_ms), + pdFALSE, (void*)0, sys_reset_callback); + + if (timer_sys_rst != NULL) { + BaseType_t start_res = xTimerStart(timer_sys_rst, 0); + if (start_res == pdFAIL) ret = -1; + } else { + ret = -1; + } + + return ret; +} diff --git a/modules/sys_utils.h b/modules/sys_utils.h new file mode 100644 index 000000000..a7e38c086 --- /dev/null +++ b/modules/sys_utils.h @@ -0,0 +1,38 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2021 Augusto Fraga Giachero + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +/** + * @file sys_utils.c + * @author Augusto Fraga Giachero + * + * @brief System utilities functions + * + * @ingroup sysutils + */ + +/** + * @brief Schedule a MCU reset + * + * @param[in] period_ms Reset the MCU after a period specified in milisseconds + * + * @return 0 if successful, non zero if there was an error + */ +int sys_schedule_reset(int period_ms); diff --git a/modules/task_priorities.h b/modules/task_priorities.h index ec34c587b..9b66ff360 100644 --- a/modules/task_priorities.h +++ b/modules/task_priorities.h @@ -38,6 +38,7 @@ #define tskLM75SENSOR_PRIORITY (tskIDLE_PRIORITY+3) #define tskMAX6642SENSOR_PRIORITY (tskIDLE_PRIORITY+3) #define tskINA220SENSOR_PRIORITY (tskIDLE_PRIORITY+3) +#define tskINA3221SENSOR_PRIORITY (tskIDLE_PRIORITY+3) #define tskIPMI_HANDLERS_PRIORITY (tskIDLE_PRIORITY+4) #define tskIPMI_PRIORITY (tskIDLE_PRIORITY+4) diff --git a/port/board/CMakeLists.txt b/port/board/CMakeLists.txt index 5fffa642d..2f548cd9c 100644 --- a/port/board/CMakeLists.txt +++ b/port/board/CMakeLists.txt @@ -12,13 +12,27 @@ if(${BOARD} MATCHES "^(afc-bpm)$") message(STATUS "Selected Board version: ${VERSION}") if(${VERSION} MATCHES "(3.0)") - add_subdirectory(afc-bpm/v3_0) + message(FATAL_ERROR "${BoldRed}AFCv3.0 is not supported anymore. Use -DVERSION=3.1 instead.${ColourReset}") elseif(${VERSION} MATCHES "(3.1)") add_subdirectory(afc-bpm/v3_1) endif() +elseif(${BOARD} MATCHES "^(afc-fofb-ctrl)$") + + if(NOT VERSION) + message(FATAL_ERROR "${BoldRed}AFC board version was not selected! You must pass the flag -DVERSION=.${ColourReset}") + endif() + + message(STATUS "Selected Board version: ${VERSION}") + if(${VERSION} MATCHES "(3.1)") + add_subdirectory(afc-fofb-ctrl/v3_1) + endif() + elseif(${BOARD} MATCHES "^(afc-timing)$" ) add_subdirectory(afc-timing) + +elseif(${BOARD} MATCHES "^(afc-v4)$" ) + add_subdirectory(afc-v4) else() message(FATAL_ERROR "${BoldRed}Selected board \"${BOARD}\" is not implemented!${ColourReset}") @@ -33,6 +47,8 @@ if(BOARD_RTM AND (";${TARGET_MODULES};" MATCHES ";RTM;")) message(STATUS "Selected RTM Board support: ${BOARD_RTM}") if(${BOARD_RTM} MATCHES "(8sfp)") add_subdirectory(rtm-8sfp) + elseif(${BOARD_RTM} MATCHES "(lamp)") + add_subdirectory(rtm-lamp) else() message(FATAL_ERROR "${BoldRed}Selected RTM board \"${BOARD_RTM}\" is not implemented!${ColourReset}") endif() diff --git a/port/board/afc-bpm/v3_0/adn4604_usercfg.h b/port/board/afc-bpm/v3_0/adn4604_usercfg.h deleted file mode 100644 index 3953d8326..000000000 --- a/port/board/afc-bpm/v3_0/adn4604_usercfg.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * openMMC -- Open Source modular IPM Controller firmware - * - * Copyright (C) 2015 Henrique Silva - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * @license GPL-3.0+ - */ - -#ifdef ADN4604_USERCFG_H_ -#error "User configuration for ADN4604 Clock switch already defined by other board port, check the build chain!" -#else -#define ADN4604_USERCFG_H_ - -/* User configuration defines for ADN4604 Clock switch output config */ -#define ADN4604_CFG_OUT_0 0 /* TCLKD_OUT */ -#define ADN4604_CFG_OUT_1 0 /* TCLKC_OUT */ -#define ADN4604_CFG_OUT_2 0 /* TCLKA_OUT */ -#define ADN4604_CFG_OUT_3 0 /* TCLKB_OUT */ -#define ADN4604_CFG_OUT_4 13 /* FPGA_CCLK */ -#define ADN4604_CFG_OUT_5 8 /* FP2_CLK2 */ -#define ADN4604_CFG_OUT_6 8 /* LINK01_CLK */ -#define ADN4604_CFG_OUT_7 8 /* FP2_CLK1 */ -#define ADN4604_CFG_OUT_8 8 /* PCIE_CLK1 */ -#define ADN4604_CFG_OUT_9 8 /* LINK23_CLK */ -#define ADN4604_CFG_OUT_10 14 /* FIN1_CLK3 */ -#define ADN4604_CFG_OUT_11 14 /* FIN1_CLK2 */ -#define ADN4604_CFG_OUT_12 14 /* RTM_SYNC_CLK */ -#define ADN4604_CFG_OUT_13 5 /* OP15C (Aux U-Fl connector) */ -#define ADN4604_CFG_OUT_14 14 /* FIN2_CLK2 */ -#define ADN4604_CFG_OUT_15 14 /* FIN2_CLK3 */ - -/* Output enable flags */ -#define ADN4604_EN_OUT_0 0 /* TCLKD_OUT */ -#define ADN4604_EN_OUT_1 0 /* TCLKC_OUT */ -#define ADN4604_EN_OUT_2 0 /* TCLKA_OUT */ -#define ADN4604_EN_OUT_3 0 /* TCLKB_OUT */ -#define ADN4604_EN_OUT_4 1 /* FPGA_CCLK */ -#define ADN4604_EN_OUT_5 1 /* FP2_CLK2 */ -#define ADN4604_EN_OUT_6 1 /* LINK01_CLK */ -#define ADN4604_EN_OUT_7 1 /* FP2_CLK1 */ -#define ADN4604_EN_OUT_8 1 /* PCIE_CLK1 */ -#define ADN4604_EN_OUT_9 1 /* LINK23_CLK */ -#define ADN4604_EN_OUT_10 0 /* FIN1_CLK3 */ -#define ADN4604_EN_OUT_11 0 /* FIN1_CLK2 */ -#define ADN4604_EN_OUT_12 0 /* RTM_SYNC_CLK */ -#define ADN4604_EN_OUT_13 1 /* OP15C (Aux U-Fl connector) */ -#define ADN4604_EN_OUT_14 0 /* FIN2_CLK2 */ -#define ADN4604_EN_OUT_15 0 /* FIN2_CLK3 */ - -#endif diff --git a/port/board/afc-bpm/v3_0/i2c_mapping.c b/port/board/afc-bpm/v3_0/i2c_mapping.c deleted file mode 100644 index 6e73cada2..000000000 --- a/port/board/afc-bpm/v3_0/i2c_mapping.c +++ /dev/null @@ -1,92 +0,0 @@ -#include "i2c.h" -#include "i2c_mapping.h" -#include "port.h" - - -i2c_mux_state_t i2c_mux[I2C_MUX_CNT] = { - { I2C1, -1, 0 }, - { I2C2, -1, 0 }, -}; - -i2c_bus_mapping_t i2c_bus_map[I2C_BUS_CNT] = { - [I2C_BUS_UNKNOWN_ID] = { I2C1, -1, 0 }, - [I2C_BUS_FMC1_ID] = { I2C1, 0, 1 }, - [I2C_BUS_FMC2_ID] = { I2C1, 1, 1 }, - [I2C_BUS_CPU_ID] = { I2C1, -1, 1 }, - [I2C_BUS_RTM_ID] = { I2C1, 0, 1 }, - [I2C_BUS_CLOCK_ID] = { I2C1, 2, 1 }, - [I2C_BUS_FPGA_ID] = { I2C1, 0, 0 }, -}; - -i2c_chip_mapping_t i2c_chip_map[I2C_CHIP_CNT] = { - [CHIP_ID_MUX] = { I2C_BUS_CPU_ID, 0x70 }, - [CHIP_ID_LM75AIM_0] = { I2C_BUS_CPU_ID, 0x4C }, - [CHIP_ID_LM75AIM_1] = { I2C_BUS_CPU_ID, 0x4D }, - [CHIP_ID_LM75AIM_2] = { I2C_BUS_CPU_ID, 0x4E }, - [CHIP_ID_LM75AIM_3] = { I2C_BUS_CPU_ID, 0x4F }, - [CHIP_ID_MAX6642] = { I2C_BUS_CPU_ID, 0x48 }, - - [CHIP_ID_RTC] = { I2C_BUS_CPU_ID, 0x9F }, - [CHIP_ID_RTC_EEPROM] = { I2C_BUS_CPU_ID, 0x57 }, - [CHIP_ID_EEPROM] = { I2C_BUS_CPU_ID, 0x50 }, - [CHIP_ID_EEPROM_ID] = { I2C_BUS_CPU_ID, 0x58 }, - - [CHIP_ID_INA_0] = { I2C_BUS_CPU_ID, 0x40 }, - [CHIP_ID_INA_1] = { I2C_BUS_CPU_ID, 0x41 }, - [CHIP_ID_INA_2] = { I2C_BUS_CPU_ID, 0x42 }, - [CHIP_ID_INA_3] = { I2C_BUS_CPU_ID, 0x43 }, - [CHIP_ID_INA_4] = { I2C_BUS_CPU_ID, 0x44 }, - [CHIP_ID_INA_5] = { I2C_BUS_CPU_ID, 0x45 }, - - [CHIP_ID_ADN] = { I2C_BUS_CPU_ID, 0x4B }, - [CHIP_ID_SI57x] = { I2C_BUS_CLOCK_ID, 0x30 }, - - [CHIP_ID_FMC1_EEPROM] = { I2C_BUS_FMC1_ID, 0x50 }, - [CHIP_ID_FMC1_LM75_0] = { I2C_BUS_FMC1_ID, 0x48 }, - [CHIP_ID_FMC1_LM75_1] = { I2C_BUS_FMC1_ID, 0x49 }, - - [CHIP_ID_FMC2_EEPROM] = { I2C_BUS_FMC2_ID, 0x52 }, - [CHIP_ID_FMC2_LM75_0] = { I2C_BUS_FMC2_ID, 0x48 }, - [CHIP_ID_FMC2_LM75_1] = { I2C_BUS_FMC2_ID, 0x49 }, - - [CHIP_ID_RTM_PCA9554] = { I2C_BUS_RTM_ID, 0x20 }, - [CHIP_ID_RTM_EEPROM] = { I2C_BUS_RTM_ID, 0x50 }, - [CHIP_ID_RTM_LM75_0] = { I2C_BUS_RTM_ID, 0x48 }, - [CHIP_ID_RTM_LM75_1] = { I2C_BUS_RTM_ID, 0x49 }, -}; - -bool i2c_set_mux_bus( uint8_t bus_id, i2c_mux_state_t *i2c_mux, int8_t new_state ) -{ - portENABLE_INTERRUPTS(); - - if (i2c_mux->i2c_interface == i2c_bus_map[i2c_chip_map[CHIP_ID_MUX].bus_id].i2c_interface) { - /* Include enable bit (fourth bit) on channel selection byte */ - uint8_t pca_channel = new_state | (1 << 3); - - /* Select desired channel in the I2C switch */ - if( xI2CMasterWrite( i2c_bus_map[i2c_chip_map[CHIP_ID_MUX].bus_id].i2c_interface, i2c_chip_map[CHIP_ID_MUX].i2c_address, &pca_channel, 1 ) != 1 ) { - /* We failed to configure the I2C Mux, release the semaphore */ - xSemaphoreGive( i2c_mux->semaphore ); - return false; - } - } - - i2c_mux->state = new_state; - return true; -} - -uint8_t i2c_get_mux_bus( uint8_t bus_id, i2c_mux_state_t *i2c_mux ) -{ - if (i2c_mux->i2c_interface == i2c_bus_map[i2c_chip_map[CHIP_ID_MUX].bus_id].i2c_interface) { - /* Include enable bit (fourth bit) on channel selection byte */ - uint8_t pca_channel; - - portENABLE_INTERRUPTS(); - /* Read bus state (other master on the bus may have switched it */ - xI2CMasterRead( i2c_bus_map[i2c_chip_map[CHIP_ID_MUX].bus_id].i2c_interface, i2c_chip_map[CHIP_ID_MUX].i2c_address, &pca_channel, 1 ); - - return (pca_channel & 0x07); - } else { - return i2c_mux->state; - } -} diff --git a/port/board/afc-bpm/v3_0/payload.c b/port/board/afc-bpm/v3_0/payload.c deleted file mode 100644 index 59e949982..000000000 --- a/port/board/afc-bpm/v3_0/payload.c +++ /dev/null @@ -1,410 +0,0 @@ -/* - * openMMC -- Open Source modular IPM Controller firmware - * - * Copyright (C) 2015 Piotr Miedzik - * Copyright (C) 2015-2016 Henrique Silva - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * @license GPL-3.0+ - */ - -/* FreeRTOS Includes */ -#include "FreeRTOS.h" -#include "task.h" -#include "semphr.h" -#include "event_groups.h" - -/* Project Includes */ -#include "port.h" -#include "payload.h" -#include "ipmi.h" -#include "task_priorities.h" -#include "adn4604.h" -#include "ad84xx.h" -#include "hotswap.h" -#include "utils.h" -#include "fru.h" -#include "led.h" -#include "board_led.h" - -/* payload states - * 0 - no power - * 1 - power switching on - * Power Up sequence - * - * 2 - power good wait - * Since power supply switching - * Until detect power good - * - * 3 - power good - * Here you can configure devices such as clock crossbar and others - * We have to reset pin state program b - * - * 4 - fpga booting - * Since DCDC converters initialization - * Until FPGA DONE signal - * about 30 sec - * - * 5 - fpga working - * - * 6 - power switching off - * Power-off sequence - * - * 7 - power QUIESCED - * It continues until a power outage on the line 12v - * or for 30 seconds (???) - * - * 255 - power fail - */ - -static void check_fpga_reset( void ) -{ - static TickType_t edge_time; - static uint8_t reset_lock; - static uint8_t last_state = 1; - - TickType_t diff; - TickType_t cur_time = xTaskGetTickCount(); - - uint8_t cur_state = gpio_read_pin( PIN_PORT(GPIO_FRONT_BUTTON), PIN_NUMBER(GPIO_FRONT_BUTTON)); - - if ( (cur_state == 0) && (last_state == 1) ) { - /* Detects the falling edge of the front panel button */ - edge_time = cur_time; - reset_lock = 0; - } - - diff = getTickDifference( cur_time, edge_time ); - - if ( (diff > pdMS_TO_TICKS(2000)) && (reset_lock == 0) && (cur_state == 0) ) { - gpio_set_pin_low( PIN_PORT(GPIO_FPGA_RESET), PIN_NUMBER(GPIO_FPGA_RESET) ); - asm("NOP"); - gpio_set_pin_high( PIN_PORT(GPIO_FPGA_RESET), PIN_NUMBER(GPIO_FPGA_RESET) ); - - /* If the user continues to press the button after the 2s, prevent this action to be repeated */ - reset_lock = 1; - - /* Blink RED LED to indicate to the user that the Reset was performed */ - LEDUpdate( FRU_AMC, LED1, LEDMODE_LAMPTEST, LEDINIT_ON, 5, 0 ); - } - - last_state = cur_state; -} - -#ifdef MODULE_DAC_AD84XX -void set_vadj_volt( uint8_t fmc_slot, float v ) -{ - uint32_t res_total; - uint32_t res_dac; - - res_total = (uint32_t) (1162.5/(v-0.775)) - 453; - res_dac = (1800*res_total)/(1800-res_total); - - /* Use only the lower 8-bits (the dac only has 256 steps) */ - res_dac &= 0xFF; - - dac_ad84xx_set_res( fmc_slot, res_dac ); -} -#endif - -/** - * @brief Set AFC's DCDC Converters state - * - * @param on DCDCs state - * - * @warning The FMC1_P12V DCDC is not affected by this function since it has to be always on in order to measure the Payload power status on the AFC board. - */ -void setDC_DC_ConvertersON( bool on ) -{ - gpio_set_pin_state( PIN_PORT(GPIO_EN_FMC1_PVADJ), PIN_NUMBER(GPIO_EN_FMC1_PVADJ), on ); - //gpio_set_pin_state( PIN_PORT(GPIO_EN_FMC1_P12V), PIN_NUMBER(GPIO_EN_FMC1_P12V), on ); - gpio_set_pin_state( PIN_PORT(GPIO_EN_FMC1_P3V3), PIN_NUMBER(GPIO_EN_FMC1_P3V3), on ); - - gpio_set_pin_state( PIN_PORT(GPIO_EN_FMC2_PVADJ), PIN_NUMBER(GPIO_EN_FMC2_PVADJ), on ); - gpio_set_pin_state( PIN_PORT(GPIO_EN_FMC2_P12V), PIN_NUMBER(GPIO_EN_FMC2_P12V), on ); - gpio_set_pin_state( PIN_PORT(GPIO_EN_FMC2_P3V3), PIN_NUMBER(GPIO_EN_FMC2_P3V3), on ); - - gpio_set_pin_state( PIN_PORT(GPIO_EN_P1V0), PIN_NUMBER(GPIO_EN_P1V0), on ); - gpio_set_pin_state( PIN_PORT(GPIO_EN_P1V8), PIN_NUMBER(GPIO_EN_P1V8), on ); // <- this one causes problems if not switched off before power loss - gpio_set_pin_state( PIN_PORT(GPIO_EN_P1V2), PIN_NUMBER(GPIO_EN_P1V2), on ); - gpio_set_pin_state( PIN_PORT(GPIO_EN_P1V5_VTT), PIN_NUMBER(GPIO_EN_P1V5_VTT), on ); - gpio_set_pin_state( PIN_PORT(GPIO_EN_P3V3), PIN_NUMBER(GPIO_EN_P3V3), on ); -} - -EventGroupHandle_t amc_payload_evt = NULL; - -void payload_send_message( uint8_t fru_id, EventBits_t msg) -{ - if ( (fru_id == FRU_AMC) && amc_payload_evt ) { - xEventGroupSetBits( amc_payload_evt, msg ); - } -} - -TaskHandle_t vTaskPayload_Handle; - -void payload_init( void ) -{ - -#ifndef BENCH_TEST - /* Wait until ENABLE# signal is asserted ( ENABLE == 0) */ - while ( gpio_read_pin( PIN_PORT(GPIO_MMC_ENABLE), PIN_NUMBER(GPIO_MMC_ENABLE) ) == 1 ) {}; -#endif - - xTaskCreate( vTaskPayload, "Payload", 120, NULL, tskPAYLOAD_PRIORITY, &vTaskPayload_Handle ); - - amc_payload_evt = xEventGroupCreate(); - -#ifdef MODULE_DAC_AD84XX - /* Configure the PVADJ DAC */ - dac_ad84xx_init(); - set_vadj_volt( 0, 2.5 ); - set_vadj_volt( 1, 2.5 ); -#endif - - /* Configure FPGA reset line */ - gpio_set_pin_state( PIN_PORT(GPIO_FPGA_RESET), PIN_NUMBER(GPIO_FPGA_RESET), GPIO_LEVEL_HIGH ); -} - -void vTaskPayload( void *pvParameters ) -{ - uint8_t state = PAYLOAD_NO_POWER; - uint8_t new_state = PAYLOAD_STATE_NO_CHANGE; - - /* Payload power good flag */ - uint8_t PP_good = 0; - - /* Payload DCDCs good flag */ - uint8_t DCDC_good = 0; - - uint8_t QUIESCED_req = 0; - EventBits_t current_evt; - - extern sensor_t * hotswap_amc_sensor; - - TickType_t xLastWakeTime; - xLastWakeTime = xTaskGetTickCount(); - - gpio_set_pin_state( PIN_PORT(GPIO_FPGA_PROGRAM_B), PIN_NUMBER(GPIO_FPGA_PROGRAM_B), GPIO_LEVEL_HIGH ); - - for ( ;; ) { - - check_fpga_reset(); - - /* Initialize one of the FMC's DCDC so we can measure when the Payload Power is present */ - gpio_set_pin_state( PIN_PORT(GPIO_EN_FMC1_P12V), PIN_NUMBER(GPIO_EN_FMC1_P12V), GPIO_LEVEL_HIGH ); - - new_state = state; - - current_evt = xEventGroupGetBits( amc_payload_evt ); - - if ( current_evt & PAYLOAD_MESSAGE_PPGOOD ) { - PP_good = 1; - xEventGroupClearBits( amc_payload_evt, PAYLOAD_MESSAGE_PPGOOD ); - } - if ( current_evt & PAYLOAD_MESSAGE_PPGOODn ) { - PP_good = 0; - xEventGroupClearBits( amc_payload_evt, PAYLOAD_MESSAGE_PPGOODn ); - } - if ( current_evt & PAYLOAD_MESSAGE_DCDC_PGOOD ) { - DCDC_good = 1; - xEventGroupClearBits( amc_payload_evt, PAYLOAD_MESSAGE_DCDC_PGOOD ); - } - if ( current_evt & PAYLOAD_MESSAGE_DCDC_PGOODn ) { - DCDC_good = 0; - xEventGroupClearBits( amc_payload_evt, PAYLOAD_MESSAGE_DCDC_PGOODn ); - } - if ( current_evt & PAYLOAD_MESSAGE_QUIESCE ) { - QUIESCED_req = 1; - xEventGroupClearBits( amc_payload_evt, PAYLOAD_MESSAGE_QUIESCE ); - } - if ( current_evt & PAYLOAD_MESSAGE_COLD_RST ) { - state = PAYLOAD_SWITCHING_OFF; - xEventGroupClearBits( amc_payload_evt, PAYLOAD_MESSAGE_COLD_RST ); - } - if ( current_evt & PAYLOAD_MESSAGE_REBOOT ) { - gpio_set_pin_low( PIN_PORT(GPIO_FPGA_RESET), PIN_NUMBER(GPIO_FPGA_RESET) ); - asm("NOP"); - gpio_set_pin_high( PIN_PORT(GPIO_FPGA_RESET), PIN_NUMBER(GPIO_FPGA_RESET) ); - xEventGroupClearBits( amc_payload_evt, PAYLOAD_MESSAGE_REBOOT ); - } - - DCDC_good = gpio_read_pin( PIN_PORT(GPIO_DCDC_PGOOD), PIN_NUMBER(GPIO_DCDC_PGOOD) ); - - switch(state) { - - case PAYLOAD_NO_POWER: - - if (PP_good) { - new_state = PAYLOAD_POWER_GOOD_WAIT; - } - QUIESCED_req = 0; - break; - - case PAYLOAD_POWER_GOOD_WAIT: - /* Turn DDC converters on */ - setDC_DC_ConvertersON( true ); - - /* Clear hotswap sensor backend power failure bits */ - hotswap_clear_mask_bit( HOTSWAP_AMC, HOTSWAP_BACKEND_PWR_SHUTDOWN_MASK ); - hotswap_clear_mask_bit( HOTSWAP_AMC, HOTSWAP_BACKEND_PWR_FAILURE_MASK ); - - if ( QUIESCED_req || ( PP_good == 0 ) ) { - new_state = PAYLOAD_SWITCHING_OFF; - } else if ( DCDC_good == 1 ) { - new_state = PAYLOAD_STATE_FPGA_SETUP; - } - break; - - case PAYLOAD_STATE_FPGA_SETUP: -#ifdef MODULE_ADN4604 - adn4604_init(); -#endif - new_state = PAYLOAD_FPGA_BOOTING; - break; - - case PAYLOAD_FPGA_BOOTING: - if ( QUIESCED_req == 1 || PP_good == 0 || DCDC_good == 0 ) { - new_state = PAYLOAD_SWITCHING_OFF; - } - break; - - case PAYLOAD_SWITCHING_OFF: - setDC_DC_ConvertersON( false ); - - if ( QUIESCED_req ) { - hotswap_set_mask_bit( HOTSWAP_AMC, HOTSWAP_QUIESCED_MASK ); - if ( hotswap_send_event( hotswap_amc_sensor, HOTSWAP_STATE_QUIESCED ) == ipmb_error_success ) { - QUIESCED_req = 0; - hotswap_clear_mask_bit( HOTSWAP_AMC, HOTSWAP_QUIESCED_MASK ); - new_state = PAYLOAD_NO_POWER; - } - } else { - new_state = PAYLOAD_NO_POWER; - } - /* Reset the power good flags to avoid the state machine to start over without a new read from the sensors */ - PP_good = 0; - DCDC_good = 0; - break; - - default: - break; - } - - state = new_state; - vTaskDelayUntil( &xLastWakeTime, PAYLOAD_BASE_DELAY ); - } -} - - -/* HPM Functions */ -#ifdef MODULE_HPM - -#include "flash_spi.h" -#include "string.h" - -uint8_t hpm_page[256]; -uint8_t hpm_pg_index; -uint32_t hpm_page_addr; - -uint8_t payload_hpm_prepare_comp( void ) -{ - /* Initialize variables */ - memset(hpm_page, 0xFF, sizeof(hpm_page)); - hpm_pg_index = 0; - hpm_page_addr = 0; - - /* Initialize flash */ - ssp_init( FLASH_SPI, FLASH_SPI_BITRATE, FLASH_SPI_FRAME_SIZE, SSP_MASTER, SSP_INTERRUPT ); - - /* Prevent the FPGA from accessing the Flash to configure itself now */ - gpio_set_pin_state( PIN_PORT(GPIO_FPGA_PROGRAM_B), PIN_NUMBER(GPIO_FPGA_PROGRAM_B), GPIO_LEVEL_HIGH ); - gpio_set_pin_state( PIN_PORT(GPIO_FPGA_PROGRAM_B), PIN_NUMBER(GPIO_FPGA_PROGRAM_B), GPIO_LEVEL_LOW ); - gpio_set_pin_state( PIN_PORT(GPIO_FPGA_PROGRAM_B), PIN_NUMBER(GPIO_FPGA_PROGRAM_B), GPIO_LEVEL_HIGH ); - gpio_set_pin_state( PIN_PORT(GPIO_FPGA_PROGRAM_B), PIN_NUMBER(GPIO_FPGA_PROGRAM_B), GPIO_LEVEL_LOW ); - - /* Erase FLASH */ - flash_bulk_erase(); - - return IPMI_CC_COMMAND_IN_PROGRESS; -} - -uint8_t payload_hpm_upload_block( uint8_t * block, uint16_t size ) -{ - /* TODO: Check DONE pin before accessing the SPI bus, since the FPGA may be reading it in order to boot */ - uint8_t remaining_bytes_start; - - if ( sizeof(hpm_page) - hpm_pg_index > size ) { - /* Our page is not full yet, just append the new data */ - memcpy(&hpm_page[hpm_pg_index], block, size); - hpm_pg_index += size; - - return IPMI_CC_OK; - - } else { - /* Complete the remaining bytes on the buffer */ - memcpy(&hpm_page[hpm_pg_index], block, (sizeof(hpm_page) - hpm_pg_index)); - remaining_bytes_start = (sizeof(hpm_page) - hpm_pg_index); - - /* Program the complete page in the Flash */ - flash_program_page( hpm_page_addr, &hpm_page[0], sizeof(hpm_page)); - - hpm_page_addr += sizeof(hpm_page); - - /* Empty our buffer and reset the index */ - memset(hpm_page, 0xFF, sizeof(hpm_page)); - hpm_pg_index = 0; - - /* Save the trailing bytes */ - memcpy(&hpm_page[hpm_pg_index], block+remaining_bytes_start, size-remaining_bytes_start); - - hpm_pg_index = size-remaining_bytes_start; - - return IPMI_CC_COMMAND_IN_PROGRESS; - } -} - -uint8_t payload_hpm_finish_upload( uint32_t image_size ) -{ - /* Check if the last page was already programmed */ - if (!hpm_pg_index) { - /* Program the complete page in the Flash */ - flash_program_page( hpm_page_addr, &hpm_page[0], (sizeof(hpm_page)-hpm_pg_index)); - hpm_pg_index = 0; - hpm_page_addr = 0; - - return IPMI_CC_COMMAND_IN_PROGRESS; - } - - return IPMI_CC_OK; -} - -uint8_t payload_hpm_get_upgrade_status( void ) -{ - if (is_flash_busy()) { - return IPMI_CC_COMMAND_IN_PROGRESS; - } else { - return IPMI_CC_OK; - } -} - -uint8_t payload_hpm_activate_firmware( void ) -{ - /* Reset FPGA - Pulse PROGRAM_B pin */ - gpio_set_pin_state( PIN_PORT(GPIO_FPGA_PROGRAM_B), PIN_NUMBER(GPIO_FPGA_PROGRAM_B), GPIO_LEVEL_LOW); - gpio_set_pin_state( PIN_PORT(GPIO_FPGA_PROGRAM_B), PIN_NUMBER(GPIO_FPGA_PROGRAM_B), GPIO_LEVEL_HIGH); - - return IPMI_CC_OK; -} -#endif diff --git a/port/board/afc-bpm/v3_0/pin_mapping.h b/port/board/afc-bpm/v3_0/pin_mapping.h deleted file mode 100644 index 3b0ecf1a5..000000000 --- a/port/board/afc-bpm/v3_0/pin_mapping.h +++ /dev/null @@ -1,236 +0,0 @@ -/* - * openMMC -- Open Source modular IPM Controller firmware - * - * Copyright (C) 2016 Henrique Silva - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * @license GPL-3.0+ - */ - -/** - * @defgroup AFC_V3_0 AFCv3.0 Board Port - * @ingroup BOARD_PORTS - */ - -/** - * @file afc-bpm/v3_0/pin_mapping.h - * @brief Hardware pin definitions for AFCv3.0 - * - * @ingroup AFC_V3_0_PIN_MAPPING - */ - -/** - * @defgroup AFC_V3_0_PIN_MAPPING AFCv3.0 Pin Mapping - * @ingroup AFC_V3_0 - * @{ - */ - -#ifndef PIN_MAPPING_H_ -#define PIN_MAPPING_H_ - -/* SPI Interfaces */ -#define FPGA_SPI 0 -#define FLASH_SPI 1 - -/* UART Interfaces */ -#define UART_DEBUG 3 - -/* Pin definitions */ - -/* I2C ports */ -#define I2C0_SDA PIN_DEF( PORT0, 27, (IOCON_FUNC1 | IOCON_MODE_INACT), NON_GPIO ) -#define I2C0_SCL PIN_DEF( PORT0, 28, (IOCON_FUNC1 | IOCON_MODE_INACT), NON_GPIO ) -#define I2C1_SDA PIN_DEF( PORT0, 0, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO ) -#define I2C1_SCL PIN_DEF( PORT0, 1, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO ) -#define I2C2_SDA PIN_DEF( PORT0, 10, (IOCON_FUNC2 | IOCON_MODE_INACT), NON_GPIO ) -#define I2C2_SCL PIN_DEF( PORT0, 11, (IOCON_FUNC2 | IOCON_MODE_INACT), NON_GPIO ) - -/* UART Debug port */ -#define UART_DEBUG_TXD PIN_DEF( PORT4, 28, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO ) -#define UART_DEBUG_RXD PIN_DEF( PORT4, 29, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO ) - -/* SSP Ports */ -/* FPGA SPI Port (SSEL is GPIO for word transfers larger than 8bits) */ -#define SSP0_SCK PIN_DEF( PORT1, 20, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO ) -#define SSP0_SSEL PIN_DEF( PORT1, 21, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_OUTPUT ) -#define SSP0_MISO PIN_DEF( PORT1, 23, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO ) -#define SSP0_MOSI PIN_DEF( PORT1, 24, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO ) -/* Flash SPI Port (SSEL is GPIO for word transfers larger than 8bits) */ -#define SSP1_SCK PIN_DEF( PORT0, 7, (IOCON_FUNC2 | IOCON_MODE_INACT), NON_GPIO ) -#define SSP1_SSEL PIN_DEF( PORT0, 6, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_OUTPUT ) -#define SSP1_MISO PIN_DEF( PORT0, 8, (IOCON_FUNC2 | IOCON_MODE_INACT), NON_GPIO ) -#define SSP1_MOSI PIN_DEF( PORT0, 9, (IOCON_FUNC2 | IOCON_MODE_INACT), NON_GPIO ) - -/* SPI Legacy port - should be updated to SSP interface */ -/* DAC SPI Port (SSEL is GPIO for word transfers larger than 8bits) */ -#define SPI_SCK PIN_DEF( PORT0, 15, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO ) -#define SPI_SSEL PIN_DEF( PORT0, 16, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_OUTPUT ) -//#define SPI_MISO PIN_DEF( PORT0, 17, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO ) -#define SPI_MOSI PIN_DEF( PORT0, 18, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO ) - -/* GPIO definitions */ -/* Geographic Address pin definitions */ -#define GPIO_GA0 PIN_DEF( PORT1, 0, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) -#define GPIO_GA1 PIN_DEF( PORT1, 1, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) -#define GPIO_GA2 PIN_DEF( PORT1, 4, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) -#define GPIO_GA_TEST PIN_DEF( PORT1, 8, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_OUTPUT ) - -/* Board LEDs */ -#define GPIO_LEDBLUE PIN_DEF( PORT1, 9, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_OUTPUT ) -#define GPIO_LEDGREEN PIN_DEF( PORT1, 10, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) -#define GPIO_LEDRED PIN_DEF( PORT1, 25, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) - -/* Front Panel BUTTON */ -#define GPIO_FRONT_BUTTON PIN_DEF( PORT2, 12, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_INPUT ) - -/* Hot swap handle */ -#define GPIO_HOT_SWAP_HANDLE PIN_DEF( PORT2, 13, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_INPUT ) - -/* FPGA DCDC converters */ -#define GPIO_EN_P1V0 PIN_DEF( PORT3, 25, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) -#define GPIO_EN_P1V2 PIN_DEF( PORT0, 23, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) -#define GPIO_EN_P1V8 PIN_DEF( PORT0, 24, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) -#define GPIO_EN_P3V3 PIN_DEF( PORT1, 27, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) -#define GPIO_EN_P1V5_VTT PIN_DEF( PORT1, 29, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) -#define GPIO_DCDC_PGOOD PIN_DEF( PORT3, 26, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_INPUT ) - -/* FMC1 DCDC Converters */ -#define GPIO_EN_FMC1_P12V PIN_DEF( PORT0, 4, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) -#define GPIO_EN_FMC1_P3V3 PIN_DEF( PORT0, 25, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) -#define GPIO_EN_FMC1_PVADJ PIN_DEF( PORT1, 31, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) - -/* FMC2 DCDC Converters */ -#define GPIO_EN_FMC2_P12V PIN_DEF( PORT0, 5, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) -#define GPIO_EN_FMC2_P3V3 PIN_DEF( PORT0, 26, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) -#define GPIO_EN_FMC2_PVADJ PIN_DEF( PORT1, 28, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) - -/* RTM */ -#define GPIO_EN_RTM_PWR PIN_DEF( PORT1, 30, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) -/* NOTE: Due to a hardware limitation, pins 29 and 30 from port 0 will have the same direction, even if set differently in the register */ -#define GPIO_RTM_PS PIN_DEF( PORT0, 29, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_INPUT ) -#define GPIO_EN_RTM_I2C PIN_DEF( PORT0, 30, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) - -/* FPGA Control */ -#define GPIO_FPGA_PROGRAM_B PIN_DEF( PORT0, 17, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) -#define GPIO_FPGA_DONE_B PIN_DEF( PORT0, 22, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) -#define GPIO_FPGA_RESET PIN_DEF( PORT2, 9, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) - -/* VADJ DAC */ -#define GPIO_DAC_VADJ_RST PIN_DEF( PORT0, 21, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_OUTPUT ) -#define GPIO_DAC_VADJ_CSN PIN_DEF( PORT0, 16, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_OUTPUT ) - -/* ADN4604 Clock Switch */ -#define GPIO_ADN_UPDATE PIN_DEF( PORT1, 26, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_OUTPUT ) -#define GPIO_ADN_RESETN PIN_DEF( PORT1, 22, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_INPUT ) - -/* SCANSTA1101 JTAG Switch */ -#define GPIO_SCANSTA1101_ADDR0 PIN_DEF( PORT2, 0, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) -#define GPIO_SCANSTA1101_ADDR1 PIN_DEF( PORT2, 1, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) -#define GPIO_SCANSTA1101_ADDR2 PIN_DEF( PORT2, 2, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) -#define GPIO_SCANSTA1101_ADDR3 PIN_DEF( PORT2, 3, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) -#define GPIO_SCANSTA1101_ADDR4 PIN_DEF( PORT2, 4, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) -#define GPIO_SCANSTA1101_ADDR5 PIN_DEF( PORT2, 5, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) -#define GPIO_SCANSTA1101_ADDR6 PIN_DEF( PORT2, 6, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) -#define GPIO_SCANSTA1101_TRIST_B PIN_DEF( PORT2, 7, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) - -/* MMC ENABLE# */ -#define GPIO_MMC_ENABLE PIN_DEF( PORT2, 8, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_INPUT ) - -/* Overtemp signal */ -#define GPIO_OVERTEMPn PIN_DEF( PORT2, 10, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_INPUT ) - -/* FMC Present signals */ -#define GPIO_FMC1_PRSNT_M2C PIN_DEF( PORT1, 14, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_INPUT ) -#define GPIO_FMC2_PRSNT_M2C PIN_DEF( PORT1, 15, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_INPUT ) - -/* FMC Power Good signals */ -#define GPIO_FMC1_PG_M2C PIN_DEF( PORT1, 16, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_INPUT ) -#define GPIO_FMC2_PG_M2C PIN_DEF( PORT1, 17, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_INPUT ) -#define GPIO_FMC1_PG_C2M PIN_DEF( PORT1, 18, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_OUTPUT ) -#define GPIO_FMC2_PG_C2M PIN_DEF( PORT1, 19, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_OUTPUT ) - -/* Pin initialization (config) list */ -#define PIN_CFG_LIST \ - I2C0_SDA, \ - I2C0_SCL, \ - I2C1_SDA, \ - I2C1_SCL, \ - I2C2_SDA, \ - I2C2_SCL, \ - UART_DEBUG_TXD, \ - UART_DEBUG_RXD, \ - SSP0_SCK, \ - SSP0_SSEL, \ - SSP0_MISO, \ - SSP0_MOSI, \ - SSP1_SCK, \ - SSP1_SSEL, \ - SSP1_MISO, \ - SSP1_MOSI, \ - SPI_SCK, \ - SPI_SSEL, \ - SPI_MOSI, \ - GPIO_GA0, \ - GPIO_GA1, \ - GPIO_GA2, \ - GPIO_GA_TEST, \ - GPIO_LEDBLUE, \ - GPIO_LEDGREEN, \ - GPIO_LEDRED, \ - GPIO_FRONT_BUTTON, \ - GPIO_HOT_SWAP_HANDLE, \ - GPIO_EN_P1V0, \ - GPIO_EN_P1V2, \ - GPIO_EN_P1V8, \ - GPIO_EN_P3V3, \ - GPIO_EN_P1V5_VTT, \ - GPIO_DCDC_PGOOD, \ - GPIO_EN_FMC1_P12V, \ - GPIO_EN_FMC1_P3V3, \ - GPIO_EN_FMC1_PVADJ, \ - GPIO_EN_FMC2_P12V, \ - GPIO_EN_FMC2_P3V3, \ - GPIO_EN_FMC2_PVADJ, \ - GPIO_EN_RTM_PWR, \ - GPIO_RTM_PS, \ - GPIO_EN_RTM_I2C, \ - GPIO_FPGA_PROGRAM_B, \ - GPIO_FPGA_DONE_B, \ - GPIO_FPGA_RESET, \ - GPIO_DAC_VADJ_RST, \ - GPIO_DAC_VADJ_CSN, \ - GPIO_ADN_UPDATE, \ - GPIO_ADN_RESETN, \ - GPIO_SCANSTA1101_ADDR0, \ - GPIO_SCANSTA1101_ADDR1, \ - GPIO_SCANSTA1101_ADDR2, \ - GPIO_SCANSTA1101_ADDR3, \ - GPIO_SCANSTA1101_ADDR4, \ - GPIO_SCANSTA1101_ADDR5, \ - GPIO_SCANSTA1101_ADDR6, \ - GPIO_SCANSTA1101_TRIST_B, \ - GPIO_MMC_ENABLE, \ - GPIO_FMC1_PRSNT_M2C, \ - GPIO_FMC2_PRSNT_M2C, \ - GPIO_FMC1_PG_M2C, \ - GPIO_FMC2_PG_M2C, \ - GPIO_FMC1_PG_C2M, \ - GPIO_FMC2_PG_C2M - -#endif - -/** - * @} - */ diff --git a/port/board/afc-bpm/v3_1/CMakeLists.txt b/port/board/afc-bpm/v3_1/CMakeLists.txt index aca327149..456ea228b 100644 --- a/port/board/afc-bpm/v3_1/CMakeLists.txt +++ b/port/board/afc-bpm/v3_1/CMakeLists.txt @@ -12,7 +12,6 @@ set(TARGET_MODULES "FRU" "PAYLOAD" "SDR" - "WATCHDOG" "SCANSTA1101" "ADN4604" "FPGA_SPI" @@ -26,8 +25,14 @@ set(TARGET_MODULES "INA220_CURRENT" "HPM" "UART_DEBUG" + "SYSUTILS" + "FLASH_SPI" ) +if (NOT DISABLE_WATCHDOG) + list(APPEND TARGET_MODULES "WATCHDOG") +endif() + set(BOARD_PATH ${CMAKE_CURRENT_SOURCE_DIR}) #Include the modules sources diff --git a/port/board/afc-bpm/v3_1/adn4604_usercfg.h b/port/board/afc-bpm/v3_1/adn4604_usercfg.h index c1a124bb8..f0279d532 100644 --- a/port/board/afc-bpm/v3_1/adn4604_usercfg.h +++ b/port/board/afc-bpm/v3_1/adn4604_usercfg.h @@ -32,7 +32,7 @@ #define ADN4604_CFG_OUT_4 13 /* FPGA_CCLK */ #define ADN4604_CFG_OUT_5 8 /* FP2_CLK2 */ #define ADN4604_CFG_OUT_6 5 /* LINK01_CLK */ -#define ADN4604_CFG_OUT_7 8 /* FP2_CLK1 */ +#define ADN4604_CFG_OUT_7 15 /* FP2_CLK1 */ #define ADN4604_CFG_OUT_8 8 /* PCIE_CLK1 */ #define ADN4604_CFG_OUT_9 5 /* LINK23_CLK */ #define ADN4604_CFG_OUT_10 5 /* FIN1_CLK3 */ @@ -48,11 +48,11 @@ #define ADN4604_EN_OUT_2 0 /* TCLKA_OUT */ #define ADN4604_EN_OUT_3 0 /* TCLKB_OUT */ #define ADN4604_EN_OUT_4 1 /* FPGA_CCLK */ -#define ADN4604_EN_OUT_5 1 /* FP2_CLK2 */ +#define ADN4604_EN_OUT_5 0 /* FP2_CLK2 */ #define ADN4604_EN_OUT_6 1 /* LINK01_CLK */ #define ADN4604_EN_OUT_7 1 /* FP2_CLK1 */ #define ADN4604_EN_OUT_8 1 /* PCIE_CLK1 */ -#define ADN4604_EN_OUT_9 1 /* LINK23_CLK */ +#define ADN4604_EN_OUT_9 0 /* LINK23_CLK */ #define ADN4604_EN_OUT_10 1 /* FIN1_CLK3 */ #define ADN4604_EN_OUT_11 1 /* FIN1_CLK2 */ #define ADN4604_EN_OUT_12 0 /* RTM_SYNC_CLK */ diff --git a/port/board/afc-bpm/v3_1/ipmi_oem.c b/port/board/afc-bpm/v3_1/ipmi_oem.c index 0176a3f8f..156342f05 100644 --- a/port/board/afc-bpm/v3_1/ipmi_oem.c +++ b/port/board/afc-bpm/v3_1/ipmi_oem.c @@ -80,7 +80,7 @@ IPMI_HANDLER(ipmi_oem_cmd_i2c_transfer, NETFN_CUSTOM_OEM, IPMI_OEM_CMD_I2C_TRANS if ( read_len > 0 ) { read_data = pvPortMalloc( read_len ); - memset( read_data, read_len, 0 ); + memset( read_data, 0, read_len ); if ( xI2CMasterRead( i2c_interf, i2c_addr, read_data, read_len ) == read_len ) { rsp->data[0] = read_len; diff --git a/port/board/afc-bpm/v3_1/payload.c b/port/board/afc-bpm/v3_1/payload.c index 2f6f7fa03..68ecb10d0 100644 --- a/port/board/afc-bpm/v3_1/payload.c +++ b/port/board/afc-bpm/v3_1/payload.c @@ -178,11 +178,17 @@ TaskHandle_t vTaskPayload_Handle; void payload_init( void ) { + /* Set standalone mode if the module is disconnected from a create*/ + bool standalone_mode = false; -#ifndef BENCH_TEST - /* Wait until ENABLE# signal is asserted ( ENABLE == 0) */ - while ( gpio_read_pin( PIN_PORT(GPIO_MMC_ENABLE), PIN_NUMBER(GPIO_MMC_ENABLE) ) == 1 ) {}; -#endif + if (get_ipmb_addr() == IPMB_ADDR_DISCONNECTED) { + standalone_mode = true; + } + + if (!standalone_mode) { + /* Wait until ENABLE# signal is asserted ( ENABLE == 0) */ + while ( gpio_read_pin( PIN_PORT(GPIO_MMC_ENABLE), PIN_NUMBER(GPIO_MMC_ENABLE) ) == 1 ) {}; + } xTaskCreate( vTaskPayload, "Payload", 120, NULL, tskPAYLOAD_PRIORITY, &vTaskPayload_Handle ); @@ -234,18 +240,33 @@ void vTaskPayload( void *pvParameters ) current_evt = xEventGroupGetBits( amc_payload_evt ); if ( current_evt & PAYLOAD_MESSAGE_QUIESCE ) { - QUIESCED_req = 1; + + /* + * If you issue a shutdown fru command in the MCH shell, the payload power + * task will receive a PAYLOAD_MESSAGE_QUIESCE message and set the + * QUIESCED_req flag to '1' and the MCH will shutdown the 12VP0 power, + * making the payload power task go to PAYLOAD_NO_POWER state. + * So, if we are in the PAYLOAD_QUIESCED state and receive a + * PAYLOAD_MESSAGE_QUIESCE message, the QUIESCED_req flag + * should be '0' + */ + + if (state == PAYLOAD_QUIESCED) { + QUIESCED_req = 0; + } else { + QUIESCED_req = 1; + } xEventGroupClearBits( amc_payload_evt, PAYLOAD_MESSAGE_QUIESCE ); } if ( current_evt & PAYLOAD_MESSAGE_COLD_RST ) { - state = PAYLOAD_SWITCHING_OFF; + state = PAYLOAD_RESET; xEventGroupClearBits( amc_payload_evt, PAYLOAD_MESSAGE_COLD_RST ); } if ( (current_evt & PAYLOAD_MESSAGE_REBOOT) || (current_evt & PAYLOAD_MESSAGE_WARM_RST) ) { fpga_soft_reset(); - xEventGroupClearBits( amc_payload_evt, PAYLOAD_MESSAGE_REBOOT ); + xEventGroupClearBits(amc_payload_evt, PAYLOAD_MESSAGE_REBOOT | PAYLOAD_MESSAGE_WARM_RST); } payload_check_pgood(&PP_good); @@ -307,6 +328,12 @@ void vTaskPayload( void *pvParameters ) new_state = PAYLOAD_NO_POWER; } break; + + case PAYLOAD_RESET: + /*Reset DCDC converters*/ + setDC_DC_ConvertersON( false ); + new_state = PAYLOAD_NO_POWER; + break; default: break; @@ -341,7 +368,7 @@ uint8_t payload_hpm_prepare_comp( void ) return IPMI_CC_OUT_OF_SPACE; } - memset(hpm_page, 0xFF, sizeof(hpm_page)); + memset(hpm_page, 0xFF, PAYLOAD_HPM_PAGE_SIZE); hpm_pg_index = 0; hpm_page_addr = 0; @@ -366,7 +393,7 @@ uint8_t payload_hpm_upload_block( uint8_t * block, uint16_t size ) /* TODO: Check DONE pin before accessing the SPI bus, since the FPGA may be reading it in order to boot */ uint8_t remaining_bytes_start; - if ( sizeof(hpm_page) - hpm_pg_index > size ) { + if ( PAYLOAD_HPM_PAGE_SIZE - hpm_pg_index > size ) { /* Our page is not full yet, just append the new data */ memcpy(&hpm_page[hpm_pg_index], block, size); hpm_pg_index += size; @@ -375,16 +402,16 @@ uint8_t payload_hpm_upload_block( uint8_t * block, uint16_t size ) } else { /* Complete the remaining bytes on the buffer */ - memcpy(&hpm_page[hpm_pg_index], block, (sizeof(hpm_page) - hpm_pg_index)); - remaining_bytes_start = (sizeof(hpm_page) - hpm_pg_index); + memcpy(&hpm_page[hpm_pg_index], block, (PAYLOAD_HPM_PAGE_SIZE - hpm_pg_index)); + remaining_bytes_start = (PAYLOAD_HPM_PAGE_SIZE - hpm_pg_index); /* Program the complete page in the Flash */ - flash_program_page( hpm_page_addr, &hpm_page[0], sizeof(hpm_page)); + flash_program_page( hpm_page_addr, &hpm_page[0], PAYLOAD_HPM_PAGE_SIZE); - hpm_page_addr += sizeof(hpm_page); + hpm_page_addr += PAYLOAD_HPM_PAGE_SIZE; /* Empty our buffer and reset the index */ - memset(hpm_page, 0xFF, sizeof(hpm_page)); + memset(hpm_page, 0xFF, PAYLOAD_HPM_PAGE_SIZE); hpm_pg_index = 0; /* Save the trailing bytes */ @@ -403,7 +430,7 @@ uint8_t payload_hpm_finish_upload( uint32_t image_size ) /* Check if the last page was already programmed */ if (!hpm_pg_index) { /* Program the complete page in the Flash */ - flash_program_page( hpm_page_addr, &hpm_page[0], (sizeof(hpm_page)-hpm_pg_index)); + flash_program_page( hpm_page_addr, &hpm_page[0], (PAYLOAD_HPM_PAGE_SIZE-hpm_pg_index)); hpm_pg_index = 0; hpm_page_addr = 0; diff --git a/port/board/afc-bpm/v3_1/payload.h b/port/board/afc-bpm/v3_1/payload.h index fbd307164..3aec34f29 100644 --- a/port/board/afc-bpm/v3_1/payload.h +++ b/port/board/afc-bpm/v3_1/payload.h @@ -48,6 +48,7 @@ extern enum { PAYLOAD_FPGA_ON, PAYLOAD_SWITCHING_OFF, PAYLOAD_QUIESCED, + PAYLOAD_RESET, PAYLOAD_MAX_STATES } payload_state; diff --git a/port/board/afc-timing/CMakeLists.txt b/port/board/afc-timing/CMakeLists.txt index 6d4879a90..788115b62 100644 --- a/port/board/afc-timing/CMakeLists.txt +++ b/port/board/afc-timing/CMakeLists.txt @@ -12,7 +12,6 @@ set(TARGET_MODULES "FRU" "PAYLOAD" "SDR" - "WATCHDOG" "SCANSTA1101" "ADN4604" "DAC_AD84XX" @@ -25,8 +24,14 @@ set(TARGET_MODULES "HPM" "RTM" "UART_DEBUG" + "SYSUTILS" + "FLASH_SPI" ) +if (NOT DISABLE_WATCHDOG) + list(APPEND TARGET_MODULES "WATCHDOG") +endif() + set(BOARD_PATH ${CMAKE_CURRENT_SOURCE_DIR}) #Include the modules sources diff --git a/port/board/afc-timing/ipmi_oem.c b/port/board/afc-timing/ipmi_oem.c index e7f78ee06..bc3780cbe 100644 --- a/port/board/afc-timing/ipmi_oem.c +++ b/port/board/afc-timing/ipmi_oem.c @@ -80,7 +80,7 @@ IPMI_HANDLER(ipmi_oem_cmd_i2c_transfer, NETFN_CUSTOM_OEM, IPMI_OEM_CMD_I2C_TRANS if ( read_len > 0 ) { read_data = pvPortMalloc( read_len ); - memset( read_data, read_len, 0 ); + memset( read_data, 0, read_len ); if ( xI2CMasterRead( i2c_interf, i2c_addr, read_data, read_len ) == read_len ) { rsp->data[0] = read_len; diff --git a/port/board/afc-timing/payload.c b/port/board/afc-timing/payload.c index c693c7f4f..07994fb45 100644 --- a/port/board/afc-timing/payload.c +++ b/port/board/afc-timing/payload.c @@ -179,10 +179,19 @@ TaskHandle_t vTaskPayload_Handle; void payload_init( void ) { -#ifndef BENCH_TEST - /* Wait until ENABLE# signal is asserted ( ENABLE == 0) */ - while ( gpio_read_pin( PIN_PORT(GPIO_MMC_ENABLE), PIN_NUMBER(GPIO_MMC_ENABLE) ) == 1 ) {}; -#endif + + /* Set standalone mode if the module is disconnected from a create*/ + bool standalone_mode = false; + + if (get_ipmb_addr() == IPMB_ADDR_DISCONNECTED) { + standalone_mode = true; + } + + if (!standalone_mode) { + /* Wait until ENABLE# signal is asserted ( ENABLE == 0) */ + while ( gpio_read_pin( PIN_PORT(GPIO_MMC_ENABLE), PIN_NUMBER(GPIO_MMC_ENABLE) ) == 1 ) {}; + } + xTaskCreate( vTaskPayload, "Payload", 120, NULL, tskPAYLOAD_PRIORITY, &vTaskPayload_Handle ); @@ -234,18 +243,33 @@ void vTaskPayload( void *pvParameters ) current_evt = xEventGroupGetBits( amc_payload_evt ); if ( current_evt & PAYLOAD_MESSAGE_QUIESCE ) { - QUIESCED_req = 1; + + /* + * If you issue a shutdown fru command in the MCH shell, the payload power + * task will receive a PAYLOAD_MESSAGE_QUIESCE message and set the + * QUIESCED_req flag to '1' and the MCH will shutdown the 12VP0 power, + * making the payload power task go to PAYLOAD_NO_POWER state. + * So, if we are in the PAYLOAD_QUIESCED state and receive a + * PAYLOAD_MESSAGE_QUIESCE message, the QUIESCED_req flag + * should be '0' + */ + + if (state == PAYLOAD_QUIESCED) { + QUIESCED_req = 0; + } else { + QUIESCED_req = 1; + } xEventGroupClearBits( amc_payload_evt, PAYLOAD_MESSAGE_QUIESCE ); } if ( current_evt & PAYLOAD_MESSAGE_COLD_RST ) { - state = PAYLOAD_SWITCHING_OFF; + state = PAYLOAD_RESET; xEventGroupClearBits( amc_payload_evt, PAYLOAD_MESSAGE_COLD_RST ); } if ( (current_evt & PAYLOAD_MESSAGE_REBOOT) || (current_evt & PAYLOAD_MESSAGE_WARM_RST) ) { fpga_soft_reset(); - xEventGroupClearBits( amc_payload_evt, PAYLOAD_MESSAGE_REBOOT ); + xEventGroupClearBits(amc_payload_evt, PAYLOAD_MESSAGE_REBOOT | PAYLOAD_MESSAGE_WARM_RST); } payload_check_pgood(&PP_good); @@ -307,6 +331,11 @@ void vTaskPayload( void *pvParameters ) new_state = PAYLOAD_NO_POWER; } break; + case PAYLOAD_RESET: + /*Reset DCDC converters*/ + setDC_DC_ConvertersON( false ); + new_state = PAYLOAD_NO_POWER; + break; default: break; @@ -342,7 +371,7 @@ uint8_t payload_hpm_prepare_comp( void ) return IPMI_CC_OUT_OF_SPACE; } - memset(hpm_page, 0xFF, sizeof(hpm_page)); + memset(hpm_page, 0xFF, PAYLOAD_HPM_PAGE_SIZE); hpm_pg_index = 0; hpm_page_addr = 0; @@ -367,7 +396,7 @@ uint8_t payload_hpm_upload_block( uint8_t * block, uint16_t size ) /* TODO: Check DONE pin before accessing the SPI bus, since the FPGA may be reading it in order to boot */ uint8_t remaining_bytes_start; - if ( sizeof(hpm_page) - hpm_pg_index > size ) { + if ( PAYLOAD_HPM_PAGE_SIZE - hpm_pg_index > size ) { /* Our page is not full yet, just append the new data */ memcpy(&hpm_page[hpm_pg_index], block, size); hpm_pg_index += size; @@ -376,16 +405,16 @@ uint8_t payload_hpm_upload_block( uint8_t * block, uint16_t size ) } else { /* Complete the remaining bytes on the buffer */ - memcpy(&hpm_page[hpm_pg_index], block, (sizeof(hpm_page) - hpm_pg_index)); - remaining_bytes_start = (sizeof(hpm_page) - hpm_pg_index); + memcpy(&hpm_page[hpm_pg_index], block, (PAYLOAD_HPM_PAGE_SIZE - hpm_pg_index)); + remaining_bytes_start = (PAYLOAD_HPM_PAGE_SIZE - hpm_pg_index); /* Program the complete page in the Flash */ - flash_program_page( hpm_page_addr, &hpm_page[0], sizeof(hpm_page)); + flash_program_page( hpm_page_addr, &hpm_page[0], PAYLOAD_HPM_PAGE_SIZE); - hpm_page_addr += sizeof(hpm_page); + hpm_page_addr += PAYLOAD_HPM_PAGE_SIZE; /* Empty our buffer and reset the index */ - memset(hpm_page, 0xFF, sizeof(hpm_page)); + memset(hpm_page, 0xFF, PAYLOAD_HPM_PAGE_SIZE); hpm_pg_index = 0; /* Save the trailing bytes */ @@ -404,7 +433,7 @@ uint8_t payload_hpm_finish_upload( uint32_t image_size ) /* Check if the last page was already programmed */ if (!hpm_pg_index) { /* Program the complete page in the Flash */ - flash_program_page( hpm_page_addr, &hpm_page[0], (sizeof(hpm_page)-hpm_pg_index)); + flash_program_page( hpm_page_addr, &hpm_page[0], (PAYLOAD_HPM_PAGE_SIZE-hpm_pg_index)); hpm_pg_index = 0; hpm_page_addr = 0; diff --git a/port/board/afc-timing/payload.h b/port/board/afc-timing/payload.h index d5121862c..03ff35e3b 100644 --- a/port/board/afc-timing/payload.h +++ b/port/board/afc-timing/payload.h @@ -48,6 +48,7 @@ extern enum { PAYLOAD_FPGA_ON, PAYLOAD_SWITCHING_OFF, PAYLOAD_QUIESCED, + PAYLOAD_RESET, PAYLOAD_MAX_STATES } payload_state; diff --git a/port/board/afc-bpm/v3_0/CMakeLists.txt b/port/board/afc-v4/CMakeLists.txt similarity index 61% rename from port/board/afc-bpm/v3_0/CMakeLists.txt rename to port/board/afc-v4/CMakeLists.txt index 920448f1f..1ae65a93f 100644 --- a/port/board/afc-bpm/v3_0/CMakeLists.txt +++ b/port/board/afc-v4/CMakeLists.txt @@ -1,10 +1,10 @@ #Select which microcontroller and board are being used if (NOT TARGET_CONTROLLER) - set(TARGET_CONTROLLER "LPC1764" CACHE STRING "Target MMC Controller") + set(TARGET_CONTROLLER "LPC1768" CACHE STRING "Target MMC Controller") endif() if (NOT TARGET_BOARD_NAME) - set(TARGET_BOARD_NAME "AFC 3.0" CACHE STRING "Board Name") + set(TARGET_BOARD_NAME "AFC v4" CACHE STRING "Board Name") endif() #List all modules used by this board @@ -12,33 +12,47 @@ set(TARGET_MODULES "FRU" "PAYLOAD" "SDR" - "WATCHDOG" - "SCANSTA1101" - "ADN4604" - "FPGA_SPI" "DAC_AD84XX" - "EEPROM_AT24MAC" "HOTSWAP_SENSOR" + "EEPROM_AT24MAC" "LM75" "MAX6642" - "INA220_VOLTAGE" - "INA220_CURRENT" +# "INA3221_VOLTAGE" +# "INA3221_CURRENT" + "UART_DEBUG" + "MCP23016" + "ADC" + "BOARD_CONFIG" + "IDT_8V54816" "HPM" + "SYSUTILS" ) +if (NOT DISABLE_WATCHDOG) + list(APPEND TARGET_MODULES "WATCHDOG") +endif() + set(BOARD_PATH ${CMAKE_CURRENT_SOURCE_DIR}) #Include the modules sources ##Sensors SDR list -set(PROJ_SRCS ${PROJ_SRCS} ${BOARD_PATH}/sdr_list.c) -set(PROJ_SRCS ${PROJ_SRCS} ${BOARD_PATH}/i2c_mapping.c) -set(PROJ_SRCS ${PROJ_SRCS} ${BOARD_PATH}/ipmi_oem.c) +set( PROJ_SRCS ${PROJ_SRCS} ${BOARD_PATH}/sdr_list.c ) +set( PROJ_SRCS ${PROJ_SRCS} ${BOARD_PATH}/i2c_mapping.c ) if (";${TARGET_MODULES};" MATCHES ";PAYLOAD;") set(PROJ_SRCS ${PROJ_SRCS} ${BOARD_PATH}/payload.c) set(MODULES_FLAGS "${MODULES_FLAGS} -DMODULE_PAYLOAD") endif() +if (";${TARGET_MODULES};" MATCHES ";ADC;") + set(MODULES_FLAGS "${MODULES_FLAGS} -DMODULE_ADC") +endif() + +if (";${TARGET_MODULES};" MATCHES ";BOARD_CONFIG;") + set(PROJ_SRCS ${PROJ_SRCS} ${BOARD_PATH}/board_config.c) + set(MODULES_FLAGS "${MODULES_FLAGS} -DMODULE_BOARD_CONFIG") +endif() + #Extra definitions if (FRU_WRITE_EEPROM) message(STATUS "FRU EEPROM will be written if no valid data is found!") @@ -46,10 +60,6 @@ if (FRU_WRITE_EEPROM) set(FRU_WRITE_EEPROM false CACHE BOOL "Set this flag to enable writing the board ID on the EEPROM" FORCE) endif() -if (";${TARGET_MODULES};" MATCHES ";RTM;") - message(WARNING "${BoldRed} WARNING: RTM Module is not tested for AFC v3.0 boards!${ColourReset}") -endif() - #Set the variables in the main scope set(TARGET_MODULES ${TARGET_MODULES} PARENT_SCOPE) set(MODULES_FLAGS ${MODULES_FLAGS} PARENT_SCOPE) diff --git a/port/board/afc-v4/board_config.c b/port/board/afc-v4/board_config.c new file mode 100644 index 000000000..19e996c38 --- /dev/null +++ b/port/board/afc-v4/board_config.c @@ -0,0 +1,39 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2021 Krzysztof Macias + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +/* Project Includes */ +#include "port.h" + + +uint8_t clock_switch_default_config() { + +} + +void board_init() { + /* I2C MUX Init */ + gpio_set_pin_state(PIN_PORT(GPIO_I2C_MUX_ADDR1), PIN_NUMBER(GPIO_I2C_MUX_ADDR1), GPIO_LEVEL_LOW); + gpio_set_pin_state(PIN_PORT(GPIO_I2C_MUX_ADDR2), PIN_NUMBER(GPIO_I2C_MUX_ADDR2), GPIO_LEVEL_LOW); + gpio_set_pin_state(PIN_PORT(GPIO_I2C_SW_RESETn), PIN_NUMBER(GPIO_I2C_SW_RESETn), GPIO_LEVEL_HIGH); +} + +void board_config() { + clock_switch_default_config(); +} diff --git a/port/board/afc-v4/board_config.h b/port/board/afc-v4/board_config.h new file mode 100644 index 000000000..aac71c84e --- /dev/null +++ b/port/board/afc-v4/board_config.h @@ -0,0 +1,28 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2021 Krzysztof Macias + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +#ifndef BOARD_CONFIG_H_ +#define BOARD_CONFIG_H_ + +void board_init(); +void board_config(); + +#endif diff --git a/port/board/afc-v4/i2c_mapping.c b/port/board/afc-v4/i2c_mapping.c new file mode 100644 index 000000000..ed04b7f4e --- /dev/null +++ b/port/board/afc-v4/i2c_mapping.c @@ -0,0 +1,97 @@ +#include "i2c.h" +#include "i2c_mapping.h" +#include "port.h" + +i2c_mux_state_t i2c_mux[I2C_MUX_CNT] = { + { I2C1, -1, 0 }, + { I2C2, -1, 0 } +}; + +i2c_bus_mapping_t i2c_bus_map[I2C_BUS_CNT] = { + [I2C_BUS_UNKNOWN_ID] = { I2C1, -1, 0 }, + [I2C_BUS_TEMP_SENSORS_ID] = { I2C1, 0, 1 }, + [I2C_BUS_RTCE_ID] = { I2C1, 1, 1 }, + [I2C_BUS_PORT2_ID] = { I2C1, 2, 1 }, + [I2C_BUS_POWER_ID] = { I2C1, 3, 1 }, + [I2C_BUS_CLOCK_ID] = { I2C1, 4, 1 }, + [I2C_BUS_RTM_ID] = { I2C1, 5, 1 }, + [I2C_BUS_FMC2_ID] = { I2C1, 6, 1 }, + [I2C_BUS_FMC1_ID] = { I2C1, 7, 1 }, + [I2C_BUS_MUX_ID] = { I2C1, -1, 1 }, + [I2C_BUS_MCP_ID] = { I2C2, -1, 1 } +}; + +i2c_chip_mapping_t i2c_chip_map[I2C_CHIP_CNT] = { + [CHIP_ID_MUX] = { I2C_BUS_MUX_ID, 0x71 }, + [CHIP_ID_MAX6642] = { I2C_BUS_TEMP_SENSORS_ID, 0x48 }, + [CHIP_ID_LM75AIM_0] = { I2C_BUS_TEMP_SENSORS_ID, 0x4C }, + [CHIP_ID_LM75AIM_1] = { I2C_BUS_TEMP_SENSORS_ID, 0x4D }, + [CHIP_ID_LM75AIM_2] = { I2C_BUS_TEMP_SENSORS_ID, 0x4E }, + [CHIP_ID_LM75AIM_3] = { I2C_BUS_TEMP_SENSORS_ID, 0x4F }, + + + [CHIP_ID_RTC_EEPROM] = { I2C_BUS_RTCE_ID, 0x57 }, + [CHIP_ID_SRAM_RTCC] = { I2C_BUS_RTCE_ID, 0x6F }, + [CHIP_ID_EEPROM] = { I2C_BUS_RTCE_ID, 0x50 }, + [CHIP_ID_EUI] = { I2C_BUS_RTCE_ID, 0x58 }, + [CHIP_ID_EEPROM_64K] = { I2C_BUS_RTCE_ID, 0x51 }, + + [CHIP_ID_INA_0] = { I2C_BUS_POWER_ID, 0x40 }, + [CHIP_ID_INA_1] = { I2C_BUS_POWER_ID, 0x41 }, + [CHIP_ID_INA_2] = { I2C_BUS_POWER_ID, 0x42 }, + + [CHIP_ID_8V54816] = { I2C_BUS_CLOCK_ID, 0x5B }, + + [CHIP_ID_FMC2_EEPROM] = { I2C_BUS_FMC2_ID, 0x52 }, + [CHIP_ID_FMC2_LM75_0] = { I2C_BUS_FMC2_ID, 0x48 }, + [CHIP_ID_FMC2_LM75_1] = { I2C_BUS_FMC2_ID, 0x49 }, + + [CHIP_ID_FMC1_EEPROM] = { I2C_BUS_FMC1_ID, 0x50 }, + [CHIP_ID_FMC1_LM75_0] = { I2C_BUS_FMC1_ID, 0x48 }, + [CHIP_ID_FMC1_LM75_1] = { I2C_BUS_FMC1_ID, 0x49 }, + + [CHIP_ID_MCP23016] = { I2C_BUS_MCP_ID, 0x20 } +}; + +bool i2c_set_mux_bus( uint8_t bus_id, i2c_mux_state_t *i2c_mux, int8_t new_state ) +{ + portENABLE_INTERRUPTS(); + + if (i2c_mux->i2c_interface == i2c_bus_map[i2c_chip_map[CHIP_ID_MUX].bus_id].i2c_interface) { + uint8_t tca_channel = 1 << new_state; + + /* Select desired channel in the I2C switch */ + if( xI2CMasterWrite( i2c_bus_map[i2c_chip_map[CHIP_ID_MUX].bus_id].i2c_interface, i2c_chip_map[CHIP_ID_MUX].i2c_address, &tca_channel, 1 ) != 1 ) { + /* We failed to configure the I2C Mux, release the semaphore */ + xSemaphoreGive( i2c_mux->semaphore ); + return false; + } + } + + i2c_mux->state = new_state; + return true; +} + +uint8_t i2c_get_mux_bus( uint8_t bus_id, i2c_mux_state_t *i2c_mux ) +{ + if (i2c_mux->i2c_interface == i2c_bus_map[i2c_chip_map[CHIP_ID_MUX].bus_id].i2c_interface) { + /* Include enable bit (fourth bit) on channel selection byte */ + uint8_t tca_channel; + + portENABLE_INTERRUPTS(); + /* Read bus state (other master on the bus may have switched it */ + xI2CMasterRead( i2c_bus_map[i2c_chip_map[CHIP_ID_MUX].bus_id].i2c_interface, i2c_chip_map[CHIP_ID_MUX].i2c_address, &tca_channel, 1 ); + + /* Convert bit position from tca register to actual channel number */ + uint8_t num; + for (num = 0; num <= 8 ; num++) + { + if (tca_channel & 1 << num) + break; + } + return num; + + } else { + return i2c_mux->state; + } +} diff --git a/port/board/afc-bpm/v3_0/i2c_mapping.h b/port/board/afc-v4/i2c_mapping.h similarity index 54% rename from port/board/afc-bpm/v3_0/i2c_mapping.h rename to port/board/afc-v4/i2c_mapping.h index 8210289d3..6f4c01650 100644 --- a/port/board/afc-bpm/v3_0/i2c_mapping.h +++ b/port/board/afc-v4/i2c_mapping.h @@ -7,66 +7,51 @@ #define I2CMODE_INTERRUPT 0 #define SPEED_100KHZ 100000 -// BUS_ID -// 0 - FMC1 -// 1 - FMC2 -// 3 - CPU_ID -// -/////////////////////// - -enum { - CARRIER_TYPE_AFC = 0x01, - CARRIER_TYPE_AFCK, - CARRIER_TYPE_UNKNOWN = 0xFF -}; - enum { I2C_BUS_UNKNOWN_ID = 0x00, - I2C_BUS_FMC1_ID, - I2C_BUS_FMC2_ID, - I2C_BUS_CPU_ID, - I2C_BUS_RTM_ID, + I2C_BUS_TEMP_SENSORS_ID, + I2C_BUS_RTCE_ID, + I2C_BUS_PORT2_ID, + I2C_BUS_POWER_ID, I2C_BUS_CLOCK_ID, - I2C_BUS_FPGA_ID + I2C_BUS_RTM_ID, + I2C_BUS_FMC2_ID, + I2C_BUS_FMC1_ID, + I2C_BUS_MUX_ID, + I2C_BUS_MCP_ID, + I2C_BUS_CNT }; enum { CHIP_ID_MUX = 0, + CHIP_ID_MAX6642, CHIP_ID_LM75AIM_0, CHIP_ID_LM75AIM_1, CHIP_ID_LM75AIM_2, CHIP_ID_LM75AIM_3, - CHIP_ID_MAX6642, - CHIP_ID_RTC, CHIP_ID_RTC_EEPROM, + CHIP_ID_SRAM_RTCC, CHIP_ID_EEPROM, - CHIP_ID_EEPROM_ID, + CHIP_ID_EUI, + CHIP_ID_EEPROM_64K, CHIP_ID_INA_0, CHIP_ID_INA_1, CHIP_ID_INA_2, - CHIP_ID_INA_3, - CHIP_ID_INA_4, - CHIP_ID_INA_5, - CHIP_ID_ADN, - CHIP_ID_SI57x, - CHIP_ID_FMC1_EEPROM, - CHIP_ID_FMC1_LM75_1, - CHIP_ID_FMC1_LM75_0, + CHIP_ID_8V54816, CHIP_ID_FMC2_EEPROM, - CHIP_ID_FMC2_LM75_1, CHIP_ID_FMC2_LM75_0, - CHIP_ID_RTM_PCA9554, - CHIP_ID_RTM_EEPROM, - CHIP_ID_RTM_LM75_0, - CHIP_ID_RTM_LM75_1 + CHIP_ID_FMC2_LM75_1, + CHIP_ID_FMC1_EEPROM, + CHIP_ID_FMC1_LM75_0, + CHIP_ID_FMC1_LM75_1, + CHIP_ID_MCP23016, + I2C_CHIP_CNT }; #define I2C_MUX_CNT 2 -#define I2C_BUS_CNT 7 -#define I2C_CHIP_CNT 28 -extern i2c_mux_state_t i2c_mux[]; -extern i2c_bus_mapping_t i2c_bus_map[]; -extern i2c_chip_mapping_t i2c_chip_map[]; +extern i2c_mux_state_t i2c_mux[I2C_MUX_CNT]; +extern i2c_bus_mapping_t i2c_bus_map[I2C_BUS_CNT]; +extern i2c_chip_mapping_t i2c_chip_map[I2C_CHIP_CNT]; #endif diff --git a/port/board/afc-bpm/v3_0/ipmi_oem.c b/port/board/afc-v4/ipmi_oem.c similarity index 78% rename from port/board/afc-bpm/v3_0/ipmi_oem.c rename to port/board/afc-v4/ipmi_oem.c index 0176a3f8f..7d8382b1f 100644 --- a/port/board/afc-bpm/v3_0/ipmi_oem.c +++ b/port/board/afc-v4/ipmi_oem.c @@ -80,7 +80,7 @@ IPMI_HANDLER(ipmi_oem_cmd_i2c_transfer, NETFN_CUSTOM_OEM, IPMI_OEM_CMD_I2C_TRANS if ( read_len > 0 ) { read_data = pvPortMalloc( read_len ); - memset( read_data, read_len, 0 ); + memset( read_data, 0, read_len ); if ( xI2CMasterRead( i2c_interf, i2c_addr, read_data, read_len ) == read_len ) { rsp->data[0] = read_len; @@ -163,54 +163,3 @@ IPMI_HANDLER(ipmi_oem_cmd_gpio_pin, NETFN_CUSTOM_OEM, IPMI_OEM_CMD_GPIO_PIN, ipm rsp->data_len = len; } - -/* ADN4604 IPMI Control commands */ -#ifdef MODULE_ADN4604 - -#include "adn4604.h" - -/* This command may take a while to execute and hold the IPMI transaction */ -IPMI_HANDLER(ipmi_oem_adn4604_cfg_output, NETFN_CUSTOM_OEM, IPMI_OEM_CMD_ADN4604_SET_OUTPUT_CFG, ipmi_msg *req, ipmi_msg* rsp) -{ - int len = rsp->data_len = 0; - - /* @todo Read port status before setting the new configuration */ - extern adn_connect_map_t con; - uint8_t map; - uint8_t output = req->data[1]; - uint8_t input = req->data[2]; - uint8_t enable = req->data[3]; - - if (output % 2) { - *((uint8_t *)&con+(output/2)) &= 0x0F; - *((uint8_t *)&con+(output/2)) |= (input << 4) & 0xF0; - } else { - *((uint8_t *)&con+(output/2)) &= 0xF0; - *((uint8_t *)&con+(output/2)) |= input & 0x0F; - } - - map = ( req->data[0] == 0 ) ? ADN_XPT_MAP0_CON_REG : ADN_XPT_MAP1_CON_REG; - - adn4604_xpt_config( map , con ); - - if ( enable ) { - adn4604_tx_control( output, TX_ENABLED ); - } else { - adn4604_tx_control( output, TX_DISABLED ); - } - - adn4604_update(); - - rsp->data_len = len; - rsp->completion_code = IPMI_CC_OK; -} - -IPMI_HANDLER(ipmi_oem_adn4604_reset, NETFN_CUSTOM_OEM, IPMI_OEM_CMD_ADN4604_RESET, ipmi_msg *req, ipmi_msg* rsp) -{ - adn4604_reset(); - - rsp->data_len = 0; - rsp->completion_code = IPMI_CC_OK; -} - -#endif diff --git a/port/board/afc-bpm/v3_0/ipmi_oem.h b/port/board/afc-v4/ipmi_oem.h similarity index 81% rename from port/board/afc-bpm/v3_0/ipmi_oem.h rename to port/board/afc-v4/ipmi_oem.h index 47b149adc..4bbf1094f 100644 --- a/port/board/afc-bpm/v3_0/ipmi_oem.h +++ b/port/board/afc-v4/ipmi_oem.h @@ -24,15 +24,15 @@ #define IPMI_OEM_H_ /** - * @file afc-bpm/v3_0/ipmi_oem.h + * @file afc-v4/ipmi_oem.h * @brief Custom IPMI commands for AFC * - * @ingroup AFC_V3_0_IPMI_OEM + * @ingroup AFC_V4_0_IPMI_OEM */ /** - * @defgroup AFC_V3_0_IPMI_OEM AFCv3.0 IPMI OEM Commands - * @ingroup AFC_V3_0 + * @defgroup AFC_V4_0_IPMI_OEM AFCv4.0 IPMI OEM Commands + * @ingroup AFC_V4_0 * @{ */ @@ -44,11 +44,6 @@ #define NETFN_CUSTOM_OEM 0x30 #define IPMI_OEM_CMD_I2C_TRANSFER 0x00 - -#define IPMI_OEM_CMD_ADN4604_SET_OUTPUT_CFG 0x01 -#define IPMI_OEM_CMD_ADN4604_GET_OUTPUT_CFG 0x02 -#define IPMI_OEM_CMD_ADN4604_RESET 0x03 - #define IPMI_OEM_CMD_GPIO_PIN 0x04 /** * @} diff --git a/port/board/afc-v4/payload.c b/port/board/afc-v4/payload.c new file mode 100644 index 000000000..af86bf4e4 --- /dev/null +++ b/port/board/afc-v4/payload.c @@ -0,0 +1,499 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2015 Piotr Miedzik + * Copyright (C) 2015-2016 Henrique Silva + * Copyright (C) 2021 Krzysztof Macias + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +/* FreeRTOS Includes */ +#include "FreeRTOS.h" +#include "task.h" +#include "semphr.h" +#include "event_groups.h" + +/* Project Includes */ +#include "port.h" +#include "adc_17xx_40xx.h" +#include "payload.h" +#include "ipmi.h" +#include "task_priorities.h" +#include "mcp23016.h" +#include "ad84xx.h" +#include "hotswap.h" +#include "utils.h" +#include "fru.h" +#include "led.h" +#include "board_led.h" + + +/* payload states + * 0 - No power + * + * 1 - Power Good wait + * Enable DCDC Converters + * Hotswap backend power failure and shutdown status clear + * + * 2 - FPGA setup + * One-time configurations (clock switch - ADN4604) + * + * 3 - FPGA on + * + * 4 - Power switching off + * Disable DCDC Converters + * Send "quiesced" event if requested + * + * 5 - Power quiesced + * Payload was safely turned off + * Wait until payload power goes down to restart the cycle + */ + +const external_gpio_t ext_gpios[16] = { + [EXT_GPIO_P1V5_VTT_EN] = { 1, 7 }, + [EXT_GPIO_EN_P1V8] = { 1, 6 }, + [EXT_GPIO_EN_P1V2] = { 1, 5 }, + [EXT_GPIO_EN_FMC1_P12V] = { 1, 4 }, + [EXT_GPIO_EN_FMC2_P12V] = { 1, 3 }, + [EXT_GPIO_EN_FMC1_PVADJ] = { 1, 2 }, + [EXT_GPIO_EN_FMC2_PVADJ] = { 1, 1 }, + [EXT_GPIO_EN_FMC1_P3V3] = { 1, 0 }, + [EXT_GPIO_EN_FMC2_P3V3] = { 0, 7 }, + [EXT_GPIO_EN_P1V0] = { 0, 6 }, + [EXT_GPIO_EN_P3V3] = { 0, 5 }, + [EXT_GPIO_EN_RTM_PWR] = { 0, 4 }, + [EXT_GPIO_EN_RTM_MP] = { 0, 3 }, + [EXT_GPIO_FPGA_I2C_RESET] = { 0, 2 }, + [EXT_GPIO_DAC_VADJ_RSTn] = { 0, 1 }, + [EXT_GPIO_PROGRAM_B] = { 0, 0 } +}; + + +/** + * @brief Set AFC's DCDC Converters state + * + * @param on DCDCs state + * + */ + +uint8_t setDC_DC_ConvertersON(bool on) +{ + uint8_t power_pins[] = { + EXT_GPIO_EN_P1V0, + EXT_GPIO_EN_P1V8, + EXT_GPIO_EN_P3V3, + EXT_GPIO_EN_FMC1_PVADJ, + EXT_GPIO_EN_FMC2_PVADJ, + EXT_GPIO_P1V5_VTT_EN, + EXT_GPIO_EN_P1V2, + EXT_GPIO_EN_FMC1_P12V, + EXT_GPIO_EN_FMC1_P3V3, + EXT_GPIO_EN_FMC2_P12V, + EXT_GPIO_EN_FMC2_P3V3 + }; + + uint8_t pin; + if (on) { + printf("Enable Power\n"); + + for (uint8_t i = 0; i < (sizeof(power_pins) / sizeof(power_pins[0])); i++) { + pin = power_pins[i]; + mcp23016_write_pin( ext_gpios[pin].port_num, ext_gpios[pin].pin_num, true ); + vTaskDelay(10); + } + } else { + printf("Disable Power\n"); + + for (uint8_t i = (sizeof(power_pins) / sizeof(power_pins[0])); i > 0; i--) { + pin = power_pins[i]; + mcp23016_write_pin( ext_gpios[pin].port_num, ext_gpios[pin].pin_num, false ); + vTaskDelay(10); + } + } + return 1; +} + +static void fpga_soft_reset( void ) +{ + gpio_set_pin_low( PIN_PORT(GPIO_FPGA_RESET), PIN_NUMBER(GPIO_FPGA_RESET) ); + asm("NOP"); + gpio_set_pin_high( PIN_PORT(GPIO_FPGA_RESET), PIN_NUMBER(GPIO_FPGA_RESET) ); + + /* Blink RED LED to indicate to the user that the Reset was performed */ + LEDUpdate( FRU_AMC, LED1, LEDMODE_LAMPTEST, LEDINIT_ON, 5, 0 ); +} + +static void check_fpga_reset( void ) +{ + static TickType_t edge_time; + static uint8_t reset_lock; + static uint8_t last_state = 1; + + TickType_t diff; + TickType_t cur_time = xTaskGetTickCount(); + + uint8_t cur_state = gpio_read_pin( PIN_PORT(GPIO_FRONT_BUTTON), PIN_NUMBER(GPIO_FRONT_BUTTON)); + + if ( (cur_state == 0) && (last_state == 1) ) { + /* Detects the falling edge of the front panel button */ + edge_time = cur_time; + reset_lock = 0; + } + + diff = getTickDifference( cur_time, edge_time ); + + if ( (diff > pdMS_TO_TICKS(2000)) && (reset_lock == 0) && (cur_state == 0) ) { + fpga_soft_reset(); + /* If the user continues to press the button after the 2s, prevent this action to be repeated */ + reset_lock = 1; + } + + last_state = cur_state; +} + +uint8_t payload_check_pgood() +{ + /* Threshold set to ~8V */ + const uint16_t PAYLOAD_THRESHOLD = 0x9B2; + uint16_t dataADC; + + Chip_ADC_SetStartMode(LPC_ADC, ADC_START_NOW, ADC_TRIGGERMODE_RISING); + + /* Waiting for A/D conversion complete */ + while (Chip_ADC_ReadStatus(LPC_ADC, ADC_CH1, ADC_DR_DONE_STAT) != SET) {} + /* Read ADC value */ + Chip_ADC_ReadValue(LPC_ADC, ADC_CH1, &dataADC); + + if (dataADC > PAYLOAD_THRESHOLD){ + return 1; + } + return 0; +} + +#ifdef MODULE_DAC_AD84XX +void set_vadj_volt( uint8_t fmc_slot, float v ) +{ + uint32_t res_total; + uint32_t res_dac; + + res_total = (uint32_t) (1162.5/(v-0.775)) - 453; + res_dac = (1800*res_total)/(1800-res_total); + + /* Use only the lower 8-bits (the dac only has 256 steps) */ + res_dac &= 0xFF; + + dac_ad84xx_set_res( fmc_slot, res_dac ); +} +#endif + +EventGroupHandle_t amc_payload_evt = NULL; +#ifdef MODULE_RTM +EventGroupHandle_t rtm_payload_evt = NULL; +#endif + +void payload_send_message( uint8_t fru_id, EventBits_t msg) +{ + if ( (fru_id == FRU_AMC) && amc_payload_evt ) { + xEventGroupSetBits( amc_payload_evt, msg ); +#ifdef MODULE_RTM + } else if ( (fru_id == FRU_RTM) && rtm_payload_evt ) { + xEventGroupSetBits( rtm_payload_evt, msg ); +#endif + } + +} + +TaskHandle_t vTaskPayload_Handle; + +void payload_init( void ) +{ + bool standalone_mode = false; + mmc_err err; + + if (get_ipmb_addr() == IPMB_ADDR_DISCONNECTED) { + standalone_mode = true; + } + + if (!standalone_mode) { + /* Wait until ENABLE# signal is asserted ( ENABLE == 0) */ + while ( gpio_read_pin( PIN_PORT(GPIO_MMC_ENABLE), PIN_NUMBER(GPIO_MMC_ENABLE) ) == 1 ) {}; + } + + xTaskCreate( vTaskPayload, "Payload", 120, NULL, tskPAYLOAD_PRIORITY, &vTaskPayload_Handle ); + + amc_payload_evt = xEventGroupCreate(); +#ifdef MODULE_RTM + rtm_payload_evt = xEventGroupCreate(); +#endif + +#ifdef MODULE_ADC + ADC_CLOCK_SETUP_T ADCSetup; + Chip_ADC_Init(LPC_ADC, &ADCSetup); + Chip_ADC_EnableChannel(LPC_ADC, ADC_CH1, ENABLE); +#endif + +#ifdef MODULE_MCP23016 + if (!gpio_read_pin(PIN_PORT(GPIO_PGOOD_P1V0), PIN_NUMBER(GPIO_PGOOD_P1V0))){ + + /* + * Configure all GPIOs as outputs + */ + err = mcp23016_set_port_dir(0, 0); + + if (err != MMC_OK) { + PRINT_ERR_LINE(err); + } + + err = mcp23016_set_port_dir(1, 0); + + if (err != MMC_OK) { + PRINT_ERR_LINE(err); + } + +#ifdef MODULE_DAC_AD84XX + /* Configure the PVADJ DAC */ + err = mcp23016_write_pin( ext_gpios[EXT_GPIO_DAC_VADJ_RSTn].port_num, ext_gpios[EXT_GPIO_DAC_VADJ_RSTn].pin_num, false ); + if (err != MMC_OK) { + PRINT_ERR_LINE(err); + } + + dac_ad84xx_init(); + + err = mcp23016_write_pin( ext_gpios[EXT_GPIO_DAC_VADJ_RSTn].port_num, ext_gpios[EXT_GPIO_DAC_VADJ_RSTn].pin_num, true ); + if (err != MMC_OK) { + PRINT_ERR_LINE(err); + } + + set_vadj_volt( 0, 2.5 ); + set_vadj_volt( 1, 2.5 ); +#endif + + gpio_set_pin_state(PIN_PORT(GPIO_FPGA_RESET), PIN_NUMBER(GPIO_FPGA_RESET), GPIO_LEVEL_LOW); + gpio_set_pin_state(PIN_PORT(GPIO_FPGA_INITB), PIN_NUMBER(GPIO_FPGA_INITB), GPIO_LEVEL_LOW); + + err = mcp23016_write_pin( ext_gpios[EXT_GPIO_PROGRAM_B].port_num, ext_gpios[EXT_GPIO_PROGRAM_B].pin_num, false ); + + if (err != MMC_OK) { + PRINT_ERR_LINE(err); + } + + err = mcp23016_write_pin( ext_gpios[EXT_GPIO_FPGA_I2C_RESET].port_num, ext_gpios[EXT_GPIO_FPGA_I2C_RESET].pin_num, true ); + + if (err != MMC_OK) { + PRINT_ERR_LINE(err); + } + } +#endif +} + +void vTaskPayload( void *pvParameters ) +{ + uint8_t state = PAYLOAD_NO_POWER; + /* Use arbitrary state value to force the first state update */ + uint8_t new_state = -1; + + /* Payload power good flag */ + uint8_t PP_good = 0; + + /* Payload DCDCs good flag */ + uint8_t DCDC_good = 0; + + uint8_t QUIESCED_req = 0; + EventBits_t current_evt; + + extern sensor_t * hotswap_amc_sensor; + + TickType_t xLastWakeTime; + mmc_err err; + + xLastWakeTime = xTaskGetTickCount(); + + for ( ;; ) { + check_fpga_reset(); + + new_state = state; + + current_evt = xEventGroupGetBits( amc_payload_evt ); + + if ( current_evt & PAYLOAD_MESSAGE_QUIESCE ) { + + /* + * If you issue a shutdown fru command in the MCH shell, the payload power + * task will receive a PAYLOAD_MESSAGE_QUIESCE message and set the + * QUIESCED_req flag to '1' and the MCH will shutdown the 12VP0 power, + * making the payload power task go to PAYLOAD_NO_POWER state. + * So, if we are in the PAYLOAD_QUIESCED state and receive a + * PAYLOAD_MESSAGE_QUIESCE message, the QUIESCED_req flag + * should be '0' + */ + + if (state == PAYLOAD_QUIESCED) { + QUIESCED_req = 0; + } else { + QUIESCED_req = 1; + } + xEventGroupClearBits( amc_payload_evt, PAYLOAD_MESSAGE_QUIESCE ); + } + + if ( current_evt & PAYLOAD_MESSAGE_COLD_RST ) { + state = PAYLOAD_RESET; + xEventGroupClearBits( amc_payload_evt, PAYLOAD_MESSAGE_COLD_RST ); + } + + if ( (current_evt & PAYLOAD_MESSAGE_REBOOT) || (current_evt & PAYLOAD_MESSAGE_WARM_RST) ) { + fpga_soft_reset(); + xEventGroupClearBits(amc_payload_evt, PAYLOAD_MESSAGE_REBOOT | PAYLOAD_MESSAGE_WARM_RST); + } + + PP_good = payload_check_pgood(); + DCDC_good = gpio_read_pin(PIN_PORT(GPIO_PGOOD_P1V0), PIN_NUMBER(GPIO_PGOOD_P1V0)); + + switch(state) { + + case PAYLOAD_NO_POWER: + if (PP_good) { + new_state = PAYLOAD_POWER_GOOD_WAIT; + } + break; + + case PAYLOAD_POWER_GOOD_WAIT: + /* Turn DDC converters on */ + if ( DCDC_good == 0 ){ + setDC_DC_ConvertersON( true ); + } + + /* Clear hotswap sensor backend power failure bits */ + hotswap_clear_mask_bit( HOTSWAP_AMC, HOTSWAP_BACKEND_PWR_SHUTDOWN_MASK ); + hotswap_clear_mask_bit( HOTSWAP_AMC, HOTSWAP_BACKEND_PWR_FAILURE_MASK ); + + if ( QUIESCED_req || ( PP_good == 0 ) ) { + new_state = PAYLOAD_SWITCHING_OFF; + } else if ( DCDC_good == 1 ) { + new_state = PAYLOAD_STATE_FPGA_SETUP; + + err = mcp23016_write_pin( ext_gpios[EXT_GPIO_PROGRAM_B].port_num, ext_gpios[EXT_GPIO_PROGRAM_B].pin_num, true ); + + if (err != MMC_OK) { + PRINT_ERR_LINE(err); + } + + gpio_set_pin_state(PIN_PORT(GPIO_FPGA_INITB), PIN_NUMBER(GPIO_FPGA_INITB), GPIO_LEVEL_HIGH); + gpio_set_pin_state(PIN_PORT(GPIO_FPGA_RESET), PIN_NUMBER(GPIO_FPGA_RESET), GPIO_LEVEL_HIGH); + } + break; + + case PAYLOAD_STATE_FPGA_SETUP: + + new_state = PAYLOAD_FPGA_ON; + break; + + case PAYLOAD_FPGA_ON: + if ( QUIESCED_req == 1 || PP_good == 0 || DCDC_good == 0 ) { + new_state = PAYLOAD_SWITCHING_OFF; + } + break; + + case PAYLOAD_SWITCHING_OFF: + gpio_set_pin_state(PIN_PORT(GPIO_FPGA_RESET), PIN_NUMBER(GPIO_FPGA_RESET), GPIO_LEVEL_LOW); + gpio_set_pin_state(PIN_PORT(GPIO_FPGA_INITB), PIN_NUMBER(GPIO_FPGA_INITB), GPIO_LEVEL_LOW); + err = mcp23016_write_pin( ext_gpios[EXT_GPIO_PROGRAM_B].port_num, ext_gpios[EXT_GPIO_PROGRAM_B].pin_num, false ); + + if (err != MMC_OK) { + PRINT_ERR_LINE(err); + } + + setDC_DC_ConvertersON( false ); + + /* Respond to quiesce event if any */ + if ( QUIESCED_req ) { + hotswap_set_mask_bit( HOTSWAP_AMC, HOTSWAP_QUIESCED_MASK ); + hotswap_send_event( hotswap_amc_sensor, HOTSWAP_STATE_QUIESCED ); + hotswap_clear_mask_bit( HOTSWAP_AMC, HOTSWAP_QUIESCED_MASK ); + QUIESCED_req = 0; + } + new_state = PAYLOAD_QUIESCED; + break; + + case PAYLOAD_QUIESCED: + /* Wait until power goes down to restart the cycle */ + if (PP_good == 0 && DCDC_good == 0) { + new_state = PAYLOAD_NO_POWER; + } + break; + + case PAYLOAD_RESET: + /*Reset DCDC converters*/ + setDC_DC_ConvertersON( false ); + new_state = PAYLOAD_NO_POWER; + break; + + default: + break; + } + + state = new_state; + vTaskDelayUntil( &xLastWakeTime, PAYLOAD_BASE_DELAY ); + } +} + + +/* HPM Functions */ +#ifdef MODULE_HPM + +#include "flash_spi.h" +#include "string.h" + +uint8_t payload_hpm_prepare_comp( void ) +{ + return IPMI_CC_ILLEGAL_COMMAND_DISABLED; +} + +uint8_t payload_hpm_upload_block( uint8_t * block, uint16_t size ) +{ + return IPMI_CC_ILLEGAL_COMMAND_DISABLED; +} + +uint8_t payload_hpm_finish_upload( uint32_t image_size ) +{ + return IPMI_CC_ILLEGAL_COMMAND_DISABLED; +} + +uint8_t payload_hpm_get_upgrade_status( void ) +{ + return IPMI_CC_ILLEGAL_COMMAND_DISABLED; +} + +uint8_t payload_hpm_activate_firmware( void ) +{ + mmc_err err; + + /* Reset FPGA - Pulse PROGRAM_B pin */ + err = mcp23016_write_pin( ext_gpios[EXT_GPIO_PROGRAM_B].port_num, ext_gpios[EXT_GPIO_PROGRAM_B].pin_num, false ); + + if (err != MMC_OK) { + PRINT_ERR_LINE(err); + } + + err = mcp23016_write_pin( ext_gpios[EXT_GPIO_PROGRAM_B].port_num, ext_gpios[EXT_GPIO_PROGRAM_B].pin_num, true ); + + if (err != MMC_OK) { + PRINT_ERR_LINE(err); + } + + return IPMI_CC_OK; +} +#endif diff --git a/port/board/afc-bpm/v3_0/payload.h b/port/board/afc-v4/payload.h similarity index 64% rename from port/board/afc-bpm/v3_0/payload.h rename to port/board/afc-v4/payload.h index 0b8082b73..432fe18c4 100644 --- a/port/board/afc-bpm/v3_0/payload.h +++ b/port/board/afc-v4/payload.h @@ -3,6 +3,7 @@ * * Copyright (C) 2015 Piotr Miedzik * Copyright (C) 2015-2016 Henrique Silva + * Copyright (C) 2021 Krzysztof Macias * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,15 +22,15 @@ */ /** - * @file afc/v3_1/payload.h - * @brief Payload control module definitions for AFCv3.1 + * @file afcv4/payload.h + * @brief Payload control module definitions for AFCv4.0 * - * @ingroup AFC_V3_1_PAYLOAD + * @ingroup AFC_V4_0_PAYLOAD */ /** - * @defgroup AFC_V3_1_PAYLOAD AFCv3.1 Payload Control - * @ingroup AFC_V3_1 + * @defgroup AFC_V4_0_PAYLOAD AFCv4 Payload Control + * @ingroup AFC_V4_0 * @{ */ @@ -43,41 +44,63 @@ */ extern enum { PAYLOAD_NO_POWER = 0, - PAYLOAD_SWITCHING_ON, PAYLOAD_POWER_GOOD_WAIT, PAYLOAD_STATE_FPGA_SETUP, - PAYLOAD_FPGA_BOOTING, - PAYLOAD_FPGA_WORKING, + PAYLOAD_FPGA_ON, PAYLOAD_SWITCHING_OFF, PAYLOAD_QUIESCED, - PAYLOAD_OFF, - PAYLOAD_STATE_NO_CHANGE = 253, - PAYLOAD_STATE_UNKNOWN = 254, - PAYLOAD_POWER_FAIL = 255 + PAYLOAD_RESET, + PAYLOAD_MAX_STATES, } payload_state; /** - * @defgroup AFC_V3_1_PAYLOAD_MSG Payload Messages Codes - * @ingroup AFC_V3_1_PAYLOAD + * @defgroup AFC_V4_0_PAYLOAD_MSG Payload Messages Codes + * @ingroup AFC_V4_0_PAYLOAD * @{ */ -#define PAYLOAD_MESSAGE_PPGOOD (1 << 0) -#define PAYLOAD_MESSAGE_PPGOODn (1 << 1) -#define PAYLOAD_MESSAGE_DCDC_PGOOD (1 << 2) -#define PAYLOAD_MESSAGE_DCDC_PGOODn (1 << 3) -#define PAYLOAD_MESSAGE_COLD_RST (1 << 4) -#define PAYLOAD_MESSAGE_WARM_RST (1 << 5) -#define PAYLOAD_MESSAGE_REBOOT (1 << 6) -#define PAYLOAD_MESSAGE_QUIESCE (1 << 7) +#define PAYLOAD_MESSAGE_COLD_RST (1 << 0) +#define PAYLOAD_MESSAGE_WARM_RST (1 << 1) +#define PAYLOAD_MESSAGE_REBOOT (1 << 2) +#define PAYLOAD_MESSAGE_QUIESCE (1 << 3) +#define PAYLOAD_MESSAGE_DCDC_PGOOD (1 << 4) +#define PAYLOAD_MESSAGE_DCDC_PGOODn (1 << 5) /** * @} */ +typedef struct external_gpio { + uint8_t port_num; + uint8_t pin_num; +} external_gpio_t; + +enum { + EXT_GPIO_EN_P1V0, + EXT_GPIO_EN_P1V8, + EXT_GPIO_EN_P3V3, + EXT_GPIO_EN_FMC1_PVADJ, + EXT_GPIO_EN_FMC2_PVADJ, + EXT_GPIO_P1V5_VTT_EN, + EXT_GPIO_EN_P1V2, + EXT_GPIO_EN_FMC1_P12V, + EXT_GPIO_EN_FMC1_P3V3, + EXT_GPIO_EN_FMC2_P12V, + EXT_GPIO_EN_FMC2_P3V3, + EXT_GPIO_EN_RTM_PWR, + EXT_GPIO_EN_RTM_MP, + EXT_GPIO_FPGA_I2C_RESET, + EXT_GPIO_DAC_VADJ_RSTn, + EXT_GPIO_PROGRAM_B, +}; /** * @brief Payload task unblock delay */ #define PAYLOAD_BASE_DELAY 100 +/** + * @brief Payload task handle variable + */ +extern TaskHandle_t vTaskPayload_Handle; + /** * @brief Sends a message to the payload task * @@ -101,6 +124,9 @@ void vTaskPayload( void *pvParameters ); void payload_init( void ); #ifdef MODULE_HPM + +#define PAYLOAD_HPM_PAGE_SIZE 256 + uint8_t payload_hpm_prepare_comp( void ); uint8_t payload_hpm_upload_block( uint8_t * block, uint16_t size ); uint8_t payload_hpm_finish_upload( uint32_t image_size ); diff --git a/port/board/afc-v4/pin_mapping.h b/port/board/afc-v4/pin_mapping.h new file mode 100644 index 000000000..ce8430153 --- /dev/null +++ b/port/board/afc-v4/pin_mapping.h @@ -0,0 +1,246 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2016 Henrique Silva + * Copyright (C) 2021 Krzysztof Macias + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +/** + * @defgroup AFC_V4_0 AFCv4.0 Board Port + * @ingroup BOARD_PORTS + */ + +/** + * @file afc-v4/pin_mapping.h + * @brief Hardware pin definitions for AFCv4.0 + * + * @ingroup AFC_V4_0_PIN_MAPPING + */ + +/** + * @defgroup AFC_V4_0_PIN_MAPPING AFCv4.0 Pin Mapping + * @ingroup AFC_V4_0 + * @{ + */ + +#ifndef PIN_MAPPING_H_ +#define PIN_MAPPING_H_ + +/* SPI Interfaces */ +#define FPGA_SPI 0 + +/* UART Interfaces */ +#define UART_DEBUG 0 + +/* Pin definitions */ + +/* I2C ports */ +#define I2C0_SDA PIN_DEF( PORT0, 27, (IOCON_FUNC1 | IOCON_MODE_INACT), NON_GPIO ) +#define I2C0_SCL PIN_DEF( PORT0, 28, (IOCON_FUNC1 | IOCON_MODE_INACT), NON_GPIO ) +#define I2C1_SDA PIN_DEF( PORT0, 0, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO ) +#define I2C1_SCL PIN_DEF( PORT0, 1, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO ) +#define I2C2_SDA PIN_DEF( PORT0, 10, (IOCON_FUNC2 | IOCON_MODE_INACT), NON_GPIO ) +#define I2C2_SCL PIN_DEF( PORT0, 11, (IOCON_FUNC2 | IOCON_MODE_INACT), NON_GPIO ) + +/* UART Debug port */ +#define UART_DEBUG_TXD PIN_DEF( PORT0, 2, (IOCON_FUNC1 | IOCON_MODE_INACT), NON_GPIO ) +#define UART_DEBUG_RXD PIN_DEF( PORT0, 3, (IOCON_FUNC1 | IOCON_MODE_INACT), NON_GPIO ) + +/* FPGA SPI Port (SSEL is GPIO for word transfers larger than 8bits) */ +#define SSP0_SCK PIN_DEF( PORT1, 20, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO ) +#define SSP0_SSEL PIN_DEF( PORT1, 21, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_OUTPUT ) +#define SSP0_MISO PIN_DEF( PORT1, 23, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO ) +#define SSP0_MOSI PIN_DEF( PORT1, 24, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO ) + +/* SPI Legacy port - should be updated to SSP interface */ +/* DAC SPI Port (SSEL is GPIO for word transfers larger than 8bits) */ +#define SPI_SCK PIN_DEF( PORT0, 15, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO ) +#define SPI_SSEL PIN_DEF( PORT0, 16, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_OUTPUT ) +#define SPI_MOSI PIN_DEF( PORT0, 18, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO ) + +/* Tracedata */ +#define TRACEDATA3 PIN_DEF( PORT2, 2, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO ) +#define TRACEDATA2 PIN_DEF( PORT2, 3, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO ) +#define TRACEDATA1 PIN_DEF( PORT2, 4, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO ) +#define TRACEDATA0 PIN_DEF( PORT2, 5, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO ) +#define TRACECLK PIN_DEF( PORT2, 6, (IOCON_FUNC3 | IOCON_MODE_INACT), NON_GPIO ) + +/*ADC Payload detector*/ +#define ADC_PAYLOAD_DETECTOR PIN_DEF( PORT0, 24, (IOCON_FUNC1 | IOCON_MODE_INACT), NON_GPIO ) + + +/* GPIO definitions */ + +/* I2C MUX control pins */ +#define GPIO_I2C_MUX_ADDR1 PIN_DEF( PORT0, 4, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) +#define GPIO_I2C_MUX_ADDR2 PIN_DEF( PORT0, 5, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) +#define GPIO_I2C_SW_RESETn PIN_DEF( PORT0, 19, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_OUTPUT ) + +/* LPC_ISPn RTS */ +#define GPIO_RTS PIN_DEF( PORT2, 10, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) + +/* Power Good pins */ +#define GPIO_PG_RESETn PIN_DEF( PORT1, 22, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) +#define GPIO_PGOOD_P1V0 PIN_DEF( PORT3, 26, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) + +#define GPIO_AMC_RTM_CRITICAL PIN_DEF( PORT1, 26, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) +#define GPIO_AMC_RTM_TC PIN_DEF( PORT1, 28, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) +#define GPIO_AMC_RTM_WARNING PIN_DEF( PORT1, 29, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) +#define GPIO_AMC_RTM_PV PIN_DEF( PORT1, 27, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) + +/* FMC Power Good pins */ +#define GPIO_FMC1_PG_M2C PIN_DEF( PORT1, 16, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) +#define GPIO_FMC2_PG_M2C PIN_DEF( PORT1, 17, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) +#define GPIO_FMC1_PG_C2M PIN_DEF( PORT1, 18, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_OUTPUT ) +#define GPIO_FMC2_PG_C2M PIN_DEF( PORT1, 19, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_OUTPUT ) + +#define GPIO_FMC1_CRITICAL PIN_DEF( PORT0, 23, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) +#define GPIO_FMC1_TC PIN_DEF( PORT0, 25, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) +#define GPIO_FMC1_WARNING PIN_DEF( PORT0, 26, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) +#define GPIO_FMC1_PV PIN_DEF( PORT1, 31, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) + +#define GPIO_FMC2_CRITICAL PIN_DEF( PORT2, 7, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) +#define GPIO_FMC2_TC PIN_DEF( PORT4, 28, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) +#define GPIO_FMC2_WARNING PIN_DEF( PORT4, 29, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) +#define GPIO_FMC2_PV PIN_DEF( PORT3, 25, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) + +/* Geographic Address pin definitions */ +#define GPIO_GA0 PIN_DEF( PORT1, 0, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) +#define GPIO_GA1 PIN_DEF( PORT1, 1, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) +#define GPIO_GA2 PIN_DEF( PORT1, 4, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) +#define GPIO_GA_TEST PIN_DEF( PORT1, 8, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_OUTPUT ) + +/* Board LEDs */ +#define GPIO_LEDBLUE PIN_DEF( PORT1, 9, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_OUTPUT ) +#define GPIO_LEDGREEN PIN_DEF( PORT1, 10, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) +#define GPIO_LEDRED PIN_DEF( PORT1, 25, (IOCON_FUNC0 | IOCON_MODE_PULLDOWN), GPIO_DIR_OUTPUT ) + +/* Front Panel BUTTON */ +#define GPIO_FRONT_BUTTON PIN_DEF( PORT2, 12, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) + +/* Hot swap handle */ +#define GPIO_HOT_SWAP_HANDLE PIN_DEF( PORT2, 13, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) + +/* FPGA Control */ +#define GPIO_FPGA_DONE_B PIN_DEF( PORT0, 22, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) +#define GPIO_FPGA_INITB PIN_DEF( PORT0, 20, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_OUTPUT ) +#define GPIO_FPGA_RESET PIN_DEF( PORT2, 9, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_OUTPUT ) + +/* VADJ DAC */ +#define GPIO_DAC_VADJ_RST PIN_DEF( PORT0, 21, (IOCON_FUNC0 | IOCON_MODE_PULLUP), GPIO_DIR_OUTPUT ) + +/* MMC ENABLE# */ +#define GPIO_MMC_ENABLE PIN_DEF( PORT2, 8, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) + +/* Overtemp signal */ +#define GPIO_OVERTEMPn PIN_DEF( PORT2, 11, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) + +/* JTAG */ +#define GPIO_FMC1_JTAG_Override PIN_DEF( PORT2, 1, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_OUTPUT ) +#define GPIO_FMC2_JTAG_Override PIN_DEF( PORT0, 8, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_OUTPUT ) +#define GPIO_RTM_JTAG_Override PIN_DEF( PORT2, 0, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_OUTPUT ) + +/* EEPROM WP signal */ +#define GPIO_EEPROM_WP PIN_DEF( PORT1, 30, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_OUTPUT ) + +/* FMC CLK signals */ +#define GPIO_CLK_DIR_FMC2 PIN_DEF( PORT0, 6, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) +#define GPIO_CLK_DIR_FMC1 PIN_DEF( PORT0, 7, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) + +/* FMC Present signals */ +#define GPIO_FMC1_PRSNT_M2C PIN_DEF( PORT1, 14, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) +#define GPIO_FMC2_PRSNT_M2C PIN_DEF( PORT1, 15, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) + +/* RTM */ +#define GPIO_RTM_PS PIN_DEF( PORT0, 29, (IOCON_FUNC0 | IOCON_MODE_INACT), GPIO_DIR_INPUT ) + + +/* Pin initialization (config) list */ +#define PIN_CFG_LIST \ + I2C0_SDA, \ + I2C0_SCL, \ + I2C1_SDA, \ + I2C1_SCL, \ + I2C2_SDA, \ + I2C2_SCL, \ + UART_DEBUG_TXD, \ + UART_DEBUG_RXD, \ + SSP0_SCK, \ + SSP0_SSEL, \ + SSP0_MISO, \ + SSP0_MOSI, \ + SPI_SCK, \ + SPI_SSEL, \ + SPI_MOSI, \ + TRACEDATA3, \ + TRACEDATA2, \ + TRACEDATA1, \ + TRACEDATA0, \ + TRACECLK, \ + ADC_PAYLOAD_DETECTOR, \ + GPIO_I2C_MUX_ADDR1, \ + GPIO_I2C_MUX_ADDR2, \ + GPIO_I2C_SW_RESETn, \ + GPIO_RTS, \ + GPIO_PG_RESETn, \ + GPIO_PGOOD_P1V0, \ + GPIO_AMC_RTM_CRITICAL, \ + GPIO_AMC_RTM_TC, \ + GPIO_AMC_RTM_WARNING, \ + GPIO_AMC_RTM_PV, \ + GPIO_FMC1_PG_M2C, \ + GPIO_FMC2_PG_M2C, \ + GPIO_FMC1_PG_C2M, \ + GPIO_FMC2_PG_C2M, \ + GPIO_FMC1_CRITICAL, \ + GPIO_FMC1_TC, \ + GPIO_FMC1_WARNING, \ + GPIO_FMC1_PV, \ + GPIO_FMC2_CRITICAL, \ + GPIO_FMC2_TC, \ + GPIO_FMC2_WARNING, \ + GPIO_FMC2_PV, \ + GPIO_GA0, \ + GPIO_GA1, \ + GPIO_GA2, \ + GPIO_GA_TEST, \ + GPIO_LEDBLUE, \ + GPIO_LEDGREEN, \ + GPIO_LEDRED, \ + GPIO_FRONT_BUTTON, \ + GPIO_HOT_SWAP_HANDLE, \ + GPIO_FPGA_DONE_B, \ + GPIO_FPGA_INITB, \ + GPIO_FPGA_RESET, \ + GPIO_DAC_VADJ_RST, \ + GPIO_MMC_ENABLE, \ + GPIO_OVERTEMPn, \ + GPIO_FMC1_JTAG_Override, \ + GPIO_FMC2_JTAG_Override, \ + GPIO_RTM_JTAG_Override, \ + GPIO_EEPROM_WP, \ + GPIO_CLK_DIR_FMC2, \ + GPIO_CLK_DIR_FMC1, \ + GPIO_FMC1_PRSNT_M2C, \ + GPIO_FMC2_PRSNT_M2C, \ + GPIO_RTM_PS +#endif + +/** + * @} + */ diff --git a/port/board/afc-bpm/v3_0/sdr_list.c b/port/board/afc-v4/sdr_list.c similarity index 65% rename from port/board/afc-bpm/v3_0/sdr_list.c rename to port/board/afc-v4/sdr_list.c index e1138afd8..6c5b69abc 100644 --- a/port/board/afc-bpm/v3_0/sdr_list.c +++ b/port/board/afc-v4/sdr_list.c @@ -2,6 +2,7 @@ * openMMC -- Open Source modular IPM Controller firmware * * Copyright (C) 2015-2016 Henrique Silva + * Copyright (C) 2021 Krzysztof Macias * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +20,10 @@ * @license GPL-3.0+ */ +/* Table 42 ipmi-second-gen */ + /* Project Includes */ +#include "port.h" #include "sdr.h" #include "utils.h" #include "i2c_mapping.h" @@ -29,8 +33,10 @@ #include "fpga_spi.h" /* SDR List */ -#ifdef MODULE_INA220_VOLTAGE -#include "ina220.h" +#ifdef MODULE_INA3221_VOLTAGE +#include "ina3221.h" +#define SDR_AMC_12V_ID "AMC +12V" +#define SDR_RTM_12V_ID "RTM +12V" #define SDR_FMC1_12V_ID "FMC1 +12V" #define SDR_FMC1_VADJ_ID "FMC1 VADJ" #define SDR_FMC1_P3V3_ID "FMC1 +3.3V" @@ -38,8 +44,10 @@ #define SDR_FMC2_VADJ_ID "FMC2 VADJ" #define SDR_FMC2_P3V3_ID "FMC2 +3.3V" #endif -#ifdef MODULE_INA220_CURRENT -#include "ina220.h" +#ifdef MODULE_INA3221_CURRENT +#include "ina3221.h" +#define SDR_AMC_12V_CURR_ID "AMC +12V Curr" +#define SDR_RTM_12V_CURR_ID "RTM +12V Curr" #define SDR_FMC1_VADJ_CURR_ID "FMC1 +12V Curr" #define SDR_FMC1_12V_CURR_ID "FMC1 VADJ Curr" #define SDR_FMC1_P3V3_CURR_ID "FMC1 +3.3V Curr" @@ -87,10 +95,120 @@ const SDR_type_02h_t SDR_HOTSWAP_AMC = { .IDtypelen = 0xc0 | STR_SIZE("HOTSWAP AMC"), /* 8 bit ASCII, number of bytes */ .IDstring = "HOTSWAP AMC" /* sensor string */ }; - #endif -#ifdef MODULE_INA220_VOLTAGE +#ifdef MODULE_INA3221_VOLTAGE + +/* AMC 12V */ +const SDR_type_01h_t SDR_AMC_12V = { + + .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ + .hdr.recID_MSB = 0x00, + .hdr.SDRversion = 0x51, + .hdr.rectype = TYPE_01, + .hdr.reclength = sizeof(SDR_type_01h_t) - sizeof(SDR_entry_hdr_t), + + .ownerID = 0x00, /* i2c address, -> SDR_Init */ + .ownerLUN = 0x00, /* sensor owner LUN */ + .sensornum = 0x00, /* Filled by sdr_insert_entry() */ + + /* record body bytes */ + .entityID = 0xC1, /* entity id: AMC Module */ + .entityinstance = 0x00, /* entity instance -> SDR_Init */ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ + .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: Voltage*/ + .event_reading_type = 0x01, /* sensor reading*/ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ + .sensor_units_1 = 0x00, /* sensor units 1 :*/ + .sensor_units_2 = 0x04, /* sensor units 2 :*/ + .sensor_units_3 = 0x00, /* sensor units 3 :*/ + .linearization = 0x00, /* Linearization */ + .M = 64, /* M */ + .M_tol = 0x00, /* M - Tolerance */ + .B = 0x00, /* B */ + .B_accuracy = 0x00, /* B - Accuracy */ + .acc_exp_sensor_dir = 0x02, /* Sensor direction */ + .Rexp_Bexp = 0xD0, /* R-Exp = -3 , B-Exp = 0 */ + .analog_flags = 0x03, /* Analogue characteristics flags */ + .nominal_reading = (12000 >> 6), /* Nominal reading [(M * x + B * 10^(B_exp)) * 10^(R_exp)] = 12.032 V */ + .normal_max = (13000 >> 6), /* Normal maximum = 12.544 V */ + .normal_min = (11000 >> 6), /* Normal minimum = 11.456 V */ + .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ + .sensor_min_reading = 0x00, /* Sensor Minimum reading */ + .upper_nonrecover_thr = (16000 >> 6), /* Upper non-recoverable Threshold = 13.056 V */ + .upper_critical_thr = (15000 >> 6), /* Upper critical Threshold = 12.608 V */ + .upper_noncritical_thr = (14000 >> 6), /* Upper non critical Threshold = 12.48 V */ + .lower_nonrecover_thr = (8000 >> 6), /* Lower non-recoverable Threshold = 11.008 V */ + .lower_critical_thr = (9000 >> 6), /* Lower critical Threshold = 11.392 V */ + .lower_noncritical_thr = (10000 >> 6), /* Lower non-critical Threshold = 11.52 V */ + .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ + .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ + .reserved1 = 0x00, /* reserved */ + .reserved2 = 0x00, /* reserved */ + .OEM = INA3221_CHANNEL_1, /* OEM reserved */ + .IDtypelen = 0xc0 | STR_SIZE(SDR_FMC1_12V_ID) , /* 8 bit ASCII, number of bytes */ + .IDstring = SDR_AMC_12V_ID /* sensor string */ +}; + +/* RTM 12V */ +const SDR_type_01h_t SDR_RTM_12V = { + + .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ + .hdr.recID_MSB = 0x00, + .hdr.SDRversion = 0x51, + .hdr.rectype = TYPE_01, + .hdr.reclength = sizeof(SDR_type_01h_t) - sizeof(SDR_entry_hdr_t), + + .ownerID = 0x00, /* i2c address, -> SDR_Init */ + .ownerLUN = 0x00, /* sensor owner LUN */ + .sensornum = 0x00, /* Filled by sdr_insert_entry() */ + + /* record body bytes */ + .entityID = 0xC1, /* entity id: AMC Module */ + .entityinstance = 0x00, /* entity instance -> SDR_Init */ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ + .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: Voltage*/ + .event_reading_type = 0x01, /* sensor reading*/ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ + .sensor_units_1 = 0x00, /* sensor units 1 :*/ + .sensor_units_2 = 0x04, /* sensor units 2 :*/ + .sensor_units_3 = 0x00, /* sensor units 3 :*/ + .linearization = 0x00, /* Linearization */ + .M = 64, /* M */ + .M_tol = 0x00, /* M - Tolerance */ + .B = 0x00, /* B */ + .B_accuracy = 0x00, /* B - Accuracy */ + .acc_exp_sensor_dir = 0x02, /* Sensor direction */ + .Rexp_Bexp = 0xD0, /* R-Exp = -3 , B-Exp = 0 */ + .analog_flags = 0x03, /* Analogue characteristics flags */ + .nominal_reading = (12000 >> 6), /* Nominal reading [(M * x + B * 10^(B_exp)) * 10^(R_exp)] = 12.032 V */ + .normal_max = (13000 >> 6), /* Normal maximum = 12.544 V */ + .normal_min = (11000 >> 6), /* Normal minimum = 11.456 V */ + .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ + .sensor_min_reading = 0x00, /* Sensor Minimum reading */ + .upper_nonrecover_thr = (16000 >> 6), /* Upper non-recoverable Threshold = 13.056 V */ + .upper_critical_thr = (15000 >> 6), /* Upper critical Threshold = 12.608 V */ + .upper_noncritical_thr = (14000 >> 6), /* Upper non critical Threshold = 12.48 V */ + .lower_nonrecover_thr = 0, /* Lower non-recoverable Threshold = 11.008 V */ + .lower_critical_thr = 0, /* Lower critical Threshold = 11.392 V */ + .lower_noncritical_thr = 0, /* Lower non-critical Threshold = 11.52 V */ + .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ + .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ + .reserved1 = 0x00, /* reserved */ + .reserved2 = 0x00, /* reserved */ + .OEM = INA3221_CHANNEL_2, /* OEM reserved */ + .IDtypelen = 0xc0 | STR_SIZE(SDR_RTM_12V_ID) , /* 8 bit ASCII, number of bytes */ + .IDstring = SDR_RTM_12V_ID /* sensor string */ +}; + /* FMC1 12V */ const SDR_type_01h_t SDR_FMC1_12V = { @@ -126,22 +244,22 @@ const SDR_type_01h_t SDR_FMC1_12V = { .acc_exp_sensor_dir = 0x02, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp = -3 , B-Exp = 0 */ .analog_flags = 0x03, /* Analogue characteristics flags */ - .nominal_reading = 190, /* Nominal reading = 12.285V */ - .normal_max = 200, /* Normal maximum */ - .normal_min = 0, /* Normal minimum */ + .nominal_reading = (12000 >> 6), /* Nominal reading [(M * x + B * 10^(B_exp)) * 10^(R_exp)] = 12.032 V */ + .normal_max = (13000 >> 6), /* Normal maximum = 12.544 V */ + .normal_min = (11000 >> 6), /* Normal minimum = 11.456 V */ .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 205, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 200, /* Upper critical Threshold */ - .upper_noncritical_thr = 195, /* Upper non critical Threshold */ - .lower_nonrecover_thr = 170, /* Lower non-recoverable Threshold */ - .lower_critical_thr = 175, /* Lower critical Threshold */ - .lower_noncritical_thr = 180, /* Lower non-critical Threshold */ + .upper_nonrecover_thr = (16000 >> 6), /* Upper non-recoverable Threshold = 13.056 V */ + .upper_critical_thr = (15000 >> 6), /* Upper critical Threshold = 12.608 V */ + .upper_noncritical_thr = (14000 >> 6), /* Upper non critical Threshold = 12.48 V */ + .lower_nonrecover_thr = (8000 >> 6), /* Lower non-recoverable Threshold = 11.008 V */ + .lower_critical_thr = (9000 >> 6), /* Lower critical Threshold = 11.392 V */ + .lower_noncritical_thr = (10000 >> 6), /* Lower non-critical Threshold = 11.52 V */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ .reserved2 = 0x00, /* reserved */ - .OEM = 0x00, /* OEM reserved */ + .OEM = INA3221_CHANNEL_2, /* OEM reserved */ .IDtypelen = 0xc0 | STR_SIZE(SDR_FMC1_12V_ID) , /* 8 bit ASCII, number of bytes */ .IDstring = SDR_FMC1_12V_ID /* sensor string */ }; @@ -180,22 +298,22 @@ const SDR_type_01h_t SDR_FMC1_VADJ = { .acc_exp_sensor_dir = 0x00, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp , B-Exp */ .analog_flags = 0x00, /* Analogue characteristics flags */ - .nominal_reading = 39, /* Nominal reading */ - .normal_max = 47, /* Normal maximum */ - .normal_min = 0, /* Normal minimum */ - .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ - .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 51, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 46, /* Upper critical Threshold */ - .upper_noncritical_thr = 43, /* Upper non critical Threshold */ - .lower_nonrecover_thr = 28, /* Lower non-recoverable Threshold */ - .lower_critical_thr = 32, /* Lower critical Threshold */ - .lower_noncritical_thr = 36, /* Lower non-critical Threshold */ +// .nominal_reading = 39, /* Nominal reading */ +// .normal_max = 47, /* Normal maximum */ +// .normal_min = 0, /* Normal minimum */ +// .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ +// .sensor_min_reading = 0x00, /* Sensor Minimum reading */ +// .upper_nonrecover_thr = 51, /* Upper non-recoverable Threshold */ +// .upper_critical_thr = 46, /* Upper critical Threshold */ +// .upper_noncritical_thr = 43, /* Upper non critical Threshold */ +// .lower_nonrecover_thr = 28, /* Lower non-recoverable Threshold */ +// .lower_critical_thr = 32, /* Lower critical Threshold */ +// .lower_noncritical_thr = 36, /* Lower non-critical Threshold */ .pos_thr_hysteresis = 1, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 1, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ .reserved2 = 0x00, /* reserved */ - .OEM = 0x00, /* OEM reserved */ + .OEM = INA3221_CHANNEL_3, /* OEM reserved */ .IDtypelen = 0xc0 | STR_SIZE(SDR_FMC1_VADJ_ID), /* 8 bit ASCII, number of bytes */ .IDstring = SDR_FMC1_VADJ_ID /* sensor string */ }; @@ -233,22 +351,22 @@ const SDR_type_01h_t SDR_FMC1_P3V3 = { .acc_exp_sensor_dir = 0x00, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp , B-Exp */ .analog_flags = 0x00, /* Analogue characteristics flags */ - .nominal_reading = 52, /* Nominal reading */ - .normal_max = 59, /* Normal maximum */ - .normal_min = 45, /* Normal minimum */ - .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ - .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 62, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 59, /* Upper critical Threshold */ - .upper_noncritical_thr = 55, /* Upper non critical Threshold */ - .lower_nonrecover_thr = 42, /* Lower non-recoverable Threshold */ - .lower_critical_thr = 45, /* Lower critical Threshold */ - .lower_noncritical_thr = 48, /* Lower non-critical Threshold */ +// .nominal_reading = 52, /* Nominal reading */ +// .normal_max = 59, /* Normal maximum */ +// .normal_min = 45, /* Normal minimum */ +// .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ +// .sensor_min_reading = 0x00, /* Sensor Minimum reading */ +// .upper_nonrecover_thr = 62, /* Upper non-recoverable Threshold */ +// .upper_critical_thr = 59, /* Upper critical Threshold */ +// .upper_noncritical_thr = 55, /* Upper non critical Threshold */ +// .lower_nonrecover_thr = 42, /* Lower non-recoverable Threshold */ +// .lower_critical_thr = 45, /* Lower critical Threshold */ +// .lower_noncritical_thr = 48, /* Lower non-critical Threshold */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ .reserved2 = 0x00, /* reserved */ - .OEM = 0x00, /* OEM reserved */ + .OEM = INA3221_CHANNEL_1, /* OEM reserved */ .IDtypelen = 0xc0 | STR_SIZE(SDR_FMC1_P3V3_ID), /* 8 bit ASCII, number of bytes */ .IDstring = SDR_FMC1_P3V3_ID /* sensor string */ }; @@ -287,22 +405,22 @@ const SDR_type_01h_t SDR_FMC2_12V = { .acc_exp_sensor_dir = 0x02, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp = -3 , B-Exp = 0 */ .analog_flags = 0x03, /* Analogue characteristics flags */ - .nominal_reading = 190, /* Nominal reading = 12.285V */ - .normal_max = 200, /* Normal maximum */ - .normal_min = 0, /* Normal minimum */ + .nominal_reading = (12000 >> 6), /* Nominal reading [(M * x + B * 10^(B_exp)) * 10^(R_exp)] = 12.032 V */ + .normal_max = (13000 >> 6), /* Normal maximum = 12.544 V */ + .normal_min = (11000 >> 6), /* Normal minimum = 11.456 V */ .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 205, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 200, /* Upper critical Threshold */ - .upper_noncritical_thr = 195, /* Upper non critical Threshold */ - .lower_nonrecover_thr = 170, /* Lower non-recoverable Threshold */ - .lower_critical_thr = 175, /* Lower critical Threshold */ - .lower_noncritical_thr = 180, /* Lower non-critical Threshold */ + .upper_nonrecover_thr = (16000 >> 6), /* Upper non-recoverable Threshold = 13.056 V */ + .upper_critical_thr = (15000 >> 6), /* Upper critical Threshold = 12.608 V */ + .upper_noncritical_thr = (14000 >> 6), /* Upper non critical Threshold = 12.48 V */ + .lower_nonrecover_thr = (8000 >> 6), /* Lower non-recoverable Threshold = 11.008 V */ + .lower_critical_thr = (9000 >> 6), /* Lower critical Threshold = 11.392 V */ + .lower_noncritical_thr = (10000 >> 6), /* Lower non-critical Threshold = 11.52 V */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ .reserved2 = 0x00, /* reserved */ - .OEM = 0x00, /* OEM reserved */ + .OEM = INA3221_CHANNEL_2, /* OEM reserved */ .IDtypelen = 0xc0 | STR_SIZE(SDR_FMC2_12V_ID), /* 8 bit ASCII, number of bytes */ .IDstring = SDR_FMC2_12V_ID /* sensor string */ }; @@ -341,22 +459,22 @@ const SDR_type_01h_t SDR_FMC2_VADJ = { .acc_exp_sensor_dir = 0x00, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp , B-Exp */ .analog_flags = 0x00, /* Analogue characteristics flags */ - .nominal_reading = 39, /* Nominal reading */ - .normal_max = 47, /* Normal maximum */ - .normal_min = 0, /* Normal minimum */ - .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ - .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 51, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 46, /* Upper critical Threshold */ - .upper_noncritical_thr = 43, /* Upper non critical Threshold */ - .lower_nonrecover_thr = 28, /* Lower non-recoverable Threshold */ - .lower_critical_thr = 32, /* Lower critical Threshold */ - .lower_noncritical_thr = 36, /* Lower non-critical Threshold */ +// .nominal_reading = 39, /* Nominal reading */ +// .normal_max = 47, /* Normal maximum */ +// .normal_min = 0, /* Normal minimum */ +// .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ +// .sensor_min_reading = 0x00, /* Sensor Minimum reading */ +// .upper_nonrecover_thr = 51, /* Upper non-recoverable Threshold */ +// .upper_critical_thr = 46, /* Upper critical Threshold */ +// .upper_noncritical_thr = 43, /* Upper non critical Threshold */ +// .lower_nonrecover_thr = 28, /* Lower non-recoverable Threshold */ +// .lower_critical_thr = 32, /* Lower critical Threshold */ +// .lower_noncritical_thr = 36, /* Lower non-critical Threshold */ .pos_thr_hysteresis = 1, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 1, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ .reserved2 = 0x00, /* reserved */ - .OEM = 0x00, /* OEM reserved */ + .OEM = INA3221_CHANNEL_3, /* OEM reserved */ .IDtypelen = 0xc0 | STR_SIZE(SDR_FMC2_VADJ_ID), /* 8 bit ASCII, number of bytes */ .IDstring = SDR_FMC2_VADJ_ID /* sensor string */ }; @@ -396,30 +514,31 @@ const SDR_type_01h_t SDR_FMC2_P3V3 = { .acc_exp_sensor_dir = 0x00, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp , B-Exp */ .analog_flags = 0x00, /* Analogue characteristics flags */ - .nominal_reading = 52, /* Nominal reading */ - .normal_max = 59, /* Normal maximum */ - .normal_min = 45, /* Normal minimum */ - .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ - .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 62, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 59, /* Upper critical Threshold */ - .upper_noncritical_thr = 55, /* Upper non critical Threshold */ - .lower_nonrecover_thr = 42, /* Lower non-recoverable Threshold */ - .lower_critical_thr = 45, /* Lower critical Threshold */ - .lower_noncritical_thr = 48, /* Lower non-critical Threshold */ +// .nominal_reading = 52, /* Nominal reading */ +// .normal_max = 59, /* Normal maximum */ +// .normal_min = 45, /* Normal minimum */ +// .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ +// .sensor_min_reading = 0x00, /* Sensor Minimum reading */ +// .upper_nonrecover_thr = 62, /* Upper non-recoverable Threshold */ +// .upper_critical_thr = 59, /* Upper critical Threshold */ +// .upper_noncritical_thr = 55, /* Upper non critical Threshold */ +// .lower_nonrecover_thr = 42, /* Lower non-recoverable Threshold */ +// .lower_critical_thr = 45, /* Lower critical Threshold */ +// .lower_noncritical_thr = 48, /* Lower non-critical Threshold */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ .reserved2 = 0x00, /* reserved */ - .OEM = 0x00, /* OEM reserved */ + .OEM = INA3221_CHANNEL_1, /* OEM reserved */ .IDtypelen = 0xc0 | STR_SIZE(SDR_FMC2_P3V3_ID), /* 8 bit ASCII, number of bytes */ .IDstring = SDR_FMC2_P3V3_ID /* sensor string */ }; #endif -#ifdef MODULE_INA220_CURRENT -/* FMC1 12V Current */ -const SDR_type_01h_t SDR_FMC1_12V_CURR = { +#ifdef MODULE_INA3221_CURRENT + +/* AMC 12V Current */ +const SDR_type_01h_t SDR_AMC_12V_CURR = { .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, @@ -438,8 +557,8 @@ const SDR_type_01h_t SDR_FMC1_12V_CURR = { .sensorcap = 0x56, /* capabilities: auto re-arm */ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: Current */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ - .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .assertion_event_mask = 0x0A80, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A80, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ @@ -453,22 +572,132 @@ const SDR_type_01h_t SDR_FMC1_12V_CURR = { .acc_exp_sensor_dir = 0x02, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp = -3 , B-Exp = 0 */ .analog_flags = 0x03, /* Analogue characteristics flags */ - .nominal_reading = 32, /* Nominal reading = 1A */ - .normal_max = 125, /* Normal maximum */ + .nominal_reading = 62, /* Nominal reading [mA] */ + .normal_max = 100, /* Normal maximum */ .normal_min = 0, /* Normal minimum */ .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ - .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ - .upper_noncritical_thr = 95, /* Upper non critical Threshold - 3A */ - .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold - -0.1A */ - .lower_critical_thr = 10, /* Lower critical Threshold - 0.32A */ - .lower_noncritical_thr = 15, /* Lower non-critical Threshold - 0.5A */ + .upper_nonrecover_thr = 127, /* Upper non-recoverable Threshold - 4A */ + .upper_critical_thr = 127, /* Upper critical Threshold - 3.5A */ + .upper_noncritical_thr = 127, /* Upper non critical Threshold - 3A */ + .lower_nonrecover_thr = -15, /* Lower non-recoverable Threshold - -0.1A */ + .lower_critical_thr = -10, /* Lower critical Threshold - 0.32A */ + .lower_noncritical_thr = -5, /* Lower non-critical Threshold - 0.5A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ .reserved2 = 0x00, /* reserved */ - .OEM = 0x00, /* OEM reserved */ + .OEM = INA3221_CHANNEL_1, /* OEM reserved */ + .IDtypelen = 0xc0 | STR_SIZE(SDR_FMC1_12V_CURR_ID) , /* 8 bit ASCII, number of bytes */ + .IDstring = SDR_AMC_12V_CURR_ID /* sensor string */ +}; + +/* RTM 12V Current */ +const SDR_type_01h_t SDR_RTM_12V_CURR = { + + .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ + .hdr.recID_MSB = 0x00, + .hdr.SDRversion = 0x51, + .hdr.rectype = TYPE_01, + .hdr.reclength = sizeof(SDR_type_01h_t) - sizeof(SDR_entry_hdr_t), + + .ownerID = 0x00, /* i2c address, -> SDR_Init */ + .ownerLUN = 0x00, /* sensor owner LUN */ + .sensornum = 0x00, /* Filled by sdr_insert_entry() */ + + /* record body bytes */ + .entityID = 0xC1, /* entity id: AMC Module */ + .entityinstance = 0x00, /* entity instance -> SDR_Init */ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm */ + .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: Current */ + .event_reading_type = 0x01, /* sensor reading*/ + .assertion_event_mask = 0x0A80, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A80, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ + .sensor_units_1 = 0x80, /* sensor units 1 :*/ + .sensor_units_2 = 0x05, /* sensor units 2 :*/ + .sensor_units_3 = 0x00, /* sensor units 3 :*/ + .linearization = 0x00, /* Linearization */ + .M = 32, /* M */ + .M_tol = 0x00, /* M - Tolerance */ + .B = 0x00, /* B */ + .B_accuracy = 0x00, /* B - Accuracy */ + .acc_exp_sensor_dir = 0x02, /* Sensor direction */ + .Rexp_Bexp = 0xD0, /* R-Exp = -3 , B-Exp = 0 */ + .analog_flags = 0x03, /* Analogue characteristics flags */ +// .nominal_reading = 32, /* Nominal reading = 1A */ +// .normal_max = 125, /* Normal maximum */ +// .normal_min = 0, /* Normal minimum */ +// .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ +// .sensor_min_reading = 0x00, /* Sensor Minimum reading */ +// .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ +// .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ +// .upper_noncritical_thr = 95, /* Upper non critical Threshold - 3A */ +// .lower_nonrecover_thr = -15, /* Lower non-recoverable Threshold - -0.1A */ +// .lower_critical_thr = -10, /* Lower critical Threshold - 0.32A */ +// .lower_noncritical_thr = -5, /* Lower non-critical Threshold - 0.5A */ + .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ + .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ + .reserved1 = 0x00, /* reserved */ + .reserved2 = 0x00, /* reserved */ + .OEM = INA3221_CHANNEL_2, /* OEM reserved */ + .IDtypelen = 0xc0 | STR_SIZE(SDR_FMC1_12V_CURR_ID) , /* 8 bit ASCII, number of bytes */ + .IDstring = SDR_RTM_12V_CURR_ID /* sensor string */ +}; + +/* FMC1 12V Current */ +const SDR_type_01h_t SDR_FMC1_12V_CURR = { + + .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ + .hdr.recID_MSB = 0x00, + .hdr.SDRversion = 0x51, + .hdr.rectype = TYPE_01, + .hdr.reclength = sizeof(SDR_type_01h_t) - sizeof(SDR_entry_hdr_t), + + .ownerID = 0x00, /* i2c address, -> SDR_Init */ + .ownerLUN = 0x00, /* sensor owner LUN */ + .sensornum = 0x00, /* Filled by sdr_insert_entry() */ + + /* record body bytes */ + .entityID = 0xC1, /* entity id: AMC Module */ + .entityinstance = 0x00, /* entity instance -> SDR_Init */ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm */ + .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: Current */ + .event_reading_type = 0x01, /* sensor reading*/ + .assertion_event_mask = 0x0A80, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A80, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ + .sensor_units_1 = 0x80, /* sensor units 1 :*/ + .sensor_units_2 = 0x05, /* sensor units 2 :*/ + .sensor_units_3 = 0x00, /* sensor units 3 :*/ + .linearization = 0x00, /* Linearization */ + .M = 32, /* M */ + .M_tol = 0x00, /* M - Tolerance */ + .B = 0x00, /* B */ + .B_accuracy = 0x00, /* B - Accuracy */ + .acc_exp_sensor_dir = 0x02, /* Sensor direction */ + .Rexp_Bexp = 0xD0, /* R-Exp = -3 , B-Exp = 0 */ + .analog_flags = 0x03, /* Analogue characteristics flags */ +// .nominal_reading = 32, /* Nominal reading = 1A */ +// .normal_max = 125, /* Normal maximum */ +// .normal_min = 0, /* Normal minimum */ +// .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ +// .sensor_min_reading = 0x00, /* Sensor Minimum reading */ +// .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ +// .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ +// .upper_noncritical_thr = 95, /* Upper non critical Threshold - 3A */ +// .lower_nonrecover_thr = -15, /* Lower non-recoverable Threshold - -0.1A */ +// .lower_critical_thr = -10, /* Lower critical Threshold - 0.32A */ +// .lower_noncritical_thr = -5, /* Lower non-critical Threshold - 0.5A */ + .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ + .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ + .reserved1 = 0x00, /* reserved */ + .reserved2 = 0x00, /* reserved */ + .OEM = INA3221_CHANNEL_2, /* OEM reserved */ .IDtypelen = 0xc0 | STR_SIZE(SDR_FMC1_12V_CURR_ID) , /* 8 bit ASCII, number of bytes */ .IDstring = SDR_FMC1_12V_CURR_ID /* sensor string */ }; @@ -492,8 +721,8 @@ const SDR_type_01h_t SDR_FMC1_VADJ_CURR = { .sensorcap = 0x56, /* capabilities: auto re-arm */ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: CURRENT */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ - .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .assertion_event_mask = 0x0A80, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A80, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ @@ -507,22 +736,22 @@ const SDR_type_01h_t SDR_FMC1_VADJ_CURR = { .acc_exp_sensor_dir = 0x00, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp , B-Exp */ .analog_flags = 0x00, /* Analogue characteristics flags */ - .nominal_reading = 39, /* Nominal reading - 1.24A */ - .normal_max = 47, /* Normal maximum - 1.5A*/ - .normal_min = 0, /* Normal minimum - 0A */ - .sensor_max_reading = 0x7F, /* Sensor Maximum reading */ - .sensor_min_reading = 0x80, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ - .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ - .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ - .lower_nonrecover_thr = -10, /* Lower non-recoverable Threshold - -0.32A */ - .lower_critical_thr = 0, /* Lower critical Threshold - 0A */ - .lower_noncritical_thr = 5, /* Lower non-critical Threshold - 0.16A */ +// .nominal_reading = 39, /* Nominal reading - 1.24A */ +// .normal_max = 47, /* Normal maximum - 1.5A*/ +// .normal_min = 0, /* Normal minimum - 0A */ +// .sensor_max_reading = 0x7F, /* Sensor Maximum reading */ +// .sensor_min_reading = 0x80, /* Sensor Minimum reading */ +// .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ +// .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ +// .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ +// .lower_nonrecover_thr = -15, /* Lower non-recoverable Threshold - -0.32A */ +// .lower_critical_thr = -10, /* Lower critical Threshold - 0A */ +// .lower_noncritical_thr = -5, /* Lower non-critical Threshold - 0.16A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ .reserved2 = 0x00, /* reserved */ - .OEM = 0x00, /* OEM reserved */ + .OEM = INA3221_CHANNEL_3, /* OEM reserved */ .IDtypelen = 0xc0 | STR_SIZE(SDR_FMC1_VADJ_CURR_ID), /* 8 bit ASCII, number of bytes */ .IDstring = SDR_FMC1_VADJ_CURR_ID /* sensor string */ }; @@ -546,8 +775,8 @@ const SDR_type_01h_t SDR_FMC1_P3V3_CURR = { .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: CURRENT */ .event_reading_type = 0x01, /* sensor reading */ - .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ - .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .assertion_event_mask = 0x0A80, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A80, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ @@ -560,22 +789,22 @@ const SDR_type_01h_t SDR_FMC1_P3V3_CURR = { .acc_exp_sensor_dir = 0x00, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp , B-Exp */ .analog_flags = 0x00, /* Analogue characteristics flags */ - .nominal_reading = 85, /* Nominal reading */ - .normal_max = 94, /* Normal maximum - 3A */ - .normal_min = 32, /* Normal minimum - 1A */ - .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ - .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ - .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ - .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ - .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold - -0.1A */ - .lower_critical_thr = 10, /* Lower critical Threshold - 0.32A */ - .lower_noncritical_thr = 32, /* Lower non-critical Threshold - 1A */ +// .nominal_reading = 85, /* Nominal reading */ +// .normal_max = 94, /* Normal maximum - 3A */ +// .normal_min = 32, /* Normal minimum - 1A */ +// .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ +// .sensor_min_reading = 0x00, /* Sensor Minimum reading */ +// .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ +// .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ +// .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ +// .lower_nonrecover_thr = -15, /* Lower non-recoverable Threshold - -0.1A */ +// .lower_critical_thr = -10, /* Lower critical Threshold - 0.32A */ +// .lower_noncritical_thr = -5, /* Lower non-critical Threshold - 1A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ .reserved2 = 0x00, /* reserved */ - .OEM = 0x00, /* OEM reserved */ + .OEM = INA3221_CHANNEL_1, /* OEM reserved */ .IDtypelen = 0xc0 | STR_SIZE(SDR_FMC1_P3V3_CURR_ID), /* 8 bit ASCII, number of bytes */ .IDstring = SDR_FMC1_P3V3_CURR_ID /* sensor string */ }; @@ -599,8 +828,8 @@ const SDR_type_01h_t SDR_FMC2_12V_CURR = { .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: Current */ .event_reading_type = 0x01, /* sensor reading */ - .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ - .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .assertion_event_mask = 0x0A80, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A80, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ @@ -614,22 +843,22 @@ const SDR_type_01h_t SDR_FMC2_12V_CURR = { .acc_exp_sensor_dir = 0x02, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp = -3 , B-Exp = 0 */ .analog_flags = 0x03, /* Analogue characteristics flags */ - .nominal_reading = 32, /* Nominal reading = 1A */ - .normal_max = 125, /* Normal maximum */ - .normal_min = 0, /* Normal minimum */ - .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ - .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ - .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ - .upper_noncritical_thr = 95, /* Upper non critical Threshold - 3A */ - .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold - -0.1A */ - .lower_critical_thr = 10, /* Lower critical Threshold - 0.32A */ - .lower_noncritical_thr = 15, /* Lower non-critical Threshold - 0.5A */ +// .nominal_reading = 32, /* Nominal reading = 1A */ +// .normal_max = 125, /* Normal maximum */ +// .normal_min = 0, /* Normal minimum */ +// .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ +// .sensor_min_reading = 0x00, /* Sensor Minimum reading */ +// .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ +// .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ +// .upper_noncritical_thr = 95, /* Upper non critical Threshold - 3A */ +// .lower_nonrecover_thr = -15, /* Lower non-recoverable Threshold - -0.1A */ +// .lower_critical_thr = -10, /* Lower critical Threshold - 0.32A */ +// .lower_noncritical_thr = -5, /* Lower non-critical Threshold - 0.5A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ .reserved2 = 0x00, /* reserved */ - .OEM = 0x00, /* OEM reserved */ + .OEM = INA3221_CHANNEL_2, /* OEM reserved */ .IDtypelen = 0xc0 | STR_SIZE(SDR_FMC2_12V_CURR_ID) , /* 8 bit ASCII, number of bytes */ .IDstring = SDR_FMC2_12V_CURR_ID /* sensor string */ }; @@ -653,8 +882,8 @@ const SDR_type_01h_t SDR_FMC2_VADJ_CURR = { .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: voltage*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ - .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .assertion_event_mask = 0x0A80, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A80, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ @@ -668,22 +897,22 @@ const SDR_type_01h_t SDR_FMC2_VADJ_CURR = { .acc_exp_sensor_dir = 0x00, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp , B-Exp */ .analog_flags = 0x00, /* Analogue characteristics flags */ - .nominal_reading = 39, /* Nominal reading - 1.24A */ - .normal_max = 47, /* Normal maximum - 1.5A*/ - .normal_min = 0, /* Normal minimum - 0A */ - .sensor_max_reading = 0x7F, /* Sensor Maximum reading */ - .sensor_min_reading = 0x80, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ - .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ - .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ - .lower_nonrecover_thr = -10, /* Lower non-recoverable Threshold - -0.32A */ - .lower_critical_thr = 0, /* Lower critical Threshold - 0A */ - .lower_noncritical_thr = 5, /* Lower non-critical Threshold - 0.16A */ +// .nominal_reading = 39, /* Nominal reading - 1.24A */ +// .normal_max = 47, /* Normal maximum - 1.5A*/ +// .normal_min = 0, /* Normal minimum - 0A */ +// .sensor_max_reading = 0x7F, /* Sensor Maximum reading */ +// .sensor_min_reading = 0x80, /* Sensor Minimum reading */ +// .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ +// .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ +// .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ +// .lower_nonrecover_thr = -15, /* Lower non-recoverable Threshold - -0.32A */ +// .lower_critical_thr = -10, /* Lower critical Threshold - 0A */ +// .lower_noncritical_thr = -5, /* Lower non-critical Threshold - 0.16A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ .reserved2 = 0x00, /* reserved */ - .OEM = 0x00, /* OEM reserved */ + .OEM = INA3221_CHANNEL_3, /* OEM reserved */ .IDtypelen = 0xc0 | STR_SIZE(SDR_FMC2_VADJ_CURR_ID), /* 8 bit ASCII, number of bytes */ .IDstring = SDR_FMC2_VADJ_CURR_ID /* sensor string */ }; @@ -707,8 +936,8 @@ const SDR_type_01h_t SDR_FMC2_P3V3_CURR = { .sensorcap = 0x56, /* capabilities: auto re-arm */ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: CURRENT */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ - .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .assertion_event_mask = 0x0A80, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A80, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ @@ -721,22 +950,22 @@ const SDR_type_01h_t SDR_FMC2_P3V3_CURR = { .acc_exp_sensor_dir = 0x00, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp , B-Exp */ .analog_flags = 0x00, /* Analogue characteristics flags */ - .nominal_reading = 85, /* Nominal reading */ - .normal_max = 94, /* Normal maximum - 3A */ - .normal_min = 32, /* Normal minimum - 1A */ - .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ - .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ - .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ - .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ - .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold - -0.1A */ - .lower_critical_thr = 10, /* Lower critical Threshold - 0.32A */ - .lower_noncritical_thr = 32, /* Lower non-critical Threshold - 1A */ +// .nominal_reading = 85, /* Nominal reading */ +// .normal_max = 94, /* Normal maximum - 3A */ +// .normal_min = 32, /* Normal minimum - 1A */ +// .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ +// .sensor_min_reading = 0x00, /* Sensor Minimum reading */ +// .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ +// .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ +// .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ +// .lower_nonrecover_thr = -15, /* Lower non-recoverable Threshold - -0.1A */ +// .lower_critical_thr = -10, /* Lower critical Threshold - 0.32A */ +// .lower_noncritical_thr = -5, /* Lower non-critical Threshold - 1A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ .reserved2 = 0x00, /* reserved */ - .OEM = 0x00, /* OEM reserved */ + .OEM = INA3221_CHANNEL_1, /* OEM reserved */ .IDtypelen = 0xc0 | STR_SIZE(SDR_FMC2_P3V3_CURR_ID), /* 8 bit ASCII, number of bytes */ .IDstring = SDR_FMC2_P3V3_CURR_ID /* sensor string */ }; @@ -1012,35 +1241,64 @@ const SDR_type_01h_t SDR_MAX6642_FPGA = { }; #endif +#if defined(MODULE_INA3221_VOLTAGE) || defined(MODULE_INA3221_CURRENT) + +// INA3221 configuration +const ina3221_config_t INA3221_SETTINGS = { + .shunt_resistor[0] = 2, /* mOhm */ + .shunt_resistor[1] = 2, /* mOhm */ + .shunt_resistor[2] = 2 /* mOhm */ +}; + +#endif + void amc_sdr_init( void ) { /* Hotswap Sensor */ sdr_insert_entry( TYPE_02, (void *) &SDR_HOTSWAP_AMC, &vTaskHotSwap_Handle, 0, 0 ); - /* INA220 sensors */ -#ifdef MODULE_INA220_VOLTAGE + /* INA3221 sensors */ +#ifdef MODULE_INA3221_VOLTAGE + + /* AMC RTM Voltage */ + sdr_insert_entry( TYPE_01, (void *) &SDR_AMC_12V, &vTaskINA3221_Handle, 0, CHIP_ID_INA_0 ); + sdr_insert_entry( TYPE_01, (void *) &SDR_RTM_12V, &vTaskINA3221_Handle, 0, CHIP_ID_INA_0 ); + sdr_add_settings(CHIP_ID_INA_0, (void *) &INA3221_SETTINGS); + /* FMC1 Voltage */ - sdr_insert_entry( TYPE_01, (void *) &SDR_FMC1_12V, &vTaskINA220_Handle, FMC1_12V_DEVID, CHIP_ID_INA_5 ); - sdr_insert_entry( TYPE_01, (void *) &SDR_FMC1_VADJ, &vTaskINA220_Handle, FMC1_VADJ_DEVID, CHIP_ID_INA_2 ); - sdr_insert_entry( TYPE_01, (void *) &SDR_FMC1_P3V3, &vTaskINA220_Handle, FMC1_P3V3_DEVID, CHIP_ID_INA_4 ); + sdr_insert_entry( TYPE_01, (void *) &SDR_FMC1_12V, &vTaskINA3221_Handle, FMC1_12V_DEVID, CHIP_ID_INA_1 ); + sdr_insert_entry( TYPE_01, (void *) &SDR_FMC1_VADJ, &vTaskINA3221_Handle, FMC1_VADJ_DEVID, CHIP_ID_INA_1 ); + sdr_insert_entry( TYPE_01, (void *) &SDR_FMC1_P3V3, &vTaskINA3221_Handle, FMC1_P3V3_DEVID, CHIP_ID_INA_1 ); + sdr_add_settings(CHIP_ID_INA_1, (void *) &INA3221_SETTINGS); /* FMC2 Voltage */ - sdr_insert_entry( TYPE_01, (void *) &SDR_FMC2_12V, &vTaskINA220_Handle, FMC2_12V_DEVID, CHIP_ID_INA_0 ); - sdr_insert_entry( TYPE_01, (void *) &SDR_FMC2_VADJ, &vTaskINA220_Handle, FMC2_VADJ_DEVID, CHIP_ID_INA_1 ); - sdr_insert_entry( TYPE_01, (void *) &SDR_FMC2_P3V3, &vTaskINA220_Handle, FMC2_P3V3_DEVID, CHIP_ID_INA_3 ); -#endif + sdr_insert_entry( TYPE_01, (void *) &SDR_FMC2_12V, &vTaskINA3221_Handle, FMC2_12V_DEVID, CHIP_ID_INA_2 ); + sdr_insert_entry( TYPE_01, (void *) &SDR_FMC2_VADJ, &vTaskINA3221_Handle, FMC2_VADJ_DEVID, CHIP_ID_INA_2 ); + sdr_insert_entry( TYPE_01, (void *) &SDR_FMC2_P3V3, &vTaskINA3221_Handle, FMC2_P3V3_DEVID, CHIP_ID_INA_2 ); + sdr_add_settings(CHIP_ID_INA_2, (void *) &INA3221_SETTINGS); + + #endif + +#ifdef MODULE_INA3221_CURRENT + + /* AMC RTM Current */ + sdr_insert_entry( TYPE_01, (void *) &SDR_AMC_12V_CURR, &vTaskINA3221_Handle, 0, CHIP_ID_INA_0 ); + sdr_insert_entry( TYPE_01, (void *) &SDR_RTM_12V_CURR, &vTaskINA3221_Handle, 0, CHIP_ID_INA_0 ); + sdr_add_settings(CHIP_ID_INA_0, (void *) &INA3221_SETTINGS); -#ifdef MODULE_INA220_CURRENT /* FMC1 Current */ - sdr_insert_entry( TYPE_01, (void *) &SDR_FMC1_12V_CURR, &vTaskINA220_Handle, FMC1_12V_CURR_DEVID, CHIP_ID_INA_5 ); - sdr_insert_entry( TYPE_01, (void *) &SDR_FMC1_VADJ_CURR, &vTaskINA220_Handle, FMC1_VADJ_CURR_DEVID, CHIP_ID_INA_2 ); - sdr_insert_entry( TYPE_01, (void *) &SDR_FMC1_P3V3_CURR, &vTaskINA220_Handle, FMC1_P3V3_CURR_DEVID, CHIP_ID_INA_4 ); + sdr_insert_entry( TYPE_01, (void *) &SDR_FMC1_12V_CURR, &vTaskINA3221_Handle, FMC1_12V_CURR_DEVID, CHIP_ID_INA_1 ); + sdr_insert_entry( TYPE_01, (void *) &SDR_FMC1_VADJ_CURR, &vTaskINA3221_Handle, FMC1_VADJ_CURR_DEVID, CHIP_ID_INA_1 ); + sdr_insert_entry( TYPE_01, (void *) &SDR_FMC1_P3V3_CURR, &vTaskINA3221_Handle, FMC1_P3V3_CURR_DEVID, CHIP_ID_INA_1 ); + sdr_add_settings(CHIP_ID_INA_1, (void *) &INA3221_SETTINGS); /* FMC2 Current */ - sdr_insert_entry( TYPE_01, (void *) &SDR_FMC2_12V_CURR, &vTaskINA220_Handle, FMC2_12V_CURR_DEVID, CHIP_ID_INA_0 ); - sdr_insert_entry( TYPE_01, (void *) &SDR_FMC2_VADJ_CURR, &vTaskINA220_Handle, FMC2_VADJ_CURR_DEVID, CHIP_ID_INA_1 ); - sdr_insert_entry( TYPE_01, (void *) &SDR_FMC2_P3V3_CURR, &vTaskINA220_Handle, FMC2_P3V3_CURR_DEVID, CHIP_ID_INA_3 ); -#endif + sdr_insert_entry( TYPE_01, (void *) &SDR_FMC2_12V_CURR, &vTaskINA3221_Handle, FMC2_12V_CURR_DEVID, CHIP_ID_INA_2 ); + sdr_insert_entry( TYPE_01, (void *) &SDR_FMC2_VADJ_CURR, &vTaskINA3221_Handle, FMC2_VADJ_CURR_DEVID, CHIP_ID_INA_2 ); + sdr_insert_entry( TYPE_01, (void *) &SDR_FMC2_P3V3_CURR, &vTaskINA3221_Handle, FMC2_P3V3_CURR_DEVID, CHIP_ID_INA_2 ); + sdr_add_settings(CHIP_ID_INA_2, (void *) &INA3221_SETTINGS); + + #endif #ifdef MODULE_MAX6642 /* FPGA Die Temperature */ diff --git a/port/board/afc-bpm/v3_0/user_amc_fru.h b/port/board/afc-v4/user_amc_fru.h similarity index 83% rename from port/board/afc-bpm/v3_0/user_amc_fru.h rename to port/board/afc-v4/user_amc_fru.h index 2ca545104..dbba5ac06 100644 --- a/port/board/afc-bpm/v3_0/user_amc_fru.h +++ b/port/board/afc-v4/user_amc_fru.h @@ -3,6 +3,7 @@ * * Copyright (C) 2015 Julian Mendez * Copyright (C) 2015-2016 Henrique Silva + * Copyright (C) 2021 Krzysztof Macias * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,21 +32,21 @@ /********************************************* * Board information area *********************************************/ -#define AMC_BOARD_MANUFACTURING_TIME 10463040 /* Amount of minutes since 0:00 1/1/96 */ +#define AMC_BOARD_MANUFACTURING_TIME 13076640 /* Amount of minutes since 0:00 1/1/96 */ #define AMC_BOARD_MANUFACTURER "Creotech" #define AMC_BOARD_NAME "AMC-FMC-Carrier" -#define AMC_BOARD_SN "1100140002" +#define AMC_BOARD_SN "CNxxxxx" #define AMC_BOARD_PN "AFC" /********************************************* * Product information area *********************************************/ -#define AMC_PRODUCT_MANUFACTURER "LNLS" -#define AMC_PRODUCT_NAME "AFC BPM" -#define AMC_PRODUCT_PN "00001" -#define AMC_PRODUCT_VERSION "v3.0" -#define AMC_PRODUCT_SN "1100140002" -#define AMC_PRODUCT_ASSET_TAG "No tag" +#define AMC_PRODUCT_MANUFACTURER "Creotech" +#define AMC_PRODUCT_NAME "AFC" +#define AMC_PRODUCT_PN "AFC:4.0" +#define AMC_PRODUCT_VERSION "4.0" +#define AMC_PRODUCT_SN "CNxxxxx" +#define AMC_PRODUCT_ASSET_TAG "Generic FRU" /********************************************* * AMC: Point to point connectivity record @@ -60,7 +61,7 @@ DIRECT_CLOCK_CONNECTION(CLOCK_ID, ACTIVATION, PLL_USE, SOURCE/RECEIVER, CLOCK_FAMILY, ACCURACY, FREQUENCY, MIN FREQUENCY, MAX FREQUENCY) */ #define AMC_CLOCK_CONFIGURATION_LIST \ DIRECT_CLOCK_CONNECTION(FCLKA, CIPMC, NO_PLL, RECEIVER, PCI_RESERVED, 0, MHz(100), MHz(99), MHz(101)) \ - DIRECT_CLOCK_CONNECTION(TCLKA, APP, NO_PLL, RECEIVER, UNSPEC_FAMILY, 0, KHz(13500), MHz(13), MHz(14)) + DIRECT_CLOCK_CONNECTION(TCLKA, APP, NO_PLL, RECEIVER, UNSPEC_FAMILY, 0, KHz(62500), KHz(62450), KHz(62550)) /********************************************** * PICMG: Module current record **********************************************/ @@ -69,4 +70,4 @@ /********************************************* * RTM Compatibility Record *********************************************/ -#define AMC_COMPATIBILITY_CODE 0x11223344 +#define AMC_COMPATIBILITY_CODE 0x55667788 diff --git a/port/board/rtm-8sfp/rtm_user.c b/port/board/rtm-8sfp/rtm_user.c index c7e143baa..9042a8be9 100644 --- a/port/board/rtm-8sfp/rtm_user.c +++ b/port/board/rtm-8sfp/rtm_user.c @@ -50,7 +50,7 @@ uint8_t rtm_get_hotswap_handle_status( uint8_t *state ) rtm_enable_i2c(); - if (pca9554_read_pin( RTM_GPIO_HOTSWAP_HANDLE, &pin_read ) == 0 ) { + if (pca9554_read_pin( CHIP_ID_RTM_PCA9554, RTM_GPIO_HOTSWAP_HANDLE, &pin_read ) == 0 ) { return false; } @@ -88,7 +88,7 @@ void rtm_check_presence( uint8_t *status ) void rtm_hardware_init( void ) { rtm_enable_i2c(); - pca9554_set_port_dir( 0x1F ); + pca9554_set_port_dir( CHIP_ID_RTM_PCA9554, 0x1F ); } void rtm_enable_i2c( void ) @@ -179,7 +179,7 @@ void rtm_ctrl_led( uint8_t id, uint8_t state ) return; } - pca9554_write_pin( pca_pin, state ); + pca9554_write_pin( CHIP_ID_RTM_PCA9554, pca_pin, state ); } uint8_t rtm_read_led( uint8_t id ) @@ -203,7 +203,7 @@ uint8_t rtm_read_led( uint8_t id ) return 1; } - pca9554_read_pin( pca_pin, &stat ); + pca9554_read_pin( CHIP_ID_RTM_PCA9554, pca_pin, &stat ); return stat; } diff --git a/port/board/rtm-lamp/CMakeLists.txt b/port/board/rtm-lamp/CMakeLists.txt new file mode 100644 index 000000000..6b46c70bb --- /dev/null +++ b/port/board/rtm-lamp/CMakeLists.txt @@ -0,0 +1,25 @@ +#List all modules used by this board +set(RTM_LAMP_MODULES + "PCA9554" + "EEPROM_24XX64" + "CDCE906" + "MAX116XX" + ) + +set(RTM_LAMP_PATH ${CMAKE_CURRENT_SOURCE_DIR}) + +#Include the modules sources +##Sensors SDR list +set( PROJ_SRCS ${PROJ_SRCS} + ${RTM_LAMP_PATH}/rtm_user.c + ${RTM_LAMP_PATH}/sdr_list.c + ) + +#Include headers path +set(PROJ_HDRS ${PROJ_HDRS} ${RTM_LAMP_PATH}) + +#Set the variables in the main scope +set(TARGET_MODULES ${TARGET_MODULES} ${RTM_LAMP_MODULES} PARENT_SCOPE) + +set(PROJ_SRCS ${PROJ_SRCS} PARENT_SCOPE) +set(PROJ_HDRS ${PROJ_HDRS} PARENT_SCOPE) diff --git a/port/board/rtm-lamp/cdce906_config.h b/port/board/rtm-lamp/cdce906_config.h new file mode 100644 index 000000000..a155d643a --- /dev/null +++ b/port/board/rtm-lamp/cdce906_config.h @@ -0,0 +1,85 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2021 Augusto Fraga Giachero + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +/** + * @file cdce906_config.h + * @author Augusto Fraga Giachero + * + * @brief CDCE906 PLL configuration + * + * @ingroup RTM-LAMP + */ + +#include "cdce906.h" + +static const cdce906_cfg cdce906_rtm_cfg = +{ + .clksrc = CDCE906_CLK_SRC_CLKIN_DIFF, + .pll_div_m = {1, 1, 1}, + .pll_div_n = {5, 1, 1}, + .pll_vco_mux = { + CDCE906_PLL_VCO_MUX_PLL, + CDCE906_PLL_VCO_MUX_PLL, + CDCE906_PLL_VCO_MUX_PLL, + }, + .pll_fvco = { + CDCE906_PLL_FVCO_80_200MHZ, + CDCE906_PLL_FVCO_80_200MHZ, + CDCE906_PLL_FVCO_80_200MHZ, + }, + .ssc_mod_amount = CDCE906_SSC_MOD_AMOUNT_OFF, + .ssc_mod_freq = CDCE906_SSC_MOD_FREQ_3286, + .s0_cfg = CDCE906_S0_CFG_POWER_DOWN_CTRL, + .s1_cfg = CDCE906_S1_CFG_Yx_FIXED_OUTPUT_CTRL, + .pll_sel = { + CDCE906_Px_PLL_SEL_PLL1, + CDCE906_Px_PLL_SEL_BYPASS, + CDCE906_Px_PLL_SEL_BYPASS, + CDCE906_Px_PLL_SEL_BYPASS, + CDCE906_Px_PLL_SEL_BYPASS, + CDCE906_Px_PLL_SEL_BYPASS, + }, + .p_div = {1, 120, 30, 60, 1, 1}, + .y_slew = { + CDCE906_Yx_SLEW_CFG_NOMINAL_1NS, + CDCE906_Yx_SLEW_CFG_NOMINAL_1NS, + CDCE906_Yx_SLEW_CFG_NOMINAL_1NS, + CDCE906_Yx_SLEW_CFG_NOMINAL_1NS, + CDCE906_Yx_SLEW_CFG_NOMINAL_1NS, + CDCE906_Yx_SLEW_CFG_NOMINAL_1NS, + }, + .y_p_sel = { + CDCE906_Yx_Px_SEL_P0, + CDCE906_Yx_Px_SEL_P1, + CDCE906_Yx_Px_SEL_P2, + CDCE906_Yx_Px_SEL_P3, + CDCE906_Yx_Px_SEL_P4, + CDCE906_Yx_Px_SEL_P5, + }, + .y_out = { + CDCE906_Yx_OUT_CFG_EN, + CDCE906_Yx_OUT_CFG_DIS_HIGH, + CDCE906_Yx_OUT_CFG_DIS_LOW, + CDCE906_Yx_OUT_CFG_DIS_LOW, + CDCE906_Yx_OUT_CFG_DIS_LOW, + CDCE906_Yx_OUT_CFG_DIS_LOW, + }, +}; diff --git a/port/board/rtm-lamp/rtm_user.c b/port/board/rtm-lamp/rtm_user.c new file mode 100644 index 000000000..7bcab98a8 --- /dev/null +++ b/port/board/rtm-lamp/rtm_user.c @@ -0,0 +1,245 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2015-2016 Henrique Silva + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +/* Project includes */ +#include "port.h" +#include "rtm.h" +#include "pca9554.h" +#include "pin_mapping.h" +#include "hotswap.h" +#include "i2c_mapping.h" +#include "fru.h" +#include "utils.h" +#include "led.h" +#include "board_led.h" +#include "uart_debug.h" +#include "cdce906_config.h" +/* RTM Management functions */ + +void rtm_enable_payload_power( void ) +{ + gpio_set_pin_state( PIN_PORT(GPIO_EN_RTM_PWR), PIN_NUMBER(GPIO_EN_RTM_PWR), 1 ); + + /* + * RTM-LAMP power up sequence + */ + pca9554_write_pin(CHIP_ID_RTM_PCA9554_PWR, RTM_GPIO_5V_EN, 1); + vTaskDelay(pdMS_TO_TICKS(10)); + pca9554_write_pin(CHIP_ID_RTM_PCA9554_PWR, RTM_GPIO_NEG_7V_EN, 1); + pca9554_write_pin(CHIP_ID_RTM_PCA9554_PWR, RTM_GPIO_7V_EN, 0); + vTaskDelay(pdMS_TO_TICKS(10)); + pca9554_write_pin(CHIP_ID_RTM_PCA9554_PWR, RTM_GPIO_VS1_EN, 1); + pca9554_write_pin(CHIP_ID_RTM_PCA9554_PWR, RTM_GPIO_VS2_EN, 1); +} + +void rtm_disable_payload_power( void ) +{ + gpio_set_pin_state( PIN_PORT(GPIO_EN_RTM_PWR), PIN_NUMBER(GPIO_EN_RTM_PWR), 0 ); + + /* + * RTM-LAMP power down sequence + */ + pca9554_write_pin(CHIP_ID_RTM_PCA9554_PWR, RTM_GPIO_VS1_EN, 0); + pca9554_write_pin(CHIP_ID_RTM_PCA9554_PWR, RTM_GPIO_VS2_EN, 0); + vTaskDelay(pdMS_TO_TICKS(10)); + pca9554_write_pin(CHIP_ID_RTM_PCA9554_PWR, RTM_GPIO_NEG_7V_EN, 0); + pca9554_write_pin(CHIP_ID_RTM_PCA9554_PWR, RTM_GPIO_7V_EN, 1); + vTaskDelay(pdMS_TO_TICKS(10)); + pca9554_write_pin(CHIP_ID_RTM_PCA9554_PWR, RTM_GPIO_5V_EN, 0); +} + +uint8_t rtm_get_hotswap_handle_status( uint8_t *state ) +{ + static uint8_t falling, rising; + uint8_t pin_read; + + rtm_enable_i2c(); + + if (pca9554_read_pin( CHIP_ID_RTM_PCA9554_LEDS, RTM_GPIO_HOTSWAP_HANDLE, &pin_read ) == 0 ) { + return false; + } + + falling = (falling << 1) | !pin_read | 0x80; + rising = (rising << 1) | pin_read | 0x80; + + if ( (falling == 0xFF) || (rising == 0xFF) ) { + *state = pin_read; + return true; + } + return false; +} + +void rtm_check_presence( uint8_t *status ) +{ + /* Due to a hardware limitation in the AFC board, we can't rely on reading the PS signal + since this pin doesn't have a pull-up resistor, it's always read as 0. + A very dirty workaround is to 'ping' the RTM IO Expander(PCA9554), if it responds, then the board is connected */ + rtm_enable_i2c(); + + uint8_t i2c_addr, i2c_interface; + uint8_t dumb; + + /* Defaults to absent - in case of I2C failure */ + *status = HOTSWAP_STATE_URTM_ABSENT; + + if (i2c_take_by_chipid( CHIP_ID_RTM_PCA9554_LEDS, &i2c_addr, &i2c_interface, 100)) { + if (xI2CMasterRead( i2c_interface, i2c_addr, &dumb, 1)) { + *status = HOTSWAP_STATE_URTM_PRSENT; + } + i2c_give(i2c_interface); + } +} + +void rtm_hardware_init( void ) +{ + rtm_enable_i2c(); + pca9554_set_port_dir( CHIP_ID_RTM_PCA9554_LEDS, 0x1F ); + + /* + * Clock configuration + */ + cdce906_write_cfg(CHIP_ID_RTM_CDCE906, &cdce906_rtm_cfg); + + /* + * Disable all power rails + */ + pca9554_set_port_dir(CHIP_ID_RTM_PCA9554_PWR, 0x00); + pca9554_write_port(CHIP_ID_RTM_PCA9554_PWR, (0 << RTM_GPIO_NEG_7V_EN) | + (1 << RTM_GPIO_7V_EN) | (0 << RTM_GPIO_VS1_EN) | + (0 << RTM_GPIO_VS2_EN) | (0 << RTM_GPIO_5V_EN)); +} + +void rtm_enable_i2c( void ) +{ + /* Enable I2C communication with RTM */ + gpio_set_pin_dir( PIN_PORT(GPIO_RTM_PS), PIN_NUMBER(GPIO_RTM_PS), GPIO_DIR_OUTPUT ); + gpio_set_pin_dir( PIN_PORT(GPIO_EN_RTM_I2C), PIN_NUMBER(GPIO_EN_RTM_I2C), GPIO_DIR_OUTPUT ); + gpio_set_pin_state( PIN_PORT(GPIO_EN_RTM_I2C), PIN_NUMBER(GPIO_EN_RTM_I2C), GPIO_LEVEL_HIGH ); +} + +void rtm_disable_i2c( void ) +{ + gpio_set_pin_dir( PIN_PORT(GPIO_RTM_PS), PIN_NUMBER(GPIO_RTM_PS), GPIO_DIR_INPUT ); + gpio_set_pin_dir( PIN_PORT(GPIO_EN_RTM_I2C), PIN_NUMBER(GPIO_EN_RTM_I2C), GPIO_DIR_INPUT ); +} + +bool rtm_compatibility_check( void ) +{ + uint8_t i; + size_t rec_sz[2]; + uint8_t *z3_compat_recs[2] = { NULL, NULL }; + uint8_t cmn_hdr[8], multirec_hdr[10]; + uint8_t multirec_off; + bool z3rec_found; + + for ( i = 0; i < 2; i++ ) { + /* Read FRU Common Header */ + fru_read( i, cmn_hdr, 0, 8 ); + /* The offsets are divided by 8 in the common header */ + multirec_off = cmn_hdr[5]*8; + + do { + /* Read Multirecord header */ + fru_read( i, multirec_hdr, multirec_off, 10 ); + + if (multirec_hdr[8] == 0x30) { + z3rec_found = true; + break; + } + /* Advance the offset pointer, adding the record length field to it */ + multirec_off += multirec_hdr[2]+5; + + } while ( (multirec_hdr[1] >> 7) != 1 ); + + if ( z3rec_found ) { + /* Read the Zone3 Compatibility Record, including the Multirecord header */ + rec_sz[i] = multirec_hdr[2]+5; + z3_compat_recs[i] = pvPortMalloc( rec_sz[i] ); + fru_read( i, z3_compat_recs[i], multirec_off, rec_sz[i] ); + } + + } + + if ( !cmpBuffs( z3_compat_recs[0], rec_sz[0], z3_compat_recs[1], rec_sz[1] ) ) { + return true; + } + + vPortFree(z3_compat_recs[0]); + vPortFree(z3_compat_recs[1]); + + return false; +} + +bool rtm_quiesce( void ) +{ + /* In this board, no action is needed to quiesce */ + return true; +} + +void rtm_ctrl_led( uint8_t id, uint8_t state ) +{ + uint8_t pca_pin; + + switch( id ) { + case LED_BLUE: + pca_pin = RTM_GPIO_LED_BLUE; + break; + + case LED1: + pca_pin = RTM_GPIO_LED_RED; + break; + + case LED2: + pca_pin = RTM_GPIO_LED_GREEN; + break; + + default: + return; + } + + pca9554_write_pin( CHIP_ID_RTM_PCA9554_LEDS, pca_pin, state ); +} + +uint8_t rtm_read_led( uint8_t id ) +{ + uint8_t pca_pin, stat; + + switch( id ) { + case LED_BLUE: + pca_pin = RTM_GPIO_LED_BLUE; + break; + + case LED1: + pca_pin = RTM_GPIO_LED_RED; + break; + + case LED2: + pca_pin = RTM_GPIO_LED_GREEN; + break; + + default: + return 1; + } + + pca9554_read_pin( CHIP_ID_RTM_PCA9554_LEDS, pca_pin, &stat ); + + return stat; +} diff --git a/port/board/rtm-lamp/rtm_user.h b/port/board/rtm-lamp/rtm_user.h new file mode 100644 index 000000000..269d2ca85 --- /dev/null +++ b/port/board/rtm-lamp/rtm_user.h @@ -0,0 +1,53 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2015-2016 Henrique Silva + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +#ifndef RTM_USER_H_ +#define RTM_USER_H_ + +/* PCA9554 outputs */ +#define RTM_GPIO_HOTSWAP_HANDLE 0 +#define RTM_GPIO_OVERTEMP_SHUTDOWN 4 +#define RTM_GPIO_LED_RED 5 +#define RTM_GPIO_LED_GREEN 6 +#define RTM_GPIO_LED_BLUE 7 + +#define RTM_GPIO_VS1_EN 0 +#define RTM_GPIO_VS2_EN 1 +#define RTM_GPIO_7V_EN 2 +#define RTM_GPIO_5V_EN 3 +#define RTM_GPIO_NEG_7V_EN 4 + +/* Mandatory RTM module functions */ +void rtm_enable_payload_power( void ); +void rtm_disable_payload_power( void ); +uint8_t rtm_get_hotswap_handle_status( uint8_t *state ); +void rtm_check_presence( uint8_t *status ); +void rtm_hardware_init( void ); +void rtm_ctrl_led( uint8_t id, uint8_t state ); +uint8_t rtm_read_led( uint8_t id ); +bool rtm_quiesce( void ); +bool rtm_compatibility_check( void ); + +/* User defined functions */ +void rtm_enable_i2c( void ); +void rtm_disable_i2c( void ); + +#endif diff --git a/port/board/rtm-lamp/rtm_user_fru.h b/port/board/rtm-lamp/rtm_user_fru.h new file mode 100644 index 000000000..99a128964 --- /dev/null +++ b/port/board/rtm-lamp/rtm_user_fru.h @@ -0,0 +1,53 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2015 Julian Mendez + * Copyright (C) 2015-2016 Henrique Silva + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +#include "fru_editor.h" + +/********************************************* + * Common defines + *********************************************/ +#define RTM_LANG_CODE 0 +#define RTM_FRU_FILE_ID "RTMFRU" //Allows knowing the source of the FRU present in the memory + +/********************************************* + * Board information area + *********************************************/ +#define RTM_BOARD_MANUFACTURING_TIME 10463040 /* Amount of minutes since 0:00 1/1/96 */ +#define RTM_BOARD_MANUFACTURER "Creotech" +#define RTM_BOARD_NAME "RTM-8-SFP" +#define RTM_BOARD_SN "" +#define RTM_BOARD_PN "RTM-8-SFP" + +/********************************************* + * Product information area + *********************************************/ +#define RTM_PRODUCT_MANUFACTURER "LNLS" +#define RTM_PRODUCT_NAME "AFC SFP Module" +#define RTM_PRODUCT_PN "" +#define RTM_PRODUCT_VERSION "v1.1" +#define RTM_PRODUCT_SN "" +#define RTM_PRODUCT_ASSET_TAG "Generic FRU" + +/********************************************* + * RTM Compatibility Record + *********************************************/ +#define RTM_COMPATIBILITY_CODE 0x11223344 diff --git a/port/board/rtm-lamp/sdr_list.c b/port/board/rtm-lamp/sdr_list.c new file mode 100644 index 000000000..db7d705a5 --- /dev/null +++ b/port/board/rtm-lamp/sdr_list.c @@ -0,0 +1,245 @@ +/* + * openMMC -- Open Source modular IPM Controller firmware + * + * Copyright (C) 2015-2016 Henrique Silva + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @license GPL-3.0+ + */ + +/* Project Includes */ +#include "sdr.h" +#include "utils.h" +#include "sensors.h" +#include "i2c_mapping.h" + +/* Rename file to sdr_list.c */ +#ifdef MODULE_HOTSWAP +const SDR_type_02h_t SDR_HOTSWAP_RTM = { + + .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ + .hdr.recID_MSB = 0x00, + .hdr.SDRversion = 0x51, + .hdr.rectype = TYPE_02, + .hdr.reclength = sizeof(SDR_type_02h_t) - sizeof(SDR_entry_hdr_t), + + .ownerID = 0x00, /* i2c address, -> SDR_Init */ + .ownerLUN = 0x00, /* sensor owner LUN */ + .sensornum = 0x00, /* Filled by sdr_insert_entry() */ + +/* record body bytes */ + .entityID = 0xC0, /* entity id: RTM */ + .entityinstance = 0x00, /* entity instance -> SDR_Init */ + .sensorinit = 0x03, /* init: event generation + scanning enabled */ + .sensorcap = 0xc1, /* capabilities: auto re-arm,*/ + .sensortype = SENSOR_TYPE_HOT_SWAP, /* sensor type: HOT SWAP*/ + .event_reading_type = 0x6f, /* sensor reading*/ + .assertion_event_mask = 0x0000, /* assertion event mask */ + .deassertion_event_mask = 0x0000, /* deassertion event mask */ + .readable_threshold_mask = 0x00, /* LSB: readable Threshold mask: no thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: no thresholds are setable: */ + .sensor_units_1 = 0xc0, /* sensor units 1 : Does not return analog reading*/ + .sensor_units_2 = 0x00, /* sensor units 2 :*/ + .sensor_units_3 = 0x00, /* sensor units 3 :*/ + .record_sharing[0] = 0x00, + .record_sharing[1] = 0x00, + .pos_thr_hysteresis = 0x00, /* positive going Threshold hysteresis value */ + .neg_thr_hysteresis = 0x00, /* negative going Threshold hysteresis value */ + .reserved1 = 0x00, /* reserved */ + .reserved2 = 0x00, /* reserved */ + .reserved3 = 0x00, /* reserved */ + .OEM = 0x00, /* OEM reserved */ + .IDtypelen = 0xc0 | STR_SIZE("HOTSWAP RTM"), /* 8 bit ASCII, number of bytes */ + .IDstring = "HOTSWAP RTM" /* sensor string */ +}; +#endif + +#ifdef MODULE_LM75 +const SDR_type_01h_t SDR_LM75_RTM_1 = { + + .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ + .hdr.recID_MSB = 0x00, + .hdr.SDRversion = 0x51, + .hdr.rectype = TYPE_01, + .hdr.reclength = sizeof(SDR_type_01h_t) - sizeof(SDR_entry_hdr_t), + + .ownerID = 0x00, /* i2c address, -> SDR_Init */ + .ownerLUN = 0x00, /* sensor owner LUN */ + .sensornum = 0x00, /* Filled by sdr_insert_entry() */ + + /* record body bytes */ + .entityID = 0xC0, /* entity id: RTM */ + .entityinstance = 0x00, /* entity instance -> SDR_Init */ + .sensorinit = 0x7f, /* init: event generation + scanning enabled */ + .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ + .event_reading_type = 0x01, /* sensor reading*/ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ + .sensor_units_1 = 0x00, /* sensor units 1 :*/ + .sensor_units_2 = 0x01, /* sensor units 2 :*/ + .sensor_units_3 = 0x00, /* sensor units 3 :*/ + .linearization = 0x00, /* Linearization */ + .M = 5, /* M */ + .M_tol = 0x00, /* M - Tolerance */ + .B = 0x00, /* B */ + .B_accuracy = 0x00, /* B - Accuracy */ + .acc_exp_sensor_dir = 0x00, /* Sensor direction */ + .Rexp_Bexp = 0xF0, /* R-Exp , B-Exp */ + .analog_flags = 0x03, /* Analogue characteristics flags */ + .nominal_reading = (30 << 1), /* Nominal reading */ + .normal_max = (50 << 1), /* Normal maximum */ + .normal_min = (20 << 1), /* Normal minimum */ + .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ + .sensor_min_reading = 0x00, /* Sensor Minimum reading */ + .upper_nonrecover_thr = (75 << 1), /* Upper non-recoverable Threshold */ + .upper_critical_thr = (65 << 1), /* Upper critical Threshold */ + .upper_noncritical_thr = (55 << 1), /* Upper non critical Threshold */ + .lower_nonrecover_thr = (5 << 1), /* Lower non-recoverable Threshold */ + .lower_critical_thr = (10 << 1), /* Lower critical Threshold */ + .lower_noncritical_thr = (20 << 1), /* Lower non-critical Threshold */ + .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ + .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ + .reserved1 = 0x00, /* reserved */ + .reserved2 = 0x00, /* reserved */ + .OEM = 0x00, /* OEM reserved */ + .IDtypelen = 0xc0 | STR_SIZE("TEMP RTM1"), /* 8 bit ASCII, number of bytes */ + .IDstring = "TEMP RTM1" /* sensor string */ +}; + +const SDR_type_01h_t SDR_LM75_RTM_2 = { + + .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ + .hdr.recID_MSB = 0x00, + .hdr.SDRversion = 0x51, + .hdr.rectype = TYPE_01, + .hdr.reclength = sizeof(SDR_type_01h_t) - sizeof(SDR_entry_hdr_t), + + .ownerID = 0x00, /* i2c address, -> SDR_Init */ + .ownerLUN = 0x00, /* sensor owner LUN */ + .sensornum = 0x00, /* Filled by sdr_insert_entry() */ + + /* record body bytes */ + .entityID = 0xC0, /* entity id: RTM */ + .entityinstance = 0x00, /* entity instance -> SDR_Init */ + .sensorinit = 0x7f, /* init: event generation + scanning enabled */ + .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ + .event_reading_type = 0x01, /* sensor reading*/ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ + .sensor_units_1 = 0x00, /* sensor units 1 :*/ + .sensor_units_2 = 0x01, /* sensor units 2 :*/ + .sensor_units_3 = 0x00, /* sensor units 3 :*/ + .linearization = 0x00, /* Linearization */ + .M = 5, /* M */ + .M_tol = 0x00, /* M - Tolerance */ + .B = 0x00, /* B */ + .B_accuracy = 0x00, /* B - Accuracy */ + .acc_exp_sensor_dir = 0x00, /* Sensor direction */ + .Rexp_Bexp = 0xF0, /* R-Exp , B-Exp */ + .analog_flags = 0x03, /* Analogue characteristics flags */ + .nominal_reading = (30 << 1), /* Nominal reading */ + .normal_max = (50 << 1), /* Normal maximum */ + .normal_min = (20 << 1), /* Normal minimum */ + .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ + .sensor_min_reading = 0x00, /* Sensor Minimum reading */ + .upper_nonrecover_thr = (75 << 1), /* Upper non-recoverable Threshold */ + .upper_critical_thr = (65 << 1), /* Upper critical Threshold */ + .upper_noncritical_thr = (55 << 1), /* Upper non critical Threshold */ + .lower_nonrecover_thr = (5 << 1), /* Lower non-recoverable Threshold */ + .lower_critical_thr = (10 << 1), /* Lower critical Threshold */ + .lower_noncritical_thr = (20 << 1), /* Lower non-critical Threshold */ + .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ + .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ + .reserved1 = 0x00, /* reserved */ + .reserved2 = 0x00, /* reserved */ + .OEM = 0x00, /* OEM reserved */ + .IDtypelen = 0xc0 | STR_SIZE("TEMP RTM2"), /* 8 bit ASCII, number of bytes */ + .IDstring = "TEMP RTM2" /* sensor string */ +}; + +const SDR_type_01h_t SDR_LM75_RTM_3 = { + + .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ + .hdr.recID_MSB = 0x00, + .hdr.SDRversion = 0x51, + .hdr.rectype = TYPE_01, + .hdr.reclength = sizeof(SDR_type_01h_t) - sizeof(SDR_entry_hdr_t), + + .ownerID = 0x00, /* i2c address, -> SDR_Init */ + .ownerLUN = 0x00, /* sensor owner LUN */ + .sensornum = 0x00, /* Filled by sdr_insert_entry() */ + + /* record body bytes */ + .entityID = 0xC0, /* entity id: RTM */ + .entityinstance = 0x00, /* entity instance -> SDR_Init */ + .sensorinit = 0x7f, /* init: event generation + scanning enabled */ + .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ + .event_reading_type = 0x01, /* sensor reading*/ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ + .sensor_units_1 = 0x00, /* sensor units 1 :*/ + .sensor_units_2 = 0x01, /* sensor units 2 :*/ + .sensor_units_3 = 0x00, /* sensor units 3 :*/ + .linearization = 0x00, /* Linearization */ + .M = 5, /* M */ + .M_tol = 0x00, /* M - Tolerance */ + .B = 0x00, /* B */ + .B_accuracy = 0x00, /* B - Accuracy */ + .acc_exp_sensor_dir = 0x00, /* Sensor direction */ + .Rexp_Bexp = 0xF0, /* R-Exp , B-Exp */ + .analog_flags = 0x03, /* Analogue characteristics flags */ + .nominal_reading = (30 << 1), /* Nominal reading */ + .normal_max = (50 << 1), /* Normal maximum */ + .normal_min = (20 << 1), /* Normal minimum */ + .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ + .sensor_min_reading = 0x00, /* Sensor Minimum reading */ + .upper_nonrecover_thr = (75 << 1), /* Upper non-recoverable Threshold */ + .upper_critical_thr = (65 << 1), /* Upper critical Threshold */ + .upper_noncritical_thr = (55 << 1), /* Upper non critical Threshold */ + .lower_nonrecover_thr = (5 << 1), /* Lower non-recoverable Threshold */ + .lower_critical_thr = (10 << 1), /* Lower critical Threshold */ + .lower_noncritical_thr = (20 << 1), /* Lower non-critical Threshold */ + .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ + .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ + .reserved1 = 0x00, /* reserved */ + .reserved2 = 0x00, /* reserved */ + .OEM = 0x00, /* OEM reserved */ + .IDtypelen = 0xc0 | STR_SIZE("TEMP RTM3"), /* 8 bit ASCII, number of bytes */ + .IDstring = "TEMP RTM3" /* sensor string */ +}; +#endif + +void rtm_sdr_init( void ) +{ +#ifdef MODULE_HOTSWAP + sdr_insert_entry( TYPE_02, (void *) &SDR_HOTSWAP_RTM, &vTaskHotSwap_Handle, 0, 0 ); +#endif + +#ifdef MODULE_LM75 + sdr_insert_entry( TYPE_01, (void *) &SDR_LM75_RTM_1, &vTaskLM75_Handle, 0, CHIP_ID_RTM_LM75_0 ); + sdr_insert_entry( TYPE_01, (void *) &SDR_LM75_RTM_2, &vTaskLM75_Handle, 0, CHIP_ID_RTM_LM75_1 ); + sdr_insert_entry( TYPE_01, (void *) &SDR_LM75_RTM_3, &vTaskLM75_Handle, 0, CHIP_ID_RTM_LM75_2 ); +#endif + +} diff --git a/port/ucontroller/CMakeLists.txt b/port/ucontroller/CMakeLists.txt index db69c0c41..3ed8ade99 100644 --- a/port/ucontroller/CMakeLists.txt +++ b/port/ucontroller/CMakeLists.txt @@ -14,3 +14,4 @@ endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" PARENT_SCOPE) set(UCONTROLLER_SRCS ${UCONTROLLER_SRCS} PARENT_SCOPE) set(UCONTROLLER_HDRS ${UCONTROLLER_HDRS} PARENT_SCOPE) +set(UCONTROLLER_APP_LD_SCRIPT ${UCONTROLLER_APP_LD_SCRIPT} PARENT_SCOPE) diff --git a/port/ucontroller/nxp/lpc17xx/CMakeLists.txt b/port/ucontroller/nxp/lpc17xx/CMakeLists.txt index b47dfe263..45f3a1147 100644 --- a/port/ucontroller/nxp/lpc17xx/CMakeLists.txt +++ b/port/ucontroller/nxp/lpc17xx/CMakeLists.txt @@ -18,6 +18,7 @@ set(UCONTROLLER_HDRS ) set(LIBLPCOPEN_SRCS + ${LPCOPEN_SRCPATH}/adc_17xx_40xx.c ${LPCOPEN_SRCPATH}/chip_17xx_40xx.c ${LPCOPEN_SRCPATH}/clock_17xx_40xx.c ${LPCOPEN_SRCPATH}/gpio_17xx_40xx.c @@ -68,6 +69,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" PARENT_SCOPE) set(UCONTROLLER_SRCS ${UCONTROLLER_SRCS} PARENT_SCOPE) set(UCONTROLLER_HDRS ${UCONTROLLER_HDRS} PARENT_SCOPE) +set(UCONTROLLER_APP_LD_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/linker/${TARGET_CONTROLLER}_app.ld" PARENT_SCOPE) add_library(lpcopen STATIC ${LIBLPCOPEN_SRCS}) @@ -75,3 +77,5 @@ target_link_libraries(lpcopen PUBLIC FreeRTOS) target_include_directories(lpcopen PUBLIC ${LPCOPEN_INCPATH}) target_include_directories(lpcopen PUBLIC ${LPC17XX_PATH}) target_include_directories(lpcopen PUBLIC ${PROJ_HDRS}) + +add_subdirectory(bootloader) diff --git a/port/ucontroller/nxp/lpc17xx/FreeRTOSConfig.h b/port/ucontroller/nxp/lpc17xx/FreeRTOSConfig.h index e502e6935..54fc3d0dc 100644 --- a/port/ucontroller/nxp/lpc17xx/FreeRTOSConfig.h +++ b/port/ucontroller/nxp/lpc17xx/FreeRTOSConfig.h @@ -76,6 +76,10 @@ licensing and training services. #define configUSE_STATS_FORMATTING_FUNCTIONS 0 #define configAPPLICATION_ALLOCATED_HEAP 1 #define configSUPPORT_DYNAMIC_ALLOCATION 1 +#define configUSE_TIMERS 1 +#define configTIMER_TASK_PRIORITY 5 +#define configTIMER_QUEUE_LENGTH 2 +#define configTIMER_TASK_STACK_DEPTH 128 void vAssertCalled( char* file, uint32_t line); #define configASSERT( x ) if( ( x ) == 0 ) { vAssertCalled( __FILE__, __LINE__ );} diff --git a/port/ucontroller/nxp/lpc17xx/arm_cm3_reset.h b/port/ucontroller/nxp/lpc17xx/arm_cm3_reset.h new file mode 100644 index 000000000..ce1051dc8 --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/arm_cm3_reset.h @@ -0,0 +1,13 @@ +#include "core_cm3.h" + +static inline void mcu_reset(void) +{ + /* Issue a system reset */ + SCB->AIRCR = ((0x5FA << SCB_AIRCR_VECTKEY_Pos) | + (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | + SCB_AIRCR_SYSRESETREQ_Msk); + /* Ensure completion of memory accesses */ + __asm volatile ("dsb"); + /* Wait for the reset */ + while(1); +} diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/.clang_complete b/port/ucontroller/nxp/lpc17xx/bootloader/.clang_complete new file mode 100644 index 000000000..41b1f4958 --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/.clang_complete @@ -0,0 +1 @@ +-I./inc/ \ No newline at end of file diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/CMakeLists.txt b/port/ucontroller/nxp/lpc17xx/bootloader/CMakeLists.txt new file mode 100644 index 000000000..2bf631d9b --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/CMakeLists.txt @@ -0,0 +1,55 @@ +set(BOOTLOADER_INC_PATH ${CMAKE_CURRENT_SOURCE_DIR}/inc) + +set(BOOTLOADER_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/src/lpc17_clock.c + ${CMAKE_CURRENT_SOURCE_DIR}/src/lpc17_iap.c + ${CMAKE_CURRENT_SOURCE_DIR}/src/lpc17_pincfg.c + ${CMAKE_CURRENT_SOURCE_DIR}/src/lpc17_progmem.c + ${CMAKE_CURRENT_SOURCE_DIR}/src/lpc17_uart.c + ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c + ${CMAKE_CURRENT_SOURCE_DIR}/src/start_app.c + ${CMAKE_CURRENT_SOURCE_DIR}/src/startup.s + ) + +set(BOOTLOADER_SRCS ${BOOTLOADER_SRCS} PARENT_SCOPE) +set(BOOTLOADER_INC_PATH ${BOOTLOADER_INC_PATH} PARENT_SCOPE) + +set(COMMON_FLAGS "") +set(CMAKE_C_FLAGS "") +set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") +set(CMAKE_EXE_LINKER_FLAGS "") +set(CMAKE_C_FLAGS_DEBUG "-Og -g3 -DDEBUG") +set(CMAKE_C_FLAGS_RELEASE "-Os") +set(CMAKE_C_FLAGS_RELWITHDEBINFO "-Os -g3") + +set(CMAKE_ASM_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}) +set(CMAKE_ASM_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}) +set(CMAKE_ASM_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO}) + +set(LPC17_BOOT_FLAGS "-fno-tree-loop-distribute-patterns -fno-exceptions -fno-unwind-tables -fdata-sections -ffunction-sections -Wall -mcpu=cortex-m3 -mlittle-endian -mthumb -I \"${BOOTLOADER_INC_PATH}\" -mlong-calls") +set(LPC17_BOOT_LINK_FLAGS "${LPC17_BOOT_FLAGS} -Wl,--gc-sections -nostdlib -nostartfiles -T \"${CMAKE_CURRENT_SOURCE_DIR}/../linker/${TARGET_CONTROLLER}_boot.ld\"") +message(STATUS "LPC17_BOOT_FLAGS: ${LPC17_BOOT_FLAGS}") +message(STATUS "LPC17_BOOT_LINK_FLAGS: ${LPC17_BOOT_LINK_FLAGS}") +message(STATUS "LPC17_FLAGS: ${LPC17_FLAGS}") +add_executable(newboot ${BOOTLOADER_SRCS}) +set_target_properties(newboot PROPERTIES + COMPILE_FLAGS ${LPC17_BOOT_FLAGS} + SUFFIX ".elf" + LINK_FLAGS ${LPC17_BOOT_LINK_FLAGS} + ) +add_custom_command(TARGET newboot POST_BUILD + COMMAND ${CMAKE_OBJCOPY} -O binary newboot.elf newboot.bin + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + COMMENT "Generate a raw binary image of the bootloader" + ) + +##Generate hpm files if bin2hpm is installed + +find_program(BIN2HPM NAMES "bin2hpm") +if(BIN2HPM) + add_custom_command(TARGET newboot POST_BUILD + COMMAND bin2hpm -c 0 -n -m 0x315A -p 0x00 newboot.bin -o newboot.hpm + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + COMMENT "Creating HPM file from binary" + ) +endif() diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/README.md b/port/ucontroller/nxp/lpc17xx/bootloader/README.md new file mode 100644 index 000000000..d72798e6c --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/README.md @@ -0,0 +1,37 @@ +# LPC17xx bootloader (newboot) + +This bootloader is responsible for copying the new firmware image from the firmware update area to the application or bootloader (self-update) area. It shouldn't be confused with the LPC17xx ROM bootloader (firmware programming via serial port). + +## Flash layout + +The flash memory is divided in three regions defined in the linker script for each target. + +LPC1764: +* Bootloader 0x00000000 - 0x00001FFF (8 KiB); +* Application 0x00002000 - 0x000FFFF (56 KiB); +* Firmware update 0x00010000 - 0x0001DFFF (56 KiB); +* New firmware record address: 0x0001DF00. + +LPC1768: +* Bootloader 0x00000000 - 0x00001FFF (8 KiB); +* Application 0x00002000 - 0x0003FFFF (248 KiB); +* Firmware update 0x00040000 - 0x0007DFFF (248 KiB); +* New firmware record address: 0x0007FF00. + +``` +New firmware record: + + +-----------------+-----------------+-----------------+---------------+------------+ + | Major version | Minor version | Build version | Firmware type | Magic word | + | number (1 byte) | number (1 byte) | number (1 byte) | (1 byte) | (4 bytes) | + +-----------------+-----------------+-----------------+---------------+------------+ + +``` + +The bootloader checks if the magic word is equal to 0xAAAAAAAA (firmware update magic word), if it is, the new firmware will be copied from the firmware update region to the application or bootloader region depending on the firmware type (application or bootloader). After finishing the copying, the bootloader will erase the firmware update region. + +The Firmware type byte indicates what to update, (0x01: application, 0x02: bootloader). All flash writing logic is executed from SRAM to allow self updating. + +## Migrating from the older openMMC versions + +newboot is not compatible with openMMC prior version 1.5.0, and the older bootloader doesn't support self update nor openMMC >= 1.5.0, so remote updates via HPM would require a special version of openMMC that updates the bootloader from the application side. This is not done yet, so the only way to safely update the bootloader and openMMC now is via the JTAG/SWD interface. diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/inc/LPC176x5x.h b/port/ucontroller/nxp/lpc17xx/bootloader/inc/LPC176x5x.h new file mode 100644 index 000000000..2e946d43f --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/inc/LPC176x5x.h @@ -0,0 +1,10643 @@ +/* + * Copyright (c) 2009-2019 ARM Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @file lpc17_headers//LPC176x5x.h + * @brief CMSIS HeaderFile + * @version 0.2 + * @date 06. February 2020 + * @note Generated by SVDConv V3.3.27 on Thursday, 06.02.2020 12:13:27 + * from File 'LPC176x5x_v0.2.svd', + */ + + + +/** @addtogroup + * @{ + */ + + +/** @addtogroup LPC176x5x + * @{ + */ + + +#ifndef LPC176X5X_H +#define LPC176X5X_H + +#ifdef __cplusplus +extern "C" { +#endif + + +/** @addtogroup Configuration_of_CMSIS + * @{ + */ + + + +/* =========================================================================================================================== */ +/* ================ Interrupt Number Definition ================ */ +/* =========================================================================================================================== */ + +typedef enum { +/* ======================================= ARM Cortex-M3 Specific Interrupt Numbers ======================================== */ + Reset_IRQn = -15, /*!< -15 Reset Vector, invoked on Power up and warm reset */ + NonMaskableInt_IRQn = -14, /*!< -14 Non maskable Interrupt, cannot be stopped or preempted */ + HardFault_IRQn = -13, /*!< -13 Hard Fault, all classes of Fault */ + MemoryManagement_IRQn = -12, /*!< -12 Memory Management, MPU mismatch, including Access Violation + and No Match */ + BusFault_IRQn = -11, /*!< -11 Bus Fault, Pre-Fetch-, Memory Access Fault, other address/memory + related Fault */ + UsageFault_IRQn = -10, /*!< -10 Usage Fault, i.e. Undef Instruction, Illegal State Transition */ + SVCall_IRQn = -5, /*!< -5 System Service Call via SVC instruction */ + DebugMonitor_IRQn = -4, /*!< -4 Debug Monitor */ + PendSV_IRQn = -2, /*!< -2 Pendable request for system service */ + SysTick_IRQn = -1, /*!< -1 System Tick Timer */ +/* ========================================= LPC176x5x Specific Interrupt Numbers ========================================== */ + WDT_IRQn = 0, /*!< 0 WDT */ + TIMER0_IRQn = 1, /*!< 1 TIMER0 */ + TIMER1_IRQn = 2, /*!< 2 TIMER1 */ + TIMER2_IRQn = 3, /*!< 3 TIMER2 */ + TIMER3_IRQn = 4, /*!< 4 TIMER3 */ + UART0_IRQn = 5, /*!< 5 UART0 */ + UART1_IRQn = 6, /*!< 6 UART1 */ + UART2_IRQn = 7, /*!< 7 UART2 */ + UART3_IRQn = 8, /*!< 8 UART3 */ + PWM1_IRQn = 9, /*!< 9 PWM1 */ + I2C0_IRQn = 10, /*!< 10 I2C0 */ + I2C1_IRQn = 11, /*!< 11 I2C1 */ + I2C2_IRQn = 12, /*!< 12 I2C2 */ + SPI_IRQn = 13, /*!< 13 SPI */ + SSP0_IRQn = 14, /*!< 14 SSP0 */ + SSP1_IRQn = 15, /*!< 15 SSP1 */ + PLL0_IRQn = 16, /*!< 16 PLL0 */ + RTC_IRQn = 17, /*!< 17 RTC */ + EINT0_IRQn = 18, /*!< 18 EINT0 */ + EINT1_IRQn = 19, /*!< 19 EINT1 */ + EINT2_IRQn = 20, /*!< 20 EINT2 */ + EINT3_IRQn = 21, /*!< 21 EINT3 */ + ADC_IRQn = 22, /*!< 22 ADC */ + BOD_IRQn = 23, /*!< 23 BOD */ + USB_IRQn = 24, /*!< 24 USB */ + CAN_IRQn = 25, /*!< 25 CAN */ + DMA_IRQn = 26, /*!< 26 DMA */ + I2S_IRQn = 27, /*!< 27 I2S */ + ENET_IRQn = 28, /*!< 28 ENET */ + RIT_IRQn = 29, /*!< 29 RIT */ + MCPWM_IRQn = 30, /*!< 30 MCPWM */ + QEI_IRQn = 31, /*!< 31 QEI */ + PLL1_IRQn = 32, /*!< 32 PLL1 */ + USBActivity_IRQn = 33, /*!< 33 USBActivity */ + CANActivity_IRQn = 34 /*!< 34 CANActivity */ +} IRQn_Type; + + + +/* =========================================================================================================================== */ +/* ================ Processor and Core Peripheral Section ================ */ +/* =========================================================================================================================== */ + +/* =========================== Configuration of the ARM Cortex-M3 Processor and Core Peripherals =========================== */ +#define __CM3_REV 0x0000U /*!< CM3 Core Revision */ +#define __NVIC_PRIO_BITS 5 /*!< Number of Bits used for Priority Levels */ +#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */ +#define __MPU_PRESENT 1 /*!< MPU present */ +#define __FPU_PRESENT 0 /*!< FPU present */ + + +/** @} */ /* End of group Configuration_of_CMSIS */ + +#include "core_cm3.h" /*!< ARM Cortex-M3 processor and core peripherals */ +// #include "system_LPC176x5x.h" /*!< LPC176x5x System */ + +#ifndef __IM /*!< Fallback for older CMSIS versions */ + #define __IM __I +#endif +#ifndef __OM /*!< Fallback for older CMSIS versions */ + #define __OM __O +#endif +#ifndef __IOM /*!< Fallback for older CMSIS versions */ + #define __IOM __IO +#endif + + +/* ======================================== Start of section using anonymous unions ======================================== */ +#if defined (__CC_ARM) + #pragma push + #pragma anon_unions +#elif defined (__ICCARM__) + #pragma language=extended +#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wc11-extensions" + #pragma clang diagnostic ignored "-Wreserved-id-macro" + #pragma clang diagnostic ignored "-Wgnu-anonymous-struct" + #pragma clang diagnostic ignored "-Wnested-anon-types" +#elif defined (__GNUC__) + /* anonymous unions are enabled by default */ +#elif defined (__TMS470__) + /* anonymous unions are enabled by default */ +#elif defined (__TASKING__) + #pragma warning 586 +#elif defined (__CSMC__) + /* anonymous unions are enabled by default */ +#else + #warning Not supported compiler type +#endif + + +/* =========================================================================================================================== */ +/* ================ Device Specific Peripheral Section ================ */ +/* =========================================================================================================================== */ + + +/** @addtogroup Device_Peripheral_peripherals + * @{ + */ + + + +/* =========================================================================================================================== */ +/* ================ WDT ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief Watchdog Timer (WDT) (WDT) + */ + +typedef struct { /*!< (@ 0x40000000) WDT Structure */ + __IOM uint32_t MOD; /*!< (@ 0x00000000) Watchdog mode register. This register determines + the basic mode and status of the Watchdog + Timer. */ + __IOM uint32_t TC; /*!< (@ 0x00000004) Watchdog timer constant register. The value in + this register determines the time-out value. */ + __OM uint32_t FEED; /*!< (@ 0x00000008) Watchdog feed sequence register. Writing 0xAA + followed by 0x55 to this register reloads + the Watchdog timer with the value contained + in WDTC. */ + __IM uint32_t TV; /*!< (@ 0x0000000C) Watchdog timer value register. This register + reads out the current value of the Watchdog + timer. */ + __IOM uint32_t CLKSEL; /*!< (@ 0x00000010) Watchdog clock select register. */ +} LPC_WDT_Type; /*!< Size = 20 (0x14) */ + + + +/* =========================================================================================================================== */ +/* ================ TIMER0 ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief Timer0/1/2/3 (TIMER0) + */ + +typedef struct { /*!< (@ 0x40004000) TIMER0 Structure */ + __IOM uint32_t IR; /*!< (@ 0x00000000) Interrupt Register. The IR can be written to + clear interrupts. The IR can be read to + identify which of eight possible interrupt + sources are pending. */ + __IOM uint32_t TCR; /*!< (@ 0x00000004) Timer Control Register. The TCR is used to control + the Timer Counter functions. The Timer Counter + can be disabled or reset through the TCR. */ + __IOM uint32_t TC; /*!< (@ 0x00000008) Timer Counter. The 32 bit TC is incremented every + PR+1 cycles of PCLK. The TC is controlled + through the TCR. */ + __IOM uint32_t PR; /*!< (@ 0x0000000C) Prescale Register. When the Prescale Counter + (PC) is equal to this value, the next clock + increments the TC and clears the PC. */ + __IOM uint32_t PC; /*!< (@ 0x00000010) Prescale Counter. The 32 bit PC is a counter + which is incremented to the value stored + in PR. When the value in PR is reached, + the TC is incremented and the PC is cleared. + The PC is observable and controllable through + the bus interface. */ + __IOM uint32_t MCR; /*!< (@ 0x00000014) Match Control Register. The MCR is used to control + if an interrupt is generated and if the + TC is reset when a Match occurs. */ + __IOM uint32_t MR[4]; /*!< (@ 0x00000018) Match Register 0. MR0 can be enabled through + the MCR to reset the TC, stop both the TC + and PC, and/or generate an interrupt every + time MR0 matches the TC. */ + __IOM uint32_t CCR; /*!< (@ 0x00000028) Capture Control Register. The CCR controls which + edges of the capture inputs are used to + load the Capture Registers and whether or + not an interrupt is generated when a capture + takes place. */ + __IM uint32_t CR[2]; /*!< (@ 0x0000002C) Capture Register 0. CR0 is loaded with the value + of TC when there is an event on the CAPn.0 + input. */ + __IM uint32_t RESERVED[2]; + __IOM uint32_t EMR; /*!< (@ 0x0000003C) External Match Register. The EMR controls the + external match pins. */ + __IM uint32_t RESERVED1[12]; + __IOM uint32_t CTCR; /*!< (@ 0x00000070) Count Control Register. The CTCR selects between + Timer and Counter mode, and in Counter mode + selects the signal and edge(s) for counting. */ +} LPC_TIMER0_Type; /*!< Size = 116 (0x74) */ + + + +/* =========================================================================================================================== */ +/* ================ TIMER1 ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief Timer0/1/2/3 (TIMER1) + */ + +typedef struct { /*!< (@ 0x40008000) TIMER1 Structure */ + __IOM uint32_t IR; /*!< (@ 0x00000000) Interrupt Register. The IR can be written to + clear interrupts. The IR can be read to + identify which of eight possible interrupt + sources are pending. */ + __IOM uint32_t TCR; /*!< (@ 0x00000004) Timer Control Register. The TCR is used to control + the Timer Counter functions. The Timer Counter + can be disabled or reset through the TCR. */ + __IOM uint32_t TC; /*!< (@ 0x00000008) Timer Counter. The 32 bit TC is incremented every + PR+1 cycles of PCLK. The TC is controlled + through the TCR. */ + __IOM uint32_t PR; /*!< (@ 0x0000000C) Prescale Register. When the Prescale Counter + (PC) is equal to this value, the next clock + increments the TC and clears the PC. */ + __IOM uint32_t PC; /*!< (@ 0x00000010) Prescale Counter. The 32 bit PC is a counter + which is incremented to the value stored + in PR. When the value in PR is reached, + the TC is incremented and the PC is cleared. + The PC is observable and controllable through + the bus interface. */ + __IOM uint32_t MCR; /*!< (@ 0x00000014) Match Control Register. The MCR is used to control + if an interrupt is generated and if the + TC is reset when a Match occurs. */ + __IOM uint32_t MR[4]; /*!< (@ 0x00000018) Match Register 0. MR0 can be enabled through + the MCR to reset the TC, stop both the TC + and PC, and/or generate an interrupt every + time MR0 matches the TC. */ + __IOM uint32_t CCR; /*!< (@ 0x00000028) Capture Control Register. The CCR controls which + edges of the capture inputs are used to + load the Capture Registers and whether or + not an interrupt is generated when a capture + takes place. */ + __IM uint32_t CR[2]; /*!< (@ 0x0000002C) Capture Register 0. CR0 is loaded with the value + of TC when there is an event on the CAPn.0 + input. */ + __IM uint32_t RESERVED[2]; + __IOM uint32_t EMR; /*!< (@ 0x0000003C) External Match Register. The EMR controls the + external match pins. */ + __IM uint32_t RESERVED1[12]; + __IOM uint32_t CTCR; /*!< (@ 0x00000070) Count Control Register. The CTCR selects between + Timer and Counter mode, and in Counter mode + selects the signal and edge(s) for counting. */ +} LPC_TIMER1_Type; /*!< Size = 116 (0x74) */ + + + +/* =========================================================================================================================== */ +/* ================ UART0 ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief UART0/2/3 (UART0) + */ + +typedef struct { /*!< (@ 0x4000C000) UART0 Structure */ + + union { + __IM uint32_t RBR; /*!< (@ 0x00000000) Receiver Buffer Register. Contains the next received + character to be read (DLAB =0). */ + __OM uint32_t THR; /*!< (@ 0x00000000) Transmit Holding Regiter. The next character + to be transmitted is written here (DLAB + =0). */ + __IOM uint32_t DLL; /*!< (@ 0x00000000) Divisor Latch LSB. Least significant byte of + the baud rate divisor value. The full divisor + is used to generate a baud rate from the + fractional rate divider (DLAB =1). */ + }; + + union { + __IOM uint32_t DLM; /*!< (@ 0x00000004) Divisor Latch MSB. Most significant byte of the + baud rate divisor value. The full divisor + is used to generate a baud rate from the + fractional rate divider (DLAB =1). */ + __IOM uint32_t IER; /*!< (@ 0x00000004) Interrupt Enable Register. Contains individual + interrupt enable bits for the 7 potential + UART interrupts (DLAB =0). */ + }; + + union { + __IM uint32_t IIR; /*!< (@ 0x00000008) Interrupt ID Register. Identifies which interrupt(s) + are pending. */ + __OM uint32_t FCR; /*!< (@ 0x00000008) FIFO Control Register. Controls UART FIFO usage + and modes. */ + }; + __IOM uint32_t LCR; /*!< (@ 0x0000000C) Line Control Register. Contains controls for + frame formatting and break generation. */ + __IM uint32_t RESERVED; + __IM uint32_t LSR; /*!< (@ 0x00000014) Line Status Register. Contains flags for transmit + and receive status, including line errors. */ + __IM uint32_t RESERVED1; + __IOM uint32_t SCR; /*!< (@ 0x0000001C) Scratch Pad Register. 8-bit temporary storage + for software. */ + __IOM uint32_t ACR; /*!< (@ 0x00000020) Auto-baud Control Register. Contains controls + for the auto-baud feature. */ + __IM uint32_t RESERVED2; + __IOM uint32_t FDR; /*!< (@ 0x00000028) Fractional Divider Register. Generates a clock + input for the baud rate divider. */ + __IM uint32_t RESERVED3; + __IOM uint32_t TER; /*!< (@ 0x00000030) Transmit Enable Register. Turns off UART transmitter + for use with software flow control. */ + __IM uint32_t RESERVED4[6]; + __IOM uint32_t RS485CTRL; /*!< (@ 0x0000004C) RS-485/EIA-485 Control. Contains controls to + configure various aspects of RS-485/EIA-485 + modes. */ + __IOM uint32_t RS485ADRMATCH; /*!< (@ 0x00000050) RS-485/EIA-485 address match. Contains the address + match value for RS-485/EIA-485 mode. */ + __IOM uint32_t RS485DLY; /*!< (@ 0x00000054) RS-485/EIA-485 direction control delay. */ +} LPC_UART0_Type; /*!< Size = 88 (0x58) */ + + + +/* =========================================================================================================================== */ +/* ================ UART1 ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief UART1 (UART1) + */ + +typedef struct { /*!< (@ 0x40010000) UART1 Structure */ + + union { + __IM uint32_t RBR; /*!< (@ 0x00000000) DLAB =0 Receiver Buffer Register. Contains the + next received character to be read. */ + __OM uint32_t THR; /*!< (@ 0x00000000) DLAB =0. Transmit Holding Register. The next + character to be transmitted is written here. */ + __IOM uint32_t DLL; /*!< (@ 0x00000000) DLAB =1. Divisor Latch LSB. Least significant + byte of the baud rate divisor value. The + full divisor is used to generate a baud + rate from the fractional rate divider. */ + }; + + union { + __IOM uint32_t DLM; /*!< (@ 0x00000004) DLAB =1. Divisor Latch MSB. Most significant + byte of the baud rate divisor value. The + full divisor is used to generate a baud + rate from the fractional rate divider. */ + __IOM uint32_t IER; /*!< (@ 0x00000004) DLAB =0. Interrupt Enable Register. Contains + individual interrupt enable bits for the + 7 potential UART1 interrupts. */ + }; + + union { + __IM uint32_t IIR; /*!< (@ 0x00000008) Interrupt ID Register. Identifies which interrupt(s) + are pending. */ + __OM uint32_t FCR; /*!< (@ 0x00000008) FIFO Control Register. Controls UART1 FIFO usage + and modes. */ + }; + __IOM uint32_t LCR; /*!< (@ 0x0000000C) Line Control Register. Contains controls for + frame formatting and break generation. */ + __IOM uint32_t MCR; /*!< (@ 0x00000010) Modem Control Register. Contains controls for + flow control handshaking and loopback mode. */ + __IM uint32_t LSR; /*!< (@ 0x00000014) Line Status Register. Contains flags for transmit + and receive status, including line errors. */ + __IM uint32_t MSR; /*!< (@ 0x00000018) Modem Status Register. Contains handshake signal + status flags. */ + __IOM uint32_t SCR; /*!< (@ 0x0000001C) Scratch Pad Register. 8-bit temporary storage + for software. */ + __IOM uint32_t ACR; /*!< (@ 0x00000020) Auto-baud Control Register. Contains controls + for the auto-baud feature. */ + __IM uint32_t RESERVED; + __IOM uint32_t FDR; /*!< (@ 0x00000028) Fractional Divider Register. Generates a clock + input for the baud rate divider. */ + __IM uint32_t RESERVED1; + __IOM uint32_t TER; /*!< (@ 0x00000030) Transmit Enable Register. Turns off UART transmitter + for use with software flow control. */ + __IM uint32_t RESERVED2[6]; + __IOM uint32_t RS485CTRL; /*!< (@ 0x0000004C) RS-485/EIA-485 Control. Contains controls to + configure various aspects of RS-485/EIA-485 + modes. */ + __IOM uint32_t RS485ADRMATCH; /*!< (@ 0x00000050) RS-485/EIA-485 address match. Contains the address + match value for RS-485/EIA-485 mode. */ + __IOM uint32_t RS485DLY; /*!< (@ 0x00000054) RS-485/EIA-485 direction control delay. */ +} LPC_UART1_Type; /*!< Size = 88 (0x58) */ + + + +/* =========================================================================================================================== */ +/* ================ PWM1 ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief Pulse Width Modulators (PWM1) (PWM1) + */ + +typedef struct { /*!< (@ 0x40018000) PWM1 Structure */ + __IOM uint32_t IR; /*!< (@ 0x00000000) Interrupt Register. The IR can be written to + clear interrupts, or read to identify which + PWM interrupt sources are pending. */ + __IOM uint32_t TCR; /*!< (@ 0x00000004) Timer Control Register. The TCR is used to control + the Timer Counter functions. */ + __IOM uint32_t TC; /*!< (@ 0x00000008) Timer Counter. The 32 bit TC is incremented every + PR+1 cycles of PCLK. The TC is controlled + through the TCR. */ + __IOM uint32_t PR; /*!< (@ 0x0000000C) Prescale Register. Determines how often the PWM + counter is incremented. */ + __IOM uint32_t PC; /*!< (@ 0x00000010) Prescale Counter. Prescaler for the main PWM + counter. */ + __IOM uint32_t MCR; /*!< (@ 0x00000014) Match Control Register. The MCR is used to control + whether an interrupt is generated and if + the PWM counter is reset when a Match occurs. */ + __IOM uint32_t MR0; /*!< (@ 0x00000018) Match Register. Match registersare continuously + compared to the PWM counter in order to + control PWMoutput edges. */ + __IOM uint32_t MR1; /*!< (@ 0x0000001C) Match Register. Match registersare continuously + compared to the PWM counter in order to + control PWMoutput edges. */ + __IOM uint32_t MR2; /*!< (@ 0x00000020) Match Register. Match registersare continuously + compared to the PWM counter in order to + control PWMoutput edges. */ + __IOM uint32_t MR3; /*!< (@ 0x00000024) Match Register. Match registersare continuously + compared to the PWM counter in order to + control PWMoutput edges. */ + __IOM uint32_t CCR; /*!< (@ 0x00000028) Capture Control Register. The CCR controls which + edges of the capture inputs are used to + load the Capture Registers and whether or + not an interrupt is generated for a capture + event. */ + __IOM uint32_t CR[2]; /*!< (@ 0x0000002C) PWM Control Register. Enables PWM outputs and + selects either single edge or double edge + controlled PWM outputs. */ + __IM uint32_t RESERVED[3]; + __IOM uint32_t MR4; /*!< (@ 0x00000040) Match Register. Match registersare continuously + compared to the PWM counter in order to + control PWMoutput edges. */ + __IOM uint32_t MR5; /*!< (@ 0x00000044) Match Register. Match registersare continuously + compared to the PWM counter in order to + control PWMoutput edges. */ + __IOM uint32_t MR6; /*!< (@ 0x00000048) Match Register. Match registersare continuously + compared to the PWM counter in order to + control PWMoutput edges. */ + __IOM uint32_t PCR; /*!< (@ 0x0000004C) PWM Control Register. Enables PWM outputs and + selects either single edge or double edge + controlled PWM outputs. */ + __IOM uint32_t LER; /*!< (@ 0x00000050) Load Enable Register. Enables use of updated + PWM match values. */ + __IM uint32_t RESERVED1[7]; + __IOM uint32_t CTCR; /*!< (@ 0x00000070) Count Control Register. The CTCR selects between + Timer and Counter mode, and in Counter mode + selects the signal and edge(s) for counting. */ +} LPC_PWM1_Type; /*!< Size = 116 (0x74) */ + + + +/* =========================================================================================================================== */ +/* ================ I2C0 ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief I2C bus interface (I2C0) + */ + +typedef struct { /*!< (@ 0x4001C000) I2C0 Structure */ + __IOM uint32_t CONSET; /*!< (@ 0x00000000) I2C Control Set Register. When a one is written + to a bit of this register, the corresponding + bit in the I2C control register is set. + Writing a zero has no effect on the corresponding + bit in the I2C control register. */ + __IM uint32_t STAT; /*!< (@ 0x00000004) I2C Status Register. During I2C operation, this + register provides detailed status codes + that allow software to determine the next + action needed. */ + __IOM uint32_t DAT; /*!< (@ 0x00000008) I2C Data Register. During master or slave transmit + mode, data to be transmitted is written + to this register. During master or slave + receive mode, data that has been received + may be read from this register. */ + __IOM uint32_t ADR0; /*!< (@ 0x0000000C) I2C Slave Address Register 0. Contains the 7-bit + slave address for operation of the I2C interface + in slave mode, and is not used in master + mode. The least significant bit determines + whether a slave responds to the General + Call address. */ + __IOM uint32_t SCLH; /*!< (@ 0x00000010) SCH Duty Cycle Register High Half Word. Determines + the high time of the I2C clock. */ + __IOM uint32_t SCLL; /*!< (@ 0x00000014) SCL Duty Cycle Register Low Half Word. Determines + the low time of the I2C clock. SCLL and + SCLH together determine the clock frequency + generated by an I2C master and certain times + used in slave mode. */ + __OM uint32_t CONCLR; /*!< (@ 0x00000018) I2C Control Clear Register. When a one is written + to a bit of this register, the corresponding + bit in the I2C control register is cleared. + Writing a zero has no effect on the corresponding + bit in the I2C control register. */ + __IOM uint32_t MMCTRL; /*!< (@ 0x0000001C) Monitor mode control register. */ + __IOM uint32_t ADR1; /*!< (@ 0x00000020) I2C Slave Address Register. Contains the 7-bit + slave address for operation of the I2C interface + in slave mode, and is not used in master + mode. The least significant bit determines + whether a slave responds to the General + Call address. */ + __IOM uint32_t ADR2; /*!< (@ 0x00000024) I2C Slave Address Register. Contains the 7-bit + slave address for operation of the I2C interface + in slave mode, and is not used in master + mode. The least significant bit determines + whether a slave responds to the General + Call address. */ + __IOM uint32_t ADR3; /*!< (@ 0x00000028) I2C Slave Address Register. Contains the 7-bit + slave address for operation of the I2C interface + in slave mode, and is not used in master + mode. The least significant bit determines + whether a slave responds to the General + Call address. */ + __IM uint32_t DATA_BUFFER; /*!< (@ 0x0000002C) Data buffer register. The contents of the 8 MSBs + of the DAT shift register will be transferred + to the DATA_BUFFER automatically after every + nine bits (8 bits of data plus ACK or NACK) + has been received on the bus. */ + __IOM uint32_t MASK[4]; /*!< (@ 0x00000030) I2C Slave address mask register */ +} LPC_I2C0_Type; /*!< Size = 64 (0x40) */ + + + +/* =========================================================================================================================== */ +/* ================ SPI ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief SPI (SPI) + */ + +typedef struct { /*!< (@ 0x40020000) SPI Structure */ + __IOM uint32_t CR; /*!< (@ 0x00000000) SPI Control Register. This register controls + the operation of the SPI. */ + __IM uint32_t SR; /*!< (@ 0x00000004) SPI Status Register. This register shows the + status of the SPI. */ + __IOM uint32_t DR; /*!< (@ 0x00000008) SPI Data Register. This bi-directional register + provides the transmit and receive data for + the SPI. Transmit data is provided to the + SPI0 by writing to this register. Data received + by the SPI0 can be read from this register. */ + __IOM uint32_t CCR; /*!< (@ 0x0000000C) SPI Clock Counter Register. This register controls + the frequency of a master's SCK0. */ + __IM uint32_t RESERVED[3]; + __IOM uint32_t INT; /*!< (@ 0x0000001C) SPI Interrupt Flag. This register contains the + interrupt flag for the SPI interface. */ +} LPC_SPI_Type; /*!< Size = 32 (0x20) */ + + + +/* =========================================================================================================================== */ +/* ================ RTC ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief Real Time Clock (RTC) (RTC) + */ + +typedef struct { /*!< (@ 0x40024000) RTC Structure */ + __IOM uint32_t ILR; /*!< (@ 0x00000000) Interrupt Location Register */ + __IM uint32_t RESERVED; + __IOM uint32_t CCR; /*!< (@ 0x00000008) Clock Control Register */ + __IOM uint32_t CIIR; /*!< (@ 0x0000000C) Counter Increment Interrupt Register */ + __IOM uint32_t AMR; /*!< (@ 0x00000010) Alarm Mask Register */ + __IM uint32_t CTIME0; /*!< (@ 0x00000014) Consolidated Time Register 0 */ + __IM uint32_t CTIME1; /*!< (@ 0x00000018) Consolidated Time Register 1 */ + __IM uint32_t CTIME2; /*!< (@ 0x0000001C) Consolidated Time Register 2 */ + __IOM uint32_t SEC; /*!< (@ 0x00000020) Seconds Counter */ + __IOM uint32_t MIN; /*!< (@ 0x00000024) Minutes Register */ + __IOM uint32_t HRS; /*!< (@ 0x00000028) Hours Register */ + __IOM uint32_t DOM; /*!< (@ 0x0000002C) Day of Month Register */ + __IOM uint32_t DOW; /*!< (@ 0x00000030) Day of Week Register */ + __IOM uint32_t DOY; /*!< (@ 0x00000034) Day of Year Register */ + __IOM uint32_t MONTH; /*!< (@ 0x00000038) Months Register */ + __IOM uint32_t YEAR; /*!< (@ 0x0000003C) Years Register */ + __IOM uint32_t CALIBRATION; /*!< (@ 0x00000040) Calibration Value Register */ + __IOM uint32_t GPREG0; /*!< (@ 0x00000044) General Purpose Register 0 */ + __IOM uint32_t GPREG1; /*!< (@ 0x00000048) General Purpose Register 0 */ + __IOM uint32_t GPREG2; /*!< (@ 0x0000004C) General Purpose Register 0 */ + __IOM uint32_t GPREG3; /*!< (@ 0x00000050) General Purpose Register 0 */ + __IOM uint32_t GPREG4; /*!< (@ 0x00000054) General Purpose Register 0 */ + __IOM uint32_t RTC_AUXEN; /*!< (@ 0x00000058) RTC Auxiliary Enable register */ + __IOM uint32_t RTC_AUX; /*!< (@ 0x0000005C) RTC Auxiliary control register */ + __IOM uint32_t ASEC; /*!< (@ 0x00000060) Alarm value for Seconds */ + __IOM uint32_t AMIN; /*!< (@ 0x00000064) Alarm value for Minutes */ + __IOM uint32_t AHRS; /*!< (@ 0x00000068) Alarm value for Hours */ + __IOM uint32_t ADOM; /*!< (@ 0x0000006C) Alarm value for Day of Month */ + __IOM uint32_t ADOW; /*!< (@ 0x00000070) Alarm value for Day of Week */ + __IOM uint32_t ADOY; /*!< (@ 0x00000074) Alarm value for Day of Year */ + __IOM uint32_t AMON; /*!< (@ 0x00000078) Alarm value for Months */ + __IOM uint32_t AYRS; /*!< (@ 0x0000007C) Alarm value for Year */ +} LPC_RTC_Type; /*!< Size = 128 (0x80) */ + + + +/* =========================================================================================================================== */ +/* ================ GPIOINT ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief GPIO (GPIOINT) + */ + +typedef struct { /*!< (@ 0x40028080) GPIOINT Structure */ + __IM uint32_t STATUS; /*!< (@ 0x00000000) GPIO overall Interrupt Status. */ + __IM uint32_t STATR0; /*!< (@ 0x00000004) GPIO Interrupt Status for Rising edge for Port + 0. */ + __IM uint32_t STATF0; /*!< (@ 0x00000008) GPIO Interrupt Status for Falling edge for Port + 0. */ + __OM uint32_t CLR0; /*!< (@ 0x0000000C) GPIO Interrupt Clear. */ + __IOM uint32_t ENR0; /*!< (@ 0x00000010) GPIO Interrupt Enable for Rising edge for Port + 0. */ + __IOM uint32_t ENF0; /*!< (@ 0x00000014) GPIO Interrupt Enable for Falling edge for Port + 0. */ + __IM uint32_t RESERVED[3]; + __IM uint32_t STATR2; /*!< (@ 0x00000024) GPIO Interrupt Status for Rising edge for Port + 0. */ + __IM uint32_t STATF2; /*!< (@ 0x00000028) GPIO Interrupt Status for Falling edge for Port + 0. */ + __OM uint32_t CLR2; /*!< (@ 0x0000002C) GPIO Interrupt Clear. */ + __IOM uint32_t ENR2; /*!< (@ 0x00000030) GPIO Interrupt Enable for Rising edge for Port + 0. */ + __IOM uint32_t ENF2; /*!< (@ 0x00000034) GPIO Interrupt Enable for Falling edge for Port + 0. */ +} LPC_GPIOINT_Type; /*!< Size = 56 (0x38) */ + + + +/* =========================================================================================================================== */ +/* ================ PINCONNECT ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief Pin connect block (PINCONNECT) + */ + +typedef struct { /*!< (@ 0x4002C000) PINCONNECT Structure */ + __IOM uint32_t PINSEL0; /*!< (@ 0x00000000) Pin function select register 0. */ + __IOM uint32_t PINSEL1; /*!< (@ 0x00000004) Pin function select register 1. */ + __IOM uint32_t PINSEL2; /*!< (@ 0x00000008) Pin function select register 2. */ + __IOM uint32_t PINSEL3; /*!< (@ 0x0000000C) Pin function select register 3. */ + __IOM uint32_t PINSEL4; /*!< (@ 0x00000010) Pin function select register 4 */ + __IM uint32_t RESERVED[2]; + __IOM uint32_t PINSEL7; /*!< (@ 0x0000001C) Pin function select register 7 */ + __IM uint32_t RESERVED1; + __IOM uint32_t PINSEL9; /*!< (@ 0x00000024) Pin function select register 9 */ + __IOM uint32_t PINSEL10; /*!< (@ 0x00000028) Pin function select register 10 */ + __IM uint32_t RESERVED2[5]; + __IOM uint32_t PINMODE0; /*!< (@ 0x00000040) Pin mode select register 0 */ + __IOM uint32_t PINMODE1; /*!< (@ 0x00000044) Pin mode select register 1 */ + __IOM uint32_t PINMODE2; /*!< (@ 0x00000048) Pin mode select register 2 */ + __IOM uint32_t PINMODE3; /*!< (@ 0x0000004C) Pin mode select register 3. */ + __IOM uint32_t PINMODE4; /*!< (@ 0x00000050) Pin mode select register 4 */ + __IM uint32_t RESERVED3[2]; + __IOM uint32_t PINMODE7; /*!< (@ 0x0000005C) Pin mode select register 7 */ + __IM uint32_t RESERVED4; + __IOM uint32_t PINMODE9; /*!< (@ 0x00000064) Pin mode select register 9 */ + __IOM uint32_t PINMODE_OD0; /*!< (@ 0x00000068) Open drain mode control register 0 */ + __IOM uint32_t PINMODE_OD1; /*!< (@ 0x0000006C) Open drain mode control register 1 */ + __IOM uint32_t PINMODE_OD2; /*!< (@ 0x00000070) Open drain mode control register 2 */ + __IOM uint32_t PINMODE_OD3; /*!< (@ 0x00000074) Open drain mode control register 3 */ + __IOM uint32_t PINMODE_OD4; /*!< (@ 0x00000078) Open drain mode control register 4 */ + __IOM uint32_t I2CPADCFG; /*!< (@ 0x0000007C) I2C Pin Configuration register */ +} LPC_PINCONNECT_Type; /*!< Size = 128 (0x80) */ + + + +/* =========================================================================================================================== */ +/* ================ SSP1 ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief SSP1 controller (SSP1) + */ + +typedef struct { /*!< (@ 0x40030000) SSP1 Structure */ + __IOM uint32_t CR0; /*!< (@ 0x00000000) Control Register 0. Selects the serial clock + rate, bus type, and data size. */ + __IOM uint32_t CR1; /*!< (@ 0x00000004) Control Register 1. Selects master/slave and + other modes. */ + __IOM uint32_t DR; /*!< (@ 0x00000008) Data Register. Writes fill the transmit FIFO, + and reads empty the receive FIFO. */ + __IM uint32_t SR; /*!< (@ 0x0000000C) Status Register */ + __IOM uint32_t CPSR; /*!< (@ 0x00000010) Clock Prescale Register */ + __IOM uint32_t IMSC; /*!< (@ 0x00000014) Interrupt Mask Set and Clear Register */ + __IM uint32_t RIS; /*!< (@ 0x00000018) Raw Interrupt Status Register */ + __IM uint32_t MIS; /*!< (@ 0x0000001C) Masked Interrupt Status Register */ + __OM uint32_t ICR; /*!< (@ 0x00000020) SSPICR Interrupt Clear Register */ + __IOM uint32_t DMACR; /*!< (@ 0x00000024) SSP0 DMA control register */ +} LPC_SSP1_Type; /*!< Size = 40 (0x28) */ + + + +/* =========================================================================================================================== */ +/* ================ ADC ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief Analog-to-Digital Converter (ADC) (ADC) + */ + +typedef struct { /*!< (@ 0x40034000) ADC Structure */ + __IOM uint32_t CR; /*!< (@ 0x00000000) A/D Control Register. The ADCR register must + be written to select the operating mode + before A/D conversion can occur. */ + __IOM uint32_t GDR; /*!< (@ 0x00000004) A/D Global Data Register. This register contains + the ADC's DONE bit and the result of the + most recent A/D conversion. */ + __IM uint32_t RESERVED; + __IOM uint32_t INTEN; /*!< (@ 0x0000000C) A/D Interrupt Enable Register. This register + contains enable bits that allow the DONE + flag of each A/D channel to be included + or excluded from contributing to the generation + of an A/D interrupt. */ + __IM uint32_t DR[8]; /*!< (@ 0x00000010) A/D Channel 0 Data Register. This register contains + the result of the most recent conversion + completed on channel 0. */ + __IM uint32_t STAT; /*!< (@ 0x00000030) A/D Status Register. This register contains DONE + and OVERRUN flags for all of the A/D channels, + as well as the A/D interrupt/DMA flag. */ + __IOM uint32_t TRM; /*!< (@ 0x00000034) ADC trim register. */ +} LPC_ADC_Type; /*!< Size = 56 (0x38) */ + + + +/* =========================================================================================================================== */ +/* ================ CANAFRAM ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief CAN acceptance filter RAM (CANAFRAM) + */ + +typedef struct { /*!< (@ 0x40038000) CANAFRAM Structure */ + __IOM uint32_t MASK[512]; /*!< (@ 0x00000000) CAN AF ram access register */ +} LPC_CANAFRAM_Type; /*!< Size = 2048 (0x800) */ + + + +/* =========================================================================================================================== */ +/* ================ CANAF ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief CAN controller acceptance filter (CANAF) + */ + +typedef struct { /*!< (@ 0x4003C000) CANAF Structure */ + __IOM uint32_t AFMR; /*!< (@ 0x00000000) Acceptance Filter Register */ + __IOM uint32_t SFF_SA; /*!< (@ 0x00000004) Standard Frame Individual Start Address Register */ + __IOM uint32_t SFF_GRP_SA; /*!< (@ 0x00000008) Standard Frame Group Start Address Register */ + __IOM uint32_t EFF_SA; /*!< (@ 0x0000000C) Extended Frame Start Address Register */ + __IOM uint32_t EFF_GRP_SA; /*!< (@ 0x00000010) Extended Frame Group Start Address Register */ + __IOM uint32_t ENDOFTABLE; /*!< (@ 0x00000014) End of AF Tables register */ + __IM uint32_t LUTERRAD; /*!< (@ 0x00000018) LUT Error Address register */ + __IM uint32_t LUTERR; /*!< (@ 0x0000001C) LUT Error Register */ + __IOM uint32_t FCANIE; /*!< (@ 0x00000020) FullCAN interrupt enable register */ + __IOM uint32_t FCANIC0; /*!< (@ 0x00000024) FullCAN interrupt and capture register0 */ + __IOM uint32_t FCANIC1; /*!< (@ 0x00000028) FullCAN interrupt and capture register1 */ +} LPC_CANAF_Type; /*!< Size = 44 (0x2c) */ + + + +/* =========================================================================================================================== */ +/* ================ CCAN ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief Central CAN controller (CCAN) + */ + +typedef struct { /*!< (@ 0x40040000) CCAN Structure */ + __IM uint32_t TXSR; /*!< (@ 0x00000000) CAN Central Transmit Status Register */ + __IM uint32_t RXSR; /*!< (@ 0x00000004) CAN Central Receive Status Register */ + __IM uint32_t MSR; /*!< (@ 0x00000008) CAN Central Miscellaneous Register */ +} LPC_CCAN_Type; /*!< Size = 12 (0xc) */ + + + +/* =========================================================================================================================== */ +/* ================ CAN1 ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief CAN1 controller (CAN1) + */ + +typedef struct { /*!< (@ 0x40044000) CAN1 Structure */ + __IOM uint32_t MOD; /*!< (@ 0x00000000) Controls the operating mode of the CAN Controller. */ + __OM uint32_t CMR; /*!< (@ 0x00000004) Command bits that affect the state of the CAN + Controller */ + __IM uint32_t GSR; /*!< (@ 0x00000008) Global Controller Status and Error Counters. + The error counters can only be written when + RM in CANMOD is 1. */ + __IM uint32_t ICR; /*!< (@ 0x0000000C) Interrupt status, Arbitration Lost Capture, Error + Code Capture */ + __IOM uint32_t IER; /*!< (@ 0x00000010) Interrupt Enable */ + __IOM uint32_t BTR; /*!< (@ 0x00000014) Bus Timing. Can only be written when RM in CANMOD + is 1. */ + __IOM uint32_t EWL; /*!< (@ 0x00000018) Error Warning Limit. Can only be written when + RM in CANMOD is 1. */ + __IM uint32_t SR; /*!< (@ 0x0000001C) Status Register */ + __IOM uint32_t RFS; /*!< (@ 0x00000020) Receive frame status. Can only be written when + RM in CANMOD is 1. */ + __IOM uint32_t RID; /*!< (@ 0x00000024) Received Identifier. Can only be written when + RM in CANMOD is 1. */ + __IOM uint32_t RDA; /*!< (@ 0x00000028) Received data bytes 1-4. Can only be written + when RM in CANMOD is 1. */ + __IOM uint32_t RDB; /*!< (@ 0x0000002C) Received data bytes 5-8. Can only be written + when RM in CANMOD is 1. */ + __IOM uint32_t TFI1; /*!< (@ 0x00000030) Transmitframe info (Tx Buffer ) */ + __IOM uint32_t TID1; /*!< (@ 0x00000034) TransmitIdentifier (Tx Buffer) */ + __IOM uint32_t TDA1; /*!< (@ 0x00000038) Transmitdata bytes 1-4 (Tx Buffer) */ + __IOM uint32_t TDB1; /*!< (@ 0x0000003C) Transmitdata bytes 5-8 (Tx Buffer ) */ + __IOM uint32_t TFI2; /*!< (@ 0x00000040) Transmitframe info (Tx Buffer ) */ + __IOM uint32_t TID2; /*!< (@ 0x00000044) TransmitIdentifier (Tx Buffer) */ + __IOM uint32_t TDA2; /*!< (@ 0x00000048) Transmitdata bytes 1-4 (Tx Buffer) */ + __IOM uint32_t TDB2; /*!< (@ 0x0000004C) Transmitdata bytes 5-8 (Tx Buffer ) */ + __IOM uint32_t TFI3; /*!< (@ 0x00000050) Transmitframe info (Tx Buffer ) */ + __IOM uint32_t TID3; /*!< (@ 0x00000054) TransmitIdentifier (Tx Buffer) */ + __IOM uint32_t TDA3; /*!< (@ 0x00000058) Transmitdata bytes 1-4 (Tx Buffer) */ + __IOM uint32_t TDB3; /*!< (@ 0x0000005C) Transmitdata bytes 5-8 (Tx Buffer ) */ +} LPC_CAN1_Type; /*!< Size = 96 (0x60) */ + + + +/* =========================================================================================================================== */ +/* ================ CAN2 ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief CAN1 controller (CAN2) + */ + +typedef struct { /*!< (@ 0x40048000) CAN2 Structure */ + __IOM uint32_t MOD; /*!< (@ 0x00000000) Controls the operating mode of the CAN Controller. */ + __OM uint32_t CMR; /*!< (@ 0x00000004) Command bits that affect the state of the CAN + Controller */ + __IM uint32_t GSR; /*!< (@ 0x00000008) Global Controller Status and Error Counters. + The error counters can only be written when + RM in CANMOD is 1. */ + __IM uint32_t ICR; /*!< (@ 0x0000000C) Interrupt status, Arbitration Lost Capture, Error + Code Capture */ + __IOM uint32_t IER; /*!< (@ 0x00000010) Interrupt Enable */ + __IOM uint32_t BTR; /*!< (@ 0x00000014) Bus Timing. Can only be written when RM in CANMOD + is 1. */ + __IOM uint32_t EWL; /*!< (@ 0x00000018) Error Warning Limit. Can only be written when + RM in CANMOD is 1. */ + __IM uint32_t SR; /*!< (@ 0x0000001C) Status Register */ + __IOM uint32_t RFS; /*!< (@ 0x00000020) Receive frame status. Can only be written when + RM in CANMOD is 1. */ + __IOM uint32_t RID; /*!< (@ 0x00000024) Received Identifier. Can only be written when + RM in CANMOD is 1. */ + __IOM uint32_t RDA; /*!< (@ 0x00000028) Received data bytes 1-4. Can only be written + when RM in CANMOD is 1. */ + __IOM uint32_t RDB; /*!< (@ 0x0000002C) Received data bytes 5-8. Can only be written + when RM in CANMOD is 1. */ + __IOM uint32_t TFI1; /*!< (@ 0x00000030) Transmitframe info (Tx Buffer ) */ + __IOM uint32_t TID1; /*!< (@ 0x00000034) TransmitIdentifier (Tx Buffer) */ + __IOM uint32_t TDA1; /*!< (@ 0x00000038) Transmitdata bytes 1-4 (Tx Buffer) */ + __IOM uint32_t TDB1; /*!< (@ 0x0000003C) Transmitdata bytes 5-8 (Tx Buffer ) */ + __IOM uint32_t TFI2; /*!< (@ 0x00000040) Transmitframe info (Tx Buffer ) */ + __IOM uint32_t TID2; /*!< (@ 0x00000044) TransmitIdentifier (Tx Buffer) */ + __IOM uint32_t TDA2; /*!< (@ 0x00000048) Transmitdata bytes 1-4 (Tx Buffer) */ + __IOM uint32_t TDB2; /*!< (@ 0x0000004C) Transmitdata bytes 5-8 (Tx Buffer ) */ + __IOM uint32_t TFI3; /*!< (@ 0x00000050) Transmitframe info (Tx Buffer ) */ + __IOM uint32_t TID3; /*!< (@ 0x00000054) TransmitIdentifier (Tx Buffer) */ + __IOM uint32_t TDA3; /*!< (@ 0x00000058) Transmitdata bytes 1-4 (Tx Buffer) */ + __IOM uint32_t TDB3; /*!< (@ 0x0000005C) Transmitdata bytes 5-8 (Tx Buffer ) */ +} LPC_CAN2_Type; /*!< Size = 96 (0x60) */ + + + +/* =========================================================================================================================== */ +/* ================ SSP0 ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief SSP controller (SSP0) + */ + +typedef struct { /*!< (@ 0x40088000) SSP0 Structure */ + __IOM uint32_t CR0; /*!< (@ 0x00000000) Control Register 0. Selects the serial clock + rate, bus type, and data size. */ + __IOM uint32_t CR1; /*!< (@ 0x00000004) Control Register 1. Selects master/slave and + other modes. */ + __IOM uint32_t DR; /*!< (@ 0x00000008) Data Register. Writes fill the transmit FIFO, + and reads empty the receive FIFO. */ + __IM uint32_t SR; /*!< (@ 0x0000000C) Status Register */ + __IOM uint32_t CPSR; /*!< (@ 0x00000010) Clock Prescale Register */ + __IOM uint32_t IMSC; /*!< (@ 0x00000014) Interrupt Mask Set and Clear Register */ + __IM uint32_t RIS; /*!< (@ 0x00000018) Raw Interrupt Status Register */ + __IM uint32_t MIS; /*!< (@ 0x0000001C) Masked Interrupt Status Register */ + __OM uint32_t ICR; /*!< (@ 0x00000020) SSPICR Interrupt Clear Register */ + __IOM uint32_t DMACR; /*!< (@ 0x00000024) SSP0 DMA control register */ +} LPC_SSP0_Type; /*!< Size = 40 (0x28) */ + + + +/* =========================================================================================================================== */ +/* ================ DAC ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief Digital-to-Analog Converter (DAC) (DAC) + */ + +typedef struct { /*!< (@ 0x4008C000) DAC Structure */ + __IOM uint32_t CR; /*!< (@ 0x00000000) D/A Converter Register. This register contains + the digital value to be converted to analog + and a power control bit. */ + __IOM uint32_t CTRL; /*!< (@ 0x00000004) DAC Control register. This register controls + DMA and timer operation. */ + __IOM uint32_t CNTVAL; /*!< (@ 0x00000008) DAC Counter Value register. This register contains + the reload value for the DAC DMA/Interrupt + timer. */ +} LPC_DAC_Type; /*!< Size = 12 (0xc) */ + + + +/* =========================================================================================================================== */ +/* ================ TIMER2 ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief Timer0/1/2/3 (TIMER2) + */ + +typedef struct { /*!< (@ 0x40090000) TIMER2 Structure */ + __IOM uint32_t IR; /*!< (@ 0x00000000) Interrupt Register. The IR can be written to + clear interrupts. The IR can be read to + identify which of eight possible interrupt + sources are pending. */ + __IOM uint32_t TCR; /*!< (@ 0x00000004) Timer Control Register. The TCR is used to control + the Timer Counter functions. The Timer Counter + can be disabled or reset through the TCR. */ + __IOM uint32_t TC; /*!< (@ 0x00000008) Timer Counter. The 32 bit TC is incremented every + PR+1 cycles of PCLK. The TC is controlled + through the TCR. */ + __IOM uint32_t PR; /*!< (@ 0x0000000C) Prescale Register. When the Prescale Counter + (PC) is equal to this value, the next clock + increments the TC and clears the PC. */ + __IOM uint32_t PC; /*!< (@ 0x00000010) Prescale Counter. The 32 bit PC is a counter + which is incremented to the value stored + in PR. When the value in PR is reached, + the TC is incremented and the PC is cleared. + The PC is observable and controllable through + the bus interface. */ + __IOM uint32_t MCR; /*!< (@ 0x00000014) Match Control Register. The MCR is used to control + if an interrupt is generated and if the + TC is reset when a Match occurs. */ + __IOM uint32_t MR[4]; /*!< (@ 0x00000018) Match Register 0. MR0 can be enabled through + the MCR to reset the TC, stop both the TC + and PC, and/or generate an interrupt every + time MR0 matches the TC. */ + __IOM uint32_t CCR; /*!< (@ 0x00000028) Capture Control Register. The CCR controls which + edges of the capture inputs are used to + load the Capture Registers and whether or + not an interrupt is generated when a capture + takes place. */ + __IM uint32_t CR[2]; /*!< (@ 0x0000002C) Capture Register 0. CR0 is loaded with the value + of TC when there is an event on the CAPn.0 + input. */ + __IM uint32_t RESERVED[2]; + __IOM uint32_t EMR; /*!< (@ 0x0000003C) External Match Register. The EMR controls the + external match pins. */ + __IM uint32_t RESERVED1[12]; + __IOM uint32_t CTCR; /*!< (@ 0x00000070) Count Control Register. The CTCR selects between + Timer and Counter mode, and in Counter mode + selects the signal and edge(s) for counting. */ +} LPC_TIMER2_Type; /*!< Size = 116 (0x74) */ + + + +/* =========================================================================================================================== */ +/* ================ TIMER3 ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief Timer0/1/2/3 (TIMER3) + */ + +typedef struct { /*!< (@ 0x40094000) TIMER3 Structure */ + __IOM uint32_t IR; /*!< (@ 0x00000000) Interrupt Register. The IR can be written to + clear interrupts. The IR can be read to + identify which of eight possible interrupt + sources are pending. */ + __IOM uint32_t TCR; /*!< (@ 0x00000004) Timer Control Register. The TCR is used to control + the Timer Counter functions. The Timer Counter + can be disabled or reset through the TCR. */ + __IOM uint32_t TC; /*!< (@ 0x00000008) Timer Counter. The 32 bit TC is incremented every + PR+1 cycles of PCLK. The TC is controlled + through the TCR. */ + __IOM uint32_t PR; /*!< (@ 0x0000000C) Prescale Register. When the Prescale Counter + (PC) is equal to this value, the next clock + increments the TC and clears the PC. */ + __IOM uint32_t PC; /*!< (@ 0x00000010) Prescale Counter. The 32 bit PC is a counter + which is incremented to the value stored + in PR. When the value in PR is reached, + the TC is incremented and the PC is cleared. + The PC is observable and controllable through + the bus interface. */ + __IOM uint32_t MCR; /*!< (@ 0x00000014) Match Control Register. The MCR is used to control + if an interrupt is generated and if the + TC is reset when a Match occurs. */ + __IOM uint32_t MR[4]; /*!< (@ 0x00000018) Match Register 0. MR0 can be enabled through + the MCR to reset the TC, stop both the TC + and PC, and/or generate an interrupt every + time MR0 matches the TC. */ + __IOM uint32_t CCR; /*!< (@ 0x00000028) Capture Control Register. The CCR controls which + edges of the capture inputs are used to + load the Capture Registers and whether or + not an interrupt is generated when a capture + takes place. */ + __IM uint32_t CR[2]; /*!< (@ 0x0000002C) Capture Register 0. CR0 is loaded with the value + of TC when there is an event on the CAPn.0 + input. */ + __IM uint32_t RESERVED[2]; + __IOM uint32_t EMR; /*!< (@ 0x0000003C) External Match Register. The EMR controls the + external match pins. */ + __IM uint32_t RESERVED1[12]; + __IOM uint32_t CTCR; /*!< (@ 0x00000070) Count Control Register. The CTCR selects between + Timer and Counter mode, and in Counter mode + selects the signal and edge(s) for counting. */ +} LPC_TIMER3_Type; /*!< Size = 116 (0x74) */ + + + +/* =========================================================================================================================== */ +/* ================ UART2 ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief UART0/2/3 (UART2) + */ + +typedef struct { /*!< (@ 0x40098000) UART2 Structure */ + + union { + __IM uint32_t RBR; /*!< (@ 0x00000000) Receiver Buffer Register. Contains the next received + character to be read (DLAB =0). */ + __OM uint32_t THR; /*!< (@ 0x00000000) Transmit Holding Regiter. The next character + to be transmitted is written here (DLAB + =0). */ + __IOM uint32_t DLL; /*!< (@ 0x00000000) Divisor Latch LSB. Least significant byte of + the baud rate divisor value. The full divisor + is used to generate a baud rate from the + fractional rate divider (DLAB =1). */ + }; + + union { + __IOM uint32_t DLM; /*!< (@ 0x00000004) Divisor Latch MSB. Most significant byte of the + baud rate divisor value. The full divisor + is used to generate a baud rate from the + fractional rate divider (DLAB =1). */ + __IOM uint32_t IER; /*!< (@ 0x00000004) Interrupt Enable Register. Contains individual + interrupt enable bits for the 7 potential + UART interrupts (DLAB =0). */ + }; + + union { + __IM uint32_t IIR; /*!< (@ 0x00000008) Interrupt ID Register. Identifies which interrupt(s) + are pending. */ + __OM uint32_t FCR; /*!< (@ 0x00000008) FIFO Control Register. Controls UART FIFO usage + and modes. */ + }; + __IOM uint32_t LCR; /*!< (@ 0x0000000C) Line Control Register. Contains controls for + frame formatting and break generation. */ + __IM uint32_t RESERVED; + __IM uint32_t LSR; /*!< (@ 0x00000014) Line Status Register. Contains flags for transmit + and receive status, including line errors. */ + __IM uint32_t RESERVED1; + __IOM uint32_t SCR; /*!< (@ 0x0000001C) Scratch Pad Register. 8-bit temporary storage + for software. */ + __IOM uint32_t ACR; /*!< (@ 0x00000020) Auto-baud Control Register. Contains controls + for the auto-baud feature. */ + __IM uint32_t RESERVED2; + __IOM uint32_t FDR; /*!< (@ 0x00000028) Fractional Divider Register. Generates a clock + input for the baud rate divider. */ + __IM uint32_t RESERVED3; + __IOM uint32_t TER; /*!< (@ 0x00000030) Transmit Enable Register. Turns off UART transmitter + for use with software flow control. */ + __IM uint32_t RESERVED4[6]; + __IOM uint32_t RS485CTRL; /*!< (@ 0x0000004C) RS-485/EIA-485 Control. Contains controls to + configure various aspects of RS-485/EIA-485 + modes. */ + __IOM uint32_t RS485ADRMATCH; /*!< (@ 0x00000050) RS-485/EIA-485 address match. Contains the address + match value for RS-485/EIA-485 mode. */ + __IOM uint32_t RS485DLY; /*!< (@ 0x00000054) RS-485/EIA-485 direction control delay. */ +} LPC_UART2_Type; /*!< Size = 88 (0x58) */ + + + +/* =========================================================================================================================== */ +/* ================ UART3 ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief UART0/2/3 (UART3) + */ + +typedef struct { /*!< (@ 0x4009C000) UART3 Structure */ + + union { + __IM uint32_t RBR; /*!< (@ 0x00000000) Receiver Buffer Register. Contains the next received + character to be read (DLAB =0). */ + __OM uint32_t THR; /*!< (@ 0x00000000) Transmit Holding Regiter. The next character + to be transmitted is written here (DLAB + =0). */ + __IOM uint32_t DLL; /*!< (@ 0x00000000) Divisor Latch LSB. Least significant byte of + the baud rate divisor value. The full divisor + is used to generate a baud rate from the + fractional rate divider (DLAB =1). */ + }; + + union { + __IOM uint32_t DLM; /*!< (@ 0x00000004) Divisor Latch MSB. Most significant byte of the + baud rate divisor value. The full divisor + is used to generate a baud rate from the + fractional rate divider (DLAB =1). */ + __IOM uint32_t IER; /*!< (@ 0x00000004) Interrupt Enable Register. Contains individual + interrupt enable bits for the 7 potential + UART interrupts (DLAB =0). */ + }; + + union { + __IM uint32_t IIR; /*!< (@ 0x00000008) Interrupt ID Register. Identifies which interrupt(s) + are pending. */ + __OM uint32_t FCR; /*!< (@ 0x00000008) FIFO Control Register. Controls UART FIFO usage + and modes. */ + }; + __IOM uint32_t LCR; /*!< (@ 0x0000000C) Line Control Register. Contains controls for + frame formatting and break generation. */ + __IM uint32_t RESERVED; + __IM uint32_t LSR; /*!< (@ 0x00000014) Line Status Register. Contains flags for transmit + and receive status, including line errors. */ + __IM uint32_t RESERVED1; + __IOM uint32_t SCR; /*!< (@ 0x0000001C) Scratch Pad Register. 8-bit temporary storage + for software. */ + __IOM uint32_t ACR; /*!< (@ 0x00000020) Auto-baud Control Register. Contains controls + for the auto-baud feature. */ + __IM uint32_t RESERVED2; + __IOM uint32_t FDR; /*!< (@ 0x00000028) Fractional Divider Register. Generates a clock + input for the baud rate divider. */ + __IM uint32_t RESERVED3; + __IOM uint32_t TER; /*!< (@ 0x00000030) Transmit Enable Register. Turns off UART transmitter + for use with software flow control. */ + __IM uint32_t RESERVED4[6]; + __IOM uint32_t RS485CTRL; /*!< (@ 0x0000004C) RS-485/EIA-485 Control. Contains controls to + configure various aspects of RS-485/EIA-485 + modes. */ + __IOM uint32_t RS485ADRMATCH; /*!< (@ 0x00000050) RS-485/EIA-485 address match. Contains the address + match value for RS-485/EIA-485 mode. */ + __IOM uint32_t RS485DLY; /*!< (@ 0x00000054) RS-485/EIA-485 direction control delay. */ +} LPC_UART3_Type; /*!< Size = 88 (0x58) */ + + + +/* =========================================================================================================================== */ +/* ================ I2S ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief I2S interface (I2S) + */ + +typedef struct { /*!< (@ 0x400A8000) I2S Structure */ + __IOM uint32_t DAO; /*!< (@ 0x00000000) I2S Digital Audio Output Register. Contains control + bits for the I2S transmit channel. */ + __IOM uint32_t DAI; /*!< (@ 0x00000004) I2S Digital Audio Input Register. Contains control + bits for the I2S receive channel. */ + __OM uint32_t TXFIFO; /*!< (@ 0x00000008) I2S Transmit FIFO. Access register for the 8 + x 32-bit transmitter FIFO. */ + __IM uint32_t RXFIFO; /*!< (@ 0x0000000C) I2S Receive FIFO. Access register for the 8 x + 32-bit receiver FIFO. */ + __IM uint32_t STATE; /*!< (@ 0x00000010) I2S Status Feedback Register. Contains status + information about the I2S interface. */ + __IOM uint32_t DMA1; /*!< (@ 0x00000014) I2S DMA Configuration Register 1. Contains control + information for DMA request 1. */ + __IOM uint32_t DMA2; /*!< (@ 0x00000018) I2S DMA Configuration Register 2. Contains control + information for DMA request 2. */ + __IOM uint32_t IRQ; /*!< (@ 0x0000001C) I2S Interrupt Request Control Register. Contains + bits that control how the I2S interrupt + request is generated. */ + __IOM uint32_t TXRATE; /*!< (@ 0x00000020) I2S Transmit MCLK divider. This register determines + the I2S TX MCLK rate by specifying the value + to divide PCLK by in order to produce MCLK. */ + __IOM uint32_t RXRATE; /*!< (@ 0x00000024) I2S Receive MCLK divider. This register determines + the I2S RX MCLK rate by specifying the value + to divide PCLK by in order to produce MCLK. */ + __IOM uint32_t TXBITRATE; /*!< (@ 0x00000028) I2S Transmit bit rate divider. This register + determines the I2S transmit bit rate by + specifying the value to divide TX_MCLK by + in order to produce the transmit bit clock. */ + __IOM uint32_t RXBITRATE; /*!< (@ 0x0000002C) I2S Receive bit rate divider. This register determines + the I2S receive bit rate by specifying the + value to divide RX_MCLK by in order to produce + the receive bit clock. */ + __IOM uint32_t TXMODE; /*!< (@ 0x00000030) I2S Transmit mode control. */ + __IOM uint32_t RXMODE; /*!< (@ 0x00000034) I2S Receive mode control. */ +} LPC_I2S_Type; /*!< Size = 56 (0x38) */ + + + +/* =========================================================================================================================== */ +/* ================ RITIMER ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief Repetitive Interrupt Timer (RIT) (RITIMER) + */ + +typedef struct { /*!< (@ 0x400B0000) RITIMER Structure */ + __IOM uint32_t COMPVAL; /*!< (@ 0x00000000) Compare register */ + __IOM uint32_t MASK; /*!< (@ 0x00000004) Mask register. This register holds the 32-bit + mask value. A 1 written to any bit will + force a compare on the corresponding bit + of the counter and compare register. */ + __IOM uint32_t CTRL; /*!< (@ 0x00000008) Control register. */ + __IOM uint32_t COUNTER; /*!< (@ 0x0000000C) 32-bit counter */ +} LPC_RITIMER_Type; /*!< Size = 16 (0x10) */ + + + +/* =========================================================================================================================== */ +/* ================ MCPWM ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief Motor Control PWM (MCPWM) + */ + +typedef struct { /*!< (@ 0x400B8000) MCPWM Structure */ + __IM uint32_t CON; /*!< (@ 0x00000000) PWM Control read address */ + __OM uint32_t CON_SET; /*!< (@ 0x00000004) PWM Control set address */ + __OM uint32_t CON_CLR; /*!< (@ 0x00000008) PWM Control clear address */ + __IM uint32_t CAPCON; /*!< (@ 0x0000000C) Capture Control read address */ + __OM uint32_t CAPCON_SET; /*!< (@ 0x00000010) Capture Control set address */ + __OM uint32_t CAPCON_CLR; /*!< (@ 0x00000014) Event Control clear address */ + __IOM uint32_t TC[3]; /*!< (@ 0x00000018) Timer Counter register */ + __IOM uint32_t LIM[3]; /*!< (@ 0x00000024) Limit register */ + __IOM uint32_t MAT[3]; /*!< (@ 0x00000030) Match register */ + __IOM uint32_t DT; /*!< (@ 0x0000003C) Dead time register */ + __IOM uint32_t CP; /*!< (@ 0x00000040) Communication Pattern register */ + __IM uint32_t CAP[3]; /*!< (@ 0x00000044) Capture register */ + __IM uint32_t INTEN; /*!< (@ 0x00000050) Interrupt Enable read address */ + __OM uint32_t INTEN_SET; /*!< (@ 0x00000054) Interrupt Enable set address */ + __OM uint32_t INTEN_CLR; /*!< (@ 0x00000058) Interrupt Enable clear address */ + __IM uint32_t CNTCON; /*!< (@ 0x0000005C) Count Control read address */ + __OM uint32_t CNTCON_SET; /*!< (@ 0x00000060) Count Control set address */ + __OM uint32_t CNTCON_CLR; /*!< (@ 0x00000064) Count Control clear address */ + __IM uint32_t INTF; /*!< (@ 0x00000068) Interrupt flags read address */ + __OM uint32_t INTF_SET; /*!< (@ 0x0000006C) Interrupt flags set address */ + __OM uint32_t INTF_CLR; /*!< (@ 0x00000070) Interrupt flags clear address */ + __OM uint32_t CAP_CLR; /*!< (@ 0x00000074) Capture clear address */ +} LPC_MCPWM_Type; /*!< Size = 120 (0x78) */ + + + +/* =========================================================================================================================== */ +/* ================ QEI ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief Quadrature Encoder Interface (QEI) (QEI) + */ + +typedef struct { /*!< (@ 0x400BC000) QEI Structure */ + __OM uint32_t CON; /*!< (@ 0x00000000) Control register */ + __IM uint32_t STAT; /*!< (@ 0x00000004) Status register */ + __IOM uint32_t CONF; /*!< (@ 0x00000008) Configuration register */ + __IM uint32_t POS; /*!< (@ 0x0000000C) Position register */ + __IOM uint32_t MAXPOS; /*!< (@ 0x00000010) Maximum position register */ + __IOM uint32_t CMPOS0; /*!< (@ 0x00000014) Position compare register 0 */ + __IOM uint32_t CMPOS1; /*!< (@ 0x00000018) Position compare register 1 */ + __IOM uint32_t CMPOS2; /*!< (@ 0x0000001C) Position compare register 2 */ + __IM uint32_t INXCNT; /*!< (@ 0x00000020) Index count register 0 */ + __IOM uint32_t INXCMP0; /*!< (@ 0x00000024) Index compare register 0 */ + __IOM uint32_t LOAD; /*!< (@ 0x00000028) Velocity timer reload register */ + __IM uint32_t TIME; /*!< (@ 0x0000002C) Velocity timer register */ + __IM uint32_t VEL; /*!< (@ 0x00000030) Velocity counter register */ + __IM uint32_t CAP; /*!< (@ 0x00000034) Velocity capture register */ + __IOM uint32_t VELCOMP; /*!< (@ 0x00000038) Velocity compare register */ + __IOM uint32_t FILTER; /*!< (@ 0x0000003C) Digital filter register */ + __IM uint32_t RESERVED[998]; + __OM uint32_t IEC; /*!< (@ 0x00000FD8) Interrupt enable clear register */ + __OM uint32_t IES; /*!< (@ 0x00000FDC) Interrupt enable set register */ + __IM uint32_t INTSTAT; /*!< (@ 0x00000FE0) Interrupt status register */ + __IM uint32_t IE; /*!< (@ 0x00000FE4) Interrupt enable register */ + __OM uint32_t CLR; /*!< (@ 0x00000FE8) Interrupt status clear register */ + __OM uint32_t SET; /*!< (@ 0x00000FEC) Interrupt status set register */ +} LPC_QEI_Type; /*!< Size = 4080 (0xff0) */ + + + +/* =========================================================================================================================== */ +/* ================ SYSCON ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief System and clock control (SYSCON) + */ + +typedef struct { /*!< (@ 0x400FC000) SYSCON Structure */ + __IOM uint32_t FLASHCFG; /*!< (@ 0x00000000) Flash Accelerator Configuration Register. Controls + flash access timing. */ + __IM uint32_t RESERVED[31]; + __IOM uint32_t PLL0CON; /*!< (@ 0x00000080) PLL0 Control Register */ + __IOM uint32_t PLL0CFG; /*!< (@ 0x00000084) PLL0 Configuration Register */ + __IM uint32_t PLL0STAT; /*!< (@ 0x00000088) PLL0 Status Register */ + __OM uint32_t PLL0FEED; /*!< (@ 0x0000008C) PLL0 Feed Register */ + __IM uint32_t RESERVED1[4]; + __IOM uint32_t PLL1CON; /*!< (@ 0x000000A0) PLL1 Control Register */ + __IOM uint32_t PLL1CFG; /*!< (@ 0x000000A4) PLL1 Configuration Register */ + __IM uint32_t PLL1STAT; /*!< (@ 0x000000A8) PLL1 Status Register */ + __OM uint32_t PLL1FEED; /*!< (@ 0x000000AC) PLL1 Feed Register */ + __IM uint32_t RESERVED2[4]; + __IOM uint32_t PCON; /*!< (@ 0x000000C0) Power Control Register */ + __IOM uint32_t PCONP; /*!< (@ 0x000000C4) Power Control for Peripherals Register */ + __IM uint32_t RESERVED3[15]; + __IOM uint32_t CCLKCFG; /*!< (@ 0x00000104) CPU Clock Configuration Register */ + __IOM uint32_t USBCLKCFG; /*!< (@ 0x00000108) USB Clock Configuration Register */ + __IOM uint32_t CLKSRCSEL; /*!< (@ 0x0000010C) Clock Source Select Register */ + __IOM uint32_t CANSLEEPCLR; /*!< (@ 0x00000110) Allows clearing the current CAN channel sleep + state as well as reading that state. */ + __IOM uint32_t CANWAKEFLAGS; /*!< (@ 0x00000114) Allows reading the wake-up state of the CAN channels. */ + __IM uint32_t RESERVED4[10]; + __IOM uint32_t EXTINT; /*!< (@ 0x00000140) External Interrupt Flag Register */ + __IM uint32_t RESERVED5; + __IOM uint32_t EXTMODE; /*!< (@ 0x00000148) External Interrupt Mode register */ + __IOM uint32_t EXTPOLAR; /*!< (@ 0x0000014C) External Interrupt Polarity Register */ + __IM uint32_t RESERVED6[12]; + __IOM uint32_t RSID; /*!< (@ 0x00000180) Reset Source Identification Register */ + __IM uint32_t RESERVED7[7]; + __IOM uint32_t SCS; /*!< (@ 0x000001A0) System control and status */ + __IM uint32_t RESERVED8; + __IOM uint32_t PCLKSEL0; /*!< (@ 0x000001A8) Peripheral Clock Selection register 0. */ + __IOM uint32_t PCLKSEL1; /*!< (@ 0x000001AC) Peripheral Clock Selection register 1. */ + __IM uint32_t RESERVED9[4]; + __IOM uint32_t USBINTST; /*!< (@ 0x000001C0) USB Interrupt Status */ + __IOM uint32_t DMACREQSEL; /*!< (@ 0x000001C4) Selects between alternative requests on DMA channels + 0 through 7 and 10 through 15 */ + __IOM uint32_t CLKOUTCFG; /*!< (@ 0x000001C8) Clock Output Configuration Register */ +} LPC_SYSCON_Type; /*!< Size = 460 (0x1cc) */ + + + +/* =========================================================================================================================== */ +/* ================ EMAC ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief Ethernet (EMAC) + */ + +typedef struct { /*!< (@ 0x50000000) EMAC Structure */ + __IOM uint32_t MAC1; /*!< (@ 0x00000000) MAC configuration register 1. */ + __IOM uint32_t MAC2; /*!< (@ 0x00000004) MAC configuration register 2. */ + __IOM uint32_t IPGT; /*!< (@ 0x00000008) Back-to-Back Inter-Packet-Gap register. */ + __IOM uint32_t IPGR; /*!< (@ 0x0000000C) Non Back-to-Back Inter-Packet-Gap register. */ + __IOM uint32_t CLRT; /*!< (@ 0x00000010) Collision window / Retry register. */ + __IOM uint32_t MAXF; /*!< (@ 0x00000014) Maximum Frame register. */ + __IOM uint32_t SUPP; /*!< (@ 0x00000018) PHY Support register. */ + __IOM uint32_t TEST; /*!< (@ 0x0000001C) Test register. */ + __IOM uint32_t MCFG; /*!< (@ 0x00000020) MII Mgmt Configuration register. */ + __IOM uint32_t MCMD; /*!< (@ 0x00000024) MII Mgmt Command register. */ + __IOM uint32_t MADR; /*!< (@ 0x00000028) MII Mgmt Address register. */ + __OM uint32_t MWTD; /*!< (@ 0x0000002C) MII Mgmt Write Data register. */ + __IM uint32_t MRDD; /*!< (@ 0x00000030) MII Mgmt Read Data register. */ + __IM uint32_t MIND; /*!< (@ 0x00000034) MII Mgmt Indicators register. */ + __IM uint32_t RESERVED[2]; + __IOM uint32_t SA0; /*!< (@ 0x00000040) Station Address 0 register. */ + __IOM uint32_t SA1; /*!< (@ 0x00000044) Station Address 1 register. */ + __IOM uint32_t SA2; /*!< (@ 0x00000048) Station Address 2 register. */ + __IM uint32_t RESERVED1[45]; + __IOM uint32_t COMMAND; /*!< (@ 0x00000100) Command register. */ + __IM uint32_t STATUS; /*!< (@ 0x00000104) Status register. */ + __IOM uint32_t RXDESCRIPTOR; /*!< (@ 0x00000108) Receive descriptor base address register. */ + __IOM uint32_t RXSTATUS; /*!< (@ 0x0000010C) Receive status base address register. */ + __IOM uint32_t RXDESCRIPTORNUMBER; /*!< (@ 0x00000110) Receive number of descriptors register. */ + __IM uint32_t RXPRODUCEINDEX; /*!< (@ 0x00000114) Receive produce index register. */ + __IOM uint32_t RXCONSUMEINDEX; /*!< (@ 0x00000118) Receive consume index register. */ + __IOM uint32_t TXDESCRIPTOR; /*!< (@ 0x0000011C) Transmit descriptor base address register. */ + __IOM uint32_t TXSTATUS; /*!< (@ 0x00000120) Transmit status base address register. */ + __IOM uint32_t TXDESCRIPTORNUMBER; /*!< (@ 0x00000124) Transmit number of descriptors register. */ + __IOM uint32_t TXPRODUCEINDEX; /*!< (@ 0x00000128) Transmit produce index register. */ + __IM uint32_t TXCONSUMEINDEX; /*!< (@ 0x0000012C) Transmit consume index register. */ + __IM uint32_t RESERVED2[10]; + __IM uint32_t TSV0; /*!< (@ 0x00000158) Transmit status vector 0 register. */ + __IM uint32_t TSV1; /*!< (@ 0x0000015C) Transmit status vector 1 register. */ + __IM uint32_t RSV; /*!< (@ 0x00000160) Receive status vector register. */ + __IM uint32_t RESERVED3[3]; + __IOM uint32_t FLOWCONTROLCOUNTER; /*!< (@ 0x00000170) Flow control counter register. */ + __IM uint32_t FLOWCONTROLSTATUS; /*!< (@ 0x00000174) Flow control status register. */ + __IM uint32_t RESERVED4[34]; + __IOM uint32_t RXFILTERCTRL; /*!< (@ 0x00000200) Receive filter control register. */ + __IM uint32_t RXFILTERWOLSTATUS; /*!< (@ 0x00000204) Receive filter WoL status register. */ + __OM uint32_t RXFILTERWOLCLEAR; /*!< (@ 0x00000208) Receive filter WoL clear register. */ + __IM uint32_t RESERVED5; + __IOM uint32_t HASHFILTERL; /*!< (@ 0x00000210) Hash filter table LSBs register. */ + __IOM uint32_t HASHFILTERH; /*!< (@ 0x00000214) Hash filter table MSBs register. */ + __IM uint32_t RESERVED6[882]; + __IM uint32_t INTSTATUS; /*!< (@ 0x00000FE0) Interrupt status register. */ + __IOM uint32_t INTENABLE; /*!< (@ 0x00000FE4) Interrupt enable register. */ + __OM uint32_t INTCLEAR; /*!< (@ 0x00000FE8) Interrupt clear register. */ + __OM uint32_t INTSET; /*!< (@ 0x00000FEC) Interrupt set register. */ + __IM uint32_t RESERVED7; + __IOM uint32_t POWERDOWN; /*!< (@ 0x00000FF4) Power-down register. */ +} LPC_EMAC_Type; /*!< Size = 4088 (0xff8) */ + + + +/* =========================================================================================================================== */ +/* ================ GPDMA ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief General purpose DMA controller (GPDMA) + */ + +typedef struct { /*!< (@ 0x50004000) GPDMA Structure */ + __IM uint32_t INTSTAT; /*!< (@ 0x00000000) DMA Interrupt Status Register */ + __IM uint32_t INTTCSTAT; /*!< (@ 0x00000004) DMA Interrupt Terminal Count Request Status Register */ + __OM uint32_t INTTCCLEAR; /*!< (@ 0x00000008) DMA Interrupt Terminal Count Request Clear Register */ + __IM uint32_t INTERRSTAT; /*!< (@ 0x0000000C) DMA Interrupt Error Status Register */ + __OM uint32_t INTERRCLR; /*!< (@ 0x00000010) DMA Interrupt Error Clear Register */ + __IM uint32_t RAWINTTCSTAT; /*!< (@ 0x00000014) DMA Raw Interrupt Terminal Count Status Register */ + __IM uint32_t RAWINTERRSTAT; /*!< (@ 0x00000018) DMA Raw Error Interrupt Status Register */ + __IM uint32_t ENBLDCHNS; /*!< (@ 0x0000001C) DMA Enabled Channel Register */ + __IOM uint32_t SOFTBREQ; /*!< (@ 0x00000020) DMA Software Burst Request Register */ + __IOM uint32_t SOFTSREQ; /*!< (@ 0x00000024) DMA Software Single Request Register */ + __IOM uint32_t SOFTLBREQ; /*!< (@ 0x00000028) DMA Software Last Burst Request Register */ + __IOM uint32_t SOFTLSREQ; /*!< (@ 0x0000002C) DMA Software Last Single Request Register */ + __IOM uint32_t CONFIG; /*!< (@ 0x00000030) DMA Configuration Register */ + __IOM uint32_t SYNC; /*!< (@ 0x00000034) DMA Synchronization Register */ + __IM uint32_t RESERVED[50]; + __IOM uint32_t SRCADDR0; /*!< (@ 0x00000100) DMA Channel 0 Source Address Register */ + __IOM uint32_t DESTADDR0; /*!< (@ 0x00000104) DMA Channel 0 Destination Address Register */ + __IOM uint32_t LLI0; /*!< (@ 0x00000108) DMA Channel 0 Linked List Item Register */ + __IOM uint32_t CONTROL0; /*!< (@ 0x0000010C) DMA Channel 0 Control Register */ + __IOM uint32_t CONFIG0; /*!< (@ 0x00000110) DMA Channel 0 Configuration Register[1] */ + __IM uint32_t RESERVED1[3]; + __IOM uint32_t SRCADDR1; /*!< (@ 0x00000120) DMA Channel 0 Source Address Register */ + __IOM uint32_t DESTADDR1; /*!< (@ 0x00000124) DMA Channel 0 Destination Address Register */ + __IOM uint32_t LLI1; /*!< (@ 0x00000128) DMA Channel 0 Linked List Item Register */ + __IOM uint32_t CONTROL1; /*!< (@ 0x0000012C) DMA Channel 0 Control Register */ + __IOM uint32_t CONFIG1; /*!< (@ 0x00000130) DMA Channel 0 Configuration Register[1] */ + __IM uint32_t RESERVED2[3]; + __IOM uint32_t SRCADDR2; /*!< (@ 0x00000140) DMA Channel 0 Source Address Register */ + __IOM uint32_t DESTADDR2; /*!< (@ 0x00000144) DMA Channel 0 Destination Address Register */ + __IOM uint32_t LLI2; /*!< (@ 0x00000148) DMA Channel 0 Linked List Item Register */ + __IOM uint32_t CONTROL2; /*!< (@ 0x0000014C) DMA Channel 0 Control Register */ + __IOM uint32_t CONFIG2; /*!< (@ 0x00000150) DMA Channel 0 Configuration Register[1] */ + __IM uint32_t RESERVED3[3]; + __IOM uint32_t SRCADDR3; /*!< (@ 0x00000160) DMA Channel 0 Source Address Register */ + __IOM uint32_t DESTADDR3; /*!< (@ 0x00000164) DMA Channel 0 Destination Address Register */ + __IOM uint32_t LLI3; /*!< (@ 0x00000168) DMA Channel 0 Linked List Item Register */ + __IOM uint32_t CONTROL3; /*!< (@ 0x0000016C) DMA Channel 0 Control Register */ + __IOM uint32_t CONFIG3; /*!< (@ 0x00000170) DMA Channel 0 Configuration Register[1] */ + __IM uint32_t RESERVED4[3]; + __IOM uint32_t SRCADDR4; /*!< (@ 0x00000180) DMA Channel 0 Source Address Register */ + __IOM uint32_t DESTADDR4; /*!< (@ 0x00000184) DMA Channel 0 Destination Address Register */ + __IOM uint32_t LLI4; /*!< (@ 0x00000188) DMA Channel 0 Linked List Item Register */ + __IOM uint32_t CONTROL4; /*!< (@ 0x0000018C) DMA Channel 0 Control Register */ + __IOM uint32_t CONFIG4; /*!< (@ 0x00000190) DMA Channel 0 Configuration Register[1] */ + __IM uint32_t RESERVED5[3]; + __IOM uint32_t SRCADDR5; /*!< (@ 0x000001A0) DMA Channel 0 Source Address Register */ + __IOM uint32_t DESTADDR5; /*!< (@ 0x000001A4) DMA Channel 0 Destination Address Register */ + __IOM uint32_t LLI5; /*!< (@ 0x000001A8) DMA Channel 0 Linked List Item Register */ + __IOM uint32_t CONTROL5; /*!< (@ 0x000001AC) DMA Channel 0 Control Register */ + __IOM uint32_t CONFIG5; /*!< (@ 0x000001B0) DMA Channel 0 Configuration Register[1] */ + __IM uint32_t RESERVED6[3]; + __IOM uint32_t SRCADDR6; /*!< (@ 0x000001C0) DMA Channel 0 Source Address Register */ + __IOM uint32_t DESTADDR6; /*!< (@ 0x000001C4) DMA Channel 0 Destination Address Register */ + __IOM uint32_t LLI6; /*!< (@ 0x000001C8) DMA Channel 0 Linked List Item Register */ + __IOM uint32_t CONTROL6; /*!< (@ 0x000001CC) DMA Channel 0 Control Register */ + __IOM uint32_t CONFIG6; /*!< (@ 0x000001D0) DMA Channel 0 Configuration Register[1] */ + __IM uint32_t RESERVED7[3]; + __IOM uint32_t SRCADDR7; /*!< (@ 0x000001E0) DMA Channel 0 Source Address Register */ + __IOM uint32_t DESTADDR7; /*!< (@ 0x000001E4) DMA Channel 0 Destination Address Register */ + __IOM uint32_t LLI7; /*!< (@ 0x000001E8) DMA Channel 0 Linked List Item Register */ + __IOM uint32_t CONTROL7; /*!< (@ 0x000001EC) DMA Channel 0 Control Register */ + __IOM uint32_t CONFIG7; /*!< (@ 0x000001F0) DMA Channel 0 Configuration Register[1] */ +} LPC_GPDMA_Type; /*!< Size = 500 (0x1f4) */ + + + +/* =========================================================================================================================== */ +/* ================ USB ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief USB device/host/OTG controller (USB) + */ + +typedef struct { /*!< (@ 0x50008000) USB Structure */ + __IM uint32_t RESERVED[55]; + __IM uint32_t RXPLEN; /*!< (@ 0x000000DC) USB Receive Packet Length */ + __IM uint32_t RESERVED1[8]; + __IM uint32_t INTST; /*!< (@ 0x00000100) OTG Interrupt Status */ + __IOM uint32_t INTEN; /*!< (@ 0x00000104) OTG Interrupt Enable */ + __OM uint32_t INTSET; /*!< (@ 0x00000108) OTG Interrupt Set */ + __OM uint32_t INTCLR; /*!< (@ 0x0000010C) OTG Interrupt Clear */ + __IOM uint32_t STCTRL; /*!< (@ 0x00000110) OTG Status and Control and USB port select */ + __IOM uint32_t TMR; /*!< (@ 0x00000114) OTG Timer */ + __IM uint32_t RESERVED2[58]; + __IM uint32_t DEVINTST; /*!< (@ 0x00000200) USB Device Interrupt Status */ + __IOM uint32_t DEVINTEN; /*!< (@ 0x00000204) USB Device Interrupt Enable */ + __OM uint32_t DEVINTCLR; /*!< (@ 0x00000208) USB Device Interrupt Clear */ + __OM uint32_t DEVINTSET; /*!< (@ 0x0000020C) USB Device Interrupt Set */ + __OM uint32_t CMDCODE; /*!< (@ 0x00000210) USB Command Code */ + __IM uint32_t CMDDATA; /*!< (@ 0x00000214) USB Command Data */ + __IM uint32_t RXDATA; /*!< (@ 0x00000218) USB Receive Data */ + __OM uint32_t TXDATA; /*!< (@ 0x0000021C) USB Transmit Data */ + __IM uint32_t RESERVED3; + __OM uint32_t TXPLEN; /*!< (@ 0x00000224) USB Transmit Packet Length */ + __IOM uint32_t CTRL; /*!< (@ 0x00000228) USB Control */ + __OM uint32_t DEVINTPRI; /*!< (@ 0x0000022C) USB Device Interrupt Priority */ + __IM uint32_t EPINTST; /*!< (@ 0x00000230) USB Endpoint Interrupt Status */ + __IOM uint32_t EPINTEN; /*!< (@ 0x00000234) USB Endpoint Interrupt Enable */ + __OM uint32_t EPINTCLR; /*!< (@ 0x00000238) USB Endpoint Interrupt Clear */ + __OM uint32_t EPINTSET; /*!< (@ 0x0000023C) USB Endpoint Interrupt Set */ + __OM uint32_t EPINTPRI; /*!< (@ 0x00000240) USB Endpoint Priority */ + __IOM uint32_t REEP; /*!< (@ 0x00000244) USB Realize Endpoint */ + __OM uint32_t EPIND; /*!< (@ 0x00000248) USB Endpoint Index */ + __IOM uint32_t MAXPSIZE; /*!< (@ 0x0000024C) USB MaxPacketSize */ + __IM uint32_t DMARST; /*!< (@ 0x00000250) USB DMA Request Status */ + __OM uint32_t DMARCLR; /*!< (@ 0x00000254) USB DMA Request Clear */ + __OM uint32_t DMARSET; /*!< (@ 0x00000258) USB DMA Request Set */ + __IM uint32_t RESERVED4[9]; + __IOM uint32_t UDCAH; /*!< (@ 0x00000280) USB UDCA Head */ + __IM uint32_t EPDMAST; /*!< (@ 0x00000284) USB Endpoint DMA Status */ + __OM uint32_t EPDMAEN; /*!< (@ 0x00000288) USB Endpoint DMA Enable */ + __OM uint32_t EPDMADIS; /*!< (@ 0x0000028C) USB Endpoint DMA Disable */ + __IM uint32_t DMAINTST; /*!< (@ 0x00000290) USB DMA Interrupt Status */ + __IOM uint32_t DMAINTEN; /*!< (@ 0x00000294) USB DMA Interrupt Enable */ + __IM uint32_t RESERVED5[2]; + __IM uint32_t EOTINTST; /*!< (@ 0x000002A0) USB End of Transfer Interrupt Status */ + __OM uint32_t EOTINTCLR; /*!< (@ 0x000002A4) USB End of Transfer Interrupt Clear */ + __OM uint32_t EOTINTSET; /*!< (@ 0x000002A8) USB End of Transfer Interrupt Set */ + __IM uint32_t NDDRINTST; /*!< (@ 0x000002AC) USB New DD Request Interrupt Status */ + __OM uint32_t NDDRINTCLR; /*!< (@ 0x000002B0) USB New DD Request Interrupt Clear */ + __OM uint32_t NDDRINTSET; /*!< (@ 0x000002B4) USB New DD Request Interrupt Set */ + __IM uint32_t SYSERRINTST; /*!< (@ 0x000002B8) USB System Error Interrupt Status */ + __OM uint32_t SYSERRINTCLR; /*!< (@ 0x000002BC) USB System Error Interrupt Clear */ + __OM uint32_t SYSERRINTSET; /*!< (@ 0x000002C0) USB System Error Interrupt Set */ + __IM uint32_t RESERVED6[15]; + + union { + __IM uint32_t I2C_RX; /*!< (@ 0x00000300) I2C Receive */ + __OM uint32_t I2C_WO; /*!< (@ 0x00000300) I2C Transmit */ + }; + __IM uint32_t I2C_STS; /*!< (@ 0x00000304) I2C Status */ + __IOM uint32_t I2C_CTL; /*!< (@ 0x00000308) I2C Control */ + __IOM uint32_t I2C_CLKHI; /*!< (@ 0x0000030C) I2C Clock High */ + __OM uint32_t I2C_CLKLO; /*!< (@ 0x00000310) I2C Clock Low */ + __IM uint32_t RESERVED7[824]; + + union { + __IOM uint32_t USBCLKCTRL; /*!< (@ 0x00000FF4) USB Clock Control */ + __IOM uint32_t OTGCLKCTRL; /*!< (@ 0x00000FF4) OTG clock controller */ + }; + + union { + __IM uint32_t USBCLKST; /*!< (@ 0x00000FF8) USB Clock Status */ + __IM uint32_t OTGCLKST; /*!< (@ 0x00000FF8) OTG clock status */ + }; +} LPC_USB_Type; /*!< Size = 4092 (0xffc) */ + + + +/* =========================================================================================================================== */ +/* ================ GPIO ================ */ +/* =========================================================================================================================== */ + + +/** + * @brief General Purpose I/O (GPIO) + */ + +typedef struct { /*!< (@ 0x2009C000) GPIO Structure */ + __IOM uint32_t DIR0; /*!< (@ 0x00000000) GPIO Port Direction control register. */ + __IM uint32_t RESERVED[3]; + __IOM uint32_t MASK0; /*!< (@ 0x00000010) Mask register for Port. */ + __IOM uint32_t PIN0; /*!< (@ 0x00000014) Port Pin value register using FIOMASK. */ + __IOM uint32_t SET0; /*!< (@ 0x00000018) Port Output Set register using FIOMASK. */ + __OM uint32_t CLR0; /*!< (@ 0x0000001C) Port Output Clear register using FIOMASK. */ + __IOM uint32_t DIR1; /*!< (@ 0x00000020) GPIO Port Direction control register. */ + __IM uint32_t RESERVED1[3]; + __IOM uint32_t MASK1; /*!< (@ 0x00000030) Mask register for Port. */ + __IOM uint32_t PIN1; /*!< (@ 0x00000034) Port Pin value register using FIOMASK. */ + __IOM uint32_t SET1; /*!< (@ 0x00000038) Port Output Set register using FIOMASK. */ + __OM uint32_t CLR1; /*!< (@ 0x0000003C) Port Output Clear register using FIOMASK. */ + __IOM uint32_t DIR2; /*!< (@ 0x00000040) GPIO Port Direction control register. */ + __IM uint32_t RESERVED2[3]; + __IOM uint32_t MASK2; /*!< (@ 0x00000050) Mask register for Port. */ + __IOM uint32_t PIN2; /*!< (@ 0x00000054) Port Pin value register using FIOMASK. */ + __IOM uint32_t SET2; /*!< (@ 0x00000058) Port Output Set register using FIOMASK. */ + __OM uint32_t CLR2; /*!< (@ 0x0000005C) Port Output Clear register using FIOMASK. */ + __IOM uint32_t DIR3; /*!< (@ 0x00000060) GPIO Port Direction control register. */ + __IM uint32_t RESERVED3[3]; + __IOM uint32_t MASK3; /*!< (@ 0x00000070) Mask register for Port. */ + __IOM uint32_t PIN3; /*!< (@ 0x00000074) Port Pin value register using FIOMASK. */ + __IOM uint32_t SET3; /*!< (@ 0x00000078) Port Output Set register using FIOMASK. */ + __OM uint32_t CLR3; /*!< (@ 0x0000007C) Port Output Clear register using FIOMASK. */ + __IOM uint32_t DIR4; /*!< (@ 0x00000080) GPIO Port Direction control register. */ + __IM uint32_t RESERVED4[3]; + __IOM uint32_t MASK4; /*!< (@ 0x00000090) Mask register for Port. */ + __IOM uint32_t PIN4; /*!< (@ 0x00000094) Port Pin value register using FIOMASK. */ + __IOM uint32_t SET4; /*!< (@ 0x00000098) Port Output Set register using FIOMASK. */ + __OM uint32_t CLR4; /*!< (@ 0x0000009C) Port Output Clear register using FIOMASK. */ +} LPC_GPIO_Type; /*!< Size = 160 (0xa0) */ + + +/** @} */ /* End of group Device_Peripheral_peripherals */ + + +/* =========================================================================================================================== */ +/* ================ Device Specific Peripheral Address Map ================ */ +/* =========================================================================================================================== */ + + +/** @addtogroup Device_Peripheral_peripheralAddr + * @{ + */ + +#define LPC_WDT_BASE 0x40000000UL +#define LPC_TIMER0_BASE 0x40004000UL +#define LPC_TIMER1_BASE 0x40008000UL +#define LPC_UART0_BASE 0x4000C000UL +#define LPC_UART1_BASE 0x40010000UL +#define LPC_PWM1_BASE 0x40018000UL +#define LPC_I2C0_BASE 0x4001C000UL +#define LPC_SPI_BASE 0x40020000UL +#define LPC_RTC_BASE 0x40024000UL +#define LPC_GPIOINT_BASE 0x40028080UL +#define LPC_PINCONNECT_BASE 0x4002C000UL +#define LPC_SSP1_BASE 0x40030000UL +#define LPC_ADC_BASE 0x40034000UL +#define LPC_CANAFRAM_BASE 0x40038000UL +#define LPC_CANAF_BASE 0x4003C000UL +#define LPC_CCAN_BASE 0x40040000UL +#define LPC_CAN1_BASE 0x40044000UL +#define LPC_CAN2_BASE 0x40048000UL +#define LPC_I2C1_BASE 0x4005C000UL +#define LPC_SSP0_BASE 0x40088000UL +#define LPC_DAC_BASE 0x4008C000UL +#define LPC_TIMER2_BASE 0x40090000UL +#define LPC_TIMER3_BASE 0x40094000UL +#define LPC_UART2_BASE 0x40098000UL +#define LPC_UART3_BASE 0x4009C000UL +#define LPC_I2C2_BASE 0x400A0000UL +#define LPC_I2S_BASE 0x400A8000UL +#define LPC_RITIMER_BASE 0x400B0000UL +#define LPC_MCPWM_BASE 0x400B8000UL +#define LPC_QEI_BASE 0x400BC000UL +#define LPC_SYSCON_BASE 0x400FC000UL +#define LPC_EMAC_BASE 0x50000000UL +#define LPC_GPDMA_BASE 0x50004000UL +#define LPC_USB_BASE 0x50008000UL +#define LPC_GPIO_BASE 0x2009C000UL + +/** @} */ /* End of group Device_Peripheral_peripheralAddr */ + + +/* =========================================================================================================================== */ +/* ================ Peripheral declaration ================ */ +/* =========================================================================================================================== */ + + +/** @addtogroup Device_Peripheral_declaration + * @{ + */ + +#define LPC_WDT ((LPC_WDT_Type*) LPC_WDT_BASE) +#define LPC_TIMER0 ((LPC_TIMER0_Type*) LPC_TIMER0_BASE) +#define LPC_TIMER1 ((LPC_TIMER1_Type*) LPC_TIMER1_BASE) +#define LPC_UART0 ((LPC_UART0_Type*) LPC_UART0_BASE) +#define LPC_UART1 ((LPC_UART1_Type*) LPC_UART1_BASE) +#define LPC_PWM1 ((LPC_PWM1_Type*) LPC_PWM1_BASE) +#define LPC_I2C0 ((LPC_I2C0_Type*) LPC_I2C0_BASE) +#define LPC_SPI ((LPC_SPI_Type*) LPC_SPI_BASE) +#define LPC_RTC ((LPC_RTC_Type*) LPC_RTC_BASE) +#define LPC_GPIOINT ((LPC_GPIOINT_Type*) LPC_GPIOINT_BASE) +#define LPC_PINCONNECT ((LPC_PINCONNECT_Type*) LPC_PINCONNECT_BASE) +#define LPC_SSP1 ((LPC_SSP1_Type*) LPC_SSP1_BASE) +#define LPC_ADC ((LPC_ADC_Type*) LPC_ADC_BASE) +#define LPC_CANAFRAM ((LPC_CANAFRAM_Type*) LPC_CANAFRAM_BASE) +#define LPC_CANAF ((LPC_CANAF_Type*) LPC_CANAF_BASE) +#define LPC_CCAN ((LPC_CCAN_Type*) LPC_CCAN_BASE) +#define LPC_CAN1 ((LPC_CAN1_Type*) LPC_CAN1_BASE) +#define LPC_CAN2 ((LPC_CAN2_Type*) LPC_CAN2_BASE) +#define LPC_I2C1 ((LPC_I2C0_Type*) LPC_I2C1_BASE) +#define LPC_SSP0 ((LPC_SSP0_Type*) LPC_SSP0_BASE) +#define LPC_DAC ((LPC_DAC_Type*) LPC_DAC_BASE) +#define LPC_TIMER2 ((LPC_TIMER2_Type*) LPC_TIMER2_BASE) +#define LPC_TIMER3 ((LPC_TIMER3_Type*) LPC_TIMER3_BASE) +#define LPC_UART2 ((LPC_UART2_Type*) LPC_UART2_BASE) +#define LPC_UART3 ((LPC_UART3_Type*) LPC_UART3_BASE) +#define LPC_I2C2 ((LPC_I2C0_Type*) LPC_I2C2_BASE) +#define LPC_I2S ((LPC_I2S_Type*) LPC_I2S_BASE) +#define LPC_RITIMER ((LPC_RITIMER_Type*) LPC_RITIMER_BASE) +#define LPC_MCPWM ((LPC_MCPWM_Type*) LPC_MCPWM_BASE) +#define LPC_QEI ((LPC_QEI_Type*) LPC_QEI_BASE) +#define LPC_SYSCON ((LPC_SYSCON_Type*) LPC_SYSCON_BASE) +#define LPC_EMAC ((LPC_EMAC_Type*) LPC_EMAC_BASE) +#define LPC_GPDMA ((LPC_GPDMA_Type*) LPC_GPDMA_BASE) +#define LPC_USB ((LPC_USB_Type*) LPC_USB_BASE) +#define LPC_GPIO ((LPC_GPIO_Type*) LPC_GPIO_BASE) + +/** @} */ /* End of group Device_Peripheral_declaration */ + + +/* ========================================= End of section using anonymous unions ========================================= */ +#if defined (__CC_ARM) + #pragma pop +#elif defined (__ICCARM__) + /* leave anonymous unions enabled */ +#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #pragma clang diagnostic pop +#elif defined (__GNUC__) + /* anonymous unions are enabled by default */ +#elif defined (__TMS470__) + /* anonymous unions are enabled by default */ +#elif defined (__TASKING__) + #pragma warning restore +#elif defined (__CSMC__) + /* anonymous unions are enabled by default */ +#endif + + +/* =========================================================================================================================== */ +/* ================ Pos/Mask Peripheral Section ================ */ +/* =========================================================================================================================== */ + + +/** @addtogroup PosMask_peripherals + * @{ + */ + + + +/* =========================================================================================================================== */ +/* ================ LPC_WDT ================ */ +/* =========================================================================================================================== */ + +/* ========================================================== MOD ========================================================== */ +#define WDT_MOD_WDEN_Pos (0UL) /*!< WDEN (Bit 0) */ +#define WDT_MOD_WDEN_Msk (0x1UL) /*!< WDEN (Bitfield-Mask: 0x01) */ +#define WDT_MOD_WDRESET_Pos (1UL) /*!< WDRESET (Bit 1) */ +#define WDT_MOD_WDRESET_Msk (0x2UL) /*!< WDRESET (Bitfield-Mask: 0x01) */ +#define WDT_MOD_WDTOF_Pos (2UL) /*!< WDTOF (Bit 2) */ +#define WDT_MOD_WDTOF_Msk (0x4UL) /*!< WDTOF (Bitfield-Mask: 0x01) */ +#define WDT_MOD_WDINT_Pos (3UL) /*!< WDINT (Bit 3) */ +#define WDT_MOD_WDINT_Msk (0x8UL) /*!< WDINT (Bitfield-Mask: 0x01) */ +/* ========================================================== TC =========================================================== */ +#define WDT_TC_Count_Pos (0UL) /*!< Count (Bit 0) */ +#define WDT_TC_Count_Msk (0xffffffffUL) /*!< Count (Bitfield-Mask: 0xffffffff) */ +/* ========================================================= FEED ========================================================== */ +#define WDT_FEED_Feed_Pos (0UL) /*!< Feed (Bit 0) */ +#define WDT_FEED_Feed_Msk (0xffUL) /*!< Feed (Bitfield-Mask: 0xff) */ +/* ========================================================== TV =========================================================== */ +#define WDT_TV_Count_Pos (0UL) /*!< Count (Bit 0) */ +#define WDT_TV_Count_Msk (0xffffffffUL) /*!< Count (Bitfield-Mask: 0xffffffff) */ +/* ======================================================== CLKSEL ========================================================= */ +#define WDT_CLKSEL_CLKSEL_Pos (0UL) /*!< CLKSEL (Bit 0) */ +#define WDT_CLKSEL_CLKSEL_Msk (0x3UL) /*!< CLKSEL (Bitfield-Mask: 0x03) */ +#define WDT_CLKSEL_LOCK_Pos (31UL) /*!< LOCK (Bit 31) */ +#define WDT_CLKSEL_LOCK_Msk (0x80000000UL) /*!< LOCK (Bitfield-Mask: 0x01) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_TIMER0 ================ */ +/* =========================================================================================================================== */ + +/* ========================================================== IR =========================================================== */ +#define TIMER0_IR_MR0INT_Pos (0UL) /*!< MR0INT (Bit 0) */ +#define TIMER0_IR_MR0INT_Msk (0x1UL) /*!< MR0INT (Bitfield-Mask: 0x01) */ +#define TIMER0_IR_MR1INT_Pos (1UL) /*!< MR1INT (Bit 1) */ +#define TIMER0_IR_MR1INT_Msk (0x2UL) /*!< MR1INT (Bitfield-Mask: 0x01) */ +#define TIMER0_IR_MR2INT_Pos (2UL) /*!< MR2INT (Bit 2) */ +#define TIMER0_IR_MR2INT_Msk (0x4UL) /*!< MR2INT (Bitfield-Mask: 0x01) */ +#define TIMER0_IR_MR3INT_Pos (3UL) /*!< MR3INT (Bit 3) */ +#define TIMER0_IR_MR3INT_Msk (0x8UL) /*!< MR3INT (Bitfield-Mask: 0x01) */ +#define TIMER0_IR_CR0INT_Pos (4UL) /*!< CR0INT (Bit 4) */ +#define TIMER0_IR_CR0INT_Msk (0x10UL) /*!< CR0INT (Bitfield-Mask: 0x01) */ +#define TIMER0_IR_CR1INT_Pos (5UL) /*!< CR1INT (Bit 5) */ +#define TIMER0_IR_CR1INT_Msk (0x20UL) /*!< CR1INT (Bitfield-Mask: 0x01) */ +/* ========================================================== TCR ========================================================== */ +#define TIMER0_TCR_CEN_Pos (0UL) /*!< CEN (Bit 0) */ +#define TIMER0_TCR_CEN_Msk (0x1UL) /*!< CEN (Bitfield-Mask: 0x01) */ +#define TIMER0_TCR_CRST_Pos (1UL) /*!< CRST (Bit 1) */ +#define TIMER0_TCR_CRST_Msk (0x2UL) /*!< CRST (Bitfield-Mask: 0x01) */ +/* ========================================================== TC =========================================================== */ +#define TIMER0_TC_TC_Pos (0UL) /*!< TC (Bit 0) */ +#define TIMER0_TC_TC_Msk (0xffffffffUL) /*!< TC (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== PR =========================================================== */ +#define TIMER0_PR_PM_Pos (0UL) /*!< PM (Bit 0) */ +#define TIMER0_PR_PM_Msk (0xffffffffUL) /*!< PM (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== PC =========================================================== */ +#define TIMER0_PC_PC_Pos (0UL) /*!< PC (Bit 0) */ +#define TIMER0_PC_PC_Msk (0xffffffffUL) /*!< PC (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== MCR ========================================================== */ +#define TIMER0_MCR_MR0I_Pos (0UL) /*!< MR0I (Bit 0) */ +#define TIMER0_MCR_MR0I_Msk (0x1UL) /*!< MR0I (Bitfield-Mask: 0x01) */ +#define TIMER0_MCR_MR0R_Pos (1UL) /*!< MR0R (Bit 1) */ +#define TIMER0_MCR_MR0R_Msk (0x2UL) /*!< MR0R (Bitfield-Mask: 0x01) */ +#define TIMER0_MCR_MR0S_Pos (2UL) /*!< MR0S (Bit 2) */ +#define TIMER0_MCR_MR0S_Msk (0x4UL) /*!< MR0S (Bitfield-Mask: 0x01) */ +#define TIMER0_MCR_MR1I_Pos (3UL) /*!< MR1I (Bit 3) */ +#define TIMER0_MCR_MR1I_Msk (0x8UL) /*!< MR1I (Bitfield-Mask: 0x01) */ +#define TIMER0_MCR_MR1R_Pos (4UL) /*!< MR1R (Bit 4) */ +#define TIMER0_MCR_MR1R_Msk (0x10UL) /*!< MR1R (Bitfield-Mask: 0x01) */ +#define TIMER0_MCR_MR1S_Pos (5UL) /*!< MR1S (Bit 5) */ +#define TIMER0_MCR_MR1S_Msk (0x20UL) /*!< MR1S (Bitfield-Mask: 0x01) */ +#define TIMER0_MCR_MR2I_Pos (6UL) /*!< MR2I (Bit 6) */ +#define TIMER0_MCR_MR2I_Msk (0x40UL) /*!< MR2I (Bitfield-Mask: 0x01) */ +#define TIMER0_MCR_MR2R_Pos (7UL) /*!< MR2R (Bit 7) */ +#define TIMER0_MCR_MR2R_Msk (0x80UL) /*!< MR2R (Bitfield-Mask: 0x01) */ +#define TIMER0_MCR_MR2S_Pos (8UL) /*!< MR2S (Bit 8) */ +#define TIMER0_MCR_MR2S_Msk (0x100UL) /*!< MR2S (Bitfield-Mask: 0x01) */ +#define TIMER0_MCR_MR3I_Pos (9UL) /*!< MR3I (Bit 9) */ +#define TIMER0_MCR_MR3I_Msk (0x200UL) /*!< MR3I (Bitfield-Mask: 0x01) */ +#define TIMER0_MCR_MR3R_Pos (10UL) /*!< MR3R (Bit 10) */ +#define TIMER0_MCR_MR3R_Msk (0x400UL) /*!< MR3R (Bitfield-Mask: 0x01) */ +#define TIMER0_MCR_MR3S_Pos (11UL) /*!< MR3S (Bit 11) */ +#define TIMER0_MCR_MR3S_Msk (0x800UL) /*!< MR3S (Bitfield-Mask: 0x01) */ +/* ========================================================== CCR ========================================================== */ +#define TIMER0_CCR_CAP0RE_Pos (0UL) /*!< CAP0RE (Bit 0) */ +#define TIMER0_CCR_CAP0RE_Msk (0x1UL) /*!< CAP0RE (Bitfield-Mask: 0x01) */ +#define TIMER0_CCR_CAP0FE_Pos (1UL) /*!< CAP0FE (Bit 1) */ +#define TIMER0_CCR_CAP0FE_Msk (0x2UL) /*!< CAP0FE (Bitfield-Mask: 0x01) */ +#define TIMER0_CCR_CAP0I_Pos (2UL) /*!< CAP0I (Bit 2) */ +#define TIMER0_CCR_CAP0I_Msk (0x4UL) /*!< CAP0I (Bitfield-Mask: 0x01) */ +#define TIMER0_CCR_CAP1RE_Pos (3UL) /*!< CAP1RE (Bit 3) */ +#define TIMER0_CCR_CAP1RE_Msk (0x8UL) /*!< CAP1RE (Bitfield-Mask: 0x01) */ +#define TIMER0_CCR_CAP1FE_Pos (4UL) /*!< CAP1FE (Bit 4) */ +#define TIMER0_CCR_CAP1FE_Msk (0x10UL) /*!< CAP1FE (Bitfield-Mask: 0x01) */ +#define TIMER0_CCR_CAP1I_Pos (5UL) /*!< CAP1I (Bit 5) */ +#define TIMER0_CCR_CAP1I_Msk (0x20UL) /*!< CAP1I (Bitfield-Mask: 0x01) */ +/* ========================================================== EMR ========================================================== */ +#define TIMER0_EMR_EM0_Pos (0UL) /*!< EM0 (Bit 0) */ +#define TIMER0_EMR_EM0_Msk (0x1UL) /*!< EM0 (Bitfield-Mask: 0x01) */ +#define TIMER0_EMR_EM1_Pos (1UL) /*!< EM1 (Bit 1) */ +#define TIMER0_EMR_EM1_Msk (0x2UL) /*!< EM1 (Bitfield-Mask: 0x01) */ +#define TIMER0_EMR_EM2_Pos (2UL) /*!< EM2 (Bit 2) */ +#define TIMER0_EMR_EM2_Msk (0x4UL) /*!< EM2 (Bitfield-Mask: 0x01) */ +#define TIMER0_EMR_EM3_Pos (3UL) /*!< EM3 (Bit 3) */ +#define TIMER0_EMR_EM3_Msk (0x8UL) /*!< EM3 (Bitfield-Mask: 0x01) */ +#define TIMER0_EMR_EMC0_Pos (4UL) /*!< EMC0 (Bit 4) */ +#define TIMER0_EMR_EMC0_Msk (0x30UL) /*!< EMC0 (Bitfield-Mask: 0x03) */ +#define TIMER0_EMR_EMC1_Pos (6UL) /*!< EMC1 (Bit 6) */ +#define TIMER0_EMR_EMC1_Msk (0xc0UL) /*!< EMC1 (Bitfield-Mask: 0x03) */ +#define TIMER0_EMR_EMC2_Pos (8UL) /*!< EMC2 (Bit 8) */ +#define TIMER0_EMR_EMC2_Msk (0x300UL) /*!< EMC2 (Bitfield-Mask: 0x03) */ +#define TIMER0_EMR_EMC3_Pos (10UL) /*!< EMC3 (Bit 10) */ +#define TIMER0_EMR_EMC3_Msk (0xc00UL) /*!< EMC3 (Bitfield-Mask: 0x03) */ +/* ========================================================= CTCR ========================================================== */ +#define TIMER0_CTCR_CTMODE_Pos (0UL) /*!< CTMODE (Bit 0) */ +#define TIMER0_CTCR_CTMODE_Msk (0x3UL) /*!< CTMODE (Bitfield-Mask: 0x03) */ +#define TIMER0_CTCR_CINSEL_Pos (2UL) /*!< CINSEL (Bit 2) */ +#define TIMER0_CTCR_CINSEL_Msk (0xcUL) /*!< CINSEL (Bitfield-Mask: 0x03) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_TIMER1 ================ */ +/* =========================================================================================================================== */ + +/* ========================================================== IR =========================================================== */ +#define TIMER1_IR_MR0INT_Pos (0UL) /*!< MR0INT (Bit 0) */ +#define TIMER1_IR_MR0INT_Msk (0x1UL) /*!< MR0INT (Bitfield-Mask: 0x01) */ +#define TIMER1_IR_MR1INT_Pos (1UL) /*!< MR1INT (Bit 1) */ +#define TIMER1_IR_MR1INT_Msk (0x2UL) /*!< MR1INT (Bitfield-Mask: 0x01) */ +#define TIMER1_IR_MR2INT_Pos (2UL) /*!< MR2INT (Bit 2) */ +#define TIMER1_IR_MR2INT_Msk (0x4UL) /*!< MR2INT (Bitfield-Mask: 0x01) */ +#define TIMER1_IR_MR3INT_Pos (3UL) /*!< MR3INT (Bit 3) */ +#define TIMER1_IR_MR3INT_Msk (0x8UL) /*!< MR3INT (Bitfield-Mask: 0x01) */ +#define TIMER1_IR_CR0INT_Pos (4UL) /*!< CR0INT (Bit 4) */ +#define TIMER1_IR_CR0INT_Msk (0x10UL) /*!< CR0INT (Bitfield-Mask: 0x01) */ +#define TIMER1_IR_CR1INT_Pos (5UL) /*!< CR1INT (Bit 5) */ +#define TIMER1_IR_CR1INT_Msk (0x20UL) /*!< CR1INT (Bitfield-Mask: 0x01) */ +/* ========================================================== TCR ========================================================== */ +#define TIMER1_TCR_CEN_Pos (0UL) /*!< CEN (Bit 0) */ +#define TIMER1_TCR_CEN_Msk (0x1UL) /*!< CEN (Bitfield-Mask: 0x01) */ +#define TIMER1_TCR_CRST_Pos (1UL) /*!< CRST (Bit 1) */ +#define TIMER1_TCR_CRST_Msk (0x2UL) /*!< CRST (Bitfield-Mask: 0x01) */ +/* ========================================================== TC =========================================================== */ +#define TIMER1_TC_TC_Pos (0UL) /*!< TC (Bit 0) */ +#define TIMER1_TC_TC_Msk (0xffffffffUL) /*!< TC (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== PR =========================================================== */ +#define TIMER1_PR_PM_Pos (0UL) /*!< PM (Bit 0) */ +#define TIMER1_PR_PM_Msk (0xffffffffUL) /*!< PM (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== PC =========================================================== */ +#define TIMER1_PC_PC_Pos (0UL) /*!< PC (Bit 0) */ +#define TIMER1_PC_PC_Msk (0xffffffffUL) /*!< PC (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== MCR ========================================================== */ +#define TIMER1_MCR_MR0I_Pos (0UL) /*!< MR0I (Bit 0) */ +#define TIMER1_MCR_MR0I_Msk (0x1UL) /*!< MR0I (Bitfield-Mask: 0x01) */ +#define TIMER1_MCR_MR0R_Pos (1UL) /*!< MR0R (Bit 1) */ +#define TIMER1_MCR_MR0R_Msk (0x2UL) /*!< MR0R (Bitfield-Mask: 0x01) */ +#define TIMER1_MCR_MR0S_Pos (2UL) /*!< MR0S (Bit 2) */ +#define TIMER1_MCR_MR0S_Msk (0x4UL) /*!< MR0S (Bitfield-Mask: 0x01) */ +#define TIMER1_MCR_MR1I_Pos (3UL) /*!< MR1I (Bit 3) */ +#define TIMER1_MCR_MR1I_Msk (0x8UL) /*!< MR1I (Bitfield-Mask: 0x01) */ +#define TIMER1_MCR_MR1R_Pos (4UL) /*!< MR1R (Bit 4) */ +#define TIMER1_MCR_MR1R_Msk (0x10UL) /*!< MR1R (Bitfield-Mask: 0x01) */ +#define TIMER1_MCR_MR1S_Pos (5UL) /*!< MR1S (Bit 5) */ +#define TIMER1_MCR_MR1S_Msk (0x20UL) /*!< MR1S (Bitfield-Mask: 0x01) */ +#define TIMER1_MCR_MR2I_Pos (6UL) /*!< MR2I (Bit 6) */ +#define TIMER1_MCR_MR2I_Msk (0x40UL) /*!< MR2I (Bitfield-Mask: 0x01) */ +#define TIMER1_MCR_MR2R_Pos (7UL) /*!< MR2R (Bit 7) */ +#define TIMER1_MCR_MR2R_Msk (0x80UL) /*!< MR2R (Bitfield-Mask: 0x01) */ +#define TIMER1_MCR_MR2S_Pos (8UL) /*!< MR2S (Bit 8) */ +#define TIMER1_MCR_MR2S_Msk (0x100UL) /*!< MR2S (Bitfield-Mask: 0x01) */ +#define TIMER1_MCR_MR3I_Pos (9UL) /*!< MR3I (Bit 9) */ +#define TIMER1_MCR_MR3I_Msk (0x200UL) /*!< MR3I (Bitfield-Mask: 0x01) */ +#define TIMER1_MCR_MR3R_Pos (10UL) /*!< MR3R (Bit 10) */ +#define TIMER1_MCR_MR3R_Msk (0x400UL) /*!< MR3R (Bitfield-Mask: 0x01) */ +#define TIMER1_MCR_MR3S_Pos (11UL) /*!< MR3S (Bit 11) */ +#define TIMER1_MCR_MR3S_Msk (0x800UL) /*!< MR3S (Bitfield-Mask: 0x01) */ +/* ========================================================== CCR ========================================================== */ +#define TIMER1_CCR_CAP0RE_Pos (0UL) /*!< CAP0RE (Bit 0) */ +#define TIMER1_CCR_CAP0RE_Msk (0x1UL) /*!< CAP0RE (Bitfield-Mask: 0x01) */ +#define TIMER1_CCR_CAP0FE_Pos (1UL) /*!< CAP0FE (Bit 1) */ +#define TIMER1_CCR_CAP0FE_Msk (0x2UL) /*!< CAP0FE (Bitfield-Mask: 0x01) */ +#define TIMER1_CCR_CAP0I_Pos (2UL) /*!< CAP0I (Bit 2) */ +#define TIMER1_CCR_CAP0I_Msk (0x4UL) /*!< CAP0I (Bitfield-Mask: 0x01) */ +#define TIMER1_CCR_CAP1RE_Pos (3UL) /*!< CAP1RE (Bit 3) */ +#define TIMER1_CCR_CAP1RE_Msk (0x8UL) /*!< CAP1RE (Bitfield-Mask: 0x01) */ +#define TIMER1_CCR_CAP1FE_Pos (4UL) /*!< CAP1FE (Bit 4) */ +#define TIMER1_CCR_CAP1FE_Msk (0x10UL) /*!< CAP1FE (Bitfield-Mask: 0x01) */ +#define TIMER1_CCR_CAP1I_Pos (5UL) /*!< CAP1I (Bit 5) */ +#define TIMER1_CCR_CAP1I_Msk (0x20UL) /*!< CAP1I (Bitfield-Mask: 0x01) */ +/* ========================================================== EMR ========================================================== */ +#define TIMER1_EMR_EM0_Pos (0UL) /*!< EM0 (Bit 0) */ +#define TIMER1_EMR_EM0_Msk (0x1UL) /*!< EM0 (Bitfield-Mask: 0x01) */ +#define TIMER1_EMR_EM1_Pos (1UL) /*!< EM1 (Bit 1) */ +#define TIMER1_EMR_EM1_Msk (0x2UL) /*!< EM1 (Bitfield-Mask: 0x01) */ +#define TIMER1_EMR_EM2_Pos (2UL) /*!< EM2 (Bit 2) */ +#define TIMER1_EMR_EM2_Msk (0x4UL) /*!< EM2 (Bitfield-Mask: 0x01) */ +#define TIMER1_EMR_EM3_Pos (3UL) /*!< EM3 (Bit 3) */ +#define TIMER1_EMR_EM3_Msk (0x8UL) /*!< EM3 (Bitfield-Mask: 0x01) */ +#define TIMER1_EMR_EMC0_Pos (4UL) /*!< EMC0 (Bit 4) */ +#define TIMER1_EMR_EMC0_Msk (0x30UL) /*!< EMC0 (Bitfield-Mask: 0x03) */ +#define TIMER1_EMR_EMC1_Pos (6UL) /*!< EMC1 (Bit 6) */ +#define TIMER1_EMR_EMC1_Msk (0xc0UL) /*!< EMC1 (Bitfield-Mask: 0x03) */ +#define TIMER1_EMR_EMC2_Pos (8UL) /*!< EMC2 (Bit 8) */ +#define TIMER1_EMR_EMC2_Msk (0x300UL) /*!< EMC2 (Bitfield-Mask: 0x03) */ +#define TIMER1_EMR_EMC3_Pos (10UL) /*!< EMC3 (Bit 10) */ +#define TIMER1_EMR_EMC3_Msk (0xc00UL) /*!< EMC3 (Bitfield-Mask: 0x03) */ +/* ========================================================= CTCR ========================================================== */ +#define TIMER1_CTCR_CTMODE_Pos (0UL) /*!< CTMODE (Bit 0) */ +#define TIMER1_CTCR_CTMODE_Msk (0x3UL) /*!< CTMODE (Bitfield-Mask: 0x03) */ +#define TIMER1_CTCR_CINSEL_Pos (2UL) /*!< CINSEL (Bit 2) */ +#define TIMER1_CTCR_CINSEL_Msk (0xcUL) /*!< CINSEL (Bitfield-Mask: 0x03) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_UART0 ================ */ +/* =========================================================================================================================== */ + +/* ========================================================== RBR ========================================================== */ +#define UART0_RBR_RBR_Pos (0UL) /*!< RBR (Bit 0) */ +#define UART0_RBR_RBR_Msk (0xffUL) /*!< RBR (Bitfield-Mask: 0xff) */ +/* ========================================================== THR ========================================================== */ +#define UART0_THR_THR_Pos (0UL) /*!< THR (Bit 0) */ +#define UART0_THR_THR_Msk (0xffUL) /*!< THR (Bitfield-Mask: 0xff) */ +/* ========================================================== DLL ========================================================== */ +#define UART0_DLL_DLLSB_Pos (0UL) /*!< DLLSB (Bit 0) */ +#define UART0_DLL_DLLSB_Msk (0xffUL) /*!< DLLSB (Bitfield-Mask: 0xff) */ +/* ========================================================== DLM ========================================================== */ +#define UART0_DLM_DLMSB_Pos (0UL) /*!< DLMSB (Bit 0) */ +#define UART0_DLM_DLMSB_Msk (0xffUL) /*!< DLMSB (Bitfield-Mask: 0xff) */ +/* ========================================================== IER ========================================================== */ +#define UART0_IER_RBRIE_Pos (0UL) /*!< RBRIE (Bit 0) */ +#define UART0_IER_RBRIE_Msk (0x1UL) /*!< RBRIE (Bitfield-Mask: 0x01) */ +#define UART0_IER_THREIE_Pos (1UL) /*!< THREIE (Bit 1) */ +#define UART0_IER_THREIE_Msk (0x2UL) /*!< THREIE (Bitfield-Mask: 0x01) */ +#define UART0_IER_RXIE_Pos (2UL) /*!< RXIE (Bit 2) */ +#define UART0_IER_RXIE_Msk (0x4UL) /*!< RXIE (Bitfield-Mask: 0x01) */ +#define UART0_IER_ABEOINTEN_Pos (8UL) /*!< ABEOINTEN (Bit 8) */ +#define UART0_IER_ABEOINTEN_Msk (0x100UL) /*!< ABEOINTEN (Bitfield-Mask: 0x01) */ +#define UART0_IER_ABTOINTEN_Pos (9UL) /*!< ABTOINTEN (Bit 9) */ +#define UART0_IER_ABTOINTEN_Msk (0x200UL) /*!< ABTOINTEN (Bitfield-Mask: 0x01) */ +/* ========================================================== IIR ========================================================== */ +#define UART0_IIR_INTSTATUS_Pos (0UL) /*!< INTSTATUS (Bit 0) */ +#define UART0_IIR_INTSTATUS_Msk (0x1UL) /*!< INTSTATUS (Bitfield-Mask: 0x01) */ +#define UART0_IIR_INTID_Pos (1UL) /*!< INTID (Bit 1) */ +#define UART0_IIR_INTID_Msk (0xeUL) /*!< INTID (Bitfield-Mask: 0x07) */ +#define UART0_IIR_FIFOENABLE_Pos (6UL) /*!< FIFOENABLE (Bit 6) */ +#define UART0_IIR_FIFOENABLE_Msk (0xc0UL) /*!< FIFOENABLE (Bitfield-Mask: 0x03) */ +#define UART0_IIR_ABEOINT_Pos (8UL) /*!< ABEOINT (Bit 8) */ +#define UART0_IIR_ABEOINT_Msk (0x100UL) /*!< ABEOINT (Bitfield-Mask: 0x01) */ +#define UART0_IIR_ABTOINT_Pos (9UL) /*!< ABTOINT (Bit 9) */ +#define UART0_IIR_ABTOINT_Msk (0x200UL) /*!< ABTOINT (Bitfield-Mask: 0x01) */ +/* ========================================================== FCR ========================================================== */ +#define UART0_FCR_FIFOEN_Pos (0UL) /*!< FIFOEN (Bit 0) */ +#define UART0_FCR_FIFOEN_Msk (0x1UL) /*!< FIFOEN (Bitfield-Mask: 0x01) */ +#define UART0_FCR_RXFIFORES_Pos (1UL) /*!< RXFIFORES (Bit 1) */ +#define UART0_FCR_RXFIFORES_Msk (0x2UL) /*!< RXFIFORES (Bitfield-Mask: 0x01) */ +#define UART0_FCR_TXFIFORES_Pos (2UL) /*!< TXFIFORES (Bit 2) */ +#define UART0_FCR_TXFIFORES_Msk (0x4UL) /*!< TXFIFORES (Bitfield-Mask: 0x01) */ +#define UART0_FCR_DMAMODE_Pos (3UL) /*!< DMAMODE (Bit 3) */ +#define UART0_FCR_DMAMODE_Msk (0x8UL) /*!< DMAMODE (Bitfield-Mask: 0x01) */ +#define UART0_FCR_RXTRIGLVL_Pos (6UL) /*!< RXTRIGLVL (Bit 6) */ +#define UART0_FCR_RXTRIGLVL_Msk (0xc0UL) /*!< RXTRIGLVL (Bitfield-Mask: 0x03) */ +/* ========================================================== LCR ========================================================== */ +#define UART0_LCR_WLS_Pos (0UL) /*!< WLS (Bit 0) */ +#define UART0_LCR_WLS_Msk (0x3UL) /*!< WLS (Bitfield-Mask: 0x03) */ +#define UART0_LCR_SBS_Pos (2UL) /*!< SBS (Bit 2) */ +#define UART0_LCR_SBS_Msk (0x4UL) /*!< SBS (Bitfield-Mask: 0x01) */ +#define UART0_LCR_PE_Pos (3UL) /*!< PE (Bit 3) */ +#define UART0_LCR_PE_Msk (0x8UL) /*!< PE (Bitfield-Mask: 0x01) */ +#define UART0_LCR_PS_Pos (4UL) /*!< PS (Bit 4) */ +#define UART0_LCR_PS_Msk (0x30UL) /*!< PS (Bitfield-Mask: 0x03) */ +#define UART0_LCR_BC_Pos (6UL) /*!< BC (Bit 6) */ +#define UART0_LCR_BC_Msk (0x40UL) /*!< BC (Bitfield-Mask: 0x01) */ +#define UART0_LCR_DLAB_Pos (7UL) /*!< DLAB (Bit 7) */ +#define UART0_LCR_DLAB_Msk (0x80UL) /*!< DLAB (Bitfield-Mask: 0x01) */ +/* ========================================================== LSR ========================================================== */ +#define UART0_LSR_RDR_Pos (0UL) /*!< RDR (Bit 0) */ +#define UART0_LSR_RDR_Msk (0x1UL) /*!< RDR (Bitfield-Mask: 0x01) */ +#define UART0_LSR_OE_Pos (1UL) /*!< OE (Bit 1) */ +#define UART0_LSR_OE_Msk (0x2UL) /*!< OE (Bitfield-Mask: 0x01) */ +#define UART0_LSR_PE_Pos (2UL) /*!< PE (Bit 2) */ +#define UART0_LSR_PE_Msk (0x4UL) /*!< PE (Bitfield-Mask: 0x01) */ +#define UART0_LSR_FE_Pos (3UL) /*!< FE (Bit 3) */ +#define UART0_LSR_FE_Msk (0x8UL) /*!< FE (Bitfield-Mask: 0x01) */ +#define UART0_LSR_BI_Pos (4UL) /*!< BI (Bit 4) */ +#define UART0_LSR_BI_Msk (0x10UL) /*!< BI (Bitfield-Mask: 0x01) */ +#define UART0_LSR_THRE_Pos (5UL) /*!< THRE (Bit 5) */ +#define UART0_LSR_THRE_Msk (0x20UL) /*!< THRE (Bitfield-Mask: 0x01) */ +#define UART0_LSR_TEMT_Pos (6UL) /*!< TEMT (Bit 6) */ +#define UART0_LSR_TEMT_Msk (0x40UL) /*!< TEMT (Bitfield-Mask: 0x01) */ +#define UART0_LSR_RXFE_Pos (7UL) /*!< RXFE (Bit 7) */ +#define UART0_LSR_RXFE_Msk (0x80UL) /*!< RXFE (Bitfield-Mask: 0x01) */ +/* ========================================================== SCR ========================================================== */ +#define UART0_SCR_PAD_Pos (0UL) /*!< PAD (Bit 0) */ +#define UART0_SCR_PAD_Msk (0xffUL) /*!< PAD (Bitfield-Mask: 0xff) */ +/* ========================================================== ACR ========================================================== */ +#define UART0_ACR_START_Pos (0UL) /*!< START (Bit 0) */ +#define UART0_ACR_START_Msk (0x1UL) /*!< START (Bitfield-Mask: 0x01) */ +#define UART0_ACR_MODE_Pos (1UL) /*!< MODE (Bit 1) */ +#define UART0_ACR_MODE_Msk (0x2UL) /*!< MODE (Bitfield-Mask: 0x01) */ +#define UART0_ACR_AUTORESTART_Pos (2UL) /*!< AUTORESTART (Bit 2) */ +#define UART0_ACR_AUTORESTART_Msk (0x4UL) /*!< AUTORESTART (Bitfield-Mask: 0x01) */ +#define UART0_ACR_ABEOINTCLR_Pos (8UL) /*!< ABEOINTCLR (Bit 8) */ +#define UART0_ACR_ABEOINTCLR_Msk (0x100UL) /*!< ABEOINTCLR (Bitfield-Mask: 0x01) */ +#define UART0_ACR_ABTOINTCLR_Pos (9UL) /*!< ABTOINTCLR (Bit 9) */ +#define UART0_ACR_ABTOINTCLR_Msk (0x200UL) /*!< ABTOINTCLR (Bitfield-Mask: 0x01) */ +/* ========================================================== FDR ========================================================== */ +#define UART0_FDR_DIVADDVAL_Pos (0UL) /*!< DIVADDVAL (Bit 0) */ +#define UART0_FDR_DIVADDVAL_Msk (0xfUL) /*!< DIVADDVAL (Bitfield-Mask: 0x0f) */ +#define UART0_FDR_MULVAL_Pos (4UL) /*!< MULVAL (Bit 4) */ +#define UART0_FDR_MULVAL_Msk (0xf0UL) /*!< MULVAL (Bitfield-Mask: 0x0f) */ +/* ========================================================== TER ========================================================== */ +#define UART0_TER_TXEN_Pos (7UL) /*!< TXEN (Bit 7) */ +#define UART0_TER_TXEN_Msk (0x80UL) /*!< TXEN (Bitfield-Mask: 0x01) */ +/* ======================================================= RS485CTRL ======================================================= */ +#define UART0_RS485CTRL_NMMEN_Pos (0UL) /*!< NMMEN (Bit 0) */ +#define UART0_RS485CTRL_NMMEN_Msk (0x1UL) /*!< NMMEN (Bitfield-Mask: 0x01) */ +#define UART0_RS485CTRL_RXDIS_Pos (1UL) /*!< RXDIS (Bit 1) */ +#define UART0_RS485CTRL_RXDIS_Msk (0x2UL) /*!< RXDIS (Bitfield-Mask: 0x01) */ +#define UART0_RS485CTRL_AADEN_Pos (2UL) /*!< AADEN (Bit 2) */ +#define UART0_RS485CTRL_AADEN_Msk (0x4UL) /*!< AADEN (Bitfield-Mask: 0x01) */ +#define UART0_RS485CTRL_DCTRL_Pos (4UL) /*!< DCTRL (Bit 4) */ +#define UART0_RS485CTRL_DCTRL_Msk (0x10UL) /*!< DCTRL (Bitfield-Mask: 0x01) */ +#define UART0_RS485CTRL_OINV_Pos (5UL) /*!< OINV (Bit 5) */ +#define UART0_RS485CTRL_OINV_Msk (0x20UL) /*!< OINV (Bitfield-Mask: 0x01) */ +/* ===================================================== RS485ADRMATCH ===================================================== */ +#define UART0_RS485ADRMATCH_ADRMATCH_Pos (0UL) /*!< ADRMATCH (Bit 0) */ +#define UART0_RS485ADRMATCH_ADRMATCH_Msk (0xffUL) /*!< ADRMATCH (Bitfield-Mask: 0xff) */ +/* ======================================================= RS485DLY ======================================================== */ +#define UART0_RS485DLY_DLY_Pos (0UL) /*!< DLY (Bit 0) */ +#define UART0_RS485DLY_DLY_Msk (0xffUL) /*!< DLY (Bitfield-Mask: 0xff) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_UART1 ================ */ +/* =========================================================================================================================== */ + +/* ========================================================== RBR ========================================================== */ +#define UART1_RBR_RBR_Pos (0UL) /*!< RBR (Bit 0) */ +#define UART1_RBR_RBR_Msk (0xffUL) /*!< RBR (Bitfield-Mask: 0xff) */ +/* ========================================================== THR ========================================================== */ +#define UART1_THR_THR_Pos (0UL) /*!< THR (Bit 0) */ +#define UART1_THR_THR_Msk (0xffUL) /*!< THR (Bitfield-Mask: 0xff) */ +/* ========================================================== DLL ========================================================== */ +#define UART1_DLL_DLLSB_Pos (0UL) /*!< DLLSB (Bit 0) */ +#define UART1_DLL_DLLSB_Msk (0xffUL) /*!< DLLSB (Bitfield-Mask: 0xff) */ +/* ========================================================== DLM ========================================================== */ +#define UART1_DLM_DLMSB_Pos (0UL) /*!< DLMSB (Bit 0) */ +#define UART1_DLM_DLMSB_Msk (0xffUL) /*!< DLMSB (Bitfield-Mask: 0xff) */ +/* ========================================================== IER ========================================================== */ +#define UART1_IER_RBRIE_Pos (0UL) /*!< RBRIE (Bit 0) */ +#define UART1_IER_RBRIE_Msk (0x1UL) /*!< RBRIE (Bitfield-Mask: 0x01) */ +#define UART1_IER_THREIE_Pos (1UL) /*!< THREIE (Bit 1) */ +#define UART1_IER_THREIE_Msk (0x2UL) /*!< THREIE (Bitfield-Mask: 0x01) */ +#define UART1_IER_RXIE_Pos (2UL) /*!< RXIE (Bit 2) */ +#define UART1_IER_RXIE_Msk (0x4UL) /*!< RXIE (Bitfield-Mask: 0x01) */ +#define UART1_IER_MSIE_Pos (3UL) /*!< MSIE (Bit 3) */ +#define UART1_IER_MSIE_Msk (0x8UL) /*!< MSIE (Bitfield-Mask: 0x01) */ +#define UART1_IER_CTSIE_Pos (7UL) /*!< CTSIE (Bit 7) */ +#define UART1_IER_CTSIE_Msk (0x80UL) /*!< CTSIE (Bitfield-Mask: 0x01) */ +#define UART1_IER_ABEOIE_Pos (8UL) /*!< ABEOIE (Bit 8) */ +#define UART1_IER_ABEOIE_Msk (0x100UL) /*!< ABEOIE (Bitfield-Mask: 0x01) */ +#define UART1_IER_ABTOIE_Pos (9UL) /*!< ABTOIE (Bit 9) */ +#define UART1_IER_ABTOIE_Msk (0x200UL) /*!< ABTOIE (Bitfield-Mask: 0x01) */ +/* ========================================================== IIR ========================================================== */ +#define UART1_IIR_INTSTATUS_Pos (0UL) /*!< INTSTATUS (Bit 0) */ +#define UART1_IIR_INTSTATUS_Msk (0x1UL) /*!< INTSTATUS (Bitfield-Mask: 0x01) */ +#define UART1_IIR_INTID_Pos (1UL) /*!< INTID (Bit 1) */ +#define UART1_IIR_INTID_Msk (0xeUL) /*!< INTID (Bitfield-Mask: 0x07) */ +#define UART1_IIR_FIFOENABLE_Pos (6UL) /*!< FIFOENABLE (Bit 6) */ +#define UART1_IIR_FIFOENABLE_Msk (0xc0UL) /*!< FIFOENABLE (Bitfield-Mask: 0x03) */ +#define UART1_IIR_ABEOINT_Pos (8UL) /*!< ABEOINT (Bit 8) */ +#define UART1_IIR_ABEOINT_Msk (0x100UL) /*!< ABEOINT (Bitfield-Mask: 0x01) */ +#define UART1_IIR_ABTOINT_Pos (9UL) /*!< ABTOINT (Bit 9) */ +#define UART1_IIR_ABTOINT_Msk (0x200UL) /*!< ABTOINT (Bitfield-Mask: 0x01) */ +/* ========================================================== FCR ========================================================== */ +#define UART1_FCR_FIFOEN_Pos (0UL) /*!< FIFOEN (Bit 0) */ +#define UART1_FCR_FIFOEN_Msk (0x1UL) /*!< FIFOEN (Bitfield-Mask: 0x01) */ +#define UART1_FCR_RXFIFORES_Pos (1UL) /*!< RXFIFORES (Bit 1) */ +#define UART1_FCR_RXFIFORES_Msk (0x2UL) /*!< RXFIFORES (Bitfield-Mask: 0x01) */ +#define UART1_FCR_TXFIFORES_Pos (2UL) /*!< TXFIFORES (Bit 2) */ +#define UART1_FCR_TXFIFORES_Msk (0x4UL) /*!< TXFIFORES (Bitfield-Mask: 0x01) */ +#define UART1_FCR_DMAMODE_Pos (3UL) /*!< DMAMODE (Bit 3) */ +#define UART1_FCR_DMAMODE_Msk (0x8UL) /*!< DMAMODE (Bitfield-Mask: 0x01) */ +#define UART1_FCR_RXTRIGLVL_Pos (6UL) /*!< RXTRIGLVL (Bit 6) */ +#define UART1_FCR_RXTRIGLVL_Msk (0xc0UL) /*!< RXTRIGLVL (Bitfield-Mask: 0x03) */ +/* ========================================================== LCR ========================================================== */ +#define UART1_LCR_WLS_Pos (0UL) /*!< WLS (Bit 0) */ +#define UART1_LCR_WLS_Msk (0x3UL) /*!< WLS (Bitfield-Mask: 0x03) */ +#define UART1_LCR_SBS_Pos (2UL) /*!< SBS (Bit 2) */ +#define UART1_LCR_SBS_Msk (0x4UL) /*!< SBS (Bitfield-Mask: 0x01) */ +#define UART1_LCR_PE_Pos (3UL) /*!< PE (Bit 3) */ +#define UART1_LCR_PE_Msk (0x8UL) /*!< PE (Bitfield-Mask: 0x01) */ +#define UART1_LCR_PS_Pos (4UL) /*!< PS (Bit 4) */ +#define UART1_LCR_PS_Msk (0x30UL) /*!< PS (Bitfield-Mask: 0x03) */ +#define UART1_LCR_BC_Pos (6UL) /*!< BC (Bit 6) */ +#define UART1_LCR_BC_Msk (0x40UL) /*!< BC (Bitfield-Mask: 0x01) */ +#define UART1_LCR_DLAB_Pos (7UL) /*!< DLAB (Bit 7) */ +#define UART1_LCR_DLAB_Msk (0x80UL) /*!< DLAB (Bitfield-Mask: 0x01) */ +/* ========================================================== MCR ========================================================== */ +#define UART1_MCR_DTRCTRL_Pos (0UL) /*!< DTRCTRL (Bit 0) */ +#define UART1_MCR_DTRCTRL_Msk (0x1UL) /*!< DTRCTRL (Bitfield-Mask: 0x01) */ +#define UART1_MCR_RTSCTRL_Pos (1UL) /*!< RTSCTRL (Bit 1) */ +#define UART1_MCR_RTSCTRL_Msk (0x2UL) /*!< RTSCTRL (Bitfield-Mask: 0x01) */ +#define UART1_MCR_LMS_Pos (4UL) /*!< LMS (Bit 4) */ +#define UART1_MCR_LMS_Msk (0x10UL) /*!< LMS (Bitfield-Mask: 0x01) */ +#define UART1_MCR_RTSEN_Pos (6UL) /*!< RTSEN (Bit 6) */ +#define UART1_MCR_RTSEN_Msk (0x40UL) /*!< RTSEN (Bitfield-Mask: 0x01) */ +#define UART1_MCR_CTSEN_Pos (7UL) /*!< CTSEN (Bit 7) */ +#define UART1_MCR_CTSEN_Msk (0x80UL) /*!< CTSEN (Bitfield-Mask: 0x01) */ +/* ========================================================== LSR ========================================================== */ +#define UART1_LSR_RDR_Pos (0UL) /*!< RDR (Bit 0) */ +#define UART1_LSR_RDR_Msk (0x1UL) /*!< RDR (Bitfield-Mask: 0x01) */ +#define UART1_LSR_OE_Pos (1UL) /*!< OE (Bit 1) */ +#define UART1_LSR_OE_Msk (0x2UL) /*!< OE (Bitfield-Mask: 0x01) */ +#define UART1_LSR_PE_Pos (2UL) /*!< PE (Bit 2) */ +#define UART1_LSR_PE_Msk (0x4UL) /*!< PE (Bitfield-Mask: 0x01) */ +#define UART1_LSR_FE_Pos (3UL) /*!< FE (Bit 3) */ +#define UART1_LSR_FE_Msk (0x8UL) /*!< FE (Bitfield-Mask: 0x01) */ +#define UART1_LSR_BI_Pos (4UL) /*!< BI (Bit 4) */ +#define UART1_LSR_BI_Msk (0x10UL) /*!< BI (Bitfield-Mask: 0x01) */ +#define UART1_LSR_THRE_Pos (5UL) /*!< THRE (Bit 5) */ +#define UART1_LSR_THRE_Msk (0x20UL) /*!< THRE (Bitfield-Mask: 0x01) */ +#define UART1_LSR_TEMT_Pos (6UL) /*!< TEMT (Bit 6) */ +#define UART1_LSR_TEMT_Msk (0x40UL) /*!< TEMT (Bitfield-Mask: 0x01) */ +#define UART1_LSR_RXFE_Pos (7UL) /*!< RXFE (Bit 7) */ +#define UART1_LSR_RXFE_Msk (0x80UL) /*!< RXFE (Bitfield-Mask: 0x01) */ +/* ========================================================== MSR ========================================================== */ +#define UART1_MSR_DCTS_Pos (0UL) /*!< DCTS (Bit 0) */ +#define UART1_MSR_DCTS_Msk (0x1UL) /*!< DCTS (Bitfield-Mask: 0x01) */ +#define UART1_MSR_DDSR_Pos (1UL) /*!< DDSR (Bit 1) */ +#define UART1_MSR_DDSR_Msk (0x2UL) /*!< DDSR (Bitfield-Mask: 0x01) */ +#define UART1_MSR_TERI_Pos (2UL) /*!< TERI (Bit 2) */ +#define UART1_MSR_TERI_Msk (0x4UL) /*!< TERI (Bitfield-Mask: 0x01) */ +#define UART1_MSR_DDCD_Pos (3UL) /*!< DDCD (Bit 3) */ +#define UART1_MSR_DDCD_Msk (0x8UL) /*!< DDCD (Bitfield-Mask: 0x01) */ +#define UART1_MSR_CTS_Pos (4UL) /*!< CTS (Bit 4) */ +#define UART1_MSR_CTS_Msk (0x10UL) /*!< CTS (Bitfield-Mask: 0x01) */ +#define UART1_MSR_DSR_Pos (5UL) /*!< DSR (Bit 5) */ +#define UART1_MSR_DSR_Msk (0x20UL) /*!< DSR (Bitfield-Mask: 0x01) */ +#define UART1_MSR_RI_Pos (6UL) /*!< RI (Bit 6) */ +#define UART1_MSR_RI_Msk (0x40UL) /*!< RI (Bitfield-Mask: 0x01) */ +#define UART1_MSR_DCD_Pos (7UL) /*!< DCD (Bit 7) */ +#define UART1_MSR_DCD_Msk (0x80UL) /*!< DCD (Bitfield-Mask: 0x01) */ +/* ========================================================== SCR ========================================================== */ +#define UART1_SCR_Pad_Pos (0UL) /*!< Pad (Bit 0) */ +#define UART1_SCR_Pad_Msk (0xffUL) /*!< Pad (Bitfield-Mask: 0xff) */ +/* ========================================================== ACR ========================================================== */ +#define UART1_ACR_START_Pos (0UL) /*!< START (Bit 0) */ +#define UART1_ACR_START_Msk (0x1UL) /*!< START (Bitfield-Mask: 0x01) */ +#define UART1_ACR_MODE_Pos (1UL) /*!< MODE (Bit 1) */ +#define UART1_ACR_MODE_Msk (0x2UL) /*!< MODE (Bitfield-Mask: 0x01) */ +#define UART1_ACR_AUTORESTART_Pos (2UL) /*!< AUTORESTART (Bit 2) */ +#define UART1_ACR_AUTORESTART_Msk (0x4UL) /*!< AUTORESTART (Bitfield-Mask: 0x01) */ +#define UART1_ACR_ABEOINTCLR_Pos (8UL) /*!< ABEOINTCLR (Bit 8) */ +#define UART1_ACR_ABEOINTCLR_Msk (0x100UL) /*!< ABEOINTCLR (Bitfield-Mask: 0x01) */ +#define UART1_ACR_ABTOINTCLR_Pos (9UL) /*!< ABTOINTCLR (Bit 9) */ +#define UART1_ACR_ABTOINTCLR_Msk (0x200UL) /*!< ABTOINTCLR (Bitfield-Mask: 0x01) */ +/* ========================================================== FDR ========================================================== */ +#define UART1_FDR_DIVADDVAL_Pos (0UL) /*!< DIVADDVAL (Bit 0) */ +#define UART1_FDR_DIVADDVAL_Msk (0xfUL) /*!< DIVADDVAL (Bitfield-Mask: 0x0f) */ +#define UART1_FDR_MULVAL_Pos (4UL) /*!< MULVAL (Bit 4) */ +#define UART1_FDR_MULVAL_Msk (0xf0UL) /*!< MULVAL (Bitfield-Mask: 0x0f) */ +/* ========================================================== TER ========================================================== */ +#define UART1_TER_TXEN_Pos (7UL) /*!< TXEN (Bit 7) */ +#define UART1_TER_TXEN_Msk (0x80UL) /*!< TXEN (Bitfield-Mask: 0x01) */ +/* ======================================================= RS485CTRL ======================================================= */ +#define UART1_RS485CTRL_NMMEN_Pos (0UL) /*!< NMMEN (Bit 0) */ +#define UART1_RS485CTRL_NMMEN_Msk (0x1UL) /*!< NMMEN (Bitfield-Mask: 0x01) */ +#define UART1_RS485CTRL_RXDIS_Pos (1UL) /*!< RXDIS (Bit 1) */ +#define UART1_RS485CTRL_RXDIS_Msk (0x2UL) /*!< RXDIS (Bitfield-Mask: 0x01) */ +#define UART1_RS485CTRL_AADEN_Pos (2UL) /*!< AADEN (Bit 2) */ +#define UART1_RS485CTRL_AADEN_Msk (0x4UL) /*!< AADEN (Bitfield-Mask: 0x01) */ +#define UART1_RS485CTRL_SEL_Pos (3UL) /*!< SEL (Bit 3) */ +#define UART1_RS485CTRL_SEL_Msk (0x8UL) /*!< SEL (Bitfield-Mask: 0x01) */ +#define UART1_RS485CTRL_DCTRL_Pos (4UL) /*!< DCTRL (Bit 4) */ +#define UART1_RS485CTRL_DCTRL_Msk (0x10UL) /*!< DCTRL (Bitfield-Mask: 0x01) */ +#define UART1_RS485CTRL_OINV_Pos (5UL) /*!< OINV (Bit 5) */ +#define UART1_RS485CTRL_OINV_Msk (0x20UL) /*!< OINV (Bitfield-Mask: 0x01) */ +/* ===================================================== RS485ADRMATCH ===================================================== */ +#define UART1_RS485ADRMATCH_ADRMATCH_Pos (0UL) /*!< ADRMATCH (Bit 0) */ +#define UART1_RS485ADRMATCH_ADRMATCH_Msk (0xffUL) /*!< ADRMATCH (Bitfield-Mask: 0xff) */ +/* ======================================================= RS485DLY ======================================================== */ +#define UART1_RS485DLY_DLY_Pos (0UL) /*!< DLY (Bit 0) */ +#define UART1_RS485DLY_DLY_Msk (0xffUL) /*!< DLY (Bitfield-Mask: 0xff) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_PWM1 ================ */ +/* =========================================================================================================================== */ + +/* ========================================================== IR =========================================================== */ +#define PWM1_IR_PWMMR0INT_Pos (0UL) /*!< PWMMR0INT (Bit 0) */ +#define PWM1_IR_PWMMR0INT_Msk (0x1UL) /*!< PWMMR0INT (Bitfield-Mask: 0x01) */ +#define PWM1_IR_PWMMR1INT_Pos (1UL) /*!< PWMMR1INT (Bit 1) */ +#define PWM1_IR_PWMMR1INT_Msk (0x2UL) /*!< PWMMR1INT (Bitfield-Mask: 0x01) */ +#define PWM1_IR_PWMMR2INT_Pos (2UL) /*!< PWMMR2INT (Bit 2) */ +#define PWM1_IR_PWMMR2INT_Msk (0x4UL) /*!< PWMMR2INT (Bitfield-Mask: 0x01) */ +#define PWM1_IR_PWMMR3INT_Pos (3UL) /*!< PWMMR3INT (Bit 3) */ +#define PWM1_IR_PWMMR3INT_Msk (0x8UL) /*!< PWMMR3INT (Bitfield-Mask: 0x01) */ +#define PWM1_IR_PWMCAP0INT_Pos (4UL) /*!< PWMCAP0INT (Bit 4) */ +#define PWM1_IR_PWMCAP0INT_Msk (0x10UL) /*!< PWMCAP0INT (Bitfield-Mask: 0x01) */ +#define PWM1_IR_PWMCAP1INT_Pos (5UL) /*!< PWMCAP1INT (Bit 5) */ +#define PWM1_IR_PWMCAP1INT_Msk (0x20UL) /*!< PWMCAP1INT (Bitfield-Mask: 0x01) */ +#define PWM1_IR_PWMMR4INT_Pos (8UL) /*!< PWMMR4INT (Bit 8) */ +#define PWM1_IR_PWMMR4INT_Msk (0x100UL) /*!< PWMMR4INT (Bitfield-Mask: 0x01) */ +#define PWM1_IR_PWMMR5INT_Pos (9UL) /*!< PWMMR5INT (Bit 9) */ +#define PWM1_IR_PWMMR5INT_Msk (0x200UL) /*!< PWMMR5INT (Bitfield-Mask: 0x01) */ +#define PWM1_IR_PWMMR6INT_Pos (10UL) /*!< PWMMR6INT (Bit 10) */ +#define PWM1_IR_PWMMR6INT_Msk (0x400UL) /*!< PWMMR6INT (Bitfield-Mask: 0x01) */ +/* ========================================================== TCR ========================================================== */ +#define PWM1_TCR_CE_Pos (0UL) /*!< CE (Bit 0) */ +#define PWM1_TCR_CE_Msk (0x1UL) /*!< CE (Bitfield-Mask: 0x01) */ +#define PWM1_TCR_CR_Pos (1UL) /*!< CR (Bit 1) */ +#define PWM1_TCR_CR_Msk (0x2UL) /*!< CR (Bitfield-Mask: 0x01) */ +#define PWM1_TCR_PWMEN_Pos (3UL) /*!< PWMEN (Bit 3) */ +#define PWM1_TCR_PWMEN_Msk (0x8UL) /*!< PWMEN (Bitfield-Mask: 0x01) */ +#define PWM1_TCR_MDIS_Pos (4UL) /*!< MDIS (Bit 4) */ +#define PWM1_TCR_MDIS_Msk (0x10UL) /*!< MDIS (Bitfield-Mask: 0x01) */ +/* ========================================================== TC =========================================================== */ +#define PWM1_TC_TC_Pos (0UL) /*!< TC (Bit 0) */ +#define PWM1_TC_TC_Msk (0xffffffffUL) /*!< TC (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== PR =========================================================== */ +#define PWM1_PR_PM_Pos (0UL) /*!< PM (Bit 0) */ +#define PWM1_PR_PM_Msk (0xffffffffUL) /*!< PM (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== PC =========================================================== */ +#define PWM1_PC_PC_Pos (0UL) /*!< PC (Bit 0) */ +#define PWM1_PC_PC_Msk (0xffffffffUL) /*!< PC (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== MCR ========================================================== */ +#define PWM1_MCR_PWMMR0I_Pos (0UL) /*!< PWMMR0I (Bit 0) */ +#define PWM1_MCR_PWMMR0I_Msk (0x1UL) /*!< PWMMR0I (Bitfield-Mask: 0x01) */ +#define PWM1_MCR_PWMMR0R_Pos (1UL) /*!< PWMMR0R (Bit 1) */ +#define PWM1_MCR_PWMMR0R_Msk (0x2UL) /*!< PWMMR0R (Bitfield-Mask: 0x01) */ +#define PWM1_MCR_PWMMR0S_Pos (2UL) /*!< PWMMR0S (Bit 2) */ +#define PWM1_MCR_PWMMR0S_Msk (0x4UL) /*!< PWMMR0S (Bitfield-Mask: 0x01) */ +#define PWM1_MCR_PWMMR1I_Pos (3UL) /*!< PWMMR1I (Bit 3) */ +#define PWM1_MCR_PWMMR1I_Msk (0x8UL) /*!< PWMMR1I (Bitfield-Mask: 0x01) */ +#define PWM1_MCR_PWMMR1R_Pos (4UL) /*!< PWMMR1R (Bit 4) */ +#define PWM1_MCR_PWMMR1R_Msk (0x10UL) /*!< PWMMR1R (Bitfield-Mask: 0x01) */ +#define PWM1_MCR_PWMMR1S_Pos (5UL) /*!< PWMMR1S (Bit 5) */ +#define PWM1_MCR_PWMMR1S_Msk (0x20UL) /*!< PWMMR1S (Bitfield-Mask: 0x01) */ +#define PWM1_MCR_PWMMR2I_Pos (6UL) /*!< PWMMR2I (Bit 6) */ +#define PWM1_MCR_PWMMR2I_Msk (0x40UL) /*!< PWMMR2I (Bitfield-Mask: 0x01) */ +#define PWM1_MCR_PWMMR2R_Pos (7UL) /*!< PWMMR2R (Bit 7) */ +#define PWM1_MCR_PWMMR2R_Msk (0x80UL) /*!< PWMMR2R (Bitfield-Mask: 0x01) */ +#define PWM1_MCR_PWMMR2S_Pos (8UL) /*!< PWMMR2S (Bit 8) */ +#define PWM1_MCR_PWMMR2S_Msk (0x100UL) /*!< PWMMR2S (Bitfield-Mask: 0x01) */ +#define PWM1_MCR_PWMMR3I_Pos (9UL) /*!< PWMMR3I (Bit 9) */ +#define PWM1_MCR_PWMMR3I_Msk (0x200UL) /*!< PWMMR3I (Bitfield-Mask: 0x01) */ +#define PWM1_MCR_PWMMR3R_Pos (10UL) /*!< PWMMR3R (Bit 10) */ +#define PWM1_MCR_PWMMR3R_Msk (0x400UL) /*!< PWMMR3R (Bitfield-Mask: 0x01) */ +#define PWM1_MCR_PWMMR3S_Pos (11UL) /*!< PWMMR3S (Bit 11) */ +#define PWM1_MCR_PWMMR3S_Msk (0x800UL) /*!< PWMMR3S (Bitfield-Mask: 0x01) */ +#define PWM1_MCR_PWMMR4I_Pos (12UL) /*!< PWMMR4I (Bit 12) */ +#define PWM1_MCR_PWMMR4I_Msk (0x1000UL) /*!< PWMMR4I (Bitfield-Mask: 0x01) */ +#define PWM1_MCR_PWMMR4R_Pos (13UL) /*!< PWMMR4R (Bit 13) */ +#define PWM1_MCR_PWMMR4R_Msk (0x2000UL) /*!< PWMMR4R (Bitfield-Mask: 0x01) */ +#define PWM1_MCR_PWMMR4S_Pos (14UL) /*!< PWMMR4S (Bit 14) */ +#define PWM1_MCR_PWMMR4S_Msk (0x4000UL) /*!< PWMMR4S (Bitfield-Mask: 0x01) */ +#define PWM1_MCR_PWMMR5I_Pos (15UL) /*!< PWMMR5I (Bit 15) */ +#define PWM1_MCR_PWMMR5I_Msk (0x8000UL) /*!< PWMMR5I (Bitfield-Mask: 0x01) */ +#define PWM1_MCR_PWMMR5R_Pos (16UL) /*!< PWMMR5R (Bit 16) */ +#define PWM1_MCR_PWMMR5R_Msk (0x10000UL) /*!< PWMMR5R (Bitfield-Mask: 0x01) */ +#define PWM1_MCR_PWMMR5S_Pos (17UL) /*!< PWMMR5S (Bit 17) */ +#define PWM1_MCR_PWMMR5S_Msk (0x20000UL) /*!< PWMMR5S (Bitfield-Mask: 0x01) */ +#define PWM1_MCR_PWMMR6I_Pos (18UL) /*!< PWMMR6I (Bit 18) */ +#define PWM1_MCR_PWMMR6I_Msk (0x40000UL) /*!< PWMMR6I (Bitfield-Mask: 0x01) */ +#define PWM1_MCR_PWMMR6R_Pos (19UL) /*!< PWMMR6R (Bit 19) */ +#define PWM1_MCR_PWMMR6R_Msk (0x80000UL) /*!< PWMMR6R (Bitfield-Mask: 0x01) */ +#define PWM1_MCR_PWMMR6S_Pos (20UL) /*!< PWMMR6S (Bit 20) */ +#define PWM1_MCR_PWMMR6S_Msk (0x100000UL) /*!< PWMMR6S (Bitfield-Mask: 0x01) */ +/* ========================================================== MR0 ========================================================== */ +#define PWM1_MR0_MATCH_Pos (0UL) /*!< MATCH (Bit 0) */ +#define PWM1_MR0_MATCH_Msk (0xffffffffUL) /*!< MATCH (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== MR1 ========================================================== */ +#define PWM1_MR1_MATCH_Pos (0UL) /*!< MATCH (Bit 0) */ +#define PWM1_MR1_MATCH_Msk (0xffffffffUL) /*!< MATCH (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== MR2 ========================================================== */ +#define PWM1_MR2_MATCH_Pos (0UL) /*!< MATCH (Bit 0) */ +#define PWM1_MR2_MATCH_Msk (0xffffffffUL) /*!< MATCH (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== MR3 ========================================================== */ +#define PWM1_MR3_MATCH_Pos (0UL) /*!< MATCH (Bit 0) */ +#define PWM1_MR3_MATCH_Msk (0xffffffffUL) /*!< MATCH (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== CCR ========================================================== */ +#define PWM1_CCR_CAP0_R_Pos (0UL) /*!< CAP0_R (Bit 0) */ +#define PWM1_CCR_CAP0_R_Msk (0x1UL) /*!< CAP0_R (Bitfield-Mask: 0x01) */ +#define PWM1_CCR_CAP0_F_Pos (1UL) /*!< CAP0_F (Bit 1) */ +#define PWM1_CCR_CAP0_F_Msk (0x2UL) /*!< CAP0_F (Bitfield-Mask: 0x01) */ +#define PWM1_CCR_CAP0_I_Pos (2UL) /*!< CAP0_I (Bit 2) */ +#define PWM1_CCR_CAP0_I_Msk (0x4UL) /*!< CAP0_I (Bitfield-Mask: 0x01) */ +#define PWM1_CCR_CAP1_R_Pos (3UL) /*!< CAP1_R (Bit 3) */ +#define PWM1_CCR_CAP1_R_Msk (0x8UL) /*!< CAP1_R (Bitfield-Mask: 0x01) */ +#define PWM1_CCR_CAP1_F_Pos (4UL) /*!< CAP1_F (Bit 4) */ +#define PWM1_CCR_CAP1_F_Msk (0x10UL) /*!< CAP1_F (Bitfield-Mask: 0x01) */ +#define PWM1_CCR_CAP1_I_Pos (5UL) /*!< CAP1_I (Bit 5) */ +#define PWM1_CCR_CAP1_I_Msk (0x20UL) /*!< CAP1_I (Bitfield-Mask: 0x01) */ +/* ========================================================== MR4 ========================================================== */ +#define PWM1_MR4_MATCH_Pos (0UL) /*!< MATCH (Bit 0) */ +#define PWM1_MR4_MATCH_Msk (0xffffffffUL) /*!< MATCH (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== MR5 ========================================================== */ +#define PWM1_MR5_MATCH_Pos (0UL) /*!< MATCH (Bit 0) */ +#define PWM1_MR5_MATCH_Msk (0xffffffffUL) /*!< MATCH (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== MR6 ========================================================== */ +#define PWM1_MR6_MATCH_Pos (0UL) /*!< MATCH (Bit 0) */ +#define PWM1_MR6_MATCH_Msk (0xffffffffUL) /*!< MATCH (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== PCR ========================================================== */ +#define PWM1_PCR_PWMSEL2_Pos (2UL) /*!< PWMSEL2 (Bit 2) */ +#define PWM1_PCR_PWMSEL2_Msk (0x4UL) /*!< PWMSEL2 (Bitfield-Mask: 0x01) */ +#define PWM1_PCR_PWMSEL3_Pos (3UL) /*!< PWMSEL3 (Bit 3) */ +#define PWM1_PCR_PWMSEL3_Msk (0x8UL) /*!< PWMSEL3 (Bitfield-Mask: 0x01) */ +#define PWM1_PCR_PWMSEL4_Pos (4UL) /*!< PWMSEL4 (Bit 4) */ +#define PWM1_PCR_PWMSEL4_Msk (0x10UL) /*!< PWMSEL4 (Bitfield-Mask: 0x01) */ +#define PWM1_PCR_PWMSEL5_Pos (5UL) /*!< PWMSEL5 (Bit 5) */ +#define PWM1_PCR_PWMSEL5_Msk (0x20UL) /*!< PWMSEL5 (Bitfield-Mask: 0x01) */ +#define PWM1_PCR_PWMSEL6_Pos (6UL) /*!< PWMSEL6 (Bit 6) */ +#define PWM1_PCR_PWMSEL6_Msk (0x40UL) /*!< PWMSEL6 (Bitfield-Mask: 0x01) */ +#define PWM1_PCR_PWMENA1_Pos (9UL) /*!< PWMENA1 (Bit 9) */ +#define PWM1_PCR_PWMENA1_Msk (0x200UL) /*!< PWMENA1 (Bitfield-Mask: 0x01) */ +#define PWM1_PCR_PWMENA2_Pos (10UL) /*!< PWMENA2 (Bit 10) */ +#define PWM1_PCR_PWMENA2_Msk (0x400UL) /*!< PWMENA2 (Bitfield-Mask: 0x01) */ +#define PWM1_PCR_PWMENA3_Pos (11UL) /*!< PWMENA3 (Bit 11) */ +#define PWM1_PCR_PWMENA3_Msk (0x800UL) /*!< PWMENA3 (Bitfield-Mask: 0x01) */ +#define PWM1_PCR_PWMENA4_Pos (12UL) /*!< PWMENA4 (Bit 12) */ +#define PWM1_PCR_PWMENA4_Msk (0x1000UL) /*!< PWMENA4 (Bitfield-Mask: 0x01) */ +#define PWM1_PCR_PWMENA5_Pos (13UL) /*!< PWMENA5 (Bit 13) */ +#define PWM1_PCR_PWMENA5_Msk (0x2000UL) /*!< PWMENA5 (Bitfield-Mask: 0x01) */ +#define PWM1_PCR_PWMENA6_Pos (14UL) /*!< PWMENA6 (Bit 14) */ +#define PWM1_PCR_PWMENA6_Msk (0x4000UL) /*!< PWMENA6 (Bitfield-Mask: 0x01) */ +/* ========================================================== LER ========================================================== */ +#define PWM1_LER_MAT0LATCHEN_Pos (0UL) /*!< MAT0LATCHEN (Bit 0) */ +#define PWM1_LER_MAT0LATCHEN_Msk (0x1UL) /*!< MAT0LATCHEN (Bitfield-Mask: 0x01) */ +#define PWM1_LER_MAT1LATCHEN_Pos (1UL) /*!< MAT1LATCHEN (Bit 1) */ +#define PWM1_LER_MAT1LATCHEN_Msk (0x2UL) /*!< MAT1LATCHEN (Bitfield-Mask: 0x01) */ +#define PWM1_LER_MAT2LATCHEN_Pos (2UL) /*!< MAT2LATCHEN (Bit 2) */ +#define PWM1_LER_MAT2LATCHEN_Msk (0x4UL) /*!< MAT2LATCHEN (Bitfield-Mask: 0x01) */ +#define PWM1_LER_MAT3LATCHEN_Pos (3UL) /*!< MAT3LATCHEN (Bit 3) */ +#define PWM1_LER_MAT3LATCHEN_Msk (0x8UL) /*!< MAT3LATCHEN (Bitfield-Mask: 0x01) */ +#define PWM1_LER_MAT4LATCHEN_Pos (4UL) /*!< MAT4LATCHEN (Bit 4) */ +#define PWM1_LER_MAT4LATCHEN_Msk (0x10UL) /*!< MAT4LATCHEN (Bitfield-Mask: 0x01) */ +#define PWM1_LER_MAT5LATCHEN_Pos (5UL) /*!< MAT5LATCHEN (Bit 5) */ +#define PWM1_LER_MAT5LATCHEN_Msk (0x20UL) /*!< MAT5LATCHEN (Bitfield-Mask: 0x01) */ +#define PWM1_LER_MAT6LATCHEN_Pos (6UL) /*!< MAT6LATCHEN (Bit 6) */ +#define PWM1_LER_MAT6LATCHEN_Msk (0x40UL) /*!< MAT6LATCHEN (Bitfield-Mask: 0x01) */ +/* ========================================================= CTCR ========================================================== */ +#define PWM1_CTCR_MOD_Pos (0UL) /*!< MOD (Bit 0) */ +#define PWM1_CTCR_MOD_Msk (0x3UL) /*!< MOD (Bitfield-Mask: 0x03) */ +#define PWM1_CTCR_CIS_Pos (2UL) /*!< CIS (Bit 2) */ +#define PWM1_CTCR_CIS_Msk (0xcUL) /*!< CIS (Bitfield-Mask: 0x03) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_I2C0 ================ */ +/* =========================================================================================================================== */ + +/* ======================================================== CONSET ========================================================= */ +#define I2C0_CONSET_AA_Pos (2UL) /*!< AA (Bit 2) */ +#define I2C0_CONSET_AA_Msk (0x4UL) /*!< AA (Bitfield-Mask: 0x01) */ +#define I2C0_CONSET_SI_Pos (3UL) /*!< SI (Bit 3) */ +#define I2C0_CONSET_SI_Msk (0x8UL) /*!< SI (Bitfield-Mask: 0x01) */ +#define I2C0_CONSET_STO_Pos (4UL) /*!< STO (Bit 4) */ +#define I2C0_CONSET_STO_Msk (0x10UL) /*!< STO (Bitfield-Mask: 0x01) */ +#define I2C0_CONSET_STA_Pos (5UL) /*!< STA (Bit 5) */ +#define I2C0_CONSET_STA_Msk (0x20UL) /*!< STA (Bitfield-Mask: 0x01) */ +#define I2C0_CONSET_I2EN_Pos (6UL) /*!< I2EN (Bit 6) */ +#define I2C0_CONSET_I2EN_Msk (0x40UL) /*!< I2EN (Bitfield-Mask: 0x01) */ +/* ========================================================= STAT ========================================================== */ +#define I2C0_STAT_Status_Pos (3UL) /*!< Status (Bit 3) */ +#define I2C0_STAT_Status_Msk (0xf8UL) /*!< Status (Bitfield-Mask: 0x1f) */ +/* ========================================================== DAT ========================================================== */ +#define I2C0_DAT_Data_Pos (0UL) /*!< Data (Bit 0) */ +#define I2C0_DAT_Data_Msk (0xffUL) /*!< Data (Bitfield-Mask: 0xff) */ +/* ========================================================= ADR0 ========================================================== */ +#define I2C0_ADR0_GC_Pos (0UL) /*!< GC (Bit 0) */ +#define I2C0_ADR0_GC_Msk (0x1UL) /*!< GC (Bitfield-Mask: 0x01) */ +#define I2C0_ADR0_Address_Pos (1UL) /*!< Address (Bit 1) */ +#define I2C0_ADR0_Address_Msk (0xfeUL) /*!< Address (Bitfield-Mask: 0x7f) */ +/* ========================================================= SCLH ========================================================== */ +#define I2C0_SCLH_SCLH_Pos (0UL) /*!< SCLH (Bit 0) */ +#define I2C0_SCLH_SCLH_Msk (0xffffUL) /*!< SCLH (Bitfield-Mask: 0xffff) */ +/* ========================================================= SCLL ========================================================== */ +#define I2C0_SCLL_SCLL_Pos (0UL) /*!< SCLL (Bit 0) */ +#define I2C0_SCLL_SCLL_Msk (0xffffUL) /*!< SCLL (Bitfield-Mask: 0xffff) */ +/* ======================================================== CONCLR ========================================================= */ +#define I2C0_CONCLR_AAC_Pos (2UL) /*!< AAC (Bit 2) */ +#define I2C0_CONCLR_AAC_Msk (0x4UL) /*!< AAC (Bitfield-Mask: 0x01) */ +#define I2C0_CONCLR_SIC_Pos (3UL) /*!< SIC (Bit 3) */ +#define I2C0_CONCLR_SIC_Msk (0x8UL) /*!< SIC (Bitfield-Mask: 0x01) */ +#define I2C0_CONCLR_STAC_Pos (5UL) /*!< STAC (Bit 5) */ +#define I2C0_CONCLR_STAC_Msk (0x20UL) /*!< STAC (Bitfield-Mask: 0x01) */ +#define I2C0_CONCLR_I2ENC_Pos (6UL) /*!< I2ENC (Bit 6) */ +#define I2C0_CONCLR_I2ENC_Msk (0x40UL) /*!< I2ENC (Bitfield-Mask: 0x01) */ +/* ======================================================== MMCTRL ========================================================= */ +#define I2C0_MMCTRL_MM_ENA_Pos (0UL) /*!< MM_ENA (Bit 0) */ +#define I2C0_MMCTRL_MM_ENA_Msk (0x1UL) /*!< MM_ENA (Bitfield-Mask: 0x01) */ +#define I2C0_MMCTRL_ENA_SCL_Pos (1UL) /*!< ENA_SCL (Bit 1) */ +#define I2C0_MMCTRL_ENA_SCL_Msk (0x2UL) /*!< ENA_SCL (Bitfield-Mask: 0x01) */ +#define I2C0_MMCTRL_MATCH_ALL_Pos (2UL) /*!< MATCH_ALL (Bit 2) */ +#define I2C0_MMCTRL_MATCH_ALL_Msk (0x4UL) /*!< MATCH_ALL (Bitfield-Mask: 0x01) */ +/* ========================================================= ADR1 ========================================================== */ +#define I2C0_ADR1_GC_Pos (0UL) /*!< GC (Bit 0) */ +#define I2C0_ADR1_GC_Msk (0x1UL) /*!< GC (Bitfield-Mask: 0x01) */ +#define I2C0_ADR1_Address_Pos (1UL) /*!< Address (Bit 1) */ +#define I2C0_ADR1_Address_Msk (0xfeUL) /*!< Address (Bitfield-Mask: 0x7f) */ +/* ========================================================= ADR2 ========================================================== */ +#define I2C0_ADR2_GC_Pos (0UL) /*!< GC (Bit 0) */ +#define I2C0_ADR2_GC_Msk (0x1UL) /*!< GC (Bitfield-Mask: 0x01) */ +#define I2C0_ADR2_Address_Pos (1UL) /*!< Address (Bit 1) */ +#define I2C0_ADR2_Address_Msk (0xfeUL) /*!< Address (Bitfield-Mask: 0x7f) */ +/* ========================================================= ADR3 ========================================================== */ +#define I2C0_ADR3_GC_Pos (0UL) /*!< GC (Bit 0) */ +#define I2C0_ADR3_GC_Msk (0x1UL) /*!< GC (Bitfield-Mask: 0x01) */ +#define I2C0_ADR3_Address_Pos (1UL) /*!< Address (Bit 1) */ +#define I2C0_ADR3_Address_Msk (0xfeUL) /*!< Address (Bitfield-Mask: 0x7f) */ +/* ====================================================== DATA_BUFFER ====================================================== */ +#define I2C0_DATA_BUFFER_Data_Pos (0UL) /*!< Data (Bit 0) */ +#define I2C0_DATA_BUFFER_Data_Msk (0xffUL) /*!< Data (Bitfield-Mask: 0xff) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_SPI ================ */ +/* =========================================================================================================================== */ + +/* ========================================================== CR =========================================================== */ +#define SPI_CR_BITENABLE_Pos (2UL) /*!< BITENABLE (Bit 2) */ +#define SPI_CR_BITENABLE_Msk (0x4UL) /*!< BITENABLE (Bitfield-Mask: 0x01) */ +#define SPI_CR_CPHA_Pos (3UL) /*!< CPHA (Bit 3) */ +#define SPI_CR_CPHA_Msk (0x8UL) /*!< CPHA (Bitfield-Mask: 0x01) */ +#define SPI_CR_CPOL_Pos (4UL) /*!< CPOL (Bit 4) */ +#define SPI_CR_CPOL_Msk (0x10UL) /*!< CPOL (Bitfield-Mask: 0x01) */ +#define SPI_CR_MSTR_Pos (5UL) /*!< MSTR (Bit 5) */ +#define SPI_CR_MSTR_Msk (0x20UL) /*!< MSTR (Bitfield-Mask: 0x01) */ +#define SPI_CR_LSBF_Pos (6UL) /*!< LSBF (Bit 6) */ +#define SPI_CR_LSBF_Msk (0x40UL) /*!< LSBF (Bitfield-Mask: 0x01) */ +#define SPI_CR_SPIE_Pos (7UL) /*!< SPIE (Bit 7) */ +#define SPI_CR_SPIE_Msk (0x80UL) /*!< SPIE (Bitfield-Mask: 0x01) */ +#define SPI_CR_BITS_Pos (8UL) /*!< BITS (Bit 8) */ +#define SPI_CR_BITS_Msk (0xf00UL) /*!< BITS (Bitfield-Mask: 0x0f) */ +/* ========================================================== SR =========================================================== */ +#define SPI_SR_ABRT_Pos (3UL) /*!< ABRT (Bit 3) */ +#define SPI_SR_ABRT_Msk (0x8UL) /*!< ABRT (Bitfield-Mask: 0x01) */ +#define SPI_SR_MODF_Pos (4UL) /*!< MODF (Bit 4) */ +#define SPI_SR_MODF_Msk (0x10UL) /*!< MODF (Bitfield-Mask: 0x01) */ +#define SPI_SR_ROVR_Pos (5UL) /*!< ROVR (Bit 5) */ +#define SPI_SR_ROVR_Msk (0x20UL) /*!< ROVR (Bitfield-Mask: 0x01) */ +#define SPI_SR_WCOL_Pos (6UL) /*!< WCOL (Bit 6) */ +#define SPI_SR_WCOL_Msk (0x40UL) /*!< WCOL (Bitfield-Mask: 0x01) */ +#define SPI_SR_SPIF_Pos (7UL) /*!< SPIF (Bit 7) */ +#define SPI_SR_SPIF_Msk (0x80UL) /*!< SPIF (Bitfield-Mask: 0x01) */ +/* ========================================================== DR =========================================================== */ +#define SPI_DR_DATALOW_Pos (0UL) /*!< DATALOW (Bit 0) */ +#define SPI_DR_DATALOW_Msk (0xffUL) /*!< DATALOW (Bitfield-Mask: 0xff) */ +#define SPI_DR_DATAHIGH_Pos (8UL) /*!< DATAHIGH (Bit 8) */ +#define SPI_DR_DATAHIGH_Msk (0xff00UL) /*!< DATAHIGH (Bitfield-Mask: 0xff) */ +/* ========================================================== CCR ========================================================== */ +#define SPI_CCR_COUNTER_Pos (0UL) /*!< COUNTER (Bit 0) */ +#define SPI_CCR_COUNTER_Msk (0xffUL) /*!< COUNTER (Bitfield-Mask: 0xff) */ +/* ========================================================== INT ========================================================== */ +#define SPI_INT_SPIF_Pos (0UL) /*!< SPIF (Bit 0) */ +#define SPI_INT_SPIF_Msk (0x1UL) /*!< SPIF (Bitfield-Mask: 0x01) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_RTC ================ */ +/* =========================================================================================================================== */ + +/* ========================================================== ILR ========================================================== */ +#define RTC_ILR_RTCCIF_Pos (0UL) /*!< RTCCIF (Bit 0) */ +#define RTC_ILR_RTCCIF_Msk (0x1UL) /*!< RTCCIF (Bitfield-Mask: 0x01) */ +#define RTC_ILR_RTCALF_Pos (1UL) /*!< RTCALF (Bit 1) */ +#define RTC_ILR_RTCALF_Msk (0x2UL) /*!< RTCALF (Bitfield-Mask: 0x01) */ +/* ========================================================== CCR ========================================================== */ +#define RTC_CCR_CLKEN_Pos (0UL) /*!< CLKEN (Bit 0) */ +#define RTC_CCR_CLKEN_Msk (0x1UL) /*!< CLKEN (Bitfield-Mask: 0x01) */ +#define RTC_CCR_CTCRST_Pos (1UL) /*!< CTCRST (Bit 1) */ +#define RTC_CCR_CTCRST_Msk (0x2UL) /*!< CTCRST (Bitfield-Mask: 0x01) */ +#define RTC_CCR_CCALEN_Pos (4UL) /*!< CCALEN (Bit 4) */ +#define RTC_CCR_CCALEN_Msk (0x10UL) /*!< CCALEN (Bitfield-Mask: 0x01) */ +/* ========================================================= CIIR ========================================================== */ +#define RTC_CIIR_IMSEC_Pos (0UL) /*!< IMSEC (Bit 0) */ +#define RTC_CIIR_IMSEC_Msk (0x1UL) /*!< IMSEC (Bitfield-Mask: 0x01) */ +#define RTC_CIIR_IMMIN_Pos (1UL) /*!< IMMIN (Bit 1) */ +#define RTC_CIIR_IMMIN_Msk (0x2UL) /*!< IMMIN (Bitfield-Mask: 0x01) */ +#define RTC_CIIR_IMHOUR_Pos (2UL) /*!< IMHOUR (Bit 2) */ +#define RTC_CIIR_IMHOUR_Msk (0x4UL) /*!< IMHOUR (Bitfield-Mask: 0x01) */ +#define RTC_CIIR_IMDOM_Pos (3UL) /*!< IMDOM (Bit 3) */ +#define RTC_CIIR_IMDOM_Msk (0x8UL) /*!< IMDOM (Bitfield-Mask: 0x01) */ +#define RTC_CIIR_IMDOW_Pos (4UL) /*!< IMDOW (Bit 4) */ +#define RTC_CIIR_IMDOW_Msk (0x10UL) /*!< IMDOW (Bitfield-Mask: 0x01) */ +#define RTC_CIIR_IMDOY_Pos (5UL) /*!< IMDOY (Bit 5) */ +#define RTC_CIIR_IMDOY_Msk (0x20UL) /*!< IMDOY (Bitfield-Mask: 0x01) */ +#define RTC_CIIR_IMMON_Pos (6UL) /*!< IMMON (Bit 6) */ +#define RTC_CIIR_IMMON_Msk (0x40UL) /*!< IMMON (Bitfield-Mask: 0x01) */ +#define RTC_CIIR_IMYEAR_Pos (7UL) /*!< IMYEAR (Bit 7) */ +#define RTC_CIIR_IMYEAR_Msk (0x80UL) /*!< IMYEAR (Bitfield-Mask: 0x01) */ +/* ========================================================== AMR ========================================================== */ +#define RTC_AMR_AMRSEC_Pos (0UL) /*!< AMRSEC (Bit 0) */ +#define RTC_AMR_AMRSEC_Msk (0x1UL) /*!< AMRSEC (Bitfield-Mask: 0x01) */ +#define RTC_AMR_AMRMIN_Pos (1UL) /*!< AMRMIN (Bit 1) */ +#define RTC_AMR_AMRMIN_Msk (0x2UL) /*!< AMRMIN (Bitfield-Mask: 0x01) */ +#define RTC_AMR_AMRHOUR_Pos (2UL) /*!< AMRHOUR (Bit 2) */ +#define RTC_AMR_AMRHOUR_Msk (0x4UL) /*!< AMRHOUR (Bitfield-Mask: 0x01) */ +#define RTC_AMR_AMRDOM_Pos (3UL) /*!< AMRDOM (Bit 3) */ +#define RTC_AMR_AMRDOM_Msk (0x8UL) /*!< AMRDOM (Bitfield-Mask: 0x01) */ +#define RTC_AMR_AMRDOW_Pos (4UL) /*!< AMRDOW (Bit 4) */ +#define RTC_AMR_AMRDOW_Msk (0x10UL) /*!< AMRDOW (Bitfield-Mask: 0x01) */ +#define RTC_AMR_AMRDOY_Pos (5UL) /*!< AMRDOY (Bit 5) */ +#define RTC_AMR_AMRDOY_Msk (0x20UL) /*!< AMRDOY (Bitfield-Mask: 0x01) */ +#define RTC_AMR_AMRMON_Pos (6UL) /*!< AMRMON (Bit 6) */ +#define RTC_AMR_AMRMON_Msk (0x40UL) /*!< AMRMON (Bitfield-Mask: 0x01) */ +#define RTC_AMR_AMRYEAR_Pos (7UL) /*!< AMRYEAR (Bit 7) */ +#define RTC_AMR_AMRYEAR_Msk (0x80UL) /*!< AMRYEAR (Bitfield-Mask: 0x01) */ +/* ======================================================== CTIME0 ========================================================= */ +#define RTC_CTIME0_SECONDS_Pos (0UL) /*!< SECONDS (Bit 0) */ +#define RTC_CTIME0_SECONDS_Msk (0x3fUL) /*!< SECONDS (Bitfield-Mask: 0x3f) */ +#define RTC_CTIME0_MINUTES_Pos (8UL) /*!< MINUTES (Bit 8) */ +#define RTC_CTIME0_MINUTES_Msk (0x3f00UL) /*!< MINUTES (Bitfield-Mask: 0x3f) */ +#define RTC_CTIME0_HOURS_Pos (16UL) /*!< HOURS (Bit 16) */ +#define RTC_CTIME0_HOURS_Msk (0x1f0000UL) /*!< HOURS (Bitfield-Mask: 0x1f) */ +#define RTC_CTIME0_DOW_Pos (24UL) /*!< DOW (Bit 24) */ +#define RTC_CTIME0_DOW_Msk (0x7000000UL) /*!< DOW (Bitfield-Mask: 0x07) */ +/* ======================================================== CTIME1 ========================================================= */ +#define RTC_CTIME1_DOM_Pos (0UL) /*!< DOM (Bit 0) */ +#define RTC_CTIME1_DOM_Msk (0x1fUL) /*!< DOM (Bitfield-Mask: 0x1f) */ +#define RTC_CTIME1_MONTH_Pos (8UL) /*!< MONTH (Bit 8) */ +#define RTC_CTIME1_MONTH_Msk (0xf00UL) /*!< MONTH (Bitfield-Mask: 0x0f) */ +#define RTC_CTIME1_YEAR_Pos (16UL) /*!< YEAR (Bit 16) */ +#define RTC_CTIME1_YEAR_Msk (0xfff0000UL) /*!< YEAR (Bitfield-Mask: 0xfff) */ +/* ======================================================== CTIME2 ========================================================= */ +#define RTC_CTIME2_DOY_Pos (0UL) /*!< DOY (Bit 0) */ +#define RTC_CTIME2_DOY_Msk (0xfffUL) /*!< DOY (Bitfield-Mask: 0xfff) */ +/* ========================================================== SEC ========================================================== */ +#define RTC_SEC_SECONDS_Pos (0UL) /*!< SECONDS (Bit 0) */ +#define RTC_SEC_SECONDS_Msk (0x3fUL) /*!< SECONDS (Bitfield-Mask: 0x3f) */ +/* ========================================================== MIN ========================================================== */ +#define RTC_MIN_MINUTES_Pos (0UL) /*!< MINUTES (Bit 0) */ +#define RTC_MIN_MINUTES_Msk (0x3fUL) /*!< MINUTES (Bitfield-Mask: 0x3f) */ +/* ========================================================== HRS ========================================================== */ +#define RTC_HRS_HOURS_Pos (0UL) /*!< HOURS (Bit 0) */ +#define RTC_HRS_HOURS_Msk (0x1fUL) /*!< HOURS (Bitfield-Mask: 0x1f) */ +/* ========================================================== DOM ========================================================== */ +#define RTC_DOM_DOM_Pos (0UL) /*!< DOM (Bit 0) */ +#define RTC_DOM_DOM_Msk (0x1fUL) /*!< DOM (Bitfield-Mask: 0x1f) */ +/* ========================================================== DOW ========================================================== */ +#define RTC_DOW_DOW_Pos (0UL) /*!< DOW (Bit 0) */ +#define RTC_DOW_DOW_Msk (0x7UL) /*!< DOW (Bitfield-Mask: 0x07) */ +/* ========================================================== DOY ========================================================== */ +#define RTC_DOY_DOY_Pos (0UL) /*!< DOY (Bit 0) */ +#define RTC_DOY_DOY_Msk (0x1ffUL) /*!< DOY (Bitfield-Mask: 0x1ff) */ +/* ========================================================= MONTH ========================================================= */ +#define RTC_MONTH_MONTH_Pos (0UL) /*!< MONTH (Bit 0) */ +#define RTC_MONTH_MONTH_Msk (0xfUL) /*!< MONTH (Bitfield-Mask: 0x0f) */ +/* ========================================================= YEAR ========================================================== */ +#define RTC_YEAR_YEAR_Pos (0UL) /*!< YEAR (Bit 0) */ +#define RTC_YEAR_YEAR_Msk (0xfffUL) /*!< YEAR (Bitfield-Mask: 0xfff) */ +/* ====================================================== CALIBRATION ====================================================== */ +#define RTC_CALIBRATION_CALVAL_Pos (0UL) /*!< CALVAL (Bit 0) */ +#define RTC_CALIBRATION_CALVAL_Msk (0x1ffffUL) /*!< CALVAL (Bitfield-Mask: 0x1ffff) */ +#define RTC_CALIBRATION_CALDIR_Pos (17UL) /*!< CALDIR (Bit 17) */ +#define RTC_CALIBRATION_CALDIR_Msk (0x20000UL) /*!< CALDIR (Bitfield-Mask: 0x01) */ +/* ======================================================== GPREG0 ========================================================= */ +#define RTC_GPREG0_GP_Pos (0UL) /*!< GP (Bit 0) */ +#define RTC_GPREG0_GP_Msk (0xffffffffUL) /*!< GP (Bitfield-Mask: 0xffffffff) */ +/* ======================================================== GPREG1 ========================================================= */ +#define RTC_GPREG1_GP_Pos (0UL) /*!< GP (Bit 0) */ +#define RTC_GPREG1_GP_Msk (0xffffffffUL) /*!< GP (Bitfield-Mask: 0xffffffff) */ +/* ======================================================== GPREG2 ========================================================= */ +#define RTC_GPREG2_GP_Pos (0UL) /*!< GP (Bit 0) */ +#define RTC_GPREG2_GP_Msk (0xffffffffUL) /*!< GP (Bitfield-Mask: 0xffffffff) */ +/* ======================================================== GPREG3 ========================================================= */ +#define RTC_GPREG3_GP_Pos (0UL) /*!< GP (Bit 0) */ +#define RTC_GPREG3_GP_Msk (0xffffffffUL) /*!< GP (Bitfield-Mask: 0xffffffff) */ +/* ======================================================== GPREG4 ========================================================= */ +#define RTC_GPREG4_GP_Pos (0UL) /*!< GP (Bit 0) */ +#define RTC_GPREG4_GP_Msk (0xffffffffUL) /*!< GP (Bitfield-Mask: 0xffffffff) */ +/* ======================================================== RTC_AUX ======================================================== */ +#define RTC_RTC_AUX_RTC_OSCF_Pos (4UL) /*!< RTC_OSCF (Bit 4) */ +#define RTC_RTC_AUX_RTC_OSCF_Msk (0x10UL) /*!< RTC_OSCF (Bitfield-Mask: 0x01) */ +#define RTC_RTC_AUX_RTC_PDOUT_Pos (6UL) /*!< RTC_PDOUT (Bit 6) */ +#define RTC_RTC_AUX_RTC_PDOUT_Msk (0x40UL) /*!< RTC_PDOUT (Bitfield-Mask: 0x01) */ +/* ======================================================= RTC_AUXEN ======================================================= */ +#define RTC_RTC_AUXEN_RTC_OSCFEN_Pos (4UL) /*!< RTC_OSCFEN (Bit 4) */ +#define RTC_RTC_AUXEN_RTC_OSCFEN_Msk (0x10UL) /*!< RTC_OSCFEN (Bitfield-Mask: 0x01) */ +/* ========================================================= ASEC ========================================================== */ +#define RTC_ASEC_SECONDS_Pos (0UL) /*!< SECONDS (Bit 0) */ +#define RTC_ASEC_SECONDS_Msk (0x3fUL) /*!< SECONDS (Bitfield-Mask: 0x3f) */ +/* ========================================================= AMIN ========================================================== */ +#define RTC_AMIN_MINUTES_Pos (0UL) /*!< MINUTES (Bit 0) */ +#define RTC_AMIN_MINUTES_Msk (0x3fUL) /*!< MINUTES (Bitfield-Mask: 0x3f) */ +/* ========================================================= AHRS ========================================================== */ +#define RTC_AHRS_HOURS_Pos (0UL) /*!< HOURS (Bit 0) */ +#define RTC_AHRS_HOURS_Msk (0x1fUL) /*!< HOURS (Bitfield-Mask: 0x1f) */ +/* ========================================================= ADOM ========================================================== */ +#define RTC_ADOM_DOM_Pos (0UL) /*!< DOM (Bit 0) */ +#define RTC_ADOM_DOM_Msk (0x1fUL) /*!< DOM (Bitfield-Mask: 0x1f) */ +/* ========================================================= ADOW ========================================================== */ +#define RTC_ADOW_DOW_Pos (0UL) /*!< DOW (Bit 0) */ +#define RTC_ADOW_DOW_Msk (0x7UL) /*!< DOW (Bitfield-Mask: 0x07) */ +/* ========================================================= ADOY ========================================================== */ +#define RTC_ADOY_DOY_Pos (0UL) /*!< DOY (Bit 0) */ +#define RTC_ADOY_DOY_Msk (0x1ffUL) /*!< DOY (Bitfield-Mask: 0x1ff) */ +/* ========================================================= AMON ========================================================== */ +#define RTC_AMON_MONTH_Pos (0UL) /*!< MONTH (Bit 0) */ +#define RTC_AMON_MONTH_Msk (0xfUL) /*!< MONTH (Bitfield-Mask: 0x0f) */ +/* ========================================================= AYRS ========================================================== */ +#define RTC_AYRS_YEAR_Pos (0UL) /*!< YEAR (Bit 0) */ +#define RTC_AYRS_YEAR_Msk (0xfffUL) /*!< YEAR (Bitfield-Mask: 0xfff) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_GPIOINT ================ */ +/* =========================================================================================================================== */ + +/* ======================================================== STATUS ========================================================= */ +#define GPIOINT_STATUS_P0INT_Pos (0UL) /*!< P0INT (Bit 0) */ +#define GPIOINT_STATUS_P0INT_Msk (0x1UL) /*!< P0INT (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATUS_P2INT_Pos (2UL) /*!< P2INT (Bit 2) */ +#define GPIOINT_STATUS_P2INT_Msk (0x4UL) /*!< P2INT (Bitfield-Mask: 0x01) */ +/* ======================================================== STATR0 ========================================================= */ +#define GPIOINT_STATR0_P0_0REI_Pos (0UL) /*!< P0_0REI (Bit 0) */ +#define GPIOINT_STATR0_P0_0REI_Msk (0x1UL) /*!< P0_0REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_1REI_Pos (1UL) /*!< P0_1REI (Bit 1) */ +#define GPIOINT_STATR0_P0_1REI_Msk (0x2UL) /*!< P0_1REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_2REI_Pos (2UL) /*!< P0_2REI (Bit 2) */ +#define GPIOINT_STATR0_P0_2REI_Msk (0x4UL) /*!< P0_2REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_3REI_Pos (3UL) /*!< P0_3REI (Bit 3) */ +#define GPIOINT_STATR0_P0_3REI_Msk (0x8UL) /*!< P0_3REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_4REI_Pos (4UL) /*!< P0_4REI (Bit 4) */ +#define GPIOINT_STATR0_P0_4REI_Msk (0x10UL) /*!< P0_4REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_5REI_Pos (5UL) /*!< P0_5REI (Bit 5) */ +#define GPIOINT_STATR0_P0_5REI_Msk (0x20UL) /*!< P0_5REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_6REI_Pos (6UL) /*!< P0_6REI (Bit 6) */ +#define GPIOINT_STATR0_P0_6REI_Msk (0x40UL) /*!< P0_6REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_7REI_Pos (7UL) /*!< P0_7REI (Bit 7) */ +#define GPIOINT_STATR0_P0_7REI_Msk (0x80UL) /*!< P0_7REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_8REI_Pos (8UL) /*!< P0_8REI (Bit 8) */ +#define GPIOINT_STATR0_P0_8REI_Msk (0x100UL) /*!< P0_8REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_9REI_Pos (9UL) /*!< P0_9REI (Bit 9) */ +#define GPIOINT_STATR0_P0_9REI_Msk (0x200UL) /*!< P0_9REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_10REI_Pos (10UL) /*!< P0_10REI (Bit 10) */ +#define GPIOINT_STATR0_P0_10REI_Msk (0x400UL) /*!< P0_10REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_11REI_Pos (11UL) /*!< P0_11REI (Bit 11) */ +#define GPIOINT_STATR0_P0_11REI_Msk (0x800UL) /*!< P0_11REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_12REI_Pos (12UL) /*!< P0_12REI (Bit 12) */ +#define GPIOINT_STATR0_P0_12REI_Msk (0x1000UL) /*!< P0_12REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_13REI_Pos (13UL) /*!< P0_13REI (Bit 13) */ +#define GPIOINT_STATR0_P0_13REI_Msk (0x2000UL) /*!< P0_13REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_14REI_Pos (14UL) /*!< P0_14REI (Bit 14) */ +#define GPIOINT_STATR0_P0_14REI_Msk (0x4000UL) /*!< P0_14REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_15REI_Pos (15UL) /*!< P0_15REI (Bit 15) */ +#define GPIOINT_STATR0_P0_15REI_Msk (0x8000UL) /*!< P0_15REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_16REI_Pos (16UL) /*!< P0_16REI (Bit 16) */ +#define GPIOINT_STATR0_P0_16REI_Msk (0x10000UL) /*!< P0_16REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_17REI_Pos (17UL) /*!< P0_17REI (Bit 17) */ +#define GPIOINT_STATR0_P0_17REI_Msk (0x20000UL) /*!< P0_17REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_18REI_Pos (18UL) /*!< P0_18REI (Bit 18) */ +#define GPIOINT_STATR0_P0_18REI_Msk (0x40000UL) /*!< P0_18REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_19REI_Pos (19UL) /*!< P0_19REI (Bit 19) */ +#define GPIOINT_STATR0_P0_19REI_Msk (0x80000UL) /*!< P0_19REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_20REI_Pos (20UL) /*!< P0_20REI (Bit 20) */ +#define GPIOINT_STATR0_P0_20REI_Msk (0x100000UL) /*!< P0_20REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_21REI_Pos (21UL) /*!< P0_21REI (Bit 21) */ +#define GPIOINT_STATR0_P0_21REI_Msk (0x200000UL) /*!< P0_21REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_22REI_Pos (22UL) /*!< P0_22REI (Bit 22) */ +#define GPIOINT_STATR0_P0_22REI_Msk (0x400000UL) /*!< P0_22REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_23REI_Pos (23UL) /*!< P0_23REI (Bit 23) */ +#define GPIOINT_STATR0_P0_23REI_Msk (0x800000UL) /*!< P0_23REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_24REI_Pos (24UL) /*!< P0_24REI (Bit 24) */ +#define GPIOINT_STATR0_P0_24REI_Msk (0x1000000UL) /*!< P0_24REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_25REI_Pos (25UL) /*!< P0_25REI (Bit 25) */ +#define GPIOINT_STATR0_P0_25REI_Msk (0x2000000UL) /*!< P0_25REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_26REI_Pos (26UL) /*!< P0_26REI (Bit 26) */ +#define GPIOINT_STATR0_P0_26REI_Msk (0x4000000UL) /*!< P0_26REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_27REI_Pos (27UL) /*!< P0_27REI (Bit 27) */ +#define GPIOINT_STATR0_P0_27REI_Msk (0x8000000UL) /*!< P0_27REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_28REI_Pos (28UL) /*!< P0_28REI (Bit 28) */ +#define GPIOINT_STATR0_P0_28REI_Msk (0x10000000UL) /*!< P0_28REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_29REI_Pos (29UL) /*!< P0_29REI (Bit 29) */ +#define GPIOINT_STATR0_P0_29REI_Msk (0x20000000UL) /*!< P0_29REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR0_P0_30REI_Pos (30UL) /*!< P0_30REI (Bit 30) */ +#define GPIOINT_STATR0_P0_30REI_Msk (0x40000000UL) /*!< P0_30REI (Bitfield-Mask: 0x01) */ +/* ======================================================== STATF0 ========================================================= */ +#define GPIOINT_STATF0_P0_0FEI_Pos (0UL) /*!< P0_0FEI (Bit 0) */ +#define GPIOINT_STATF0_P0_0FEI_Msk (0x1UL) /*!< P0_0FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_1FEI_Pos (1UL) /*!< P0_1FEI (Bit 1) */ +#define GPIOINT_STATF0_P0_1FEI_Msk (0x2UL) /*!< P0_1FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_2FEI_Pos (2UL) /*!< P0_2FEI (Bit 2) */ +#define GPIOINT_STATF0_P0_2FEI_Msk (0x4UL) /*!< P0_2FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_3FEI_Pos (3UL) /*!< P0_3FEI (Bit 3) */ +#define GPIOINT_STATF0_P0_3FEI_Msk (0x8UL) /*!< P0_3FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_4FEI_Pos (4UL) /*!< P0_4FEI (Bit 4) */ +#define GPIOINT_STATF0_P0_4FEI_Msk (0x10UL) /*!< P0_4FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_5FEI_Pos (5UL) /*!< P0_5FEI (Bit 5) */ +#define GPIOINT_STATF0_P0_5FEI_Msk (0x20UL) /*!< P0_5FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_6FEI_Pos (6UL) /*!< P0_6FEI (Bit 6) */ +#define GPIOINT_STATF0_P0_6FEI_Msk (0x40UL) /*!< P0_6FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_7FEI_Pos (7UL) /*!< P0_7FEI (Bit 7) */ +#define GPIOINT_STATF0_P0_7FEI_Msk (0x80UL) /*!< P0_7FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_8FEI_Pos (8UL) /*!< P0_8FEI (Bit 8) */ +#define GPIOINT_STATF0_P0_8FEI_Msk (0x100UL) /*!< P0_8FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_9FEI_Pos (9UL) /*!< P0_9FEI (Bit 9) */ +#define GPIOINT_STATF0_P0_9FEI_Msk (0x200UL) /*!< P0_9FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_10FEI_Pos (10UL) /*!< P0_10FEI (Bit 10) */ +#define GPIOINT_STATF0_P0_10FEI_Msk (0x400UL) /*!< P0_10FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_11FEI_Pos (11UL) /*!< P0_11FEI (Bit 11) */ +#define GPIOINT_STATF0_P0_11FEI_Msk (0x800UL) /*!< P0_11FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_12FEI_Pos (12UL) /*!< P0_12FEI (Bit 12) */ +#define GPIOINT_STATF0_P0_12FEI_Msk (0x1000UL) /*!< P0_12FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_13FEI_Pos (13UL) /*!< P0_13FEI (Bit 13) */ +#define GPIOINT_STATF0_P0_13FEI_Msk (0x2000UL) /*!< P0_13FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_14FEI_Pos (14UL) /*!< P0_14FEI (Bit 14) */ +#define GPIOINT_STATF0_P0_14FEI_Msk (0x4000UL) /*!< P0_14FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_15FEI_Pos (15UL) /*!< P0_15FEI (Bit 15) */ +#define GPIOINT_STATF0_P0_15FEI_Msk (0x8000UL) /*!< P0_15FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_16FEI_Pos (16UL) /*!< P0_16FEI (Bit 16) */ +#define GPIOINT_STATF0_P0_16FEI_Msk (0x10000UL) /*!< P0_16FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_17FEI_Pos (17UL) /*!< P0_17FEI (Bit 17) */ +#define GPIOINT_STATF0_P0_17FEI_Msk (0x20000UL) /*!< P0_17FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_18FEI_Pos (18UL) /*!< P0_18FEI (Bit 18) */ +#define GPIOINT_STATF0_P0_18FEI_Msk (0x40000UL) /*!< P0_18FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_19FEI_Pos (19UL) /*!< P0_19FEI (Bit 19) */ +#define GPIOINT_STATF0_P0_19FEI_Msk (0x80000UL) /*!< P0_19FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_20FEI_Pos (20UL) /*!< P0_20FEI (Bit 20) */ +#define GPIOINT_STATF0_P0_20FEI_Msk (0x100000UL) /*!< P0_20FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_21FEI_Pos (21UL) /*!< P0_21FEI (Bit 21) */ +#define GPIOINT_STATF0_P0_21FEI_Msk (0x200000UL) /*!< P0_21FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_22FEI_Pos (22UL) /*!< P0_22FEI (Bit 22) */ +#define GPIOINT_STATF0_P0_22FEI_Msk (0x400000UL) /*!< P0_22FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_23FEI_Pos (23UL) /*!< P0_23FEI (Bit 23) */ +#define GPIOINT_STATF0_P0_23FEI_Msk (0x800000UL) /*!< P0_23FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_24FEI_Pos (24UL) /*!< P0_24FEI (Bit 24) */ +#define GPIOINT_STATF0_P0_24FEI_Msk (0x1000000UL) /*!< P0_24FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_25FEI_Pos (25UL) /*!< P0_25FEI (Bit 25) */ +#define GPIOINT_STATF0_P0_25FEI_Msk (0x2000000UL) /*!< P0_25FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_26FEI_Pos (26UL) /*!< P0_26FEI (Bit 26) */ +#define GPIOINT_STATF0_P0_26FEI_Msk (0x4000000UL) /*!< P0_26FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_27FEI_Pos (27UL) /*!< P0_27FEI (Bit 27) */ +#define GPIOINT_STATF0_P0_27FEI_Msk (0x8000000UL) /*!< P0_27FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_28FEI_Pos (28UL) /*!< P0_28FEI (Bit 28) */ +#define GPIOINT_STATF0_P0_28FEI_Msk (0x10000000UL) /*!< P0_28FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_29FEI_Pos (29UL) /*!< P0_29FEI (Bit 29) */ +#define GPIOINT_STATF0_P0_29FEI_Msk (0x20000000UL) /*!< P0_29FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF0_P0_30FEI_Pos (30UL) /*!< P0_30FEI (Bit 30) */ +#define GPIOINT_STATF0_P0_30FEI_Msk (0x40000000UL) /*!< P0_30FEI (Bitfield-Mask: 0x01) */ +/* ========================================================= CLR0 ========================================================== */ +#define GPIOINT_CLR0_P0_0CI_Pos (0UL) /*!< P0_0CI (Bit 0) */ +#define GPIOINT_CLR0_P0_0CI_Msk (0x1UL) /*!< P0_0CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_1CI_Pos (1UL) /*!< P0_1CI (Bit 1) */ +#define GPIOINT_CLR0_P0_1CI_Msk (0x2UL) /*!< P0_1CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_2CI_Pos (2UL) /*!< P0_2CI (Bit 2) */ +#define GPIOINT_CLR0_P0_2CI_Msk (0x4UL) /*!< P0_2CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_3CI_Pos (3UL) /*!< P0_3CI (Bit 3) */ +#define GPIOINT_CLR0_P0_3CI_Msk (0x8UL) /*!< P0_3CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_4CI_Pos (4UL) /*!< P0_4CI (Bit 4) */ +#define GPIOINT_CLR0_P0_4CI_Msk (0x10UL) /*!< P0_4CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_5CI_Pos (5UL) /*!< P0_5CI (Bit 5) */ +#define GPIOINT_CLR0_P0_5CI_Msk (0x20UL) /*!< P0_5CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_6CI_Pos (6UL) /*!< P0_6CI (Bit 6) */ +#define GPIOINT_CLR0_P0_6CI_Msk (0x40UL) /*!< P0_6CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_7CI_Pos (7UL) /*!< P0_7CI (Bit 7) */ +#define GPIOINT_CLR0_P0_7CI_Msk (0x80UL) /*!< P0_7CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_8CI_Pos (8UL) /*!< P0_8CI (Bit 8) */ +#define GPIOINT_CLR0_P0_8CI_Msk (0x100UL) /*!< P0_8CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_9CI_Pos (9UL) /*!< P0_9CI (Bit 9) */ +#define GPIOINT_CLR0_P0_9CI_Msk (0x200UL) /*!< P0_9CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_10CI_Pos (10UL) /*!< P0_10CI (Bit 10) */ +#define GPIOINT_CLR0_P0_10CI_Msk (0x400UL) /*!< P0_10CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_11CI_Pos (11UL) /*!< P0_11CI (Bit 11) */ +#define GPIOINT_CLR0_P0_11CI_Msk (0x800UL) /*!< P0_11CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_12CI_Pos (12UL) /*!< P0_12CI (Bit 12) */ +#define GPIOINT_CLR0_P0_12CI_Msk (0x1000UL) /*!< P0_12CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_13CI_Pos (13UL) /*!< P0_13CI (Bit 13) */ +#define GPIOINT_CLR0_P0_13CI_Msk (0x2000UL) /*!< P0_13CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_14CI_Pos (14UL) /*!< P0_14CI (Bit 14) */ +#define GPIOINT_CLR0_P0_14CI_Msk (0x4000UL) /*!< P0_14CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_15CI_Pos (15UL) /*!< P0_15CI (Bit 15) */ +#define GPIOINT_CLR0_P0_15CI_Msk (0x8000UL) /*!< P0_15CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_16CI_Pos (16UL) /*!< P0_16CI (Bit 16) */ +#define GPIOINT_CLR0_P0_16CI_Msk (0x10000UL) /*!< P0_16CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_17CI_Pos (17UL) /*!< P0_17CI (Bit 17) */ +#define GPIOINT_CLR0_P0_17CI_Msk (0x20000UL) /*!< P0_17CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_18CI_Pos (18UL) /*!< P0_18CI (Bit 18) */ +#define GPIOINT_CLR0_P0_18CI_Msk (0x40000UL) /*!< P0_18CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_19CI_Pos (19UL) /*!< P0_19CI (Bit 19) */ +#define GPIOINT_CLR0_P0_19CI_Msk (0x80000UL) /*!< P0_19CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_20CI_Pos (20UL) /*!< P0_20CI (Bit 20) */ +#define GPIOINT_CLR0_P0_20CI_Msk (0x100000UL) /*!< P0_20CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_21CI_Pos (21UL) /*!< P0_21CI (Bit 21) */ +#define GPIOINT_CLR0_P0_21CI_Msk (0x200000UL) /*!< P0_21CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_22CI_Pos (22UL) /*!< P0_22CI (Bit 22) */ +#define GPIOINT_CLR0_P0_22CI_Msk (0x400000UL) /*!< P0_22CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_23CI_Pos (23UL) /*!< P0_23CI (Bit 23) */ +#define GPIOINT_CLR0_P0_23CI_Msk (0x800000UL) /*!< P0_23CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_24CI_Pos (24UL) /*!< P0_24CI (Bit 24) */ +#define GPIOINT_CLR0_P0_24CI_Msk (0x1000000UL) /*!< P0_24CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_25CI_Pos (25UL) /*!< P0_25CI (Bit 25) */ +#define GPIOINT_CLR0_P0_25CI_Msk (0x2000000UL) /*!< P0_25CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_26CI_Pos (26UL) /*!< P0_26CI (Bit 26) */ +#define GPIOINT_CLR0_P0_26CI_Msk (0x4000000UL) /*!< P0_26CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_27CI_Pos (27UL) /*!< P0_27CI (Bit 27) */ +#define GPIOINT_CLR0_P0_27CI_Msk (0x8000000UL) /*!< P0_27CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_28CI_Pos (28UL) /*!< P0_28CI (Bit 28) */ +#define GPIOINT_CLR0_P0_28CI_Msk (0x10000000UL) /*!< P0_28CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_29CI_Pos (29UL) /*!< P0_29CI (Bit 29) */ +#define GPIOINT_CLR0_P0_29CI_Msk (0x20000000UL) /*!< P0_29CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR0_P0_30CI_Pos (30UL) /*!< P0_30CI (Bit 30) */ +#define GPIOINT_CLR0_P0_30CI_Msk (0x40000000UL) /*!< P0_30CI (Bitfield-Mask: 0x01) */ +/* ========================================================= ENR0 ========================================================== */ +#define GPIOINT_ENR0_P0_0ER_Pos (0UL) /*!< P0_0ER (Bit 0) */ +#define GPIOINT_ENR0_P0_0ER_Msk (0x1UL) /*!< P0_0ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_1ER_Pos (1UL) /*!< P0_1ER (Bit 1) */ +#define GPIOINT_ENR0_P0_1ER_Msk (0x2UL) /*!< P0_1ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_2ER_Pos (2UL) /*!< P0_2ER (Bit 2) */ +#define GPIOINT_ENR0_P0_2ER_Msk (0x4UL) /*!< P0_2ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_3ER_Pos (3UL) /*!< P0_3ER (Bit 3) */ +#define GPIOINT_ENR0_P0_3ER_Msk (0x8UL) /*!< P0_3ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_4ER_Pos (4UL) /*!< P0_4ER (Bit 4) */ +#define GPIOINT_ENR0_P0_4ER_Msk (0x10UL) /*!< P0_4ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_5ER_Pos (5UL) /*!< P0_5ER (Bit 5) */ +#define GPIOINT_ENR0_P0_5ER_Msk (0x20UL) /*!< P0_5ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_6ER_Pos (6UL) /*!< P0_6ER (Bit 6) */ +#define GPIOINT_ENR0_P0_6ER_Msk (0x40UL) /*!< P0_6ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_7ER_Pos (7UL) /*!< P0_7ER (Bit 7) */ +#define GPIOINT_ENR0_P0_7ER_Msk (0x80UL) /*!< P0_7ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_8ER_Pos (8UL) /*!< P0_8ER (Bit 8) */ +#define GPIOINT_ENR0_P0_8ER_Msk (0x100UL) /*!< P0_8ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_9ER_Pos (9UL) /*!< P0_9ER (Bit 9) */ +#define GPIOINT_ENR0_P0_9ER_Msk (0x200UL) /*!< P0_9ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_10ER_Pos (10UL) /*!< P0_10ER (Bit 10) */ +#define GPIOINT_ENR0_P0_10ER_Msk (0x400UL) /*!< P0_10ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_11ER_Pos (11UL) /*!< P0_11ER (Bit 11) */ +#define GPIOINT_ENR0_P0_11ER_Msk (0x800UL) /*!< P0_11ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_12ER_Pos (12UL) /*!< P0_12ER (Bit 12) */ +#define GPIOINT_ENR0_P0_12ER_Msk (0x1000UL) /*!< P0_12ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_13ER_Pos (13UL) /*!< P0_13ER (Bit 13) */ +#define GPIOINT_ENR0_P0_13ER_Msk (0x2000UL) /*!< P0_13ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_14ER_Pos (14UL) /*!< P0_14ER (Bit 14) */ +#define GPIOINT_ENR0_P0_14ER_Msk (0x4000UL) /*!< P0_14ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_15ER_Pos (15UL) /*!< P0_15ER (Bit 15) */ +#define GPIOINT_ENR0_P0_15ER_Msk (0x8000UL) /*!< P0_15ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_16ER_Pos (16UL) /*!< P0_16ER (Bit 16) */ +#define GPIOINT_ENR0_P0_16ER_Msk (0x10000UL) /*!< P0_16ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_17ER_Pos (17UL) /*!< P0_17ER (Bit 17) */ +#define GPIOINT_ENR0_P0_17ER_Msk (0x20000UL) /*!< P0_17ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_18ER_Pos (18UL) /*!< P0_18ER (Bit 18) */ +#define GPIOINT_ENR0_P0_18ER_Msk (0x40000UL) /*!< P0_18ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_19ER_Pos (19UL) /*!< P0_19ER (Bit 19) */ +#define GPIOINT_ENR0_P0_19ER_Msk (0x80000UL) /*!< P0_19ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_20ER_Pos (20UL) /*!< P0_20ER (Bit 20) */ +#define GPIOINT_ENR0_P0_20ER_Msk (0x100000UL) /*!< P0_20ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_21ER_Pos (21UL) /*!< P0_21ER (Bit 21) */ +#define GPIOINT_ENR0_P0_21ER_Msk (0x200000UL) /*!< P0_21ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_22ER_Pos (22UL) /*!< P0_22ER (Bit 22) */ +#define GPIOINT_ENR0_P0_22ER_Msk (0x400000UL) /*!< P0_22ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_23ER_Pos (23UL) /*!< P0_23ER (Bit 23) */ +#define GPIOINT_ENR0_P0_23ER_Msk (0x800000UL) /*!< P0_23ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_24ER_Pos (24UL) /*!< P0_24ER (Bit 24) */ +#define GPIOINT_ENR0_P0_24ER_Msk (0x1000000UL) /*!< P0_24ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_25ER_Pos (25UL) /*!< P0_25ER (Bit 25) */ +#define GPIOINT_ENR0_P0_25ER_Msk (0x2000000UL) /*!< P0_25ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_26ER_Pos (26UL) /*!< P0_26ER (Bit 26) */ +#define GPIOINT_ENR0_P0_26ER_Msk (0x4000000UL) /*!< P0_26ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_27ER_Pos (27UL) /*!< P0_27ER (Bit 27) */ +#define GPIOINT_ENR0_P0_27ER_Msk (0x8000000UL) /*!< P0_27ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_28ER_Pos (28UL) /*!< P0_28ER (Bit 28) */ +#define GPIOINT_ENR0_P0_28ER_Msk (0x10000000UL) /*!< P0_28ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_29ER_Pos (29UL) /*!< P0_29ER (Bit 29) */ +#define GPIOINT_ENR0_P0_29ER_Msk (0x20000000UL) /*!< P0_29ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR0_P0_30ER_Pos (30UL) /*!< P0_30ER (Bit 30) */ +#define GPIOINT_ENR0_P0_30ER_Msk (0x40000000UL) /*!< P0_30ER (Bitfield-Mask: 0x01) */ +/* ========================================================= ENF0 ========================================================== */ +#define GPIOINT_ENF0_P0_0EF_Pos (0UL) /*!< P0_0EF (Bit 0) */ +#define GPIOINT_ENF0_P0_0EF_Msk (0x1UL) /*!< P0_0EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_1EF_Pos (1UL) /*!< P0_1EF (Bit 1) */ +#define GPIOINT_ENF0_P0_1EF_Msk (0x2UL) /*!< P0_1EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_2EF_Pos (2UL) /*!< P0_2EF (Bit 2) */ +#define GPIOINT_ENF0_P0_2EF_Msk (0x4UL) /*!< P0_2EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_3EF_Pos (3UL) /*!< P0_3EF (Bit 3) */ +#define GPIOINT_ENF0_P0_3EF_Msk (0x8UL) /*!< P0_3EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_4EF_Pos (4UL) /*!< P0_4EF (Bit 4) */ +#define GPIOINT_ENF0_P0_4EF_Msk (0x10UL) /*!< P0_4EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_5EF_Pos (5UL) /*!< P0_5EF (Bit 5) */ +#define GPIOINT_ENF0_P0_5EF_Msk (0x20UL) /*!< P0_5EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_6EF_Pos (6UL) /*!< P0_6EF (Bit 6) */ +#define GPIOINT_ENF0_P0_6EF_Msk (0x40UL) /*!< P0_6EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_7EF_Pos (7UL) /*!< P0_7EF (Bit 7) */ +#define GPIOINT_ENF0_P0_7EF_Msk (0x80UL) /*!< P0_7EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_8EF_Pos (8UL) /*!< P0_8EF (Bit 8) */ +#define GPIOINT_ENF0_P0_8EF_Msk (0x100UL) /*!< P0_8EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_9EF_Pos (9UL) /*!< P0_9EF (Bit 9) */ +#define GPIOINT_ENF0_P0_9EF_Msk (0x200UL) /*!< P0_9EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_10EF_Pos (10UL) /*!< P0_10EF (Bit 10) */ +#define GPIOINT_ENF0_P0_10EF_Msk (0x400UL) /*!< P0_10EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_11EF_Pos (11UL) /*!< P0_11EF (Bit 11) */ +#define GPIOINT_ENF0_P0_11EF_Msk (0x800UL) /*!< P0_11EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_12EF_Pos (12UL) /*!< P0_12EF (Bit 12) */ +#define GPIOINT_ENF0_P0_12EF_Msk (0x1000UL) /*!< P0_12EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_13EF_Pos (13UL) /*!< P0_13EF (Bit 13) */ +#define GPIOINT_ENF0_P0_13EF_Msk (0x2000UL) /*!< P0_13EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_14EF_Pos (14UL) /*!< P0_14EF (Bit 14) */ +#define GPIOINT_ENF0_P0_14EF_Msk (0x4000UL) /*!< P0_14EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_15EF_Pos (15UL) /*!< P0_15EF (Bit 15) */ +#define GPIOINT_ENF0_P0_15EF_Msk (0x8000UL) /*!< P0_15EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_16EF_Pos (16UL) /*!< P0_16EF (Bit 16) */ +#define GPIOINT_ENF0_P0_16EF_Msk (0x10000UL) /*!< P0_16EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_17EF_Pos (17UL) /*!< P0_17EF (Bit 17) */ +#define GPIOINT_ENF0_P0_17EF_Msk (0x20000UL) /*!< P0_17EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_18EF_Pos (18UL) /*!< P0_18EF (Bit 18) */ +#define GPIOINT_ENF0_P0_18EF_Msk (0x40000UL) /*!< P0_18EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_19EF_Pos (19UL) /*!< P0_19EF (Bit 19) */ +#define GPIOINT_ENF0_P0_19EF_Msk (0x80000UL) /*!< P0_19EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_20EF_Pos (20UL) /*!< P0_20EF (Bit 20) */ +#define GPIOINT_ENF0_P0_20EF_Msk (0x100000UL) /*!< P0_20EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_21EF_Pos (21UL) /*!< P0_21EF (Bit 21) */ +#define GPIOINT_ENF0_P0_21EF_Msk (0x200000UL) /*!< P0_21EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_22EF_Pos (22UL) /*!< P0_22EF (Bit 22) */ +#define GPIOINT_ENF0_P0_22EF_Msk (0x400000UL) /*!< P0_22EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_23EF_Pos (23UL) /*!< P0_23EF (Bit 23) */ +#define GPIOINT_ENF0_P0_23EF_Msk (0x800000UL) /*!< P0_23EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_24EF_Pos (24UL) /*!< P0_24EF (Bit 24) */ +#define GPIOINT_ENF0_P0_24EF_Msk (0x1000000UL) /*!< P0_24EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_25EF_Pos (25UL) /*!< P0_25EF (Bit 25) */ +#define GPIOINT_ENF0_P0_25EF_Msk (0x2000000UL) /*!< P0_25EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_26EF_Pos (26UL) /*!< P0_26EF (Bit 26) */ +#define GPIOINT_ENF0_P0_26EF_Msk (0x4000000UL) /*!< P0_26EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_27EF_Pos (27UL) /*!< P0_27EF (Bit 27) */ +#define GPIOINT_ENF0_P0_27EF_Msk (0x8000000UL) /*!< P0_27EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_28EF_Pos (28UL) /*!< P0_28EF (Bit 28) */ +#define GPIOINT_ENF0_P0_28EF_Msk (0x10000000UL) /*!< P0_28EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_29EF_Pos (29UL) /*!< P0_29EF (Bit 29) */ +#define GPIOINT_ENF0_P0_29EF_Msk (0x20000000UL) /*!< P0_29EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF0_P0_30EF_Pos (30UL) /*!< P0_30EF (Bit 30) */ +#define GPIOINT_ENF0_P0_30EF_Msk (0x40000000UL) /*!< P0_30EF (Bitfield-Mask: 0x01) */ +/* ======================================================== STATR2 ========================================================= */ +#define GPIOINT_STATR2_P2_0REI_Pos (0UL) /*!< P2_0REI (Bit 0) */ +#define GPIOINT_STATR2_P2_0REI_Msk (0x1UL) /*!< P2_0REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR2_P2_1REI_Pos (1UL) /*!< P2_1REI (Bit 1) */ +#define GPIOINT_STATR2_P2_1REI_Msk (0x2UL) /*!< P2_1REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR2_P2_2REI_Pos (2UL) /*!< P2_2REI (Bit 2) */ +#define GPIOINT_STATR2_P2_2REI_Msk (0x4UL) /*!< P2_2REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR2_P2_3REI_Pos (3UL) /*!< P2_3REI (Bit 3) */ +#define GPIOINT_STATR2_P2_3REI_Msk (0x8UL) /*!< P2_3REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR2_P2_4REI_Pos (4UL) /*!< P2_4REI (Bit 4) */ +#define GPIOINT_STATR2_P2_4REI_Msk (0x10UL) /*!< P2_4REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR2_P2_5REI_Pos (5UL) /*!< P2_5REI (Bit 5) */ +#define GPIOINT_STATR2_P2_5REI_Msk (0x20UL) /*!< P2_5REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR2_P2_6REI_Pos (6UL) /*!< P2_6REI (Bit 6) */ +#define GPIOINT_STATR2_P2_6REI_Msk (0x40UL) /*!< P2_6REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR2_P2_7REI_Pos (7UL) /*!< P2_7REI (Bit 7) */ +#define GPIOINT_STATR2_P2_7REI_Msk (0x80UL) /*!< P2_7REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR2_P2_8REI_Pos (8UL) /*!< P2_8REI (Bit 8) */ +#define GPIOINT_STATR2_P2_8REI_Msk (0x100UL) /*!< P2_8REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR2_P2_9REI_Pos (9UL) /*!< P2_9REI (Bit 9) */ +#define GPIOINT_STATR2_P2_9REI_Msk (0x200UL) /*!< P2_9REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR2_P2_10REI_Pos (10UL) /*!< P2_10REI (Bit 10) */ +#define GPIOINT_STATR2_P2_10REI_Msk (0x400UL) /*!< P2_10REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR2_P2_11REI_Pos (11UL) /*!< P2_11REI (Bit 11) */ +#define GPIOINT_STATR2_P2_11REI_Msk (0x800UL) /*!< P2_11REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR2_P2_12REI_Pos (12UL) /*!< P2_12REI (Bit 12) */ +#define GPIOINT_STATR2_P2_12REI_Msk (0x1000UL) /*!< P2_12REI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATR2_P2_13REI_Pos (13UL) /*!< P2_13REI (Bit 13) */ +#define GPIOINT_STATR2_P2_13REI_Msk (0x2000UL) /*!< P2_13REI (Bitfield-Mask: 0x01) */ +/* ======================================================== STATF2 ========================================================= */ +#define GPIOINT_STATF2_P2_0FEI_Pos (0UL) /*!< P2_0FEI (Bit 0) */ +#define GPIOINT_STATF2_P2_0FEI_Msk (0x1UL) /*!< P2_0FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF2_P2_1FEI_Pos (1UL) /*!< P2_1FEI (Bit 1) */ +#define GPIOINT_STATF2_P2_1FEI_Msk (0x2UL) /*!< P2_1FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF2_P2_2FEI_Pos (2UL) /*!< P2_2FEI (Bit 2) */ +#define GPIOINT_STATF2_P2_2FEI_Msk (0x4UL) /*!< P2_2FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF2_P2_3FEI_Pos (3UL) /*!< P2_3FEI (Bit 3) */ +#define GPIOINT_STATF2_P2_3FEI_Msk (0x8UL) /*!< P2_3FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF2_P2_4FEI_Pos (4UL) /*!< P2_4FEI (Bit 4) */ +#define GPIOINT_STATF2_P2_4FEI_Msk (0x10UL) /*!< P2_4FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF2_P2_5FEI_Pos (5UL) /*!< P2_5FEI (Bit 5) */ +#define GPIOINT_STATF2_P2_5FEI_Msk (0x20UL) /*!< P2_5FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF2_P2_6FEI_Pos (6UL) /*!< P2_6FEI (Bit 6) */ +#define GPIOINT_STATF2_P2_6FEI_Msk (0x40UL) /*!< P2_6FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF2_P2_7FEI_Pos (7UL) /*!< P2_7FEI (Bit 7) */ +#define GPIOINT_STATF2_P2_7FEI_Msk (0x80UL) /*!< P2_7FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF2_P2_8FEI_Pos (8UL) /*!< P2_8FEI (Bit 8) */ +#define GPIOINT_STATF2_P2_8FEI_Msk (0x100UL) /*!< P2_8FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF2_P2_9FEI_Pos (9UL) /*!< P2_9FEI (Bit 9) */ +#define GPIOINT_STATF2_P2_9FEI_Msk (0x200UL) /*!< P2_9FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF2_P2_10FEI_Pos (10UL) /*!< P2_10FEI (Bit 10) */ +#define GPIOINT_STATF2_P2_10FEI_Msk (0x400UL) /*!< P2_10FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF2_P2_11FEI_Pos (11UL) /*!< P2_11FEI (Bit 11) */ +#define GPIOINT_STATF2_P2_11FEI_Msk (0x800UL) /*!< P2_11FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF2_P2_12FEI_Pos (12UL) /*!< P2_12FEI (Bit 12) */ +#define GPIOINT_STATF2_P2_12FEI_Msk (0x1000UL) /*!< P2_12FEI (Bitfield-Mask: 0x01) */ +#define GPIOINT_STATF2_P2_13FEI_Pos (13UL) /*!< P2_13FEI (Bit 13) */ +#define GPIOINT_STATF2_P2_13FEI_Msk (0x2000UL) /*!< P2_13FEI (Bitfield-Mask: 0x01) */ +/* ========================================================= CLR2 ========================================================== */ +#define GPIOINT_CLR2_P2_0CI_Pos (0UL) /*!< P2_0CI (Bit 0) */ +#define GPIOINT_CLR2_P2_0CI_Msk (0x1UL) /*!< P2_0CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR2_P2_1CI_Pos (1UL) /*!< P2_1CI (Bit 1) */ +#define GPIOINT_CLR2_P2_1CI_Msk (0x2UL) /*!< P2_1CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR2_P2_2CI_Pos (2UL) /*!< P2_2CI (Bit 2) */ +#define GPIOINT_CLR2_P2_2CI_Msk (0x4UL) /*!< P2_2CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR2_P2_3CI_Pos (3UL) /*!< P2_3CI (Bit 3) */ +#define GPIOINT_CLR2_P2_3CI_Msk (0x8UL) /*!< P2_3CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR2_P2_4CI_Pos (4UL) /*!< P2_4CI (Bit 4) */ +#define GPIOINT_CLR2_P2_4CI_Msk (0x10UL) /*!< P2_4CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR2_P2_5CI_Pos (5UL) /*!< P2_5CI (Bit 5) */ +#define GPIOINT_CLR2_P2_5CI_Msk (0x20UL) /*!< P2_5CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR2_P2_6CI_Pos (6UL) /*!< P2_6CI (Bit 6) */ +#define GPIOINT_CLR2_P2_6CI_Msk (0x40UL) /*!< P2_6CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR2_P2_7CI_Pos (7UL) /*!< P2_7CI (Bit 7) */ +#define GPIOINT_CLR2_P2_7CI_Msk (0x80UL) /*!< P2_7CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR2_P2_8CI_Pos (8UL) /*!< P2_8CI (Bit 8) */ +#define GPIOINT_CLR2_P2_8CI_Msk (0x100UL) /*!< P2_8CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR2_P2_9CI_Pos (9UL) /*!< P2_9CI (Bit 9) */ +#define GPIOINT_CLR2_P2_9CI_Msk (0x200UL) /*!< P2_9CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR2_P2_10CI_Pos (10UL) /*!< P2_10CI (Bit 10) */ +#define GPIOINT_CLR2_P2_10CI_Msk (0x400UL) /*!< P2_10CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR2_P2_11CI_Pos (11UL) /*!< P2_11CI (Bit 11) */ +#define GPIOINT_CLR2_P2_11CI_Msk (0x800UL) /*!< P2_11CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR2_P2_12CI_Pos (12UL) /*!< P2_12CI (Bit 12) */ +#define GPIOINT_CLR2_P2_12CI_Msk (0x1000UL) /*!< P2_12CI (Bitfield-Mask: 0x01) */ +#define GPIOINT_CLR2_P2_13CI_Pos (13UL) /*!< P2_13CI (Bit 13) */ +#define GPIOINT_CLR2_P2_13CI_Msk (0x2000UL) /*!< P2_13CI (Bitfield-Mask: 0x01) */ +/* ========================================================= ENR2 ========================================================== */ +#define GPIOINT_ENR2_P2_0ER_Pos (0UL) /*!< P2_0ER (Bit 0) */ +#define GPIOINT_ENR2_P2_0ER_Msk (0x1UL) /*!< P2_0ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR2_P2_1ER_Pos (1UL) /*!< P2_1ER (Bit 1) */ +#define GPIOINT_ENR2_P2_1ER_Msk (0x2UL) /*!< P2_1ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR2_P2_2ER_Pos (2UL) /*!< P2_2ER (Bit 2) */ +#define GPIOINT_ENR2_P2_2ER_Msk (0x4UL) /*!< P2_2ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR2_P2_3ER_Pos (3UL) /*!< P2_3ER (Bit 3) */ +#define GPIOINT_ENR2_P2_3ER_Msk (0x8UL) /*!< P2_3ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR2_P2_4ER_Pos (4UL) /*!< P2_4ER (Bit 4) */ +#define GPIOINT_ENR2_P2_4ER_Msk (0x10UL) /*!< P2_4ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR2_P2_5ER_Pos (5UL) /*!< P2_5ER (Bit 5) */ +#define GPIOINT_ENR2_P2_5ER_Msk (0x20UL) /*!< P2_5ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR2_P2_6ER_Pos (6UL) /*!< P2_6ER (Bit 6) */ +#define GPIOINT_ENR2_P2_6ER_Msk (0x40UL) /*!< P2_6ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR2_P2_7ER_Pos (7UL) /*!< P2_7ER (Bit 7) */ +#define GPIOINT_ENR2_P2_7ER_Msk (0x80UL) /*!< P2_7ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR2_P2_8ER_Pos (8UL) /*!< P2_8ER (Bit 8) */ +#define GPIOINT_ENR2_P2_8ER_Msk (0x100UL) /*!< P2_8ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR2_P2_9ER_Pos (9UL) /*!< P2_9ER (Bit 9) */ +#define GPIOINT_ENR2_P2_9ER_Msk (0x200UL) /*!< P2_9ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR2_P2_10ER_Pos (10UL) /*!< P2_10ER (Bit 10) */ +#define GPIOINT_ENR2_P2_10ER_Msk (0x400UL) /*!< P2_10ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR2_P2_11ER_Pos (11UL) /*!< P2_11ER (Bit 11) */ +#define GPIOINT_ENR2_P2_11ER_Msk (0x800UL) /*!< P2_11ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR2_P2_12ER_Pos (12UL) /*!< P2_12ER (Bit 12) */ +#define GPIOINT_ENR2_P2_12ER_Msk (0x1000UL) /*!< P2_12ER (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENR2_P2_13ER_Pos (13UL) /*!< P2_13ER (Bit 13) */ +#define GPIOINT_ENR2_P2_13ER_Msk (0x2000UL) /*!< P2_13ER (Bitfield-Mask: 0x01) */ +/* ========================================================= ENF2 ========================================================== */ +#define GPIOINT_ENF2_P2_0EF_Pos (0UL) /*!< P2_0EF (Bit 0) */ +#define GPIOINT_ENF2_P2_0EF_Msk (0x1UL) /*!< P2_0EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF2_P2_1EF_Pos (1UL) /*!< P2_1EF (Bit 1) */ +#define GPIOINT_ENF2_P2_1EF_Msk (0x2UL) /*!< P2_1EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF2_P2_2EF_Pos (2UL) /*!< P2_2EF (Bit 2) */ +#define GPIOINT_ENF2_P2_2EF_Msk (0x4UL) /*!< P2_2EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF2_P2_3EF_Pos (3UL) /*!< P2_3EF (Bit 3) */ +#define GPIOINT_ENF2_P2_3EF_Msk (0x8UL) /*!< P2_3EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF2_P2_4EF_Pos (4UL) /*!< P2_4EF (Bit 4) */ +#define GPIOINT_ENF2_P2_4EF_Msk (0x10UL) /*!< P2_4EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF2_P2_5EF_Pos (5UL) /*!< P2_5EF (Bit 5) */ +#define GPIOINT_ENF2_P2_5EF_Msk (0x20UL) /*!< P2_5EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF2_P2_6EF_Pos (6UL) /*!< P2_6EF (Bit 6) */ +#define GPIOINT_ENF2_P2_6EF_Msk (0x40UL) /*!< P2_6EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF2_P2_7EF_Pos (7UL) /*!< P2_7EF (Bit 7) */ +#define GPIOINT_ENF2_P2_7EF_Msk (0x80UL) /*!< P2_7EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF2_P2_8EF_Pos (8UL) /*!< P2_8EF (Bit 8) */ +#define GPIOINT_ENF2_P2_8EF_Msk (0x100UL) /*!< P2_8EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF2_P2_9EF_Pos (9UL) /*!< P2_9EF (Bit 9) */ +#define GPIOINT_ENF2_P2_9EF_Msk (0x200UL) /*!< P2_9EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF2_P2_10EF_Pos (10UL) /*!< P2_10EF (Bit 10) */ +#define GPIOINT_ENF2_P2_10EF_Msk (0x400UL) /*!< P2_10EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF2_P2_11EF_Pos (11UL) /*!< P2_11EF (Bit 11) */ +#define GPIOINT_ENF2_P2_11EF_Msk (0x800UL) /*!< P2_11EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF2_P2_12EF_Pos (12UL) /*!< P2_12EF (Bit 12) */ +#define GPIOINT_ENF2_P2_12EF_Msk (0x1000UL) /*!< P2_12EF (Bitfield-Mask: 0x01) */ +#define GPIOINT_ENF2_P2_13EF_Pos (13UL) /*!< P2_13EF (Bit 13) */ +#define GPIOINT_ENF2_P2_13EF_Msk (0x2000UL) /*!< P2_13EF (Bitfield-Mask: 0x01) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_PINCONNECT ================ */ +/* =========================================================================================================================== */ + +/* ======================================================== PINSEL0 ======================================================== */ +#define PINCONNECT_PINSEL0_P0_0_Pos (0UL) /*!< P0_0 (Bit 0) */ +#define PINCONNECT_PINSEL0_P0_0_Msk (0x3UL) /*!< P0_0 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL0_P0_1_Pos (2UL) /*!< P0_1 (Bit 2) */ +#define PINCONNECT_PINSEL0_P0_1_Msk (0xcUL) /*!< P0_1 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL0_P0_2_Pos (4UL) /*!< P0_2 (Bit 4) */ +#define PINCONNECT_PINSEL0_P0_2_Msk (0x30UL) /*!< P0_2 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL0_P0_3_Pos (6UL) /*!< P0_3 (Bit 6) */ +#define PINCONNECT_PINSEL0_P0_3_Msk (0xc0UL) /*!< P0_3 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL0_P0_4_Pos (8UL) /*!< P0_4 (Bit 8) */ +#define PINCONNECT_PINSEL0_P0_4_Msk (0x300UL) /*!< P0_4 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL0_P0_5_Pos (10UL) /*!< P0_5 (Bit 10) */ +#define PINCONNECT_PINSEL0_P0_5_Msk (0xc00UL) /*!< P0_5 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL0_P0_6_Pos (12UL) /*!< P0_6 (Bit 12) */ +#define PINCONNECT_PINSEL0_P0_6_Msk (0x3000UL) /*!< P0_6 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL0_P0_7_Pos (14UL) /*!< P0_7 (Bit 14) */ +#define PINCONNECT_PINSEL0_P0_7_Msk (0xc000UL) /*!< P0_7 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL0_P0_8_Pos (16UL) /*!< P0_8 (Bit 16) */ +#define PINCONNECT_PINSEL0_P0_8_Msk (0x30000UL) /*!< P0_8 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL0_P0_9_Pos (18UL) /*!< P0_9 (Bit 18) */ +#define PINCONNECT_PINSEL0_P0_9_Msk (0xc0000UL) /*!< P0_9 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL0_P0_10_Pos (20UL) /*!< P0_10 (Bit 20) */ +#define PINCONNECT_PINSEL0_P0_10_Msk (0x300000UL) /*!< P0_10 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL0_P0_11_Pos (22UL) /*!< P0_11 (Bit 22) */ +#define PINCONNECT_PINSEL0_P0_11_Msk (0xc00000UL) /*!< P0_11 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL0_P0_15_Pos (30UL) /*!< P0_15 (Bit 30) */ +#define PINCONNECT_PINSEL0_P0_15_Msk (0xc0000000UL) /*!< P0_15 (Bitfield-Mask: 0x03) */ +/* ======================================================== PINSEL1 ======================================================== */ +#define PINCONNECT_PINSEL1_P0_16_Pos (0UL) /*!< P0_16 (Bit 0) */ +#define PINCONNECT_PINSEL1_P0_16_Msk (0x3UL) /*!< P0_16 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL1_P0_17_Pos (2UL) /*!< P0_17 (Bit 2) */ +#define PINCONNECT_PINSEL1_P0_17_Msk (0xcUL) /*!< P0_17 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL1_P0_18_Pos (4UL) /*!< P0_18 (Bit 4) */ +#define PINCONNECT_PINSEL1_P0_18_Msk (0x30UL) /*!< P0_18 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL1_P0_19_Pos (6UL) /*!< P0_19 (Bit 6) */ +#define PINCONNECT_PINSEL1_P0_19_Msk (0xc0UL) /*!< P0_19 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL1_P0_20_Pos (8UL) /*!< P0_20 (Bit 8) */ +#define PINCONNECT_PINSEL1_P0_20_Msk (0x300UL) /*!< P0_20 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL1_P0_21_Pos (10UL) /*!< P0_21 (Bit 10) */ +#define PINCONNECT_PINSEL1_P0_21_Msk (0xc00UL) /*!< P0_21 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL1_P0_22_Pos (12UL) /*!< P0_22 (Bit 12) */ +#define PINCONNECT_PINSEL1_P0_22_Msk (0x3000UL) /*!< P0_22 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL1_P0_23_Pos (14UL) /*!< P0_23 (Bit 14) */ +#define PINCONNECT_PINSEL1_P0_23_Msk (0xc000UL) /*!< P0_23 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL1_P0_24_Pos (16UL) /*!< P0_24 (Bit 16) */ +#define PINCONNECT_PINSEL1_P0_24_Msk (0x30000UL) /*!< P0_24 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL1_P0_25_Pos (18UL) /*!< P0_25 (Bit 18) */ +#define PINCONNECT_PINSEL1_P0_25_Msk (0xc0000UL) /*!< P0_25 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL1_P0_26_Pos (20UL) /*!< P0_26 (Bit 20) */ +#define PINCONNECT_PINSEL1_P0_26_Msk (0x300000UL) /*!< P0_26 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL1_P0_27_Pos (22UL) /*!< P0_27 (Bit 22) */ +#define PINCONNECT_PINSEL1_P0_27_Msk (0xc00000UL) /*!< P0_27 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL1_P0_28_Pos (24UL) /*!< P0_28 (Bit 24) */ +#define PINCONNECT_PINSEL1_P0_28_Msk (0x3000000UL) /*!< P0_28 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL1_P0_29_Pos (26UL) /*!< P0_29 (Bit 26) */ +#define PINCONNECT_PINSEL1_P0_29_Msk (0xc000000UL) /*!< P0_29 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL1_P0_30_Pos (28UL) /*!< P0_30 (Bit 28) */ +#define PINCONNECT_PINSEL1_P0_30_Msk (0x30000000UL) /*!< P0_30 (Bitfield-Mask: 0x03) */ +/* ======================================================== PINSEL2 ======================================================== */ +#define PINCONNECT_PINSEL2_P1_0_Pos (0UL) /*!< P1_0 (Bit 0) */ +#define PINCONNECT_PINSEL2_P1_0_Msk (0x3UL) /*!< P1_0 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL2_P1_1_Pos (2UL) /*!< P1_1 (Bit 2) */ +#define PINCONNECT_PINSEL2_P1_1_Msk (0xcUL) /*!< P1_1 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL2_P1_4_Pos (8UL) /*!< P1_4 (Bit 8) */ +#define PINCONNECT_PINSEL2_P1_4_Msk (0x300UL) /*!< P1_4 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL2_P1_8_Pos (16UL) /*!< P1_8 (Bit 16) */ +#define PINCONNECT_PINSEL2_P1_8_Msk (0x30000UL) /*!< P1_8 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL2_P1_9_Pos (18UL) /*!< P1_9 (Bit 18) */ +#define PINCONNECT_PINSEL2_P1_9_Msk (0xc0000UL) /*!< P1_9 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL2_P1_10_Pos (20UL) /*!< P1_10 (Bit 20) */ +#define PINCONNECT_PINSEL2_P1_10_Msk (0x300000UL) /*!< P1_10 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL2_P1_14_Pos (22UL) /*!< P1_14 (Bit 22) */ +#define PINCONNECT_PINSEL2_P1_14_Msk (0xc00000UL) /*!< P1_14 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL2_P1_15_Pos (30UL) /*!< P1_15 (Bit 30) */ +#define PINCONNECT_PINSEL2_P1_15_Msk (0xc0000000UL) /*!< P1_15 (Bitfield-Mask: 0x03) */ +/* ======================================================== PINSEL3 ======================================================== */ +#define PINCONNECT_PINSEL3_P1_16_Pos (0UL) /*!< P1_16 (Bit 0) */ +#define PINCONNECT_PINSEL3_P1_16_Msk (0x3UL) /*!< P1_16 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL3_P1_17_Pos (2UL) /*!< P1_17 (Bit 2) */ +#define PINCONNECT_PINSEL3_P1_17_Msk (0xcUL) /*!< P1_17 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL3_P1_18_Pos (4UL) /*!< P1_18 (Bit 4) */ +#define PINCONNECT_PINSEL3_P1_18_Msk (0x30UL) /*!< P1_18 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL3_P1_19_Pos (6UL) /*!< P1_19 (Bit 6) */ +#define PINCONNECT_PINSEL3_P1_19_Msk (0xc0UL) /*!< P1_19 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL3_P1_20_Pos (8UL) /*!< P1_20 (Bit 8) */ +#define PINCONNECT_PINSEL3_P1_20_Msk (0x300UL) /*!< P1_20 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL3_P1_21_Pos (10UL) /*!< P1_21 (Bit 10) */ +#define PINCONNECT_PINSEL3_P1_21_Msk (0xc00UL) /*!< P1_21 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL3_P1_22_Pos (12UL) /*!< P1_22 (Bit 12) */ +#define PINCONNECT_PINSEL3_P1_22_Msk (0x3000UL) /*!< P1_22 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL3_P1_23_Pos (14UL) /*!< P1_23 (Bit 14) */ +#define PINCONNECT_PINSEL3_P1_23_Msk (0xc000UL) /*!< P1_23 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL3_P1_24_Pos (16UL) /*!< P1_24 (Bit 16) */ +#define PINCONNECT_PINSEL3_P1_24_Msk (0x30000UL) /*!< P1_24 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL3_P1_25_Pos (18UL) /*!< P1_25 (Bit 18) */ +#define PINCONNECT_PINSEL3_P1_25_Msk (0xc0000UL) /*!< P1_25 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL3_P1_26_Pos (20UL) /*!< P1_26 (Bit 20) */ +#define PINCONNECT_PINSEL3_P1_26_Msk (0x300000UL) /*!< P1_26 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL3_P1_27_Pos (22UL) /*!< P1_27 (Bit 22) */ +#define PINCONNECT_PINSEL3_P1_27_Msk (0xc00000UL) /*!< P1_27 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL3_P1_28_Pos (24UL) /*!< P1_28 (Bit 24) */ +#define PINCONNECT_PINSEL3_P1_28_Msk (0x3000000UL) /*!< P1_28 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL3_P1_29_Pos (26UL) /*!< P1_29 (Bit 26) */ +#define PINCONNECT_PINSEL3_P1_29_Msk (0xc000000UL) /*!< P1_29 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL3_P1_30_Pos (28UL) /*!< P1_30 (Bit 28) */ +#define PINCONNECT_PINSEL3_P1_30_Msk (0x30000000UL) /*!< P1_30 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL3_P1_31_Pos (30UL) /*!< P1_31 (Bit 30) */ +#define PINCONNECT_PINSEL3_P1_31_Msk (0xc0000000UL) /*!< P1_31 (Bitfield-Mask: 0x03) */ +/* ======================================================== PINSEL4 ======================================================== */ +#define PINCONNECT_PINSEL4_P2_0_Pos (0UL) /*!< P2_0 (Bit 0) */ +#define PINCONNECT_PINSEL4_P2_0_Msk (0x3UL) /*!< P2_0 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL4_P2_1_Pos (2UL) /*!< P2_1 (Bit 2) */ +#define PINCONNECT_PINSEL4_P2_1_Msk (0xcUL) /*!< P2_1 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL4_P2_2_Pos (4UL) /*!< P2_2 (Bit 4) */ +#define PINCONNECT_PINSEL4_P2_2_Msk (0x30UL) /*!< P2_2 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL4_P2_3_Pos (6UL) /*!< P2_3 (Bit 6) */ +#define PINCONNECT_PINSEL4_P2_3_Msk (0xc0UL) /*!< P2_3 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL4_P2_4_Pos (8UL) /*!< P2_4 (Bit 8) */ +#define PINCONNECT_PINSEL4_P2_4_Msk (0x300UL) /*!< P2_4 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL4_P2_5_Pos (10UL) /*!< P2_5 (Bit 10) */ +#define PINCONNECT_PINSEL4_P2_5_Msk (0xc00UL) /*!< P2_5 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL4_P2_6_Pos (12UL) /*!< P2_6 (Bit 12) */ +#define PINCONNECT_PINSEL4_P2_6_Msk (0x3000UL) /*!< P2_6 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL4_P2_7_Pos (14UL) /*!< P2_7 (Bit 14) */ +#define PINCONNECT_PINSEL4_P2_7_Msk (0xc000UL) /*!< P2_7 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL4_P2_8_Pos (16UL) /*!< P2_8 (Bit 16) */ +#define PINCONNECT_PINSEL4_P2_8_Msk (0x30000UL) /*!< P2_8 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL4_P2_9_Pos (18UL) /*!< P2_9 (Bit 18) */ +#define PINCONNECT_PINSEL4_P2_9_Msk (0xc0000UL) /*!< P2_9 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL4_P2_10_Pos (20UL) /*!< P2_10 (Bit 20) */ +#define PINCONNECT_PINSEL4_P2_10_Msk (0x300000UL) /*!< P2_10 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL4_P2_11_Pos (22UL) /*!< P2_11 (Bit 22) */ +#define PINCONNECT_PINSEL4_P2_11_Msk (0xc00000UL) /*!< P2_11 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL4_P2_12_Pos (24UL) /*!< P2_12 (Bit 24) */ +#define PINCONNECT_PINSEL4_P2_12_Msk (0x3000000UL) /*!< P2_12 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL4_P2_13_Pos (26UL) /*!< P2_13 (Bit 26) */ +#define PINCONNECT_PINSEL4_P2_13_Msk (0xc000000UL) /*!< P2_13 (Bitfield-Mask: 0x03) */ +/* ======================================================== PINSEL7 ======================================================== */ +#define PINCONNECT_PINSEL7_P3_25_Pos (18UL) /*!< P3_25 (Bit 18) */ +#define PINCONNECT_PINSEL7_P3_25_Msk (0xc0000UL) /*!< P3_25 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL7_P3_26_Pos (20UL) /*!< P3_26 (Bit 20) */ +#define PINCONNECT_PINSEL7_P3_26_Msk (0x300000UL) /*!< P3_26 (Bitfield-Mask: 0x03) */ +/* ======================================================== PINSEL9 ======================================================== */ +#define PINCONNECT_PINSEL9_P4_28_Pos (24UL) /*!< P4_28 (Bit 24) */ +#define PINCONNECT_PINSEL9_P4_28_Msk (0x3000000UL) /*!< P4_28 (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINSEL9_P4_29_Pos (26UL) /*!< P4_29 (Bit 26) */ +#define PINCONNECT_PINSEL9_P4_29_Msk (0xc000000UL) /*!< P4_29 (Bitfield-Mask: 0x03) */ +/* ======================================================= PINSEL10 ======================================================== */ +#define PINCONNECT_PINSEL10_TPIUCTRL_Pos (3UL) /*!< TPIUCTRL (Bit 3) */ +#define PINCONNECT_PINSEL10_TPIUCTRL_Msk (0x8UL) /*!< TPIUCTRL (Bitfield-Mask: 0x01) */ +/* ======================================================= PINMODE0 ======================================================== */ +#define PINCONNECT_PINMODE0_P0_00MODE_Pos (0UL) /*!< P0_00MODE (Bit 0) */ +#define PINCONNECT_PINMODE0_P0_00MODE_Msk (0x3UL) /*!< P0_00MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE0_P0_01MODE_Pos (2UL) /*!< P0_01MODE (Bit 2) */ +#define PINCONNECT_PINMODE0_P0_01MODE_Msk (0xcUL) /*!< P0_01MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE0_P0_02MODE_Pos (4UL) /*!< P0_02MODE (Bit 4) */ +#define PINCONNECT_PINMODE0_P0_02MODE_Msk (0x30UL) /*!< P0_02MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE0_P0_03MODE_Pos (6UL) /*!< P0_03MODE (Bit 6) */ +#define PINCONNECT_PINMODE0_P0_03MODE_Msk (0xc0UL) /*!< P0_03MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE0_P0_04MODE_Pos (8UL) /*!< P0_04MODE (Bit 8) */ +#define PINCONNECT_PINMODE0_P0_04MODE_Msk (0x300UL) /*!< P0_04MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE0_P0_05MODE_Pos (10UL) /*!< P0_05MODE (Bit 10) */ +#define PINCONNECT_PINMODE0_P0_05MODE_Msk (0xc00UL) /*!< P0_05MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE0_P0_06MODE_Pos (12UL) /*!< P0_06MODE (Bit 12) */ +#define PINCONNECT_PINMODE0_P0_06MODE_Msk (0x3000UL) /*!< P0_06MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE0_P0_07MODE_Pos (14UL) /*!< P0_07MODE (Bit 14) */ +#define PINCONNECT_PINMODE0_P0_07MODE_Msk (0xc000UL) /*!< P0_07MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE0_P0_08MODE_Pos (16UL) /*!< P0_08MODE (Bit 16) */ +#define PINCONNECT_PINMODE0_P0_08MODE_Msk (0x30000UL) /*!< P0_08MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE0_P0_09MODE_Pos (18UL) /*!< P0_09MODE (Bit 18) */ +#define PINCONNECT_PINMODE0_P0_09MODE_Msk (0xc0000UL) /*!< P0_09MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE0_P0_10MODE_Pos (20UL) /*!< P0_10MODE (Bit 20) */ +#define PINCONNECT_PINMODE0_P0_10MODE_Msk (0x300000UL) /*!< P0_10MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE0_P0_11MODE_Pos (22UL) /*!< P0_11MODE (Bit 22) */ +#define PINCONNECT_PINMODE0_P0_11MODE_Msk (0xc00000UL) /*!< P0_11MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE0_P0_15MODE_Pos (30UL) /*!< P0_15MODE (Bit 30) */ +#define PINCONNECT_PINMODE0_P0_15MODE_Msk (0xc0000000UL) /*!< P0_15MODE (Bitfield-Mask: 0x03) */ +/* ======================================================= PINMODE1 ======================================================== */ +#define PINCONNECT_PINMODE1_P0_16MODE_Pos (0UL) /*!< P0_16MODE (Bit 0) */ +#define PINCONNECT_PINMODE1_P0_16MODE_Msk (0x3UL) /*!< P0_16MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE1_P0_17MODE_Pos (2UL) /*!< P0_17MODE (Bit 2) */ +#define PINCONNECT_PINMODE1_P0_17MODE_Msk (0xcUL) /*!< P0_17MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE1_P0_18MODE_Pos (4UL) /*!< P0_18MODE (Bit 4) */ +#define PINCONNECT_PINMODE1_P0_18MODE_Msk (0x30UL) /*!< P0_18MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE1_P0_19MODE_Pos (6UL) /*!< P0_19MODE (Bit 6) */ +#define PINCONNECT_PINMODE1_P0_19MODE_Msk (0xc0UL) /*!< P0_19MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE1_P0_20MODE_Pos (8UL) /*!< P0_20MODE (Bit 8) */ +#define PINCONNECT_PINMODE1_P0_20MODE_Msk (0x300UL) /*!< P0_20MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE1_P0_21MODE_Pos (10UL) /*!< P0_21MODE (Bit 10) */ +#define PINCONNECT_PINMODE1_P0_21MODE_Msk (0xc00UL) /*!< P0_21MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE1_P0_22MODE_Pos (12UL) /*!< P0_22MODE (Bit 12) */ +#define PINCONNECT_PINMODE1_P0_22MODE_Msk (0x3000UL) /*!< P0_22MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE1_P0_23MODE_Pos (14UL) /*!< P0_23MODE (Bit 14) */ +#define PINCONNECT_PINMODE1_P0_23MODE_Msk (0xc000UL) /*!< P0_23MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE1_P0_24MODE_Pos (16UL) /*!< P0_24MODE (Bit 16) */ +#define PINCONNECT_PINMODE1_P0_24MODE_Msk (0x30000UL) /*!< P0_24MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE1_P0_25MODE_Pos (18UL) /*!< P0_25MODE (Bit 18) */ +#define PINCONNECT_PINMODE1_P0_25MODE_Msk (0xc0000UL) /*!< P0_25MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE1_P0_26MODE_Pos (20UL) /*!< P0_26MODE (Bit 20) */ +#define PINCONNECT_PINMODE1_P0_26MODE_Msk (0x300000UL) /*!< P0_26MODE (Bitfield-Mask: 0x03) */ +/* ======================================================= PINMODE2 ======================================================== */ +#define PINCONNECT_PINMODE2_P1_00MODE_Pos (0UL) /*!< P1_00MODE (Bit 0) */ +#define PINCONNECT_PINMODE2_P1_00MODE_Msk (0x3UL) /*!< P1_00MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE2_P1_01MODE_Pos (2UL) /*!< P1_01MODE (Bit 2) */ +#define PINCONNECT_PINMODE2_P1_01MODE_Msk (0xcUL) /*!< P1_01MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE2_P1_04MODE_Pos (8UL) /*!< P1_04MODE (Bit 8) */ +#define PINCONNECT_PINMODE2_P1_04MODE_Msk (0x300UL) /*!< P1_04MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE2_P1_08MODE_Pos (16UL) /*!< P1_08MODE (Bit 16) */ +#define PINCONNECT_PINMODE2_P1_08MODE_Msk (0x30000UL) /*!< P1_08MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE2_P1_09MODE_Pos (18UL) /*!< P1_09MODE (Bit 18) */ +#define PINCONNECT_PINMODE2_P1_09MODE_Msk (0xc0000UL) /*!< P1_09MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE2_P1_10MODE_Pos (20UL) /*!< P1_10MODE (Bit 20) */ +#define PINCONNECT_PINMODE2_P1_10MODE_Msk (0x300000UL) /*!< P1_10MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE2_P1_14MODE_Pos (28UL) /*!< P1_14MODE (Bit 28) */ +#define PINCONNECT_PINMODE2_P1_14MODE_Msk (0x30000000UL) /*!< P1_14MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE2_P1_15MODE_Pos (30UL) /*!< P1_15MODE (Bit 30) */ +#define PINCONNECT_PINMODE2_P1_15MODE_Msk (0xc0000000UL) /*!< P1_15MODE (Bitfield-Mask: 0x03) */ +/* ======================================================= PINMODE3 ======================================================== */ +#define PINCONNECT_PINMODE3_P1_16MODE_Pos (0UL) /*!< P1_16MODE (Bit 0) */ +#define PINCONNECT_PINMODE3_P1_16MODE_Msk (0x3UL) /*!< P1_16MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE3_P1_17MODE_Pos (2UL) /*!< P1_17MODE (Bit 2) */ +#define PINCONNECT_PINMODE3_P1_17MODE_Msk (0xcUL) /*!< P1_17MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE3_P1_18MODE_Pos (4UL) /*!< P1_18MODE (Bit 4) */ +#define PINCONNECT_PINMODE3_P1_18MODE_Msk (0x30UL) /*!< P1_18MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE3_P1_19MODE_Pos (6UL) /*!< P1_19MODE (Bit 6) */ +#define PINCONNECT_PINMODE3_P1_19MODE_Msk (0xc0UL) /*!< P1_19MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE3_P1_20MODE_Pos (8UL) /*!< P1_20MODE (Bit 8) */ +#define PINCONNECT_PINMODE3_P1_20MODE_Msk (0x300UL) /*!< P1_20MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE3_P1_21MODE_Pos (10UL) /*!< P1_21MODE (Bit 10) */ +#define PINCONNECT_PINMODE3_P1_21MODE_Msk (0xc00UL) /*!< P1_21MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE3_P1_22MODE_Pos (12UL) /*!< P1_22MODE (Bit 12) */ +#define PINCONNECT_PINMODE3_P1_22MODE_Msk (0x3000UL) /*!< P1_22MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE3_P1_23MODE_Pos (14UL) /*!< P1_23MODE (Bit 14) */ +#define PINCONNECT_PINMODE3_P1_23MODE_Msk (0xc000UL) /*!< P1_23MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE3_P1_24MODE_Pos (16UL) /*!< P1_24MODE (Bit 16) */ +#define PINCONNECT_PINMODE3_P1_24MODE_Msk (0x30000UL) /*!< P1_24MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE3_P1_25MODE_Pos (18UL) /*!< P1_25MODE (Bit 18) */ +#define PINCONNECT_PINMODE3_P1_25MODE_Msk (0xc0000UL) /*!< P1_25MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE3_P1_26MODE_Pos (20UL) /*!< P1_26MODE (Bit 20) */ +#define PINCONNECT_PINMODE3_P1_26MODE_Msk (0x300000UL) /*!< P1_26MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE3_P1_27MODE_Pos (22UL) /*!< P1_27MODE (Bit 22) */ +#define PINCONNECT_PINMODE3_P1_27MODE_Msk (0xc00000UL) /*!< P1_27MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE3_P1_28MODE_Pos (24UL) /*!< P1_28MODE (Bit 24) */ +#define PINCONNECT_PINMODE3_P1_28MODE_Msk (0x3000000UL) /*!< P1_28MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE3_P1_29MODE_Pos (26UL) /*!< P1_29MODE (Bit 26) */ +#define PINCONNECT_PINMODE3_P1_29MODE_Msk (0xc000000UL) /*!< P1_29MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE3_P1_30MODE_Pos (28UL) /*!< P1_30MODE (Bit 28) */ +#define PINCONNECT_PINMODE3_P1_30MODE_Msk (0x30000000UL) /*!< P1_30MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE3_P1_31MODE_Pos (30UL) /*!< P1_31MODE (Bit 30) */ +#define PINCONNECT_PINMODE3_P1_31MODE_Msk (0xc0000000UL) /*!< P1_31MODE (Bitfield-Mask: 0x03) */ +/* ======================================================= PINMODE4 ======================================================== */ +#define PINCONNECT_PINMODE4_P2_00MODE_Pos (0UL) /*!< P2_00MODE (Bit 0) */ +#define PINCONNECT_PINMODE4_P2_00MODE_Msk (0x3UL) /*!< P2_00MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE4_P2_01MODE_Pos (2UL) /*!< P2_01MODE (Bit 2) */ +#define PINCONNECT_PINMODE4_P2_01MODE_Msk (0xcUL) /*!< P2_01MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE4_P2_02MODE_Pos (4UL) /*!< P2_02MODE (Bit 4) */ +#define PINCONNECT_PINMODE4_P2_02MODE_Msk (0x30UL) /*!< P2_02MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE4_P2_03MODE_Pos (6UL) /*!< P2_03MODE (Bit 6) */ +#define PINCONNECT_PINMODE4_P2_03MODE_Msk (0xc0UL) /*!< P2_03MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE4_P2_04MODE_Pos (8UL) /*!< P2_04MODE (Bit 8) */ +#define PINCONNECT_PINMODE4_P2_04MODE_Msk (0x300UL) /*!< P2_04MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE4_P2_05MODE_Pos (10UL) /*!< P2_05MODE (Bit 10) */ +#define PINCONNECT_PINMODE4_P2_05MODE_Msk (0xc00UL) /*!< P2_05MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE4_P2_06MODE_Pos (12UL) /*!< P2_06MODE (Bit 12) */ +#define PINCONNECT_PINMODE4_P2_06MODE_Msk (0x3000UL) /*!< P2_06MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE4_P2_07MODE_Pos (14UL) /*!< P2_07MODE (Bit 14) */ +#define PINCONNECT_PINMODE4_P2_07MODE_Msk (0xc000UL) /*!< P2_07MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE4_P2_08MODE_Pos (16UL) /*!< P2_08MODE (Bit 16) */ +#define PINCONNECT_PINMODE4_P2_08MODE_Msk (0x30000UL) /*!< P2_08MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE4_P2_09MODE_Pos (18UL) /*!< P2_09MODE (Bit 18) */ +#define PINCONNECT_PINMODE4_P2_09MODE_Msk (0xc0000UL) /*!< P2_09MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE4_P2_10MODE_Pos (20UL) /*!< P2_10MODE (Bit 20) */ +#define PINCONNECT_PINMODE4_P2_10MODE_Msk (0x300000UL) /*!< P2_10MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE4_P2_11MODE_Pos (22UL) /*!< P2_11MODE (Bit 22) */ +#define PINCONNECT_PINMODE4_P2_11MODE_Msk (0xc00000UL) /*!< P2_11MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE4_P2_12MODE_Pos (24UL) /*!< P2_12MODE (Bit 24) */ +#define PINCONNECT_PINMODE4_P2_12MODE_Msk (0x3000000UL) /*!< P2_12MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE4_P2_13MODE_Pos (26UL) /*!< P2_13MODE (Bit 26) */ +#define PINCONNECT_PINMODE4_P2_13MODE_Msk (0xc000000UL) /*!< P2_13MODE (Bitfield-Mask: 0x03) */ +/* ======================================================= PINMODE7 ======================================================== */ +#define PINCONNECT_PINMODE7_P3_25MODE_Pos (18UL) /*!< P3_25MODE (Bit 18) */ +#define PINCONNECT_PINMODE7_P3_25MODE_Msk (0xc0000UL) /*!< P3_25MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE7_P3_26MODE_Pos (20UL) /*!< P3_26MODE (Bit 20) */ +#define PINCONNECT_PINMODE7_P3_26MODE_Msk (0x300000UL) /*!< P3_26MODE (Bitfield-Mask: 0x03) */ +/* ======================================================= PINMODE9 ======================================================== */ +#define PINCONNECT_PINMODE9_P4_28MODE_Pos (24UL) /*!< P4_28MODE (Bit 24) */ +#define PINCONNECT_PINMODE9_P4_28MODE_Msk (0x3000000UL) /*!< P4_28MODE (Bitfield-Mask: 0x03) */ +#define PINCONNECT_PINMODE9_P4_29MODE_Pos (26UL) /*!< P4_29MODE (Bit 26) */ +#define PINCONNECT_PINMODE9_P4_29MODE_Msk (0xc000000UL) /*!< P4_29MODE (Bitfield-Mask: 0x03) */ +/* ====================================================== PINMODE_OD0 ====================================================== */ +#define PINCONNECT_PINMODE_OD0_P0_00OD_Pos (0UL) /*!< P0_00OD (Bit 0) */ +#define PINCONNECT_PINMODE_OD0_P0_00OD_Msk (0x1UL) /*!< P0_00OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_01OD_Pos (1UL) /*!< P0_01OD (Bit 1) */ +#define PINCONNECT_PINMODE_OD0_P0_01OD_Msk (0x2UL) /*!< P0_01OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_02OD_Pos (2UL) /*!< P0_02OD (Bit 2) */ +#define PINCONNECT_PINMODE_OD0_P0_02OD_Msk (0x4UL) /*!< P0_02OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_03OD_Pos (3UL) /*!< P0_03OD (Bit 3) */ +#define PINCONNECT_PINMODE_OD0_P0_03OD_Msk (0x8UL) /*!< P0_03OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_04OD_Pos (4UL) /*!< P0_04OD (Bit 4) */ +#define PINCONNECT_PINMODE_OD0_P0_04OD_Msk (0x10UL) /*!< P0_04OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_05OD_Pos (5UL) /*!< P0_05OD (Bit 5) */ +#define PINCONNECT_PINMODE_OD0_P0_05OD_Msk (0x20UL) /*!< P0_05OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_06OD_Pos (6UL) /*!< P0_06OD (Bit 6) */ +#define PINCONNECT_PINMODE_OD0_P0_06OD_Msk (0x40UL) /*!< P0_06OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_07OD_Pos (7UL) /*!< P0_07OD (Bit 7) */ +#define PINCONNECT_PINMODE_OD0_P0_07OD_Msk (0x80UL) /*!< P0_07OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_08OD_Pos (8UL) /*!< P0_08OD (Bit 8) */ +#define PINCONNECT_PINMODE_OD0_P0_08OD_Msk (0x100UL) /*!< P0_08OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_09OD_Pos (9UL) /*!< P0_09OD (Bit 9) */ +#define PINCONNECT_PINMODE_OD0_P0_09OD_Msk (0x200UL) /*!< P0_09OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_10OD_Pos (10UL) /*!< P0_10OD (Bit 10) */ +#define PINCONNECT_PINMODE_OD0_P0_10OD_Msk (0x400UL) /*!< P0_10OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_11OD_Pos (11UL) /*!< P0_11OD (Bit 11) */ +#define PINCONNECT_PINMODE_OD0_P0_11OD_Msk (0x800UL) /*!< P0_11OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_15OD_Pos (15UL) /*!< P0_15OD (Bit 15) */ +#define PINCONNECT_PINMODE_OD0_P0_15OD_Msk (0x8000UL) /*!< P0_15OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_16OD_Pos (16UL) /*!< P0_16OD (Bit 16) */ +#define PINCONNECT_PINMODE_OD0_P0_16OD_Msk (0x10000UL) /*!< P0_16OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_17OD_Pos (17UL) /*!< P0_17OD (Bit 17) */ +#define PINCONNECT_PINMODE_OD0_P0_17OD_Msk (0x20000UL) /*!< P0_17OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_18OD_Pos (18UL) /*!< P0_18OD (Bit 18) */ +#define PINCONNECT_PINMODE_OD0_P0_18OD_Msk (0x40000UL) /*!< P0_18OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_19OD_Pos (19UL) /*!< P0_19OD (Bit 19) */ +#define PINCONNECT_PINMODE_OD0_P0_19OD_Msk (0x80000UL) /*!< P0_19OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_20OD_Pos (20UL) /*!< P0_20OD (Bit 20) */ +#define PINCONNECT_PINMODE_OD0_P0_20OD_Msk (0x100000UL) /*!< P0_20OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_21OD_Pos (21UL) /*!< P0_21OD (Bit 21) */ +#define PINCONNECT_PINMODE_OD0_P0_21OD_Msk (0x200000UL) /*!< P0_21OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_22OD_Pos (22UL) /*!< P0_22OD (Bit 22) */ +#define PINCONNECT_PINMODE_OD0_P0_22OD_Msk (0x400000UL) /*!< P0_22OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_23OD_Pos (23UL) /*!< P0_23OD (Bit 23) */ +#define PINCONNECT_PINMODE_OD0_P0_23OD_Msk (0x800000UL) /*!< P0_23OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_24OD_Pos (24UL) /*!< P0_24OD (Bit 24) */ +#define PINCONNECT_PINMODE_OD0_P0_24OD_Msk (0x1000000UL) /*!< P0_24OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_25OD_Pos (25UL) /*!< P0_25OD (Bit 25) */ +#define PINCONNECT_PINMODE_OD0_P0_25OD_Msk (0x2000000UL) /*!< P0_25OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_26OD_Pos (26UL) /*!< P0_26OD (Bit 26) */ +#define PINCONNECT_PINMODE_OD0_P0_26OD_Msk (0x4000000UL) /*!< P0_26OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_29OD_Pos (29UL) /*!< P0_29OD (Bit 29) */ +#define PINCONNECT_PINMODE_OD0_P0_29OD_Msk (0x20000000UL) /*!< P0_29OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD0_P0_30OD_Pos (30UL) /*!< P0_30OD (Bit 30) */ +#define PINCONNECT_PINMODE_OD0_P0_30OD_Msk (0x40000000UL) /*!< P0_30OD (Bitfield-Mask: 0x01) */ +/* ====================================================== PINMODE_OD1 ====================================================== */ +#define PINCONNECT_PINMODE_OD1_P1_00OD_Pos (0UL) /*!< P1_00OD (Bit 0) */ +#define PINCONNECT_PINMODE_OD1_P1_00OD_Msk (0x1UL) /*!< P1_00OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD1_P1_01OD_Pos (1UL) /*!< P1_01OD (Bit 1) */ +#define PINCONNECT_PINMODE_OD1_P1_01OD_Msk (0x2UL) /*!< P1_01OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD1_P1_04OD_Pos (4UL) /*!< P1_04OD (Bit 4) */ +#define PINCONNECT_PINMODE_OD1_P1_04OD_Msk (0x10UL) /*!< P1_04OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD1_P1_08OD_Pos (8UL) /*!< P1_08OD (Bit 8) */ +#define PINCONNECT_PINMODE_OD1_P1_08OD_Msk (0x100UL) /*!< P1_08OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD1_P1_09OD_Pos (9UL) /*!< P1_09OD (Bit 9) */ +#define PINCONNECT_PINMODE_OD1_P1_09OD_Msk (0x200UL) /*!< P1_09OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD1_P1_10OD_Pos (10UL) /*!< P1_10OD (Bit 10) */ +#define PINCONNECT_PINMODE_OD1_P1_10OD_Msk (0x400UL) /*!< P1_10OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD1_P1_14OD_Pos (14UL) /*!< P1_14OD (Bit 14) */ +#define PINCONNECT_PINMODE_OD1_P1_14OD_Msk (0x4000UL) /*!< P1_14OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD1_P1_15OD_Pos (15UL) /*!< P1_15OD (Bit 15) */ +#define PINCONNECT_PINMODE_OD1_P1_15OD_Msk (0x8000UL) /*!< P1_15OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD1_P1_16OD_Pos (16UL) /*!< P1_16OD (Bit 16) */ +#define PINCONNECT_PINMODE_OD1_P1_16OD_Msk (0x10000UL) /*!< P1_16OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD1_P1_17OD_Pos (17UL) /*!< P1_17OD (Bit 17) */ +#define PINCONNECT_PINMODE_OD1_P1_17OD_Msk (0x20000UL) /*!< P1_17OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD1_P1_18OD_Pos (18UL) /*!< P1_18OD (Bit 18) */ +#define PINCONNECT_PINMODE_OD1_P1_18OD_Msk (0x40000UL) /*!< P1_18OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD1_P1_19OD_Pos (19UL) /*!< P1_19OD (Bit 19) */ +#define PINCONNECT_PINMODE_OD1_P1_19OD_Msk (0x80000UL) /*!< P1_19OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD1_P1_20OD_Pos (20UL) /*!< P1_20OD (Bit 20) */ +#define PINCONNECT_PINMODE_OD1_P1_20OD_Msk (0x100000UL) /*!< P1_20OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD1_P1_21OD_Pos (21UL) /*!< P1_21OD (Bit 21) */ +#define PINCONNECT_PINMODE_OD1_P1_21OD_Msk (0x200000UL) /*!< P1_21OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD1_P1_22OD_Pos (22UL) /*!< P1_22OD (Bit 22) */ +#define PINCONNECT_PINMODE_OD1_P1_22OD_Msk (0x400000UL) /*!< P1_22OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD1_P1_23OD_Pos (23UL) /*!< P1_23OD (Bit 23) */ +#define PINCONNECT_PINMODE_OD1_P1_23OD_Msk (0x800000UL) /*!< P1_23OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD1_P1_24OD_Pos (24UL) /*!< P1_24OD (Bit 24) */ +#define PINCONNECT_PINMODE_OD1_P1_24OD_Msk (0x1000000UL) /*!< P1_24OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD1_P1_25OD_Pos (25UL) /*!< P1_25OD (Bit 25) */ +#define PINCONNECT_PINMODE_OD1_P1_25OD_Msk (0x2000000UL) /*!< P1_25OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD1_P1_26OD_Pos (26UL) /*!< P1_26OD (Bit 26) */ +#define PINCONNECT_PINMODE_OD1_P1_26OD_Msk (0x4000000UL) /*!< P1_26OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD1_P1_27OD_Pos (27UL) /*!< P1_27OD (Bit 27) */ +#define PINCONNECT_PINMODE_OD1_P1_27OD_Msk (0x8000000UL) /*!< P1_27OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD1_P1_28OD_Pos (28UL) /*!< P1_28OD (Bit 28) */ +#define PINCONNECT_PINMODE_OD1_P1_28OD_Msk (0x10000000UL) /*!< P1_28OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD1_P1_29OD_Pos (29UL) /*!< P1_29OD (Bit 29) */ +#define PINCONNECT_PINMODE_OD1_P1_29OD_Msk (0x20000000UL) /*!< P1_29OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD1_P1_30OD_Pos (30UL) /*!< P1_30OD (Bit 30) */ +#define PINCONNECT_PINMODE_OD1_P1_30OD_Msk (0x40000000UL) /*!< P1_30OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD1_P1_31OD_Pos (31UL) /*!< P1_31OD (Bit 31) */ +#define PINCONNECT_PINMODE_OD1_P1_31OD_Msk (0x80000000UL) /*!< P1_31OD (Bitfield-Mask: 0x01) */ +/* ====================================================== PINMODE_OD2 ====================================================== */ +#define PINCONNECT_PINMODE_OD2_P2_00OD_Pos (0UL) /*!< P2_00OD (Bit 0) */ +#define PINCONNECT_PINMODE_OD2_P2_00OD_Msk (0x1UL) /*!< P2_00OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD2_P2_01OD_Pos (1UL) /*!< P2_01OD (Bit 1) */ +#define PINCONNECT_PINMODE_OD2_P2_01OD_Msk (0x2UL) /*!< P2_01OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD2_P2_02OD_Pos (2UL) /*!< P2_02OD (Bit 2) */ +#define PINCONNECT_PINMODE_OD2_P2_02OD_Msk (0x4UL) /*!< P2_02OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD2_P2_03OD_Pos (3UL) /*!< P2_03OD (Bit 3) */ +#define PINCONNECT_PINMODE_OD2_P2_03OD_Msk (0x8UL) /*!< P2_03OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD2_P2_04OD_Pos (4UL) /*!< P2_04OD (Bit 4) */ +#define PINCONNECT_PINMODE_OD2_P2_04OD_Msk (0x10UL) /*!< P2_04OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD2_P2_05OD_Pos (5UL) /*!< P2_05OD (Bit 5) */ +#define PINCONNECT_PINMODE_OD2_P2_05OD_Msk (0x20UL) /*!< P2_05OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD2_P2_06OD_Pos (6UL) /*!< P2_06OD (Bit 6) */ +#define PINCONNECT_PINMODE_OD2_P2_06OD_Msk (0x40UL) /*!< P2_06OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD2_P2_07OD_Pos (7UL) /*!< P2_07OD (Bit 7) */ +#define PINCONNECT_PINMODE_OD2_P2_07OD_Msk (0x80UL) /*!< P2_07OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD2_P2_08OD_Pos (8UL) /*!< P2_08OD (Bit 8) */ +#define PINCONNECT_PINMODE_OD2_P2_08OD_Msk (0x100UL) /*!< P2_08OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD2_P2_09OD_Pos (9UL) /*!< P2_09OD (Bit 9) */ +#define PINCONNECT_PINMODE_OD2_P2_09OD_Msk (0x200UL) /*!< P2_09OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD2_P2_10OD_Pos (10UL) /*!< P2_10OD (Bit 10) */ +#define PINCONNECT_PINMODE_OD2_P2_10OD_Msk (0x400UL) /*!< P2_10OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD2_P2_11OD_Pos (11UL) /*!< P2_11OD (Bit 11) */ +#define PINCONNECT_PINMODE_OD2_P2_11OD_Msk (0x800UL) /*!< P2_11OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD2_P2_12OD_Pos (12UL) /*!< P2_12OD (Bit 12) */ +#define PINCONNECT_PINMODE_OD2_P2_12OD_Msk (0x1000UL) /*!< P2_12OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD2_P2_13OD_Pos (13UL) /*!< P2_13OD (Bit 13) */ +#define PINCONNECT_PINMODE_OD2_P2_13OD_Msk (0x2000UL) /*!< P2_13OD (Bitfield-Mask: 0x01) */ +/* ====================================================== PINMODE_OD3 ====================================================== */ +#define PINCONNECT_PINMODE_OD3_P3_25OD_Pos (25UL) /*!< P3_25OD (Bit 25) */ +#define PINCONNECT_PINMODE_OD3_P3_25OD_Msk (0x2000000UL) /*!< P3_25OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD3_P3_26OD_Pos (26UL) /*!< P3_26OD (Bit 26) */ +#define PINCONNECT_PINMODE_OD3_P3_26OD_Msk (0x4000000UL) /*!< P3_26OD (Bitfield-Mask: 0x01) */ +/* ====================================================== PINMODE_OD4 ====================================================== */ +#define PINCONNECT_PINMODE_OD4_P4_28OD_Pos (28UL) /*!< P4_28OD (Bit 28) */ +#define PINCONNECT_PINMODE_OD4_P4_28OD_Msk (0x10000000UL) /*!< P4_28OD (Bitfield-Mask: 0x01) */ +#define PINCONNECT_PINMODE_OD4_P4_29OD_Pos (29UL) /*!< P4_29OD (Bit 29) */ +#define PINCONNECT_PINMODE_OD4_P4_29OD_Msk (0x20000000UL) /*!< P4_29OD (Bitfield-Mask: 0x01) */ +/* ======================================================= I2CPADCFG ======================================================= */ +#define PINCONNECT_I2CPADCFG_SDADRV0_Pos (0UL) /*!< SDADRV0 (Bit 0) */ +#define PINCONNECT_I2CPADCFG_SDADRV0_Msk (0x1UL) /*!< SDADRV0 (Bitfield-Mask: 0x01) */ +#define PINCONNECT_I2CPADCFG_SDAI2C0_Pos (1UL) /*!< SDAI2C0 (Bit 1) */ +#define PINCONNECT_I2CPADCFG_SDAI2C0_Msk (0x2UL) /*!< SDAI2C0 (Bitfield-Mask: 0x01) */ +#define PINCONNECT_I2CPADCFG_SCLDRV0_Pos (2UL) /*!< SCLDRV0 (Bit 2) */ +#define PINCONNECT_I2CPADCFG_SCLDRV0_Msk (0x4UL) /*!< SCLDRV0 (Bitfield-Mask: 0x01) */ +#define PINCONNECT_I2CPADCFG_SCLI2C0_Pos (3UL) /*!< SCLI2C0 (Bit 3) */ +#define PINCONNECT_I2CPADCFG_SCLI2C0_Msk (0x8UL) /*!< SCLI2C0 (Bitfield-Mask: 0x01) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_SSP1 ================ */ +/* =========================================================================================================================== */ + +/* ========================================================== CR0 ========================================================== */ +#define SSP1_CR0_DSS_Pos (0UL) /*!< DSS (Bit 0) */ +#define SSP1_CR0_DSS_Msk (0xfUL) /*!< DSS (Bitfield-Mask: 0x0f) */ +#define SSP1_CR0_FRF_Pos (4UL) /*!< FRF (Bit 4) */ +#define SSP1_CR0_FRF_Msk (0x30UL) /*!< FRF (Bitfield-Mask: 0x03) */ +#define SSP1_CR0_CPOL_Pos (6UL) /*!< CPOL (Bit 6) */ +#define SSP1_CR0_CPOL_Msk (0x40UL) /*!< CPOL (Bitfield-Mask: 0x01) */ +#define SSP1_CR0_CPHA_Pos (7UL) /*!< CPHA (Bit 7) */ +#define SSP1_CR0_CPHA_Msk (0x80UL) /*!< CPHA (Bitfield-Mask: 0x01) */ +#define SSP1_CR0_SCR_Pos (8UL) /*!< SCR (Bit 8) */ +#define SSP1_CR0_SCR_Msk (0xff00UL) /*!< SCR (Bitfield-Mask: 0xff) */ +/* ========================================================== CR1 ========================================================== */ +#define SSP1_CR1_LBM_Pos (0UL) /*!< LBM (Bit 0) */ +#define SSP1_CR1_LBM_Msk (0x1UL) /*!< LBM (Bitfield-Mask: 0x01) */ +#define SSP1_CR1_SSE_Pos (1UL) /*!< SSE (Bit 1) */ +#define SSP1_CR1_SSE_Msk (0x2UL) /*!< SSE (Bitfield-Mask: 0x01) */ +#define SSP1_CR1_MS_Pos (2UL) /*!< MS (Bit 2) */ +#define SSP1_CR1_MS_Msk (0x4UL) /*!< MS (Bitfield-Mask: 0x01) */ +#define SSP1_CR1_SOD_Pos (3UL) /*!< SOD (Bit 3) */ +#define SSP1_CR1_SOD_Msk (0x8UL) /*!< SOD (Bitfield-Mask: 0x01) */ +/* ========================================================== DR =========================================================== */ +#define SSP1_DR_DATA_Pos (0UL) /*!< DATA (Bit 0) */ +#define SSP1_DR_DATA_Msk (0xffffUL) /*!< DATA (Bitfield-Mask: 0xffff) */ +/* ========================================================== SR =========================================================== */ +#define SSP1_SR_TFE_Pos (0UL) /*!< TFE (Bit 0) */ +#define SSP1_SR_TFE_Msk (0x1UL) /*!< TFE (Bitfield-Mask: 0x01) */ +#define SSP1_SR_TNF_Pos (1UL) /*!< TNF (Bit 1) */ +#define SSP1_SR_TNF_Msk (0x2UL) /*!< TNF (Bitfield-Mask: 0x01) */ +#define SSP1_SR_RNE_Pos (2UL) /*!< RNE (Bit 2) */ +#define SSP1_SR_RNE_Msk (0x4UL) /*!< RNE (Bitfield-Mask: 0x01) */ +#define SSP1_SR_RFF_Pos (3UL) /*!< RFF (Bit 3) */ +#define SSP1_SR_RFF_Msk (0x8UL) /*!< RFF (Bitfield-Mask: 0x01) */ +#define SSP1_SR_BSY_Pos (4UL) /*!< BSY (Bit 4) */ +#define SSP1_SR_BSY_Msk (0x10UL) /*!< BSY (Bitfield-Mask: 0x01) */ +/* ========================================================= CPSR ========================================================== */ +#define SSP1_CPSR_CPSDVSR_Pos (0UL) /*!< CPSDVSR (Bit 0) */ +#define SSP1_CPSR_CPSDVSR_Msk (0xffUL) /*!< CPSDVSR (Bitfield-Mask: 0xff) */ +/* ========================================================= IMSC ========================================================== */ +#define SSP1_IMSC_RORIM_Pos (0UL) /*!< RORIM (Bit 0) */ +#define SSP1_IMSC_RORIM_Msk (0x1UL) /*!< RORIM (Bitfield-Mask: 0x01) */ +#define SSP1_IMSC_RTIM_Pos (1UL) /*!< RTIM (Bit 1) */ +#define SSP1_IMSC_RTIM_Msk (0x2UL) /*!< RTIM (Bitfield-Mask: 0x01) */ +#define SSP1_IMSC_RXIM_Pos (2UL) /*!< RXIM (Bit 2) */ +#define SSP1_IMSC_RXIM_Msk (0x4UL) /*!< RXIM (Bitfield-Mask: 0x01) */ +#define SSP1_IMSC_TXIM_Pos (3UL) /*!< TXIM (Bit 3) */ +#define SSP1_IMSC_TXIM_Msk (0x8UL) /*!< TXIM (Bitfield-Mask: 0x01) */ +/* ========================================================== RIS ========================================================== */ +#define SSP1_RIS_RORRIS_Pos (0UL) /*!< RORRIS (Bit 0) */ +#define SSP1_RIS_RORRIS_Msk (0x1UL) /*!< RORRIS (Bitfield-Mask: 0x01) */ +#define SSP1_RIS_RTRIS_Pos (1UL) /*!< RTRIS (Bit 1) */ +#define SSP1_RIS_RTRIS_Msk (0x2UL) /*!< RTRIS (Bitfield-Mask: 0x01) */ +#define SSP1_RIS_RXRIS_Pos (2UL) /*!< RXRIS (Bit 2) */ +#define SSP1_RIS_RXRIS_Msk (0x4UL) /*!< RXRIS (Bitfield-Mask: 0x01) */ +#define SSP1_RIS_TXRIS_Pos (3UL) /*!< TXRIS (Bit 3) */ +#define SSP1_RIS_TXRIS_Msk (0x8UL) /*!< TXRIS (Bitfield-Mask: 0x01) */ +/* ========================================================== MIS ========================================================== */ +#define SSP1_MIS_RORMIS_Pos (0UL) /*!< RORMIS (Bit 0) */ +#define SSP1_MIS_RORMIS_Msk (0x1UL) /*!< RORMIS (Bitfield-Mask: 0x01) */ +#define SSP1_MIS_RTMIS_Pos (1UL) /*!< RTMIS (Bit 1) */ +#define SSP1_MIS_RTMIS_Msk (0x2UL) /*!< RTMIS (Bitfield-Mask: 0x01) */ +#define SSP1_MIS_RXMIS_Pos (2UL) /*!< RXMIS (Bit 2) */ +#define SSP1_MIS_RXMIS_Msk (0x4UL) /*!< RXMIS (Bitfield-Mask: 0x01) */ +#define SSP1_MIS_TXMIS_Pos (3UL) /*!< TXMIS (Bit 3) */ +#define SSP1_MIS_TXMIS_Msk (0x8UL) /*!< TXMIS (Bitfield-Mask: 0x01) */ +/* ========================================================== ICR ========================================================== */ +#define SSP1_ICR_RORIC_Pos (0UL) /*!< RORIC (Bit 0) */ +#define SSP1_ICR_RORIC_Msk (0x1UL) /*!< RORIC (Bitfield-Mask: 0x01) */ +#define SSP1_ICR_RTIC_Pos (1UL) /*!< RTIC (Bit 1) */ +#define SSP1_ICR_RTIC_Msk (0x2UL) /*!< RTIC (Bitfield-Mask: 0x01) */ +/* ========================================================= DMACR ========================================================= */ +#define SSP1_DMACR_RXDMAE_Pos (0UL) /*!< RXDMAE (Bit 0) */ +#define SSP1_DMACR_RXDMAE_Msk (0x1UL) /*!< RXDMAE (Bitfield-Mask: 0x01) */ +#define SSP1_DMACR_TXDMAE_Pos (1UL) /*!< TXDMAE (Bit 1) */ +#define SSP1_DMACR_TXDMAE_Msk (0x2UL) /*!< TXDMAE (Bitfield-Mask: 0x01) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_ADC ================ */ +/* =========================================================================================================================== */ + +/* ========================================================== CR =========================================================== */ +#define ADC_CR_SEL_Pos (0UL) /*!< SEL (Bit 0) */ +#define ADC_CR_SEL_Msk (0xffUL) /*!< SEL (Bitfield-Mask: 0xff) */ +#define ADC_CR_CLKDIV_Pos (8UL) /*!< CLKDIV (Bit 8) */ +#define ADC_CR_CLKDIV_Msk (0xff00UL) /*!< CLKDIV (Bitfield-Mask: 0xff) */ +#define ADC_CR_BURST_Pos (16UL) /*!< BURST (Bit 16) */ +#define ADC_CR_BURST_Msk (0x10000UL) /*!< BURST (Bitfield-Mask: 0x01) */ +#define ADC_CR_PDN_Pos (21UL) /*!< PDN (Bit 21) */ +#define ADC_CR_PDN_Msk (0x200000UL) /*!< PDN (Bitfield-Mask: 0x01) */ +#define ADC_CR_START_Pos (24UL) /*!< START (Bit 24) */ +#define ADC_CR_START_Msk (0x7000000UL) /*!< START (Bitfield-Mask: 0x07) */ +#define ADC_CR_EDGE_Pos (27UL) /*!< EDGE (Bit 27) */ +#define ADC_CR_EDGE_Msk (0x8000000UL) /*!< EDGE (Bitfield-Mask: 0x01) */ +/* ========================================================== GDR ========================================================== */ +#define ADC_GDR_RESULT_Pos (4UL) /*!< RESULT (Bit 4) */ +#define ADC_GDR_RESULT_Msk (0xfff0UL) /*!< RESULT (Bitfield-Mask: 0xfff) */ +#define ADC_GDR_CHN_Pos (24UL) /*!< CHN (Bit 24) */ +#define ADC_GDR_CHN_Msk (0x7000000UL) /*!< CHN (Bitfield-Mask: 0x07) */ +#define ADC_GDR_OVERRUN_Pos (30UL) /*!< OVERRUN (Bit 30) */ +#define ADC_GDR_OVERRUN_Msk (0x40000000UL) /*!< OVERRUN (Bitfield-Mask: 0x01) */ +#define ADC_GDR_DONE_Pos (31UL) /*!< DONE (Bit 31) */ +#define ADC_GDR_DONE_Msk (0x80000000UL) /*!< DONE (Bitfield-Mask: 0x01) */ +/* ========================================================= INTEN ========================================================= */ +#define ADC_INTEN_ADINTEN0_Pos (0UL) /*!< ADINTEN0 (Bit 0) */ +#define ADC_INTEN_ADINTEN0_Msk (0x1UL) /*!< ADINTEN0 (Bitfield-Mask: 0x01) */ +#define ADC_INTEN_ADINTEN1_Pos (1UL) /*!< ADINTEN1 (Bit 1) */ +#define ADC_INTEN_ADINTEN1_Msk (0x2UL) /*!< ADINTEN1 (Bitfield-Mask: 0x01) */ +#define ADC_INTEN_ADINTEN2_Pos (2UL) /*!< ADINTEN2 (Bit 2) */ +#define ADC_INTEN_ADINTEN2_Msk (0x4UL) /*!< ADINTEN2 (Bitfield-Mask: 0x01) */ +#define ADC_INTEN_ADINTEN3_Pos (3UL) /*!< ADINTEN3 (Bit 3) */ +#define ADC_INTEN_ADINTEN3_Msk (0x8UL) /*!< ADINTEN3 (Bitfield-Mask: 0x01) */ +#define ADC_INTEN_ADINTEN4_Pos (4UL) /*!< ADINTEN4 (Bit 4) */ +#define ADC_INTEN_ADINTEN4_Msk (0x10UL) /*!< ADINTEN4 (Bitfield-Mask: 0x01) */ +#define ADC_INTEN_ADINTEN5_Pos (5UL) /*!< ADINTEN5 (Bit 5) */ +#define ADC_INTEN_ADINTEN5_Msk (0x20UL) /*!< ADINTEN5 (Bitfield-Mask: 0x01) */ +#define ADC_INTEN_ADINTEN6_Pos (6UL) /*!< ADINTEN6 (Bit 6) */ +#define ADC_INTEN_ADINTEN6_Msk (0x40UL) /*!< ADINTEN6 (Bitfield-Mask: 0x01) */ +#define ADC_INTEN_ADINTEN7_Pos (7UL) /*!< ADINTEN7 (Bit 7) */ +#define ADC_INTEN_ADINTEN7_Msk (0x80UL) /*!< ADINTEN7 (Bitfield-Mask: 0x01) */ +#define ADC_INTEN_ADGINTEN_Pos (8UL) /*!< ADGINTEN (Bit 8) */ +#define ADC_INTEN_ADGINTEN_Msk (0x100UL) /*!< ADGINTEN (Bitfield-Mask: 0x01) */ +/* ========================================================= STAT ========================================================== */ +#define ADC_STAT_DONE0_Pos (0UL) /*!< DONE0 (Bit 0) */ +#define ADC_STAT_DONE0_Msk (0x1UL) /*!< DONE0 (Bitfield-Mask: 0x01) */ +#define ADC_STAT_DONE1_Pos (1UL) /*!< DONE1 (Bit 1) */ +#define ADC_STAT_DONE1_Msk (0x2UL) /*!< DONE1 (Bitfield-Mask: 0x01) */ +#define ADC_STAT_DONE2_Pos (2UL) /*!< DONE2 (Bit 2) */ +#define ADC_STAT_DONE2_Msk (0x4UL) /*!< DONE2 (Bitfield-Mask: 0x01) */ +#define ADC_STAT_DONE3_Pos (3UL) /*!< DONE3 (Bit 3) */ +#define ADC_STAT_DONE3_Msk (0x8UL) /*!< DONE3 (Bitfield-Mask: 0x01) */ +#define ADC_STAT_DONE4_Pos (4UL) /*!< DONE4 (Bit 4) */ +#define ADC_STAT_DONE4_Msk (0x10UL) /*!< DONE4 (Bitfield-Mask: 0x01) */ +#define ADC_STAT_DONE5_Pos (5UL) /*!< DONE5 (Bit 5) */ +#define ADC_STAT_DONE5_Msk (0x20UL) /*!< DONE5 (Bitfield-Mask: 0x01) */ +#define ADC_STAT_DONE6_Pos (6UL) /*!< DONE6 (Bit 6) */ +#define ADC_STAT_DONE6_Msk (0x40UL) /*!< DONE6 (Bitfield-Mask: 0x01) */ +#define ADC_STAT_DONE7_Pos (7UL) /*!< DONE7 (Bit 7) */ +#define ADC_STAT_DONE7_Msk (0x80UL) /*!< DONE7 (Bitfield-Mask: 0x01) */ +#define ADC_STAT_OVERRUN0_Pos (8UL) /*!< OVERRUN0 (Bit 8) */ +#define ADC_STAT_OVERRUN0_Msk (0x100UL) /*!< OVERRUN0 (Bitfield-Mask: 0x01) */ +#define ADC_STAT_OVERRUN1_Pos (9UL) /*!< OVERRUN1 (Bit 9) */ +#define ADC_STAT_OVERRUN1_Msk (0x200UL) /*!< OVERRUN1 (Bitfield-Mask: 0x01) */ +#define ADC_STAT_OVERRUN2_Pos (10UL) /*!< OVERRUN2 (Bit 10) */ +#define ADC_STAT_OVERRUN2_Msk (0x400UL) /*!< OVERRUN2 (Bitfield-Mask: 0x01) */ +#define ADC_STAT_OVERRUN3_Pos (11UL) /*!< OVERRUN3 (Bit 11) */ +#define ADC_STAT_OVERRUN3_Msk (0x800UL) /*!< OVERRUN3 (Bitfield-Mask: 0x01) */ +#define ADC_STAT_OVERRUN4_Pos (12UL) /*!< OVERRUN4 (Bit 12) */ +#define ADC_STAT_OVERRUN4_Msk (0x1000UL) /*!< OVERRUN4 (Bitfield-Mask: 0x01) */ +#define ADC_STAT_OVERRUN5_Pos (13UL) /*!< OVERRUN5 (Bit 13) */ +#define ADC_STAT_OVERRUN5_Msk (0x2000UL) /*!< OVERRUN5 (Bitfield-Mask: 0x01) */ +#define ADC_STAT_OVERRUN6_Pos (14UL) /*!< OVERRUN6 (Bit 14) */ +#define ADC_STAT_OVERRUN6_Msk (0x4000UL) /*!< OVERRUN6 (Bitfield-Mask: 0x01) */ +#define ADC_STAT_OVERRUN7_Pos (15UL) /*!< OVERRUN7 (Bit 15) */ +#define ADC_STAT_OVERRUN7_Msk (0x8000UL) /*!< OVERRUN7 (Bitfield-Mask: 0x01) */ +#define ADC_STAT_ADINT_Pos (16UL) /*!< ADINT (Bit 16) */ +#define ADC_STAT_ADINT_Msk (0x10000UL) /*!< ADINT (Bitfield-Mask: 0x01) */ +/* ========================================================== TRM ========================================================== */ +#define ADC_TRM_ADCOFFS_Pos (4UL) /*!< ADCOFFS (Bit 4) */ +#define ADC_TRM_ADCOFFS_Msk (0xf0UL) /*!< ADCOFFS (Bitfield-Mask: 0x0f) */ +#define ADC_TRM_TRIM_Pos (8UL) /*!< TRIM (Bit 8) */ +#define ADC_TRM_TRIM_Msk (0xf00UL) /*!< TRIM (Bitfield-Mask: 0x0f) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_CANAFRAM ================ */ +/* =========================================================================================================================== */ + + + +/* =========================================================================================================================== */ +/* ================ LPC_CANAF ================ */ +/* =========================================================================================================================== */ + +/* ========================================================= AFMR ========================================================== */ +#define CANAF_AFMR_ACCOFF_Pos (0UL) /*!< ACCOFF (Bit 0) */ +#define CANAF_AFMR_ACCOFF_Msk (0x1UL) /*!< ACCOFF (Bitfield-Mask: 0x01) */ +#define CANAF_AFMR_ACCBP_Pos (1UL) /*!< ACCBP (Bit 1) */ +#define CANAF_AFMR_ACCBP_Msk (0x2UL) /*!< ACCBP (Bitfield-Mask: 0x01) */ +#define CANAF_AFMR_EFCAN_Pos (2UL) /*!< EFCAN (Bit 2) */ +#define CANAF_AFMR_EFCAN_Msk (0x4UL) /*!< EFCAN (Bitfield-Mask: 0x01) */ +/* ======================================================== SFF_SA ========================================================= */ +#define CANAF_SFF_SA_SFF_SA_Pos (2UL) /*!< SFF_SA (Bit 2) */ +#define CANAF_SFF_SA_SFF_SA_Msk (0x7fcUL) /*!< SFF_SA (Bitfield-Mask: 0x1ff) */ +/* ====================================================== SFF_GRP_SA ======================================================= */ +#define CANAF_SFF_GRP_SA_SFF_GRP_SA_Pos (2UL) /*!< SFF_GRP_SA (Bit 2) */ +#define CANAF_SFF_GRP_SA_SFF_GRP_SA_Msk (0xffcUL) /*!< SFF_GRP_SA (Bitfield-Mask: 0x3ff) */ +/* ======================================================== EFF_SA ========================================================= */ +#define CANAF_EFF_SA_EFF_SA_Pos (2UL) /*!< EFF_SA (Bit 2) */ +#define CANAF_EFF_SA_EFF_SA_Msk (0x7fcUL) /*!< EFF_SA (Bitfield-Mask: 0x1ff) */ +/* ====================================================== EFF_GRP_SA ======================================================= */ +#define CANAF_EFF_GRP_SA_EFF_GRP_SA_Pos (2UL) /*!< EFF_GRP_SA (Bit 2) */ +#define CANAF_EFF_GRP_SA_EFF_GRP_SA_Msk (0xffcUL) /*!< EFF_GRP_SA (Bitfield-Mask: 0x3ff) */ +/* ====================================================== ENDOFTABLE ======================================================= */ +#define CANAF_ENDOFTABLE_ENDOFTABLE_Pos (2UL) /*!< ENDOFTABLE (Bit 2) */ +#define CANAF_ENDOFTABLE_ENDOFTABLE_Msk (0xffcUL) /*!< ENDOFTABLE (Bitfield-Mask: 0x3ff) */ +/* ======================================================= LUTERRAD ======================================================== */ +#define CANAF_LUTERRAD_LUTERRAD_Pos (2UL) /*!< LUTERRAD (Bit 2) */ +#define CANAF_LUTERRAD_LUTERRAD_Msk (0x7fcUL) /*!< LUTERRAD (Bitfield-Mask: 0x1ff) */ +/* ======================================================== LUTERR ========================================================= */ +#define CANAF_LUTERR_LUTERR_Pos (0UL) /*!< LUTERR (Bit 0) */ +#define CANAF_LUTERR_LUTERR_Msk (0x1UL) /*!< LUTERR (Bitfield-Mask: 0x01) */ +/* ======================================================== FCANIE ========================================================= */ +#define CANAF_FCANIE_FCANIE_Pos (0UL) /*!< FCANIE (Bit 0) */ +#define CANAF_FCANIE_FCANIE_Msk (0x1UL) /*!< FCANIE (Bitfield-Mask: 0x01) */ +/* ======================================================== FCANIC0 ======================================================== */ +#define CANAF_FCANIC0_INTPND_Pos (0UL) /*!< INTPND (Bit 0) */ +#define CANAF_FCANIC0_INTPND_Msk (0xffffffffUL) /*!< INTPND (Bitfield-Mask: 0xffffffff) */ +/* ======================================================== FCANIC1 ======================================================== */ +#define CANAF_FCANIC1_IntPnd32_Pos (0UL) /*!< IntPnd32 (Bit 0) */ +#define CANAF_FCANIC1_IntPnd32_Msk (0xffffffffUL) /*!< IntPnd32 (Bitfield-Mask: 0xffffffff) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_CCAN ================ */ +/* =========================================================================================================================== */ + +/* ========================================================= TXSR ========================================================== */ +#define CCAN_TXSR_TS1_Pos (0UL) /*!< TS1 (Bit 0) */ +#define CCAN_TXSR_TS1_Msk (0x1UL) /*!< TS1 (Bitfield-Mask: 0x01) */ +#define CCAN_TXSR_TS2_Pos (1UL) /*!< TS2 (Bit 1) */ +#define CCAN_TXSR_TS2_Msk (0x2UL) /*!< TS2 (Bitfield-Mask: 0x01) */ +#define CCAN_TXSR_TBS1_Pos (8UL) /*!< TBS1 (Bit 8) */ +#define CCAN_TXSR_TBS1_Msk (0x100UL) /*!< TBS1 (Bitfield-Mask: 0x01) */ +#define CCAN_TXSR_TBS2_Pos (9UL) /*!< TBS2 (Bit 9) */ +#define CCAN_TXSR_TBS2_Msk (0x200UL) /*!< TBS2 (Bitfield-Mask: 0x01) */ +#define CCAN_TXSR_TCS1_Pos (16UL) /*!< TCS1 (Bit 16) */ +#define CCAN_TXSR_TCS1_Msk (0x10000UL) /*!< TCS1 (Bitfield-Mask: 0x01) */ +#define CCAN_TXSR_TCS2_Pos (17UL) /*!< TCS2 (Bit 17) */ +#define CCAN_TXSR_TCS2_Msk (0x20000UL) /*!< TCS2 (Bitfield-Mask: 0x01) */ +/* ========================================================= RXSR ========================================================== */ +#define CCAN_RXSR_RS1_Pos (0UL) /*!< RS1 (Bit 0) */ +#define CCAN_RXSR_RS1_Msk (0x1UL) /*!< RS1 (Bitfield-Mask: 0x01) */ +#define CCAN_RXSR_RS2_Pos (1UL) /*!< RS2 (Bit 1) */ +#define CCAN_RXSR_RS2_Msk (0x2UL) /*!< RS2 (Bitfield-Mask: 0x01) */ +#define CCAN_RXSR_RB1_Pos (8UL) /*!< RB1 (Bit 8) */ +#define CCAN_RXSR_RB1_Msk (0x100UL) /*!< RB1 (Bitfield-Mask: 0x01) */ +#define CCAN_RXSR_RB2_Pos (9UL) /*!< RB2 (Bit 9) */ +#define CCAN_RXSR_RB2_Msk (0x200UL) /*!< RB2 (Bitfield-Mask: 0x01) */ +#define CCAN_RXSR_DOS1_Pos (16UL) /*!< DOS1 (Bit 16) */ +#define CCAN_RXSR_DOS1_Msk (0x10000UL) /*!< DOS1 (Bitfield-Mask: 0x01) */ +#define CCAN_RXSR_DOS2_Pos (17UL) /*!< DOS2 (Bit 17) */ +#define CCAN_RXSR_DOS2_Msk (0x20000UL) /*!< DOS2 (Bitfield-Mask: 0x01) */ +/* ========================================================== MSR ========================================================== */ +#define CCAN_MSR_E1_Pos (0UL) /*!< E1 (Bit 0) */ +#define CCAN_MSR_E1_Msk (0x1UL) /*!< E1 (Bitfield-Mask: 0x01) */ +#define CCAN_MSR_E2_Pos (1UL) /*!< E2 (Bit 1) */ +#define CCAN_MSR_E2_Msk (0x2UL) /*!< E2 (Bitfield-Mask: 0x01) */ +#define CCAN_MSR_BS1_Pos (8UL) /*!< BS1 (Bit 8) */ +#define CCAN_MSR_BS1_Msk (0x100UL) /*!< BS1 (Bitfield-Mask: 0x01) */ +#define CCAN_MSR_BS2_Pos (9UL) /*!< BS2 (Bit 9) */ +#define CCAN_MSR_BS2_Msk (0x200UL) /*!< BS2 (Bitfield-Mask: 0x01) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_CAN1 ================ */ +/* =========================================================================================================================== */ + +/* ========================================================== MOD ========================================================== */ +#define CAN1_MOD_RM_Pos (0UL) /*!< RM (Bit 0) */ +#define CAN1_MOD_RM_Msk (0x1UL) /*!< RM (Bitfield-Mask: 0x01) */ +#define CAN1_MOD_LOM_Pos (1UL) /*!< LOM (Bit 1) */ +#define CAN1_MOD_LOM_Msk (0x2UL) /*!< LOM (Bitfield-Mask: 0x01) */ +#define CAN1_MOD_STM_Pos (2UL) /*!< STM (Bit 2) */ +#define CAN1_MOD_STM_Msk (0x4UL) /*!< STM (Bitfield-Mask: 0x01) */ +#define CAN1_MOD_TPM_Pos (3UL) /*!< TPM (Bit 3) */ +#define CAN1_MOD_TPM_Msk (0x8UL) /*!< TPM (Bitfield-Mask: 0x01) */ +#define CAN1_MOD_SM_Pos (4UL) /*!< SM (Bit 4) */ +#define CAN1_MOD_SM_Msk (0x10UL) /*!< SM (Bitfield-Mask: 0x01) */ +#define CAN1_MOD_RPM_Pos (5UL) /*!< RPM (Bit 5) */ +#define CAN1_MOD_RPM_Msk (0x20UL) /*!< RPM (Bitfield-Mask: 0x01) */ +#define CAN1_MOD_TM_Pos (7UL) /*!< TM (Bit 7) */ +#define CAN1_MOD_TM_Msk (0x80UL) /*!< TM (Bitfield-Mask: 0x01) */ +/* ========================================================== CMR ========================================================== */ +#define CAN1_CMR_TR_Pos (0UL) /*!< TR (Bit 0) */ +#define CAN1_CMR_TR_Msk (0x1UL) /*!< TR (Bitfield-Mask: 0x01) */ +#define CAN1_CMR_AT_Pos (1UL) /*!< AT (Bit 1) */ +#define CAN1_CMR_AT_Msk (0x2UL) /*!< AT (Bitfield-Mask: 0x01) */ +#define CAN1_CMR_RRB_Pos (2UL) /*!< RRB (Bit 2) */ +#define CAN1_CMR_RRB_Msk (0x4UL) /*!< RRB (Bitfield-Mask: 0x01) */ +#define CAN1_CMR_CDO_Pos (3UL) /*!< CDO (Bit 3) */ +#define CAN1_CMR_CDO_Msk (0x8UL) /*!< CDO (Bitfield-Mask: 0x01) */ +#define CAN1_CMR_SRR_Pos (4UL) /*!< SRR (Bit 4) */ +#define CAN1_CMR_SRR_Msk (0x10UL) /*!< SRR (Bitfield-Mask: 0x01) */ +#define CAN1_CMR_STB1_Pos (5UL) /*!< STB1 (Bit 5) */ +#define CAN1_CMR_STB1_Msk (0x20UL) /*!< STB1 (Bitfield-Mask: 0x01) */ +#define CAN1_CMR_STB2_Pos (6UL) /*!< STB2 (Bit 6) */ +#define CAN1_CMR_STB2_Msk (0x40UL) /*!< STB2 (Bitfield-Mask: 0x01) */ +#define CAN1_CMR_STB3_Pos (7UL) /*!< STB3 (Bit 7) */ +#define CAN1_CMR_STB3_Msk (0x80UL) /*!< STB3 (Bitfield-Mask: 0x01) */ +/* ========================================================== GSR ========================================================== */ +#define CAN1_GSR_RBS_Pos (0UL) /*!< RBS (Bit 0) */ +#define CAN1_GSR_RBS_Msk (0x1UL) /*!< RBS (Bitfield-Mask: 0x01) */ +#define CAN1_GSR_DOS_Pos (1UL) /*!< DOS (Bit 1) */ +#define CAN1_GSR_DOS_Msk (0x2UL) /*!< DOS (Bitfield-Mask: 0x01) */ +#define CAN1_GSR_TBS_Pos (2UL) /*!< TBS (Bit 2) */ +#define CAN1_GSR_TBS_Msk (0x4UL) /*!< TBS (Bitfield-Mask: 0x01) */ +#define CAN1_GSR_TCS_Pos (3UL) /*!< TCS (Bit 3) */ +#define CAN1_GSR_TCS_Msk (0x8UL) /*!< TCS (Bitfield-Mask: 0x01) */ +#define CAN1_GSR_RS_Pos (4UL) /*!< RS (Bit 4) */ +#define CAN1_GSR_RS_Msk (0x10UL) /*!< RS (Bitfield-Mask: 0x01) */ +#define CAN1_GSR_TS_Pos (5UL) /*!< TS (Bit 5) */ +#define CAN1_GSR_TS_Msk (0x20UL) /*!< TS (Bitfield-Mask: 0x01) */ +#define CAN1_GSR_ES_Pos (6UL) /*!< ES (Bit 6) */ +#define CAN1_GSR_ES_Msk (0x40UL) /*!< ES (Bitfield-Mask: 0x01) */ +#define CAN1_GSR_BS_Pos (7UL) /*!< BS (Bit 7) */ +#define CAN1_GSR_BS_Msk (0x80UL) /*!< BS (Bitfield-Mask: 0x01) */ +#define CAN1_GSR_RXERR_Pos (16UL) /*!< RXERR (Bit 16) */ +#define CAN1_GSR_RXERR_Msk (0xff0000UL) /*!< RXERR (Bitfield-Mask: 0xff) */ +#define CAN1_GSR_TXERR_Pos (24UL) /*!< TXERR (Bit 24) */ +#define CAN1_GSR_TXERR_Msk (0xff000000UL) /*!< TXERR (Bitfield-Mask: 0xff) */ +/* ========================================================== ICR ========================================================== */ +#define CAN1_ICR_RI_Pos (0UL) /*!< RI (Bit 0) */ +#define CAN1_ICR_RI_Msk (0x1UL) /*!< RI (Bitfield-Mask: 0x01) */ +#define CAN1_ICR_TI1_Pos (1UL) /*!< TI1 (Bit 1) */ +#define CAN1_ICR_TI1_Msk (0x2UL) /*!< TI1 (Bitfield-Mask: 0x01) */ +#define CAN1_ICR_EI_Pos (2UL) /*!< EI (Bit 2) */ +#define CAN1_ICR_EI_Msk (0x4UL) /*!< EI (Bitfield-Mask: 0x01) */ +#define CAN1_ICR_DOI_Pos (3UL) /*!< DOI (Bit 3) */ +#define CAN1_ICR_DOI_Msk (0x8UL) /*!< DOI (Bitfield-Mask: 0x01) */ +#define CAN1_ICR_WUI_Pos (4UL) /*!< WUI (Bit 4) */ +#define CAN1_ICR_WUI_Msk (0x10UL) /*!< WUI (Bitfield-Mask: 0x01) */ +#define CAN1_ICR_EPI_Pos (5UL) /*!< EPI (Bit 5) */ +#define CAN1_ICR_EPI_Msk (0x20UL) /*!< EPI (Bitfield-Mask: 0x01) */ +#define CAN1_ICR_ALI_Pos (6UL) /*!< ALI (Bit 6) */ +#define CAN1_ICR_ALI_Msk (0x40UL) /*!< ALI (Bitfield-Mask: 0x01) */ +#define CAN1_ICR_BEI_Pos (7UL) /*!< BEI (Bit 7) */ +#define CAN1_ICR_BEI_Msk (0x80UL) /*!< BEI (Bitfield-Mask: 0x01) */ +#define CAN1_ICR_IDI_Pos (8UL) /*!< IDI (Bit 8) */ +#define CAN1_ICR_IDI_Msk (0x100UL) /*!< IDI (Bitfield-Mask: 0x01) */ +#define CAN1_ICR_TI2_Pos (9UL) /*!< TI2 (Bit 9) */ +#define CAN1_ICR_TI2_Msk (0x200UL) /*!< TI2 (Bitfield-Mask: 0x01) */ +#define CAN1_ICR_TI3_Pos (10UL) /*!< TI3 (Bit 10) */ +#define CAN1_ICR_TI3_Msk (0x400UL) /*!< TI3 (Bitfield-Mask: 0x01) */ +#define CAN1_ICR_ERRBIT4_0_Pos (16UL) /*!< ERRBIT4_0 (Bit 16) */ +#define CAN1_ICR_ERRBIT4_0_Msk (0x1f0000UL) /*!< ERRBIT4_0 (Bitfield-Mask: 0x1f) */ +#define CAN1_ICR_ERRDIR_Pos (21UL) /*!< ERRDIR (Bit 21) */ +#define CAN1_ICR_ERRDIR_Msk (0x200000UL) /*!< ERRDIR (Bitfield-Mask: 0x01) */ +#define CAN1_ICR_ERRC1_0_Pos (22UL) /*!< ERRC1_0 (Bit 22) */ +#define CAN1_ICR_ERRC1_0_Msk (0xc00000UL) /*!< ERRC1_0 (Bitfield-Mask: 0x03) */ +#define CAN1_ICR_ALCBIT_Pos (24UL) /*!< ALCBIT (Bit 24) */ +#define CAN1_ICR_ALCBIT_Msk (0xff000000UL) /*!< ALCBIT (Bitfield-Mask: 0xff) */ +/* ========================================================== IER ========================================================== */ +#define CAN1_IER_RIE_Pos (0UL) /*!< RIE (Bit 0) */ +#define CAN1_IER_RIE_Msk (0x1UL) /*!< RIE (Bitfield-Mask: 0x01) */ +#define CAN1_IER_TIE1_Pos (1UL) /*!< TIE1 (Bit 1) */ +#define CAN1_IER_TIE1_Msk (0x2UL) /*!< TIE1 (Bitfield-Mask: 0x01) */ +#define CAN1_IER_EIE_Pos (2UL) /*!< EIE (Bit 2) */ +#define CAN1_IER_EIE_Msk (0x4UL) /*!< EIE (Bitfield-Mask: 0x01) */ +#define CAN1_IER_DOIE_Pos (3UL) /*!< DOIE (Bit 3) */ +#define CAN1_IER_DOIE_Msk (0x8UL) /*!< DOIE (Bitfield-Mask: 0x01) */ +#define CAN1_IER_WUIE_Pos (4UL) /*!< WUIE (Bit 4) */ +#define CAN1_IER_WUIE_Msk (0x10UL) /*!< WUIE (Bitfield-Mask: 0x01) */ +#define CAN1_IER_EPIE_Pos (5UL) /*!< EPIE (Bit 5) */ +#define CAN1_IER_EPIE_Msk (0x20UL) /*!< EPIE (Bitfield-Mask: 0x01) */ +#define CAN1_IER_ALIE_Pos (6UL) /*!< ALIE (Bit 6) */ +#define CAN1_IER_ALIE_Msk (0x40UL) /*!< ALIE (Bitfield-Mask: 0x01) */ +#define CAN1_IER_BEIE_Pos (7UL) /*!< BEIE (Bit 7) */ +#define CAN1_IER_BEIE_Msk (0x80UL) /*!< BEIE (Bitfield-Mask: 0x01) */ +#define CAN1_IER_IDIE_Pos (8UL) /*!< IDIE (Bit 8) */ +#define CAN1_IER_IDIE_Msk (0x100UL) /*!< IDIE (Bitfield-Mask: 0x01) */ +#define CAN1_IER_TIE2_Pos (9UL) /*!< TIE2 (Bit 9) */ +#define CAN1_IER_TIE2_Msk (0x200UL) /*!< TIE2 (Bitfield-Mask: 0x01) */ +#define CAN1_IER_TIE3_Pos (10UL) /*!< TIE3 (Bit 10) */ +#define CAN1_IER_TIE3_Msk (0x400UL) /*!< TIE3 (Bitfield-Mask: 0x01) */ +/* ========================================================== BTR ========================================================== */ +#define CAN1_BTR_BRP_Pos (0UL) /*!< BRP (Bit 0) */ +#define CAN1_BTR_BRP_Msk (0x3ffUL) /*!< BRP (Bitfield-Mask: 0x3ff) */ +#define CAN1_BTR_SJW_Pos (14UL) /*!< SJW (Bit 14) */ +#define CAN1_BTR_SJW_Msk (0xc000UL) /*!< SJW (Bitfield-Mask: 0x03) */ +#define CAN1_BTR_TESG1_Pos (16UL) /*!< TESG1 (Bit 16) */ +#define CAN1_BTR_TESG1_Msk (0xf0000UL) /*!< TESG1 (Bitfield-Mask: 0x0f) */ +#define CAN1_BTR_TESG2_Pos (20UL) /*!< TESG2 (Bit 20) */ +#define CAN1_BTR_TESG2_Msk (0x700000UL) /*!< TESG2 (Bitfield-Mask: 0x07) */ +#define CAN1_BTR_SAM_Pos (23UL) /*!< SAM (Bit 23) */ +#define CAN1_BTR_SAM_Msk (0x800000UL) /*!< SAM (Bitfield-Mask: 0x01) */ +/* ========================================================== EWL ========================================================== */ +#define CAN1_EWL_EWL_Pos (0UL) /*!< EWL (Bit 0) */ +#define CAN1_EWL_EWL_Msk (0xffUL) /*!< EWL (Bitfield-Mask: 0xff) */ +/* ========================================================== SR =========================================================== */ +#define CAN1_SR_RBS_1_Pos (0UL) /*!< RBS_1 (Bit 0) */ +#define CAN1_SR_RBS_1_Msk (0x1UL) /*!< RBS_1 (Bitfield-Mask: 0x01) */ +#define CAN1_SR_DOS_1_Pos (1UL) /*!< DOS_1 (Bit 1) */ +#define CAN1_SR_DOS_1_Msk (0x2UL) /*!< DOS_1 (Bitfield-Mask: 0x01) */ +#define CAN1_SR_TBS1_1_Pos (2UL) /*!< TBS1_1 (Bit 2) */ +#define CAN1_SR_TBS1_1_Msk (0x4UL) /*!< TBS1_1 (Bitfield-Mask: 0x01) */ +#define CAN1_SR_TCS1_1_Pos (3UL) /*!< TCS1_1 (Bit 3) */ +#define CAN1_SR_TCS1_1_Msk (0x8UL) /*!< TCS1_1 (Bitfield-Mask: 0x01) */ +#define CAN1_SR_RS_1_Pos (4UL) /*!< RS_1 (Bit 4) */ +#define CAN1_SR_RS_1_Msk (0x10UL) /*!< RS_1 (Bitfield-Mask: 0x01) */ +#define CAN1_SR_TS1_1_Pos (5UL) /*!< TS1_1 (Bit 5) */ +#define CAN1_SR_TS1_1_Msk (0x20UL) /*!< TS1_1 (Bitfield-Mask: 0x01) */ +#define CAN1_SR_ES_1_Pos (6UL) /*!< ES_1 (Bit 6) */ +#define CAN1_SR_ES_1_Msk (0x40UL) /*!< ES_1 (Bitfield-Mask: 0x01) */ +#define CAN1_SR_BS_1_Pos (7UL) /*!< BS_1 (Bit 7) */ +#define CAN1_SR_BS_1_Msk (0x80UL) /*!< BS_1 (Bitfield-Mask: 0x01) */ +#define CAN1_SR_RBS_2_Pos (8UL) /*!< RBS_2 (Bit 8) */ +#define CAN1_SR_RBS_2_Msk (0x100UL) /*!< RBS_2 (Bitfield-Mask: 0x01) */ +#define CAN1_SR_DOS_2_Pos (9UL) /*!< DOS_2 (Bit 9) */ +#define CAN1_SR_DOS_2_Msk (0x200UL) /*!< DOS_2 (Bitfield-Mask: 0x01) */ +#define CAN1_SR_TBS2_2_Pos (10UL) /*!< TBS2_2 (Bit 10) */ +#define CAN1_SR_TBS2_2_Msk (0x400UL) /*!< TBS2_2 (Bitfield-Mask: 0x01) */ +#define CAN1_SR_TCS2_2_Pos (11UL) /*!< TCS2_2 (Bit 11) */ +#define CAN1_SR_TCS2_2_Msk (0x800UL) /*!< TCS2_2 (Bitfield-Mask: 0x01) */ +#define CAN1_SR_RS_2_Pos (12UL) /*!< RS_2 (Bit 12) */ +#define CAN1_SR_RS_2_Msk (0x1000UL) /*!< RS_2 (Bitfield-Mask: 0x01) */ +#define CAN1_SR_TS2_2_Pos (13UL) /*!< TS2_2 (Bit 13) */ +#define CAN1_SR_TS2_2_Msk (0x2000UL) /*!< TS2_2 (Bitfield-Mask: 0x01) */ +#define CAN1_SR_ES_2_Pos (14UL) /*!< ES_2 (Bit 14) */ +#define CAN1_SR_ES_2_Msk (0x4000UL) /*!< ES_2 (Bitfield-Mask: 0x01) */ +#define CAN1_SR_BS_2_Pos (15UL) /*!< BS_2 (Bit 15) */ +#define CAN1_SR_BS_2_Msk (0x8000UL) /*!< BS_2 (Bitfield-Mask: 0x01) */ +#define CAN1_SR_RBS_3_Pos (16UL) /*!< RBS_3 (Bit 16) */ +#define CAN1_SR_RBS_3_Msk (0x10000UL) /*!< RBS_3 (Bitfield-Mask: 0x01) */ +#define CAN1_SR_DOS_3_Pos (17UL) /*!< DOS_3 (Bit 17) */ +#define CAN1_SR_DOS_3_Msk (0x20000UL) /*!< DOS_3 (Bitfield-Mask: 0x01) */ +#define CAN1_SR_TBS3_3_Pos (18UL) /*!< TBS3_3 (Bit 18) */ +#define CAN1_SR_TBS3_3_Msk (0x40000UL) /*!< TBS3_3 (Bitfield-Mask: 0x01) */ +#define CAN1_SR_TCS3_3_Pos (19UL) /*!< TCS3_3 (Bit 19) */ +#define CAN1_SR_TCS3_3_Msk (0x80000UL) /*!< TCS3_3 (Bitfield-Mask: 0x01) */ +#define CAN1_SR_RS_3_Pos (20UL) /*!< RS_3 (Bit 20) */ +#define CAN1_SR_RS_3_Msk (0x100000UL) /*!< RS_3 (Bitfield-Mask: 0x01) */ +#define CAN1_SR_TS3_3_Pos (21UL) /*!< TS3_3 (Bit 21) */ +#define CAN1_SR_TS3_3_Msk (0x200000UL) /*!< TS3_3 (Bitfield-Mask: 0x01) */ +#define CAN1_SR_ES_3_Pos (22UL) /*!< ES_3 (Bit 22) */ +#define CAN1_SR_ES_3_Msk (0x400000UL) /*!< ES_3 (Bitfield-Mask: 0x01) */ +#define CAN1_SR_BS_3_Pos (23UL) /*!< BS_3 (Bit 23) */ +#define CAN1_SR_BS_3_Msk (0x800000UL) /*!< BS_3 (Bitfield-Mask: 0x01) */ +/* ========================================================== RFS ========================================================== */ +#define CAN1_RFS_IDINDEX_Pos (0UL) /*!< IDINDEX (Bit 0) */ +#define CAN1_RFS_IDINDEX_Msk (0x3ffUL) /*!< IDINDEX (Bitfield-Mask: 0x3ff) */ +#define CAN1_RFS_BP_Pos (10UL) /*!< BP (Bit 10) */ +#define CAN1_RFS_BP_Msk (0x400UL) /*!< BP (Bitfield-Mask: 0x01) */ +#define CAN1_RFS_DLC_Pos (16UL) /*!< DLC (Bit 16) */ +#define CAN1_RFS_DLC_Msk (0xf0000UL) /*!< DLC (Bitfield-Mask: 0x0f) */ +#define CAN1_RFS_RTR_Pos (30UL) /*!< RTR (Bit 30) */ +#define CAN1_RFS_RTR_Msk (0x40000000UL) /*!< RTR (Bitfield-Mask: 0x01) */ +#define CAN1_RFS_FF_Pos (31UL) /*!< FF (Bit 31) */ +#define CAN1_RFS_FF_Msk (0x80000000UL) /*!< FF (Bitfield-Mask: 0x01) */ +/* ========================================================== RID ========================================================== */ +#define CAN1_RID_ID_Pos (0UL) /*!< ID (Bit 0) */ +#define CAN1_RID_ID_Msk (0x7ffUL) /*!< ID (Bitfield-Mask: 0x7ff) */ +/* ========================================================== RDA ========================================================== */ +#define CAN1_RDA_DATA1_Pos (0UL) /*!< DATA1 (Bit 0) */ +#define CAN1_RDA_DATA1_Msk (0xffUL) /*!< DATA1 (Bitfield-Mask: 0xff) */ +#define CAN1_RDA_DATA2_Pos (8UL) /*!< DATA2 (Bit 8) */ +#define CAN1_RDA_DATA2_Msk (0xff00UL) /*!< DATA2 (Bitfield-Mask: 0xff) */ +#define CAN1_RDA_DATA3_Pos (16UL) /*!< DATA3 (Bit 16) */ +#define CAN1_RDA_DATA3_Msk (0xff0000UL) /*!< DATA3 (Bitfield-Mask: 0xff) */ +#define CAN1_RDA_DATA4_Pos (24UL) /*!< DATA4 (Bit 24) */ +#define CAN1_RDA_DATA4_Msk (0xff000000UL) /*!< DATA4 (Bitfield-Mask: 0xff) */ +/* ========================================================== RDB ========================================================== */ +#define CAN1_RDB_DATA5_Pos (0UL) /*!< DATA5 (Bit 0) */ +#define CAN1_RDB_DATA5_Msk (0xffUL) /*!< DATA5 (Bitfield-Mask: 0xff) */ +#define CAN1_RDB_DATA6_Pos (8UL) /*!< DATA6 (Bit 8) */ +#define CAN1_RDB_DATA6_Msk (0xff00UL) /*!< DATA6 (Bitfield-Mask: 0xff) */ +#define CAN1_RDB_DATA7_Pos (16UL) /*!< DATA7 (Bit 16) */ +#define CAN1_RDB_DATA7_Msk (0xff0000UL) /*!< DATA7 (Bitfield-Mask: 0xff) */ +#define CAN1_RDB_DATA8_Pos (24UL) /*!< DATA8 (Bit 24) */ +#define CAN1_RDB_DATA8_Msk (0xff000000UL) /*!< DATA8 (Bitfield-Mask: 0xff) */ +/* ========================================================= TFI1 ========================================================== */ +#define CAN1_TFI1_PRIO_Pos (0UL) /*!< PRIO (Bit 0) */ +#define CAN1_TFI1_PRIO_Msk (0xffUL) /*!< PRIO (Bitfield-Mask: 0xff) */ +#define CAN1_TFI1_DLC_Pos (16UL) /*!< DLC (Bit 16) */ +#define CAN1_TFI1_DLC_Msk (0xf0000UL) /*!< DLC (Bitfield-Mask: 0x0f) */ +#define CAN1_TFI1_RTR_Pos (30UL) /*!< RTR (Bit 30) */ +#define CAN1_TFI1_RTR_Msk (0x40000000UL) /*!< RTR (Bitfield-Mask: 0x01) */ +#define CAN1_TFI1_FF_Pos (31UL) /*!< FF (Bit 31) */ +#define CAN1_TFI1_FF_Msk (0x80000000UL) /*!< FF (Bitfield-Mask: 0x01) */ +/* ========================================================= TFI2 ========================================================== */ +#define CAN1_TFI2_PRIO_Pos (0UL) /*!< PRIO (Bit 0) */ +#define CAN1_TFI2_PRIO_Msk (0xffUL) /*!< PRIO (Bitfield-Mask: 0xff) */ +#define CAN1_TFI2_DLC_Pos (16UL) /*!< DLC (Bit 16) */ +#define CAN1_TFI2_DLC_Msk (0xf0000UL) /*!< DLC (Bitfield-Mask: 0x0f) */ +#define CAN1_TFI2_RTR_Pos (30UL) /*!< RTR (Bit 30) */ +#define CAN1_TFI2_RTR_Msk (0x40000000UL) /*!< RTR (Bitfield-Mask: 0x01) */ +#define CAN1_TFI2_FF_Pos (31UL) /*!< FF (Bit 31) */ +#define CAN1_TFI2_FF_Msk (0x80000000UL) /*!< FF (Bitfield-Mask: 0x01) */ +/* ========================================================= TFI3 ========================================================== */ +#define CAN1_TFI3_PRIO_Pos (0UL) /*!< PRIO (Bit 0) */ +#define CAN1_TFI3_PRIO_Msk (0xffUL) /*!< PRIO (Bitfield-Mask: 0xff) */ +#define CAN1_TFI3_DLC_Pos (16UL) /*!< DLC (Bit 16) */ +#define CAN1_TFI3_DLC_Msk (0xf0000UL) /*!< DLC (Bitfield-Mask: 0x0f) */ +#define CAN1_TFI3_RTR_Pos (30UL) /*!< RTR (Bit 30) */ +#define CAN1_TFI3_RTR_Msk (0x40000000UL) /*!< RTR (Bitfield-Mask: 0x01) */ +#define CAN1_TFI3_FF_Pos (31UL) /*!< FF (Bit 31) */ +#define CAN1_TFI3_FF_Msk (0x80000000UL) /*!< FF (Bitfield-Mask: 0x01) */ +/* ========================================================= TID1 ========================================================== */ +#define CAN1_TID1_ID_Pos (0UL) /*!< ID (Bit 0) */ +#define CAN1_TID1_ID_Msk (0x7ffUL) /*!< ID (Bitfield-Mask: 0x7ff) */ +/* ========================================================= TID2 ========================================================== */ +#define CAN1_TID2_ID_Pos (0UL) /*!< ID (Bit 0) */ +#define CAN1_TID2_ID_Msk (0x7ffUL) /*!< ID (Bitfield-Mask: 0x7ff) */ +/* ========================================================= TID3 ========================================================== */ +#define CAN1_TID3_ID_Pos (0UL) /*!< ID (Bit 0) */ +#define CAN1_TID3_ID_Msk (0x7ffUL) /*!< ID (Bitfield-Mask: 0x7ff) */ +/* ========================================================= TDA1 ========================================================== */ +#define CAN1_TDA1_DATA1_Pos (0UL) /*!< DATA1 (Bit 0) */ +#define CAN1_TDA1_DATA1_Msk (0xffUL) /*!< DATA1 (Bitfield-Mask: 0xff) */ +#define CAN1_TDA1_DATA2_Pos (8UL) /*!< DATA2 (Bit 8) */ +#define CAN1_TDA1_DATA2_Msk (0xff00UL) /*!< DATA2 (Bitfield-Mask: 0xff) */ +#define CAN1_TDA1_DATA3_Pos (16UL) /*!< DATA3 (Bit 16) */ +#define CAN1_TDA1_DATA3_Msk (0xff0000UL) /*!< DATA3 (Bitfield-Mask: 0xff) */ +#define CAN1_TDA1_DATA4_Pos (24UL) /*!< DATA4 (Bit 24) */ +#define CAN1_TDA1_DATA4_Msk (0xff000000UL) /*!< DATA4 (Bitfield-Mask: 0xff) */ +/* ========================================================= TDA2 ========================================================== */ +#define CAN1_TDA2_DATA1_Pos (0UL) /*!< DATA1 (Bit 0) */ +#define CAN1_TDA2_DATA1_Msk (0xffUL) /*!< DATA1 (Bitfield-Mask: 0xff) */ +#define CAN1_TDA2_DATA2_Pos (8UL) /*!< DATA2 (Bit 8) */ +#define CAN1_TDA2_DATA2_Msk (0xff00UL) /*!< DATA2 (Bitfield-Mask: 0xff) */ +#define CAN1_TDA2_DATA3_Pos (16UL) /*!< DATA3 (Bit 16) */ +#define CAN1_TDA2_DATA3_Msk (0xff0000UL) /*!< DATA3 (Bitfield-Mask: 0xff) */ +#define CAN1_TDA2_DATA4_Pos (24UL) /*!< DATA4 (Bit 24) */ +#define CAN1_TDA2_DATA4_Msk (0xff000000UL) /*!< DATA4 (Bitfield-Mask: 0xff) */ +/* ========================================================= TDA3 ========================================================== */ +#define CAN1_TDA3_DATA1_Pos (0UL) /*!< DATA1 (Bit 0) */ +#define CAN1_TDA3_DATA1_Msk (0xffUL) /*!< DATA1 (Bitfield-Mask: 0xff) */ +#define CAN1_TDA3_DATA2_Pos (8UL) /*!< DATA2 (Bit 8) */ +#define CAN1_TDA3_DATA2_Msk (0xff00UL) /*!< DATA2 (Bitfield-Mask: 0xff) */ +#define CAN1_TDA3_DATA3_Pos (16UL) /*!< DATA3 (Bit 16) */ +#define CAN1_TDA3_DATA3_Msk (0xff0000UL) /*!< DATA3 (Bitfield-Mask: 0xff) */ +#define CAN1_TDA3_DATA4_Pos (24UL) /*!< DATA4 (Bit 24) */ +#define CAN1_TDA3_DATA4_Msk (0xff000000UL) /*!< DATA4 (Bitfield-Mask: 0xff) */ +/* ========================================================= TDB1 ========================================================== */ +#define CAN1_TDB1_DATA5_Pos (0UL) /*!< DATA5 (Bit 0) */ +#define CAN1_TDB1_DATA5_Msk (0xffUL) /*!< DATA5 (Bitfield-Mask: 0xff) */ +#define CAN1_TDB1_DATA6_Pos (8UL) /*!< DATA6 (Bit 8) */ +#define CAN1_TDB1_DATA6_Msk (0xff00UL) /*!< DATA6 (Bitfield-Mask: 0xff) */ +#define CAN1_TDB1_DATA7_Pos (16UL) /*!< DATA7 (Bit 16) */ +#define CAN1_TDB1_DATA7_Msk (0xff0000UL) /*!< DATA7 (Bitfield-Mask: 0xff) */ +#define CAN1_TDB1_DATA8_Pos (24UL) /*!< DATA8 (Bit 24) */ +#define CAN1_TDB1_DATA8_Msk (0xff000000UL) /*!< DATA8 (Bitfield-Mask: 0xff) */ +/* ========================================================= TDB2 ========================================================== */ +#define CAN1_TDB2_DATA5_Pos (0UL) /*!< DATA5 (Bit 0) */ +#define CAN1_TDB2_DATA5_Msk (0xffUL) /*!< DATA5 (Bitfield-Mask: 0xff) */ +#define CAN1_TDB2_DATA6_Pos (8UL) /*!< DATA6 (Bit 8) */ +#define CAN1_TDB2_DATA6_Msk (0xff00UL) /*!< DATA6 (Bitfield-Mask: 0xff) */ +#define CAN1_TDB2_DATA7_Pos (16UL) /*!< DATA7 (Bit 16) */ +#define CAN1_TDB2_DATA7_Msk (0xff0000UL) /*!< DATA7 (Bitfield-Mask: 0xff) */ +#define CAN1_TDB2_DATA8_Pos (24UL) /*!< DATA8 (Bit 24) */ +#define CAN1_TDB2_DATA8_Msk (0xff000000UL) /*!< DATA8 (Bitfield-Mask: 0xff) */ +/* ========================================================= TDB3 ========================================================== */ +#define CAN1_TDB3_DATA5_Pos (0UL) /*!< DATA5 (Bit 0) */ +#define CAN1_TDB3_DATA5_Msk (0xffUL) /*!< DATA5 (Bitfield-Mask: 0xff) */ +#define CAN1_TDB3_DATA6_Pos (8UL) /*!< DATA6 (Bit 8) */ +#define CAN1_TDB3_DATA6_Msk (0xff00UL) /*!< DATA6 (Bitfield-Mask: 0xff) */ +#define CAN1_TDB3_DATA7_Pos (16UL) /*!< DATA7 (Bit 16) */ +#define CAN1_TDB3_DATA7_Msk (0xff0000UL) /*!< DATA7 (Bitfield-Mask: 0xff) */ +#define CAN1_TDB3_DATA8_Pos (24UL) /*!< DATA8 (Bit 24) */ +#define CAN1_TDB3_DATA8_Msk (0xff000000UL) /*!< DATA8 (Bitfield-Mask: 0xff) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_CAN2 ================ */ +/* =========================================================================================================================== */ + +/* ========================================================== MOD ========================================================== */ +#define CAN2_MOD_RM_Pos (0UL) /*!< RM (Bit 0) */ +#define CAN2_MOD_RM_Msk (0x1UL) /*!< RM (Bitfield-Mask: 0x01) */ +#define CAN2_MOD_LOM_Pos (1UL) /*!< LOM (Bit 1) */ +#define CAN2_MOD_LOM_Msk (0x2UL) /*!< LOM (Bitfield-Mask: 0x01) */ +#define CAN2_MOD_STM_Pos (2UL) /*!< STM (Bit 2) */ +#define CAN2_MOD_STM_Msk (0x4UL) /*!< STM (Bitfield-Mask: 0x01) */ +#define CAN2_MOD_TPM_Pos (3UL) /*!< TPM (Bit 3) */ +#define CAN2_MOD_TPM_Msk (0x8UL) /*!< TPM (Bitfield-Mask: 0x01) */ +#define CAN2_MOD_SM_Pos (4UL) /*!< SM (Bit 4) */ +#define CAN2_MOD_SM_Msk (0x10UL) /*!< SM (Bitfield-Mask: 0x01) */ +#define CAN2_MOD_RPM_Pos (5UL) /*!< RPM (Bit 5) */ +#define CAN2_MOD_RPM_Msk (0x20UL) /*!< RPM (Bitfield-Mask: 0x01) */ +#define CAN2_MOD_TM_Pos (7UL) /*!< TM (Bit 7) */ +#define CAN2_MOD_TM_Msk (0x80UL) /*!< TM (Bitfield-Mask: 0x01) */ +/* ========================================================== CMR ========================================================== */ +#define CAN2_CMR_TR_Pos (0UL) /*!< TR (Bit 0) */ +#define CAN2_CMR_TR_Msk (0x1UL) /*!< TR (Bitfield-Mask: 0x01) */ +#define CAN2_CMR_AT_Pos (1UL) /*!< AT (Bit 1) */ +#define CAN2_CMR_AT_Msk (0x2UL) /*!< AT (Bitfield-Mask: 0x01) */ +#define CAN2_CMR_RRB_Pos (2UL) /*!< RRB (Bit 2) */ +#define CAN2_CMR_RRB_Msk (0x4UL) /*!< RRB (Bitfield-Mask: 0x01) */ +#define CAN2_CMR_CDO_Pos (3UL) /*!< CDO (Bit 3) */ +#define CAN2_CMR_CDO_Msk (0x8UL) /*!< CDO (Bitfield-Mask: 0x01) */ +#define CAN2_CMR_SRR_Pos (4UL) /*!< SRR (Bit 4) */ +#define CAN2_CMR_SRR_Msk (0x10UL) /*!< SRR (Bitfield-Mask: 0x01) */ +#define CAN2_CMR_STB1_Pos (5UL) /*!< STB1 (Bit 5) */ +#define CAN2_CMR_STB1_Msk (0x20UL) /*!< STB1 (Bitfield-Mask: 0x01) */ +#define CAN2_CMR_STB2_Pos (6UL) /*!< STB2 (Bit 6) */ +#define CAN2_CMR_STB2_Msk (0x40UL) /*!< STB2 (Bitfield-Mask: 0x01) */ +#define CAN2_CMR_STB3_Pos (7UL) /*!< STB3 (Bit 7) */ +#define CAN2_CMR_STB3_Msk (0x80UL) /*!< STB3 (Bitfield-Mask: 0x01) */ +/* ========================================================== GSR ========================================================== */ +#define CAN2_GSR_RBS_Pos (0UL) /*!< RBS (Bit 0) */ +#define CAN2_GSR_RBS_Msk (0x1UL) /*!< RBS (Bitfield-Mask: 0x01) */ +#define CAN2_GSR_DOS_Pos (1UL) /*!< DOS (Bit 1) */ +#define CAN2_GSR_DOS_Msk (0x2UL) /*!< DOS (Bitfield-Mask: 0x01) */ +#define CAN2_GSR_TBS_Pos (2UL) /*!< TBS (Bit 2) */ +#define CAN2_GSR_TBS_Msk (0x4UL) /*!< TBS (Bitfield-Mask: 0x01) */ +#define CAN2_GSR_TCS_Pos (3UL) /*!< TCS (Bit 3) */ +#define CAN2_GSR_TCS_Msk (0x8UL) /*!< TCS (Bitfield-Mask: 0x01) */ +#define CAN2_GSR_RS_Pos (4UL) /*!< RS (Bit 4) */ +#define CAN2_GSR_RS_Msk (0x10UL) /*!< RS (Bitfield-Mask: 0x01) */ +#define CAN2_GSR_TS_Pos (5UL) /*!< TS (Bit 5) */ +#define CAN2_GSR_TS_Msk (0x20UL) /*!< TS (Bitfield-Mask: 0x01) */ +#define CAN2_GSR_ES_Pos (6UL) /*!< ES (Bit 6) */ +#define CAN2_GSR_ES_Msk (0x40UL) /*!< ES (Bitfield-Mask: 0x01) */ +#define CAN2_GSR_BS_Pos (7UL) /*!< BS (Bit 7) */ +#define CAN2_GSR_BS_Msk (0x80UL) /*!< BS (Bitfield-Mask: 0x01) */ +#define CAN2_GSR_RXERR_Pos (16UL) /*!< RXERR (Bit 16) */ +#define CAN2_GSR_RXERR_Msk (0xff0000UL) /*!< RXERR (Bitfield-Mask: 0xff) */ +#define CAN2_GSR_TXERR_Pos (24UL) /*!< TXERR (Bit 24) */ +#define CAN2_GSR_TXERR_Msk (0xff000000UL) /*!< TXERR (Bitfield-Mask: 0xff) */ +/* ========================================================== ICR ========================================================== */ +#define CAN2_ICR_RI_Pos (0UL) /*!< RI (Bit 0) */ +#define CAN2_ICR_RI_Msk (0x1UL) /*!< RI (Bitfield-Mask: 0x01) */ +#define CAN2_ICR_TI1_Pos (1UL) /*!< TI1 (Bit 1) */ +#define CAN2_ICR_TI1_Msk (0x2UL) /*!< TI1 (Bitfield-Mask: 0x01) */ +#define CAN2_ICR_EI_Pos (2UL) /*!< EI (Bit 2) */ +#define CAN2_ICR_EI_Msk (0x4UL) /*!< EI (Bitfield-Mask: 0x01) */ +#define CAN2_ICR_DOI_Pos (3UL) /*!< DOI (Bit 3) */ +#define CAN2_ICR_DOI_Msk (0x8UL) /*!< DOI (Bitfield-Mask: 0x01) */ +#define CAN2_ICR_WUI_Pos (4UL) /*!< WUI (Bit 4) */ +#define CAN2_ICR_WUI_Msk (0x10UL) /*!< WUI (Bitfield-Mask: 0x01) */ +#define CAN2_ICR_EPI_Pos (5UL) /*!< EPI (Bit 5) */ +#define CAN2_ICR_EPI_Msk (0x20UL) /*!< EPI (Bitfield-Mask: 0x01) */ +#define CAN2_ICR_ALI_Pos (6UL) /*!< ALI (Bit 6) */ +#define CAN2_ICR_ALI_Msk (0x40UL) /*!< ALI (Bitfield-Mask: 0x01) */ +#define CAN2_ICR_BEI_Pos (7UL) /*!< BEI (Bit 7) */ +#define CAN2_ICR_BEI_Msk (0x80UL) /*!< BEI (Bitfield-Mask: 0x01) */ +#define CAN2_ICR_IDI_Pos (8UL) /*!< IDI (Bit 8) */ +#define CAN2_ICR_IDI_Msk (0x100UL) /*!< IDI (Bitfield-Mask: 0x01) */ +#define CAN2_ICR_TI2_Pos (9UL) /*!< TI2 (Bit 9) */ +#define CAN2_ICR_TI2_Msk (0x200UL) /*!< TI2 (Bitfield-Mask: 0x01) */ +#define CAN2_ICR_TI3_Pos (10UL) /*!< TI3 (Bit 10) */ +#define CAN2_ICR_TI3_Msk (0x400UL) /*!< TI3 (Bitfield-Mask: 0x01) */ +#define CAN2_ICR_ERRBIT4_0_Pos (16UL) /*!< ERRBIT4_0 (Bit 16) */ +#define CAN2_ICR_ERRBIT4_0_Msk (0x1f0000UL) /*!< ERRBIT4_0 (Bitfield-Mask: 0x1f) */ +#define CAN2_ICR_ERRDIR_Pos (21UL) /*!< ERRDIR (Bit 21) */ +#define CAN2_ICR_ERRDIR_Msk (0x200000UL) /*!< ERRDIR (Bitfield-Mask: 0x01) */ +#define CAN2_ICR_ERRC1_0_Pos (22UL) /*!< ERRC1_0 (Bit 22) */ +#define CAN2_ICR_ERRC1_0_Msk (0xc00000UL) /*!< ERRC1_0 (Bitfield-Mask: 0x03) */ +#define CAN2_ICR_ALCBIT_Pos (24UL) /*!< ALCBIT (Bit 24) */ +#define CAN2_ICR_ALCBIT_Msk (0xff000000UL) /*!< ALCBIT (Bitfield-Mask: 0xff) */ +/* ========================================================== IER ========================================================== */ +#define CAN2_IER_RIE_Pos (0UL) /*!< RIE (Bit 0) */ +#define CAN2_IER_RIE_Msk (0x1UL) /*!< RIE (Bitfield-Mask: 0x01) */ +#define CAN2_IER_TIE1_Pos (1UL) /*!< TIE1 (Bit 1) */ +#define CAN2_IER_TIE1_Msk (0x2UL) /*!< TIE1 (Bitfield-Mask: 0x01) */ +#define CAN2_IER_EIE_Pos (2UL) /*!< EIE (Bit 2) */ +#define CAN2_IER_EIE_Msk (0x4UL) /*!< EIE (Bitfield-Mask: 0x01) */ +#define CAN2_IER_DOIE_Pos (3UL) /*!< DOIE (Bit 3) */ +#define CAN2_IER_DOIE_Msk (0x8UL) /*!< DOIE (Bitfield-Mask: 0x01) */ +#define CAN2_IER_WUIE_Pos (4UL) /*!< WUIE (Bit 4) */ +#define CAN2_IER_WUIE_Msk (0x10UL) /*!< WUIE (Bitfield-Mask: 0x01) */ +#define CAN2_IER_EPIE_Pos (5UL) /*!< EPIE (Bit 5) */ +#define CAN2_IER_EPIE_Msk (0x20UL) /*!< EPIE (Bitfield-Mask: 0x01) */ +#define CAN2_IER_ALIE_Pos (6UL) /*!< ALIE (Bit 6) */ +#define CAN2_IER_ALIE_Msk (0x40UL) /*!< ALIE (Bitfield-Mask: 0x01) */ +#define CAN2_IER_BEIE_Pos (7UL) /*!< BEIE (Bit 7) */ +#define CAN2_IER_BEIE_Msk (0x80UL) /*!< BEIE (Bitfield-Mask: 0x01) */ +#define CAN2_IER_IDIE_Pos (8UL) /*!< IDIE (Bit 8) */ +#define CAN2_IER_IDIE_Msk (0x100UL) /*!< IDIE (Bitfield-Mask: 0x01) */ +#define CAN2_IER_TIE2_Pos (9UL) /*!< TIE2 (Bit 9) */ +#define CAN2_IER_TIE2_Msk (0x200UL) /*!< TIE2 (Bitfield-Mask: 0x01) */ +#define CAN2_IER_TIE3_Pos (10UL) /*!< TIE3 (Bit 10) */ +#define CAN2_IER_TIE3_Msk (0x400UL) /*!< TIE3 (Bitfield-Mask: 0x01) */ +/* ========================================================== BTR ========================================================== */ +#define CAN2_BTR_BRP_Pos (0UL) /*!< BRP (Bit 0) */ +#define CAN2_BTR_BRP_Msk (0x3ffUL) /*!< BRP (Bitfield-Mask: 0x3ff) */ +#define CAN2_BTR_SJW_Pos (14UL) /*!< SJW (Bit 14) */ +#define CAN2_BTR_SJW_Msk (0xc000UL) /*!< SJW (Bitfield-Mask: 0x03) */ +#define CAN2_BTR_TESG1_Pos (16UL) /*!< TESG1 (Bit 16) */ +#define CAN2_BTR_TESG1_Msk (0xf0000UL) /*!< TESG1 (Bitfield-Mask: 0x0f) */ +#define CAN2_BTR_TESG2_Pos (20UL) /*!< TESG2 (Bit 20) */ +#define CAN2_BTR_TESG2_Msk (0x700000UL) /*!< TESG2 (Bitfield-Mask: 0x07) */ +#define CAN2_BTR_SAM_Pos (23UL) /*!< SAM (Bit 23) */ +#define CAN2_BTR_SAM_Msk (0x800000UL) /*!< SAM (Bitfield-Mask: 0x01) */ +/* ========================================================== EWL ========================================================== */ +#define CAN2_EWL_EWL_Pos (0UL) /*!< EWL (Bit 0) */ +#define CAN2_EWL_EWL_Msk (0xffUL) /*!< EWL (Bitfield-Mask: 0xff) */ +/* ========================================================== SR =========================================================== */ +#define CAN2_SR_RBS_1_Pos (0UL) /*!< RBS_1 (Bit 0) */ +#define CAN2_SR_RBS_1_Msk (0x1UL) /*!< RBS_1 (Bitfield-Mask: 0x01) */ +#define CAN2_SR_DOS_1_Pos (1UL) /*!< DOS_1 (Bit 1) */ +#define CAN2_SR_DOS_1_Msk (0x2UL) /*!< DOS_1 (Bitfield-Mask: 0x01) */ +#define CAN2_SR_TBS1_1_Pos (2UL) /*!< TBS1_1 (Bit 2) */ +#define CAN2_SR_TBS1_1_Msk (0x4UL) /*!< TBS1_1 (Bitfield-Mask: 0x01) */ +#define CAN2_SR_TCS1_1_Pos (3UL) /*!< TCS1_1 (Bit 3) */ +#define CAN2_SR_TCS1_1_Msk (0x8UL) /*!< TCS1_1 (Bitfield-Mask: 0x01) */ +#define CAN2_SR_RS_1_Pos (4UL) /*!< RS_1 (Bit 4) */ +#define CAN2_SR_RS_1_Msk (0x10UL) /*!< RS_1 (Bitfield-Mask: 0x01) */ +#define CAN2_SR_TS1_1_Pos (5UL) /*!< TS1_1 (Bit 5) */ +#define CAN2_SR_TS1_1_Msk (0x20UL) /*!< TS1_1 (Bitfield-Mask: 0x01) */ +#define CAN2_SR_ES_1_Pos (6UL) /*!< ES_1 (Bit 6) */ +#define CAN2_SR_ES_1_Msk (0x40UL) /*!< ES_1 (Bitfield-Mask: 0x01) */ +#define CAN2_SR_BS_1_Pos (7UL) /*!< BS_1 (Bit 7) */ +#define CAN2_SR_BS_1_Msk (0x80UL) /*!< BS_1 (Bitfield-Mask: 0x01) */ +#define CAN2_SR_RBS_2_Pos (8UL) /*!< RBS_2 (Bit 8) */ +#define CAN2_SR_RBS_2_Msk (0x100UL) /*!< RBS_2 (Bitfield-Mask: 0x01) */ +#define CAN2_SR_DOS_2_Pos (9UL) /*!< DOS_2 (Bit 9) */ +#define CAN2_SR_DOS_2_Msk (0x200UL) /*!< DOS_2 (Bitfield-Mask: 0x01) */ +#define CAN2_SR_TBS2_2_Pos (10UL) /*!< TBS2_2 (Bit 10) */ +#define CAN2_SR_TBS2_2_Msk (0x400UL) /*!< TBS2_2 (Bitfield-Mask: 0x01) */ +#define CAN2_SR_TCS2_2_Pos (11UL) /*!< TCS2_2 (Bit 11) */ +#define CAN2_SR_TCS2_2_Msk (0x800UL) /*!< TCS2_2 (Bitfield-Mask: 0x01) */ +#define CAN2_SR_RS_2_Pos (12UL) /*!< RS_2 (Bit 12) */ +#define CAN2_SR_RS_2_Msk (0x1000UL) /*!< RS_2 (Bitfield-Mask: 0x01) */ +#define CAN2_SR_TS2_2_Pos (13UL) /*!< TS2_2 (Bit 13) */ +#define CAN2_SR_TS2_2_Msk (0x2000UL) /*!< TS2_2 (Bitfield-Mask: 0x01) */ +#define CAN2_SR_ES_2_Pos (14UL) /*!< ES_2 (Bit 14) */ +#define CAN2_SR_ES_2_Msk (0x4000UL) /*!< ES_2 (Bitfield-Mask: 0x01) */ +#define CAN2_SR_BS_2_Pos (15UL) /*!< BS_2 (Bit 15) */ +#define CAN2_SR_BS_2_Msk (0x8000UL) /*!< BS_2 (Bitfield-Mask: 0x01) */ +#define CAN2_SR_RBS_3_Pos (16UL) /*!< RBS_3 (Bit 16) */ +#define CAN2_SR_RBS_3_Msk (0x10000UL) /*!< RBS_3 (Bitfield-Mask: 0x01) */ +#define CAN2_SR_DOS_3_Pos (17UL) /*!< DOS_3 (Bit 17) */ +#define CAN2_SR_DOS_3_Msk (0x20000UL) /*!< DOS_3 (Bitfield-Mask: 0x01) */ +#define CAN2_SR_TBS3_3_Pos (18UL) /*!< TBS3_3 (Bit 18) */ +#define CAN2_SR_TBS3_3_Msk (0x40000UL) /*!< TBS3_3 (Bitfield-Mask: 0x01) */ +#define CAN2_SR_TCS3_3_Pos (19UL) /*!< TCS3_3 (Bit 19) */ +#define CAN2_SR_TCS3_3_Msk (0x80000UL) /*!< TCS3_3 (Bitfield-Mask: 0x01) */ +#define CAN2_SR_RS_3_Pos (20UL) /*!< RS_3 (Bit 20) */ +#define CAN2_SR_RS_3_Msk (0x100000UL) /*!< RS_3 (Bitfield-Mask: 0x01) */ +#define CAN2_SR_TS3_3_Pos (21UL) /*!< TS3_3 (Bit 21) */ +#define CAN2_SR_TS3_3_Msk (0x200000UL) /*!< TS3_3 (Bitfield-Mask: 0x01) */ +#define CAN2_SR_ES_3_Pos (22UL) /*!< ES_3 (Bit 22) */ +#define CAN2_SR_ES_3_Msk (0x400000UL) /*!< ES_3 (Bitfield-Mask: 0x01) */ +#define CAN2_SR_BS_3_Pos (23UL) /*!< BS_3 (Bit 23) */ +#define CAN2_SR_BS_3_Msk (0x800000UL) /*!< BS_3 (Bitfield-Mask: 0x01) */ +/* ========================================================== RFS ========================================================== */ +#define CAN2_RFS_IDINDEX_Pos (0UL) /*!< IDINDEX (Bit 0) */ +#define CAN2_RFS_IDINDEX_Msk (0x3ffUL) /*!< IDINDEX (Bitfield-Mask: 0x3ff) */ +#define CAN2_RFS_BP_Pos (10UL) /*!< BP (Bit 10) */ +#define CAN2_RFS_BP_Msk (0x400UL) /*!< BP (Bitfield-Mask: 0x01) */ +#define CAN2_RFS_DLC_Pos (16UL) /*!< DLC (Bit 16) */ +#define CAN2_RFS_DLC_Msk (0xf0000UL) /*!< DLC (Bitfield-Mask: 0x0f) */ +#define CAN2_RFS_RTR_Pos (30UL) /*!< RTR (Bit 30) */ +#define CAN2_RFS_RTR_Msk (0x40000000UL) /*!< RTR (Bitfield-Mask: 0x01) */ +#define CAN2_RFS_FF_Pos (31UL) /*!< FF (Bit 31) */ +#define CAN2_RFS_FF_Msk (0x80000000UL) /*!< FF (Bitfield-Mask: 0x01) */ +/* ========================================================== RID ========================================================== */ +#define CAN2_RID_ID_Pos (0UL) /*!< ID (Bit 0) */ +#define CAN2_RID_ID_Msk (0x7ffUL) /*!< ID (Bitfield-Mask: 0x7ff) */ +/* ========================================================== RDA ========================================================== */ +#define CAN2_RDA_DATA1_Pos (0UL) /*!< DATA1 (Bit 0) */ +#define CAN2_RDA_DATA1_Msk (0xffUL) /*!< DATA1 (Bitfield-Mask: 0xff) */ +#define CAN2_RDA_DATA2_Pos (8UL) /*!< DATA2 (Bit 8) */ +#define CAN2_RDA_DATA2_Msk (0xff00UL) /*!< DATA2 (Bitfield-Mask: 0xff) */ +#define CAN2_RDA_DATA3_Pos (16UL) /*!< DATA3 (Bit 16) */ +#define CAN2_RDA_DATA3_Msk (0xff0000UL) /*!< DATA3 (Bitfield-Mask: 0xff) */ +#define CAN2_RDA_DATA4_Pos (24UL) /*!< DATA4 (Bit 24) */ +#define CAN2_RDA_DATA4_Msk (0xff000000UL) /*!< DATA4 (Bitfield-Mask: 0xff) */ +/* ========================================================== RDB ========================================================== */ +#define CAN2_RDB_DATA5_Pos (0UL) /*!< DATA5 (Bit 0) */ +#define CAN2_RDB_DATA5_Msk (0xffUL) /*!< DATA5 (Bitfield-Mask: 0xff) */ +#define CAN2_RDB_DATA6_Pos (8UL) /*!< DATA6 (Bit 8) */ +#define CAN2_RDB_DATA6_Msk (0xff00UL) /*!< DATA6 (Bitfield-Mask: 0xff) */ +#define CAN2_RDB_DATA7_Pos (16UL) /*!< DATA7 (Bit 16) */ +#define CAN2_RDB_DATA7_Msk (0xff0000UL) /*!< DATA7 (Bitfield-Mask: 0xff) */ +#define CAN2_RDB_DATA8_Pos (24UL) /*!< DATA8 (Bit 24) */ +#define CAN2_RDB_DATA8_Msk (0xff000000UL) /*!< DATA8 (Bitfield-Mask: 0xff) */ +/* ========================================================= TFI1 ========================================================== */ +#define CAN2_TFI1_PRIO_Pos (0UL) /*!< PRIO (Bit 0) */ +#define CAN2_TFI1_PRIO_Msk (0xffUL) /*!< PRIO (Bitfield-Mask: 0xff) */ +#define CAN2_TFI1_DLC_Pos (16UL) /*!< DLC (Bit 16) */ +#define CAN2_TFI1_DLC_Msk (0xf0000UL) /*!< DLC (Bitfield-Mask: 0x0f) */ +#define CAN2_TFI1_RTR_Pos (30UL) /*!< RTR (Bit 30) */ +#define CAN2_TFI1_RTR_Msk (0x40000000UL) /*!< RTR (Bitfield-Mask: 0x01) */ +#define CAN2_TFI1_FF_Pos (31UL) /*!< FF (Bit 31) */ +#define CAN2_TFI1_FF_Msk (0x80000000UL) /*!< FF (Bitfield-Mask: 0x01) */ +/* ========================================================= TFI2 ========================================================== */ +#define CAN2_TFI2_PRIO_Pos (0UL) /*!< PRIO (Bit 0) */ +#define CAN2_TFI2_PRIO_Msk (0xffUL) /*!< PRIO (Bitfield-Mask: 0xff) */ +#define CAN2_TFI2_DLC_Pos (16UL) /*!< DLC (Bit 16) */ +#define CAN2_TFI2_DLC_Msk (0xf0000UL) /*!< DLC (Bitfield-Mask: 0x0f) */ +#define CAN2_TFI2_RTR_Pos (30UL) /*!< RTR (Bit 30) */ +#define CAN2_TFI2_RTR_Msk (0x40000000UL) /*!< RTR (Bitfield-Mask: 0x01) */ +#define CAN2_TFI2_FF_Pos (31UL) /*!< FF (Bit 31) */ +#define CAN2_TFI2_FF_Msk (0x80000000UL) /*!< FF (Bitfield-Mask: 0x01) */ +/* ========================================================= TFI3 ========================================================== */ +#define CAN2_TFI3_PRIO_Pos (0UL) /*!< PRIO (Bit 0) */ +#define CAN2_TFI3_PRIO_Msk (0xffUL) /*!< PRIO (Bitfield-Mask: 0xff) */ +#define CAN2_TFI3_DLC_Pos (16UL) /*!< DLC (Bit 16) */ +#define CAN2_TFI3_DLC_Msk (0xf0000UL) /*!< DLC (Bitfield-Mask: 0x0f) */ +#define CAN2_TFI3_RTR_Pos (30UL) /*!< RTR (Bit 30) */ +#define CAN2_TFI3_RTR_Msk (0x40000000UL) /*!< RTR (Bitfield-Mask: 0x01) */ +#define CAN2_TFI3_FF_Pos (31UL) /*!< FF (Bit 31) */ +#define CAN2_TFI3_FF_Msk (0x80000000UL) /*!< FF (Bitfield-Mask: 0x01) */ +/* ========================================================= TID1 ========================================================== */ +#define CAN2_TID1_ID_Pos (0UL) /*!< ID (Bit 0) */ +#define CAN2_TID1_ID_Msk (0x7ffUL) /*!< ID (Bitfield-Mask: 0x7ff) */ +/* ========================================================= TID2 ========================================================== */ +#define CAN2_TID2_ID_Pos (0UL) /*!< ID (Bit 0) */ +#define CAN2_TID2_ID_Msk (0x7ffUL) /*!< ID (Bitfield-Mask: 0x7ff) */ +/* ========================================================= TID3 ========================================================== */ +#define CAN2_TID3_ID_Pos (0UL) /*!< ID (Bit 0) */ +#define CAN2_TID3_ID_Msk (0x7ffUL) /*!< ID (Bitfield-Mask: 0x7ff) */ +/* ========================================================= TDA1 ========================================================== */ +#define CAN2_TDA1_DATA1_Pos (0UL) /*!< DATA1 (Bit 0) */ +#define CAN2_TDA1_DATA1_Msk (0xffUL) /*!< DATA1 (Bitfield-Mask: 0xff) */ +#define CAN2_TDA1_DATA2_Pos (8UL) /*!< DATA2 (Bit 8) */ +#define CAN2_TDA1_DATA2_Msk (0xff00UL) /*!< DATA2 (Bitfield-Mask: 0xff) */ +#define CAN2_TDA1_DATA3_Pos (16UL) /*!< DATA3 (Bit 16) */ +#define CAN2_TDA1_DATA3_Msk (0xff0000UL) /*!< DATA3 (Bitfield-Mask: 0xff) */ +#define CAN2_TDA1_DATA4_Pos (24UL) /*!< DATA4 (Bit 24) */ +#define CAN2_TDA1_DATA4_Msk (0xff000000UL) /*!< DATA4 (Bitfield-Mask: 0xff) */ +/* ========================================================= TDA2 ========================================================== */ +#define CAN2_TDA2_DATA1_Pos (0UL) /*!< DATA1 (Bit 0) */ +#define CAN2_TDA2_DATA1_Msk (0xffUL) /*!< DATA1 (Bitfield-Mask: 0xff) */ +#define CAN2_TDA2_DATA2_Pos (8UL) /*!< DATA2 (Bit 8) */ +#define CAN2_TDA2_DATA2_Msk (0xff00UL) /*!< DATA2 (Bitfield-Mask: 0xff) */ +#define CAN2_TDA2_DATA3_Pos (16UL) /*!< DATA3 (Bit 16) */ +#define CAN2_TDA2_DATA3_Msk (0xff0000UL) /*!< DATA3 (Bitfield-Mask: 0xff) */ +#define CAN2_TDA2_DATA4_Pos (24UL) /*!< DATA4 (Bit 24) */ +#define CAN2_TDA2_DATA4_Msk (0xff000000UL) /*!< DATA4 (Bitfield-Mask: 0xff) */ +/* ========================================================= TDA3 ========================================================== */ +#define CAN2_TDA3_DATA1_Pos (0UL) /*!< DATA1 (Bit 0) */ +#define CAN2_TDA3_DATA1_Msk (0xffUL) /*!< DATA1 (Bitfield-Mask: 0xff) */ +#define CAN2_TDA3_DATA2_Pos (8UL) /*!< DATA2 (Bit 8) */ +#define CAN2_TDA3_DATA2_Msk (0xff00UL) /*!< DATA2 (Bitfield-Mask: 0xff) */ +#define CAN2_TDA3_DATA3_Pos (16UL) /*!< DATA3 (Bit 16) */ +#define CAN2_TDA3_DATA3_Msk (0xff0000UL) /*!< DATA3 (Bitfield-Mask: 0xff) */ +#define CAN2_TDA3_DATA4_Pos (24UL) /*!< DATA4 (Bit 24) */ +#define CAN2_TDA3_DATA4_Msk (0xff000000UL) /*!< DATA4 (Bitfield-Mask: 0xff) */ +/* ========================================================= TDB1 ========================================================== */ +#define CAN2_TDB1_DATA5_Pos (0UL) /*!< DATA5 (Bit 0) */ +#define CAN2_TDB1_DATA5_Msk (0xffUL) /*!< DATA5 (Bitfield-Mask: 0xff) */ +#define CAN2_TDB1_DATA6_Pos (8UL) /*!< DATA6 (Bit 8) */ +#define CAN2_TDB1_DATA6_Msk (0xff00UL) /*!< DATA6 (Bitfield-Mask: 0xff) */ +#define CAN2_TDB1_DATA7_Pos (16UL) /*!< DATA7 (Bit 16) */ +#define CAN2_TDB1_DATA7_Msk (0xff0000UL) /*!< DATA7 (Bitfield-Mask: 0xff) */ +#define CAN2_TDB1_DATA8_Pos (24UL) /*!< DATA8 (Bit 24) */ +#define CAN2_TDB1_DATA8_Msk (0xff000000UL) /*!< DATA8 (Bitfield-Mask: 0xff) */ +/* ========================================================= TDB2 ========================================================== */ +#define CAN2_TDB2_DATA5_Pos (0UL) /*!< DATA5 (Bit 0) */ +#define CAN2_TDB2_DATA5_Msk (0xffUL) /*!< DATA5 (Bitfield-Mask: 0xff) */ +#define CAN2_TDB2_DATA6_Pos (8UL) /*!< DATA6 (Bit 8) */ +#define CAN2_TDB2_DATA6_Msk (0xff00UL) /*!< DATA6 (Bitfield-Mask: 0xff) */ +#define CAN2_TDB2_DATA7_Pos (16UL) /*!< DATA7 (Bit 16) */ +#define CAN2_TDB2_DATA7_Msk (0xff0000UL) /*!< DATA7 (Bitfield-Mask: 0xff) */ +#define CAN2_TDB2_DATA8_Pos (24UL) /*!< DATA8 (Bit 24) */ +#define CAN2_TDB2_DATA8_Msk (0xff000000UL) /*!< DATA8 (Bitfield-Mask: 0xff) */ +/* ========================================================= TDB3 ========================================================== */ +#define CAN2_TDB3_DATA5_Pos (0UL) /*!< DATA5 (Bit 0) */ +#define CAN2_TDB3_DATA5_Msk (0xffUL) /*!< DATA5 (Bitfield-Mask: 0xff) */ +#define CAN2_TDB3_DATA6_Pos (8UL) /*!< DATA6 (Bit 8) */ +#define CAN2_TDB3_DATA6_Msk (0xff00UL) /*!< DATA6 (Bitfield-Mask: 0xff) */ +#define CAN2_TDB3_DATA7_Pos (16UL) /*!< DATA7 (Bit 16) */ +#define CAN2_TDB3_DATA7_Msk (0xff0000UL) /*!< DATA7 (Bitfield-Mask: 0xff) */ +#define CAN2_TDB3_DATA8_Pos (24UL) /*!< DATA8 (Bit 24) */ +#define CAN2_TDB3_DATA8_Msk (0xff000000UL) /*!< DATA8 (Bitfield-Mask: 0xff) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_SSP0 ================ */ +/* =========================================================================================================================== */ + +/* ========================================================== CR0 ========================================================== */ +#define SSP0_CR0_DSS_Pos (0UL) /*!< DSS (Bit 0) */ +#define SSP0_CR0_DSS_Msk (0xfUL) /*!< DSS (Bitfield-Mask: 0x0f) */ +#define SSP0_CR0_FRF_Pos (4UL) /*!< FRF (Bit 4) */ +#define SSP0_CR0_FRF_Msk (0x30UL) /*!< FRF (Bitfield-Mask: 0x03) */ +#define SSP0_CR0_CPOL_Pos (6UL) /*!< CPOL (Bit 6) */ +#define SSP0_CR0_CPOL_Msk (0x40UL) /*!< CPOL (Bitfield-Mask: 0x01) */ +#define SSP0_CR0_CPHA_Pos (7UL) /*!< CPHA (Bit 7) */ +#define SSP0_CR0_CPHA_Msk (0x80UL) /*!< CPHA (Bitfield-Mask: 0x01) */ +#define SSP0_CR0_SCR_Pos (8UL) /*!< SCR (Bit 8) */ +#define SSP0_CR0_SCR_Msk (0xff00UL) /*!< SCR (Bitfield-Mask: 0xff) */ +/* ========================================================== CR1 ========================================================== */ +#define SSP0_CR1_LBM_Pos (0UL) /*!< LBM (Bit 0) */ +#define SSP0_CR1_LBM_Msk (0x1UL) /*!< LBM (Bitfield-Mask: 0x01) */ +#define SSP0_CR1_SSE_Pos (1UL) /*!< SSE (Bit 1) */ +#define SSP0_CR1_SSE_Msk (0x2UL) /*!< SSE (Bitfield-Mask: 0x01) */ +#define SSP0_CR1_MS_Pos (2UL) /*!< MS (Bit 2) */ +#define SSP0_CR1_MS_Msk (0x4UL) /*!< MS (Bitfield-Mask: 0x01) */ +#define SSP0_CR1_SOD_Pos (3UL) /*!< SOD (Bit 3) */ +#define SSP0_CR1_SOD_Msk (0x8UL) /*!< SOD (Bitfield-Mask: 0x01) */ +/* ========================================================== DR =========================================================== */ +#define SSP0_DR_DATA_Pos (0UL) /*!< DATA (Bit 0) */ +#define SSP0_DR_DATA_Msk (0xffffUL) /*!< DATA (Bitfield-Mask: 0xffff) */ +/* ========================================================== SR =========================================================== */ +#define SSP0_SR_TFE_Pos (0UL) /*!< TFE (Bit 0) */ +#define SSP0_SR_TFE_Msk (0x1UL) /*!< TFE (Bitfield-Mask: 0x01) */ +#define SSP0_SR_TNF_Pos (1UL) /*!< TNF (Bit 1) */ +#define SSP0_SR_TNF_Msk (0x2UL) /*!< TNF (Bitfield-Mask: 0x01) */ +#define SSP0_SR_RNE_Pos (2UL) /*!< RNE (Bit 2) */ +#define SSP0_SR_RNE_Msk (0x4UL) /*!< RNE (Bitfield-Mask: 0x01) */ +#define SSP0_SR_RFF_Pos (3UL) /*!< RFF (Bit 3) */ +#define SSP0_SR_RFF_Msk (0x8UL) /*!< RFF (Bitfield-Mask: 0x01) */ +#define SSP0_SR_BSY_Pos (4UL) /*!< BSY (Bit 4) */ +#define SSP0_SR_BSY_Msk (0x10UL) /*!< BSY (Bitfield-Mask: 0x01) */ +/* ========================================================= CPSR ========================================================== */ +#define SSP0_CPSR_CPSDVSR_Pos (0UL) /*!< CPSDVSR (Bit 0) */ +#define SSP0_CPSR_CPSDVSR_Msk (0xffUL) /*!< CPSDVSR (Bitfield-Mask: 0xff) */ +/* ========================================================= IMSC ========================================================== */ +#define SSP0_IMSC_RORIM_Pos (0UL) /*!< RORIM (Bit 0) */ +#define SSP0_IMSC_RORIM_Msk (0x1UL) /*!< RORIM (Bitfield-Mask: 0x01) */ +#define SSP0_IMSC_RTIM_Pos (1UL) /*!< RTIM (Bit 1) */ +#define SSP0_IMSC_RTIM_Msk (0x2UL) /*!< RTIM (Bitfield-Mask: 0x01) */ +#define SSP0_IMSC_RXIM_Pos (2UL) /*!< RXIM (Bit 2) */ +#define SSP0_IMSC_RXIM_Msk (0x4UL) /*!< RXIM (Bitfield-Mask: 0x01) */ +#define SSP0_IMSC_TXIM_Pos (3UL) /*!< TXIM (Bit 3) */ +#define SSP0_IMSC_TXIM_Msk (0x8UL) /*!< TXIM (Bitfield-Mask: 0x01) */ +/* ========================================================== RIS ========================================================== */ +#define SSP0_RIS_RORRIS_Pos (0UL) /*!< RORRIS (Bit 0) */ +#define SSP0_RIS_RORRIS_Msk (0x1UL) /*!< RORRIS (Bitfield-Mask: 0x01) */ +#define SSP0_RIS_RTRIS_Pos (1UL) /*!< RTRIS (Bit 1) */ +#define SSP0_RIS_RTRIS_Msk (0x2UL) /*!< RTRIS (Bitfield-Mask: 0x01) */ +#define SSP0_RIS_RXRIS_Pos (2UL) /*!< RXRIS (Bit 2) */ +#define SSP0_RIS_RXRIS_Msk (0x4UL) /*!< RXRIS (Bitfield-Mask: 0x01) */ +#define SSP0_RIS_TXRIS_Pos (3UL) /*!< TXRIS (Bit 3) */ +#define SSP0_RIS_TXRIS_Msk (0x8UL) /*!< TXRIS (Bitfield-Mask: 0x01) */ +/* ========================================================== MIS ========================================================== */ +#define SSP0_MIS_RORMIS_Pos (0UL) /*!< RORMIS (Bit 0) */ +#define SSP0_MIS_RORMIS_Msk (0x1UL) /*!< RORMIS (Bitfield-Mask: 0x01) */ +#define SSP0_MIS_RTMIS_Pos (1UL) /*!< RTMIS (Bit 1) */ +#define SSP0_MIS_RTMIS_Msk (0x2UL) /*!< RTMIS (Bitfield-Mask: 0x01) */ +#define SSP0_MIS_RXMIS_Pos (2UL) /*!< RXMIS (Bit 2) */ +#define SSP0_MIS_RXMIS_Msk (0x4UL) /*!< RXMIS (Bitfield-Mask: 0x01) */ +#define SSP0_MIS_TXMIS_Pos (3UL) /*!< TXMIS (Bit 3) */ +#define SSP0_MIS_TXMIS_Msk (0x8UL) /*!< TXMIS (Bitfield-Mask: 0x01) */ +/* ========================================================== ICR ========================================================== */ +#define SSP0_ICR_RORIC_Pos (0UL) /*!< RORIC (Bit 0) */ +#define SSP0_ICR_RORIC_Msk (0x1UL) /*!< RORIC (Bitfield-Mask: 0x01) */ +#define SSP0_ICR_RTIC_Pos (1UL) /*!< RTIC (Bit 1) */ +#define SSP0_ICR_RTIC_Msk (0x2UL) /*!< RTIC (Bitfield-Mask: 0x01) */ +/* ========================================================= DMACR ========================================================= */ +#define SSP0_DMACR_RXDMAE_Pos (0UL) /*!< RXDMAE (Bit 0) */ +#define SSP0_DMACR_RXDMAE_Msk (0x1UL) /*!< RXDMAE (Bitfield-Mask: 0x01) */ +#define SSP0_DMACR_TXDMAE_Pos (1UL) /*!< TXDMAE (Bit 1) */ +#define SSP0_DMACR_TXDMAE_Msk (0x2UL) /*!< TXDMAE (Bitfield-Mask: 0x01) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_DAC ================ */ +/* =========================================================================================================================== */ + +/* ========================================================== CR =========================================================== */ +#define DAC_CR_VALUE_Pos (6UL) /*!< VALUE (Bit 6) */ +#define DAC_CR_VALUE_Msk (0xffc0UL) /*!< VALUE (Bitfield-Mask: 0x3ff) */ +#define DAC_CR_BIAS_Pos (16UL) /*!< BIAS (Bit 16) */ +#define DAC_CR_BIAS_Msk (0x10000UL) /*!< BIAS (Bitfield-Mask: 0x01) */ +/* ========================================================= CTRL ========================================================== */ +#define DAC_CTRL_INT_DMA_REQ_Pos (0UL) /*!< INT_DMA_REQ (Bit 0) */ +#define DAC_CTRL_INT_DMA_REQ_Msk (0x1UL) /*!< INT_DMA_REQ (Bitfield-Mask: 0x01) */ +#define DAC_CTRL_DBLBUF_ENA_Pos (1UL) /*!< DBLBUF_ENA (Bit 1) */ +#define DAC_CTRL_DBLBUF_ENA_Msk (0x2UL) /*!< DBLBUF_ENA (Bitfield-Mask: 0x01) */ +#define DAC_CTRL_CNT_ENA_Pos (2UL) /*!< CNT_ENA (Bit 2) */ +#define DAC_CTRL_CNT_ENA_Msk (0x4UL) /*!< CNT_ENA (Bitfield-Mask: 0x01) */ +#define DAC_CTRL_DMA_ENA_Pos (3UL) /*!< DMA_ENA (Bit 3) */ +#define DAC_CTRL_DMA_ENA_Msk (0x8UL) /*!< DMA_ENA (Bitfield-Mask: 0x01) */ +/* ======================================================== CNTVAL ========================================================= */ +#define DAC_CNTVAL_VALUE_Pos (0UL) /*!< VALUE (Bit 0) */ +#define DAC_CNTVAL_VALUE_Msk (0xffffUL) /*!< VALUE (Bitfield-Mask: 0xffff) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_TIMER2 ================ */ +/* =========================================================================================================================== */ + +/* ========================================================== IR =========================================================== */ +#define TIMER2_IR_MR0INT_Pos (0UL) /*!< MR0INT (Bit 0) */ +#define TIMER2_IR_MR0INT_Msk (0x1UL) /*!< MR0INT (Bitfield-Mask: 0x01) */ +#define TIMER2_IR_MR1INT_Pos (1UL) /*!< MR1INT (Bit 1) */ +#define TIMER2_IR_MR1INT_Msk (0x2UL) /*!< MR1INT (Bitfield-Mask: 0x01) */ +#define TIMER2_IR_MR2INT_Pos (2UL) /*!< MR2INT (Bit 2) */ +#define TIMER2_IR_MR2INT_Msk (0x4UL) /*!< MR2INT (Bitfield-Mask: 0x01) */ +#define TIMER2_IR_MR3INT_Pos (3UL) /*!< MR3INT (Bit 3) */ +#define TIMER2_IR_MR3INT_Msk (0x8UL) /*!< MR3INT (Bitfield-Mask: 0x01) */ +#define TIMER2_IR_CR0INT_Pos (4UL) /*!< CR0INT (Bit 4) */ +#define TIMER2_IR_CR0INT_Msk (0x10UL) /*!< CR0INT (Bitfield-Mask: 0x01) */ +#define TIMER2_IR_CR1INT_Pos (5UL) /*!< CR1INT (Bit 5) */ +#define TIMER2_IR_CR1INT_Msk (0x20UL) /*!< CR1INT (Bitfield-Mask: 0x01) */ +/* ========================================================== TCR ========================================================== */ +#define TIMER2_TCR_CEN_Pos (0UL) /*!< CEN (Bit 0) */ +#define TIMER2_TCR_CEN_Msk (0x1UL) /*!< CEN (Bitfield-Mask: 0x01) */ +#define TIMER2_TCR_CRST_Pos (1UL) /*!< CRST (Bit 1) */ +#define TIMER2_TCR_CRST_Msk (0x2UL) /*!< CRST (Bitfield-Mask: 0x01) */ +/* ========================================================== TC =========================================================== */ +#define TIMER2_TC_TC_Pos (0UL) /*!< TC (Bit 0) */ +#define TIMER2_TC_TC_Msk (0xffffffffUL) /*!< TC (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== PR =========================================================== */ +#define TIMER2_PR_PM_Pos (0UL) /*!< PM (Bit 0) */ +#define TIMER2_PR_PM_Msk (0xffffffffUL) /*!< PM (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== PC =========================================================== */ +#define TIMER2_PC_PC_Pos (0UL) /*!< PC (Bit 0) */ +#define TIMER2_PC_PC_Msk (0xffffffffUL) /*!< PC (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== MCR ========================================================== */ +#define TIMER2_MCR_MR0I_Pos (0UL) /*!< MR0I (Bit 0) */ +#define TIMER2_MCR_MR0I_Msk (0x1UL) /*!< MR0I (Bitfield-Mask: 0x01) */ +#define TIMER2_MCR_MR0R_Pos (1UL) /*!< MR0R (Bit 1) */ +#define TIMER2_MCR_MR0R_Msk (0x2UL) /*!< MR0R (Bitfield-Mask: 0x01) */ +#define TIMER2_MCR_MR0S_Pos (2UL) /*!< MR0S (Bit 2) */ +#define TIMER2_MCR_MR0S_Msk (0x4UL) /*!< MR0S (Bitfield-Mask: 0x01) */ +#define TIMER2_MCR_MR1I_Pos (3UL) /*!< MR1I (Bit 3) */ +#define TIMER2_MCR_MR1I_Msk (0x8UL) /*!< MR1I (Bitfield-Mask: 0x01) */ +#define TIMER2_MCR_MR1R_Pos (4UL) /*!< MR1R (Bit 4) */ +#define TIMER2_MCR_MR1R_Msk (0x10UL) /*!< MR1R (Bitfield-Mask: 0x01) */ +#define TIMER2_MCR_MR1S_Pos (5UL) /*!< MR1S (Bit 5) */ +#define TIMER2_MCR_MR1S_Msk (0x20UL) /*!< MR1S (Bitfield-Mask: 0x01) */ +#define TIMER2_MCR_MR2I_Pos (6UL) /*!< MR2I (Bit 6) */ +#define TIMER2_MCR_MR2I_Msk (0x40UL) /*!< MR2I (Bitfield-Mask: 0x01) */ +#define TIMER2_MCR_MR2R_Pos (7UL) /*!< MR2R (Bit 7) */ +#define TIMER2_MCR_MR2R_Msk (0x80UL) /*!< MR2R (Bitfield-Mask: 0x01) */ +#define TIMER2_MCR_MR2S_Pos (8UL) /*!< MR2S (Bit 8) */ +#define TIMER2_MCR_MR2S_Msk (0x100UL) /*!< MR2S (Bitfield-Mask: 0x01) */ +#define TIMER2_MCR_MR3I_Pos (9UL) /*!< MR3I (Bit 9) */ +#define TIMER2_MCR_MR3I_Msk (0x200UL) /*!< MR3I (Bitfield-Mask: 0x01) */ +#define TIMER2_MCR_MR3R_Pos (10UL) /*!< MR3R (Bit 10) */ +#define TIMER2_MCR_MR3R_Msk (0x400UL) /*!< MR3R (Bitfield-Mask: 0x01) */ +#define TIMER2_MCR_MR3S_Pos (11UL) /*!< MR3S (Bit 11) */ +#define TIMER2_MCR_MR3S_Msk (0x800UL) /*!< MR3S (Bitfield-Mask: 0x01) */ +/* ========================================================== CCR ========================================================== */ +#define TIMER2_CCR_CAP0RE_Pos (0UL) /*!< CAP0RE (Bit 0) */ +#define TIMER2_CCR_CAP0RE_Msk (0x1UL) /*!< CAP0RE (Bitfield-Mask: 0x01) */ +#define TIMER2_CCR_CAP0FE_Pos (1UL) /*!< CAP0FE (Bit 1) */ +#define TIMER2_CCR_CAP0FE_Msk (0x2UL) /*!< CAP0FE (Bitfield-Mask: 0x01) */ +#define TIMER2_CCR_CAP0I_Pos (2UL) /*!< CAP0I (Bit 2) */ +#define TIMER2_CCR_CAP0I_Msk (0x4UL) /*!< CAP0I (Bitfield-Mask: 0x01) */ +#define TIMER2_CCR_CAP1RE_Pos (3UL) /*!< CAP1RE (Bit 3) */ +#define TIMER2_CCR_CAP1RE_Msk (0x8UL) /*!< CAP1RE (Bitfield-Mask: 0x01) */ +#define TIMER2_CCR_CAP1FE_Pos (4UL) /*!< CAP1FE (Bit 4) */ +#define TIMER2_CCR_CAP1FE_Msk (0x10UL) /*!< CAP1FE (Bitfield-Mask: 0x01) */ +#define TIMER2_CCR_CAP1I_Pos (5UL) /*!< CAP1I (Bit 5) */ +#define TIMER2_CCR_CAP1I_Msk (0x20UL) /*!< CAP1I (Bitfield-Mask: 0x01) */ +/* ========================================================== EMR ========================================================== */ +#define TIMER2_EMR_EM0_Pos (0UL) /*!< EM0 (Bit 0) */ +#define TIMER2_EMR_EM0_Msk (0x1UL) /*!< EM0 (Bitfield-Mask: 0x01) */ +#define TIMER2_EMR_EM1_Pos (1UL) /*!< EM1 (Bit 1) */ +#define TIMER2_EMR_EM1_Msk (0x2UL) /*!< EM1 (Bitfield-Mask: 0x01) */ +#define TIMER2_EMR_EM2_Pos (2UL) /*!< EM2 (Bit 2) */ +#define TIMER2_EMR_EM2_Msk (0x4UL) /*!< EM2 (Bitfield-Mask: 0x01) */ +#define TIMER2_EMR_EM3_Pos (3UL) /*!< EM3 (Bit 3) */ +#define TIMER2_EMR_EM3_Msk (0x8UL) /*!< EM3 (Bitfield-Mask: 0x01) */ +#define TIMER2_EMR_EMC0_Pos (4UL) /*!< EMC0 (Bit 4) */ +#define TIMER2_EMR_EMC0_Msk (0x30UL) /*!< EMC0 (Bitfield-Mask: 0x03) */ +#define TIMER2_EMR_EMC1_Pos (6UL) /*!< EMC1 (Bit 6) */ +#define TIMER2_EMR_EMC1_Msk (0xc0UL) /*!< EMC1 (Bitfield-Mask: 0x03) */ +#define TIMER2_EMR_EMC2_Pos (8UL) /*!< EMC2 (Bit 8) */ +#define TIMER2_EMR_EMC2_Msk (0x300UL) /*!< EMC2 (Bitfield-Mask: 0x03) */ +#define TIMER2_EMR_EMC3_Pos (10UL) /*!< EMC3 (Bit 10) */ +#define TIMER2_EMR_EMC3_Msk (0xc00UL) /*!< EMC3 (Bitfield-Mask: 0x03) */ +/* ========================================================= CTCR ========================================================== */ +#define TIMER2_CTCR_CTMODE_Pos (0UL) /*!< CTMODE (Bit 0) */ +#define TIMER2_CTCR_CTMODE_Msk (0x3UL) /*!< CTMODE (Bitfield-Mask: 0x03) */ +#define TIMER2_CTCR_CINSEL_Pos (2UL) /*!< CINSEL (Bit 2) */ +#define TIMER2_CTCR_CINSEL_Msk (0xcUL) /*!< CINSEL (Bitfield-Mask: 0x03) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_TIMER3 ================ */ +/* =========================================================================================================================== */ + +/* ========================================================== IR =========================================================== */ +#define TIMER3_IR_MR0INT_Pos (0UL) /*!< MR0INT (Bit 0) */ +#define TIMER3_IR_MR0INT_Msk (0x1UL) /*!< MR0INT (Bitfield-Mask: 0x01) */ +#define TIMER3_IR_MR1INT_Pos (1UL) /*!< MR1INT (Bit 1) */ +#define TIMER3_IR_MR1INT_Msk (0x2UL) /*!< MR1INT (Bitfield-Mask: 0x01) */ +#define TIMER3_IR_MR2INT_Pos (2UL) /*!< MR2INT (Bit 2) */ +#define TIMER3_IR_MR2INT_Msk (0x4UL) /*!< MR2INT (Bitfield-Mask: 0x01) */ +#define TIMER3_IR_MR3INT_Pos (3UL) /*!< MR3INT (Bit 3) */ +#define TIMER3_IR_MR3INT_Msk (0x8UL) /*!< MR3INT (Bitfield-Mask: 0x01) */ +#define TIMER3_IR_CR0INT_Pos (4UL) /*!< CR0INT (Bit 4) */ +#define TIMER3_IR_CR0INT_Msk (0x10UL) /*!< CR0INT (Bitfield-Mask: 0x01) */ +#define TIMER3_IR_CR1INT_Pos (5UL) /*!< CR1INT (Bit 5) */ +#define TIMER3_IR_CR1INT_Msk (0x20UL) /*!< CR1INT (Bitfield-Mask: 0x01) */ +/* ========================================================== TCR ========================================================== */ +#define TIMER3_TCR_CEN_Pos (0UL) /*!< CEN (Bit 0) */ +#define TIMER3_TCR_CEN_Msk (0x1UL) /*!< CEN (Bitfield-Mask: 0x01) */ +#define TIMER3_TCR_CRST_Pos (1UL) /*!< CRST (Bit 1) */ +#define TIMER3_TCR_CRST_Msk (0x2UL) /*!< CRST (Bitfield-Mask: 0x01) */ +/* ========================================================== TC =========================================================== */ +#define TIMER3_TC_TC_Pos (0UL) /*!< TC (Bit 0) */ +#define TIMER3_TC_TC_Msk (0xffffffffUL) /*!< TC (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== PR =========================================================== */ +#define TIMER3_PR_PM_Pos (0UL) /*!< PM (Bit 0) */ +#define TIMER3_PR_PM_Msk (0xffffffffUL) /*!< PM (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== PC =========================================================== */ +#define TIMER3_PC_PC_Pos (0UL) /*!< PC (Bit 0) */ +#define TIMER3_PC_PC_Msk (0xffffffffUL) /*!< PC (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== MCR ========================================================== */ +#define TIMER3_MCR_MR0I_Pos (0UL) /*!< MR0I (Bit 0) */ +#define TIMER3_MCR_MR0I_Msk (0x1UL) /*!< MR0I (Bitfield-Mask: 0x01) */ +#define TIMER3_MCR_MR0R_Pos (1UL) /*!< MR0R (Bit 1) */ +#define TIMER3_MCR_MR0R_Msk (0x2UL) /*!< MR0R (Bitfield-Mask: 0x01) */ +#define TIMER3_MCR_MR0S_Pos (2UL) /*!< MR0S (Bit 2) */ +#define TIMER3_MCR_MR0S_Msk (0x4UL) /*!< MR0S (Bitfield-Mask: 0x01) */ +#define TIMER3_MCR_MR1I_Pos (3UL) /*!< MR1I (Bit 3) */ +#define TIMER3_MCR_MR1I_Msk (0x8UL) /*!< MR1I (Bitfield-Mask: 0x01) */ +#define TIMER3_MCR_MR1R_Pos (4UL) /*!< MR1R (Bit 4) */ +#define TIMER3_MCR_MR1R_Msk (0x10UL) /*!< MR1R (Bitfield-Mask: 0x01) */ +#define TIMER3_MCR_MR1S_Pos (5UL) /*!< MR1S (Bit 5) */ +#define TIMER3_MCR_MR1S_Msk (0x20UL) /*!< MR1S (Bitfield-Mask: 0x01) */ +#define TIMER3_MCR_MR2I_Pos (6UL) /*!< MR2I (Bit 6) */ +#define TIMER3_MCR_MR2I_Msk (0x40UL) /*!< MR2I (Bitfield-Mask: 0x01) */ +#define TIMER3_MCR_MR2R_Pos (7UL) /*!< MR2R (Bit 7) */ +#define TIMER3_MCR_MR2R_Msk (0x80UL) /*!< MR2R (Bitfield-Mask: 0x01) */ +#define TIMER3_MCR_MR2S_Pos (8UL) /*!< MR2S (Bit 8) */ +#define TIMER3_MCR_MR2S_Msk (0x100UL) /*!< MR2S (Bitfield-Mask: 0x01) */ +#define TIMER3_MCR_MR3I_Pos (9UL) /*!< MR3I (Bit 9) */ +#define TIMER3_MCR_MR3I_Msk (0x200UL) /*!< MR3I (Bitfield-Mask: 0x01) */ +#define TIMER3_MCR_MR3R_Pos (10UL) /*!< MR3R (Bit 10) */ +#define TIMER3_MCR_MR3R_Msk (0x400UL) /*!< MR3R (Bitfield-Mask: 0x01) */ +#define TIMER3_MCR_MR3S_Pos (11UL) /*!< MR3S (Bit 11) */ +#define TIMER3_MCR_MR3S_Msk (0x800UL) /*!< MR3S (Bitfield-Mask: 0x01) */ +/* ========================================================== CCR ========================================================== */ +#define TIMER3_CCR_CAP0RE_Pos (0UL) /*!< CAP0RE (Bit 0) */ +#define TIMER3_CCR_CAP0RE_Msk (0x1UL) /*!< CAP0RE (Bitfield-Mask: 0x01) */ +#define TIMER3_CCR_CAP0FE_Pos (1UL) /*!< CAP0FE (Bit 1) */ +#define TIMER3_CCR_CAP0FE_Msk (0x2UL) /*!< CAP0FE (Bitfield-Mask: 0x01) */ +#define TIMER3_CCR_CAP0I_Pos (2UL) /*!< CAP0I (Bit 2) */ +#define TIMER3_CCR_CAP0I_Msk (0x4UL) /*!< CAP0I (Bitfield-Mask: 0x01) */ +#define TIMER3_CCR_CAP1RE_Pos (3UL) /*!< CAP1RE (Bit 3) */ +#define TIMER3_CCR_CAP1RE_Msk (0x8UL) /*!< CAP1RE (Bitfield-Mask: 0x01) */ +#define TIMER3_CCR_CAP1FE_Pos (4UL) /*!< CAP1FE (Bit 4) */ +#define TIMER3_CCR_CAP1FE_Msk (0x10UL) /*!< CAP1FE (Bitfield-Mask: 0x01) */ +#define TIMER3_CCR_CAP1I_Pos (5UL) /*!< CAP1I (Bit 5) */ +#define TIMER3_CCR_CAP1I_Msk (0x20UL) /*!< CAP1I (Bitfield-Mask: 0x01) */ +/* ========================================================== EMR ========================================================== */ +#define TIMER3_EMR_EM0_Pos (0UL) /*!< EM0 (Bit 0) */ +#define TIMER3_EMR_EM0_Msk (0x1UL) /*!< EM0 (Bitfield-Mask: 0x01) */ +#define TIMER3_EMR_EM1_Pos (1UL) /*!< EM1 (Bit 1) */ +#define TIMER3_EMR_EM1_Msk (0x2UL) /*!< EM1 (Bitfield-Mask: 0x01) */ +#define TIMER3_EMR_EM2_Pos (2UL) /*!< EM2 (Bit 2) */ +#define TIMER3_EMR_EM2_Msk (0x4UL) /*!< EM2 (Bitfield-Mask: 0x01) */ +#define TIMER3_EMR_EM3_Pos (3UL) /*!< EM3 (Bit 3) */ +#define TIMER3_EMR_EM3_Msk (0x8UL) /*!< EM3 (Bitfield-Mask: 0x01) */ +#define TIMER3_EMR_EMC0_Pos (4UL) /*!< EMC0 (Bit 4) */ +#define TIMER3_EMR_EMC0_Msk (0x30UL) /*!< EMC0 (Bitfield-Mask: 0x03) */ +#define TIMER3_EMR_EMC1_Pos (6UL) /*!< EMC1 (Bit 6) */ +#define TIMER3_EMR_EMC1_Msk (0xc0UL) /*!< EMC1 (Bitfield-Mask: 0x03) */ +#define TIMER3_EMR_EMC2_Pos (8UL) /*!< EMC2 (Bit 8) */ +#define TIMER3_EMR_EMC2_Msk (0x300UL) /*!< EMC2 (Bitfield-Mask: 0x03) */ +#define TIMER3_EMR_EMC3_Pos (10UL) /*!< EMC3 (Bit 10) */ +#define TIMER3_EMR_EMC3_Msk (0xc00UL) /*!< EMC3 (Bitfield-Mask: 0x03) */ +/* ========================================================= CTCR ========================================================== */ +#define TIMER3_CTCR_CTMODE_Pos (0UL) /*!< CTMODE (Bit 0) */ +#define TIMER3_CTCR_CTMODE_Msk (0x3UL) /*!< CTMODE (Bitfield-Mask: 0x03) */ +#define TIMER3_CTCR_CINSEL_Pos (2UL) /*!< CINSEL (Bit 2) */ +#define TIMER3_CTCR_CINSEL_Msk (0xcUL) /*!< CINSEL (Bitfield-Mask: 0x03) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_UART2 ================ */ +/* =========================================================================================================================== */ + +/* ========================================================== RBR ========================================================== */ +#define UART2_RBR_RBR_Pos (0UL) /*!< RBR (Bit 0) */ +#define UART2_RBR_RBR_Msk (0xffUL) /*!< RBR (Bitfield-Mask: 0xff) */ +/* ========================================================== THR ========================================================== */ +#define UART2_THR_THR_Pos (0UL) /*!< THR (Bit 0) */ +#define UART2_THR_THR_Msk (0xffUL) /*!< THR (Bitfield-Mask: 0xff) */ +/* ========================================================== DLL ========================================================== */ +#define UART2_DLL_DLLSB_Pos (0UL) /*!< DLLSB (Bit 0) */ +#define UART2_DLL_DLLSB_Msk (0xffUL) /*!< DLLSB (Bitfield-Mask: 0xff) */ +/* ========================================================== DLM ========================================================== */ +#define UART2_DLM_DLMSB_Pos (0UL) /*!< DLMSB (Bit 0) */ +#define UART2_DLM_DLMSB_Msk (0xffUL) /*!< DLMSB (Bitfield-Mask: 0xff) */ +/* ========================================================== IER ========================================================== */ +#define UART2_IER_RBRIE_Pos (0UL) /*!< RBRIE (Bit 0) */ +#define UART2_IER_RBRIE_Msk (0x1UL) /*!< RBRIE (Bitfield-Mask: 0x01) */ +#define UART2_IER_THREIE_Pos (1UL) /*!< THREIE (Bit 1) */ +#define UART2_IER_THREIE_Msk (0x2UL) /*!< THREIE (Bitfield-Mask: 0x01) */ +#define UART2_IER_RXIE_Pos (2UL) /*!< RXIE (Bit 2) */ +#define UART2_IER_RXIE_Msk (0x4UL) /*!< RXIE (Bitfield-Mask: 0x01) */ +#define UART2_IER_ABEOINTEN_Pos (8UL) /*!< ABEOINTEN (Bit 8) */ +#define UART2_IER_ABEOINTEN_Msk (0x100UL) /*!< ABEOINTEN (Bitfield-Mask: 0x01) */ +#define UART2_IER_ABTOINTEN_Pos (9UL) /*!< ABTOINTEN (Bit 9) */ +#define UART2_IER_ABTOINTEN_Msk (0x200UL) /*!< ABTOINTEN (Bitfield-Mask: 0x01) */ +/* ========================================================== IIR ========================================================== */ +#define UART2_IIR_INTSTATUS_Pos (0UL) /*!< INTSTATUS (Bit 0) */ +#define UART2_IIR_INTSTATUS_Msk (0x1UL) /*!< INTSTATUS (Bitfield-Mask: 0x01) */ +#define UART2_IIR_INTID_Pos (1UL) /*!< INTID (Bit 1) */ +#define UART2_IIR_INTID_Msk (0xeUL) /*!< INTID (Bitfield-Mask: 0x07) */ +#define UART2_IIR_FIFOENABLE_Pos (6UL) /*!< FIFOENABLE (Bit 6) */ +#define UART2_IIR_FIFOENABLE_Msk (0xc0UL) /*!< FIFOENABLE (Bitfield-Mask: 0x03) */ +#define UART2_IIR_ABEOINT_Pos (8UL) /*!< ABEOINT (Bit 8) */ +#define UART2_IIR_ABEOINT_Msk (0x100UL) /*!< ABEOINT (Bitfield-Mask: 0x01) */ +#define UART2_IIR_ABTOINT_Pos (9UL) /*!< ABTOINT (Bit 9) */ +#define UART2_IIR_ABTOINT_Msk (0x200UL) /*!< ABTOINT (Bitfield-Mask: 0x01) */ +/* ========================================================== FCR ========================================================== */ +#define UART2_FCR_FIFOEN_Pos (0UL) /*!< FIFOEN (Bit 0) */ +#define UART2_FCR_FIFOEN_Msk (0x1UL) /*!< FIFOEN (Bitfield-Mask: 0x01) */ +#define UART2_FCR_RXFIFORES_Pos (1UL) /*!< RXFIFORES (Bit 1) */ +#define UART2_FCR_RXFIFORES_Msk (0x2UL) /*!< RXFIFORES (Bitfield-Mask: 0x01) */ +#define UART2_FCR_TXFIFORES_Pos (2UL) /*!< TXFIFORES (Bit 2) */ +#define UART2_FCR_TXFIFORES_Msk (0x4UL) /*!< TXFIFORES (Bitfield-Mask: 0x01) */ +#define UART2_FCR_DMAMODE_Pos (3UL) /*!< DMAMODE (Bit 3) */ +#define UART2_FCR_DMAMODE_Msk (0x8UL) /*!< DMAMODE (Bitfield-Mask: 0x01) */ +#define UART2_FCR_RXTRIGLVL_Pos (6UL) /*!< RXTRIGLVL (Bit 6) */ +#define UART2_FCR_RXTRIGLVL_Msk (0xc0UL) /*!< RXTRIGLVL (Bitfield-Mask: 0x03) */ +/* ========================================================== LCR ========================================================== */ +#define UART2_LCR_WLS_Pos (0UL) /*!< WLS (Bit 0) */ +#define UART2_LCR_WLS_Msk (0x3UL) /*!< WLS (Bitfield-Mask: 0x03) */ +#define UART2_LCR_SBS_Pos (2UL) /*!< SBS (Bit 2) */ +#define UART2_LCR_SBS_Msk (0x4UL) /*!< SBS (Bitfield-Mask: 0x01) */ +#define UART2_LCR_PE_Pos (3UL) /*!< PE (Bit 3) */ +#define UART2_LCR_PE_Msk (0x8UL) /*!< PE (Bitfield-Mask: 0x01) */ +#define UART2_LCR_PS_Pos (4UL) /*!< PS (Bit 4) */ +#define UART2_LCR_PS_Msk (0x30UL) /*!< PS (Bitfield-Mask: 0x03) */ +#define UART2_LCR_BC_Pos (6UL) /*!< BC (Bit 6) */ +#define UART2_LCR_BC_Msk (0x40UL) /*!< BC (Bitfield-Mask: 0x01) */ +#define UART2_LCR_DLAB_Pos (7UL) /*!< DLAB (Bit 7) */ +#define UART2_LCR_DLAB_Msk (0x80UL) /*!< DLAB (Bitfield-Mask: 0x01) */ +/* ========================================================== LSR ========================================================== */ +#define UART2_LSR_RDR_Pos (0UL) /*!< RDR (Bit 0) */ +#define UART2_LSR_RDR_Msk (0x1UL) /*!< RDR (Bitfield-Mask: 0x01) */ +#define UART2_LSR_OE_Pos (1UL) /*!< OE (Bit 1) */ +#define UART2_LSR_OE_Msk (0x2UL) /*!< OE (Bitfield-Mask: 0x01) */ +#define UART2_LSR_PE_Pos (2UL) /*!< PE (Bit 2) */ +#define UART2_LSR_PE_Msk (0x4UL) /*!< PE (Bitfield-Mask: 0x01) */ +#define UART2_LSR_FE_Pos (3UL) /*!< FE (Bit 3) */ +#define UART2_LSR_FE_Msk (0x8UL) /*!< FE (Bitfield-Mask: 0x01) */ +#define UART2_LSR_BI_Pos (4UL) /*!< BI (Bit 4) */ +#define UART2_LSR_BI_Msk (0x10UL) /*!< BI (Bitfield-Mask: 0x01) */ +#define UART2_LSR_THRE_Pos (5UL) /*!< THRE (Bit 5) */ +#define UART2_LSR_THRE_Msk (0x20UL) /*!< THRE (Bitfield-Mask: 0x01) */ +#define UART2_LSR_TEMT_Pos (6UL) /*!< TEMT (Bit 6) */ +#define UART2_LSR_TEMT_Msk (0x40UL) /*!< TEMT (Bitfield-Mask: 0x01) */ +#define UART2_LSR_RXFE_Pos (7UL) /*!< RXFE (Bit 7) */ +#define UART2_LSR_RXFE_Msk (0x80UL) /*!< RXFE (Bitfield-Mask: 0x01) */ +/* ========================================================== SCR ========================================================== */ +#define UART2_SCR_PAD_Pos (0UL) /*!< PAD (Bit 0) */ +#define UART2_SCR_PAD_Msk (0xffUL) /*!< PAD (Bitfield-Mask: 0xff) */ +/* ========================================================== ACR ========================================================== */ +#define UART2_ACR_START_Pos (0UL) /*!< START (Bit 0) */ +#define UART2_ACR_START_Msk (0x1UL) /*!< START (Bitfield-Mask: 0x01) */ +#define UART2_ACR_MODE_Pos (1UL) /*!< MODE (Bit 1) */ +#define UART2_ACR_MODE_Msk (0x2UL) /*!< MODE (Bitfield-Mask: 0x01) */ +#define UART2_ACR_AUTORESTART_Pos (2UL) /*!< AUTORESTART (Bit 2) */ +#define UART2_ACR_AUTORESTART_Msk (0x4UL) /*!< AUTORESTART (Bitfield-Mask: 0x01) */ +#define UART2_ACR_ABEOINTCLR_Pos (8UL) /*!< ABEOINTCLR (Bit 8) */ +#define UART2_ACR_ABEOINTCLR_Msk (0x100UL) /*!< ABEOINTCLR (Bitfield-Mask: 0x01) */ +#define UART2_ACR_ABTOINTCLR_Pos (9UL) /*!< ABTOINTCLR (Bit 9) */ +#define UART2_ACR_ABTOINTCLR_Msk (0x200UL) /*!< ABTOINTCLR (Bitfield-Mask: 0x01) */ +/* ========================================================== FDR ========================================================== */ +#define UART2_FDR_DIVADDVAL_Pos (0UL) /*!< DIVADDVAL (Bit 0) */ +#define UART2_FDR_DIVADDVAL_Msk (0xfUL) /*!< DIVADDVAL (Bitfield-Mask: 0x0f) */ +#define UART2_FDR_MULVAL_Pos (4UL) /*!< MULVAL (Bit 4) */ +#define UART2_FDR_MULVAL_Msk (0xf0UL) /*!< MULVAL (Bitfield-Mask: 0x0f) */ +/* ========================================================== TER ========================================================== */ +#define UART2_TER_TXEN_Pos (7UL) /*!< TXEN (Bit 7) */ +#define UART2_TER_TXEN_Msk (0x80UL) /*!< TXEN (Bitfield-Mask: 0x01) */ +/* ======================================================= RS485CTRL ======================================================= */ +#define UART2_RS485CTRL_NMMEN_Pos (0UL) /*!< NMMEN (Bit 0) */ +#define UART2_RS485CTRL_NMMEN_Msk (0x1UL) /*!< NMMEN (Bitfield-Mask: 0x01) */ +#define UART2_RS485CTRL_RXDIS_Pos (1UL) /*!< RXDIS (Bit 1) */ +#define UART2_RS485CTRL_RXDIS_Msk (0x2UL) /*!< RXDIS (Bitfield-Mask: 0x01) */ +#define UART2_RS485CTRL_AADEN_Pos (2UL) /*!< AADEN (Bit 2) */ +#define UART2_RS485CTRL_AADEN_Msk (0x4UL) /*!< AADEN (Bitfield-Mask: 0x01) */ +#define UART2_RS485CTRL_DCTRL_Pos (4UL) /*!< DCTRL (Bit 4) */ +#define UART2_RS485CTRL_DCTRL_Msk (0x10UL) /*!< DCTRL (Bitfield-Mask: 0x01) */ +#define UART2_RS485CTRL_OINV_Pos (5UL) /*!< OINV (Bit 5) */ +#define UART2_RS485CTRL_OINV_Msk (0x20UL) /*!< OINV (Bitfield-Mask: 0x01) */ +/* ===================================================== RS485ADRMATCH ===================================================== */ +#define UART2_RS485ADRMATCH_ADRMATCH_Pos (0UL) /*!< ADRMATCH (Bit 0) */ +#define UART2_RS485ADRMATCH_ADRMATCH_Msk (0xffUL) /*!< ADRMATCH (Bitfield-Mask: 0xff) */ +/* ======================================================= RS485DLY ======================================================== */ +#define UART2_RS485DLY_DLY_Pos (0UL) /*!< DLY (Bit 0) */ +#define UART2_RS485DLY_DLY_Msk (0xffUL) /*!< DLY (Bitfield-Mask: 0xff) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_UART3 ================ */ +/* =========================================================================================================================== */ + +/* ========================================================== RBR ========================================================== */ +#define UART3_RBR_RBR_Pos (0UL) /*!< RBR (Bit 0) */ +#define UART3_RBR_RBR_Msk (0xffUL) /*!< RBR (Bitfield-Mask: 0xff) */ +/* ========================================================== THR ========================================================== */ +#define UART3_THR_THR_Pos (0UL) /*!< THR (Bit 0) */ +#define UART3_THR_THR_Msk (0xffUL) /*!< THR (Bitfield-Mask: 0xff) */ +/* ========================================================== DLL ========================================================== */ +#define UART3_DLL_DLLSB_Pos (0UL) /*!< DLLSB (Bit 0) */ +#define UART3_DLL_DLLSB_Msk (0xffUL) /*!< DLLSB (Bitfield-Mask: 0xff) */ +/* ========================================================== DLM ========================================================== */ +#define UART3_DLM_DLMSB_Pos (0UL) /*!< DLMSB (Bit 0) */ +#define UART3_DLM_DLMSB_Msk (0xffUL) /*!< DLMSB (Bitfield-Mask: 0xff) */ +/* ========================================================== IER ========================================================== */ +#define UART3_IER_RBRIE_Pos (0UL) /*!< RBRIE (Bit 0) */ +#define UART3_IER_RBRIE_Msk (0x1UL) /*!< RBRIE (Bitfield-Mask: 0x01) */ +#define UART3_IER_THREIE_Pos (1UL) /*!< THREIE (Bit 1) */ +#define UART3_IER_THREIE_Msk (0x2UL) /*!< THREIE (Bitfield-Mask: 0x01) */ +#define UART3_IER_RXIE_Pos (2UL) /*!< RXIE (Bit 2) */ +#define UART3_IER_RXIE_Msk (0x4UL) /*!< RXIE (Bitfield-Mask: 0x01) */ +#define UART3_IER_ABEOINTEN_Pos (8UL) /*!< ABEOINTEN (Bit 8) */ +#define UART3_IER_ABEOINTEN_Msk (0x100UL) /*!< ABEOINTEN (Bitfield-Mask: 0x01) */ +#define UART3_IER_ABTOINTEN_Pos (9UL) /*!< ABTOINTEN (Bit 9) */ +#define UART3_IER_ABTOINTEN_Msk (0x200UL) /*!< ABTOINTEN (Bitfield-Mask: 0x01) */ +/* ========================================================== IIR ========================================================== */ +#define UART3_IIR_INTSTATUS_Pos (0UL) /*!< INTSTATUS (Bit 0) */ +#define UART3_IIR_INTSTATUS_Msk (0x1UL) /*!< INTSTATUS (Bitfield-Mask: 0x01) */ +#define UART3_IIR_INTID_Pos (1UL) /*!< INTID (Bit 1) */ +#define UART3_IIR_INTID_Msk (0xeUL) /*!< INTID (Bitfield-Mask: 0x07) */ +#define UART3_IIR_FIFOENABLE_Pos (6UL) /*!< FIFOENABLE (Bit 6) */ +#define UART3_IIR_FIFOENABLE_Msk (0xc0UL) /*!< FIFOENABLE (Bitfield-Mask: 0x03) */ +#define UART3_IIR_ABEOINT_Pos (8UL) /*!< ABEOINT (Bit 8) */ +#define UART3_IIR_ABEOINT_Msk (0x100UL) /*!< ABEOINT (Bitfield-Mask: 0x01) */ +#define UART3_IIR_ABTOINT_Pos (9UL) /*!< ABTOINT (Bit 9) */ +#define UART3_IIR_ABTOINT_Msk (0x200UL) /*!< ABTOINT (Bitfield-Mask: 0x01) */ +/* ========================================================== FCR ========================================================== */ +#define UART3_FCR_FIFOEN_Pos (0UL) /*!< FIFOEN (Bit 0) */ +#define UART3_FCR_FIFOEN_Msk (0x1UL) /*!< FIFOEN (Bitfield-Mask: 0x01) */ +#define UART3_FCR_RXFIFORES_Pos (1UL) /*!< RXFIFORES (Bit 1) */ +#define UART3_FCR_RXFIFORES_Msk (0x2UL) /*!< RXFIFORES (Bitfield-Mask: 0x01) */ +#define UART3_FCR_TXFIFORES_Pos (2UL) /*!< TXFIFORES (Bit 2) */ +#define UART3_FCR_TXFIFORES_Msk (0x4UL) /*!< TXFIFORES (Bitfield-Mask: 0x01) */ +#define UART3_FCR_DMAMODE_Pos (3UL) /*!< DMAMODE (Bit 3) */ +#define UART3_FCR_DMAMODE_Msk (0x8UL) /*!< DMAMODE (Bitfield-Mask: 0x01) */ +#define UART3_FCR_RXTRIGLVL_Pos (6UL) /*!< RXTRIGLVL (Bit 6) */ +#define UART3_FCR_RXTRIGLVL_Msk (0xc0UL) /*!< RXTRIGLVL (Bitfield-Mask: 0x03) */ +/* ========================================================== LCR ========================================================== */ +#define UART3_LCR_WLS_Pos (0UL) /*!< WLS (Bit 0) */ +#define UART3_LCR_WLS_Msk (0x3UL) /*!< WLS (Bitfield-Mask: 0x03) */ +#define UART3_LCR_SBS_Pos (2UL) /*!< SBS (Bit 2) */ +#define UART3_LCR_SBS_Msk (0x4UL) /*!< SBS (Bitfield-Mask: 0x01) */ +#define UART3_LCR_PE_Pos (3UL) /*!< PE (Bit 3) */ +#define UART3_LCR_PE_Msk (0x8UL) /*!< PE (Bitfield-Mask: 0x01) */ +#define UART3_LCR_PS_Pos (4UL) /*!< PS (Bit 4) */ +#define UART3_LCR_PS_Msk (0x30UL) /*!< PS (Bitfield-Mask: 0x03) */ +#define UART3_LCR_BC_Pos (6UL) /*!< BC (Bit 6) */ +#define UART3_LCR_BC_Msk (0x40UL) /*!< BC (Bitfield-Mask: 0x01) */ +#define UART3_LCR_DLAB_Pos (7UL) /*!< DLAB (Bit 7) */ +#define UART3_LCR_DLAB_Msk (0x80UL) /*!< DLAB (Bitfield-Mask: 0x01) */ +/* ========================================================== LSR ========================================================== */ +#define UART3_LSR_RDR_Pos (0UL) /*!< RDR (Bit 0) */ +#define UART3_LSR_RDR_Msk (0x1UL) /*!< RDR (Bitfield-Mask: 0x01) */ +#define UART3_LSR_OE_Pos (1UL) /*!< OE (Bit 1) */ +#define UART3_LSR_OE_Msk (0x2UL) /*!< OE (Bitfield-Mask: 0x01) */ +#define UART3_LSR_PE_Pos (2UL) /*!< PE (Bit 2) */ +#define UART3_LSR_PE_Msk (0x4UL) /*!< PE (Bitfield-Mask: 0x01) */ +#define UART3_LSR_FE_Pos (3UL) /*!< FE (Bit 3) */ +#define UART3_LSR_FE_Msk (0x8UL) /*!< FE (Bitfield-Mask: 0x01) */ +#define UART3_LSR_BI_Pos (4UL) /*!< BI (Bit 4) */ +#define UART3_LSR_BI_Msk (0x10UL) /*!< BI (Bitfield-Mask: 0x01) */ +#define UART3_LSR_THRE_Pos (5UL) /*!< THRE (Bit 5) */ +#define UART3_LSR_THRE_Msk (0x20UL) /*!< THRE (Bitfield-Mask: 0x01) */ +#define UART3_LSR_TEMT_Pos (6UL) /*!< TEMT (Bit 6) */ +#define UART3_LSR_TEMT_Msk (0x40UL) /*!< TEMT (Bitfield-Mask: 0x01) */ +#define UART3_LSR_RXFE_Pos (7UL) /*!< RXFE (Bit 7) */ +#define UART3_LSR_RXFE_Msk (0x80UL) /*!< RXFE (Bitfield-Mask: 0x01) */ +/* ========================================================== SCR ========================================================== */ +#define UART3_SCR_PAD_Pos (0UL) /*!< PAD (Bit 0) */ +#define UART3_SCR_PAD_Msk (0xffUL) /*!< PAD (Bitfield-Mask: 0xff) */ +/* ========================================================== ACR ========================================================== */ +#define UART3_ACR_START_Pos (0UL) /*!< START (Bit 0) */ +#define UART3_ACR_START_Msk (0x1UL) /*!< START (Bitfield-Mask: 0x01) */ +#define UART3_ACR_MODE_Pos (1UL) /*!< MODE (Bit 1) */ +#define UART3_ACR_MODE_Msk (0x2UL) /*!< MODE (Bitfield-Mask: 0x01) */ +#define UART3_ACR_AUTORESTART_Pos (2UL) /*!< AUTORESTART (Bit 2) */ +#define UART3_ACR_AUTORESTART_Msk (0x4UL) /*!< AUTORESTART (Bitfield-Mask: 0x01) */ +#define UART3_ACR_ABEOINTCLR_Pos (8UL) /*!< ABEOINTCLR (Bit 8) */ +#define UART3_ACR_ABEOINTCLR_Msk (0x100UL) /*!< ABEOINTCLR (Bitfield-Mask: 0x01) */ +#define UART3_ACR_ABTOINTCLR_Pos (9UL) /*!< ABTOINTCLR (Bit 9) */ +#define UART3_ACR_ABTOINTCLR_Msk (0x200UL) /*!< ABTOINTCLR (Bitfield-Mask: 0x01) */ +/* ========================================================== FDR ========================================================== */ +#define UART3_FDR_DIVADDVAL_Pos (0UL) /*!< DIVADDVAL (Bit 0) */ +#define UART3_FDR_DIVADDVAL_Msk (0xfUL) /*!< DIVADDVAL (Bitfield-Mask: 0x0f) */ +#define UART3_FDR_MULVAL_Pos (4UL) /*!< MULVAL (Bit 4) */ +#define UART3_FDR_MULVAL_Msk (0xf0UL) /*!< MULVAL (Bitfield-Mask: 0x0f) */ +/* ========================================================== TER ========================================================== */ +#define UART3_TER_TXEN_Pos (7UL) /*!< TXEN (Bit 7) */ +#define UART3_TER_TXEN_Msk (0x80UL) /*!< TXEN (Bitfield-Mask: 0x01) */ +/* ======================================================= RS485CTRL ======================================================= */ +#define UART3_RS485CTRL_NMMEN_Pos (0UL) /*!< NMMEN (Bit 0) */ +#define UART3_RS485CTRL_NMMEN_Msk (0x1UL) /*!< NMMEN (Bitfield-Mask: 0x01) */ +#define UART3_RS485CTRL_RXDIS_Pos (1UL) /*!< RXDIS (Bit 1) */ +#define UART3_RS485CTRL_RXDIS_Msk (0x2UL) /*!< RXDIS (Bitfield-Mask: 0x01) */ +#define UART3_RS485CTRL_AADEN_Pos (2UL) /*!< AADEN (Bit 2) */ +#define UART3_RS485CTRL_AADEN_Msk (0x4UL) /*!< AADEN (Bitfield-Mask: 0x01) */ +#define UART3_RS485CTRL_DCTRL_Pos (4UL) /*!< DCTRL (Bit 4) */ +#define UART3_RS485CTRL_DCTRL_Msk (0x10UL) /*!< DCTRL (Bitfield-Mask: 0x01) */ +#define UART3_RS485CTRL_OINV_Pos (5UL) /*!< OINV (Bit 5) */ +#define UART3_RS485CTRL_OINV_Msk (0x20UL) /*!< OINV (Bitfield-Mask: 0x01) */ +/* ===================================================== RS485ADRMATCH ===================================================== */ +#define UART3_RS485ADRMATCH_ADRMATCH_Pos (0UL) /*!< ADRMATCH (Bit 0) */ +#define UART3_RS485ADRMATCH_ADRMATCH_Msk (0xffUL) /*!< ADRMATCH (Bitfield-Mask: 0xff) */ +/* ======================================================= RS485DLY ======================================================== */ +#define UART3_RS485DLY_DLY_Pos (0UL) /*!< DLY (Bit 0) */ +#define UART3_RS485DLY_DLY_Msk (0xffUL) /*!< DLY (Bitfield-Mask: 0xff) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_I2S ================ */ +/* =========================================================================================================================== */ + +/* ========================================================== DAO ========================================================== */ +#define I2S_DAO_WORDWIDTH_Pos (0UL) /*!< WORDWIDTH (Bit 0) */ +#define I2S_DAO_WORDWIDTH_Msk (0x3UL) /*!< WORDWIDTH (Bitfield-Mask: 0x03) */ +#define I2S_DAO_MONO_Pos (2UL) /*!< MONO (Bit 2) */ +#define I2S_DAO_MONO_Msk (0x4UL) /*!< MONO (Bitfield-Mask: 0x01) */ +#define I2S_DAO_STOP_Pos (3UL) /*!< STOP (Bit 3) */ +#define I2S_DAO_STOP_Msk (0x8UL) /*!< STOP (Bitfield-Mask: 0x01) */ +#define I2S_DAO_RESET_Pos (4UL) /*!< RESET (Bit 4) */ +#define I2S_DAO_RESET_Msk (0x10UL) /*!< RESET (Bitfield-Mask: 0x01) */ +#define I2S_DAO_WS_SEL_Pos (5UL) /*!< WS_SEL (Bit 5) */ +#define I2S_DAO_WS_SEL_Msk (0x20UL) /*!< WS_SEL (Bitfield-Mask: 0x01) */ +#define I2S_DAO_WS_HALFPERIOD_Pos (6UL) /*!< WS_HALFPERIOD (Bit 6) */ +#define I2S_DAO_WS_HALFPERIOD_Msk (0x7fc0UL) /*!< WS_HALFPERIOD (Bitfield-Mask: 0x1ff) */ +#define I2S_DAO_MUTE_Pos (15UL) /*!< MUTE (Bit 15) */ +#define I2S_DAO_MUTE_Msk (0x8000UL) /*!< MUTE (Bitfield-Mask: 0x01) */ +/* ========================================================== DAI ========================================================== */ +#define I2S_DAI_WORDWIDTH_Pos (0UL) /*!< WORDWIDTH (Bit 0) */ +#define I2S_DAI_WORDWIDTH_Msk (0x3UL) /*!< WORDWIDTH (Bitfield-Mask: 0x03) */ +#define I2S_DAI_MONO_Pos (2UL) /*!< MONO (Bit 2) */ +#define I2S_DAI_MONO_Msk (0x4UL) /*!< MONO (Bitfield-Mask: 0x01) */ +#define I2S_DAI_STOP_Pos (3UL) /*!< STOP (Bit 3) */ +#define I2S_DAI_STOP_Msk (0x8UL) /*!< STOP (Bitfield-Mask: 0x01) */ +#define I2S_DAI_RESET_Pos (4UL) /*!< RESET (Bit 4) */ +#define I2S_DAI_RESET_Msk (0x10UL) /*!< RESET (Bitfield-Mask: 0x01) */ +#define I2S_DAI_WS_SEL_Pos (5UL) /*!< WS_SEL (Bit 5) */ +#define I2S_DAI_WS_SEL_Msk (0x20UL) /*!< WS_SEL (Bitfield-Mask: 0x01) */ +#define I2S_DAI_WS_HALFPERIOD_Pos (6UL) /*!< WS_HALFPERIOD (Bit 6) */ +#define I2S_DAI_WS_HALFPERIOD_Msk (0x7fc0UL) /*!< WS_HALFPERIOD (Bitfield-Mask: 0x1ff) */ +/* ======================================================== TXFIFO ========================================================= */ +#define I2S_TXFIFO_I2STXFIFO_Pos (0UL) /*!< I2STXFIFO (Bit 0) */ +#define I2S_TXFIFO_I2STXFIFO_Msk (0xffffffffUL) /*!< I2STXFIFO (Bitfield-Mask: 0xffffffff) */ +/* ======================================================== RXFIFO ========================================================= */ +#define I2S_RXFIFO_I2SRXFIFO_Pos (0UL) /*!< I2SRXFIFO (Bit 0) */ +#define I2S_RXFIFO_I2SRXFIFO_Msk (0xffffffffUL) /*!< I2SRXFIFO (Bitfield-Mask: 0xffffffff) */ +/* ========================================================= STATE ========================================================= */ +#define I2S_STATE_IRQ_Pos (0UL) /*!< IRQ (Bit 0) */ +#define I2S_STATE_IRQ_Msk (0x1UL) /*!< IRQ (Bitfield-Mask: 0x01) */ +#define I2S_STATE_DMAREQ1_Pos (1UL) /*!< DMAREQ1 (Bit 1) */ +#define I2S_STATE_DMAREQ1_Msk (0x2UL) /*!< DMAREQ1 (Bitfield-Mask: 0x01) */ +#define I2S_STATE_DMAREQ2_Pos (2UL) /*!< DMAREQ2 (Bit 2) */ +#define I2S_STATE_DMAREQ2_Msk (0x4UL) /*!< DMAREQ2 (Bitfield-Mask: 0x01) */ +#define I2S_STATE_RX_LEVEL_Pos (8UL) /*!< RX_LEVEL (Bit 8) */ +#define I2S_STATE_RX_LEVEL_Msk (0xf00UL) /*!< RX_LEVEL (Bitfield-Mask: 0x0f) */ +#define I2S_STATE_TX_LEVEL_Pos (16UL) /*!< TX_LEVEL (Bit 16) */ +#define I2S_STATE_TX_LEVEL_Msk (0xf0000UL) /*!< TX_LEVEL (Bitfield-Mask: 0x0f) */ +/* ========================================================= DMA1 ========================================================== */ +#define I2S_DMA1_RX_DMA1_ENABLE_Pos (0UL) /*!< RX_DMA1_ENABLE (Bit 0) */ +#define I2S_DMA1_RX_DMA1_ENABLE_Msk (0x1UL) /*!< RX_DMA1_ENABLE (Bitfield-Mask: 0x01) */ +#define I2S_DMA1_TX_DMA1_ENABLE_Pos (1UL) /*!< TX_DMA1_ENABLE (Bit 1) */ +#define I2S_DMA1_TX_DMA1_ENABLE_Msk (0x2UL) /*!< TX_DMA1_ENABLE (Bitfield-Mask: 0x01) */ +#define I2S_DMA1_RX_DEPTH_DMA1_Pos (8UL) /*!< RX_DEPTH_DMA1 (Bit 8) */ +#define I2S_DMA1_RX_DEPTH_DMA1_Msk (0xf00UL) /*!< RX_DEPTH_DMA1 (Bitfield-Mask: 0x0f) */ +#define I2S_DMA1_TX_DEPTH_DMA1_Pos (16UL) /*!< TX_DEPTH_DMA1 (Bit 16) */ +#define I2S_DMA1_TX_DEPTH_DMA1_Msk (0xf0000UL) /*!< TX_DEPTH_DMA1 (Bitfield-Mask: 0x0f) */ +/* ========================================================= DMA2 ========================================================== */ +#define I2S_DMA2_RX_DMA2_ENABLE_Pos (0UL) /*!< RX_DMA2_ENABLE (Bit 0) */ +#define I2S_DMA2_RX_DMA2_ENABLE_Msk (0x1UL) /*!< RX_DMA2_ENABLE (Bitfield-Mask: 0x01) */ +#define I2S_DMA2_TX_DMA2_ENABLE_Pos (1UL) /*!< TX_DMA2_ENABLE (Bit 1) */ +#define I2S_DMA2_TX_DMA2_ENABLE_Msk (0x2UL) /*!< TX_DMA2_ENABLE (Bitfield-Mask: 0x01) */ +#define I2S_DMA2_RX_DEPTH_DMA2_Pos (8UL) /*!< RX_DEPTH_DMA2 (Bit 8) */ +#define I2S_DMA2_RX_DEPTH_DMA2_Msk (0xf00UL) /*!< RX_DEPTH_DMA2 (Bitfield-Mask: 0x0f) */ +#define I2S_DMA2_TX_DEPTH_DMA2_Pos (16UL) /*!< TX_DEPTH_DMA2 (Bit 16) */ +#define I2S_DMA2_TX_DEPTH_DMA2_Msk (0xf0000UL) /*!< TX_DEPTH_DMA2 (Bitfield-Mask: 0x0f) */ +/* ========================================================== IRQ ========================================================== */ +#define I2S_IRQ_RX_IRQ_ENABLE_Pos (0UL) /*!< RX_IRQ_ENABLE (Bit 0) */ +#define I2S_IRQ_RX_IRQ_ENABLE_Msk (0x1UL) /*!< RX_IRQ_ENABLE (Bitfield-Mask: 0x01) */ +#define I2S_IRQ_TX_IRQ_ENABLE_Pos (1UL) /*!< TX_IRQ_ENABLE (Bit 1) */ +#define I2S_IRQ_TX_IRQ_ENABLE_Msk (0x2UL) /*!< TX_IRQ_ENABLE (Bitfield-Mask: 0x01) */ +#define I2S_IRQ_RX_DEPTH_IRQ_Pos (8UL) /*!< RX_DEPTH_IRQ (Bit 8) */ +#define I2S_IRQ_RX_DEPTH_IRQ_Msk (0xf00UL) /*!< RX_DEPTH_IRQ (Bitfield-Mask: 0x0f) */ +#define I2S_IRQ_TX_DEPTH_IRQ_Pos (16UL) /*!< TX_DEPTH_IRQ (Bit 16) */ +#define I2S_IRQ_TX_DEPTH_IRQ_Msk (0xf0000UL) /*!< TX_DEPTH_IRQ (Bitfield-Mask: 0x0f) */ +/* ======================================================== TXRATE ========================================================= */ +#define I2S_TXRATE_Y_DIVIDER_Pos (0UL) /*!< Y_DIVIDER (Bit 0) */ +#define I2S_TXRATE_Y_DIVIDER_Msk (0xffUL) /*!< Y_DIVIDER (Bitfield-Mask: 0xff) */ +#define I2S_TXRATE_X_DIVIDER_Pos (8UL) /*!< X_DIVIDER (Bit 8) */ +#define I2S_TXRATE_X_DIVIDER_Msk (0xff00UL) /*!< X_DIVIDER (Bitfield-Mask: 0xff) */ +/* ======================================================== RXRATE ========================================================= */ +#define I2S_RXRATE_Y_DIVIDER_Pos (0UL) /*!< Y_DIVIDER (Bit 0) */ +#define I2S_RXRATE_Y_DIVIDER_Msk (0xffUL) /*!< Y_DIVIDER (Bitfield-Mask: 0xff) */ +#define I2S_RXRATE_X_DIVIDER_Pos (8UL) /*!< X_DIVIDER (Bit 8) */ +#define I2S_RXRATE_X_DIVIDER_Msk (0xff00UL) /*!< X_DIVIDER (Bitfield-Mask: 0xff) */ +/* ======================================================= TXBITRATE ======================================================= */ +#define I2S_TXBITRATE_TX_BITRATE_Pos (0UL) /*!< TX_BITRATE (Bit 0) */ +#define I2S_TXBITRATE_TX_BITRATE_Msk (0x3fUL) /*!< TX_BITRATE (Bitfield-Mask: 0x3f) */ +/* ======================================================= RXBITRATE ======================================================= */ +#define I2S_RXBITRATE_RX_BITRATE_Pos (0UL) /*!< RX_BITRATE (Bit 0) */ +#define I2S_RXBITRATE_RX_BITRATE_Msk (0x3fUL) /*!< RX_BITRATE (Bitfield-Mask: 0x3f) */ +/* ======================================================== TXMODE ========================================================= */ +#define I2S_TXMODE_TXCLKSEL_Pos (0UL) /*!< TXCLKSEL (Bit 0) */ +#define I2S_TXMODE_TXCLKSEL_Msk (0x3UL) /*!< TXCLKSEL (Bitfield-Mask: 0x03) */ +#define I2S_TXMODE_TX4PIN_Pos (2UL) /*!< TX4PIN (Bit 2) */ +#define I2S_TXMODE_TX4PIN_Msk (0x4UL) /*!< TX4PIN (Bitfield-Mask: 0x01) */ +#define I2S_TXMODE_TXMCENA_Pos (3UL) /*!< TXMCENA (Bit 3) */ +#define I2S_TXMODE_TXMCENA_Msk (0x8UL) /*!< TXMCENA (Bitfield-Mask: 0x01) */ +/* ======================================================== RXMODE ========================================================= */ +#define I2S_RXMODE_RXCLKSEL_Pos (0UL) /*!< RXCLKSEL (Bit 0) */ +#define I2S_RXMODE_RXCLKSEL_Msk (0x3UL) /*!< RXCLKSEL (Bitfield-Mask: 0x03) */ +#define I2S_RXMODE_RX4PIN_Pos (2UL) /*!< RX4PIN (Bit 2) */ +#define I2S_RXMODE_RX4PIN_Msk (0x4UL) /*!< RX4PIN (Bitfield-Mask: 0x01) */ +#define I2S_RXMODE_RXMCENA_Pos (3UL) /*!< RXMCENA (Bit 3) */ +#define I2S_RXMODE_RXMCENA_Msk (0x8UL) /*!< RXMCENA (Bitfield-Mask: 0x01) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_RITIMER ================ */ +/* =========================================================================================================================== */ + +/* ======================================================== COMPVAL ======================================================== */ +#define RITIMER_COMPVAL_RICOMP_Pos (0UL) /*!< RICOMP (Bit 0) */ +#define RITIMER_COMPVAL_RICOMP_Msk (0xffffffffUL) /*!< RICOMP (Bitfield-Mask: 0xffffffff) */ +/* ========================================================= MASK ========================================================== */ +#define RITIMER_MASK_RIMASK_Pos (0UL) /*!< RIMASK (Bit 0) */ +#define RITIMER_MASK_RIMASK_Msk (0xffffffffUL) /*!< RIMASK (Bitfield-Mask: 0xffffffff) */ +/* ========================================================= CTRL ========================================================== */ +#define RITIMER_CTRL_RITINT_Pos (0UL) /*!< RITINT (Bit 0) */ +#define RITIMER_CTRL_RITINT_Msk (0x1UL) /*!< RITINT (Bitfield-Mask: 0x01) */ +#define RITIMER_CTRL_RITENCLR_Pos (1UL) /*!< RITENCLR (Bit 1) */ +#define RITIMER_CTRL_RITENCLR_Msk (0x2UL) /*!< RITENCLR (Bitfield-Mask: 0x01) */ +#define RITIMER_CTRL_RITENBR_Pos (2UL) /*!< RITENBR (Bit 2) */ +#define RITIMER_CTRL_RITENBR_Msk (0x4UL) /*!< RITENBR (Bitfield-Mask: 0x01) */ +#define RITIMER_CTRL_RITEN_Pos (3UL) /*!< RITEN (Bit 3) */ +#define RITIMER_CTRL_RITEN_Msk (0x8UL) /*!< RITEN (Bitfield-Mask: 0x01) */ +/* ======================================================== COUNTER ======================================================== */ +#define RITIMER_COUNTER_RICOUNTER_Pos (0UL) /*!< RICOUNTER (Bit 0) */ +#define RITIMER_COUNTER_RICOUNTER_Msk (0xffffffffUL) /*!< RICOUNTER (Bitfield-Mask: 0xffffffff) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_MCPWM ================ */ +/* =========================================================================================================================== */ + +/* ========================================================== CON ========================================================== */ +#define MCPWM_CON_RUN0_Pos (0UL) /*!< RUN0 (Bit 0) */ +#define MCPWM_CON_RUN0_Msk (0x1UL) /*!< RUN0 (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_CENTER0_Pos (1UL) /*!< CENTER0 (Bit 1) */ +#define MCPWM_CON_CENTER0_Msk (0x2UL) /*!< CENTER0 (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_POLA0_Pos (2UL) /*!< POLA0 (Bit 2) */ +#define MCPWM_CON_POLA0_Msk (0x4UL) /*!< POLA0 (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_DTE0_Pos (3UL) /*!< DTE0 (Bit 3) */ +#define MCPWM_CON_DTE0_Msk (0x8UL) /*!< DTE0 (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_DISUP0_Pos (4UL) /*!< DISUP0 (Bit 4) */ +#define MCPWM_CON_DISUP0_Msk (0x10UL) /*!< DISUP0 (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_RUN1_Pos (8UL) /*!< RUN1 (Bit 8) */ +#define MCPWM_CON_RUN1_Msk (0x100UL) /*!< RUN1 (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_CENTER1_Pos (9UL) /*!< CENTER1 (Bit 9) */ +#define MCPWM_CON_CENTER1_Msk (0x200UL) /*!< CENTER1 (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_POLA1_Pos (10UL) /*!< POLA1 (Bit 10) */ +#define MCPWM_CON_POLA1_Msk (0x400UL) /*!< POLA1 (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_DTE1_Pos (11UL) /*!< DTE1 (Bit 11) */ +#define MCPWM_CON_DTE1_Msk (0x800UL) /*!< DTE1 (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_DISUP1_Pos (12UL) /*!< DISUP1 (Bit 12) */ +#define MCPWM_CON_DISUP1_Msk (0x1000UL) /*!< DISUP1 (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_RUN2_Pos (16UL) /*!< RUN2 (Bit 16) */ +#define MCPWM_CON_RUN2_Msk (0x10000UL) /*!< RUN2 (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_CENTER2_Pos (17UL) /*!< CENTER2 (Bit 17) */ +#define MCPWM_CON_CENTER2_Msk (0x20000UL) /*!< CENTER2 (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_POLA2_Pos (18UL) /*!< POLA2 (Bit 18) */ +#define MCPWM_CON_POLA2_Msk (0x40000UL) /*!< POLA2 (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_DTE2_Pos (19UL) /*!< DTE2 (Bit 19) */ +#define MCPWM_CON_DTE2_Msk (0x80000UL) /*!< DTE2 (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_DISUP2_Pos (20UL) /*!< DISUP2 (Bit 20) */ +#define MCPWM_CON_DISUP2_Msk (0x100000UL) /*!< DISUP2 (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_INVBDC_Pos (29UL) /*!< INVBDC (Bit 29) */ +#define MCPWM_CON_INVBDC_Msk (0x20000000UL) /*!< INVBDC (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_ACMODE_Pos (30UL) /*!< ACMODE (Bit 30) */ +#define MCPWM_CON_ACMODE_Msk (0x40000000UL) /*!< ACMODE (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_DCMODE_Pos (31UL) /*!< DCMODE (Bit 31) */ +#define MCPWM_CON_DCMODE_Msk (0x80000000UL) /*!< DCMODE (Bitfield-Mask: 0x01) */ +/* ======================================================== CON_SET ======================================================== */ +#define MCPWM_CON_SET_RUN0_SET_Pos (0UL) /*!< RUN0_SET (Bit 0) */ +#define MCPWM_CON_SET_RUN0_SET_Msk (0x1UL) /*!< RUN0_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_SET_CENTER0_SET_Pos (1UL) /*!< CENTER0_SET (Bit 1) */ +#define MCPWM_CON_SET_CENTER0_SET_Msk (0x2UL) /*!< CENTER0_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_SET_POLA0_SET_Pos (2UL) /*!< POLA0_SET (Bit 2) */ +#define MCPWM_CON_SET_POLA0_SET_Msk (0x4UL) /*!< POLA0_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_SET_DTE0_SET_Pos (3UL) /*!< DTE0_SET (Bit 3) */ +#define MCPWM_CON_SET_DTE0_SET_Msk (0x8UL) /*!< DTE0_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_SET_DISUP0_SET_Pos (4UL) /*!< DISUP0_SET (Bit 4) */ +#define MCPWM_CON_SET_DISUP0_SET_Msk (0x10UL) /*!< DISUP0_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_SET_RUN1_SET_Pos (8UL) /*!< RUN1_SET (Bit 8) */ +#define MCPWM_CON_SET_RUN1_SET_Msk (0x100UL) /*!< RUN1_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_SET_CENTER1_SET_Pos (9UL) /*!< CENTER1_SET (Bit 9) */ +#define MCPWM_CON_SET_CENTER1_SET_Msk (0x200UL) /*!< CENTER1_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_SET_POLA1_SET_Pos (10UL) /*!< POLA1_SET (Bit 10) */ +#define MCPWM_CON_SET_POLA1_SET_Msk (0x400UL) /*!< POLA1_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_SET_DTE1_SET_Pos (11UL) /*!< DTE1_SET (Bit 11) */ +#define MCPWM_CON_SET_DTE1_SET_Msk (0x800UL) /*!< DTE1_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_SET_DISUP1_SET_Pos (12UL) /*!< DISUP1_SET (Bit 12) */ +#define MCPWM_CON_SET_DISUP1_SET_Msk (0x1000UL) /*!< DISUP1_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_SET_RUN2_SET_Pos (16UL) /*!< RUN2_SET (Bit 16) */ +#define MCPWM_CON_SET_RUN2_SET_Msk (0x10000UL) /*!< RUN2_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_SET_CENTER2_SET_Pos (17UL) /*!< CENTER2_SET (Bit 17) */ +#define MCPWM_CON_SET_CENTER2_SET_Msk (0x20000UL) /*!< CENTER2_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_SET_POLA2_SET_Pos (18UL) /*!< POLA2_SET (Bit 18) */ +#define MCPWM_CON_SET_POLA2_SET_Msk (0x40000UL) /*!< POLA2_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_SET_DTE2_SET_Pos (19UL) /*!< DTE2_SET (Bit 19) */ +#define MCPWM_CON_SET_DTE2_SET_Msk (0x80000UL) /*!< DTE2_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_SET_DISUP2_SET_Pos (20UL) /*!< DISUP2_SET (Bit 20) */ +#define MCPWM_CON_SET_DISUP2_SET_Msk (0x100000UL) /*!< DISUP2_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_SET_INVBDC_SET_Pos (29UL) /*!< INVBDC_SET (Bit 29) */ +#define MCPWM_CON_SET_INVBDC_SET_Msk (0x20000000UL) /*!< INVBDC_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_SET_ACMODE_SET_Pos (30UL) /*!< ACMODE_SET (Bit 30) */ +#define MCPWM_CON_SET_ACMODE_SET_Msk (0x40000000UL) /*!< ACMODE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_SET_DCMODE_SET_Pos (31UL) /*!< DCMODE_SET (Bit 31) */ +#define MCPWM_CON_SET_DCMODE_SET_Msk (0x80000000UL) /*!< DCMODE_SET (Bitfield-Mask: 0x01) */ +/* ======================================================== CON_CLR ======================================================== */ +#define MCPWM_CON_CLR_RUN0_CLR_Pos (0UL) /*!< RUN0_CLR (Bit 0) */ +#define MCPWM_CON_CLR_RUN0_CLR_Msk (0x1UL) /*!< RUN0_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_CLR_CENTER0_CLR_Pos (1UL) /*!< CENTER0_CLR (Bit 1) */ +#define MCPWM_CON_CLR_CENTER0_CLR_Msk (0x2UL) /*!< CENTER0_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_CLR_POLA0_CLR_Pos (2UL) /*!< POLA0_CLR (Bit 2) */ +#define MCPWM_CON_CLR_POLA0_CLR_Msk (0x4UL) /*!< POLA0_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_CLR_DTE0_CLR_Pos (3UL) /*!< DTE0_CLR (Bit 3) */ +#define MCPWM_CON_CLR_DTE0_CLR_Msk (0x8UL) /*!< DTE0_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_CLR_DISUP0_CLR_Pos (4UL) /*!< DISUP0_CLR (Bit 4) */ +#define MCPWM_CON_CLR_DISUP0_CLR_Msk (0x10UL) /*!< DISUP0_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_CLR_RUN1_CLR_Pos (8UL) /*!< RUN1_CLR (Bit 8) */ +#define MCPWM_CON_CLR_RUN1_CLR_Msk (0x100UL) /*!< RUN1_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_CLR_CENTER1_CLR_Pos (9UL) /*!< CENTER1_CLR (Bit 9) */ +#define MCPWM_CON_CLR_CENTER1_CLR_Msk (0x200UL) /*!< CENTER1_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_CLR_POLA1_CLR_Pos (10UL) /*!< POLA1_CLR (Bit 10) */ +#define MCPWM_CON_CLR_POLA1_CLR_Msk (0x400UL) /*!< POLA1_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_CLR_DTE1_CLR_Pos (11UL) /*!< DTE1_CLR (Bit 11) */ +#define MCPWM_CON_CLR_DTE1_CLR_Msk (0x800UL) /*!< DTE1_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_CLR_DISUP1_CLR_Pos (12UL) /*!< DISUP1_CLR (Bit 12) */ +#define MCPWM_CON_CLR_DISUP1_CLR_Msk (0x1000UL) /*!< DISUP1_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_CLR_RUN2_CLR_Pos (16UL) /*!< RUN2_CLR (Bit 16) */ +#define MCPWM_CON_CLR_RUN2_CLR_Msk (0x10000UL) /*!< RUN2_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_CLR_CENTER2_CLR_Pos (17UL) /*!< CENTER2_CLR (Bit 17) */ +#define MCPWM_CON_CLR_CENTER2_CLR_Msk (0x20000UL) /*!< CENTER2_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_CLR_POLA2_CLR_Pos (18UL) /*!< POLA2_CLR (Bit 18) */ +#define MCPWM_CON_CLR_POLA2_CLR_Msk (0x40000UL) /*!< POLA2_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_CLR_DTE2_CLR_Pos (19UL) /*!< DTE2_CLR (Bit 19) */ +#define MCPWM_CON_CLR_DTE2_CLR_Msk (0x80000UL) /*!< DTE2_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_CLR_DISUP2_CLR_Pos (20UL) /*!< DISUP2_CLR (Bit 20) */ +#define MCPWM_CON_CLR_DISUP2_CLR_Msk (0x100000UL) /*!< DISUP2_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_CLR_INVBDC_CLR_Pos (29UL) /*!< INVBDC_CLR (Bit 29) */ +#define MCPWM_CON_CLR_INVBDC_CLR_Msk (0x20000000UL) /*!< INVBDC_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_CLR_ACMOD_CLR_Pos (30UL) /*!< ACMOD_CLR (Bit 30) */ +#define MCPWM_CON_CLR_ACMOD_CLR_Msk (0x40000000UL) /*!< ACMOD_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CON_CLR_DCMODE_CLR_Pos (31UL) /*!< DCMODE_CLR (Bit 31) */ +#define MCPWM_CON_CLR_DCMODE_CLR_Msk (0x80000000UL) /*!< DCMODE_CLR (Bitfield-Mask: 0x01) */ +/* ======================================================== CAPCON ========================================================= */ +#define MCPWM_CAPCON_CAP0MCI0_RE_Pos (0UL) /*!< CAP0MCI0_RE (Bit 0) */ +#define MCPWM_CAPCON_CAP0MCI0_RE_Msk (0x1UL) /*!< CAP0MCI0_RE (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CAP0MCI0_FE_Pos (1UL) /*!< CAP0MCI0_FE (Bit 1) */ +#define MCPWM_CAPCON_CAP0MCI0_FE_Msk (0x2UL) /*!< CAP0MCI0_FE (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CAP0MCI1_RE_Pos (2UL) /*!< CAP0MCI1_RE (Bit 2) */ +#define MCPWM_CAPCON_CAP0MCI1_RE_Msk (0x4UL) /*!< CAP0MCI1_RE (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CAP0MCI1_FE_Pos (3UL) /*!< CAP0MCI1_FE (Bit 3) */ +#define MCPWM_CAPCON_CAP0MCI1_FE_Msk (0x8UL) /*!< CAP0MCI1_FE (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CAP0MCI2_RE_Pos (4UL) /*!< CAP0MCI2_RE (Bit 4) */ +#define MCPWM_CAPCON_CAP0MCI2_RE_Msk (0x10UL) /*!< CAP0MCI2_RE (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CAP0MCI2_FE_Pos (5UL) /*!< CAP0MCI2_FE (Bit 5) */ +#define MCPWM_CAPCON_CAP0MCI2_FE_Msk (0x20UL) /*!< CAP0MCI2_FE (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CAP1MCI0_RE_Pos (6UL) /*!< CAP1MCI0_RE (Bit 6) */ +#define MCPWM_CAPCON_CAP1MCI0_RE_Msk (0x40UL) /*!< CAP1MCI0_RE (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CAP1MCI0_FE_Pos (7UL) /*!< CAP1MCI0_FE (Bit 7) */ +#define MCPWM_CAPCON_CAP1MCI0_FE_Msk (0x80UL) /*!< CAP1MCI0_FE (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CAP1MCI1_RE_Pos (8UL) /*!< CAP1MCI1_RE (Bit 8) */ +#define MCPWM_CAPCON_CAP1MCI1_RE_Msk (0x100UL) /*!< CAP1MCI1_RE (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CAP1MCI1_FE_Pos (9UL) /*!< CAP1MCI1_FE (Bit 9) */ +#define MCPWM_CAPCON_CAP1MCI1_FE_Msk (0x200UL) /*!< CAP1MCI1_FE (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CAP1MCI2_RE_Pos (10UL) /*!< CAP1MCI2_RE (Bit 10) */ +#define MCPWM_CAPCON_CAP1MCI2_RE_Msk (0x400UL) /*!< CAP1MCI2_RE (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CAP1MCI2_FE_Pos (11UL) /*!< CAP1MCI2_FE (Bit 11) */ +#define MCPWM_CAPCON_CAP1MCI2_FE_Msk (0x800UL) /*!< CAP1MCI2_FE (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CAP2MCI0_RE_Pos (12UL) /*!< CAP2MCI0_RE (Bit 12) */ +#define MCPWM_CAPCON_CAP2MCI0_RE_Msk (0x1000UL) /*!< CAP2MCI0_RE (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CAP2MCI0_FE_Pos (13UL) /*!< CAP2MCI0_FE (Bit 13) */ +#define MCPWM_CAPCON_CAP2MCI0_FE_Msk (0x2000UL) /*!< CAP2MCI0_FE (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CAP2MCI1_RE_Pos (14UL) /*!< CAP2MCI1_RE (Bit 14) */ +#define MCPWM_CAPCON_CAP2MCI1_RE_Msk (0x4000UL) /*!< CAP2MCI1_RE (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CAP2MCI1_FE_Pos (15UL) /*!< CAP2MCI1_FE (Bit 15) */ +#define MCPWM_CAPCON_CAP2MCI1_FE_Msk (0x8000UL) /*!< CAP2MCI1_FE (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CAP2MCI2_RE_Pos (16UL) /*!< CAP2MCI2_RE (Bit 16) */ +#define MCPWM_CAPCON_CAP2MCI2_RE_Msk (0x10000UL) /*!< CAP2MCI2_RE (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CAP2MCI2_FE_Pos (17UL) /*!< CAP2MCI2_FE (Bit 17) */ +#define MCPWM_CAPCON_CAP2MCI2_FE_Msk (0x20000UL) /*!< CAP2MCI2_FE (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_RT0_Pos (18UL) /*!< RT0 (Bit 18) */ +#define MCPWM_CAPCON_RT0_Msk (0x40000UL) /*!< RT0 (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_RT1_Pos (19UL) /*!< RT1 (Bit 19) */ +#define MCPWM_CAPCON_RT1_Msk (0x80000UL) /*!< RT1 (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_RT2_Pos (20UL) /*!< RT2 (Bit 20) */ +#define MCPWM_CAPCON_RT2_Msk (0x100000UL) /*!< RT2 (Bitfield-Mask: 0x01) */ +/* ====================================================== CAPCON_SET ======================================================= */ +#define MCPWM_CAPCON_SET_CAP0MCI0_RE_SET_Pos (0UL) /*!< CAP0MCI0_RE_SET (Bit 0) */ +#define MCPWM_CAPCON_SET_CAP0MCI0_RE_SET_Msk (0x1UL) /*!< CAP0MCI0_RE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_SET_CAP0MCI0_FE_SET_Pos (1UL) /*!< CAP0MCI0_FE_SET (Bit 1) */ +#define MCPWM_CAPCON_SET_CAP0MCI0_FE_SET_Msk (0x2UL) /*!< CAP0MCI0_FE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_SET_CAP0MCI1_RE_SET_Pos (2UL) /*!< CAP0MCI1_RE_SET (Bit 2) */ +#define MCPWM_CAPCON_SET_CAP0MCI1_RE_SET_Msk (0x4UL) /*!< CAP0MCI1_RE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_SET_CAP0MCI1_FE_SET_Pos (3UL) /*!< CAP0MCI1_FE_SET (Bit 3) */ +#define MCPWM_CAPCON_SET_CAP0MCI1_FE_SET_Msk (0x8UL) /*!< CAP0MCI1_FE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_SET_CAP0MCI2_RE_SET_Pos (4UL) /*!< CAP0MCI2_RE_SET (Bit 4) */ +#define MCPWM_CAPCON_SET_CAP0MCI2_RE_SET_Msk (0x10UL) /*!< CAP0MCI2_RE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_SET_CAP0MCI2_FE_SET_Pos (5UL) /*!< CAP0MCI2_FE_SET (Bit 5) */ +#define MCPWM_CAPCON_SET_CAP0MCI2_FE_SET_Msk (0x20UL) /*!< CAP0MCI2_FE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_SET_CAP1MCI0_RE_SET_Pos (6UL) /*!< CAP1MCI0_RE_SET (Bit 6) */ +#define MCPWM_CAPCON_SET_CAP1MCI0_RE_SET_Msk (0x40UL) /*!< CAP1MCI0_RE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_SET_CAP1MCI0_FE_SET_Pos (7UL) /*!< CAP1MCI0_FE_SET (Bit 7) */ +#define MCPWM_CAPCON_SET_CAP1MCI0_FE_SET_Msk (0x80UL) /*!< CAP1MCI0_FE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_SET_CAP1MCI1_RE_SET_Pos (8UL) /*!< CAP1MCI1_RE_SET (Bit 8) */ +#define MCPWM_CAPCON_SET_CAP1MCI1_RE_SET_Msk (0x100UL) /*!< CAP1MCI1_RE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_SET_CAP1MCI1_FE_SET_Pos (9UL) /*!< CAP1MCI1_FE_SET (Bit 9) */ +#define MCPWM_CAPCON_SET_CAP1MCI1_FE_SET_Msk (0x200UL) /*!< CAP1MCI1_FE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_SET_CAP1MCI2_RE_SET_Pos (10UL) /*!< CAP1MCI2_RE_SET (Bit 10) */ +#define MCPWM_CAPCON_SET_CAP1MCI2_RE_SET_Msk (0x400UL) /*!< CAP1MCI2_RE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_SET_CAP1MCI2_FE_SET_Pos (11UL) /*!< CAP1MCI2_FE_SET (Bit 11) */ +#define MCPWM_CAPCON_SET_CAP1MCI2_FE_SET_Msk (0x800UL) /*!< CAP1MCI2_FE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_SET_CAP2MCI0_RE_SET_Pos (12UL) /*!< CAP2MCI0_RE_SET (Bit 12) */ +#define MCPWM_CAPCON_SET_CAP2MCI0_RE_SET_Msk (0x1000UL) /*!< CAP2MCI0_RE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_SET_CAP2MCI0_FE_SET_Pos (13UL) /*!< CAP2MCI0_FE_SET (Bit 13) */ +#define MCPWM_CAPCON_SET_CAP2MCI0_FE_SET_Msk (0x2000UL) /*!< CAP2MCI0_FE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_SET_CAP2MCI1_RE_SET_Pos (14UL) /*!< CAP2MCI1_RE_SET (Bit 14) */ +#define MCPWM_CAPCON_SET_CAP2MCI1_RE_SET_Msk (0x4000UL) /*!< CAP2MCI1_RE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_SET_CAP2MCI1_FE_SET_Pos (15UL) /*!< CAP2MCI1_FE_SET (Bit 15) */ +#define MCPWM_CAPCON_SET_CAP2MCI1_FE_SET_Msk (0x8000UL) /*!< CAP2MCI1_FE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_SET_CAP2MCI2_RE_SET_Pos (16UL) /*!< CAP2MCI2_RE_SET (Bit 16) */ +#define MCPWM_CAPCON_SET_CAP2MCI2_RE_SET_Msk (0x10000UL) /*!< CAP2MCI2_RE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_SET_CAP2MCI2_FE_SET_Pos (17UL) /*!< CAP2MCI2_FE_SET (Bit 17) */ +#define MCPWM_CAPCON_SET_CAP2MCI2_FE_SET_Msk (0x20000UL) /*!< CAP2MCI2_FE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_SET_RT0_SET_Pos (18UL) /*!< RT0_SET (Bit 18) */ +#define MCPWM_CAPCON_SET_RT0_SET_Msk (0x40000UL) /*!< RT0_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_SET_RT1_SET_Pos (19UL) /*!< RT1_SET (Bit 19) */ +#define MCPWM_CAPCON_SET_RT1_SET_Msk (0x80000UL) /*!< RT1_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_SET_RT2_SET_Pos (20UL) /*!< RT2_SET (Bit 20) */ +#define MCPWM_CAPCON_SET_RT2_SET_Msk (0x100000UL) /*!< RT2_SET (Bitfield-Mask: 0x01) */ +/* ====================================================== CAPCON_CLR ======================================================= */ +#define MCPWM_CAPCON_CLR_CAP0MCI0_RE_CLR_Pos (0UL) /*!< CAP0MCI0_RE_CLR (Bit 0) */ +#define MCPWM_CAPCON_CLR_CAP0MCI0_RE_CLR_Msk (0x1UL) /*!< CAP0MCI0_RE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CLR_CAP0MCI0_FE_CLR_Pos (1UL) /*!< CAP0MCI0_FE_CLR (Bit 1) */ +#define MCPWM_CAPCON_CLR_CAP0MCI0_FE_CLR_Msk (0x2UL) /*!< CAP0MCI0_FE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CLR_CAP0MCI1_RE_CLR_Pos (2UL) /*!< CAP0MCI1_RE_CLR (Bit 2) */ +#define MCPWM_CAPCON_CLR_CAP0MCI1_RE_CLR_Msk (0x4UL) /*!< CAP0MCI1_RE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CLR_CAP0MCI1_FE_CLR_Pos (3UL) /*!< CAP0MCI1_FE_CLR (Bit 3) */ +#define MCPWM_CAPCON_CLR_CAP0MCI1_FE_CLR_Msk (0x8UL) /*!< CAP0MCI1_FE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CLR_CAP0MCI2_RE_CLR_Pos (4UL) /*!< CAP0MCI2_RE_CLR (Bit 4) */ +#define MCPWM_CAPCON_CLR_CAP0MCI2_RE_CLR_Msk (0x10UL) /*!< CAP0MCI2_RE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CLR_CAP0MCI2_FE_CLR_Pos (5UL) /*!< CAP0MCI2_FE_CLR (Bit 5) */ +#define MCPWM_CAPCON_CLR_CAP0MCI2_FE_CLR_Msk (0x20UL) /*!< CAP0MCI2_FE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CLR_CAP1MCI0_RE_CLR_Pos (6UL) /*!< CAP1MCI0_RE_CLR (Bit 6) */ +#define MCPWM_CAPCON_CLR_CAP1MCI0_RE_CLR_Msk (0x40UL) /*!< CAP1MCI0_RE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CLR_CAP1MCI0_FE_CLR_Pos (7UL) /*!< CAP1MCI0_FE_CLR (Bit 7) */ +#define MCPWM_CAPCON_CLR_CAP1MCI0_FE_CLR_Msk (0x80UL) /*!< CAP1MCI0_FE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CLR_CAP1MCI1_RE_CLR_Pos (8UL) /*!< CAP1MCI1_RE_CLR (Bit 8) */ +#define MCPWM_CAPCON_CLR_CAP1MCI1_RE_CLR_Msk (0x100UL) /*!< CAP1MCI1_RE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CLR_CAP1MCI1_FE_CLR_Pos (9UL) /*!< CAP1MCI1_FE_CLR (Bit 9) */ +#define MCPWM_CAPCON_CLR_CAP1MCI1_FE_CLR_Msk (0x200UL) /*!< CAP1MCI1_FE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CLR_CAP1MCI2_RE_CLR_Pos (10UL) /*!< CAP1MCI2_RE_CLR (Bit 10) */ +#define MCPWM_CAPCON_CLR_CAP1MCI2_RE_CLR_Msk (0x400UL) /*!< CAP1MCI2_RE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CLR_CAP1MCI2_FE_CLR_Pos (11UL) /*!< CAP1MCI2_FE_CLR (Bit 11) */ +#define MCPWM_CAPCON_CLR_CAP1MCI2_FE_CLR_Msk (0x800UL) /*!< CAP1MCI2_FE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CLR_CAP2MCI0_RE_CLR_Pos (12UL) /*!< CAP2MCI0_RE_CLR (Bit 12) */ +#define MCPWM_CAPCON_CLR_CAP2MCI0_RE_CLR_Msk (0x1000UL) /*!< CAP2MCI0_RE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CLR_CAP2MCI0_FE_CLR_Pos (13UL) /*!< CAP2MCI0_FE_CLR (Bit 13) */ +#define MCPWM_CAPCON_CLR_CAP2MCI0_FE_CLR_Msk (0x2000UL) /*!< CAP2MCI0_FE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CLR_CAP2MCI1_RE_CLR_Pos (14UL) /*!< CAP2MCI1_RE_CLR (Bit 14) */ +#define MCPWM_CAPCON_CLR_CAP2MCI1_RE_CLR_Msk (0x4000UL) /*!< CAP2MCI1_RE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CLR_CAP2MCI1_FE_CLR_Pos (15UL) /*!< CAP2MCI1_FE_CLR (Bit 15) */ +#define MCPWM_CAPCON_CLR_CAP2MCI1_FE_CLR_Msk (0x8000UL) /*!< CAP2MCI1_FE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CLR_CAP2MCI2_RE_CLR_Pos (16UL) /*!< CAP2MCI2_RE_CLR (Bit 16) */ +#define MCPWM_CAPCON_CLR_CAP2MCI2_RE_CLR_Msk (0x10000UL) /*!< CAP2MCI2_RE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CLR_CAP2MCI2_FE_CLR_Pos (17UL) /*!< CAP2MCI2_FE_CLR (Bit 17) */ +#define MCPWM_CAPCON_CLR_CAP2MCI2_FE_CLR_Msk (0x20000UL) /*!< CAP2MCI2_FE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CLR_RT0_CLR_Pos (18UL) /*!< RT0_CLR (Bit 18) */ +#define MCPWM_CAPCON_CLR_RT0_CLR_Msk (0x40000UL) /*!< RT0_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CLR_RT1_CLR_Pos (19UL) /*!< RT1_CLR (Bit 19) */ +#define MCPWM_CAPCON_CLR_RT1_CLR_Msk (0x80000UL) /*!< RT1_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CAPCON_CLR_RT2_CLR_Pos (20UL) /*!< RT2_CLR (Bit 20) */ +#define MCPWM_CAPCON_CLR_RT2_CLR_Msk (0x100000UL) /*!< RT2_CLR (Bitfield-Mask: 0x01) */ +/* ========================================================== DT =========================================================== */ +#define MCPWM_DT_DT0_Pos (0UL) /*!< DT0 (Bit 0) */ +#define MCPWM_DT_DT0_Msk (0x3ffUL) /*!< DT0 (Bitfield-Mask: 0x3ff) */ +#define MCPWM_DT_DT1_Pos (10UL) /*!< DT1 (Bit 10) */ +#define MCPWM_DT_DT1_Msk (0xffc00UL) /*!< DT1 (Bitfield-Mask: 0x3ff) */ +#define MCPWM_DT_DT2_Pos (20UL) /*!< DT2 (Bit 20) */ +#define MCPWM_DT_DT2_Msk (0x3ff00000UL) /*!< DT2 (Bitfield-Mask: 0x3ff) */ +/* ========================================================== CP =========================================================== */ +#define MCPWM_CP_CCPA0_Pos (0UL) /*!< CCPA0 (Bit 0) */ +#define MCPWM_CP_CCPA0_Msk (0x1UL) /*!< CCPA0 (Bitfield-Mask: 0x01) */ +#define MCPWM_CP_CCPB0_Pos (1UL) /*!< CCPB0 (Bit 1) */ +#define MCPWM_CP_CCPB0_Msk (0x2UL) /*!< CCPB0 (Bitfield-Mask: 0x01) */ +#define MCPWM_CP_CCPA1_Pos (2UL) /*!< CCPA1 (Bit 2) */ +#define MCPWM_CP_CCPA1_Msk (0x4UL) /*!< CCPA1 (Bitfield-Mask: 0x01) */ +#define MCPWM_CP_CCPB1_Pos (3UL) /*!< CCPB1 (Bit 3) */ +#define MCPWM_CP_CCPB1_Msk (0x8UL) /*!< CCPB1 (Bitfield-Mask: 0x01) */ +#define MCPWM_CP_CCPA2_Pos (4UL) /*!< CCPA2 (Bit 4) */ +#define MCPWM_CP_CCPA2_Msk (0x10UL) /*!< CCPA2 (Bitfield-Mask: 0x01) */ +#define MCPWM_CP_CCPB2_Pos (5UL) /*!< CCPB2 (Bit 5) */ +#define MCPWM_CP_CCPB2_Msk (0x20UL) /*!< CCPB2 (Bitfield-Mask: 0x01) */ +/* ========================================================= INTEN ========================================================= */ +#define MCPWM_INTEN_ILIM0_Pos (0UL) /*!< ILIM0 (Bit 0) */ +#define MCPWM_INTEN_ILIM0_Msk (0x1UL) /*!< ILIM0 (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_IMAT0_Pos (1UL) /*!< IMAT0 (Bit 1) */ +#define MCPWM_INTEN_IMAT0_Msk (0x2UL) /*!< IMAT0 (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_ICAP0_Pos (2UL) /*!< ICAP0 (Bit 2) */ +#define MCPWM_INTEN_ICAP0_Msk (0x4UL) /*!< ICAP0 (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_ILIM1_Pos (4UL) /*!< ILIM1 (Bit 4) */ +#define MCPWM_INTEN_ILIM1_Msk (0x10UL) /*!< ILIM1 (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_IMAT1_Pos (5UL) /*!< IMAT1 (Bit 5) */ +#define MCPWM_INTEN_IMAT1_Msk (0x20UL) /*!< IMAT1 (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_ICAP1_Pos (6UL) /*!< ICAP1 (Bit 6) */ +#define MCPWM_INTEN_ICAP1_Msk (0x40UL) /*!< ICAP1 (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_ILIM2_Pos (8UL) /*!< ILIM2 (Bit 8) */ +#define MCPWM_INTEN_ILIM2_Msk (0x100UL) /*!< ILIM2 (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_IMAT2_Pos (9UL) /*!< IMAT2 (Bit 9) */ +#define MCPWM_INTEN_IMAT2_Msk (0x200UL) /*!< IMAT2 (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_ICAP2_Pos (10UL) /*!< ICAP2 (Bit 10) */ +#define MCPWM_INTEN_ICAP2_Msk (0x400UL) /*!< ICAP2 (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_ABORT_Pos (15UL) /*!< ABORT (Bit 15) */ +#define MCPWM_INTEN_ABORT_Msk (0x8000UL) /*!< ABORT (Bitfield-Mask: 0x01) */ +/* ======================================================= INTEN_SET ======================================================= */ +#define MCPWM_INTEN_SET_ILIM0_SET_Pos (0UL) /*!< ILIM0_SET (Bit 0) */ +#define MCPWM_INTEN_SET_ILIM0_SET_Msk (0x1UL) /*!< ILIM0_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_SET_IMAT0_SET_Pos (1UL) /*!< IMAT0_SET (Bit 1) */ +#define MCPWM_INTEN_SET_IMAT0_SET_Msk (0x2UL) /*!< IMAT0_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_SET_ICAP0_SET_Pos (2UL) /*!< ICAP0_SET (Bit 2) */ +#define MCPWM_INTEN_SET_ICAP0_SET_Msk (0x4UL) /*!< ICAP0_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_SET_ILIM1_SET_Pos (4UL) /*!< ILIM1_SET (Bit 4) */ +#define MCPWM_INTEN_SET_ILIM1_SET_Msk (0x10UL) /*!< ILIM1_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_SET_IMAT1_SET_Pos (5UL) /*!< IMAT1_SET (Bit 5) */ +#define MCPWM_INTEN_SET_IMAT1_SET_Msk (0x20UL) /*!< IMAT1_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_SET_ICAP1_SET_Pos (6UL) /*!< ICAP1_SET (Bit 6) */ +#define MCPWM_INTEN_SET_ICAP1_SET_Msk (0x40UL) /*!< ICAP1_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_SET_ILIM2_SET_Pos (9UL) /*!< ILIM2_SET (Bit 9) */ +#define MCPWM_INTEN_SET_ILIM2_SET_Msk (0x200UL) /*!< ILIM2_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_SET_IMAT2_SET_Pos (10UL) /*!< IMAT2_SET (Bit 10) */ +#define MCPWM_INTEN_SET_IMAT2_SET_Msk (0x400UL) /*!< IMAT2_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_SET_ICAP2_SET_Pos (11UL) /*!< ICAP2_SET (Bit 11) */ +#define MCPWM_INTEN_SET_ICAP2_SET_Msk (0x800UL) /*!< ICAP2_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_SET_ABORT_SET_Pos (15UL) /*!< ABORT_SET (Bit 15) */ +#define MCPWM_INTEN_SET_ABORT_SET_Msk (0x8000UL) /*!< ABORT_SET (Bitfield-Mask: 0x01) */ +/* ======================================================= INTEN_CLR ======================================================= */ +#define MCPWM_INTEN_CLR_ILIM0_CLR_Pos (0UL) /*!< ILIM0_CLR (Bit 0) */ +#define MCPWM_INTEN_CLR_ILIM0_CLR_Msk (0x1UL) /*!< ILIM0_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_CLR_IMAT0_CLR_Pos (1UL) /*!< IMAT0_CLR (Bit 1) */ +#define MCPWM_INTEN_CLR_IMAT0_CLR_Msk (0x2UL) /*!< IMAT0_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_CLR_ICAP0_CLR_Pos (2UL) /*!< ICAP0_CLR (Bit 2) */ +#define MCPWM_INTEN_CLR_ICAP0_CLR_Msk (0x4UL) /*!< ICAP0_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_CLR_ILIM1_CLR_Pos (4UL) /*!< ILIM1_CLR (Bit 4) */ +#define MCPWM_INTEN_CLR_ILIM1_CLR_Msk (0x10UL) /*!< ILIM1_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_CLR_IMAT1_CLR_Pos (5UL) /*!< IMAT1_CLR (Bit 5) */ +#define MCPWM_INTEN_CLR_IMAT1_CLR_Msk (0x20UL) /*!< IMAT1_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_CLR_ICAP1_CLR_Pos (6UL) /*!< ICAP1_CLR (Bit 6) */ +#define MCPWM_INTEN_CLR_ICAP1_CLR_Msk (0x40UL) /*!< ICAP1_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_CLR_ILIM2_CLR_Pos (8UL) /*!< ILIM2_CLR (Bit 8) */ +#define MCPWM_INTEN_CLR_ILIM2_CLR_Msk (0x100UL) /*!< ILIM2_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_CLR_IMAT2_CLR_Pos (9UL) /*!< IMAT2_CLR (Bit 9) */ +#define MCPWM_INTEN_CLR_IMAT2_CLR_Msk (0x200UL) /*!< IMAT2_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_CLR_ICAP2_CLR_Pos (10UL) /*!< ICAP2_CLR (Bit 10) */ +#define MCPWM_INTEN_CLR_ICAP2_CLR_Msk (0x400UL) /*!< ICAP2_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_INTEN_CLR_ABORT_CLR_Pos (15UL) /*!< ABORT_CLR (Bit 15) */ +#define MCPWM_INTEN_CLR_ABORT_CLR_Msk (0x8000UL) /*!< ABORT_CLR (Bitfield-Mask: 0x01) */ +/* ========================================================= INTF ========================================================== */ +#define MCPWM_INTF_ILIM0_F_Pos (0UL) /*!< ILIM0_F (Bit 0) */ +#define MCPWM_INTF_ILIM0_F_Msk (0x1UL) /*!< ILIM0_F (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_IMAT0_F_Pos (1UL) /*!< IMAT0_F (Bit 1) */ +#define MCPWM_INTF_IMAT0_F_Msk (0x2UL) /*!< IMAT0_F (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_ICAP0_F_Pos (2UL) /*!< ICAP0_F (Bit 2) */ +#define MCPWM_INTF_ICAP0_F_Msk (0x4UL) /*!< ICAP0_F (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_ILIM1_F_Pos (4UL) /*!< ILIM1_F (Bit 4) */ +#define MCPWM_INTF_ILIM1_F_Msk (0x10UL) /*!< ILIM1_F (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_IMAT1_F_Pos (5UL) /*!< IMAT1_F (Bit 5) */ +#define MCPWM_INTF_IMAT1_F_Msk (0x20UL) /*!< IMAT1_F (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_ICAP1_F_Pos (6UL) /*!< ICAP1_F (Bit 6) */ +#define MCPWM_INTF_ICAP1_F_Msk (0x40UL) /*!< ICAP1_F (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_ILIM2_F_Pos (8UL) /*!< ILIM2_F (Bit 8) */ +#define MCPWM_INTF_ILIM2_F_Msk (0x100UL) /*!< ILIM2_F (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_IMAT2_F_Pos (9UL) /*!< IMAT2_F (Bit 9) */ +#define MCPWM_INTF_IMAT2_F_Msk (0x200UL) /*!< IMAT2_F (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_ICAP2_F_Pos (10UL) /*!< ICAP2_F (Bit 10) */ +#define MCPWM_INTF_ICAP2_F_Msk (0x400UL) /*!< ICAP2_F (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_ABORT_F_Pos (15UL) /*!< ABORT_F (Bit 15) */ +#define MCPWM_INTF_ABORT_F_Msk (0x8000UL) /*!< ABORT_F (Bitfield-Mask: 0x01) */ +/* ======================================================= INTF_SET ======================================================== */ +#define MCPWM_INTF_SET_ILIM0_F_SET_Pos (0UL) /*!< ILIM0_F_SET (Bit 0) */ +#define MCPWM_INTF_SET_ILIM0_F_SET_Msk (0x1UL) /*!< ILIM0_F_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_SET_IMAT0_F_SET_Pos (1UL) /*!< IMAT0_F_SET (Bit 1) */ +#define MCPWM_INTF_SET_IMAT0_F_SET_Msk (0x2UL) /*!< IMAT0_F_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_SET_ICAP0_F_SET_Pos (2UL) /*!< ICAP0_F_SET (Bit 2) */ +#define MCPWM_INTF_SET_ICAP0_F_SET_Msk (0x4UL) /*!< ICAP0_F_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_SET_ILIM1_F_SET_Pos (4UL) /*!< ILIM1_F_SET (Bit 4) */ +#define MCPWM_INTF_SET_ILIM1_F_SET_Msk (0x10UL) /*!< ILIM1_F_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_SET_IMAT1_F_SET_Pos (5UL) /*!< IMAT1_F_SET (Bit 5) */ +#define MCPWM_INTF_SET_IMAT1_F_SET_Msk (0x20UL) /*!< IMAT1_F_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_SET_ICAP1_F_SET_Pos (6UL) /*!< ICAP1_F_SET (Bit 6) */ +#define MCPWM_INTF_SET_ICAP1_F_SET_Msk (0x40UL) /*!< ICAP1_F_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_SET_ILIM2_F_SET_Pos (8UL) /*!< ILIM2_F_SET (Bit 8) */ +#define MCPWM_INTF_SET_ILIM2_F_SET_Msk (0x100UL) /*!< ILIM2_F_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_SET_IMAT2_F_SET_Pos (9UL) /*!< IMAT2_F_SET (Bit 9) */ +#define MCPWM_INTF_SET_IMAT2_F_SET_Msk (0x200UL) /*!< IMAT2_F_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_SET_ICAP2_F_SET_Pos (10UL) /*!< ICAP2_F_SET (Bit 10) */ +#define MCPWM_INTF_SET_ICAP2_F_SET_Msk (0x400UL) /*!< ICAP2_F_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_SET_ABORT_F_SET_Pos (15UL) /*!< ABORT_F_SET (Bit 15) */ +#define MCPWM_INTF_SET_ABORT_F_SET_Msk (0x8000UL) /*!< ABORT_F_SET (Bitfield-Mask: 0x01) */ +/* ======================================================= INTF_CLR ======================================================== */ +#define MCPWM_INTF_CLR_ILIM0_F_CLR_Pos (0UL) /*!< ILIM0_F_CLR (Bit 0) */ +#define MCPWM_INTF_CLR_ILIM0_F_CLR_Msk (0x1UL) /*!< ILIM0_F_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_CLR_IMAT0_F_CLR_Pos (1UL) /*!< IMAT0_F_CLR (Bit 1) */ +#define MCPWM_INTF_CLR_IMAT0_F_CLR_Msk (0x2UL) /*!< IMAT0_F_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_CLR_ICAP0_F_CLR_Pos (2UL) /*!< ICAP0_F_CLR (Bit 2) */ +#define MCPWM_INTF_CLR_ICAP0_F_CLR_Msk (0x4UL) /*!< ICAP0_F_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_CLR_ILIM1_F_CLR_Pos (4UL) /*!< ILIM1_F_CLR (Bit 4) */ +#define MCPWM_INTF_CLR_ILIM1_F_CLR_Msk (0x10UL) /*!< ILIM1_F_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_CLR_IMAT1_F_CLR_Pos (5UL) /*!< IMAT1_F_CLR (Bit 5) */ +#define MCPWM_INTF_CLR_IMAT1_F_CLR_Msk (0x20UL) /*!< IMAT1_F_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_CLR_ICAP1_F_CLR_Pos (6UL) /*!< ICAP1_F_CLR (Bit 6) */ +#define MCPWM_INTF_CLR_ICAP1_F_CLR_Msk (0x40UL) /*!< ICAP1_F_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_CLR_ILIM2_F_CLR_Pos (8UL) /*!< ILIM2_F_CLR (Bit 8) */ +#define MCPWM_INTF_CLR_ILIM2_F_CLR_Msk (0x100UL) /*!< ILIM2_F_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_CLR_IMAT2_F_CLR_Pos (9UL) /*!< IMAT2_F_CLR (Bit 9) */ +#define MCPWM_INTF_CLR_IMAT2_F_CLR_Msk (0x200UL) /*!< IMAT2_F_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_CLR_ICAP2_F_CLR_Pos (10UL) /*!< ICAP2_F_CLR (Bit 10) */ +#define MCPWM_INTF_CLR_ICAP2_F_CLR_Msk (0x400UL) /*!< ICAP2_F_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_INTF_CLR_ABORT_F_CLR_Pos (15UL) /*!< ABORT_F_CLR (Bit 15) */ +#define MCPWM_INTF_CLR_ABORT_F_CLR_Msk (0x8000UL) /*!< ABORT_F_CLR (Bitfield-Mask: 0x01) */ +/* ======================================================== CNTCON ========================================================= */ +#define MCPWM_CNTCON_TC0MCI0_RE_Pos (0UL) /*!< TC0MCI0_RE (Bit 0) */ +#define MCPWM_CNTCON_TC0MCI0_RE_Msk (0x1UL) /*!< TC0MCI0_RE (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_TC0MCI0_FE_Pos (1UL) /*!< TC0MCI0_FE (Bit 1) */ +#define MCPWM_CNTCON_TC0MCI0_FE_Msk (0x2UL) /*!< TC0MCI0_FE (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_TC0MCI1_RE_Pos (2UL) /*!< TC0MCI1_RE (Bit 2) */ +#define MCPWM_CNTCON_TC0MCI1_RE_Msk (0x4UL) /*!< TC0MCI1_RE (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_TC0MCI1_FE_Pos (3UL) /*!< TC0MCI1_FE (Bit 3) */ +#define MCPWM_CNTCON_TC0MCI1_FE_Msk (0x8UL) /*!< TC0MCI1_FE (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_TC0MCI2_RE_Pos (4UL) /*!< TC0MCI2_RE (Bit 4) */ +#define MCPWM_CNTCON_TC0MCI2_RE_Msk (0x10UL) /*!< TC0MCI2_RE (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_TC0MCI2_FE_Pos (5UL) /*!< TC0MCI2_FE (Bit 5) */ +#define MCPWM_CNTCON_TC0MCI2_FE_Msk (0x20UL) /*!< TC0MCI2_FE (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_TC1MCI0_RE_Pos (6UL) /*!< TC1MCI0_RE (Bit 6) */ +#define MCPWM_CNTCON_TC1MCI0_RE_Msk (0x40UL) /*!< TC1MCI0_RE (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_TC1MCI0_FE_Pos (7UL) /*!< TC1MCI0_FE (Bit 7) */ +#define MCPWM_CNTCON_TC1MCI0_FE_Msk (0x80UL) /*!< TC1MCI0_FE (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_TC1MCI1_RE_Pos (8UL) /*!< TC1MCI1_RE (Bit 8) */ +#define MCPWM_CNTCON_TC1MCI1_RE_Msk (0x100UL) /*!< TC1MCI1_RE (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_TC1MCI1_FE_Pos (9UL) /*!< TC1MCI1_FE (Bit 9) */ +#define MCPWM_CNTCON_TC1MCI1_FE_Msk (0x200UL) /*!< TC1MCI1_FE (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_TC1MCI2_RE_Pos (10UL) /*!< TC1MCI2_RE (Bit 10) */ +#define MCPWM_CNTCON_TC1MCI2_RE_Msk (0x400UL) /*!< TC1MCI2_RE (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_TC1MCI2_FE_Pos (11UL) /*!< TC1MCI2_FE (Bit 11) */ +#define MCPWM_CNTCON_TC1MCI2_FE_Msk (0x800UL) /*!< TC1MCI2_FE (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_TC2MCI0_RE_Pos (12UL) /*!< TC2MCI0_RE (Bit 12) */ +#define MCPWM_CNTCON_TC2MCI0_RE_Msk (0x1000UL) /*!< TC2MCI0_RE (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_TC2MCI0_FE_Pos (13UL) /*!< TC2MCI0_FE (Bit 13) */ +#define MCPWM_CNTCON_TC2MCI0_FE_Msk (0x2000UL) /*!< TC2MCI0_FE (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_TC2MCI1_RE_Pos (14UL) /*!< TC2MCI1_RE (Bit 14) */ +#define MCPWM_CNTCON_TC2MCI1_RE_Msk (0x4000UL) /*!< TC2MCI1_RE (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_TC2MCI1_FE_Pos (15UL) /*!< TC2MCI1_FE (Bit 15) */ +#define MCPWM_CNTCON_TC2MCI1_FE_Msk (0x8000UL) /*!< TC2MCI1_FE (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_TC2MCI2_RE_Pos (16UL) /*!< TC2MCI2_RE (Bit 16) */ +#define MCPWM_CNTCON_TC2MCI2_RE_Msk (0x10000UL) /*!< TC2MCI2_RE (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_TC2MCI2_FE_Pos (17UL) /*!< TC2MCI2_FE (Bit 17) */ +#define MCPWM_CNTCON_TC2MCI2_FE_Msk (0x20000UL) /*!< TC2MCI2_FE (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_CNTR0_Pos (29UL) /*!< CNTR0 (Bit 29) */ +#define MCPWM_CNTCON_CNTR0_Msk (0x20000000UL) /*!< CNTR0 (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_CNTR1_Pos (30UL) /*!< CNTR1 (Bit 30) */ +#define MCPWM_CNTCON_CNTR1_Msk (0x40000000UL) /*!< CNTR1 (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_CNTR2_Pos (31UL) /*!< CNTR2 (Bit 31) */ +#define MCPWM_CNTCON_CNTR2_Msk (0x80000000UL) /*!< CNTR2 (Bitfield-Mask: 0x01) */ +/* ====================================================== CNTCON_SET ======================================================= */ +#define MCPWM_CNTCON_SET_TC0MCI0_RE_SET_Pos (0UL) /*!< TC0MCI0_RE_SET (Bit 0) */ +#define MCPWM_CNTCON_SET_TC0MCI0_RE_SET_Msk (0x1UL) /*!< TC0MCI0_RE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_SET_TC0MCI0_FE_SET_Pos (1UL) /*!< TC0MCI0_FE_SET (Bit 1) */ +#define MCPWM_CNTCON_SET_TC0MCI0_FE_SET_Msk (0x2UL) /*!< TC0MCI0_FE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_SET_TC0MCI1_RE_SET_Pos (2UL) /*!< TC0MCI1_RE_SET (Bit 2) */ +#define MCPWM_CNTCON_SET_TC0MCI1_RE_SET_Msk (0x4UL) /*!< TC0MCI1_RE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_SET_TC0MCI1_FE_SET_Pos (3UL) /*!< TC0MCI1_FE_SET (Bit 3) */ +#define MCPWM_CNTCON_SET_TC0MCI1_FE_SET_Msk (0x8UL) /*!< TC0MCI1_FE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_SET_TC0MCI2_RE_SET_Pos (4UL) /*!< TC0MCI2_RE_SET (Bit 4) */ +#define MCPWM_CNTCON_SET_TC0MCI2_RE_SET_Msk (0x10UL) /*!< TC0MCI2_RE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_SET_TC0MCI2_FE_SET_Pos (5UL) /*!< TC0MCI2_FE_SET (Bit 5) */ +#define MCPWM_CNTCON_SET_TC0MCI2_FE_SET_Msk (0x20UL) /*!< TC0MCI2_FE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_SET_TC1MCI0_RE_SET_Pos (6UL) /*!< TC1MCI0_RE_SET (Bit 6) */ +#define MCPWM_CNTCON_SET_TC1MCI0_RE_SET_Msk (0x40UL) /*!< TC1MCI0_RE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_SET_TC1MCI0_FE_SET_Pos (7UL) /*!< TC1MCI0_FE_SET (Bit 7) */ +#define MCPWM_CNTCON_SET_TC1MCI0_FE_SET_Msk (0x80UL) /*!< TC1MCI0_FE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_SET_TC1MCI1_RE_SET_Pos (8UL) /*!< TC1MCI1_RE_SET (Bit 8) */ +#define MCPWM_CNTCON_SET_TC1MCI1_RE_SET_Msk (0x100UL) /*!< TC1MCI1_RE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_SET_TC1MCI1_FE_SET_Pos (9UL) /*!< TC1MCI1_FE_SET (Bit 9) */ +#define MCPWM_CNTCON_SET_TC1MCI1_FE_SET_Msk (0x200UL) /*!< TC1MCI1_FE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_SET_TC1MCI2_RE_SET_Pos (10UL) /*!< TC1MCI2_RE_SET (Bit 10) */ +#define MCPWM_CNTCON_SET_TC1MCI2_RE_SET_Msk (0x400UL) /*!< TC1MCI2_RE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_SET_TC1MCI2_FE_SET_Pos (11UL) /*!< TC1MCI2_FE_SET (Bit 11) */ +#define MCPWM_CNTCON_SET_TC1MCI2_FE_SET_Msk (0x800UL) /*!< TC1MCI2_FE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_SET_TC2MCI0_RE_SET_Pos (12UL) /*!< TC2MCI0_RE_SET (Bit 12) */ +#define MCPWM_CNTCON_SET_TC2MCI0_RE_SET_Msk (0x1000UL) /*!< TC2MCI0_RE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_SET_TC2MCI0_FE_SET_Pos (13UL) /*!< TC2MCI0_FE_SET (Bit 13) */ +#define MCPWM_CNTCON_SET_TC2MCI0_FE_SET_Msk (0x2000UL) /*!< TC2MCI0_FE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_SET_TC2MCI1_RE_SET_Pos (14UL) /*!< TC2MCI1_RE_SET (Bit 14) */ +#define MCPWM_CNTCON_SET_TC2MCI1_RE_SET_Msk (0x4000UL) /*!< TC2MCI1_RE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_SET_TC2MCI1_FE_SET_Pos (15UL) /*!< TC2MCI1_FE_SET (Bit 15) */ +#define MCPWM_CNTCON_SET_TC2MCI1_FE_SET_Msk (0x8000UL) /*!< TC2MCI1_FE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_SET_TC2MCI2_RE_SET_Pos (16UL) /*!< TC2MCI2_RE_SET (Bit 16) */ +#define MCPWM_CNTCON_SET_TC2MCI2_RE_SET_Msk (0x10000UL) /*!< TC2MCI2_RE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_SET_TC2MCI2_FE_SET_Pos (17UL) /*!< TC2MCI2_FE_SET (Bit 17) */ +#define MCPWM_CNTCON_SET_TC2MCI2_FE_SET_Msk (0x20000UL) /*!< TC2MCI2_FE_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_SET_CNTR0_SET_Pos (29UL) /*!< CNTR0_SET (Bit 29) */ +#define MCPWM_CNTCON_SET_CNTR0_SET_Msk (0x20000000UL) /*!< CNTR0_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_SET_CNTR1_SET_Pos (30UL) /*!< CNTR1_SET (Bit 30) */ +#define MCPWM_CNTCON_SET_CNTR1_SET_Msk (0x40000000UL) /*!< CNTR1_SET (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_SET_CNTR2_SET_Pos (31UL) /*!< CNTR2_SET (Bit 31) */ +#define MCPWM_CNTCON_SET_CNTR2_SET_Msk (0x80000000UL) /*!< CNTR2_SET (Bitfield-Mask: 0x01) */ +/* ====================================================== CNTCON_CLR ======================================================= */ +#define MCPWM_CNTCON_CLR_TC0MCI0_RE_CLR_Pos (0UL) /*!< TC0MCI0_RE_CLR (Bit 0) */ +#define MCPWM_CNTCON_CLR_TC0MCI0_RE_CLR_Msk (0x1UL) /*!< TC0MCI0_RE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_CLR_TC0MCI0_FE_CLR_Pos (1UL) /*!< TC0MCI0_FE_CLR (Bit 1) */ +#define MCPWM_CNTCON_CLR_TC0MCI0_FE_CLR_Msk (0x2UL) /*!< TC0MCI0_FE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_CLR_TC0MCI1_RE_CLR_Pos (2UL) /*!< TC0MCI1_RE_CLR (Bit 2) */ +#define MCPWM_CNTCON_CLR_TC0MCI1_RE_CLR_Msk (0x4UL) /*!< TC0MCI1_RE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_CLR_TC0MCI1_FE_CLR_Pos (3UL) /*!< TC0MCI1_FE_CLR (Bit 3) */ +#define MCPWM_CNTCON_CLR_TC0MCI1_FE_CLR_Msk (0x8UL) /*!< TC0MCI1_FE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_CLR_TC0MCI2_RE_Pos (4UL) /*!< TC0MCI2_RE (Bit 4) */ +#define MCPWM_CNTCON_CLR_TC0MCI2_RE_Msk (0x10UL) /*!< TC0MCI2_RE (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_CLR_TC0MCI2_FE_CLR_Pos (5UL) /*!< TC0MCI2_FE_CLR (Bit 5) */ +#define MCPWM_CNTCON_CLR_TC0MCI2_FE_CLR_Msk (0x20UL) /*!< TC0MCI2_FE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_CLR_TC1MCI0_RE_CLR_Pos (6UL) /*!< TC1MCI0_RE_CLR (Bit 6) */ +#define MCPWM_CNTCON_CLR_TC1MCI0_RE_CLR_Msk (0x40UL) /*!< TC1MCI0_RE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_CLR_TC1MCI0_FE_CLR_Pos (7UL) /*!< TC1MCI0_FE_CLR (Bit 7) */ +#define MCPWM_CNTCON_CLR_TC1MCI0_FE_CLR_Msk (0x80UL) /*!< TC1MCI0_FE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_CLR_TC1MCI1_RE_CLR_Pos (8UL) /*!< TC1MCI1_RE_CLR (Bit 8) */ +#define MCPWM_CNTCON_CLR_TC1MCI1_RE_CLR_Msk (0x100UL) /*!< TC1MCI1_RE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_CLR_TC1MCI1_FE_CLR_Pos (9UL) /*!< TC1MCI1_FE_CLR (Bit 9) */ +#define MCPWM_CNTCON_CLR_TC1MCI1_FE_CLR_Msk (0x200UL) /*!< TC1MCI1_FE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_CLR_TC1MCI2_RE_CLR_Pos (10UL) /*!< TC1MCI2_RE_CLR (Bit 10) */ +#define MCPWM_CNTCON_CLR_TC1MCI2_RE_CLR_Msk (0x400UL) /*!< TC1MCI2_RE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_CLR_TC1MCI2_FE_CLR_Pos (11UL) /*!< TC1MCI2_FE_CLR (Bit 11) */ +#define MCPWM_CNTCON_CLR_TC1MCI2_FE_CLR_Msk (0x800UL) /*!< TC1MCI2_FE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_CLR_TC2MCI0_RE_CLR_Pos (12UL) /*!< TC2MCI0_RE_CLR (Bit 12) */ +#define MCPWM_CNTCON_CLR_TC2MCI0_RE_CLR_Msk (0x1000UL) /*!< TC2MCI0_RE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_CLR_TC2MCI0_FE_CLR_Pos (13UL) /*!< TC2MCI0_FE_CLR (Bit 13) */ +#define MCPWM_CNTCON_CLR_TC2MCI0_FE_CLR_Msk (0x2000UL) /*!< TC2MCI0_FE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_CLR_TC2MCI1_RE_CLR_Pos (14UL) /*!< TC2MCI1_RE_CLR (Bit 14) */ +#define MCPWM_CNTCON_CLR_TC2MCI1_RE_CLR_Msk (0x4000UL) /*!< TC2MCI1_RE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_CLR_TC2MCI1_FE_CLR_Pos (15UL) /*!< TC2MCI1_FE_CLR (Bit 15) */ +#define MCPWM_CNTCON_CLR_TC2MCI1_FE_CLR_Msk (0x8000UL) /*!< TC2MCI1_FE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_CLR_TC2MCI2_RE_CLR_Pos (16UL) /*!< TC2MCI2_RE_CLR (Bit 16) */ +#define MCPWM_CNTCON_CLR_TC2MCI2_RE_CLR_Msk (0x10000UL) /*!< TC2MCI2_RE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_CLR_TC2MCI2_FE_CLR_Pos (17UL) /*!< TC2MCI2_FE_CLR (Bit 17) */ +#define MCPWM_CNTCON_CLR_TC2MCI2_FE_CLR_Msk (0x20000UL) /*!< TC2MCI2_FE_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_CLR_CNTR0_CLR_Pos (29UL) /*!< CNTR0_CLR (Bit 29) */ +#define MCPWM_CNTCON_CLR_CNTR0_CLR_Msk (0x20000000UL) /*!< CNTR0_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_CLR_CNTR1_CLR_Pos (30UL) /*!< CNTR1_CLR (Bit 30) */ +#define MCPWM_CNTCON_CLR_CNTR1_CLR_Msk (0x40000000UL) /*!< CNTR1_CLR (Bitfield-Mask: 0x01) */ +#define MCPWM_CNTCON_CLR_CNTR2_CLR_Pos (31UL) /*!< CNTR2_CLR (Bit 31) */ +#define MCPWM_CNTCON_CLR_CNTR2_CLR_Msk (0x80000000UL) /*!< CNTR2_CLR (Bitfield-Mask: 0x01) */ +/* ======================================================== CAP_CLR ======================================================== */ +#define MCPWM_CAP_CLR_CAP_CLR0_Pos (0UL) /*!< CAP_CLR0 (Bit 0) */ +#define MCPWM_CAP_CLR_CAP_CLR0_Msk (0x1UL) /*!< CAP_CLR0 (Bitfield-Mask: 0x01) */ +#define MCPWM_CAP_CLR_CAP_CLR1_Pos (1UL) /*!< CAP_CLR1 (Bit 1) */ +#define MCPWM_CAP_CLR_CAP_CLR1_Msk (0x2UL) /*!< CAP_CLR1 (Bitfield-Mask: 0x01) */ +#define MCPWM_CAP_CLR_CAP_CLR2_Pos (2UL) /*!< CAP_CLR2 (Bit 2) */ +#define MCPWM_CAP_CLR_CAP_CLR2_Msk (0x4UL) /*!< CAP_CLR2 (Bitfield-Mask: 0x01) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_QEI ================ */ +/* =========================================================================================================================== */ + +/* ========================================================== CON ========================================================== */ +#define QEI_CON_RESP_Pos (0UL) /*!< RESP (Bit 0) */ +#define QEI_CON_RESP_Msk (0x1UL) /*!< RESP (Bitfield-Mask: 0x01) */ +#define QEI_CON_RESPI_Pos (1UL) /*!< RESPI (Bit 1) */ +#define QEI_CON_RESPI_Msk (0x2UL) /*!< RESPI (Bitfield-Mask: 0x01) */ +#define QEI_CON_RESV_Pos (2UL) /*!< RESV (Bit 2) */ +#define QEI_CON_RESV_Msk (0x4UL) /*!< RESV (Bitfield-Mask: 0x01) */ +#define QEI_CON_RESI_Pos (3UL) /*!< RESI (Bit 3) */ +#define QEI_CON_RESI_Msk (0x8UL) /*!< RESI (Bitfield-Mask: 0x01) */ +/* ========================================================= CONF ========================================================== */ +#define QEI_CONF_DIRINV_Pos (0UL) /*!< DIRINV (Bit 0) */ +#define QEI_CONF_DIRINV_Msk (0x1UL) /*!< DIRINV (Bitfield-Mask: 0x01) */ +#define QEI_CONF_SIGMODE_Pos (1UL) /*!< SIGMODE (Bit 1) */ +#define QEI_CONF_SIGMODE_Msk (0x2UL) /*!< SIGMODE (Bitfield-Mask: 0x01) */ +#define QEI_CONF_CAPMODE_Pos (2UL) /*!< CAPMODE (Bit 2) */ +#define QEI_CONF_CAPMODE_Msk (0x4UL) /*!< CAPMODE (Bitfield-Mask: 0x01) */ +#define QEI_CONF_INVINX_Pos (3UL) /*!< INVINX (Bit 3) */ +#define QEI_CONF_INVINX_Msk (0x8UL) /*!< INVINX (Bitfield-Mask: 0x01) */ +#define QEI_CONF_CRESPI_Pos (4UL) /*!< CRESPI (Bit 4) */ +#define QEI_CONF_CRESPI_Msk (0x10UL) /*!< CRESPI (Bitfield-Mask: 0x01) */ +#define QEI_CONF_INXGATE_Pos (16UL) /*!< INXGATE (Bit 16) */ +#define QEI_CONF_INXGATE_Msk (0xf0000UL) /*!< INXGATE (Bitfield-Mask: 0x0f) */ +/* ========================================================= STAT ========================================================== */ +#define QEI_STAT_DIR_Pos (0UL) /*!< DIR (Bit 0) */ +#define QEI_STAT_DIR_Msk (0x1UL) /*!< DIR (Bitfield-Mask: 0x01) */ +/* ========================================================== POS ========================================================== */ +#define QEI_POS_POS_Pos (0UL) /*!< POS (Bit 0) */ +#define QEI_POS_POS_Msk (0xffffffffUL) /*!< POS (Bitfield-Mask: 0xffffffff) */ +/* ======================================================== MAXPOS ========================================================= */ +#define QEI_MAXPOS_MAXPOS_Pos (0UL) /*!< MAXPOS (Bit 0) */ +#define QEI_MAXPOS_MAXPOS_Msk (0xffffffffUL) /*!< MAXPOS (Bitfield-Mask: 0xffffffff) */ +/* ======================================================== CMPOS0 ========================================================= */ +#define QEI_CMPOS0_PCMP0_Pos (0UL) /*!< PCMP0 (Bit 0) */ +#define QEI_CMPOS0_PCMP0_Msk (0xffffffffUL) /*!< PCMP0 (Bitfield-Mask: 0xffffffff) */ +/* ======================================================== CMPOS1 ========================================================= */ +#define QEI_CMPOS1_PCMP1_Pos (0UL) /*!< PCMP1 (Bit 0) */ +#define QEI_CMPOS1_PCMP1_Msk (0xffffffffUL) /*!< PCMP1 (Bitfield-Mask: 0xffffffff) */ +/* ======================================================== CMPOS2 ========================================================= */ +#define QEI_CMPOS2_PCMP2_Pos (0UL) /*!< PCMP2 (Bit 0) */ +#define QEI_CMPOS2_PCMP2_Msk (0xffffffffUL) /*!< PCMP2 (Bitfield-Mask: 0xffffffff) */ +/* ======================================================== INXCNT ========================================================= */ +#define QEI_INXCNT_ENCPOS_Pos (0UL) /*!< ENCPOS (Bit 0) */ +#define QEI_INXCNT_ENCPOS_Msk (0xffffffffUL) /*!< ENCPOS (Bitfield-Mask: 0xffffffff) */ +/* ======================================================== INXCMP0 ======================================================== */ +#define QEI_INXCMP0_ICMP0_Pos (0UL) /*!< ICMP0 (Bit 0) */ +#define QEI_INXCMP0_ICMP0_Msk (0xffffffffUL) /*!< ICMP0 (Bitfield-Mask: 0xffffffff) */ +/* ========================================================= LOAD ========================================================== */ +#define QEI_LOAD_VELLOAD_Pos (0UL) /*!< VELLOAD (Bit 0) */ +#define QEI_LOAD_VELLOAD_Msk (0xffffffffUL) /*!< VELLOAD (Bitfield-Mask: 0xffffffff) */ +/* ========================================================= TIME ========================================================== */ +#define QEI_TIME_VELVAL_Pos (0UL) /*!< VELVAL (Bit 0) */ +#define QEI_TIME_VELVAL_Msk (0xffffffffUL) /*!< VELVAL (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== VEL ========================================================== */ +#define QEI_VEL_VELPC_Pos (0UL) /*!< VELPC (Bit 0) */ +#define QEI_VEL_VELPC_Msk (0xffffffffUL) /*!< VELPC (Bitfield-Mask: 0xffffffff) */ +/* ========================================================== CAP ========================================================== */ +#define QEI_CAP_VELCAP_Pos (0UL) /*!< VELCAP (Bit 0) */ +#define QEI_CAP_VELCAP_Msk (0xffffffffUL) /*!< VELCAP (Bitfield-Mask: 0xffffffff) */ +/* ======================================================== VELCOMP ======================================================== */ +#define QEI_VELCOMP_VELPC_Pos (0UL) /*!< VELPC (Bit 0) */ +#define QEI_VELCOMP_VELPC_Msk (0xffffffffUL) /*!< VELPC (Bitfield-Mask: 0xffffffff) */ +/* ======================================================== FILTER ========================================================= */ +#define QEI_FILTER_FILTA_Pos (0UL) /*!< FILTA (Bit 0) */ +#define QEI_FILTER_FILTA_Msk (0xffffffffUL) /*!< FILTA (Bitfield-Mask: 0xffffffff) */ +/* ======================================================== INTSTAT ======================================================== */ +#define QEI_INTSTAT_INX_INT_Pos (0UL) /*!< INX_INT (Bit 0) */ +#define QEI_INTSTAT_INX_INT_Msk (0x1UL) /*!< INX_INT (Bitfield-Mask: 0x01) */ +#define QEI_INTSTAT_TIM_INT_Pos (1UL) /*!< TIM_INT (Bit 1) */ +#define QEI_INTSTAT_TIM_INT_Msk (0x2UL) /*!< TIM_INT (Bitfield-Mask: 0x01) */ +#define QEI_INTSTAT_VELC_INT_Pos (2UL) /*!< VELC_INT (Bit 2) */ +#define QEI_INTSTAT_VELC_INT_Msk (0x4UL) /*!< VELC_INT (Bitfield-Mask: 0x01) */ +#define QEI_INTSTAT_DIR_INT_Pos (3UL) /*!< DIR_INT (Bit 3) */ +#define QEI_INTSTAT_DIR_INT_Msk (0x8UL) /*!< DIR_INT (Bitfield-Mask: 0x01) */ +#define QEI_INTSTAT_ERR_INT_Pos (4UL) /*!< ERR_INT (Bit 4) */ +#define QEI_INTSTAT_ERR_INT_Msk (0x10UL) /*!< ERR_INT (Bitfield-Mask: 0x01) */ +#define QEI_INTSTAT_ENCLK_INT_Pos (5UL) /*!< ENCLK_INT (Bit 5) */ +#define QEI_INTSTAT_ENCLK_INT_Msk (0x20UL) /*!< ENCLK_INT (Bitfield-Mask: 0x01) */ +#define QEI_INTSTAT_POS0_INT_Pos (6UL) /*!< POS0_INT (Bit 6) */ +#define QEI_INTSTAT_POS0_INT_Msk (0x40UL) /*!< POS0_INT (Bitfield-Mask: 0x01) */ +#define QEI_INTSTAT_POS1_INT_Pos (7UL) /*!< POS1_INT (Bit 7) */ +#define QEI_INTSTAT_POS1_INT_Msk (0x80UL) /*!< POS1_INT (Bitfield-Mask: 0x01) */ +#define QEI_INTSTAT_POS2_INT_Pos (8UL) /*!< POS2_INT (Bit 8) */ +#define QEI_INTSTAT_POS2_INT_Msk (0x100UL) /*!< POS2_INT (Bitfield-Mask: 0x01) */ +#define QEI_INTSTAT_REV0_INT_Pos (9UL) /*!< REV0_INT (Bit 9) */ +#define QEI_INTSTAT_REV0_INT_Msk (0x200UL) /*!< REV0_INT (Bitfield-Mask: 0x01) */ +#define QEI_INTSTAT_POS0REV_INT_Pos (10UL) /*!< POS0REV_INT (Bit 10) */ +#define QEI_INTSTAT_POS0REV_INT_Msk (0x400UL) /*!< POS0REV_INT (Bitfield-Mask: 0x01) */ +#define QEI_INTSTAT_POS1REV_INT_Pos (11UL) /*!< POS1REV_INT (Bit 11) */ +#define QEI_INTSTAT_POS1REV_INT_Msk (0x800UL) /*!< POS1REV_INT (Bitfield-Mask: 0x01) */ +#define QEI_INTSTAT_POS2REV_INT_Pos (12UL) /*!< POS2REV_INT (Bit 12) */ +#define QEI_INTSTAT_POS2REV_INT_Msk (0x1000UL) /*!< POS2REV_INT (Bitfield-Mask: 0x01) */ +#define QEI_INTSTAT_REV1_INT_Pos (13UL) /*!< REV1_INT (Bit 13) */ +#define QEI_INTSTAT_REV1_INT_Msk (0x2000UL) /*!< REV1_INT (Bitfield-Mask: 0x01) */ +#define QEI_INTSTAT_REV2_INT_Pos (14UL) /*!< REV2_INT (Bit 14) */ +#define QEI_INTSTAT_REV2_INT_Msk (0x4000UL) /*!< REV2_INT (Bitfield-Mask: 0x01) */ +#define QEI_INTSTAT_MAXPOS_INT_Pos (15UL) /*!< MAXPOS_INT (Bit 15) */ +#define QEI_INTSTAT_MAXPOS_INT_Msk (0x8000UL) /*!< MAXPOS_INT (Bitfield-Mask: 0x01) */ +/* ========================================================== SET ========================================================== */ +#define QEI_SET_INX_INT_Pos (0UL) /*!< INX_INT (Bit 0) */ +#define QEI_SET_INX_INT_Msk (0x1UL) /*!< INX_INT (Bitfield-Mask: 0x01) */ +#define QEI_SET_TIM_INT_Pos (1UL) /*!< TIM_INT (Bit 1) */ +#define QEI_SET_TIM_INT_Msk (0x2UL) /*!< TIM_INT (Bitfield-Mask: 0x01) */ +#define QEI_SET_VELC_INT_Pos (2UL) /*!< VELC_INT (Bit 2) */ +#define QEI_SET_VELC_INT_Msk (0x4UL) /*!< VELC_INT (Bitfield-Mask: 0x01) */ +#define QEI_SET_DIR_INT_Pos (3UL) /*!< DIR_INT (Bit 3) */ +#define QEI_SET_DIR_INT_Msk (0x8UL) /*!< DIR_INT (Bitfield-Mask: 0x01) */ +#define QEI_SET_ERR_INT_Pos (4UL) /*!< ERR_INT (Bit 4) */ +#define QEI_SET_ERR_INT_Msk (0x10UL) /*!< ERR_INT (Bitfield-Mask: 0x01) */ +#define QEI_SET_ENCLK_INT_Pos (5UL) /*!< ENCLK_INT (Bit 5) */ +#define QEI_SET_ENCLK_INT_Msk (0x20UL) /*!< ENCLK_INT (Bitfield-Mask: 0x01) */ +#define QEI_SET_POS0_INT_Pos (6UL) /*!< POS0_INT (Bit 6) */ +#define QEI_SET_POS0_INT_Msk (0x40UL) /*!< POS0_INT (Bitfield-Mask: 0x01) */ +#define QEI_SET_POS1_INT_Pos (7UL) /*!< POS1_INT (Bit 7) */ +#define QEI_SET_POS1_INT_Msk (0x80UL) /*!< POS1_INT (Bitfield-Mask: 0x01) */ +#define QEI_SET_POS2_INT_Pos (8UL) /*!< POS2_INT (Bit 8) */ +#define QEI_SET_POS2_INT_Msk (0x100UL) /*!< POS2_INT (Bitfield-Mask: 0x01) */ +#define QEI_SET_REV0_INT_Pos (9UL) /*!< REV0_INT (Bit 9) */ +#define QEI_SET_REV0_INT_Msk (0x200UL) /*!< REV0_INT (Bitfield-Mask: 0x01) */ +#define QEI_SET_POS0REV_INT_Pos (10UL) /*!< POS0REV_INT (Bit 10) */ +#define QEI_SET_POS0REV_INT_Msk (0x400UL) /*!< POS0REV_INT (Bitfield-Mask: 0x01) */ +#define QEI_SET_POS1REV_INT_Pos (11UL) /*!< POS1REV_INT (Bit 11) */ +#define QEI_SET_POS1REV_INT_Msk (0x800UL) /*!< POS1REV_INT (Bitfield-Mask: 0x01) */ +#define QEI_SET_POS2REV_INT_Pos (12UL) /*!< POS2REV_INT (Bit 12) */ +#define QEI_SET_POS2REV_INT_Msk (0x1000UL) /*!< POS2REV_INT (Bitfield-Mask: 0x01) */ +#define QEI_SET_REV1_INT_Pos (13UL) /*!< REV1_INT (Bit 13) */ +#define QEI_SET_REV1_INT_Msk (0x2000UL) /*!< REV1_INT (Bitfield-Mask: 0x01) */ +#define QEI_SET_REV2_INT_Pos (14UL) /*!< REV2_INT (Bit 14) */ +#define QEI_SET_REV2_INT_Msk (0x4000UL) /*!< REV2_INT (Bitfield-Mask: 0x01) */ +#define QEI_SET_MAXPOS_INT_Pos (15UL) /*!< MAXPOS_INT (Bit 15) */ +#define QEI_SET_MAXPOS_INT_Msk (0x8000UL) /*!< MAXPOS_INT (Bitfield-Mask: 0x01) */ +/* ========================================================== CLR ========================================================== */ +#define QEI_CLR_INX_INT_Pos (0UL) /*!< INX_INT (Bit 0) */ +#define QEI_CLR_INX_INT_Msk (0x1UL) /*!< INX_INT (Bitfield-Mask: 0x01) */ +#define QEI_CLR_TIM_INT_Pos (1UL) /*!< TIM_INT (Bit 1) */ +#define QEI_CLR_TIM_INT_Msk (0x2UL) /*!< TIM_INT (Bitfield-Mask: 0x01) */ +#define QEI_CLR_VELC_INT_Pos (2UL) /*!< VELC_INT (Bit 2) */ +#define QEI_CLR_VELC_INT_Msk (0x4UL) /*!< VELC_INT (Bitfield-Mask: 0x01) */ +#define QEI_CLR_DIR_INT_Pos (3UL) /*!< DIR_INT (Bit 3) */ +#define QEI_CLR_DIR_INT_Msk (0x8UL) /*!< DIR_INT (Bitfield-Mask: 0x01) */ +#define QEI_CLR_ERR_INT_Pos (4UL) /*!< ERR_INT (Bit 4) */ +#define QEI_CLR_ERR_INT_Msk (0x10UL) /*!< ERR_INT (Bitfield-Mask: 0x01) */ +#define QEI_CLR_ENCLK_INT_Pos (5UL) /*!< ENCLK_INT (Bit 5) */ +#define QEI_CLR_ENCLK_INT_Msk (0x20UL) /*!< ENCLK_INT (Bitfield-Mask: 0x01) */ +#define QEI_CLR_POS0_INT_Pos (6UL) /*!< POS0_INT (Bit 6) */ +#define QEI_CLR_POS0_INT_Msk (0x40UL) /*!< POS0_INT (Bitfield-Mask: 0x01) */ +#define QEI_CLR_POS1_INT_Pos (7UL) /*!< POS1_INT (Bit 7) */ +#define QEI_CLR_POS1_INT_Msk (0x80UL) /*!< POS1_INT (Bitfield-Mask: 0x01) */ +#define QEI_CLR_POS2_INT_Pos (8UL) /*!< POS2_INT (Bit 8) */ +#define QEI_CLR_POS2_INT_Msk (0x100UL) /*!< POS2_INT (Bitfield-Mask: 0x01) */ +#define QEI_CLR_REV0_INT_Pos (9UL) /*!< REV0_INT (Bit 9) */ +#define QEI_CLR_REV0_INT_Msk (0x200UL) /*!< REV0_INT (Bitfield-Mask: 0x01) */ +#define QEI_CLR_POS0REV_INT_Pos (10UL) /*!< POS0REV_INT (Bit 10) */ +#define QEI_CLR_POS0REV_INT_Msk (0x400UL) /*!< POS0REV_INT (Bitfield-Mask: 0x01) */ +#define QEI_CLR_POS1REV_INT_Pos (11UL) /*!< POS1REV_INT (Bit 11) */ +#define QEI_CLR_POS1REV_INT_Msk (0x800UL) /*!< POS1REV_INT (Bitfield-Mask: 0x01) */ +#define QEI_CLR_POS2REV_INT_Pos (12UL) /*!< POS2REV_INT (Bit 12) */ +#define QEI_CLR_POS2REV_INT_Msk (0x1000UL) /*!< POS2REV_INT (Bitfield-Mask: 0x01) */ +#define QEI_CLR_REV1_INT_Pos (13UL) /*!< REV1_INT (Bit 13) */ +#define QEI_CLR_REV1_INT_Msk (0x2000UL) /*!< REV1_INT (Bitfield-Mask: 0x01) */ +#define QEI_CLR_REV2_INT_Pos (14UL) /*!< REV2_INT (Bit 14) */ +#define QEI_CLR_REV2_INT_Msk (0x4000UL) /*!< REV2_INT (Bitfield-Mask: 0x01) */ +#define QEI_CLR_MAXPOS_INT_Pos (15UL) /*!< MAXPOS_INT (Bit 15) */ +#define QEI_CLR_MAXPOS_INT_Msk (0x8000UL) /*!< MAXPOS_INT (Bitfield-Mask: 0x01) */ +/* ========================================================== IE =========================================================== */ +#define QEI_IE_INX_INT_Pos (0UL) /*!< INX_INT (Bit 0) */ +#define QEI_IE_INX_INT_Msk (0x1UL) /*!< INX_INT (Bitfield-Mask: 0x01) */ +#define QEI_IE_TIM_INT_Pos (1UL) /*!< TIM_INT (Bit 1) */ +#define QEI_IE_TIM_INT_Msk (0x2UL) /*!< TIM_INT (Bitfield-Mask: 0x01) */ +#define QEI_IE_VELC_INT_Pos (2UL) /*!< VELC_INT (Bit 2) */ +#define QEI_IE_VELC_INT_Msk (0x4UL) /*!< VELC_INT (Bitfield-Mask: 0x01) */ +#define QEI_IE_DIR_INT_Pos (3UL) /*!< DIR_INT (Bit 3) */ +#define QEI_IE_DIR_INT_Msk (0x8UL) /*!< DIR_INT (Bitfield-Mask: 0x01) */ +#define QEI_IE_ERR_INT_Pos (4UL) /*!< ERR_INT (Bit 4) */ +#define QEI_IE_ERR_INT_Msk (0x10UL) /*!< ERR_INT (Bitfield-Mask: 0x01) */ +#define QEI_IE_ENCLK_INT_Pos (5UL) /*!< ENCLK_INT (Bit 5) */ +#define QEI_IE_ENCLK_INT_Msk (0x20UL) /*!< ENCLK_INT (Bitfield-Mask: 0x01) */ +#define QEI_IE_POS0_INT_Pos (6UL) /*!< POS0_INT (Bit 6) */ +#define QEI_IE_POS0_INT_Msk (0x40UL) /*!< POS0_INT (Bitfield-Mask: 0x01) */ +#define QEI_IE_POS1_INT_Pos (7UL) /*!< POS1_INT (Bit 7) */ +#define QEI_IE_POS1_INT_Msk (0x80UL) /*!< POS1_INT (Bitfield-Mask: 0x01) */ +#define QEI_IE_POS2_INT_Pos (8UL) /*!< POS2_INT (Bit 8) */ +#define QEI_IE_POS2_INT_Msk (0x100UL) /*!< POS2_INT (Bitfield-Mask: 0x01) */ +#define QEI_IE_REV0_INT_Pos (9UL) /*!< REV0_INT (Bit 9) */ +#define QEI_IE_REV0_INT_Msk (0x200UL) /*!< REV0_INT (Bitfield-Mask: 0x01) */ +#define QEI_IE_POS0REV_INT_Pos (10UL) /*!< POS0REV_INT (Bit 10) */ +#define QEI_IE_POS0REV_INT_Msk (0x400UL) /*!< POS0REV_INT (Bitfield-Mask: 0x01) */ +#define QEI_IE_POS1REV_INT_Pos (11UL) /*!< POS1REV_INT (Bit 11) */ +#define QEI_IE_POS1REV_INT_Msk (0x800UL) /*!< POS1REV_INT (Bitfield-Mask: 0x01) */ +#define QEI_IE_POS2REV_INT_Pos (12UL) /*!< POS2REV_INT (Bit 12) */ +#define QEI_IE_POS2REV_INT_Msk (0x1000UL) /*!< POS2REV_INT (Bitfield-Mask: 0x01) */ +#define QEI_IE_REV1_INT_Pos (13UL) /*!< REV1_INT (Bit 13) */ +#define QEI_IE_REV1_INT_Msk (0x2000UL) /*!< REV1_INT (Bitfield-Mask: 0x01) */ +#define QEI_IE_REV2_INT_Pos (14UL) /*!< REV2_INT (Bit 14) */ +#define QEI_IE_REV2_INT_Msk (0x4000UL) /*!< REV2_INT (Bitfield-Mask: 0x01) */ +#define QEI_IE_MAXPOS_INT_Pos (15UL) /*!< MAXPOS_INT (Bit 15) */ +#define QEI_IE_MAXPOS_INT_Msk (0x8000UL) /*!< MAXPOS_INT (Bitfield-Mask: 0x01) */ +/* ========================================================== IES ========================================================== */ +#define QEI_IES_INX_INT_Pos (0UL) /*!< INX_INT (Bit 0) */ +#define QEI_IES_INX_INT_Msk (0x1UL) /*!< INX_INT (Bitfield-Mask: 0x01) */ +#define QEI_IES_TIM_INT_Pos (1UL) /*!< TIM_INT (Bit 1) */ +#define QEI_IES_TIM_INT_Msk (0x2UL) /*!< TIM_INT (Bitfield-Mask: 0x01) */ +#define QEI_IES_VELC_INT_Pos (2UL) /*!< VELC_INT (Bit 2) */ +#define QEI_IES_VELC_INT_Msk (0x4UL) /*!< VELC_INT (Bitfield-Mask: 0x01) */ +#define QEI_IES_DIR_INT_Pos (3UL) /*!< DIR_INT (Bit 3) */ +#define QEI_IES_DIR_INT_Msk (0x8UL) /*!< DIR_INT (Bitfield-Mask: 0x01) */ +#define QEI_IES_ERR_INT_Pos (4UL) /*!< ERR_INT (Bit 4) */ +#define QEI_IES_ERR_INT_Msk (0x10UL) /*!< ERR_INT (Bitfield-Mask: 0x01) */ +#define QEI_IES_ENCLK_INT_Pos (5UL) /*!< ENCLK_INT (Bit 5) */ +#define QEI_IES_ENCLK_INT_Msk (0x20UL) /*!< ENCLK_INT (Bitfield-Mask: 0x01) */ +#define QEI_IES_POS0_INT_Pos (6UL) /*!< POS0_INT (Bit 6) */ +#define QEI_IES_POS0_INT_Msk (0x40UL) /*!< POS0_INT (Bitfield-Mask: 0x01) */ +#define QEI_IES_POS1_INT_Pos (7UL) /*!< POS1_INT (Bit 7) */ +#define QEI_IES_POS1_INT_Msk (0x80UL) /*!< POS1_INT (Bitfield-Mask: 0x01) */ +#define QEI_IES_POS2_INT_Pos (8UL) /*!< POS2_INT (Bit 8) */ +#define QEI_IES_POS2_INT_Msk (0x100UL) /*!< POS2_INT (Bitfield-Mask: 0x01) */ +#define QEI_IES_REV0_INT_Pos (9UL) /*!< REV0_INT (Bit 9) */ +#define QEI_IES_REV0_INT_Msk (0x200UL) /*!< REV0_INT (Bitfield-Mask: 0x01) */ +#define QEI_IES_POS0REV_INT_Pos (10UL) /*!< POS0REV_INT (Bit 10) */ +#define QEI_IES_POS0REV_INT_Msk (0x400UL) /*!< POS0REV_INT (Bitfield-Mask: 0x01) */ +#define QEI_IES_POS1REV_INT_Pos (11UL) /*!< POS1REV_INT (Bit 11) */ +#define QEI_IES_POS1REV_INT_Msk (0x800UL) /*!< POS1REV_INT (Bitfield-Mask: 0x01) */ +#define QEI_IES_POS2REV_INT_Pos (12UL) /*!< POS2REV_INT (Bit 12) */ +#define QEI_IES_POS2REV_INT_Msk (0x1000UL) /*!< POS2REV_INT (Bitfield-Mask: 0x01) */ +#define QEI_IES_REV1_INT_Pos (13UL) /*!< REV1_INT (Bit 13) */ +#define QEI_IES_REV1_INT_Msk (0x2000UL) /*!< REV1_INT (Bitfield-Mask: 0x01) */ +#define QEI_IES_REV2_INT_Pos (14UL) /*!< REV2_INT (Bit 14) */ +#define QEI_IES_REV2_INT_Msk (0x4000UL) /*!< REV2_INT (Bitfield-Mask: 0x01) */ +#define QEI_IES_MAXPOS_INT_Pos (15UL) /*!< MAXPOS_INT (Bit 15) */ +#define QEI_IES_MAXPOS_INT_Msk (0x8000UL) /*!< MAXPOS_INT (Bitfield-Mask: 0x01) */ +/* ========================================================== IEC ========================================================== */ +#define QEI_IEC_INX_INT_Pos (0UL) /*!< INX_INT (Bit 0) */ +#define QEI_IEC_INX_INT_Msk (0x1UL) /*!< INX_INT (Bitfield-Mask: 0x01) */ +#define QEI_IEC_TIM_INT_Pos (1UL) /*!< TIM_INT (Bit 1) */ +#define QEI_IEC_TIM_INT_Msk (0x2UL) /*!< TIM_INT (Bitfield-Mask: 0x01) */ +#define QEI_IEC_VELC_INT_Pos (2UL) /*!< VELC_INT (Bit 2) */ +#define QEI_IEC_VELC_INT_Msk (0x4UL) /*!< VELC_INT (Bitfield-Mask: 0x01) */ +#define QEI_IEC_DIR_INT_Pos (3UL) /*!< DIR_INT (Bit 3) */ +#define QEI_IEC_DIR_INT_Msk (0x8UL) /*!< DIR_INT (Bitfield-Mask: 0x01) */ +#define QEI_IEC_ERR_INT_Pos (4UL) /*!< ERR_INT (Bit 4) */ +#define QEI_IEC_ERR_INT_Msk (0x10UL) /*!< ERR_INT (Bitfield-Mask: 0x01) */ +#define QEI_IEC_ENCLK_INT_Pos (5UL) /*!< ENCLK_INT (Bit 5) */ +#define QEI_IEC_ENCLK_INT_Msk (0x20UL) /*!< ENCLK_INT (Bitfield-Mask: 0x01) */ +#define QEI_IEC_POS0_INT_Pos (6UL) /*!< POS0_INT (Bit 6) */ +#define QEI_IEC_POS0_INT_Msk (0x40UL) /*!< POS0_INT (Bitfield-Mask: 0x01) */ +#define QEI_IEC_POS1_INT_Pos (7UL) /*!< POS1_INT (Bit 7) */ +#define QEI_IEC_POS1_INT_Msk (0x80UL) /*!< POS1_INT (Bitfield-Mask: 0x01) */ +#define QEI_IEC_POS2_INT_Pos (8UL) /*!< POS2_INT (Bit 8) */ +#define QEI_IEC_POS2_INT_Msk (0x100UL) /*!< POS2_INT (Bitfield-Mask: 0x01) */ +#define QEI_IEC_REV0_INT_Pos (9UL) /*!< REV0_INT (Bit 9) */ +#define QEI_IEC_REV0_INT_Msk (0x200UL) /*!< REV0_INT (Bitfield-Mask: 0x01) */ +#define QEI_IEC_POS0REV_INT_Pos (10UL) /*!< POS0REV_INT (Bit 10) */ +#define QEI_IEC_POS0REV_INT_Msk (0x400UL) /*!< POS0REV_INT (Bitfield-Mask: 0x01) */ +#define QEI_IEC_POS1REV_INT_Pos (11UL) /*!< POS1REV_INT (Bit 11) */ +#define QEI_IEC_POS1REV_INT_Msk (0x800UL) /*!< POS1REV_INT (Bitfield-Mask: 0x01) */ +#define QEI_IEC_POS2REV_INT_Pos (12UL) /*!< POS2REV_INT (Bit 12) */ +#define QEI_IEC_POS2REV_INT_Msk (0x1000UL) /*!< POS2REV_INT (Bitfield-Mask: 0x01) */ +#define QEI_IEC_REV1_INT_Pos (13UL) /*!< REV1_INT (Bit 13) */ +#define QEI_IEC_REV1_INT_Msk (0x2000UL) /*!< REV1_INT (Bitfield-Mask: 0x01) */ +#define QEI_IEC_REV2_INT_Pos (14UL) /*!< REV2_INT (Bit 14) */ +#define QEI_IEC_REV2_INT_Msk (0x4000UL) /*!< REV2_INT (Bitfield-Mask: 0x01) */ +#define QEI_IEC_MAXPOS_INT_Pos (15UL) /*!< MAXPOS_INT (Bit 15) */ +#define QEI_IEC_MAXPOS_INT_Msk (0x8000UL) /*!< MAXPOS_INT (Bitfield-Mask: 0x01) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_SYSCON ================ */ +/* =========================================================================================================================== */ + +/* ======================================================= FLASHCFG ======================================================== */ +#define SYSCON_FLASHCFG_FLASHTIM_Pos (12UL) /*!< FLASHTIM (Bit 12) */ +#define SYSCON_FLASHCFG_FLASHTIM_Msk (0xf000UL) /*!< FLASHTIM (Bitfield-Mask: 0x0f) */ +/* ======================================================== PLL0CON ======================================================== */ +#define SYSCON_PLL0CON_PLLE0_Pos (0UL) /*!< PLLE0 (Bit 0) */ +#define SYSCON_PLL0CON_PLLE0_Msk (0x1UL) /*!< PLLE0 (Bitfield-Mask: 0x01) */ +#define SYSCON_PLL0CON_PLLC0_Pos (1UL) /*!< PLLC0 (Bit 1) */ +#define SYSCON_PLL0CON_PLLC0_Msk (0x2UL) /*!< PLLC0 (Bitfield-Mask: 0x01) */ +/* ======================================================== PLL0CFG ======================================================== */ +#define SYSCON_PLL0CFG_MSEL0_Pos (0UL) /*!< MSEL0 (Bit 0) */ +#define SYSCON_PLL0CFG_MSEL0_Msk (0x7fffUL) /*!< MSEL0 (Bitfield-Mask: 0x7fff) */ +#define SYSCON_PLL0CFG_NSEL0_Pos (16UL) /*!< NSEL0 (Bit 16) */ +#define SYSCON_PLL0CFG_NSEL0_Msk (0xff0000UL) /*!< NSEL0 (Bitfield-Mask: 0xff) */ +/* ======================================================= PLL0STAT ======================================================== */ +#define SYSCON_PLL0STAT_MSEL0_Pos (0UL) /*!< MSEL0 (Bit 0) */ +#define SYSCON_PLL0STAT_MSEL0_Msk (0x7fffUL) /*!< MSEL0 (Bitfield-Mask: 0x7fff) */ +#define SYSCON_PLL0STAT_NSEL0_Pos (16UL) /*!< NSEL0 (Bit 16) */ +#define SYSCON_PLL0STAT_NSEL0_Msk (0xff0000UL) /*!< NSEL0 (Bitfield-Mask: 0xff) */ +#define SYSCON_PLL0STAT_PLLE0_STAT_Pos (24UL) /*!< PLLE0_STAT (Bit 24) */ +#define SYSCON_PLL0STAT_PLLE0_STAT_Msk (0x1000000UL) /*!< PLLE0_STAT (Bitfield-Mask: 0x01) */ +#define SYSCON_PLL0STAT_PLLC0_STAT_Pos (25UL) /*!< PLLC0_STAT (Bit 25) */ +#define SYSCON_PLL0STAT_PLLC0_STAT_Msk (0x2000000UL) /*!< PLLC0_STAT (Bitfield-Mask: 0x01) */ +#define SYSCON_PLL0STAT_PLOCK0_Pos (26UL) /*!< PLOCK0 (Bit 26) */ +#define SYSCON_PLL0STAT_PLOCK0_Msk (0x4000000UL) /*!< PLOCK0 (Bitfield-Mask: 0x01) */ +/* ======================================================= PLL0FEED ======================================================== */ +#define SYSCON_PLL0FEED_PLL0FEED_Pos (0UL) /*!< PLL0FEED (Bit 0) */ +#define SYSCON_PLL0FEED_PLL0FEED_Msk (0xffUL) /*!< PLL0FEED (Bitfield-Mask: 0xff) */ +/* ======================================================== PLL1CON ======================================================== */ +#define SYSCON_PLL1CON_PLLE1_Pos (0UL) /*!< PLLE1 (Bit 0) */ +#define SYSCON_PLL1CON_PLLE1_Msk (0x1UL) /*!< PLLE1 (Bitfield-Mask: 0x01) */ +#define SYSCON_PLL1CON_PLLC1_Pos (1UL) /*!< PLLC1 (Bit 1) */ +#define SYSCON_PLL1CON_PLLC1_Msk (0x2UL) /*!< PLLC1 (Bitfield-Mask: 0x01) */ +/* ======================================================== PLL1CFG ======================================================== */ +#define SYSCON_PLL1CFG_MSEL1_Pos (0UL) /*!< MSEL1 (Bit 0) */ +#define SYSCON_PLL1CFG_MSEL1_Msk (0x1fUL) /*!< MSEL1 (Bitfield-Mask: 0x1f) */ +#define SYSCON_PLL1CFG_PSEL1_Pos (5UL) /*!< PSEL1 (Bit 5) */ +#define SYSCON_PLL1CFG_PSEL1_Msk (0x60UL) /*!< PSEL1 (Bitfield-Mask: 0x03) */ +/* ======================================================= PLL1STAT ======================================================== */ +#define SYSCON_PLL1STAT_MSEL1_Pos (0UL) /*!< MSEL1 (Bit 0) */ +#define SYSCON_PLL1STAT_MSEL1_Msk (0x1fUL) /*!< MSEL1 (Bitfield-Mask: 0x1f) */ +#define SYSCON_PLL1STAT_PSEL1_Pos (5UL) /*!< PSEL1 (Bit 5) */ +#define SYSCON_PLL1STAT_PSEL1_Msk (0x60UL) /*!< PSEL1 (Bitfield-Mask: 0x03) */ +#define SYSCON_PLL1STAT_PLLE1_STAT_Pos (8UL) /*!< PLLE1_STAT (Bit 8) */ +#define SYSCON_PLL1STAT_PLLE1_STAT_Msk (0x100UL) /*!< PLLE1_STAT (Bitfield-Mask: 0x01) */ +#define SYSCON_PLL1STAT_PLLC1_STAT_Pos (9UL) /*!< PLLC1_STAT (Bit 9) */ +#define SYSCON_PLL1STAT_PLLC1_STAT_Msk (0x200UL) /*!< PLLC1_STAT (Bitfield-Mask: 0x01) */ +#define SYSCON_PLL1STAT_PLOCK1_Pos (10UL) /*!< PLOCK1 (Bit 10) */ +#define SYSCON_PLL1STAT_PLOCK1_Msk (0x400UL) /*!< PLOCK1 (Bitfield-Mask: 0x01) */ +/* ======================================================= PLL1FEED ======================================================== */ +#define SYSCON_PLL1FEED_PLL1FEED_Pos (0UL) /*!< PLL1FEED (Bit 0) */ +#define SYSCON_PLL1FEED_PLL1FEED_Msk (0xffUL) /*!< PLL1FEED (Bitfield-Mask: 0xff) */ +/* ========================================================= PCON ========================================================== */ +#define SYSCON_PCON_PM0_Pos (0UL) /*!< PM0 (Bit 0) */ +#define SYSCON_PCON_PM0_Msk (0x1UL) /*!< PM0 (Bitfield-Mask: 0x01) */ +#define SYSCON_PCON_PM1_Pos (1UL) /*!< PM1 (Bit 1) */ +#define SYSCON_PCON_PM1_Msk (0x2UL) /*!< PM1 (Bitfield-Mask: 0x01) */ +#define SYSCON_PCON_BODRPM_Pos (2UL) /*!< BODRPM (Bit 2) */ +#define SYSCON_PCON_BODRPM_Msk (0x4UL) /*!< BODRPM (Bitfield-Mask: 0x01) */ +#define SYSCON_PCON_BOGD_Pos (3UL) /*!< BOGD (Bit 3) */ +#define SYSCON_PCON_BOGD_Msk (0x8UL) /*!< BOGD (Bitfield-Mask: 0x01) */ +#define SYSCON_PCON_BORD_Pos (4UL) /*!< BORD (Bit 4) */ +#define SYSCON_PCON_BORD_Msk (0x10UL) /*!< BORD (Bitfield-Mask: 0x01) */ +#define SYSCON_PCON_SMFLAG_Pos (8UL) /*!< SMFLAG (Bit 8) */ +#define SYSCON_PCON_SMFLAG_Msk (0x100UL) /*!< SMFLAG (Bitfield-Mask: 0x01) */ +#define SYSCON_PCON_DSFLAG_Pos (9UL) /*!< DSFLAG (Bit 9) */ +#define SYSCON_PCON_DSFLAG_Msk (0x200UL) /*!< DSFLAG (Bitfield-Mask: 0x01) */ +#define SYSCON_PCON_PDFLAG_Pos (10UL) /*!< PDFLAG (Bit 10) */ +#define SYSCON_PCON_PDFLAG_Msk (0x400UL) /*!< PDFLAG (Bitfield-Mask: 0x01) */ +#define SYSCON_PCON_DPDFLAG_Pos (11UL) /*!< DPDFLAG (Bit 11) */ +#define SYSCON_PCON_DPDFLAG_Msk (0x800UL) /*!< DPDFLAG (Bitfield-Mask: 0x01) */ +/* ========================================================= PCONP ========================================================= */ +#define SYSCON_PCONP_PCTIM0_Pos (1UL) /*!< PCTIM0 (Bit 1) */ +#define SYSCON_PCONP_PCTIM0_Msk (0x2UL) /*!< PCTIM0 (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCTIM1_Pos (2UL) /*!< PCTIM1 (Bit 2) */ +#define SYSCON_PCONP_PCTIM1_Msk (0x4UL) /*!< PCTIM1 (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCUART0_Pos (3UL) /*!< PCUART0 (Bit 3) */ +#define SYSCON_PCONP_PCUART0_Msk (0x8UL) /*!< PCUART0 (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCUART1_Pos (4UL) /*!< PCUART1 (Bit 4) */ +#define SYSCON_PCONP_PCUART1_Msk (0x10UL) /*!< PCUART1 (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCPWM1_Pos (6UL) /*!< PCPWM1 (Bit 6) */ +#define SYSCON_PCONP_PCPWM1_Msk (0x40UL) /*!< PCPWM1 (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCI2C0_Pos (7UL) /*!< PCI2C0 (Bit 7) */ +#define SYSCON_PCONP_PCI2C0_Msk (0x80UL) /*!< PCI2C0 (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCSPI_Pos (8UL) /*!< PCSPI (Bit 8) */ +#define SYSCON_PCONP_PCSPI_Msk (0x100UL) /*!< PCSPI (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCRTC_Pos (9UL) /*!< PCRTC (Bit 9) */ +#define SYSCON_PCONP_PCRTC_Msk (0x200UL) /*!< PCRTC (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCSSP1_Pos (10UL) /*!< PCSSP1 (Bit 10) */ +#define SYSCON_PCONP_PCSSP1_Msk (0x400UL) /*!< PCSSP1 (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCADC_Pos (12UL) /*!< PCADC (Bit 12) */ +#define SYSCON_PCONP_PCADC_Msk (0x1000UL) /*!< PCADC (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCCAN1_Pos (13UL) /*!< PCCAN1 (Bit 13) */ +#define SYSCON_PCONP_PCCAN1_Msk (0x2000UL) /*!< PCCAN1 (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCCAN2_Pos (14UL) /*!< PCCAN2 (Bit 14) */ +#define SYSCON_PCONP_PCCAN2_Msk (0x4000UL) /*!< PCCAN2 (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCGPIO_Pos (15UL) /*!< PCGPIO (Bit 15) */ +#define SYSCON_PCONP_PCGPIO_Msk (0x8000UL) /*!< PCGPIO (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCRIT_Pos (16UL) /*!< PCRIT (Bit 16) */ +#define SYSCON_PCONP_PCRIT_Msk (0x10000UL) /*!< PCRIT (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCMCPWM_Pos (17UL) /*!< PCMCPWM (Bit 17) */ +#define SYSCON_PCONP_PCMCPWM_Msk (0x20000UL) /*!< PCMCPWM (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCQEI_Pos (18UL) /*!< PCQEI (Bit 18) */ +#define SYSCON_PCONP_PCQEI_Msk (0x40000UL) /*!< PCQEI (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCI2C1_Pos (19UL) /*!< PCI2C1 (Bit 19) */ +#define SYSCON_PCONP_PCI2C1_Msk (0x80000UL) /*!< PCI2C1 (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCSSP0_Pos (21UL) /*!< PCSSP0 (Bit 21) */ +#define SYSCON_PCONP_PCSSP0_Msk (0x200000UL) /*!< PCSSP0 (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCTIM2_Pos (22UL) /*!< PCTIM2 (Bit 22) */ +#define SYSCON_PCONP_PCTIM2_Msk (0x400000UL) /*!< PCTIM2 (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCTIM3_Pos (23UL) /*!< PCTIM3 (Bit 23) */ +#define SYSCON_PCONP_PCTIM3_Msk (0x800000UL) /*!< PCTIM3 (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCUART2_Pos (24UL) /*!< PCUART2 (Bit 24) */ +#define SYSCON_PCONP_PCUART2_Msk (0x1000000UL) /*!< PCUART2 (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCUART3_Pos (25UL) /*!< PCUART3 (Bit 25) */ +#define SYSCON_PCONP_PCUART3_Msk (0x2000000UL) /*!< PCUART3 (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCI2C2_Pos (26UL) /*!< PCI2C2 (Bit 26) */ +#define SYSCON_PCONP_PCI2C2_Msk (0x4000000UL) /*!< PCI2C2 (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCI2S_Pos (27UL) /*!< PCI2S (Bit 27) */ +#define SYSCON_PCONP_PCI2S_Msk (0x8000000UL) /*!< PCI2S (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCGPDMA_Pos (29UL) /*!< PCGPDMA (Bit 29) */ +#define SYSCON_PCONP_PCGPDMA_Msk (0x20000000UL) /*!< PCGPDMA (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCENET_Pos (30UL) /*!< PCENET (Bit 30) */ +#define SYSCON_PCONP_PCENET_Msk (0x40000000UL) /*!< PCENET (Bitfield-Mask: 0x01) */ +#define SYSCON_PCONP_PCUSB_Pos (31UL) /*!< PCUSB (Bit 31) */ +#define SYSCON_PCONP_PCUSB_Msk (0x80000000UL) /*!< PCUSB (Bitfield-Mask: 0x01) */ +/* ======================================================== CCLKCFG ======================================================== */ +#define SYSCON_CCLKCFG_CCLKSEL_Pos (0UL) /*!< CCLKSEL (Bit 0) */ +#define SYSCON_CCLKCFG_CCLKSEL_Msk (0xffUL) /*!< CCLKSEL (Bitfield-Mask: 0xff) */ +/* ======================================================= USBCLKCFG ======================================================= */ +#define SYSCON_USBCLKCFG_USBSEL_Pos (0UL) /*!< USBSEL (Bit 0) */ +#define SYSCON_USBCLKCFG_USBSEL_Msk (0xfUL) /*!< USBSEL (Bitfield-Mask: 0x0f) */ +/* ======================================================= CLKSRCSEL ======================================================= */ +#define SYSCON_CLKSRCSEL_CLKSRC_Pos (0UL) /*!< CLKSRC (Bit 0) */ +#define SYSCON_CLKSRCSEL_CLKSRC_Msk (0x3UL) /*!< CLKSRC (Bitfield-Mask: 0x03) */ +/* ====================================================== CANSLEEPCLR ====================================================== */ +#define SYSCON_CANSLEEPCLR_CAN1SLEEP_Pos (1UL) /*!< CAN1SLEEP (Bit 1) */ +#define SYSCON_CANSLEEPCLR_CAN1SLEEP_Msk (0x2UL) /*!< CAN1SLEEP (Bitfield-Mask: 0x01) */ +#define SYSCON_CANSLEEPCLR_CAN2SLEEP_Pos (2UL) /*!< CAN2SLEEP (Bit 2) */ +#define SYSCON_CANSLEEPCLR_CAN2SLEEP_Msk (0x4UL) /*!< CAN2SLEEP (Bitfield-Mask: 0x01) */ +/* ===================================================== CANWAKEFLAGS ====================================================== */ +#define SYSCON_CANWAKEFLAGS_CAN1WAKE_Pos (1UL) /*!< CAN1WAKE (Bit 1) */ +#define SYSCON_CANWAKEFLAGS_CAN1WAKE_Msk (0x2UL) /*!< CAN1WAKE (Bitfield-Mask: 0x01) */ +#define SYSCON_CANWAKEFLAGS_CAN2WAKE_Pos (2UL) /*!< CAN2WAKE (Bit 2) */ +#define SYSCON_CANWAKEFLAGS_CAN2WAKE_Msk (0x4UL) /*!< CAN2WAKE (Bitfield-Mask: 0x01) */ +/* ======================================================== EXTINT ========================================================= */ +#define SYSCON_EXTINT_EINT0_Pos (0UL) /*!< EINT0 (Bit 0) */ +#define SYSCON_EXTINT_EINT0_Msk (0x1UL) /*!< EINT0 (Bitfield-Mask: 0x01) */ +#define SYSCON_EXTINT_EINT1_Pos (1UL) /*!< EINT1 (Bit 1) */ +#define SYSCON_EXTINT_EINT1_Msk (0x2UL) /*!< EINT1 (Bitfield-Mask: 0x01) */ +#define SYSCON_EXTINT_EINT2_Pos (2UL) /*!< EINT2 (Bit 2) */ +#define SYSCON_EXTINT_EINT2_Msk (0x4UL) /*!< EINT2 (Bitfield-Mask: 0x01) */ +#define SYSCON_EXTINT_EINT3_Pos (3UL) /*!< EINT3 (Bit 3) */ +#define SYSCON_EXTINT_EINT3_Msk (0x8UL) /*!< EINT3 (Bitfield-Mask: 0x01) */ +/* ======================================================== EXTMODE ======================================================== */ +#define SYSCON_EXTMODE_EXTMODE0_Pos (0UL) /*!< EXTMODE0 (Bit 0) */ +#define SYSCON_EXTMODE_EXTMODE0_Msk (0x1UL) /*!< EXTMODE0 (Bitfield-Mask: 0x01) */ +#define SYSCON_EXTMODE_EXTMODE1_Pos (1UL) /*!< EXTMODE1 (Bit 1) */ +#define SYSCON_EXTMODE_EXTMODE1_Msk (0x2UL) /*!< EXTMODE1 (Bitfield-Mask: 0x01) */ +#define SYSCON_EXTMODE_EXTMODE2_Pos (2UL) /*!< EXTMODE2 (Bit 2) */ +#define SYSCON_EXTMODE_EXTMODE2_Msk (0x4UL) /*!< EXTMODE2 (Bitfield-Mask: 0x01) */ +#define SYSCON_EXTMODE_EXTMODE3_Pos (3UL) /*!< EXTMODE3 (Bit 3) */ +#define SYSCON_EXTMODE_EXTMODE3_Msk (0x8UL) /*!< EXTMODE3 (Bitfield-Mask: 0x01) */ +/* ======================================================= EXTPOLAR ======================================================== */ +#define SYSCON_EXTPOLAR_EXTPOLAR0_Pos (0UL) /*!< EXTPOLAR0 (Bit 0) */ +#define SYSCON_EXTPOLAR_EXTPOLAR0_Msk (0x1UL) /*!< EXTPOLAR0 (Bitfield-Mask: 0x01) */ +#define SYSCON_EXTPOLAR_EXTPOLAR1_Pos (1UL) /*!< EXTPOLAR1 (Bit 1) */ +#define SYSCON_EXTPOLAR_EXTPOLAR1_Msk (0x2UL) /*!< EXTPOLAR1 (Bitfield-Mask: 0x01) */ +#define SYSCON_EXTPOLAR_EXTPOLAR2_Pos (2UL) /*!< EXTPOLAR2 (Bit 2) */ +#define SYSCON_EXTPOLAR_EXTPOLAR2_Msk (0x4UL) /*!< EXTPOLAR2 (Bitfield-Mask: 0x01) */ +#define SYSCON_EXTPOLAR_EXTPOLAR3_Pos (3UL) /*!< EXTPOLAR3 (Bit 3) */ +#define SYSCON_EXTPOLAR_EXTPOLAR3_Msk (0x8UL) /*!< EXTPOLAR3 (Bitfield-Mask: 0x01) */ +/* ========================================================= RSID ========================================================== */ +#define SYSCON_RSID_POR_Pos (0UL) /*!< POR (Bit 0) */ +#define SYSCON_RSID_POR_Msk (0x1UL) /*!< POR (Bitfield-Mask: 0x01) */ +#define SYSCON_RSID_EXTR_Pos (1UL) /*!< EXTR (Bit 1) */ +#define SYSCON_RSID_EXTR_Msk (0x2UL) /*!< EXTR (Bitfield-Mask: 0x01) */ +#define SYSCON_RSID_WDTR_Pos (2UL) /*!< WDTR (Bit 2) */ +#define SYSCON_RSID_WDTR_Msk (0x4UL) /*!< WDTR (Bitfield-Mask: 0x01) */ +#define SYSCON_RSID_BODR_Pos (3UL) /*!< BODR (Bit 3) */ +#define SYSCON_RSID_BODR_Msk (0x8UL) /*!< BODR (Bitfield-Mask: 0x01) */ +/* ========================================================== SCS ========================================================== */ +#define SYSCON_SCS_OSCRANGE_Pos (4UL) /*!< OSCRANGE (Bit 4) */ +#define SYSCON_SCS_OSCRANGE_Msk (0x10UL) /*!< OSCRANGE (Bitfield-Mask: 0x01) */ +#define SYSCON_SCS_OSCEN_Pos (5UL) /*!< OSCEN (Bit 5) */ +#define SYSCON_SCS_OSCEN_Msk (0x20UL) /*!< OSCEN (Bitfield-Mask: 0x01) */ +#define SYSCON_SCS_OSCSTAT_Pos (6UL) /*!< OSCSTAT (Bit 6) */ +#define SYSCON_SCS_OSCSTAT_Msk (0x40UL) /*!< OSCSTAT (Bitfield-Mask: 0x01) */ +/* ======================================================= PCLKSEL0 ======================================================== */ +#define SYSCON_PCLKSEL0_PCLK_WDT_Pos (0UL) /*!< PCLK_WDT (Bit 0) */ +#define SYSCON_PCLKSEL0_PCLK_WDT_Msk (0x3UL) /*!< PCLK_WDT (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL0_PCLK_TIMER0_Pos (2UL) /*!< PCLK_TIMER0 (Bit 2) */ +#define SYSCON_PCLKSEL0_PCLK_TIMER0_Msk (0xcUL) /*!< PCLK_TIMER0 (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL0_PCLK_TIMER1_Pos (4UL) /*!< PCLK_TIMER1 (Bit 4) */ +#define SYSCON_PCLKSEL0_PCLK_TIMER1_Msk (0x30UL) /*!< PCLK_TIMER1 (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL0_PCLK_UART0_Pos (6UL) /*!< PCLK_UART0 (Bit 6) */ +#define SYSCON_PCLKSEL0_PCLK_UART0_Msk (0xc0UL) /*!< PCLK_UART0 (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL0_PCLK_UART1_Pos (8UL) /*!< PCLK_UART1 (Bit 8) */ +#define SYSCON_PCLKSEL0_PCLK_UART1_Msk (0x300UL) /*!< PCLK_UART1 (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL0_PCLK_PWM1_Pos (12UL) /*!< PCLK_PWM1 (Bit 12) */ +#define SYSCON_PCLKSEL0_PCLK_PWM1_Msk (0x3000UL) /*!< PCLK_PWM1 (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL0_PCLK_I2C0_Pos (14UL) /*!< PCLK_I2C0 (Bit 14) */ +#define SYSCON_PCLKSEL0_PCLK_I2C0_Msk (0xc000UL) /*!< PCLK_I2C0 (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL0_PCLK_SPI_Pos (16UL) /*!< PCLK_SPI (Bit 16) */ +#define SYSCON_PCLKSEL0_PCLK_SPI_Msk (0x30000UL) /*!< PCLK_SPI (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL0_PCLK_SSP1_Pos (20UL) /*!< PCLK_SSP1 (Bit 20) */ +#define SYSCON_PCLKSEL0_PCLK_SSP1_Msk (0x300000UL) /*!< PCLK_SSP1 (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL0_PCLK_DAC_Pos (22UL) /*!< PCLK_DAC (Bit 22) */ +#define SYSCON_PCLKSEL0_PCLK_DAC_Msk (0xc00000UL) /*!< PCLK_DAC (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL0_PCLK_ADC_Pos (24UL) /*!< PCLK_ADC (Bit 24) */ +#define SYSCON_PCLKSEL0_PCLK_ADC_Msk (0x3000000UL) /*!< PCLK_ADC (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL0_PCLK_CAN1_Pos (26UL) /*!< PCLK_CAN1 (Bit 26) */ +#define SYSCON_PCLKSEL0_PCLK_CAN1_Msk (0xc000000UL) /*!< PCLK_CAN1 (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL0_PCLK_CAN2_Pos (28UL) /*!< PCLK_CAN2 (Bit 28) */ +#define SYSCON_PCLKSEL0_PCLK_CAN2_Msk (0x30000000UL) /*!< PCLK_CAN2 (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL0_PCLK_ACF_Pos (30UL) /*!< PCLK_ACF (Bit 30) */ +#define SYSCON_PCLKSEL0_PCLK_ACF_Msk (0xc0000000UL) /*!< PCLK_ACF (Bitfield-Mask: 0x03) */ +/* ======================================================= PCLKSEL1 ======================================================== */ +#define SYSCON_PCLKSEL1_PCLK_QEI_Pos (0UL) /*!< PCLK_QEI (Bit 0) */ +#define SYSCON_PCLKSEL1_PCLK_QEI_Msk (0x3UL) /*!< PCLK_QEI (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL1_PCLK_GPIOINT_Pos (2UL) /*!< PCLK_GPIOINT (Bit 2) */ +#define SYSCON_PCLKSEL1_PCLK_GPIOINT_Msk (0xcUL) /*!< PCLK_GPIOINT (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL1_PCLK_PCB_Pos (4UL) /*!< PCLK_PCB (Bit 4) */ +#define SYSCON_PCLKSEL1_PCLK_PCB_Msk (0x30UL) /*!< PCLK_PCB (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL1_PCLK_I2C1_Pos (6UL) /*!< PCLK_I2C1 (Bit 6) */ +#define SYSCON_PCLKSEL1_PCLK_I2C1_Msk (0xc0UL) /*!< PCLK_I2C1 (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL1_PCLK_SSP0_Pos (10UL) /*!< PCLK_SSP0 (Bit 10) */ +#define SYSCON_PCLKSEL1_PCLK_SSP0_Msk (0xc00UL) /*!< PCLK_SSP0 (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL1_PCLK_TIMER2_Pos (12UL) /*!< PCLK_TIMER2 (Bit 12) */ +#define SYSCON_PCLKSEL1_PCLK_TIMER2_Msk (0x3000UL) /*!< PCLK_TIMER2 (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL1_PCLK_TIMER3_Pos (14UL) /*!< PCLK_TIMER3 (Bit 14) */ +#define SYSCON_PCLKSEL1_PCLK_TIMER3_Msk (0xc000UL) /*!< PCLK_TIMER3 (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL1_PCLK_UART2_Pos (16UL) /*!< PCLK_UART2 (Bit 16) */ +#define SYSCON_PCLKSEL1_PCLK_UART2_Msk (0x30000UL) /*!< PCLK_UART2 (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL1_PCLK_UART3_Pos (18UL) /*!< PCLK_UART3 (Bit 18) */ +#define SYSCON_PCLKSEL1_PCLK_UART3_Msk (0xc0000UL) /*!< PCLK_UART3 (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL1_PCLK_I2C2_Pos (20UL) /*!< PCLK_I2C2 (Bit 20) */ +#define SYSCON_PCLKSEL1_PCLK_I2C2_Msk (0x300000UL) /*!< PCLK_I2C2 (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL1_PCLK_I2S_Pos (22UL) /*!< PCLK_I2S (Bit 22) */ +#define SYSCON_PCLKSEL1_PCLK_I2S_Msk (0xc00000UL) /*!< PCLK_I2S (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL1_PCLK_RIT_Pos (26UL) /*!< PCLK_RIT (Bit 26) */ +#define SYSCON_PCLKSEL1_PCLK_RIT_Msk (0xc000000UL) /*!< PCLK_RIT (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL1_PCLK_SYSCON_Pos (28UL) /*!< PCLK_SYSCON (Bit 28) */ +#define SYSCON_PCLKSEL1_PCLK_SYSCON_Msk (0x30000000UL) /*!< PCLK_SYSCON (Bitfield-Mask: 0x03) */ +#define SYSCON_PCLKSEL1_PCLK_MC_Pos (30UL) /*!< PCLK_MC (Bit 30) */ +#define SYSCON_PCLKSEL1_PCLK_MC_Msk (0xc0000000UL) /*!< PCLK_MC (Bitfield-Mask: 0x03) */ +/* ======================================================= USBINTST ======================================================== */ +#define SYSCON_USBINTST_USB_INT_REQ_LP_Pos (0UL) /*!< USB_INT_REQ_LP (Bit 0) */ +#define SYSCON_USBINTST_USB_INT_REQ_LP_Msk (0x1UL) /*!< USB_INT_REQ_LP (Bitfield-Mask: 0x01) */ +#define SYSCON_USBINTST_USB_INT_REQ_HP_Pos (1UL) /*!< USB_INT_REQ_HP (Bit 1) */ +#define SYSCON_USBINTST_USB_INT_REQ_HP_Msk (0x2UL) /*!< USB_INT_REQ_HP (Bitfield-Mask: 0x01) */ +#define SYSCON_USBINTST_USB_INT_REQ_DMA_Pos (2UL) /*!< USB_INT_REQ_DMA (Bit 2) */ +#define SYSCON_USBINTST_USB_INT_REQ_DMA_Msk (0x4UL) /*!< USB_INT_REQ_DMA (Bitfield-Mask: 0x01) */ +#define SYSCON_USBINTST_USB_HOST_INT_Pos (3UL) /*!< USB_HOST_INT (Bit 3) */ +#define SYSCON_USBINTST_USB_HOST_INT_Msk (0x8UL) /*!< USB_HOST_INT (Bitfield-Mask: 0x01) */ +#define SYSCON_USBINTST_USB_ATX_INT_Pos (4UL) /*!< USB_ATX_INT (Bit 4) */ +#define SYSCON_USBINTST_USB_ATX_INT_Msk (0x10UL) /*!< USB_ATX_INT (Bitfield-Mask: 0x01) */ +#define SYSCON_USBINTST_USB_OTG_INT_Pos (5UL) /*!< USB_OTG_INT (Bit 5) */ +#define SYSCON_USBINTST_USB_OTG_INT_Msk (0x20UL) /*!< USB_OTG_INT (Bitfield-Mask: 0x01) */ +#define SYSCON_USBINTST_USB_I2C_INT_Pos (6UL) /*!< USB_I2C_INT (Bit 6) */ +#define SYSCON_USBINTST_USB_I2C_INT_Msk (0x40UL) /*!< USB_I2C_INT (Bitfield-Mask: 0x01) */ +#define SYSCON_USBINTST_USB_NEED_CLK_Pos (8UL) /*!< USB_NEED_CLK (Bit 8) */ +#define SYSCON_USBINTST_USB_NEED_CLK_Msk (0x100UL) /*!< USB_NEED_CLK (Bitfield-Mask: 0x01) */ +#define SYSCON_USBINTST_EN_USB_INTS_Pos (31UL) /*!< EN_USB_INTS (Bit 31) */ +#define SYSCON_USBINTST_EN_USB_INTS_Msk (0x80000000UL) /*!< EN_USB_INTS (Bitfield-Mask: 0x01) */ +/* ====================================================== DMACREQSEL ======================================================= */ +#define SYSCON_DMACREQSEL_DMASEL08_Pos (0UL) /*!< DMASEL08 (Bit 0) */ +#define SYSCON_DMACREQSEL_DMASEL08_Msk (0x1UL) /*!< DMASEL08 (Bitfield-Mask: 0x01) */ +#define SYSCON_DMACREQSEL_DMASEL09_Pos (1UL) /*!< DMASEL09 (Bit 1) */ +#define SYSCON_DMACREQSEL_DMASEL09_Msk (0x2UL) /*!< DMASEL09 (Bitfield-Mask: 0x01) */ +#define SYSCON_DMACREQSEL_DMASEL10_Pos (2UL) /*!< DMASEL10 (Bit 2) */ +#define SYSCON_DMACREQSEL_DMASEL10_Msk (0x4UL) /*!< DMASEL10 (Bitfield-Mask: 0x01) */ +#define SYSCON_DMACREQSEL_DMASEL11_Pos (3UL) /*!< DMASEL11 (Bit 3) */ +#define SYSCON_DMACREQSEL_DMASEL11_Msk (0x8UL) /*!< DMASEL11 (Bitfield-Mask: 0x01) */ +#define SYSCON_DMACREQSEL_DMASEL12_Pos (4UL) /*!< DMASEL12 (Bit 4) */ +#define SYSCON_DMACREQSEL_DMASEL12_Msk (0x10UL) /*!< DMASEL12 (Bitfield-Mask: 0x01) */ +#define SYSCON_DMACREQSEL_DMASEL13_Pos (5UL) /*!< DMASEL13 (Bit 5) */ +#define SYSCON_DMACREQSEL_DMASEL13_Msk (0x20UL) /*!< DMASEL13 (Bitfield-Mask: 0x01) */ +#define SYSCON_DMACREQSEL_DMASEL14_Pos (6UL) /*!< DMASEL14 (Bit 6) */ +#define SYSCON_DMACREQSEL_DMASEL14_Msk (0x40UL) /*!< DMASEL14 (Bitfield-Mask: 0x01) */ +#define SYSCON_DMACREQSEL_DMASEL15_Pos (7UL) /*!< DMASEL15 (Bit 7) */ +#define SYSCON_DMACREQSEL_DMASEL15_Msk (0x80UL) /*!< DMASEL15 (Bitfield-Mask: 0x01) */ +/* ======================================================= CLKOUTCFG ======================================================= */ +#define SYSCON_CLKOUTCFG_CLKOUTSEL_Pos (0UL) /*!< CLKOUTSEL (Bit 0) */ +#define SYSCON_CLKOUTCFG_CLKOUTSEL_Msk (0xfUL) /*!< CLKOUTSEL (Bitfield-Mask: 0x0f) */ +#define SYSCON_CLKOUTCFG_CLKOUTDIV_Pos (4UL) /*!< CLKOUTDIV (Bit 4) */ +#define SYSCON_CLKOUTCFG_CLKOUTDIV_Msk (0xf0UL) /*!< CLKOUTDIV (Bitfield-Mask: 0x0f) */ +#define SYSCON_CLKOUTCFG_CLKOUT_EN_Pos (8UL) /*!< CLKOUT_EN (Bit 8) */ +#define SYSCON_CLKOUTCFG_CLKOUT_EN_Msk (0x100UL) /*!< CLKOUT_EN (Bitfield-Mask: 0x01) */ +#define SYSCON_CLKOUTCFG_CLKOUT_ACT_Pos (9UL) /*!< CLKOUT_ACT (Bit 9) */ +#define SYSCON_CLKOUTCFG_CLKOUT_ACT_Msk (0x200UL) /*!< CLKOUT_ACT (Bitfield-Mask: 0x01) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_EMAC ================ */ +/* =========================================================================================================================== */ + +/* ========================================================= MAC1 ========================================================== */ +#define EMAC_MAC1_RXENABLE_Pos (0UL) /*!< RXENABLE (Bit 0) */ +#define EMAC_MAC1_RXENABLE_Msk (0x1UL) /*!< RXENABLE (Bitfield-Mask: 0x01) */ +#define EMAC_MAC1_PARF_Pos (1UL) /*!< PARF (Bit 1) */ +#define EMAC_MAC1_PARF_Msk (0x2UL) /*!< PARF (Bitfield-Mask: 0x01) */ +#define EMAC_MAC1_RXFLOWCTRL_Pos (2UL) /*!< RXFLOWCTRL (Bit 2) */ +#define EMAC_MAC1_RXFLOWCTRL_Msk (0x4UL) /*!< RXFLOWCTRL (Bitfield-Mask: 0x01) */ +#define EMAC_MAC1_TXFLOWCTRL_Pos (3UL) /*!< TXFLOWCTRL (Bit 3) */ +#define EMAC_MAC1_TXFLOWCTRL_Msk (0x8UL) /*!< TXFLOWCTRL (Bitfield-Mask: 0x01) */ +#define EMAC_MAC1_LOOPBACK_Pos (4UL) /*!< LOOPBACK (Bit 4) */ +#define EMAC_MAC1_LOOPBACK_Msk (0x10UL) /*!< LOOPBACK (Bitfield-Mask: 0x01) */ +#define EMAC_MAC1_RESETTX_Pos (8UL) /*!< RESETTX (Bit 8) */ +#define EMAC_MAC1_RESETTX_Msk (0x100UL) /*!< RESETTX (Bitfield-Mask: 0x01) */ +#define EMAC_MAC1_RESETMCSTX_Pos (9UL) /*!< RESETMCSTX (Bit 9) */ +#define EMAC_MAC1_RESETMCSTX_Msk (0x200UL) /*!< RESETMCSTX (Bitfield-Mask: 0x01) */ +#define EMAC_MAC1_RESETRX_Pos (10UL) /*!< RESETRX (Bit 10) */ +#define EMAC_MAC1_RESETRX_Msk (0x400UL) /*!< RESETRX (Bitfield-Mask: 0x01) */ +#define EMAC_MAC1_RESETMCSRX_Pos (11UL) /*!< RESETMCSRX (Bit 11) */ +#define EMAC_MAC1_RESETMCSRX_Msk (0x800UL) /*!< RESETMCSRX (Bitfield-Mask: 0x01) */ +#define EMAC_MAC1_SIMRESET_Pos (14UL) /*!< SIMRESET (Bit 14) */ +#define EMAC_MAC1_SIMRESET_Msk (0x4000UL) /*!< SIMRESET (Bitfield-Mask: 0x01) */ +#define EMAC_MAC1_SOFTRESET_Pos (15UL) /*!< SOFTRESET (Bit 15) */ +#define EMAC_MAC1_SOFTRESET_Msk (0x8000UL) /*!< SOFTRESET (Bitfield-Mask: 0x01) */ +/* ========================================================= MAC2 ========================================================== */ +#define EMAC_MAC2_FULLDUPLEX_Pos (0UL) /*!< FULLDUPLEX (Bit 0) */ +#define EMAC_MAC2_FULLDUPLEX_Msk (0x1UL) /*!< FULLDUPLEX (Bitfield-Mask: 0x01) */ +#define EMAC_MAC2_FLC_Pos (1UL) /*!< FLC (Bit 1) */ +#define EMAC_MAC2_FLC_Msk (0x2UL) /*!< FLC (Bitfield-Mask: 0x01) */ +#define EMAC_MAC2_HFEN_Pos (2UL) /*!< HFEN (Bit 2) */ +#define EMAC_MAC2_HFEN_Msk (0x4UL) /*!< HFEN (Bitfield-Mask: 0x01) */ +#define EMAC_MAC2_DELAYEDCRC_Pos (3UL) /*!< DELAYEDCRC (Bit 3) */ +#define EMAC_MAC2_DELAYEDCRC_Msk (0x8UL) /*!< DELAYEDCRC (Bitfield-Mask: 0x01) */ +#define EMAC_MAC2_CRCEN_Pos (4UL) /*!< CRCEN (Bit 4) */ +#define EMAC_MAC2_CRCEN_Msk (0x10UL) /*!< CRCEN (Bitfield-Mask: 0x01) */ +#define EMAC_MAC2_PADCRCEN_Pos (5UL) /*!< PADCRCEN (Bit 5) */ +#define EMAC_MAC2_PADCRCEN_Msk (0x20UL) /*!< PADCRCEN (Bitfield-Mask: 0x01) */ +#define EMAC_MAC2_VLANPADEN_Pos (6UL) /*!< VLANPADEN (Bit 6) */ +#define EMAC_MAC2_VLANPADEN_Msk (0x40UL) /*!< VLANPADEN (Bitfield-Mask: 0x01) */ +#define EMAC_MAC2_AUTODETPADEN_Pos (7UL) /*!< AUTODETPADEN (Bit 7) */ +#define EMAC_MAC2_AUTODETPADEN_Msk (0x80UL) /*!< AUTODETPADEN (Bitfield-Mask: 0x01) */ +#define EMAC_MAC2_PPENF_Pos (8UL) /*!< PPENF (Bit 8) */ +#define EMAC_MAC2_PPENF_Msk (0x100UL) /*!< PPENF (Bitfield-Mask: 0x01) */ +#define EMAC_MAC2_LPENF_Pos (9UL) /*!< LPENF (Bit 9) */ +#define EMAC_MAC2_LPENF_Msk (0x200UL) /*!< LPENF (Bitfield-Mask: 0x01) */ +#define EMAC_MAC2_NOBACKOFF_Pos (12UL) /*!< NOBACKOFF (Bit 12) */ +#define EMAC_MAC2_NOBACKOFF_Msk (0x1000UL) /*!< NOBACKOFF (Bitfield-Mask: 0x01) */ +#define EMAC_MAC2_BP_NOBACKOFF_Pos (13UL) /*!< BP_NOBACKOFF (Bit 13) */ +#define EMAC_MAC2_BP_NOBACKOFF_Msk (0x2000UL) /*!< BP_NOBACKOFF (Bitfield-Mask: 0x01) */ +#define EMAC_MAC2_EXCESSDEFER_Pos (14UL) /*!< EXCESSDEFER (Bit 14) */ +#define EMAC_MAC2_EXCESSDEFER_Msk (0x4000UL) /*!< EXCESSDEFER (Bitfield-Mask: 0x01) */ +/* ========================================================= IPGT ========================================================== */ +#define EMAC_IPGT_BTOBINTEGAP_Pos (0UL) /*!< BTOBINTEGAP (Bit 0) */ +#define EMAC_IPGT_BTOBINTEGAP_Msk (0x7fUL) /*!< BTOBINTEGAP (Bitfield-Mask: 0x7f) */ +/* ========================================================= IPGR ========================================================== */ +#define EMAC_IPGR_NBTOBINTEGAP2_Pos (0UL) /*!< NBTOBINTEGAP2 (Bit 0) */ +#define EMAC_IPGR_NBTOBINTEGAP2_Msk (0x7fUL) /*!< NBTOBINTEGAP2 (Bitfield-Mask: 0x7f) */ +#define EMAC_IPGR_NBTOBINTEGAP1_Pos (8UL) /*!< NBTOBINTEGAP1 (Bit 8) */ +#define EMAC_IPGR_NBTOBINTEGAP1_Msk (0x7f00UL) /*!< NBTOBINTEGAP1 (Bitfield-Mask: 0x7f) */ +/* ========================================================= CLRT ========================================================== */ +#define EMAC_CLRT_RETRANSMAX_Pos (0UL) /*!< RETRANSMAX (Bit 0) */ +#define EMAC_CLRT_RETRANSMAX_Msk (0xfUL) /*!< RETRANSMAX (Bitfield-Mask: 0x0f) */ +#define EMAC_CLRT_COLLWIN_Pos (8UL) /*!< COLLWIN (Bit 8) */ +#define EMAC_CLRT_COLLWIN_Msk (0x3f00UL) /*!< COLLWIN (Bitfield-Mask: 0x3f) */ +/* ========================================================= MAXF ========================================================== */ +#define EMAC_MAXF_MAXFLEN_Pos (0UL) /*!< MAXFLEN (Bit 0) */ +#define EMAC_MAXF_MAXFLEN_Msk (0xffffUL) /*!< MAXFLEN (Bitfield-Mask: 0xffff) */ +/* ========================================================= SUPP ========================================================== */ +#define EMAC_SUPP_SPEED_Pos (8UL) /*!< SPEED (Bit 8) */ +#define EMAC_SUPP_SPEED_Msk (0x100UL) /*!< SPEED (Bitfield-Mask: 0x01) */ +/* ========================================================= TEST ========================================================== */ +#define EMAC_TEST_SCPQ_Pos (0UL) /*!< SCPQ (Bit 0) */ +#define EMAC_TEST_SCPQ_Msk (0x1UL) /*!< SCPQ (Bitfield-Mask: 0x01) */ +#define EMAC_TEST_TESTPAUSE_Pos (1UL) /*!< TESTPAUSE (Bit 1) */ +#define EMAC_TEST_TESTPAUSE_Msk (0x2UL) /*!< TESTPAUSE (Bitfield-Mask: 0x01) */ +#define EMAC_TEST_TESTBP_Pos (2UL) /*!< TESTBP (Bit 2) */ +#define EMAC_TEST_TESTBP_Msk (0x4UL) /*!< TESTBP (Bitfield-Mask: 0x01) */ +/* ========================================================= MCFG ========================================================== */ +#define EMAC_MCFG_SCANINC_Pos (0UL) /*!< SCANINC (Bit 0) */ +#define EMAC_MCFG_SCANINC_Msk (0x1UL) /*!< SCANINC (Bitfield-Mask: 0x01) */ +#define EMAC_MCFG_SUPPPREAMBLE_Pos (1UL) /*!< SUPPPREAMBLE (Bit 1) */ +#define EMAC_MCFG_SUPPPREAMBLE_Msk (0x2UL) /*!< SUPPPREAMBLE (Bitfield-Mask: 0x01) */ +#define EMAC_MCFG_CLOCKSEL_Pos (2UL) /*!< CLOCKSEL (Bit 2) */ +#define EMAC_MCFG_CLOCKSEL_Msk (0x3cUL) /*!< CLOCKSEL (Bitfield-Mask: 0x0f) */ +#define EMAC_MCFG_RESETMIIMGMT_Pos (15UL) /*!< RESETMIIMGMT (Bit 15) */ +#define EMAC_MCFG_RESETMIIMGMT_Msk (0x8000UL) /*!< RESETMIIMGMT (Bitfield-Mask: 0x01) */ +/* ========================================================= MCMD ========================================================== */ +#define EMAC_MCMD_READ_Pos (0UL) /*!< READ (Bit 0) */ +#define EMAC_MCMD_READ_Msk (0x1UL) /*!< READ (Bitfield-Mask: 0x01) */ +#define EMAC_MCMD_SCAN_Pos (1UL) /*!< SCAN (Bit 1) */ +#define EMAC_MCMD_SCAN_Msk (0x2UL) /*!< SCAN (Bitfield-Mask: 0x01) */ +/* ========================================================= MADR ========================================================== */ +#define EMAC_MADR_REGADDR_Pos (0UL) /*!< REGADDR (Bit 0) */ +#define EMAC_MADR_REGADDR_Msk (0x1fUL) /*!< REGADDR (Bitfield-Mask: 0x1f) */ +#define EMAC_MADR_PHYADDR_Pos (8UL) /*!< PHYADDR (Bit 8) */ +#define EMAC_MADR_PHYADDR_Msk (0x1f00UL) /*!< PHYADDR (Bitfield-Mask: 0x1f) */ +/* ========================================================= MWTD ========================================================== */ +#define EMAC_MWTD_WRITEDATA_Pos (0UL) /*!< WRITEDATA (Bit 0) */ +#define EMAC_MWTD_WRITEDATA_Msk (0xffffUL) /*!< WRITEDATA (Bitfield-Mask: 0xffff) */ +/* ========================================================= MRDD ========================================================== */ +#define EMAC_MRDD_READDATA_Pos (0UL) /*!< READDATA (Bit 0) */ +#define EMAC_MRDD_READDATA_Msk (0xffffUL) /*!< READDATA (Bitfield-Mask: 0xffff) */ +/* ========================================================= MIND ========================================================== */ +#define EMAC_MIND_BUSY_Pos (0UL) /*!< BUSY (Bit 0) */ +#define EMAC_MIND_BUSY_Msk (0x1UL) /*!< BUSY (Bitfield-Mask: 0x01) */ +#define EMAC_MIND_SCANNING_Pos (1UL) /*!< SCANNING (Bit 1) */ +#define EMAC_MIND_SCANNING_Msk (0x2UL) /*!< SCANNING (Bitfield-Mask: 0x01) */ +#define EMAC_MIND_NOTVALID_Pos (2UL) /*!< NOTVALID (Bit 2) */ +#define EMAC_MIND_NOTVALID_Msk (0x4UL) /*!< NOTVALID (Bitfield-Mask: 0x01) */ +#define EMAC_MIND_MIILINKFAIL_Pos (3UL) /*!< MIILINKFAIL (Bit 3) */ +#define EMAC_MIND_MIILINKFAIL_Msk (0x8UL) /*!< MIILINKFAIL (Bitfield-Mask: 0x01) */ +/* ========================================================== SA0 ========================================================== */ +#define EMAC_SA0_SADDR2_Pos (0UL) /*!< SADDR2 (Bit 0) */ +#define EMAC_SA0_SADDR2_Msk (0xffUL) /*!< SADDR2 (Bitfield-Mask: 0xff) */ +#define EMAC_SA0_SADDR1_Pos (8UL) /*!< SADDR1 (Bit 8) */ +#define EMAC_SA0_SADDR1_Msk (0xff00UL) /*!< SADDR1 (Bitfield-Mask: 0xff) */ +/* ========================================================== SA1 ========================================================== */ +#define EMAC_SA1_SADDR4_Pos (0UL) /*!< SADDR4 (Bit 0) */ +#define EMAC_SA1_SADDR4_Msk (0xffUL) /*!< SADDR4 (Bitfield-Mask: 0xff) */ +#define EMAC_SA1_SADDR3_Pos (8UL) /*!< SADDR3 (Bit 8) */ +#define EMAC_SA1_SADDR3_Msk (0xff00UL) /*!< SADDR3 (Bitfield-Mask: 0xff) */ +/* ========================================================== SA2 ========================================================== */ +#define EMAC_SA2_SADDR6_Pos (0UL) /*!< SADDR6 (Bit 0) */ +#define EMAC_SA2_SADDR6_Msk (0xffUL) /*!< SADDR6 (Bitfield-Mask: 0xff) */ +#define EMAC_SA2_SADDR5_Pos (8UL) /*!< SADDR5 (Bit 8) */ +#define EMAC_SA2_SADDR5_Msk (0xff00UL) /*!< SADDR5 (Bitfield-Mask: 0xff) */ +/* ======================================================== COMMAND ======================================================== */ +#define EMAC_COMMAND_RXENABLE_Pos (0UL) /*!< RXENABLE (Bit 0) */ +#define EMAC_COMMAND_RXENABLE_Msk (0x1UL) /*!< RXENABLE (Bitfield-Mask: 0x01) */ +#define EMAC_COMMAND_TXENABLE_Pos (1UL) /*!< TXENABLE (Bit 1) */ +#define EMAC_COMMAND_TXENABLE_Msk (0x2UL) /*!< TXENABLE (Bitfield-Mask: 0x01) */ +#define EMAC_COMMAND_REGRESET_Pos (3UL) /*!< REGRESET (Bit 3) */ +#define EMAC_COMMAND_REGRESET_Msk (0x8UL) /*!< REGRESET (Bitfield-Mask: 0x01) */ +#define EMAC_COMMAND_TXRESET_Pos (4UL) /*!< TXRESET (Bit 4) */ +#define EMAC_COMMAND_TXRESET_Msk (0x10UL) /*!< TXRESET (Bitfield-Mask: 0x01) */ +#define EMAC_COMMAND_RXRESET_Pos (5UL) /*!< RXRESET (Bit 5) */ +#define EMAC_COMMAND_RXRESET_Msk (0x20UL) /*!< RXRESET (Bitfield-Mask: 0x01) */ +#define EMAC_COMMAND_PASSRUNTFRAME_Pos (6UL) /*!< PASSRUNTFRAME (Bit 6) */ +#define EMAC_COMMAND_PASSRUNTFRAME_Msk (0x40UL) /*!< PASSRUNTFRAME (Bitfield-Mask: 0x01) */ +#define EMAC_COMMAND_PASSRXFILTER_Pos (7UL) /*!< PASSRXFILTER (Bit 7) */ +#define EMAC_COMMAND_PASSRXFILTER_Msk (0x80UL) /*!< PASSRXFILTER (Bitfield-Mask: 0x01) */ +#define EMAC_COMMAND_TXFLOWCONTROL_Pos (8UL) /*!< TXFLOWCONTROL (Bit 8) */ +#define EMAC_COMMAND_TXFLOWCONTROL_Msk (0x100UL) /*!< TXFLOWCONTROL (Bitfield-Mask: 0x01) */ +#define EMAC_COMMAND_RMII_Pos (9UL) /*!< RMII (Bit 9) */ +#define EMAC_COMMAND_RMII_Msk (0x200UL) /*!< RMII (Bitfield-Mask: 0x01) */ +#define EMAC_COMMAND_FULLDUPLEX_Pos (10UL) /*!< FULLDUPLEX (Bit 10) */ +#define EMAC_COMMAND_FULLDUPLEX_Msk (0x400UL) /*!< FULLDUPLEX (Bitfield-Mask: 0x01) */ +/* ======================================================== STATUS ========================================================= */ +#define EMAC_STATUS_RXSTATUS_Pos (0UL) /*!< RXSTATUS (Bit 0) */ +#define EMAC_STATUS_RXSTATUS_Msk (0x1UL) /*!< RXSTATUS (Bitfield-Mask: 0x01) */ +#define EMAC_STATUS_TXSTATUS_Pos (1UL) /*!< TXSTATUS (Bit 1) */ +#define EMAC_STATUS_TXSTATUS_Msk (0x2UL) /*!< TXSTATUS (Bitfield-Mask: 0x01) */ +/* ===================================================== RXDESCRIPTOR ====================================================== */ +#define EMAC_RXDESCRIPTOR_RXDESCRIPTOR_Pos (2UL) /*!< RXDESCRIPTOR (Bit 2) */ +#define EMAC_RXDESCRIPTOR_RXDESCRIPTOR_Msk (0xfffffffcUL) /*!< RXDESCRIPTOR (Bitfield-Mask: 0x3fffffff) */ +/* ======================================================= RXSTATUS ======================================================== */ +#define EMAC_RXSTATUS_RXSTATUS_Pos (3UL) /*!< RXSTATUS (Bit 3) */ +#define EMAC_RXSTATUS_RXSTATUS_Msk (0xfffffff8UL) /*!< RXSTATUS (Bitfield-Mask: 0x1fffffff) */ +/* ================================================== RXDESCRIPTORNUMBER =================================================== */ +#define EMAC_RXDESCRIPTORNUMBER_RXDESCRIPTORN_Pos (0UL) /*!< RXDESCRIPTORN (Bit 0) */ +#define EMAC_RXDESCRIPTORNUMBER_RXDESCRIPTORN_Msk (0xffffUL) /*!< RXDESCRIPTORN (Bitfield-Mask: 0xffff) */ +/* ==================================================== RXPRODUCEINDEX ===================================================== */ +#define EMAC_RXPRODUCEINDEX_RXPRODUCEIX_Pos (0UL) /*!< RXPRODUCEIX (Bit 0) */ +#define EMAC_RXPRODUCEINDEX_RXPRODUCEIX_Msk (0xffffUL) /*!< RXPRODUCEIX (Bitfield-Mask: 0xffff) */ +/* ==================================================== RXCONSUMEINDEX ===================================================== */ +#define EMAC_RXCONSUMEINDEX_RXCONSUMEIX_Pos (0UL) /*!< RXCONSUMEIX (Bit 0) */ +#define EMAC_RXCONSUMEINDEX_RXCONSUMEIX_Msk (0xffffUL) /*!< RXCONSUMEIX (Bitfield-Mask: 0xffff) */ +/* ===================================================== TXDESCRIPTOR ====================================================== */ +#define EMAC_TXDESCRIPTOR_TXD_Pos (2UL) /*!< TXD (Bit 2) */ +#define EMAC_TXDESCRIPTOR_TXD_Msk (0xfffffffcUL) /*!< TXD (Bitfield-Mask: 0x3fffffff) */ +/* ======================================================= TXSTATUS ======================================================== */ +#define EMAC_TXSTATUS_TXSTAT_Pos (2UL) /*!< TXSTAT (Bit 2) */ +#define EMAC_TXSTATUS_TXSTAT_Msk (0xfffffffcUL) /*!< TXSTAT (Bitfield-Mask: 0x3fffffff) */ +/* ================================================== TXDESCRIPTORNUMBER =================================================== */ +#define EMAC_TXDESCRIPTORNUMBER_TXDN_Pos (0UL) /*!< TXDN (Bit 0) */ +#define EMAC_TXDESCRIPTORNUMBER_TXDN_Msk (0xffffUL) /*!< TXDN (Bitfield-Mask: 0xffff) */ +/* ==================================================== TXPRODUCEINDEX ===================================================== */ +#define EMAC_TXPRODUCEINDEX_TXPI_Pos (0UL) /*!< TXPI (Bit 0) */ +#define EMAC_TXPRODUCEINDEX_TXPI_Msk (0xffffUL) /*!< TXPI (Bitfield-Mask: 0xffff) */ +/* ==================================================== TXCONSUMEINDEX ===================================================== */ +#define EMAC_TXCONSUMEINDEX_TXCI_Pos (0UL) /*!< TXCI (Bit 0) */ +#define EMAC_TXCONSUMEINDEX_TXCI_Msk (0xffffUL) /*!< TXCI (Bitfield-Mask: 0xffff) */ +/* ========================================================= TSV0 ========================================================== */ +#define EMAC_TSV0_CRCERR_Pos (0UL) /*!< CRCERR (Bit 0) */ +#define EMAC_TSV0_CRCERR_Msk (0x1UL) /*!< CRCERR (Bitfield-Mask: 0x01) */ +#define EMAC_TSV0_LCE_Pos (1UL) /*!< LCE (Bit 1) */ +#define EMAC_TSV0_LCE_Msk (0x2UL) /*!< LCE (Bitfield-Mask: 0x01) */ +#define EMAC_TSV0_LOR_Pos (2UL) /*!< LOR (Bit 2) */ +#define EMAC_TSV0_LOR_Msk (0x4UL) /*!< LOR (Bitfield-Mask: 0x01) */ +#define EMAC_TSV0_DONE_Pos (3UL) /*!< DONE (Bit 3) */ +#define EMAC_TSV0_DONE_Msk (0x8UL) /*!< DONE (Bitfield-Mask: 0x01) */ +#define EMAC_TSV0_MULTICAST_Pos (4UL) /*!< MULTICAST (Bit 4) */ +#define EMAC_TSV0_MULTICAST_Msk (0x10UL) /*!< MULTICAST (Bitfield-Mask: 0x01) */ +#define EMAC_TSV0_BROADCAST_Pos (5UL) /*!< BROADCAST (Bit 5) */ +#define EMAC_TSV0_BROADCAST_Msk (0x20UL) /*!< BROADCAST (Bitfield-Mask: 0x01) */ +#define EMAC_TSV0_PACKETDEFER_Pos (6UL) /*!< PACKETDEFER (Bit 6) */ +#define EMAC_TSV0_PACKETDEFER_Msk (0x40UL) /*!< PACKETDEFER (Bitfield-Mask: 0x01) */ +#define EMAC_TSV0_EXDF_Pos (7UL) /*!< EXDF (Bit 7) */ +#define EMAC_TSV0_EXDF_Msk (0x80UL) /*!< EXDF (Bitfield-Mask: 0x01) */ +#define EMAC_TSV0_EXCOL_Pos (8UL) /*!< EXCOL (Bit 8) */ +#define EMAC_TSV0_EXCOL_Msk (0x100UL) /*!< EXCOL (Bitfield-Mask: 0x01) */ +#define EMAC_TSV0_LCOL_Pos (9UL) /*!< LCOL (Bit 9) */ +#define EMAC_TSV0_LCOL_Msk (0x200UL) /*!< LCOL (Bitfield-Mask: 0x01) */ +#define EMAC_TSV0_GIANT_Pos (10UL) /*!< GIANT (Bit 10) */ +#define EMAC_TSV0_GIANT_Msk (0x400UL) /*!< GIANT (Bitfield-Mask: 0x01) */ +#define EMAC_TSV0_UNDERRUN_Pos (11UL) /*!< UNDERRUN (Bit 11) */ +#define EMAC_TSV0_UNDERRUN_Msk (0x800UL) /*!< UNDERRUN (Bitfield-Mask: 0x01) */ +#define EMAC_TSV0_TOTALBYTES_Pos (12UL) /*!< TOTALBYTES (Bit 12) */ +#define EMAC_TSV0_TOTALBYTES_Msk (0xffff000UL) /*!< TOTALBYTES (Bitfield-Mask: 0xffff) */ +#define EMAC_TSV0_CONTROLFRAME_Pos (28UL) /*!< CONTROLFRAME (Bit 28) */ +#define EMAC_TSV0_CONTROLFRAME_Msk (0x10000000UL) /*!< CONTROLFRAME (Bitfield-Mask: 0x01) */ +#define EMAC_TSV0_PAUSE_Pos (29UL) /*!< PAUSE (Bit 29) */ +#define EMAC_TSV0_PAUSE_Msk (0x20000000UL) /*!< PAUSE (Bitfield-Mask: 0x01) */ +#define EMAC_TSV0_BACKPRESSURE_Pos (30UL) /*!< BACKPRESSURE (Bit 30) */ +#define EMAC_TSV0_BACKPRESSURE_Msk (0x40000000UL) /*!< BACKPRESSURE (Bitfield-Mask: 0x01) */ +#define EMAC_TSV0_VLAN_Pos (31UL) /*!< VLAN (Bit 31) */ +#define EMAC_TSV0_VLAN_Msk (0x80000000UL) /*!< VLAN (Bitfield-Mask: 0x01) */ +/* ========================================================= TSV1 ========================================================== */ +#define EMAC_TSV1_TBC_Pos (0UL) /*!< TBC (Bit 0) */ +#define EMAC_TSV1_TBC_Msk (0xffffUL) /*!< TBC (Bitfield-Mask: 0xffff) */ +#define EMAC_TSV1_TCC_Pos (16UL) /*!< TCC (Bit 16) */ +#define EMAC_TSV1_TCC_Msk (0xf0000UL) /*!< TCC (Bitfield-Mask: 0x0f) */ +/* ========================================================== RSV ========================================================== */ +#define EMAC_RSV_RBC_Pos (0UL) /*!< RBC (Bit 0) */ +#define EMAC_RSV_RBC_Msk (0xffffUL) /*!< RBC (Bitfield-Mask: 0xffff) */ +#define EMAC_RSV_PPI_Pos (16UL) /*!< PPI (Bit 16) */ +#define EMAC_RSV_PPI_Msk (0x10000UL) /*!< PPI (Bitfield-Mask: 0x01) */ +#define EMAC_RSV_RXDVSEEN_Pos (17UL) /*!< RXDVSEEN (Bit 17) */ +#define EMAC_RSV_RXDVSEEN_Msk (0x20000UL) /*!< RXDVSEEN (Bitfield-Mask: 0x01) */ +#define EMAC_RSV_CESEEN_Pos (18UL) /*!< CESEEN (Bit 18) */ +#define EMAC_RSV_CESEEN_Msk (0x40000UL) /*!< CESEEN (Bitfield-Mask: 0x01) */ +#define EMAC_RSV_RCV_Pos (19UL) /*!< RCV (Bit 19) */ +#define EMAC_RSV_RCV_Msk (0x80000UL) /*!< RCV (Bitfield-Mask: 0x01) */ +#define EMAC_RSV_CRCERR_Pos (20UL) /*!< CRCERR (Bit 20) */ +#define EMAC_RSV_CRCERR_Msk (0x100000UL) /*!< CRCERR (Bitfield-Mask: 0x01) */ +#define EMAC_RSV_LCERR_Pos (21UL) /*!< LCERR (Bit 21) */ +#define EMAC_RSV_LCERR_Msk (0x200000UL) /*!< LCERR (Bitfield-Mask: 0x01) */ +#define EMAC_RSV_LOR_Pos (22UL) /*!< LOR (Bit 22) */ +#define EMAC_RSV_LOR_Msk (0x400000UL) /*!< LOR (Bitfield-Mask: 0x01) */ +#define EMAC_RSV_ROK_Pos (23UL) /*!< ROK (Bit 23) */ +#define EMAC_RSV_ROK_Msk (0x800000UL) /*!< ROK (Bitfield-Mask: 0x01) */ +#define EMAC_RSV_MULTICAST_Pos (24UL) /*!< MULTICAST (Bit 24) */ +#define EMAC_RSV_MULTICAST_Msk (0x1000000UL) /*!< MULTICAST (Bitfield-Mask: 0x01) */ +#define EMAC_RSV_BROADCAST_Pos (25UL) /*!< BROADCAST (Bit 25) */ +#define EMAC_RSV_BROADCAST_Msk (0x2000000UL) /*!< BROADCAST (Bitfield-Mask: 0x01) */ +#define EMAC_RSV_DRIBBLENIBBLE_Pos (26UL) /*!< DRIBBLENIBBLE (Bit 26) */ +#define EMAC_RSV_DRIBBLENIBBLE_Msk (0x4000000UL) /*!< DRIBBLENIBBLE (Bitfield-Mask: 0x01) */ +#define EMAC_RSV_CONTROLFRAME_Pos (27UL) /*!< CONTROLFRAME (Bit 27) */ +#define EMAC_RSV_CONTROLFRAME_Msk (0x8000000UL) /*!< CONTROLFRAME (Bitfield-Mask: 0x01) */ +#define EMAC_RSV_PAUSE_Pos (28UL) /*!< PAUSE (Bit 28) */ +#define EMAC_RSV_PAUSE_Msk (0x10000000UL) /*!< PAUSE (Bitfield-Mask: 0x01) */ +#define EMAC_RSV_UO_Pos (29UL) /*!< UO (Bit 29) */ +#define EMAC_RSV_UO_Msk (0x20000000UL) /*!< UO (Bitfield-Mask: 0x01) */ +#define EMAC_RSV_VLAN_Pos (30UL) /*!< VLAN (Bit 30) */ +#define EMAC_RSV_VLAN_Msk (0x40000000UL) /*!< VLAN (Bitfield-Mask: 0x01) */ +/* ================================================== FLOWCONTROLCOUNTER =================================================== */ +#define EMAC_FLOWCONTROLCOUNTER_MC_Pos (0UL) /*!< MC (Bit 0) */ +#define EMAC_FLOWCONTROLCOUNTER_MC_Msk (0xffffUL) /*!< MC (Bitfield-Mask: 0xffff) */ +#define EMAC_FLOWCONTROLCOUNTER_PT_Pos (16UL) /*!< PT (Bit 16) */ +#define EMAC_FLOWCONTROLCOUNTER_PT_Msk (0xffff0000UL) /*!< PT (Bitfield-Mask: 0xffff) */ +/* =================================================== FLOWCONTROLSTATUS =================================================== */ +#define EMAC_FLOWCONTROLSTATUS_MCC_Pos (0UL) /*!< MCC (Bit 0) */ +#define EMAC_FLOWCONTROLSTATUS_MCC_Msk (0xffffUL) /*!< MCC (Bitfield-Mask: 0xffff) */ +/* ===================================================== RXFILTERCTRL ====================================================== */ +#define EMAC_RXFILTERCTRL_AUE_Pos (0UL) /*!< AUE (Bit 0) */ +#define EMAC_RXFILTERCTRL_AUE_Msk (0x1UL) /*!< AUE (Bitfield-Mask: 0x01) */ +#define EMAC_RXFILTERCTRL_ABE_Pos (1UL) /*!< ABE (Bit 1) */ +#define EMAC_RXFILTERCTRL_ABE_Msk (0x2UL) /*!< ABE (Bitfield-Mask: 0x01) */ +#define EMAC_RXFILTERCTRL_AME_Pos (2UL) /*!< AME (Bit 2) */ +#define EMAC_RXFILTERCTRL_AME_Msk (0x4UL) /*!< AME (Bitfield-Mask: 0x01) */ +#define EMAC_RXFILTERCTRL_AUHE_Pos (3UL) /*!< AUHE (Bit 3) */ +#define EMAC_RXFILTERCTRL_AUHE_Msk (0x8UL) /*!< AUHE (Bitfield-Mask: 0x01) */ +#define EMAC_RXFILTERCTRL_AMHE_Pos (4UL) /*!< AMHE (Bit 4) */ +#define EMAC_RXFILTERCTRL_AMHE_Msk (0x10UL) /*!< AMHE (Bitfield-Mask: 0x01) */ +#define EMAC_RXFILTERCTRL_APE_Pos (5UL) /*!< APE (Bit 5) */ +#define EMAC_RXFILTERCTRL_APE_Msk (0x20UL) /*!< APE (Bitfield-Mask: 0x01) */ +#define EMAC_RXFILTERCTRL_MPEW_Pos (12UL) /*!< MPEW (Bit 12) */ +#define EMAC_RXFILTERCTRL_MPEW_Msk (0x1000UL) /*!< MPEW (Bitfield-Mask: 0x01) */ +#define EMAC_RXFILTERCTRL_RFEW_Pos (13UL) /*!< RFEW (Bit 13) */ +#define EMAC_RXFILTERCTRL_RFEW_Msk (0x2000UL) /*!< RFEW (Bitfield-Mask: 0x01) */ +/* =================================================== RXFILTERWOLSTATUS =================================================== */ +#define EMAC_RXFILTERWOLSTATUS_AUW_Pos (0UL) /*!< AUW (Bit 0) */ +#define EMAC_RXFILTERWOLSTATUS_AUW_Msk (0x1UL) /*!< AUW (Bitfield-Mask: 0x01) */ +#define EMAC_RXFILTERWOLSTATUS_ABW_Pos (1UL) /*!< ABW (Bit 1) */ +#define EMAC_RXFILTERWOLSTATUS_ABW_Msk (0x2UL) /*!< ABW (Bitfield-Mask: 0x01) */ +#define EMAC_RXFILTERWOLSTATUS_AMW_Pos (2UL) /*!< AMW (Bit 2) */ +#define EMAC_RXFILTERWOLSTATUS_AMW_Msk (0x4UL) /*!< AMW (Bitfield-Mask: 0x01) */ +#define EMAC_RXFILTERWOLSTATUS_AUHW_Pos (3UL) /*!< AUHW (Bit 3) */ +#define EMAC_RXFILTERWOLSTATUS_AUHW_Msk (0x8UL) /*!< AUHW (Bitfield-Mask: 0x01) */ +#define EMAC_RXFILTERWOLSTATUS_AMHW_Pos (4UL) /*!< AMHW (Bit 4) */ +#define EMAC_RXFILTERWOLSTATUS_AMHW_Msk (0x10UL) /*!< AMHW (Bitfield-Mask: 0x01) */ +#define EMAC_RXFILTERWOLSTATUS_APW_Pos (5UL) /*!< APW (Bit 5) */ +#define EMAC_RXFILTERWOLSTATUS_APW_Msk (0x20UL) /*!< APW (Bitfield-Mask: 0x01) */ +#define EMAC_RXFILTERWOLSTATUS_RFW_Pos (7UL) /*!< RFW (Bit 7) */ +#define EMAC_RXFILTERWOLSTATUS_RFW_Msk (0x80UL) /*!< RFW (Bitfield-Mask: 0x01) */ +#define EMAC_RXFILTERWOLSTATUS_MPW_Pos (8UL) /*!< MPW (Bit 8) */ +#define EMAC_RXFILTERWOLSTATUS_MPW_Msk (0x100UL) /*!< MPW (Bitfield-Mask: 0x01) */ +/* =================================================== RXFILTERWOLCLEAR ==================================================== */ +#define EMAC_RXFILTERWOLCLEAR_AUWCLR_Pos (0UL) /*!< AUWCLR (Bit 0) */ +#define EMAC_RXFILTERWOLCLEAR_AUWCLR_Msk (0x1UL) /*!< AUWCLR (Bitfield-Mask: 0x01) */ +#define EMAC_RXFILTERWOLCLEAR_ABWCLR_Pos (1UL) /*!< ABWCLR (Bit 1) */ +#define EMAC_RXFILTERWOLCLEAR_ABWCLR_Msk (0x2UL) /*!< ABWCLR (Bitfield-Mask: 0x01) */ +#define EMAC_RXFILTERWOLCLEAR_AMWCLR_Pos (2UL) /*!< AMWCLR (Bit 2) */ +#define EMAC_RXFILTERWOLCLEAR_AMWCLR_Msk (0x4UL) /*!< AMWCLR (Bitfield-Mask: 0x01) */ +#define EMAC_RXFILTERWOLCLEAR_AUHWCLR_Pos (3UL) /*!< AUHWCLR (Bit 3) */ +#define EMAC_RXFILTERWOLCLEAR_AUHWCLR_Msk (0x8UL) /*!< AUHWCLR (Bitfield-Mask: 0x01) */ +#define EMAC_RXFILTERWOLCLEAR_AMHWCLR_Pos (4UL) /*!< AMHWCLR (Bit 4) */ +#define EMAC_RXFILTERWOLCLEAR_AMHWCLR_Msk (0x10UL) /*!< AMHWCLR (Bitfield-Mask: 0x01) */ +#define EMAC_RXFILTERWOLCLEAR_APWCLR_Pos (5UL) /*!< APWCLR (Bit 5) */ +#define EMAC_RXFILTERWOLCLEAR_APWCLR_Msk (0x20UL) /*!< APWCLR (Bitfield-Mask: 0x01) */ +#define EMAC_RXFILTERWOLCLEAR_RFWCLR_Pos (7UL) /*!< RFWCLR (Bit 7) */ +#define EMAC_RXFILTERWOLCLEAR_RFWCLR_Msk (0x80UL) /*!< RFWCLR (Bitfield-Mask: 0x01) */ +#define EMAC_RXFILTERWOLCLEAR_MPWCLR_Pos (8UL) /*!< MPWCLR (Bit 8) */ +#define EMAC_RXFILTERWOLCLEAR_MPWCLR_Msk (0x100UL) /*!< MPWCLR (Bitfield-Mask: 0x01) */ +/* ====================================================== HASHFILTERL ====================================================== */ +#define EMAC_HASHFILTERL_HFL_Pos (0UL) /*!< HFL (Bit 0) */ +#define EMAC_HASHFILTERL_HFL_Msk (0xffffffffUL) /*!< HFL (Bitfield-Mask: 0xffffffff) */ +/* ====================================================== HASHFILTERH ====================================================== */ +#define EMAC_HASHFILTERH_HFH_Pos (0UL) /*!< HFH (Bit 0) */ +#define EMAC_HASHFILTERH_HFH_Msk (0xffffffffUL) /*!< HFH (Bitfield-Mask: 0xffffffff) */ +/* ======================================================= INTSTATUS ======================================================= */ +#define EMAC_INTSTATUS_RXOVERRUNINT_Pos (0UL) /*!< RXOVERRUNINT (Bit 0) */ +#define EMAC_INTSTATUS_RXOVERRUNINT_Msk (0x1UL) /*!< RXOVERRUNINT (Bitfield-Mask: 0x01) */ +#define EMAC_INTSTATUS_RXERRORINT_Pos (1UL) /*!< RXERRORINT (Bit 1) */ +#define EMAC_INTSTATUS_RXERRORINT_Msk (0x2UL) /*!< RXERRORINT (Bitfield-Mask: 0x01) */ +#define EMAC_INTSTATUS_RXFINISHEDINT_Pos (2UL) /*!< RXFINISHEDINT (Bit 2) */ +#define EMAC_INTSTATUS_RXFINISHEDINT_Msk (0x4UL) /*!< RXFINISHEDINT (Bitfield-Mask: 0x01) */ +#define EMAC_INTSTATUS_RXDONEINT_Pos (3UL) /*!< RXDONEINT (Bit 3) */ +#define EMAC_INTSTATUS_RXDONEINT_Msk (0x8UL) /*!< RXDONEINT (Bitfield-Mask: 0x01) */ +#define EMAC_INTSTATUS_TXUNDERRUNINT_Pos (4UL) /*!< TXUNDERRUNINT (Bit 4) */ +#define EMAC_INTSTATUS_TXUNDERRUNINT_Msk (0x10UL) /*!< TXUNDERRUNINT (Bitfield-Mask: 0x01) */ +#define EMAC_INTSTATUS_TXERRORINT_Pos (5UL) /*!< TXERRORINT (Bit 5) */ +#define EMAC_INTSTATUS_TXERRORINT_Msk (0x20UL) /*!< TXERRORINT (Bitfield-Mask: 0x01) */ +#define EMAC_INTSTATUS_TXFINISHEDINT_Pos (6UL) /*!< TXFINISHEDINT (Bit 6) */ +#define EMAC_INTSTATUS_TXFINISHEDINT_Msk (0x40UL) /*!< TXFINISHEDINT (Bitfield-Mask: 0x01) */ +#define EMAC_INTSTATUS_TXDONEINT_Pos (7UL) /*!< TXDONEINT (Bit 7) */ +#define EMAC_INTSTATUS_TXDONEINT_Msk (0x80UL) /*!< TXDONEINT (Bitfield-Mask: 0x01) */ +#define EMAC_INTSTATUS_SOFTINT_Pos (12UL) /*!< SOFTINT (Bit 12) */ +#define EMAC_INTSTATUS_SOFTINT_Msk (0x1000UL) /*!< SOFTINT (Bitfield-Mask: 0x01) */ +#define EMAC_INTSTATUS_WAKEUPINT_Pos (13UL) /*!< WAKEUPINT (Bit 13) */ +#define EMAC_INTSTATUS_WAKEUPINT_Msk (0x2000UL) /*!< WAKEUPINT (Bitfield-Mask: 0x01) */ +/* ======================================================= INTENABLE ======================================================= */ +#define EMAC_INTENABLE_RXOVERRUNINTEN_Pos (0UL) /*!< RXOVERRUNINTEN (Bit 0) */ +#define EMAC_INTENABLE_RXOVERRUNINTEN_Msk (0x1UL) /*!< RXOVERRUNINTEN (Bitfield-Mask: 0x01) */ +#define EMAC_INTENABLE_RXERRORINTEN_Pos (1UL) /*!< RXERRORINTEN (Bit 1) */ +#define EMAC_INTENABLE_RXERRORINTEN_Msk (0x2UL) /*!< RXERRORINTEN (Bitfield-Mask: 0x01) */ +#define EMAC_INTENABLE_RXFINISHEDINTEN_Pos (2UL) /*!< RXFINISHEDINTEN (Bit 2) */ +#define EMAC_INTENABLE_RXFINISHEDINTEN_Msk (0x4UL) /*!< RXFINISHEDINTEN (Bitfield-Mask: 0x01) */ +#define EMAC_INTENABLE_RXDONEINTEN_Pos (3UL) /*!< RXDONEINTEN (Bit 3) */ +#define EMAC_INTENABLE_RXDONEINTEN_Msk (0x8UL) /*!< RXDONEINTEN (Bitfield-Mask: 0x01) */ +#define EMAC_INTENABLE_TXUNDERRUNINTEN_Pos (4UL) /*!< TXUNDERRUNINTEN (Bit 4) */ +#define EMAC_INTENABLE_TXUNDERRUNINTEN_Msk (0x10UL) /*!< TXUNDERRUNINTEN (Bitfield-Mask: 0x01) */ +#define EMAC_INTENABLE_TXERRORINTEN_Pos (5UL) /*!< TXERRORINTEN (Bit 5) */ +#define EMAC_INTENABLE_TXERRORINTEN_Msk (0x20UL) /*!< TXERRORINTEN (Bitfield-Mask: 0x01) */ +#define EMAC_INTENABLE_TXFINISHEDINTEN_Pos (6UL) /*!< TXFINISHEDINTEN (Bit 6) */ +#define EMAC_INTENABLE_TXFINISHEDINTEN_Msk (0x40UL) /*!< TXFINISHEDINTEN (Bitfield-Mask: 0x01) */ +#define EMAC_INTENABLE_TXDONEINTEN_Pos (7UL) /*!< TXDONEINTEN (Bit 7) */ +#define EMAC_INTENABLE_TXDONEINTEN_Msk (0x80UL) /*!< TXDONEINTEN (Bitfield-Mask: 0x01) */ +#define EMAC_INTENABLE_SOFTINTEN_Pos (12UL) /*!< SOFTINTEN (Bit 12) */ +#define EMAC_INTENABLE_SOFTINTEN_Msk (0x1000UL) /*!< SOFTINTEN (Bitfield-Mask: 0x01) */ +#define EMAC_INTENABLE_WAKEUPINTEN_Pos (13UL) /*!< WAKEUPINTEN (Bit 13) */ +#define EMAC_INTENABLE_WAKEUPINTEN_Msk (0x2000UL) /*!< WAKEUPINTEN (Bitfield-Mask: 0x01) */ +/* ======================================================= INTCLEAR ======================================================== */ +#define EMAC_INTCLEAR_RXOVERRUNINTCLR_Pos (0UL) /*!< RXOVERRUNINTCLR (Bit 0) */ +#define EMAC_INTCLEAR_RXOVERRUNINTCLR_Msk (0x1UL) /*!< RXOVERRUNINTCLR (Bitfield-Mask: 0x01) */ +#define EMAC_INTCLEAR_RXERRORINTCLR_Pos (1UL) /*!< RXERRORINTCLR (Bit 1) */ +#define EMAC_INTCLEAR_RXERRORINTCLR_Msk (0x2UL) /*!< RXERRORINTCLR (Bitfield-Mask: 0x01) */ +#define EMAC_INTCLEAR_RXFINISHEDINTCLR_Pos (2UL) /*!< RXFINISHEDINTCLR (Bit 2) */ +#define EMAC_INTCLEAR_RXFINISHEDINTCLR_Msk (0x4UL) /*!< RXFINISHEDINTCLR (Bitfield-Mask: 0x01) */ +#define EMAC_INTCLEAR_RXDONEINTCLR_Pos (3UL) /*!< RXDONEINTCLR (Bit 3) */ +#define EMAC_INTCLEAR_RXDONEINTCLR_Msk (0x8UL) /*!< RXDONEINTCLR (Bitfield-Mask: 0x01) */ +#define EMAC_INTCLEAR_TXUNDERRUNINTCLR_Pos (4UL) /*!< TXUNDERRUNINTCLR (Bit 4) */ +#define EMAC_INTCLEAR_TXUNDERRUNINTCLR_Msk (0x10UL) /*!< TXUNDERRUNINTCLR (Bitfield-Mask: 0x01) */ +#define EMAC_INTCLEAR_TXERRORINTCLR_Pos (5UL) /*!< TXERRORINTCLR (Bit 5) */ +#define EMAC_INTCLEAR_TXERRORINTCLR_Msk (0x20UL) /*!< TXERRORINTCLR (Bitfield-Mask: 0x01) */ +#define EMAC_INTCLEAR_TXFINISHEDINTCLR_Pos (6UL) /*!< TXFINISHEDINTCLR (Bit 6) */ +#define EMAC_INTCLEAR_TXFINISHEDINTCLR_Msk (0x40UL) /*!< TXFINISHEDINTCLR (Bitfield-Mask: 0x01) */ +#define EMAC_INTCLEAR_TXDONEINTCLR_Pos (7UL) /*!< TXDONEINTCLR (Bit 7) */ +#define EMAC_INTCLEAR_TXDONEINTCLR_Msk (0x80UL) /*!< TXDONEINTCLR (Bitfield-Mask: 0x01) */ +#define EMAC_INTCLEAR_SOFTINTCLR_Pos (12UL) /*!< SOFTINTCLR (Bit 12) */ +#define EMAC_INTCLEAR_SOFTINTCLR_Msk (0x1000UL) /*!< SOFTINTCLR (Bitfield-Mask: 0x01) */ +#define EMAC_INTCLEAR_WAKEUPINTCLR_Pos (13UL) /*!< WAKEUPINTCLR (Bit 13) */ +#define EMAC_INTCLEAR_WAKEUPINTCLR_Msk (0x2000UL) /*!< WAKEUPINTCLR (Bitfield-Mask: 0x01) */ +/* ======================================================== INTSET ========================================================= */ +#define EMAC_INTSET_RXOVERRUNINTSET_Pos (0UL) /*!< RXOVERRUNINTSET (Bit 0) */ +#define EMAC_INTSET_RXOVERRUNINTSET_Msk (0x1UL) /*!< RXOVERRUNINTSET (Bitfield-Mask: 0x01) */ +#define EMAC_INTSET_RXERRORINTSET_Pos (1UL) /*!< RXERRORINTSET (Bit 1) */ +#define EMAC_INTSET_RXERRORINTSET_Msk (0x2UL) /*!< RXERRORINTSET (Bitfield-Mask: 0x01) */ +#define EMAC_INTSET_RXFINISHEDINTSET_Pos (2UL) /*!< RXFINISHEDINTSET (Bit 2) */ +#define EMAC_INTSET_RXFINISHEDINTSET_Msk (0x4UL) /*!< RXFINISHEDINTSET (Bitfield-Mask: 0x01) */ +#define EMAC_INTSET_RXDONEINTSET_Pos (3UL) /*!< RXDONEINTSET (Bit 3) */ +#define EMAC_INTSET_RXDONEINTSET_Msk (0x8UL) /*!< RXDONEINTSET (Bitfield-Mask: 0x01) */ +#define EMAC_INTSET_TXUNDERRUNINTSET_Pos (4UL) /*!< TXUNDERRUNINTSET (Bit 4) */ +#define EMAC_INTSET_TXUNDERRUNINTSET_Msk (0x10UL) /*!< TXUNDERRUNINTSET (Bitfield-Mask: 0x01) */ +#define EMAC_INTSET_TXERRORINTSET_Pos (5UL) /*!< TXERRORINTSET (Bit 5) */ +#define EMAC_INTSET_TXERRORINTSET_Msk (0x20UL) /*!< TXERRORINTSET (Bitfield-Mask: 0x01) */ +#define EMAC_INTSET_TXFINISHEDINTSET_Pos (6UL) /*!< TXFINISHEDINTSET (Bit 6) */ +#define EMAC_INTSET_TXFINISHEDINTSET_Msk (0x40UL) /*!< TXFINISHEDINTSET (Bitfield-Mask: 0x01) */ +#define EMAC_INTSET_TXDONEINTSET_Pos (7UL) /*!< TXDONEINTSET (Bit 7) */ +#define EMAC_INTSET_TXDONEINTSET_Msk (0x80UL) /*!< TXDONEINTSET (Bitfield-Mask: 0x01) */ +#define EMAC_INTSET_SOFTINTSET_Pos (12UL) /*!< SOFTINTSET (Bit 12) */ +#define EMAC_INTSET_SOFTINTSET_Msk (0x1000UL) /*!< SOFTINTSET (Bitfield-Mask: 0x01) */ +#define EMAC_INTSET_WAKEUPINTSET_Pos (13UL) /*!< WAKEUPINTSET (Bit 13) */ +#define EMAC_INTSET_WAKEUPINTSET_Msk (0x2000UL) /*!< WAKEUPINTSET (Bitfield-Mask: 0x01) */ +/* ======================================================= POWERDOWN ======================================================= */ +#define EMAC_POWERDOWN_PD_Pos (31UL) /*!< PD (Bit 31) */ +#define EMAC_POWERDOWN_PD_Msk (0x80000000UL) /*!< PD (Bitfield-Mask: 0x01) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_GPDMA ================ */ +/* =========================================================================================================================== */ + +/* ======================================================== INTSTAT ======================================================== */ +#define GPDMA_INTSTAT_INTSTAT0_Pos (0UL) /*!< INTSTAT0 (Bit 0) */ +#define GPDMA_INTSTAT_INTSTAT0_Msk (0x1UL) /*!< INTSTAT0 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTSTAT_INTSTAT1_Pos (1UL) /*!< INTSTAT1 (Bit 1) */ +#define GPDMA_INTSTAT_INTSTAT1_Msk (0x2UL) /*!< INTSTAT1 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTSTAT_INTSTAT2_Pos (2UL) /*!< INTSTAT2 (Bit 2) */ +#define GPDMA_INTSTAT_INTSTAT2_Msk (0x4UL) /*!< INTSTAT2 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTSTAT_INTSTAT3_Pos (3UL) /*!< INTSTAT3 (Bit 3) */ +#define GPDMA_INTSTAT_INTSTAT3_Msk (0x8UL) /*!< INTSTAT3 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTSTAT_INTSTAT4_Pos (4UL) /*!< INTSTAT4 (Bit 4) */ +#define GPDMA_INTSTAT_INTSTAT4_Msk (0x10UL) /*!< INTSTAT4 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTSTAT_INTSTAT5_Pos (5UL) /*!< INTSTAT5 (Bit 5) */ +#define GPDMA_INTSTAT_INTSTAT5_Msk (0x20UL) /*!< INTSTAT5 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTSTAT_INTSTAT6_Pos (6UL) /*!< INTSTAT6 (Bit 6) */ +#define GPDMA_INTSTAT_INTSTAT6_Msk (0x40UL) /*!< INTSTAT6 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTSTAT_INTSTAT7_Pos (7UL) /*!< INTSTAT7 (Bit 7) */ +#define GPDMA_INTSTAT_INTSTAT7_Msk (0x80UL) /*!< INTSTAT7 (Bitfield-Mask: 0x01) */ +/* ======================================================= INTTCSTAT ======================================================= */ +#define GPDMA_INTTCSTAT_INTTCSTAT0_Pos (0UL) /*!< INTTCSTAT0 (Bit 0) */ +#define GPDMA_INTTCSTAT_INTTCSTAT0_Msk (0x1UL) /*!< INTTCSTAT0 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTTCSTAT_INTTCSTAT1_Pos (1UL) /*!< INTTCSTAT1 (Bit 1) */ +#define GPDMA_INTTCSTAT_INTTCSTAT1_Msk (0x2UL) /*!< INTTCSTAT1 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTTCSTAT_INTTCSTAT2_Pos (2UL) /*!< INTTCSTAT2 (Bit 2) */ +#define GPDMA_INTTCSTAT_INTTCSTAT2_Msk (0x4UL) /*!< INTTCSTAT2 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTTCSTAT_INTTCSTAT3_Pos (3UL) /*!< INTTCSTAT3 (Bit 3) */ +#define GPDMA_INTTCSTAT_INTTCSTAT3_Msk (0x8UL) /*!< INTTCSTAT3 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTTCSTAT_INTTCSTAT4_Pos (4UL) /*!< INTTCSTAT4 (Bit 4) */ +#define GPDMA_INTTCSTAT_INTTCSTAT4_Msk (0x10UL) /*!< INTTCSTAT4 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTTCSTAT_INTTCSTAT5_Pos (5UL) /*!< INTTCSTAT5 (Bit 5) */ +#define GPDMA_INTTCSTAT_INTTCSTAT5_Msk (0x20UL) /*!< INTTCSTAT5 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTTCSTAT_INTTCSTAT6_Pos (6UL) /*!< INTTCSTAT6 (Bit 6) */ +#define GPDMA_INTTCSTAT_INTTCSTAT6_Msk (0x40UL) /*!< INTTCSTAT6 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTTCSTAT_INTTCSTAT7_Pos (7UL) /*!< INTTCSTAT7 (Bit 7) */ +#define GPDMA_INTTCSTAT_INTTCSTAT7_Msk (0x80UL) /*!< INTTCSTAT7 (Bitfield-Mask: 0x01) */ +/* ====================================================== INTTCCLEAR ======================================================= */ +#define GPDMA_INTTCCLEAR_INTTCCLEAR0_Pos (0UL) /*!< INTTCCLEAR0 (Bit 0) */ +#define GPDMA_INTTCCLEAR_INTTCCLEAR0_Msk (0x1UL) /*!< INTTCCLEAR0 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTTCCLEAR_INTTCCLEAR1_Pos (1UL) /*!< INTTCCLEAR1 (Bit 1) */ +#define GPDMA_INTTCCLEAR_INTTCCLEAR1_Msk (0x2UL) /*!< INTTCCLEAR1 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTTCCLEAR_INTTCCLEAR2_Pos (2UL) /*!< INTTCCLEAR2 (Bit 2) */ +#define GPDMA_INTTCCLEAR_INTTCCLEAR2_Msk (0x4UL) /*!< INTTCCLEAR2 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTTCCLEAR_INTTCCLEAR3_Pos (3UL) /*!< INTTCCLEAR3 (Bit 3) */ +#define GPDMA_INTTCCLEAR_INTTCCLEAR3_Msk (0x8UL) /*!< INTTCCLEAR3 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTTCCLEAR_INTTCCLEAR4_Pos (4UL) /*!< INTTCCLEAR4 (Bit 4) */ +#define GPDMA_INTTCCLEAR_INTTCCLEAR4_Msk (0x10UL) /*!< INTTCCLEAR4 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTTCCLEAR_INTTCCLEAR5_Pos (5UL) /*!< INTTCCLEAR5 (Bit 5) */ +#define GPDMA_INTTCCLEAR_INTTCCLEAR5_Msk (0x20UL) /*!< INTTCCLEAR5 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTTCCLEAR_INTTCCLEAR6_Pos (6UL) /*!< INTTCCLEAR6 (Bit 6) */ +#define GPDMA_INTTCCLEAR_INTTCCLEAR6_Msk (0x40UL) /*!< INTTCCLEAR6 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTTCCLEAR_INTTCCLEAR7_Pos (7UL) /*!< INTTCCLEAR7 (Bit 7) */ +#define GPDMA_INTTCCLEAR_INTTCCLEAR7_Msk (0x80UL) /*!< INTTCCLEAR7 (Bitfield-Mask: 0x01) */ +/* ====================================================== INTERRSTAT ======================================================= */ +#define GPDMA_INTERRSTAT_INTERRSTAT0_Pos (0UL) /*!< INTERRSTAT0 (Bit 0) */ +#define GPDMA_INTERRSTAT_INTERRSTAT0_Msk (0x1UL) /*!< INTERRSTAT0 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTERRSTAT_INTERRSTAT1_Pos (1UL) /*!< INTERRSTAT1 (Bit 1) */ +#define GPDMA_INTERRSTAT_INTERRSTAT1_Msk (0x2UL) /*!< INTERRSTAT1 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTERRSTAT_INTERRSTAT2_Pos (2UL) /*!< INTERRSTAT2 (Bit 2) */ +#define GPDMA_INTERRSTAT_INTERRSTAT2_Msk (0x4UL) /*!< INTERRSTAT2 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTERRSTAT_INTERRSTAT3_Pos (3UL) /*!< INTERRSTAT3 (Bit 3) */ +#define GPDMA_INTERRSTAT_INTERRSTAT3_Msk (0x8UL) /*!< INTERRSTAT3 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTERRSTAT_INTERRSTAT4_Pos (4UL) /*!< INTERRSTAT4 (Bit 4) */ +#define GPDMA_INTERRSTAT_INTERRSTAT4_Msk (0x10UL) /*!< INTERRSTAT4 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTERRSTAT_INTERRSTAT5_Pos (5UL) /*!< INTERRSTAT5 (Bit 5) */ +#define GPDMA_INTERRSTAT_INTERRSTAT5_Msk (0x20UL) /*!< INTERRSTAT5 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTERRSTAT_INTERRSTAT6_Pos (6UL) /*!< INTERRSTAT6 (Bit 6) */ +#define GPDMA_INTERRSTAT_INTERRSTAT6_Msk (0x40UL) /*!< INTERRSTAT6 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTERRSTAT_INTERRSTAT7_Pos (7UL) /*!< INTERRSTAT7 (Bit 7) */ +#define GPDMA_INTERRSTAT_INTERRSTAT7_Msk (0x80UL) /*!< INTERRSTAT7 (Bitfield-Mask: 0x01) */ +/* ======================================================= INTERRCLR ======================================================= */ +#define GPDMA_INTERRCLR_INTERRCLR0_Pos (0UL) /*!< INTERRCLR0 (Bit 0) */ +#define GPDMA_INTERRCLR_INTERRCLR0_Msk (0x1UL) /*!< INTERRCLR0 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTERRCLR_INTERRCLR1_Pos (1UL) /*!< INTERRCLR1 (Bit 1) */ +#define GPDMA_INTERRCLR_INTERRCLR1_Msk (0x2UL) /*!< INTERRCLR1 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTERRCLR_INTERRCLR2_Pos (2UL) /*!< INTERRCLR2 (Bit 2) */ +#define GPDMA_INTERRCLR_INTERRCLR2_Msk (0x4UL) /*!< INTERRCLR2 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTERRCLR_INTERRCLR3_Pos (3UL) /*!< INTERRCLR3 (Bit 3) */ +#define GPDMA_INTERRCLR_INTERRCLR3_Msk (0x8UL) /*!< INTERRCLR3 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTERRCLR_INTERRCLR4_Pos (4UL) /*!< INTERRCLR4 (Bit 4) */ +#define GPDMA_INTERRCLR_INTERRCLR4_Msk (0x10UL) /*!< INTERRCLR4 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTERRCLR_INTERRCLR5_Pos (5UL) /*!< INTERRCLR5 (Bit 5) */ +#define GPDMA_INTERRCLR_INTERRCLR5_Msk (0x20UL) /*!< INTERRCLR5 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTERRCLR_INTERRCLR6_Pos (6UL) /*!< INTERRCLR6 (Bit 6) */ +#define GPDMA_INTERRCLR_INTERRCLR6_Msk (0x40UL) /*!< INTERRCLR6 (Bitfield-Mask: 0x01) */ +#define GPDMA_INTERRCLR_INTERRCLR7_Pos (7UL) /*!< INTERRCLR7 (Bit 7) */ +#define GPDMA_INTERRCLR_INTERRCLR7_Msk (0x80UL) /*!< INTERRCLR7 (Bitfield-Mask: 0x01) */ +/* ===================================================== RAWINTTCSTAT ====================================================== */ +#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT0_Pos (0UL) /*!< RAWINTTCSTAT0 (Bit 0) */ +#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT0_Msk (0x1UL) /*!< RAWINTTCSTAT0 (Bitfield-Mask: 0x01) */ +#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT1_Pos (1UL) /*!< RAWINTTCSTAT1 (Bit 1) */ +#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT1_Msk (0x2UL) /*!< RAWINTTCSTAT1 (Bitfield-Mask: 0x01) */ +#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT2_Pos (2UL) /*!< RAWINTTCSTAT2 (Bit 2) */ +#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT2_Msk (0x4UL) /*!< RAWINTTCSTAT2 (Bitfield-Mask: 0x01) */ +#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT3_Pos (3UL) /*!< RAWINTTCSTAT3 (Bit 3) */ +#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT3_Msk (0x8UL) /*!< RAWINTTCSTAT3 (Bitfield-Mask: 0x01) */ +#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT4_Pos (4UL) /*!< RAWINTTCSTAT4 (Bit 4) */ +#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT4_Msk (0x10UL) /*!< RAWINTTCSTAT4 (Bitfield-Mask: 0x01) */ +#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT5_Pos (5UL) /*!< RAWINTTCSTAT5 (Bit 5) */ +#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT5_Msk (0x20UL) /*!< RAWINTTCSTAT5 (Bitfield-Mask: 0x01) */ +#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT6_Pos (6UL) /*!< RAWINTTCSTAT6 (Bit 6) */ +#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT6_Msk (0x40UL) /*!< RAWINTTCSTAT6 (Bitfield-Mask: 0x01) */ +#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT7_Pos (7UL) /*!< RAWINTTCSTAT7 (Bit 7) */ +#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT7_Msk (0x80UL) /*!< RAWINTTCSTAT7 (Bitfield-Mask: 0x01) */ +/* ===================================================== RAWINTERRSTAT ===================================================== */ +#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT0_Pos (0UL) /*!< RAWINTERRSTAT0 (Bit 0) */ +#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT0_Msk (0x1UL) /*!< RAWINTERRSTAT0 (Bitfield-Mask: 0x01) */ +#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT1_Pos (1UL) /*!< RAWINTERRSTAT1 (Bit 1) */ +#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT1_Msk (0x2UL) /*!< RAWINTERRSTAT1 (Bitfield-Mask: 0x01) */ +#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT2_Pos (2UL) /*!< RAWINTERRSTAT2 (Bit 2) */ +#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT2_Msk (0x4UL) /*!< RAWINTERRSTAT2 (Bitfield-Mask: 0x01) */ +#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT3_Pos (3UL) /*!< RAWINTERRSTAT3 (Bit 3) */ +#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT3_Msk (0x8UL) /*!< RAWINTERRSTAT3 (Bitfield-Mask: 0x01) */ +#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT4_Pos (4UL) /*!< RAWINTERRSTAT4 (Bit 4) */ +#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT4_Msk (0x10UL) /*!< RAWINTERRSTAT4 (Bitfield-Mask: 0x01) */ +#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT5_Pos (5UL) /*!< RAWINTERRSTAT5 (Bit 5) */ +#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT5_Msk (0x20UL) /*!< RAWINTERRSTAT5 (Bitfield-Mask: 0x01) */ +#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT6_Pos (6UL) /*!< RAWINTERRSTAT6 (Bit 6) */ +#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT6_Msk (0x40UL) /*!< RAWINTERRSTAT6 (Bitfield-Mask: 0x01) */ +#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT7_Pos (7UL) /*!< RAWINTERRSTAT7 (Bit 7) */ +#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT7_Msk (0x80UL) /*!< RAWINTERRSTAT7 (Bitfield-Mask: 0x01) */ +/* ======================================================= ENBLDCHNS ======================================================= */ +#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS0_Pos (0UL) /*!< ENABLEDCHANNELS0 (Bit 0) */ +#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS0_Msk (0x1UL) /*!< ENABLEDCHANNELS0 (Bitfield-Mask: 0x01) */ +#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS1_Pos (1UL) /*!< ENABLEDCHANNELS1 (Bit 1) */ +#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS1_Msk (0x2UL) /*!< ENABLEDCHANNELS1 (Bitfield-Mask: 0x01) */ +#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS2_Pos (2UL) /*!< ENABLEDCHANNELS2 (Bit 2) */ +#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS2_Msk (0x4UL) /*!< ENABLEDCHANNELS2 (Bitfield-Mask: 0x01) */ +#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS3_Pos (3UL) /*!< ENABLEDCHANNELS3 (Bit 3) */ +#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS3_Msk (0x8UL) /*!< ENABLEDCHANNELS3 (Bitfield-Mask: 0x01) */ +#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS4_Pos (4UL) /*!< ENABLEDCHANNELS4 (Bit 4) */ +#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS4_Msk (0x10UL) /*!< ENABLEDCHANNELS4 (Bitfield-Mask: 0x01) */ +#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS5_Pos (5UL) /*!< ENABLEDCHANNELS5 (Bit 5) */ +#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS5_Msk (0x20UL) /*!< ENABLEDCHANNELS5 (Bitfield-Mask: 0x01) */ +#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS6_Pos (6UL) /*!< ENABLEDCHANNELS6 (Bit 6) */ +#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS6_Msk (0x40UL) /*!< ENABLEDCHANNELS6 (Bitfield-Mask: 0x01) */ +#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS7_Pos (7UL) /*!< ENABLEDCHANNELS7 (Bit 7) */ +#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS7_Msk (0x80UL) /*!< ENABLEDCHANNELS7 (Bitfield-Mask: 0x01) */ +/* ======================================================= SOFTBREQ ======================================================== */ +#define GPDMA_SOFTBREQ_SOFTBREQ0_Pos (0UL) /*!< SOFTBREQ0 (Bit 0) */ +#define GPDMA_SOFTBREQ_SOFTBREQ0_Msk (0x1UL) /*!< SOFTBREQ0 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTBREQ_SOFTBREQ1_Pos (1UL) /*!< SOFTBREQ1 (Bit 1) */ +#define GPDMA_SOFTBREQ_SOFTBREQ1_Msk (0x2UL) /*!< SOFTBREQ1 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTBREQ_SOFTBREQ2_Pos (2UL) /*!< SOFTBREQ2 (Bit 2) */ +#define GPDMA_SOFTBREQ_SOFTBREQ2_Msk (0x4UL) /*!< SOFTBREQ2 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTBREQ_SOFTBREQ3_Pos (3UL) /*!< SOFTBREQ3 (Bit 3) */ +#define GPDMA_SOFTBREQ_SOFTBREQ3_Msk (0x8UL) /*!< SOFTBREQ3 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTBREQ_SOFTBREQ4_Pos (4UL) /*!< SOFTBREQ4 (Bit 4) */ +#define GPDMA_SOFTBREQ_SOFTBREQ4_Msk (0x10UL) /*!< SOFTBREQ4 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTBREQ_SOFTBREQ5_Pos (5UL) /*!< SOFTBREQ5 (Bit 5) */ +#define GPDMA_SOFTBREQ_SOFTBREQ5_Msk (0x20UL) /*!< SOFTBREQ5 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTBREQ_SOFTBREQ6_Pos (6UL) /*!< SOFTBREQ6 (Bit 6) */ +#define GPDMA_SOFTBREQ_SOFTBREQ6_Msk (0x40UL) /*!< SOFTBREQ6 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTBREQ_SOFTBREQ7_Pos (7UL) /*!< SOFTBREQ7 (Bit 7) */ +#define GPDMA_SOFTBREQ_SOFTBREQ7_Msk (0x80UL) /*!< SOFTBREQ7 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTBREQ_SOFTBREQ8_Pos (8UL) /*!< SOFTBREQ8 (Bit 8) */ +#define GPDMA_SOFTBREQ_SOFTBREQ8_Msk (0x100UL) /*!< SOFTBREQ8 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTBREQ_SOFTBREQ9_Pos (9UL) /*!< SOFTBREQ9 (Bit 9) */ +#define GPDMA_SOFTBREQ_SOFTBREQ9_Msk (0x200UL) /*!< SOFTBREQ9 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTBREQ_SOFTBREQ10_Pos (10UL) /*!< SOFTBREQ10 (Bit 10) */ +#define GPDMA_SOFTBREQ_SOFTBREQ10_Msk (0x400UL) /*!< SOFTBREQ10 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTBREQ_SOFTBREQ11_Pos (11UL) /*!< SOFTBREQ11 (Bit 11) */ +#define GPDMA_SOFTBREQ_SOFTBREQ11_Msk (0x800UL) /*!< SOFTBREQ11 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTBREQ_SOFTBREQ12_Pos (12UL) /*!< SOFTBREQ12 (Bit 12) */ +#define GPDMA_SOFTBREQ_SOFTBREQ12_Msk (0x1000UL) /*!< SOFTBREQ12 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTBREQ_SOFTBREQ13_Pos (13UL) /*!< SOFTBREQ13 (Bit 13) */ +#define GPDMA_SOFTBREQ_SOFTBREQ13_Msk (0x2000UL) /*!< SOFTBREQ13 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTBREQ_SOFTBREQ14_Pos (14UL) /*!< SOFTBREQ14 (Bit 14) */ +#define GPDMA_SOFTBREQ_SOFTBREQ14_Msk (0x4000UL) /*!< SOFTBREQ14 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTBREQ_SOFTBREQ15_Pos (15UL) /*!< SOFTBREQ15 (Bit 15) */ +#define GPDMA_SOFTBREQ_SOFTBREQ15_Msk (0x8000UL) /*!< SOFTBREQ15 (Bitfield-Mask: 0x01) */ +/* ======================================================= SOFTSREQ ======================================================== */ +#define GPDMA_SOFTSREQ_SOFTSREQ0_Pos (0UL) /*!< SOFTSREQ0 (Bit 0) */ +#define GPDMA_SOFTSREQ_SOFTSREQ0_Msk (0x1UL) /*!< SOFTSREQ0 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTSREQ_SOFTSREQ1_Pos (1UL) /*!< SOFTSREQ1 (Bit 1) */ +#define GPDMA_SOFTSREQ_SOFTSREQ1_Msk (0x2UL) /*!< SOFTSREQ1 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTSREQ_SOFTSREQ2_Pos (2UL) /*!< SOFTSREQ2 (Bit 2) */ +#define GPDMA_SOFTSREQ_SOFTSREQ2_Msk (0x4UL) /*!< SOFTSREQ2 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTSREQ_SOFTSREQ3_Pos (3UL) /*!< SOFTSREQ3 (Bit 3) */ +#define GPDMA_SOFTSREQ_SOFTSREQ3_Msk (0x8UL) /*!< SOFTSREQ3 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTSREQ_SOFTSREQ4_Pos (4UL) /*!< SOFTSREQ4 (Bit 4) */ +#define GPDMA_SOFTSREQ_SOFTSREQ4_Msk (0x10UL) /*!< SOFTSREQ4 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTSREQ_SOFTSREQ5_Pos (5UL) /*!< SOFTSREQ5 (Bit 5) */ +#define GPDMA_SOFTSREQ_SOFTSREQ5_Msk (0x20UL) /*!< SOFTSREQ5 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTSREQ_SOFTSREQ6_Pos (6UL) /*!< SOFTSREQ6 (Bit 6) */ +#define GPDMA_SOFTSREQ_SOFTSREQ6_Msk (0x40UL) /*!< SOFTSREQ6 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTSREQ_SOFTSREQ7_Pos (7UL) /*!< SOFTSREQ7 (Bit 7) */ +#define GPDMA_SOFTSREQ_SOFTSREQ7_Msk (0x80UL) /*!< SOFTSREQ7 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTSREQ_SOFTSREQ8_Pos (8UL) /*!< SOFTSREQ8 (Bit 8) */ +#define GPDMA_SOFTSREQ_SOFTSREQ8_Msk (0x100UL) /*!< SOFTSREQ8 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTSREQ_SOFTSREQ9_Pos (9UL) /*!< SOFTSREQ9 (Bit 9) */ +#define GPDMA_SOFTSREQ_SOFTSREQ9_Msk (0x200UL) /*!< SOFTSREQ9 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTSREQ_SOFTSREQ10_Pos (10UL) /*!< SOFTSREQ10 (Bit 10) */ +#define GPDMA_SOFTSREQ_SOFTSREQ10_Msk (0x400UL) /*!< SOFTSREQ10 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTSREQ_SOFTSREQ11_Pos (11UL) /*!< SOFTSREQ11 (Bit 11) */ +#define GPDMA_SOFTSREQ_SOFTSREQ11_Msk (0x800UL) /*!< SOFTSREQ11 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTSREQ_SOFTSREQ12_Pos (12UL) /*!< SOFTSREQ12 (Bit 12) */ +#define GPDMA_SOFTSREQ_SOFTSREQ12_Msk (0x1000UL) /*!< SOFTSREQ12 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTSREQ_SOFTSREQ13_Pos (13UL) /*!< SOFTSREQ13 (Bit 13) */ +#define GPDMA_SOFTSREQ_SOFTSREQ13_Msk (0x2000UL) /*!< SOFTSREQ13 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTSREQ_SOFTSREQ14_Pos (14UL) /*!< SOFTSREQ14 (Bit 14) */ +#define GPDMA_SOFTSREQ_SOFTSREQ14_Msk (0x4000UL) /*!< SOFTSREQ14 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTSREQ_SOFTSREQ15_Pos (15UL) /*!< SOFTSREQ15 (Bit 15) */ +#define GPDMA_SOFTSREQ_SOFTSREQ15_Msk (0x8000UL) /*!< SOFTSREQ15 (Bitfield-Mask: 0x01) */ +/* ======================================================= SOFTLBREQ ======================================================= */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ0_Pos (0UL) /*!< SOFTLBREQ0 (Bit 0) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ0_Msk (0x1UL) /*!< SOFTLBREQ0 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ1_Pos (1UL) /*!< SOFTLBREQ1 (Bit 1) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ1_Msk (0x2UL) /*!< SOFTLBREQ1 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ2_Pos (2UL) /*!< SOFTLBREQ2 (Bit 2) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ2_Msk (0x4UL) /*!< SOFTLBREQ2 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ3_Pos (3UL) /*!< SOFTLBREQ3 (Bit 3) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ3_Msk (0x8UL) /*!< SOFTLBREQ3 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ4_Pos (4UL) /*!< SOFTLBREQ4 (Bit 4) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ4_Msk (0x10UL) /*!< SOFTLBREQ4 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ5_Pos (5UL) /*!< SOFTLBREQ5 (Bit 5) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ5_Msk (0x20UL) /*!< SOFTLBREQ5 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ6_Pos (6UL) /*!< SOFTLBREQ6 (Bit 6) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ6_Msk (0x40UL) /*!< SOFTLBREQ6 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ7_Pos (7UL) /*!< SOFTLBREQ7 (Bit 7) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ7_Msk (0x80UL) /*!< SOFTLBREQ7 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ8_Pos (8UL) /*!< SOFTLBREQ8 (Bit 8) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ8_Msk (0x100UL) /*!< SOFTLBREQ8 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ9_Pos (9UL) /*!< SOFTLBREQ9 (Bit 9) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ9_Msk (0x200UL) /*!< SOFTLBREQ9 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ10_Pos (10UL) /*!< SOFTLBREQ10 (Bit 10) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ10_Msk (0x400UL) /*!< SOFTLBREQ10 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ11_Pos (11UL) /*!< SOFTLBREQ11 (Bit 11) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ11_Msk (0x800UL) /*!< SOFTLBREQ11 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ12_Pos (12UL) /*!< SOFTLBREQ12 (Bit 12) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ12_Msk (0x1000UL) /*!< SOFTLBREQ12 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ13_Pos (13UL) /*!< SOFTLBREQ13 (Bit 13) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ13_Msk (0x2000UL) /*!< SOFTLBREQ13 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ14_Pos (14UL) /*!< SOFTLBREQ14 (Bit 14) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ14_Msk (0x4000UL) /*!< SOFTLBREQ14 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ15_Pos (15UL) /*!< SOFTLBREQ15 (Bit 15) */ +#define GPDMA_SOFTLBREQ_SOFTLBREQ15_Msk (0x8000UL) /*!< SOFTLBREQ15 (Bitfield-Mask: 0x01) */ +/* ======================================================= SOFTLSREQ ======================================================= */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ0_Pos (0UL) /*!< SOFTLSREQ0 (Bit 0) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ0_Msk (0x1UL) /*!< SOFTLSREQ0 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ1_Pos (1UL) /*!< SOFTLSREQ1 (Bit 1) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ1_Msk (0x2UL) /*!< SOFTLSREQ1 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ2_Pos (2UL) /*!< SOFTLSREQ2 (Bit 2) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ2_Msk (0x4UL) /*!< SOFTLSREQ2 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ3_Pos (3UL) /*!< SOFTLSREQ3 (Bit 3) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ3_Msk (0x8UL) /*!< SOFTLSREQ3 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ4_Pos (4UL) /*!< SOFTLSREQ4 (Bit 4) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ4_Msk (0x10UL) /*!< SOFTLSREQ4 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ5_Pos (5UL) /*!< SOFTLSREQ5 (Bit 5) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ5_Msk (0x20UL) /*!< SOFTLSREQ5 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ6_Pos (6UL) /*!< SOFTLSREQ6 (Bit 6) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ6_Msk (0x40UL) /*!< SOFTLSREQ6 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ7_Pos (7UL) /*!< SOFTLSREQ7 (Bit 7) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ7_Msk (0x80UL) /*!< SOFTLSREQ7 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ8_Pos (8UL) /*!< SOFTLSREQ8 (Bit 8) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ8_Msk (0x100UL) /*!< SOFTLSREQ8 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ9_Pos (9UL) /*!< SOFTLSREQ9 (Bit 9) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ9_Msk (0x200UL) /*!< SOFTLSREQ9 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ10_Pos (10UL) /*!< SOFTLSREQ10 (Bit 10) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ10_Msk (0x400UL) /*!< SOFTLSREQ10 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ11_Pos (11UL) /*!< SOFTLSREQ11 (Bit 11) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ11_Msk (0x800UL) /*!< SOFTLSREQ11 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ12_Pos (12UL) /*!< SOFTLSREQ12 (Bit 12) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ12_Msk (0x1000UL) /*!< SOFTLSREQ12 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ13_Pos (13UL) /*!< SOFTLSREQ13 (Bit 13) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ13_Msk (0x2000UL) /*!< SOFTLSREQ13 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ14_Pos (14UL) /*!< SOFTLSREQ14 (Bit 14) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ14_Msk (0x4000UL) /*!< SOFTLSREQ14 (Bitfield-Mask: 0x01) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ15_Pos (15UL) /*!< SOFTLSREQ15 (Bit 15) */ +#define GPDMA_SOFTLSREQ_SOFTLSREQ15_Msk (0x8000UL) /*!< SOFTLSREQ15 (Bitfield-Mask: 0x01) */ +/* ======================================================== CONFIG ========================================================= */ +#define GPDMA_CONFIG_E_Pos (0UL) /*!< E (Bit 0) */ +#define GPDMA_CONFIG_E_Msk (0x1UL) /*!< E (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG_M_Pos (1UL) /*!< M (Bit 1) */ +#define GPDMA_CONFIG_M_Msk (0x2UL) /*!< M (Bitfield-Mask: 0x01) */ +/* ========================================================= SYNC ========================================================== */ +#define GPDMA_SYNC_DMACSYNC0_Pos (0UL) /*!< DMACSYNC0 (Bit 0) */ +#define GPDMA_SYNC_DMACSYNC0_Msk (0x1UL) /*!< DMACSYNC0 (Bitfield-Mask: 0x01) */ +#define GPDMA_SYNC_DMACSYNC1_Pos (1UL) /*!< DMACSYNC1 (Bit 1) */ +#define GPDMA_SYNC_DMACSYNC1_Msk (0x2UL) /*!< DMACSYNC1 (Bitfield-Mask: 0x01) */ +#define GPDMA_SYNC_DMACSYNC2_Pos (2UL) /*!< DMACSYNC2 (Bit 2) */ +#define GPDMA_SYNC_DMACSYNC2_Msk (0x4UL) /*!< DMACSYNC2 (Bitfield-Mask: 0x01) */ +#define GPDMA_SYNC_DMACSYNC3_Pos (3UL) /*!< DMACSYNC3 (Bit 3) */ +#define GPDMA_SYNC_DMACSYNC3_Msk (0x8UL) /*!< DMACSYNC3 (Bitfield-Mask: 0x01) */ +#define GPDMA_SYNC_DMACSYNC4_Pos (4UL) /*!< DMACSYNC4 (Bit 4) */ +#define GPDMA_SYNC_DMACSYNC4_Msk (0x10UL) /*!< DMACSYNC4 (Bitfield-Mask: 0x01) */ +#define GPDMA_SYNC_DMACSYNC5_Pos (5UL) /*!< DMACSYNC5 (Bit 5) */ +#define GPDMA_SYNC_DMACSYNC5_Msk (0x20UL) /*!< DMACSYNC5 (Bitfield-Mask: 0x01) */ +#define GPDMA_SYNC_DMACSYNC6_Pos (6UL) /*!< DMACSYNC6 (Bit 6) */ +#define GPDMA_SYNC_DMACSYNC6_Msk (0x40UL) /*!< DMACSYNC6 (Bitfield-Mask: 0x01) */ +#define GPDMA_SYNC_DMACSYNC7_Pos (7UL) /*!< DMACSYNC7 (Bit 7) */ +#define GPDMA_SYNC_DMACSYNC7_Msk (0x80UL) /*!< DMACSYNC7 (Bitfield-Mask: 0x01) */ +#define GPDMA_SYNC_DMACSYNC8_Pos (8UL) /*!< DMACSYNC8 (Bit 8) */ +#define GPDMA_SYNC_DMACSYNC8_Msk (0x100UL) /*!< DMACSYNC8 (Bitfield-Mask: 0x01) */ +#define GPDMA_SYNC_DMACSYNC9_Pos (9UL) /*!< DMACSYNC9 (Bit 9) */ +#define GPDMA_SYNC_DMACSYNC9_Msk (0x200UL) /*!< DMACSYNC9 (Bitfield-Mask: 0x01) */ +#define GPDMA_SYNC_DMACSYNC10_Pos (10UL) /*!< DMACSYNC10 (Bit 10) */ +#define GPDMA_SYNC_DMACSYNC10_Msk (0x400UL) /*!< DMACSYNC10 (Bitfield-Mask: 0x01) */ +#define GPDMA_SYNC_DMACSYNC11_Pos (11UL) /*!< DMACSYNC11 (Bit 11) */ +#define GPDMA_SYNC_DMACSYNC11_Msk (0x800UL) /*!< DMACSYNC11 (Bitfield-Mask: 0x01) */ +#define GPDMA_SYNC_DMACSYNC12_Pos (12UL) /*!< DMACSYNC12 (Bit 12) */ +#define GPDMA_SYNC_DMACSYNC12_Msk (0x1000UL) /*!< DMACSYNC12 (Bitfield-Mask: 0x01) */ +#define GPDMA_SYNC_DMACSYNC13_Pos (13UL) /*!< DMACSYNC13 (Bit 13) */ +#define GPDMA_SYNC_DMACSYNC13_Msk (0x2000UL) /*!< DMACSYNC13 (Bitfield-Mask: 0x01) */ +#define GPDMA_SYNC_DMACSYNC14_Pos (14UL) /*!< DMACSYNC14 (Bit 14) */ +#define GPDMA_SYNC_DMACSYNC14_Msk (0x4000UL) /*!< DMACSYNC14 (Bitfield-Mask: 0x01) */ +#define GPDMA_SYNC_DMACSYNC15_Pos (15UL) /*!< DMACSYNC15 (Bit 15) */ +#define GPDMA_SYNC_DMACSYNC15_Msk (0x8000UL) /*!< DMACSYNC15 (Bitfield-Mask: 0x01) */ +/* ======================================================= SRCADDR0 ======================================================== */ +#define GPDMA_SRCADDR0_SRCADDR_Pos (0UL) /*!< SRCADDR (Bit 0) */ +#define GPDMA_SRCADDR0_SRCADDR_Msk (0xffffffffUL) /*!< SRCADDR (Bitfield-Mask: 0xffffffff) */ +/* ======================================================= SRCADDR1 ======================================================== */ +#define GPDMA_SRCADDR1_SRCADDR_Pos (0UL) /*!< SRCADDR (Bit 0) */ +#define GPDMA_SRCADDR1_SRCADDR_Msk (0xffffffffUL) /*!< SRCADDR (Bitfield-Mask: 0xffffffff) */ +/* ======================================================= SRCADDR2 ======================================================== */ +#define GPDMA_SRCADDR2_SRCADDR_Pos (0UL) /*!< SRCADDR (Bit 0) */ +#define GPDMA_SRCADDR2_SRCADDR_Msk (0xffffffffUL) /*!< SRCADDR (Bitfield-Mask: 0xffffffff) */ +/* ======================================================= SRCADDR3 ======================================================== */ +#define GPDMA_SRCADDR3_SRCADDR_Pos (0UL) /*!< SRCADDR (Bit 0) */ +#define GPDMA_SRCADDR3_SRCADDR_Msk (0xffffffffUL) /*!< SRCADDR (Bitfield-Mask: 0xffffffff) */ +/* ======================================================= SRCADDR4 ======================================================== */ +#define GPDMA_SRCADDR4_SRCADDR_Pos (0UL) /*!< SRCADDR (Bit 0) */ +#define GPDMA_SRCADDR4_SRCADDR_Msk (0xffffffffUL) /*!< SRCADDR (Bitfield-Mask: 0xffffffff) */ +/* ======================================================= SRCADDR5 ======================================================== */ +#define GPDMA_SRCADDR5_SRCADDR_Pos (0UL) /*!< SRCADDR (Bit 0) */ +#define GPDMA_SRCADDR5_SRCADDR_Msk (0xffffffffUL) /*!< SRCADDR (Bitfield-Mask: 0xffffffff) */ +/* ======================================================= SRCADDR6 ======================================================== */ +#define GPDMA_SRCADDR6_SRCADDR_Pos (0UL) /*!< SRCADDR (Bit 0) */ +#define GPDMA_SRCADDR6_SRCADDR_Msk (0xffffffffUL) /*!< SRCADDR (Bitfield-Mask: 0xffffffff) */ +/* ======================================================= SRCADDR7 ======================================================== */ +#define GPDMA_SRCADDR7_SRCADDR_Pos (0UL) /*!< SRCADDR (Bit 0) */ +#define GPDMA_SRCADDR7_SRCADDR_Msk (0xffffffffUL) /*!< SRCADDR (Bitfield-Mask: 0xffffffff) */ +/* ======================================================= DESTADDR0 ======================================================= */ +#define GPDMA_DESTADDR0_DESTADDR_Pos (0UL) /*!< DESTADDR (Bit 0) */ +#define GPDMA_DESTADDR0_DESTADDR_Msk (0xffffffffUL) /*!< DESTADDR (Bitfield-Mask: 0xffffffff) */ +/* ======================================================= DESTADDR1 ======================================================= */ +#define GPDMA_DESTADDR1_DESTADDR_Pos (0UL) /*!< DESTADDR (Bit 0) */ +#define GPDMA_DESTADDR1_DESTADDR_Msk (0xffffffffUL) /*!< DESTADDR (Bitfield-Mask: 0xffffffff) */ +/* ======================================================= DESTADDR2 ======================================================= */ +#define GPDMA_DESTADDR2_DESTADDR_Pos (0UL) /*!< DESTADDR (Bit 0) */ +#define GPDMA_DESTADDR2_DESTADDR_Msk (0xffffffffUL) /*!< DESTADDR (Bitfield-Mask: 0xffffffff) */ +/* ======================================================= DESTADDR3 ======================================================= */ +#define GPDMA_DESTADDR3_DESTADDR_Pos (0UL) /*!< DESTADDR (Bit 0) */ +#define GPDMA_DESTADDR3_DESTADDR_Msk (0xffffffffUL) /*!< DESTADDR (Bitfield-Mask: 0xffffffff) */ +/* ======================================================= DESTADDR4 ======================================================= */ +#define GPDMA_DESTADDR4_DESTADDR_Pos (0UL) /*!< DESTADDR (Bit 0) */ +#define GPDMA_DESTADDR4_DESTADDR_Msk (0xffffffffUL) /*!< DESTADDR (Bitfield-Mask: 0xffffffff) */ +/* ======================================================= DESTADDR5 ======================================================= */ +#define GPDMA_DESTADDR5_DESTADDR_Pos (0UL) /*!< DESTADDR (Bit 0) */ +#define GPDMA_DESTADDR5_DESTADDR_Msk (0xffffffffUL) /*!< DESTADDR (Bitfield-Mask: 0xffffffff) */ +/* ======================================================= DESTADDR6 ======================================================= */ +#define GPDMA_DESTADDR6_DESTADDR_Pos (0UL) /*!< DESTADDR (Bit 0) */ +#define GPDMA_DESTADDR6_DESTADDR_Msk (0xffffffffUL) /*!< DESTADDR (Bitfield-Mask: 0xffffffff) */ +/* ======================================================= DESTADDR7 ======================================================= */ +#define GPDMA_DESTADDR7_DESTADDR_Pos (0UL) /*!< DESTADDR (Bit 0) */ +#define GPDMA_DESTADDR7_DESTADDR_Msk (0xffffffffUL) /*!< DESTADDR (Bitfield-Mask: 0xffffffff) */ +/* ========================================================= LLI0 ========================================================== */ +#define GPDMA_LLI0_LLI_Pos (2UL) /*!< LLI (Bit 2) */ +#define GPDMA_LLI0_LLI_Msk (0xfffffffcUL) /*!< LLI (Bitfield-Mask: 0x3fffffff) */ +/* ========================================================= LLI1 ========================================================== */ +#define GPDMA_LLI1_LLI_Pos (2UL) /*!< LLI (Bit 2) */ +#define GPDMA_LLI1_LLI_Msk (0xfffffffcUL) /*!< LLI (Bitfield-Mask: 0x3fffffff) */ +/* ========================================================= LLI2 ========================================================== */ +#define GPDMA_LLI2_LLI_Pos (2UL) /*!< LLI (Bit 2) */ +#define GPDMA_LLI2_LLI_Msk (0xfffffffcUL) /*!< LLI (Bitfield-Mask: 0x3fffffff) */ +/* ========================================================= LLI3 ========================================================== */ +#define GPDMA_LLI3_LLI_Pos (2UL) /*!< LLI (Bit 2) */ +#define GPDMA_LLI3_LLI_Msk (0xfffffffcUL) /*!< LLI (Bitfield-Mask: 0x3fffffff) */ +/* ========================================================= LLI4 ========================================================== */ +#define GPDMA_LLI4_LLI_Pos (2UL) /*!< LLI (Bit 2) */ +#define GPDMA_LLI4_LLI_Msk (0xfffffffcUL) /*!< LLI (Bitfield-Mask: 0x3fffffff) */ +/* ========================================================= LLI5 ========================================================== */ +#define GPDMA_LLI5_LLI_Pos (2UL) /*!< LLI (Bit 2) */ +#define GPDMA_LLI5_LLI_Msk (0xfffffffcUL) /*!< LLI (Bitfield-Mask: 0x3fffffff) */ +/* ========================================================= LLI6 ========================================================== */ +#define GPDMA_LLI6_LLI_Pos (2UL) /*!< LLI (Bit 2) */ +#define GPDMA_LLI6_LLI_Msk (0xfffffffcUL) /*!< LLI (Bitfield-Mask: 0x3fffffff) */ +/* ========================================================= LLI7 ========================================================== */ +#define GPDMA_LLI7_LLI_Pos (2UL) /*!< LLI (Bit 2) */ +#define GPDMA_LLI7_LLI_Msk (0xfffffffcUL) /*!< LLI (Bitfield-Mask: 0x3fffffff) */ +/* ======================================================= CONTROL0 ======================================================== */ +#define GPDMA_CONTROL0_TRANSFERSIZE_Pos (0UL) /*!< TRANSFERSIZE (Bit 0) */ +#define GPDMA_CONTROL0_TRANSFERSIZE_Msk (0xfffUL) /*!< TRANSFERSIZE (Bitfield-Mask: 0xfff) */ +#define GPDMA_CONTROL0_SBSIZE_Pos (12UL) /*!< SBSIZE (Bit 12) */ +#define GPDMA_CONTROL0_SBSIZE_Msk (0x7000UL) /*!< SBSIZE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL0_DBSIZE_Pos (15UL) /*!< DBSIZE (Bit 15) */ +#define GPDMA_CONTROL0_DBSIZE_Msk (0x38000UL) /*!< DBSIZE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL0_SWIDTH_Pos (18UL) /*!< SWIDTH (Bit 18) */ +#define GPDMA_CONTROL0_SWIDTH_Msk (0x1c0000UL) /*!< SWIDTH (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL0_DWIDTH_Pos (21UL) /*!< DWIDTH (Bit 21) */ +#define GPDMA_CONTROL0_DWIDTH_Msk (0xe00000UL) /*!< DWIDTH (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL0_SI_Pos (26UL) /*!< SI (Bit 26) */ +#define GPDMA_CONTROL0_SI_Msk (0x4000000UL) /*!< SI (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL0_DI_Pos (27UL) /*!< DI (Bit 27) */ +#define GPDMA_CONTROL0_DI_Msk (0x8000000UL) /*!< DI (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL0_PROT1_Pos (28UL) /*!< PROT1 (Bit 28) */ +#define GPDMA_CONTROL0_PROT1_Msk (0x10000000UL) /*!< PROT1 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL0_PROT2_Pos (29UL) /*!< PROT2 (Bit 29) */ +#define GPDMA_CONTROL0_PROT2_Msk (0x20000000UL) /*!< PROT2 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL0_PROT3_Pos (30UL) /*!< PROT3 (Bit 30) */ +#define GPDMA_CONTROL0_PROT3_Msk (0x40000000UL) /*!< PROT3 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL0_I_Pos (31UL) /*!< I (Bit 31) */ +#define GPDMA_CONTROL0_I_Msk (0x80000000UL) /*!< I (Bitfield-Mask: 0x01) */ +/* ======================================================= CONTROL1 ======================================================== */ +#define GPDMA_CONTROL1_TRANSFERSIZE_Pos (0UL) /*!< TRANSFERSIZE (Bit 0) */ +#define GPDMA_CONTROL1_TRANSFERSIZE_Msk (0xfffUL) /*!< TRANSFERSIZE (Bitfield-Mask: 0xfff) */ +#define GPDMA_CONTROL1_SBSIZE_Pos (12UL) /*!< SBSIZE (Bit 12) */ +#define GPDMA_CONTROL1_SBSIZE_Msk (0x7000UL) /*!< SBSIZE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL1_DBSIZE_Pos (15UL) /*!< DBSIZE (Bit 15) */ +#define GPDMA_CONTROL1_DBSIZE_Msk (0x38000UL) /*!< DBSIZE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL1_SWIDTH_Pos (18UL) /*!< SWIDTH (Bit 18) */ +#define GPDMA_CONTROL1_SWIDTH_Msk (0x1c0000UL) /*!< SWIDTH (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL1_DWIDTH_Pos (21UL) /*!< DWIDTH (Bit 21) */ +#define GPDMA_CONTROL1_DWIDTH_Msk (0xe00000UL) /*!< DWIDTH (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL1_SI_Pos (26UL) /*!< SI (Bit 26) */ +#define GPDMA_CONTROL1_SI_Msk (0x4000000UL) /*!< SI (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL1_DI_Pos (27UL) /*!< DI (Bit 27) */ +#define GPDMA_CONTROL1_DI_Msk (0x8000000UL) /*!< DI (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL1_PROT1_Pos (28UL) /*!< PROT1 (Bit 28) */ +#define GPDMA_CONTROL1_PROT1_Msk (0x10000000UL) /*!< PROT1 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL1_PROT2_Pos (29UL) /*!< PROT2 (Bit 29) */ +#define GPDMA_CONTROL1_PROT2_Msk (0x20000000UL) /*!< PROT2 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL1_PROT3_Pos (30UL) /*!< PROT3 (Bit 30) */ +#define GPDMA_CONTROL1_PROT3_Msk (0x40000000UL) /*!< PROT3 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL1_I_Pos (31UL) /*!< I (Bit 31) */ +#define GPDMA_CONTROL1_I_Msk (0x80000000UL) /*!< I (Bitfield-Mask: 0x01) */ +/* ======================================================= CONTROL2 ======================================================== */ +#define GPDMA_CONTROL2_TRANSFERSIZE_Pos (0UL) /*!< TRANSFERSIZE (Bit 0) */ +#define GPDMA_CONTROL2_TRANSFERSIZE_Msk (0xfffUL) /*!< TRANSFERSIZE (Bitfield-Mask: 0xfff) */ +#define GPDMA_CONTROL2_SBSIZE_Pos (12UL) /*!< SBSIZE (Bit 12) */ +#define GPDMA_CONTROL2_SBSIZE_Msk (0x7000UL) /*!< SBSIZE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL2_DBSIZE_Pos (15UL) /*!< DBSIZE (Bit 15) */ +#define GPDMA_CONTROL2_DBSIZE_Msk (0x38000UL) /*!< DBSIZE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL2_SWIDTH_Pos (18UL) /*!< SWIDTH (Bit 18) */ +#define GPDMA_CONTROL2_SWIDTH_Msk (0x1c0000UL) /*!< SWIDTH (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL2_DWIDTH_Pos (21UL) /*!< DWIDTH (Bit 21) */ +#define GPDMA_CONTROL2_DWIDTH_Msk (0xe00000UL) /*!< DWIDTH (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL2_SI_Pos (26UL) /*!< SI (Bit 26) */ +#define GPDMA_CONTROL2_SI_Msk (0x4000000UL) /*!< SI (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL2_DI_Pos (27UL) /*!< DI (Bit 27) */ +#define GPDMA_CONTROL2_DI_Msk (0x8000000UL) /*!< DI (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL2_PROT1_Pos (28UL) /*!< PROT1 (Bit 28) */ +#define GPDMA_CONTROL2_PROT1_Msk (0x10000000UL) /*!< PROT1 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL2_PROT2_Pos (29UL) /*!< PROT2 (Bit 29) */ +#define GPDMA_CONTROL2_PROT2_Msk (0x20000000UL) /*!< PROT2 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL2_PROT3_Pos (30UL) /*!< PROT3 (Bit 30) */ +#define GPDMA_CONTROL2_PROT3_Msk (0x40000000UL) /*!< PROT3 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL2_I_Pos (31UL) /*!< I (Bit 31) */ +#define GPDMA_CONTROL2_I_Msk (0x80000000UL) /*!< I (Bitfield-Mask: 0x01) */ +/* ======================================================= CONTROL3 ======================================================== */ +#define GPDMA_CONTROL3_TRANSFERSIZE_Pos (0UL) /*!< TRANSFERSIZE (Bit 0) */ +#define GPDMA_CONTROL3_TRANSFERSIZE_Msk (0xfffUL) /*!< TRANSFERSIZE (Bitfield-Mask: 0xfff) */ +#define GPDMA_CONTROL3_SBSIZE_Pos (12UL) /*!< SBSIZE (Bit 12) */ +#define GPDMA_CONTROL3_SBSIZE_Msk (0x7000UL) /*!< SBSIZE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL3_DBSIZE_Pos (15UL) /*!< DBSIZE (Bit 15) */ +#define GPDMA_CONTROL3_DBSIZE_Msk (0x38000UL) /*!< DBSIZE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL3_SWIDTH_Pos (18UL) /*!< SWIDTH (Bit 18) */ +#define GPDMA_CONTROL3_SWIDTH_Msk (0x1c0000UL) /*!< SWIDTH (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL3_DWIDTH_Pos (21UL) /*!< DWIDTH (Bit 21) */ +#define GPDMA_CONTROL3_DWIDTH_Msk (0xe00000UL) /*!< DWIDTH (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL3_SI_Pos (26UL) /*!< SI (Bit 26) */ +#define GPDMA_CONTROL3_SI_Msk (0x4000000UL) /*!< SI (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL3_DI_Pos (27UL) /*!< DI (Bit 27) */ +#define GPDMA_CONTROL3_DI_Msk (0x8000000UL) /*!< DI (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL3_PROT1_Pos (28UL) /*!< PROT1 (Bit 28) */ +#define GPDMA_CONTROL3_PROT1_Msk (0x10000000UL) /*!< PROT1 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL3_PROT2_Pos (29UL) /*!< PROT2 (Bit 29) */ +#define GPDMA_CONTROL3_PROT2_Msk (0x20000000UL) /*!< PROT2 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL3_PROT3_Pos (30UL) /*!< PROT3 (Bit 30) */ +#define GPDMA_CONTROL3_PROT3_Msk (0x40000000UL) /*!< PROT3 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL3_I_Pos (31UL) /*!< I (Bit 31) */ +#define GPDMA_CONTROL3_I_Msk (0x80000000UL) /*!< I (Bitfield-Mask: 0x01) */ +/* ======================================================= CONTROL4 ======================================================== */ +#define GPDMA_CONTROL4_TRANSFERSIZE_Pos (0UL) /*!< TRANSFERSIZE (Bit 0) */ +#define GPDMA_CONTROL4_TRANSFERSIZE_Msk (0xfffUL) /*!< TRANSFERSIZE (Bitfield-Mask: 0xfff) */ +#define GPDMA_CONTROL4_SBSIZE_Pos (12UL) /*!< SBSIZE (Bit 12) */ +#define GPDMA_CONTROL4_SBSIZE_Msk (0x7000UL) /*!< SBSIZE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL4_DBSIZE_Pos (15UL) /*!< DBSIZE (Bit 15) */ +#define GPDMA_CONTROL4_DBSIZE_Msk (0x38000UL) /*!< DBSIZE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL4_SWIDTH_Pos (18UL) /*!< SWIDTH (Bit 18) */ +#define GPDMA_CONTROL4_SWIDTH_Msk (0x1c0000UL) /*!< SWIDTH (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL4_DWIDTH_Pos (21UL) /*!< DWIDTH (Bit 21) */ +#define GPDMA_CONTROL4_DWIDTH_Msk (0xe00000UL) /*!< DWIDTH (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL4_SI_Pos (26UL) /*!< SI (Bit 26) */ +#define GPDMA_CONTROL4_SI_Msk (0x4000000UL) /*!< SI (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL4_DI_Pos (27UL) /*!< DI (Bit 27) */ +#define GPDMA_CONTROL4_DI_Msk (0x8000000UL) /*!< DI (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL4_PROT1_Pos (28UL) /*!< PROT1 (Bit 28) */ +#define GPDMA_CONTROL4_PROT1_Msk (0x10000000UL) /*!< PROT1 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL4_PROT2_Pos (29UL) /*!< PROT2 (Bit 29) */ +#define GPDMA_CONTROL4_PROT2_Msk (0x20000000UL) /*!< PROT2 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL4_PROT3_Pos (30UL) /*!< PROT3 (Bit 30) */ +#define GPDMA_CONTROL4_PROT3_Msk (0x40000000UL) /*!< PROT3 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL4_I_Pos (31UL) /*!< I (Bit 31) */ +#define GPDMA_CONTROL4_I_Msk (0x80000000UL) /*!< I (Bitfield-Mask: 0x01) */ +/* ======================================================= CONTROL5 ======================================================== */ +#define GPDMA_CONTROL5_TRANSFERSIZE_Pos (0UL) /*!< TRANSFERSIZE (Bit 0) */ +#define GPDMA_CONTROL5_TRANSFERSIZE_Msk (0xfffUL) /*!< TRANSFERSIZE (Bitfield-Mask: 0xfff) */ +#define GPDMA_CONTROL5_SBSIZE_Pos (12UL) /*!< SBSIZE (Bit 12) */ +#define GPDMA_CONTROL5_SBSIZE_Msk (0x7000UL) /*!< SBSIZE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL5_DBSIZE_Pos (15UL) /*!< DBSIZE (Bit 15) */ +#define GPDMA_CONTROL5_DBSIZE_Msk (0x38000UL) /*!< DBSIZE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL5_SWIDTH_Pos (18UL) /*!< SWIDTH (Bit 18) */ +#define GPDMA_CONTROL5_SWIDTH_Msk (0x1c0000UL) /*!< SWIDTH (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL5_DWIDTH_Pos (21UL) /*!< DWIDTH (Bit 21) */ +#define GPDMA_CONTROL5_DWIDTH_Msk (0xe00000UL) /*!< DWIDTH (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL5_SI_Pos (26UL) /*!< SI (Bit 26) */ +#define GPDMA_CONTROL5_SI_Msk (0x4000000UL) /*!< SI (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL5_DI_Pos (27UL) /*!< DI (Bit 27) */ +#define GPDMA_CONTROL5_DI_Msk (0x8000000UL) /*!< DI (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL5_PROT1_Pos (28UL) /*!< PROT1 (Bit 28) */ +#define GPDMA_CONTROL5_PROT1_Msk (0x10000000UL) /*!< PROT1 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL5_PROT2_Pos (29UL) /*!< PROT2 (Bit 29) */ +#define GPDMA_CONTROL5_PROT2_Msk (0x20000000UL) /*!< PROT2 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL5_PROT3_Pos (30UL) /*!< PROT3 (Bit 30) */ +#define GPDMA_CONTROL5_PROT3_Msk (0x40000000UL) /*!< PROT3 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL5_I_Pos (31UL) /*!< I (Bit 31) */ +#define GPDMA_CONTROL5_I_Msk (0x80000000UL) /*!< I (Bitfield-Mask: 0x01) */ +/* ======================================================= CONTROL6 ======================================================== */ +#define GPDMA_CONTROL6_TRANSFERSIZE_Pos (0UL) /*!< TRANSFERSIZE (Bit 0) */ +#define GPDMA_CONTROL6_TRANSFERSIZE_Msk (0xfffUL) /*!< TRANSFERSIZE (Bitfield-Mask: 0xfff) */ +#define GPDMA_CONTROL6_SBSIZE_Pos (12UL) /*!< SBSIZE (Bit 12) */ +#define GPDMA_CONTROL6_SBSIZE_Msk (0x7000UL) /*!< SBSIZE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL6_DBSIZE_Pos (15UL) /*!< DBSIZE (Bit 15) */ +#define GPDMA_CONTROL6_DBSIZE_Msk (0x38000UL) /*!< DBSIZE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL6_SWIDTH_Pos (18UL) /*!< SWIDTH (Bit 18) */ +#define GPDMA_CONTROL6_SWIDTH_Msk (0x1c0000UL) /*!< SWIDTH (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL6_DWIDTH_Pos (21UL) /*!< DWIDTH (Bit 21) */ +#define GPDMA_CONTROL6_DWIDTH_Msk (0xe00000UL) /*!< DWIDTH (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL6_SI_Pos (26UL) /*!< SI (Bit 26) */ +#define GPDMA_CONTROL6_SI_Msk (0x4000000UL) /*!< SI (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL6_DI_Pos (27UL) /*!< DI (Bit 27) */ +#define GPDMA_CONTROL6_DI_Msk (0x8000000UL) /*!< DI (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL6_PROT1_Pos (28UL) /*!< PROT1 (Bit 28) */ +#define GPDMA_CONTROL6_PROT1_Msk (0x10000000UL) /*!< PROT1 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL6_PROT2_Pos (29UL) /*!< PROT2 (Bit 29) */ +#define GPDMA_CONTROL6_PROT2_Msk (0x20000000UL) /*!< PROT2 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL6_PROT3_Pos (30UL) /*!< PROT3 (Bit 30) */ +#define GPDMA_CONTROL6_PROT3_Msk (0x40000000UL) /*!< PROT3 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL6_I_Pos (31UL) /*!< I (Bit 31) */ +#define GPDMA_CONTROL6_I_Msk (0x80000000UL) /*!< I (Bitfield-Mask: 0x01) */ +/* ======================================================= CONTROL7 ======================================================== */ +#define GPDMA_CONTROL7_TRANSFERSIZE_Pos (0UL) /*!< TRANSFERSIZE (Bit 0) */ +#define GPDMA_CONTROL7_TRANSFERSIZE_Msk (0xfffUL) /*!< TRANSFERSIZE (Bitfield-Mask: 0xfff) */ +#define GPDMA_CONTROL7_SBSIZE_Pos (12UL) /*!< SBSIZE (Bit 12) */ +#define GPDMA_CONTROL7_SBSIZE_Msk (0x7000UL) /*!< SBSIZE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL7_DBSIZE_Pos (15UL) /*!< DBSIZE (Bit 15) */ +#define GPDMA_CONTROL7_DBSIZE_Msk (0x38000UL) /*!< DBSIZE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL7_SWIDTH_Pos (18UL) /*!< SWIDTH (Bit 18) */ +#define GPDMA_CONTROL7_SWIDTH_Msk (0x1c0000UL) /*!< SWIDTH (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL7_DWIDTH_Pos (21UL) /*!< DWIDTH (Bit 21) */ +#define GPDMA_CONTROL7_DWIDTH_Msk (0xe00000UL) /*!< DWIDTH (Bitfield-Mask: 0x07) */ +#define GPDMA_CONTROL7_SI_Pos (26UL) /*!< SI (Bit 26) */ +#define GPDMA_CONTROL7_SI_Msk (0x4000000UL) /*!< SI (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL7_DI_Pos (27UL) /*!< DI (Bit 27) */ +#define GPDMA_CONTROL7_DI_Msk (0x8000000UL) /*!< DI (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL7_PROT1_Pos (28UL) /*!< PROT1 (Bit 28) */ +#define GPDMA_CONTROL7_PROT1_Msk (0x10000000UL) /*!< PROT1 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL7_PROT2_Pos (29UL) /*!< PROT2 (Bit 29) */ +#define GPDMA_CONTROL7_PROT2_Msk (0x20000000UL) /*!< PROT2 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL7_PROT3_Pos (30UL) /*!< PROT3 (Bit 30) */ +#define GPDMA_CONTROL7_PROT3_Msk (0x40000000UL) /*!< PROT3 (Bitfield-Mask: 0x01) */ +#define GPDMA_CONTROL7_I_Pos (31UL) /*!< I (Bit 31) */ +#define GPDMA_CONTROL7_I_Msk (0x80000000UL) /*!< I (Bitfield-Mask: 0x01) */ +/* ======================================================== CONFIG0 ======================================================== */ +#define GPDMA_CONFIG0_E_Pos (0UL) /*!< E (Bit 0) */ +#define GPDMA_CONFIG0_E_Msk (0x1UL) /*!< E (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG0_SRCPERIPHERAL_Pos (1UL) /*!< SRCPERIPHERAL (Bit 1) */ +#define GPDMA_CONFIG0_SRCPERIPHERAL_Msk (0x3eUL) /*!< SRCPERIPHERAL (Bitfield-Mask: 0x1f) */ +#define GPDMA_CONFIG0_DESTPERIPHERAL_Pos (6UL) /*!< DESTPERIPHERAL (Bit 6) */ +#define GPDMA_CONFIG0_DESTPERIPHERAL_Msk (0x7c0UL) /*!< DESTPERIPHERAL (Bitfield-Mask: 0x1f) */ +#define GPDMA_CONFIG0_TRANSFERTYPE_Pos (11UL) /*!< TRANSFERTYPE (Bit 11) */ +#define GPDMA_CONFIG0_TRANSFERTYPE_Msk (0x3800UL) /*!< TRANSFERTYPE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONFIG0_IE_Pos (14UL) /*!< IE (Bit 14) */ +#define GPDMA_CONFIG0_IE_Msk (0x4000UL) /*!< IE (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG0_ITC_Pos (15UL) /*!< ITC (Bit 15) */ +#define GPDMA_CONFIG0_ITC_Msk (0x8000UL) /*!< ITC (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG0_L_Pos (16UL) /*!< L (Bit 16) */ +#define GPDMA_CONFIG0_L_Msk (0x10000UL) /*!< L (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG0_A_Pos (17UL) /*!< A (Bit 17) */ +#define GPDMA_CONFIG0_A_Msk (0x20000UL) /*!< A (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG0_H_Pos (18UL) /*!< H (Bit 18) */ +#define GPDMA_CONFIG0_H_Msk (0x40000UL) /*!< H (Bitfield-Mask: 0x01) */ +/* ======================================================== CONFIG1 ======================================================== */ +#define GPDMA_CONFIG1_E_Pos (0UL) /*!< E (Bit 0) */ +#define GPDMA_CONFIG1_E_Msk (0x1UL) /*!< E (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG1_SRCPERIPHERAL_Pos (1UL) /*!< SRCPERIPHERAL (Bit 1) */ +#define GPDMA_CONFIG1_SRCPERIPHERAL_Msk (0x3eUL) /*!< SRCPERIPHERAL (Bitfield-Mask: 0x1f) */ +#define GPDMA_CONFIG1_DESTPERIPHERAL_Pos (6UL) /*!< DESTPERIPHERAL (Bit 6) */ +#define GPDMA_CONFIG1_DESTPERIPHERAL_Msk (0x7c0UL) /*!< DESTPERIPHERAL (Bitfield-Mask: 0x1f) */ +#define GPDMA_CONFIG1_TRANSFERTYPE_Pos (11UL) /*!< TRANSFERTYPE (Bit 11) */ +#define GPDMA_CONFIG1_TRANSFERTYPE_Msk (0x3800UL) /*!< TRANSFERTYPE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONFIG1_IE_Pos (14UL) /*!< IE (Bit 14) */ +#define GPDMA_CONFIG1_IE_Msk (0x4000UL) /*!< IE (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG1_ITC_Pos (15UL) /*!< ITC (Bit 15) */ +#define GPDMA_CONFIG1_ITC_Msk (0x8000UL) /*!< ITC (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG1_L_Pos (16UL) /*!< L (Bit 16) */ +#define GPDMA_CONFIG1_L_Msk (0x10000UL) /*!< L (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG1_A_Pos (17UL) /*!< A (Bit 17) */ +#define GPDMA_CONFIG1_A_Msk (0x20000UL) /*!< A (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG1_H_Pos (18UL) /*!< H (Bit 18) */ +#define GPDMA_CONFIG1_H_Msk (0x40000UL) /*!< H (Bitfield-Mask: 0x01) */ +/* ======================================================== CONFIG2 ======================================================== */ +#define GPDMA_CONFIG2_E_Pos (0UL) /*!< E (Bit 0) */ +#define GPDMA_CONFIG2_E_Msk (0x1UL) /*!< E (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG2_SRCPERIPHERAL_Pos (1UL) /*!< SRCPERIPHERAL (Bit 1) */ +#define GPDMA_CONFIG2_SRCPERIPHERAL_Msk (0x3eUL) /*!< SRCPERIPHERAL (Bitfield-Mask: 0x1f) */ +#define GPDMA_CONFIG2_DESTPERIPHERAL_Pos (6UL) /*!< DESTPERIPHERAL (Bit 6) */ +#define GPDMA_CONFIG2_DESTPERIPHERAL_Msk (0x7c0UL) /*!< DESTPERIPHERAL (Bitfield-Mask: 0x1f) */ +#define GPDMA_CONFIG2_TRANSFERTYPE_Pos (11UL) /*!< TRANSFERTYPE (Bit 11) */ +#define GPDMA_CONFIG2_TRANSFERTYPE_Msk (0x3800UL) /*!< TRANSFERTYPE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONFIG2_IE_Pos (14UL) /*!< IE (Bit 14) */ +#define GPDMA_CONFIG2_IE_Msk (0x4000UL) /*!< IE (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG2_ITC_Pos (15UL) /*!< ITC (Bit 15) */ +#define GPDMA_CONFIG2_ITC_Msk (0x8000UL) /*!< ITC (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG2_L_Pos (16UL) /*!< L (Bit 16) */ +#define GPDMA_CONFIG2_L_Msk (0x10000UL) /*!< L (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG2_A_Pos (17UL) /*!< A (Bit 17) */ +#define GPDMA_CONFIG2_A_Msk (0x20000UL) /*!< A (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG2_H_Pos (18UL) /*!< H (Bit 18) */ +#define GPDMA_CONFIG2_H_Msk (0x40000UL) /*!< H (Bitfield-Mask: 0x01) */ +/* ======================================================== CONFIG3 ======================================================== */ +#define GPDMA_CONFIG3_E_Pos (0UL) /*!< E (Bit 0) */ +#define GPDMA_CONFIG3_E_Msk (0x1UL) /*!< E (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG3_SRCPERIPHERAL_Pos (1UL) /*!< SRCPERIPHERAL (Bit 1) */ +#define GPDMA_CONFIG3_SRCPERIPHERAL_Msk (0x3eUL) /*!< SRCPERIPHERAL (Bitfield-Mask: 0x1f) */ +#define GPDMA_CONFIG3_DESTPERIPHERAL_Pos (6UL) /*!< DESTPERIPHERAL (Bit 6) */ +#define GPDMA_CONFIG3_DESTPERIPHERAL_Msk (0x7c0UL) /*!< DESTPERIPHERAL (Bitfield-Mask: 0x1f) */ +#define GPDMA_CONFIG3_TRANSFERTYPE_Pos (11UL) /*!< TRANSFERTYPE (Bit 11) */ +#define GPDMA_CONFIG3_TRANSFERTYPE_Msk (0x3800UL) /*!< TRANSFERTYPE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONFIG3_IE_Pos (14UL) /*!< IE (Bit 14) */ +#define GPDMA_CONFIG3_IE_Msk (0x4000UL) /*!< IE (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG3_ITC_Pos (15UL) /*!< ITC (Bit 15) */ +#define GPDMA_CONFIG3_ITC_Msk (0x8000UL) /*!< ITC (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG3_L_Pos (16UL) /*!< L (Bit 16) */ +#define GPDMA_CONFIG3_L_Msk (0x10000UL) /*!< L (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG3_A_Pos (17UL) /*!< A (Bit 17) */ +#define GPDMA_CONFIG3_A_Msk (0x20000UL) /*!< A (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG3_H_Pos (18UL) /*!< H (Bit 18) */ +#define GPDMA_CONFIG3_H_Msk (0x40000UL) /*!< H (Bitfield-Mask: 0x01) */ +/* ======================================================== CONFIG4 ======================================================== */ +#define GPDMA_CONFIG4_E_Pos (0UL) /*!< E (Bit 0) */ +#define GPDMA_CONFIG4_E_Msk (0x1UL) /*!< E (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG4_SRCPERIPHERAL_Pos (1UL) /*!< SRCPERIPHERAL (Bit 1) */ +#define GPDMA_CONFIG4_SRCPERIPHERAL_Msk (0x3eUL) /*!< SRCPERIPHERAL (Bitfield-Mask: 0x1f) */ +#define GPDMA_CONFIG4_DESTPERIPHERAL_Pos (6UL) /*!< DESTPERIPHERAL (Bit 6) */ +#define GPDMA_CONFIG4_DESTPERIPHERAL_Msk (0x7c0UL) /*!< DESTPERIPHERAL (Bitfield-Mask: 0x1f) */ +#define GPDMA_CONFIG4_TRANSFERTYPE_Pos (11UL) /*!< TRANSFERTYPE (Bit 11) */ +#define GPDMA_CONFIG4_TRANSFERTYPE_Msk (0x3800UL) /*!< TRANSFERTYPE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONFIG4_IE_Pos (14UL) /*!< IE (Bit 14) */ +#define GPDMA_CONFIG4_IE_Msk (0x4000UL) /*!< IE (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG4_ITC_Pos (15UL) /*!< ITC (Bit 15) */ +#define GPDMA_CONFIG4_ITC_Msk (0x8000UL) /*!< ITC (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG4_L_Pos (16UL) /*!< L (Bit 16) */ +#define GPDMA_CONFIG4_L_Msk (0x10000UL) /*!< L (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG4_A_Pos (17UL) /*!< A (Bit 17) */ +#define GPDMA_CONFIG4_A_Msk (0x20000UL) /*!< A (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG4_H_Pos (18UL) /*!< H (Bit 18) */ +#define GPDMA_CONFIG4_H_Msk (0x40000UL) /*!< H (Bitfield-Mask: 0x01) */ +/* ======================================================== CONFIG5 ======================================================== */ +#define GPDMA_CONFIG5_E_Pos (0UL) /*!< E (Bit 0) */ +#define GPDMA_CONFIG5_E_Msk (0x1UL) /*!< E (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG5_SRCPERIPHERAL_Pos (1UL) /*!< SRCPERIPHERAL (Bit 1) */ +#define GPDMA_CONFIG5_SRCPERIPHERAL_Msk (0x3eUL) /*!< SRCPERIPHERAL (Bitfield-Mask: 0x1f) */ +#define GPDMA_CONFIG5_DESTPERIPHERAL_Pos (6UL) /*!< DESTPERIPHERAL (Bit 6) */ +#define GPDMA_CONFIG5_DESTPERIPHERAL_Msk (0x7c0UL) /*!< DESTPERIPHERAL (Bitfield-Mask: 0x1f) */ +#define GPDMA_CONFIG5_TRANSFERTYPE_Pos (11UL) /*!< TRANSFERTYPE (Bit 11) */ +#define GPDMA_CONFIG5_TRANSFERTYPE_Msk (0x3800UL) /*!< TRANSFERTYPE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONFIG5_IE_Pos (14UL) /*!< IE (Bit 14) */ +#define GPDMA_CONFIG5_IE_Msk (0x4000UL) /*!< IE (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG5_ITC_Pos (15UL) /*!< ITC (Bit 15) */ +#define GPDMA_CONFIG5_ITC_Msk (0x8000UL) /*!< ITC (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG5_L_Pos (16UL) /*!< L (Bit 16) */ +#define GPDMA_CONFIG5_L_Msk (0x10000UL) /*!< L (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG5_A_Pos (17UL) /*!< A (Bit 17) */ +#define GPDMA_CONFIG5_A_Msk (0x20000UL) /*!< A (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG5_H_Pos (18UL) /*!< H (Bit 18) */ +#define GPDMA_CONFIG5_H_Msk (0x40000UL) /*!< H (Bitfield-Mask: 0x01) */ +/* ======================================================== CONFIG6 ======================================================== */ +#define GPDMA_CONFIG6_E_Pos (0UL) /*!< E (Bit 0) */ +#define GPDMA_CONFIG6_E_Msk (0x1UL) /*!< E (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG6_SRCPERIPHERAL_Pos (1UL) /*!< SRCPERIPHERAL (Bit 1) */ +#define GPDMA_CONFIG6_SRCPERIPHERAL_Msk (0x3eUL) /*!< SRCPERIPHERAL (Bitfield-Mask: 0x1f) */ +#define GPDMA_CONFIG6_DESTPERIPHERAL_Pos (6UL) /*!< DESTPERIPHERAL (Bit 6) */ +#define GPDMA_CONFIG6_DESTPERIPHERAL_Msk (0x7c0UL) /*!< DESTPERIPHERAL (Bitfield-Mask: 0x1f) */ +#define GPDMA_CONFIG6_TRANSFERTYPE_Pos (11UL) /*!< TRANSFERTYPE (Bit 11) */ +#define GPDMA_CONFIG6_TRANSFERTYPE_Msk (0x3800UL) /*!< TRANSFERTYPE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONFIG6_IE_Pos (14UL) /*!< IE (Bit 14) */ +#define GPDMA_CONFIG6_IE_Msk (0x4000UL) /*!< IE (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG6_ITC_Pos (15UL) /*!< ITC (Bit 15) */ +#define GPDMA_CONFIG6_ITC_Msk (0x8000UL) /*!< ITC (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG6_L_Pos (16UL) /*!< L (Bit 16) */ +#define GPDMA_CONFIG6_L_Msk (0x10000UL) /*!< L (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG6_A_Pos (17UL) /*!< A (Bit 17) */ +#define GPDMA_CONFIG6_A_Msk (0x20000UL) /*!< A (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG6_H_Pos (18UL) /*!< H (Bit 18) */ +#define GPDMA_CONFIG6_H_Msk (0x40000UL) /*!< H (Bitfield-Mask: 0x01) */ +/* ======================================================== CONFIG7 ======================================================== */ +#define GPDMA_CONFIG7_E_Pos (0UL) /*!< E (Bit 0) */ +#define GPDMA_CONFIG7_E_Msk (0x1UL) /*!< E (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG7_SRCPERIPHERAL_Pos (1UL) /*!< SRCPERIPHERAL (Bit 1) */ +#define GPDMA_CONFIG7_SRCPERIPHERAL_Msk (0x3eUL) /*!< SRCPERIPHERAL (Bitfield-Mask: 0x1f) */ +#define GPDMA_CONFIG7_DESTPERIPHERAL_Pos (6UL) /*!< DESTPERIPHERAL (Bit 6) */ +#define GPDMA_CONFIG7_DESTPERIPHERAL_Msk (0x7c0UL) /*!< DESTPERIPHERAL (Bitfield-Mask: 0x1f) */ +#define GPDMA_CONFIG7_TRANSFERTYPE_Pos (11UL) /*!< TRANSFERTYPE (Bit 11) */ +#define GPDMA_CONFIG7_TRANSFERTYPE_Msk (0x3800UL) /*!< TRANSFERTYPE (Bitfield-Mask: 0x07) */ +#define GPDMA_CONFIG7_IE_Pos (14UL) /*!< IE (Bit 14) */ +#define GPDMA_CONFIG7_IE_Msk (0x4000UL) /*!< IE (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG7_ITC_Pos (15UL) /*!< ITC (Bit 15) */ +#define GPDMA_CONFIG7_ITC_Msk (0x8000UL) /*!< ITC (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG7_L_Pos (16UL) /*!< L (Bit 16) */ +#define GPDMA_CONFIG7_L_Msk (0x10000UL) /*!< L (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG7_A_Pos (17UL) /*!< A (Bit 17) */ +#define GPDMA_CONFIG7_A_Msk (0x20000UL) /*!< A (Bitfield-Mask: 0x01) */ +#define GPDMA_CONFIG7_H_Pos (18UL) /*!< H (Bit 18) */ +#define GPDMA_CONFIG7_H_Msk (0x40000UL) /*!< H (Bitfield-Mask: 0x01) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_USB ================ */ +/* =========================================================================================================================== */ + +/* ========================================================= INTST ========================================================= */ +#define USB_INTST_TMR_Pos (0UL) /*!< TMR (Bit 0) */ +#define USB_INTST_TMR_Msk (0x1UL) /*!< TMR (Bitfield-Mask: 0x01) */ +#define USB_INTST_REMOVE_PU_Pos (1UL) /*!< REMOVE_PU (Bit 1) */ +#define USB_INTST_REMOVE_PU_Msk (0x2UL) /*!< REMOVE_PU (Bitfield-Mask: 0x01) */ +#define USB_INTST_HNP_FAILURE_Pos (2UL) /*!< HNP_FAILURE (Bit 2) */ +#define USB_INTST_HNP_FAILURE_Msk (0x4UL) /*!< HNP_FAILURE (Bitfield-Mask: 0x01) */ +#define USB_INTST_HNP_SUCCESS_Pos (3UL) /*!< HNP_SUCCESS (Bit 3) */ +#define USB_INTST_HNP_SUCCESS_Msk (0x8UL) /*!< HNP_SUCCESS (Bitfield-Mask: 0x01) */ +/* ========================================================= INTEN ========================================================= */ +#define USB_INTEN_TMR_EN_Pos (0UL) /*!< TMR_EN (Bit 0) */ +#define USB_INTEN_TMR_EN_Msk (0x1UL) /*!< TMR_EN (Bitfield-Mask: 0x01) */ +#define USB_INTEN_REMOVE_PU_EN_Pos (1UL) /*!< REMOVE_PU_EN (Bit 1) */ +#define USB_INTEN_REMOVE_PU_EN_Msk (0x2UL) /*!< REMOVE_PU_EN (Bitfield-Mask: 0x01) */ +#define USB_INTEN_HNP_FAILURE_EN_Pos (2UL) /*!< HNP_FAILURE_EN (Bit 2) */ +#define USB_INTEN_HNP_FAILURE_EN_Msk (0x4UL) /*!< HNP_FAILURE_EN (Bitfield-Mask: 0x01) */ +#define USB_INTEN_HNP_SUCCES_EN_Pos (3UL) /*!< HNP_SUCCES_EN (Bit 3) */ +#define USB_INTEN_HNP_SUCCES_EN_Msk (0x8UL) /*!< HNP_SUCCES_EN (Bitfield-Mask: 0x01) */ +/* ======================================================== INTSET ========================================================= */ +#define USB_INTSET_TMR_SET_Pos (0UL) /*!< TMR_SET (Bit 0) */ +#define USB_INTSET_TMR_SET_Msk (0x1UL) /*!< TMR_SET (Bitfield-Mask: 0x01) */ +#define USB_INTSET_REMOVE_PU_SET_Pos (1UL) /*!< REMOVE_PU_SET (Bit 1) */ +#define USB_INTSET_REMOVE_PU_SET_Msk (0x2UL) /*!< REMOVE_PU_SET (Bitfield-Mask: 0x01) */ +#define USB_INTSET_HNP_FAILURE_SET_Pos (2UL) /*!< HNP_FAILURE_SET (Bit 2) */ +#define USB_INTSET_HNP_FAILURE_SET_Msk (0x4UL) /*!< HNP_FAILURE_SET (Bitfield-Mask: 0x01) */ +#define USB_INTSET_HNP_SUCCES_SET_Pos (3UL) /*!< HNP_SUCCES_SET (Bit 3) */ +#define USB_INTSET_HNP_SUCCES_SET_Msk (0x8UL) /*!< HNP_SUCCES_SET (Bitfield-Mask: 0x01) */ +/* ======================================================== INTCLR ========================================================= */ +#define USB_INTCLR_TMR_CLR_Pos (0UL) /*!< TMR_CLR (Bit 0) */ +#define USB_INTCLR_TMR_CLR_Msk (0x1UL) /*!< TMR_CLR (Bitfield-Mask: 0x01) */ +#define USB_INTCLR_REMOVE_PU_CLR_Pos (1UL) /*!< REMOVE_PU_CLR (Bit 1) */ +#define USB_INTCLR_REMOVE_PU_CLR_Msk (0x2UL) /*!< REMOVE_PU_CLR (Bitfield-Mask: 0x01) */ +#define USB_INTCLR_HNP_FAILURE_CLR_Pos (2UL) /*!< HNP_FAILURE_CLR (Bit 2) */ +#define USB_INTCLR_HNP_FAILURE_CLR_Msk (0x4UL) /*!< HNP_FAILURE_CLR (Bitfield-Mask: 0x01) */ +#define USB_INTCLR_HNP_SUCCES_CLR_Pos (3UL) /*!< HNP_SUCCES_CLR (Bit 3) */ +#define USB_INTCLR_HNP_SUCCES_CLR_Msk (0x8UL) /*!< HNP_SUCCES_CLR (Bitfield-Mask: 0x01) */ +/* ======================================================== STCTRL ========================================================= */ +#define USB_STCTRL_PORT_FUNC_Pos (0UL) /*!< PORT_FUNC (Bit 0) */ +#define USB_STCTRL_PORT_FUNC_Msk (0x3UL) /*!< PORT_FUNC (Bitfield-Mask: 0x03) */ +#define USB_STCTRL_TMR_SCALE_Pos (2UL) /*!< TMR_SCALE (Bit 2) */ +#define USB_STCTRL_TMR_SCALE_Msk (0xcUL) /*!< TMR_SCALE (Bitfield-Mask: 0x03) */ +#define USB_STCTRL_TMR_MODE_Pos (4UL) /*!< TMR_MODE (Bit 4) */ +#define USB_STCTRL_TMR_MODE_Msk (0x10UL) /*!< TMR_MODE (Bitfield-Mask: 0x01) */ +#define USB_STCTRL_TMR_EN_Pos (5UL) /*!< TMR_EN (Bit 5) */ +#define USB_STCTRL_TMR_EN_Msk (0x20UL) /*!< TMR_EN (Bitfield-Mask: 0x01) */ +#define USB_STCTRL_TMR_RST_Pos (6UL) /*!< TMR_RST (Bit 6) */ +#define USB_STCTRL_TMR_RST_Msk (0x40UL) /*!< TMR_RST (Bitfield-Mask: 0x01) */ +#define USB_STCTRL_B_HNP_TRACK_Pos (8UL) /*!< B_HNP_TRACK (Bit 8) */ +#define USB_STCTRL_B_HNP_TRACK_Msk (0x100UL) /*!< B_HNP_TRACK (Bitfield-Mask: 0x01) */ +#define USB_STCTRL_A_HNP_TRACK_Pos (9UL) /*!< A_HNP_TRACK (Bit 9) */ +#define USB_STCTRL_A_HNP_TRACK_Msk (0x200UL) /*!< A_HNP_TRACK (Bitfield-Mask: 0x01) */ +#define USB_STCTRL_PU_REMOVED_Pos (10UL) /*!< PU_REMOVED (Bit 10) */ +#define USB_STCTRL_PU_REMOVED_Msk (0x400UL) /*!< PU_REMOVED (Bitfield-Mask: 0x01) */ +#define USB_STCTRL_TMR_CNT_Pos (16UL) /*!< TMR_CNT (Bit 16) */ +#define USB_STCTRL_TMR_CNT_Msk (0xffff0000UL) /*!< TMR_CNT (Bitfield-Mask: 0xffff) */ +/* ========================================================== TMR ========================================================== */ +#define USB_TMR_TIMEOUT_CNT_Pos (0UL) /*!< TIMEOUT_CNT (Bit 0) */ +#define USB_TMR_TIMEOUT_CNT_Msk (0xffffUL) /*!< TIMEOUT_CNT (Bitfield-Mask: 0xffff) */ +/* ======================================================= DEVINTST ======================================================== */ +#define USB_DEVINTST_FRAME_Pos (0UL) /*!< FRAME (Bit 0) */ +#define USB_DEVINTST_FRAME_Msk (0x1UL) /*!< FRAME (Bitfield-Mask: 0x01) */ +#define USB_DEVINTST_EP_FAST_Pos (1UL) /*!< EP_FAST (Bit 1) */ +#define USB_DEVINTST_EP_FAST_Msk (0x2UL) /*!< EP_FAST (Bitfield-Mask: 0x01) */ +#define USB_DEVINTST_EP_SLOW_Pos (2UL) /*!< EP_SLOW (Bit 2) */ +#define USB_DEVINTST_EP_SLOW_Msk (0x4UL) /*!< EP_SLOW (Bitfield-Mask: 0x01) */ +#define USB_DEVINTST_DEV_STAT_Pos (3UL) /*!< DEV_STAT (Bit 3) */ +#define USB_DEVINTST_DEV_STAT_Msk (0x8UL) /*!< DEV_STAT (Bitfield-Mask: 0x01) */ +#define USB_DEVINTST_CCEMPTY_Pos (4UL) /*!< CCEMPTY (Bit 4) */ +#define USB_DEVINTST_CCEMPTY_Msk (0x10UL) /*!< CCEMPTY (Bitfield-Mask: 0x01) */ +#define USB_DEVINTST_CDFULL_Pos (5UL) /*!< CDFULL (Bit 5) */ +#define USB_DEVINTST_CDFULL_Msk (0x20UL) /*!< CDFULL (Bitfield-Mask: 0x01) */ +#define USB_DEVINTST_RxENDPKT_Pos (6UL) /*!< RxENDPKT (Bit 6) */ +#define USB_DEVINTST_RxENDPKT_Msk (0x40UL) /*!< RxENDPKT (Bitfield-Mask: 0x01) */ +#define USB_DEVINTST_TxENDPKT_Pos (7UL) /*!< TxENDPKT (Bit 7) */ +#define USB_DEVINTST_TxENDPKT_Msk (0x80UL) /*!< TxENDPKT (Bitfield-Mask: 0x01) */ +#define USB_DEVINTST_EP_RLZED_Pos (8UL) /*!< EP_RLZED (Bit 8) */ +#define USB_DEVINTST_EP_RLZED_Msk (0x100UL) /*!< EP_RLZED (Bitfield-Mask: 0x01) */ +#define USB_DEVINTST_ERR_INT_Pos (9UL) /*!< ERR_INT (Bit 9) */ +#define USB_DEVINTST_ERR_INT_Msk (0x200UL) /*!< ERR_INT (Bitfield-Mask: 0x01) */ +/* ======================================================= DEVINTEN ======================================================== */ +#define USB_DEVINTEN_FRAMEEN_Pos (0UL) /*!< FRAMEEN (Bit 0) */ +#define USB_DEVINTEN_FRAMEEN_Msk (0x1UL) /*!< FRAMEEN (Bitfield-Mask: 0x01) */ +#define USB_DEVINTEN_EP_FASTEN_Pos (1UL) /*!< EP_FASTEN (Bit 1) */ +#define USB_DEVINTEN_EP_FASTEN_Msk (0x2UL) /*!< EP_FASTEN (Bitfield-Mask: 0x01) */ +#define USB_DEVINTEN_EP_SLOWEN_Pos (2UL) /*!< EP_SLOWEN (Bit 2) */ +#define USB_DEVINTEN_EP_SLOWEN_Msk (0x4UL) /*!< EP_SLOWEN (Bitfield-Mask: 0x01) */ +#define USB_DEVINTEN_DEV_STATEN_Pos (3UL) /*!< DEV_STATEN (Bit 3) */ +#define USB_DEVINTEN_DEV_STATEN_Msk (0x8UL) /*!< DEV_STATEN (Bitfield-Mask: 0x01) */ +#define USB_DEVINTEN_CCEMPTYEN_Pos (4UL) /*!< CCEMPTYEN (Bit 4) */ +#define USB_DEVINTEN_CCEMPTYEN_Msk (0x10UL) /*!< CCEMPTYEN (Bitfield-Mask: 0x01) */ +#define USB_DEVINTEN_CDFULLEN_Pos (5UL) /*!< CDFULLEN (Bit 5) */ +#define USB_DEVINTEN_CDFULLEN_Msk (0x20UL) /*!< CDFULLEN (Bitfield-Mask: 0x01) */ +#define USB_DEVINTEN_RxENDPKTEN_Pos (6UL) /*!< RxENDPKTEN (Bit 6) */ +#define USB_DEVINTEN_RxENDPKTEN_Msk (0x40UL) /*!< RxENDPKTEN (Bitfield-Mask: 0x01) */ +#define USB_DEVINTEN_TxENDPKTEN_Pos (7UL) /*!< TxENDPKTEN (Bit 7) */ +#define USB_DEVINTEN_TxENDPKTEN_Msk (0x80UL) /*!< TxENDPKTEN (Bitfield-Mask: 0x01) */ +#define USB_DEVINTEN_EP_RLZEDEN_Pos (8UL) /*!< EP_RLZEDEN (Bit 8) */ +#define USB_DEVINTEN_EP_RLZEDEN_Msk (0x100UL) /*!< EP_RLZEDEN (Bitfield-Mask: 0x01) */ +#define USB_DEVINTEN_ERR_INTEN_Pos (9UL) /*!< ERR_INTEN (Bit 9) */ +#define USB_DEVINTEN_ERR_INTEN_Msk (0x200UL) /*!< ERR_INTEN (Bitfield-Mask: 0x01) */ +/* ======================================================= DEVINTCLR ======================================================= */ +#define USB_DEVINTCLR_FRAMECLR_Pos (0UL) /*!< FRAMECLR (Bit 0) */ +#define USB_DEVINTCLR_FRAMECLR_Msk (0x1UL) /*!< FRAMECLR (Bitfield-Mask: 0x01) */ +#define USB_DEVINTCLR_EP_FASTCLR_Pos (1UL) /*!< EP_FASTCLR (Bit 1) */ +#define USB_DEVINTCLR_EP_FASTCLR_Msk (0x2UL) /*!< EP_FASTCLR (Bitfield-Mask: 0x01) */ +#define USB_DEVINTCLR_EP_SLOWCLR_Pos (2UL) /*!< EP_SLOWCLR (Bit 2) */ +#define USB_DEVINTCLR_EP_SLOWCLR_Msk (0x4UL) /*!< EP_SLOWCLR (Bitfield-Mask: 0x01) */ +#define USB_DEVINTCLR_DEV_STATCLR_Pos (3UL) /*!< DEV_STATCLR (Bit 3) */ +#define USB_DEVINTCLR_DEV_STATCLR_Msk (0x8UL) /*!< DEV_STATCLR (Bitfield-Mask: 0x01) */ +#define USB_DEVINTCLR_CCEMPTYCLR_Pos (4UL) /*!< CCEMPTYCLR (Bit 4) */ +#define USB_DEVINTCLR_CCEMPTYCLR_Msk (0x10UL) /*!< CCEMPTYCLR (Bitfield-Mask: 0x01) */ +#define USB_DEVINTCLR_CDFULLCLR_Pos (5UL) /*!< CDFULLCLR (Bit 5) */ +#define USB_DEVINTCLR_CDFULLCLR_Msk (0x20UL) /*!< CDFULLCLR (Bitfield-Mask: 0x01) */ +#define USB_DEVINTCLR_RxENDPKTCLR_Pos (6UL) /*!< RxENDPKTCLR (Bit 6) */ +#define USB_DEVINTCLR_RxENDPKTCLR_Msk (0x40UL) /*!< RxENDPKTCLR (Bitfield-Mask: 0x01) */ +#define USB_DEVINTCLR_TxENDPKTCLR_Pos (7UL) /*!< TxENDPKTCLR (Bit 7) */ +#define USB_DEVINTCLR_TxENDPKTCLR_Msk (0x80UL) /*!< TxENDPKTCLR (Bitfield-Mask: 0x01) */ +#define USB_DEVINTCLR_EP_RLZEDCLR_Pos (8UL) /*!< EP_RLZEDCLR (Bit 8) */ +#define USB_DEVINTCLR_EP_RLZEDCLR_Msk (0x100UL) /*!< EP_RLZEDCLR (Bitfield-Mask: 0x01) */ +#define USB_DEVINTCLR_ERR_INTCLR_Pos (9UL) /*!< ERR_INTCLR (Bit 9) */ +#define USB_DEVINTCLR_ERR_INTCLR_Msk (0x200UL) /*!< ERR_INTCLR (Bitfield-Mask: 0x01) */ +/* ======================================================= DEVINTSET ======================================================= */ +#define USB_DEVINTSET_FRAMESET_Pos (0UL) /*!< FRAMESET (Bit 0) */ +#define USB_DEVINTSET_FRAMESET_Msk (0x1UL) /*!< FRAMESET (Bitfield-Mask: 0x01) */ +#define USB_DEVINTSET_EP_FASTSET_Pos (1UL) /*!< EP_FASTSET (Bit 1) */ +#define USB_DEVINTSET_EP_FASTSET_Msk (0x2UL) /*!< EP_FASTSET (Bitfield-Mask: 0x01) */ +#define USB_DEVINTSET_EP_SLOWSET_Pos (2UL) /*!< EP_SLOWSET (Bit 2) */ +#define USB_DEVINTSET_EP_SLOWSET_Msk (0x4UL) /*!< EP_SLOWSET (Bitfield-Mask: 0x01) */ +#define USB_DEVINTSET_DEV_STATSET_Pos (3UL) /*!< DEV_STATSET (Bit 3) */ +#define USB_DEVINTSET_DEV_STATSET_Msk (0x8UL) /*!< DEV_STATSET (Bitfield-Mask: 0x01) */ +#define USB_DEVINTSET_CCEMPTYSET_Pos (4UL) /*!< CCEMPTYSET (Bit 4) */ +#define USB_DEVINTSET_CCEMPTYSET_Msk (0x10UL) /*!< CCEMPTYSET (Bitfield-Mask: 0x01) */ +#define USB_DEVINTSET_CDFULLSET_Pos (5UL) /*!< CDFULLSET (Bit 5) */ +#define USB_DEVINTSET_CDFULLSET_Msk (0x20UL) /*!< CDFULLSET (Bitfield-Mask: 0x01) */ +#define USB_DEVINTSET_RxENDPKTSET_Pos (6UL) /*!< RxENDPKTSET (Bit 6) */ +#define USB_DEVINTSET_RxENDPKTSET_Msk (0x40UL) /*!< RxENDPKTSET (Bitfield-Mask: 0x01) */ +#define USB_DEVINTSET_TxENDPKTSET_Pos (7UL) /*!< TxENDPKTSET (Bit 7) */ +#define USB_DEVINTSET_TxENDPKTSET_Msk (0x80UL) /*!< TxENDPKTSET (Bitfield-Mask: 0x01) */ +#define USB_DEVINTSET_EP_RLZEDSET_Pos (8UL) /*!< EP_RLZEDSET (Bit 8) */ +#define USB_DEVINTSET_EP_RLZEDSET_Msk (0x100UL) /*!< EP_RLZEDSET (Bitfield-Mask: 0x01) */ +#define USB_DEVINTSET_ERR_INTSET_Pos (9UL) /*!< ERR_INTSET (Bit 9) */ +#define USB_DEVINTSET_ERR_INTSET_Msk (0x200UL) /*!< ERR_INTSET (Bitfield-Mask: 0x01) */ +/* ======================================================== CMDCODE ======================================================== */ +#define USB_CMDCODE_CMD_PHASE_Pos (8UL) /*!< CMD_PHASE (Bit 8) */ +#define USB_CMDCODE_CMD_PHASE_Msk (0xff00UL) /*!< CMD_PHASE (Bitfield-Mask: 0xff) */ +#define USB_CMDCODE_CMD_CODE_WDATA_Pos (16UL) /*!< CMD_CODE_WDATA (Bit 16) */ +#define USB_CMDCODE_CMD_CODE_WDATA_Msk (0xff0000UL) /*!< CMD_CODE_WDATA (Bitfield-Mask: 0xff) */ +/* ======================================================== CMDDATA ======================================================== */ +#define USB_CMDDATA_CMD_RDATA_Pos (0UL) /*!< CMD_RDATA (Bit 0) */ +#define USB_CMDDATA_CMD_RDATA_Msk (0xffUL) /*!< CMD_RDATA (Bitfield-Mask: 0xff) */ +/* ======================================================== RXDATA ========================================================= */ +#define USB_RXDATA_RX_DATA_Pos (0UL) /*!< RX_DATA (Bit 0) */ +#define USB_RXDATA_RX_DATA_Msk (0xffffffffUL) /*!< RX_DATA (Bitfield-Mask: 0xffffffff) */ +/* ======================================================== TXDATA ========================================================= */ +#define USB_TXDATA_TX_DATA_Pos (0UL) /*!< TX_DATA (Bit 0) */ +#define USB_TXDATA_TX_DATA_Msk (0xffffffffUL) /*!< TX_DATA (Bitfield-Mask: 0xffffffff) */ +/* ======================================================== RXPLEN ========================================================= */ +#define USB_RXPLEN_PKT_LNGTH_Pos (0UL) /*!< PKT_LNGTH (Bit 0) */ +#define USB_RXPLEN_PKT_LNGTH_Msk (0x3ffUL) /*!< PKT_LNGTH (Bitfield-Mask: 0x3ff) */ +#define USB_RXPLEN_DV_Pos (10UL) /*!< DV (Bit 10) */ +#define USB_RXPLEN_DV_Msk (0x400UL) /*!< DV (Bitfield-Mask: 0x01) */ +#define USB_RXPLEN_PKT_RDY_Pos (11UL) /*!< PKT_RDY (Bit 11) */ +#define USB_RXPLEN_PKT_RDY_Msk (0x800UL) /*!< PKT_RDY (Bitfield-Mask: 0x01) */ +/* ======================================================== TXPLEN ========================================================= */ +#define USB_TXPLEN_PKT_LNGTH_Pos (0UL) /*!< PKT_LNGTH (Bit 0) */ +#define USB_TXPLEN_PKT_LNGTH_Msk (0x3ffUL) /*!< PKT_LNGTH (Bitfield-Mask: 0x3ff) */ +/* ========================================================= CTRL ========================================================== */ +#define USB_CTRL_RD_EN_Pos (0UL) /*!< RD_EN (Bit 0) */ +#define USB_CTRL_RD_EN_Msk (0x1UL) /*!< RD_EN (Bitfield-Mask: 0x01) */ +#define USB_CTRL_WR_EN_Pos (1UL) /*!< WR_EN (Bit 1) */ +#define USB_CTRL_WR_EN_Msk (0x2UL) /*!< WR_EN (Bitfield-Mask: 0x01) */ +#define USB_CTRL_LOG_ENDPOINT_Pos (2UL) /*!< LOG_ENDPOINT (Bit 2) */ +#define USB_CTRL_LOG_ENDPOINT_Msk (0x3cUL) /*!< LOG_ENDPOINT (Bitfield-Mask: 0x0f) */ +/* ======================================================= DEVINTPRI ======================================================= */ +#define USB_DEVINTPRI_FRAME_Pos (0UL) /*!< FRAME (Bit 0) */ +#define USB_DEVINTPRI_FRAME_Msk (0x1UL) /*!< FRAME (Bitfield-Mask: 0x01) */ +#define USB_DEVINTPRI_EP_FAST_Pos (1UL) /*!< EP_FAST (Bit 1) */ +#define USB_DEVINTPRI_EP_FAST_Msk (0x2UL) /*!< EP_FAST (Bitfield-Mask: 0x01) */ +/* ======================================================== EPINTST ======================================================== */ +#define USB_EPINTST_EPST0_Pos (0UL) /*!< EPST0 (Bit 0) */ +#define USB_EPINTST_EPST0_Msk (0x1UL) /*!< EPST0 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST1_Pos (1UL) /*!< EPST1 (Bit 1) */ +#define USB_EPINTST_EPST1_Msk (0x2UL) /*!< EPST1 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST2_Pos (2UL) /*!< EPST2 (Bit 2) */ +#define USB_EPINTST_EPST2_Msk (0x4UL) /*!< EPST2 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST3_Pos (3UL) /*!< EPST3 (Bit 3) */ +#define USB_EPINTST_EPST3_Msk (0x8UL) /*!< EPST3 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST4_Pos (4UL) /*!< EPST4 (Bit 4) */ +#define USB_EPINTST_EPST4_Msk (0x10UL) /*!< EPST4 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST5_Pos (5UL) /*!< EPST5 (Bit 5) */ +#define USB_EPINTST_EPST5_Msk (0x20UL) /*!< EPST5 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST6_Pos (6UL) /*!< EPST6 (Bit 6) */ +#define USB_EPINTST_EPST6_Msk (0x40UL) /*!< EPST6 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST7_Pos (7UL) /*!< EPST7 (Bit 7) */ +#define USB_EPINTST_EPST7_Msk (0x80UL) /*!< EPST7 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST8_Pos (8UL) /*!< EPST8 (Bit 8) */ +#define USB_EPINTST_EPST8_Msk (0x100UL) /*!< EPST8 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST9_Pos (9UL) /*!< EPST9 (Bit 9) */ +#define USB_EPINTST_EPST9_Msk (0x200UL) /*!< EPST9 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST10_Pos (10UL) /*!< EPST10 (Bit 10) */ +#define USB_EPINTST_EPST10_Msk (0x400UL) /*!< EPST10 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST11_Pos (11UL) /*!< EPST11 (Bit 11) */ +#define USB_EPINTST_EPST11_Msk (0x800UL) /*!< EPST11 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST12_Pos (12UL) /*!< EPST12 (Bit 12) */ +#define USB_EPINTST_EPST12_Msk (0x1000UL) /*!< EPST12 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST13_Pos (13UL) /*!< EPST13 (Bit 13) */ +#define USB_EPINTST_EPST13_Msk (0x2000UL) /*!< EPST13 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST14_Pos (14UL) /*!< EPST14 (Bit 14) */ +#define USB_EPINTST_EPST14_Msk (0x4000UL) /*!< EPST14 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST15_Pos (15UL) /*!< EPST15 (Bit 15) */ +#define USB_EPINTST_EPST15_Msk (0x8000UL) /*!< EPST15 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST16_Pos (16UL) /*!< EPST16 (Bit 16) */ +#define USB_EPINTST_EPST16_Msk (0x10000UL) /*!< EPST16 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST17_Pos (17UL) /*!< EPST17 (Bit 17) */ +#define USB_EPINTST_EPST17_Msk (0x20000UL) /*!< EPST17 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST18_Pos (18UL) /*!< EPST18 (Bit 18) */ +#define USB_EPINTST_EPST18_Msk (0x40000UL) /*!< EPST18 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST19_Pos (19UL) /*!< EPST19 (Bit 19) */ +#define USB_EPINTST_EPST19_Msk (0x80000UL) /*!< EPST19 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST20_Pos (20UL) /*!< EPST20 (Bit 20) */ +#define USB_EPINTST_EPST20_Msk (0x100000UL) /*!< EPST20 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST21_Pos (21UL) /*!< EPST21 (Bit 21) */ +#define USB_EPINTST_EPST21_Msk (0x200000UL) /*!< EPST21 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST22_Pos (22UL) /*!< EPST22 (Bit 22) */ +#define USB_EPINTST_EPST22_Msk (0x400000UL) /*!< EPST22 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST23_Pos (23UL) /*!< EPST23 (Bit 23) */ +#define USB_EPINTST_EPST23_Msk (0x800000UL) /*!< EPST23 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST24_Pos (24UL) /*!< EPST24 (Bit 24) */ +#define USB_EPINTST_EPST24_Msk (0x1000000UL) /*!< EPST24 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST25_Pos (25UL) /*!< EPST25 (Bit 25) */ +#define USB_EPINTST_EPST25_Msk (0x2000000UL) /*!< EPST25 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST26_Pos (26UL) /*!< EPST26 (Bit 26) */ +#define USB_EPINTST_EPST26_Msk (0x4000000UL) /*!< EPST26 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST27_Pos (27UL) /*!< EPST27 (Bit 27) */ +#define USB_EPINTST_EPST27_Msk (0x8000000UL) /*!< EPST27 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST28_Pos (28UL) /*!< EPST28 (Bit 28) */ +#define USB_EPINTST_EPST28_Msk (0x10000000UL) /*!< EPST28 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST29_Pos (29UL) /*!< EPST29 (Bit 29) */ +#define USB_EPINTST_EPST29_Msk (0x20000000UL) /*!< EPST29 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST30_Pos (30UL) /*!< EPST30 (Bit 30) */ +#define USB_EPINTST_EPST30_Msk (0x40000000UL) /*!< EPST30 (Bitfield-Mask: 0x01) */ +#define USB_EPINTST_EPST31_Pos (31UL) /*!< EPST31 (Bit 31) */ +#define USB_EPINTST_EPST31_Msk (0x80000000UL) /*!< EPST31 (Bitfield-Mask: 0x01) */ +/* ======================================================== EPINTEN ======================================================== */ +#define USB_EPINTEN_EPEN0_Pos (0UL) /*!< EPEN0 (Bit 0) */ +#define USB_EPINTEN_EPEN0_Msk (0x1UL) /*!< EPEN0 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN1_Pos (1UL) /*!< EPEN1 (Bit 1) */ +#define USB_EPINTEN_EPEN1_Msk (0x2UL) /*!< EPEN1 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN2_Pos (2UL) /*!< EPEN2 (Bit 2) */ +#define USB_EPINTEN_EPEN2_Msk (0x4UL) /*!< EPEN2 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN3_Pos (3UL) /*!< EPEN3 (Bit 3) */ +#define USB_EPINTEN_EPEN3_Msk (0x8UL) /*!< EPEN3 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN4_Pos (4UL) /*!< EPEN4 (Bit 4) */ +#define USB_EPINTEN_EPEN4_Msk (0x10UL) /*!< EPEN4 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN5_Pos (5UL) /*!< EPEN5 (Bit 5) */ +#define USB_EPINTEN_EPEN5_Msk (0x20UL) /*!< EPEN5 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN6_Pos (6UL) /*!< EPEN6 (Bit 6) */ +#define USB_EPINTEN_EPEN6_Msk (0x40UL) /*!< EPEN6 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN7_Pos (7UL) /*!< EPEN7 (Bit 7) */ +#define USB_EPINTEN_EPEN7_Msk (0x80UL) /*!< EPEN7 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN8_Pos (8UL) /*!< EPEN8 (Bit 8) */ +#define USB_EPINTEN_EPEN8_Msk (0x100UL) /*!< EPEN8 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN9_Pos (9UL) /*!< EPEN9 (Bit 9) */ +#define USB_EPINTEN_EPEN9_Msk (0x200UL) /*!< EPEN9 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN10_Pos (10UL) /*!< EPEN10 (Bit 10) */ +#define USB_EPINTEN_EPEN10_Msk (0x400UL) /*!< EPEN10 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN11_Pos (11UL) /*!< EPEN11 (Bit 11) */ +#define USB_EPINTEN_EPEN11_Msk (0x800UL) /*!< EPEN11 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN12_Pos (12UL) /*!< EPEN12 (Bit 12) */ +#define USB_EPINTEN_EPEN12_Msk (0x1000UL) /*!< EPEN12 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN13_Pos (13UL) /*!< EPEN13 (Bit 13) */ +#define USB_EPINTEN_EPEN13_Msk (0x2000UL) /*!< EPEN13 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN14_Pos (14UL) /*!< EPEN14 (Bit 14) */ +#define USB_EPINTEN_EPEN14_Msk (0x4000UL) /*!< EPEN14 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN15_Pos (15UL) /*!< EPEN15 (Bit 15) */ +#define USB_EPINTEN_EPEN15_Msk (0x8000UL) /*!< EPEN15 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN16_Pos (16UL) /*!< EPEN16 (Bit 16) */ +#define USB_EPINTEN_EPEN16_Msk (0x10000UL) /*!< EPEN16 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN17_Pos (17UL) /*!< EPEN17 (Bit 17) */ +#define USB_EPINTEN_EPEN17_Msk (0x20000UL) /*!< EPEN17 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN18_Pos (18UL) /*!< EPEN18 (Bit 18) */ +#define USB_EPINTEN_EPEN18_Msk (0x40000UL) /*!< EPEN18 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN19_Pos (19UL) /*!< EPEN19 (Bit 19) */ +#define USB_EPINTEN_EPEN19_Msk (0x80000UL) /*!< EPEN19 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN20_Pos (20UL) /*!< EPEN20 (Bit 20) */ +#define USB_EPINTEN_EPEN20_Msk (0x100000UL) /*!< EPEN20 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN21_Pos (21UL) /*!< EPEN21 (Bit 21) */ +#define USB_EPINTEN_EPEN21_Msk (0x200000UL) /*!< EPEN21 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN22_Pos (22UL) /*!< EPEN22 (Bit 22) */ +#define USB_EPINTEN_EPEN22_Msk (0x400000UL) /*!< EPEN22 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN23_Pos (23UL) /*!< EPEN23 (Bit 23) */ +#define USB_EPINTEN_EPEN23_Msk (0x800000UL) /*!< EPEN23 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN24_Pos (24UL) /*!< EPEN24 (Bit 24) */ +#define USB_EPINTEN_EPEN24_Msk (0x1000000UL) /*!< EPEN24 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN25_Pos (25UL) /*!< EPEN25 (Bit 25) */ +#define USB_EPINTEN_EPEN25_Msk (0x2000000UL) /*!< EPEN25 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN26_Pos (26UL) /*!< EPEN26 (Bit 26) */ +#define USB_EPINTEN_EPEN26_Msk (0x4000000UL) /*!< EPEN26 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN27_Pos (27UL) /*!< EPEN27 (Bit 27) */ +#define USB_EPINTEN_EPEN27_Msk (0x8000000UL) /*!< EPEN27 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN28_Pos (28UL) /*!< EPEN28 (Bit 28) */ +#define USB_EPINTEN_EPEN28_Msk (0x10000000UL) /*!< EPEN28 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN29_Pos (29UL) /*!< EPEN29 (Bit 29) */ +#define USB_EPINTEN_EPEN29_Msk (0x20000000UL) /*!< EPEN29 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN30_Pos (30UL) /*!< EPEN30 (Bit 30) */ +#define USB_EPINTEN_EPEN30_Msk (0x40000000UL) /*!< EPEN30 (Bitfield-Mask: 0x01) */ +#define USB_EPINTEN_EPEN31_Pos (31UL) /*!< EPEN31 (Bit 31) */ +#define USB_EPINTEN_EPEN31_Msk (0x80000000UL) /*!< EPEN31 (Bitfield-Mask: 0x01) */ +/* ======================================================= EPINTCLR ======================================================== */ +#define USB_EPINTCLR_EPCLR0_Pos (0UL) /*!< EPCLR0 (Bit 0) */ +#define USB_EPINTCLR_EPCLR0_Msk (0x1UL) /*!< EPCLR0 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR1_Pos (1UL) /*!< EPCLR1 (Bit 1) */ +#define USB_EPINTCLR_EPCLR1_Msk (0x2UL) /*!< EPCLR1 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR2_Pos (2UL) /*!< EPCLR2 (Bit 2) */ +#define USB_EPINTCLR_EPCLR2_Msk (0x4UL) /*!< EPCLR2 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR3_Pos (3UL) /*!< EPCLR3 (Bit 3) */ +#define USB_EPINTCLR_EPCLR3_Msk (0x8UL) /*!< EPCLR3 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR4_Pos (4UL) /*!< EPCLR4 (Bit 4) */ +#define USB_EPINTCLR_EPCLR4_Msk (0x10UL) /*!< EPCLR4 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR5_Pos (5UL) /*!< EPCLR5 (Bit 5) */ +#define USB_EPINTCLR_EPCLR5_Msk (0x20UL) /*!< EPCLR5 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR6_Pos (6UL) /*!< EPCLR6 (Bit 6) */ +#define USB_EPINTCLR_EPCLR6_Msk (0x40UL) /*!< EPCLR6 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR7_Pos (7UL) /*!< EPCLR7 (Bit 7) */ +#define USB_EPINTCLR_EPCLR7_Msk (0x80UL) /*!< EPCLR7 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR8_Pos (8UL) /*!< EPCLR8 (Bit 8) */ +#define USB_EPINTCLR_EPCLR8_Msk (0x100UL) /*!< EPCLR8 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR9_Pos (9UL) /*!< EPCLR9 (Bit 9) */ +#define USB_EPINTCLR_EPCLR9_Msk (0x200UL) /*!< EPCLR9 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR10_Pos (10UL) /*!< EPCLR10 (Bit 10) */ +#define USB_EPINTCLR_EPCLR10_Msk (0x400UL) /*!< EPCLR10 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR11_Pos (11UL) /*!< EPCLR11 (Bit 11) */ +#define USB_EPINTCLR_EPCLR11_Msk (0x800UL) /*!< EPCLR11 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR12_Pos (12UL) /*!< EPCLR12 (Bit 12) */ +#define USB_EPINTCLR_EPCLR12_Msk (0x1000UL) /*!< EPCLR12 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR13_Pos (13UL) /*!< EPCLR13 (Bit 13) */ +#define USB_EPINTCLR_EPCLR13_Msk (0x2000UL) /*!< EPCLR13 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR14_Pos (14UL) /*!< EPCLR14 (Bit 14) */ +#define USB_EPINTCLR_EPCLR14_Msk (0x4000UL) /*!< EPCLR14 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR15_Pos (15UL) /*!< EPCLR15 (Bit 15) */ +#define USB_EPINTCLR_EPCLR15_Msk (0x8000UL) /*!< EPCLR15 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR16_Pos (16UL) /*!< EPCLR16 (Bit 16) */ +#define USB_EPINTCLR_EPCLR16_Msk (0x10000UL) /*!< EPCLR16 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR17_Pos (17UL) /*!< EPCLR17 (Bit 17) */ +#define USB_EPINTCLR_EPCLR17_Msk (0x20000UL) /*!< EPCLR17 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR18_Pos (18UL) /*!< EPCLR18 (Bit 18) */ +#define USB_EPINTCLR_EPCLR18_Msk (0x40000UL) /*!< EPCLR18 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR19_Pos (19UL) /*!< EPCLR19 (Bit 19) */ +#define USB_EPINTCLR_EPCLR19_Msk (0x80000UL) /*!< EPCLR19 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR20_Pos (20UL) /*!< EPCLR20 (Bit 20) */ +#define USB_EPINTCLR_EPCLR20_Msk (0x100000UL) /*!< EPCLR20 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR21_Pos (21UL) /*!< EPCLR21 (Bit 21) */ +#define USB_EPINTCLR_EPCLR21_Msk (0x200000UL) /*!< EPCLR21 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR22_Pos (22UL) /*!< EPCLR22 (Bit 22) */ +#define USB_EPINTCLR_EPCLR22_Msk (0x400000UL) /*!< EPCLR22 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR23_Pos (23UL) /*!< EPCLR23 (Bit 23) */ +#define USB_EPINTCLR_EPCLR23_Msk (0x800000UL) /*!< EPCLR23 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR24_Pos (24UL) /*!< EPCLR24 (Bit 24) */ +#define USB_EPINTCLR_EPCLR24_Msk (0x1000000UL) /*!< EPCLR24 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR25_Pos (25UL) /*!< EPCLR25 (Bit 25) */ +#define USB_EPINTCLR_EPCLR25_Msk (0x2000000UL) /*!< EPCLR25 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR26_Pos (26UL) /*!< EPCLR26 (Bit 26) */ +#define USB_EPINTCLR_EPCLR26_Msk (0x4000000UL) /*!< EPCLR26 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR27_Pos (27UL) /*!< EPCLR27 (Bit 27) */ +#define USB_EPINTCLR_EPCLR27_Msk (0x8000000UL) /*!< EPCLR27 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR28_Pos (28UL) /*!< EPCLR28 (Bit 28) */ +#define USB_EPINTCLR_EPCLR28_Msk (0x10000000UL) /*!< EPCLR28 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR29_Pos (29UL) /*!< EPCLR29 (Bit 29) */ +#define USB_EPINTCLR_EPCLR29_Msk (0x20000000UL) /*!< EPCLR29 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR30_Pos (30UL) /*!< EPCLR30 (Bit 30) */ +#define USB_EPINTCLR_EPCLR30_Msk (0x40000000UL) /*!< EPCLR30 (Bitfield-Mask: 0x01) */ +#define USB_EPINTCLR_EPCLR31_Pos (31UL) /*!< EPCLR31 (Bit 31) */ +#define USB_EPINTCLR_EPCLR31_Msk (0x80000000UL) /*!< EPCLR31 (Bitfield-Mask: 0x01) */ +/* ======================================================= EPINTSET ======================================================== */ +#define USB_EPINTSET_EPSET0_Pos (0UL) /*!< EPSET0 (Bit 0) */ +#define USB_EPINTSET_EPSET0_Msk (0x1UL) /*!< EPSET0 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET1_Pos (1UL) /*!< EPSET1 (Bit 1) */ +#define USB_EPINTSET_EPSET1_Msk (0x2UL) /*!< EPSET1 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET2_Pos (2UL) /*!< EPSET2 (Bit 2) */ +#define USB_EPINTSET_EPSET2_Msk (0x4UL) /*!< EPSET2 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET3_Pos (3UL) /*!< EPSET3 (Bit 3) */ +#define USB_EPINTSET_EPSET3_Msk (0x8UL) /*!< EPSET3 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET4_Pos (4UL) /*!< EPSET4 (Bit 4) */ +#define USB_EPINTSET_EPSET4_Msk (0x10UL) /*!< EPSET4 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET5_Pos (5UL) /*!< EPSET5 (Bit 5) */ +#define USB_EPINTSET_EPSET5_Msk (0x20UL) /*!< EPSET5 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET6_Pos (6UL) /*!< EPSET6 (Bit 6) */ +#define USB_EPINTSET_EPSET6_Msk (0x40UL) /*!< EPSET6 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET7_Pos (7UL) /*!< EPSET7 (Bit 7) */ +#define USB_EPINTSET_EPSET7_Msk (0x80UL) /*!< EPSET7 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET8_Pos (8UL) /*!< EPSET8 (Bit 8) */ +#define USB_EPINTSET_EPSET8_Msk (0x100UL) /*!< EPSET8 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET9_Pos (9UL) /*!< EPSET9 (Bit 9) */ +#define USB_EPINTSET_EPSET9_Msk (0x200UL) /*!< EPSET9 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET10_Pos (10UL) /*!< EPSET10 (Bit 10) */ +#define USB_EPINTSET_EPSET10_Msk (0x400UL) /*!< EPSET10 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET11_Pos (11UL) /*!< EPSET11 (Bit 11) */ +#define USB_EPINTSET_EPSET11_Msk (0x800UL) /*!< EPSET11 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET12_Pos (12UL) /*!< EPSET12 (Bit 12) */ +#define USB_EPINTSET_EPSET12_Msk (0x1000UL) /*!< EPSET12 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET13_Pos (13UL) /*!< EPSET13 (Bit 13) */ +#define USB_EPINTSET_EPSET13_Msk (0x2000UL) /*!< EPSET13 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET14_Pos (14UL) /*!< EPSET14 (Bit 14) */ +#define USB_EPINTSET_EPSET14_Msk (0x4000UL) /*!< EPSET14 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET15_Pos (15UL) /*!< EPSET15 (Bit 15) */ +#define USB_EPINTSET_EPSET15_Msk (0x8000UL) /*!< EPSET15 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET16_Pos (16UL) /*!< EPSET16 (Bit 16) */ +#define USB_EPINTSET_EPSET16_Msk (0x10000UL) /*!< EPSET16 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET17_Pos (17UL) /*!< EPSET17 (Bit 17) */ +#define USB_EPINTSET_EPSET17_Msk (0x20000UL) /*!< EPSET17 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET18_Pos (18UL) /*!< EPSET18 (Bit 18) */ +#define USB_EPINTSET_EPSET18_Msk (0x40000UL) /*!< EPSET18 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET19_Pos (19UL) /*!< EPSET19 (Bit 19) */ +#define USB_EPINTSET_EPSET19_Msk (0x80000UL) /*!< EPSET19 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET20_Pos (20UL) /*!< EPSET20 (Bit 20) */ +#define USB_EPINTSET_EPSET20_Msk (0x100000UL) /*!< EPSET20 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET21_Pos (21UL) /*!< EPSET21 (Bit 21) */ +#define USB_EPINTSET_EPSET21_Msk (0x200000UL) /*!< EPSET21 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET22_Pos (22UL) /*!< EPSET22 (Bit 22) */ +#define USB_EPINTSET_EPSET22_Msk (0x400000UL) /*!< EPSET22 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET23_Pos (23UL) /*!< EPSET23 (Bit 23) */ +#define USB_EPINTSET_EPSET23_Msk (0x800000UL) /*!< EPSET23 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET24_Pos (24UL) /*!< EPSET24 (Bit 24) */ +#define USB_EPINTSET_EPSET24_Msk (0x1000000UL) /*!< EPSET24 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET25_Pos (25UL) /*!< EPSET25 (Bit 25) */ +#define USB_EPINTSET_EPSET25_Msk (0x2000000UL) /*!< EPSET25 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET26_Pos (26UL) /*!< EPSET26 (Bit 26) */ +#define USB_EPINTSET_EPSET26_Msk (0x4000000UL) /*!< EPSET26 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET27_Pos (27UL) /*!< EPSET27 (Bit 27) */ +#define USB_EPINTSET_EPSET27_Msk (0x8000000UL) /*!< EPSET27 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET28_Pos (28UL) /*!< EPSET28 (Bit 28) */ +#define USB_EPINTSET_EPSET28_Msk (0x10000000UL) /*!< EPSET28 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET29_Pos (29UL) /*!< EPSET29 (Bit 29) */ +#define USB_EPINTSET_EPSET29_Msk (0x20000000UL) /*!< EPSET29 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET30_Pos (30UL) /*!< EPSET30 (Bit 30) */ +#define USB_EPINTSET_EPSET30_Msk (0x40000000UL) /*!< EPSET30 (Bitfield-Mask: 0x01) */ +#define USB_EPINTSET_EPSET31_Pos (31UL) /*!< EPSET31 (Bit 31) */ +#define USB_EPINTSET_EPSET31_Msk (0x80000000UL) /*!< EPSET31 (Bitfield-Mask: 0x01) */ +/* ======================================================= EPINTPRI ======================================================== */ +#define USB_EPINTPRI_EPPRI0_Pos (0UL) /*!< EPPRI0 (Bit 0) */ +#define USB_EPINTPRI_EPPRI0_Msk (0x1UL) /*!< EPPRI0 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI1_Pos (1UL) /*!< EPPRI1 (Bit 1) */ +#define USB_EPINTPRI_EPPRI1_Msk (0x2UL) /*!< EPPRI1 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI2_Pos (2UL) /*!< EPPRI2 (Bit 2) */ +#define USB_EPINTPRI_EPPRI2_Msk (0x4UL) /*!< EPPRI2 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI3_Pos (3UL) /*!< EPPRI3 (Bit 3) */ +#define USB_EPINTPRI_EPPRI3_Msk (0x8UL) /*!< EPPRI3 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI4_Pos (4UL) /*!< EPPRI4 (Bit 4) */ +#define USB_EPINTPRI_EPPRI4_Msk (0x10UL) /*!< EPPRI4 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI5_Pos (5UL) /*!< EPPRI5 (Bit 5) */ +#define USB_EPINTPRI_EPPRI5_Msk (0x20UL) /*!< EPPRI5 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI6_Pos (6UL) /*!< EPPRI6 (Bit 6) */ +#define USB_EPINTPRI_EPPRI6_Msk (0x40UL) /*!< EPPRI6 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI7_Pos (7UL) /*!< EPPRI7 (Bit 7) */ +#define USB_EPINTPRI_EPPRI7_Msk (0x80UL) /*!< EPPRI7 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI8_Pos (8UL) /*!< EPPRI8 (Bit 8) */ +#define USB_EPINTPRI_EPPRI8_Msk (0x100UL) /*!< EPPRI8 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI9_Pos (9UL) /*!< EPPRI9 (Bit 9) */ +#define USB_EPINTPRI_EPPRI9_Msk (0x200UL) /*!< EPPRI9 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI10_Pos (10UL) /*!< EPPRI10 (Bit 10) */ +#define USB_EPINTPRI_EPPRI10_Msk (0x400UL) /*!< EPPRI10 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI11_Pos (11UL) /*!< EPPRI11 (Bit 11) */ +#define USB_EPINTPRI_EPPRI11_Msk (0x800UL) /*!< EPPRI11 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI12_Pos (12UL) /*!< EPPRI12 (Bit 12) */ +#define USB_EPINTPRI_EPPRI12_Msk (0x1000UL) /*!< EPPRI12 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI13_Pos (13UL) /*!< EPPRI13 (Bit 13) */ +#define USB_EPINTPRI_EPPRI13_Msk (0x2000UL) /*!< EPPRI13 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI14_Pos (14UL) /*!< EPPRI14 (Bit 14) */ +#define USB_EPINTPRI_EPPRI14_Msk (0x4000UL) /*!< EPPRI14 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI15_Pos (15UL) /*!< EPPRI15 (Bit 15) */ +#define USB_EPINTPRI_EPPRI15_Msk (0x8000UL) /*!< EPPRI15 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI16_Pos (16UL) /*!< EPPRI16 (Bit 16) */ +#define USB_EPINTPRI_EPPRI16_Msk (0x10000UL) /*!< EPPRI16 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI17_Pos (17UL) /*!< EPPRI17 (Bit 17) */ +#define USB_EPINTPRI_EPPRI17_Msk (0x20000UL) /*!< EPPRI17 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI18_Pos (18UL) /*!< EPPRI18 (Bit 18) */ +#define USB_EPINTPRI_EPPRI18_Msk (0x40000UL) /*!< EPPRI18 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI19_Pos (19UL) /*!< EPPRI19 (Bit 19) */ +#define USB_EPINTPRI_EPPRI19_Msk (0x80000UL) /*!< EPPRI19 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI20_Pos (20UL) /*!< EPPRI20 (Bit 20) */ +#define USB_EPINTPRI_EPPRI20_Msk (0x100000UL) /*!< EPPRI20 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI21_Pos (21UL) /*!< EPPRI21 (Bit 21) */ +#define USB_EPINTPRI_EPPRI21_Msk (0x200000UL) /*!< EPPRI21 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI22_Pos (22UL) /*!< EPPRI22 (Bit 22) */ +#define USB_EPINTPRI_EPPRI22_Msk (0x400000UL) /*!< EPPRI22 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI23_Pos (23UL) /*!< EPPRI23 (Bit 23) */ +#define USB_EPINTPRI_EPPRI23_Msk (0x800000UL) /*!< EPPRI23 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI24_Pos (24UL) /*!< EPPRI24 (Bit 24) */ +#define USB_EPINTPRI_EPPRI24_Msk (0x1000000UL) /*!< EPPRI24 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI25_Pos (25UL) /*!< EPPRI25 (Bit 25) */ +#define USB_EPINTPRI_EPPRI25_Msk (0x2000000UL) /*!< EPPRI25 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI26_Pos (26UL) /*!< EPPRI26 (Bit 26) */ +#define USB_EPINTPRI_EPPRI26_Msk (0x4000000UL) /*!< EPPRI26 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI27_Pos (27UL) /*!< EPPRI27 (Bit 27) */ +#define USB_EPINTPRI_EPPRI27_Msk (0x8000000UL) /*!< EPPRI27 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI28_Pos (28UL) /*!< EPPRI28 (Bit 28) */ +#define USB_EPINTPRI_EPPRI28_Msk (0x10000000UL) /*!< EPPRI28 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI29_Pos (29UL) /*!< EPPRI29 (Bit 29) */ +#define USB_EPINTPRI_EPPRI29_Msk (0x20000000UL) /*!< EPPRI29 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI30_Pos (30UL) /*!< EPPRI30 (Bit 30) */ +#define USB_EPINTPRI_EPPRI30_Msk (0x40000000UL) /*!< EPPRI30 (Bitfield-Mask: 0x01) */ +#define USB_EPINTPRI_EPPRI31_Pos (31UL) /*!< EPPRI31 (Bit 31) */ +#define USB_EPINTPRI_EPPRI31_Msk (0x80000000UL) /*!< EPPRI31 (Bitfield-Mask: 0x01) */ +/* ========================================================= REEP ========================================================== */ +#define USB_REEP_EPR0_Pos (0UL) /*!< EPR0 (Bit 0) */ +#define USB_REEP_EPR0_Msk (0x1UL) /*!< EPR0 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR1_Pos (1UL) /*!< EPR1 (Bit 1) */ +#define USB_REEP_EPR1_Msk (0x2UL) /*!< EPR1 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR2_Pos (2UL) /*!< EPR2 (Bit 2) */ +#define USB_REEP_EPR2_Msk (0x4UL) /*!< EPR2 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR3_Pos (3UL) /*!< EPR3 (Bit 3) */ +#define USB_REEP_EPR3_Msk (0x8UL) /*!< EPR3 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR4_Pos (4UL) /*!< EPR4 (Bit 4) */ +#define USB_REEP_EPR4_Msk (0x10UL) /*!< EPR4 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR5_Pos (5UL) /*!< EPR5 (Bit 5) */ +#define USB_REEP_EPR5_Msk (0x20UL) /*!< EPR5 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR6_Pos (6UL) /*!< EPR6 (Bit 6) */ +#define USB_REEP_EPR6_Msk (0x40UL) /*!< EPR6 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR7_Pos (7UL) /*!< EPR7 (Bit 7) */ +#define USB_REEP_EPR7_Msk (0x80UL) /*!< EPR7 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR8_Pos (8UL) /*!< EPR8 (Bit 8) */ +#define USB_REEP_EPR8_Msk (0x100UL) /*!< EPR8 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR9_Pos (9UL) /*!< EPR9 (Bit 9) */ +#define USB_REEP_EPR9_Msk (0x200UL) /*!< EPR9 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR10_Pos (10UL) /*!< EPR10 (Bit 10) */ +#define USB_REEP_EPR10_Msk (0x400UL) /*!< EPR10 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR11_Pos (11UL) /*!< EPR11 (Bit 11) */ +#define USB_REEP_EPR11_Msk (0x800UL) /*!< EPR11 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR12_Pos (12UL) /*!< EPR12 (Bit 12) */ +#define USB_REEP_EPR12_Msk (0x1000UL) /*!< EPR12 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR13_Pos (13UL) /*!< EPR13 (Bit 13) */ +#define USB_REEP_EPR13_Msk (0x2000UL) /*!< EPR13 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR14_Pos (14UL) /*!< EPR14 (Bit 14) */ +#define USB_REEP_EPR14_Msk (0x4000UL) /*!< EPR14 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR15_Pos (15UL) /*!< EPR15 (Bit 15) */ +#define USB_REEP_EPR15_Msk (0x8000UL) /*!< EPR15 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR16_Pos (16UL) /*!< EPR16 (Bit 16) */ +#define USB_REEP_EPR16_Msk (0x10000UL) /*!< EPR16 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR17_Pos (17UL) /*!< EPR17 (Bit 17) */ +#define USB_REEP_EPR17_Msk (0x20000UL) /*!< EPR17 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR18_Pos (18UL) /*!< EPR18 (Bit 18) */ +#define USB_REEP_EPR18_Msk (0x40000UL) /*!< EPR18 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR19_Pos (19UL) /*!< EPR19 (Bit 19) */ +#define USB_REEP_EPR19_Msk (0x80000UL) /*!< EPR19 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR20_Pos (20UL) /*!< EPR20 (Bit 20) */ +#define USB_REEP_EPR20_Msk (0x100000UL) /*!< EPR20 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR21_Pos (21UL) /*!< EPR21 (Bit 21) */ +#define USB_REEP_EPR21_Msk (0x200000UL) /*!< EPR21 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR22_Pos (22UL) /*!< EPR22 (Bit 22) */ +#define USB_REEP_EPR22_Msk (0x400000UL) /*!< EPR22 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR23_Pos (23UL) /*!< EPR23 (Bit 23) */ +#define USB_REEP_EPR23_Msk (0x800000UL) /*!< EPR23 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR24_Pos (24UL) /*!< EPR24 (Bit 24) */ +#define USB_REEP_EPR24_Msk (0x1000000UL) /*!< EPR24 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR25_Pos (25UL) /*!< EPR25 (Bit 25) */ +#define USB_REEP_EPR25_Msk (0x2000000UL) /*!< EPR25 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR26_Pos (26UL) /*!< EPR26 (Bit 26) */ +#define USB_REEP_EPR26_Msk (0x4000000UL) /*!< EPR26 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR27_Pos (27UL) /*!< EPR27 (Bit 27) */ +#define USB_REEP_EPR27_Msk (0x8000000UL) /*!< EPR27 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR28_Pos (28UL) /*!< EPR28 (Bit 28) */ +#define USB_REEP_EPR28_Msk (0x10000000UL) /*!< EPR28 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR29_Pos (29UL) /*!< EPR29 (Bit 29) */ +#define USB_REEP_EPR29_Msk (0x20000000UL) /*!< EPR29 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR30_Pos (30UL) /*!< EPR30 (Bit 30) */ +#define USB_REEP_EPR30_Msk (0x40000000UL) /*!< EPR30 (Bitfield-Mask: 0x01) */ +#define USB_REEP_EPR31_Pos (31UL) /*!< EPR31 (Bit 31) */ +#define USB_REEP_EPR31_Msk (0x80000000UL) /*!< EPR31 (Bitfield-Mask: 0x01) */ +/* ========================================================= EPIND ========================================================= */ +#define USB_EPIND_PHY_EP_Pos (0UL) /*!< PHY_EP (Bit 0) */ +#define USB_EPIND_PHY_EP_Msk (0x1fUL) /*!< PHY_EP (Bitfield-Mask: 0x1f) */ +/* ======================================================= MAXPSIZE ======================================================== */ +#define USB_MAXPSIZE_MPS_Pos (0UL) /*!< MPS (Bit 0) */ +#define USB_MAXPSIZE_MPS_Msk (0x3ffUL) /*!< MPS (Bitfield-Mask: 0x3ff) */ +/* ======================================================== DMARST ========================================================= */ +#define USB_DMARST_EPRST0_Pos (0UL) /*!< EPRST0 (Bit 0) */ +#define USB_DMARST_EPRST0_Msk (0x1UL) /*!< EPRST0 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST1_Pos (1UL) /*!< EPRST1 (Bit 1) */ +#define USB_DMARST_EPRST1_Msk (0x2UL) /*!< EPRST1 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST2_Pos (2UL) /*!< EPRST2 (Bit 2) */ +#define USB_DMARST_EPRST2_Msk (0x4UL) /*!< EPRST2 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST3_Pos (3UL) /*!< EPRST3 (Bit 3) */ +#define USB_DMARST_EPRST3_Msk (0x8UL) /*!< EPRST3 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST4_Pos (4UL) /*!< EPRST4 (Bit 4) */ +#define USB_DMARST_EPRST4_Msk (0x10UL) /*!< EPRST4 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST5_Pos (5UL) /*!< EPRST5 (Bit 5) */ +#define USB_DMARST_EPRST5_Msk (0x20UL) /*!< EPRST5 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST6_Pos (6UL) /*!< EPRST6 (Bit 6) */ +#define USB_DMARST_EPRST6_Msk (0x40UL) /*!< EPRST6 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST7_Pos (7UL) /*!< EPRST7 (Bit 7) */ +#define USB_DMARST_EPRST7_Msk (0x80UL) /*!< EPRST7 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST8_Pos (8UL) /*!< EPRST8 (Bit 8) */ +#define USB_DMARST_EPRST8_Msk (0x100UL) /*!< EPRST8 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST9_Pos (9UL) /*!< EPRST9 (Bit 9) */ +#define USB_DMARST_EPRST9_Msk (0x200UL) /*!< EPRST9 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST10_Pos (10UL) /*!< EPRST10 (Bit 10) */ +#define USB_DMARST_EPRST10_Msk (0x400UL) /*!< EPRST10 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST11_Pos (11UL) /*!< EPRST11 (Bit 11) */ +#define USB_DMARST_EPRST11_Msk (0x800UL) /*!< EPRST11 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST12_Pos (12UL) /*!< EPRST12 (Bit 12) */ +#define USB_DMARST_EPRST12_Msk (0x1000UL) /*!< EPRST12 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST13_Pos (13UL) /*!< EPRST13 (Bit 13) */ +#define USB_DMARST_EPRST13_Msk (0x2000UL) /*!< EPRST13 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST14_Pos (14UL) /*!< EPRST14 (Bit 14) */ +#define USB_DMARST_EPRST14_Msk (0x4000UL) /*!< EPRST14 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST15_Pos (15UL) /*!< EPRST15 (Bit 15) */ +#define USB_DMARST_EPRST15_Msk (0x8000UL) /*!< EPRST15 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST16_Pos (16UL) /*!< EPRST16 (Bit 16) */ +#define USB_DMARST_EPRST16_Msk (0x10000UL) /*!< EPRST16 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST17_Pos (17UL) /*!< EPRST17 (Bit 17) */ +#define USB_DMARST_EPRST17_Msk (0x20000UL) /*!< EPRST17 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST18_Pos (18UL) /*!< EPRST18 (Bit 18) */ +#define USB_DMARST_EPRST18_Msk (0x40000UL) /*!< EPRST18 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST19_Pos (19UL) /*!< EPRST19 (Bit 19) */ +#define USB_DMARST_EPRST19_Msk (0x80000UL) /*!< EPRST19 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST20_Pos (20UL) /*!< EPRST20 (Bit 20) */ +#define USB_DMARST_EPRST20_Msk (0x100000UL) /*!< EPRST20 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST21_Pos (21UL) /*!< EPRST21 (Bit 21) */ +#define USB_DMARST_EPRST21_Msk (0x200000UL) /*!< EPRST21 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST22_Pos (22UL) /*!< EPRST22 (Bit 22) */ +#define USB_DMARST_EPRST22_Msk (0x400000UL) /*!< EPRST22 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST23_Pos (23UL) /*!< EPRST23 (Bit 23) */ +#define USB_DMARST_EPRST23_Msk (0x800000UL) /*!< EPRST23 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST24_Pos (24UL) /*!< EPRST24 (Bit 24) */ +#define USB_DMARST_EPRST24_Msk (0x1000000UL) /*!< EPRST24 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST25_Pos (25UL) /*!< EPRST25 (Bit 25) */ +#define USB_DMARST_EPRST25_Msk (0x2000000UL) /*!< EPRST25 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST26_Pos (26UL) /*!< EPRST26 (Bit 26) */ +#define USB_DMARST_EPRST26_Msk (0x4000000UL) /*!< EPRST26 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST27_Pos (27UL) /*!< EPRST27 (Bit 27) */ +#define USB_DMARST_EPRST27_Msk (0x8000000UL) /*!< EPRST27 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST28_Pos (28UL) /*!< EPRST28 (Bit 28) */ +#define USB_DMARST_EPRST28_Msk (0x10000000UL) /*!< EPRST28 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST29_Pos (29UL) /*!< EPRST29 (Bit 29) */ +#define USB_DMARST_EPRST29_Msk (0x20000000UL) /*!< EPRST29 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST30_Pos (30UL) /*!< EPRST30 (Bit 30) */ +#define USB_DMARST_EPRST30_Msk (0x40000000UL) /*!< EPRST30 (Bitfield-Mask: 0x01) */ +#define USB_DMARST_EPRST31_Pos (31UL) /*!< EPRST31 (Bit 31) */ +#define USB_DMARST_EPRST31_Msk (0x80000000UL) /*!< EPRST31 (Bitfield-Mask: 0x01) */ +/* ======================================================== DMARCLR ======================================================== */ +#define USB_DMARCLR_EPRCLR0_Pos (0UL) /*!< EPRCLR0 (Bit 0) */ +#define USB_DMARCLR_EPRCLR0_Msk (0x1UL) /*!< EPRCLR0 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR1_Pos (1UL) /*!< EPRCLR1 (Bit 1) */ +#define USB_DMARCLR_EPRCLR1_Msk (0x2UL) /*!< EPRCLR1 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR2_Pos (2UL) /*!< EPRCLR2 (Bit 2) */ +#define USB_DMARCLR_EPRCLR2_Msk (0x4UL) /*!< EPRCLR2 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR3_Pos (3UL) /*!< EPRCLR3 (Bit 3) */ +#define USB_DMARCLR_EPRCLR3_Msk (0x8UL) /*!< EPRCLR3 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR4_Pos (4UL) /*!< EPRCLR4 (Bit 4) */ +#define USB_DMARCLR_EPRCLR4_Msk (0x10UL) /*!< EPRCLR4 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR5_Pos (5UL) /*!< EPRCLR5 (Bit 5) */ +#define USB_DMARCLR_EPRCLR5_Msk (0x20UL) /*!< EPRCLR5 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR6_Pos (6UL) /*!< EPRCLR6 (Bit 6) */ +#define USB_DMARCLR_EPRCLR6_Msk (0x40UL) /*!< EPRCLR6 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR7_Pos (7UL) /*!< EPRCLR7 (Bit 7) */ +#define USB_DMARCLR_EPRCLR7_Msk (0x80UL) /*!< EPRCLR7 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR8_Pos (8UL) /*!< EPRCLR8 (Bit 8) */ +#define USB_DMARCLR_EPRCLR8_Msk (0x100UL) /*!< EPRCLR8 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR9_Pos (9UL) /*!< EPRCLR9 (Bit 9) */ +#define USB_DMARCLR_EPRCLR9_Msk (0x200UL) /*!< EPRCLR9 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR10_Pos (10UL) /*!< EPRCLR10 (Bit 10) */ +#define USB_DMARCLR_EPRCLR10_Msk (0x400UL) /*!< EPRCLR10 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR11_Pos (11UL) /*!< EPRCLR11 (Bit 11) */ +#define USB_DMARCLR_EPRCLR11_Msk (0x800UL) /*!< EPRCLR11 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR12_Pos (12UL) /*!< EPRCLR12 (Bit 12) */ +#define USB_DMARCLR_EPRCLR12_Msk (0x1000UL) /*!< EPRCLR12 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR13_Pos (13UL) /*!< EPRCLR13 (Bit 13) */ +#define USB_DMARCLR_EPRCLR13_Msk (0x2000UL) /*!< EPRCLR13 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR14_Pos (14UL) /*!< EPRCLR14 (Bit 14) */ +#define USB_DMARCLR_EPRCLR14_Msk (0x4000UL) /*!< EPRCLR14 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR15_Pos (15UL) /*!< EPRCLR15 (Bit 15) */ +#define USB_DMARCLR_EPRCLR15_Msk (0x8000UL) /*!< EPRCLR15 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR16_Pos (16UL) /*!< EPRCLR16 (Bit 16) */ +#define USB_DMARCLR_EPRCLR16_Msk (0x10000UL) /*!< EPRCLR16 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR17_Pos (17UL) /*!< EPRCLR17 (Bit 17) */ +#define USB_DMARCLR_EPRCLR17_Msk (0x20000UL) /*!< EPRCLR17 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR18_Pos (18UL) /*!< EPRCLR18 (Bit 18) */ +#define USB_DMARCLR_EPRCLR18_Msk (0x40000UL) /*!< EPRCLR18 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR19_Pos (19UL) /*!< EPRCLR19 (Bit 19) */ +#define USB_DMARCLR_EPRCLR19_Msk (0x80000UL) /*!< EPRCLR19 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR20_Pos (20UL) /*!< EPRCLR20 (Bit 20) */ +#define USB_DMARCLR_EPRCLR20_Msk (0x100000UL) /*!< EPRCLR20 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR21_Pos (21UL) /*!< EPRCLR21 (Bit 21) */ +#define USB_DMARCLR_EPRCLR21_Msk (0x200000UL) /*!< EPRCLR21 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR22_Pos (22UL) /*!< EPRCLR22 (Bit 22) */ +#define USB_DMARCLR_EPRCLR22_Msk (0x400000UL) /*!< EPRCLR22 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR23_Pos (23UL) /*!< EPRCLR23 (Bit 23) */ +#define USB_DMARCLR_EPRCLR23_Msk (0x800000UL) /*!< EPRCLR23 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR24_Pos (24UL) /*!< EPRCLR24 (Bit 24) */ +#define USB_DMARCLR_EPRCLR24_Msk (0x1000000UL) /*!< EPRCLR24 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR25_Pos (25UL) /*!< EPRCLR25 (Bit 25) */ +#define USB_DMARCLR_EPRCLR25_Msk (0x2000000UL) /*!< EPRCLR25 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR26_Pos (26UL) /*!< EPRCLR26 (Bit 26) */ +#define USB_DMARCLR_EPRCLR26_Msk (0x4000000UL) /*!< EPRCLR26 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR27_Pos (27UL) /*!< EPRCLR27 (Bit 27) */ +#define USB_DMARCLR_EPRCLR27_Msk (0x8000000UL) /*!< EPRCLR27 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR28_Pos (28UL) /*!< EPRCLR28 (Bit 28) */ +#define USB_DMARCLR_EPRCLR28_Msk (0x10000000UL) /*!< EPRCLR28 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR29_Pos (29UL) /*!< EPRCLR29 (Bit 29) */ +#define USB_DMARCLR_EPRCLR29_Msk (0x20000000UL) /*!< EPRCLR29 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR30_Pos (30UL) /*!< EPRCLR30 (Bit 30) */ +#define USB_DMARCLR_EPRCLR30_Msk (0x40000000UL) /*!< EPRCLR30 (Bitfield-Mask: 0x01) */ +#define USB_DMARCLR_EPRCLR31_Pos (31UL) /*!< EPRCLR31 (Bit 31) */ +#define USB_DMARCLR_EPRCLR31_Msk (0x80000000UL) /*!< EPRCLR31 (Bitfield-Mask: 0x01) */ +/* ======================================================== DMARSET ======================================================== */ +#define USB_DMARSET_EPRSET0_Pos (0UL) /*!< EPRSET0 (Bit 0) */ +#define USB_DMARSET_EPRSET0_Msk (0x1UL) /*!< EPRSET0 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET1_Pos (1UL) /*!< EPRSET1 (Bit 1) */ +#define USB_DMARSET_EPRSET1_Msk (0x2UL) /*!< EPRSET1 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET2_Pos (2UL) /*!< EPRSET2 (Bit 2) */ +#define USB_DMARSET_EPRSET2_Msk (0x4UL) /*!< EPRSET2 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET3_Pos (3UL) /*!< EPRSET3 (Bit 3) */ +#define USB_DMARSET_EPRSET3_Msk (0x8UL) /*!< EPRSET3 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET4_Pos (4UL) /*!< EPRSET4 (Bit 4) */ +#define USB_DMARSET_EPRSET4_Msk (0x10UL) /*!< EPRSET4 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET5_Pos (5UL) /*!< EPRSET5 (Bit 5) */ +#define USB_DMARSET_EPRSET5_Msk (0x20UL) /*!< EPRSET5 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET6_Pos (6UL) /*!< EPRSET6 (Bit 6) */ +#define USB_DMARSET_EPRSET6_Msk (0x40UL) /*!< EPRSET6 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET7_Pos (7UL) /*!< EPRSET7 (Bit 7) */ +#define USB_DMARSET_EPRSET7_Msk (0x80UL) /*!< EPRSET7 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET8_Pos (8UL) /*!< EPRSET8 (Bit 8) */ +#define USB_DMARSET_EPRSET8_Msk (0x100UL) /*!< EPRSET8 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET9_Pos (9UL) /*!< EPRSET9 (Bit 9) */ +#define USB_DMARSET_EPRSET9_Msk (0x200UL) /*!< EPRSET9 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET10_Pos (10UL) /*!< EPRSET10 (Bit 10) */ +#define USB_DMARSET_EPRSET10_Msk (0x400UL) /*!< EPRSET10 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET11_Pos (11UL) /*!< EPRSET11 (Bit 11) */ +#define USB_DMARSET_EPRSET11_Msk (0x800UL) /*!< EPRSET11 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET12_Pos (12UL) /*!< EPRSET12 (Bit 12) */ +#define USB_DMARSET_EPRSET12_Msk (0x1000UL) /*!< EPRSET12 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET13_Pos (13UL) /*!< EPRSET13 (Bit 13) */ +#define USB_DMARSET_EPRSET13_Msk (0x2000UL) /*!< EPRSET13 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET14_Pos (14UL) /*!< EPRSET14 (Bit 14) */ +#define USB_DMARSET_EPRSET14_Msk (0x4000UL) /*!< EPRSET14 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET15_Pos (15UL) /*!< EPRSET15 (Bit 15) */ +#define USB_DMARSET_EPRSET15_Msk (0x8000UL) /*!< EPRSET15 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET16_Pos (16UL) /*!< EPRSET16 (Bit 16) */ +#define USB_DMARSET_EPRSET16_Msk (0x10000UL) /*!< EPRSET16 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET17_Pos (17UL) /*!< EPRSET17 (Bit 17) */ +#define USB_DMARSET_EPRSET17_Msk (0x20000UL) /*!< EPRSET17 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET18_Pos (18UL) /*!< EPRSET18 (Bit 18) */ +#define USB_DMARSET_EPRSET18_Msk (0x40000UL) /*!< EPRSET18 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET19_Pos (19UL) /*!< EPRSET19 (Bit 19) */ +#define USB_DMARSET_EPRSET19_Msk (0x80000UL) /*!< EPRSET19 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET20_Pos (20UL) /*!< EPRSET20 (Bit 20) */ +#define USB_DMARSET_EPRSET20_Msk (0x100000UL) /*!< EPRSET20 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET21_Pos (21UL) /*!< EPRSET21 (Bit 21) */ +#define USB_DMARSET_EPRSET21_Msk (0x200000UL) /*!< EPRSET21 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET22_Pos (22UL) /*!< EPRSET22 (Bit 22) */ +#define USB_DMARSET_EPRSET22_Msk (0x400000UL) /*!< EPRSET22 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET23_Pos (23UL) /*!< EPRSET23 (Bit 23) */ +#define USB_DMARSET_EPRSET23_Msk (0x800000UL) /*!< EPRSET23 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET24_Pos (24UL) /*!< EPRSET24 (Bit 24) */ +#define USB_DMARSET_EPRSET24_Msk (0x1000000UL) /*!< EPRSET24 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET25_Pos (25UL) /*!< EPRSET25 (Bit 25) */ +#define USB_DMARSET_EPRSET25_Msk (0x2000000UL) /*!< EPRSET25 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET26_Pos (26UL) /*!< EPRSET26 (Bit 26) */ +#define USB_DMARSET_EPRSET26_Msk (0x4000000UL) /*!< EPRSET26 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET27_Pos (27UL) /*!< EPRSET27 (Bit 27) */ +#define USB_DMARSET_EPRSET27_Msk (0x8000000UL) /*!< EPRSET27 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET28_Pos (28UL) /*!< EPRSET28 (Bit 28) */ +#define USB_DMARSET_EPRSET28_Msk (0x10000000UL) /*!< EPRSET28 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET29_Pos (29UL) /*!< EPRSET29 (Bit 29) */ +#define USB_DMARSET_EPRSET29_Msk (0x20000000UL) /*!< EPRSET29 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET30_Pos (30UL) /*!< EPRSET30 (Bit 30) */ +#define USB_DMARSET_EPRSET30_Msk (0x40000000UL) /*!< EPRSET30 (Bitfield-Mask: 0x01) */ +#define USB_DMARSET_EPRSET31_Pos (31UL) /*!< EPRSET31 (Bit 31) */ +#define USB_DMARSET_EPRSET31_Msk (0x80000000UL) /*!< EPRSET31 (Bitfield-Mask: 0x01) */ +/* ========================================================= UDCAH ========================================================= */ +#define USB_UDCAH_UDCA_ADDR_Pos (7UL) /*!< UDCA_ADDR (Bit 7) */ +#define USB_UDCAH_UDCA_ADDR_Msk (0xffffff80UL) /*!< UDCA_ADDR (Bitfield-Mask: 0x1ffffff) */ +/* ======================================================== EPDMAST ======================================================== */ +#define USB_EPDMAST_EP_DMA_ST0_Pos (0UL) /*!< EP_DMA_ST0 (Bit 0) */ +#define USB_EPDMAST_EP_DMA_ST0_Msk (0x1UL) /*!< EP_DMA_ST0 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST1_Pos (1UL) /*!< EP_DMA_ST1 (Bit 1) */ +#define USB_EPDMAST_EP_DMA_ST1_Msk (0x2UL) /*!< EP_DMA_ST1 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST2_Pos (2UL) /*!< EP_DMA_ST2 (Bit 2) */ +#define USB_EPDMAST_EP_DMA_ST2_Msk (0x4UL) /*!< EP_DMA_ST2 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST3_Pos (3UL) /*!< EP_DMA_ST3 (Bit 3) */ +#define USB_EPDMAST_EP_DMA_ST3_Msk (0x8UL) /*!< EP_DMA_ST3 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST4_Pos (4UL) /*!< EP_DMA_ST4 (Bit 4) */ +#define USB_EPDMAST_EP_DMA_ST4_Msk (0x10UL) /*!< EP_DMA_ST4 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST5_Pos (5UL) /*!< EP_DMA_ST5 (Bit 5) */ +#define USB_EPDMAST_EP_DMA_ST5_Msk (0x20UL) /*!< EP_DMA_ST5 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST6_Pos (6UL) /*!< EP_DMA_ST6 (Bit 6) */ +#define USB_EPDMAST_EP_DMA_ST6_Msk (0x40UL) /*!< EP_DMA_ST6 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST7_Pos (7UL) /*!< EP_DMA_ST7 (Bit 7) */ +#define USB_EPDMAST_EP_DMA_ST7_Msk (0x80UL) /*!< EP_DMA_ST7 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST8_Pos (8UL) /*!< EP_DMA_ST8 (Bit 8) */ +#define USB_EPDMAST_EP_DMA_ST8_Msk (0x100UL) /*!< EP_DMA_ST8 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST9_Pos (9UL) /*!< EP_DMA_ST9 (Bit 9) */ +#define USB_EPDMAST_EP_DMA_ST9_Msk (0x200UL) /*!< EP_DMA_ST9 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST10_Pos (10UL) /*!< EP_DMA_ST10 (Bit 10) */ +#define USB_EPDMAST_EP_DMA_ST10_Msk (0x400UL) /*!< EP_DMA_ST10 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST11_Pos (11UL) /*!< EP_DMA_ST11 (Bit 11) */ +#define USB_EPDMAST_EP_DMA_ST11_Msk (0x800UL) /*!< EP_DMA_ST11 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST12_Pos (12UL) /*!< EP_DMA_ST12 (Bit 12) */ +#define USB_EPDMAST_EP_DMA_ST12_Msk (0x1000UL) /*!< EP_DMA_ST12 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST13_Pos (13UL) /*!< EP_DMA_ST13 (Bit 13) */ +#define USB_EPDMAST_EP_DMA_ST13_Msk (0x2000UL) /*!< EP_DMA_ST13 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST14_Pos (14UL) /*!< EP_DMA_ST14 (Bit 14) */ +#define USB_EPDMAST_EP_DMA_ST14_Msk (0x4000UL) /*!< EP_DMA_ST14 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST15_Pos (15UL) /*!< EP_DMA_ST15 (Bit 15) */ +#define USB_EPDMAST_EP_DMA_ST15_Msk (0x8000UL) /*!< EP_DMA_ST15 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST16_Pos (16UL) /*!< EP_DMA_ST16 (Bit 16) */ +#define USB_EPDMAST_EP_DMA_ST16_Msk (0x10000UL) /*!< EP_DMA_ST16 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST17_Pos (17UL) /*!< EP_DMA_ST17 (Bit 17) */ +#define USB_EPDMAST_EP_DMA_ST17_Msk (0x20000UL) /*!< EP_DMA_ST17 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST18_Pos (18UL) /*!< EP_DMA_ST18 (Bit 18) */ +#define USB_EPDMAST_EP_DMA_ST18_Msk (0x40000UL) /*!< EP_DMA_ST18 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST19_Pos (19UL) /*!< EP_DMA_ST19 (Bit 19) */ +#define USB_EPDMAST_EP_DMA_ST19_Msk (0x80000UL) /*!< EP_DMA_ST19 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST20_Pos (20UL) /*!< EP_DMA_ST20 (Bit 20) */ +#define USB_EPDMAST_EP_DMA_ST20_Msk (0x100000UL) /*!< EP_DMA_ST20 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST21_Pos (21UL) /*!< EP_DMA_ST21 (Bit 21) */ +#define USB_EPDMAST_EP_DMA_ST21_Msk (0x200000UL) /*!< EP_DMA_ST21 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST22_Pos (22UL) /*!< EP_DMA_ST22 (Bit 22) */ +#define USB_EPDMAST_EP_DMA_ST22_Msk (0x400000UL) /*!< EP_DMA_ST22 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST23_Pos (23UL) /*!< EP_DMA_ST23 (Bit 23) */ +#define USB_EPDMAST_EP_DMA_ST23_Msk (0x800000UL) /*!< EP_DMA_ST23 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST24_Pos (24UL) /*!< EP_DMA_ST24 (Bit 24) */ +#define USB_EPDMAST_EP_DMA_ST24_Msk (0x1000000UL) /*!< EP_DMA_ST24 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST25_Pos (25UL) /*!< EP_DMA_ST25 (Bit 25) */ +#define USB_EPDMAST_EP_DMA_ST25_Msk (0x2000000UL) /*!< EP_DMA_ST25 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST26_Pos (26UL) /*!< EP_DMA_ST26 (Bit 26) */ +#define USB_EPDMAST_EP_DMA_ST26_Msk (0x4000000UL) /*!< EP_DMA_ST26 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST27_Pos (27UL) /*!< EP_DMA_ST27 (Bit 27) */ +#define USB_EPDMAST_EP_DMA_ST27_Msk (0x8000000UL) /*!< EP_DMA_ST27 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST28_Pos (28UL) /*!< EP_DMA_ST28 (Bit 28) */ +#define USB_EPDMAST_EP_DMA_ST28_Msk (0x10000000UL) /*!< EP_DMA_ST28 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST29_Pos (29UL) /*!< EP_DMA_ST29 (Bit 29) */ +#define USB_EPDMAST_EP_DMA_ST29_Msk (0x20000000UL) /*!< EP_DMA_ST29 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST30_Pos (30UL) /*!< EP_DMA_ST30 (Bit 30) */ +#define USB_EPDMAST_EP_DMA_ST30_Msk (0x40000000UL) /*!< EP_DMA_ST30 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAST_EP_DMA_ST31_Pos (31UL) /*!< EP_DMA_ST31 (Bit 31) */ +#define USB_EPDMAST_EP_DMA_ST31_Msk (0x80000000UL) /*!< EP_DMA_ST31 (Bitfield-Mask: 0x01) */ +/* ======================================================== EPDMAEN ======================================================== */ +#define USB_EPDMAEN_EP_DMA_EN0_Pos (0UL) /*!< EP_DMA_EN0 (Bit 0) */ +#define USB_EPDMAEN_EP_DMA_EN0_Msk (0x1UL) /*!< EP_DMA_EN0 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAEN_EP_DMA_EN1_Pos (1UL) /*!< EP_DMA_EN1 (Bit 1) */ +#define USB_EPDMAEN_EP_DMA_EN1_Msk (0x2UL) /*!< EP_DMA_EN1 (Bitfield-Mask: 0x01) */ +#define USB_EPDMAEN_EP_DMA_EN_Pos (2UL) /*!< EP_DMA_EN (Bit 2) */ +#define USB_EPDMAEN_EP_DMA_EN_Msk (0xfffffffcUL) /*!< EP_DMA_EN (Bitfield-Mask: 0x3fffffff) */ +/* ======================================================= EPDMADIS ======================================================== */ +#define USB_EPDMADIS_EP_DMA_DIS0_Pos (0UL) /*!< EP_DMA_DIS0 (Bit 0) */ +#define USB_EPDMADIS_EP_DMA_DIS0_Msk (0x1UL) /*!< EP_DMA_DIS0 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS1_Pos (1UL) /*!< EP_DMA_DIS1 (Bit 1) */ +#define USB_EPDMADIS_EP_DMA_DIS1_Msk (0x2UL) /*!< EP_DMA_DIS1 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS2_Pos (2UL) /*!< EP_DMA_DIS2 (Bit 2) */ +#define USB_EPDMADIS_EP_DMA_DIS2_Msk (0x4UL) /*!< EP_DMA_DIS2 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS3_Pos (3UL) /*!< EP_DMA_DIS3 (Bit 3) */ +#define USB_EPDMADIS_EP_DMA_DIS3_Msk (0x8UL) /*!< EP_DMA_DIS3 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS4_Pos (4UL) /*!< EP_DMA_DIS4 (Bit 4) */ +#define USB_EPDMADIS_EP_DMA_DIS4_Msk (0x10UL) /*!< EP_DMA_DIS4 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS5_Pos (5UL) /*!< EP_DMA_DIS5 (Bit 5) */ +#define USB_EPDMADIS_EP_DMA_DIS5_Msk (0x20UL) /*!< EP_DMA_DIS5 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS6_Pos (6UL) /*!< EP_DMA_DIS6 (Bit 6) */ +#define USB_EPDMADIS_EP_DMA_DIS6_Msk (0x40UL) /*!< EP_DMA_DIS6 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS7_Pos (7UL) /*!< EP_DMA_DIS7 (Bit 7) */ +#define USB_EPDMADIS_EP_DMA_DIS7_Msk (0x80UL) /*!< EP_DMA_DIS7 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS8_Pos (8UL) /*!< EP_DMA_DIS8 (Bit 8) */ +#define USB_EPDMADIS_EP_DMA_DIS8_Msk (0x100UL) /*!< EP_DMA_DIS8 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS9_Pos (9UL) /*!< EP_DMA_DIS9 (Bit 9) */ +#define USB_EPDMADIS_EP_DMA_DIS9_Msk (0x200UL) /*!< EP_DMA_DIS9 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS10_Pos (10UL) /*!< EP_DMA_DIS10 (Bit 10) */ +#define USB_EPDMADIS_EP_DMA_DIS10_Msk (0x400UL) /*!< EP_DMA_DIS10 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS11_Pos (11UL) /*!< EP_DMA_DIS11 (Bit 11) */ +#define USB_EPDMADIS_EP_DMA_DIS11_Msk (0x800UL) /*!< EP_DMA_DIS11 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS12_Pos (12UL) /*!< EP_DMA_DIS12 (Bit 12) */ +#define USB_EPDMADIS_EP_DMA_DIS12_Msk (0x1000UL) /*!< EP_DMA_DIS12 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS13_Pos (13UL) /*!< EP_DMA_DIS13 (Bit 13) */ +#define USB_EPDMADIS_EP_DMA_DIS13_Msk (0x2000UL) /*!< EP_DMA_DIS13 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS14_Pos (14UL) /*!< EP_DMA_DIS14 (Bit 14) */ +#define USB_EPDMADIS_EP_DMA_DIS14_Msk (0x4000UL) /*!< EP_DMA_DIS14 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS15_Pos (15UL) /*!< EP_DMA_DIS15 (Bit 15) */ +#define USB_EPDMADIS_EP_DMA_DIS15_Msk (0x8000UL) /*!< EP_DMA_DIS15 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS16_Pos (16UL) /*!< EP_DMA_DIS16 (Bit 16) */ +#define USB_EPDMADIS_EP_DMA_DIS16_Msk (0x10000UL) /*!< EP_DMA_DIS16 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS17_Pos (17UL) /*!< EP_DMA_DIS17 (Bit 17) */ +#define USB_EPDMADIS_EP_DMA_DIS17_Msk (0x20000UL) /*!< EP_DMA_DIS17 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS18_Pos (18UL) /*!< EP_DMA_DIS18 (Bit 18) */ +#define USB_EPDMADIS_EP_DMA_DIS18_Msk (0x40000UL) /*!< EP_DMA_DIS18 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS19_Pos (19UL) /*!< EP_DMA_DIS19 (Bit 19) */ +#define USB_EPDMADIS_EP_DMA_DIS19_Msk (0x80000UL) /*!< EP_DMA_DIS19 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS20_Pos (20UL) /*!< EP_DMA_DIS20 (Bit 20) */ +#define USB_EPDMADIS_EP_DMA_DIS20_Msk (0x100000UL) /*!< EP_DMA_DIS20 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS21_Pos (21UL) /*!< EP_DMA_DIS21 (Bit 21) */ +#define USB_EPDMADIS_EP_DMA_DIS21_Msk (0x200000UL) /*!< EP_DMA_DIS21 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS22_Pos (22UL) /*!< EP_DMA_DIS22 (Bit 22) */ +#define USB_EPDMADIS_EP_DMA_DIS22_Msk (0x400000UL) /*!< EP_DMA_DIS22 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS23_Pos (23UL) /*!< EP_DMA_DIS23 (Bit 23) */ +#define USB_EPDMADIS_EP_DMA_DIS23_Msk (0x800000UL) /*!< EP_DMA_DIS23 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS24_Pos (24UL) /*!< EP_DMA_DIS24 (Bit 24) */ +#define USB_EPDMADIS_EP_DMA_DIS24_Msk (0x1000000UL) /*!< EP_DMA_DIS24 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS25_Pos (25UL) /*!< EP_DMA_DIS25 (Bit 25) */ +#define USB_EPDMADIS_EP_DMA_DIS25_Msk (0x2000000UL) /*!< EP_DMA_DIS25 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS26_Pos (26UL) /*!< EP_DMA_DIS26 (Bit 26) */ +#define USB_EPDMADIS_EP_DMA_DIS26_Msk (0x4000000UL) /*!< EP_DMA_DIS26 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS27_Pos (27UL) /*!< EP_DMA_DIS27 (Bit 27) */ +#define USB_EPDMADIS_EP_DMA_DIS27_Msk (0x8000000UL) /*!< EP_DMA_DIS27 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS28_Pos (28UL) /*!< EP_DMA_DIS28 (Bit 28) */ +#define USB_EPDMADIS_EP_DMA_DIS28_Msk (0x10000000UL) /*!< EP_DMA_DIS28 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS29_Pos (29UL) /*!< EP_DMA_DIS29 (Bit 29) */ +#define USB_EPDMADIS_EP_DMA_DIS29_Msk (0x20000000UL) /*!< EP_DMA_DIS29 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS30_Pos (30UL) /*!< EP_DMA_DIS30 (Bit 30) */ +#define USB_EPDMADIS_EP_DMA_DIS30_Msk (0x40000000UL) /*!< EP_DMA_DIS30 (Bitfield-Mask: 0x01) */ +#define USB_EPDMADIS_EP_DMA_DIS31_Pos (31UL) /*!< EP_DMA_DIS31 (Bit 31) */ +#define USB_EPDMADIS_EP_DMA_DIS31_Msk (0x80000000UL) /*!< EP_DMA_DIS31 (Bitfield-Mask: 0x01) */ +/* ======================================================= DMAINTST ======================================================== */ +#define USB_DMAINTST_EOT_Pos (0UL) /*!< EOT (Bit 0) */ +#define USB_DMAINTST_EOT_Msk (0x1UL) /*!< EOT (Bitfield-Mask: 0x01) */ +#define USB_DMAINTST_NDDR_Pos (1UL) /*!< NDDR (Bit 1) */ +#define USB_DMAINTST_NDDR_Msk (0x2UL) /*!< NDDR (Bitfield-Mask: 0x01) */ +#define USB_DMAINTST_ERR_Pos (2UL) /*!< ERR (Bit 2) */ +#define USB_DMAINTST_ERR_Msk (0x4UL) /*!< ERR (Bitfield-Mask: 0x01) */ +/* ======================================================= DMAINTEN ======================================================== */ +#define USB_DMAINTEN_EOT_Pos (0UL) /*!< EOT (Bit 0) */ +#define USB_DMAINTEN_EOT_Msk (0x1UL) /*!< EOT (Bitfield-Mask: 0x01) */ +#define USB_DMAINTEN_NDDR_Pos (1UL) /*!< NDDR (Bit 1) */ +#define USB_DMAINTEN_NDDR_Msk (0x2UL) /*!< NDDR (Bitfield-Mask: 0x01) */ +#define USB_DMAINTEN_ERR_Pos (2UL) /*!< ERR (Bit 2) */ +#define USB_DMAINTEN_ERR_Msk (0x4UL) /*!< ERR (Bitfield-Mask: 0x01) */ +/* ======================================================= EOTINTST ======================================================== */ +#define USB_EOTINTST_EPTXINTST0_Pos (0UL) /*!< EPTXINTST0 (Bit 0) */ +#define USB_EOTINTST_EPTXINTST0_Msk (0x1UL) /*!< EPTXINTST0 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST1_Pos (1UL) /*!< EPTXINTST1 (Bit 1) */ +#define USB_EOTINTST_EPTXINTST1_Msk (0x2UL) /*!< EPTXINTST1 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST2_Pos (2UL) /*!< EPTXINTST2 (Bit 2) */ +#define USB_EOTINTST_EPTXINTST2_Msk (0x4UL) /*!< EPTXINTST2 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST3_Pos (3UL) /*!< EPTXINTST3 (Bit 3) */ +#define USB_EOTINTST_EPTXINTST3_Msk (0x8UL) /*!< EPTXINTST3 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST4_Pos (4UL) /*!< EPTXINTST4 (Bit 4) */ +#define USB_EOTINTST_EPTXINTST4_Msk (0x10UL) /*!< EPTXINTST4 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST5_Pos (5UL) /*!< EPTXINTST5 (Bit 5) */ +#define USB_EOTINTST_EPTXINTST5_Msk (0x20UL) /*!< EPTXINTST5 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST6_Pos (6UL) /*!< EPTXINTST6 (Bit 6) */ +#define USB_EOTINTST_EPTXINTST6_Msk (0x40UL) /*!< EPTXINTST6 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST7_Pos (7UL) /*!< EPTXINTST7 (Bit 7) */ +#define USB_EOTINTST_EPTXINTST7_Msk (0x80UL) /*!< EPTXINTST7 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST8_Pos (8UL) /*!< EPTXINTST8 (Bit 8) */ +#define USB_EOTINTST_EPTXINTST8_Msk (0x100UL) /*!< EPTXINTST8 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST9_Pos (9UL) /*!< EPTXINTST9 (Bit 9) */ +#define USB_EOTINTST_EPTXINTST9_Msk (0x200UL) /*!< EPTXINTST9 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST10_Pos (10UL) /*!< EPTXINTST10 (Bit 10) */ +#define USB_EOTINTST_EPTXINTST10_Msk (0x400UL) /*!< EPTXINTST10 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST11_Pos (11UL) /*!< EPTXINTST11 (Bit 11) */ +#define USB_EOTINTST_EPTXINTST11_Msk (0x800UL) /*!< EPTXINTST11 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST12_Pos (12UL) /*!< EPTXINTST12 (Bit 12) */ +#define USB_EOTINTST_EPTXINTST12_Msk (0x1000UL) /*!< EPTXINTST12 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST13_Pos (13UL) /*!< EPTXINTST13 (Bit 13) */ +#define USB_EOTINTST_EPTXINTST13_Msk (0x2000UL) /*!< EPTXINTST13 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST14_Pos (14UL) /*!< EPTXINTST14 (Bit 14) */ +#define USB_EOTINTST_EPTXINTST14_Msk (0x4000UL) /*!< EPTXINTST14 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST15_Pos (15UL) /*!< EPTXINTST15 (Bit 15) */ +#define USB_EOTINTST_EPTXINTST15_Msk (0x8000UL) /*!< EPTXINTST15 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST16_Pos (16UL) /*!< EPTXINTST16 (Bit 16) */ +#define USB_EOTINTST_EPTXINTST16_Msk (0x10000UL) /*!< EPTXINTST16 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST17_Pos (17UL) /*!< EPTXINTST17 (Bit 17) */ +#define USB_EOTINTST_EPTXINTST17_Msk (0x20000UL) /*!< EPTXINTST17 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST18_Pos (18UL) /*!< EPTXINTST18 (Bit 18) */ +#define USB_EOTINTST_EPTXINTST18_Msk (0x40000UL) /*!< EPTXINTST18 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST19_Pos (19UL) /*!< EPTXINTST19 (Bit 19) */ +#define USB_EOTINTST_EPTXINTST19_Msk (0x80000UL) /*!< EPTXINTST19 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST20_Pos (20UL) /*!< EPTXINTST20 (Bit 20) */ +#define USB_EOTINTST_EPTXINTST20_Msk (0x100000UL) /*!< EPTXINTST20 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST21_Pos (21UL) /*!< EPTXINTST21 (Bit 21) */ +#define USB_EOTINTST_EPTXINTST21_Msk (0x200000UL) /*!< EPTXINTST21 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST22_Pos (22UL) /*!< EPTXINTST22 (Bit 22) */ +#define USB_EOTINTST_EPTXINTST22_Msk (0x400000UL) /*!< EPTXINTST22 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST23_Pos (23UL) /*!< EPTXINTST23 (Bit 23) */ +#define USB_EOTINTST_EPTXINTST23_Msk (0x800000UL) /*!< EPTXINTST23 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST24_Pos (24UL) /*!< EPTXINTST24 (Bit 24) */ +#define USB_EOTINTST_EPTXINTST24_Msk (0x1000000UL) /*!< EPTXINTST24 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST25_Pos (25UL) /*!< EPTXINTST25 (Bit 25) */ +#define USB_EOTINTST_EPTXINTST25_Msk (0x2000000UL) /*!< EPTXINTST25 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST26_Pos (26UL) /*!< EPTXINTST26 (Bit 26) */ +#define USB_EOTINTST_EPTXINTST26_Msk (0x4000000UL) /*!< EPTXINTST26 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST27_Pos (27UL) /*!< EPTXINTST27 (Bit 27) */ +#define USB_EOTINTST_EPTXINTST27_Msk (0x8000000UL) /*!< EPTXINTST27 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST28_Pos (28UL) /*!< EPTXINTST28 (Bit 28) */ +#define USB_EOTINTST_EPTXINTST28_Msk (0x10000000UL) /*!< EPTXINTST28 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST29_Pos (29UL) /*!< EPTXINTST29 (Bit 29) */ +#define USB_EOTINTST_EPTXINTST29_Msk (0x20000000UL) /*!< EPTXINTST29 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST30_Pos (30UL) /*!< EPTXINTST30 (Bit 30) */ +#define USB_EOTINTST_EPTXINTST30_Msk (0x40000000UL) /*!< EPTXINTST30 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTST_EPTXINTST31_Pos (31UL) /*!< EPTXINTST31 (Bit 31) */ +#define USB_EOTINTST_EPTXINTST31_Msk (0x80000000UL) /*!< EPTXINTST31 (Bitfield-Mask: 0x01) */ +/* ======================================================= EOTINTCLR ======================================================= */ +#define USB_EOTINTCLR_EPTXINTCLR0_Pos (0UL) /*!< EPTXINTCLR0 (Bit 0) */ +#define USB_EOTINTCLR_EPTXINTCLR0_Msk (0x1UL) /*!< EPTXINTCLR0 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR1_Pos (1UL) /*!< EPTXINTCLR1 (Bit 1) */ +#define USB_EOTINTCLR_EPTXINTCLR1_Msk (0x2UL) /*!< EPTXINTCLR1 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR2_Pos (2UL) /*!< EPTXINTCLR2 (Bit 2) */ +#define USB_EOTINTCLR_EPTXINTCLR2_Msk (0x4UL) /*!< EPTXINTCLR2 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR3_Pos (3UL) /*!< EPTXINTCLR3 (Bit 3) */ +#define USB_EOTINTCLR_EPTXINTCLR3_Msk (0x8UL) /*!< EPTXINTCLR3 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR4_Pos (4UL) /*!< EPTXINTCLR4 (Bit 4) */ +#define USB_EOTINTCLR_EPTXINTCLR4_Msk (0x10UL) /*!< EPTXINTCLR4 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR5_Pos (5UL) /*!< EPTXINTCLR5 (Bit 5) */ +#define USB_EOTINTCLR_EPTXINTCLR5_Msk (0x20UL) /*!< EPTXINTCLR5 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR6_Pos (6UL) /*!< EPTXINTCLR6 (Bit 6) */ +#define USB_EOTINTCLR_EPTXINTCLR6_Msk (0x40UL) /*!< EPTXINTCLR6 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR7_Pos (7UL) /*!< EPTXINTCLR7 (Bit 7) */ +#define USB_EOTINTCLR_EPTXINTCLR7_Msk (0x80UL) /*!< EPTXINTCLR7 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR8_Pos (8UL) /*!< EPTXINTCLR8 (Bit 8) */ +#define USB_EOTINTCLR_EPTXINTCLR8_Msk (0x100UL) /*!< EPTXINTCLR8 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR9_Pos (9UL) /*!< EPTXINTCLR9 (Bit 9) */ +#define USB_EOTINTCLR_EPTXINTCLR9_Msk (0x200UL) /*!< EPTXINTCLR9 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR10_Pos (10UL) /*!< EPTXINTCLR10 (Bit 10) */ +#define USB_EOTINTCLR_EPTXINTCLR10_Msk (0x400UL) /*!< EPTXINTCLR10 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR11_Pos (11UL) /*!< EPTXINTCLR11 (Bit 11) */ +#define USB_EOTINTCLR_EPTXINTCLR11_Msk (0x800UL) /*!< EPTXINTCLR11 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR12_Pos (12UL) /*!< EPTXINTCLR12 (Bit 12) */ +#define USB_EOTINTCLR_EPTXINTCLR12_Msk (0x1000UL) /*!< EPTXINTCLR12 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR13_Pos (13UL) /*!< EPTXINTCLR13 (Bit 13) */ +#define USB_EOTINTCLR_EPTXINTCLR13_Msk (0x2000UL) /*!< EPTXINTCLR13 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR14_Pos (14UL) /*!< EPTXINTCLR14 (Bit 14) */ +#define USB_EOTINTCLR_EPTXINTCLR14_Msk (0x4000UL) /*!< EPTXINTCLR14 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR15_Pos (15UL) /*!< EPTXINTCLR15 (Bit 15) */ +#define USB_EOTINTCLR_EPTXINTCLR15_Msk (0x8000UL) /*!< EPTXINTCLR15 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR16_Pos (16UL) /*!< EPTXINTCLR16 (Bit 16) */ +#define USB_EOTINTCLR_EPTXINTCLR16_Msk (0x10000UL) /*!< EPTXINTCLR16 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR17_Pos (17UL) /*!< EPTXINTCLR17 (Bit 17) */ +#define USB_EOTINTCLR_EPTXINTCLR17_Msk (0x20000UL) /*!< EPTXINTCLR17 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR18_Pos (18UL) /*!< EPTXINTCLR18 (Bit 18) */ +#define USB_EOTINTCLR_EPTXINTCLR18_Msk (0x40000UL) /*!< EPTXINTCLR18 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR19_Pos (19UL) /*!< EPTXINTCLR19 (Bit 19) */ +#define USB_EOTINTCLR_EPTXINTCLR19_Msk (0x80000UL) /*!< EPTXINTCLR19 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR20_Pos (20UL) /*!< EPTXINTCLR20 (Bit 20) */ +#define USB_EOTINTCLR_EPTXINTCLR20_Msk (0x100000UL) /*!< EPTXINTCLR20 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR21_Pos (21UL) /*!< EPTXINTCLR21 (Bit 21) */ +#define USB_EOTINTCLR_EPTXINTCLR21_Msk (0x200000UL) /*!< EPTXINTCLR21 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR22_Pos (22UL) /*!< EPTXINTCLR22 (Bit 22) */ +#define USB_EOTINTCLR_EPTXINTCLR22_Msk (0x400000UL) /*!< EPTXINTCLR22 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR23_Pos (23UL) /*!< EPTXINTCLR23 (Bit 23) */ +#define USB_EOTINTCLR_EPTXINTCLR23_Msk (0x800000UL) /*!< EPTXINTCLR23 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR24_Pos (24UL) /*!< EPTXINTCLR24 (Bit 24) */ +#define USB_EOTINTCLR_EPTXINTCLR24_Msk (0x1000000UL) /*!< EPTXINTCLR24 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR25_Pos (25UL) /*!< EPTXINTCLR25 (Bit 25) */ +#define USB_EOTINTCLR_EPTXINTCLR25_Msk (0x2000000UL) /*!< EPTXINTCLR25 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR26_Pos (26UL) /*!< EPTXINTCLR26 (Bit 26) */ +#define USB_EOTINTCLR_EPTXINTCLR26_Msk (0x4000000UL) /*!< EPTXINTCLR26 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR27_Pos (27UL) /*!< EPTXINTCLR27 (Bit 27) */ +#define USB_EOTINTCLR_EPTXINTCLR27_Msk (0x8000000UL) /*!< EPTXINTCLR27 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR28_Pos (28UL) /*!< EPTXINTCLR28 (Bit 28) */ +#define USB_EOTINTCLR_EPTXINTCLR28_Msk (0x10000000UL) /*!< EPTXINTCLR28 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR29_Pos (29UL) /*!< EPTXINTCLR29 (Bit 29) */ +#define USB_EOTINTCLR_EPTXINTCLR29_Msk (0x20000000UL) /*!< EPTXINTCLR29 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR30_Pos (30UL) /*!< EPTXINTCLR30 (Bit 30) */ +#define USB_EOTINTCLR_EPTXINTCLR30_Msk (0x40000000UL) /*!< EPTXINTCLR30 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTCLR_EPTXINTCLR31_Pos (31UL) /*!< EPTXINTCLR31 (Bit 31) */ +#define USB_EOTINTCLR_EPTXINTCLR31_Msk (0x80000000UL) /*!< EPTXINTCLR31 (Bitfield-Mask: 0x01) */ +/* ======================================================= EOTINTSET ======================================================= */ +#define USB_EOTINTSET_EPTXINTSET0_Pos (0UL) /*!< EPTXINTSET0 (Bit 0) */ +#define USB_EOTINTSET_EPTXINTSET0_Msk (0x1UL) /*!< EPTXINTSET0 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET1_Pos (1UL) /*!< EPTXINTSET1 (Bit 1) */ +#define USB_EOTINTSET_EPTXINTSET1_Msk (0x2UL) /*!< EPTXINTSET1 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET2_Pos (2UL) /*!< EPTXINTSET2 (Bit 2) */ +#define USB_EOTINTSET_EPTXINTSET2_Msk (0x4UL) /*!< EPTXINTSET2 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET3_Pos (3UL) /*!< EPTXINTSET3 (Bit 3) */ +#define USB_EOTINTSET_EPTXINTSET3_Msk (0x8UL) /*!< EPTXINTSET3 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET4_Pos (4UL) /*!< EPTXINTSET4 (Bit 4) */ +#define USB_EOTINTSET_EPTXINTSET4_Msk (0x10UL) /*!< EPTXINTSET4 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET5_Pos (5UL) /*!< EPTXINTSET5 (Bit 5) */ +#define USB_EOTINTSET_EPTXINTSET5_Msk (0x20UL) /*!< EPTXINTSET5 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET6_Pos (6UL) /*!< EPTXINTSET6 (Bit 6) */ +#define USB_EOTINTSET_EPTXINTSET6_Msk (0x40UL) /*!< EPTXINTSET6 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET7_Pos (7UL) /*!< EPTXINTSET7 (Bit 7) */ +#define USB_EOTINTSET_EPTXINTSET7_Msk (0x80UL) /*!< EPTXINTSET7 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET8_Pos (8UL) /*!< EPTXINTSET8 (Bit 8) */ +#define USB_EOTINTSET_EPTXINTSET8_Msk (0x100UL) /*!< EPTXINTSET8 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET9_Pos (9UL) /*!< EPTXINTSET9 (Bit 9) */ +#define USB_EOTINTSET_EPTXINTSET9_Msk (0x200UL) /*!< EPTXINTSET9 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET10_Pos (10UL) /*!< EPTXINTSET10 (Bit 10) */ +#define USB_EOTINTSET_EPTXINTSET10_Msk (0x400UL) /*!< EPTXINTSET10 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET11_Pos (11UL) /*!< EPTXINTSET11 (Bit 11) */ +#define USB_EOTINTSET_EPTXINTSET11_Msk (0x800UL) /*!< EPTXINTSET11 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET12_Pos (12UL) /*!< EPTXINTSET12 (Bit 12) */ +#define USB_EOTINTSET_EPTXINTSET12_Msk (0x1000UL) /*!< EPTXINTSET12 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET13_Pos (13UL) /*!< EPTXINTSET13 (Bit 13) */ +#define USB_EOTINTSET_EPTXINTSET13_Msk (0x2000UL) /*!< EPTXINTSET13 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET14_Pos (14UL) /*!< EPTXINTSET14 (Bit 14) */ +#define USB_EOTINTSET_EPTXINTSET14_Msk (0x4000UL) /*!< EPTXINTSET14 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET15_Pos (15UL) /*!< EPTXINTSET15 (Bit 15) */ +#define USB_EOTINTSET_EPTXINTSET15_Msk (0x8000UL) /*!< EPTXINTSET15 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET16_Pos (16UL) /*!< EPTXINTSET16 (Bit 16) */ +#define USB_EOTINTSET_EPTXINTSET16_Msk (0x10000UL) /*!< EPTXINTSET16 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET17_Pos (17UL) /*!< EPTXINTSET17 (Bit 17) */ +#define USB_EOTINTSET_EPTXINTSET17_Msk (0x20000UL) /*!< EPTXINTSET17 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET18_Pos (18UL) /*!< EPTXINTSET18 (Bit 18) */ +#define USB_EOTINTSET_EPTXINTSET18_Msk (0x40000UL) /*!< EPTXINTSET18 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET19_Pos (19UL) /*!< EPTXINTSET19 (Bit 19) */ +#define USB_EOTINTSET_EPTXINTSET19_Msk (0x80000UL) /*!< EPTXINTSET19 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET20_Pos (20UL) /*!< EPTXINTSET20 (Bit 20) */ +#define USB_EOTINTSET_EPTXINTSET20_Msk (0x100000UL) /*!< EPTXINTSET20 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET21_Pos (21UL) /*!< EPTXINTSET21 (Bit 21) */ +#define USB_EOTINTSET_EPTXINTSET21_Msk (0x200000UL) /*!< EPTXINTSET21 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET22_Pos (22UL) /*!< EPTXINTSET22 (Bit 22) */ +#define USB_EOTINTSET_EPTXINTSET22_Msk (0x400000UL) /*!< EPTXINTSET22 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET23_Pos (23UL) /*!< EPTXINTSET23 (Bit 23) */ +#define USB_EOTINTSET_EPTXINTSET23_Msk (0x800000UL) /*!< EPTXINTSET23 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET24_Pos (24UL) /*!< EPTXINTSET24 (Bit 24) */ +#define USB_EOTINTSET_EPTXINTSET24_Msk (0x1000000UL) /*!< EPTXINTSET24 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET25_Pos (25UL) /*!< EPTXINTSET25 (Bit 25) */ +#define USB_EOTINTSET_EPTXINTSET25_Msk (0x2000000UL) /*!< EPTXINTSET25 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET26_Pos (26UL) /*!< EPTXINTSET26 (Bit 26) */ +#define USB_EOTINTSET_EPTXINTSET26_Msk (0x4000000UL) /*!< EPTXINTSET26 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET27_Pos (27UL) /*!< EPTXINTSET27 (Bit 27) */ +#define USB_EOTINTSET_EPTXINTSET27_Msk (0x8000000UL) /*!< EPTXINTSET27 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET28_Pos (28UL) /*!< EPTXINTSET28 (Bit 28) */ +#define USB_EOTINTSET_EPTXINTSET28_Msk (0x10000000UL) /*!< EPTXINTSET28 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET29_Pos (29UL) /*!< EPTXINTSET29 (Bit 29) */ +#define USB_EOTINTSET_EPTXINTSET29_Msk (0x20000000UL) /*!< EPTXINTSET29 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET30_Pos (30UL) /*!< EPTXINTSET30 (Bit 30) */ +#define USB_EOTINTSET_EPTXINTSET30_Msk (0x40000000UL) /*!< EPTXINTSET30 (Bitfield-Mask: 0x01) */ +#define USB_EOTINTSET_EPTXINTSET31_Pos (31UL) /*!< EPTXINTSET31 (Bit 31) */ +#define USB_EOTINTSET_EPTXINTSET31_Msk (0x80000000UL) /*!< EPTXINTSET31 (Bitfield-Mask: 0x01) */ +/* ======================================================= NDDRINTST ======================================================= */ +#define USB_NDDRINTST_EPNDDINTST0_Pos (0UL) /*!< EPNDDINTST0 (Bit 0) */ +#define USB_NDDRINTST_EPNDDINTST0_Msk (0x1UL) /*!< EPNDDINTST0 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST1_Pos (1UL) /*!< EPNDDINTST1 (Bit 1) */ +#define USB_NDDRINTST_EPNDDINTST1_Msk (0x2UL) /*!< EPNDDINTST1 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST2_Pos (2UL) /*!< EPNDDINTST2 (Bit 2) */ +#define USB_NDDRINTST_EPNDDINTST2_Msk (0x4UL) /*!< EPNDDINTST2 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST3_Pos (3UL) /*!< EPNDDINTST3 (Bit 3) */ +#define USB_NDDRINTST_EPNDDINTST3_Msk (0x8UL) /*!< EPNDDINTST3 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST4_Pos (4UL) /*!< EPNDDINTST4 (Bit 4) */ +#define USB_NDDRINTST_EPNDDINTST4_Msk (0x10UL) /*!< EPNDDINTST4 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST5_Pos (5UL) /*!< EPNDDINTST5 (Bit 5) */ +#define USB_NDDRINTST_EPNDDINTST5_Msk (0x20UL) /*!< EPNDDINTST5 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST6_Pos (6UL) /*!< EPNDDINTST6 (Bit 6) */ +#define USB_NDDRINTST_EPNDDINTST6_Msk (0x40UL) /*!< EPNDDINTST6 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST7_Pos (7UL) /*!< EPNDDINTST7 (Bit 7) */ +#define USB_NDDRINTST_EPNDDINTST7_Msk (0x80UL) /*!< EPNDDINTST7 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST8_Pos (8UL) /*!< EPNDDINTST8 (Bit 8) */ +#define USB_NDDRINTST_EPNDDINTST8_Msk (0x100UL) /*!< EPNDDINTST8 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST9_Pos (9UL) /*!< EPNDDINTST9 (Bit 9) */ +#define USB_NDDRINTST_EPNDDINTST9_Msk (0x200UL) /*!< EPNDDINTST9 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST10_Pos (10UL) /*!< EPNDDINTST10 (Bit 10) */ +#define USB_NDDRINTST_EPNDDINTST10_Msk (0x400UL) /*!< EPNDDINTST10 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST11_Pos (11UL) /*!< EPNDDINTST11 (Bit 11) */ +#define USB_NDDRINTST_EPNDDINTST11_Msk (0x800UL) /*!< EPNDDINTST11 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST12_Pos (12UL) /*!< EPNDDINTST12 (Bit 12) */ +#define USB_NDDRINTST_EPNDDINTST12_Msk (0x1000UL) /*!< EPNDDINTST12 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST13_Pos (13UL) /*!< EPNDDINTST13 (Bit 13) */ +#define USB_NDDRINTST_EPNDDINTST13_Msk (0x2000UL) /*!< EPNDDINTST13 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST14_Pos (14UL) /*!< EPNDDINTST14 (Bit 14) */ +#define USB_NDDRINTST_EPNDDINTST14_Msk (0x4000UL) /*!< EPNDDINTST14 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST15_Pos (15UL) /*!< EPNDDINTST15 (Bit 15) */ +#define USB_NDDRINTST_EPNDDINTST15_Msk (0x8000UL) /*!< EPNDDINTST15 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST16_Pos (16UL) /*!< EPNDDINTST16 (Bit 16) */ +#define USB_NDDRINTST_EPNDDINTST16_Msk (0x10000UL) /*!< EPNDDINTST16 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST17_Pos (17UL) /*!< EPNDDINTST17 (Bit 17) */ +#define USB_NDDRINTST_EPNDDINTST17_Msk (0x20000UL) /*!< EPNDDINTST17 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST18_Pos (18UL) /*!< EPNDDINTST18 (Bit 18) */ +#define USB_NDDRINTST_EPNDDINTST18_Msk (0x40000UL) /*!< EPNDDINTST18 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST19_Pos (19UL) /*!< EPNDDINTST19 (Bit 19) */ +#define USB_NDDRINTST_EPNDDINTST19_Msk (0x80000UL) /*!< EPNDDINTST19 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST20_Pos (20UL) /*!< EPNDDINTST20 (Bit 20) */ +#define USB_NDDRINTST_EPNDDINTST20_Msk (0x100000UL) /*!< EPNDDINTST20 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST21_Pos (21UL) /*!< EPNDDINTST21 (Bit 21) */ +#define USB_NDDRINTST_EPNDDINTST21_Msk (0x200000UL) /*!< EPNDDINTST21 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST22_Pos (22UL) /*!< EPNDDINTST22 (Bit 22) */ +#define USB_NDDRINTST_EPNDDINTST22_Msk (0x400000UL) /*!< EPNDDINTST22 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST23_Pos (23UL) /*!< EPNDDINTST23 (Bit 23) */ +#define USB_NDDRINTST_EPNDDINTST23_Msk (0x800000UL) /*!< EPNDDINTST23 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST24_Pos (24UL) /*!< EPNDDINTST24 (Bit 24) */ +#define USB_NDDRINTST_EPNDDINTST24_Msk (0x1000000UL) /*!< EPNDDINTST24 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST25_Pos (25UL) /*!< EPNDDINTST25 (Bit 25) */ +#define USB_NDDRINTST_EPNDDINTST25_Msk (0x2000000UL) /*!< EPNDDINTST25 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST26_Pos (26UL) /*!< EPNDDINTST26 (Bit 26) */ +#define USB_NDDRINTST_EPNDDINTST26_Msk (0x4000000UL) /*!< EPNDDINTST26 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST27_Pos (27UL) /*!< EPNDDINTST27 (Bit 27) */ +#define USB_NDDRINTST_EPNDDINTST27_Msk (0x8000000UL) /*!< EPNDDINTST27 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST28_Pos (28UL) /*!< EPNDDINTST28 (Bit 28) */ +#define USB_NDDRINTST_EPNDDINTST28_Msk (0x10000000UL) /*!< EPNDDINTST28 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST29_Pos (29UL) /*!< EPNDDINTST29 (Bit 29) */ +#define USB_NDDRINTST_EPNDDINTST29_Msk (0x20000000UL) /*!< EPNDDINTST29 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST30_Pos (30UL) /*!< EPNDDINTST30 (Bit 30) */ +#define USB_NDDRINTST_EPNDDINTST30_Msk (0x40000000UL) /*!< EPNDDINTST30 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTST_EPNDDINTST31_Pos (31UL) /*!< EPNDDINTST31 (Bit 31) */ +#define USB_NDDRINTST_EPNDDINTST31_Msk (0x80000000UL) /*!< EPNDDINTST31 (Bitfield-Mask: 0x01) */ +/* ====================================================== NDDRINTCLR ======================================================= */ +#define USB_NDDRINTCLR_EPNDDINTCLR0_Pos (0UL) /*!< EPNDDINTCLR0 (Bit 0) */ +#define USB_NDDRINTCLR_EPNDDINTCLR0_Msk (0x1UL) /*!< EPNDDINTCLR0 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR1_Pos (1UL) /*!< EPNDDINTCLR1 (Bit 1) */ +#define USB_NDDRINTCLR_EPNDDINTCLR1_Msk (0x2UL) /*!< EPNDDINTCLR1 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR2_Pos (2UL) /*!< EPNDDINTCLR2 (Bit 2) */ +#define USB_NDDRINTCLR_EPNDDINTCLR2_Msk (0x4UL) /*!< EPNDDINTCLR2 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR3_Pos (3UL) /*!< EPNDDINTCLR3 (Bit 3) */ +#define USB_NDDRINTCLR_EPNDDINTCLR3_Msk (0x8UL) /*!< EPNDDINTCLR3 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR4_Pos (4UL) /*!< EPNDDINTCLR4 (Bit 4) */ +#define USB_NDDRINTCLR_EPNDDINTCLR4_Msk (0x10UL) /*!< EPNDDINTCLR4 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR5_Pos (5UL) /*!< EPNDDINTCLR5 (Bit 5) */ +#define USB_NDDRINTCLR_EPNDDINTCLR5_Msk (0x20UL) /*!< EPNDDINTCLR5 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR6_Pos (6UL) /*!< EPNDDINTCLR6 (Bit 6) */ +#define USB_NDDRINTCLR_EPNDDINTCLR6_Msk (0x40UL) /*!< EPNDDINTCLR6 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR7_Pos (7UL) /*!< EPNDDINTCLR7 (Bit 7) */ +#define USB_NDDRINTCLR_EPNDDINTCLR7_Msk (0x80UL) /*!< EPNDDINTCLR7 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR8_Pos (8UL) /*!< EPNDDINTCLR8 (Bit 8) */ +#define USB_NDDRINTCLR_EPNDDINTCLR8_Msk (0x100UL) /*!< EPNDDINTCLR8 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR9_Pos (9UL) /*!< EPNDDINTCLR9 (Bit 9) */ +#define USB_NDDRINTCLR_EPNDDINTCLR9_Msk (0x200UL) /*!< EPNDDINTCLR9 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR10_Pos (10UL) /*!< EPNDDINTCLR10 (Bit 10) */ +#define USB_NDDRINTCLR_EPNDDINTCLR10_Msk (0x400UL) /*!< EPNDDINTCLR10 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR11_Pos (11UL) /*!< EPNDDINTCLR11 (Bit 11) */ +#define USB_NDDRINTCLR_EPNDDINTCLR11_Msk (0x800UL) /*!< EPNDDINTCLR11 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR12_Pos (12UL) /*!< EPNDDINTCLR12 (Bit 12) */ +#define USB_NDDRINTCLR_EPNDDINTCLR12_Msk (0x1000UL) /*!< EPNDDINTCLR12 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR13_Pos (13UL) /*!< EPNDDINTCLR13 (Bit 13) */ +#define USB_NDDRINTCLR_EPNDDINTCLR13_Msk (0x2000UL) /*!< EPNDDINTCLR13 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR14_Pos (14UL) /*!< EPNDDINTCLR14 (Bit 14) */ +#define USB_NDDRINTCLR_EPNDDINTCLR14_Msk (0x4000UL) /*!< EPNDDINTCLR14 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR15_Pos (15UL) /*!< EPNDDINTCLR15 (Bit 15) */ +#define USB_NDDRINTCLR_EPNDDINTCLR15_Msk (0x8000UL) /*!< EPNDDINTCLR15 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR16_Pos (16UL) /*!< EPNDDINTCLR16 (Bit 16) */ +#define USB_NDDRINTCLR_EPNDDINTCLR16_Msk (0x10000UL) /*!< EPNDDINTCLR16 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR17_Pos (17UL) /*!< EPNDDINTCLR17 (Bit 17) */ +#define USB_NDDRINTCLR_EPNDDINTCLR17_Msk (0x20000UL) /*!< EPNDDINTCLR17 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR18_Pos (18UL) /*!< EPNDDINTCLR18 (Bit 18) */ +#define USB_NDDRINTCLR_EPNDDINTCLR18_Msk (0x40000UL) /*!< EPNDDINTCLR18 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR19_Pos (19UL) /*!< EPNDDINTCLR19 (Bit 19) */ +#define USB_NDDRINTCLR_EPNDDINTCLR19_Msk (0x80000UL) /*!< EPNDDINTCLR19 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR20_Pos (20UL) /*!< EPNDDINTCLR20 (Bit 20) */ +#define USB_NDDRINTCLR_EPNDDINTCLR20_Msk (0x100000UL) /*!< EPNDDINTCLR20 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR21_Pos (21UL) /*!< EPNDDINTCLR21 (Bit 21) */ +#define USB_NDDRINTCLR_EPNDDINTCLR21_Msk (0x200000UL) /*!< EPNDDINTCLR21 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR22_Pos (22UL) /*!< EPNDDINTCLR22 (Bit 22) */ +#define USB_NDDRINTCLR_EPNDDINTCLR22_Msk (0x400000UL) /*!< EPNDDINTCLR22 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR23_Pos (23UL) /*!< EPNDDINTCLR23 (Bit 23) */ +#define USB_NDDRINTCLR_EPNDDINTCLR23_Msk (0x800000UL) /*!< EPNDDINTCLR23 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR24_Pos (24UL) /*!< EPNDDINTCLR24 (Bit 24) */ +#define USB_NDDRINTCLR_EPNDDINTCLR24_Msk (0x1000000UL) /*!< EPNDDINTCLR24 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR25_Pos (25UL) /*!< EPNDDINTCLR25 (Bit 25) */ +#define USB_NDDRINTCLR_EPNDDINTCLR25_Msk (0x2000000UL) /*!< EPNDDINTCLR25 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR26_Pos (26UL) /*!< EPNDDINTCLR26 (Bit 26) */ +#define USB_NDDRINTCLR_EPNDDINTCLR26_Msk (0x4000000UL) /*!< EPNDDINTCLR26 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR27_Pos (27UL) /*!< EPNDDINTCLR27 (Bit 27) */ +#define USB_NDDRINTCLR_EPNDDINTCLR27_Msk (0x8000000UL) /*!< EPNDDINTCLR27 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR28_Pos (28UL) /*!< EPNDDINTCLR28 (Bit 28) */ +#define USB_NDDRINTCLR_EPNDDINTCLR28_Msk (0x10000000UL) /*!< EPNDDINTCLR28 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR29_Pos (29UL) /*!< EPNDDINTCLR29 (Bit 29) */ +#define USB_NDDRINTCLR_EPNDDINTCLR29_Msk (0x20000000UL) /*!< EPNDDINTCLR29 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR30_Pos (30UL) /*!< EPNDDINTCLR30 (Bit 30) */ +#define USB_NDDRINTCLR_EPNDDINTCLR30_Msk (0x40000000UL) /*!< EPNDDINTCLR30 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTCLR_EPNDDINTCLR31_Pos (31UL) /*!< EPNDDINTCLR31 (Bit 31) */ +#define USB_NDDRINTCLR_EPNDDINTCLR31_Msk (0x80000000UL) /*!< EPNDDINTCLR31 (Bitfield-Mask: 0x01) */ +/* ====================================================== NDDRINTSET ======================================================= */ +#define USB_NDDRINTSET_EPNDDINTSET0_Pos (0UL) /*!< EPNDDINTSET0 (Bit 0) */ +#define USB_NDDRINTSET_EPNDDINTSET0_Msk (0x1UL) /*!< EPNDDINTSET0 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET1_Pos (1UL) /*!< EPNDDINTSET1 (Bit 1) */ +#define USB_NDDRINTSET_EPNDDINTSET1_Msk (0x2UL) /*!< EPNDDINTSET1 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET2_Pos (2UL) /*!< EPNDDINTSET2 (Bit 2) */ +#define USB_NDDRINTSET_EPNDDINTSET2_Msk (0x4UL) /*!< EPNDDINTSET2 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET3_Pos (3UL) /*!< EPNDDINTSET3 (Bit 3) */ +#define USB_NDDRINTSET_EPNDDINTSET3_Msk (0x8UL) /*!< EPNDDINTSET3 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET4_Pos (4UL) /*!< EPNDDINTSET4 (Bit 4) */ +#define USB_NDDRINTSET_EPNDDINTSET4_Msk (0x10UL) /*!< EPNDDINTSET4 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET5_Pos (5UL) /*!< EPNDDINTSET5 (Bit 5) */ +#define USB_NDDRINTSET_EPNDDINTSET5_Msk (0x20UL) /*!< EPNDDINTSET5 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET6_Pos (6UL) /*!< EPNDDINTSET6 (Bit 6) */ +#define USB_NDDRINTSET_EPNDDINTSET6_Msk (0x40UL) /*!< EPNDDINTSET6 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET7_Pos (7UL) /*!< EPNDDINTSET7 (Bit 7) */ +#define USB_NDDRINTSET_EPNDDINTSET7_Msk (0x80UL) /*!< EPNDDINTSET7 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET8_Pos (8UL) /*!< EPNDDINTSET8 (Bit 8) */ +#define USB_NDDRINTSET_EPNDDINTSET8_Msk (0x100UL) /*!< EPNDDINTSET8 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET9_Pos (9UL) /*!< EPNDDINTSET9 (Bit 9) */ +#define USB_NDDRINTSET_EPNDDINTSET9_Msk (0x200UL) /*!< EPNDDINTSET9 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET10_Pos (10UL) /*!< EPNDDINTSET10 (Bit 10) */ +#define USB_NDDRINTSET_EPNDDINTSET10_Msk (0x400UL) /*!< EPNDDINTSET10 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET11_Pos (11UL) /*!< EPNDDINTSET11 (Bit 11) */ +#define USB_NDDRINTSET_EPNDDINTSET11_Msk (0x800UL) /*!< EPNDDINTSET11 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET12_Pos (12UL) /*!< EPNDDINTSET12 (Bit 12) */ +#define USB_NDDRINTSET_EPNDDINTSET12_Msk (0x1000UL) /*!< EPNDDINTSET12 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET13_Pos (13UL) /*!< EPNDDINTSET13 (Bit 13) */ +#define USB_NDDRINTSET_EPNDDINTSET13_Msk (0x2000UL) /*!< EPNDDINTSET13 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET14_Pos (14UL) /*!< EPNDDINTSET14 (Bit 14) */ +#define USB_NDDRINTSET_EPNDDINTSET14_Msk (0x4000UL) /*!< EPNDDINTSET14 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET15_Pos (15UL) /*!< EPNDDINTSET15 (Bit 15) */ +#define USB_NDDRINTSET_EPNDDINTSET15_Msk (0x8000UL) /*!< EPNDDINTSET15 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET16_Pos (16UL) /*!< EPNDDINTSET16 (Bit 16) */ +#define USB_NDDRINTSET_EPNDDINTSET16_Msk (0x10000UL) /*!< EPNDDINTSET16 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET17_Pos (17UL) /*!< EPNDDINTSET17 (Bit 17) */ +#define USB_NDDRINTSET_EPNDDINTSET17_Msk (0x20000UL) /*!< EPNDDINTSET17 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET18_Pos (18UL) /*!< EPNDDINTSET18 (Bit 18) */ +#define USB_NDDRINTSET_EPNDDINTSET18_Msk (0x40000UL) /*!< EPNDDINTSET18 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET19_Pos (19UL) /*!< EPNDDINTSET19 (Bit 19) */ +#define USB_NDDRINTSET_EPNDDINTSET19_Msk (0x80000UL) /*!< EPNDDINTSET19 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET20_Pos (20UL) /*!< EPNDDINTSET20 (Bit 20) */ +#define USB_NDDRINTSET_EPNDDINTSET20_Msk (0x100000UL) /*!< EPNDDINTSET20 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET21_Pos (21UL) /*!< EPNDDINTSET21 (Bit 21) */ +#define USB_NDDRINTSET_EPNDDINTSET21_Msk (0x200000UL) /*!< EPNDDINTSET21 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET22_Pos (22UL) /*!< EPNDDINTSET22 (Bit 22) */ +#define USB_NDDRINTSET_EPNDDINTSET22_Msk (0x400000UL) /*!< EPNDDINTSET22 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET23_Pos (23UL) /*!< EPNDDINTSET23 (Bit 23) */ +#define USB_NDDRINTSET_EPNDDINTSET23_Msk (0x800000UL) /*!< EPNDDINTSET23 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET24_Pos (24UL) /*!< EPNDDINTSET24 (Bit 24) */ +#define USB_NDDRINTSET_EPNDDINTSET24_Msk (0x1000000UL) /*!< EPNDDINTSET24 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET25_Pos (25UL) /*!< EPNDDINTSET25 (Bit 25) */ +#define USB_NDDRINTSET_EPNDDINTSET25_Msk (0x2000000UL) /*!< EPNDDINTSET25 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET26_Pos (26UL) /*!< EPNDDINTSET26 (Bit 26) */ +#define USB_NDDRINTSET_EPNDDINTSET26_Msk (0x4000000UL) /*!< EPNDDINTSET26 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET27_Pos (27UL) /*!< EPNDDINTSET27 (Bit 27) */ +#define USB_NDDRINTSET_EPNDDINTSET27_Msk (0x8000000UL) /*!< EPNDDINTSET27 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET28_Pos (28UL) /*!< EPNDDINTSET28 (Bit 28) */ +#define USB_NDDRINTSET_EPNDDINTSET28_Msk (0x10000000UL) /*!< EPNDDINTSET28 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET29_Pos (29UL) /*!< EPNDDINTSET29 (Bit 29) */ +#define USB_NDDRINTSET_EPNDDINTSET29_Msk (0x20000000UL) /*!< EPNDDINTSET29 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET30_Pos (30UL) /*!< EPNDDINTSET30 (Bit 30) */ +#define USB_NDDRINTSET_EPNDDINTSET30_Msk (0x40000000UL) /*!< EPNDDINTSET30 (Bitfield-Mask: 0x01) */ +#define USB_NDDRINTSET_EPNDDINTSET31_Pos (31UL) /*!< EPNDDINTSET31 (Bit 31) */ +#define USB_NDDRINTSET_EPNDDINTSET31_Msk (0x80000000UL) /*!< EPNDDINTSET31 (Bitfield-Mask: 0x01) */ +/* ====================================================== SYSERRINTST ====================================================== */ +#define USB_SYSERRINTST_EPERRINTST0_Pos (0UL) /*!< EPERRINTST0 (Bit 0) */ +#define USB_SYSERRINTST_EPERRINTST0_Msk (0x1UL) /*!< EPERRINTST0 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST1_Pos (1UL) /*!< EPERRINTST1 (Bit 1) */ +#define USB_SYSERRINTST_EPERRINTST1_Msk (0x2UL) /*!< EPERRINTST1 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST2_Pos (2UL) /*!< EPERRINTST2 (Bit 2) */ +#define USB_SYSERRINTST_EPERRINTST2_Msk (0x4UL) /*!< EPERRINTST2 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST3_Pos (3UL) /*!< EPERRINTST3 (Bit 3) */ +#define USB_SYSERRINTST_EPERRINTST3_Msk (0x8UL) /*!< EPERRINTST3 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST4_Pos (4UL) /*!< EPERRINTST4 (Bit 4) */ +#define USB_SYSERRINTST_EPERRINTST4_Msk (0x10UL) /*!< EPERRINTST4 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST5_Pos (5UL) /*!< EPERRINTST5 (Bit 5) */ +#define USB_SYSERRINTST_EPERRINTST5_Msk (0x20UL) /*!< EPERRINTST5 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST6_Pos (6UL) /*!< EPERRINTST6 (Bit 6) */ +#define USB_SYSERRINTST_EPERRINTST6_Msk (0x40UL) /*!< EPERRINTST6 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST7_Pos (7UL) /*!< EPERRINTST7 (Bit 7) */ +#define USB_SYSERRINTST_EPERRINTST7_Msk (0x80UL) /*!< EPERRINTST7 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST8_Pos (8UL) /*!< EPERRINTST8 (Bit 8) */ +#define USB_SYSERRINTST_EPERRINTST8_Msk (0x100UL) /*!< EPERRINTST8 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST9_Pos (9UL) /*!< EPERRINTST9 (Bit 9) */ +#define USB_SYSERRINTST_EPERRINTST9_Msk (0x200UL) /*!< EPERRINTST9 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST10_Pos (10UL) /*!< EPERRINTST10 (Bit 10) */ +#define USB_SYSERRINTST_EPERRINTST10_Msk (0x400UL) /*!< EPERRINTST10 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST11_Pos (11UL) /*!< EPERRINTST11 (Bit 11) */ +#define USB_SYSERRINTST_EPERRINTST11_Msk (0x800UL) /*!< EPERRINTST11 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST12_Pos (12UL) /*!< EPERRINTST12 (Bit 12) */ +#define USB_SYSERRINTST_EPERRINTST12_Msk (0x1000UL) /*!< EPERRINTST12 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST13_Pos (13UL) /*!< EPERRINTST13 (Bit 13) */ +#define USB_SYSERRINTST_EPERRINTST13_Msk (0x2000UL) /*!< EPERRINTST13 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST14_Pos (14UL) /*!< EPERRINTST14 (Bit 14) */ +#define USB_SYSERRINTST_EPERRINTST14_Msk (0x4000UL) /*!< EPERRINTST14 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST15_Pos (15UL) /*!< EPERRINTST15 (Bit 15) */ +#define USB_SYSERRINTST_EPERRINTST15_Msk (0x8000UL) /*!< EPERRINTST15 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST16_Pos (16UL) /*!< EPERRINTST16 (Bit 16) */ +#define USB_SYSERRINTST_EPERRINTST16_Msk (0x10000UL) /*!< EPERRINTST16 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST17_Pos (17UL) /*!< EPERRINTST17 (Bit 17) */ +#define USB_SYSERRINTST_EPERRINTST17_Msk (0x20000UL) /*!< EPERRINTST17 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST18_Pos (18UL) /*!< EPERRINTST18 (Bit 18) */ +#define USB_SYSERRINTST_EPERRINTST18_Msk (0x40000UL) /*!< EPERRINTST18 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST19_Pos (19UL) /*!< EPERRINTST19 (Bit 19) */ +#define USB_SYSERRINTST_EPERRINTST19_Msk (0x80000UL) /*!< EPERRINTST19 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST20_Pos (20UL) /*!< EPERRINTST20 (Bit 20) */ +#define USB_SYSERRINTST_EPERRINTST20_Msk (0x100000UL) /*!< EPERRINTST20 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST21_Pos (21UL) /*!< EPERRINTST21 (Bit 21) */ +#define USB_SYSERRINTST_EPERRINTST21_Msk (0x200000UL) /*!< EPERRINTST21 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST22_Pos (22UL) /*!< EPERRINTST22 (Bit 22) */ +#define USB_SYSERRINTST_EPERRINTST22_Msk (0x400000UL) /*!< EPERRINTST22 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST23_Pos (23UL) /*!< EPERRINTST23 (Bit 23) */ +#define USB_SYSERRINTST_EPERRINTST23_Msk (0x800000UL) /*!< EPERRINTST23 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST24_Pos (24UL) /*!< EPERRINTST24 (Bit 24) */ +#define USB_SYSERRINTST_EPERRINTST24_Msk (0x1000000UL) /*!< EPERRINTST24 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST25_Pos (25UL) /*!< EPERRINTST25 (Bit 25) */ +#define USB_SYSERRINTST_EPERRINTST25_Msk (0x2000000UL) /*!< EPERRINTST25 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST26_Pos (26UL) /*!< EPERRINTST26 (Bit 26) */ +#define USB_SYSERRINTST_EPERRINTST26_Msk (0x4000000UL) /*!< EPERRINTST26 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST27_Pos (27UL) /*!< EPERRINTST27 (Bit 27) */ +#define USB_SYSERRINTST_EPERRINTST27_Msk (0x8000000UL) /*!< EPERRINTST27 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST28_Pos (28UL) /*!< EPERRINTST28 (Bit 28) */ +#define USB_SYSERRINTST_EPERRINTST28_Msk (0x10000000UL) /*!< EPERRINTST28 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST29_Pos (29UL) /*!< EPERRINTST29 (Bit 29) */ +#define USB_SYSERRINTST_EPERRINTST29_Msk (0x20000000UL) /*!< EPERRINTST29 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST30_Pos (30UL) /*!< EPERRINTST30 (Bit 30) */ +#define USB_SYSERRINTST_EPERRINTST30_Msk (0x40000000UL) /*!< EPERRINTST30 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTST_EPERRINTST31_Pos (31UL) /*!< EPERRINTST31 (Bit 31) */ +#define USB_SYSERRINTST_EPERRINTST31_Msk (0x80000000UL) /*!< EPERRINTST31 (Bitfield-Mask: 0x01) */ +/* ===================================================== SYSERRINTCLR ====================================================== */ +#define USB_SYSERRINTCLR_EPERRINTCLR0_Pos (0UL) /*!< EPERRINTCLR0 (Bit 0) */ +#define USB_SYSERRINTCLR_EPERRINTCLR0_Msk (0x1UL) /*!< EPERRINTCLR0 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR1_Pos (1UL) /*!< EPERRINTCLR1 (Bit 1) */ +#define USB_SYSERRINTCLR_EPERRINTCLR1_Msk (0x2UL) /*!< EPERRINTCLR1 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR2_Pos (2UL) /*!< EPERRINTCLR2 (Bit 2) */ +#define USB_SYSERRINTCLR_EPERRINTCLR2_Msk (0x4UL) /*!< EPERRINTCLR2 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR3_Pos (3UL) /*!< EPERRINTCLR3 (Bit 3) */ +#define USB_SYSERRINTCLR_EPERRINTCLR3_Msk (0x8UL) /*!< EPERRINTCLR3 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR4_Pos (4UL) /*!< EPERRINTCLR4 (Bit 4) */ +#define USB_SYSERRINTCLR_EPERRINTCLR4_Msk (0x10UL) /*!< EPERRINTCLR4 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR5_Pos (5UL) /*!< EPERRINTCLR5 (Bit 5) */ +#define USB_SYSERRINTCLR_EPERRINTCLR5_Msk (0x20UL) /*!< EPERRINTCLR5 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR6_Pos (6UL) /*!< EPERRINTCLR6 (Bit 6) */ +#define USB_SYSERRINTCLR_EPERRINTCLR6_Msk (0x40UL) /*!< EPERRINTCLR6 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR7_Pos (7UL) /*!< EPERRINTCLR7 (Bit 7) */ +#define USB_SYSERRINTCLR_EPERRINTCLR7_Msk (0x80UL) /*!< EPERRINTCLR7 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR8_Pos (8UL) /*!< EPERRINTCLR8 (Bit 8) */ +#define USB_SYSERRINTCLR_EPERRINTCLR8_Msk (0x100UL) /*!< EPERRINTCLR8 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR9_Pos (9UL) /*!< EPERRINTCLR9 (Bit 9) */ +#define USB_SYSERRINTCLR_EPERRINTCLR9_Msk (0x200UL) /*!< EPERRINTCLR9 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR10_Pos (10UL) /*!< EPERRINTCLR10 (Bit 10) */ +#define USB_SYSERRINTCLR_EPERRINTCLR10_Msk (0x400UL) /*!< EPERRINTCLR10 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR11_Pos (11UL) /*!< EPERRINTCLR11 (Bit 11) */ +#define USB_SYSERRINTCLR_EPERRINTCLR11_Msk (0x800UL) /*!< EPERRINTCLR11 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR12_Pos (12UL) /*!< EPERRINTCLR12 (Bit 12) */ +#define USB_SYSERRINTCLR_EPERRINTCLR12_Msk (0x1000UL) /*!< EPERRINTCLR12 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR13_Pos (13UL) /*!< EPERRINTCLR13 (Bit 13) */ +#define USB_SYSERRINTCLR_EPERRINTCLR13_Msk (0x2000UL) /*!< EPERRINTCLR13 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR14_Pos (14UL) /*!< EPERRINTCLR14 (Bit 14) */ +#define USB_SYSERRINTCLR_EPERRINTCLR14_Msk (0x4000UL) /*!< EPERRINTCLR14 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR15_Pos (15UL) /*!< EPERRINTCLR15 (Bit 15) */ +#define USB_SYSERRINTCLR_EPERRINTCLR15_Msk (0x8000UL) /*!< EPERRINTCLR15 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR16_Pos (16UL) /*!< EPERRINTCLR16 (Bit 16) */ +#define USB_SYSERRINTCLR_EPERRINTCLR16_Msk (0x10000UL) /*!< EPERRINTCLR16 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR17_Pos (17UL) /*!< EPERRINTCLR17 (Bit 17) */ +#define USB_SYSERRINTCLR_EPERRINTCLR17_Msk (0x20000UL) /*!< EPERRINTCLR17 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR18_Pos (18UL) /*!< EPERRINTCLR18 (Bit 18) */ +#define USB_SYSERRINTCLR_EPERRINTCLR18_Msk (0x40000UL) /*!< EPERRINTCLR18 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR19_Pos (19UL) /*!< EPERRINTCLR19 (Bit 19) */ +#define USB_SYSERRINTCLR_EPERRINTCLR19_Msk (0x80000UL) /*!< EPERRINTCLR19 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR20_Pos (20UL) /*!< EPERRINTCLR20 (Bit 20) */ +#define USB_SYSERRINTCLR_EPERRINTCLR20_Msk (0x100000UL) /*!< EPERRINTCLR20 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR21_Pos (21UL) /*!< EPERRINTCLR21 (Bit 21) */ +#define USB_SYSERRINTCLR_EPERRINTCLR21_Msk (0x200000UL) /*!< EPERRINTCLR21 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR22_Pos (22UL) /*!< EPERRINTCLR22 (Bit 22) */ +#define USB_SYSERRINTCLR_EPERRINTCLR22_Msk (0x400000UL) /*!< EPERRINTCLR22 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR23_Pos (23UL) /*!< EPERRINTCLR23 (Bit 23) */ +#define USB_SYSERRINTCLR_EPERRINTCLR23_Msk (0x800000UL) /*!< EPERRINTCLR23 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR24_Pos (24UL) /*!< EPERRINTCLR24 (Bit 24) */ +#define USB_SYSERRINTCLR_EPERRINTCLR24_Msk (0x1000000UL) /*!< EPERRINTCLR24 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR25_Pos (25UL) /*!< EPERRINTCLR25 (Bit 25) */ +#define USB_SYSERRINTCLR_EPERRINTCLR25_Msk (0x2000000UL) /*!< EPERRINTCLR25 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR26_Pos (26UL) /*!< EPERRINTCLR26 (Bit 26) */ +#define USB_SYSERRINTCLR_EPERRINTCLR26_Msk (0x4000000UL) /*!< EPERRINTCLR26 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR27_Pos (27UL) /*!< EPERRINTCLR27 (Bit 27) */ +#define USB_SYSERRINTCLR_EPERRINTCLR27_Msk (0x8000000UL) /*!< EPERRINTCLR27 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR28_Pos (28UL) /*!< EPERRINTCLR28 (Bit 28) */ +#define USB_SYSERRINTCLR_EPERRINTCLR28_Msk (0x10000000UL) /*!< EPERRINTCLR28 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR29_Pos (29UL) /*!< EPERRINTCLR29 (Bit 29) */ +#define USB_SYSERRINTCLR_EPERRINTCLR29_Msk (0x20000000UL) /*!< EPERRINTCLR29 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR30_Pos (30UL) /*!< EPERRINTCLR30 (Bit 30) */ +#define USB_SYSERRINTCLR_EPERRINTCLR30_Msk (0x40000000UL) /*!< EPERRINTCLR30 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTCLR_EPERRINTCLR31_Pos (31UL) /*!< EPERRINTCLR31 (Bit 31) */ +#define USB_SYSERRINTCLR_EPERRINTCLR31_Msk (0x80000000UL) /*!< EPERRINTCLR31 (Bitfield-Mask: 0x01) */ +/* ===================================================== SYSERRINTSET ====================================================== */ +#define USB_SYSERRINTSET_EPERRINTSET0_Pos (0UL) /*!< EPERRINTSET0 (Bit 0) */ +#define USB_SYSERRINTSET_EPERRINTSET0_Msk (0x1UL) /*!< EPERRINTSET0 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET1_Pos (1UL) /*!< EPERRINTSET1 (Bit 1) */ +#define USB_SYSERRINTSET_EPERRINTSET1_Msk (0x2UL) /*!< EPERRINTSET1 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET2_Pos (2UL) /*!< EPERRINTSET2 (Bit 2) */ +#define USB_SYSERRINTSET_EPERRINTSET2_Msk (0x4UL) /*!< EPERRINTSET2 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET3_Pos (3UL) /*!< EPERRINTSET3 (Bit 3) */ +#define USB_SYSERRINTSET_EPERRINTSET3_Msk (0x8UL) /*!< EPERRINTSET3 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET4_Pos (4UL) /*!< EPERRINTSET4 (Bit 4) */ +#define USB_SYSERRINTSET_EPERRINTSET4_Msk (0x10UL) /*!< EPERRINTSET4 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET5_Pos (5UL) /*!< EPERRINTSET5 (Bit 5) */ +#define USB_SYSERRINTSET_EPERRINTSET5_Msk (0x20UL) /*!< EPERRINTSET5 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET6_Pos (6UL) /*!< EPERRINTSET6 (Bit 6) */ +#define USB_SYSERRINTSET_EPERRINTSET6_Msk (0x40UL) /*!< EPERRINTSET6 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET7_Pos (7UL) /*!< EPERRINTSET7 (Bit 7) */ +#define USB_SYSERRINTSET_EPERRINTSET7_Msk (0x80UL) /*!< EPERRINTSET7 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET8_Pos (8UL) /*!< EPERRINTSET8 (Bit 8) */ +#define USB_SYSERRINTSET_EPERRINTSET8_Msk (0x100UL) /*!< EPERRINTSET8 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET9_Pos (9UL) /*!< EPERRINTSET9 (Bit 9) */ +#define USB_SYSERRINTSET_EPERRINTSET9_Msk (0x200UL) /*!< EPERRINTSET9 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET10_Pos (10UL) /*!< EPERRINTSET10 (Bit 10) */ +#define USB_SYSERRINTSET_EPERRINTSET10_Msk (0x400UL) /*!< EPERRINTSET10 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET11_Pos (11UL) /*!< EPERRINTSET11 (Bit 11) */ +#define USB_SYSERRINTSET_EPERRINTSET11_Msk (0x800UL) /*!< EPERRINTSET11 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET12_Pos (12UL) /*!< EPERRINTSET12 (Bit 12) */ +#define USB_SYSERRINTSET_EPERRINTSET12_Msk (0x1000UL) /*!< EPERRINTSET12 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET13_Pos (13UL) /*!< EPERRINTSET13 (Bit 13) */ +#define USB_SYSERRINTSET_EPERRINTSET13_Msk (0x2000UL) /*!< EPERRINTSET13 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET14_Pos (14UL) /*!< EPERRINTSET14 (Bit 14) */ +#define USB_SYSERRINTSET_EPERRINTSET14_Msk (0x4000UL) /*!< EPERRINTSET14 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET15_Pos (15UL) /*!< EPERRINTSET15 (Bit 15) */ +#define USB_SYSERRINTSET_EPERRINTSET15_Msk (0x8000UL) /*!< EPERRINTSET15 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET16_Pos (16UL) /*!< EPERRINTSET16 (Bit 16) */ +#define USB_SYSERRINTSET_EPERRINTSET16_Msk (0x10000UL) /*!< EPERRINTSET16 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET17_Pos (17UL) /*!< EPERRINTSET17 (Bit 17) */ +#define USB_SYSERRINTSET_EPERRINTSET17_Msk (0x20000UL) /*!< EPERRINTSET17 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET18_Pos (18UL) /*!< EPERRINTSET18 (Bit 18) */ +#define USB_SYSERRINTSET_EPERRINTSET18_Msk (0x40000UL) /*!< EPERRINTSET18 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET19_Pos (19UL) /*!< EPERRINTSET19 (Bit 19) */ +#define USB_SYSERRINTSET_EPERRINTSET19_Msk (0x80000UL) /*!< EPERRINTSET19 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET20_Pos (20UL) /*!< EPERRINTSET20 (Bit 20) */ +#define USB_SYSERRINTSET_EPERRINTSET20_Msk (0x100000UL) /*!< EPERRINTSET20 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET21_Pos (21UL) /*!< EPERRINTSET21 (Bit 21) */ +#define USB_SYSERRINTSET_EPERRINTSET21_Msk (0x200000UL) /*!< EPERRINTSET21 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET22_Pos (22UL) /*!< EPERRINTSET22 (Bit 22) */ +#define USB_SYSERRINTSET_EPERRINTSET22_Msk (0x400000UL) /*!< EPERRINTSET22 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET23_Pos (23UL) /*!< EPERRINTSET23 (Bit 23) */ +#define USB_SYSERRINTSET_EPERRINTSET23_Msk (0x800000UL) /*!< EPERRINTSET23 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET24_Pos (24UL) /*!< EPERRINTSET24 (Bit 24) */ +#define USB_SYSERRINTSET_EPERRINTSET24_Msk (0x1000000UL) /*!< EPERRINTSET24 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET25_Pos (25UL) /*!< EPERRINTSET25 (Bit 25) */ +#define USB_SYSERRINTSET_EPERRINTSET25_Msk (0x2000000UL) /*!< EPERRINTSET25 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET26_Pos (26UL) /*!< EPERRINTSET26 (Bit 26) */ +#define USB_SYSERRINTSET_EPERRINTSET26_Msk (0x4000000UL) /*!< EPERRINTSET26 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET27_Pos (27UL) /*!< EPERRINTSET27 (Bit 27) */ +#define USB_SYSERRINTSET_EPERRINTSET27_Msk (0x8000000UL) /*!< EPERRINTSET27 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET28_Pos (28UL) /*!< EPERRINTSET28 (Bit 28) */ +#define USB_SYSERRINTSET_EPERRINTSET28_Msk (0x10000000UL) /*!< EPERRINTSET28 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET29_Pos (29UL) /*!< EPERRINTSET29 (Bit 29) */ +#define USB_SYSERRINTSET_EPERRINTSET29_Msk (0x20000000UL) /*!< EPERRINTSET29 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET30_Pos (30UL) /*!< EPERRINTSET30 (Bit 30) */ +#define USB_SYSERRINTSET_EPERRINTSET30_Msk (0x40000000UL) /*!< EPERRINTSET30 (Bitfield-Mask: 0x01) */ +#define USB_SYSERRINTSET_EPERRINTSET31_Pos (31UL) /*!< EPERRINTSET31 (Bit 31) */ +#define USB_SYSERRINTSET_EPERRINTSET31_Msk (0x80000000UL) /*!< EPERRINTSET31 (Bitfield-Mask: 0x01) */ +/* ======================================================== I2C_RX ========================================================= */ +#define USB_I2C_RX_RXDATA_Pos (0UL) /*!< RXDATA (Bit 0) */ +#define USB_I2C_RX_RXDATA_Msk (0xffUL) /*!< RXDATA (Bitfield-Mask: 0xff) */ +/* ======================================================== I2C_WO ========================================================= */ +#define USB_I2C_WO_TXDATA_Pos (0UL) /*!< TXDATA (Bit 0) */ +#define USB_I2C_WO_TXDATA_Msk (0xffUL) /*!< TXDATA (Bitfield-Mask: 0xff) */ +#define USB_I2C_WO_START_Pos (8UL) /*!< START (Bit 8) */ +#define USB_I2C_WO_START_Msk (0x100UL) /*!< START (Bitfield-Mask: 0x01) */ +#define USB_I2C_WO_STOP_Pos (9UL) /*!< STOP (Bit 9) */ +#define USB_I2C_WO_STOP_Msk (0x200UL) /*!< STOP (Bitfield-Mask: 0x01) */ +/* ======================================================== I2C_STS ======================================================== */ +#define USB_I2C_STS_TDI_Pos (0UL) /*!< TDI (Bit 0) */ +#define USB_I2C_STS_TDI_Msk (0x1UL) /*!< TDI (Bitfield-Mask: 0x01) */ +#define USB_I2C_STS_AFI_Pos (1UL) /*!< AFI (Bit 1) */ +#define USB_I2C_STS_AFI_Msk (0x2UL) /*!< AFI (Bitfield-Mask: 0x01) */ +#define USB_I2C_STS_NAI_Pos (2UL) /*!< NAI (Bit 2) */ +#define USB_I2C_STS_NAI_Msk (0x4UL) /*!< NAI (Bitfield-Mask: 0x01) */ +#define USB_I2C_STS_DRMI_Pos (3UL) /*!< DRMI (Bit 3) */ +#define USB_I2C_STS_DRMI_Msk (0x8UL) /*!< DRMI (Bitfield-Mask: 0x01) */ +#define USB_I2C_STS_DRSI_Pos (4UL) /*!< DRSI (Bit 4) */ +#define USB_I2C_STS_DRSI_Msk (0x10UL) /*!< DRSI (Bitfield-Mask: 0x01) */ +#define USB_I2C_STS_Active_Pos (5UL) /*!< Active (Bit 5) */ +#define USB_I2C_STS_Active_Msk (0x20UL) /*!< Active (Bitfield-Mask: 0x01) */ +#define USB_I2C_STS_SCL_Pos (6UL) /*!< SCL (Bit 6) */ +#define USB_I2C_STS_SCL_Msk (0x40UL) /*!< SCL (Bitfield-Mask: 0x01) */ +#define USB_I2C_STS_SDA_Pos (7UL) /*!< SDA (Bit 7) */ +#define USB_I2C_STS_SDA_Msk (0x80UL) /*!< SDA (Bitfield-Mask: 0x01) */ +#define USB_I2C_STS_RFF_Pos (8UL) /*!< RFF (Bit 8) */ +#define USB_I2C_STS_RFF_Msk (0x100UL) /*!< RFF (Bitfield-Mask: 0x01) */ +#define USB_I2C_STS_RFE_Pos (9UL) /*!< RFE (Bit 9) */ +#define USB_I2C_STS_RFE_Msk (0x200UL) /*!< RFE (Bitfield-Mask: 0x01) */ +#define USB_I2C_STS_TFF_Pos (10UL) /*!< TFF (Bit 10) */ +#define USB_I2C_STS_TFF_Msk (0x400UL) /*!< TFF (Bitfield-Mask: 0x01) */ +#define USB_I2C_STS_TFE_Pos (11UL) /*!< TFE (Bit 11) */ +#define USB_I2C_STS_TFE_Msk (0x800UL) /*!< TFE (Bitfield-Mask: 0x01) */ +/* ======================================================== I2C_CTL ======================================================== */ +#define USB_I2C_CTL_TDIE_Pos (0UL) /*!< TDIE (Bit 0) */ +#define USB_I2C_CTL_TDIE_Msk (0x1UL) /*!< TDIE (Bitfield-Mask: 0x01) */ +#define USB_I2C_CTL_AFIE_Pos (1UL) /*!< AFIE (Bit 1) */ +#define USB_I2C_CTL_AFIE_Msk (0x2UL) /*!< AFIE (Bitfield-Mask: 0x01) */ +#define USB_I2C_CTL_NAIE_Pos (2UL) /*!< NAIE (Bit 2) */ +#define USB_I2C_CTL_NAIE_Msk (0x4UL) /*!< NAIE (Bitfield-Mask: 0x01) */ +#define USB_I2C_CTL_DRMIE_Pos (3UL) /*!< DRMIE (Bit 3) */ +#define USB_I2C_CTL_DRMIE_Msk (0x8UL) /*!< DRMIE (Bitfield-Mask: 0x01) */ +#define USB_I2C_CTL_DRSIE_Pos (4UL) /*!< DRSIE (Bit 4) */ +#define USB_I2C_CTL_DRSIE_Msk (0x10UL) /*!< DRSIE (Bitfield-Mask: 0x01) */ +#define USB_I2C_CTL_REFIE_Pos (5UL) /*!< REFIE (Bit 5) */ +#define USB_I2C_CTL_REFIE_Msk (0x20UL) /*!< REFIE (Bitfield-Mask: 0x01) */ +#define USB_I2C_CTL_RFDAIE_Pos (6UL) /*!< RFDAIE (Bit 6) */ +#define USB_I2C_CTL_RFDAIE_Msk (0x40UL) /*!< RFDAIE (Bitfield-Mask: 0x01) */ +#define USB_I2C_CTL_TFFIE_Pos (7UL) /*!< TFFIE (Bit 7) */ +#define USB_I2C_CTL_TFFIE_Msk (0x80UL) /*!< TFFIE (Bitfield-Mask: 0x01) */ +#define USB_I2C_CTL_SRST_Pos (8UL) /*!< SRST (Bit 8) */ +#define USB_I2C_CTL_SRST_Msk (0x100UL) /*!< SRST (Bitfield-Mask: 0x01) */ +/* ======================================================= I2C_CLKHI ======================================================= */ +#define USB_I2C_CLKHI_CDHI_Pos (0UL) /*!< CDHI (Bit 0) */ +#define USB_I2C_CLKHI_CDHI_Msk (0xffUL) /*!< CDHI (Bitfield-Mask: 0xff) */ +/* ======================================================= I2C_CLKLO ======================================================= */ +#define USB_I2C_CLKLO_CDLO_Pos (0UL) /*!< CDLO (Bit 0) */ +#define USB_I2C_CLKLO_CDLO_Msk (0xffUL) /*!< CDLO (Bitfield-Mask: 0xff) */ +/* ====================================================== USBCLKCTRL ======================================================= */ +#define USB_USBCLKCTRL_DEV_CLK_EN_Pos (1UL) /*!< DEV_CLK_EN (Bit 1) */ +#define USB_USBCLKCTRL_DEV_CLK_EN_Msk (0x2UL) /*!< DEV_CLK_EN (Bitfield-Mask: 0x01) */ +#define USB_USBCLKCTRL_PORTSEL_CLK_EN_Pos (3UL) /*!< PORTSEL_CLK_EN (Bit 3) */ +#define USB_USBCLKCTRL_PORTSEL_CLK_EN_Msk (0x8UL) /*!< PORTSEL_CLK_EN (Bitfield-Mask: 0x01) */ +#define USB_USBCLKCTRL_AHB_CLK_EN_Pos (4UL) /*!< AHB_CLK_EN (Bit 4) */ +#define USB_USBCLKCTRL_AHB_CLK_EN_Msk (0x10UL) /*!< AHB_CLK_EN (Bitfield-Mask: 0x01) */ +/* ====================================================== OTGCLKCTRL ======================================================= */ +#define USB_OTGCLKCTRL_HOST_CLK_EN_Pos (0UL) /*!< HOST_CLK_EN (Bit 0) */ +#define USB_OTGCLKCTRL_HOST_CLK_EN_Msk (0x1UL) /*!< HOST_CLK_EN (Bitfield-Mask: 0x01) */ +#define USB_OTGCLKCTRL_DEV_CLK_EN_Pos (1UL) /*!< DEV_CLK_EN (Bit 1) */ +#define USB_OTGCLKCTRL_DEV_CLK_EN_Msk (0x2UL) /*!< DEV_CLK_EN (Bitfield-Mask: 0x01) */ +#define USB_OTGCLKCTRL_I2C_CLK_EN_Pos (2UL) /*!< I2C_CLK_EN (Bit 2) */ +#define USB_OTGCLKCTRL_I2C_CLK_EN_Msk (0x4UL) /*!< I2C_CLK_EN (Bitfield-Mask: 0x01) */ +#define USB_OTGCLKCTRL_OTG_CLK_EN_Pos (3UL) /*!< OTG_CLK_EN (Bit 3) */ +#define USB_OTGCLKCTRL_OTG_CLK_EN_Msk (0x8UL) /*!< OTG_CLK_EN (Bitfield-Mask: 0x01) */ +#define USB_OTGCLKCTRL_AHB_CLK_EN_Pos (4UL) /*!< AHB_CLK_EN (Bit 4) */ +#define USB_OTGCLKCTRL_AHB_CLK_EN_Msk (0x10UL) /*!< AHB_CLK_EN (Bitfield-Mask: 0x01) */ +/* ======================================================= USBCLKST ======================================================== */ +#define USB_USBCLKST_DEV_CLK_ON_Pos (1UL) /*!< DEV_CLK_ON (Bit 1) */ +#define USB_USBCLKST_DEV_CLK_ON_Msk (0x2UL) /*!< DEV_CLK_ON (Bitfield-Mask: 0x01) */ +#define USB_USBCLKST_PORTSEL_CLK_ON_Pos (3UL) /*!< PORTSEL_CLK_ON (Bit 3) */ +#define USB_USBCLKST_PORTSEL_CLK_ON_Msk (0x8UL) /*!< PORTSEL_CLK_ON (Bitfield-Mask: 0x01) */ +#define USB_USBCLKST_AHB_CLK_ON_Pos (4UL) /*!< AHB_CLK_ON (Bit 4) */ +#define USB_USBCLKST_AHB_CLK_ON_Msk (0x10UL) /*!< AHB_CLK_ON (Bitfield-Mask: 0x01) */ +/* ======================================================= OTGCLKST ======================================================== */ +#define USB_OTGCLKST_HOST_CLK_ON_Pos (0UL) /*!< HOST_CLK_ON (Bit 0) */ +#define USB_OTGCLKST_HOST_CLK_ON_Msk (0x1UL) /*!< HOST_CLK_ON (Bitfield-Mask: 0x01) */ +#define USB_OTGCLKST_DEV_CLK_ON_Pos (1UL) /*!< DEV_CLK_ON (Bit 1) */ +#define USB_OTGCLKST_DEV_CLK_ON_Msk (0x2UL) /*!< DEV_CLK_ON (Bitfield-Mask: 0x01) */ +#define USB_OTGCLKST_I2C_CLK_ON_Pos (2UL) /*!< I2C_CLK_ON (Bit 2) */ +#define USB_OTGCLKST_I2C_CLK_ON_Msk (0x4UL) /*!< I2C_CLK_ON (Bitfield-Mask: 0x01) */ +#define USB_OTGCLKST_OTG_CLK_ON_Pos (3UL) /*!< OTG_CLK_ON (Bit 3) */ +#define USB_OTGCLKST_OTG_CLK_ON_Msk (0x8UL) /*!< OTG_CLK_ON (Bitfield-Mask: 0x01) */ +#define USB_OTGCLKST_AHB_CLK_ON_Pos (4UL) /*!< AHB_CLK_ON (Bit 4) */ +#define USB_OTGCLKST_AHB_CLK_ON_Msk (0x10UL) /*!< AHB_CLK_ON (Bitfield-Mask: 0x01) */ + + +/* =========================================================================================================================== */ +/* ================ LPC_GPIO ================ */ +/* =========================================================================================================================== */ + +/* ========================================================= DIR0 ========================================================== */ +#define GPIO_DIR0_PINDIR0_Pos (0UL) /*!< PINDIR0 (Bit 0) */ +#define GPIO_DIR0_PINDIR0_Msk (0x1UL) /*!< PINDIR0 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR1_Pos (1UL) /*!< PINDIR1 (Bit 1) */ +#define GPIO_DIR0_PINDIR1_Msk (0x2UL) /*!< PINDIR1 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR2_Pos (2UL) /*!< PINDIR2 (Bit 2) */ +#define GPIO_DIR0_PINDIR2_Msk (0x4UL) /*!< PINDIR2 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR3_Pos (3UL) /*!< PINDIR3 (Bit 3) */ +#define GPIO_DIR0_PINDIR3_Msk (0x8UL) /*!< PINDIR3 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR4_Pos (4UL) /*!< PINDIR4 (Bit 4) */ +#define GPIO_DIR0_PINDIR4_Msk (0x10UL) /*!< PINDIR4 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR5_Pos (5UL) /*!< PINDIR5 (Bit 5) */ +#define GPIO_DIR0_PINDIR5_Msk (0x20UL) /*!< PINDIR5 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR6_Pos (6UL) /*!< PINDIR6 (Bit 6) */ +#define GPIO_DIR0_PINDIR6_Msk (0x40UL) /*!< PINDIR6 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR7_Pos (7UL) /*!< PINDIR7 (Bit 7) */ +#define GPIO_DIR0_PINDIR7_Msk (0x80UL) /*!< PINDIR7 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR8_Pos (8UL) /*!< PINDIR8 (Bit 8) */ +#define GPIO_DIR0_PINDIR8_Msk (0x100UL) /*!< PINDIR8 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR9_Pos (9UL) /*!< PINDIR9 (Bit 9) */ +#define GPIO_DIR0_PINDIR9_Msk (0x200UL) /*!< PINDIR9 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR10_Pos (10UL) /*!< PINDIR10 (Bit 10) */ +#define GPIO_DIR0_PINDIR10_Msk (0x400UL) /*!< PINDIR10 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR11_Pos (11UL) /*!< PINDIR11 (Bit 11) */ +#define GPIO_DIR0_PINDIR11_Msk (0x800UL) /*!< PINDIR11 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR12_Pos (12UL) /*!< PINDIR12 (Bit 12) */ +#define GPIO_DIR0_PINDIR12_Msk (0x1000UL) /*!< PINDIR12 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR13_Pos (13UL) /*!< PINDIR13 (Bit 13) */ +#define GPIO_DIR0_PINDIR13_Msk (0x2000UL) /*!< PINDIR13 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR14_Pos (14UL) /*!< PINDIR14 (Bit 14) */ +#define GPIO_DIR0_PINDIR14_Msk (0x4000UL) /*!< PINDIR14 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR15_Pos (15UL) /*!< PINDIR15 (Bit 15) */ +#define GPIO_DIR0_PINDIR15_Msk (0x8000UL) /*!< PINDIR15 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR16_Pos (16UL) /*!< PINDIR16 (Bit 16) */ +#define GPIO_DIR0_PINDIR16_Msk (0x10000UL) /*!< PINDIR16 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR17_Pos (17UL) /*!< PINDIR17 (Bit 17) */ +#define GPIO_DIR0_PINDIR17_Msk (0x20000UL) /*!< PINDIR17 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR18_Pos (18UL) /*!< PINDIR18 (Bit 18) */ +#define GPIO_DIR0_PINDIR18_Msk (0x40000UL) /*!< PINDIR18 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR19_Pos (19UL) /*!< PINDIR19 (Bit 19) */ +#define GPIO_DIR0_PINDIR19_Msk (0x80000UL) /*!< PINDIR19 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR20_Pos (20UL) /*!< PINDIR20 (Bit 20) */ +#define GPIO_DIR0_PINDIR20_Msk (0x100000UL) /*!< PINDIR20 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR21_Pos (21UL) /*!< PINDIR21 (Bit 21) */ +#define GPIO_DIR0_PINDIR21_Msk (0x200000UL) /*!< PINDIR21 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR22_Pos (22UL) /*!< PINDIR22 (Bit 22) */ +#define GPIO_DIR0_PINDIR22_Msk (0x400000UL) /*!< PINDIR22 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR23_Pos (23UL) /*!< PINDIR23 (Bit 23) */ +#define GPIO_DIR0_PINDIR23_Msk (0x800000UL) /*!< PINDIR23 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR24_Pos (24UL) /*!< PINDIR24 (Bit 24) */ +#define GPIO_DIR0_PINDIR24_Msk (0x1000000UL) /*!< PINDIR24 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR25_Pos (25UL) /*!< PINDIR25 (Bit 25) */ +#define GPIO_DIR0_PINDIR25_Msk (0x2000000UL) /*!< PINDIR25 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR26_Pos (26UL) /*!< PINDIR26 (Bit 26) */ +#define GPIO_DIR0_PINDIR26_Msk (0x4000000UL) /*!< PINDIR26 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR27_Pos (27UL) /*!< PINDIR27 (Bit 27) */ +#define GPIO_DIR0_PINDIR27_Msk (0x8000000UL) /*!< PINDIR27 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR28_Pos (28UL) /*!< PINDIR28 (Bit 28) */ +#define GPIO_DIR0_PINDIR28_Msk (0x10000000UL) /*!< PINDIR28 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR29_Pos (29UL) /*!< PINDIR29 (Bit 29) */ +#define GPIO_DIR0_PINDIR29_Msk (0x20000000UL) /*!< PINDIR29 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR30_Pos (30UL) /*!< PINDIR30 (Bit 30) */ +#define GPIO_DIR0_PINDIR30_Msk (0x40000000UL) /*!< PINDIR30 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR0_PINDIR31_Pos (31UL) /*!< PINDIR31 (Bit 31) */ +#define GPIO_DIR0_PINDIR31_Msk (0x80000000UL) /*!< PINDIR31 (Bitfield-Mask: 0x01) */ +/* ========================================================= DIR1 ========================================================== */ +#define GPIO_DIR1_PINDIR0_Pos (0UL) /*!< PINDIR0 (Bit 0) */ +#define GPIO_DIR1_PINDIR0_Msk (0x1UL) /*!< PINDIR0 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR1_Pos (1UL) /*!< PINDIR1 (Bit 1) */ +#define GPIO_DIR1_PINDIR1_Msk (0x2UL) /*!< PINDIR1 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR2_Pos (2UL) /*!< PINDIR2 (Bit 2) */ +#define GPIO_DIR1_PINDIR2_Msk (0x4UL) /*!< PINDIR2 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR3_Pos (3UL) /*!< PINDIR3 (Bit 3) */ +#define GPIO_DIR1_PINDIR3_Msk (0x8UL) /*!< PINDIR3 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR4_Pos (4UL) /*!< PINDIR4 (Bit 4) */ +#define GPIO_DIR1_PINDIR4_Msk (0x10UL) /*!< PINDIR4 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR5_Pos (5UL) /*!< PINDIR5 (Bit 5) */ +#define GPIO_DIR1_PINDIR5_Msk (0x20UL) /*!< PINDIR5 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR6_Pos (6UL) /*!< PINDIR6 (Bit 6) */ +#define GPIO_DIR1_PINDIR6_Msk (0x40UL) /*!< PINDIR6 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR7_Pos (7UL) /*!< PINDIR7 (Bit 7) */ +#define GPIO_DIR1_PINDIR7_Msk (0x80UL) /*!< PINDIR7 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR8_Pos (8UL) /*!< PINDIR8 (Bit 8) */ +#define GPIO_DIR1_PINDIR8_Msk (0x100UL) /*!< PINDIR8 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR9_Pos (9UL) /*!< PINDIR9 (Bit 9) */ +#define GPIO_DIR1_PINDIR9_Msk (0x200UL) /*!< PINDIR9 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR10_Pos (10UL) /*!< PINDIR10 (Bit 10) */ +#define GPIO_DIR1_PINDIR10_Msk (0x400UL) /*!< PINDIR10 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR11_Pos (11UL) /*!< PINDIR11 (Bit 11) */ +#define GPIO_DIR1_PINDIR11_Msk (0x800UL) /*!< PINDIR11 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR12_Pos (12UL) /*!< PINDIR12 (Bit 12) */ +#define GPIO_DIR1_PINDIR12_Msk (0x1000UL) /*!< PINDIR12 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR13_Pos (13UL) /*!< PINDIR13 (Bit 13) */ +#define GPIO_DIR1_PINDIR13_Msk (0x2000UL) /*!< PINDIR13 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR14_Pos (14UL) /*!< PINDIR14 (Bit 14) */ +#define GPIO_DIR1_PINDIR14_Msk (0x4000UL) /*!< PINDIR14 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR15_Pos (15UL) /*!< PINDIR15 (Bit 15) */ +#define GPIO_DIR1_PINDIR15_Msk (0x8000UL) /*!< PINDIR15 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR16_Pos (16UL) /*!< PINDIR16 (Bit 16) */ +#define GPIO_DIR1_PINDIR16_Msk (0x10000UL) /*!< PINDIR16 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR17_Pos (17UL) /*!< PINDIR17 (Bit 17) */ +#define GPIO_DIR1_PINDIR17_Msk (0x20000UL) /*!< PINDIR17 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR18_Pos (18UL) /*!< PINDIR18 (Bit 18) */ +#define GPIO_DIR1_PINDIR18_Msk (0x40000UL) /*!< PINDIR18 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR19_Pos (19UL) /*!< PINDIR19 (Bit 19) */ +#define GPIO_DIR1_PINDIR19_Msk (0x80000UL) /*!< PINDIR19 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR20_Pos (20UL) /*!< PINDIR20 (Bit 20) */ +#define GPIO_DIR1_PINDIR20_Msk (0x100000UL) /*!< PINDIR20 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR21_Pos (21UL) /*!< PINDIR21 (Bit 21) */ +#define GPIO_DIR1_PINDIR21_Msk (0x200000UL) /*!< PINDIR21 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR22_Pos (22UL) /*!< PINDIR22 (Bit 22) */ +#define GPIO_DIR1_PINDIR22_Msk (0x400000UL) /*!< PINDIR22 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR23_Pos (23UL) /*!< PINDIR23 (Bit 23) */ +#define GPIO_DIR1_PINDIR23_Msk (0x800000UL) /*!< PINDIR23 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR24_Pos (24UL) /*!< PINDIR24 (Bit 24) */ +#define GPIO_DIR1_PINDIR24_Msk (0x1000000UL) /*!< PINDIR24 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR25_Pos (25UL) /*!< PINDIR25 (Bit 25) */ +#define GPIO_DIR1_PINDIR25_Msk (0x2000000UL) /*!< PINDIR25 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR26_Pos (26UL) /*!< PINDIR26 (Bit 26) */ +#define GPIO_DIR1_PINDIR26_Msk (0x4000000UL) /*!< PINDIR26 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR27_Pos (27UL) /*!< PINDIR27 (Bit 27) */ +#define GPIO_DIR1_PINDIR27_Msk (0x8000000UL) /*!< PINDIR27 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR28_Pos (28UL) /*!< PINDIR28 (Bit 28) */ +#define GPIO_DIR1_PINDIR28_Msk (0x10000000UL) /*!< PINDIR28 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR29_Pos (29UL) /*!< PINDIR29 (Bit 29) */ +#define GPIO_DIR1_PINDIR29_Msk (0x20000000UL) /*!< PINDIR29 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR30_Pos (30UL) /*!< PINDIR30 (Bit 30) */ +#define GPIO_DIR1_PINDIR30_Msk (0x40000000UL) /*!< PINDIR30 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR1_PINDIR31_Pos (31UL) /*!< PINDIR31 (Bit 31) */ +#define GPIO_DIR1_PINDIR31_Msk (0x80000000UL) /*!< PINDIR31 (Bitfield-Mask: 0x01) */ +/* ========================================================= DIR2 ========================================================== */ +#define GPIO_DIR2_PINDIR0_Pos (0UL) /*!< PINDIR0 (Bit 0) */ +#define GPIO_DIR2_PINDIR0_Msk (0x1UL) /*!< PINDIR0 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR1_Pos (1UL) /*!< PINDIR1 (Bit 1) */ +#define GPIO_DIR2_PINDIR1_Msk (0x2UL) /*!< PINDIR1 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR2_Pos (2UL) /*!< PINDIR2 (Bit 2) */ +#define GPIO_DIR2_PINDIR2_Msk (0x4UL) /*!< PINDIR2 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR3_Pos (3UL) /*!< PINDIR3 (Bit 3) */ +#define GPIO_DIR2_PINDIR3_Msk (0x8UL) /*!< PINDIR3 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR4_Pos (4UL) /*!< PINDIR4 (Bit 4) */ +#define GPIO_DIR2_PINDIR4_Msk (0x10UL) /*!< PINDIR4 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR5_Pos (5UL) /*!< PINDIR5 (Bit 5) */ +#define GPIO_DIR2_PINDIR5_Msk (0x20UL) /*!< PINDIR5 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR6_Pos (6UL) /*!< PINDIR6 (Bit 6) */ +#define GPIO_DIR2_PINDIR6_Msk (0x40UL) /*!< PINDIR6 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR7_Pos (7UL) /*!< PINDIR7 (Bit 7) */ +#define GPIO_DIR2_PINDIR7_Msk (0x80UL) /*!< PINDIR7 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR8_Pos (8UL) /*!< PINDIR8 (Bit 8) */ +#define GPIO_DIR2_PINDIR8_Msk (0x100UL) /*!< PINDIR8 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR9_Pos (9UL) /*!< PINDIR9 (Bit 9) */ +#define GPIO_DIR2_PINDIR9_Msk (0x200UL) /*!< PINDIR9 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR10_Pos (10UL) /*!< PINDIR10 (Bit 10) */ +#define GPIO_DIR2_PINDIR10_Msk (0x400UL) /*!< PINDIR10 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR11_Pos (11UL) /*!< PINDIR11 (Bit 11) */ +#define GPIO_DIR2_PINDIR11_Msk (0x800UL) /*!< PINDIR11 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR12_Pos (12UL) /*!< PINDIR12 (Bit 12) */ +#define GPIO_DIR2_PINDIR12_Msk (0x1000UL) /*!< PINDIR12 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR13_Pos (13UL) /*!< PINDIR13 (Bit 13) */ +#define GPIO_DIR2_PINDIR13_Msk (0x2000UL) /*!< PINDIR13 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR14_Pos (14UL) /*!< PINDIR14 (Bit 14) */ +#define GPIO_DIR2_PINDIR14_Msk (0x4000UL) /*!< PINDIR14 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR15_Pos (15UL) /*!< PINDIR15 (Bit 15) */ +#define GPIO_DIR2_PINDIR15_Msk (0x8000UL) /*!< PINDIR15 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR16_Pos (16UL) /*!< PINDIR16 (Bit 16) */ +#define GPIO_DIR2_PINDIR16_Msk (0x10000UL) /*!< PINDIR16 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR17_Pos (17UL) /*!< PINDIR17 (Bit 17) */ +#define GPIO_DIR2_PINDIR17_Msk (0x20000UL) /*!< PINDIR17 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR18_Pos (18UL) /*!< PINDIR18 (Bit 18) */ +#define GPIO_DIR2_PINDIR18_Msk (0x40000UL) /*!< PINDIR18 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR19_Pos (19UL) /*!< PINDIR19 (Bit 19) */ +#define GPIO_DIR2_PINDIR19_Msk (0x80000UL) /*!< PINDIR19 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR20_Pos (20UL) /*!< PINDIR20 (Bit 20) */ +#define GPIO_DIR2_PINDIR20_Msk (0x100000UL) /*!< PINDIR20 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR21_Pos (21UL) /*!< PINDIR21 (Bit 21) */ +#define GPIO_DIR2_PINDIR21_Msk (0x200000UL) /*!< PINDIR21 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR22_Pos (22UL) /*!< PINDIR22 (Bit 22) */ +#define GPIO_DIR2_PINDIR22_Msk (0x400000UL) /*!< PINDIR22 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR23_Pos (23UL) /*!< PINDIR23 (Bit 23) */ +#define GPIO_DIR2_PINDIR23_Msk (0x800000UL) /*!< PINDIR23 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR24_Pos (24UL) /*!< PINDIR24 (Bit 24) */ +#define GPIO_DIR2_PINDIR24_Msk (0x1000000UL) /*!< PINDIR24 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR25_Pos (25UL) /*!< PINDIR25 (Bit 25) */ +#define GPIO_DIR2_PINDIR25_Msk (0x2000000UL) /*!< PINDIR25 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR26_Pos (26UL) /*!< PINDIR26 (Bit 26) */ +#define GPIO_DIR2_PINDIR26_Msk (0x4000000UL) /*!< PINDIR26 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR27_Pos (27UL) /*!< PINDIR27 (Bit 27) */ +#define GPIO_DIR2_PINDIR27_Msk (0x8000000UL) /*!< PINDIR27 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR28_Pos (28UL) /*!< PINDIR28 (Bit 28) */ +#define GPIO_DIR2_PINDIR28_Msk (0x10000000UL) /*!< PINDIR28 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR29_Pos (29UL) /*!< PINDIR29 (Bit 29) */ +#define GPIO_DIR2_PINDIR29_Msk (0x20000000UL) /*!< PINDIR29 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR30_Pos (30UL) /*!< PINDIR30 (Bit 30) */ +#define GPIO_DIR2_PINDIR30_Msk (0x40000000UL) /*!< PINDIR30 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR2_PINDIR31_Pos (31UL) /*!< PINDIR31 (Bit 31) */ +#define GPIO_DIR2_PINDIR31_Msk (0x80000000UL) /*!< PINDIR31 (Bitfield-Mask: 0x01) */ +/* ========================================================= DIR3 ========================================================== */ +#define GPIO_DIR3_PINDIR0_Pos (0UL) /*!< PINDIR0 (Bit 0) */ +#define GPIO_DIR3_PINDIR0_Msk (0x1UL) /*!< PINDIR0 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR1_Pos (1UL) /*!< PINDIR1 (Bit 1) */ +#define GPIO_DIR3_PINDIR1_Msk (0x2UL) /*!< PINDIR1 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR2_Pos (2UL) /*!< PINDIR2 (Bit 2) */ +#define GPIO_DIR3_PINDIR2_Msk (0x4UL) /*!< PINDIR2 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR3_Pos (3UL) /*!< PINDIR3 (Bit 3) */ +#define GPIO_DIR3_PINDIR3_Msk (0x8UL) /*!< PINDIR3 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR4_Pos (4UL) /*!< PINDIR4 (Bit 4) */ +#define GPIO_DIR3_PINDIR4_Msk (0x10UL) /*!< PINDIR4 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR5_Pos (5UL) /*!< PINDIR5 (Bit 5) */ +#define GPIO_DIR3_PINDIR5_Msk (0x20UL) /*!< PINDIR5 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR6_Pos (6UL) /*!< PINDIR6 (Bit 6) */ +#define GPIO_DIR3_PINDIR6_Msk (0x40UL) /*!< PINDIR6 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR7_Pos (7UL) /*!< PINDIR7 (Bit 7) */ +#define GPIO_DIR3_PINDIR7_Msk (0x80UL) /*!< PINDIR7 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR8_Pos (8UL) /*!< PINDIR8 (Bit 8) */ +#define GPIO_DIR3_PINDIR8_Msk (0x100UL) /*!< PINDIR8 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR9_Pos (9UL) /*!< PINDIR9 (Bit 9) */ +#define GPIO_DIR3_PINDIR9_Msk (0x200UL) /*!< PINDIR9 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR10_Pos (10UL) /*!< PINDIR10 (Bit 10) */ +#define GPIO_DIR3_PINDIR10_Msk (0x400UL) /*!< PINDIR10 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR11_Pos (11UL) /*!< PINDIR11 (Bit 11) */ +#define GPIO_DIR3_PINDIR11_Msk (0x800UL) /*!< PINDIR11 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR12_Pos (12UL) /*!< PINDIR12 (Bit 12) */ +#define GPIO_DIR3_PINDIR12_Msk (0x1000UL) /*!< PINDIR12 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR13_Pos (13UL) /*!< PINDIR13 (Bit 13) */ +#define GPIO_DIR3_PINDIR13_Msk (0x2000UL) /*!< PINDIR13 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR14_Pos (14UL) /*!< PINDIR14 (Bit 14) */ +#define GPIO_DIR3_PINDIR14_Msk (0x4000UL) /*!< PINDIR14 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR15_Pos (15UL) /*!< PINDIR15 (Bit 15) */ +#define GPIO_DIR3_PINDIR15_Msk (0x8000UL) /*!< PINDIR15 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR16_Pos (16UL) /*!< PINDIR16 (Bit 16) */ +#define GPIO_DIR3_PINDIR16_Msk (0x10000UL) /*!< PINDIR16 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR17_Pos (17UL) /*!< PINDIR17 (Bit 17) */ +#define GPIO_DIR3_PINDIR17_Msk (0x20000UL) /*!< PINDIR17 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR18_Pos (18UL) /*!< PINDIR18 (Bit 18) */ +#define GPIO_DIR3_PINDIR18_Msk (0x40000UL) /*!< PINDIR18 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR19_Pos (19UL) /*!< PINDIR19 (Bit 19) */ +#define GPIO_DIR3_PINDIR19_Msk (0x80000UL) /*!< PINDIR19 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR20_Pos (20UL) /*!< PINDIR20 (Bit 20) */ +#define GPIO_DIR3_PINDIR20_Msk (0x100000UL) /*!< PINDIR20 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR21_Pos (21UL) /*!< PINDIR21 (Bit 21) */ +#define GPIO_DIR3_PINDIR21_Msk (0x200000UL) /*!< PINDIR21 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR22_Pos (22UL) /*!< PINDIR22 (Bit 22) */ +#define GPIO_DIR3_PINDIR22_Msk (0x400000UL) /*!< PINDIR22 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR23_Pos (23UL) /*!< PINDIR23 (Bit 23) */ +#define GPIO_DIR3_PINDIR23_Msk (0x800000UL) /*!< PINDIR23 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR24_Pos (24UL) /*!< PINDIR24 (Bit 24) */ +#define GPIO_DIR3_PINDIR24_Msk (0x1000000UL) /*!< PINDIR24 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR25_Pos (25UL) /*!< PINDIR25 (Bit 25) */ +#define GPIO_DIR3_PINDIR25_Msk (0x2000000UL) /*!< PINDIR25 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR26_Pos (26UL) /*!< PINDIR26 (Bit 26) */ +#define GPIO_DIR3_PINDIR26_Msk (0x4000000UL) /*!< PINDIR26 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR27_Pos (27UL) /*!< PINDIR27 (Bit 27) */ +#define GPIO_DIR3_PINDIR27_Msk (0x8000000UL) /*!< PINDIR27 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR28_Pos (28UL) /*!< PINDIR28 (Bit 28) */ +#define GPIO_DIR3_PINDIR28_Msk (0x10000000UL) /*!< PINDIR28 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR29_Pos (29UL) /*!< PINDIR29 (Bit 29) */ +#define GPIO_DIR3_PINDIR29_Msk (0x20000000UL) /*!< PINDIR29 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR30_Pos (30UL) /*!< PINDIR30 (Bit 30) */ +#define GPIO_DIR3_PINDIR30_Msk (0x40000000UL) /*!< PINDIR30 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR3_PINDIR31_Pos (31UL) /*!< PINDIR31 (Bit 31) */ +#define GPIO_DIR3_PINDIR31_Msk (0x80000000UL) /*!< PINDIR31 (Bitfield-Mask: 0x01) */ +/* ========================================================= DIR4 ========================================================== */ +#define GPIO_DIR4_PINDIR0_Pos (0UL) /*!< PINDIR0 (Bit 0) */ +#define GPIO_DIR4_PINDIR0_Msk (0x1UL) /*!< PINDIR0 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR1_Pos (1UL) /*!< PINDIR1 (Bit 1) */ +#define GPIO_DIR4_PINDIR1_Msk (0x2UL) /*!< PINDIR1 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR2_Pos (2UL) /*!< PINDIR2 (Bit 2) */ +#define GPIO_DIR4_PINDIR2_Msk (0x4UL) /*!< PINDIR2 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR3_Pos (3UL) /*!< PINDIR3 (Bit 3) */ +#define GPIO_DIR4_PINDIR3_Msk (0x8UL) /*!< PINDIR3 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR4_Pos (4UL) /*!< PINDIR4 (Bit 4) */ +#define GPIO_DIR4_PINDIR4_Msk (0x10UL) /*!< PINDIR4 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR5_Pos (5UL) /*!< PINDIR5 (Bit 5) */ +#define GPIO_DIR4_PINDIR5_Msk (0x20UL) /*!< PINDIR5 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR6_Pos (6UL) /*!< PINDIR6 (Bit 6) */ +#define GPIO_DIR4_PINDIR6_Msk (0x40UL) /*!< PINDIR6 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR7_Pos (7UL) /*!< PINDIR7 (Bit 7) */ +#define GPIO_DIR4_PINDIR7_Msk (0x80UL) /*!< PINDIR7 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR8_Pos (8UL) /*!< PINDIR8 (Bit 8) */ +#define GPIO_DIR4_PINDIR8_Msk (0x100UL) /*!< PINDIR8 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR9_Pos (9UL) /*!< PINDIR9 (Bit 9) */ +#define GPIO_DIR4_PINDIR9_Msk (0x200UL) /*!< PINDIR9 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR10_Pos (10UL) /*!< PINDIR10 (Bit 10) */ +#define GPIO_DIR4_PINDIR10_Msk (0x400UL) /*!< PINDIR10 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR11_Pos (11UL) /*!< PINDIR11 (Bit 11) */ +#define GPIO_DIR4_PINDIR11_Msk (0x800UL) /*!< PINDIR11 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR12_Pos (12UL) /*!< PINDIR12 (Bit 12) */ +#define GPIO_DIR4_PINDIR12_Msk (0x1000UL) /*!< PINDIR12 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR13_Pos (13UL) /*!< PINDIR13 (Bit 13) */ +#define GPIO_DIR4_PINDIR13_Msk (0x2000UL) /*!< PINDIR13 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR14_Pos (14UL) /*!< PINDIR14 (Bit 14) */ +#define GPIO_DIR4_PINDIR14_Msk (0x4000UL) /*!< PINDIR14 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR15_Pos (15UL) /*!< PINDIR15 (Bit 15) */ +#define GPIO_DIR4_PINDIR15_Msk (0x8000UL) /*!< PINDIR15 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR16_Pos (16UL) /*!< PINDIR16 (Bit 16) */ +#define GPIO_DIR4_PINDIR16_Msk (0x10000UL) /*!< PINDIR16 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR17_Pos (17UL) /*!< PINDIR17 (Bit 17) */ +#define GPIO_DIR4_PINDIR17_Msk (0x20000UL) /*!< PINDIR17 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR18_Pos (18UL) /*!< PINDIR18 (Bit 18) */ +#define GPIO_DIR4_PINDIR18_Msk (0x40000UL) /*!< PINDIR18 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR19_Pos (19UL) /*!< PINDIR19 (Bit 19) */ +#define GPIO_DIR4_PINDIR19_Msk (0x80000UL) /*!< PINDIR19 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR20_Pos (20UL) /*!< PINDIR20 (Bit 20) */ +#define GPIO_DIR4_PINDIR20_Msk (0x100000UL) /*!< PINDIR20 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR21_Pos (21UL) /*!< PINDIR21 (Bit 21) */ +#define GPIO_DIR4_PINDIR21_Msk (0x200000UL) /*!< PINDIR21 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR22_Pos (22UL) /*!< PINDIR22 (Bit 22) */ +#define GPIO_DIR4_PINDIR22_Msk (0x400000UL) /*!< PINDIR22 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR23_Pos (23UL) /*!< PINDIR23 (Bit 23) */ +#define GPIO_DIR4_PINDIR23_Msk (0x800000UL) /*!< PINDIR23 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR24_Pos (24UL) /*!< PINDIR24 (Bit 24) */ +#define GPIO_DIR4_PINDIR24_Msk (0x1000000UL) /*!< PINDIR24 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR25_Pos (25UL) /*!< PINDIR25 (Bit 25) */ +#define GPIO_DIR4_PINDIR25_Msk (0x2000000UL) /*!< PINDIR25 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR26_Pos (26UL) /*!< PINDIR26 (Bit 26) */ +#define GPIO_DIR4_PINDIR26_Msk (0x4000000UL) /*!< PINDIR26 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR27_Pos (27UL) /*!< PINDIR27 (Bit 27) */ +#define GPIO_DIR4_PINDIR27_Msk (0x8000000UL) /*!< PINDIR27 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR28_Pos (28UL) /*!< PINDIR28 (Bit 28) */ +#define GPIO_DIR4_PINDIR28_Msk (0x10000000UL) /*!< PINDIR28 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR29_Pos (29UL) /*!< PINDIR29 (Bit 29) */ +#define GPIO_DIR4_PINDIR29_Msk (0x20000000UL) /*!< PINDIR29 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR30_Pos (30UL) /*!< PINDIR30 (Bit 30) */ +#define GPIO_DIR4_PINDIR30_Msk (0x40000000UL) /*!< PINDIR30 (Bitfield-Mask: 0x01) */ +#define GPIO_DIR4_PINDIR31_Pos (31UL) /*!< PINDIR31 (Bit 31) */ +#define GPIO_DIR4_PINDIR31_Msk (0x80000000UL) /*!< PINDIR31 (Bitfield-Mask: 0x01) */ +/* ========================================================= MASK0 ========================================================= */ +#define GPIO_MASK0_PINMASK0_Pos (0UL) /*!< PINMASK0 (Bit 0) */ +#define GPIO_MASK0_PINMASK0_Msk (0x1UL) /*!< PINMASK0 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK1_Pos (1UL) /*!< PINMASK1 (Bit 1) */ +#define GPIO_MASK0_PINMASK1_Msk (0x2UL) /*!< PINMASK1 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK2_Pos (2UL) /*!< PINMASK2 (Bit 2) */ +#define GPIO_MASK0_PINMASK2_Msk (0x4UL) /*!< PINMASK2 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK3_Pos (3UL) /*!< PINMASK3 (Bit 3) */ +#define GPIO_MASK0_PINMASK3_Msk (0x8UL) /*!< PINMASK3 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK4_Pos (4UL) /*!< PINMASK4 (Bit 4) */ +#define GPIO_MASK0_PINMASK4_Msk (0x10UL) /*!< PINMASK4 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK5_Pos (5UL) /*!< PINMASK5 (Bit 5) */ +#define GPIO_MASK0_PINMASK5_Msk (0x20UL) /*!< PINMASK5 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK6_Pos (6UL) /*!< PINMASK6 (Bit 6) */ +#define GPIO_MASK0_PINMASK6_Msk (0x40UL) /*!< PINMASK6 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK7_Pos (7UL) /*!< PINMASK7 (Bit 7) */ +#define GPIO_MASK0_PINMASK7_Msk (0x80UL) /*!< PINMASK7 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK8_Pos (8UL) /*!< PINMASK8 (Bit 8) */ +#define GPIO_MASK0_PINMASK8_Msk (0x100UL) /*!< PINMASK8 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK9_Pos (9UL) /*!< PINMASK9 (Bit 9) */ +#define GPIO_MASK0_PINMASK9_Msk (0x200UL) /*!< PINMASK9 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK10_Pos (10UL) /*!< PINMASK10 (Bit 10) */ +#define GPIO_MASK0_PINMASK10_Msk (0x400UL) /*!< PINMASK10 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK11_Pos (11UL) /*!< PINMASK11 (Bit 11) */ +#define GPIO_MASK0_PINMASK11_Msk (0x800UL) /*!< PINMASK11 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK12_Pos (12UL) /*!< PINMASK12 (Bit 12) */ +#define GPIO_MASK0_PINMASK12_Msk (0x1000UL) /*!< PINMASK12 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK13_Pos (13UL) /*!< PINMASK13 (Bit 13) */ +#define GPIO_MASK0_PINMASK13_Msk (0x2000UL) /*!< PINMASK13 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK14_Pos (14UL) /*!< PINMASK14 (Bit 14) */ +#define GPIO_MASK0_PINMASK14_Msk (0x4000UL) /*!< PINMASK14 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK15_Pos (15UL) /*!< PINMASK15 (Bit 15) */ +#define GPIO_MASK0_PINMASK15_Msk (0x8000UL) /*!< PINMASK15 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK16_Pos (16UL) /*!< PINMASK16 (Bit 16) */ +#define GPIO_MASK0_PINMASK16_Msk (0x10000UL) /*!< PINMASK16 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK17_Pos (17UL) /*!< PINMASK17 (Bit 17) */ +#define GPIO_MASK0_PINMASK17_Msk (0x20000UL) /*!< PINMASK17 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK18_Pos (18UL) /*!< PINMASK18 (Bit 18) */ +#define GPIO_MASK0_PINMASK18_Msk (0x40000UL) /*!< PINMASK18 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK19_Pos (19UL) /*!< PINMASK19 (Bit 19) */ +#define GPIO_MASK0_PINMASK19_Msk (0x80000UL) /*!< PINMASK19 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK20_Pos (20UL) /*!< PINMASK20 (Bit 20) */ +#define GPIO_MASK0_PINMASK20_Msk (0x100000UL) /*!< PINMASK20 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK21_Pos (21UL) /*!< PINMASK21 (Bit 21) */ +#define GPIO_MASK0_PINMASK21_Msk (0x200000UL) /*!< PINMASK21 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK22_Pos (22UL) /*!< PINMASK22 (Bit 22) */ +#define GPIO_MASK0_PINMASK22_Msk (0x400000UL) /*!< PINMASK22 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK23_Pos (23UL) /*!< PINMASK23 (Bit 23) */ +#define GPIO_MASK0_PINMASK23_Msk (0x800000UL) /*!< PINMASK23 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK24_Pos (24UL) /*!< PINMASK24 (Bit 24) */ +#define GPIO_MASK0_PINMASK24_Msk (0x1000000UL) /*!< PINMASK24 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK25_Pos (25UL) /*!< PINMASK25 (Bit 25) */ +#define GPIO_MASK0_PINMASK25_Msk (0x2000000UL) /*!< PINMASK25 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK26_Pos (26UL) /*!< PINMASK26 (Bit 26) */ +#define GPIO_MASK0_PINMASK26_Msk (0x4000000UL) /*!< PINMASK26 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK27_Pos (27UL) /*!< PINMASK27 (Bit 27) */ +#define GPIO_MASK0_PINMASK27_Msk (0x8000000UL) /*!< PINMASK27 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK28_Pos (28UL) /*!< PINMASK28 (Bit 28) */ +#define GPIO_MASK0_PINMASK28_Msk (0x10000000UL) /*!< PINMASK28 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK29_Pos (29UL) /*!< PINMASK29 (Bit 29) */ +#define GPIO_MASK0_PINMASK29_Msk (0x20000000UL) /*!< PINMASK29 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK30_Pos (30UL) /*!< PINMASK30 (Bit 30) */ +#define GPIO_MASK0_PINMASK30_Msk (0x40000000UL) /*!< PINMASK30 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK0_PINMASK31_Pos (31UL) /*!< PINMASK31 (Bit 31) */ +#define GPIO_MASK0_PINMASK31_Msk (0x80000000UL) /*!< PINMASK31 (Bitfield-Mask: 0x01) */ +/* ========================================================= MASK1 ========================================================= */ +#define GPIO_MASK1_PINMASK0_Pos (0UL) /*!< PINMASK0 (Bit 0) */ +#define GPIO_MASK1_PINMASK0_Msk (0x1UL) /*!< PINMASK0 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK1_Pos (1UL) /*!< PINMASK1 (Bit 1) */ +#define GPIO_MASK1_PINMASK1_Msk (0x2UL) /*!< PINMASK1 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK2_Pos (2UL) /*!< PINMASK2 (Bit 2) */ +#define GPIO_MASK1_PINMASK2_Msk (0x4UL) /*!< PINMASK2 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK3_Pos (3UL) /*!< PINMASK3 (Bit 3) */ +#define GPIO_MASK1_PINMASK3_Msk (0x8UL) /*!< PINMASK3 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK4_Pos (4UL) /*!< PINMASK4 (Bit 4) */ +#define GPIO_MASK1_PINMASK4_Msk (0x10UL) /*!< PINMASK4 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK5_Pos (5UL) /*!< PINMASK5 (Bit 5) */ +#define GPIO_MASK1_PINMASK5_Msk (0x20UL) /*!< PINMASK5 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK6_Pos (6UL) /*!< PINMASK6 (Bit 6) */ +#define GPIO_MASK1_PINMASK6_Msk (0x40UL) /*!< PINMASK6 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK7_Pos (7UL) /*!< PINMASK7 (Bit 7) */ +#define GPIO_MASK1_PINMASK7_Msk (0x80UL) /*!< PINMASK7 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK8_Pos (8UL) /*!< PINMASK8 (Bit 8) */ +#define GPIO_MASK1_PINMASK8_Msk (0x100UL) /*!< PINMASK8 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK9_Pos (9UL) /*!< PINMASK9 (Bit 9) */ +#define GPIO_MASK1_PINMASK9_Msk (0x200UL) /*!< PINMASK9 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK10_Pos (10UL) /*!< PINMASK10 (Bit 10) */ +#define GPIO_MASK1_PINMASK10_Msk (0x400UL) /*!< PINMASK10 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK11_Pos (11UL) /*!< PINMASK11 (Bit 11) */ +#define GPIO_MASK1_PINMASK11_Msk (0x800UL) /*!< PINMASK11 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK12_Pos (12UL) /*!< PINMASK12 (Bit 12) */ +#define GPIO_MASK1_PINMASK12_Msk (0x1000UL) /*!< PINMASK12 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK13_Pos (13UL) /*!< PINMASK13 (Bit 13) */ +#define GPIO_MASK1_PINMASK13_Msk (0x2000UL) /*!< PINMASK13 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK14_Pos (14UL) /*!< PINMASK14 (Bit 14) */ +#define GPIO_MASK1_PINMASK14_Msk (0x4000UL) /*!< PINMASK14 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK15_Pos (15UL) /*!< PINMASK15 (Bit 15) */ +#define GPIO_MASK1_PINMASK15_Msk (0x8000UL) /*!< PINMASK15 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK16_Pos (16UL) /*!< PINMASK16 (Bit 16) */ +#define GPIO_MASK1_PINMASK16_Msk (0x10000UL) /*!< PINMASK16 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK17_Pos (17UL) /*!< PINMASK17 (Bit 17) */ +#define GPIO_MASK1_PINMASK17_Msk (0x20000UL) /*!< PINMASK17 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK18_Pos (18UL) /*!< PINMASK18 (Bit 18) */ +#define GPIO_MASK1_PINMASK18_Msk (0x40000UL) /*!< PINMASK18 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK19_Pos (19UL) /*!< PINMASK19 (Bit 19) */ +#define GPIO_MASK1_PINMASK19_Msk (0x80000UL) /*!< PINMASK19 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK20_Pos (20UL) /*!< PINMASK20 (Bit 20) */ +#define GPIO_MASK1_PINMASK20_Msk (0x100000UL) /*!< PINMASK20 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK21_Pos (21UL) /*!< PINMASK21 (Bit 21) */ +#define GPIO_MASK1_PINMASK21_Msk (0x200000UL) /*!< PINMASK21 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK22_Pos (22UL) /*!< PINMASK22 (Bit 22) */ +#define GPIO_MASK1_PINMASK22_Msk (0x400000UL) /*!< PINMASK22 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK23_Pos (23UL) /*!< PINMASK23 (Bit 23) */ +#define GPIO_MASK1_PINMASK23_Msk (0x800000UL) /*!< PINMASK23 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK24_Pos (24UL) /*!< PINMASK24 (Bit 24) */ +#define GPIO_MASK1_PINMASK24_Msk (0x1000000UL) /*!< PINMASK24 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK25_Pos (25UL) /*!< PINMASK25 (Bit 25) */ +#define GPIO_MASK1_PINMASK25_Msk (0x2000000UL) /*!< PINMASK25 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK26_Pos (26UL) /*!< PINMASK26 (Bit 26) */ +#define GPIO_MASK1_PINMASK26_Msk (0x4000000UL) /*!< PINMASK26 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK27_Pos (27UL) /*!< PINMASK27 (Bit 27) */ +#define GPIO_MASK1_PINMASK27_Msk (0x8000000UL) /*!< PINMASK27 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK28_Pos (28UL) /*!< PINMASK28 (Bit 28) */ +#define GPIO_MASK1_PINMASK28_Msk (0x10000000UL) /*!< PINMASK28 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK29_Pos (29UL) /*!< PINMASK29 (Bit 29) */ +#define GPIO_MASK1_PINMASK29_Msk (0x20000000UL) /*!< PINMASK29 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK30_Pos (30UL) /*!< PINMASK30 (Bit 30) */ +#define GPIO_MASK1_PINMASK30_Msk (0x40000000UL) /*!< PINMASK30 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK1_PINMASK31_Pos (31UL) /*!< PINMASK31 (Bit 31) */ +#define GPIO_MASK1_PINMASK31_Msk (0x80000000UL) /*!< PINMASK31 (Bitfield-Mask: 0x01) */ +/* ========================================================= MASK2 ========================================================= */ +#define GPIO_MASK2_PINMASK0_Pos (0UL) /*!< PINMASK0 (Bit 0) */ +#define GPIO_MASK2_PINMASK0_Msk (0x1UL) /*!< PINMASK0 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK1_Pos (1UL) /*!< PINMASK1 (Bit 1) */ +#define GPIO_MASK2_PINMASK1_Msk (0x2UL) /*!< PINMASK1 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK2_Pos (2UL) /*!< PINMASK2 (Bit 2) */ +#define GPIO_MASK2_PINMASK2_Msk (0x4UL) /*!< PINMASK2 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK3_Pos (3UL) /*!< PINMASK3 (Bit 3) */ +#define GPIO_MASK2_PINMASK3_Msk (0x8UL) /*!< PINMASK3 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK4_Pos (4UL) /*!< PINMASK4 (Bit 4) */ +#define GPIO_MASK2_PINMASK4_Msk (0x10UL) /*!< PINMASK4 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK5_Pos (5UL) /*!< PINMASK5 (Bit 5) */ +#define GPIO_MASK2_PINMASK5_Msk (0x20UL) /*!< PINMASK5 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK6_Pos (6UL) /*!< PINMASK6 (Bit 6) */ +#define GPIO_MASK2_PINMASK6_Msk (0x40UL) /*!< PINMASK6 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK7_Pos (7UL) /*!< PINMASK7 (Bit 7) */ +#define GPIO_MASK2_PINMASK7_Msk (0x80UL) /*!< PINMASK7 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK8_Pos (8UL) /*!< PINMASK8 (Bit 8) */ +#define GPIO_MASK2_PINMASK8_Msk (0x100UL) /*!< PINMASK8 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK9_Pos (9UL) /*!< PINMASK9 (Bit 9) */ +#define GPIO_MASK2_PINMASK9_Msk (0x200UL) /*!< PINMASK9 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK10_Pos (10UL) /*!< PINMASK10 (Bit 10) */ +#define GPIO_MASK2_PINMASK10_Msk (0x400UL) /*!< PINMASK10 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK11_Pos (11UL) /*!< PINMASK11 (Bit 11) */ +#define GPIO_MASK2_PINMASK11_Msk (0x800UL) /*!< PINMASK11 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK12_Pos (12UL) /*!< PINMASK12 (Bit 12) */ +#define GPIO_MASK2_PINMASK12_Msk (0x1000UL) /*!< PINMASK12 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK13_Pos (13UL) /*!< PINMASK13 (Bit 13) */ +#define GPIO_MASK2_PINMASK13_Msk (0x2000UL) /*!< PINMASK13 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK14_Pos (14UL) /*!< PINMASK14 (Bit 14) */ +#define GPIO_MASK2_PINMASK14_Msk (0x4000UL) /*!< PINMASK14 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK15_Pos (15UL) /*!< PINMASK15 (Bit 15) */ +#define GPIO_MASK2_PINMASK15_Msk (0x8000UL) /*!< PINMASK15 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK16_Pos (16UL) /*!< PINMASK16 (Bit 16) */ +#define GPIO_MASK2_PINMASK16_Msk (0x10000UL) /*!< PINMASK16 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK17_Pos (17UL) /*!< PINMASK17 (Bit 17) */ +#define GPIO_MASK2_PINMASK17_Msk (0x20000UL) /*!< PINMASK17 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK18_Pos (18UL) /*!< PINMASK18 (Bit 18) */ +#define GPIO_MASK2_PINMASK18_Msk (0x40000UL) /*!< PINMASK18 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK19_Pos (19UL) /*!< PINMASK19 (Bit 19) */ +#define GPIO_MASK2_PINMASK19_Msk (0x80000UL) /*!< PINMASK19 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK20_Pos (20UL) /*!< PINMASK20 (Bit 20) */ +#define GPIO_MASK2_PINMASK20_Msk (0x100000UL) /*!< PINMASK20 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK21_Pos (21UL) /*!< PINMASK21 (Bit 21) */ +#define GPIO_MASK2_PINMASK21_Msk (0x200000UL) /*!< PINMASK21 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK22_Pos (22UL) /*!< PINMASK22 (Bit 22) */ +#define GPIO_MASK2_PINMASK22_Msk (0x400000UL) /*!< PINMASK22 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK23_Pos (23UL) /*!< PINMASK23 (Bit 23) */ +#define GPIO_MASK2_PINMASK23_Msk (0x800000UL) /*!< PINMASK23 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK24_Pos (24UL) /*!< PINMASK24 (Bit 24) */ +#define GPIO_MASK2_PINMASK24_Msk (0x1000000UL) /*!< PINMASK24 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK25_Pos (25UL) /*!< PINMASK25 (Bit 25) */ +#define GPIO_MASK2_PINMASK25_Msk (0x2000000UL) /*!< PINMASK25 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK26_Pos (26UL) /*!< PINMASK26 (Bit 26) */ +#define GPIO_MASK2_PINMASK26_Msk (0x4000000UL) /*!< PINMASK26 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK27_Pos (27UL) /*!< PINMASK27 (Bit 27) */ +#define GPIO_MASK2_PINMASK27_Msk (0x8000000UL) /*!< PINMASK27 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK28_Pos (28UL) /*!< PINMASK28 (Bit 28) */ +#define GPIO_MASK2_PINMASK28_Msk (0x10000000UL) /*!< PINMASK28 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK29_Pos (29UL) /*!< PINMASK29 (Bit 29) */ +#define GPIO_MASK2_PINMASK29_Msk (0x20000000UL) /*!< PINMASK29 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK30_Pos (30UL) /*!< PINMASK30 (Bit 30) */ +#define GPIO_MASK2_PINMASK30_Msk (0x40000000UL) /*!< PINMASK30 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK2_PINMASK31_Pos (31UL) /*!< PINMASK31 (Bit 31) */ +#define GPIO_MASK2_PINMASK31_Msk (0x80000000UL) /*!< PINMASK31 (Bitfield-Mask: 0x01) */ +/* ========================================================= MASK3 ========================================================= */ +#define GPIO_MASK3_PINMASK0_Pos (0UL) /*!< PINMASK0 (Bit 0) */ +#define GPIO_MASK3_PINMASK0_Msk (0x1UL) /*!< PINMASK0 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK1_Pos (1UL) /*!< PINMASK1 (Bit 1) */ +#define GPIO_MASK3_PINMASK1_Msk (0x2UL) /*!< PINMASK1 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK2_Pos (2UL) /*!< PINMASK2 (Bit 2) */ +#define GPIO_MASK3_PINMASK2_Msk (0x4UL) /*!< PINMASK2 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK3_Pos (3UL) /*!< PINMASK3 (Bit 3) */ +#define GPIO_MASK3_PINMASK3_Msk (0x8UL) /*!< PINMASK3 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK4_Pos (4UL) /*!< PINMASK4 (Bit 4) */ +#define GPIO_MASK3_PINMASK4_Msk (0x10UL) /*!< PINMASK4 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK5_Pos (5UL) /*!< PINMASK5 (Bit 5) */ +#define GPIO_MASK3_PINMASK5_Msk (0x20UL) /*!< PINMASK5 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK6_Pos (6UL) /*!< PINMASK6 (Bit 6) */ +#define GPIO_MASK3_PINMASK6_Msk (0x40UL) /*!< PINMASK6 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK7_Pos (7UL) /*!< PINMASK7 (Bit 7) */ +#define GPIO_MASK3_PINMASK7_Msk (0x80UL) /*!< PINMASK7 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK8_Pos (8UL) /*!< PINMASK8 (Bit 8) */ +#define GPIO_MASK3_PINMASK8_Msk (0x100UL) /*!< PINMASK8 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK9_Pos (9UL) /*!< PINMASK9 (Bit 9) */ +#define GPIO_MASK3_PINMASK9_Msk (0x200UL) /*!< PINMASK9 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK10_Pos (10UL) /*!< PINMASK10 (Bit 10) */ +#define GPIO_MASK3_PINMASK10_Msk (0x400UL) /*!< PINMASK10 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK11_Pos (11UL) /*!< PINMASK11 (Bit 11) */ +#define GPIO_MASK3_PINMASK11_Msk (0x800UL) /*!< PINMASK11 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK12_Pos (12UL) /*!< PINMASK12 (Bit 12) */ +#define GPIO_MASK3_PINMASK12_Msk (0x1000UL) /*!< PINMASK12 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK13_Pos (13UL) /*!< PINMASK13 (Bit 13) */ +#define GPIO_MASK3_PINMASK13_Msk (0x2000UL) /*!< PINMASK13 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK14_Pos (14UL) /*!< PINMASK14 (Bit 14) */ +#define GPIO_MASK3_PINMASK14_Msk (0x4000UL) /*!< PINMASK14 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK15_Pos (15UL) /*!< PINMASK15 (Bit 15) */ +#define GPIO_MASK3_PINMASK15_Msk (0x8000UL) /*!< PINMASK15 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK16_Pos (16UL) /*!< PINMASK16 (Bit 16) */ +#define GPIO_MASK3_PINMASK16_Msk (0x10000UL) /*!< PINMASK16 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK17_Pos (17UL) /*!< PINMASK17 (Bit 17) */ +#define GPIO_MASK3_PINMASK17_Msk (0x20000UL) /*!< PINMASK17 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK18_Pos (18UL) /*!< PINMASK18 (Bit 18) */ +#define GPIO_MASK3_PINMASK18_Msk (0x40000UL) /*!< PINMASK18 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK19_Pos (19UL) /*!< PINMASK19 (Bit 19) */ +#define GPIO_MASK3_PINMASK19_Msk (0x80000UL) /*!< PINMASK19 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK20_Pos (20UL) /*!< PINMASK20 (Bit 20) */ +#define GPIO_MASK3_PINMASK20_Msk (0x100000UL) /*!< PINMASK20 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK21_Pos (21UL) /*!< PINMASK21 (Bit 21) */ +#define GPIO_MASK3_PINMASK21_Msk (0x200000UL) /*!< PINMASK21 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK22_Pos (22UL) /*!< PINMASK22 (Bit 22) */ +#define GPIO_MASK3_PINMASK22_Msk (0x400000UL) /*!< PINMASK22 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK23_Pos (23UL) /*!< PINMASK23 (Bit 23) */ +#define GPIO_MASK3_PINMASK23_Msk (0x800000UL) /*!< PINMASK23 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK24_Pos (24UL) /*!< PINMASK24 (Bit 24) */ +#define GPIO_MASK3_PINMASK24_Msk (0x1000000UL) /*!< PINMASK24 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK25_Pos (25UL) /*!< PINMASK25 (Bit 25) */ +#define GPIO_MASK3_PINMASK25_Msk (0x2000000UL) /*!< PINMASK25 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK26_Pos (26UL) /*!< PINMASK26 (Bit 26) */ +#define GPIO_MASK3_PINMASK26_Msk (0x4000000UL) /*!< PINMASK26 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK27_Pos (27UL) /*!< PINMASK27 (Bit 27) */ +#define GPIO_MASK3_PINMASK27_Msk (0x8000000UL) /*!< PINMASK27 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK28_Pos (28UL) /*!< PINMASK28 (Bit 28) */ +#define GPIO_MASK3_PINMASK28_Msk (0x10000000UL) /*!< PINMASK28 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK29_Pos (29UL) /*!< PINMASK29 (Bit 29) */ +#define GPIO_MASK3_PINMASK29_Msk (0x20000000UL) /*!< PINMASK29 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK30_Pos (30UL) /*!< PINMASK30 (Bit 30) */ +#define GPIO_MASK3_PINMASK30_Msk (0x40000000UL) /*!< PINMASK30 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK3_PINMASK31_Pos (31UL) /*!< PINMASK31 (Bit 31) */ +#define GPIO_MASK3_PINMASK31_Msk (0x80000000UL) /*!< PINMASK31 (Bitfield-Mask: 0x01) */ +/* ========================================================= MASK4 ========================================================= */ +#define GPIO_MASK4_PINMASK0_Pos (0UL) /*!< PINMASK0 (Bit 0) */ +#define GPIO_MASK4_PINMASK0_Msk (0x1UL) /*!< PINMASK0 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK1_Pos (1UL) /*!< PINMASK1 (Bit 1) */ +#define GPIO_MASK4_PINMASK1_Msk (0x2UL) /*!< PINMASK1 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK2_Pos (2UL) /*!< PINMASK2 (Bit 2) */ +#define GPIO_MASK4_PINMASK2_Msk (0x4UL) /*!< PINMASK2 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK3_Pos (3UL) /*!< PINMASK3 (Bit 3) */ +#define GPIO_MASK4_PINMASK3_Msk (0x8UL) /*!< PINMASK3 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK4_Pos (4UL) /*!< PINMASK4 (Bit 4) */ +#define GPIO_MASK4_PINMASK4_Msk (0x10UL) /*!< PINMASK4 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK5_Pos (5UL) /*!< PINMASK5 (Bit 5) */ +#define GPIO_MASK4_PINMASK5_Msk (0x20UL) /*!< PINMASK5 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK6_Pos (6UL) /*!< PINMASK6 (Bit 6) */ +#define GPIO_MASK4_PINMASK6_Msk (0x40UL) /*!< PINMASK6 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK7_Pos (7UL) /*!< PINMASK7 (Bit 7) */ +#define GPIO_MASK4_PINMASK7_Msk (0x80UL) /*!< PINMASK7 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK8_Pos (8UL) /*!< PINMASK8 (Bit 8) */ +#define GPIO_MASK4_PINMASK8_Msk (0x100UL) /*!< PINMASK8 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK9_Pos (9UL) /*!< PINMASK9 (Bit 9) */ +#define GPIO_MASK4_PINMASK9_Msk (0x200UL) /*!< PINMASK9 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK10_Pos (10UL) /*!< PINMASK10 (Bit 10) */ +#define GPIO_MASK4_PINMASK10_Msk (0x400UL) /*!< PINMASK10 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK11_Pos (11UL) /*!< PINMASK11 (Bit 11) */ +#define GPIO_MASK4_PINMASK11_Msk (0x800UL) /*!< PINMASK11 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK12_Pos (12UL) /*!< PINMASK12 (Bit 12) */ +#define GPIO_MASK4_PINMASK12_Msk (0x1000UL) /*!< PINMASK12 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK13_Pos (13UL) /*!< PINMASK13 (Bit 13) */ +#define GPIO_MASK4_PINMASK13_Msk (0x2000UL) /*!< PINMASK13 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK14_Pos (14UL) /*!< PINMASK14 (Bit 14) */ +#define GPIO_MASK4_PINMASK14_Msk (0x4000UL) /*!< PINMASK14 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK15_Pos (15UL) /*!< PINMASK15 (Bit 15) */ +#define GPIO_MASK4_PINMASK15_Msk (0x8000UL) /*!< PINMASK15 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK16_Pos (16UL) /*!< PINMASK16 (Bit 16) */ +#define GPIO_MASK4_PINMASK16_Msk (0x10000UL) /*!< PINMASK16 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK17_Pos (17UL) /*!< PINMASK17 (Bit 17) */ +#define GPIO_MASK4_PINMASK17_Msk (0x20000UL) /*!< PINMASK17 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK18_Pos (18UL) /*!< PINMASK18 (Bit 18) */ +#define GPIO_MASK4_PINMASK18_Msk (0x40000UL) /*!< PINMASK18 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK19_Pos (19UL) /*!< PINMASK19 (Bit 19) */ +#define GPIO_MASK4_PINMASK19_Msk (0x80000UL) /*!< PINMASK19 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK20_Pos (20UL) /*!< PINMASK20 (Bit 20) */ +#define GPIO_MASK4_PINMASK20_Msk (0x100000UL) /*!< PINMASK20 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK21_Pos (21UL) /*!< PINMASK21 (Bit 21) */ +#define GPIO_MASK4_PINMASK21_Msk (0x200000UL) /*!< PINMASK21 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK22_Pos (22UL) /*!< PINMASK22 (Bit 22) */ +#define GPIO_MASK4_PINMASK22_Msk (0x400000UL) /*!< PINMASK22 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK23_Pos (23UL) /*!< PINMASK23 (Bit 23) */ +#define GPIO_MASK4_PINMASK23_Msk (0x800000UL) /*!< PINMASK23 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK24_Pos (24UL) /*!< PINMASK24 (Bit 24) */ +#define GPIO_MASK4_PINMASK24_Msk (0x1000000UL) /*!< PINMASK24 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK25_Pos (25UL) /*!< PINMASK25 (Bit 25) */ +#define GPIO_MASK4_PINMASK25_Msk (0x2000000UL) /*!< PINMASK25 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK26_Pos (26UL) /*!< PINMASK26 (Bit 26) */ +#define GPIO_MASK4_PINMASK26_Msk (0x4000000UL) /*!< PINMASK26 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK27_Pos (27UL) /*!< PINMASK27 (Bit 27) */ +#define GPIO_MASK4_PINMASK27_Msk (0x8000000UL) /*!< PINMASK27 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK28_Pos (28UL) /*!< PINMASK28 (Bit 28) */ +#define GPIO_MASK4_PINMASK28_Msk (0x10000000UL) /*!< PINMASK28 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK29_Pos (29UL) /*!< PINMASK29 (Bit 29) */ +#define GPIO_MASK4_PINMASK29_Msk (0x20000000UL) /*!< PINMASK29 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK30_Pos (30UL) /*!< PINMASK30 (Bit 30) */ +#define GPIO_MASK4_PINMASK30_Msk (0x40000000UL) /*!< PINMASK30 (Bitfield-Mask: 0x01) */ +#define GPIO_MASK4_PINMASK31_Pos (31UL) /*!< PINMASK31 (Bit 31) */ +#define GPIO_MASK4_PINMASK31_Msk (0x80000000UL) /*!< PINMASK31 (Bitfield-Mask: 0x01) */ +/* ========================================================= PIN0 ========================================================== */ +#define GPIO_PIN0_PINVAL0_Pos (0UL) /*!< PINVAL0 (Bit 0) */ +#define GPIO_PIN0_PINVAL0_Msk (0x1UL) /*!< PINVAL0 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL1_Pos (1UL) /*!< PINVAL1 (Bit 1) */ +#define GPIO_PIN0_PINVAL1_Msk (0x2UL) /*!< PINVAL1 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL2_Pos (2UL) /*!< PINVAL2 (Bit 2) */ +#define GPIO_PIN0_PINVAL2_Msk (0x4UL) /*!< PINVAL2 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL3_Pos (3UL) /*!< PINVAL3 (Bit 3) */ +#define GPIO_PIN0_PINVAL3_Msk (0x8UL) /*!< PINVAL3 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL4_Pos (4UL) /*!< PINVAL4 (Bit 4) */ +#define GPIO_PIN0_PINVAL4_Msk (0x10UL) /*!< PINVAL4 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL5_Pos (5UL) /*!< PINVAL5 (Bit 5) */ +#define GPIO_PIN0_PINVAL5_Msk (0x20UL) /*!< PINVAL5 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL6_Pos (6UL) /*!< PINVAL6 (Bit 6) */ +#define GPIO_PIN0_PINVAL6_Msk (0x40UL) /*!< PINVAL6 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL7_Pos (7UL) /*!< PINVAL7 (Bit 7) */ +#define GPIO_PIN0_PINVAL7_Msk (0x80UL) /*!< PINVAL7 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL8_Pos (8UL) /*!< PINVAL8 (Bit 8) */ +#define GPIO_PIN0_PINVAL8_Msk (0x100UL) /*!< PINVAL8 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL9_Pos (9UL) /*!< PINVAL9 (Bit 9) */ +#define GPIO_PIN0_PINVAL9_Msk (0x200UL) /*!< PINVAL9 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL10_Pos (10UL) /*!< PINVAL10 (Bit 10) */ +#define GPIO_PIN0_PINVAL10_Msk (0x400UL) /*!< PINVAL10 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL11_Pos (11UL) /*!< PINVAL11 (Bit 11) */ +#define GPIO_PIN0_PINVAL11_Msk (0x800UL) /*!< PINVAL11 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL12_Pos (12UL) /*!< PINVAL12 (Bit 12) */ +#define GPIO_PIN0_PINVAL12_Msk (0x1000UL) /*!< PINVAL12 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL13_Pos (13UL) /*!< PINVAL13 (Bit 13) */ +#define GPIO_PIN0_PINVAL13_Msk (0x2000UL) /*!< PINVAL13 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL14_Pos (14UL) /*!< PINVAL14 (Bit 14) */ +#define GPIO_PIN0_PINVAL14_Msk (0x4000UL) /*!< PINVAL14 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL15_Pos (15UL) /*!< PINVAL15 (Bit 15) */ +#define GPIO_PIN0_PINVAL15_Msk (0x8000UL) /*!< PINVAL15 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL16_Pos (16UL) /*!< PINVAL16 (Bit 16) */ +#define GPIO_PIN0_PINVAL16_Msk (0x10000UL) /*!< PINVAL16 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL17_Pos (17UL) /*!< PINVAL17 (Bit 17) */ +#define GPIO_PIN0_PINVAL17_Msk (0x20000UL) /*!< PINVAL17 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL18_Pos (18UL) /*!< PINVAL18 (Bit 18) */ +#define GPIO_PIN0_PINVAL18_Msk (0x40000UL) /*!< PINVAL18 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL19_Pos (19UL) /*!< PINVAL19 (Bit 19) */ +#define GPIO_PIN0_PINVAL19_Msk (0x80000UL) /*!< PINVAL19 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL20_Pos (20UL) /*!< PINVAL20 (Bit 20) */ +#define GPIO_PIN0_PINVAL20_Msk (0x100000UL) /*!< PINVAL20 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL21_Pos (21UL) /*!< PINVAL21 (Bit 21) */ +#define GPIO_PIN0_PINVAL21_Msk (0x200000UL) /*!< PINVAL21 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL22_Pos (22UL) /*!< PINVAL22 (Bit 22) */ +#define GPIO_PIN0_PINVAL22_Msk (0x400000UL) /*!< PINVAL22 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL23_Pos (23UL) /*!< PINVAL23 (Bit 23) */ +#define GPIO_PIN0_PINVAL23_Msk (0x800000UL) /*!< PINVAL23 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL24_Pos (24UL) /*!< PINVAL24 (Bit 24) */ +#define GPIO_PIN0_PINVAL24_Msk (0x1000000UL) /*!< PINVAL24 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL25_Pos (25UL) /*!< PINVAL25 (Bit 25) */ +#define GPIO_PIN0_PINVAL25_Msk (0x2000000UL) /*!< PINVAL25 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL26_Pos (26UL) /*!< PINVAL26 (Bit 26) */ +#define GPIO_PIN0_PINVAL26_Msk (0x4000000UL) /*!< PINVAL26 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL27_Pos (27UL) /*!< PINVAL27 (Bit 27) */ +#define GPIO_PIN0_PINVAL27_Msk (0x8000000UL) /*!< PINVAL27 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL28_Pos (28UL) /*!< PINVAL28 (Bit 28) */ +#define GPIO_PIN0_PINVAL28_Msk (0x10000000UL) /*!< PINVAL28 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL29_Pos (29UL) /*!< PINVAL29 (Bit 29) */ +#define GPIO_PIN0_PINVAL29_Msk (0x20000000UL) /*!< PINVAL29 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL30_Pos (30UL) /*!< PINVAL30 (Bit 30) */ +#define GPIO_PIN0_PINVAL30_Msk (0x40000000UL) /*!< PINVAL30 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN0_PINVAL31_Pos (31UL) /*!< PINVAL31 (Bit 31) */ +#define GPIO_PIN0_PINVAL31_Msk (0x80000000UL) /*!< PINVAL31 (Bitfield-Mask: 0x01) */ +/* ========================================================= PIN1 ========================================================== */ +#define GPIO_PIN1_PINVAL0_Pos (0UL) /*!< PINVAL0 (Bit 0) */ +#define GPIO_PIN1_PINVAL0_Msk (0x1UL) /*!< PINVAL0 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL1_Pos (1UL) /*!< PINVAL1 (Bit 1) */ +#define GPIO_PIN1_PINVAL1_Msk (0x2UL) /*!< PINVAL1 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL2_Pos (2UL) /*!< PINVAL2 (Bit 2) */ +#define GPIO_PIN1_PINVAL2_Msk (0x4UL) /*!< PINVAL2 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL3_Pos (3UL) /*!< PINVAL3 (Bit 3) */ +#define GPIO_PIN1_PINVAL3_Msk (0x8UL) /*!< PINVAL3 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL4_Pos (4UL) /*!< PINVAL4 (Bit 4) */ +#define GPIO_PIN1_PINVAL4_Msk (0x10UL) /*!< PINVAL4 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL5_Pos (5UL) /*!< PINVAL5 (Bit 5) */ +#define GPIO_PIN1_PINVAL5_Msk (0x20UL) /*!< PINVAL5 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL6_Pos (6UL) /*!< PINVAL6 (Bit 6) */ +#define GPIO_PIN1_PINVAL6_Msk (0x40UL) /*!< PINVAL6 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL7_Pos (7UL) /*!< PINVAL7 (Bit 7) */ +#define GPIO_PIN1_PINVAL7_Msk (0x80UL) /*!< PINVAL7 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL8_Pos (8UL) /*!< PINVAL8 (Bit 8) */ +#define GPIO_PIN1_PINVAL8_Msk (0x100UL) /*!< PINVAL8 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL9_Pos (9UL) /*!< PINVAL9 (Bit 9) */ +#define GPIO_PIN1_PINVAL9_Msk (0x200UL) /*!< PINVAL9 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL10_Pos (10UL) /*!< PINVAL10 (Bit 10) */ +#define GPIO_PIN1_PINVAL10_Msk (0x400UL) /*!< PINVAL10 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL11_Pos (11UL) /*!< PINVAL11 (Bit 11) */ +#define GPIO_PIN1_PINVAL11_Msk (0x800UL) /*!< PINVAL11 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL12_Pos (12UL) /*!< PINVAL12 (Bit 12) */ +#define GPIO_PIN1_PINVAL12_Msk (0x1000UL) /*!< PINVAL12 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL13_Pos (13UL) /*!< PINVAL13 (Bit 13) */ +#define GPIO_PIN1_PINVAL13_Msk (0x2000UL) /*!< PINVAL13 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL14_Pos (14UL) /*!< PINVAL14 (Bit 14) */ +#define GPIO_PIN1_PINVAL14_Msk (0x4000UL) /*!< PINVAL14 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL15_Pos (15UL) /*!< PINVAL15 (Bit 15) */ +#define GPIO_PIN1_PINVAL15_Msk (0x8000UL) /*!< PINVAL15 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL16_Pos (16UL) /*!< PINVAL16 (Bit 16) */ +#define GPIO_PIN1_PINVAL16_Msk (0x10000UL) /*!< PINVAL16 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL17_Pos (17UL) /*!< PINVAL17 (Bit 17) */ +#define GPIO_PIN1_PINVAL17_Msk (0x20000UL) /*!< PINVAL17 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL18_Pos (18UL) /*!< PINVAL18 (Bit 18) */ +#define GPIO_PIN1_PINVAL18_Msk (0x40000UL) /*!< PINVAL18 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL19_Pos (19UL) /*!< PINVAL19 (Bit 19) */ +#define GPIO_PIN1_PINVAL19_Msk (0x80000UL) /*!< PINVAL19 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL20_Pos (20UL) /*!< PINVAL20 (Bit 20) */ +#define GPIO_PIN1_PINVAL20_Msk (0x100000UL) /*!< PINVAL20 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL21_Pos (21UL) /*!< PINVAL21 (Bit 21) */ +#define GPIO_PIN1_PINVAL21_Msk (0x200000UL) /*!< PINVAL21 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL22_Pos (22UL) /*!< PINVAL22 (Bit 22) */ +#define GPIO_PIN1_PINVAL22_Msk (0x400000UL) /*!< PINVAL22 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL23_Pos (23UL) /*!< PINVAL23 (Bit 23) */ +#define GPIO_PIN1_PINVAL23_Msk (0x800000UL) /*!< PINVAL23 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL24_Pos (24UL) /*!< PINVAL24 (Bit 24) */ +#define GPIO_PIN1_PINVAL24_Msk (0x1000000UL) /*!< PINVAL24 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL25_Pos (25UL) /*!< PINVAL25 (Bit 25) */ +#define GPIO_PIN1_PINVAL25_Msk (0x2000000UL) /*!< PINVAL25 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL26_Pos (26UL) /*!< PINVAL26 (Bit 26) */ +#define GPIO_PIN1_PINVAL26_Msk (0x4000000UL) /*!< PINVAL26 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL27_Pos (27UL) /*!< PINVAL27 (Bit 27) */ +#define GPIO_PIN1_PINVAL27_Msk (0x8000000UL) /*!< PINVAL27 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL28_Pos (28UL) /*!< PINVAL28 (Bit 28) */ +#define GPIO_PIN1_PINVAL28_Msk (0x10000000UL) /*!< PINVAL28 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL29_Pos (29UL) /*!< PINVAL29 (Bit 29) */ +#define GPIO_PIN1_PINVAL29_Msk (0x20000000UL) /*!< PINVAL29 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL30_Pos (30UL) /*!< PINVAL30 (Bit 30) */ +#define GPIO_PIN1_PINVAL30_Msk (0x40000000UL) /*!< PINVAL30 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN1_PINVAL31_Pos (31UL) /*!< PINVAL31 (Bit 31) */ +#define GPIO_PIN1_PINVAL31_Msk (0x80000000UL) /*!< PINVAL31 (Bitfield-Mask: 0x01) */ +/* ========================================================= PIN2 ========================================================== */ +#define GPIO_PIN2_PINVAL0_Pos (0UL) /*!< PINVAL0 (Bit 0) */ +#define GPIO_PIN2_PINVAL0_Msk (0x1UL) /*!< PINVAL0 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL1_Pos (1UL) /*!< PINVAL1 (Bit 1) */ +#define GPIO_PIN2_PINVAL1_Msk (0x2UL) /*!< PINVAL1 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL2_Pos (2UL) /*!< PINVAL2 (Bit 2) */ +#define GPIO_PIN2_PINVAL2_Msk (0x4UL) /*!< PINVAL2 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL3_Pos (3UL) /*!< PINVAL3 (Bit 3) */ +#define GPIO_PIN2_PINVAL3_Msk (0x8UL) /*!< PINVAL3 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL4_Pos (4UL) /*!< PINVAL4 (Bit 4) */ +#define GPIO_PIN2_PINVAL4_Msk (0x10UL) /*!< PINVAL4 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL5_Pos (5UL) /*!< PINVAL5 (Bit 5) */ +#define GPIO_PIN2_PINVAL5_Msk (0x20UL) /*!< PINVAL5 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL6_Pos (6UL) /*!< PINVAL6 (Bit 6) */ +#define GPIO_PIN2_PINVAL6_Msk (0x40UL) /*!< PINVAL6 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL7_Pos (7UL) /*!< PINVAL7 (Bit 7) */ +#define GPIO_PIN2_PINVAL7_Msk (0x80UL) /*!< PINVAL7 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL8_Pos (8UL) /*!< PINVAL8 (Bit 8) */ +#define GPIO_PIN2_PINVAL8_Msk (0x100UL) /*!< PINVAL8 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL9_Pos (9UL) /*!< PINVAL9 (Bit 9) */ +#define GPIO_PIN2_PINVAL9_Msk (0x200UL) /*!< PINVAL9 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL10_Pos (10UL) /*!< PINVAL10 (Bit 10) */ +#define GPIO_PIN2_PINVAL10_Msk (0x400UL) /*!< PINVAL10 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL11_Pos (11UL) /*!< PINVAL11 (Bit 11) */ +#define GPIO_PIN2_PINVAL11_Msk (0x800UL) /*!< PINVAL11 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL12_Pos (12UL) /*!< PINVAL12 (Bit 12) */ +#define GPIO_PIN2_PINVAL12_Msk (0x1000UL) /*!< PINVAL12 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL13_Pos (13UL) /*!< PINVAL13 (Bit 13) */ +#define GPIO_PIN2_PINVAL13_Msk (0x2000UL) /*!< PINVAL13 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL14_Pos (14UL) /*!< PINVAL14 (Bit 14) */ +#define GPIO_PIN2_PINVAL14_Msk (0x4000UL) /*!< PINVAL14 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL15_Pos (15UL) /*!< PINVAL15 (Bit 15) */ +#define GPIO_PIN2_PINVAL15_Msk (0x8000UL) /*!< PINVAL15 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL16_Pos (16UL) /*!< PINVAL16 (Bit 16) */ +#define GPIO_PIN2_PINVAL16_Msk (0x10000UL) /*!< PINVAL16 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL17_Pos (17UL) /*!< PINVAL17 (Bit 17) */ +#define GPIO_PIN2_PINVAL17_Msk (0x20000UL) /*!< PINVAL17 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL18_Pos (18UL) /*!< PINVAL18 (Bit 18) */ +#define GPIO_PIN2_PINVAL18_Msk (0x40000UL) /*!< PINVAL18 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL19_Pos (19UL) /*!< PINVAL19 (Bit 19) */ +#define GPIO_PIN2_PINVAL19_Msk (0x80000UL) /*!< PINVAL19 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL20_Pos (20UL) /*!< PINVAL20 (Bit 20) */ +#define GPIO_PIN2_PINVAL20_Msk (0x100000UL) /*!< PINVAL20 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL21_Pos (21UL) /*!< PINVAL21 (Bit 21) */ +#define GPIO_PIN2_PINVAL21_Msk (0x200000UL) /*!< PINVAL21 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL22_Pos (22UL) /*!< PINVAL22 (Bit 22) */ +#define GPIO_PIN2_PINVAL22_Msk (0x400000UL) /*!< PINVAL22 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL23_Pos (23UL) /*!< PINVAL23 (Bit 23) */ +#define GPIO_PIN2_PINVAL23_Msk (0x800000UL) /*!< PINVAL23 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL24_Pos (24UL) /*!< PINVAL24 (Bit 24) */ +#define GPIO_PIN2_PINVAL24_Msk (0x1000000UL) /*!< PINVAL24 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL25_Pos (25UL) /*!< PINVAL25 (Bit 25) */ +#define GPIO_PIN2_PINVAL25_Msk (0x2000000UL) /*!< PINVAL25 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL26_Pos (26UL) /*!< PINVAL26 (Bit 26) */ +#define GPIO_PIN2_PINVAL26_Msk (0x4000000UL) /*!< PINVAL26 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL27_Pos (27UL) /*!< PINVAL27 (Bit 27) */ +#define GPIO_PIN2_PINVAL27_Msk (0x8000000UL) /*!< PINVAL27 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL28_Pos (28UL) /*!< PINVAL28 (Bit 28) */ +#define GPIO_PIN2_PINVAL28_Msk (0x10000000UL) /*!< PINVAL28 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL29_Pos (29UL) /*!< PINVAL29 (Bit 29) */ +#define GPIO_PIN2_PINVAL29_Msk (0x20000000UL) /*!< PINVAL29 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL30_Pos (30UL) /*!< PINVAL30 (Bit 30) */ +#define GPIO_PIN2_PINVAL30_Msk (0x40000000UL) /*!< PINVAL30 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN2_PINVAL31_Pos (31UL) /*!< PINVAL31 (Bit 31) */ +#define GPIO_PIN2_PINVAL31_Msk (0x80000000UL) /*!< PINVAL31 (Bitfield-Mask: 0x01) */ +/* ========================================================= PIN3 ========================================================== */ +#define GPIO_PIN3_PINVAL0_Pos (0UL) /*!< PINVAL0 (Bit 0) */ +#define GPIO_PIN3_PINVAL0_Msk (0x1UL) /*!< PINVAL0 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL1_Pos (1UL) /*!< PINVAL1 (Bit 1) */ +#define GPIO_PIN3_PINVAL1_Msk (0x2UL) /*!< PINVAL1 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL2_Pos (2UL) /*!< PINVAL2 (Bit 2) */ +#define GPIO_PIN3_PINVAL2_Msk (0x4UL) /*!< PINVAL2 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL3_Pos (3UL) /*!< PINVAL3 (Bit 3) */ +#define GPIO_PIN3_PINVAL3_Msk (0x8UL) /*!< PINVAL3 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL4_Pos (4UL) /*!< PINVAL4 (Bit 4) */ +#define GPIO_PIN3_PINVAL4_Msk (0x10UL) /*!< PINVAL4 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL5_Pos (5UL) /*!< PINVAL5 (Bit 5) */ +#define GPIO_PIN3_PINVAL5_Msk (0x20UL) /*!< PINVAL5 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL6_Pos (6UL) /*!< PINVAL6 (Bit 6) */ +#define GPIO_PIN3_PINVAL6_Msk (0x40UL) /*!< PINVAL6 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL7_Pos (7UL) /*!< PINVAL7 (Bit 7) */ +#define GPIO_PIN3_PINVAL7_Msk (0x80UL) /*!< PINVAL7 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL8_Pos (8UL) /*!< PINVAL8 (Bit 8) */ +#define GPIO_PIN3_PINVAL8_Msk (0x100UL) /*!< PINVAL8 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL9_Pos (9UL) /*!< PINVAL9 (Bit 9) */ +#define GPIO_PIN3_PINVAL9_Msk (0x200UL) /*!< PINVAL9 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL10_Pos (10UL) /*!< PINVAL10 (Bit 10) */ +#define GPIO_PIN3_PINVAL10_Msk (0x400UL) /*!< PINVAL10 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL11_Pos (11UL) /*!< PINVAL11 (Bit 11) */ +#define GPIO_PIN3_PINVAL11_Msk (0x800UL) /*!< PINVAL11 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL12_Pos (12UL) /*!< PINVAL12 (Bit 12) */ +#define GPIO_PIN3_PINVAL12_Msk (0x1000UL) /*!< PINVAL12 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL13_Pos (13UL) /*!< PINVAL13 (Bit 13) */ +#define GPIO_PIN3_PINVAL13_Msk (0x2000UL) /*!< PINVAL13 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL14_Pos (14UL) /*!< PINVAL14 (Bit 14) */ +#define GPIO_PIN3_PINVAL14_Msk (0x4000UL) /*!< PINVAL14 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL15_Pos (15UL) /*!< PINVAL15 (Bit 15) */ +#define GPIO_PIN3_PINVAL15_Msk (0x8000UL) /*!< PINVAL15 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL16_Pos (16UL) /*!< PINVAL16 (Bit 16) */ +#define GPIO_PIN3_PINVAL16_Msk (0x10000UL) /*!< PINVAL16 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL17_Pos (17UL) /*!< PINVAL17 (Bit 17) */ +#define GPIO_PIN3_PINVAL17_Msk (0x20000UL) /*!< PINVAL17 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL18_Pos (18UL) /*!< PINVAL18 (Bit 18) */ +#define GPIO_PIN3_PINVAL18_Msk (0x40000UL) /*!< PINVAL18 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL19_Pos (19UL) /*!< PINVAL19 (Bit 19) */ +#define GPIO_PIN3_PINVAL19_Msk (0x80000UL) /*!< PINVAL19 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL20_Pos (20UL) /*!< PINVAL20 (Bit 20) */ +#define GPIO_PIN3_PINVAL20_Msk (0x100000UL) /*!< PINVAL20 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL21_Pos (21UL) /*!< PINVAL21 (Bit 21) */ +#define GPIO_PIN3_PINVAL21_Msk (0x200000UL) /*!< PINVAL21 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL22_Pos (22UL) /*!< PINVAL22 (Bit 22) */ +#define GPIO_PIN3_PINVAL22_Msk (0x400000UL) /*!< PINVAL22 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL23_Pos (23UL) /*!< PINVAL23 (Bit 23) */ +#define GPIO_PIN3_PINVAL23_Msk (0x800000UL) /*!< PINVAL23 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL24_Pos (24UL) /*!< PINVAL24 (Bit 24) */ +#define GPIO_PIN3_PINVAL24_Msk (0x1000000UL) /*!< PINVAL24 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL25_Pos (25UL) /*!< PINVAL25 (Bit 25) */ +#define GPIO_PIN3_PINVAL25_Msk (0x2000000UL) /*!< PINVAL25 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL26_Pos (26UL) /*!< PINVAL26 (Bit 26) */ +#define GPIO_PIN3_PINVAL26_Msk (0x4000000UL) /*!< PINVAL26 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL27_Pos (27UL) /*!< PINVAL27 (Bit 27) */ +#define GPIO_PIN3_PINVAL27_Msk (0x8000000UL) /*!< PINVAL27 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL28_Pos (28UL) /*!< PINVAL28 (Bit 28) */ +#define GPIO_PIN3_PINVAL28_Msk (0x10000000UL) /*!< PINVAL28 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL29_Pos (29UL) /*!< PINVAL29 (Bit 29) */ +#define GPIO_PIN3_PINVAL29_Msk (0x20000000UL) /*!< PINVAL29 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL30_Pos (30UL) /*!< PINVAL30 (Bit 30) */ +#define GPIO_PIN3_PINVAL30_Msk (0x40000000UL) /*!< PINVAL30 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN3_PINVAL31_Pos (31UL) /*!< PINVAL31 (Bit 31) */ +#define GPIO_PIN3_PINVAL31_Msk (0x80000000UL) /*!< PINVAL31 (Bitfield-Mask: 0x01) */ +/* ========================================================= PIN4 ========================================================== */ +#define GPIO_PIN4_PINVAL0_Pos (0UL) /*!< PINVAL0 (Bit 0) */ +#define GPIO_PIN4_PINVAL0_Msk (0x1UL) /*!< PINVAL0 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL1_Pos (1UL) /*!< PINVAL1 (Bit 1) */ +#define GPIO_PIN4_PINVAL1_Msk (0x2UL) /*!< PINVAL1 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL2_Pos (2UL) /*!< PINVAL2 (Bit 2) */ +#define GPIO_PIN4_PINVAL2_Msk (0x4UL) /*!< PINVAL2 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL3_Pos (3UL) /*!< PINVAL3 (Bit 3) */ +#define GPIO_PIN4_PINVAL3_Msk (0x8UL) /*!< PINVAL3 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL4_Pos (4UL) /*!< PINVAL4 (Bit 4) */ +#define GPIO_PIN4_PINVAL4_Msk (0x10UL) /*!< PINVAL4 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL5_Pos (5UL) /*!< PINVAL5 (Bit 5) */ +#define GPIO_PIN4_PINVAL5_Msk (0x20UL) /*!< PINVAL5 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL6_Pos (6UL) /*!< PINVAL6 (Bit 6) */ +#define GPIO_PIN4_PINVAL6_Msk (0x40UL) /*!< PINVAL6 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL7_Pos (7UL) /*!< PINVAL7 (Bit 7) */ +#define GPIO_PIN4_PINVAL7_Msk (0x80UL) /*!< PINVAL7 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL8_Pos (8UL) /*!< PINVAL8 (Bit 8) */ +#define GPIO_PIN4_PINVAL8_Msk (0x100UL) /*!< PINVAL8 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL9_Pos (9UL) /*!< PINVAL9 (Bit 9) */ +#define GPIO_PIN4_PINVAL9_Msk (0x200UL) /*!< PINVAL9 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL10_Pos (10UL) /*!< PINVAL10 (Bit 10) */ +#define GPIO_PIN4_PINVAL10_Msk (0x400UL) /*!< PINVAL10 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL11_Pos (11UL) /*!< PINVAL11 (Bit 11) */ +#define GPIO_PIN4_PINVAL11_Msk (0x800UL) /*!< PINVAL11 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL12_Pos (12UL) /*!< PINVAL12 (Bit 12) */ +#define GPIO_PIN4_PINVAL12_Msk (0x1000UL) /*!< PINVAL12 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL13_Pos (13UL) /*!< PINVAL13 (Bit 13) */ +#define GPIO_PIN4_PINVAL13_Msk (0x2000UL) /*!< PINVAL13 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL14_Pos (14UL) /*!< PINVAL14 (Bit 14) */ +#define GPIO_PIN4_PINVAL14_Msk (0x4000UL) /*!< PINVAL14 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL15_Pos (15UL) /*!< PINVAL15 (Bit 15) */ +#define GPIO_PIN4_PINVAL15_Msk (0x8000UL) /*!< PINVAL15 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL16_Pos (16UL) /*!< PINVAL16 (Bit 16) */ +#define GPIO_PIN4_PINVAL16_Msk (0x10000UL) /*!< PINVAL16 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL17_Pos (17UL) /*!< PINVAL17 (Bit 17) */ +#define GPIO_PIN4_PINVAL17_Msk (0x20000UL) /*!< PINVAL17 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL18_Pos (18UL) /*!< PINVAL18 (Bit 18) */ +#define GPIO_PIN4_PINVAL18_Msk (0x40000UL) /*!< PINVAL18 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL19_Pos (19UL) /*!< PINVAL19 (Bit 19) */ +#define GPIO_PIN4_PINVAL19_Msk (0x80000UL) /*!< PINVAL19 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL20_Pos (20UL) /*!< PINVAL20 (Bit 20) */ +#define GPIO_PIN4_PINVAL20_Msk (0x100000UL) /*!< PINVAL20 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL21_Pos (21UL) /*!< PINVAL21 (Bit 21) */ +#define GPIO_PIN4_PINVAL21_Msk (0x200000UL) /*!< PINVAL21 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL22_Pos (22UL) /*!< PINVAL22 (Bit 22) */ +#define GPIO_PIN4_PINVAL22_Msk (0x400000UL) /*!< PINVAL22 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL23_Pos (23UL) /*!< PINVAL23 (Bit 23) */ +#define GPIO_PIN4_PINVAL23_Msk (0x800000UL) /*!< PINVAL23 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL24_Pos (24UL) /*!< PINVAL24 (Bit 24) */ +#define GPIO_PIN4_PINVAL24_Msk (0x1000000UL) /*!< PINVAL24 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL25_Pos (25UL) /*!< PINVAL25 (Bit 25) */ +#define GPIO_PIN4_PINVAL25_Msk (0x2000000UL) /*!< PINVAL25 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL26_Pos (26UL) /*!< PINVAL26 (Bit 26) */ +#define GPIO_PIN4_PINVAL26_Msk (0x4000000UL) /*!< PINVAL26 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL27_Pos (27UL) /*!< PINVAL27 (Bit 27) */ +#define GPIO_PIN4_PINVAL27_Msk (0x8000000UL) /*!< PINVAL27 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL28_Pos (28UL) /*!< PINVAL28 (Bit 28) */ +#define GPIO_PIN4_PINVAL28_Msk (0x10000000UL) /*!< PINVAL28 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL29_Pos (29UL) /*!< PINVAL29 (Bit 29) */ +#define GPIO_PIN4_PINVAL29_Msk (0x20000000UL) /*!< PINVAL29 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL30_Pos (30UL) /*!< PINVAL30 (Bit 30) */ +#define GPIO_PIN4_PINVAL30_Msk (0x40000000UL) /*!< PINVAL30 (Bitfield-Mask: 0x01) */ +#define GPIO_PIN4_PINVAL31_Pos (31UL) /*!< PINVAL31 (Bit 31) */ +#define GPIO_PIN4_PINVAL31_Msk (0x80000000UL) /*!< PINVAL31 (Bitfield-Mask: 0x01) */ +/* ========================================================= SET0 ========================================================== */ +#define GPIO_SET0_PINSET0_Pos (0UL) /*!< PINSET0 (Bit 0) */ +#define GPIO_SET0_PINSET0_Msk (0x1UL) /*!< PINSET0 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET1_Pos (1UL) /*!< PINSET1 (Bit 1) */ +#define GPIO_SET0_PINSET1_Msk (0x2UL) /*!< PINSET1 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET2_Pos (2UL) /*!< PINSET2 (Bit 2) */ +#define GPIO_SET0_PINSET2_Msk (0x4UL) /*!< PINSET2 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET3_Pos (3UL) /*!< PINSET3 (Bit 3) */ +#define GPIO_SET0_PINSET3_Msk (0x8UL) /*!< PINSET3 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET4_Pos (4UL) /*!< PINSET4 (Bit 4) */ +#define GPIO_SET0_PINSET4_Msk (0x10UL) /*!< PINSET4 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET5_Pos (5UL) /*!< PINSET5 (Bit 5) */ +#define GPIO_SET0_PINSET5_Msk (0x20UL) /*!< PINSET5 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET6_Pos (6UL) /*!< PINSET6 (Bit 6) */ +#define GPIO_SET0_PINSET6_Msk (0x40UL) /*!< PINSET6 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET7_Pos (7UL) /*!< PINSET7 (Bit 7) */ +#define GPIO_SET0_PINSET7_Msk (0x80UL) /*!< PINSET7 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET8_Pos (8UL) /*!< PINSET8 (Bit 8) */ +#define GPIO_SET0_PINSET8_Msk (0x100UL) /*!< PINSET8 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET9_Pos (9UL) /*!< PINSET9 (Bit 9) */ +#define GPIO_SET0_PINSET9_Msk (0x200UL) /*!< PINSET9 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET10_Pos (10UL) /*!< PINSET10 (Bit 10) */ +#define GPIO_SET0_PINSET10_Msk (0x400UL) /*!< PINSET10 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET11_Pos (11UL) /*!< PINSET11 (Bit 11) */ +#define GPIO_SET0_PINSET11_Msk (0x800UL) /*!< PINSET11 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET12_Pos (12UL) /*!< PINSET12 (Bit 12) */ +#define GPIO_SET0_PINSET12_Msk (0x1000UL) /*!< PINSET12 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET13_Pos (13UL) /*!< PINSET13 (Bit 13) */ +#define GPIO_SET0_PINSET13_Msk (0x2000UL) /*!< PINSET13 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET14_Pos (14UL) /*!< PINSET14 (Bit 14) */ +#define GPIO_SET0_PINSET14_Msk (0x4000UL) /*!< PINSET14 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET15_Pos (15UL) /*!< PINSET15 (Bit 15) */ +#define GPIO_SET0_PINSET15_Msk (0x8000UL) /*!< PINSET15 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET16_Pos (16UL) /*!< PINSET16 (Bit 16) */ +#define GPIO_SET0_PINSET16_Msk (0x10000UL) /*!< PINSET16 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET17_Pos (17UL) /*!< PINSET17 (Bit 17) */ +#define GPIO_SET0_PINSET17_Msk (0x20000UL) /*!< PINSET17 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET18_Pos (18UL) /*!< PINSET18 (Bit 18) */ +#define GPIO_SET0_PINSET18_Msk (0x40000UL) /*!< PINSET18 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET19_Pos (19UL) /*!< PINSET19 (Bit 19) */ +#define GPIO_SET0_PINSET19_Msk (0x80000UL) /*!< PINSET19 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET20_Pos (20UL) /*!< PINSET20 (Bit 20) */ +#define GPIO_SET0_PINSET20_Msk (0x100000UL) /*!< PINSET20 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET21_Pos (21UL) /*!< PINSET21 (Bit 21) */ +#define GPIO_SET0_PINSET21_Msk (0x200000UL) /*!< PINSET21 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET22_Pos (22UL) /*!< PINSET22 (Bit 22) */ +#define GPIO_SET0_PINSET22_Msk (0x400000UL) /*!< PINSET22 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET23_Pos (23UL) /*!< PINSET23 (Bit 23) */ +#define GPIO_SET0_PINSET23_Msk (0x800000UL) /*!< PINSET23 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET24_Pos (24UL) /*!< PINSET24 (Bit 24) */ +#define GPIO_SET0_PINSET24_Msk (0x1000000UL) /*!< PINSET24 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET25_Pos (25UL) /*!< PINSET25 (Bit 25) */ +#define GPIO_SET0_PINSET25_Msk (0x2000000UL) /*!< PINSET25 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET26_Pos (26UL) /*!< PINSET26 (Bit 26) */ +#define GPIO_SET0_PINSET26_Msk (0x4000000UL) /*!< PINSET26 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET27_Pos (27UL) /*!< PINSET27 (Bit 27) */ +#define GPIO_SET0_PINSET27_Msk (0x8000000UL) /*!< PINSET27 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET28_Pos (28UL) /*!< PINSET28 (Bit 28) */ +#define GPIO_SET0_PINSET28_Msk (0x10000000UL) /*!< PINSET28 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET29_Pos (29UL) /*!< PINSET29 (Bit 29) */ +#define GPIO_SET0_PINSET29_Msk (0x20000000UL) /*!< PINSET29 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET30_Pos (30UL) /*!< PINSET30 (Bit 30) */ +#define GPIO_SET0_PINSET30_Msk (0x40000000UL) /*!< PINSET30 (Bitfield-Mask: 0x01) */ +#define GPIO_SET0_PINSET31_Pos (31UL) /*!< PINSET31 (Bit 31) */ +#define GPIO_SET0_PINSET31_Msk (0x80000000UL) /*!< PINSET31 (Bitfield-Mask: 0x01) */ +/* ========================================================= SET1 ========================================================== */ +#define GPIO_SET1_PINSET0_Pos (0UL) /*!< PINSET0 (Bit 0) */ +#define GPIO_SET1_PINSET0_Msk (0x1UL) /*!< PINSET0 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET1_Pos (1UL) /*!< PINSET1 (Bit 1) */ +#define GPIO_SET1_PINSET1_Msk (0x2UL) /*!< PINSET1 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET2_Pos (2UL) /*!< PINSET2 (Bit 2) */ +#define GPIO_SET1_PINSET2_Msk (0x4UL) /*!< PINSET2 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET3_Pos (3UL) /*!< PINSET3 (Bit 3) */ +#define GPIO_SET1_PINSET3_Msk (0x8UL) /*!< PINSET3 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET4_Pos (4UL) /*!< PINSET4 (Bit 4) */ +#define GPIO_SET1_PINSET4_Msk (0x10UL) /*!< PINSET4 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET5_Pos (5UL) /*!< PINSET5 (Bit 5) */ +#define GPIO_SET1_PINSET5_Msk (0x20UL) /*!< PINSET5 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET6_Pos (6UL) /*!< PINSET6 (Bit 6) */ +#define GPIO_SET1_PINSET6_Msk (0x40UL) /*!< PINSET6 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET7_Pos (7UL) /*!< PINSET7 (Bit 7) */ +#define GPIO_SET1_PINSET7_Msk (0x80UL) /*!< PINSET7 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET8_Pos (8UL) /*!< PINSET8 (Bit 8) */ +#define GPIO_SET1_PINSET8_Msk (0x100UL) /*!< PINSET8 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET9_Pos (9UL) /*!< PINSET9 (Bit 9) */ +#define GPIO_SET1_PINSET9_Msk (0x200UL) /*!< PINSET9 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET10_Pos (10UL) /*!< PINSET10 (Bit 10) */ +#define GPIO_SET1_PINSET10_Msk (0x400UL) /*!< PINSET10 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET11_Pos (11UL) /*!< PINSET11 (Bit 11) */ +#define GPIO_SET1_PINSET11_Msk (0x800UL) /*!< PINSET11 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET12_Pos (12UL) /*!< PINSET12 (Bit 12) */ +#define GPIO_SET1_PINSET12_Msk (0x1000UL) /*!< PINSET12 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET13_Pos (13UL) /*!< PINSET13 (Bit 13) */ +#define GPIO_SET1_PINSET13_Msk (0x2000UL) /*!< PINSET13 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET14_Pos (14UL) /*!< PINSET14 (Bit 14) */ +#define GPIO_SET1_PINSET14_Msk (0x4000UL) /*!< PINSET14 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET15_Pos (15UL) /*!< PINSET15 (Bit 15) */ +#define GPIO_SET1_PINSET15_Msk (0x8000UL) /*!< PINSET15 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET16_Pos (16UL) /*!< PINSET16 (Bit 16) */ +#define GPIO_SET1_PINSET16_Msk (0x10000UL) /*!< PINSET16 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET17_Pos (17UL) /*!< PINSET17 (Bit 17) */ +#define GPIO_SET1_PINSET17_Msk (0x20000UL) /*!< PINSET17 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET18_Pos (18UL) /*!< PINSET18 (Bit 18) */ +#define GPIO_SET1_PINSET18_Msk (0x40000UL) /*!< PINSET18 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET19_Pos (19UL) /*!< PINSET19 (Bit 19) */ +#define GPIO_SET1_PINSET19_Msk (0x80000UL) /*!< PINSET19 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET20_Pos (20UL) /*!< PINSET20 (Bit 20) */ +#define GPIO_SET1_PINSET20_Msk (0x100000UL) /*!< PINSET20 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET21_Pos (21UL) /*!< PINSET21 (Bit 21) */ +#define GPIO_SET1_PINSET21_Msk (0x200000UL) /*!< PINSET21 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET22_Pos (22UL) /*!< PINSET22 (Bit 22) */ +#define GPIO_SET1_PINSET22_Msk (0x400000UL) /*!< PINSET22 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET23_Pos (23UL) /*!< PINSET23 (Bit 23) */ +#define GPIO_SET1_PINSET23_Msk (0x800000UL) /*!< PINSET23 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET24_Pos (24UL) /*!< PINSET24 (Bit 24) */ +#define GPIO_SET1_PINSET24_Msk (0x1000000UL) /*!< PINSET24 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET25_Pos (25UL) /*!< PINSET25 (Bit 25) */ +#define GPIO_SET1_PINSET25_Msk (0x2000000UL) /*!< PINSET25 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET26_Pos (26UL) /*!< PINSET26 (Bit 26) */ +#define GPIO_SET1_PINSET26_Msk (0x4000000UL) /*!< PINSET26 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET27_Pos (27UL) /*!< PINSET27 (Bit 27) */ +#define GPIO_SET1_PINSET27_Msk (0x8000000UL) /*!< PINSET27 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET28_Pos (28UL) /*!< PINSET28 (Bit 28) */ +#define GPIO_SET1_PINSET28_Msk (0x10000000UL) /*!< PINSET28 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET29_Pos (29UL) /*!< PINSET29 (Bit 29) */ +#define GPIO_SET1_PINSET29_Msk (0x20000000UL) /*!< PINSET29 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET30_Pos (30UL) /*!< PINSET30 (Bit 30) */ +#define GPIO_SET1_PINSET30_Msk (0x40000000UL) /*!< PINSET30 (Bitfield-Mask: 0x01) */ +#define GPIO_SET1_PINSET31_Pos (31UL) /*!< PINSET31 (Bit 31) */ +#define GPIO_SET1_PINSET31_Msk (0x80000000UL) /*!< PINSET31 (Bitfield-Mask: 0x01) */ +/* ========================================================= SET2 ========================================================== */ +#define GPIO_SET2_PINSET0_Pos (0UL) /*!< PINSET0 (Bit 0) */ +#define GPIO_SET2_PINSET0_Msk (0x1UL) /*!< PINSET0 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET1_Pos (1UL) /*!< PINSET1 (Bit 1) */ +#define GPIO_SET2_PINSET1_Msk (0x2UL) /*!< PINSET1 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET2_Pos (2UL) /*!< PINSET2 (Bit 2) */ +#define GPIO_SET2_PINSET2_Msk (0x4UL) /*!< PINSET2 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET3_Pos (3UL) /*!< PINSET3 (Bit 3) */ +#define GPIO_SET2_PINSET3_Msk (0x8UL) /*!< PINSET3 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET4_Pos (4UL) /*!< PINSET4 (Bit 4) */ +#define GPIO_SET2_PINSET4_Msk (0x10UL) /*!< PINSET4 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET5_Pos (5UL) /*!< PINSET5 (Bit 5) */ +#define GPIO_SET2_PINSET5_Msk (0x20UL) /*!< PINSET5 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET6_Pos (6UL) /*!< PINSET6 (Bit 6) */ +#define GPIO_SET2_PINSET6_Msk (0x40UL) /*!< PINSET6 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET7_Pos (7UL) /*!< PINSET7 (Bit 7) */ +#define GPIO_SET2_PINSET7_Msk (0x80UL) /*!< PINSET7 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET8_Pos (8UL) /*!< PINSET8 (Bit 8) */ +#define GPIO_SET2_PINSET8_Msk (0x100UL) /*!< PINSET8 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET9_Pos (9UL) /*!< PINSET9 (Bit 9) */ +#define GPIO_SET2_PINSET9_Msk (0x200UL) /*!< PINSET9 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET10_Pos (10UL) /*!< PINSET10 (Bit 10) */ +#define GPIO_SET2_PINSET10_Msk (0x400UL) /*!< PINSET10 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET11_Pos (11UL) /*!< PINSET11 (Bit 11) */ +#define GPIO_SET2_PINSET11_Msk (0x800UL) /*!< PINSET11 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET12_Pos (12UL) /*!< PINSET12 (Bit 12) */ +#define GPIO_SET2_PINSET12_Msk (0x1000UL) /*!< PINSET12 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET13_Pos (13UL) /*!< PINSET13 (Bit 13) */ +#define GPIO_SET2_PINSET13_Msk (0x2000UL) /*!< PINSET13 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET14_Pos (14UL) /*!< PINSET14 (Bit 14) */ +#define GPIO_SET2_PINSET14_Msk (0x4000UL) /*!< PINSET14 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET15_Pos (15UL) /*!< PINSET15 (Bit 15) */ +#define GPIO_SET2_PINSET15_Msk (0x8000UL) /*!< PINSET15 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET16_Pos (16UL) /*!< PINSET16 (Bit 16) */ +#define GPIO_SET2_PINSET16_Msk (0x10000UL) /*!< PINSET16 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET17_Pos (17UL) /*!< PINSET17 (Bit 17) */ +#define GPIO_SET2_PINSET17_Msk (0x20000UL) /*!< PINSET17 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET18_Pos (18UL) /*!< PINSET18 (Bit 18) */ +#define GPIO_SET2_PINSET18_Msk (0x40000UL) /*!< PINSET18 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET19_Pos (19UL) /*!< PINSET19 (Bit 19) */ +#define GPIO_SET2_PINSET19_Msk (0x80000UL) /*!< PINSET19 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET20_Pos (20UL) /*!< PINSET20 (Bit 20) */ +#define GPIO_SET2_PINSET20_Msk (0x100000UL) /*!< PINSET20 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET21_Pos (21UL) /*!< PINSET21 (Bit 21) */ +#define GPIO_SET2_PINSET21_Msk (0x200000UL) /*!< PINSET21 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET22_Pos (22UL) /*!< PINSET22 (Bit 22) */ +#define GPIO_SET2_PINSET22_Msk (0x400000UL) /*!< PINSET22 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET23_Pos (23UL) /*!< PINSET23 (Bit 23) */ +#define GPIO_SET2_PINSET23_Msk (0x800000UL) /*!< PINSET23 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET24_Pos (24UL) /*!< PINSET24 (Bit 24) */ +#define GPIO_SET2_PINSET24_Msk (0x1000000UL) /*!< PINSET24 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET25_Pos (25UL) /*!< PINSET25 (Bit 25) */ +#define GPIO_SET2_PINSET25_Msk (0x2000000UL) /*!< PINSET25 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET26_Pos (26UL) /*!< PINSET26 (Bit 26) */ +#define GPIO_SET2_PINSET26_Msk (0x4000000UL) /*!< PINSET26 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET27_Pos (27UL) /*!< PINSET27 (Bit 27) */ +#define GPIO_SET2_PINSET27_Msk (0x8000000UL) /*!< PINSET27 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET28_Pos (28UL) /*!< PINSET28 (Bit 28) */ +#define GPIO_SET2_PINSET28_Msk (0x10000000UL) /*!< PINSET28 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET29_Pos (29UL) /*!< PINSET29 (Bit 29) */ +#define GPIO_SET2_PINSET29_Msk (0x20000000UL) /*!< PINSET29 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET30_Pos (30UL) /*!< PINSET30 (Bit 30) */ +#define GPIO_SET2_PINSET30_Msk (0x40000000UL) /*!< PINSET30 (Bitfield-Mask: 0x01) */ +#define GPIO_SET2_PINSET31_Pos (31UL) /*!< PINSET31 (Bit 31) */ +#define GPIO_SET2_PINSET31_Msk (0x80000000UL) /*!< PINSET31 (Bitfield-Mask: 0x01) */ +/* ========================================================= SET3 ========================================================== */ +#define GPIO_SET3_PINSET0_Pos (0UL) /*!< PINSET0 (Bit 0) */ +#define GPIO_SET3_PINSET0_Msk (0x1UL) /*!< PINSET0 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET1_Pos (1UL) /*!< PINSET1 (Bit 1) */ +#define GPIO_SET3_PINSET1_Msk (0x2UL) /*!< PINSET1 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET2_Pos (2UL) /*!< PINSET2 (Bit 2) */ +#define GPIO_SET3_PINSET2_Msk (0x4UL) /*!< PINSET2 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET3_Pos (3UL) /*!< PINSET3 (Bit 3) */ +#define GPIO_SET3_PINSET3_Msk (0x8UL) /*!< PINSET3 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET4_Pos (4UL) /*!< PINSET4 (Bit 4) */ +#define GPIO_SET3_PINSET4_Msk (0x10UL) /*!< PINSET4 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET5_Pos (5UL) /*!< PINSET5 (Bit 5) */ +#define GPIO_SET3_PINSET5_Msk (0x20UL) /*!< PINSET5 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET6_Pos (6UL) /*!< PINSET6 (Bit 6) */ +#define GPIO_SET3_PINSET6_Msk (0x40UL) /*!< PINSET6 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET7_Pos (7UL) /*!< PINSET7 (Bit 7) */ +#define GPIO_SET3_PINSET7_Msk (0x80UL) /*!< PINSET7 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET8_Pos (8UL) /*!< PINSET8 (Bit 8) */ +#define GPIO_SET3_PINSET8_Msk (0x100UL) /*!< PINSET8 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET9_Pos (9UL) /*!< PINSET9 (Bit 9) */ +#define GPIO_SET3_PINSET9_Msk (0x200UL) /*!< PINSET9 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET10_Pos (10UL) /*!< PINSET10 (Bit 10) */ +#define GPIO_SET3_PINSET10_Msk (0x400UL) /*!< PINSET10 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET11_Pos (11UL) /*!< PINSET11 (Bit 11) */ +#define GPIO_SET3_PINSET11_Msk (0x800UL) /*!< PINSET11 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET12_Pos (12UL) /*!< PINSET12 (Bit 12) */ +#define GPIO_SET3_PINSET12_Msk (0x1000UL) /*!< PINSET12 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET13_Pos (13UL) /*!< PINSET13 (Bit 13) */ +#define GPIO_SET3_PINSET13_Msk (0x2000UL) /*!< PINSET13 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET14_Pos (14UL) /*!< PINSET14 (Bit 14) */ +#define GPIO_SET3_PINSET14_Msk (0x4000UL) /*!< PINSET14 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET15_Pos (15UL) /*!< PINSET15 (Bit 15) */ +#define GPIO_SET3_PINSET15_Msk (0x8000UL) /*!< PINSET15 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET16_Pos (16UL) /*!< PINSET16 (Bit 16) */ +#define GPIO_SET3_PINSET16_Msk (0x10000UL) /*!< PINSET16 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET17_Pos (17UL) /*!< PINSET17 (Bit 17) */ +#define GPIO_SET3_PINSET17_Msk (0x20000UL) /*!< PINSET17 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET18_Pos (18UL) /*!< PINSET18 (Bit 18) */ +#define GPIO_SET3_PINSET18_Msk (0x40000UL) /*!< PINSET18 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET19_Pos (19UL) /*!< PINSET19 (Bit 19) */ +#define GPIO_SET3_PINSET19_Msk (0x80000UL) /*!< PINSET19 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET20_Pos (20UL) /*!< PINSET20 (Bit 20) */ +#define GPIO_SET3_PINSET20_Msk (0x100000UL) /*!< PINSET20 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET21_Pos (21UL) /*!< PINSET21 (Bit 21) */ +#define GPIO_SET3_PINSET21_Msk (0x200000UL) /*!< PINSET21 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET22_Pos (22UL) /*!< PINSET22 (Bit 22) */ +#define GPIO_SET3_PINSET22_Msk (0x400000UL) /*!< PINSET22 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET23_Pos (23UL) /*!< PINSET23 (Bit 23) */ +#define GPIO_SET3_PINSET23_Msk (0x800000UL) /*!< PINSET23 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET24_Pos (24UL) /*!< PINSET24 (Bit 24) */ +#define GPIO_SET3_PINSET24_Msk (0x1000000UL) /*!< PINSET24 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET25_Pos (25UL) /*!< PINSET25 (Bit 25) */ +#define GPIO_SET3_PINSET25_Msk (0x2000000UL) /*!< PINSET25 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET26_Pos (26UL) /*!< PINSET26 (Bit 26) */ +#define GPIO_SET3_PINSET26_Msk (0x4000000UL) /*!< PINSET26 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET27_Pos (27UL) /*!< PINSET27 (Bit 27) */ +#define GPIO_SET3_PINSET27_Msk (0x8000000UL) /*!< PINSET27 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET28_Pos (28UL) /*!< PINSET28 (Bit 28) */ +#define GPIO_SET3_PINSET28_Msk (0x10000000UL) /*!< PINSET28 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET29_Pos (29UL) /*!< PINSET29 (Bit 29) */ +#define GPIO_SET3_PINSET29_Msk (0x20000000UL) /*!< PINSET29 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET30_Pos (30UL) /*!< PINSET30 (Bit 30) */ +#define GPIO_SET3_PINSET30_Msk (0x40000000UL) /*!< PINSET30 (Bitfield-Mask: 0x01) */ +#define GPIO_SET3_PINSET31_Pos (31UL) /*!< PINSET31 (Bit 31) */ +#define GPIO_SET3_PINSET31_Msk (0x80000000UL) /*!< PINSET31 (Bitfield-Mask: 0x01) */ +/* ========================================================= SET4 ========================================================== */ +#define GPIO_SET4_PINSET0_Pos (0UL) /*!< PINSET0 (Bit 0) */ +#define GPIO_SET4_PINSET0_Msk (0x1UL) /*!< PINSET0 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET1_Pos (1UL) /*!< PINSET1 (Bit 1) */ +#define GPIO_SET4_PINSET1_Msk (0x2UL) /*!< PINSET1 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET2_Pos (2UL) /*!< PINSET2 (Bit 2) */ +#define GPIO_SET4_PINSET2_Msk (0x4UL) /*!< PINSET2 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET3_Pos (3UL) /*!< PINSET3 (Bit 3) */ +#define GPIO_SET4_PINSET3_Msk (0x8UL) /*!< PINSET3 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET4_Pos (4UL) /*!< PINSET4 (Bit 4) */ +#define GPIO_SET4_PINSET4_Msk (0x10UL) /*!< PINSET4 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET5_Pos (5UL) /*!< PINSET5 (Bit 5) */ +#define GPIO_SET4_PINSET5_Msk (0x20UL) /*!< PINSET5 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET6_Pos (6UL) /*!< PINSET6 (Bit 6) */ +#define GPIO_SET4_PINSET6_Msk (0x40UL) /*!< PINSET6 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET7_Pos (7UL) /*!< PINSET7 (Bit 7) */ +#define GPIO_SET4_PINSET7_Msk (0x80UL) /*!< PINSET7 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET8_Pos (8UL) /*!< PINSET8 (Bit 8) */ +#define GPIO_SET4_PINSET8_Msk (0x100UL) /*!< PINSET8 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET9_Pos (9UL) /*!< PINSET9 (Bit 9) */ +#define GPIO_SET4_PINSET9_Msk (0x200UL) /*!< PINSET9 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET10_Pos (10UL) /*!< PINSET10 (Bit 10) */ +#define GPIO_SET4_PINSET10_Msk (0x400UL) /*!< PINSET10 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET11_Pos (11UL) /*!< PINSET11 (Bit 11) */ +#define GPIO_SET4_PINSET11_Msk (0x800UL) /*!< PINSET11 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET12_Pos (12UL) /*!< PINSET12 (Bit 12) */ +#define GPIO_SET4_PINSET12_Msk (0x1000UL) /*!< PINSET12 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET13_Pos (13UL) /*!< PINSET13 (Bit 13) */ +#define GPIO_SET4_PINSET13_Msk (0x2000UL) /*!< PINSET13 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET14_Pos (14UL) /*!< PINSET14 (Bit 14) */ +#define GPIO_SET4_PINSET14_Msk (0x4000UL) /*!< PINSET14 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET15_Pos (15UL) /*!< PINSET15 (Bit 15) */ +#define GPIO_SET4_PINSET15_Msk (0x8000UL) /*!< PINSET15 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET16_Pos (16UL) /*!< PINSET16 (Bit 16) */ +#define GPIO_SET4_PINSET16_Msk (0x10000UL) /*!< PINSET16 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET17_Pos (17UL) /*!< PINSET17 (Bit 17) */ +#define GPIO_SET4_PINSET17_Msk (0x20000UL) /*!< PINSET17 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET18_Pos (18UL) /*!< PINSET18 (Bit 18) */ +#define GPIO_SET4_PINSET18_Msk (0x40000UL) /*!< PINSET18 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET19_Pos (19UL) /*!< PINSET19 (Bit 19) */ +#define GPIO_SET4_PINSET19_Msk (0x80000UL) /*!< PINSET19 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET20_Pos (20UL) /*!< PINSET20 (Bit 20) */ +#define GPIO_SET4_PINSET20_Msk (0x100000UL) /*!< PINSET20 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET21_Pos (21UL) /*!< PINSET21 (Bit 21) */ +#define GPIO_SET4_PINSET21_Msk (0x200000UL) /*!< PINSET21 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET22_Pos (22UL) /*!< PINSET22 (Bit 22) */ +#define GPIO_SET4_PINSET22_Msk (0x400000UL) /*!< PINSET22 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET23_Pos (23UL) /*!< PINSET23 (Bit 23) */ +#define GPIO_SET4_PINSET23_Msk (0x800000UL) /*!< PINSET23 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET24_Pos (24UL) /*!< PINSET24 (Bit 24) */ +#define GPIO_SET4_PINSET24_Msk (0x1000000UL) /*!< PINSET24 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET25_Pos (25UL) /*!< PINSET25 (Bit 25) */ +#define GPIO_SET4_PINSET25_Msk (0x2000000UL) /*!< PINSET25 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET26_Pos (26UL) /*!< PINSET26 (Bit 26) */ +#define GPIO_SET4_PINSET26_Msk (0x4000000UL) /*!< PINSET26 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET27_Pos (27UL) /*!< PINSET27 (Bit 27) */ +#define GPIO_SET4_PINSET27_Msk (0x8000000UL) /*!< PINSET27 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET28_Pos (28UL) /*!< PINSET28 (Bit 28) */ +#define GPIO_SET4_PINSET28_Msk (0x10000000UL) /*!< PINSET28 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET29_Pos (29UL) /*!< PINSET29 (Bit 29) */ +#define GPIO_SET4_PINSET29_Msk (0x20000000UL) /*!< PINSET29 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET30_Pos (30UL) /*!< PINSET30 (Bit 30) */ +#define GPIO_SET4_PINSET30_Msk (0x40000000UL) /*!< PINSET30 (Bitfield-Mask: 0x01) */ +#define GPIO_SET4_PINSET31_Pos (31UL) /*!< PINSET31 (Bit 31) */ +#define GPIO_SET4_PINSET31_Msk (0x80000000UL) /*!< PINSET31 (Bitfield-Mask: 0x01) */ +/* ========================================================= CLR0 ========================================================== */ +#define GPIO_CLR0_PINCLR0_Pos (0UL) /*!< PINCLR0 (Bit 0) */ +#define GPIO_CLR0_PINCLR0_Msk (0x1UL) /*!< PINCLR0 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR1_Pos (1UL) /*!< PINCLR1 (Bit 1) */ +#define GPIO_CLR0_PINCLR1_Msk (0x2UL) /*!< PINCLR1 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR2_Pos (2UL) /*!< PINCLR2 (Bit 2) */ +#define GPIO_CLR0_PINCLR2_Msk (0x4UL) /*!< PINCLR2 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR3_Pos (3UL) /*!< PINCLR3 (Bit 3) */ +#define GPIO_CLR0_PINCLR3_Msk (0x8UL) /*!< PINCLR3 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR4_Pos (4UL) /*!< PINCLR4 (Bit 4) */ +#define GPIO_CLR0_PINCLR4_Msk (0x10UL) /*!< PINCLR4 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR5_Pos (5UL) /*!< PINCLR5 (Bit 5) */ +#define GPIO_CLR0_PINCLR5_Msk (0x20UL) /*!< PINCLR5 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR6_Pos (6UL) /*!< PINCLR6 (Bit 6) */ +#define GPIO_CLR0_PINCLR6_Msk (0x40UL) /*!< PINCLR6 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR7_Pos (7UL) /*!< PINCLR7 (Bit 7) */ +#define GPIO_CLR0_PINCLR7_Msk (0x80UL) /*!< PINCLR7 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR8_Pos (8UL) /*!< PINCLR8 (Bit 8) */ +#define GPIO_CLR0_PINCLR8_Msk (0x100UL) /*!< PINCLR8 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR9_Pos (9UL) /*!< PINCLR9 (Bit 9) */ +#define GPIO_CLR0_PINCLR9_Msk (0x200UL) /*!< PINCLR9 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR10_Pos (10UL) /*!< PINCLR10 (Bit 10) */ +#define GPIO_CLR0_PINCLR10_Msk (0x400UL) /*!< PINCLR10 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR11_Pos (11UL) /*!< PINCLR11 (Bit 11) */ +#define GPIO_CLR0_PINCLR11_Msk (0x800UL) /*!< PINCLR11 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR12_Pos (12UL) /*!< PINCLR12 (Bit 12) */ +#define GPIO_CLR0_PINCLR12_Msk (0x1000UL) /*!< PINCLR12 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR13_Pos (13UL) /*!< PINCLR13 (Bit 13) */ +#define GPIO_CLR0_PINCLR13_Msk (0x2000UL) /*!< PINCLR13 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR14_Pos (14UL) /*!< PINCLR14 (Bit 14) */ +#define GPIO_CLR0_PINCLR14_Msk (0x4000UL) /*!< PINCLR14 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR15_Pos (15UL) /*!< PINCLR15 (Bit 15) */ +#define GPIO_CLR0_PINCLR15_Msk (0x8000UL) /*!< PINCLR15 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR16_Pos (16UL) /*!< PINCLR16 (Bit 16) */ +#define GPIO_CLR0_PINCLR16_Msk (0x10000UL) /*!< PINCLR16 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR17_Pos (17UL) /*!< PINCLR17 (Bit 17) */ +#define GPIO_CLR0_PINCLR17_Msk (0x20000UL) /*!< PINCLR17 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR18_Pos (18UL) /*!< PINCLR18 (Bit 18) */ +#define GPIO_CLR0_PINCLR18_Msk (0x40000UL) /*!< PINCLR18 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR19_Pos (19UL) /*!< PINCLR19 (Bit 19) */ +#define GPIO_CLR0_PINCLR19_Msk (0x80000UL) /*!< PINCLR19 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR20_Pos (20UL) /*!< PINCLR20 (Bit 20) */ +#define GPIO_CLR0_PINCLR20_Msk (0x100000UL) /*!< PINCLR20 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR21_Pos (21UL) /*!< PINCLR21 (Bit 21) */ +#define GPIO_CLR0_PINCLR21_Msk (0x200000UL) /*!< PINCLR21 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR22_Pos (22UL) /*!< PINCLR22 (Bit 22) */ +#define GPIO_CLR0_PINCLR22_Msk (0x400000UL) /*!< PINCLR22 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR23_Pos (23UL) /*!< PINCLR23 (Bit 23) */ +#define GPIO_CLR0_PINCLR23_Msk (0x800000UL) /*!< PINCLR23 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR24_Pos (24UL) /*!< PINCLR24 (Bit 24) */ +#define GPIO_CLR0_PINCLR24_Msk (0x1000000UL) /*!< PINCLR24 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR25_Pos (25UL) /*!< PINCLR25 (Bit 25) */ +#define GPIO_CLR0_PINCLR25_Msk (0x2000000UL) /*!< PINCLR25 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR26_Pos (26UL) /*!< PINCLR26 (Bit 26) */ +#define GPIO_CLR0_PINCLR26_Msk (0x4000000UL) /*!< PINCLR26 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR27_Pos (27UL) /*!< PINCLR27 (Bit 27) */ +#define GPIO_CLR0_PINCLR27_Msk (0x8000000UL) /*!< PINCLR27 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR28_Pos (28UL) /*!< PINCLR28 (Bit 28) */ +#define GPIO_CLR0_PINCLR28_Msk (0x10000000UL) /*!< PINCLR28 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR29_Pos (29UL) /*!< PINCLR29 (Bit 29) */ +#define GPIO_CLR0_PINCLR29_Msk (0x20000000UL) /*!< PINCLR29 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR30_Pos (30UL) /*!< PINCLR30 (Bit 30) */ +#define GPIO_CLR0_PINCLR30_Msk (0x40000000UL) /*!< PINCLR30 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR0_PINCLR31_Pos (31UL) /*!< PINCLR31 (Bit 31) */ +#define GPIO_CLR0_PINCLR31_Msk (0x80000000UL) /*!< PINCLR31 (Bitfield-Mask: 0x01) */ +/* ========================================================= CLR1 ========================================================== */ +#define GPIO_CLR1_PINCLR0_Pos (0UL) /*!< PINCLR0 (Bit 0) */ +#define GPIO_CLR1_PINCLR0_Msk (0x1UL) /*!< PINCLR0 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR1_Pos (1UL) /*!< PINCLR1 (Bit 1) */ +#define GPIO_CLR1_PINCLR1_Msk (0x2UL) /*!< PINCLR1 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR2_Pos (2UL) /*!< PINCLR2 (Bit 2) */ +#define GPIO_CLR1_PINCLR2_Msk (0x4UL) /*!< PINCLR2 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR3_Pos (3UL) /*!< PINCLR3 (Bit 3) */ +#define GPIO_CLR1_PINCLR3_Msk (0x8UL) /*!< PINCLR3 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR4_Pos (4UL) /*!< PINCLR4 (Bit 4) */ +#define GPIO_CLR1_PINCLR4_Msk (0x10UL) /*!< PINCLR4 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR5_Pos (5UL) /*!< PINCLR5 (Bit 5) */ +#define GPIO_CLR1_PINCLR5_Msk (0x20UL) /*!< PINCLR5 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR6_Pos (6UL) /*!< PINCLR6 (Bit 6) */ +#define GPIO_CLR1_PINCLR6_Msk (0x40UL) /*!< PINCLR6 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR7_Pos (7UL) /*!< PINCLR7 (Bit 7) */ +#define GPIO_CLR1_PINCLR7_Msk (0x80UL) /*!< PINCLR7 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR8_Pos (8UL) /*!< PINCLR8 (Bit 8) */ +#define GPIO_CLR1_PINCLR8_Msk (0x100UL) /*!< PINCLR8 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR9_Pos (9UL) /*!< PINCLR9 (Bit 9) */ +#define GPIO_CLR1_PINCLR9_Msk (0x200UL) /*!< PINCLR9 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR10_Pos (10UL) /*!< PINCLR10 (Bit 10) */ +#define GPIO_CLR1_PINCLR10_Msk (0x400UL) /*!< PINCLR10 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR11_Pos (11UL) /*!< PINCLR11 (Bit 11) */ +#define GPIO_CLR1_PINCLR11_Msk (0x800UL) /*!< PINCLR11 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR12_Pos (12UL) /*!< PINCLR12 (Bit 12) */ +#define GPIO_CLR1_PINCLR12_Msk (0x1000UL) /*!< PINCLR12 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR13_Pos (13UL) /*!< PINCLR13 (Bit 13) */ +#define GPIO_CLR1_PINCLR13_Msk (0x2000UL) /*!< PINCLR13 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR14_Pos (14UL) /*!< PINCLR14 (Bit 14) */ +#define GPIO_CLR1_PINCLR14_Msk (0x4000UL) /*!< PINCLR14 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR15_Pos (15UL) /*!< PINCLR15 (Bit 15) */ +#define GPIO_CLR1_PINCLR15_Msk (0x8000UL) /*!< PINCLR15 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR16_Pos (16UL) /*!< PINCLR16 (Bit 16) */ +#define GPIO_CLR1_PINCLR16_Msk (0x10000UL) /*!< PINCLR16 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR17_Pos (17UL) /*!< PINCLR17 (Bit 17) */ +#define GPIO_CLR1_PINCLR17_Msk (0x20000UL) /*!< PINCLR17 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR18_Pos (18UL) /*!< PINCLR18 (Bit 18) */ +#define GPIO_CLR1_PINCLR18_Msk (0x40000UL) /*!< PINCLR18 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR19_Pos (19UL) /*!< PINCLR19 (Bit 19) */ +#define GPIO_CLR1_PINCLR19_Msk (0x80000UL) /*!< PINCLR19 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR20_Pos (20UL) /*!< PINCLR20 (Bit 20) */ +#define GPIO_CLR1_PINCLR20_Msk (0x100000UL) /*!< PINCLR20 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR21_Pos (21UL) /*!< PINCLR21 (Bit 21) */ +#define GPIO_CLR1_PINCLR21_Msk (0x200000UL) /*!< PINCLR21 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR22_Pos (22UL) /*!< PINCLR22 (Bit 22) */ +#define GPIO_CLR1_PINCLR22_Msk (0x400000UL) /*!< PINCLR22 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR23_Pos (23UL) /*!< PINCLR23 (Bit 23) */ +#define GPIO_CLR1_PINCLR23_Msk (0x800000UL) /*!< PINCLR23 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR24_Pos (24UL) /*!< PINCLR24 (Bit 24) */ +#define GPIO_CLR1_PINCLR24_Msk (0x1000000UL) /*!< PINCLR24 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR25_Pos (25UL) /*!< PINCLR25 (Bit 25) */ +#define GPIO_CLR1_PINCLR25_Msk (0x2000000UL) /*!< PINCLR25 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR26_Pos (26UL) /*!< PINCLR26 (Bit 26) */ +#define GPIO_CLR1_PINCLR26_Msk (0x4000000UL) /*!< PINCLR26 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR27_Pos (27UL) /*!< PINCLR27 (Bit 27) */ +#define GPIO_CLR1_PINCLR27_Msk (0x8000000UL) /*!< PINCLR27 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR28_Pos (28UL) /*!< PINCLR28 (Bit 28) */ +#define GPIO_CLR1_PINCLR28_Msk (0x10000000UL) /*!< PINCLR28 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR29_Pos (29UL) /*!< PINCLR29 (Bit 29) */ +#define GPIO_CLR1_PINCLR29_Msk (0x20000000UL) /*!< PINCLR29 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR30_Pos (30UL) /*!< PINCLR30 (Bit 30) */ +#define GPIO_CLR1_PINCLR30_Msk (0x40000000UL) /*!< PINCLR30 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR1_PINCLR31_Pos (31UL) /*!< PINCLR31 (Bit 31) */ +#define GPIO_CLR1_PINCLR31_Msk (0x80000000UL) /*!< PINCLR31 (Bitfield-Mask: 0x01) */ +/* ========================================================= CLR2 ========================================================== */ +#define GPIO_CLR2_PINCLR0_Pos (0UL) /*!< PINCLR0 (Bit 0) */ +#define GPIO_CLR2_PINCLR0_Msk (0x1UL) /*!< PINCLR0 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR1_Pos (1UL) /*!< PINCLR1 (Bit 1) */ +#define GPIO_CLR2_PINCLR1_Msk (0x2UL) /*!< PINCLR1 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR2_Pos (2UL) /*!< PINCLR2 (Bit 2) */ +#define GPIO_CLR2_PINCLR2_Msk (0x4UL) /*!< PINCLR2 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR3_Pos (3UL) /*!< PINCLR3 (Bit 3) */ +#define GPIO_CLR2_PINCLR3_Msk (0x8UL) /*!< PINCLR3 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR4_Pos (4UL) /*!< PINCLR4 (Bit 4) */ +#define GPIO_CLR2_PINCLR4_Msk (0x10UL) /*!< PINCLR4 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR5_Pos (5UL) /*!< PINCLR5 (Bit 5) */ +#define GPIO_CLR2_PINCLR5_Msk (0x20UL) /*!< PINCLR5 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR6_Pos (6UL) /*!< PINCLR6 (Bit 6) */ +#define GPIO_CLR2_PINCLR6_Msk (0x40UL) /*!< PINCLR6 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR7_Pos (7UL) /*!< PINCLR7 (Bit 7) */ +#define GPIO_CLR2_PINCLR7_Msk (0x80UL) /*!< PINCLR7 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR8_Pos (8UL) /*!< PINCLR8 (Bit 8) */ +#define GPIO_CLR2_PINCLR8_Msk (0x100UL) /*!< PINCLR8 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR9_Pos (9UL) /*!< PINCLR9 (Bit 9) */ +#define GPIO_CLR2_PINCLR9_Msk (0x200UL) /*!< PINCLR9 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR10_Pos (10UL) /*!< PINCLR10 (Bit 10) */ +#define GPIO_CLR2_PINCLR10_Msk (0x400UL) /*!< PINCLR10 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR11_Pos (11UL) /*!< PINCLR11 (Bit 11) */ +#define GPIO_CLR2_PINCLR11_Msk (0x800UL) /*!< PINCLR11 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR12_Pos (12UL) /*!< PINCLR12 (Bit 12) */ +#define GPIO_CLR2_PINCLR12_Msk (0x1000UL) /*!< PINCLR12 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR13_Pos (13UL) /*!< PINCLR13 (Bit 13) */ +#define GPIO_CLR2_PINCLR13_Msk (0x2000UL) /*!< PINCLR13 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR14_Pos (14UL) /*!< PINCLR14 (Bit 14) */ +#define GPIO_CLR2_PINCLR14_Msk (0x4000UL) /*!< PINCLR14 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR15_Pos (15UL) /*!< PINCLR15 (Bit 15) */ +#define GPIO_CLR2_PINCLR15_Msk (0x8000UL) /*!< PINCLR15 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR16_Pos (16UL) /*!< PINCLR16 (Bit 16) */ +#define GPIO_CLR2_PINCLR16_Msk (0x10000UL) /*!< PINCLR16 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR17_Pos (17UL) /*!< PINCLR17 (Bit 17) */ +#define GPIO_CLR2_PINCLR17_Msk (0x20000UL) /*!< PINCLR17 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR18_Pos (18UL) /*!< PINCLR18 (Bit 18) */ +#define GPIO_CLR2_PINCLR18_Msk (0x40000UL) /*!< PINCLR18 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR19_Pos (19UL) /*!< PINCLR19 (Bit 19) */ +#define GPIO_CLR2_PINCLR19_Msk (0x80000UL) /*!< PINCLR19 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR20_Pos (20UL) /*!< PINCLR20 (Bit 20) */ +#define GPIO_CLR2_PINCLR20_Msk (0x100000UL) /*!< PINCLR20 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR21_Pos (21UL) /*!< PINCLR21 (Bit 21) */ +#define GPIO_CLR2_PINCLR21_Msk (0x200000UL) /*!< PINCLR21 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR22_Pos (22UL) /*!< PINCLR22 (Bit 22) */ +#define GPIO_CLR2_PINCLR22_Msk (0x400000UL) /*!< PINCLR22 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR23_Pos (23UL) /*!< PINCLR23 (Bit 23) */ +#define GPIO_CLR2_PINCLR23_Msk (0x800000UL) /*!< PINCLR23 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR24_Pos (24UL) /*!< PINCLR24 (Bit 24) */ +#define GPIO_CLR2_PINCLR24_Msk (0x1000000UL) /*!< PINCLR24 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR25_Pos (25UL) /*!< PINCLR25 (Bit 25) */ +#define GPIO_CLR2_PINCLR25_Msk (0x2000000UL) /*!< PINCLR25 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR26_Pos (26UL) /*!< PINCLR26 (Bit 26) */ +#define GPIO_CLR2_PINCLR26_Msk (0x4000000UL) /*!< PINCLR26 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR27_Pos (27UL) /*!< PINCLR27 (Bit 27) */ +#define GPIO_CLR2_PINCLR27_Msk (0x8000000UL) /*!< PINCLR27 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR28_Pos (28UL) /*!< PINCLR28 (Bit 28) */ +#define GPIO_CLR2_PINCLR28_Msk (0x10000000UL) /*!< PINCLR28 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR29_Pos (29UL) /*!< PINCLR29 (Bit 29) */ +#define GPIO_CLR2_PINCLR29_Msk (0x20000000UL) /*!< PINCLR29 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR30_Pos (30UL) /*!< PINCLR30 (Bit 30) */ +#define GPIO_CLR2_PINCLR30_Msk (0x40000000UL) /*!< PINCLR30 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR2_PINCLR31_Pos (31UL) /*!< PINCLR31 (Bit 31) */ +#define GPIO_CLR2_PINCLR31_Msk (0x80000000UL) /*!< PINCLR31 (Bitfield-Mask: 0x01) */ +/* ========================================================= CLR3 ========================================================== */ +#define GPIO_CLR3_PINCLR0_Pos (0UL) /*!< PINCLR0 (Bit 0) */ +#define GPIO_CLR3_PINCLR0_Msk (0x1UL) /*!< PINCLR0 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR1_Pos (1UL) /*!< PINCLR1 (Bit 1) */ +#define GPIO_CLR3_PINCLR1_Msk (0x2UL) /*!< PINCLR1 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR2_Pos (2UL) /*!< PINCLR2 (Bit 2) */ +#define GPIO_CLR3_PINCLR2_Msk (0x4UL) /*!< PINCLR2 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR3_Pos (3UL) /*!< PINCLR3 (Bit 3) */ +#define GPIO_CLR3_PINCLR3_Msk (0x8UL) /*!< PINCLR3 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR4_Pos (4UL) /*!< PINCLR4 (Bit 4) */ +#define GPIO_CLR3_PINCLR4_Msk (0x10UL) /*!< PINCLR4 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR5_Pos (5UL) /*!< PINCLR5 (Bit 5) */ +#define GPIO_CLR3_PINCLR5_Msk (0x20UL) /*!< PINCLR5 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR6_Pos (6UL) /*!< PINCLR6 (Bit 6) */ +#define GPIO_CLR3_PINCLR6_Msk (0x40UL) /*!< PINCLR6 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR7_Pos (7UL) /*!< PINCLR7 (Bit 7) */ +#define GPIO_CLR3_PINCLR7_Msk (0x80UL) /*!< PINCLR7 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR8_Pos (8UL) /*!< PINCLR8 (Bit 8) */ +#define GPIO_CLR3_PINCLR8_Msk (0x100UL) /*!< PINCLR8 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR9_Pos (9UL) /*!< PINCLR9 (Bit 9) */ +#define GPIO_CLR3_PINCLR9_Msk (0x200UL) /*!< PINCLR9 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR10_Pos (10UL) /*!< PINCLR10 (Bit 10) */ +#define GPIO_CLR3_PINCLR10_Msk (0x400UL) /*!< PINCLR10 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR11_Pos (11UL) /*!< PINCLR11 (Bit 11) */ +#define GPIO_CLR3_PINCLR11_Msk (0x800UL) /*!< PINCLR11 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR12_Pos (12UL) /*!< PINCLR12 (Bit 12) */ +#define GPIO_CLR3_PINCLR12_Msk (0x1000UL) /*!< PINCLR12 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR13_Pos (13UL) /*!< PINCLR13 (Bit 13) */ +#define GPIO_CLR3_PINCLR13_Msk (0x2000UL) /*!< PINCLR13 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR14_Pos (14UL) /*!< PINCLR14 (Bit 14) */ +#define GPIO_CLR3_PINCLR14_Msk (0x4000UL) /*!< PINCLR14 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR15_Pos (15UL) /*!< PINCLR15 (Bit 15) */ +#define GPIO_CLR3_PINCLR15_Msk (0x8000UL) /*!< PINCLR15 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR16_Pos (16UL) /*!< PINCLR16 (Bit 16) */ +#define GPIO_CLR3_PINCLR16_Msk (0x10000UL) /*!< PINCLR16 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR17_Pos (17UL) /*!< PINCLR17 (Bit 17) */ +#define GPIO_CLR3_PINCLR17_Msk (0x20000UL) /*!< PINCLR17 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR18_Pos (18UL) /*!< PINCLR18 (Bit 18) */ +#define GPIO_CLR3_PINCLR18_Msk (0x40000UL) /*!< PINCLR18 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR19_Pos (19UL) /*!< PINCLR19 (Bit 19) */ +#define GPIO_CLR3_PINCLR19_Msk (0x80000UL) /*!< PINCLR19 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR20_Pos (20UL) /*!< PINCLR20 (Bit 20) */ +#define GPIO_CLR3_PINCLR20_Msk (0x100000UL) /*!< PINCLR20 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR21_Pos (21UL) /*!< PINCLR21 (Bit 21) */ +#define GPIO_CLR3_PINCLR21_Msk (0x200000UL) /*!< PINCLR21 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR22_Pos (22UL) /*!< PINCLR22 (Bit 22) */ +#define GPIO_CLR3_PINCLR22_Msk (0x400000UL) /*!< PINCLR22 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR23_Pos (23UL) /*!< PINCLR23 (Bit 23) */ +#define GPIO_CLR3_PINCLR23_Msk (0x800000UL) /*!< PINCLR23 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR24_Pos (24UL) /*!< PINCLR24 (Bit 24) */ +#define GPIO_CLR3_PINCLR24_Msk (0x1000000UL) /*!< PINCLR24 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR25_Pos (25UL) /*!< PINCLR25 (Bit 25) */ +#define GPIO_CLR3_PINCLR25_Msk (0x2000000UL) /*!< PINCLR25 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR26_Pos (26UL) /*!< PINCLR26 (Bit 26) */ +#define GPIO_CLR3_PINCLR26_Msk (0x4000000UL) /*!< PINCLR26 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR27_Pos (27UL) /*!< PINCLR27 (Bit 27) */ +#define GPIO_CLR3_PINCLR27_Msk (0x8000000UL) /*!< PINCLR27 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR28_Pos (28UL) /*!< PINCLR28 (Bit 28) */ +#define GPIO_CLR3_PINCLR28_Msk (0x10000000UL) /*!< PINCLR28 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR29_Pos (29UL) /*!< PINCLR29 (Bit 29) */ +#define GPIO_CLR3_PINCLR29_Msk (0x20000000UL) /*!< PINCLR29 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR30_Pos (30UL) /*!< PINCLR30 (Bit 30) */ +#define GPIO_CLR3_PINCLR30_Msk (0x40000000UL) /*!< PINCLR30 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR3_PINCLR31_Pos (31UL) /*!< PINCLR31 (Bit 31) */ +#define GPIO_CLR3_PINCLR31_Msk (0x80000000UL) /*!< PINCLR31 (Bitfield-Mask: 0x01) */ +/* ========================================================= CLR4 ========================================================== */ +#define GPIO_CLR4_PINCLR0_Pos (0UL) /*!< PINCLR0 (Bit 0) */ +#define GPIO_CLR4_PINCLR0_Msk (0x1UL) /*!< PINCLR0 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR1_Pos (1UL) /*!< PINCLR1 (Bit 1) */ +#define GPIO_CLR4_PINCLR1_Msk (0x2UL) /*!< PINCLR1 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR2_Pos (2UL) /*!< PINCLR2 (Bit 2) */ +#define GPIO_CLR4_PINCLR2_Msk (0x4UL) /*!< PINCLR2 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR3_Pos (3UL) /*!< PINCLR3 (Bit 3) */ +#define GPIO_CLR4_PINCLR3_Msk (0x8UL) /*!< PINCLR3 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR4_Pos (4UL) /*!< PINCLR4 (Bit 4) */ +#define GPIO_CLR4_PINCLR4_Msk (0x10UL) /*!< PINCLR4 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR5_Pos (5UL) /*!< PINCLR5 (Bit 5) */ +#define GPIO_CLR4_PINCLR5_Msk (0x20UL) /*!< PINCLR5 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR6_Pos (6UL) /*!< PINCLR6 (Bit 6) */ +#define GPIO_CLR4_PINCLR6_Msk (0x40UL) /*!< PINCLR6 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR7_Pos (7UL) /*!< PINCLR7 (Bit 7) */ +#define GPIO_CLR4_PINCLR7_Msk (0x80UL) /*!< PINCLR7 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR8_Pos (8UL) /*!< PINCLR8 (Bit 8) */ +#define GPIO_CLR4_PINCLR8_Msk (0x100UL) /*!< PINCLR8 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR9_Pos (9UL) /*!< PINCLR9 (Bit 9) */ +#define GPIO_CLR4_PINCLR9_Msk (0x200UL) /*!< PINCLR9 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR10_Pos (10UL) /*!< PINCLR10 (Bit 10) */ +#define GPIO_CLR4_PINCLR10_Msk (0x400UL) /*!< PINCLR10 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR11_Pos (11UL) /*!< PINCLR11 (Bit 11) */ +#define GPIO_CLR4_PINCLR11_Msk (0x800UL) /*!< PINCLR11 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR12_Pos (12UL) /*!< PINCLR12 (Bit 12) */ +#define GPIO_CLR4_PINCLR12_Msk (0x1000UL) /*!< PINCLR12 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR13_Pos (13UL) /*!< PINCLR13 (Bit 13) */ +#define GPIO_CLR4_PINCLR13_Msk (0x2000UL) /*!< PINCLR13 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR14_Pos (14UL) /*!< PINCLR14 (Bit 14) */ +#define GPIO_CLR4_PINCLR14_Msk (0x4000UL) /*!< PINCLR14 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR15_Pos (15UL) /*!< PINCLR15 (Bit 15) */ +#define GPIO_CLR4_PINCLR15_Msk (0x8000UL) /*!< PINCLR15 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR16_Pos (16UL) /*!< PINCLR16 (Bit 16) */ +#define GPIO_CLR4_PINCLR16_Msk (0x10000UL) /*!< PINCLR16 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR17_Pos (17UL) /*!< PINCLR17 (Bit 17) */ +#define GPIO_CLR4_PINCLR17_Msk (0x20000UL) /*!< PINCLR17 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR18_Pos (18UL) /*!< PINCLR18 (Bit 18) */ +#define GPIO_CLR4_PINCLR18_Msk (0x40000UL) /*!< PINCLR18 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR19_Pos (19UL) /*!< PINCLR19 (Bit 19) */ +#define GPIO_CLR4_PINCLR19_Msk (0x80000UL) /*!< PINCLR19 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR20_Pos (20UL) /*!< PINCLR20 (Bit 20) */ +#define GPIO_CLR4_PINCLR20_Msk (0x100000UL) /*!< PINCLR20 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR21_Pos (21UL) /*!< PINCLR21 (Bit 21) */ +#define GPIO_CLR4_PINCLR21_Msk (0x200000UL) /*!< PINCLR21 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR22_Pos (22UL) /*!< PINCLR22 (Bit 22) */ +#define GPIO_CLR4_PINCLR22_Msk (0x400000UL) /*!< PINCLR22 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR23_Pos (23UL) /*!< PINCLR23 (Bit 23) */ +#define GPIO_CLR4_PINCLR23_Msk (0x800000UL) /*!< PINCLR23 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR24_Pos (24UL) /*!< PINCLR24 (Bit 24) */ +#define GPIO_CLR4_PINCLR24_Msk (0x1000000UL) /*!< PINCLR24 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR25_Pos (25UL) /*!< PINCLR25 (Bit 25) */ +#define GPIO_CLR4_PINCLR25_Msk (0x2000000UL) /*!< PINCLR25 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR26_Pos (26UL) /*!< PINCLR26 (Bit 26) */ +#define GPIO_CLR4_PINCLR26_Msk (0x4000000UL) /*!< PINCLR26 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR27_Pos (27UL) /*!< PINCLR27 (Bit 27) */ +#define GPIO_CLR4_PINCLR27_Msk (0x8000000UL) /*!< PINCLR27 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR28_Pos (28UL) /*!< PINCLR28 (Bit 28) */ +#define GPIO_CLR4_PINCLR28_Msk (0x10000000UL) /*!< PINCLR28 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR29_Pos (29UL) /*!< PINCLR29 (Bit 29) */ +#define GPIO_CLR4_PINCLR29_Msk (0x20000000UL) /*!< PINCLR29 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR30_Pos (30UL) /*!< PINCLR30 (Bit 30) */ +#define GPIO_CLR4_PINCLR30_Msk (0x40000000UL) /*!< PINCLR30 (Bitfield-Mask: 0x01) */ +#define GPIO_CLR4_PINCLR31_Pos (31UL) /*!< PINCLR31 (Bit 31) */ +#define GPIO_CLR4_PINCLR31_Msk (0x80000000UL) /*!< PINCLR31 (Bitfield-Mask: 0x01) */ + +/** @} */ /* End of group PosMask_peripherals */ + + +#ifdef __cplusplus +} +#endif + +#endif /* LPC176X5X_H */ + + +/** @} */ /* End of group LPC176x5x */ + +/** @} */ /* End of group */ diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/inc/cmsis_armcc.h b/port/ucontroller/nxp/lpc17xx/bootloader/inc/cmsis_armcc.h new file mode 100644 index 000000000..cecc361cf --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/inc/cmsis_armcc.h @@ -0,0 +1,884 @@ +/**************************************************************************//** + * @file cmsis_armcc.h + * @brief CMSIS compiler ARMCC (Arm Compiler 5) header file + * @version V5.2.0 + * @date 28. January 2020 + ******************************************************************************/ +/* + * Copyright (c) 2009-2019 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __CMSIS_ARMCC_H +#define __CMSIS_ARMCC_H + + +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 400677) + #error "Please use Arm Compiler Toolchain V4.0.677 or later!" +#endif + +/* CMSIS compiler control architecture macros */ +#if ((defined (__TARGET_ARCH_6_M ) && (__TARGET_ARCH_6_M == 1)) || \ + (defined (__TARGET_ARCH_6S_M ) && (__TARGET_ARCH_6S_M == 1)) ) + #define __ARM_ARCH_6M__ 1 +#endif + +#if (defined (__TARGET_ARCH_7_M ) && (__TARGET_ARCH_7_M == 1)) + #define __ARM_ARCH_7M__ 1 +#endif + +#if (defined (__TARGET_ARCH_7E_M) && (__TARGET_ARCH_7E_M == 1)) + #define __ARM_ARCH_7EM__ 1 +#endif + + /* __ARM_ARCH_8M_BASE__ not applicable */ + /* __ARM_ARCH_8M_MAIN__ not applicable */ + +/* CMSIS compiler control DSP macros */ +#if ((defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) + #define __ARM_FEATURE_DSP 1 +#endif + +/* CMSIS compiler specific defines */ +#ifndef __ASM + #define __ASM __asm +#endif +#ifndef __INLINE + #define __INLINE __inline +#endif +#ifndef __STATIC_INLINE + #define __STATIC_INLINE static __inline +#endif +#ifndef __STATIC_FORCEINLINE + #define __STATIC_FORCEINLINE static __forceinline +#endif +#ifndef __NO_RETURN + #define __NO_RETURN __declspec(noreturn) +#endif +#ifndef __USED + #define __USED __attribute__((used)) +#endif +#ifndef __WEAK + #define __WEAK __attribute__((weak)) +#endif +#ifndef __PACKED + #define __PACKED __attribute__((packed)) +#endif +#ifndef __PACKED_STRUCT + #define __PACKED_STRUCT __packed struct +#endif +#ifndef __PACKED_UNION + #define __PACKED_UNION __packed union +#endif +#ifndef __UNALIGNED_UINT32 /* deprecated */ + #define __UNALIGNED_UINT32(x) (*((__packed uint32_t *)(x))) +#endif +#ifndef __UNALIGNED_UINT16_WRITE + #define __UNALIGNED_UINT16_WRITE(addr, val) ((*((__packed uint16_t *)(addr))) = (val)) +#endif +#ifndef __UNALIGNED_UINT16_READ + #define __UNALIGNED_UINT16_READ(addr) (*((const __packed uint16_t *)(addr))) +#endif +#ifndef __UNALIGNED_UINT32_WRITE + #define __UNALIGNED_UINT32_WRITE(addr, val) ((*((__packed uint32_t *)(addr))) = (val)) +#endif +#ifndef __UNALIGNED_UINT32_READ + #define __UNALIGNED_UINT32_READ(addr) (*((const __packed uint32_t *)(addr))) +#endif +#ifndef __ALIGNED + #define __ALIGNED(x) __attribute__((aligned(x))) +#endif +#ifndef __RESTRICT + #define __RESTRICT __restrict +#endif +#ifndef __COMPILER_BARRIER + #define __COMPILER_BARRIER() __memory_changed() +#endif + +/* ######################### Startup and Lowlevel Init ######################## */ + +#ifndef __PROGRAM_START +#define __PROGRAM_START __main +#endif + +#ifndef __INITIAL_SP +#define __INITIAL_SP Image$$ARM_LIB_STACK$$ZI$$Limit +#endif + +#ifndef __STACK_LIMIT +#define __STACK_LIMIT Image$$ARM_LIB_STACK$$ZI$$Base +#endif + +#ifndef __VECTOR_TABLE +#define __VECTOR_TABLE __Vectors +#endif + +#ifndef __VECTOR_TABLE_ATTRIBUTE +#define __VECTOR_TABLE_ATTRIBUTE __attribute((used, section("RESET"))) +#endif + +/* ########################### Core Function Access ########################### */ +/** \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions + @{ + */ + +/** + \brief Enable IRQ Interrupts + \details Enables IRQ interrupts by clearing the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +/* intrinsic void __enable_irq(); */ + + +/** + \brief Disable IRQ Interrupts + \details Disables IRQ interrupts by setting the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +/* intrinsic void __disable_irq(); */ + +/** + \brief Get Control Register + \details Returns the content of the Control Register. + \return Control Register value + */ +__STATIC_INLINE uint32_t __get_CONTROL(void) +{ + register uint32_t __regControl __ASM("control"); + return(__regControl); +} + + +/** + \brief Set Control Register + \details Writes the given value to the Control Register. + \param [in] control Control Register value to set + */ +__STATIC_INLINE void __set_CONTROL(uint32_t control) +{ + register uint32_t __regControl __ASM("control"); + __regControl = control; +} + + +/** + \brief Get IPSR Register + \details Returns the content of the IPSR Register. + \return IPSR Register value + */ +__STATIC_INLINE uint32_t __get_IPSR(void) +{ + register uint32_t __regIPSR __ASM("ipsr"); + return(__regIPSR); +} + + +/** + \brief Get APSR Register + \details Returns the content of the APSR Register. + \return APSR Register value + */ +__STATIC_INLINE uint32_t __get_APSR(void) +{ + register uint32_t __regAPSR __ASM("apsr"); + return(__regAPSR); +} + + +/** + \brief Get xPSR Register + \details Returns the content of the xPSR Register. + \return xPSR Register value + */ +__STATIC_INLINE uint32_t __get_xPSR(void) +{ + register uint32_t __regXPSR __ASM("xpsr"); + return(__regXPSR); +} + + +/** + \brief Get Process Stack Pointer + \details Returns the current value of the Process Stack Pointer (PSP). + \return PSP Register value + */ +__STATIC_INLINE uint32_t __get_PSP(void) +{ + register uint32_t __regProcessStackPointer __ASM("psp"); + return(__regProcessStackPointer); +} + + +/** + \brief Set Process Stack Pointer + \details Assigns the given value to the Process Stack Pointer (PSP). + \param [in] topOfProcStack Process Stack Pointer value to set + */ +__STATIC_INLINE void __set_PSP(uint32_t topOfProcStack) +{ + register uint32_t __regProcessStackPointer __ASM("psp"); + __regProcessStackPointer = topOfProcStack; +} + + +/** + \brief Get Main Stack Pointer + \details Returns the current value of the Main Stack Pointer (MSP). + \return MSP Register value + */ +__STATIC_INLINE uint32_t __get_MSP(void) +{ + register uint32_t __regMainStackPointer __ASM("msp"); + return(__regMainStackPointer); +} + + +/** + \brief Set Main Stack Pointer + \details Assigns the given value to the Main Stack Pointer (MSP). + \param [in] topOfMainStack Main Stack Pointer value to set + */ +__STATIC_INLINE void __set_MSP(uint32_t topOfMainStack) +{ + register uint32_t __regMainStackPointer __ASM("msp"); + __regMainStackPointer = topOfMainStack; +} + + +/** + \brief Get Priority Mask + \details Returns the current state of the priority mask bit from the Priority Mask Register. + \return Priority Mask value + */ +__STATIC_INLINE uint32_t __get_PRIMASK(void) +{ + register uint32_t __regPriMask __ASM("primask"); + return(__regPriMask); +} + + +/** + \brief Set Priority Mask + \details Assigns the given value to the Priority Mask Register. + \param [in] priMask Priority Mask + */ +__STATIC_INLINE void __set_PRIMASK(uint32_t priMask) +{ + register uint32_t __regPriMask __ASM("primask"); + __regPriMask = (priMask); +} + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) + +/** + \brief Enable FIQ + \details Enables FIQ interrupts by clearing the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +#define __enable_fault_irq __enable_fiq + + +/** + \brief Disable FIQ + \details Disables FIQ interrupts by setting the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +#define __disable_fault_irq __disable_fiq + + +/** + \brief Get Base Priority + \details Returns the current value of the Base Priority register. + \return Base Priority register value + */ +__STATIC_INLINE uint32_t __get_BASEPRI(void) +{ + register uint32_t __regBasePri __ASM("basepri"); + return(__regBasePri); +} + + +/** + \brief Set Base Priority + \details Assigns the given value to the Base Priority register. + \param [in] basePri Base Priority value to set + */ +__STATIC_INLINE void __set_BASEPRI(uint32_t basePri) +{ + register uint32_t __regBasePri __ASM("basepri"); + __regBasePri = (basePri & 0xFFU); +} + + +/** + \brief Set Base Priority with condition + \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, + or the new value increases the BASEPRI priority level. + \param [in] basePri Base Priority value to set + */ +__STATIC_INLINE void __set_BASEPRI_MAX(uint32_t basePri) +{ + register uint32_t __regBasePriMax __ASM("basepri_max"); + __regBasePriMax = (basePri & 0xFFU); +} + + +/** + \brief Get Fault Mask + \details Returns the current value of the Fault Mask register. + \return Fault Mask register value + */ +__STATIC_INLINE uint32_t __get_FAULTMASK(void) +{ + register uint32_t __regFaultMask __ASM("faultmask"); + return(__regFaultMask); +} + + +/** + \brief Set Fault Mask + \details Assigns the given value to the Fault Mask register. + \param [in] faultMask Fault Mask value to set + */ +__STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask) +{ + register uint32_t __regFaultMask __ASM("faultmask"); + __regFaultMask = (faultMask & (uint32_t)1U); +} + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */ + + +/** + \brief Get FPSCR + \details Returns the current value of the Floating Point Status/Control register. + \return Floating Point Status/Control register value + */ +__STATIC_INLINE uint32_t __get_FPSCR(void) +{ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) + register uint32_t __regfpscr __ASM("fpscr"); + return(__regfpscr); +#else + return(0U); +#endif +} + + +/** + \brief Set FPSCR + \details Assigns the given value to the Floating Point Status/Control register. + \param [in] fpscr Floating Point Status/Control value to set + */ +__STATIC_INLINE void __set_FPSCR(uint32_t fpscr) +{ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) + register uint32_t __regfpscr __ASM("fpscr"); + __regfpscr = (fpscr); +#else + (void)fpscr; +#endif +} + + +/*@} end of CMSIS_Core_RegAccFunctions */ + + +/* ########################## Core Instruction Access ######################### */ +/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface + Access to dedicated instructions + @{ +*/ + +/** + \brief No Operation + \details No Operation does nothing. This instruction can be used for code alignment purposes. + */ +#define __NOP __nop + + +/** + \brief Wait For Interrupt + \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. + */ +#define __WFI __wfi + + +/** + \brief Wait For Event + \details Wait For Event is a hint instruction that permits the processor to enter + a low-power state until one of a number of events occurs. + */ +#define __WFE __wfe + + +/** + \brief Send Event + \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. + */ +#define __SEV __sev + + +/** + \brief Instruction Synchronization Barrier + \details Instruction Synchronization Barrier flushes the pipeline in the processor, + so that all instructions following the ISB are fetched from cache or memory, + after the instruction has been completed. + */ +#define __ISB() __isb(0xF) + +/** + \brief Data Synchronization Barrier + \details Acts as a special kind of Data Memory Barrier. + It completes when all explicit memory accesses before this instruction complete. + */ +#define __DSB() __dsb(0xF) + +/** + \brief Data Memory Barrier + \details Ensures the apparent order of the explicit memory operations before + and after the instruction, without ensuring their completion. + */ +#define __DMB() __dmb(0xF) + + +/** + \brief Reverse byte order (32 bit) + \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. + \param [in] value Value to reverse + \return Reversed value + */ +#define __REV __rev + + +/** + \brief Reverse byte order (16 bit) + \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. + \param [in] value Value to reverse + \return Reversed value + */ +#ifndef __NO_EMBEDDED_ASM +__attribute__((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value) +{ + rev16 r0, r0 + bx lr +} +#endif + + +/** + \brief Reverse byte order (16 bit) + \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. + \param [in] value Value to reverse + \return Reversed value + */ +#ifndef __NO_EMBEDDED_ASM +__attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int16_t __REVSH(int16_t value) +{ + revsh r0, r0 + bx lr +} +#endif + + +/** + \brief Rotate Right in unsigned value (32 bit) + \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. + \param [in] op1 Value to rotate + \param [in] op2 Number of Bits to rotate + \return Rotated value + */ +#define __ROR __ror + + +/** + \brief Breakpoint + \details Causes the processor to enter Debug state. + Debug tools can use this to investigate system state when the instruction at a particular address is reached. + \param [in] value is ignored by the processor. + If required, a debugger can use it to store additional information about the breakpoint. + */ +#define __BKPT(value) __breakpoint(value) + + +/** + \brief Reverse bit order of value + \details Reverses the bit order of the given value. + \param [in] value Value to reverse + \return Reversed value + */ +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) + #define __RBIT __rbit +#else +__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value) +{ + uint32_t result; + uint32_t s = (4U /*sizeof(v)*/ * 8U) - 1U; /* extra shift needed at end */ + + result = value; /* r will be reversed bits of v; first get LSB of v */ + for (value >>= 1U; value != 0U; value >>= 1U) + { + result <<= 1U; + result |= value & 1U; + s--; + } + result <<= s; /* shift when v's highest bits are zero */ + return result; +} +#endif + + +/** + \brief Count leading zeros + \details Counts the number of leading zeros of a data value. + \param [in] value Value to count the leading zeros + \return number of leading zeros in value + */ +#define __CLZ __clz + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) + +/** + \brief LDR Exclusive (8 bit) + \details Executes a exclusive LDR instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __LDREXB(ptr) ((uint8_t ) __ldrex(ptr)) +#else + #define __LDREXB(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint8_t ) __ldrex(ptr)) _Pragma("pop") +#endif + + +/** + \brief LDR Exclusive (16 bit) + \details Executes a exclusive LDR instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __LDREXH(ptr) ((uint16_t) __ldrex(ptr)) +#else + #define __LDREXH(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint16_t) __ldrex(ptr)) _Pragma("pop") +#endif + + +/** + \brief LDR Exclusive (32 bit) + \details Executes a exclusive LDR instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __LDREXW(ptr) ((uint32_t ) __ldrex(ptr)) +#else + #define __LDREXW(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint32_t ) __ldrex(ptr)) _Pragma("pop") +#endif + + +/** + \brief STR Exclusive (8 bit) + \details Executes a exclusive STR instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __STREXB(value, ptr) __strex(value, ptr) +#else + #define __STREXB(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop") +#endif + + +/** + \brief STR Exclusive (16 bit) + \details Executes a exclusive STR instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __STREXH(value, ptr) __strex(value, ptr) +#else + #define __STREXH(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop") +#endif + + +/** + \brief STR Exclusive (32 bit) + \details Executes a exclusive STR instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __STREXW(value, ptr) __strex(value, ptr) +#else + #define __STREXW(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop") +#endif + + +/** + \brief Remove the exclusive lock + \details Removes the exclusive lock which is created by LDREX. + */ +#define __CLREX __clrex + + +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value + */ +#define __SSAT __ssat + + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value + */ +#define __USAT __usat + + +/** + \brief Rotate Right with Extend (32 bit) + \details Moves each bit of a bitstring right by one bit. + The carry input is shifted in at the left end of the bitstring. + \param [in] value Value to rotate + \return Rotated value + */ +#ifndef __NO_EMBEDDED_ASM +__attribute__((section(".rrx_text"))) __STATIC_INLINE __ASM uint32_t __RRX(uint32_t value) +{ + rrx r0, r0 + bx lr +} +#endif + + +/** + \brief LDRT Unprivileged (8 bit) + \details Executes a Unprivileged LDRT instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +#define __LDRBT(ptr) ((uint8_t ) __ldrt(ptr)) + + +/** + \brief LDRT Unprivileged (16 bit) + \details Executes a Unprivileged LDRT instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +#define __LDRHT(ptr) ((uint16_t) __ldrt(ptr)) + + +/** + \brief LDRT Unprivileged (32 bit) + \details Executes a Unprivileged LDRT instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +#define __LDRT(ptr) ((uint32_t ) __ldrt(ptr)) + + +/** + \brief STRT Unprivileged (8 bit) + \details Executes a Unprivileged STRT instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +#define __STRBT(value, ptr) __strt(value, ptr) + + +/** + \brief STRT Unprivileged (16 bit) + \details Executes a Unprivileged STRT instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +#define __STRHT(value, ptr) __strt(value, ptr) + + +/** + \brief STRT Unprivileged (32 bit) + \details Executes a Unprivileged STRT instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +#define __STRT(value, ptr) __strt(value, ptr) + +#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */ + +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value + */ +__attribute__((always_inline)) __STATIC_INLINE int32_t __SSAT(int32_t val, uint32_t sat) +{ + if ((sat >= 1U) && (sat <= 32U)) + { + const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); + const int32_t min = -1 - max ; + if (val > max) + { + return max; + } + else if (val < min) + { + return min; + } + } + return val; +} + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __USAT(int32_t val, uint32_t sat) +{ + if (sat <= 31U) + { + const uint32_t max = ((1U << sat) - 1U); + if (val > (int32_t)max) + { + return max; + } + else if (val < 0) + { + return 0U; + } + } + return (uint32_t)val; +} + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */ + +/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ + + +/* ################### Compiler specific Intrinsics ########################### */ +/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics + Access to dedicated SIMD instructions + @{ +*/ + +#if ((defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) + +#define __SADD8 __sadd8 +#define __QADD8 __qadd8 +#define __SHADD8 __shadd8 +#define __UADD8 __uadd8 +#define __UQADD8 __uqadd8 +#define __UHADD8 __uhadd8 +#define __SSUB8 __ssub8 +#define __QSUB8 __qsub8 +#define __SHSUB8 __shsub8 +#define __USUB8 __usub8 +#define __UQSUB8 __uqsub8 +#define __UHSUB8 __uhsub8 +#define __SADD16 __sadd16 +#define __QADD16 __qadd16 +#define __SHADD16 __shadd16 +#define __UADD16 __uadd16 +#define __UQADD16 __uqadd16 +#define __UHADD16 __uhadd16 +#define __SSUB16 __ssub16 +#define __QSUB16 __qsub16 +#define __SHSUB16 __shsub16 +#define __USUB16 __usub16 +#define __UQSUB16 __uqsub16 +#define __UHSUB16 __uhsub16 +#define __SASX __sasx +#define __QASX __qasx +#define __SHASX __shasx +#define __UASX __uasx +#define __UQASX __uqasx +#define __UHASX __uhasx +#define __SSAX __ssax +#define __QSAX __qsax +#define __SHSAX __shsax +#define __USAX __usax +#define __UQSAX __uqsax +#define __UHSAX __uhsax +#define __USAD8 __usad8 +#define __USADA8 __usada8 +#define __SSAT16 __ssat16 +#define __USAT16 __usat16 +#define __UXTB16 __uxtb16 +#define __UXTAB16 __uxtab16 +#define __SXTB16 __sxtb16 +#define __SXTAB16 __sxtab16 +#define __SMUAD __smuad +#define __SMUADX __smuadx +#define __SMLAD __smlad +#define __SMLADX __smladx +#define __SMLALD __smlald +#define __SMLALDX __smlaldx +#define __SMUSD __smusd +#define __SMUSDX __smusdx +#define __SMLSD __smlsd +#define __SMLSDX __smlsdx +#define __SMLSLD __smlsld +#define __SMLSLDX __smlsldx +#define __SEL __sel +#define __QADD __qadd +#define __QSUB __qsub + +#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \ + ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) ) + +#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \ + ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) ) + +#define __SMMLA(ARG1,ARG2,ARG3) ( (int32_t)((((int64_t)(ARG1) * (ARG2)) + \ + ((int64_t)(ARG3) << 32U) ) >> 32U)) + +#define __SXTB16_RORn(ARG1, ARG2) __SXTB16(__ROR(ARG1, ARG2)) + +#endif /* ((defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */ +/*@} end of group CMSIS_SIMD_intrinsics */ + + +#endif /* __CMSIS_ARMCC_H */ diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/inc/cmsis_armclang.h b/port/ucontroller/nxp/lpc17xx/bootloader/inc/cmsis_armclang.h new file mode 100644 index 000000000..6bb8a4f2a --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/inc/cmsis_armclang.h @@ -0,0 +1,1446 @@ +/**************************************************************************//** + * @file cmsis_armclang.h + * @brief CMSIS compiler armclang (Arm Compiler 6) header file + * @version V5.3.0 + * @date 28. January 2020 + ******************************************************************************/ +/* + * Copyright (c) 2009-2019 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*lint -esym(9058, IRQn)*/ /* disable MISRA 2012 Rule 2.4 for IRQn */ + +#ifndef __CMSIS_ARMCLANG_H +#define __CMSIS_ARMCLANG_H + +#pragma clang system_header /* treat file as system include file */ + +#ifndef __ARM_COMPAT_H +#include /* Compatibility header for Arm Compiler 5 intrinsics */ +#endif + +/* CMSIS compiler specific defines */ +#ifndef __ASM + #define __ASM __asm +#endif +#ifndef __INLINE + #define __INLINE __inline +#endif +#ifndef __STATIC_INLINE + #define __STATIC_INLINE static __inline +#endif +#ifndef __STATIC_FORCEINLINE + #define __STATIC_FORCEINLINE __attribute__((always_inline)) static __inline +#endif +#ifndef __NO_RETURN + #define __NO_RETURN __attribute__((__noreturn__)) +#endif +#ifndef __USED + #define __USED __attribute__((used)) +#endif +#ifndef __WEAK + #define __WEAK __attribute__((weak)) +#endif +#ifndef __PACKED + #define __PACKED __attribute__((packed, aligned(1))) +#endif +#ifndef __PACKED_STRUCT + #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) +#endif +#ifndef __PACKED_UNION + #define __PACKED_UNION union __attribute__((packed, aligned(1))) +#endif +#ifndef __UNALIGNED_UINT32 /* deprecated */ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT32)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32 */ + struct __attribute__((packed)) T_UINT32 { uint32_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) +#endif +#ifndef __UNALIGNED_UINT16_WRITE + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT16_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_WRITE */ + __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) +#endif +#ifndef __UNALIGNED_UINT16_READ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT16_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_READ */ + __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) +#endif +#ifndef __UNALIGNED_UINT32_WRITE + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT32_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_WRITE */ + __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) +#endif +#ifndef __UNALIGNED_UINT32_READ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT32_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_READ */ + __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) +#endif +#ifndef __ALIGNED + #define __ALIGNED(x) __attribute__((aligned(x))) +#endif +#ifndef __RESTRICT + #define __RESTRICT __restrict +#endif +#ifndef __COMPILER_BARRIER + #define __COMPILER_BARRIER() __ASM volatile("":::"memory") +#endif + +/* ######################### Startup and Lowlevel Init ######################## */ + +#ifndef __PROGRAM_START +#define __PROGRAM_START __main +#endif + +#ifndef __INITIAL_SP +#define __INITIAL_SP Image$$ARM_LIB_STACK$$ZI$$Limit +#endif + +#ifndef __STACK_LIMIT +#define __STACK_LIMIT Image$$ARM_LIB_STACK$$ZI$$Base +#endif + +#ifndef __VECTOR_TABLE +#define __VECTOR_TABLE __Vectors +#endif + +#ifndef __VECTOR_TABLE_ATTRIBUTE +#define __VECTOR_TABLE_ATTRIBUTE __attribute((used, section("RESET"))) +#endif + +/* ########################### Core Function Access ########################### */ +/** \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions + @{ + */ + +/** + \brief Enable IRQ Interrupts + \details Enables IRQ interrupts by clearing the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +/* intrinsic void __enable_irq(); see arm_compat.h */ + + +/** + \brief Disable IRQ Interrupts + \details Disables IRQ interrupts by setting the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +/* intrinsic void __disable_irq(); see arm_compat.h */ + + +/** + \brief Get Control Register + \details Returns the content of the Control Register. + \return Control Register value + */ +__STATIC_FORCEINLINE uint32_t __get_CONTROL(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Control Register (non-secure) + \details Returns the content of the non-secure Control Register when in secure mode. + \return non-secure Control Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Control Register + \details Writes the given value to the Control Register. + \param [in] control Control Register value to set + */ +__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) +{ + __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Control Register (non-secure) + \details Writes the given value to the non-secure Control Register when in secure state. + \param [in] control Control Register value to set + */ +__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) +{ + __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); +} +#endif + + +/** + \brief Get IPSR Register + \details Returns the content of the IPSR Register. + \return IPSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_IPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get APSR Register + \details Returns the content of the APSR Register. + \return APSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_APSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, apsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get xPSR Register + \details Returns the content of the xPSR Register. + \return xPSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_xPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get Process Stack Pointer + \details Returns the current value of the Process Stack Pointer (PSP). + \return PSP Register value + */ +__STATIC_FORCEINLINE uint32_t __get_PSP(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, psp" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Process Stack Pointer (non-secure) + \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. + \return PSP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Process Stack Pointer + \details Assigns the given value to the Process Stack Pointer (PSP). + \param [in] topOfProcStack Process Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack) +{ + __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Process Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. + \param [in] topOfProcStack Process Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) +{ + __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); +} +#endif + + +/** + \brief Get Main Stack Pointer + \details Returns the current value of the Main Stack Pointer (MSP). + \return MSP Register value + */ +__STATIC_FORCEINLINE uint32_t __get_MSP(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, msp" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Main Stack Pointer (non-secure) + \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. + \return MSP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Main Stack Pointer + \details Assigns the given value to the Main Stack Pointer (MSP). + \param [in] topOfMainStack Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack) +{ + __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Main Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. + \param [in] topOfMainStack Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) +{ + __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); +} +#endif + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Stack Pointer (non-secure) + \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state. + \return SP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, sp_ns" : "=r" (result) ); + return(result); +} + + +/** + \brief Set Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state. + \param [in] topOfStack Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack) +{ + __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : ); +} +#endif + + +/** + \brief Get Priority Mask + \details Returns the current state of the priority mask bit from the Priority Mask Register. + \return Priority Mask value + */ +__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Priority Mask (non-secure) + \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. + \return Priority Mask value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Priority Mask + \details Assigns the given value to the Priority Mask Register. + \param [in] priMask Priority Mask + */ +__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask) +{ + __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Priority Mask (non-secure) + \details Assigns the given value to the non-secure Priority Mask Register when in secure state. + \param [in] priMask Priority Mask + */ +__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) +{ + __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); +} +#endif + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) +/** + \brief Enable FIQ + \details Enables FIQ interrupts by clearing the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +#define __enable_fault_irq __enable_fiq /* see arm_compat.h */ + + +/** + \brief Disable FIQ + \details Disables FIQ interrupts by setting the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +#define __disable_fault_irq __disable_fiq /* see arm_compat.h */ + + +/** + \brief Get Base Priority + \details Returns the current value of the Base Priority register. + \return Base Priority register value + */ +__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, basepri" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Base Priority (non-secure) + \details Returns the current value of the non-secure Base Priority register when in secure state. + \return Base Priority register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Base Priority + \details Assigns the given value to the Base Priority register. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri) +{ + __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Base Priority (non-secure) + \details Assigns the given value to the non-secure Base Priority register when in secure state. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) +{ + __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); +} +#endif + + +/** + \brief Set Base Priority with condition + \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, + or the new value increases the BASEPRI priority level. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri) +{ + __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); +} + + +/** + \brief Get Fault Mask + \details Returns the current value of the Fault Mask register. + \return Fault Mask register value + */ +__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Fault Mask (non-secure) + \details Returns the current value of the non-secure Fault Mask register when in secure state. + \return Fault Mask register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Fault Mask + \details Assigns the given value to the Fault Mask register. + \param [in] faultMask Fault Mask value to set + */ +__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask) +{ + __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Fault Mask (non-secure) + \details Assigns the given value to the non-secure Fault Mask register when in secure state. + \param [in] faultMask Fault Mask value to set + */ +__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) +{ + __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); +} +#endif + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) + +/** + \brief Get Process Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always in non-secure + mode. + + \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). + \return PSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, psplim" : "=r" (result) ); + return result; +#endif +} + +#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Process Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always in non-secure + mode. + + \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \return PSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); + return result; +#endif +} +#endif + + +/** + \brief Set Process Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored in non-secure + mode. + + \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)ProcStackPtrLimit; +#else + __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Process Stack Pointer (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored in non-secure + mode. + + \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)ProcStackPtrLimit; +#else + __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); +#endif +} +#endif + + +/** + \brief Get Main Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always. + + \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). + \return MSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, msplim" : "=r" (result) ); + return result; +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Main Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always. + + \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. + \return MSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); + return result; +#endif +} +#endif + + +/** + \brief Set Main Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored. + + \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). + \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)MainStackPtrLimit; +#else + __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Main Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored. + + \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. + \param [in] MainStackPtrLimit Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)MainStackPtrLimit; +#else + __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); +#endif +} +#endif + +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + +/** + \brief Get FPSCR + \details Returns the current value of the Floating Point Status/Control register. + \return Floating Point Status/Control register value + */ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) +#define __get_FPSCR (uint32_t)__builtin_arm_get_fpscr +#else +#define __get_FPSCR() ((uint32_t)0U) +#endif + +/** + \brief Set FPSCR + \details Assigns the given value to the Floating Point Status/Control register. + \param [in] fpscr Floating Point Status/Control value to set + */ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) +#define __set_FPSCR __builtin_arm_set_fpscr +#else +#define __set_FPSCR(x) ((void)(x)) +#endif + + +/*@} end of CMSIS_Core_RegAccFunctions */ + + +/* ########################## Core Instruction Access ######################### */ +/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface + Access to dedicated instructions + @{ +*/ + +/* Define macros for porting to both thumb1 and thumb2. + * For thumb1, use low register (r0-r7), specified by constraint "l" + * Otherwise, use general registers, specified by constraint "r" */ +#if defined (__thumb__) && !defined (__thumb2__) +#define __CMSIS_GCC_OUT_REG(r) "=l" (r) +#define __CMSIS_GCC_RW_REG(r) "+l" (r) +#define __CMSIS_GCC_USE_REG(r) "l" (r) +#else +#define __CMSIS_GCC_OUT_REG(r) "=r" (r) +#define __CMSIS_GCC_RW_REG(r) "+r" (r) +#define __CMSIS_GCC_USE_REG(r) "r" (r) +#endif + +/** + \brief No Operation + \details No Operation does nothing. This instruction can be used for code alignment purposes. + */ +#define __NOP __builtin_arm_nop + +/** + \brief Wait For Interrupt + \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. + */ +#define __WFI __builtin_arm_wfi + + +/** + \brief Wait For Event + \details Wait For Event is a hint instruction that permits the processor to enter + a low-power state until one of a number of events occurs. + */ +#define __WFE __builtin_arm_wfe + + +/** + \brief Send Event + \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. + */ +#define __SEV __builtin_arm_sev + + +/** + \brief Instruction Synchronization Barrier + \details Instruction Synchronization Barrier flushes the pipeline in the processor, + so that all instructions following the ISB are fetched from cache or memory, + after the instruction has been completed. + */ +#define __ISB() __builtin_arm_isb(0xF) + +/** + \brief Data Synchronization Barrier + \details Acts as a special kind of Data Memory Barrier. + It completes when all explicit memory accesses before this instruction complete. + */ +#define __DSB() __builtin_arm_dsb(0xF) + + +/** + \brief Data Memory Barrier + \details Ensures the apparent order of the explicit memory operations before + and after the instruction, without ensuring their completion. + */ +#define __DMB() __builtin_arm_dmb(0xF) + + +/** + \brief Reverse byte order (32 bit) + \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. + \param [in] value Value to reverse + \return Reversed value + */ +#define __REV(value) __builtin_bswap32(value) + + +/** + \brief Reverse byte order (16 bit) + \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. + \param [in] value Value to reverse + \return Reversed value + */ +#define __REV16(value) __ROR(__REV(value), 16) + + +/** + \brief Reverse byte order (16 bit) + \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. + \param [in] value Value to reverse + \return Reversed value + */ +#define __REVSH(value) (int16_t)__builtin_bswap16(value) + + +/** + \brief Rotate Right in unsigned value (32 bit) + \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. + \param [in] op1 Value to rotate + \param [in] op2 Number of Bits to rotate + \return Rotated value + */ +__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) +{ + op2 %= 32U; + if (op2 == 0U) + { + return op1; + } + return (op1 >> op2) | (op1 << (32U - op2)); +} + + +/** + \brief Breakpoint + \details Causes the processor to enter Debug state. + Debug tools can use this to investigate system state when the instruction at a particular address is reached. + \param [in] value is ignored by the processor. + If required, a debugger can use it to store additional information about the breakpoint. + */ +#define __BKPT(value) __ASM volatile ("bkpt "#value) + + +/** + \brief Reverse bit order of value + \details Reverses the bit order of the given value. + \param [in] value Value to reverse + \return Reversed value + */ +#define __RBIT __builtin_arm_rbit + +/** + \brief Count leading zeros + \details Counts the number of leading zeros of a data value. + \param [in] value Value to count the leading zeros + \return number of leading zeros in value + */ +__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value) +{ + /* Even though __builtin_clz produces a CLZ instruction on ARM, formally + __builtin_clz(0) is undefined behaviour, so handle this case specially. + This guarantees ARM-compatible results if happening to compile on a non-ARM + target, and ensures the compiler doesn't decide to activate any + optimisations using the logic "value was passed to __builtin_clz, so it + is non-zero". + ARM Compiler 6.10 and possibly earlier will optimise this test away, leaving a + single CLZ instruction. + */ + if (value == 0U) + { + return 32U; + } + return __builtin_clz(value); +} + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) +/** + \brief LDR Exclusive (8 bit) + \details Executes a exclusive LDR instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +#define __LDREXB (uint8_t)__builtin_arm_ldrex + + +/** + \brief LDR Exclusive (16 bit) + \details Executes a exclusive LDR instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +#define __LDREXH (uint16_t)__builtin_arm_ldrex + + +/** + \brief LDR Exclusive (32 bit) + \details Executes a exclusive LDR instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +#define __LDREXW (uint32_t)__builtin_arm_ldrex + + +/** + \brief STR Exclusive (8 bit) + \details Executes a exclusive STR instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STREXB (uint32_t)__builtin_arm_strex + + +/** + \brief STR Exclusive (16 bit) + \details Executes a exclusive STR instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STREXH (uint32_t)__builtin_arm_strex + + +/** + \brief STR Exclusive (32 bit) + \details Executes a exclusive STR instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STREXW (uint32_t)__builtin_arm_strex + + +/** + \brief Remove the exclusive lock + \details Removes the exclusive lock which is created by LDREX. + */ +#define __CLREX __builtin_arm_clrex + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) + +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value + */ +#define __SSAT __builtin_arm_ssat + + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value + */ +#define __USAT __builtin_arm_usat + + +/** + \brief Rotate Right with Extend (32 bit) + \details Moves each bit of a bitstring right by one bit. + The carry input is shifted in at the left end of the bitstring. + \param [in] value Value to rotate + \return Rotated value + */ +__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value) +{ + uint32_t result; + + __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return(result); +} + + +/** + \brief LDRT Unprivileged (8 bit) + \details Executes a Unprivileged LDRT instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint8_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDRT Unprivileged (16 bit) + \details Executes a Unprivileged LDRT instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint16_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDRT Unprivileged (32 bit) + \details Executes a Unprivileged LDRT instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); + return(result); +} + + +/** + \brief STRT Unprivileged (8 bit) + \details Executes a Unprivileged STRT instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) +{ + __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief STRT Unprivileged (16 bit) + \details Executes a Unprivileged STRT instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) +{ + __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief STRT Unprivileged (32 bit) + \details Executes a Unprivileged STRT instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr) +{ + __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); +} + +#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value + */ +__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat) +{ + if ((sat >= 1U) && (sat <= 32U)) + { + const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); + const int32_t min = -1 - max ; + if (val > max) + { + return max; + } + else if (val < min) + { + return min; + } + } + return val; +} + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value + */ +__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) +{ + if (sat <= 31U) + { + const uint32_t max = ((1U << sat) - 1U); + if (val > (int32_t)max) + { + return max; + } + else if (val < 0) + { + return 0U; + } + } + return (uint32_t)val; +} + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) +/** + \brief Load-Acquire (8 bit) + \details Executes a LDAB instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return ((uint8_t) result); +} + + +/** + \brief Load-Acquire (16 bit) + \details Executes a LDAH instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return ((uint16_t) result); +} + + +/** + \brief Load-Acquire (32 bit) + \details Executes a LDA instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return(result); +} + + +/** + \brief Store-Release (8 bit) + \details Executes a STLB instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr) +{ + __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); +} + + +/** + \brief Store-Release (16 bit) + \details Executes a STLH instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr) +{ + __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); +} + + +/** + \brief Store-Release (32 bit) + \details Executes a STL instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr) +{ + __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); +} + + +/** + \brief Load-Acquire Exclusive (8 bit) + \details Executes a LDAB exclusive instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +#define __LDAEXB (uint8_t)__builtin_arm_ldaex + + +/** + \brief Load-Acquire Exclusive (16 bit) + \details Executes a LDAH exclusive instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +#define __LDAEXH (uint16_t)__builtin_arm_ldaex + + +/** + \brief Load-Acquire Exclusive (32 bit) + \details Executes a LDA exclusive instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +#define __LDAEX (uint32_t)__builtin_arm_ldaex + + +/** + \brief Store-Release Exclusive (8 bit) + \details Executes a STLB exclusive instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STLEXB (uint32_t)__builtin_arm_stlex + + +/** + \brief Store-Release Exclusive (16 bit) + \details Executes a STLH exclusive instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STLEXH (uint32_t)__builtin_arm_stlex + + +/** + \brief Store-Release Exclusive (32 bit) + \details Executes a STL exclusive instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STLEX (uint32_t)__builtin_arm_stlex + +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + +/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ + + +/* ################### Compiler specific Intrinsics ########################### */ +/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics + Access to dedicated SIMD instructions + @{ +*/ + +#if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)) + +#define __SADD8 __builtin_arm_sadd8 +#define __QADD8 __builtin_arm_qadd8 +#define __SHADD8 __builtin_arm_shadd8 +#define __UADD8 __builtin_arm_uadd8 +#define __UQADD8 __builtin_arm_uqadd8 +#define __UHADD8 __builtin_arm_uhadd8 +#define __SSUB8 __builtin_arm_ssub8 +#define __QSUB8 __builtin_arm_qsub8 +#define __SHSUB8 __builtin_arm_shsub8 +#define __USUB8 __builtin_arm_usub8 +#define __UQSUB8 __builtin_arm_uqsub8 +#define __UHSUB8 __builtin_arm_uhsub8 +#define __SADD16 __builtin_arm_sadd16 +#define __QADD16 __builtin_arm_qadd16 +#define __SHADD16 __builtin_arm_shadd16 +#define __UADD16 __builtin_arm_uadd16 +#define __UQADD16 __builtin_arm_uqadd16 +#define __UHADD16 __builtin_arm_uhadd16 +#define __SSUB16 __builtin_arm_ssub16 +#define __QSUB16 __builtin_arm_qsub16 +#define __SHSUB16 __builtin_arm_shsub16 +#define __USUB16 __builtin_arm_usub16 +#define __UQSUB16 __builtin_arm_uqsub16 +#define __UHSUB16 __builtin_arm_uhsub16 +#define __SASX __builtin_arm_sasx +#define __QASX __builtin_arm_qasx +#define __SHASX __builtin_arm_shasx +#define __UASX __builtin_arm_uasx +#define __UQASX __builtin_arm_uqasx +#define __UHASX __builtin_arm_uhasx +#define __SSAX __builtin_arm_ssax +#define __QSAX __builtin_arm_qsax +#define __SHSAX __builtin_arm_shsax +#define __USAX __builtin_arm_usax +#define __UQSAX __builtin_arm_uqsax +#define __UHSAX __builtin_arm_uhsax +#define __USAD8 __builtin_arm_usad8 +#define __USADA8 __builtin_arm_usada8 +#define __SSAT16 __builtin_arm_ssat16 +#define __USAT16 __builtin_arm_usat16 +#define __UXTB16 __builtin_arm_uxtb16 +#define __UXTAB16 __builtin_arm_uxtab16 +#define __SXTB16 __builtin_arm_sxtb16 +#define __SXTAB16 __builtin_arm_sxtab16 +#define __SMUAD __builtin_arm_smuad +#define __SMUADX __builtin_arm_smuadx +#define __SMLAD __builtin_arm_smlad +#define __SMLADX __builtin_arm_smladx +#define __SMLALD __builtin_arm_smlald +#define __SMLALDX __builtin_arm_smlaldx +#define __SMUSD __builtin_arm_smusd +#define __SMUSDX __builtin_arm_smusdx +#define __SMLSD __builtin_arm_smlsd +#define __SMLSDX __builtin_arm_smlsdx +#define __SMLSLD __builtin_arm_smlsld +#define __SMLSLDX __builtin_arm_smlsldx +#define __SEL __builtin_arm_sel +#define __QADD __builtin_arm_qadd +#define __QSUB __builtin_arm_qsub + +#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \ + ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) ) + +#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \ + ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) ) + +#define __SXTB16_RORn(ARG1, ARG2) __SXTB16(__ROR(ARG1, ARG2)) + +__STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3) +{ + int32_t result; + + __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +#endif /* (__ARM_FEATURE_DSP == 1) */ +/*@} end of group CMSIS_SIMD_intrinsics */ + + +#endif /* __CMSIS_ARMCLANG_H */ diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/inc/cmsis_armclang_ltm.h b/port/ucontroller/nxp/lpc17xx/bootloader/inc/cmsis_armclang_ltm.h new file mode 100644 index 000000000..45ed905b5 --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/inc/cmsis_armclang_ltm.h @@ -0,0 +1,1893 @@ +/**************************************************************************//** + * @file cmsis_armclang_ltm.h + * @brief CMSIS compiler armclang (Arm Compiler 6) header file + * @version V1.3.0 + * @date 28. January 2020 + ******************************************************************************/ +/* + * Copyright (c) 2018-2019 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*lint -esym(9058, IRQn)*/ /* disable MISRA 2012 Rule 2.4 for IRQn */ + +#ifndef __CMSIS_ARMCLANG_H +#define __CMSIS_ARMCLANG_H + +#pragma clang system_header /* treat file as system include file */ + +#ifndef __ARM_COMPAT_H +#include /* Compatibility header for Arm Compiler 5 intrinsics */ +#endif + +/* CMSIS compiler specific defines */ +#ifndef __ASM + #define __ASM __asm +#endif +#ifndef __INLINE + #define __INLINE __inline +#endif +#ifndef __STATIC_INLINE + #define __STATIC_INLINE static __inline +#endif +#ifndef __STATIC_FORCEINLINE + #define __STATIC_FORCEINLINE __attribute__((always_inline)) static __inline +#endif +#ifndef __NO_RETURN + #define __NO_RETURN __attribute__((__noreturn__)) +#endif +#ifndef __USED + #define __USED __attribute__((used)) +#endif +#ifndef __WEAK + #define __WEAK __attribute__((weak)) +#endif +#ifndef __PACKED + #define __PACKED __attribute__((packed, aligned(1))) +#endif +#ifndef __PACKED_STRUCT + #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) +#endif +#ifndef __PACKED_UNION + #define __PACKED_UNION union __attribute__((packed, aligned(1))) +#endif +#ifndef __UNALIGNED_UINT32 /* deprecated */ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT32)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32 */ + struct __attribute__((packed)) T_UINT32 { uint32_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) +#endif +#ifndef __UNALIGNED_UINT16_WRITE + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT16_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_WRITE */ + __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) +#endif +#ifndef __UNALIGNED_UINT16_READ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT16_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_READ */ + __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) +#endif +#ifndef __UNALIGNED_UINT32_WRITE + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT32_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_WRITE */ + __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) +#endif +#ifndef __UNALIGNED_UINT32_READ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT32_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_READ */ + __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) +#endif +#ifndef __ALIGNED + #define __ALIGNED(x) __attribute__((aligned(x))) +#endif +#ifndef __RESTRICT + #define __RESTRICT __restrict +#endif +#ifndef __COMPILER_BARRIER + #define __COMPILER_BARRIER() __ASM volatile("":::"memory") +#endif + +/* ######################### Startup and Lowlevel Init ######################## */ + +#ifndef __PROGRAM_START +#define __PROGRAM_START __main +#endif + +#ifndef __INITIAL_SP +#define __INITIAL_SP Image$$ARM_LIB_STACK$$ZI$$Limit +#endif + +#ifndef __STACK_LIMIT +#define __STACK_LIMIT Image$$ARM_LIB_STACK$$ZI$$Base +#endif + +#ifndef __VECTOR_TABLE +#define __VECTOR_TABLE __Vectors +#endif + +#ifndef __VECTOR_TABLE_ATTRIBUTE +#define __VECTOR_TABLE_ATTRIBUTE __attribute((used, section("RESET"))) +#endif + + +/* ########################### Core Function Access ########################### */ +/** \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions + @{ + */ + +/** + \brief Enable IRQ Interrupts + \details Enables IRQ interrupts by clearing the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +/* intrinsic void __enable_irq(); see arm_compat.h */ + + +/** + \brief Disable IRQ Interrupts + \details Disables IRQ interrupts by setting the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +/* intrinsic void __disable_irq(); see arm_compat.h */ + + +/** + \brief Get Control Register + \details Returns the content of the Control Register. + \return Control Register value + */ +__STATIC_FORCEINLINE uint32_t __get_CONTROL(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Control Register (non-secure) + \details Returns the content of the non-secure Control Register when in secure mode. + \return non-secure Control Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Control Register + \details Writes the given value to the Control Register. + \param [in] control Control Register value to set + */ +__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) +{ + __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Control Register (non-secure) + \details Writes the given value to the non-secure Control Register when in secure state. + \param [in] control Control Register value to set + */ +__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) +{ + __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); +} +#endif + + +/** + \brief Get IPSR Register + \details Returns the content of the IPSR Register. + \return IPSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_IPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get APSR Register + \details Returns the content of the APSR Register. + \return APSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_APSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, apsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get xPSR Register + \details Returns the content of the xPSR Register. + \return xPSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_xPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get Process Stack Pointer + \details Returns the current value of the Process Stack Pointer (PSP). + \return PSP Register value + */ +__STATIC_FORCEINLINE uint32_t __get_PSP(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, psp" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Process Stack Pointer (non-secure) + \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. + \return PSP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Process Stack Pointer + \details Assigns the given value to the Process Stack Pointer (PSP). + \param [in] topOfProcStack Process Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack) +{ + __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Process Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. + \param [in] topOfProcStack Process Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) +{ + __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); +} +#endif + + +/** + \brief Get Main Stack Pointer + \details Returns the current value of the Main Stack Pointer (MSP). + \return MSP Register value + */ +__STATIC_FORCEINLINE uint32_t __get_MSP(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, msp" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Main Stack Pointer (non-secure) + \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. + \return MSP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Main Stack Pointer + \details Assigns the given value to the Main Stack Pointer (MSP). + \param [in] topOfMainStack Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack) +{ + __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Main Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. + \param [in] topOfMainStack Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) +{ + __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); +} +#endif + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Stack Pointer (non-secure) + \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state. + \return SP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, sp_ns" : "=r" (result) ); + return(result); +} + + +/** + \brief Set Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state. + \param [in] topOfStack Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack) +{ + __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : ); +} +#endif + + +/** + \brief Get Priority Mask + \details Returns the current state of the priority mask bit from the Priority Mask Register. + \return Priority Mask value + */ +__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Priority Mask (non-secure) + \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. + \return Priority Mask value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Priority Mask + \details Assigns the given value to the Priority Mask Register. + \param [in] priMask Priority Mask + */ +__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask) +{ + __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Priority Mask (non-secure) + \details Assigns the given value to the non-secure Priority Mask Register when in secure state. + \param [in] priMask Priority Mask + */ +__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) +{ + __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); +} +#endif + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) +/** + \brief Enable FIQ + \details Enables FIQ interrupts by clearing the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +#define __enable_fault_irq __enable_fiq /* see arm_compat.h */ + + +/** + \brief Disable FIQ + \details Disables FIQ interrupts by setting the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +#define __disable_fault_irq __disable_fiq /* see arm_compat.h */ + + +/** + \brief Get Base Priority + \details Returns the current value of the Base Priority register. + \return Base Priority register value + */ +__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, basepri" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Base Priority (non-secure) + \details Returns the current value of the non-secure Base Priority register when in secure state. + \return Base Priority register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Base Priority + \details Assigns the given value to the Base Priority register. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri) +{ + __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Base Priority (non-secure) + \details Assigns the given value to the non-secure Base Priority register when in secure state. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) +{ + __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); +} +#endif + + +/** + \brief Set Base Priority with condition + \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, + or the new value increases the BASEPRI priority level. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri) +{ + __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); +} + + +/** + \brief Get Fault Mask + \details Returns the current value of the Fault Mask register. + \return Fault Mask register value + */ +__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Fault Mask (non-secure) + \details Returns the current value of the non-secure Fault Mask register when in secure state. + \return Fault Mask register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Fault Mask + \details Assigns the given value to the Fault Mask register. + \param [in] faultMask Fault Mask value to set + */ +__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask) +{ + __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Fault Mask (non-secure) + \details Assigns the given value to the non-secure Fault Mask register when in secure state. + \param [in] faultMask Fault Mask value to set + */ +__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) +{ + __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); +} +#endif + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) + +/** + \brief Get Process Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always in non-secure + mode. + + \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). + \return PSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, psplim" : "=r" (result) ); + return result; +#endif +} + +#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Process Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always in non-secure + mode. + + \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \return PSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); + return result; +#endif +} +#endif + + +/** + \brief Set Process Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored in non-secure + mode. + + \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)ProcStackPtrLimit; +#else + __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Process Stack Pointer (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored in non-secure + mode. + + \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)ProcStackPtrLimit; +#else + __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); +#endif +} +#endif + + +/** + \brief Get Main Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always. + + \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). + \return MSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, msplim" : "=r" (result) ); + return result; +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Main Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always. + + \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. + \return MSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); + return result; +#endif +} +#endif + + +/** + \brief Set Main Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored. + + \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). + \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)MainStackPtrLimit; +#else + __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Main Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored. + + \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. + \param [in] MainStackPtrLimit Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)MainStackPtrLimit; +#else + __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); +#endif +} +#endif + +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + +/** + \brief Get FPSCR + \details Returns the current value of the Floating Point Status/Control register. + \return Floating Point Status/Control register value + */ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) +#define __get_FPSCR (uint32_t)__builtin_arm_get_fpscr +#else +#define __get_FPSCR() ((uint32_t)0U) +#endif + +/** + \brief Set FPSCR + \details Assigns the given value to the Floating Point Status/Control register. + \param [in] fpscr Floating Point Status/Control value to set + */ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) +#define __set_FPSCR __builtin_arm_set_fpscr +#else +#define __set_FPSCR(x) ((void)(x)) +#endif + + +/*@} end of CMSIS_Core_RegAccFunctions */ + + +/* ########################## Core Instruction Access ######################### */ +/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface + Access to dedicated instructions + @{ +*/ + +/* Define macros for porting to both thumb1 and thumb2. + * For thumb1, use low register (r0-r7), specified by constraint "l" + * Otherwise, use general registers, specified by constraint "r" */ +#if defined (__thumb__) && !defined (__thumb2__) +#define __CMSIS_GCC_OUT_REG(r) "=l" (r) +#define __CMSIS_GCC_USE_REG(r) "l" (r) +#else +#define __CMSIS_GCC_OUT_REG(r) "=r" (r) +#define __CMSIS_GCC_USE_REG(r) "r" (r) +#endif + +/** + \brief No Operation + \details No Operation does nothing. This instruction can be used for code alignment purposes. + */ +#define __NOP __builtin_arm_nop + +/** + \brief Wait For Interrupt + \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. + */ +#define __WFI __builtin_arm_wfi + + +/** + \brief Wait For Event + \details Wait For Event is a hint instruction that permits the processor to enter + a low-power state until one of a number of events occurs. + */ +#define __WFE __builtin_arm_wfe + + +/** + \brief Send Event + \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. + */ +#define __SEV __builtin_arm_sev + + +/** + \brief Instruction Synchronization Barrier + \details Instruction Synchronization Barrier flushes the pipeline in the processor, + so that all instructions following the ISB are fetched from cache or memory, + after the instruction has been completed. + */ +#define __ISB() __builtin_arm_isb(0xF) + +/** + \brief Data Synchronization Barrier + \details Acts as a special kind of Data Memory Barrier. + It completes when all explicit memory accesses before this instruction complete. + */ +#define __DSB() __builtin_arm_dsb(0xF) + + +/** + \brief Data Memory Barrier + \details Ensures the apparent order of the explicit memory operations before + and after the instruction, without ensuring their completion. + */ +#define __DMB() __builtin_arm_dmb(0xF) + + +/** + \brief Reverse byte order (32 bit) + \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. + \param [in] value Value to reverse + \return Reversed value + */ +#define __REV(value) __builtin_bswap32(value) + + +/** + \brief Reverse byte order (16 bit) + \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. + \param [in] value Value to reverse + \return Reversed value + */ +#define __REV16(value) __ROR(__REV(value), 16) + + +/** + \brief Reverse byte order (16 bit) + \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. + \param [in] value Value to reverse + \return Reversed value + */ +#define __REVSH(value) (int16_t)__builtin_bswap16(value) + + +/** + \brief Rotate Right in unsigned value (32 bit) + \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. + \param [in] op1 Value to rotate + \param [in] op2 Number of Bits to rotate + \return Rotated value + */ +__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) +{ + op2 %= 32U; + if (op2 == 0U) + { + return op1; + } + return (op1 >> op2) | (op1 << (32U - op2)); +} + + +/** + \brief Breakpoint + \details Causes the processor to enter Debug state. + Debug tools can use this to investigate system state when the instruction at a particular address is reached. + \param [in] value is ignored by the processor. + If required, a debugger can use it to store additional information about the breakpoint. + */ +#define __BKPT(value) __ASM volatile ("bkpt "#value) + + +/** + \brief Reverse bit order of value + \details Reverses the bit order of the given value. + \param [in] value Value to reverse + \return Reversed value + */ +#define __RBIT __builtin_arm_rbit + +/** + \brief Count leading zeros + \details Counts the number of leading zeros of a data value. + \param [in] value Value to count the leading zeros + \return number of leading zeros in value + */ +__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value) +{ + /* Even though __builtin_clz produces a CLZ instruction on ARM, formally + __builtin_clz(0) is undefined behaviour, so handle this case specially. + This guarantees ARM-compatible results if happening to compile on a non-ARM + target, and ensures the compiler doesn't decide to activate any + optimisations using the logic "value was passed to __builtin_clz, so it + is non-zero". + ARM Compiler 6.10 and possibly earlier will optimise this test away, leaving a + single CLZ instruction. + */ + if (value == 0U) + { + return 32U; + } + return __builtin_clz(value); +} + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) +/** + \brief LDR Exclusive (8 bit) + \details Executes a exclusive LDR instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +#define __LDREXB (uint8_t)__builtin_arm_ldrex + + +/** + \brief LDR Exclusive (16 bit) + \details Executes a exclusive LDR instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +#define __LDREXH (uint16_t)__builtin_arm_ldrex + + +/** + \brief LDR Exclusive (32 bit) + \details Executes a exclusive LDR instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +#define __LDREXW (uint32_t)__builtin_arm_ldrex + + +/** + \brief STR Exclusive (8 bit) + \details Executes a exclusive STR instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STREXB (uint32_t)__builtin_arm_strex + + +/** + \brief STR Exclusive (16 bit) + \details Executes a exclusive STR instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STREXH (uint32_t)__builtin_arm_strex + + +/** + \brief STR Exclusive (32 bit) + \details Executes a exclusive STR instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STREXW (uint32_t)__builtin_arm_strex + + +/** + \brief Remove the exclusive lock + \details Removes the exclusive lock which is created by LDREX. + */ +#define __CLREX __builtin_arm_clrex + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) + +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value + */ +#define __SSAT __builtin_arm_ssat + + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value + */ +#define __USAT __builtin_arm_usat + + +/** + \brief Rotate Right with Extend (32 bit) + \details Moves each bit of a bitstring right by one bit. + The carry input is shifted in at the left end of the bitstring. + \param [in] value Value to rotate + \return Rotated value + */ +__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value) +{ + uint32_t result; + + __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return(result); +} + + +/** + \brief LDRT Unprivileged (8 bit) + \details Executes a Unprivileged LDRT instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint8_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDRT Unprivileged (16 bit) + \details Executes a Unprivileged LDRT instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint16_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDRT Unprivileged (32 bit) + \details Executes a Unprivileged LDRT instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); + return(result); +} + + +/** + \brief STRT Unprivileged (8 bit) + \details Executes a Unprivileged STRT instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) +{ + __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief STRT Unprivileged (16 bit) + \details Executes a Unprivileged STRT instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) +{ + __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief STRT Unprivileged (32 bit) + \details Executes a Unprivileged STRT instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr) +{ + __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); +} + +#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value + */ +__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat) +{ + if ((sat >= 1U) && (sat <= 32U)) + { + const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); + const int32_t min = -1 - max ; + if (val > max) + { + return max; + } + else if (val < min) + { + return min; + } + } + return val; +} + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value + */ +__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) +{ + if (sat <= 31U) + { + const uint32_t max = ((1U << sat) - 1U); + if (val > (int32_t)max) + { + return max; + } + else if (val < 0) + { + return 0U; + } + } + return (uint32_t)val; +} + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) +/** + \brief Load-Acquire (8 bit) + \details Executes a LDAB instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return ((uint8_t) result); +} + + +/** + \brief Load-Acquire (16 bit) + \details Executes a LDAH instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return ((uint16_t) result); +} + + +/** + \brief Load-Acquire (32 bit) + \details Executes a LDA instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return(result); +} + + +/** + \brief Store-Release (8 bit) + \details Executes a STLB instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr) +{ + __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); +} + + +/** + \brief Store-Release (16 bit) + \details Executes a STLH instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr) +{ + __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); +} + + +/** + \brief Store-Release (32 bit) + \details Executes a STL instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr) +{ + __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); +} + + +/** + \brief Load-Acquire Exclusive (8 bit) + \details Executes a LDAB exclusive instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +#define __LDAEXB (uint8_t)__builtin_arm_ldaex + + +/** + \brief Load-Acquire Exclusive (16 bit) + \details Executes a LDAH exclusive instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +#define __LDAEXH (uint16_t)__builtin_arm_ldaex + + +/** + \brief Load-Acquire Exclusive (32 bit) + \details Executes a LDA exclusive instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +#define __LDAEX (uint32_t)__builtin_arm_ldaex + + +/** + \brief Store-Release Exclusive (8 bit) + \details Executes a STLB exclusive instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STLEXB (uint32_t)__builtin_arm_stlex + + +/** + \brief Store-Release Exclusive (16 bit) + \details Executes a STLH exclusive instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STLEXH (uint32_t)__builtin_arm_stlex + + +/** + \brief Store-Release Exclusive (32 bit) + \details Executes a STL exclusive instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STLEX (uint32_t)__builtin_arm_stlex + +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + +/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ + + +/* ################### Compiler specific Intrinsics ########################### */ +/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics + Access to dedicated SIMD instructions + @{ +*/ + +#if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)) + +__STATIC_FORCEINLINE uint32_t __SADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + + +__STATIC_FORCEINLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + + +__STATIC_FORCEINLINE uint32_t __SADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USAD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +#define __SSAT16(ARG1,ARG2) \ +({ \ + int32_t __RES, __ARG1 = (ARG1); \ + __ASM ("ssat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ + __RES; \ + }) + +#define __USAT16(ARG1,ARG2) \ +({ \ + uint32_t __RES, __ARG1 = (ARG1); \ + __ASM ("usat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ + __RES; \ + }) + +__STATIC_FORCEINLINE uint32_t __UXTB16(uint32_t op1) +{ + uint32_t result; + + __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1)); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SXTB16(uint32_t op1) +{ + uint32_t result; + + __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1)); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMUAD (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint64_t __SMLALD (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint64_t __SMLALDX (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint32_t __SMUSD (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint64_t __SMLSLD (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint64_t __SMLSLDX (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint32_t __SEL (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE int32_t __QADD( int32_t op1, int32_t op2) +{ + int32_t result; + + __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE int32_t __QSUB( int32_t op1, int32_t op2) +{ + int32_t result; + + __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \ + ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) ) + +#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \ + ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) ) + +#define __SXTB16_RORn(ARG1, ARG2) __SXTB16(__ROR(ARG1, ARG2)) + +__STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3) +{ + int32_t result; + + __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +#endif /* (__ARM_FEATURE_DSP == 1) */ +/*@} end of group CMSIS_SIMD_intrinsics */ + + +#endif /* __CMSIS_ARMCLANG_H */ diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/inc/cmsis_compiler.h b/port/ucontroller/nxp/lpc17xx/bootloader/inc/cmsis_compiler.h new file mode 100644 index 000000000..adbf296f1 --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/inc/cmsis_compiler.h @@ -0,0 +1,283 @@ +/**************************************************************************//** + * @file cmsis_compiler.h + * @brief CMSIS compiler generic header file + * @version V5.1.0 + * @date 09. October 2018 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __CMSIS_COMPILER_H +#define __CMSIS_COMPILER_H + +#include + +/* + * Arm Compiler 4/5 + */ +#if defined ( __CC_ARM ) + #include "cmsis_armcc.h" + + +/* + * Arm Compiler 6.6 LTM (armclang) + */ +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) && (__ARMCC_VERSION < 6100100) + #include "cmsis_armclang_ltm.h" + + /* + * Arm Compiler above 6.10.1 (armclang) + */ +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6100100) + #include "cmsis_armclang.h" + + +/* + * GNU Compiler + */ +#elif defined ( __GNUC__ ) + #include "cmsis_gcc.h" + + +/* + * IAR Compiler + */ +#elif defined ( __ICCARM__ ) + #include + + +/* + * TI Arm Compiler + */ +#elif defined ( __TI_ARM__ ) + #include + + #ifndef __ASM + #define __ASM __asm + #endif + #ifndef __INLINE + #define __INLINE inline + #endif + #ifndef __STATIC_INLINE + #define __STATIC_INLINE static inline + #endif + #ifndef __STATIC_FORCEINLINE + #define __STATIC_FORCEINLINE __STATIC_INLINE + #endif + #ifndef __NO_RETURN + #define __NO_RETURN __attribute__((noreturn)) + #endif + #ifndef __USED + #define __USED __attribute__((used)) + #endif + #ifndef __WEAK + #define __WEAK __attribute__((weak)) + #endif + #ifndef __PACKED + #define __PACKED __attribute__((packed)) + #endif + #ifndef __PACKED_STRUCT + #define __PACKED_STRUCT struct __attribute__((packed)) + #endif + #ifndef __PACKED_UNION + #define __PACKED_UNION union __attribute__((packed)) + #endif + #ifndef __UNALIGNED_UINT32 /* deprecated */ + struct __attribute__((packed)) T_UINT32 { uint32_t v; }; + #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) + #endif + #ifndef __UNALIGNED_UINT16_WRITE + __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; + #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void*)(addr))->v) = (val)) + #endif + #ifndef __UNALIGNED_UINT16_READ + __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; + #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) + #endif + #ifndef __UNALIGNED_UINT32_WRITE + __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; + #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) + #endif + #ifndef __UNALIGNED_UINT32_READ + __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; + #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) + #endif + #ifndef __ALIGNED + #define __ALIGNED(x) __attribute__((aligned(x))) + #endif + #ifndef __RESTRICT + #define __RESTRICT __restrict + #endif + #ifndef __COMPILER_BARRIER + #warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored. + #define __COMPILER_BARRIER() (void)0 + #endif + + +/* + * TASKING Compiler + */ +#elif defined ( __TASKING__ ) + /* + * The CMSIS functions have been implemented as intrinsics in the compiler. + * Please use "carm -?i" to get an up to date list of all intrinsics, + * Including the CMSIS ones. + */ + + #ifndef __ASM + #define __ASM __asm + #endif + #ifndef __INLINE + #define __INLINE inline + #endif + #ifndef __STATIC_INLINE + #define __STATIC_INLINE static inline + #endif + #ifndef __STATIC_FORCEINLINE + #define __STATIC_FORCEINLINE __STATIC_INLINE + #endif + #ifndef __NO_RETURN + #define __NO_RETURN __attribute__((noreturn)) + #endif + #ifndef __USED + #define __USED __attribute__((used)) + #endif + #ifndef __WEAK + #define __WEAK __attribute__((weak)) + #endif + #ifndef __PACKED + #define __PACKED __packed__ + #endif + #ifndef __PACKED_STRUCT + #define __PACKED_STRUCT struct __packed__ + #endif + #ifndef __PACKED_UNION + #define __PACKED_UNION union __packed__ + #endif + #ifndef __UNALIGNED_UINT32 /* deprecated */ + struct __packed__ T_UINT32 { uint32_t v; }; + #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) + #endif + #ifndef __UNALIGNED_UINT16_WRITE + __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; + #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) + #endif + #ifndef __UNALIGNED_UINT16_READ + __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; + #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) + #endif + #ifndef __UNALIGNED_UINT32_WRITE + __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; + #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) + #endif + #ifndef __UNALIGNED_UINT32_READ + __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; + #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) + #endif + #ifndef __ALIGNED + #define __ALIGNED(x) __align(x) + #endif + #ifndef __RESTRICT + #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. + #define __RESTRICT + #endif + #ifndef __COMPILER_BARRIER + #warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored. + #define __COMPILER_BARRIER() (void)0 + #endif + + +/* + * COSMIC Compiler + */ +#elif defined ( __CSMC__ ) + #include + + #ifndef __ASM + #define __ASM _asm + #endif + #ifndef __INLINE + #define __INLINE inline + #endif + #ifndef __STATIC_INLINE + #define __STATIC_INLINE static inline + #endif + #ifndef __STATIC_FORCEINLINE + #define __STATIC_FORCEINLINE __STATIC_INLINE + #endif + #ifndef __NO_RETURN + // NO RETURN is automatically detected hence no warning here + #define __NO_RETURN + #endif + #ifndef __USED + #warning No compiler specific solution for __USED. __USED is ignored. + #define __USED + #endif + #ifndef __WEAK + #define __WEAK __weak + #endif + #ifndef __PACKED + #define __PACKED @packed + #endif + #ifndef __PACKED_STRUCT + #define __PACKED_STRUCT @packed struct + #endif + #ifndef __PACKED_UNION + #define __PACKED_UNION @packed union + #endif + #ifndef __UNALIGNED_UINT32 /* deprecated */ + @packed struct T_UINT32 { uint32_t v; }; + #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) + #endif + #ifndef __UNALIGNED_UINT16_WRITE + __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; + #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) + #endif + #ifndef __UNALIGNED_UINT16_READ + __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; + #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) + #endif + #ifndef __UNALIGNED_UINT32_WRITE + __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; + #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) + #endif + #ifndef __UNALIGNED_UINT32_READ + __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; + #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) + #endif + #ifndef __ALIGNED + #warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored. + #define __ALIGNED(x) + #endif + #ifndef __RESTRICT + #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. + #define __RESTRICT + #endif + #ifndef __COMPILER_BARRIER + #warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored. + #define __COMPILER_BARRIER() (void)0 + #endif + + +#else + #error Unknown compiler. +#endif + + +#endif /* __CMSIS_COMPILER_H */ + diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/inc/cmsis_gcc.h b/port/ucontroller/nxp/lpc17xx/bootloader/inc/cmsis_gcc.h new file mode 100644 index 000000000..570a8db59 --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/inc/cmsis_gcc.h @@ -0,0 +1,2177 @@ +/**************************************************************************//** + * @file cmsis_gcc.h + * @brief CMSIS compiler GCC header file + * @version V5.3.0 + * @date 28. January 2020 + ******************************************************************************/ +/* + * Copyright (c) 2009-2019 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __CMSIS_GCC_H +#define __CMSIS_GCC_H + +/* ignore some GCC warnings */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" +#pragma GCC diagnostic ignored "-Wunused-parameter" + +/* Fallback for __has_builtin */ +#ifndef __has_builtin + #define __has_builtin(x) (0) +#endif + +/* CMSIS compiler specific defines */ +#ifndef __ASM + #define __ASM __asm +#endif +#ifndef __INLINE + #define __INLINE inline +#endif +#ifndef __STATIC_INLINE + #define __STATIC_INLINE static inline +#endif +#ifndef __STATIC_FORCEINLINE + #define __STATIC_FORCEINLINE __attribute__((always_inline)) static inline +#endif +#ifndef __NO_RETURN + #define __NO_RETURN __attribute__((__noreturn__)) +#endif +#ifndef __USED + #define __USED __attribute__((used)) +#endif +#ifndef __WEAK + #define __WEAK __attribute__((weak)) +#endif +#ifndef __PACKED + #define __PACKED __attribute__((packed, aligned(1))) +#endif +#ifndef __PACKED_STRUCT + #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) +#endif +#ifndef __PACKED_UNION + #define __PACKED_UNION union __attribute__((packed, aligned(1))) +#endif +#ifndef __UNALIGNED_UINT32 /* deprecated */ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wpacked" + #pragma GCC diagnostic ignored "-Wattributes" + struct __attribute__((packed)) T_UINT32 { uint32_t v; }; + #pragma GCC diagnostic pop + #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) +#endif +#ifndef __UNALIGNED_UINT16_WRITE + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wpacked" + #pragma GCC diagnostic ignored "-Wattributes" + __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; + #pragma GCC diagnostic pop + #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) +#endif +#ifndef __UNALIGNED_UINT16_READ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wpacked" + #pragma GCC diagnostic ignored "-Wattributes" + __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; + #pragma GCC diagnostic pop + #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) +#endif +#ifndef __UNALIGNED_UINT32_WRITE + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wpacked" + #pragma GCC diagnostic ignored "-Wattributes" + __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; + #pragma GCC diagnostic pop + #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) +#endif +#ifndef __UNALIGNED_UINT32_READ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wpacked" + #pragma GCC diagnostic ignored "-Wattributes" + __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; + #pragma GCC diagnostic pop + #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) +#endif +#ifndef __ALIGNED + #define __ALIGNED(x) __attribute__((aligned(x))) +#endif +#ifndef __RESTRICT + #define __RESTRICT __restrict +#endif +#ifndef __COMPILER_BARRIER + #define __COMPILER_BARRIER() __ASM volatile("":::"memory") +#endif + +/* ######################### Startup and Lowlevel Init ######################## */ + +#ifndef __PROGRAM_START + +/** + \brief Initializes data and bss sections + \details This default implementations initialized all data and additional bss + sections relying on .copy.table and .zero.table specified properly + in the used linker script. + + */ +__STATIC_FORCEINLINE __NO_RETURN void __cmsis_start(void) +{ + extern void _start(void) __NO_RETURN; + + typedef struct { + uint32_t const* src; + uint32_t* dest; + uint32_t wlen; + } __copy_table_t; + + typedef struct { + uint32_t* dest; + uint32_t wlen; + } __zero_table_t; + + extern const __copy_table_t __copy_table_start__; + extern const __copy_table_t __copy_table_end__; + extern const __zero_table_t __zero_table_start__; + extern const __zero_table_t __zero_table_end__; + + for (__copy_table_t const* pTable = &__copy_table_start__; pTable < &__copy_table_end__; ++pTable) { + for(uint32_t i=0u; iwlen; ++i) { + pTable->dest[i] = pTable->src[i]; + } + } + + for (__zero_table_t const* pTable = &__zero_table_start__; pTable < &__zero_table_end__; ++pTable) { + for(uint32_t i=0u; iwlen; ++i) { + pTable->dest[i] = 0u; + } + } + + _start(); +} + +#define __PROGRAM_START __cmsis_start +#endif + +#ifndef __INITIAL_SP +#define __INITIAL_SP __StackTop +#endif + +#ifndef __STACK_LIMIT +#define __STACK_LIMIT __StackLimit +#endif + +#ifndef __VECTOR_TABLE +#define __VECTOR_TABLE __Vectors +#endif + +#ifndef __VECTOR_TABLE_ATTRIBUTE +#define __VECTOR_TABLE_ATTRIBUTE __attribute((used, section(".vectors"))) +#endif + +/* ########################### Core Function Access ########################### */ +/** \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions + @{ + */ + +/** + \brief Enable IRQ Interrupts + \details Enables IRQ interrupts by clearing the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__STATIC_FORCEINLINE void __enable_irq(void) +{ + __ASM volatile ("cpsie i" : : : "memory"); +} + + +/** + \brief Disable IRQ Interrupts + \details Disables IRQ interrupts by setting the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__STATIC_FORCEINLINE void __disable_irq(void) +{ + __ASM volatile ("cpsid i" : : : "memory"); +} + + +/** + \brief Get Control Register + \details Returns the content of the Control Register. + \return Control Register value + */ +__STATIC_FORCEINLINE uint32_t __get_CONTROL(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Control Register (non-secure) + \details Returns the content of the non-secure Control Register when in secure mode. + \return non-secure Control Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Control Register + \details Writes the given value to the Control Register. + \param [in] control Control Register value to set + */ +__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) +{ + __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Control Register (non-secure) + \details Writes the given value to the non-secure Control Register when in secure state. + \param [in] control Control Register value to set + */ +__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) +{ + __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); +} +#endif + + +/** + \brief Get IPSR Register + \details Returns the content of the IPSR Register. + \return IPSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_IPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get APSR Register + \details Returns the content of the APSR Register. + \return APSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_APSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, apsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get xPSR Register + \details Returns the content of the xPSR Register. + \return xPSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_xPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get Process Stack Pointer + \details Returns the current value of the Process Stack Pointer (PSP). + \return PSP Register value + */ +__STATIC_FORCEINLINE uint32_t __get_PSP(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, psp" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Process Stack Pointer (non-secure) + \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. + \return PSP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Process Stack Pointer + \details Assigns the given value to the Process Stack Pointer (PSP). + \param [in] topOfProcStack Process Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack) +{ + __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Process Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. + \param [in] topOfProcStack Process Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) +{ + __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); +} +#endif + + +/** + \brief Get Main Stack Pointer + \details Returns the current value of the Main Stack Pointer (MSP). + \return MSP Register value + */ +__STATIC_FORCEINLINE uint32_t __get_MSP(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, msp" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Main Stack Pointer (non-secure) + \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. + \return MSP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Main Stack Pointer + \details Assigns the given value to the Main Stack Pointer (MSP). + \param [in] topOfMainStack Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack) +{ + __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Main Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. + \param [in] topOfMainStack Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) +{ + __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); +} +#endif + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Stack Pointer (non-secure) + \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state. + \return SP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, sp_ns" : "=r" (result) ); + return(result); +} + + +/** + \brief Set Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state. + \param [in] topOfStack Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack) +{ + __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : ); +} +#endif + + +/** + \brief Get Priority Mask + \details Returns the current state of the priority mask bit from the Priority Mask Register. + \return Priority Mask value + */ +__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Priority Mask (non-secure) + \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. + \return Priority Mask value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Priority Mask + \details Assigns the given value to the Priority Mask Register. + \param [in] priMask Priority Mask + */ +__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask) +{ + __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Priority Mask (non-secure) + \details Assigns the given value to the non-secure Priority Mask Register when in secure state. + \param [in] priMask Priority Mask + */ +__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) +{ + __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); +} +#endif + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) +/** + \brief Enable FIQ + \details Enables FIQ interrupts by clearing the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__STATIC_FORCEINLINE void __enable_fault_irq(void) +{ + __ASM volatile ("cpsie f" : : : "memory"); +} + + +/** + \brief Disable FIQ + \details Disables FIQ interrupts by setting the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__STATIC_FORCEINLINE void __disable_fault_irq(void) +{ + __ASM volatile ("cpsid f" : : : "memory"); +} + + +/** + \brief Get Base Priority + \details Returns the current value of the Base Priority register. + \return Base Priority register value + */ +__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, basepri" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Base Priority (non-secure) + \details Returns the current value of the non-secure Base Priority register when in secure state. + \return Base Priority register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Base Priority + \details Assigns the given value to the Base Priority register. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri) +{ + __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Base Priority (non-secure) + \details Assigns the given value to the non-secure Base Priority register when in secure state. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) +{ + __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); +} +#endif + + +/** + \brief Set Base Priority with condition + \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, + or the new value increases the BASEPRI priority level. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri) +{ + __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); +} + + +/** + \brief Get Fault Mask + \details Returns the current value of the Fault Mask register. + \return Fault Mask register value + */ +__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Fault Mask (non-secure) + \details Returns the current value of the non-secure Fault Mask register when in secure state. + \return Fault Mask register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Fault Mask + \details Assigns the given value to the Fault Mask register. + \param [in] faultMask Fault Mask value to set + */ +__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask) +{ + __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Fault Mask (non-secure) + \details Assigns the given value to the non-secure Fault Mask register when in secure state. + \param [in] faultMask Fault Mask value to set + */ +__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) +{ + __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); +} +#endif + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) + +/** + \brief Get Process Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always in non-secure + mode. + + \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). + \return PSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, psplim" : "=r" (result) ); + return result; +#endif +} + +#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Process Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always. + + \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \return PSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); + return result; +#endif +} +#endif + + +/** + \brief Set Process Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored in non-secure + mode. + + \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)ProcStackPtrLimit; +#else + __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Process Stack Pointer (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored. + + \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)ProcStackPtrLimit; +#else + __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); +#endif +} +#endif + + +/** + \brief Get Main Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always in non-secure + mode. + + \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). + \return MSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, msplim" : "=r" (result) ); + return result; +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Main Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always. + + \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. + \return MSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); + return result; +#endif +} +#endif + + +/** + \brief Set Main Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored in non-secure + mode. + + \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). + \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)MainStackPtrLimit; +#else + __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Main Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored. + + \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. + \param [in] MainStackPtrLimit Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)MainStackPtrLimit; +#else + __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); +#endif +} +#endif + +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + + +/** + \brief Get FPSCR + \details Returns the current value of the Floating Point Status/Control register. + \return Floating Point Status/Control register value + */ +__STATIC_FORCEINLINE uint32_t __get_FPSCR(void) +{ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) +#if __has_builtin(__builtin_arm_get_fpscr) +// Re-enable using built-in when GCC has been fixed +// || (__GNUC__ > 7) || (__GNUC__ == 7 && __GNUC_MINOR__ >= 2) + /* see https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00443.html */ + return __builtin_arm_get_fpscr(); +#else + uint32_t result; + + __ASM volatile ("VMRS %0, fpscr" : "=r" (result) ); + return(result); +#endif +#else + return(0U); +#endif +} + + +/** + \brief Set FPSCR + \details Assigns the given value to the Floating Point Status/Control register. + \param [in] fpscr Floating Point Status/Control value to set + */ +__STATIC_FORCEINLINE void __set_FPSCR(uint32_t fpscr) +{ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) +#if __has_builtin(__builtin_arm_set_fpscr) +// Re-enable using built-in when GCC has been fixed +// || (__GNUC__ > 7) || (__GNUC__ == 7 && __GNUC_MINOR__ >= 2) + /* see https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00443.html */ + __builtin_arm_set_fpscr(fpscr); +#else + __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "vfpcc", "memory"); +#endif +#else + (void)fpscr; +#endif +} + + +/*@} end of CMSIS_Core_RegAccFunctions */ + + +/* ########################## Core Instruction Access ######################### */ +/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface + Access to dedicated instructions + @{ +*/ + +/* Define macros for porting to both thumb1 and thumb2. + * For thumb1, use low register (r0-r7), specified by constraint "l" + * Otherwise, use general registers, specified by constraint "r" */ +#if defined (__thumb__) && !defined (__thumb2__) +#define __CMSIS_GCC_OUT_REG(r) "=l" (r) +#define __CMSIS_GCC_RW_REG(r) "+l" (r) +#define __CMSIS_GCC_USE_REG(r) "l" (r) +#else +#define __CMSIS_GCC_OUT_REG(r) "=r" (r) +#define __CMSIS_GCC_RW_REG(r) "+r" (r) +#define __CMSIS_GCC_USE_REG(r) "r" (r) +#endif + +/** + \brief No Operation + \details No Operation does nothing. This instruction can be used for code alignment purposes. + */ +#define __NOP() __ASM volatile ("nop") + +/** + \brief Wait For Interrupt + \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. + */ +#define __WFI() __ASM volatile ("wfi":::"memory") + + +/** + \brief Wait For Event + \details Wait For Event is a hint instruction that permits the processor to enter + a low-power state until one of a number of events occurs. + */ +#define __WFE() __ASM volatile ("wfe":::"memory") + + +/** + \brief Send Event + \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. + */ +#define __SEV() __ASM volatile ("sev") + + +/** + \brief Instruction Synchronization Barrier + \details Instruction Synchronization Barrier flushes the pipeline in the processor, + so that all instructions following the ISB are fetched from cache or memory, + after the instruction has been completed. + */ +__STATIC_FORCEINLINE void __ISB(void) +{ + __ASM volatile ("isb 0xF":::"memory"); +} + + +/** + \brief Data Synchronization Barrier + \details Acts as a special kind of Data Memory Barrier. + It completes when all explicit memory accesses before this instruction complete. + */ +__STATIC_FORCEINLINE void __DSB(void) +{ + __ASM volatile ("dsb 0xF":::"memory"); +} + + +/** + \brief Data Memory Barrier + \details Ensures the apparent order of the explicit memory operations before + and after the instruction, without ensuring their completion. + */ +__STATIC_FORCEINLINE void __DMB(void) +{ + __ASM volatile ("dmb 0xF":::"memory"); +} + + +/** + \brief Reverse byte order (32 bit) + \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. + \param [in] value Value to reverse + \return Reversed value + */ +__STATIC_FORCEINLINE uint32_t __REV(uint32_t value) +{ +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) + return __builtin_bswap32(value); +#else + uint32_t result; + + __ASM ("rev %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return result; +#endif +} + + +/** + \brief Reverse byte order (16 bit) + \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. + \param [in] value Value to reverse + \return Reversed value + */ +__STATIC_FORCEINLINE uint32_t __REV16(uint32_t value) +{ + uint32_t result; + + __ASM ("rev16 %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return result; +} + + +/** + \brief Reverse byte order (16 bit) + \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. + \param [in] value Value to reverse + \return Reversed value + */ +__STATIC_FORCEINLINE int16_t __REVSH(int16_t value) +{ +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + return (int16_t)__builtin_bswap16(value); +#else + int16_t result; + + __ASM ("revsh %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return result; +#endif +} + + +/** + \brief Rotate Right in unsigned value (32 bit) + \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. + \param [in] op1 Value to rotate + \param [in] op2 Number of Bits to rotate + \return Rotated value + */ +__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) +{ + op2 %= 32U; + if (op2 == 0U) + { + return op1; + } + return (op1 >> op2) | (op1 << (32U - op2)); +} + + +/** + \brief Breakpoint + \details Causes the processor to enter Debug state. + Debug tools can use this to investigate system state when the instruction at a particular address is reached. + \param [in] value is ignored by the processor. + If required, a debugger can use it to store additional information about the breakpoint. + */ +#define __BKPT(value) __ASM volatile ("bkpt "#value) + + +/** + \brief Reverse bit order of value + \details Reverses the bit order of the given value. + \param [in] value Value to reverse + \return Reversed value + */ +__STATIC_FORCEINLINE uint32_t __RBIT(uint32_t value) +{ + uint32_t result; + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) + __ASM ("rbit %0, %1" : "=r" (result) : "r" (value) ); +#else + uint32_t s = (4U /*sizeof(v)*/ * 8U) - 1U; /* extra shift needed at end */ + + result = value; /* r will be reversed bits of v; first get LSB of v */ + for (value >>= 1U; value != 0U; value >>= 1U) + { + result <<= 1U; + result |= value & 1U; + s--; + } + result <<= s; /* shift when v's highest bits are zero */ +#endif + return result; +} + + +/** + \brief Count leading zeros + \details Counts the number of leading zeros of a data value. + \param [in] value Value to count the leading zeros + \return number of leading zeros in value + */ +__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value) +{ + /* Even though __builtin_clz produces a CLZ instruction on ARM, formally + __builtin_clz(0) is undefined behaviour, so handle this case specially. + This guarantees ARM-compatible results if happening to compile on a non-ARM + target, and ensures the compiler doesn't decide to activate any + optimisations using the logic "value was passed to __builtin_clz, so it + is non-zero". + ARM GCC 7.3 and possibly earlier will optimise this test away, leaving a + single CLZ instruction. + */ + if (value == 0U) + { + return 32U; + } + return __builtin_clz(value); +} + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) +/** + \brief LDR Exclusive (8 bit) + \details Executes a exclusive LDR instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__STATIC_FORCEINLINE uint8_t __LDREXB(volatile uint8_t *addr) +{ + uint32_t result; + +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + __ASM volatile ("ldrexb %0, %1" : "=r" (result) : "Q" (*addr) ); +#else + /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not + accepted by assembler. So has to use following less efficient pattern. + */ + __ASM volatile ("ldrexb %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); +#endif + return ((uint8_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDR Exclusive (16 bit) + \details Executes a exclusive LDR instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__STATIC_FORCEINLINE uint16_t __LDREXH(volatile uint16_t *addr) +{ + uint32_t result; + +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + __ASM volatile ("ldrexh %0, %1" : "=r" (result) : "Q" (*addr) ); +#else + /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not + accepted by assembler. So has to use following less efficient pattern. + */ + __ASM volatile ("ldrexh %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); +#endif + return ((uint16_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDR Exclusive (32 bit) + \details Executes a exclusive LDR instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__STATIC_FORCEINLINE uint32_t __LDREXW(volatile uint32_t *addr) +{ + uint32_t result; + + __ASM volatile ("ldrex %0, %1" : "=r" (result) : "Q" (*addr) ); + return(result); +} + + +/** + \brief STR Exclusive (8 bit) + \details Executes a exclusive STR instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__STATIC_FORCEINLINE uint32_t __STREXB(uint8_t value, volatile uint8_t *addr) +{ + uint32_t result; + + __ASM volatile ("strexb %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); + return(result); +} + + +/** + \brief STR Exclusive (16 bit) + \details Executes a exclusive STR instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__STATIC_FORCEINLINE uint32_t __STREXH(uint16_t value, volatile uint16_t *addr) +{ + uint32_t result; + + __ASM volatile ("strexh %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); + return(result); +} + + +/** + \brief STR Exclusive (32 bit) + \details Executes a exclusive STR instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__STATIC_FORCEINLINE uint32_t __STREXW(uint32_t value, volatile uint32_t *addr) +{ + uint32_t result; + + __ASM volatile ("strex %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" (value) ); + return(result); +} + + +/** + \brief Remove the exclusive lock + \details Removes the exclusive lock which is created by LDREX. + */ +__STATIC_FORCEINLINE void __CLREX(void) +{ + __ASM volatile ("clrex" ::: "memory"); +} + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] ARG1 Value to be saturated + \param [in] ARG2 Bit position to saturate to (1..32) + \return Saturated value + */ +#define __SSAT(ARG1, ARG2) \ +__extension__ \ +({ \ + int32_t __RES, __ARG1 = (ARG1); \ + __ASM volatile ("ssat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) : "cc" ); \ + __RES; \ + }) + + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] ARG1 Value to be saturated + \param [in] ARG2 Bit position to saturate to (0..31) + \return Saturated value + */ +#define __USAT(ARG1, ARG2) \ + __extension__ \ +({ \ + uint32_t __RES, __ARG1 = (ARG1); \ + __ASM volatile ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) : "cc" ); \ + __RES; \ + }) + + +/** + \brief Rotate Right with Extend (32 bit) + \details Moves each bit of a bitstring right by one bit. + The carry input is shifted in at the left end of the bitstring. + \param [in] value Value to rotate + \return Rotated value + */ +__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value) +{ + uint32_t result; + + __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return(result); +} + + +/** + \brief LDRT Unprivileged (8 bit) + \details Executes a Unprivileged LDRT instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr) +{ + uint32_t result; + +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); +#else + /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not + accepted by assembler. So has to use following less efficient pattern. + */ + __ASM volatile ("ldrbt %0, [%1]" : "=r" (result) : "r" (ptr) : "memory" ); +#endif + return ((uint8_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDRT Unprivileged (16 bit) + \details Executes a Unprivileged LDRT instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr) +{ + uint32_t result; + +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); +#else + /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not + accepted by assembler. So has to use following less efficient pattern. + */ + __ASM volatile ("ldrht %0, [%1]" : "=r" (result) : "r" (ptr) : "memory" ); +#endif + return ((uint16_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDRT Unprivileged (32 bit) + \details Executes a Unprivileged LDRT instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); + return(result); +} + + +/** + \brief STRT Unprivileged (8 bit) + \details Executes a Unprivileged STRT instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) +{ + __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief STRT Unprivileged (16 bit) + \details Executes a Unprivileged STRT instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) +{ + __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief STRT Unprivileged (32 bit) + \details Executes a Unprivileged STRT instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr) +{ + __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); +} + +#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value + */ +__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat) +{ + if ((sat >= 1U) && (sat <= 32U)) + { + const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); + const int32_t min = -1 - max ; + if (val > max) + { + return max; + } + else if (val < min) + { + return min; + } + } + return val; +} + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value + */ +__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) +{ + if (sat <= 31U) + { + const uint32_t max = ((1U << sat) - 1U); + if (val > (int32_t)max) + { + return max; + } + else if (val < 0) + { + return 0U; + } + } + return (uint32_t)val; +} + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) +/** + \brief Load-Acquire (8 bit) + \details Executes a LDAB instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return ((uint8_t) result); +} + + +/** + \brief Load-Acquire (16 bit) + \details Executes a LDAH instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return ((uint16_t) result); +} + + +/** + \brief Load-Acquire (32 bit) + \details Executes a LDA instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return(result); +} + + +/** + \brief Store-Release (8 bit) + \details Executes a STLB instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr) +{ + __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); +} + + +/** + \brief Store-Release (16 bit) + \details Executes a STLH instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr) +{ + __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); +} + + +/** + \brief Store-Release (32 bit) + \details Executes a STL instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr) +{ + __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); +} + + +/** + \brief Load-Acquire Exclusive (8 bit) + \details Executes a LDAB exclusive instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__STATIC_FORCEINLINE uint8_t __LDAEXB(volatile uint8_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldaexb %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return ((uint8_t) result); +} + + +/** + \brief Load-Acquire Exclusive (16 bit) + \details Executes a LDAH exclusive instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__STATIC_FORCEINLINE uint16_t __LDAEXH(volatile uint16_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldaexh %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return ((uint16_t) result); +} + + +/** + \brief Load-Acquire Exclusive (32 bit) + \details Executes a LDA exclusive instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__STATIC_FORCEINLINE uint32_t __LDAEX(volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldaex %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return(result); +} + + +/** + \brief Store-Release Exclusive (8 bit) + \details Executes a STLB exclusive instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__STATIC_FORCEINLINE uint32_t __STLEXB(uint8_t value, volatile uint8_t *ptr) +{ + uint32_t result; + + __ASM volatile ("stlexb %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); + return(result); +} + + +/** + \brief Store-Release Exclusive (16 bit) + \details Executes a STLH exclusive instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__STATIC_FORCEINLINE uint32_t __STLEXH(uint16_t value, volatile uint16_t *ptr) +{ + uint32_t result; + + __ASM volatile ("stlexh %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); + return(result); +} + + +/** + \brief Store-Release Exclusive (32 bit) + \details Executes a STL exclusive instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__STATIC_FORCEINLINE uint32_t __STLEX(uint32_t value, volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("stlex %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); + return(result); +} + +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + +/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ + + +/* ################### Compiler specific Intrinsics ########################### */ +/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics + Access to dedicated SIMD instructions + @{ +*/ + +#if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)) + +__STATIC_FORCEINLINE uint32_t __SADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + + +__STATIC_FORCEINLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + + +__STATIC_FORCEINLINE uint32_t __SADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USAD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +#define __SSAT16(ARG1, ARG2) \ +({ \ + int32_t __RES, __ARG1 = (ARG1); \ + __ASM volatile ("ssat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) : "cc" ); \ + __RES; \ + }) + +#define __USAT16(ARG1, ARG2) \ +({ \ + uint32_t __RES, __ARG1 = (ARG1); \ + __ASM volatile ("usat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) : "cc" ); \ + __RES; \ + }) + +__STATIC_FORCEINLINE uint32_t __UXTB16(uint32_t op1) +{ + uint32_t result; + + __ASM ("uxtb16 %0, %1" : "=r" (result) : "r" (op1)); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SXTB16(uint32_t op1) +{ + uint32_t result; + + __ASM ("sxtb16 %0, %1" : "=r" (result) : "r" (op1)); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SXTB16_RORn(uint32_t op1, uint32_t rotate) +{ + uint32_t result; + + __ASM ("sxtb16 %0, %1, ROR %2" : "=r" (result) : "r" (op1), "i" (rotate) ); + + return result; +} + +__STATIC_FORCEINLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMUAD (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint64_t __SMLALD (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint64_t __SMLALDX (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint32_t __SMUSD (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint64_t __SMLSLD (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint64_t __SMLSLDX (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint32_t __SEL (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE int32_t __QADD( int32_t op1, int32_t op2) +{ + int32_t result; + + __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE int32_t __QSUB( int32_t op1, int32_t op2) +{ + int32_t result; + + __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +#if 0 +#define __PKHBT(ARG1,ARG2,ARG3) \ +({ \ + uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \ + __ASM ("pkhbt %0, %1, %2, lsl %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \ + __RES; \ + }) + +#define __PKHTB(ARG1,ARG2,ARG3) \ +({ \ + uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \ + if (ARG3 == 0) \ + __ASM ("pkhtb %0, %1, %2" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2) ); \ + else \ + __ASM ("pkhtb %0, %1, %2, asr %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \ + __RES; \ + }) +#endif + +#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \ + ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) ) + +#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \ + ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) ) + +__STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3) +{ + int32_t result; + + __ASM ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +#endif /* (__ARM_FEATURE_DSP == 1) */ +/*@} end of group CMSIS_SIMD_intrinsics */ + + +#pragma GCC diagnostic pop + +#endif /* __CMSIS_GCC_H */ diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/inc/cmsis_iccarm.h b/port/ucontroller/nxp/lpc17xx/bootloader/inc/cmsis_iccarm.h new file mode 100644 index 000000000..fe2d6de91 --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/inc/cmsis_iccarm.h @@ -0,0 +1,966 @@ +/**************************************************************************//** + * @file cmsis_iccarm.h + * @brief CMSIS compiler ICCARM (IAR Compiler for Arm) header file + * @version V5.2.0 + * @date 28. January 2020 + ******************************************************************************/ + +//------------------------------------------------------------------------------ +// +// Copyright (c) 2017-2019 IAR Systems +// Copyright (c) 2017-2019 Arm Limited. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------ + + +#ifndef __CMSIS_ICCARM_H__ +#define __CMSIS_ICCARM_H__ + +#ifndef __ICCARM__ + #error This file should only be compiled by ICCARM +#endif + +#pragma system_include + +#define __IAR_FT _Pragma("inline=forced") __intrinsic + +#if (__VER__ >= 8000000) + #define __ICCARM_V8 1 +#else + #define __ICCARM_V8 0 +#endif + +#ifndef __ALIGNED + #if __ICCARM_V8 + #define __ALIGNED(x) __attribute__((aligned(x))) + #elif (__VER__ >= 7080000) + /* Needs IAR language extensions */ + #define __ALIGNED(x) __attribute__((aligned(x))) + #else + #warning No compiler specific solution for __ALIGNED.__ALIGNED is ignored. + #define __ALIGNED(x) + #endif +#endif + + +/* Define compiler macros for CPU architecture, used in CMSIS 5. + */ +#if __ARM_ARCH_6M__ || __ARM_ARCH_7M__ || __ARM_ARCH_7EM__ || __ARM_ARCH_8M_BASE__ || __ARM_ARCH_8M_MAIN__ +/* Macros already defined */ +#else + #if defined(__ARM8M_MAINLINE__) || defined(__ARM8EM_MAINLINE__) + #define __ARM_ARCH_8M_MAIN__ 1 + #elif defined(__ARM8M_BASELINE__) + #define __ARM_ARCH_8M_BASE__ 1 + #elif defined(__ARM_ARCH_PROFILE) && __ARM_ARCH_PROFILE == 'M' + #if __ARM_ARCH == 6 + #define __ARM_ARCH_6M__ 1 + #elif __ARM_ARCH == 7 + #if __ARM_FEATURE_DSP + #define __ARM_ARCH_7EM__ 1 + #else + #define __ARM_ARCH_7M__ 1 + #endif + #endif /* __ARM_ARCH */ + #endif /* __ARM_ARCH_PROFILE == 'M' */ +#endif + +/* Alternativ core deduction for older ICCARM's */ +#if !defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_7M__) && !defined(__ARM_ARCH_7EM__) && \ + !defined(__ARM_ARCH_8M_BASE__) && !defined(__ARM_ARCH_8M_MAIN__) + #if defined(__ARM6M__) && (__CORE__ == __ARM6M__) + #define __ARM_ARCH_6M__ 1 + #elif defined(__ARM7M__) && (__CORE__ == __ARM7M__) + #define __ARM_ARCH_7M__ 1 + #elif defined(__ARM7EM__) && (__CORE__ == __ARM7EM__) + #define __ARM_ARCH_7EM__ 1 + #elif defined(__ARM8M_BASELINE__) && (__CORE == __ARM8M_BASELINE__) + #define __ARM_ARCH_8M_BASE__ 1 + #elif defined(__ARM8M_MAINLINE__) && (__CORE == __ARM8M_MAINLINE__) + #define __ARM_ARCH_8M_MAIN__ 1 + #elif defined(__ARM8EM_MAINLINE__) && (__CORE == __ARM8EM_MAINLINE__) + #define __ARM_ARCH_8M_MAIN__ 1 + #else + #error "Unknown target." + #endif +#endif + + + +#if defined(__ARM_ARCH_6M__) && __ARM_ARCH_6M__==1 + #define __IAR_M0_FAMILY 1 +#elif defined(__ARM_ARCH_8M_BASE__) && __ARM_ARCH_8M_BASE__==1 + #define __IAR_M0_FAMILY 1 +#else + #define __IAR_M0_FAMILY 0 +#endif + + +#ifndef __ASM + #define __ASM __asm +#endif + +#ifndef __COMPILER_BARRIER + #define __COMPILER_BARRIER() __ASM volatile("":::"memory") +#endif + +#ifndef __INLINE + #define __INLINE inline +#endif + +#ifndef __NO_RETURN + #if __ICCARM_V8 + #define __NO_RETURN __attribute__((__noreturn__)) + #else + #define __NO_RETURN _Pragma("object_attribute=__noreturn") + #endif +#endif + +#ifndef __PACKED + #if __ICCARM_V8 + #define __PACKED __attribute__((packed, aligned(1))) + #else + /* Needs IAR language extensions */ + #define __PACKED __packed + #endif +#endif + +#ifndef __PACKED_STRUCT + #if __ICCARM_V8 + #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) + #else + /* Needs IAR language extensions */ + #define __PACKED_STRUCT __packed struct + #endif +#endif + +#ifndef __PACKED_UNION + #if __ICCARM_V8 + #define __PACKED_UNION union __attribute__((packed, aligned(1))) + #else + /* Needs IAR language extensions */ + #define __PACKED_UNION __packed union + #endif +#endif + +#ifndef __RESTRICT + #if __ICCARM_V8 + #define __RESTRICT __restrict + #else + /* Needs IAR language extensions */ + #define __RESTRICT restrict + #endif +#endif + +#ifndef __STATIC_INLINE + #define __STATIC_INLINE static inline +#endif + +#ifndef __FORCEINLINE + #define __FORCEINLINE _Pragma("inline=forced") +#endif + +#ifndef __STATIC_FORCEINLINE + #define __STATIC_FORCEINLINE __FORCEINLINE __STATIC_INLINE +#endif + +#ifndef __UNALIGNED_UINT16_READ +#pragma language=save +#pragma language=extended +__IAR_FT uint16_t __iar_uint16_read(void const *ptr) +{ + return *(__packed uint16_t*)(ptr); +} +#pragma language=restore +#define __UNALIGNED_UINT16_READ(PTR) __iar_uint16_read(PTR) +#endif + + +#ifndef __UNALIGNED_UINT16_WRITE +#pragma language=save +#pragma language=extended +__IAR_FT void __iar_uint16_write(void const *ptr, uint16_t val) +{ + *(__packed uint16_t*)(ptr) = val;; +} +#pragma language=restore +#define __UNALIGNED_UINT16_WRITE(PTR,VAL) __iar_uint16_write(PTR,VAL) +#endif + +#ifndef __UNALIGNED_UINT32_READ +#pragma language=save +#pragma language=extended +__IAR_FT uint32_t __iar_uint32_read(void const *ptr) +{ + return *(__packed uint32_t*)(ptr); +} +#pragma language=restore +#define __UNALIGNED_UINT32_READ(PTR) __iar_uint32_read(PTR) +#endif + +#ifndef __UNALIGNED_UINT32_WRITE +#pragma language=save +#pragma language=extended +__IAR_FT void __iar_uint32_write(void const *ptr, uint32_t val) +{ + *(__packed uint32_t*)(ptr) = val;; +} +#pragma language=restore +#define __UNALIGNED_UINT32_WRITE(PTR,VAL) __iar_uint32_write(PTR,VAL) +#endif + +#ifndef __UNALIGNED_UINT32 /* deprecated */ +#pragma language=save +#pragma language=extended +__packed struct __iar_u32 { uint32_t v; }; +#pragma language=restore +#define __UNALIGNED_UINT32(PTR) (((struct __iar_u32 *)(PTR))->v) +#endif + +#ifndef __USED + #if __ICCARM_V8 + #define __USED __attribute__((used)) + #else + #define __USED _Pragma("__root") + #endif +#endif + +#ifndef __WEAK + #if __ICCARM_V8 + #define __WEAK __attribute__((weak)) + #else + #define __WEAK _Pragma("__weak") + #endif +#endif + +#ifndef __PROGRAM_START +#define __PROGRAM_START __iar_program_start +#endif + +#ifndef __INITIAL_SP +#define __INITIAL_SP CSTACK$$Limit +#endif + +#ifndef __STACK_LIMIT +#define __STACK_LIMIT CSTACK$$Base +#endif + +#ifndef __VECTOR_TABLE +#define __VECTOR_TABLE __vector_table +#endif + +#ifndef __VECTOR_TABLE_ATTRIBUTE +#define __VECTOR_TABLE_ATTRIBUTE @".intvec" +#endif + +#ifndef __ICCARM_INTRINSICS_VERSION__ + #define __ICCARM_INTRINSICS_VERSION__ 0 +#endif + +#if __ICCARM_INTRINSICS_VERSION__ == 2 + + #if defined(__CLZ) + #undef __CLZ + #endif + #if defined(__REVSH) + #undef __REVSH + #endif + #if defined(__RBIT) + #undef __RBIT + #endif + #if defined(__SSAT) + #undef __SSAT + #endif + #if defined(__USAT) + #undef __USAT + #endif + + #include "iccarm_builtin.h" + + #define __disable_fault_irq __iar_builtin_disable_fiq + #define __disable_irq __iar_builtin_disable_interrupt + #define __enable_fault_irq __iar_builtin_enable_fiq + #define __enable_irq __iar_builtin_enable_interrupt + #define __arm_rsr __iar_builtin_rsr + #define __arm_wsr __iar_builtin_wsr + + + #define __get_APSR() (__arm_rsr("APSR")) + #define __get_BASEPRI() (__arm_rsr("BASEPRI")) + #define __get_CONTROL() (__arm_rsr("CONTROL")) + #define __get_FAULTMASK() (__arm_rsr("FAULTMASK")) + + #if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) + #define __get_FPSCR() (__arm_rsr("FPSCR")) + #define __set_FPSCR(VALUE) (__arm_wsr("FPSCR", (VALUE))) + #else + #define __get_FPSCR() ( 0 ) + #define __set_FPSCR(VALUE) ((void)VALUE) + #endif + + #define __get_IPSR() (__arm_rsr("IPSR")) + #define __get_MSP() (__arm_rsr("MSP")) + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + #define __get_MSPLIM() (0U) + #else + #define __get_MSPLIM() (__arm_rsr("MSPLIM")) + #endif + #define __get_PRIMASK() (__arm_rsr("PRIMASK")) + #define __get_PSP() (__arm_rsr("PSP")) + + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + #define __get_PSPLIM() (0U) + #else + #define __get_PSPLIM() (__arm_rsr("PSPLIM")) + #endif + + #define __get_xPSR() (__arm_rsr("xPSR")) + + #define __set_BASEPRI(VALUE) (__arm_wsr("BASEPRI", (VALUE))) + #define __set_BASEPRI_MAX(VALUE) (__arm_wsr("BASEPRI_MAX", (VALUE))) + #define __set_CONTROL(VALUE) (__arm_wsr("CONTROL", (VALUE))) + #define __set_FAULTMASK(VALUE) (__arm_wsr("FAULTMASK", (VALUE))) + #define __set_MSP(VALUE) (__arm_wsr("MSP", (VALUE))) + + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + #define __set_MSPLIM(VALUE) ((void)(VALUE)) + #else + #define __set_MSPLIM(VALUE) (__arm_wsr("MSPLIM", (VALUE))) + #endif + #define __set_PRIMASK(VALUE) (__arm_wsr("PRIMASK", (VALUE))) + #define __set_PSP(VALUE) (__arm_wsr("PSP", (VALUE))) + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + #define __set_PSPLIM(VALUE) ((void)(VALUE)) + #else + #define __set_PSPLIM(VALUE) (__arm_wsr("PSPLIM", (VALUE))) + #endif + + #define __TZ_get_CONTROL_NS() (__arm_rsr("CONTROL_NS")) + #define __TZ_set_CONTROL_NS(VALUE) (__arm_wsr("CONTROL_NS", (VALUE))) + #define __TZ_get_PSP_NS() (__arm_rsr("PSP_NS")) + #define __TZ_set_PSP_NS(VALUE) (__arm_wsr("PSP_NS", (VALUE))) + #define __TZ_get_MSP_NS() (__arm_rsr("MSP_NS")) + #define __TZ_set_MSP_NS(VALUE) (__arm_wsr("MSP_NS", (VALUE))) + #define __TZ_get_SP_NS() (__arm_rsr("SP_NS")) + #define __TZ_set_SP_NS(VALUE) (__arm_wsr("SP_NS", (VALUE))) + #define __TZ_get_PRIMASK_NS() (__arm_rsr("PRIMASK_NS")) + #define __TZ_set_PRIMASK_NS(VALUE) (__arm_wsr("PRIMASK_NS", (VALUE))) + #define __TZ_get_BASEPRI_NS() (__arm_rsr("BASEPRI_NS")) + #define __TZ_set_BASEPRI_NS(VALUE) (__arm_wsr("BASEPRI_NS", (VALUE))) + #define __TZ_get_FAULTMASK_NS() (__arm_rsr("FAULTMASK_NS")) + #define __TZ_set_FAULTMASK_NS(VALUE)(__arm_wsr("FAULTMASK_NS", (VALUE))) + + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + #define __TZ_get_PSPLIM_NS() (0U) + #define __TZ_set_PSPLIM_NS(VALUE) ((void)(VALUE)) + #else + #define __TZ_get_PSPLIM_NS() (__arm_rsr("PSPLIM_NS")) + #define __TZ_set_PSPLIM_NS(VALUE) (__arm_wsr("PSPLIM_NS", (VALUE))) + #endif + + #define __TZ_get_MSPLIM_NS() (__arm_rsr("MSPLIM_NS")) + #define __TZ_set_MSPLIM_NS(VALUE) (__arm_wsr("MSPLIM_NS", (VALUE))) + + #define __NOP __iar_builtin_no_operation + + #define __CLZ __iar_builtin_CLZ + #define __CLREX __iar_builtin_CLREX + + #define __DMB __iar_builtin_DMB + #define __DSB __iar_builtin_DSB + #define __ISB __iar_builtin_ISB + + #define __LDREXB __iar_builtin_LDREXB + #define __LDREXH __iar_builtin_LDREXH + #define __LDREXW __iar_builtin_LDREX + + #define __RBIT __iar_builtin_RBIT + #define __REV __iar_builtin_REV + #define __REV16 __iar_builtin_REV16 + + __IAR_FT int16_t __REVSH(int16_t val) + { + return (int16_t) __iar_builtin_REVSH(val); + } + + #define __ROR __iar_builtin_ROR + #define __RRX __iar_builtin_RRX + + #define __SEV __iar_builtin_SEV + + #if !__IAR_M0_FAMILY + #define __SSAT __iar_builtin_SSAT + #endif + + #define __STREXB __iar_builtin_STREXB + #define __STREXH __iar_builtin_STREXH + #define __STREXW __iar_builtin_STREX + + #if !__IAR_M0_FAMILY + #define __USAT __iar_builtin_USAT + #endif + + #define __WFE __iar_builtin_WFE + #define __WFI __iar_builtin_WFI + + #if __ARM_MEDIA__ + #define __SADD8 __iar_builtin_SADD8 + #define __QADD8 __iar_builtin_QADD8 + #define __SHADD8 __iar_builtin_SHADD8 + #define __UADD8 __iar_builtin_UADD8 + #define __UQADD8 __iar_builtin_UQADD8 + #define __UHADD8 __iar_builtin_UHADD8 + #define __SSUB8 __iar_builtin_SSUB8 + #define __QSUB8 __iar_builtin_QSUB8 + #define __SHSUB8 __iar_builtin_SHSUB8 + #define __USUB8 __iar_builtin_USUB8 + #define __UQSUB8 __iar_builtin_UQSUB8 + #define __UHSUB8 __iar_builtin_UHSUB8 + #define __SADD16 __iar_builtin_SADD16 + #define __QADD16 __iar_builtin_QADD16 + #define __SHADD16 __iar_builtin_SHADD16 + #define __UADD16 __iar_builtin_UADD16 + #define __UQADD16 __iar_builtin_UQADD16 + #define __UHADD16 __iar_builtin_UHADD16 + #define __SSUB16 __iar_builtin_SSUB16 + #define __QSUB16 __iar_builtin_QSUB16 + #define __SHSUB16 __iar_builtin_SHSUB16 + #define __USUB16 __iar_builtin_USUB16 + #define __UQSUB16 __iar_builtin_UQSUB16 + #define __UHSUB16 __iar_builtin_UHSUB16 + #define __SASX __iar_builtin_SASX + #define __QASX __iar_builtin_QASX + #define __SHASX __iar_builtin_SHASX + #define __UASX __iar_builtin_UASX + #define __UQASX __iar_builtin_UQASX + #define __UHASX __iar_builtin_UHASX + #define __SSAX __iar_builtin_SSAX + #define __QSAX __iar_builtin_QSAX + #define __SHSAX __iar_builtin_SHSAX + #define __USAX __iar_builtin_USAX + #define __UQSAX __iar_builtin_UQSAX + #define __UHSAX __iar_builtin_UHSAX + #define __USAD8 __iar_builtin_USAD8 + #define __USADA8 __iar_builtin_USADA8 + #define __SSAT16 __iar_builtin_SSAT16 + #define __USAT16 __iar_builtin_USAT16 + #define __UXTB16 __iar_builtin_UXTB16 + #define __UXTAB16 __iar_builtin_UXTAB16 + #define __SXTB16 __iar_builtin_SXTB16 + #define __SXTAB16 __iar_builtin_SXTAB16 + #define __SMUAD __iar_builtin_SMUAD + #define __SMUADX __iar_builtin_SMUADX + #define __SMMLA __iar_builtin_SMMLA + #define __SMLAD __iar_builtin_SMLAD + #define __SMLADX __iar_builtin_SMLADX + #define __SMLALD __iar_builtin_SMLALD + #define __SMLALDX __iar_builtin_SMLALDX + #define __SMUSD __iar_builtin_SMUSD + #define __SMUSDX __iar_builtin_SMUSDX + #define __SMLSD __iar_builtin_SMLSD + #define __SMLSDX __iar_builtin_SMLSDX + #define __SMLSLD __iar_builtin_SMLSLD + #define __SMLSLDX __iar_builtin_SMLSLDX + #define __SEL __iar_builtin_SEL + #define __QADD __iar_builtin_QADD + #define __QSUB __iar_builtin_QSUB + #define __PKHBT __iar_builtin_PKHBT + #define __PKHTB __iar_builtin_PKHTB + #endif + +#else /* __ICCARM_INTRINSICS_VERSION__ == 2 */ + + #if __IAR_M0_FAMILY + /* Avoid clash between intrinsics.h and arm_math.h when compiling for Cortex-M0. */ + #define __CLZ __cmsis_iar_clz_not_active + #define __SSAT __cmsis_iar_ssat_not_active + #define __USAT __cmsis_iar_usat_not_active + #define __RBIT __cmsis_iar_rbit_not_active + #define __get_APSR __cmsis_iar_get_APSR_not_active + #endif + + + #if (!((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) )) + #define __get_FPSCR __cmsis_iar_get_FPSR_not_active + #define __set_FPSCR __cmsis_iar_set_FPSR_not_active + #endif + + #ifdef __INTRINSICS_INCLUDED + #error intrinsics.h is already included previously! + #endif + + #include + + #if __IAR_M0_FAMILY + /* Avoid clash between intrinsics.h and arm_math.h when compiling for Cortex-M0. */ + #undef __CLZ + #undef __SSAT + #undef __USAT + #undef __RBIT + #undef __get_APSR + + __STATIC_INLINE uint8_t __CLZ(uint32_t data) + { + if (data == 0U) { return 32U; } + + uint32_t count = 0U; + uint32_t mask = 0x80000000U; + + while ((data & mask) == 0U) + { + count += 1U; + mask = mask >> 1U; + } + return count; + } + + __STATIC_INLINE uint32_t __RBIT(uint32_t v) + { + uint8_t sc = 31U; + uint32_t r = v; + for (v >>= 1U; v; v >>= 1U) + { + r <<= 1U; + r |= v & 1U; + sc--; + } + return (r << sc); + } + + __STATIC_INLINE uint32_t __get_APSR(void) + { + uint32_t res; + __asm("MRS %0,APSR" : "=r" (res)); + return res; + } + + #endif + + #if (!((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) )) + #undef __get_FPSCR + #undef __set_FPSCR + #define __get_FPSCR() (0) + #define __set_FPSCR(VALUE) ((void)VALUE) + #endif + + #pragma diag_suppress=Pe940 + #pragma diag_suppress=Pe177 + + #define __enable_irq __enable_interrupt + #define __disable_irq __disable_interrupt + #define __NOP __no_operation + + #define __get_xPSR __get_PSR + + #if (!defined(__ARM_ARCH_6M__) || __ARM_ARCH_6M__==0) + + __IAR_FT uint32_t __LDREXW(uint32_t volatile *ptr) + { + return __LDREX((unsigned long *)ptr); + } + + __IAR_FT uint32_t __STREXW(uint32_t value, uint32_t volatile *ptr) + { + return __STREX(value, (unsigned long *)ptr); + } + #endif + + + /* __CORTEX_M is defined in core_cm0.h, core_cm3.h and core_cm4.h. */ + #if (__CORTEX_M >= 0x03) + + __IAR_FT uint32_t __RRX(uint32_t value) + { + uint32_t result; + __ASM volatile("RRX %0, %1" : "=r"(result) : "r" (value)); + return(result); + } + + __IAR_FT void __set_BASEPRI_MAX(uint32_t value) + { + __asm volatile("MSR BASEPRI_MAX,%0"::"r" (value)); + } + + + #define __enable_fault_irq __enable_fiq + #define __disable_fault_irq __disable_fiq + + + #endif /* (__CORTEX_M >= 0x03) */ + + __IAR_FT uint32_t __ROR(uint32_t op1, uint32_t op2) + { + return (op1 >> op2) | (op1 << ((sizeof(op1)*8)-op2)); + } + + #if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) + + __IAR_FT uint32_t __get_MSPLIM(void) + { + uint32_t res; + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + res = 0U; + #else + __asm volatile("MRS %0,MSPLIM" : "=r" (res)); + #endif + return res; + } + + __IAR_FT void __set_MSPLIM(uint32_t value) + { + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)value; + #else + __asm volatile("MSR MSPLIM,%0" :: "r" (value)); + #endif + } + + __IAR_FT uint32_t __get_PSPLIM(void) + { + uint32_t res; + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + res = 0U; + #else + __asm volatile("MRS %0,PSPLIM" : "=r" (res)); + #endif + return res; + } + + __IAR_FT void __set_PSPLIM(uint32_t value) + { + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)value; + #else + __asm volatile("MSR PSPLIM,%0" :: "r" (value)); + #endif + } + + __IAR_FT uint32_t __TZ_get_CONTROL_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,CONTROL_NS" : "=r" (res)); + return res; + } + + __IAR_FT void __TZ_set_CONTROL_NS(uint32_t value) + { + __asm volatile("MSR CONTROL_NS,%0" :: "r" (value)); + } + + __IAR_FT uint32_t __TZ_get_PSP_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,PSP_NS" : "=r" (res)); + return res; + } + + __IAR_FT void __TZ_set_PSP_NS(uint32_t value) + { + __asm volatile("MSR PSP_NS,%0" :: "r" (value)); + } + + __IAR_FT uint32_t __TZ_get_MSP_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,MSP_NS" : "=r" (res)); + return res; + } + + __IAR_FT void __TZ_set_MSP_NS(uint32_t value) + { + __asm volatile("MSR MSP_NS,%0" :: "r" (value)); + } + + __IAR_FT uint32_t __TZ_get_SP_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,SP_NS" : "=r" (res)); + return res; + } + __IAR_FT void __TZ_set_SP_NS(uint32_t value) + { + __asm volatile("MSR SP_NS,%0" :: "r" (value)); + } + + __IAR_FT uint32_t __TZ_get_PRIMASK_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,PRIMASK_NS" : "=r" (res)); + return res; + } + + __IAR_FT void __TZ_set_PRIMASK_NS(uint32_t value) + { + __asm volatile("MSR PRIMASK_NS,%0" :: "r" (value)); + } + + __IAR_FT uint32_t __TZ_get_BASEPRI_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,BASEPRI_NS" : "=r" (res)); + return res; + } + + __IAR_FT void __TZ_set_BASEPRI_NS(uint32_t value) + { + __asm volatile("MSR BASEPRI_NS,%0" :: "r" (value)); + } + + __IAR_FT uint32_t __TZ_get_FAULTMASK_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,FAULTMASK_NS" : "=r" (res)); + return res; + } + + __IAR_FT void __TZ_set_FAULTMASK_NS(uint32_t value) + { + __asm volatile("MSR FAULTMASK_NS,%0" :: "r" (value)); + } + + __IAR_FT uint32_t __TZ_get_PSPLIM_NS(void) + { + uint32_t res; + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + res = 0U; + #else + __asm volatile("MRS %0,PSPLIM_NS" : "=r" (res)); + #endif + return res; + } + + __IAR_FT void __TZ_set_PSPLIM_NS(uint32_t value) + { + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)value; + #else + __asm volatile("MSR PSPLIM_NS,%0" :: "r" (value)); + #endif + } + + __IAR_FT uint32_t __TZ_get_MSPLIM_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,MSPLIM_NS" : "=r" (res)); + return res; + } + + __IAR_FT void __TZ_set_MSPLIM_NS(uint32_t value) + { + __asm volatile("MSR MSPLIM_NS,%0" :: "r" (value)); + } + + #endif /* __ARM_ARCH_8M_MAIN__ or __ARM_ARCH_8M_BASE__ */ + +#endif /* __ICCARM_INTRINSICS_VERSION__ == 2 */ + +#define __BKPT(value) __asm volatile ("BKPT %0" : : "i"(value)) + +#if __IAR_M0_FAMILY + __STATIC_INLINE int32_t __SSAT(int32_t val, uint32_t sat) + { + if ((sat >= 1U) && (sat <= 32U)) + { + const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); + const int32_t min = -1 - max ; + if (val > max) + { + return max; + } + else if (val < min) + { + return min; + } + } + return val; + } + + __STATIC_INLINE uint32_t __USAT(int32_t val, uint32_t sat) + { + if (sat <= 31U) + { + const uint32_t max = ((1U << sat) - 1U); + if (val > (int32_t)max) + { + return max; + } + else if (val < 0) + { + return 0U; + } + } + return (uint32_t)val; + } +#endif + +#if (__CORTEX_M >= 0x03) /* __CORTEX_M is defined in core_cm0.h, core_cm3.h and core_cm4.h. */ + + __IAR_FT uint8_t __LDRBT(volatile uint8_t *addr) + { + uint32_t res; + __ASM volatile ("LDRBT %0, [%1]" : "=r" (res) : "r" (addr) : "memory"); + return ((uint8_t)res); + } + + __IAR_FT uint16_t __LDRHT(volatile uint16_t *addr) + { + uint32_t res; + __ASM volatile ("LDRHT %0, [%1]" : "=r" (res) : "r" (addr) : "memory"); + return ((uint16_t)res); + } + + __IAR_FT uint32_t __LDRT(volatile uint32_t *addr) + { + uint32_t res; + __ASM volatile ("LDRT %0, [%1]" : "=r" (res) : "r" (addr) : "memory"); + return res; + } + + __IAR_FT void __STRBT(uint8_t value, volatile uint8_t *addr) + { + __ASM volatile ("STRBT %1, [%0]" : : "r" (addr), "r" ((uint32_t)value) : "memory"); + } + + __IAR_FT void __STRHT(uint16_t value, volatile uint16_t *addr) + { + __ASM volatile ("STRHT %1, [%0]" : : "r" (addr), "r" ((uint32_t)value) : "memory"); + } + + __IAR_FT void __STRT(uint32_t value, volatile uint32_t *addr) + { + __ASM volatile ("STRT %1, [%0]" : : "r" (addr), "r" (value) : "memory"); + } + +#endif /* (__CORTEX_M >= 0x03) */ + +#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) + + + __IAR_FT uint8_t __LDAB(volatile uint8_t *ptr) + { + uint32_t res; + __ASM volatile ("LDAB %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); + return ((uint8_t)res); + } + + __IAR_FT uint16_t __LDAH(volatile uint16_t *ptr) + { + uint32_t res; + __ASM volatile ("LDAH %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); + return ((uint16_t)res); + } + + __IAR_FT uint32_t __LDA(volatile uint32_t *ptr) + { + uint32_t res; + __ASM volatile ("LDA %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); + return res; + } + + __IAR_FT void __STLB(uint8_t value, volatile uint8_t *ptr) + { + __ASM volatile ("STLB %1, [%0]" :: "r" (ptr), "r" (value) : "memory"); + } + + __IAR_FT void __STLH(uint16_t value, volatile uint16_t *ptr) + { + __ASM volatile ("STLH %1, [%0]" :: "r" (ptr), "r" (value) : "memory"); + } + + __IAR_FT void __STL(uint32_t value, volatile uint32_t *ptr) + { + __ASM volatile ("STL %1, [%0]" :: "r" (ptr), "r" (value) : "memory"); + } + + __IAR_FT uint8_t __LDAEXB(volatile uint8_t *ptr) + { + uint32_t res; + __ASM volatile ("LDAEXB %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); + return ((uint8_t)res); + } + + __IAR_FT uint16_t __LDAEXH(volatile uint16_t *ptr) + { + uint32_t res; + __ASM volatile ("LDAEXH %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); + return ((uint16_t)res); + } + + __IAR_FT uint32_t __LDAEX(volatile uint32_t *ptr) + { + uint32_t res; + __ASM volatile ("LDAEX %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); + return res; + } + + __IAR_FT uint32_t __STLEXB(uint8_t value, volatile uint8_t *ptr) + { + uint32_t res; + __ASM volatile ("STLEXB %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory"); + return res; + } + + __IAR_FT uint32_t __STLEXH(uint16_t value, volatile uint16_t *ptr) + { + uint32_t res; + __ASM volatile ("STLEXH %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory"); + return res; + } + + __IAR_FT uint32_t __STLEX(uint32_t value, volatile uint32_t *ptr) + { + uint32_t res; + __ASM volatile ("STLEX %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory"); + return res; + } + +#endif /* __ARM_ARCH_8M_MAIN__ or __ARM_ARCH_8M_BASE__ */ + +#undef __IAR_FT +#undef __IAR_M0_FAMILY +#undef __ICCARM_V8 + +#pragma diag_default=Pe940 +#pragma diag_default=Pe177 + +#define __SXTB16_RORn(ARG1, ARG2) __SXTB16(__ROR(ARG1, ARG2)) + +#endif /* __CMSIS_ICCARM_H__ */ diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/inc/cmsis_version.h b/port/ucontroller/nxp/lpc17xx/bootloader/inc/cmsis_version.h new file mode 100644 index 000000000..2f048e455 --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/inc/cmsis_version.h @@ -0,0 +1,39 @@ +/**************************************************************************//** + * @file cmsis_version.h + * @brief CMSIS Core(M) Version definitions + * @version V5.0.4 + * @date 23. July 2019 + ******************************************************************************/ +/* + * Copyright (c) 2009-2019 ARM Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CMSIS_VERSION_H +#define __CMSIS_VERSION_H + +/* CMSIS Version definitions */ +#define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */ +#define __CM_CMSIS_VERSION_SUB ( 4U) /*!< [15:0] CMSIS Core(M) sub version */ +#define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \ + __CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */ +#endif diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/inc/core_cm3.h b/port/ucontroller/nxp/lpc17xx/bootloader/inc/core_cm3.h new file mode 100644 index 000000000..e568fa38e --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/inc/core_cm3.h @@ -0,0 +1,1938 @@ +/**************************************************************************//** + * @file core_cm3.h + * @brief CMSIS Cortex-M3 Core Peripheral Access Layer Header File + * @version V5.1.1 + * @date 19. August 2019 + ******************************************************************************/ +/* + * Copyright (c) 2009-2019 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_CM3_H_GENERIC +#define __CORE_CM3_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex_M3 + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS CM3 definitions */ +#define __CM3_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __CM3_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __CM3_CMSIS_VERSION ((__CM3_CMSIS_VERSION_MAIN << 16U) | \ + __CM3_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_M (3U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + This core does not support an FPU at all +*/ +#define __FPU_USED 0U + +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_FP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM3_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_CM3_H_DEPENDANT +#define __CORE_CM3_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __CM3_REV + #define __CM3_REV 0x0200U + #warning "__CM3_REV not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 3U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group Cortex_M3 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:27; /*!< bit: 0..26 Reserved */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + +#define APSR_Q_Pos 27U /*!< APSR: Q Position */ +#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:1; /*!< bit: 9 Reserved */ + uint32_t ICI_IT_1:6; /*!< bit: 10..15 ICI/IT part 1 */ + uint32_t _reserved1:8; /*!< bit: 16..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit */ + uint32_t ICI_IT_2:2; /*!< bit: 25..26 ICI/IT part 2 */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_Q_Pos 27U /*!< xPSR: Q Position */ +#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ + +#define xPSR_ICI_IT_2_Pos 25U /*!< xPSR: ICI/IT part 2 Position */ +#define xPSR_ICI_IT_2_Msk (3UL << xPSR_ICI_IT_2_Pos) /*!< xPSR: ICI/IT part 2 Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_ICI_IT_1_Pos 10U /*!< xPSR: ICI/IT part 1 Position */ +#define xPSR_ICI_IT_1_Msk (0x3FUL << xPSR_ICI_IT_1_Pos) /*!< xPSR: ICI/IT part 1 Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ + uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[8U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[24U]; + __IOM uint32_t ICER[8U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RESERVED1[24U]; + __IOM uint32_t ISPR[8U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[24U]; + __IOM uint32_t ICPR[8U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[24U]; + __IOM uint32_t IABR[8U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[56U]; + __IOM uint8_t IP[240U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ + uint32_t RESERVED5[644U]; + __OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ +} NVIC_Type; + +/* Software Triggered Interrupt Register Definitions */ +#define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */ +#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + __IOM uint8_t SHP[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ + __IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ + __IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ + __IOM uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ + __IOM uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ + __IOM uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ + __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ + __IM uint32_t PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ + __IM uint32_t DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ + __IM uint32_t ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __IM uint32_t MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ + __IM uint32_t ISAR[5U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ + uint32_t RESERVED0[5U]; + __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */ +#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Vector Table Offset Register Definitions */ +#if defined (__CM3_REV) && (__CM3_REV < 0x0201U) /* core r2p1 */ +#define SCB_VTOR_TBLBASE_Pos 29U /*!< SCB VTOR: TBLBASE Position */ +#define SCB_VTOR_TBLBASE_Msk (1UL << SCB_VTOR_TBLBASE_Pos) /*!< SCB VTOR: TBLBASE Mask */ + +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x3FFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ +#else +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ +#endif + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */ +#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +#define SCB_AIRCR_VECTRESET_Pos 0U /*!< SCB AIRCR: VECTRESET Position */ +#define SCB_AIRCR_VECTRESET_Msk (1UL /*<< SCB_AIRCR_VECTRESET_Pos*/) /*!< SCB AIRCR: VECTRESET Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */ +#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +#define SCB_CCR_NONBASETHRDENA_Pos 0U /*!< SCB CCR: NONBASETHRDENA Position */ +#define SCB_CCR_NONBASETHRDENA_Msk (1UL /*<< SCB_CCR_NONBASETHRDENA_Pos*/) /*!< SCB CCR: NONBASETHRDENA Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_USGFAULTENA_Pos 18U /*!< SCB SHCSR: USGFAULTENA Position */ +#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ + +#define SCB_SHCSR_BUSFAULTENA_Pos 17U /*!< SCB SHCSR: BUSFAULTENA Position */ +#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ + +#define SCB_SHCSR_MEMFAULTENA_Pos 16U /*!< SCB SHCSR: MEMFAULTENA Position */ +#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_BUSFAULTPENDED_Pos 14U /*!< SCB SHCSR: BUSFAULTPENDED Position */ +#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ + +#define SCB_SHCSR_MEMFAULTPENDED_Pos 13U /*!< SCB SHCSR: MEMFAULTPENDED Position */ +#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ + +#define SCB_SHCSR_USGFAULTPENDED_Pos 12U /*!< SCB SHCSR: USGFAULTPENDED Position */ +#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_MONITORACT_Pos 8U /*!< SCB SHCSR: MONITORACT Position */ +#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_USGFAULTACT_Pos 3U /*!< SCB SHCSR: USGFAULTACT Position */ +#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ + +#define SCB_SHCSR_BUSFAULTACT_Pos 1U /*!< SCB SHCSR: BUSFAULTACT Position */ +#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ + +#define SCB_SHCSR_MEMFAULTACT_Pos 0U /*!< SCB SHCSR: MEMFAULTACT Position */ +#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ + +/* SCB Configurable Fault Status Register Definitions */ +#define SCB_CFSR_USGFAULTSR_Pos 16U /*!< SCB CFSR: Usage Fault Status Register Position */ +#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ + +#define SCB_CFSR_BUSFAULTSR_Pos 8U /*!< SCB CFSR: Bus Fault Status Register Position */ +#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ + +#define SCB_CFSR_MEMFAULTSR_Pos 0U /*!< SCB CFSR: Memory Manage Fault Status Register Position */ +#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ + +/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ + +#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ + +#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ + +#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ + +#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ + +/* BusFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U) /*!< SCB CFSR (BFSR): BFARVALID Position */ +#define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos) /*!< SCB CFSR (BFSR): BFARVALID Mask */ + +#define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U) /*!< SCB CFSR (BFSR): STKERR Position */ +#define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos) /*!< SCB CFSR (BFSR): STKERR Mask */ + +#define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U) /*!< SCB CFSR (BFSR): UNSTKERR Position */ +#define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos) /*!< SCB CFSR (BFSR): UNSTKERR Mask */ + +#define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U) /*!< SCB CFSR (BFSR): IMPRECISERR Position */ +#define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos) /*!< SCB CFSR (BFSR): IMPRECISERR Mask */ + +#define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U) /*!< SCB CFSR (BFSR): PRECISERR Position */ +#define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos) /*!< SCB CFSR (BFSR): PRECISERR Mask */ + +#define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U) /*!< SCB CFSR (BFSR): IBUSERR Position */ +#define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos) /*!< SCB CFSR (BFSR): IBUSERR Mask */ + +/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U) /*!< SCB CFSR (UFSR): DIVBYZERO Position */ +#define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos) /*!< SCB CFSR (UFSR): DIVBYZERO Mask */ + +#define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U) /*!< SCB CFSR (UFSR): UNALIGNED Position */ +#define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos) /*!< SCB CFSR (UFSR): UNALIGNED Mask */ + +#define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U) /*!< SCB CFSR (UFSR): NOCP Position */ +#define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos) /*!< SCB CFSR (UFSR): NOCP Mask */ + +#define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U) /*!< SCB CFSR (UFSR): INVPC Position */ +#define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos) /*!< SCB CFSR (UFSR): INVPC Mask */ + +#define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U) /*!< SCB CFSR (UFSR): INVSTATE Position */ +#define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos) /*!< SCB CFSR (UFSR): INVSTATE Mask */ + +#define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U) /*!< SCB CFSR (UFSR): UNDEFINSTR Position */ +#define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos) /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */ + +/* SCB Hard Fault Status Register Definitions */ +#define SCB_HFSR_DEBUGEVT_Pos 31U /*!< SCB HFSR: DEBUGEVT Position */ +#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ + +#define SCB_HFSR_FORCED_Pos 30U /*!< SCB HFSR: FORCED Position */ +#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ + +#define SCB_HFSR_VECTTBL_Pos 1U /*!< SCB HFSR: VECTTBL Position */ +#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ + +/* SCB Debug Fault Status Register Definitions */ +#define SCB_DFSR_EXTERNAL_Pos 4U /*!< SCB DFSR: EXTERNAL Position */ +#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ + +#define SCB_DFSR_VCATCH_Pos 3U /*!< SCB DFSR: VCATCH Position */ +#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ + +#define SCB_DFSR_DWTTRAP_Pos 2U /*!< SCB DFSR: DWTTRAP Position */ +#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ + +#define SCB_DFSR_BKPT_Pos 1U /*!< SCB DFSR: BKPT Position */ +#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ + +#define SCB_DFSR_HALTED_Pos 0U /*!< SCB DFSR: HALTED Position */ +#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) + \brief Type definitions for the System Control and ID Register not in the SCB + @{ + */ + +/** + \brief Structure type to access the System Control and ID Register not in the SCB. + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ +#if defined (__CM3_REV) && (__CM3_REV >= 0x200U) + __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ +#else + uint32_t RESERVED1[1U]; +#endif +} SCnSCB_Type; + +/* Interrupt Controller Type Register Definitions */ +#define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ +#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ + +/* Auxiliary Control Register Definitions */ +#if defined (__CM3_REV) && (__CM3_REV >= 0x200U) +#define SCnSCB_ACTLR_DISOOFP_Pos 9U /*!< ACTLR: DISOOFP Position */ +#define SCnSCB_ACTLR_DISOOFP_Msk (1UL << SCnSCB_ACTLR_DISOOFP_Pos) /*!< ACTLR: DISOOFP Mask */ + +#define SCnSCB_ACTLR_DISFPCA_Pos 8U /*!< ACTLR: DISFPCA Position */ +#define SCnSCB_ACTLR_DISFPCA_Msk (1UL << SCnSCB_ACTLR_DISFPCA_Pos) /*!< ACTLR: DISFPCA Mask */ + +#define SCnSCB_ACTLR_DISFOLD_Pos 2U /*!< ACTLR: DISFOLD Position */ +#define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) /*!< ACTLR: DISFOLD Mask */ + +#define SCnSCB_ACTLR_DISDEFWBUF_Pos 1U /*!< ACTLR: DISDEFWBUF Position */ +#define SCnSCB_ACTLR_DISDEFWBUF_Msk (1UL << SCnSCB_ACTLR_DISDEFWBUF_Pos) /*!< ACTLR: DISDEFWBUF Mask */ + +#define SCnSCB_ACTLR_DISMCYCINT_Pos 0U /*!< ACTLR: DISMCYCINT Position */ +#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/) /*!< ACTLR: DISMCYCINT Mask */ +#endif + +/*@} end of group CMSIS_SCnotSCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) + \brief Type definitions for the Instrumentation Trace Macrocell (ITM) + @{ + */ + +/** + \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). + */ +typedef struct +{ + __OM union + { + __OM uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ + __OM uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ + __OM uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ + } PORT [32U]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ + uint32_t RESERVED0[864U]; + __IOM uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ + uint32_t RESERVED1[15U]; + __IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ + uint32_t RESERVED2[15U]; + __IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ + uint32_t RESERVED3[32U]; + uint32_t RESERVED4[43U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ + uint32_t RESERVED5[6U]; + __IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ + __IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ + __IM uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ + __IM uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ + __IM uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ + __IM uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ + __IM uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ + __IM uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ + __IM uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ + __IM uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ + __IM uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ + __IM uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ +} ITM_Type; + +/* ITM Trace Privilege Register Definitions */ +#define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */ +#define ITM_TPR_PRIVMASK_Msk (0xFFFFFFFFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ + +/* ITM Trace Control Register Definitions */ +#define ITM_TCR_BUSY_Pos 23U /*!< ITM TCR: BUSY Position */ +#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ + +#define ITM_TCR_TraceBusID_Pos 16U /*!< ITM TCR: ATBID Position */ +#define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) /*!< ITM TCR: ATBID Mask */ + +#define ITM_TCR_GTSFREQ_Pos 10U /*!< ITM TCR: Global timestamp frequency Position */ +#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ + +#define ITM_TCR_TSPrescale_Pos 8U /*!< ITM TCR: TSPrescale Position */ +#define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */ + +#define ITM_TCR_SWOENA_Pos 4U /*!< ITM TCR: SWOENA Position */ +#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ + +#define ITM_TCR_DWTENA_Pos 3U /*!< ITM TCR: DWTENA Position */ +#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ + +#define ITM_TCR_SYNCENA_Pos 2U /*!< ITM TCR: SYNCENA Position */ +#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ + +#define ITM_TCR_TSENA_Pos 1U /*!< ITM TCR: TSENA Position */ +#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ + +#define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */ +#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ + +/* ITM Lock Status Register Definitions */ +#define ITM_LSR_ByteAcc_Pos 2U /*!< ITM LSR: ByteAcc Position */ +#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ + +#define ITM_LSR_Access_Pos 1U /*!< ITM LSR: Access Position */ +#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ + +#define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */ +#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ + +/*@}*/ /* end of group CMSIS_ITM */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) + \brief Type definitions for the Data Watchpoint and Trace (DWT) + @{ + */ + +/** + \brief Structure type to access the Data Watchpoint and Trace Register (DWT). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + __IOM uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ + __IOM uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ + __IOM uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ + __IOM uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ + __IOM uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ + __IOM uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ + __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + __IOM uint32_t MASK0; /*!< Offset: 0x024 (R/W) Mask Register 0 */ + __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED0[1U]; + __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + __IOM uint32_t MASK1; /*!< Offset: 0x034 (R/W) Mask Register 1 */ + __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + uint32_t RESERVED1[1U]; + __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + __IOM uint32_t MASK2; /*!< Offset: 0x044 (R/W) Mask Register 2 */ + __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + __IOM uint32_t MASK3; /*!< Offset: 0x054 (R/W) Mask Register 3 */ + __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +#define DWT_CTRL_CYCEVTENA_Pos 22U /*!< DWT CTRL: CYCEVTENA Position */ +#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ + +#define DWT_CTRL_FOLDEVTENA_Pos 21U /*!< DWT CTRL: FOLDEVTENA Position */ +#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ + +#define DWT_CTRL_LSUEVTENA_Pos 20U /*!< DWT CTRL: LSUEVTENA Position */ +#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ + +#define DWT_CTRL_SLEEPEVTENA_Pos 19U /*!< DWT CTRL: SLEEPEVTENA Position */ +#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ + +#define DWT_CTRL_EXCEVTENA_Pos 18U /*!< DWT CTRL: EXCEVTENA Position */ +#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ + +#define DWT_CTRL_CPIEVTENA_Pos 17U /*!< DWT CTRL: CPIEVTENA Position */ +#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ + +#define DWT_CTRL_EXCTRCENA_Pos 16U /*!< DWT CTRL: EXCTRCENA Position */ +#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ + +#define DWT_CTRL_PCSAMPLENA_Pos 12U /*!< DWT CTRL: PCSAMPLENA Position */ +#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ + +#define DWT_CTRL_SYNCTAP_Pos 10U /*!< DWT CTRL: SYNCTAP Position */ +#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ + +#define DWT_CTRL_CYCTAP_Pos 9U /*!< DWT CTRL: CYCTAP Position */ +#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ + +#define DWT_CTRL_POSTINIT_Pos 5U /*!< DWT CTRL: POSTINIT Position */ +#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ + +#define DWT_CTRL_POSTPRESET_Pos 1U /*!< DWT CTRL: POSTPRESET Position */ +#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ + +#define DWT_CTRL_CYCCNTENA_Pos 0U /*!< DWT CTRL: CYCCNTENA Position */ +#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ + +/* DWT CPI Count Register Definitions */ +#define DWT_CPICNT_CPICNT_Pos 0U /*!< DWT CPICNT: CPICNT Position */ +#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ + +/* DWT Exception Overhead Count Register Definitions */ +#define DWT_EXCCNT_EXCCNT_Pos 0U /*!< DWT EXCCNT: EXCCNT Position */ +#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ + +/* DWT Sleep Count Register Definitions */ +#define DWT_SLEEPCNT_SLEEPCNT_Pos 0U /*!< DWT SLEEPCNT: SLEEPCNT Position */ +#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ + +/* DWT LSU Count Register Definitions */ +#define DWT_LSUCNT_LSUCNT_Pos 0U /*!< DWT LSUCNT: LSUCNT Position */ +#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ + +/* DWT Folded-instruction Count Register Definitions */ +#define DWT_FOLDCNT_FOLDCNT_Pos 0U /*!< DWT FOLDCNT: FOLDCNT Position */ +#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ + +/* DWT Comparator Mask Register Definitions */ +#define DWT_MASK_MASK_Pos 0U /*!< DWT MASK: MASK Position */ +#define DWT_MASK_MASK_Msk (0x1FUL /*<< DWT_MASK_MASK_Pos*/) /*!< DWT MASK: MASK Mask */ + +/* DWT Comparator Function Register Definitions */ +#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVADDR1_Pos 16U /*!< DWT FUNCTION: DATAVADDR1 Position */ +#define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos) /*!< DWT FUNCTION: DATAVADDR1 Mask */ + +#define DWT_FUNCTION_DATAVADDR0_Pos 12U /*!< DWT FUNCTION: DATAVADDR0 Position */ +#define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos) /*!< DWT FUNCTION: DATAVADDR0 Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_LNK1ENA_Pos 9U /*!< DWT FUNCTION: LNK1ENA Position */ +#define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos) /*!< DWT FUNCTION: LNK1ENA Mask */ + +#define DWT_FUNCTION_DATAVMATCH_Pos 8U /*!< DWT FUNCTION: DATAVMATCH Position */ +#define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos) /*!< DWT FUNCTION: DATAVMATCH Mask */ + +#define DWT_FUNCTION_CYCMATCH_Pos 7U /*!< DWT FUNCTION: CYCMATCH Position */ +#define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos) /*!< DWT FUNCTION: CYCMATCH Mask */ + +#define DWT_FUNCTION_EMITRANGE_Pos 5U /*!< DWT FUNCTION: EMITRANGE Position */ +#define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos) /*!< DWT FUNCTION: EMITRANGE Mask */ + +#define DWT_FUNCTION_FUNCTION_Pos 0U /*!< DWT FUNCTION: FUNCTION Position */ +#define DWT_FUNCTION_FUNCTION_Msk (0xFUL /*<< DWT_FUNCTION_FUNCTION_Pos*/) /*!< DWT FUNCTION: FUNCTION Mask */ + +/*@}*/ /* end of group CMSIS_DWT */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_TPI Trace Port Interface (TPI) + \brief Type definitions for the Trace Port Interface (TPI) + @{ + */ + +/** + \brief Structure type to access the Trace Port Interface Register (TPI). + */ +typedef struct +{ + __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ + __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55U]; + __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131U]; + __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __IM uint32_t FSCR; /*!< Offset: 0x308 (R/ ) Formatter Synchronization Counter Register */ + uint32_t RESERVED3[759U]; + __IM uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER Register */ + __IM uint32_t FIFO0; /*!< Offset: 0xEEC (R/ ) Integration ETM Data */ + __IM uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/ ) ITATBCTR2 */ + uint32_t RESERVED4[1U]; + __IM uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) ITATBCTR0 */ + __IM uint32_t FIFO1; /*!< Offset: 0xEFC (R/ ) Integration ITM Data */ + __IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ + uint32_t RESERVED5[39U]; + __IOM uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ + __IOM uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ + uint32_t RESERVED7[8U]; + __IM uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) TPIU_DEVID */ + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) TPIU_DEVTYPE */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_PRESCALER_Pos 0U /*!< TPI ACPR: PRESCALER Position */ +#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ + +/* TPI Selected Pin Protocol Register Definitions */ +#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ +#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ + +/* TPI Formatter and Flush Status Register Definitions */ +#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ +#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ + +/* TPI Formatter and Flush Control Register Definitions */ +#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ +#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ + +/* TPI TRIGGER Register Definitions */ +#define TPI_TRIGGER_TRIGGER_Pos 0U /*!< TPI TRIGGER: TRIGGER Position */ +#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ + +/* TPI Integration ETM Data Register Definitions (FIFO0) */ +#define TPI_FIFO0_ITM_ATVALID_Pos 29U /*!< TPI FIFO0: ITM_ATVALID Position */ +#define TPI_FIFO0_ITM_ATVALID_Msk (0x1UL << TPI_FIFO0_ITM_ATVALID_Pos) /*!< TPI FIFO0: ITM_ATVALID Mask */ + +#define TPI_FIFO0_ITM_bytecount_Pos 27U /*!< TPI FIFO0: ITM_bytecount Position */ +#define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos) /*!< TPI FIFO0: ITM_bytecount Mask */ + +#define TPI_FIFO0_ETM_ATVALID_Pos 26U /*!< TPI FIFO0: ETM_ATVALID Position */ +#define TPI_FIFO0_ETM_ATVALID_Msk (0x1UL << TPI_FIFO0_ETM_ATVALID_Pos) /*!< TPI FIFO0: ETM_ATVALID Mask */ + +#define TPI_FIFO0_ETM_bytecount_Pos 24U /*!< TPI FIFO0: ETM_bytecount Position */ +#define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos) /*!< TPI FIFO0: ETM_bytecount Mask */ + +#define TPI_FIFO0_ETM2_Pos 16U /*!< TPI FIFO0: ETM2 Position */ +#define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos) /*!< TPI FIFO0: ETM2 Mask */ + +#define TPI_FIFO0_ETM1_Pos 8U /*!< TPI FIFO0: ETM1 Position */ +#define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos) /*!< TPI FIFO0: ETM1 Mask */ + +#define TPI_FIFO0_ETM0_Pos 0U /*!< TPI FIFO0: ETM0 Position */ +#define TPI_FIFO0_ETM0_Msk (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/) /*!< TPI FIFO0: ETM0 Mask */ + +/* TPI ITATBCTR2 Register Definitions */ +#define TPI_ITATBCTR2_ATREADY2_Pos 0U /*!< TPI ITATBCTR2: ATREADY2 Position */ +#define TPI_ITATBCTR2_ATREADY2_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY2_Pos*/) /*!< TPI ITATBCTR2: ATREADY2 Mask */ + +#define TPI_ITATBCTR2_ATREADY1_Pos 0U /*!< TPI ITATBCTR2: ATREADY1 Position */ +#define TPI_ITATBCTR2_ATREADY1_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY1_Pos*/) /*!< TPI ITATBCTR2: ATREADY1 Mask */ + +/* TPI Integration ITM Data Register Definitions (FIFO1) */ +#define TPI_FIFO1_ITM_ATVALID_Pos 29U /*!< TPI FIFO1: ITM_ATVALID Position */ +#define TPI_FIFO1_ITM_ATVALID_Msk (0x1UL << TPI_FIFO1_ITM_ATVALID_Pos) /*!< TPI FIFO1: ITM_ATVALID Mask */ + +#define TPI_FIFO1_ITM_bytecount_Pos 27U /*!< TPI FIFO1: ITM_bytecount Position */ +#define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos) /*!< TPI FIFO1: ITM_bytecount Mask */ + +#define TPI_FIFO1_ETM_ATVALID_Pos 26U /*!< TPI FIFO1: ETM_ATVALID Position */ +#define TPI_FIFO1_ETM_ATVALID_Msk (0x1UL << TPI_FIFO1_ETM_ATVALID_Pos) /*!< TPI FIFO1: ETM_ATVALID Mask */ + +#define TPI_FIFO1_ETM_bytecount_Pos 24U /*!< TPI FIFO1: ETM_bytecount Position */ +#define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos) /*!< TPI FIFO1: ETM_bytecount Mask */ + +#define TPI_FIFO1_ITM2_Pos 16U /*!< TPI FIFO1: ITM2 Position */ +#define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos) /*!< TPI FIFO1: ITM2 Mask */ + +#define TPI_FIFO1_ITM1_Pos 8U /*!< TPI FIFO1: ITM1 Position */ +#define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos) /*!< TPI FIFO1: ITM1 Mask */ + +#define TPI_FIFO1_ITM0_Pos 0U /*!< TPI FIFO1: ITM0 Position */ +#define TPI_FIFO1_ITM0_Msk (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/) /*!< TPI FIFO1: ITM0 Mask */ + +/* TPI ITATBCTR0 Register Definitions */ +#define TPI_ITATBCTR0_ATREADY2_Pos 0U /*!< TPI ITATBCTR0: ATREADY2 Position */ +#define TPI_ITATBCTR0_ATREADY2_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY2_Pos*/) /*!< TPI ITATBCTR0: ATREADY2 Mask */ + +#define TPI_ITATBCTR0_ATREADY1_Pos 0U /*!< TPI ITATBCTR0: ATREADY1 Position */ +#define TPI_ITATBCTR0_ATREADY1_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY1_Pos*/) /*!< TPI ITATBCTR0: ATREADY1 Mask */ + +/* TPI Integration Mode Control Register Definitions */ +#define TPI_ITCTRL_Mode_Pos 0U /*!< TPI ITCTRL: Mode Position */ +#define TPI_ITCTRL_Mode_Msk (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_MinBufSz_Pos 6U /*!< TPI DEVID: MinBufSz Position */ +#define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos) /*!< TPI DEVID: MinBufSz Mask */ + +#define TPI_DEVID_AsynClkIn_Pos 5U /*!< TPI DEVID: AsynClkIn Position */ +#define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos) /*!< TPI DEVID: AsynClkIn Mask */ + +#define TPI_DEVID_NrTraceInput_Pos 0U /*!< TPI DEVID: NrTraceInput Position */ +#define TPI_DEVID_NrTraceInput_Msk (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ + +/* TPI DEVTYPE Register Definitions */ +#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ + +#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ + __IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Alias 1 Region Base Address Register */ + __IOM uint32_t RASR_A1; /*!< Offset: 0x018 (R/W) MPU Alias 1 Region Attribute and Size Register */ + __IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Alias 2 Region Base Address Register */ + __IOM uint32_t RASR_A2; /*!< Offset: 0x020 (R/W) MPU Alias 2 Region Attribute and Size Register */ + __IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Alias 3 Region Base Address Register */ + __IOM uint32_t RASR_A3; /*!< Offset: 0x028 (R/W) MPU Alias 3 Region Attribute and Size Register */ +} MPU_Type; + +#define MPU_TYPE_RALIASES 4U + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_ADDR_Pos 5U /*!< MPU RBAR: ADDR Position */ +#define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ + +#define MPU_RBAR_VALID_Pos 4U /*!< MPU RBAR: VALID Position */ +#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ + +#define MPU_RBAR_REGION_Pos 0U /*!< MPU RBAR: REGION Position */ +#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */ + +/* MPU Region Attribute and Size Register Definitions */ +#define MPU_RASR_ATTRS_Pos 16U /*!< MPU RASR: MPU Region Attribute field Position */ +#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */ + +#define MPU_RASR_XN_Pos 28U /*!< MPU RASR: ATTRS.XN Position */ +#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */ + +#define MPU_RASR_AP_Pos 24U /*!< MPU RASR: ATTRS.AP Position */ +#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */ + +#define MPU_RASR_TEX_Pos 19U /*!< MPU RASR: ATTRS.TEX Position */ +#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */ + +#define MPU_RASR_S_Pos 18U /*!< MPU RASR: ATTRS.S Position */ +#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */ + +#define MPU_RASR_C_Pos 17U /*!< MPU RASR: ATTRS.C Position */ +#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */ + +#define MPU_RASR_B_Pos 16U /*!< MPU RASR: ATTRS.B Position */ +#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */ + +#define MPU_RASR_SRD_Pos 8U /*!< MPU RASR: Sub-Region Disable Position */ +#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ + +#define MPU_RASR_SIZE_Pos 1U /*!< MPU RASR: Region Size Field Position */ +#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */ + +#define MPU_RASR_ENABLE_Pos 0U /*!< MPU RASR: Region enable bit Position */ +#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */ + +/*@} end of group CMSIS_MPU */ +#endif + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Type definitions for the Core Debug Registers + @{ + */ + +/** + \brief Structure type to access the Core Debug Register (CoreDebug). + */ +typedef struct +{ + __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ +} CoreDebug_Type; + +/* Debug Halting Control and Status Register Definitions */ +#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */ +#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ + +#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */ +#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ + +#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ +#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ + +#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */ +#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ + +#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */ +#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ + +#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */ +#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ + +#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */ +#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ + +#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U /*!< CoreDebug DHCSR: C_SNAPSTALL Position */ +#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */ + +#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */ +#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ + +#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */ +#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ + +#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */ +#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ + +#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */ +#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ + +/* Debug Core Register Selector Register Definitions */ +#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */ +#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ + +#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */ +#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ + +/* Debug Exception and Monitor Control Register Definitions */ +#define CoreDebug_DEMCR_TRCENA_Pos 24U /*!< CoreDebug DEMCR: TRCENA Position */ +#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */ + +#define CoreDebug_DEMCR_MON_REQ_Pos 19U /*!< CoreDebug DEMCR: MON_REQ Position */ +#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */ + +#define CoreDebug_DEMCR_MON_STEP_Pos 18U /*!< CoreDebug DEMCR: MON_STEP Position */ +#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */ + +#define CoreDebug_DEMCR_MON_PEND_Pos 17U /*!< CoreDebug DEMCR: MON_PEND Position */ +#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */ + +#define CoreDebug_DEMCR_MON_EN_Pos 16U /*!< CoreDebug DEMCR: MON_EN Position */ +#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */ + +#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */ +#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ + +#define CoreDebug_DEMCR_VC_INTERR_Pos 9U /*!< CoreDebug DEMCR: VC_INTERR Position */ +#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */ + +#define CoreDebug_DEMCR_VC_BUSERR_Pos 8U /*!< CoreDebug DEMCR: VC_BUSERR Position */ +#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */ + +#define CoreDebug_DEMCR_VC_STATERR_Pos 7U /*!< CoreDebug DEMCR: VC_STATERR Position */ +#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */ + +#define CoreDebug_DEMCR_VC_CHKERR_Pos 6U /*!< CoreDebug DEMCR: VC_CHKERR Position */ +#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */ + +#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U /*!< CoreDebug DEMCR: VC_NOCPERR Position */ +#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */ + +#define CoreDebug_DEMCR_VC_MMERR_Pos 4U /*!< CoreDebug DEMCR: VC_MMERR Position */ +#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */ + +#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */ +#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ + +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ +#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ +#define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ +#define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ +#define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ +#define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ +#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ +#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ +#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + +#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ +#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ +#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ +#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ +#define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ +#define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ +#define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ +#define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ +#endif + +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Debug Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ + #define NVIC_GetActive __NVIC_GetActive + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* The following EXC_RETURN values are saved the LR on exception entry */ +#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */ +#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */ +#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */ + + +/** + \brief Set Priority Grouping + \details Sets the priority grouping field using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ + SCB->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping + \details Reads the priority grouping field from the NVIC Interrupt Controller. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void) +{ + return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + __COMPILER_BARRIER(); + NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __COMPILER_BARRIER(); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt + \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IP[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC->IP[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; + /* ARM Application Note 321 states that the M3 does not require the architectural barrier */ +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | + SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +/*@} end of CMSIS_Core_NVICFunctions */ + + +/* ########################## MPU functions #################################### */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + +#include "mpu_armv7.h" + +#endif + + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + return 0U; /* No FPU */ +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + +/* ##################################### Debug In/Output function ########################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_core_DebugFunctions ITM Functions + \brief Functions that access the ITM debug interface. + @{ + */ + +extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ +#define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ + + +/** + \brief ITM Send Character + \details Transmits a character via the ITM channel 0, and + \li Just returns when no debugger is connected that has booked the output. + \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. + \param [in] ch Character to transmit. + \returns Character to transmit. + */ +__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) +{ + if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ + ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ + { + while (ITM->PORT[0U].u32 == 0UL) + { + __NOP(); + } + ITM->PORT[0U].u8 = (uint8_t)ch; + } + return (ch); +} + + +/** + \brief ITM Receive Character + \details Inputs a character via the external variable \ref ITM_RxBuffer. + \return Received character. + \return -1 No character pending. + */ +__STATIC_INLINE int32_t ITM_ReceiveChar (void) +{ + int32_t ch = -1; /* no character available */ + + if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) + { + ch = ITM_RxBuffer; + ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ + } + + return (ch); +} + + +/** + \brief ITM Check Character + \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. + \return 0 No character available. + \return 1 Character available. + */ +__STATIC_INLINE int32_t ITM_CheckChar (void) +{ + + if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) + { + return (0); /* no character available */ + } + else + { + return (1); /* character available */ + } +} + +/*@} end of CMSIS_core_DebugFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM3_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/inc/mpu_armv7.h b/port/ucontroller/nxp/lpc17xx/bootloader/inc/mpu_armv7.h new file mode 100644 index 000000000..786bed7de --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/inc/mpu_armv7.h @@ -0,0 +1,272 @@ +/****************************************************************************** + * @file mpu_armv7.h + * @brief CMSIS MPU API for Armv7-M MPU + * @version V5.1.0 + * @date 08. March 2019 + ******************************************************************************/ +/* + * Copyright (c) 2017-2019 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef ARM_MPU_ARMV7_H +#define ARM_MPU_ARMV7_H + +#define ARM_MPU_REGION_SIZE_32B ((uint8_t)0x04U) ///!< MPU Region Size 32 Bytes +#define ARM_MPU_REGION_SIZE_64B ((uint8_t)0x05U) ///!< MPU Region Size 64 Bytes +#define ARM_MPU_REGION_SIZE_128B ((uint8_t)0x06U) ///!< MPU Region Size 128 Bytes +#define ARM_MPU_REGION_SIZE_256B ((uint8_t)0x07U) ///!< MPU Region Size 256 Bytes +#define ARM_MPU_REGION_SIZE_512B ((uint8_t)0x08U) ///!< MPU Region Size 512 Bytes +#define ARM_MPU_REGION_SIZE_1KB ((uint8_t)0x09U) ///!< MPU Region Size 1 KByte +#define ARM_MPU_REGION_SIZE_2KB ((uint8_t)0x0AU) ///!< MPU Region Size 2 KBytes +#define ARM_MPU_REGION_SIZE_4KB ((uint8_t)0x0BU) ///!< MPU Region Size 4 KBytes +#define ARM_MPU_REGION_SIZE_8KB ((uint8_t)0x0CU) ///!< MPU Region Size 8 KBytes +#define ARM_MPU_REGION_SIZE_16KB ((uint8_t)0x0DU) ///!< MPU Region Size 16 KBytes +#define ARM_MPU_REGION_SIZE_32KB ((uint8_t)0x0EU) ///!< MPU Region Size 32 KBytes +#define ARM_MPU_REGION_SIZE_64KB ((uint8_t)0x0FU) ///!< MPU Region Size 64 KBytes +#define ARM_MPU_REGION_SIZE_128KB ((uint8_t)0x10U) ///!< MPU Region Size 128 KBytes +#define ARM_MPU_REGION_SIZE_256KB ((uint8_t)0x11U) ///!< MPU Region Size 256 KBytes +#define ARM_MPU_REGION_SIZE_512KB ((uint8_t)0x12U) ///!< MPU Region Size 512 KBytes +#define ARM_MPU_REGION_SIZE_1MB ((uint8_t)0x13U) ///!< MPU Region Size 1 MByte +#define ARM_MPU_REGION_SIZE_2MB ((uint8_t)0x14U) ///!< MPU Region Size 2 MBytes +#define ARM_MPU_REGION_SIZE_4MB ((uint8_t)0x15U) ///!< MPU Region Size 4 MBytes +#define ARM_MPU_REGION_SIZE_8MB ((uint8_t)0x16U) ///!< MPU Region Size 8 MBytes +#define ARM_MPU_REGION_SIZE_16MB ((uint8_t)0x17U) ///!< MPU Region Size 16 MBytes +#define ARM_MPU_REGION_SIZE_32MB ((uint8_t)0x18U) ///!< MPU Region Size 32 MBytes +#define ARM_MPU_REGION_SIZE_64MB ((uint8_t)0x19U) ///!< MPU Region Size 64 MBytes +#define ARM_MPU_REGION_SIZE_128MB ((uint8_t)0x1AU) ///!< MPU Region Size 128 MBytes +#define ARM_MPU_REGION_SIZE_256MB ((uint8_t)0x1BU) ///!< MPU Region Size 256 MBytes +#define ARM_MPU_REGION_SIZE_512MB ((uint8_t)0x1CU) ///!< MPU Region Size 512 MBytes +#define ARM_MPU_REGION_SIZE_1GB ((uint8_t)0x1DU) ///!< MPU Region Size 1 GByte +#define ARM_MPU_REGION_SIZE_2GB ((uint8_t)0x1EU) ///!< MPU Region Size 2 GBytes +#define ARM_MPU_REGION_SIZE_4GB ((uint8_t)0x1FU) ///!< MPU Region Size 4 GBytes + +#define ARM_MPU_AP_NONE 0U ///!< MPU Access Permission no access +#define ARM_MPU_AP_PRIV 1U ///!< MPU Access Permission privileged access only +#define ARM_MPU_AP_URO 2U ///!< MPU Access Permission unprivileged access read-only +#define ARM_MPU_AP_FULL 3U ///!< MPU Access Permission full access +#define ARM_MPU_AP_PRO 5U ///!< MPU Access Permission privileged access read-only +#define ARM_MPU_AP_RO 6U ///!< MPU Access Permission read-only access + +/** MPU Region Base Address Register Value +* +* \param Region The region to be configured, number 0 to 15. +* \param BaseAddress The base address for the region. +*/ +#define ARM_MPU_RBAR(Region, BaseAddress) \ + (((BaseAddress) & MPU_RBAR_ADDR_Msk) | \ + ((Region) & MPU_RBAR_REGION_Msk) | \ + (MPU_RBAR_VALID_Msk)) + +/** +* MPU Memory Access Attributes +* +* \param TypeExtField Type extension field, allows you to configure memory access type, for example strongly ordered, peripheral. +* \param IsShareable Region is shareable between multiple bus masters. +* \param IsCacheable Region is cacheable, i.e. its value may be kept in cache. +* \param IsBufferable Region is bufferable, i.e. using write-back caching. Cacheable but non-bufferable regions use write-through policy. +*/ +#define ARM_MPU_ACCESS_(TypeExtField, IsShareable, IsCacheable, IsBufferable) \ + ((((TypeExtField) << MPU_RASR_TEX_Pos) & MPU_RASR_TEX_Msk) | \ + (((IsShareable) << MPU_RASR_S_Pos) & MPU_RASR_S_Msk) | \ + (((IsCacheable) << MPU_RASR_C_Pos) & MPU_RASR_C_Msk) | \ + (((IsBufferable) << MPU_RASR_B_Pos) & MPU_RASR_B_Msk)) + +/** +* MPU Region Attribute and Size Register Value +* +* \param DisableExec Instruction access disable bit, 1= disable instruction fetches. +* \param AccessPermission Data access permissions, allows you to configure read/write access for User and Privileged mode. +* \param AccessAttributes Memory access attribution, see \ref ARM_MPU_ACCESS_. +* \param SubRegionDisable Sub-region disable field. +* \param Size Region size of the region to be configured, for example 4K, 8K. +*/ +#define ARM_MPU_RASR_EX(DisableExec, AccessPermission, AccessAttributes, SubRegionDisable, Size) \ + ((((DisableExec) << MPU_RASR_XN_Pos) & MPU_RASR_XN_Msk) | \ + (((AccessPermission) << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk) | \ + (((AccessAttributes) & (MPU_RASR_TEX_Msk | MPU_RASR_S_Msk | MPU_RASR_C_Msk | MPU_RASR_B_Msk))) | \ + (((SubRegionDisable) << MPU_RASR_SRD_Pos) & MPU_RASR_SRD_Msk) | \ + (((Size) << MPU_RASR_SIZE_Pos) & MPU_RASR_SIZE_Msk) | \ + (((MPU_RASR_ENABLE_Msk)))) + +/** +* MPU Region Attribute and Size Register Value +* +* \param DisableExec Instruction access disable bit, 1= disable instruction fetches. +* \param AccessPermission Data access permissions, allows you to configure read/write access for User and Privileged mode. +* \param TypeExtField Type extension field, allows you to configure memory access type, for example strongly ordered, peripheral. +* \param IsShareable Region is shareable between multiple bus masters. +* \param IsCacheable Region is cacheable, i.e. its value may be kept in cache. +* \param IsBufferable Region is bufferable, i.e. using write-back caching. Cacheable but non-bufferable regions use write-through policy. +* \param SubRegionDisable Sub-region disable field. +* \param Size Region size of the region to be configured, for example 4K, 8K. +*/ +#define ARM_MPU_RASR(DisableExec, AccessPermission, TypeExtField, IsShareable, IsCacheable, IsBufferable, SubRegionDisable, Size) \ + ARM_MPU_RASR_EX(DisableExec, AccessPermission, ARM_MPU_ACCESS_(TypeExtField, IsShareable, IsCacheable, IsBufferable), SubRegionDisable, Size) + +/** +* MPU Memory Access Attribute for strongly ordered memory. +* - TEX: 000b +* - Shareable +* - Non-cacheable +* - Non-bufferable +*/ +#define ARM_MPU_ACCESS_ORDERED ARM_MPU_ACCESS_(0U, 1U, 0U, 0U) + +/** +* MPU Memory Access Attribute for device memory. +* - TEX: 000b (if shareable) or 010b (if non-shareable) +* - Shareable or non-shareable +* - Non-cacheable +* - Bufferable (if shareable) or non-bufferable (if non-shareable) +* +* \param IsShareable Configures the device memory as shareable or non-shareable. +*/ +#define ARM_MPU_ACCESS_DEVICE(IsShareable) ((IsShareable) ? ARM_MPU_ACCESS_(0U, 1U, 0U, 1U) : ARM_MPU_ACCESS_(2U, 0U, 0U, 0U)) + +/** +* MPU Memory Access Attribute for normal memory. +* - TEX: 1BBb (reflecting outer cacheability rules) +* - Shareable or non-shareable +* - Cacheable or non-cacheable (reflecting inner cacheability rules) +* - Bufferable or non-bufferable (reflecting inner cacheability rules) +* +* \param OuterCp Configures the outer cache policy. +* \param InnerCp Configures the inner cache policy. +* \param IsShareable Configures the memory as shareable or non-shareable. +*/ +#define ARM_MPU_ACCESS_NORMAL(OuterCp, InnerCp, IsShareable) ARM_MPU_ACCESS_((4U | (OuterCp)), IsShareable, ((InnerCp) >> 1U), ((InnerCp) & 1U)) + +/** +* MPU Memory Access Attribute non-cacheable policy. +*/ +#define ARM_MPU_CACHEP_NOCACHE 0U + +/** +* MPU Memory Access Attribute write-back, write and read allocate policy. +*/ +#define ARM_MPU_CACHEP_WB_WRA 1U + +/** +* MPU Memory Access Attribute write-through, no write allocate policy. +*/ +#define ARM_MPU_CACHEP_WT_NWA 2U + +/** +* MPU Memory Access Attribute write-back, no write allocate policy. +*/ +#define ARM_MPU_CACHEP_WB_NWA 3U + + +/** +* Struct for a single MPU Region +*/ +typedef struct { + uint32_t RBAR; //!< The region base address register value (RBAR) + uint32_t RASR; //!< The region attribute and size register value (RASR) \ref MPU_RASR +} ARM_MPU_Region_t; + +/** Enable the MPU. +* \param MPU_Control Default access permissions for unconfigured regions. +*/ +__STATIC_INLINE void ARM_MPU_Enable(uint32_t MPU_Control) +{ + MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk; +#ifdef SCB_SHCSR_MEMFAULTENA_Msk + SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk; +#endif + __DSB(); + __ISB(); +} + +/** Disable the MPU. +*/ +__STATIC_INLINE void ARM_MPU_Disable(void) +{ + __DMB(); +#ifdef SCB_SHCSR_MEMFAULTENA_Msk + SCB->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk; +#endif + MPU->CTRL &= ~MPU_CTRL_ENABLE_Msk; +} + +/** Clear and disable the given MPU region. +* \param rnr Region number to be cleared. +*/ +__STATIC_INLINE void ARM_MPU_ClrRegion(uint32_t rnr) +{ + MPU->RNR = rnr; + MPU->RASR = 0U; +} + +/** Configure an MPU region. +* \param rbar Value for RBAR register. +* \param rsar Value for RSAR register. +*/ +__STATIC_INLINE void ARM_MPU_SetRegion(uint32_t rbar, uint32_t rasr) +{ + MPU->RBAR = rbar; + MPU->RASR = rasr; +} + +/** Configure the given MPU region. +* \param rnr Region number to be configured. +* \param rbar Value for RBAR register. +* \param rsar Value for RSAR register. +*/ +__STATIC_INLINE void ARM_MPU_SetRegionEx(uint32_t rnr, uint32_t rbar, uint32_t rasr) +{ + MPU->RNR = rnr; + MPU->RBAR = rbar; + MPU->RASR = rasr; +} + +/** Memcopy with strictly ordered memory access, e.g. for register targets. +* \param dst Destination data is copied to. +* \param src Source data is copied from. +* \param len Amount of data words to be copied. +*/ +__STATIC_INLINE void ARM_MPU_OrderedMemcpy(volatile uint32_t* dst, const uint32_t* __RESTRICT src, uint32_t len) +{ + uint32_t i; + for (i = 0U; i < len; ++i) + { + dst[i] = src[i]; + } +} + +/** Load the given number of MPU regions from a table. +* \param table Pointer to the MPU configuration table. +* \param cnt Amount of regions to be configured. +*/ +__STATIC_INLINE void ARM_MPU_Load(ARM_MPU_Region_t const* table, uint32_t cnt) +{ + const uint32_t rowWordSize = sizeof(ARM_MPU_Region_t)/4U; + while (cnt > MPU_TYPE_RALIASES) { + ARM_MPU_OrderedMemcpy(&(MPU->RBAR), &(table->RBAR), MPU_TYPE_RALIASES*rowWordSize); + table += MPU_TYPE_RALIASES; + cnt -= MPU_TYPE_RALIASES; + } + ARM_MPU_OrderedMemcpy(&(MPU->RBAR), &(table->RBAR), cnt*rowWordSize); +} + +#endif diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_clock.c b/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_clock.c new file mode 100644 index 000000000..2566726d7 --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_clock.c @@ -0,0 +1,344 @@ +/**************************************************************************** + * bootloader/src/lpc17_clock.c + * + * Copyright (C) 2020 Augusto Fraga Giachero. All rights reserved. + * Author: Augusto Fraga Giachero + * + * This file is part of the RFFE firmware. + * + * RFFE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RFFE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RFFE. If not, see . + * + ****************************************************************************/ + +#include "lpc17_clock.h" +#include "LPC176x5x.h" + +static inline void lpc17_pll0_feed() +{ + LPC_SYSCON->PLL0FEED = 0xAA; + LPC_SYSCON->PLL0FEED = 0x55; +} + +/* + * PLL0 output clock Fout = (2 * pll_mul * Fsrc) / pll_div + * CPU clock Fout / cpu_div + */ +int lpc17_set_pll0(uint16_t pll_div, uint16_t pll_mul, uint16_t cpu_div, enum lpc17_pll0_src src) +{ + if (pll_div < 1 || pll_div > 32) return -1; + if (pll_mul < 6 || pll_mul > 24170) return -1; + if (cpu_div < 1 || cpu_div > 256) return -1; + + cpu_div--; + pll_div--; + pll_mul--; + + /* + * Change CPU source to the Internal RC oscillator + */ + LPC_SYSCON->PLL0CON &= ~(SYSCON_PLL0CON_PLLC0_Msk); + lpc17_pll0_feed(); + + /* + * Disable PLL0 + */ + LPC_SYSCON->PLL0CON &= ~(SYSCON_PLL0CON_PLLE0_Msk); + lpc17_pll0_feed(); + + switch (src) + { + case pll0_irc_src: + LPC_SYSCON->CLKSRCSEL = 0; + break; + + case pll0_osc_src: + LPC_SYSCON->CLKSRCSEL = 1; + break; + + case pll0_rtc_src: + LPC_SYSCON->CLKSRCSEL = 2; + break; + + default: + break; + } + + /* + * Set the multiplier and divider values + */ + LPC_SYSCON->PLL0CFG = (pll_div << SYSCON_PLL0CFG_NSEL0_Pos) | + (pll_mul << SYSCON_PLL0CFG_MSEL0_Pos); + + /* + * Enable the PLL0 + */ + LPC_SYSCON->PLL0CON |= (SYSCON_PLL0CON_PLLE0_Msk); + lpc17_pll0_feed(); + + /* + * Set the CPU clock divider + */ + LPC_SYSCON->CCLKCFG = cpu_div; + + /* + * Wait for PLL0 to lock + */ + while (1) + { + volatile uint32_t stat = LPC_SYSCON->PLL0STAT; + volatile uint32_t start_tst = stat & SYSCON_PLL0STAT_PLOCK0_Msk; + if (start_tst) break; + } + + /* + * Change CPU clock source to PLL0 + */ + LPC_SYSCON->PLL0CON |= SYSCON_PLL0CON_PLLC0_Msk; + lpc17_pll0_feed(); + + return 0; +} + +void lpc17_set_pclk(enum lpc17_pclk pclk, enum lpc17_pclk_div div) +{ + uint32_t clk_div = 0; + uint32_t tmp = 0; + + switch (div) + { + case pclk_div1: + clk_div = 1; + break; + + case pclk_div2: + clk_div = 2; + break; + + case pclk_div4: + clk_div = 0; + break; + + case pclk_can_div6: + case pclk_div8: + clk_div = 3; + break; + + default: + break; + } + + switch (pclk) + { + /* PCLKSEL0 */ + case pclk_wdt: + tmp = LPC_SYSCON->PCLKSEL0; + tmp &= ~SYSCON_PCLKSEL0_PCLK_WDT_Msk; + tmp |= clk_div << SYSCON_PCLKSEL0_PCLK_WDT_Pos; + LPC_SYSCON->PCLKSEL0 = tmp; + break; + + case pclk_timer0: + tmp = LPC_SYSCON->PCLKSEL0; + tmp &= ~ SYSCON_PCLKSEL0_PCLK_TIMER0_Msk; + tmp |= clk_div << SYSCON_PCLKSEL0_PCLK_TIMER0_Pos; + LPC_SYSCON->PCLKSEL0 = tmp; + break; + + case pclk_timer1: + tmp = LPC_SYSCON->PCLKSEL0; + tmp &= ~SYSCON_PCLKSEL0_PCLK_TIMER1_Msk; + tmp |= clk_div << SYSCON_PCLKSEL0_PCLK_TIMER1_Pos; + LPC_SYSCON->PCLKSEL0 = tmp; + break; + + case pclk_uart0: + tmp = LPC_SYSCON->PCLKSEL0; + tmp &= ~SYSCON_PCLKSEL0_PCLK_UART0_Msk; + tmp |= clk_div << SYSCON_PCLKSEL0_PCLK_UART0_Pos; + LPC_SYSCON->PCLKSEL0 = tmp; + break; + + case pclk_uart1: + tmp = LPC_SYSCON->PCLKSEL0; + tmp &= ~SYSCON_PCLKSEL0_PCLK_UART1_Msk; + tmp |= clk_div << SYSCON_PCLKSEL0_PCLK_UART1_Pos; + LPC_SYSCON->PCLKSEL0 = tmp; + break; + + case pclk_pwm1: + tmp = LPC_SYSCON->PCLKSEL0; + tmp &= ~SYSCON_PCLKSEL0_PCLK_PWM1_Msk; + tmp |= clk_div << SYSCON_PCLKSEL0_PCLK_PWM1_Pos; + LPC_SYSCON->PCLKSEL0 = tmp; + break; + + case pclk_i2c0: + tmp = LPC_SYSCON->PCLKSEL0; + tmp &= ~SYSCON_PCLKSEL0_PCLK_I2C0_Msk; + tmp |= clk_div << SYSCON_PCLKSEL0_PCLK_I2C0_Pos; + LPC_SYSCON->PCLKSEL0 = tmp; + break; + + case pclk_spi: + tmp = LPC_SYSCON->PCLKSEL0; + tmp &= ~SYSCON_PCLKSEL0_PCLK_SPI_Msk; + tmp |= clk_div << SYSCON_PCLKSEL0_PCLK_SPI_Pos; + LPC_SYSCON->PCLKSEL0 = tmp; + break; + + case pclk_ssp1: + tmp = LPC_SYSCON->PCLKSEL0; + tmp &= ~SYSCON_PCLKSEL0_PCLK_SSP1_Msk; + tmp |= clk_div << SYSCON_PCLKSEL0_PCLK_SSP1_Pos; + LPC_SYSCON->PCLKSEL0 = tmp; + break; + + case pclk_dac: + tmp = LPC_SYSCON->PCLKSEL0; + tmp &= ~SYSCON_PCLKSEL0_PCLK_DAC_Msk; + tmp |= clk_div << SYSCON_PCLKSEL0_PCLK_DAC_Pos; + LPC_SYSCON->PCLKSEL0 = tmp; + break; + + case pclk_adc: + tmp = LPC_SYSCON->PCLKSEL0; + tmp &= ~SYSCON_PCLKSEL0_PCLK_ADC_Msk; + tmp |= clk_div << SYSCON_PCLKSEL0_PCLK_ADC_Pos; + LPC_SYSCON->PCLKSEL0 = tmp; + break; + + case pclk_can1: + tmp = LPC_SYSCON->PCLKSEL0; + tmp &= ~SYSCON_PCLKSEL0_PCLK_CAN1_Msk; + tmp |= clk_div << SYSCON_PCLKSEL0_PCLK_CAN1_Pos; + LPC_SYSCON->PCLKSEL0 = tmp; + break; + + case pclk_can2: + tmp = LPC_SYSCON->PCLKSEL0; + tmp &= ~SYSCON_PCLKSEL0_PCLK_CAN2_Msk; + tmp |= clk_div << SYSCON_PCLKSEL0_PCLK_CAN2_Pos; + LPC_SYSCON->PCLKSEL0 = tmp; + break; + + case pclk_acf: + tmp = LPC_SYSCON->PCLKSEL0; + tmp &= ~SYSCON_PCLKSEL0_PCLK_ACF_Msk; + tmp |= clk_div << SYSCON_PCLKSEL0_PCLK_ACF_Pos; + LPC_SYSCON->PCLKSEL0 = tmp; + break; + + /* PCLKSEL1 */ + case pclk_qei: + tmp = LPC_SYSCON->PCLKSEL1; + tmp &= ~SYSCON_PCLKSEL1_PCLK_QEI_Msk; + tmp |= clk_div << SYSCON_PCLKSEL1_PCLK_QEI_Pos; + LPC_SYSCON->PCLKSEL1 = tmp; + break; + + case pclk_gpioint: + tmp = LPC_SYSCON->PCLKSEL1; + tmp &= ~SYSCON_PCLKSEL1_PCLK_GPIOINT_Msk; + tmp |= clk_div << SYSCON_PCLKSEL1_PCLK_GPIOINT_Pos; + LPC_SYSCON->PCLKSEL1 = tmp; + break; + + case pclk_pcb: + tmp = LPC_SYSCON->PCLKSEL1; + tmp &= ~SYSCON_PCLKSEL1_PCLK_PCB_Msk; + tmp |= clk_div << SYSCON_PCLKSEL1_PCLK_PCB_Pos; + LPC_SYSCON->PCLKSEL1 = tmp; + break; + + case pclk_i2c1: + tmp = LPC_SYSCON->PCLKSEL1; + tmp &= ~SYSCON_PCLKSEL1_PCLK_I2C1_Msk; + tmp |= clk_div << SYSCON_PCLKSEL1_PCLK_I2C1_Pos; + LPC_SYSCON->PCLKSEL1 = tmp; + break; + + case pclk_ssp0: + tmp = LPC_SYSCON->PCLKSEL1; + tmp &= ~SYSCON_PCLKSEL1_PCLK_SSP0_Msk; + tmp |= clk_div << SYSCON_PCLKSEL1_PCLK_SSP0_Pos; + LPC_SYSCON->PCLKSEL1 = tmp; + break; + + case pclk_timer2: + tmp = LPC_SYSCON->PCLKSEL1; + tmp &= ~SYSCON_PCLKSEL1_PCLK_TIMER2_Msk; + tmp |= clk_div << SYSCON_PCLKSEL1_PCLK_TIMER2_Pos; + LPC_SYSCON->PCLKSEL1 = tmp; + break; + + case pclk_timer3: + tmp = LPC_SYSCON->PCLKSEL1; + tmp &= ~SYSCON_PCLKSEL1_PCLK_TIMER3_Msk; + tmp |= clk_div << SYSCON_PCLKSEL1_PCLK_TIMER3_Pos; + LPC_SYSCON->PCLKSEL1 = tmp; + break; + + case pclk_uart2: + tmp = LPC_SYSCON->PCLKSEL1; + tmp &= ~SYSCON_PCLKSEL1_PCLK_UART2_Msk; + tmp |= clk_div << SYSCON_PCLKSEL1_PCLK_UART2_Pos; + LPC_SYSCON->PCLKSEL1 = tmp; + break; + + case pclk_uart3: + tmp = LPC_SYSCON->PCLKSEL1; + tmp &= ~SYSCON_PCLKSEL1_PCLK_UART3_Msk; + tmp |= clk_div << SYSCON_PCLKSEL1_PCLK_UART3_Pos; + LPC_SYSCON->PCLKSEL1 = tmp; + break; + + case pclk_i2c2: + tmp = LPC_SYSCON->PCLKSEL1; + tmp &= ~SYSCON_PCLKSEL1_PCLK_I2C2_Msk; + tmp |= clk_div << SYSCON_PCLKSEL1_PCLK_I2C2_Pos; + LPC_SYSCON->PCLKSEL1 = tmp; + break; + + case pclk_i2s: + tmp = LPC_SYSCON->PCLKSEL1; + tmp &= ~SYSCON_PCLKSEL1_PCLK_I2S_Msk; + tmp |= clk_div << SYSCON_PCLKSEL1_PCLK_I2S_Pos; + LPC_SYSCON->PCLKSEL1 = tmp; + break; + + case pclk_rit: + tmp = LPC_SYSCON->PCLKSEL1; + tmp &= ~SYSCON_PCLKSEL1_PCLK_RIT_Msk; + tmp |= clk_div << SYSCON_PCLKSEL1_PCLK_RIT_Pos; + LPC_SYSCON->PCLKSEL1 = tmp; + break; + + case pclk_syscon: + tmp = LPC_SYSCON->PCLKSEL1; + tmp &= ~SYSCON_PCLKSEL1_PCLK_SYSCON_Msk; + tmp |= clk_div << SYSCON_PCLKSEL1_PCLK_SYSCON_Pos; + LPC_SYSCON->PCLKSEL1 = tmp; + break; + + case pclk_mc: + tmp = LPC_SYSCON->PCLKSEL1; + tmp &= ~SYSCON_PCLKSEL1_PCLK_MC_Msk; + tmp |= clk_div << SYSCON_PCLKSEL1_PCLK_MC_Pos; + LPC_SYSCON->PCLKSEL1 = tmp; + break; + + default: + break; + } +} diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_clock.h b/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_clock.h new file mode 100644 index 000000000..ccf3800fe --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_clock.h @@ -0,0 +1,77 @@ +/**************************************************************************** + * bootloader/src/lpc17_clock.h + * + * Copyright (C) 2020 Augusto Fraga Giachero. All rights reserved. + * Author: Augusto Fraga Giachero + * + * This file is part of the RFFE firmware. + * + * RFFE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RFFE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RFFE. If not, see . + * + ****************************************************************************/ + +#include + +enum lpc17_pll0_src +{ + pll0_irc_src, + pll0_osc_src, + pll0_rtc_src, +}; + +enum lpc17_pclk +{ + /* PCLKSEL0 */ + pclk_wdt, + pclk_timer0, + pclk_timer1, + pclk_uart0, + pclk_uart1, + pclk_pwm1, + pclk_i2c0, + pclk_spi, + pclk_ssp1, + pclk_dac, + pclk_adc, + pclk_can1, + pclk_can2, + pclk_acf, + /* PCLKSEL1 */ + pclk_qei, + pclk_gpioint, + pclk_pcb, + pclk_i2c1, + pclk_ssp0, + pclk_timer2, + pclk_timer3, + pclk_uart2, + pclk_uart3, + pclk_i2c2, + pclk_i2s, + pclk_rit, + pclk_syscon, + pclk_mc, +}; + +enum lpc17_pclk_div +{ + pclk_div1, + pclk_div2, + pclk_div4, + pclk_can_div6, + pclk_div8, +}; + +int lpc17_set_pll0(uint16_t pll_div, uint16_t pll_mul, uint16_t cpu_div, enum lpc17_pll0_src src); +void lpc17_set_pclk(enum lpc17_pclk pclk, enum lpc17_pclk_div div); diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_iap.c b/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_iap.c new file mode 100644 index 000000000..5817e35e8 --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_iap.c @@ -0,0 +1,95 @@ +/**************************************************************************** + * bootloader/src/lpc17_iap.c + * + * Copyright (C) 2020 Augusto Fraga Giachero. All rights reserved. + * Author: Augusto Fraga Giachero + * + * This file is part of the RFFE firmware. + * + * RFFE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RFFE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RFFE. If not, see . + * + ****************************************************************************/ + +#include "LPC176x5x.h" +#include "lpc17_iap.h" + +enum iap_cmds +{ + iap_prepare_sectors_write = 50, + iap_copy_ram_flash, + iap_erase_sectors, + iap_blank_check_sectors, + iap_read_part_id, + iap_read_boot_code_version, + iap_read_device_sn, + iap_compare, + iap_reinvoke, +}; + +static const void (*iap_entry) (uint32_t*, uint32_t*) = (void*) 0x1FFF1FF1; + +enum iap_err lpc17_iap_prepare_sectors(uint8_t start_sector, uint8_t end_sector) +{ + uint32_t inout[5] = { + (uint32_t)iap_prepare_sectors_write, + start_sector, + end_sector, + }; + + iap_entry(inout, inout); + + return (enum iap_err)inout[0]; +} + +enum iap_err lpc17_iap_copy_ram_flash(const uint32_t* src_ram, const uint32_t* dest_flash, size_t len, uint32_t cpu_clk_khz) +{ + uint32_t inout[5] = { + (uint32_t)iap_copy_ram_flash, + (uint32_t)dest_flash, + (uint32_t)src_ram, + (uint32_t)len, + cpu_clk_khz, + }; + + iap_entry(inout, inout); + + return (enum iap_err)inout[0]; +} + +enum iap_err lpc17_iap_erase_sectors(uint8_t start_sector, uint8_t end_sector, uint32_t cpu_clk_khz) +{ + uint32_t inout[5] = { + (uint32_t)iap_erase_sectors, + start_sector, + end_sector, + cpu_clk_khz, + }; + + iap_entry(inout, inout); + + return (enum iap_err)inout[0]; +} + +enum iap_err lpc17_iap_blank_check(uint8_t start_sector, uint8_t end_sector) +{ + uint32_t inout[5] = { + (uint32_t)iap_blank_check_sectors, + start_sector, + end_sector, + }; + + iap_entry(inout, inout); + + return (enum iap_err)inout[0]; +} diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_iap.h b/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_iap.h new file mode 100644 index 000000000..178639794 --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_iap.h @@ -0,0 +1,54 @@ +/**************************************************************************** + * bootloader/src/lpc17_iap.h + * + * Copyright (C) 2020 Augusto Fraga Giachero. All rights reserved. + * Author: Augusto Fraga Giachero + * + * This file is part of the RFFE firmware. + * + * RFFE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RFFE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RFFE. If not, see . + * + ****************************************************************************/ + +#include +#include + +enum iap_err +{ + iap_cmd_success = 0, + iap_invalid_command, + iap_src_addr_error, + iap_dst_addr_error, + iap_src_addr_not_mapped, + iap_dst_addr_not_mapped, + iap_count_error, + iap_invalid_sector, + iap_sector_not_blank, + iap_sector_not_prepared_for_write, + iap_compare_error, + iap_busy, + iap_param_error, + iap_addr_error, + iap_addr_not_mapped, + iap_cmd_locked, + iap_invalid_code, + iap_invalid_baud_rate, + iap_invalid_stop_bit, + iap_code_read_protection_enabled, +}; + +enum iap_err lpc17_iap_prepare_sectors(uint8_t start_sector, uint8_t end_sector); +enum iap_err lpc17_iap_copy_ram_flash(const uint32_t* src_ram, const uint32_t* dest_flash, size_t len, uint32_t cpu_clk_khz); +enum iap_err lpc17_iap_erase_sectors(uint8_t start_sector, uint8_t end_sector, uint32_t cpu_clk_khz); +enum iap_err lpc17_iap_blank_check(uint8_t start_sector, uint8_t end_sector); diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_pincfg.c b/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_pincfg.c new file mode 100644 index 000000000..34ba8879c --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_pincfg.c @@ -0,0 +1,106 @@ +/**************************************************************************** + * bootloader/src/lpc17_pincfg.c + * + * Copyright (C) 2020 Augusto Fraga Giachero. All rights reserved. + * Author: Augusto Fraga Giachero + * + * This file is part of the RFFE firmware. + * + * RFFE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RFFE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RFFE. If not, see . + * + ****************************************************************************/ + +#include + +#include "LPC176x5x.h" +#include "lpc17_pincfg.h" + +void lp17_pincfg(uint8_t port, uint8_t pin, enum pincfg_mode mode, enum pincfg_func func) +{ + volatile uint32_t* pinsel = NULL; + volatile uint32_t* pinmode = NULL; + uint8_t bit_pos = (pin * 2) % 32; + uint32_t sel_mask = (uint32_t)3 << bit_pos; + uint32_t mode_mask = (uint32_t)3 << bit_pos; + uint32_t sel_val = (uint32_t)func << bit_pos; + uint32_t mode_val = (uint32_t)mode << bit_pos; + + if (port == 0) + { + if (pin <= 15) + { + pinsel = &LPC_PINCONNECT->PINSEL0; + pinmode = &LPC_PINCONNECT->PINMODE0; + } + else + { + pinsel = &LPC_PINCONNECT->PINSEL1; + pinmode = &LPC_PINCONNECT->PINMODE1; + } + } + else if (port == 1) + { + if (pin <= 15) + { + pinsel = &LPC_PINCONNECT->PINSEL2; + pinmode = &LPC_PINCONNECT->PINMODE2; + } + else + { + pinsel = &LPC_PINCONNECT->PINSEL3; + pinmode = &LPC_PINCONNECT->PINMODE3; + } + } + else if (port == 2) + { + /* + * PINSEL5 / PINMODE5 not available + */ + if (pin <= 15) + { + pinsel = &LPC_PINCONNECT->PINSEL4; + pinmode = &LPC_PINCONNECT->PINMODE4; + } + } + else if (port == 3) + { + /* + * PINSEL6 / PINMODE6 not available + */ + if (pin >= 16) + { + pinsel = &LPC_PINCONNECT->PINSEL7; + pinmode = &LPC_PINCONNECT->PINMODE7; + } + } + else if (port == 4) + { + /* + * PINSEL8 / PINMODE8 not available + */ + if (pin >= 16) + { + pinsel = &LPC_PINCONNECT->PINSEL9; + pinmode = &LPC_PINCONNECT->PINMODE9; + } + } + + if (pinsel && pinmode) + { + *pinsel &= ~sel_mask; + *pinsel |= sel_val; + *pinmode &= ~mode_mask; + *pinmode |= mode_val; + } +} diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_pincfg.h b/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_pincfg.h new file mode 100644 index 000000000..fb94802ac --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_pincfg.h @@ -0,0 +1,42 @@ +/**************************************************************************** + * bootloader/src/lpc17_pincfg.h + * + * Copyright (C) 2020 Augusto Fraga Giachero. All rights reserved. + * Author: Augusto Fraga Giachero + * + * This file is part of the RFFE firmware. + * + * RFFE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RFFE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RFFE. If not, see . + * + ****************************************************************************/ + +#include + +enum pincfg_mode +{ + pin_mode_pullup = 0, + pin_mode_repeater = 1, + pin_mode_none = 2, + pin_mode_pulldown = 3, +}; + +enum pincfg_func +{ + pin_func_gpio = 0, + pin_func_alt1 = 1, + pin_func_alt2 = 2, + pin_func_alt3 = 3, +}; + +void lp17_pincfg(uint8_t port, uint8_t pin, enum pincfg_mode mode, enum pincfg_func func); diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_progmem.c b/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_progmem.c new file mode 100644 index 000000000..512ada61f --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_progmem.c @@ -0,0 +1,27 @@ +/**************************************************************************** + * bootloader/src/lpc17_progmem.c + * + * Copyright (C) 2020 Augusto Fraga Giachero. All rights reserved. + * Author: Augusto Fraga Giachero + * + * This file is part of the RFFE firmware. + * + * RFFE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RFFE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RFFE. If not, see . + * + ****************************************************************************/ + +#include + +#include "LPC176x5x.h" + diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_uart.c b/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_uart.c new file mode 100644 index 000000000..6a5821552 --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_uart.c @@ -0,0 +1,94 @@ +/**************************************************************************** + * bootloader/src/lpc17_uart.c + * + * Copyright (C) 2020 Augusto Fraga Giachero. All rights reserved. + * Author: Augusto Fraga Giachero + * + * This file is part of the RFFE firmware. + * + * RFFE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RFFE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RFFE. If not, see . + * + ****************************************************************************/ + +#include "lpc17_clock.h" +#include "lpc17_uart.h" +#include "LPC176x5x.h" + +int lpc17_uart0_init(uint32_t baud, uint32_t cpu_clk) +{ + /* + * Set UART0 clock as the same of CPU + */ + lpc17_set_pclk(pclk_uart0, pclk_div1); + + /* + * Enable the UART0 peripheral + */ + LPC_SYSCON->PCONP |= SYSCON_PCONP_PCUART0_Msk; + + /* + * Disable fractional baudrate generation + */ + LPC_UART0->FDR = (0 << UART0_FDR_DIVADDVAL_Pos) | + (1 << UART0_FDR_MULVAL_Pos); + + /* + * Calculate the baudrate from cpu_clk; + */ + volatile uint32_t uart_div = cpu_clk / (16 * baud); + + if (uart_div < 1 || uart_div > 0xFFFF) return -1; + + /* + * Enable divisor latch access, write the divisor value + */ + LPC_UART0->LCR |= UART0_LCR_DLAB_Msk; + LPC_UART0->DLM = (uart_div >> 8) & 0xFF; + LPC_UART0->DLL = uart_div & 0xFF; + LPC_UART0->LCR &= ~UART0_LCR_DLAB_Msk; + + /* + * Configure UART0: 8N1 + */ + LPC_UART0->LCR = (3 << UART0_LCR_WLS_Pos); + + /* + * Enable the UART0 transmitter + */ + LPC_UART0->TER = UART0_TER_TXEN_Msk; + + return 0; +} + +int lpc17_uart0_write_blocking(const uint8_t* buffer, size_t len) +{ + for (; len > 0; len--) + { + while ((LPC_UART0->LSR & UART0_LSR_THRE_Msk) == 0); + LPC_UART0->THR = *buffer++; + } + return len; +} + +int lpc17_uart0_write_str_blocking(const char* buffer) +{ + int len = 0; + while (*buffer) + { + while ((LPC_UART0->LSR & UART0_LSR_THRE_Msk) == 0); + LPC_UART0->THR = *buffer++; + len++; + } + return len; +} diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_uart.h b/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_uart.h new file mode 100644 index 000000000..0205c1935 --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/src/lpc17_uart.h @@ -0,0 +1,29 @@ +/**************************************************************************** + * bootloader/src/lpc17_uart.c + * + * Copyright (C) 2020 Augusto Fraga Giachero. All rights reserved. + * Author: Augusto Fraga Giachero + * + * This file is part of the RFFE firmware. + * + * RFFE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RFFE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RFFE. If not, see . + * + ****************************************************************************/ + +#include +#include + +int lpc17_uart0_init(uint32_t baud, uint32_t cpu_clk); +int lpc17_uart0_write_blocking(const uint8_t* buffer, size_t len); +int lpc17_uart0_write_str_blocking(const char* buffer); diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/src/main.c b/port/ucontroller/nxp/lpc17xx/bootloader/src/main.c new file mode 100644 index 000000000..04f633e87 --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/src/main.c @@ -0,0 +1,250 @@ +/**************************************************************************** + * bootloader/src/main.c + * + * Copyright (C) 2020 Augusto Fraga Giachero. All rights reserved. + * Copyright (C) 2021-2022 CNPEM. All rights reserved. + * Author: Augusto Fraga Giachero + * + * This file is part of the RFFE firmware. + * + * RFFE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RFFE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RFFE. If not, see . + * + ****************************************************************************/ + +#include +#include + +#include "LPC176x5x.h" +#include "lpc17_clock.h" +#include "lpc17_pincfg.h" +#include "lpc17_uart.h" +#include "lpc17_iap.h" +#include "start_app.h" + +enum fw_update_type +{ + FW_UPDATE_APP = 1, + FW_UPDATE_BOOT = 2, +}; + +typedef struct +{ + uint8_t version[3]; + uint8_t fw_type; + uint32_t magic; +} fw_info; + +extern const uint32_t __AppFlash_start; +extern const uint32_t __AppFlash_end; +extern const uint32_t __BootFlash_start; +extern const uint32_t __BootFlash_end; +extern const uint32_t __FWUpdateFlash_start; +extern const uint32_t __FWUpdateFlash_end; +extern const fw_info __FWInfo_addr; + +const uint32_t* app_start_addr = &__AppFlash_start; +const uint32_t* app_end_addr = &__AppFlash_end; +const uint32_t* boot_start_addr = &__BootFlash_start; +const uint32_t* boot_end_addr = &__BootFlash_end; +const uint32_t* update_start_addr = &__FWUpdateFlash_start; +const uint32_t* update_end_addr = &__FWUpdateFlash_end; + +const fw_info* fw_header = &__FWInfo_addr; + +char* u8_to_str(uint8_t n, char* str) +{ + uint8_t digits[3]; + + digits[0] = n / 100; + digits[1] = (n - digits[0]) / 10; + digits[2] = (n - digits[1]); + + if (digits[0] == 0) + { + if (digits[1] == 0) + { + str[0] = digits[2] | 0x30; + str[1] = 0; + } + else + { + str[0] = digits[1] | 0x30; + str[1] = digits[2] | 0x30; + str[2] = 0; + } + } + else + { + str[0] = digits[0] | 0x30; + str[1] = digits[1] | 0x30; + str[2] = digits[2] | 0x30; + str[3] = 0; + } + + return str; +} + +uint8_t get_sector_number(const void* flash_addr) +{ + uint8_t ret = 0; + const uint32_t flash = (const uint32_t)flash_addr; + + if (flash < 0x10000) + { + ret = (flash / 0x1000); + } + else + { + ret = ((flash - 0x10000) / 0x8000) + 16; + } + return ret; +} + +void copy_flash_region(const uint32_t* src, const uint32_t* dest, size_t len, uint32_t cpu_clk_khz) +{ + uint32_t buffer[64]; + + if (len % 256) return; + + for (size_t i = 0; i < len; i += 256, src += 64, dest += 64) + { + for (size_t i = 0; i < 64; i++) + { + buffer[i] = src[i]; + } + + uint8_t sector = get_sector_number(dest); + + lpc17_iap_prepare_sectors(sector, sector); + lpc17_iap_copy_ram_flash(buffer, dest, 256, cpu_clk_khz); + } +} + +void update(uint32_t cpu_clk_khz, enum fw_update_type ftype) +{ + uint32_t target_start_sec; + uint32_t target_end_sec; + uint32_t target_size; + const uint32_t* target_start_addr; + const uint32_t update_start_sec = get_sector_number(update_start_addr); + const uint32_t update_end_sec = get_sector_number(update_end_addr); + + if (ftype == FW_UPDATE_APP) + { + target_start_sec = get_sector_number(app_start_addr); + target_end_sec = get_sector_number(app_end_addr); + target_size = (uint32_t)app_end_addr - (uint32_t)app_start_addr + 1; + target_start_addr = app_start_addr; + } + else if (ftype == FW_UPDATE_BOOT) + { + target_start_sec = get_sector_number(boot_start_addr); + target_end_sec = get_sector_number(boot_end_addr); + target_size = (uint32_t)boot_end_addr - (uint32_t)boot_start_addr + 1; + target_start_addr = boot_start_addr; + } + else return; + + lpc17_iap_prepare_sectors(target_start_sec, target_end_sec); + lpc17_iap_erase_sectors(target_start_sec, target_end_sec, cpu_clk_khz); + + copy_flash_region(update_start_addr, target_start_addr, target_size, cpu_clk_khz); + + /* + * Erase flash firmware update section + */ + lpc17_iap_prepare_sectors(update_start_sec, update_end_sec); + lpc17_iap_erase_sectors(update_start_sec, update_end_sec, cpu_clk_khz); + + /* + * Jump to application code + */ + start_app(app_start_addr); +} + +int main(void) +{ + /* + * Update flash access time to 4 CPU clocks (required when running + * from 60 to 80MHz) + */ + LPC_SYSCON->FLASHCFG &= ~SYSCON_FLASHCFG_FLASHTIM_Msk; + LPC_SYSCON->FLASHCFG |= (3 << SYSCON_FLASHCFG_FLASHTIM_Pos); + + /* + * PLL0 output clock Fout = (2 * pll_mul * Fsrc) / pll_div + * CPU clock Fout / cpu_div + * + * For a 72 MHz cpu clock using the internal RC: + * pll_div = 1; + * pll_mull = 18; + * cpu_div = 2; + */ + lpc17_set_pll0(1, 18, 2, pll0_irc_src); + + /* + * Configure pins P0.2 as TXD0 and P0.3 as RXD0 + */ + lp17_pincfg(0, 2, pin_mode_none, pin_func_alt1); + lp17_pincfg(0, 3, pin_mode_none, pin_func_alt1); + + /* + * Initialize UAR0 (19200bps, 8N1) + */ + lpc17_uart0_init(19200, 72000000); + + if (fw_header->magic == 0xAAAAAAAA) + { + char tmp[128]; + + lpc17_uart0_write_str_blocking("[BOOTLOADER] DO NOT TURN OFF WHILE UPDATING!\r\n"); + + if (fw_header->fw_type == 1) + { + lpc17_uart0_write_str_blocking("[BOOTLOADER] New app firmware update found!\r\nUpdating to "); + lpc17_uart0_write_str_blocking(u8_to_str(fw_header->version[0], tmp)); + lpc17_uart0_write_str_blocking("."); + lpc17_uart0_write_str_blocking(u8_to_str(fw_header->version[1], tmp)); + lpc17_uart0_write_str_blocking("."); + lpc17_uart0_write_str_blocking(u8_to_str(fw_header->version[2], tmp)); + lpc17_uart0_write_str_blocking("...\r\n"); + + update(72000, FW_UPDATE_APP); + } + else if (fw_header->fw_type == 2) + { + lpc17_uart0_write_str_blocking("[BOOTLOADER] New bootloader firmware update found!\r\nUpdating to "); + lpc17_uart0_write_str_blocking(u8_to_str(fw_header->version[0], tmp)); + lpc17_uart0_write_str_blocking("."); + lpc17_uart0_write_str_blocking(u8_to_str(fw_header->version[1], tmp)); + lpc17_uart0_write_str_blocking("."); + lpc17_uart0_write_str_blocking(u8_to_str(fw_header->version[2], tmp)); + lpc17_uart0_write_str_blocking("...\r\n"); + + update(72000, FW_UPDATE_BOOT); + } + else + { + lpc17_uart0_write_str_blocking("[BOOTLOADER] ERROR: Unknown fw_type "); + lpc17_uart0_write_str_blocking(u8_to_str(fw_header->fw_type, tmp)); + lpc17_uart0_write_str_blocking(" !\r\n Jumping to application code...\r\n"); + } + } + + /* + * Jump to application code + */ + start_app(app_start_addr); + return 0; +} diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/src/start_app.c b/port/ucontroller/nxp/lpc17xx/bootloader/src/start_app.c new file mode 100644 index 000000000..cda05765e --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/src/start_app.c @@ -0,0 +1,39 @@ +/**************************************************************************** + * bootloader/src/start_app.c + * + * Copyright (C) 2020 Augusto Fraga Giachero. All rights reserved. + * Author: Augusto Fraga Giachero + * + * This file is part of the RFFE firmware. + * + * RFFE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RFFE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RFFE. If not, see . + * + ****************************************************************************/ + +#include "LPC176x5x.h" + +void start_app(const uint32_t* vtor) +{ + __disable_irq(); + SCB->VTOR = (uint32_t)vtor; + uint32_t sp = vtor[0]; + uint32_t pc = vtor[1]; + __asm__ volatile ( + "mov sp, %0 \n" + "bx %1 \n" + : + : "r"(sp), "r"(pc) + : + ); +} diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/src/start_app.h b/port/ucontroller/nxp/lpc17xx/bootloader/src/start_app.h new file mode 100644 index 000000000..b3586fd9c --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/src/start_app.h @@ -0,0 +1,26 @@ +/**************************************************************************** + * bootloader/src/start_app.h + * + * Copyright (C) 2020 Augusto Fraga Giachero. All rights reserved. + * Author: Augusto Fraga Giachero + * + * This file is part of the RFFE firmware. + * + * RFFE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RFFE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RFFE. If not, see . + * + ****************************************************************************/ + +#include + +void start_app(const uint32_t* vtor); diff --git a/port/ucontroller/nxp/lpc17xx/bootloader/src/startup.s b/port/ucontroller/nxp/lpc17xx/bootloader/src/startup.s new file mode 100644 index 000000000..983e3e16f --- /dev/null +++ b/port/ucontroller/nxp/lpc17xx/bootloader/src/startup.s @@ -0,0 +1,223 @@ +/**************************************************************************//** + * @file startup.s + * @brief CMSIS-Core(M) Device Startup File for Cortex-M3 Device + * @version V2.0.1 + * @date 23. July 2019 + ******************************************************************************/ +/* + * Copyright (c) 2009-2019 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + .syntax unified + .arch armv7-m + + .section .isr_vector + .align 2 + .globl __Vectors + .globl __Vectors_End + .globl __Vectors_Size +__Vectors: + .long _vStackTop /* Top of Stack */ + .long ResetISR /* Reset Handler */ + .long NMI_Handler /* -14 NMI Handler */ + .long HardFault_Handler /* -13 Hard Fault Handler */ + .long MemManage_Handler /* -12 MPU Fault Handler */ + .long BusFault_Handler /* -11 Bus Fault Handler */ + .long UsageFault_Handler /* -10 Usage Fault Handler */ + .long _VectorChecksum /* Checksum (required by the ROM bootloader) */ + .long 0 /* Reserved */ + .long 0 /* Reserved */ + .long 0 /* Reserved */ + .long SVC_Handler /* -5 SVCall Handler */ + .long DebugMon_Handler /* -4 Debug Monitor Handler */ + .long 0 /* Reserved */ + .long PendSV_Handler /* -2 PendSV Handler */ + .long SysTick_Handler /* -1 SysTick Handler */ + + /* Interrupts */ + .long WDT_Handler + .long TIMER0_Handler + .long TIMER1_Handler + .long TIMER2_Handler + .long TIMER3_Handler + .long UART0_Handler + .long UART1_Handler + .long UART2_Handler + .long UART3_Handler + .long PWM1_Handler + .long I2C0_Handler + .long I2C1_Handler + .long I2C2_Handler + .long SPI_Handler + .long SSP0_Handler + .long SSP1_Handler + .long PLL0_Handler + .long RTC_Handler + .long EINT0_Handler + .long EINT1_Handler + .long EINT2_Handler + .long EINT3_Handler + .long ADC_Handler + .long BOD_Handler + .long USB_Handler + .long CAN_Handler + .long DMA_Handler + .long I2S_Handler + .long ENET_Handler + .long RIT_Handler + .long MCPWM_Handler + .long QEI_Handler + .long PLL1_Handler + .long USBActivity_Handler + .long CANActivity_Handler + +// .space (189 * 4) /* Interrupts 35 .. 224 are left out */ +__Vectors_End: + .equ __Vectors_Size, __Vectors_End - __Vectors + .size __Vectors, . - __Vectors + + + .thumb + .section .boot + .align 2 + + .thumb_func + .type ResetISR, %function + .globl ResetISR +ResetISR: + ldr r4, =__data_section_table + ldr r5, =__data_section_table_end + +.L_loop0: + cmp r4, r5 + bge .L_loop0_done + ldr r1, [r4] // Flash address + ldr r2, [r4, #4] // RAM address + ldr r3, [r4, #8] // Size + +.L_loop0_0: + subs r3, #4 + ittt ge + ldrge r0, [r1, r3] + strge r0, [r2, r3] + bge .L_loop0_0 + + adds r4, #12 + b .L_loop0 +.L_loop0_done: + + ldr r3, =__bss_section_table + ldr r4, =__bss_section_table_end + +.L_loop2: + cmp r3, r4 + bge .L_loop2_done + ldr r1, [r3] + ldr r2, [r3, #4] + movs r0, 0 + +.L_loop2_0: + subs r2, #4 + itt ge + strge r0, [r1, r2] + bge .L_loop2_0 + + adds r3, #8 + b .L_loop2 +.L_loop2_done: + ldr r0,=main + blx r0 + + .size ResetISR, . - ResetISR + +/* The default macro is not used for HardFault_Handler + * because this results in a poor debug illusion. + */ + .thumb_func + .type HardFault_Handler, %function + .weak HardFault_Handler +HardFault_Handler: + b . + .size HardFault_Handler, . - HardFault_Handler + + .thumb_func + .type Default_Handler, %function + .weak Default_Handler +Default_Handler: + b . + .size Default_Handler, . - Default_Handler + +/* Macro to define default exception/interrupt handlers. + * Default handler are weak symbols with an endless loop. + * They can be overwritten by real handlers. + */ + .macro Set_Default_Handler Handler_Name + .weak \Handler_Name + .set \Handler_Name, Default_Handler + .endm + + +/* Default exception/interrupt handler */ + + Set_Default_Handler NMI_Handler + Set_Default_Handler MemManage_Handler + Set_Default_Handler BusFault_Handler + Set_Default_Handler UsageFault_Handler + Set_Default_Handler SVC_Handler + Set_Default_Handler DebugMon_Handler + Set_Default_Handler PendSV_Handler + Set_Default_Handler SysTick_Handler + + Set_Default_Handler WDT_Handler + Set_Default_Handler TIMER0_Handler + Set_Default_Handler TIMER1_Handler + Set_Default_Handler TIMER2_Handler + Set_Default_Handler TIMER3_Handler + Set_Default_Handler UART0_Handler + Set_Default_Handler UART1_Handler + Set_Default_Handler UART2_Handler + Set_Default_Handler UART3_Handler + Set_Default_Handler PWM1_Handler + Set_Default_Handler I2C0_Handler + Set_Default_Handler I2C1_Handler + Set_Default_Handler I2C2_Handler + Set_Default_Handler SPI_Handler + Set_Default_Handler SSP0_Handler + Set_Default_Handler SSP1_Handler + Set_Default_Handler PLL0_Handler + Set_Default_Handler RTC_Handler + Set_Default_Handler EINT0_Handler + Set_Default_Handler EINT1_Handler + Set_Default_Handler EINT2_Handler + Set_Default_Handler EINT3_Handler + Set_Default_Handler ADC_Handler + Set_Default_Handler BOD_Handler + Set_Default_Handler USB_Handler + Set_Default_Handler CAN_Handler + Set_Default_Handler DMA_Handler + Set_Default_Handler I2S_Handler + Set_Default_Handler ENET_Handler + Set_Default_Handler RIT_Handler + Set_Default_Handler MCPWM_Handler + Set_Default_Handler QEI_Handler + Set_Default_Handler PLL1_Handler + Set_Default_Handler USBActivity_Handler + Set_Default_Handler CANActivity_Handler + + + + .end diff --git a/port/ucontroller/nxp/lpc17xx/cr_startup_lpc175x_6x.c b/port/ucontroller/nxp/lpc17xx/cr_startup_lpc175x_6x.c index fe19482f0..0bc2a448d 100755 --- a/port/ucontroller/nxp/lpc17xx/cr_startup_lpc175x_6x.c +++ b/port/ucontroller/nxp/lpc17xx/cr_startup_lpc175x_6x.c @@ -285,6 +285,11 @@ ResetISR(void) { bss_init(ExeAddr, SectionLen); } + /* + * Enable global interrupts + */ + __asm__("cpsie i \n"); + #if defined (__USE_CMSIS) || defined (__USE_LPCOPEN) SystemInit(); #endif diff --git a/linker/LPC1764_app.ld b/port/ucontroller/nxp/lpc17xx/linker/LPC1764_app.ld similarity index 66% rename from linker/LPC1764_app.ld rename to port/ucontroller/nxp/lpc17xx/linker/LPC1764_app.ld index 92b02c1d5..639ac7f8d 100644 --- a/linker/LPC1764_app.ld +++ b/port/ucontroller/nxp/lpc17xx/linker/LPC1764_app.ld @@ -1,23 +1,29 @@ MEMORY { /* Define each memory region */ - /* First 8kB are reserved for bootloader */ /* Last 2 sectors (32kB each) are reserved for firmware upgrade */ - MFlash128 (rx) : ORIGIN = 0x2000, LENGTH = 56K /* 56K bytes */ - RamLoc16 (rwx) : ORIGIN = 0x10000000, LENGTH = 16K /* 16K bytes */ - RamAHB16 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K /* 16K bytes */ + BootFlash (r) : ORIGIN = 0x0000, LENGTH = 8K /* 8K bytes */ + AppFlash (rx) : ORIGIN = 0x2000, LENGTH = 56K /* 56K bytes */ + FWUpdateFlash (r) : ORIGIN = 0x10000, LENGTH = 64K /* 64K bytes */ + RamLoc (rwx) : ORIGIN = 0x10000000, LENGTH = 16K /* 16K bytes */ + RamAHB (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K /* 16K bytes */ } + __BootFlash_start = 0x0000; /* Bootloader start address (vector table) */ + __BootFlash_end = 0x1FFF; /* Bootloader end address (last byte) */ + __AppFlash_start = 0x2000; /* Application start address (vector table) */ + __AppFlash_end = 0x1FFF + 56K; /* Application end address (last byte) */ + __FWUpdateFlash_start = 0x10000; /* Firmware update region start address */ + __FWUpdateFlash_end = 0x0FFFF + 64K; /* Firmware update region end address (last byte) */ + + /* Last 256 bytes of flash reserved to the fw_info struct */ + __FWInfo_addr = __FWUpdateFlash_end - 255; + /* Define a symbol for the top of each memory region */ - __top_MFlash128 = 0x2000 + 56K; - __top_RamLoc16 = 0x10000000 + 16K; - __top_RamAHB16 = 0x2007c000 + 16K; + __top_AppFlash = 0x2000 + 56K; + __top_RamLoc = 0x10000000 + 16K; + __top_RamAHB = 0x2007c000 + 16K; ENTRY(ResetISR) -EXTERN(NMI_Handler) -EXTERN(HardFault_Handler) -EXTERN(MemManage_Handler) -EXTERN(BusFault_Handler) -EXTERN(UsageFault_Handler) SECTIONS { @@ -51,7 +57,7 @@ SECTIONS *(.after_vectors*) - } >MFlash128 + } > AppFlash .text : ALIGN(4) { @@ -59,14 +65,14 @@ SECTIONS *(.rodata .rodata.* .constdata .constdata.*) /* . = ALIGN(4); */ - } > MFlash128 + } > AppFlash .ipmi_handlers : ALIGN(32) { _ipmi_handlers = .; KEEP(*(.ipmi_handlers)) _eipmi_handlers = .; - } > MFlash128 + } > AppFlash /* * for exception handling/unwind - some Newlib functions (in common @@ -75,29 +81,29 @@ SECTIONS .ARM.extab : ALIGN(4) { *(.ARM.extab* .gnu.linkonce.armextab.*) - } > MFlash128 + } > AppFlash __exidx_start = .; .ARM.exidx : ALIGN(4) { *(.ARM.exidx* .gnu.linkonce.armexidx.*) - } > MFlash128 + } > AppFlash __exidx_end = .; _etext = .; - /* DATA section for RamAHB16 */ + /* DATA section for RamAHB */ .data_RAM2 : ALIGN(4) { FILL(0xff) PROVIDE(__start_data_RAM2 = .) ; *(.ramfunc.$RAM2) - *(.ramfunc.$RamAHB16) + *(.ramfunc.$RamAHB) *(.data.$RAM2*) - *(.data.$RamAHB16*) + *(.data.$RamAHB*) . = ALIGN(4) ; PROVIDE(__end_data_RAM2 = .) ; - } > RamAHB16 AT>MFlash128 + } > RamAHB AT> AppFlash /* MAIN DATA SECTION */ @@ -106,9 +112,9 @@ SECTIONS KEEP(*(.bss.$RESERVED*)) . = ALIGN(4) ; _end_uninit_RESERVED = .; - } > RamLoc16 + } > RamLoc - /* Main DATA section (RamLoc16) */ + /* Main DATA section (RamLoc) */ .data : ALIGN(4) { FILL(0xff) @@ -118,17 +124,17 @@ SECTIONS *(.data*) . = ALIGN(4) ; _edata = . ; - } > RamLoc16 AT>MFlash128 + } > RamLoc AT> AppFlash - /* BSS section for RamAHB16 */ + /* BSS section for RamAHB */ .bss_RAM2 : ALIGN(4) { PROVIDE(__start_bss_RAM2 = .) ; *(.bss.$RAM2*) - *(.bss.$RamAHB16*) + *(.bss.$RamAHB*) . = ALIGN(4) ; PROVIDE(__end_bss_RAM2 = .) ; - } > RamAHB16 + } > RamAHB /* MAIN BSS SECTION */ .bss : ALIGN(4) @@ -139,15 +145,15 @@ SECTIONS . = ALIGN(4) ; _ebss = .; PROVIDE(end = .); - } > RamLoc16 + } > RamLoc - /* NOINIT section for RamAHB16 */ + /* NOINIT section for RamAHB */ .noinit_RAM2 (NOLOAD) : ALIGN(4) { *(.noinit_RAM2*) - *(.noinit_RamAHB16*) + *(.noinit_RamAHB*) . = ALIGN(4) ; - } > RamAHB16 + } > RamAHB /* DEFAULT NOINIT SECTION */ .noinit (NOLOAD): ALIGN(4) @@ -156,10 +162,13 @@ SECTIONS *(.noinit*) . = ALIGN(4) ; _end_noinit = .; - } > RamLoc16 + } > RamLoc PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .); - PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc16 - 0); - /* Add 6 to the sum to compensate for the lacking of the less significant bit (thumb mode) */ + PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc - 0); + + /* Add 6 to the sum to compensate for the lacking of the less + significant bit (thumb mode) */ + PROVIDE(_VectorChecksum = 0 - (_vStackTop + ResetISR + NMI_Handler + HardFault_Handler + MemManage_Handler + BusFault_Handler + UsageFault_Handler + 6 )); } diff --git a/linker/LPC1764_boot.ld b/port/ucontroller/nxp/lpc17xx/linker/LPC1764_boot.ld similarity index 61% rename from linker/LPC1764_boot.ld rename to port/ucontroller/nxp/lpc17xx/linker/LPC1764_boot.ld index 682480b0a..34a08832c 100644 --- a/linker/LPC1764_boot.ld +++ b/port/ucontroller/nxp/lpc17xx/linker/LPC1764_boot.ld @@ -2,27 +2,32 @@ MEMORY { /* Define each memory region */ /* First 8kB are reserved for bootloader */ - MFlash128 (rx) : ORIGIN = 0x0000, LENGTH = 8K /* 8K bytes */ - RamLoc16 (rwx) : ORIGIN = 0x10000000, LENGTH = 16K /* 16K bytes */ - RamAHB16 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K /* 16K bytes */ + BootFlash (r) : ORIGIN = 0x0000, LENGTH = 8K /* 8K bytes */ + AppFlash (rx) : ORIGIN = 0x2000, LENGTH = 56K /* 56K bytes */ + FWUpdateFlash (r) : ORIGIN = 0x10000, LENGTH = 64K /* 64K bytes */ + RamLoc (rwx) : ORIGIN = 0x10000000, LENGTH = 16K /* 16K bytes */ + RamAHB (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K /* 16K bytes */ } + __BootFlash_start = 0x0000; /* Bootloader start address (vector table) */ + __BootFlash_end = 0x1FFF; /* Bootloader end address (last byte) */ + __AppFlash_start = 0x2000; /* Application start address (vector table) */ + __AppFlash_end = 0x1FFF + 56K; /* Application end address (last byte) */ + __FWUpdateFlash_start = 0x10000; /* Firmware update region start address */ + __FWUpdateFlash_end = 0x0FFFF + 64K; /* Firmware update region end address (last byte) */ + + /* Last 256 bytes of flash reserved to the fw_info struct */ + __FWInfo_addr = __FWUpdateFlash_end - 255; + /* Define a symbol for the top of each memory region */ - __top_MFlash128 = 0x0000 + 8K; - __top_RamLoc16 = 0x10000000 + 16K; - __top_RamAHB16 = 0x2007c000 + 16K; + __top_BootFlash = 0x0000 + 8K; + __top_RamLoc = 0x10000000 + 16K; + __top_RamAHB = 0x2007c000 + 16K; ENTRY(ResetISR) -EXTERN(NMI_Handler) -EXTERN(HardFault_Handler) -EXTERN(MemManage_Handler) -EXTERN(BusFault_Handler) -EXTERN(UsageFault_Handler) SECTIONS { - - /* MAIN TEXT SECTION */ - .text : ALIGN(4) + .boot : ALIGN(4) { FILL(0xff) __vectors_start__ = ABSOLUTE(.) ; @@ -38,6 +43,9 @@ SECTIONS LONG(LOADADDR(.data_RAM2)); LONG( ADDR(.data_RAM2)); LONG( SIZEOF(.data_RAM2)); + LONG(LOADADDR(.text)); + LONG( ADDR(.text)); + LONG( SIZEOF(.text)); __data_section_table_end = .; __bss_section_table = .; LONG( ADDR(.bss)); @@ -49,16 +57,17 @@ SECTIONS /* End of Global Section Table */ *(.after_vectors*) + *(.boot*) + } > BootFlash - } >MFlash128 - + /* MAIN TEXT SECTION */ .text : ALIGN(4) { - *(.text*) + FILL(0xff) + *(.text*) *(.rodata .rodata.* .constdata .constdata.*) . = ALIGN(4); - - } > MFlash128 + } > RamLoc AT> BootFlash /* * for exception handling/unwind - some Newlib functions (in common @@ -67,29 +76,29 @@ SECTIONS .ARM.extab : ALIGN(4) { *(.ARM.extab* .gnu.linkonce.armextab.*) - } > MFlash128 + } > BootFlash __exidx_start = .; .ARM.exidx : ALIGN(4) { *(.ARM.exidx* .gnu.linkonce.armexidx.*) - } > MFlash128 + } > BootFlash __exidx_end = .; _etext = .; - /* DATA section for RamAHB16 */ + /* DATA section for RamAHB */ .data_RAM2 : ALIGN(4) { FILL(0xff) PROVIDE(__start_data_RAM2 = .) ; *(.ramfunc.$RAM2) - *(.ramfunc.$RamAHB16) + *(.ramfunc.$RamAHB) *(.data.$RAM2*) - *(.data.$RamAHB16*) + *(.data.$RamAHB*) . = ALIGN(4) ; PROVIDE(__end_data_RAM2 = .) ; - } > RamAHB16 AT>MFlash128 + } > RamAHB AT> BootFlash /* MAIN DATA SECTION */ @@ -98,9 +107,9 @@ SECTIONS KEEP(*(.bss.$RESERVED*)) . = ALIGN(4) ; _end_uninit_RESERVED = .; - } > RamLoc16 + } > RamLoc - /* Main DATA section (RamLoc16) */ + /* Main DATA section (RamLoc) */ .data : ALIGN(4) { FILL(0xff) @@ -110,36 +119,38 @@ SECTIONS *(.data*) . = ALIGN(4) ; _edata = . ; - } > RamLoc16 AT>MFlash128 + } > RamLoc AT> BootFlash - /* BSS section for RamAHB16 */ + /* BSS section for RamAHB */ .bss_RAM2 : ALIGN(4) { PROVIDE(__start_bss_RAM2 = .) ; *(.bss.$RAM2*) - *(.bss.$RamAHB16*) + *(.bss.$RamAHB*) . = ALIGN(4) ; PROVIDE(__end_bss_RAM2 = .) ; - } > RamAHB16 + } > RamAHB /* MAIN BSS SECTION */ .bss : ALIGN(4) { _bss = .; + __bss_start__ = .; *(.bss*) *(COMMON) . = ALIGN(4) ; _ebss = .; + __bss_end__ = .; PROVIDE(end = .); - } > RamLoc16 + } > RamLoc - /* NOINIT section for RamAHB16 */ + /* NOINIT section for RamAHB */ .noinit_RAM2 (NOLOAD) : ALIGN(4) { *(.noinit_RAM2*) - *(.noinit_RamAHB16*) + *(.noinit_RamAHB*) . = ALIGN(4) ; - } > RamAHB16 + } > RamAHB /* DEFAULT NOINIT SECTION */ .noinit (NOLOAD): ALIGN(4) @@ -148,10 +159,13 @@ SECTIONS *(.noinit*) . = ALIGN(4) ; _end_noinit = .; - } > RamLoc16 + } > RamLoc PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .); - PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc16 - 0); - /* Add 6 to the sum to compensate for the lacking of the less significant bit (thumb mode) */ + PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc - 0); + + /* Add 6 to the sum to compensate for the lacking of the less + significant bit (thumb mode) */ + PROVIDE(_VectorChecksum = 0 - (_vStackTop + ResetISR + NMI_Handler + HardFault_Handler + MemManage_Handler + BusFault_Handler + UsageFault_Handler + 6 )); } diff --git a/linker/LPC1769_app.ld b/port/ucontroller/nxp/lpc17xx/linker/LPC1768_app.ld similarity index 63% rename from linker/LPC1769_app.ld rename to port/ucontroller/nxp/lpc17xx/linker/LPC1768_app.ld index 6082659fb..bb90002b8 100644 --- a/linker/LPC1769_app.ld +++ b/port/ucontroller/nxp/lpc17xx/linker/LPC1768_app.ld @@ -1,23 +1,29 @@ MEMORY { /* Define each memory region */ - /* First 8kB are reserved for bootloader */ - /* Last 2 sectors (32kB each) are reserved for firmware upgrade */ - MFlash128 (rx) : ORIGIN = 0x2000, LENGTH = 440K /* 56K bytes */ - RamLoc16 (rwx) : ORIGIN = 0x10000000, LENGTH = 32K /* 16K bytes */ - RamAHB16 (rwx) : ORIGIN = 0x2007c000, LENGTH = 32K /* 16K bytes */ + /* Last 8 sectors (32kB each) are reserved for firmware upgrade */ + BootFlash (r) : ORIGIN = 0x0000, LENGTH = 8K /* 8K bytes */ + AppFlash (rx) : ORIGIN = 0x2000, LENGTH = 248K /* 248K bytes */ + FWUpdateFlash (r) : ORIGIN = 0x40000, LENGTH = 256K /* 256K bytes */ + RamLoc (rwx) : ORIGIN = 0x10000000, LENGTH = 32K /* 32K bytes */ + RamAHB (rwx) : ORIGIN = 0x2007c000, LENGTH = 32K /* 32K bytes */ } + __BootFlash_start = 0x0000; /* Bootloader start address (vector table) */ + __BootFlash_end = 0x1FFF; /* Bootloader end address (last byte) */ + __AppFlash_start = 0x2000; /* Application start address (vector table) */ + __AppFlash_end = 0x1FFF + 248K; /* Application end address (last byte) */ + __FWUpdateFlash_start = 0x40000; /* Firmware update region start address */ + __FWUpdateFlash_end = 0x3FFFF + 256K; /* Firmware update region end address (last byte) */ + + /* Last 256 bytes of flash reserved to the fw_info struct */ + __FWInfo_addr = __FWUpdateFlash_end - 255; + /* Define a symbol for the top of each memory region */ - __top_MFlash128 = 0x2000 + 440K; - __top_RamLoc16 = 0x10000000 + 32K; - __top_RamAHB16 = 0x2007c000 + 32K; + __top_AppFlash = 0x2000 + 248K; + __top_RamLoc = 0x10000000 + 32K; + __top_RamAHB = 0x2007c000 + 32K; ENTRY(ResetISR) -EXTERN(NMI_Handler) -EXTERN(HardFault_Handler) -EXTERN(MemManage_Handler) -EXTERN(BusFault_Handler) -EXTERN(UsageFault_Handler) SECTIONS { @@ -51,7 +57,7 @@ SECTIONS *(.after_vectors*) - } >MFlash128 + } > AppFlash .text : ALIGN(4) { @@ -59,14 +65,14 @@ SECTIONS *(.rodata .rodata.* .constdata .constdata.*) /* . = ALIGN(4); */ - } > MFlash128 + } > AppFlash .ipmi_handlers : ALIGN(32) { _ipmi_handlers = .; KEEP(*(.ipmi_handlers)) _eipmi_handlers = .; - } > MFlash128 + } > AppFlash /* * for exception handling/unwind - some Newlib functions (in common @@ -75,29 +81,29 @@ SECTIONS .ARM.extab : ALIGN(4) { *(.ARM.extab* .gnu.linkonce.armextab.*) - } > MFlash128 + } > AppFlash __exidx_start = .; .ARM.exidx : ALIGN(4) { *(.ARM.exidx* .gnu.linkonce.armexidx.*) - } > MFlash128 + } > AppFlash __exidx_end = .; _etext = .; - /* DATA section for RamAHB16 */ + /* DATA section for RamAHB */ .data_RAM2 : ALIGN(4) { FILL(0xff) PROVIDE(__start_data_RAM2 = .) ; *(.ramfunc.$RAM2) - *(.ramfunc.$RamAHB16) + *(.ramfunc.$RamAHB) *(.data.$RAM2*) - *(.data.$RamAHB16*) + *(.data.$RamAHB*) . = ALIGN(4) ; PROVIDE(__end_data_RAM2 = .) ; - } > RamAHB16 AT>MFlash128 + } > RamAHB AT> AppFlash /* MAIN DATA SECTION */ @@ -106,9 +112,9 @@ SECTIONS KEEP(*(.bss.$RESERVED*)) . = ALIGN(4) ; _end_uninit_RESERVED = .; - } > RamLoc16 + } > RamLoc - /* Main DATA section (RamLoc16) */ + /* Main DATA section (RamLoc) */ .data : ALIGN(4) { FILL(0xff) @@ -118,17 +124,17 @@ SECTIONS *(.data*) . = ALIGN(4) ; _edata = . ; - } > RamLoc16 AT>MFlash128 + } > RamLoc AT> AppFlash - /* BSS section for RamAHB16 */ + /* BSS section for RamAHB */ .bss_RAM2 : ALIGN(4) { PROVIDE(__start_bss_RAM2 = .) ; *(.bss.$RAM2*) - *(.bss.$RamAHB16*) + *(.bss.$RamAHB*) . = ALIGN(4) ; PROVIDE(__end_bss_RAM2 = .) ; - } > RamAHB16 + } > RamAHB /* MAIN BSS SECTION */ .bss : ALIGN(4) @@ -139,15 +145,15 @@ SECTIONS . = ALIGN(4) ; _ebss = .; PROVIDE(end = .); - } > RamLoc16 + } > RamLoc - /* NOINIT section for RamAHB16 */ + /* NOINIT section for RamAHB */ .noinit_RAM2 (NOLOAD) : ALIGN(4) { *(.noinit_RAM2*) - *(.noinit_RamAHB16*) + *(.noinit_RamAHB*) . = ALIGN(4) ; - } > RamAHB16 + } > RamAHB /* DEFAULT NOINIT SECTION */ .noinit (NOLOAD): ALIGN(4) @@ -156,10 +162,13 @@ SECTIONS *(.noinit*) . = ALIGN(4) ; _end_noinit = .; - } > RamLoc16 + } > RamLoc PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .); - PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc16 - 0); - /* Add 6 to the sum to compensate for the lacking of the less significant bit (thumb mode) */ + PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc - 0); + + /* Add 6 to the sum to compensate for the lacking of the less + significant bit (thumb mode) */ + PROVIDE(_VectorChecksum = 0 - (_vStackTop + ResetISR + NMI_Handler + HardFault_Handler + MemManage_Handler + BusFault_Handler + UsageFault_Handler + 6 )); } diff --git a/linker/LPC1769_boot.ld b/port/ucontroller/nxp/lpc17xx/linker/LPC1768_boot.ld similarity index 60% rename from linker/LPC1769_boot.ld rename to port/ucontroller/nxp/lpc17xx/linker/LPC1768_boot.ld index ed7abe1b1..70f5906bf 100644 --- a/linker/LPC1769_boot.ld +++ b/port/ucontroller/nxp/lpc17xx/linker/LPC1768_boot.ld @@ -2,27 +2,32 @@ MEMORY { /* Define each memory region */ /* First 8kB are reserved for bootloader */ - MFlash128 (rx) : ORIGIN = 0x0000, LENGTH = 8K /* 8K bytes */ - RamLoc16 (rwx) : ORIGIN = 0x10000000, LENGTH = 32K /* 32K bytes */ - RamAHB16 (rwx) : ORIGIN = 0x2007c000, LENGTH = 32K /* 32K bytes */ + BootFlash (rx) : ORIGIN = 0x0000, LENGTH = 8K /* 8K bytes */ + AppFlash (r) : ORIGIN = 0x2000, LENGTH = 248K /* 248K bytes */ + FWUpdateFlash (r) : ORIGIN = 0x40000, LENGTH = 256K /* 256K bytes */ + RamLoc (rwx) : ORIGIN = 0x10000000, LENGTH = 32K /* 32K bytes */ + RamAHB (rwx) : ORIGIN = 0x2007c000, LENGTH = 32K /* 32K bytes */ } + __BootFlash_start = 0x0000; /* Bootloader start address (vector table) */ + __BootFlash_end = 0x1FFF; /* Bootloader end address (last byte) */ + __AppFlash_start = 0x2000; /* Application start address (vector table) */ + __AppFlash_end = 0x1FFF + 248K; /* Application end address (last byte) */ + __FWUpdateFlash_start = 0x40000; /* Firmware update region start address */ + __FWUpdateFlash_end = 0x3FFFF + 256K; /* Firmware update region end address (last byte) */ + + /* Last 256 bytes of flash reserved to the fw_info struct */ + __FWInfo_addr = __FWUpdateFlash_end - 255; + /* Define a symbol for the top of each memory region */ - __top_MFlash128 = 0x0000 + 8K; - __top_RamLoc16 = 0x10000000 + 32K; - __top_RamAHB16 = 0x2007c000 + 32K; + __top_BootFlash = 0x0000 + 8K; + __top_RamLoc = 0x10000000 + 32K; + __top_RamAHB = 0x2007c000 + 32K; ENTRY(ResetISR) -EXTERN(NMI_Handler) -EXTERN(HardFault_Handler) -EXTERN(MemManage_Handler) -EXTERN(BusFault_Handler) -EXTERN(UsageFault_Handler) SECTIONS { - - /* MAIN TEXT SECTION */ - .text : ALIGN(4) + .boot : ALIGN(4) { FILL(0xff) __vectors_start__ = ABSOLUTE(.) ; @@ -38,6 +43,9 @@ SECTIONS LONG(LOADADDR(.data_RAM2)); LONG( ADDR(.data_RAM2)); LONG( SIZEOF(.data_RAM2)); + LONG(LOADADDR(.text)); + LONG( ADDR(.text)); + LONG( SIZEOF(.text)); __data_section_table_end = .; __bss_section_table = .; LONG( ADDR(.bss)); @@ -49,16 +57,17 @@ SECTIONS /* End of Global Section Table */ *(.after_vectors*) + *(.boot*) + } > BootFlash - } >MFlash128 - + /* MAIN TEXT SECTION */ .text : ALIGN(4) { - *(.text*) + FILL(0xff) + *(.text*) *(.rodata .rodata.* .constdata .constdata.*) . = ALIGN(4); - - } > MFlash128 + } > RamLoc AT> BootFlash /* * for exception handling/unwind - some Newlib functions (in common @@ -67,29 +76,29 @@ SECTIONS .ARM.extab : ALIGN(4) { *(.ARM.extab* .gnu.linkonce.armextab.*) - } > MFlash128 + } > BootFlash __exidx_start = .; .ARM.exidx : ALIGN(4) { *(.ARM.exidx* .gnu.linkonce.armexidx.*) - } > MFlash128 + } > BootFlash __exidx_end = .; _etext = .; - /* DATA section for RamAHB16 */ + /* DATA section for RamAHB */ .data_RAM2 : ALIGN(4) { FILL(0xff) PROVIDE(__start_data_RAM2 = .) ; *(.ramfunc.$RAM2) - *(.ramfunc.$RamAHB16) + *(.ramfunc.$RamAHB) *(.data.$RAM2*) - *(.data.$RamAHB16*) + *(.data.$RamAHB*) . = ALIGN(4) ; PROVIDE(__end_data_RAM2 = .) ; - } > RamAHB16 AT>MFlash128 + } > RamAHB AT> BootFlash /* MAIN DATA SECTION */ @@ -98,9 +107,9 @@ SECTIONS KEEP(*(.bss.$RESERVED*)) . = ALIGN(4) ; _end_uninit_RESERVED = .; - } > RamLoc16 + } > RamLoc - /* Main DATA section (RamLoc16) */ + /* Main DATA section (RamLoc) */ .data : ALIGN(4) { FILL(0xff) @@ -110,36 +119,38 @@ SECTIONS *(.data*) . = ALIGN(4) ; _edata = . ; - } > RamLoc16 AT>MFlash128 + } > RamLoc AT> BootFlash - /* BSS section for RamAHB16 */ + /* BSS section for RamAHB */ .bss_RAM2 : ALIGN(4) { PROVIDE(__start_bss_RAM2 = .) ; *(.bss.$RAM2*) - *(.bss.$RamAHB16*) + *(.bss.$RamAHB*) . = ALIGN(4) ; PROVIDE(__end_bss_RAM2 = .) ; - } > RamAHB16 + } > RamAHB /* MAIN BSS SECTION */ .bss : ALIGN(4) { _bss = .; + __bss_start__ = .; *(.bss*) *(COMMON) . = ALIGN(4) ; _ebss = .; + __bss_end__ = .; PROVIDE(end = .); - } > RamLoc16 + } > RamLoc - /* NOINIT section for RamAHB16 */ + /* NOINIT section for RamAHB */ .noinit_RAM2 (NOLOAD) : ALIGN(4) { *(.noinit_RAM2*) - *(.noinit_RamAHB16*) + *(.noinit_RamAHB*) . = ALIGN(4) ; - } > RamAHB16 + } > RamAHB /* DEFAULT NOINIT SECTION */ .noinit (NOLOAD): ALIGN(4) @@ -148,10 +159,13 @@ SECTIONS *(.noinit*) . = ALIGN(4) ; _end_noinit = .; - } > RamLoc16 + } > RamLoc PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .); - PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc16 - 0); - /* Add 6 to the sum to compensate for the lacking of the less significant bit (thumb mode) */ + PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc - 0); + + /* Add 6 to the sum to compensate for the lacking of the less + significant bit (thumb mode) */ + PROVIDE(_VectorChecksum = 0 - (_vStackTop + ResetISR + NMI_Handler + HardFault_Handler + MemManage_Handler + BusFault_Handler + UsageFault_Handler + 6 )); } diff --git a/port/ucontroller/nxp/lpc17xx/lpc17_hpm.c b/port/ucontroller/nxp/lpc17xx/lpc17_hpm.c index e7d14b265..77204b5e9 100644 --- a/port/ucontroller/nxp/lpc17xx/lpc17_hpm.c +++ b/port/ucontroller/nxp/lpc17xx/lpc17_hpm.c @@ -30,130 +30,296 @@ #include "lpc17_hpm.h" #include "iap.h" #include "modules/ipmi.h" -#include "boot/boot.h" -#include "modules/watchdog.h" -#include "string.h" +#include "modules/sys_utils.h" +#include +#include "arm_cm3_reset.h" + +bool finish_upload_success = false; + +typedef struct +{ + uint8_t version[3]; + uint8_t fw_type; + uint32_t magic; + uint8_t RESERVED[248]; +} fw_info; + +/* + * Flash symbols defined in the linker script + */ +extern const uint32_t __AppFlash_start; +extern const uint32_t __AppFlash_end; +extern const uint32_t __BootFlash_start; +extern const uint32_t __BootFlash_end; +extern const uint32_t __FWUpdateFlash_start; +extern const uint32_t __FWUpdateFlash_end; +extern const fw_info __FWInfo_addr; + +const uint32_t* app_start_addr = &__AppFlash_start; +const uint32_t* app_end_addr = &__AppFlash_end; +const uint32_t* boot_start_addr = &__BootFlash_start; +const uint32_t* boot_end_addr = &__BootFlash_end; +const uint32_t* update_start_addr = &__FWUpdateFlash_start; +const uint32_t* update_end_addr = &__FWUpdateFlash_end; + +const fw_info* fw_header = &__FWInfo_addr; uint32_t ipmc_page_addr = 0; uint32_t ipmc_image_size = 0; -uint32_t ipmc_pg_index = 0; +uint32_t ipmc_page_byte_index = 0; uint32_t ipmc_page[64]; -uint8_t ipmc_hpm_prepare_comp( void ) +static uint8_t get_sector_number(const void* flash_addr) +{ + uint8_t ret = 0; + const uint32_t flash = (const uint32_t)flash_addr; + + if (flash < 0x10000) { + ret = (flash / 0x1000); + } else { + ret = ((flash - 0x10000) / 0x8000) + 16; + } + return ret; +} + +uint8_t hpm_prepare_comp(enum memory_area area) { + finish_upload_success = false; ipmc_image_size = 0; - ipmc_pg_index = 0; + ipmc_page_byte_index = 0; ipmc_page_addr = 0; - for(uint32_t i=0; i<(sizeof(ipmc_page)/sizeof(uint32_t)); i++) { + uint8_t ret = IPMI_CC_OK; + + for (uint32_t i=0; i<(sizeof(ipmc_page)/sizeof(uint32_t)); i++) { ipmc_page[i] = 0xFFFFFFFF; } + const uint32_t *start, *end; - if (ipmc_erase_sector(IPMC_UPDATE_SECTOR_START, IPMC_UPDATE_SECTOR_END) != IAP_CMD_SUCCESS) { - return IPMI_CC_UNSPECIFIED_ERROR; + if (area == BOOT_FLASH) { + start = boot_start_addr; + end = boot_end_addr; + } else if (area == FW_UPDATE_FLASH) { + start = update_start_addr; + end = update_end_addr; + } else { + return IPMI_CC_PARAM_OUT_OF_RANGE; } - return IPMI_CC_OK; + + /* Checks flash update region integrity */ + for (const uint32_t *ptr = start; ptr <= end; ptr++) { + if (*ptr != 0xFFFFFFFF) { + const uint32_t sec = get_sector_number(ptr); + + /* Erases flash update region sector */ + /* + * This procedure locks the flash, preventing code execution + * until it finishes. This can take tens of ms for multiple + * sector erases, and for all this time no interrupt + * exceptions can be served. + * + * For LPC1768 devices it would cause the HPM update to fail + * as it wouldn't answer the ipmi request in time. + */ + ret = ipmc_erase_sector(sec, sec); + + if (ret != IPMI_CC_OK) break; + } + } + + return ret; +} + +uint8_t ipmc_hpm_prepare_comp(void) +{ + return hpm_prepare_comp(FW_UPDATE_FLASH); } -uint8_t ipmc_hpm_upload_block( uint8_t * block, uint16_t size ) +uint8_t bootloader_hpm_prepare_comp(void) { - uint8_t remaining_bytes_start; + return hpm_prepare_comp(BOOT_FLASH); +} - if ( sizeof(ipmc_page)/4 - ipmc_pg_index > size/4) { +uint8_t hpm_upload_block(uint8_t *block, uint16_t size, enum memory_area area) +{ + const uint32_t ipmc_page_available_bytes_n = sizeof(ipmc_page) - ipmc_page_byte_index; + + if (ipmc_page_available_bytes_n >= size) { /* Our page is not full yet, just append the new data */ - for (uint16_t i =0; i < size; i+=4, ipmc_pg_index++) { - ipmc_page[ipmc_pg_index] = (block[i+3] << 24)|(block[i+2] << 16)|(block[i+1] << 8)|(block[i]); - } + memcpy(&((uint8_t *)ipmc_page)[ipmc_page_byte_index], block, size); + ipmc_page_byte_index += size; return IPMI_CC_OK; } else { /* Complete the remaining bytes on the buffer */ - remaining_bytes_start = (sizeof(ipmc_page)/4 - ipmc_pg_index)*4; - - for (uint16_t i =0; ipmc_pg_index < sizeof(ipmc_page)/4 ; i+=4, ipmc_pg_index++) { - ipmc_page[ipmc_pg_index] = (block[i+3] << 24)|(block[i+2] << 16)|(block[i+1] << 8)|(block[i]); - } + memcpy(&((uint8_t *)ipmc_page)[ipmc_page_byte_index], block, ipmc_page_available_bytes_n); + ipmc_page_byte_index = 0; /* Program the complete page in the Flash */ - ipmc_program_page( ipmc_page_addr, ipmc_page, sizeof(ipmc_page)); + program_page(ipmc_page_addr, ipmc_page, sizeof(ipmc_page), area); /* Advance the address counter */ ipmc_page_addr += sizeof(ipmc_page); ipmc_image_size += sizeof(ipmc_page); - /* Empty our buffer and reset the index */ - for(uint32_t i=0; i<(sizeof(ipmc_page)/sizeof(uint32_t)); i++) { - ipmc_page[i] = 0xFFFFFFFF; - } - ipmc_pg_index = 0; + /* Empty our buffer */ + memset((uint8_t *)ipmc_page, 0xFF, sizeof(ipmc_page)); /* Save the trailing bytes */ - for (uint8_t i =0; i <(size-remaining_bytes_start); i+=4) { - ipmc_page[ipmc_pg_index++] = (block[i+3+remaining_bytes_start] << 24)|(block[i+2+remaining_bytes_start] << 16)|(block[i+1+remaining_bytes_start] << 8)|(block[i+remaining_bytes_start]); - } + memcpy((uint8_t *)ipmc_page, &block[ipmc_page_available_bytes_n], size - ipmc_page_available_bytes_n); + ipmc_page_byte_index += size - ipmc_page_available_bytes_n; return IPMI_CC_COMMAND_IN_PROGRESS; } } -uint8_t ipmc_hpm_finish_upload( uint32_t image_size ) +uint8_t ipmc_hpm_upload_block(uint8_t *block, uint16_t size) +{ + return hpm_upload_block(block, size, FW_UPDATE_FLASH); +} + +uint8_t bootloader_hpm_upload_block(uint8_t *block, uint16_t size) +{ + return hpm_upload_block(block, size, BOOT_FLASH); +} + +uint8_t hpm_finish_upload(uint32_t image_size, enum memory_area area) { /* Check if the last page was already programmed */ - if (ipmc_pg_index != 0) { + if(ipmc_page_byte_index != 0) { /* Program the complete page in the Flash */ - ipmc_program_page( ipmc_page_addr, ipmc_page, sizeof(ipmc_page)); - ipmc_image_size += ipmc_pg_index*4; - ipmc_pg_index = 0; + program_page( ipmc_page_addr, ipmc_page, sizeof(ipmc_page), area); + ipmc_image_size += ipmc_page_byte_index; + ipmc_page_byte_index = 0; ipmc_page_addr = 0; } - if (ipmc_image_size != image_size) { - /* HPM CC: Number of bytes received does not match the size provided in the "Finish firmware upload" request */ + if (ipmc_image_size != image_size || + ipmc_image_size == 0) { + /* + * HPM CC: Number of bytes received does not match the size provided in the "Finish firmware upload" request + * or no bytes where received. + */ return 0x81; } - /* Copy the last page (we'll change only the last word) */ - memcpy(ipmc_page, (uint32_t *) (UPGRADE_FLASH_END_ADDR-256), sizeof(ipmc_page)); + finish_upload_success = true; + return IPMI_CC_OK; +} - /* TODO: Write actual firmware ID */ - /* Write bootloader magic word */ - ipmc_page[63] = 0x55555555; - ipmc_program_page( UPGRADE_FLASH_END_ADDR-IPMC_UPDATE_ADDRESS_OFFSET-256, ipmc_page, sizeof(ipmc_page)); +uint8_t ipmc_hpm_finish_upload(uint32_t image_size) +{ + return hpm_finish_upload(image_size, FW_UPDATE_FLASH); +} + +uint8_t bootloader_hpm_finish_upload(uint32_t image_size) +{ + return hpm_finish_upload(image_size, BOOT_FLASH); +} +uint8_t ipmc_hpm_get_upgrade_status(void) +{ + /* The IAP commands run when they're called and block the firmware. Long commands would cause timeouts on the IPMB */ return IPMI_CC_OK; } -uint8_t ipmc_hpm_get_upgrade_status( void ) +uint8_t bootloader_hpm_get_upgrade_status(void) { /* The IAP commands run when they're called and block the firmware. Long commands would cause timeouts on the IPMB */ return IPMI_CC_OK; } -uint8_t ipmc_hpm_activate_firmware( void ) +uint8_t ipmc_hpm_activate_firmware(void) { - /* Schedule a reset in the next watchdog task cycle, inhibiting the task to feed its counter */ - watchdog_reset_mcu(); + /* + * Doesn't write the magic word if the function hpm_finish_upload fails + */ + + if (!finish_upload_success) { + return IPMI_CC_UNSPECIFIED_ERROR; + } + fw_info fw_update_header; + memset(&fw_update_header, 0xFF, sizeof(fw_update_header)); + + /* + * Write firmware update record to inform the bootloader that a + * new firmware is available. + * + * TODO: Write actual firmware ID + */ + fw_update_header.magic = 0xAAAAAAAA; + fw_update_header.fw_type = 1; // Update application + fw_update_header.version[0] = 1; + fw_update_header.version[1] = 4; + fw_update_header.version[2] = 1; + + program_page((uint32_t)fw_header - (uint32_t)update_start_addr, (uint32_t*)&fw_update_header, sizeof(fw_update_header), FW_UPDATE_FLASH); + + /* + * Schedule a reset to 500ms from now + */ + sys_schedule_reset(500); + + return IPMI_CC_OK; +} + +uint8_t bootloader_hpm_activate_firmware(void) +{ + /* + * Doesn't activate the firmware if the function hpm_finish_upload fails + */ + + if (!finish_upload_success) { + return IPMI_CC_UNSPECIFIED_ERROR; + } + + sys_schedule_reset(500); return IPMI_CC_OK; } -uint8_t ipmc_program_page( uint32_t address, uint32_t * data, uint32_t size ) +uint8_t program_page(uint32_t address, uint32_t *data, uint32_t size, enum memory_area area) { + uint32_t update_start_sec, update_end_sec; + + portDISABLE_INTERRUPTS(); + if (size % 256) { /* Data should be a 256 byte boundary */ return IPMI_CC_PARAM_OUT_OF_RANGE; } - portDISABLE_INTERRUPTS(); + if (area == BOOT_FLASH) { + update_start_sec = get_sector_number(boot_start_addr); + update_end_sec = get_sector_number(boot_end_addr); - if (Chip_IAP_PreSectorForReadWrite( IPMC_UPDATE_SECTOR_START, IPMC_UPDATE_SECTOR_END ) != IAP_CMD_SUCCESS) { - portENABLE_INTERRUPTS(); - return IPMI_CC_UNSPECIFIED_ERROR; - } + if (Chip_IAP_PreSectorForReadWrite(update_start_sec, update_end_sec) != IAP_CMD_SUCCESS) { + portENABLE_INTERRUPTS(); + return IPMI_CC_UNSPECIFIED_ERROR; + } - if (Chip_IAP_CopyRamToFlash( IPMC_UPDATE_ADDRESS_OFFSET + address, data, size )) { - portENABLE_INTERRUPTS(); - return IPMI_CC_UNSPECIFIED_ERROR; + if (Chip_IAP_CopyRamToFlash((uint32_t)boot_start_addr + address, data, size)) { + portENABLE_INTERRUPTS(); + return IPMI_CC_UNSPECIFIED_ERROR; + } + + } else if (area == FW_UPDATE_FLASH) { + update_start_sec = get_sector_number(update_start_addr); + update_end_sec = get_sector_number(update_end_addr); + + if (Chip_IAP_PreSectorForReadWrite(update_start_sec, update_end_sec) != IAP_CMD_SUCCESS) { + portENABLE_INTERRUPTS(); + return IPMI_CC_UNSPECIFIED_ERROR; + } + + if (Chip_IAP_CopyRamToFlash((uint32_t)update_start_addr + address, data, size)) { + portENABLE_INTERRUPTS(); + return IPMI_CC_UNSPECIFIED_ERROR; + } + + + } else { + return IPMI_CC_PARAM_OUT_OF_RANGE; } portENABLE_INTERRUPTS(); @@ -163,11 +329,11 @@ uint8_t ipmc_program_page( uint32_t address, uint32_t * data, uint32_t size ) uint8_t ipmc_erase_sector( uint32_t sector_start, uint32_t sector_end) { portDISABLE_INTERRUPTS(); - if (Chip_IAP_PreSectorForReadWrite( sector_start, sector_end ) != IAP_CMD_SUCCESS) { + if (Chip_IAP_PreSectorForReadWrite(sector_start, sector_end) != IAP_CMD_SUCCESS) { portENABLE_INTERRUPTS(); return IPMI_CC_UNSPECIFIED_ERROR; } - if (Chip_IAP_EraseSector( sector_start, sector_end ) != IAP_CMD_SUCCESS) { + if (Chip_IAP_EraseSector(sector_start, sector_end) != IAP_CMD_SUCCESS) { portENABLE_INTERRUPTS(); return IPMI_CC_UNSPECIFIED_ERROR; } diff --git a/port/ucontroller/nxp/lpc17xx/lpc17_hpm.h b/port/ucontroller/nxp/lpc17xx/lpc17_hpm.h index 9c28b1cc2..b3ff11ea8 100644 --- a/port/ucontroller/nxp/lpc17xx/lpc17_hpm.h +++ b/port/ucontroller/nxp/lpc17xx/lpc17_hpm.h @@ -34,10 +34,22 @@ #define IPMC_UPDATE_SECTOR_END 0x11 #define IPMC_UPDATE_ADDRESS_OFFSET (IPMC_UPDATE_SECTOR_START << 12) -uint8_t ipmc_hpm_prepare_comp( void ); -uint8_t ipmc_hpm_upload_block( uint8_t * block, uint16_t size ); -uint8_t ipmc_hpm_finish_upload( uint32_t image_size ); -uint8_t ipmc_hpm_activate_firmware( void ); -uint8_t ipmc_hpm_get_upgrade_status( void ); -uint8_t ipmc_program_page( uint32_t address, uint32_t * data, uint32_t size ); -uint8_t ipmc_erase_sector( uint32_t sector_start, uint32_t sector_end); +enum memory_area { + BOOT_FLASH, + FW_UPDATE_FLASH +}; + +uint8_t ipmc_hpm_prepare_comp(void); +uint8_t ipmc_hpm_upload_block(uint8_t *block, uint16_t size); +uint8_t ipmc_hpm_finish_upload(uint32_t image_size); +uint8_t ipmc_hpm_activate_firmware(void); +uint8_t ipmc_hpm_get_upgrade_status(void); +uint8_t program_page(uint32_t address, uint32_t *data, uint32_t size, enum memory_area area); +uint8_t ipmc_erase_sector(uint32_t sector_start, uint32_t sector_end); + + +uint8_t bootloader_hpm_prepare_comp(void); +uint8_t bootloader_hpm_upload_block(uint8_t *block, uint16_t size); +uint8_t bootloader_hpm_finish_upload(uint32_t image_size); +uint8_t bootloader_hpm_activate_firmware(void); +uint8_t bootloader_hpm_get_upgrade_status(void); diff --git a/port/ucontroller/nxp/lpc17xx/lpc17_ssp.c b/port/ucontroller/nxp/lpc17xx/lpc17_ssp.c index ae46fc631..35b9feb67 100644 --- a/port/ucontroller/nxp/lpc17xx/lpc17_ssp.c +++ b/port/ucontroller/nxp/lpc17xx/lpc17_ssp.c @@ -35,11 +35,13 @@ static ssp_config_t ssp_cfg[MAX_SSP_INTERFACES] = { .irq = SSP0_IRQn, .ssel_pin = SSP0_SSEL, }, +#ifdef MODULE_FLASH_SPI [FLASH_SPI] = { .lpc_id = LPC_SSP1, .irq = SSP1_IRQn, .ssel_pin = SSP1_SSEL, } +#endif }; static void ssp_irq_handler( LPC_SSP_T * ssp_id ) diff --git a/port/ucontroller/nxp/lpc17xx/port.h b/port/ucontroller/nxp/lpc17xx/port.h index 6d24a23a9..716834557 100644 --- a/port/ucontroller/nxp/lpc17xx/port.h +++ b/port/ucontroller/nxp/lpc17xx/port.h @@ -41,6 +41,7 @@ #include "lpc17_power.h" #include "lpc17_pincfg.h" #include "pin_mapping.h" +#include "arm_cm3_reset.h" #ifdef UART_RINGBUFFER #include "lpc17_uartrb.h" diff --git a/probe/lpclink.cmake b/probe/lpclink.cmake deleted file mode 100644 index 078d3a9c1..000000000 --- a/probe/lpclink.cmake +++ /dev/null @@ -1,82 +0,0 @@ -##Program command -if(NOT DEBUG_PROBE) - set(DEBUG_PROBE "LPCLink") -endif() - -string(TOUPPER ${DEBUG_PROBE} DEBUG_PROBE_UPPERCASE) - -if(${DEBUG_PROBE_UPPERCASE} MATCHES "^(LPCLINK)$") - set(DFU_DEVICE "0x0471:0xDF55") - set(DFU_FIRMWARE "LPCXpressoWIN.enc") - set(NXP_PROG_NAME "crt_emu_cm3_nxp") - set(NXP_PROG_FLAGS "-wire=winusb") -elseif(${DEBUG_PROBE_UPPERCASE} MATCHES "^(LPCLINK2)$") - set(DFU_DEVICE "0x1FC9:0x000C") - set(NXP_PROG_NAME "crt_emu_cm_redlink") - set(DFU_FIRMWARE "LPC432x_CMSIS_DAP_V5_173.bin.hdr") - set(NXP_PROG_FLAGS "") -else() - message(FATAL_ERROR "${DEBUG_PROBE} not implemented!") -endif() - -message(STATUS "Selected debug probe: ${DEBUG_PROBE}") - -set(LPCXPRESSO_INSTALL_PATH /usr/local/lpcxpresso/lpcxpresso/bin) - -find_program(DFU_UTIL dfu-util) -if(NOT DFU_UTIL) - message(WARNING "${ColourBold}${Red}Dfu-util not found! Can't boot the programmer board!${ColourReset}") -endif() - -find_program(NXP_PROG ${NXP_PROG_NAME} PATHS ${LPCXPRESSO_INSTALL_PATH}) -if(NOT NXP_PROG) - message(WARNING "${ColourBold}${Red}${NXP_PROG_NAME} not found! Can't program the controller!${ColourReset}") -else() - get_filename_component( DFU_FIRMWARE_PATH ${NXP_PROG} DIRECTORY ) -endif() - -# Program the chip (available only for LPC1764 so far) -add_custom_target(program_boot - WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ - DEPENDS bootloader - #Boot the programmer - COMMAND ${DFU_UTIL} -d ${DFU_DEVICE} -c 0 -t 2048 -R -D ${DFU_FIRMWARE_PATH}/${DFU_FIRMWARE} || true - #Write bootloader firmware - COMMAND ${NXP_PROG} -p${TARGET_CONTROLLER} -g ${NXP_PROG_FLAGS} -flash-load=bootloader.bin -load-base=0x0000 - ) - -add_custom_target(program_app - WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ - DEPENDS ${CMAKE_PROJECT_NAME} - #Boot the programmer - COMMAND ${DFU_UTIL} -d ${DFU_DEVICE} -c 0 -t 2048 -R -D ${DFU_FIRMWARE_PATH}/${DFU_FIRMWARE} || true - #Write application firmware - COMMAND ${NXP_PROG} -p${TARGET_CONTROLLER} -g ${NXP_PROG_FLAGS} -flash-load-exec=${CMAKE_PROJECT_NAME}.bin -load-base=0x2000 - ) - -add_custom_target(program_all - WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ - DEPENDS ${CMAKE_PROJECT_NAME} bootloader - COMMAND ${DFU_UTIL} -d ${DFU_DEVICE} -c 0 -t 2048 -R -D ${DFU_FIRMWARE_PATH}/${DFU_FIRMWARE} || true - #Write application and bootloader firmwares - COMMAND ${NXP_PROG} -p${TARGET_CONTROLLER} -g ${NXP_PROG_FLAGS} -flash-mass-erase - COMMAND sleep 0.5 - COMMAND make -C ${CMAKE_BINARY_DIR} program_boot - COMMAND sleep 0.5 - COMMAND make -C ${CMAKE_BINARY_DIR} program_app - ) - -add_custom_target(full_binary - WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ - DEPENDS ${CMAKE_PROJECT_NAME} bootloader - #Create a pad file with the total size of the bootloader (0x2000) - COMMAND dd if=/dev/zero bs=1 count=8192 | tr \"\\000\" \"\\377\" > bootloader_pad.bin - #Add padding bytes to the bootloader binary - COMMAND dd if=bootloader.bin of=bootloader_pad.bin conv=notrunc - #Concatenate bootloader and app binaries - COMMAND cat bootloader_pad.bin ${CMAKE_PROJECT_NAME}.bin > openMMC_full.bin - - #Program full_binary (for tests only) - #COMMAND ${DFU_UTIL} -d ${DFU_DEVICE} -c 0 -t 2048 -R -D ${DFU_FIRMWARE_PATH}/${DFU_FIRMWARE} || true - #COMMAND ${NXP_PROG} ${NXP_PROG_FLAGS} -flash-load-exec=openMMC_full.bin -load-base=0x0 - ) diff --git a/probe/lpclink1-flash.sh b/probe/lpclink1-flash.sh new file mode 100644 index 000000000..9503d3902 --- /dev/null +++ b/probe/lpclink1-flash.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +firmware="$1" +device="$2" +address="$3" + +if [ -z "$firmware" ] || [ -z "$device" ]; then + printf "Usage: $0 firmware.bin device [address]\n" + exit 1 +fi + +if [ -z "$address" ]; then + address=0x0000 +fi + +if [ -z "$MCUXPRESSOIDE_BIN" ]; then + MCUXPRESSOIDE_BIN=/usr/local/mcuxpressoide/ide/binaries/ +fi + +"${MCUXPRESSOIDE_BIN}/boot_link1" + +set -e + +"${MCUXPRESSOIDE_BIN}/crt_emu_cm_redlink" -g -flash-load="$firmware" -load-base="$address" -p ${device} diff --git a/probe/openocd.cfg.in b/probe/openocd.cfg.in new file mode 100644 index 000000000..7ce39aabb --- /dev/null +++ b/probe/openocd.cfg.in @@ -0,0 +1,11 @@ +source [find ${OPENOCD_DEBUG_PROBE_FILE}] + +transport select ${OPENOCD_TRANSPORT} + +source [find target/${OPENOCD_TARGET}.cfg] + +adapter speed 3000 + +$_TARGETNAME configure -event gdb-attach { + halt +} diff --git a/probe/openocd.cmake b/probe/openocd.cmake new file mode 100644 index 000000000..6f8636b88 --- /dev/null +++ b/probe/openocd.cmake @@ -0,0 +1,88 @@ +##Program command + +function(check_probe_transport transport_list selected_transport) + set(transport_available FALSE) + foreach(transport IN LISTS transport_list) + if(${selected_transport} STREQUAL ${transport}) + set(transport_available TRUE) + endif() + endforeach() + if(NOT transport_available) + message(FATAL_ERROR "Debug probe does not support transport type '${selected_transport}'") + endif() +endfunction() + +if(NOT DEBUG_PROBE) + message(NOTICE "No debug probe selected! Targets program_boot, program_app and program_all will not be generated!") +else() + + if(NOT OPENOCD_TRANSPORT) + message(NOTICE "No debug probe transport set, 'jtag' selected by default.") + set(OPENOCD_TRANSPORT "jtag") + endif() + + # Selects the OpenOCD debug probe file + if(${DEBUG_PROBE} STREQUAL "digilent_jtag_hs3") + set(OPENOCD_DEBUG_PROBE_FILE "interface/ftdi/digilent_jtag_hs3.cfg") + check_probe_transport("jtag" ${OPENOCD_TRANSPORT}) + elseif(${DEBUG_PROBE} STREQUAL "cmsis-dap") + set(OPENOCD_DEBUG_PROBE_FILE "interface/cmsis-dap.cfg") + check_probe_transport("jtag;swd" ${OPENOCD_TRANSPORT}) + elseif(${DEBUG_PROBE} STREQUAL "jlink") + set(OPENOCD_DEBUG_PROBE_FILE "interface/jlink.cfg") + check_probe_transport("jtag;swd" ${OPENOCD_TRANSPORT}) + else() + message(FATAL_ERROR "${DEBUG_PROBE} not supported!") + endif() + + message(STATUS "Selected debug probe: ${DEBUG_PROBE}") + + if(${TARGET_CONTROLLER} MATCHES "^([lL][pP][cC]17[0-9][0-9])") + set(OPENOCD_TARGET lpc17xx) + else() + message(FATAL_ERROR "Target ${TARGET_CONTROLLER} not supported") + endif() + + configure_file(probe/openocd.cfg.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/openocd.cfg) + + # FIXME: The program_* targets hardcodes the program memory + # addresses for the application and bootloader. This might be + # different for other microcontrollers. Ideally, OpenOCD should use + # the ELF files to program those, but from my tests, it doesn't work + # because OpenOCD erases all flash before writing the binary from + # the ELF file. + add_custom_target(program_boot + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ + DEPENDS newboot + #Write bootloader firmware + COMMAND openocd -f openocd.cfg -c "init" -c "program newboot.bin 0x0000 verify" -c "reset run" -c "shutdown" + ) + + add_custom_target(program_app + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ + DEPENDS ${CMAKE_PROJECT_NAME} + #Write application firmware + COMMAND openocd -f openocd.cfg -c "init" -c "program ${CMAKE_PROJECT_NAME}.bin 0x2000 verify" -c "reset run" -c "shutdown" + ) + + add_custom_target(program_all + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ + DEPENDS ${CMAKE_PROJECT_NAME} newboot + #Erase all flash + COMMAND openocd -f openocd.cfg -c "init" -c "halt" -c "flash erase_sector 0 0 last" -c "flash erase_check 0" -c "shutdown" + #Write application and bootloader firmwares + COMMAND make -C ${CMAKE_BINARY_DIR} program_boot + COMMAND make -C ${CMAKE_BINARY_DIR} program_app + ) +endif() + +add_custom_target(full_binary + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ + DEPENDS ${CMAKE_PROJECT_NAME} newboot + #Create a pad file with the total size of the bootloader (0x2000) + COMMAND dd if=/dev/zero bs=1 count=8192 | tr \"\\000\" \"\\377\" > newboot_pad.bin + #Add padding bytes to the bootloader binary + COMMAND dd if=newboot.bin of=newboot_pad.bin conv=notrunc + #Concatenate bootloader and app binaries + COMMAND cat newboot_pad.bin ${CMAKE_PROJECT_NAME}.bin > openMMC_full.bin + ) diff --git a/toolchain/toolchain-arm-none-eabi.cmake b/toolchain/toolchain-arm-none-eabi.cmake index 21cd66daa..2e5aca61e 100644 --- a/toolchain/toolchain-arm-none-eabi.cmake +++ b/toolchain/toolchain-arm-none-eabi.cmake @@ -26,7 +26,7 @@ set( CMAKE_OBJCOPY ${TC_PATH}${CROSS_COMPILE}objcopy set( CMAKE_OBJDUMP ${TC_PATH}${CROSS_COMPILE}objdump CACHE FILEPATH "The toolchain objdump command " FORCE ) -set(COMMON_FLAGS "-fno-common -fno-builtin -ffunction-sections -fdata-sections -fno-strict-aliasing -fmessage-length=0") +set(COMMON_FLAGS "-fno-common -fno-builtin-printf -ffunction-sections -fdata-sections -fno-strict-aliasing -fmessage-length=0") set(CMAKE_C_FLAGS "${COMMON_FLAGS} -std=gnu99") set(CMAKE_CXX_FLAGS "${COMMON_FLAGS} -std=gnu++0x") -set(CMAKE_EXE_LINKER_FLAGS "-Wl,-gc-sections --specs=nosys.specs -nostdlib -static -nostartfiles") +set(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections,--undefined=uxTopUsedPriority --specs=nano.specs -nostartfiles")