From 63e541917bab4f5486f795b93fd220bfe5d63898 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Sun, 7 Apr 2013 18:49:53 +0000 Subject: [PATCH] Add SAM4L demo. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1850 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- .../FreeRTOS_Demo.atsln | 20 + .../FreeRTOS_Demo.cproj | 868 + .../jlink.config | 31 + .../src/ParTest.c | 123 + .../src/SAM4L_low_power_tick_management.c | 395 + .../CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf.h | 92 + .../src/asf/common/boards/board.h | 328 + .../src/asf/common/services/clock/dfll.h | 399 + .../src/asf/common/services/clock/genclk.h | 178 + .../src/asf/common/services/clock/osc.h | 164 + .../src/asf/common/services/clock/pll.h | 320 + .../asf/common/services/clock/sam4l/dfll.c | 175 + .../asf/common/services/clock/sam4l/dfll.h | 373 + .../asf/common/services/clock/sam4l/genclk.h | 238 + .../src/asf/common/services/clock/sam4l/osc.c | 222 + .../src/asf/common/services/clock/sam4l/osc.h | 504 + .../src/asf/common/services/clock/sam4l/pll.c | 88 + .../src/asf/common/services/clock/sam4l/pll.h | 253 + .../asf/common/services/clock/sam4l/sysclk.c | 1008 + .../asf/common/services/clock/sam4l/sysclk.h | 815 + .../src/asf/common/services/clock/sysclk.h | 173 + .../src/asf/common/services/ioport/ioport.h | 536 + .../common/services/ioport/sam/ioport_gpio.h | 302 + .../common/services/sleepmgr/sam4l/sleepmgr.c | 50 + .../common/services/sleepmgr/sam4l/sleepmgr.h | 124 + .../asf/common/services/sleepmgr/sleepmgr.h | 244 + .../src/asf/common/utils/interrupt.h | 139 + .../utils/interrupt/interrupt_sam_nvic.c | 47 + .../utils/interrupt/interrupt_sam_nvic.h | 169 + .../src/asf/common/utils/parts.h | 889 + .../src/asf/sam/boards/sam4l_ek/init.c | 220 + .../src/asf/sam/boards/sam4l_ek/sam4l_ek.h | 309 + .../src/asf/sam/drivers/ast/ast.c | 820 + .../src/asf/sam/drivers/ast/ast.h | 356 + .../src/asf/sam/drivers/bpm/bpm.c | 298 + .../src/asf/sam/drivers/bpm/bpm.h | 501 + .../src/asf/sam/drivers/bpm/sleep.h | 141 + .../src/asf/sam/drivers/flashcalw/flashcalw.c | 1823 ++ .../src/asf/sam/drivers/flashcalw/flashcalw.h | 399 + .../asf/sam/utils/cmsis/sam4l/include/sam4l.h | 16184 ++++++++++++++++ .../cmsis/sam4l/include/sam4l_patch_asf.h | 122 + .../cmsis/sam4l/source/templates/exceptions.c | 269 + .../cmsis/sam4l/source/templates/exceptions.h | 71 + .../source/templates/gcc/startup_sam4l.c | 205 + .../sam4l/source/templates/system_sam4l.h | 62 + .../src/asf/sam/utils/compiler.h | 1063 + .../src/asf/sam/utils/header_files/io.h | 90 + .../linker_scripts/sam4l/sam4l4/gcc/flash.ld | 154 + .../src/asf/sam/utils/make/Makefile.in | 496 + .../src/asf/sam/utils/preprocessor/mrepeat.h | 336 + .../asf/sam/utils/preprocessor/preprocessor.h | 52 + .../src/asf/sam/utils/preprocessor/stringz.h | 82 + .../src/asf/sam/utils/preprocessor/tpaste.h | 102 + .../src/asf/sam/utils/status_codes.h | 110 + .../src/asf/sam/utils/syscalls/gcc/syscalls.c | 136 + .../CMSIS END USER LICENCE AGREEMENT.pdf | Bin 0 -> 46999 bytes .../asf/thirdparty/CMSIS/Include/arm_math.h | 7057 +++++++ .../asf/thirdparty/CMSIS/Include/core_cm4.h | 1689 ++ .../thirdparty/CMSIS/Include/core_cm4_simd.h | 649 + .../thirdparty/CMSIS/Include/core_cmFunc.h | 616 + .../thirdparty/CMSIS/Include/core_cmInstr.h | 618 + .../src/asf/thirdparty/CMSIS/README.txt | 37 + .../src/config/FreeRTOSConfig.h | 196 + .../src/config/conf_ast.h | 55 + .../src/config/conf_board.h | 53 + .../src/config/conf_clock.h | 97 + .../src/config/conf_example.h | 133 + .../src/config/conf_sleepmgr.h | 49 + .../CORTEX_M4_ATSAM4L_Atmel_Studio/src/main.c | 309 + .../src/main_full.c | 273 + .../src/main_low_power.c | 267 + 71 files changed, 45766 insertions(+) create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/FreeRTOS_Demo.atsln create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/FreeRTOS_Demo.cproj create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/jlink.config create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/ParTest.c create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/SAM4L_low_power_tick_management.c create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/boards/board.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/dfll.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/genclk.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/osc.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/pll.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/dfll.c create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/dfll.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/genclk.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/osc.c create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/osc.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/pll.c create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/pll.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/sysclk.c create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/sysclk.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sysclk.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/ioport/ioport.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/ioport/sam/ioport_gpio.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/sleepmgr/sam4l/sleepmgr.c create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/sleepmgr/sam4l/sleepmgr.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/sleepmgr/sleepmgr.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/utils/interrupt.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/utils/interrupt/interrupt_sam_nvic.c create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/utils/interrupt/interrupt_sam_nvic.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/utils/parts.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/boards/sam4l_ek/init.c create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/boards/sam4l_ek/sam4l_ek.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/ast/ast.c create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/ast/ast.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/bpm/bpm.c create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/bpm/bpm.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/bpm/sleep.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/flashcalw/flashcalw.c create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/flashcalw/flashcalw.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/include/sam4l.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/include/sam4l_patch_asf.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/source/templates/exceptions.c create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/source/templates/exceptions.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/source/templates/gcc/startup_sam4l.c create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/source/templates/system_sam4l.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/compiler.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/header_files/io.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/linker_scripts/sam4l/sam4l4/gcc/flash.ld create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/make/Makefile.in create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/preprocessor/mrepeat.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/preprocessor/preprocessor.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/preprocessor/stringz.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/preprocessor/tpaste.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/status_codes.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/syscalls/gcc/syscalls.c create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/CMSIS END USER LICENCE AGREEMENT.pdf create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/Include/arm_math.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/Include/core_cm4.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/Include/core_cm4_simd.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/Include/core_cmFunc.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/Include/core_cmInstr.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/README.txt create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/FreeRTOSConfig.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/conf_ast.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/conf_board.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/conf_clock.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/conf_example.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/conf_sleepmgr.h create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/main.c create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/main_full.c create mode 100644 FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/main_low_power.c diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/FreeRTOS_Demo.atsln b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/FreeRTOS_Demo.atsln new file mode 100644 index 000000000..4419bd0e2 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/FreeRTOS_Demo.atsln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Atmel Studio Solution File, Format Version 11.00 +Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "FreeRTOS_Demo", ".\FreeRTOS_Demo.cproj", "{DFC77570-BC67-4EE7-8143-C34E75167169}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM = Debug|ARM + Release|ARM = Release|ARM + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DFC77570-BC67-4EE7-8143-C34E75167169}.Debug|ARM.ActiveCfg = Debug|ARM + {DFC77570-BC67-4EE7-8143-C34E75167169}.Debug|ARM.Build.0 = Debug|ARM + {DFC77570-BC67-4EE7-8143-C34E75167169}.Release|ARM.ActiveCfg = Release|ARM + {DFC77570-BC67-4EE7-8143-C34E75167169}.Release|ARM.Build.0 = Release|ARM + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/FreeRTOS_Demo.cproj b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/FreeRTOS_Demo.cproj new file mode 100644 index 000000000..c553fcd0c --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/FreeRTOS_Demo.cproj @@ -0,0 +1,868 @@ + + + + 2.0 + 6.0 + com.Atmel.ARMGCC + {dfc77570-bc67-4ee7-8143-c34e75167169} + ATSAM4LC4C + sam4l + Executable + C + $(MSBuildProjectName) + .elf + $(MSBuildProjectDirectory)\$(Configuration) + FreeRTOS_Demo + FreeRTOS_Demo + FreeRTOS_Demo + Native + true + false + + 1 + 3.5.1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SWD + com.atmel.avrdbg.tool.samice + + com.atmel.avrdbg.tool.samice + J-Link-OB-SAM3U128 + 000480008423 + true + false + + + + 127.0.0.1 + 4788 + False + + + SWD + + 4000000 + 1000000 + 150000 + false + false + 0 + 0 + 0 + 0 + 4000000 + + + + + + + + __ATSAM4LC4C__ + True + True + True + True + True + + + BOARD=SAM4L_EK + ARM_MATH_CM4=true + __ATSAM4LC4C__ + + + False + + + ../src/asf/sam/utils/preprocessor + ../src/asf/sam/drivers/lcdca/example/sam4lc4c_sam4l_ek + ../src/asf/sam/utils/cmsis/sam4l/include + ../src/asf/common/services/sleepmgr + ../src/asf/sam/utils + ../src/asf/common/boards + ../src/asf/sam/drivers/flashcalw + ../src/asf/sam/boards + ../src/asf/common/services/clock + ../src/asf/sam/drivers/bpm + ../src/asf/thirdparty/CMSIS/Include + ../src/asf/sam/boards/sam4l_ek + ../src/asf/sam/utils/header_files + ../src/asf/common/services/ioport + ../src/asf/sam/utils/cmsis/sam4l/source/templates + ../src/asf/common/utils + ../src/asf/thirdparty/CMSIS/Lib/GCC + ../src + ../src/config + ../src/asf/sam/drivers/ast + + + Optimize for size (-Os) + -fdata-sections + True + True + + + arm_cortexM4l_math + m + + + + + ../cmsis/linkerScripts + ../src/asf/thirdparty/CMSIS/Lib/GCC + + + True + -T../src/asf/sam/utils/linker_scripts/sam4l/sam4l4/gcc/flash.ld -Wl,--cref -Wl,--entry=Reset_Handler -mthumb + + + ../src/asf/sam/utils/preprocessor + ../src/asf/sam/drivers/lcdca/example/sam4lc4c_sam4l_ek + ../src/asf/sam/utils/cmsis/sam4l/include + ../src/asf/common/services/sleepmgr + ../src/asf/sam/utils + ../src/asf/common/boards + ../src/asf/sam/drivers/flashcalw + ../src/asf/sam/boards + ../src/asf/common/services/clock + ../src/asf/sam/drivers/bpm + ../src/asf/thirdparty/CMSIS/Include + ../src/asf/sam/boards/sam4l_ek + ../src/asf/sam/utils/header_files + ../src/asf/common/services/ioport + ../src/asf/sam/utils/cmsis/sam4l/source/templates + ../src/asf/common/utils + ../src/asf/thirdparty/CMSIS/Lib/GCC + ../src + ../src/config + ../src/asf/sam/drivers/ast + + + -DARM_MATH_CM4=true -DBOARD=SAM4L_EK -D__ATSAM4LC4C__ + + + ../src/asf/sam/utils/preprocessor + ../src/asf/sam/drivers/lcdca/example/sam4lc4c_sam4l_ek + ../src/asf/sam/utils/cmsis/sam4l/include + ../src/asf/common/services/sleepmgr + ../src/asf/sam/utils + ../src/asf/common/boards + ../src/asf/sam/drivers/flashcalw + ../src/asf/sam/boards + ../src/asf/common/services/clock + ../src/asf/sam/drivers/bpm + ../src/asf/thirdparty/CMSIS/Include + ../src/asf/sam/boards/sam4l_ek + ../src/asf/sam/utils/header_files + ../src/asf/common/services/ioport + ../src/asf/sam/utils/cmsis/sam4l/source/templates + ../src/asf/common/utils + ../src/asf/thirdparty/CMSIS/Lib/GCC + ../src + ../src/config + ../src/asf/sam/drivers/ast + + + + + + + + + __ATSAM4LC4C__ + True + True + True + True + True + + + BOARD=SAM4L_EK + ARM_MATH_CM4=true + __SAM4LC4C__ + + + False + + + ../src/asf/sam/utils/preprocessor + ../src/asf/sam/drivers/lcdca/example/sam4lc4c_sam4l_ek + ../src/asf/sam/utils/cmsis/sam4l/include + ../src/asf/common/services/sleepmgr + ../src/asf/sam/utils + ../src/asf/common/boards + ../src/asf/sam/drivers/flashcalw + ../src/asf/sam/boards + ../src/asf/common/services/clock + ../src/asf/sam/drivers/bpm + ../src/asf/thirdparty/CMSIS/Include + ../src/asf/sam/boards/sam4l_ek + ../src/asf/sam/utils/header_files + ../src/asf/common/services/ioport + ../src/asf/sam/utils/cmsis/sam4l/source/templates + ../src/asf/common/utils + ../src/asf/thirdparty/CMSIS/Lib/GCC + ../src + ../src/config + ../src/asf/sam/drivers/ast + ../../../Source/include + ../../../Source/portable/GCC/ARM_CM3 + ../../Common/include + + + -fdata-sections + True + Maximum (-g3) + True + -std=gnu99 -Wmissing-field-initializers + + + arm_cortexM4l_math + m + + + + + ../cmsis/linkerScripts + ../src/asf/thirdparty/CMSIS/Lib/GCC + + + True + -T../src/asf/sam/utils/linker_scripts/sam4l/sam4l4/gcc/flash.ld -Wl,--cref -Wl,--entry=Reset_Handler -mthumb + + + ../src/asf/sam/utils/preprocessor + ../src/asf/sam/drivers/lcdca/example/sam4lc4c_sam4l_ek + ../src/asf/sam/utils/cmsis/sam4l/include + ../src/asf/common/services/sleepmgr + ../src/asf/sam/utils + ../src/asf/common/boards + ../src/asf/sam/drivers/flashcalw + ../src/asf/sam/boards + ../src/asf/common/services/clock + ../src/asf/sam/drivers/bpm + ../src/asf/thirdparty/CMSIS/Include + ../src/asf/sam/boards/sam4l_ek + ../src/asf/sam/utils/header_files + ../src/asf/common/services/ioport + ../src/asf/sam/utils/cmsis/sam4l/source/templates + ../src/asf/common/utils + ../src/asf/thirdparty/CMSIS/Lib/GCC + ../src + ../src/config + ../src/asf/sam/drivers/ast + + + Default (-g) + -DARM_MATH_CM4=true -DBOARD=SAM4L_EK -D__ATSAM4LC4C__ + + + ../src/asf/sam/utils/preprocessor + ../src/asf/sam/drivers/lcdca/example/sam4lc4c_sam4l_ek + ../src/asf/sam/utils/cmsis/sam4l/include + ../src/asf/common/services/sleepmgr + ../src/asf/sam/utils + ../src/asf/common/boards + ../src/asf/sam/drivers/flashcalw + ../src/asf/sam/boards + ../src/asf/common/services/clock + ../src/asf/sam/drivers/bpm + ../src/asf/thirdparty/CMSIS/Include + ../src/asf/sam/boards/sam4l_ek + ../src/asf/sam/utils/header_files + ../src/asf/common/services/ioport + ../src/asf/sam/utils/cmsis/sam4l/source/templates + ../src/asf/common/utils + ../src/asf/thirdparty/CMSIS/Lib/GCC + ../src + ../src/config + ../src/asf/sam/drivers/ast + + + Default (-Wa,-g) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + compile + + + compile + + + compile + + + compile + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + + + + + compile + src\FreeRTOS-Source\include\FreeRTOS.h + + + compile + src\FreeRTOS-Source\include\list.h + + + compile + src\FreeRTOS-Source\include\mpu_wrappers.h + + + compile + src\FreeRTOS-Source\include\portable.h + + + compile + src\FreeRTOS-Source\include\projdefs.h + + + compile + src\FreeRTOS-Source\include\queue.h + + + compile + src\FreeRTOS-Source\include\semphr.h + + + compile + src\FreeRTOS-Source\include\StackMacros.h + + + compile + src\FreeRTOS-Source\include\task.h + + + compile + src\FreeRTOS-Source\include\timers.h + + + compile + src\FreeRTOS-Source\list.c + + + compile + src\FreeRTOS-Source\portable\port.c + + + compile + src\FreeRTOS-Source\portable\portmacro.h + + + compile + src\FreeRTOS-Source\portable\heap_4.c + + + compile + src\FreeRTOS-Source\queue.c + + + compile + src\FreeRTOS-Source\tasks.c + + + compile + src\FreeRTOS-Source\timers.c + + + compile + src\Common-Demo-Source\include\BlockQ.h + + + compile + src\Common-Demo-Source\include\blocktim.h + + + compile + src\Common-Demo-Source\include\comtest.h + + + compile + src\Common-Demo-Source\include\dynamic.h + + + compile + src\Common-Demo-Source\include\GenQTest.h + + + compile + src\Common-Demo-Source\include\PollQ.h + + + compile + src\Common-Demo-Source\include\recmutex.h + + + compile + src\Common-Demo-Source\include\semtest.h + + + compile + src\Common-Demo-Source\BlockQ.c + + + compile + src\Common-Demo-Source\blocktim.c + + + compile + src\Common-Demo-Source\countsem.c + + + compile + src\Common-Demo-Source\dynamic.c + + + compile + src\Common-Demo-Source\GenQTest.c + + + compile + src\Common-Demo-Source\PollQ.c + + + compile + src\Common-Demo-Source\recmutex.c + + + compile + src\Common-Demo-Source\semtest.c + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + + \ No newline at end of file diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/jlink.config b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/jlink.config new file mode 100644 index 000000000..5d3ee40a6 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/jlink.config @@ -0,0 +1,31 @@ +[BREAKPOINTS] +ShowInfoWin = 1 +EnableFlashBP = 2 +BPDuringExecution = 0 +[CFI] +CFISize = 0x00 +CFIAddr = 0x00 +[CPU] +OverrideMemMap = 0 +AllowSimulation = 1 +ScriptFile="" +[FLASH] +MinNumBytesFlashDL = 0 +SkipProgOnCRCMatch = 1 +VerifyDownload = 1 +AllowCaching = 1 +EnableFlashDL = 2 +Override = 0 +Device="UNSPECIFIED" +[GENERAL] +WorkRAMSize = 0x00 +WorkRAMAddr = 0x00 +[SWO] +SWOLogFile="" +[MEM] +RdOverrideOrMask = 0x00 +RdOverrideAndMask = 0xFFFFFFFF +RdOverrideAddr = 0xFFFFFFFF +WrOverrideOrMask = 0x00 +WrOverrideAndMask = 0xFFFFFFFF +WrOverrideAddr = 0xFFFFFFFF diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/ParTest.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/ParTest.c new file mode 100644 index 000000000..d6e6e035d --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/ParTest.c @@ -0,0 +1,123 @@ +/* + FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd. + + FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT + http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. + + *************************************************************************** + * * + * FreeRTOS tutorial books are available in pdf and paperback. * + * Complete, revised, and edited pdf reference manuals are also * + * available. * + * * + * Purchasing FreeRTOS documentation will not only help you, by * + * ensuring you get running as quickly as possible and with an * + * in-depth knowledge of how to use FreeRTOS, it will also help * + * the FreeRTOS project to continue with its mission of providing * + * professional grade, cross platform, de facto standard solutions * + * for microcontrollers - completely free of charge! * + * * + * >>> See http://www.FreeRTOS.org/Documentation for details. <<< * + * * + * Thank you for using FreeRTOS, and thank you for your support! * + * * + *************************************************************************** + + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + + >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to + distribute a combined work that includes FreeRTOS without being obliged to + provide the source code for proprietary components outside of the FreeRTOS + kernel. + + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + details. You should have received a copy of the GNU General Public License + and the FreeRTOS license exception along with FreeRTOS; if not itcan be + viewed here: http://www.freertos.org/a00114.html and also obtained by + writing to Real Time Engineers Ltd., contact details for whom are available + on the FreeRTOS WEB site. + + 1 tab == 4 spaces! + + *************************************************************************** + * * + * Having a problem? Start by reading the FAQ "My application does * + * not run, what could be wrong?" * + * * + * http://www.FreeRTOS.org/FAQHelp.html * + * * + *************************************************************************** + + + http://www.FreeRTOS.org - Documentation, books, training, latest versions, + license and Real Time Engineers Ltd. contact details. + + http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, + including FreeRTOS+Trace - an indispensable productivity tool, and our new + fully thread aware and reentrant UDP/IP stack. + + http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High + Integrity Systems, who sell the code with commercial support, + indemnification and middleware, under the OpenRTOS brand. + + http://www.SafeRTOS.com - High Integrity Systems also provide a safety + engineered and independently SIL3 certified version for use in safety and + mission critical applications that require provable dependability. +*/ + +/*----------------------------------------------------------- + * Simple IO routines to control the LEDs. + *-----------------------------------------------------------*/ + +/* Scheduler includes. */ +#include "FreeRTOS.h" +#include "task.h" + +/* Demo includes. */ +#include "partest.h" + +/* Library includes. */ +#include +#include + +/* The number of LEDs available to the user on the evaluation kit. */ +#define partestNUM_LEDS ( LED_COUNT ) +static portBASE_TYPE xLEDState = pdFALSE; + +/*-----------------------------------------------------------*/ + +void vParTestInitialise( void ) +{ + /* In this case, the LED pin is configured in the board_init() function. */ +} +/*-----------------------------------------------------------*/ + +void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) +{ + if( uxLED < partestNUM_LEDS ) + { + /* Turn the LED on. */ + taskENTER_CRITICAL(); + { + ioport_set_pin_level( LED0_GPIO, xValue ); + xLEDState = xValue; + } + taskEXIT_CRITICAL(); + } +} +/*-----------------------------------------------------------*/ + +void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) +{ + vParTestSetLED( uxLED, !xLEDState ); +} + + + diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/SAM4L_low_power_tick_management.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/SAM4L_low_power_tick_management.c new file mode 100644 index 000000000..dcfa82514 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/SAM4L_low_power_tick_management.c @@ -0,0 +1,395 @@ +/* + FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd. + + FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT + http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. + + *************************************************************************** + * * + * FreeRTOS tutorial books are available in pdf and paperback. * + * Complete, revised, and edited pdf reference manuals are also * + * available. * + * * + * Purchasing FreeRTOS documentation will not only help you, by * + * ensuring you get running as quickly as possible and with an * + * in-depth knowledge of how to use FreeRTOS, it will also help * + * the FreeRTOS project to continue with its mission of providing * + * professional grade, cross platform, de facto standard solutions * + * for microcontrollers - completely free of charge! * + * * + * >>> See http://www.FreeRTOS.org/Documentation for details. <<< * + * * + * Thank you for using FreeRTOS, and thank you for your support! * + * * + *************************************************************************** + + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + + >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to + distribute a combined work that includes FreeRTOS without being obliged to + provide the source code for proprietary components outside of the FreeRTOS + kernel. + + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + details. You should have received a copy of the GNU General Public License + and the FreeRTOS license exception along with FreeRTOS; if not itcan be + viewed here: http://www.freertos.org/a00114.html and also obtained by + writing to Real Time Engineers Ltd., contact details for whom are available + on the FreeRTOS WEB site. + + 1 tab == 4 spaces! + + *************************************************************************** + * * + * Having a problem? Start by reading the FAQ "My application does * + * not run, what could be wrong?" * + * * + * http://www.FreeRTOS.org/FAQHelp.html * + * * + *************************************************************************** + + + http://www.FreeRTOS.org - Documentation, books, training, latest versions, + license and Real Time Engineers Ltd. contact details. + + http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, + including FreeRTOS+Trace - an indispensable productivity tool, and our new + fully thread aware and reentrant UDP/IP stack. + + http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High + Integrity Systems, who sell the code with commercial support, + indemnification and middleware, under the OpenRTOS brand. + + http://www.SafeRTOS.com - High Integrity Systems also provide a safety + engineered and independently SIL3 certified version for use in safety and + mission critical applications that require provable dependability. +*/ + +/* Standard includes. */ +#include "limits.h" + +/* FreeRTOS includes. */ +#include "FreeRTOS.h" +#include "task.h" + +/* Library includes. */ +#include + + +/* + * When configCREATE_LOW_POWER_DEMO is set to 1 then the tick interrupt + * is generated by the AST. The AST configuration and handling functions are + * defined in this file. + * + * When configCREATE_LOW_POWER_DEMO is set to 0 the tick interrupt is + * generated by the standard FreeRTOS Cortex-M port layer, which uses the + * SysTick timer. + */ +#if configCREATE_LOW_POWER_DEMO == 1 + +/* Constants required to pend a PendSV interrupt from the tick ISR if the +preemptive scheduler is being used. These are just standard bits and registers +within the Cortex-M core itself. */ +#define portNVIC_INT_CTRL_REG ( * ( ( volatile unsigned long * ) 0xe000ed04 ) ) +#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL ) + +/* The alarm used to generate interrupts in the asynchronous timer. */ +#define portAST_ALARM_CHANNEL 0 + +/*-----------------------------------------------------------*/ + +/* + * The tick interrupt is generated by the asynchronous timer. The default tick + * interrupt handler cannot be used (even with the AST being handled from the + * tick hook function) because the default tick interrupt accesses the SysTick + * registers when configUSE_TICKLESS_IDLE set to 1. AST_ALARM_Handler() is the + * default name for the AST alarm interrupt. This definition overrides the + * default implementation that is weakly defined in the interrupt vector table + * file. + */ +void AST_ALARM_Handler(void); + +/*-----------------------------------------------------------*/ + +/* Calculate how many clock increments make up a single tick period. */ +static const uint32_t ulAlarmValueForOneTick = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ); + +/* Holds the maximum number of ticks that can be suppressed - which is +basically how far into the future an interrupt can be generated. Set +during initialisation. */ +static portTickType xMaximumPossibleSuppressedTicks = 0; + +/* Flag set from the tick interrupt to allow the sleep processing to know if +sleep mode was exited because of an AST interrupt or a different interrupt. */ +static volatile uint32_t ulTickFlag = pdFALSE; + +/* The AST counter is stopped temporarily each time it is re-programmed. The +following variable offsets the AST counter alarm value by the number of AST +counts that would typically be missed while the counter was stopped to compensate +for the lost time. _RB_ Value needs calculating correctly. */ +static uint32_t ulStoppedTimerCompensation = 10 / ( configCPU_CLOCK_HZ / configSYSTICK_CLOCK_HZ ); + +/*-----------------------------------------------------------*/ + +/* The tick interrupt handler. This is always the same other than the part that +clears the interrupt, which is specific to the clock being used to generate the +tick. */ +void AST_ALARM_Handler(void) +{ + /* If using preemption, also force a context switch by pending the PendSV + interrupt. */ + #if configUSE_PREEMPTION == 1 + { + portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT; + } + #endif + + /* Protect incrementing the tick with an interrupt safe critical section. */ + ( void ) portSET_INTERRUPT_MASK_FROM_ISR(); + { + vTaskIncrementTick(); + + /* Just completely clear the interrupt mask on exit by passing 0 because + it is known that this interrupt will only ever execute with the lowest + possible interrupt priority. */ + } + portCLEAR_INTERRUPT_MASK_FROM_ISR( 0 ); + + /* The CPU woke because of a tick. */ + ulTickFlag = pdTRUE; + + /* If this is the first tick since exiting tickless mode then the AST needs + to be reconfigured to generate interrupts at the defined tick frequency. */ + ast_write_alarm0_value( AST, ulAlarmValueForOneTick ); + + /* Ensure the interrupt is clear before exiting. */ + ast_clear_interrupt_flag( AST, AST_INTERRUPT_ALARM ); +} +/*-----------------------------------------------------------*/ + +/* Override the default definition of vPortSetupTimerInterrupt() that is weakly +defined in the FreeRTOS Cortex-M3 port layer layer with a version that +configures the asynchronous timer (AST) to generate the tick interrupt. */ +void vPortSetupTimerInterrupt( void ) +{ +struct ast_config ast_conf; + + /* Ensure the AST can bring the CPU out of sleep mode. */ + sleepmgr_lock_mode( SLEEPMGR_RET ); + + /* Ensure the 32KHz oscillator is enabled. */ + if( osc_is_ready( OSC_ID_OSC32 ) == pdFALSE ) + { + osc_enable( OSC_ID_OSC32 ); + osc_wait_ready( OSC_ID_OSC32 ); + } + + /* Enable the AST itself. */ + ast_enable( AST ); + + ast_conf.mode = AST_COUNTER_MODE; /* Simple up counter. */ + ast_conf.osc_type = AST_OSC_32KHZ; + ast_conf.psel = 0; /* No prescale so the actual frequency is 32KHz/2. */ + ast_conf.counter = 0; + ast_set_config( AST, &ast_conf ); + + /* The AST alarm interrupt is used as the tick interrupt. Ensure the alarm + status starts clear. */ + ast_clear_interrupt_flag( AST, AST_INTERRUPT_ALARM ); + + /* Enable wakeup from alarm 0 in the AST and power manager. */ + ast_enable_wakeup( AST, AST_WAKEUP_ALARM ); + bpm_enable_wakeup_source( BPM, ( 1 << BPM_BKUPWEN_AST ) ); + + /* Tick interrupt MUST execute at the lowest interrupt priority. */ + NVIC_SetPriority( AST_ALARM_IRQn, configLIBRARY_LOWEST_INTERRUPT_PRIORITY); + ast_enable_interrupt( AST, AST_INTERRUPT_ALARM ); + NVIC_ClearPendingIRQ( AST_ALARM_IRQn ); + NVIC_EnableIRQ( AST_ALARM_IRQn ); + + /* Automatically clear the counter on interrupt. */ + ast_enable_counter_clear_on_alarm( AST, portAST_ALARM_CHANNEL ); + + /* Start with the tick active and generating a tick with regular period. */ + ast_write_alarm0_value( AST, ulAlarmValueForOneTick ); + ast_write_counter_value( AST, 0 ); + + /* See the comments where xMaximumPossibleSuppressedTicks is declared. */ + xMaximumPossibleSuppressedTicks = ULONG_MAX / ulAlarmValueForOneTick; +} +/*-----------------------------------------------------------*/ + +void prvDisableAST( void ) +{ + while( ast_is_busy( AST ) ) + { + /* Nothing to do here, just waiting. */ + } + AST->AST_CR &= ~( AST_CR_EN ); + while( ast_is_busy( AST ) ) + { + /* Nothing to do here, just waiting. */ + } +} +/*-----------------------------------------------------------*/ + +void prvEnableAST( void ) +{ + while( ast_is_busy( AST ) ) + { + /* Nothing to do here, just waiting. */ + } + AST->AST_CR |= AST_CR_EN; + while( ast_is_busy( AST ) ) + { + /* Nothing to do here, just waiting. */ + } +} +/*-----------------------------------------------------------*/ + +/* Override the default definition of vPortSuppressTicksAndSleep() that is weakly +defined in the FreeRTOS Cortex-M3 port layer layer with a version that manages +the asynchronous timer (AST), as the tick is generated from the low power AST +and not the SysTick as would normally be the case on a Cortex-M. */ +void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime ) +{ +uint32_t ulAlarmValue, ulCompleteTickPeriods; +eSleepModeStatus eSleepAction; +portTickType xModifiableIdleTime; + + /* THIS FUNCTION IS CALLED WITH THE SCHEDULER SUSPENDED. */ + + /* Make sure the AST reload value does not overflow the counter. */ + if( xExpectedIdleTime > xMaximumPossibleSuppressedTicks ) + { + xExpectedIdleTime = xMaximumPossibleSuppressedTicks; + } + + /* Calculate the reload value required to wait xExpectedIdleTime tick + periods. -1 is used because this code will execute part way through one of + the tick periods, and the fraction of a tick period is accounted for + later. */ + ulAlarmValue = ( ulAlarmValueForOneTick * ( xExpectedIdleTime - 1UL ) ); + if( ulAlarmValue > ulStoppedTimerCompensation ) + { + /* Compensate for the fact that the AST is going to be stopped + momentarily. */ + ulAlarmValue -= ulStoppedTimerCompensation; + } + + /* Stop the AST momentarily. The time the AST is stopped for is accounted + for as best it can be, but using the tickless mode will inevitably result in + some tiny drift of the time maintained by the kernel with respect to + calendar time. */ + prvDisableAST(); + + /* Enter a critical section but don't use the taskENTER_CRITICAL() method as + that will mask interrupts that should exit sleep mode. */ + __asm volatile( "cpsid i \n\t" + "dsb \n\t" ); + + /* The tick flag is set to false before sleeping. If it is true when sleep + mode is exited then sleep mode was probably exited because the tick was + suppressed for the entire xExpectedIdleTime period. */ + ulTickFlag = pdFALSE; + + /* If a context switch is pending then abandon the low power entry as + the context switch might have been pended by an external interrupt that + requires processing. */ + eSleepAction = eTaskConfirmSleepModeStatus(); + if( eSleepAction == eAbortSleep ) + { + /* Restart tick. */ + prvEnableAST(); + + /* Re-enable interrupts - see comments above the cpsid instruction() + above. */ + __asm volatile( "cpsie i" ); + } + else + { + /* Adjust the alarm value to take into account that the current time + slice is already partially complete. */ + ulAlarmValue -= ast_read_counter_value( AST ); + ast_write_alarm0_value( AST, ulAlarmValue ); + + /* Restart the AST. */ + prvEnableAST(); + + /* Allow the application to define some pre-sleep processing. */ + xModifiableIdleTime = xExpectedIdleTime; + configPRE_SLEEP_PROCESSING( xModifiableIdleTime ); + + /* xExpectedIdleTime being set to 0 by configPRE_SLEEP_PROCESSING() + means the application defined code has already executed the WAIT + instruction. */ + if( xModifiableIdleTime > 0 ) + { + /* Sleep until something happens. */ + sleepmgr_enter_sleep(); + } + + /* Allow the application to define some post sleep processing. */ + configPOST_SLEEP_PROCESSING( xModifiableIdleTime ); + + /* Stop AST. Again, the time the SysTick is stopped for is accounted + for as best it can be, but using the tickless mode will inevitably + result in some tiny drift of the time maintained by the kernel with + respect to calendar time. */ + prvDisableAST(); + + /* Re-enable interrupts - see comments above the cpsid instruction() + above. */ +#warning The sleep manager will have re-enabled interrupts already, does this matter? + __asm volatile( "cpsie i" ); + + if( ulTickFlag != pdFALSE ) + { + /* The tick interrupt has already executed, although because this + function is called with the scheduler suspended the actual tick + processing will not occur until after this function has exited. + Reset the alarm value with whatever remains of this tick period. */ + ulAlarmValue = ulAlarmValueForOneTick - ast_read_counter_value( AST ); + ast_write_alarm0_value( AST, ulAlarmValue ); + + /* The tick interrupt handler will already have pended the tick + processing in the kernel. As the pending tick will be processed as + soon as this function exits, the tick value maintained by the tick + is stepped forward by one less than the time spent sleeping. The + actual stepping of the tick appears later in this function. */ + ulCompleteTickPeriods = xExpectedIdleTime - 1UL; + } + else + { + /* Something other than the tick interrupt ended the sleep. How + many complete tick periods passed while the processor was + sleeping? */ + ulCompleteTickPeriods = ast_read_counter_value( AST ) / ulAlarmValueForOneTick; + + /* The alarm value is set to whatever fraction of a single tick + period remains. */ + ulAlarmValue = ast_read_counter_value( AST ) - ( ulCompleteTickPeriods * ulAlarmValueForOneTick ); + ast_write_alarm0_value( AST, ulAlarmValue ); + } + + /* Restart the AST so it runs up to the alarm value. The alarm value + will get set to the value required to generate exactly one tick period + the next time the AST interrupt executes. */ + prvEnableAST(); + + /* Wind the tick forward by the number of tick periods that the CPU + remained in a low power state. */ + vTaskStepTick( ulCompleteTickPeriods ); + } +} + + +#endif /* configCREATE_LOW_POWER_DEMO == 1 */ + diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf.h new file mode 100644 index 000000000..5af623354 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf.h @@ -0,0 +1,92 @@ +/** + * \file + * + * \brief Autogenerated API include file for the Atmel Software Framework (ASF) + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#ifndef ASF_H +#define ASF_H + +/* + * This file includes all API header files for the selected drivers from ASF. + * Note: There might be duplicate includes required by more than one driver. + * + * The file is automatically generated and will be re-written when + * running the ASF driver selector tool. Any changes will be discarded. + */ + +// From module: AST - Asynchronous Timer +#include + +// From module: Common SAM compiler driver +#include +#include + +// From module: FLASHCALW Controller Software Driver +#include + +// From module: Generic board support +#include + +// From module: IOPORT - General purpose I/O service +#include + +// From module: Interrupt management - SAM3 implementation +#include + +// From module: Part identification macros +#include + +// From module: Power Management +#include +#include + +// From module: SAM4L startup code +#include +#include + +// From module: Sleep manager - SAM4L implementation +#include +#include + +// From module: System Clock Control - SAM4L implementation +#include + +#endif // ASF_H diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/boards/board.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/boards/board.h new file mode 100644 index 000000000..aa313d69b --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/boards/board.h @@ -0,0 +1,328 @@ +/** + * \file + * + * \brief Standard board header file. + * + * This file includes the appropriate board header file according to the + * defined board (parameter BOARD). + * + * Copyright (c) 2009-2013 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/** + * \defgroup group_common_boards Generic board support + * + * The generic board support module includes board-specific definitions + * and function prototypes, such as the board initialization function. + * + * \{ + */ + +#include "compiler.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/*! \name Base Boards + */ +//! @{ +#define EVK1100 1 //!< AT32UC3A EVK1100 board. +#define EVK1101 2 //!< AT32UC3B EVK1101 board. +#define UC3C_EK 3 //!< AT32UC3C UC3C_EK board. +#define EVK1104 4 //!< AT32UC3A3 EVK1104 board. +#define EVK1105 5 //!< AT32UC3A EVK1105 board. +#define STK600_RCUC3L0 6 //!< STK600 RCUC3L0 board. +#define UC3L_EK 7 //!< AT32UC3L-EK board. +#define XPLAIN 8 //!< ATxmega128A1 Xplain board. +#define STK600_RC064X 10 //!< ATxmega256A3 STK600 board. +#define STK600_RC100X 11 //!< ATxmega128A1 STK600 board. +#define UC3_A3_XPLAINED 13 //!< ATUC3A3 UC3-A3 Xplained board. +#define UC3_L0_XPLAINED 15 //!< ATUC3L0 UC3-L0 Xplained board. +#define STK600_RCUC3D 16 //!< STK600 RCUC3D board. +#define STK600_RCUC3C0 17 //!< STK600 RCUC3C board. +#define XMEGA_B1_XPLAINED 18 //!< ATxmega128B1 Xplained board. +#define XMEGA_A1_XPLAINED 19 //!< ATxmega128A1 Xplain-A1 board. +#define STK600_RCUC3L4 21 //!< ATUCL4 STK600 board +#define UC3_L0_XPLAINED_BC 22 //!< ATUC3L0 UC3-L0 Xplained board controller board +#define MEGA1284P_XPLAINED_BC 23 //!< ATmega1284P-Xplained board controller board +#define STK600_RC044X 24 //!< STK600 with RC044X routing card board. +#define STK600_RCUC3B0 25 //!< STK600 RCUC3B0 board. +#define UC3_L0_QT600 26 //!< QT600 UC3L0 MCU board. +#define XMEGA_A3BU_XPLAINED 27 //!< ATxmega256A3BU Xplained board. +#define STK600_RC064X_LCDX 28 //!< XMEGAB3 STK600 RC064X LCDX board. +#define STK600_RC100X_LCDX 29 //!< XMEGAB1 STK600 RC100X LCDX board. +#define UC3B_BOARD_CONTROLLER 30 //!< AT32UC3B1 board controller for Atmel boards +#define RZ600 31 //!< AT32UC3A RZ600 MCU board +#define SAM3S_EK 32 //!< SAM3S-EK board. +#define SAM3U_EK 33 //!< SAM3U-EK board. +#define SAM3X_EK 34 //!< SAM3X-EK board. +#define SAM3N_EK 35 //!< SAM3N-EK board. +#define SAM3S_EK2 36 //!< SAM3S-EK2 board. +#define SAM4S_EK 37 //!< SAM4S-EK board. +#define STK600_RCUC3A0 38 //!< STK600 RCUC3A0 board. +#define STK600_MEGA 39 //!< STK600 MEGA board. +#define MEGA_1284P_XPLAINED 40 //!< ATmega1284P Xplained board. +#define SAM4S_XPLAINED 41 //!< SAM4S Xplained board. +#define ATXMEGA128A1_QT600 42 //!< QT600 ATXMEGA128A1 MCU board. +#define ARDUINO_DUE_X 43 //!< Arduino Due/X board. +#define STK600_RCUC3L3 44 //!< ATUCL3 STK600 board +#define SAM4L_EK 45 //!< SAM4L-EK board. +#define STK600_MEGA_RF 46 //!< STK600 MEGA RF EVK board. +#define XMEGA_C3_XPLAINED 47 //!< ATxmega384C3 Xplained board. +#define STK600_RC032X 48 //!< STK600 with RC032X routing card board. +#define SAM4S_EK2 49 //!< SAM4S-EK2 board. +#define XMEGA_E5_XPLAINED 50 //!< ATxmega32E5 Xplained board. +#define SAM4E_EK 51 //!< SAM4E-EK board. +#define ATMEGA256RFR2_XPLAINED_PRO 52 //!< ATmega256RFR2 Xplained Pro board. +#define SAM4S_XPLAINED_PRO 53 //!< SAM4S Xplained Pro board. +#define SAM4L_XPLAINED_PRO 54 //!< SAM4L Xplained Pro board. +#define ATMEGA256RFR2_ZIGBIT 55 //!< ATmega256RFR2 zigbit +#define XMEGA_RF233_ZIGBIT 56 //!< ATxmega256A3U with AT86RF233 zigbit +#define XMEGA_RF212B_ZIGBIT 57 //!< ATxmega256A3U with AT86RF212B zigbit +#define SIMULATOR_XMEGA_A1 97 //!< Simulator for XMEGA A1 devices +#define AVR_SIMULATOR_UC3 98 //!< AVR SIMULATOR for AVR UC3 device family. +#define USER_BOARD 99 //!< User-reserved board (if any). +#define DUMMY_BOARD 100 //!< Dummy board to support board-independent applications (e.g. bootloader) +//! @} + +/*! \name Extension Boards + */ +//! @{ +#define EXT1102 1 //!< AT32UC3B EXT1102 board +#define MC300 2 //!< AT32UC3 MC300 board +#define SENSORS_XPLAINED_INERTIAL_1 3 //!< Xplained inertial sensor board 1 +#define SENSORS_XPLAINED_INERTIAL_2 4 //!< Xplained inertial sensor board 2 +#define SENSORS_XPLAINED_PRESSURE_1 5 //!< Xplained pressure sensor board +#define SENSORS_XPLAINED_LIGHTPROX_1 6 //!< Xplained light & proximity sensor board +#define SENSORS_XPLAINED_INERTIAL_A1 7 //!< Xplained inertial sensor board "A" +#define RZ600_AT86RF231 8 //!< AT86RF231 RF board in RZ600 +#define RZ600_AT86RF230B 9 //!< AT86RF230B RF board in RZ600 +#define RZ600_AT86RF212 10 //!< AT86RF212 RF board in RZ600 +#define SENSORS_XPLAINED_BREADBOARD 11 //!< Xplained sensor development breadboard +#define SECURITY_XPLAINED 12 //!< Xplained ATSHA204 board +#define USER_EXT_BOARD 99 //!< User-reserved extension board (if any). +//! @} + +#if BOARD == EVK1100 +# include "evk1100/evk1100.h" +#elif BOARD == EVK1101 +# include "evk1101/evk1101.h" +#elif BOARD == UC3C_EK +# include "uc3c_ek/uc3c_ek.h" +#elif BOARD == EVK1104 +# include "evk1104/evk1104.h" +#elif BOARD == EVK1105 +# include "evk1105/evk1105.h" +#elif BOARD == STK600_RCUC3L0 +# include "stk600/rcuc3l0/stk600_rcuc3l0.h" +#elif BOARD == UC3L_EK +# include "uc3l_ek/uc3l_ek.h" +#elif BOARD == STK600_RCUC3L4 +# include "stk600/rcuc3l4/stk600_rcuc3l4.h" +#elif BOARD == XPLAIN +# include "xplain/xplain.h" +#elif BOARD == STK600_MEGA + /*No header-file to include*/ +#elif BOARD == STK600_MEGA_RF +# include "stk600.h" +#elif BOARD == ATMEGA256RFR2_XPLAINED_PRO +# include "atmega256rfr2_xplained_pro/atmega256rfr2_xplained_pro.h" +#elif BOARD == ATMEGA256RFR2_ZIGBIT +# include "atmega256rfr2_zigbit/atmega256rfr2_zigbit.h" +#elif BOARD == STK600_RC032X +# include "stk600/rc032x/stk600_rc032x.h" +#elif BOARD == STK600_RC044X +# include "stk600/rc044x/stk600_rc044x.h" +#elif BOARD == STK600_RC064X +# include "stk600/rc064x/stk600_rc064x.h" +#elif BOARD == STK600_RC100X +# include "stk600/rc100x/stk600_rc100x.h" +#elif BOARD == UC3_A3_XPLAINED +# include "uc3_a3_xplained/uc3_a3_xplained.h" +#elif BOARD == UC3_L0_XPLAINED +# include "uc3_l0_xplained/uc3_l0_xplained.h" +#elif BOARD == STK600_RCUC3B0 +# include "stk600/rcuc3b0/stk600_rcuc3b0.h" +#elif BOARD == STK600_RCUC3D +# include "stk600/rcuc3d/stk600_rcuc3d.h" +#elif BOARD == STK600_RCUC3C0 +# include "stk600/rcuc3c0/stk600_rcuc3c0.h" +#elif BOARD == XMEGA_B1_XPLAINED +# include "xmega_b1_xplained/xmega_b1_xplained.h" +#elif BOARD == STK600_RC064X_LCDX +# include "stk600/rc064x_lcdx/stk600_rc064x_lcdx.h" +#elif BOARD == STK600_RC100X_LCDX +# include "stk600/rc100x_lcdx/stk600_rc100x_lcdx.h" +#elif BOARD == XMEGA_A1_XPLAINED +# include "xmega_a1_xplained/xmega_a1_xplained.h" +#elif BOARD == UC3_L0_XPLAINED_BC +# include "uc3_l0_xplained_bc/uc3_l0_xplained_bc.h" +#elif BOARD == SAM3S_EK +# include "sam3s_ek/sam3s_ek.h" +# include "system_sam3s.h" +#elif BOARD == SAM3S_EK2 +# include "sam3s_ek2/sam3s_ek2.h" +# include "system_sam3sd8.h" +#elif BOARD == SAM3U_EK +# include "sam3u_ek/sam3u_ek.h" +# include "system_sam3u.h" +#elif BOARD == SAM3X_EK +# include "sam3x_ek/sam3x_ek.h" +# include "system_sam3x.h" +#elif BOARD == SAM3N_EK +# include "sam3n_ek/sam3n_ek.h" +# include "system_sam3n.h" +#elif BOARD == SAM4S_EK +# include "sam4s_ek/sam4s_ek.h" +# include "system_sam4s.h" +#elif BOARD == SAM4S_XPLAINED +# include "sam4s_xplained/sam4s_xplained.h" +# include "system_sam4s.h" +#elif BOARD == SAM4S_EK2 +# include "sam4s_ek2/sam4s_ek2.h" +# include "system_sam4s.h" +#elif BOARD == MEGA_1284P_XPLAINED + /*No header-file to include*/ +#elif BOARD == ARDUINO_DUE_X +# include "arduino_due_x/arduino_due_x.h" +# include "system_sam3x.h" +#elif BOARD == SAM4L_EK +# include "sam4l_ek/sam4l_ek.h" +#elif BOARD == SAM4E_EK +# include "sam4e_ek/sam4e_ek.h" +#elif BOARD == MEGA1284P_XPLAINED_BC +# include "mega1284p_xplained_bc/mega1284p_xplained_bc.h" +#elif BOARD == UC3_L0_QT600 +# include "uc3_l0_qt600/uc3_l0_qt600.h" +#elif BOARD == XMEGA_A3BU_XPLAINED +# include "xmega_a3bu_xplained/xmega_a3bu_xplained.h" +#elif BOARD == XMEGA_E5_XPLAINED +# include "xmega_e5_xplained/xmega_e5_xplained.h" +#elif BOARD == UC3B_BOARD_CONTROLLER +# include "uc3b_board_controller/uc3b_board_controller.h" +#elif BOARD == RZ600 +# include "rz600/rz600.h" +#elif BOARD == STK600_RCUC3A0 +# include "stk600/rcuc3a0/stk600_rcuc3a0.h" +#elif BOARD == ATXMEGA128A1_QT600 +# include "atxmega128a1_qt600/atxmega128a1_qt600.h" +#elif BOARD == STK600_RCUC3L3 +# include "stk600/rcuc3l3/stk600_rcuc3l3.h" +#elif BOARD == SAM4S_XPLAINED_PRO +# include "sam4s_xplained_pro/sam4s_xplained_pro.h" +#elif BOARD == SAM4L_XPLAINED_PRO +# include "sam4l_xplained_pro/sam4l_xplained_pro.h" +#elif BOARD == SIMULATOR_XMEGA_A1 +# include "simulator/xmega_a1/simulator_xmega_a1.h" +#elif BOARD == XMEGA_C3_XPLAINED +# include "xmega_c3_xplained/xmega_c3_xplained.h" +#elif BOARD == XMEGA_RF233_ZIGBIT +# include "xmega_rf233_zigbit/xmega_rf233_zigbit.h" +#elif BOARD == XMEGA_RF212B_ZIGBIT +# include "xmega_rf212b_zigbit/xmega_rf212b_zigbit.h" +#elif BOARD == AVR_SIMULATOR_UC3 +# include "avr_simulator_uc3/avr_simulator_uc3.h" +#elif BOARD == USER_BOARD + // User-reserved area: #include the header file of your board here (if any). +# include "user_board.h" +#elif BOARD == DUMMY_BOARD +# include "dummy/dummy_board.h" +#else +# error No known Atmel board defined +#endif + +#if (defined EXT_BOARD) +# if EXT_BOARD == MC300 +# include "mc300/mc300.h" +# elif (EXT_BOARD == SENSORS_XPLAINED_INERTIAL_1) || \ + (EXT_BOARD == SENSORS_XPLAINED_INERTIAL_2) || \ + (EXT_BOARD == SENSORS_XPLAINED_INERTIAL_A1) || \ + (EXT_BOARD == SENSORS_XPLAINED_PRESSURE_1) || \ + (EXT_BOARD == SENSORS_XPLAINED_LIGHTPROX_1) || \ + (EXT_BOARD == SENSORS_XPLAINED_BREADBOARD) +# include "sensors_xplained/sensors_xplained.h" +# elif EXT_BOARD == RZ600_AT86RF231 +# include "at86rf231/at86rf231.h" +# elif EXT_BOARD == RZ600_AT86RF230B +# include "at86rf230b/at86rf230b.h" +# elif EXT_BOARD == RZ600_AT86RF212 +# include "at86rf212/at86rf212.h" +# elif EXT_BOARD == SECURITY_XPLAINED +# include "security_xplained.h" +# elif EXT_BOARD == USER_EXT_BOARD + // User-reserved area: #include the header file of your extension board here + // (if any). +# endif +#endif + + +#if (defined(__GNUC__) && defined(__AVR32__)) || (defined(__ICCAVR32__) || defined(__AAVR32__)) +#ifdef __AVR32_ABI_COMPILER__ // Automatically defined when compiling for AVR32, not when assembling. + +/*! \brief This function initializes the board target resources + * + * This function should be called to ensure proper initialization of the target + * board hardware connected to the part. + */ +extern void board_init(void); + +#endif // #ifdef __AVR32_ABI_COMPILER__ +#else +/*! \brief This function initializes the board target resources + * + * This function should be called to ensure proper initialization of the target + * board hardware connected to the part. + */ +extern void board_init(void); +#endif + + +#ifdef __cplusplus +} +#endif + +/** + * \} + */ + +#endif // _BOARD_H_ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/dfll.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/dfll.h new file mode 100644 index 000000000..af686d07a --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/dfll.h @@ -0,0 +1,399 @@ +/** + * \file + * + * \brief DFLL management + * + * Copyright (c) 2010-2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +#ifndef CLK_DFLL_H_INCLUDED +#define CLK_DFLL_H_INCLUDED + +#include +#include "conf_clock.h" + +#if UC3L +# include "uc3l/dfll.h" +#elif SAM4L +# include "sam4l/dfll.h" +#else +# error Unsupported chip type +#endif + +/** + * \ingroup clk_group + * \defgroup dfll_group DFLL Management + * + * A Digital Frequency Locked Loop can be used to generate a highly + * accurate frequency from a slower-running reference clock, in much the + * same way as a PLL. DFLLs typically have shorter startup times and + * less jitter. They can also be used in open-loop mode to generate a + * less accurate frequency without the use of a reference clock. + * + * There may be significant variations between platforms in the support + * for certain features. + * + * \par Example: Setting up DFLL0 with default parameters and dithering enabled + * + * The following example shows how to configure and enable DFLL0 in + * closed-loop mode using the default parameters specified through + * configuration symbols. + * \code + dfll_enable_config_defaults(0); \endcode + * + * To configure and enable DFLL0 in closed-loop mode using the default + * parameters and to enable specific feature like dithering for better accuracy, + * you can use this initialization process. + * \code + struct dfll_config dfllcfg; + + dfll_enable_source(CONFIG_DFLL0_SOURCE); + dfll_config_defaults(&dfllcfg, 0); + dfll_config_enable_dithering(&dfllcfg); + dfll_enable(&dfllcfg, 0); + dfll_wait_for_accurate_lock(0); \endcode + * + * When the last function call returns, DFLL0 is running at a frequency + * which matches the default configuration as accurately as possible. + * Any additional alterations to the default configuration can be added + * at the same place as the call to dfll_config_enable_dithering(), but + * note that the DFLL will never achieve "accurate" lock if dithering is + * disabled. + * + * @{ + */ + +//! \name Chip-specific DFLL characteristics +//@{ +/** + * \def NR_DFLLS + * \brief Number of on-chip DFLLs. + */ +/** + * \def DFLL_MIN_HZ + * \brief Minimum frequency that the DFLL can generate. + */ +/** + * \def DFLL_MAX_HZ + * \brief Maximum frequency that the DFLL can generate. + */ +//@} + +/** + * \typedef dfll_refclk_t + * \brief Type used for identifying a reference clock source for the DFLL. + */ + +//! \name DFLL Configuration +//@{ + +/** + * \struct dfll_config + * \brief Hardware-specific representation of DFLL configuration. + * + * This structure contains one or more device-specific values + * representing the current DFLL configuration. The contents of this + * structure is typically different from platform to platform, and the + * user should not access any fields except through the DFLL + * configuration API. + */ + +/** + * \fn void dfll_config_init_open_loop_mode(struct dfll_config *cfg) + * \brief Configure the DFLL configuration \a cfg for open-loop mode. + * + * \param cfg The DFLL configuration to be initialized. + */ +/** + * \fn void dfll_config_init_closed_loop_mode(struct dfll_config *cfg, + * dfll_refclk_t refclk, uint16_t div, uint16_t mul) + * \brief Configure the DFLL configuration \a cfg for closed-loop mode. + * + * \param cfg The DFLL configuration to be initialized. + * \param refclk The reference clock source. + * \param div Reference clock divider. + * \param mul Multiplier (integer part only). + */ +/** + * \def dfll_config_defaults(cfg, dfll_id) + * \brief Initialize DFLL configuration using default parameters. + * + * After this function returns, \a cfg will contain a configuration + * which will make the DFLL run at (CONFIG_DFLLx_MUL / CONFIG_DFLLx_DIV) + * times the frequency of CONFIG_DFLLx_SOURCE. The default configuration + * will always use closed-loop mode with no fractional multiplier. + * + * \param cfg The DFLL configuration to be initialized. + * \param dfll_id Use defaults for this DFLL. + */ +/** + * \def dfll_get_default_rate(dfll_id) + * \brief Return the default rate in Hz of \a dfll_id. + */ + +/** + * \fn void dfll_config_set_fractional_multiplier(struct dfll_config *cfg, + * uint16_t mul_i, uint16_t mul_f) + * \brief Set a fractional multiplier. + * + * This function has no effect in open-loop mode, and is only available + * on devices which support fractional multipliers. + * + * The fractional part of the multiplier is assumed to be 16 bits. The + * low-level driver will make sure to shift this value to match the + * hardware if necessary. + * + * \param cfg The DFLL configuration to be modified. + * \param mul_i Integer part of multiplier. + * \param mul_f Fractional part of multiplier. + */ +/** + * \fn void dfll_config_enable_dithering(struct dfll_config *cfg) + * \brief Enable dithering for more accurate frequency generation. + * + * The fine LSB input to the VCO is dithered to achieve fractional + * approximation to the correct multiplication ratio. + * + * \param cfg The DFLL configuration to be modified. + */ +/** + * \fn void dfll_config_disable_dithering(struct dfll_config *cfg) + * \brief Disable dithering. + * + * \see dfll_config_enable_dithering() + * + * \param cfg The DFLL configuration to be modified. + */ +/** + * \fn void dfll_config_set_initial_tuning(struct dfll_config *cfg, + * uint16_t coarse, uint16_t fine) + * \brief Set initial VCO tuning. + * + * In open loop mode, this will determine the frequency of the output. + * + * In closed loop mode, this will provide an initial estimate of the VCO + * tuning. While the DFLL will automatically adjust these values to + * match the desired output frequency, careful selection of initial + * values might reduce the time to achieve coarse and fine lock. + * + * \param cfg The DFLL configuration to be modified. + * \param coarse Coarse tuning of the frequency generator. + * \param fine Fine tuning of the frequency generator. + */ +/** + * \fn void dfll_config_set_max_step(struct dfll_config *cfg, + * uint16_t coarse, uint16_t fine) + * \brief Set the maximum VCO tuning step size. + * + * This function has no effect in open-loop mode. + * + * By default, both of these values are set to 50% of their respective + * maximums. It is not recommended to set the values any higher than + * this, but setting them lower might reduce the frequency overshoot at + * the expense of longer time to achieve coarse and/or fine lock. + * + * \param cfg The DFLL configuration to be modified + * \param coarse The maximum step size of the coarse VCO tuning. + * \param fine The maximum step size of the fine VCO tuning. + */ +/** + * \fn void dfll_config_enable_ssg(struct dfll_config *cfg, + * uint16_t amplitude, uint16_t step_size) + * \brief Enable Spread Spectrum Generator. + * + * \param cfg The DFLL configuration to be modified. + * \param amplitude The amplitude of the spread spectrum. + * \param step_size The step size of the spread spectrum. + */ +/** + * \fn void dfll_config_disable_ssg(struct dfll_config *cfg) + * \brief Disable Spread Spectrum Generator. + * + * \param cfg The DFLL configuration to be modified. + */ +//@} + +//! \name Interaction with the DFLL hardware +//@{ +/** + * \fn void dfll_enable_open_loop(const struct dfll_config *cfg, + * unsigned int dfll_id) + * \brief Activate the configuration \a cfg and enable DFLL \a dfll_id + * in open-loop mode. + * + * \pre The configuration in \a cfg must represent an open-loop + * configuration. + * + * \param cfg The configuration to be activated. + * \param dfll_id The ID of the DFLL to be enabled. + */ +/** + * \fn void dfll_enable_closed_loop(const struct dfll_config *cfg, + * unsigned int dfll_id) + * \brief Activate the configuration \a cfg and enable DFLL \a dfll_id + * in closed-loop mode. + * + * \pre The configuration in \a cfg must represent a closed-loop + * configuration. + * + * \param cfg The configuration to be activated. + * \param dfll_id The ID of the DFLL to be enabled. + */ +/** + * \fn void dfll_disable_open_loop(unsigned int dfll_id) + * \brief Disable the DFLL identified by \a dfll_id. + * + * \pre The DFLL must have been enabled in open loop mode. + * + * \param dfll_id The ID of the DFLL to be disabled. + */ +/** + * \fn void dfll_disable_closed_loop(unsigned int dfll_id) + * \brief Disable the DFLL identified by \a dfll_id. + * + * \pre The DFLL must have been enabled in closed loop mode. + * + * \param dfll_id The ID of the DFLL to be disabled. + */ +/** + * \fn bool dfll_is_coarse_locked(unsigned int dfll_id) + * \brief Determine whether or not a DFLL has achieved coarse lock. + * + * \param dfll_id The ID of the DFLL to check. + * + * \retval true The DFLL has determined the final value of the coarse + * VCO tuning value. + * \retval false The DFLL has not yet determined the coarse VCO tuning + * value, or has not been enabled. + */ +/** + * \fn bool dfll_is_fine_locked(unsigned int dfll_id) + * \brief Determine whether or not a DFLL has achieved fine lock. + * + * \param dfll_id The ID of the DFLL to check. + * + * \retval true The DFLL has determined the final value of the fine VCO + * tuning value. + * \retval false The DFLL has not yet determined the fine VCO tuning + * value, or has not been enabled. + */ +/** + * \fn bool dfll_is_accurate_locked(unsigned int dfll_id) + * \brief Determine whether or not a DFLL has achieved accurate lock. + * + * \param dfll_id The ID of the DFLL to check. + * + * \retval true The DFLL has determined the final dithering duty cycle. + * \retval false The DFLL has not yet determined the dithering duty + * cycle, or has not been enabled with dithering enabled. + */ +/** + * \fn void dfll_enable_source(enum dfll_refclk_t src) + * \brief Enable the source of the dfll. + * The source is enabled, if the source is not already running. + * + * \param dfll_source src The ID of the DFLL source to enable. + */ +/** + * \fn void dfll_enable_config_defaults(unsigned int dfll_id) + * \brief Enable the dfll with the default configuration. + * DFLL is enabled, if the DFLL is not already locked. + * + * \param dfll_id The ID of the DFLL to enable. + */ + +/** + * \brief Wait for the DFLL identified by \a dfll_id to achieve coarse + * lock. + * + * \param dfll_id The ID of the DFLL to wait for. + * + * \retval STATUS_OK The DFLL has achieved coarse lock. + * \retval ERR_TIMEOUT Timed out waiting for lock. + */ +static inline int dfll_wait_for_coarse_lock(unsigned int dfll_id) +{ + /* TODO: Add timeout mechanism */ + while (!dfll_is_coarse_locked(dfll_id)) { + /* Do nothing */ + } + + return 0; +} + +/** + * \brief Wait for the DFLL identified by \a dfll_id to achieve fine + * lock. + * + * \param dfll_id The ID of the DFLL to wait for. + * + * \retval STATUS_OK The DFLL has achieved fine lock. + * \retval ERR_TIMEOUT Timed out waiting for lock. + */ +static inline int dfll_wait_for_fine_lock(unsigned int dfll_id) +{ + /* TODO: Add timeout mechanism */ + while (!dfll_is_fine_locked(dfll_id)) { + /* Do nothing */ + } + + return 0; +} + +/** + * \brief Wait for the DFLL identified by \a dfll_id to achieve accurate + * lock. + * + * \param dfll_id The ID of the DFLL to wait for. + * + * \retval STATUS_OK The DFLL has achieved accurate lock. + * \retval ERR_TIMEOUT Timed out waiting for lock. + */ +static inline int dfll_wait_for_accurate_lock(unsigned int dfll_id) +{ + /* TODO: Add timeout mechanism */ + while (!dfll_is_accurate_locked(dfll_id)) { + /* Do nothing */ + } + + return 0; +} + +//@} +//! @} + +#endif /* CLK_DFLL_H_INCLUDED */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/genclk.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/genclk.h new file mode 100644 index 000000000..8b72a6d2b --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/genclk.h @@ -0,0 +1,178 @@ +/** + * \file + * + * \brief Generic clock management + * + * Copyright (c) 2010-2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +#ifndef CLK_GENCLK_H_INCLUDED +#define CLK_GENCLK_H_INCLUDED + +#include "parts.h" + +#if SAM3S +# include "sam3s/genclk.h" +#elif SAM3U +# include "sam3u/genclk.h" +#elif SAM3N +# include "sam3n/genclk.h" +#elif SAM3XA +# include "sam3x/genclk.h" +#elif SAM4S +# include "sam4s/genclk.h" +#elif SAM4L +# include "sam4l/genclk.h" +#elif SAM4E +# include "sam4e/genclk.h" +#elif (UC3A0 || UC3A1) +# include "uc3a0_a1/genclk.h" +#elif UC3A3 +# include "uc3a3_a4/genclk.h" +#elif UC3B +# include "uc3b0_b1/genclk.h" +#elif UC3C +# include "uc3c/genclk.h" +#elif UC3D +# include "uc3d/genclk.h" +#elif UC3L +# include "uc3l/genclk.h" +#else +# error Unsupported chip type +#endif + +/** + * \ingroup clk_group + * \defgroup genclk_group Generic Clock Management + * + * Generic clocks are configurable clocks which run outside the system + * clock domain. They are often connected to peripherals which have an + * asynchronous component running independently of the bus clock, e.g. + * USB controllers, low-power timers and RTCs, etc. + * + * Note that not all platforms have support for generic clocks; on such + * platforms, this API will not be available. + * + * @{ + */ + +/** + * \def GENCLK_DIV_MAX + * \brief Maximum divider supported by the generic clock implementation + */ +/** + * \enum genclk_source + * \brief Generic clock source ID + * + * Each generic clock may be generated from a different clock source. + * These are the available alternatives provided by the chip. + */ + +//! \name Generic clock configuration +//@{ +/** + * \struct genclk_config + * \brief Hardware representation of a set of generic clock parameters + */ +/** + * \fn void genclk_config_defaults(struct genclk_config *cfg, + * unsigned int id) + * \brief Initialize \a cfg to the default configuration for the clock + * identified by \a id. + */ +/** + * \fn void genclk_config_read(struct genclk_config *cfg, unsigned int id) + * \brief Read the currently active configuration of the clock + * identified by \a id into \a cfg. + */ +/** + * \fn void genclk_config_write(const struct genclk_config *cfg, + * unsigned int id) + * \brief Activate the configuration \a cfg on the clock identified by + * \a id. + */ +/** + * \fn void genclk_config_set_source(struct genclk_config *cfg, + * enum genclk_source src) + * \brief Select a new source clock \a src in configuration \a cfg. + */ +/** + * \fn void genclk_config_set_divider(struct genclk_config *cfg, + * unsigned int divider) + * \brief Set a new \a divider in configuration \a cfg. + */ +/** + * \fn void genclk_enable_source(enum genclk_source src) + * \brief Enable the source clock \a src used by a generic clock. + */ + //@} + +//! \name Enabling and disabling Generic Clocks +//@{ +/** + * \fn void genclk_enable(const struct genclk_config *cfg, unsigned int id) + * \brief Activate the configuration \a cfg on the clock identified by + * \a id and enable it. + */ +/** + * \fn void genclk_disable(unsigned int id) + * \brief Disable the generic clock identified by \a id. + */ +//@} + +/** + * \brief Enable the configuration defined by \a src and \a divider + * for the generic clock identified by \a id. + * + * \param id The ID of the generic clock. + * \param src The source clock of the generic clock. + * \param divider The divider used to generate the generic clock. + */ +static inline void genclk_enable_config(unsigned int id, enum genclk_source src, unsigned int divider) +{ + struct genclk_config gcfg; + + genclk_config_defaults(&gcfg, id); + genclk_enable_source(src); + genclk_config_set_source(&gcfg, src); + genclk_config_set_divider(&gcfg, divider); + genclk_enable(&gcfg, id); +} + +//! @} + +#endif /* CLK_GENCLK_H_INCLUDED */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/osc.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/osc.h new file mode 100644 index 000000000..39cde2b4f --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/osc.h @@ -0,0 +1,164 @@ +/** + * \file + * + * \brief Oscillator management + * + * Copyright (c) 2010-2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +#ifndef OSC_H_INCLUDED +#define OSC_H_INCLUDED + +#include "parts.h" +#include "conf_clock.h" + +#if SAM3S +# include "sam3s/osc.h" +#elif SAM3XA +# include "sam3x/osc.h" +#elif SAM3U +# include "sam3u/osc.h" +#elif SAM3N +# include "sam3n/osc.h" +#elif SAM4S +# include "sam4s/osc.h" +#elif SAM4E +# include "sam4e/osc.h" +#elif SAM4L +# include "sam4l/osc.h" +#elif (UC3A0 || UC3A1) +# include "uc3a0_a1/osc.h" +#elif UC3A3 +# include "uc3a3_a4/osc.h" +#elif UC3B +# include "uc3b0_b1/osc.h" +#elif UC3C +# include "uc3c/osc.h" +#elif UC3D +# include "uc3d/osc.h" +#elif UC3L +# include "uc3l/osc.h" +#elif XMEGA +# include "xmega/osc.h" +#else +# error Unsupported chip type +#endif + +/** + * \ingroup clk_group + * \defgroup osc_group Oscillator Management + * + * This group contains functions and definitions related to configuring + * and enabling/disabling on-chip oscillators. Internal RC-oscillators, + * external crystal oscillators and external clock generators are + * supported by this module. What all of these have in common is that + * they swing at a fixed, nominal frequency which is normally not + * adjustable. + * + * \par Example: Enabling an oscillator + * + * The following example demonstrates how to enable the external + * oscillator on XMEGA A and wait for it to be ready to use. The + * oscillator identifiers are platform-specific, so while the same + * procedure is used on all platforms, the parameter to osc_enable() + * will be different from device to device. + * \code + osc_enable(OSC_ID_XOSC); + osc_wait_ready(OSC_ID_XOSC); \endcode + * + * \section osc_group_board Board-specific Definitions + * If external oscillators are used, the board code must provide the + * following definitions for each of those: + * - \b BOARD__HZ: The nominal frequency of the oscillator. + * - \b BOARD__STARTUP_US: The startup time of the + * oscillator in microseconds. + * - \b BOARD__TYPE: The type of oscillator connected, i.e. + * whether it's a crystal or external clock, and sometimes what kind + * of crystal it is. The meaning of this value is platform-specific. + * + * @{ + */ + +//! \name Oscillator Management +//@{ +/** + * \fn void osc_enable(uint8_t id) + * \brief Enable oscillator \a id + * + * The startup time and mode value is automatically determined based on + * definitions in the board code. + */ +/** + * \fn void osc_disable(uint8_t id) + * \brief Disable oscillator \a id + */ +/** + * \fn osc_is_ready(uint8_t id) + * \brief Determine whether oscillator \a id is ready. + * \retval true Oscillator \a id is running and ready to use as a clock + * source. + * \retval false Oscillator \a id is not running. + */ +/** + * \fn uint32_t osc_get_rate(uint8_t id) + * \brief Return the frequency of oscillator \a id in Hz + */ + +#ifndef __ASSEMBLY__ + +/** + * \brief Wait until the oscillator identified by \a id is ready + * + * This function will busy-wait for the oscillator identified by \a id + * to become stable and ready to use as a clock source. + * + * \param id A number identifying the oscillator to wait for. + */ +static inline void osc_wait_ready(uint8_t id) +{ + while (!osc_is_ready(id)) { + /* Do nothing */ + } +} + +#endif /* __ASSEMBLY__ */ + +//@} + +//! @} + +#endif /* OSC_H_INCLUDED */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/pll.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/pll.h new file mode 100644 index 000000000..1bccb7317 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/pll.h @@ -0,0 +1,320 @@ +/** + * \file + * + * \brief PLL management + * + * Copyright (c) 2010-2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +#ifndef CLK_PLL_H_INCLUDED +#define CLK_PLL_H_INCLUDED + +#include "parts.h" +#include "conf_clock.h" + +#if SAM3S +# include "sam3s/pll.h" +#elif SAM3XA +# include "sam3x/pll.h" +#elif SAM3U +# include "sam3u/pll.h" +#elif SAM3N +# include "sam3n/pll.h" +#elif SAM4S +# include "sam4s/pll.h" +#elif SAM4E +# include "sam4e/pll.h" +#elif SAM4L +# include "sam4l/pll.h" +#elif (UC3A0 || UC3A1) +# include "uc3a0_a1/pll.h" +#elif UC3A3 +# include "uc3a3_a4/pll.h" +#elif UC3B +# include "uc3b0_b1/pll.h" +#elif UC3C +# include "uc3c/pll.h" +#elif UC3D +# include "uc3d/pll.h" +#elif (UC3L0128 || UC3L0256 || UC3L3_L4) +# include "uc3l/pll.h" +#elif XMEGA +# include "xmega/pll.h" +#else +# error Unsupported chip type +#endif + +/** + * \ingroup clk_group + * \defgroup pll_group PLL Management + * + * This group contains functions and definitions related to configuring + * and enabling/disabling on-chip PLLs. A PLL will take an input signal + * (the \em source), optionally divide the frequency by a configurable + * \em divider, and then multiply the frequency by a configurable \em + * multiplier. + * + * Some devices don't support input dividers; specifying any other + * divisor than 1 on these devices will result in an assertion failure. + * Other devices may have various restrictions to the frequency range of + * the input and output signals. + * + * \par Example: Setting up PLL0 with default parameters + * + * The following example shows how to configure and enable PLL0 using + * the default parameters specified using the configuration symbols + * listed above. + * \code + pll_enable_config_defaults(0); \endcode + * + * To configure, enable PLL0 using the default parameters and to disable + * a specific feature like Wide Bandwidth Mode (a UC3A3-specific + * PLL option.), you can use this initialization process. + * \code + struct pll_config pllcfg; + if (pll_is_locked(pll_id)) { + return; // Pll already running + } + pll_enable_source(CONFIG_PLL0_SOURCE); + pll_config_defaults(&pllcfg, 0); + pll_config_set_option(&pllcfg, PLL_OPT_WBM_DISABLE); + pll_enable(&pllcfg, 0); + pll_wait_for_lock(0); \endcode + * + * When the last function call returns, PLL0 is ready to be used as the + * main system clock source. + * + * \section pll_group_config Configuration Symbols + * + * Each PLL has a set of default parameters determined by the following + * configuration symbols in the application's configuration file: + * - \b CONFIG_PLLn_SOURCE: The default clock source connected to the + * input of PLL \a n. Must be one of the values defined by the + * #pll_source enum. + * - \b CONFIG_PLLn_MUL: The default multiplier (loop divider) of PLL + * \a n. + * - \b CONFIG_PLLn_DIV: The default input divider of PLL \a n. + * + * These configuration symbols determine the result of calling + * pll_config_defaults() and pll_get_default_rate(). + * + * @{ + */ + +//! \name Chip-specific PLL characteristics +//@{ +/** + * \def PLL_MAX_STARTUP_CYCLES + * \brief Maximum PLL startup time in number of slow clock cycles + */ +/** + * \def NR_PLLS + * \brief Number of on-chip PLLs + */ + +/** + * \def PLL_MIN_HZ + * \brief Minimum frequency that the PLL can generate + */ +/** + * \def PLL_MAX_HZ + * \brief Maximum frequency that the PLL can generate + */ +/** + * \def PLL_NR_OPTIONS + * \brief Number of PLL option bits + */ +//@} + +/** + * \enum pll_source + * \brief PLL clock source + */ + +//! \name PLL configuration +//@{ + +/** + * \struct pll_config + * \brief Hardware-specific representation of PLL configuration. + * + * This structure contains one or more device-specific values + * representing the current PLL configuration. The contents of this + * structure is typically different from platform to platform, and the + * user should not access any fields except through the PLL + * configuration API. + */ + +/** + * \fn void pll_config_init(struct pll_config *cfg, + * enum pll_source src, unsigned int div, unsigned int mul) + * \brief Initialize PLL configuration from standard parameters. + * + * \note This function may be defined inline because it is assumed to be + * called very few times, and usually with constant parameters. Inlining + * it will in such cases reduce the code size significantly. + * + * \param cfg The PLL configuration to be initialized. + * \param src The oscillator to be used as input to the PLL. + * \param div PLL input divider. + * \param mul PLL loop divider (i.e. multiplier). + * + * \return A configuration which will make the PLL run at + * (\a mul / \a div) times the frequency of \a src + */ +/** + * \def pll_config_defaults(cfg, pll_id) + * \brief Initialize PLL configuration using default parameters. + * + * After this function returns, \a cfg will contain a configuration + * which will make the PLL run at (CONFIG_PLLx_MUL / CONFIG_PLLx_DIV) + * times the frequency of CONFIG_PLLx_SOURCE. + * + * \param cfg The PLL configuration to be initialized. + * \param pll_id Use defaults for this PLL. + */ +/** + * \def pll_get_default_rate(pll_id) + * \brief Get the default rate in Hz of \a pll_id + */ +/** + * \fn void pll_config_set_option(struct pll_config *cfg, + * unsigned int option) + * \brief Set the PLL option bit \a option in the configuration \a cfg. + * + * \param cfg The PLL configuration to be changed. + * \param option The PLL option bit to be set. + */ +/** + * \fn void pll_config_clear_option(struct pll_config *cfg, + * unsigned int option) + * \brief Clear the PLL option bit \a option in the configuration \a cfg. + * + * \param cfg The PLL configuration to be changed. + * \param option The PLL option bit to be cleared. + */ +/** + * \fn void pll_config_read(struct pll_config *cfg, unsigned int pll_id) + * \brief Read the currently active configuration of \a pll_id. + * + * \param cfg The configuration object into which to store the currently + * active configuration. + * \param pll_id The ID of the PLL to be accessed. + */ +/** + * \fn void pll_config_write(const struct pll_config *cfg, + * unsigned int pll_id) + * \brief Activate the configuration \a cfg on \a pll_id + * + * \param cfg The configuration object representing the PLL + * configuration to be activated. + * \param pll_id The ID of the PLL to be updated. + */ + +//@} + +//! \name Interaction with the PLL hardware +//@{ +/** + * \fn void pll_enable(const struct pll_config *cfg, + * unsigned int pll_id) + * \brief Activate the configuration \a cfg and enable PLL \a pll_id. + * + * \param cfg The PLL configuration to be activated. + * \param pll_id The ID of the PLL to be enabled. + */ +/** + * \fn void pll_disable(unsigned int pll_id) + * \brief Disable the PLL identified by \a pll_id. + * + * After this function is called, the PLL identified by \a pll_id will + * be disabled. The PLL configuration stored in hardware may be affected + * by this, so if the caller needs to restore the same configuration + * later, it should either do a pll_config_read() before disabling the + * PLL, or remember the last configuration written to the PLL. + * + * \param pll_id The ID of the PLL to be disabled. + */ +/** + * \fn bool pll_is_locked(unsigned int pll_id) + * \brief Determine whether the PLL is locked or not. + * + * \param pll_id The ID of the PLL to check. + * + * \retval true The PLL is locked and ready to use as a clock source + * \retval false The PLL is not yet locked, or has not been enabled. + */ +/** + * \fn void pll_enable_source(enum pll_source src) + * \brief Enable the source of the pll. + * The source is enabled, if the source is not already running. + * + * \param src The ID of the PLL source to enable. + */ +/** + * \fn void pll_enable_config_defaults(unsigned int pll_id) + * \brief Enable the pll with the default configuration. + * PLL is enabled, if the PLL is not already locked. + * + * \param pll_id The ID of the PLL to enable. + */ + +/** + * \brief Wait for PLL \a pll_id to become locked + * + * \todo Use a timeout to avoid waiting forever and hanging the system + * + * \param pll_id The ID of the PLL to wait for. + * + * \retval STATUS_OK The PLL is now locked. + * \retval ERR_TIMEOUT Timed out waiting for PLL to become locked. + */ +static inline int pll_wait_for_lock(unsigned int pll_id) +{ + Assert(pll_id < NR_PLLS); + + while (!pll_is_locked(pll_id)) { + /* Do nothing */ + } + + return 0; +} + +//@} +//! @} + +#endif /* CLK_PLL_H_INCLUDED */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/dfll.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/dfll.c new file mode 100644 index 000000000..337a1c94f --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/dfll.c @@ -0,0 +1,175 @@ +/** + * \file + * + * \brief Chip-specific DFLL implementation + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +#include +#include + +#define dfll_write_reg(reg, value) \ + do { \ + while (!(SCIF->SCIF_PCLKSR & SCIF_PCLKSR_DFLL0RDY)); \ + irqflags_t ATPASTE2(dfll_flags, __LINE__) = cpu_irq_save(); \ + SCIF->SCIF_UNLOCK = SCIF_UNLOCK_KEY(0xAAUL) \ + | SCIF_UNLOCK_ADDR((uint32_t)&SCIF->SCIF_##reg - (uint32_t)SCIF);\ + SCIF->SCIF_##reg = (value); \ + cpu_irq_restore(ATPASTE2(dfll_flags, __LINE__)); \ + } while (0) + + + +void dfll_enable_open_loop(const struct dfll_config *cfg, uint32_t dfll_id) +{ + irqflags_t flags; + + UNUSED(dfll_id); + + /* First, enable the DFLL, then configure it */ + flags = cpu_irq_save(); + SCIF->SCIF_UNLOCK = SCIF_UNLOCK_KEY(0xAAUL) + | SCIF_UNLOCK_ADDR((uint32_t)&SCIF->SCIF_DFLL0CONF - (uint32_t)SCIF); + SCIF->SCIF_DFLL0CONF = SCIF_DFLL0CONF_EN; + cpu_irq_restore(flags); + dfll_write_reg(DFLL0CONF, cfg->conf | SCIF_DFLL0CONF_EN); + dfll_write_reg(DFLL0MUL, cfg->mul); + dfll_write_reg(DFLL0VAL, cfg->val); + dfll_write_reg(DFLL0SSG, cfg->ssg); +} + +void dfll_disable_open_loop(uint32_t dfll_id) +{ + UNUSED(dfll_id); + + /* First, disable the DFLL. */ + // Do a sync before reading a dfll conf register + SCIF->SCIF_DFLL0SYNC = SCIF_DFLL0SYNC_SYNC; + while (!(SCIF->SCIF_PCLKSR & SCIF_PCLKSR_DFLL0RDY)); + + uint32_t conf = SCIF->SCIF_DFLL0CONF; + conf &= ~SCIF_DFLL0CONF_EN; + dfll_write_reg(DFLL0CONF, conf); + + /* Finally, stop the reference clock */ + genclk_disable(0); +} + +void dfll_enable_closed_loop(const struct dfll_config *cfg, uint32_t dfll_id) +{ + irqflags_t flags; + + UNUSED(dfll_id); + + /* Enable the reference clock */ + genclk_enable(&cfg->ref_cfg, 0); + + /* + * Enable the DFLL first, but don't wait for the DFLL0RDY bit + * because if the DFLL has been disabled before, the DFLL0RDY + * bit stays cleared until it is re-enabled. + */ + flags = cpu_irq_save(); + SCIF->SCIF_UNLOCK = SCIF_UNLOCK_KEY(0xAAUL) + | SCIF_UNLOCK_ADDR((uint32_t)&SCIF->SCIF_DFLL0CONF - (uint32_t)SCIF); + SCIF->SCIF_DFLL0CONF = SCIF_DFLL0CONF_EN; + cpu_irq_restore(flags); + + /* + * Then, configure the DFLL, taking care to wait for the + * DFLL0RDY bit before every step. + */ + dfll_write_reg(DFLL0STEP, cfg->step); + dfll_write_reg(DFLL0MUL, cfg->mul); + dfll_write_reg(DFLL0SSG, cfg->ssg); + dfll_write_reg(DFLL0CONF, cfg->conf | SCIF_DFLL0CONF_EN); +} + +void dfll_disable_closed_loop(uint32_t dfll_id) +{ + UNUSED(dfll_id); + + /* First, disable the DFLL. */ + // Do a sync before reading a dfll conf register + SCIF->SCIF_DFLL0SYNC = SCIF_DFLL0SYNC_SYNC; + while (!(SCIF->SCIF_PCLKSR & SCIF_PCLKSR_DFLL0RDY)); + + uint32_t conf = SCIF->SCIF_DFLL0CONF; + conf &= ~SCIF_DFLL0CONF_EN; + dfll_write_reg(DFLL0CONF, conf); + + /* Finally, stop the reference clock */ + genclk_disable(0); +} + +void dfll_enable_config_defaults(uint32_t dfll_id) +{ +#ifdef CONFIG_DFLL0_SOURCE + struct dfll_config dfllcfg; +#endif + static bool open_loop_done = false; + + if(SCIF->SCIF_DFLL0CONF & SCIF_DFLL0CONF_MODE) { + // Closed-loop mode + if (dfll_is_fine_locked(dfll_id)) { + return; // DFLL already running + } + } + if (open_loop_done == true) { + return; + } + + switch (dfll_id) { +#ifdef CONFIG_DFLL0_SOURCE + case 0: + dfll_enable_source(CONFIG_DFLL0_SOURCE); + dfll_config_init_closed_loop_mode(&dfllcfg, + CONFIG_DFLL0_SOURCE, + CONFIG_DFLL0_DIV, + CONFIG_DFLL0_MUL); + + dfll_enable_closed_loop(&dfllcfg, dfll_id); + while (!dfll_is_fine_locked(dfll_id)); + break; +#endif + + default: + Assert(false); + break; + } +} diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/dfll.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/dfll.h new file mode 100644 index 000000000..731d487b8 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/dfll.h @@ -0,0 +1,373 @@ +/** + * \file + * + * \brief Chip-specific DFLL definitions + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +#ifndef CHIP_DFLL_H_INCLUDED +#define CHIP_DFLL_H_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \weakgroup dfll_group + * @{ + */ + +#define NR_DFLLS 1 +#define DFLL_MIN_HZ 20000000UL +#define DFLL_MAX_HZ 150000000UL +#define DFLL_MIN_KHZ (DFLL_MIN_HZ / 1000) +#define DFLL_MAX_KHZ (DFLL_MAX_HZ / 1000) + +#define DFLL_COARSE_MAX (255) +#define DFLL_FINE_MAX (511) +#define DFLL_FINE_HALF (255) + +#define DFLL_CALIB_VALUE (0x0B) + +#define DFLL_RANGE0 (0) +#define DFLL_RANGE1 (1) +#define DFLL_RANGE2 (2) +#define DFLL_RANGE3 (3) +#define DFLL_MAX_RANGE1 (110000000) +#define DFLL_MAX_RANGE2 (55000000) +#define DFLL_MAX_RANGE3 (30000000) + +#ifndef __ASSEMBLY__ + +#include "compiler.h" +#include +#include + +typedef enum genclk_source dfll_refclk_t; + +struct dfll_config { + struct genclk_config ref_cfg; //!< Reference clock + uint32_t conf; //!< DFLLnCONF + uint32_t mul; //!< DFLLnMUL + uint32_t step; //!< DFLLnSTEP + uint32_t ssg; //!< DFLLnSSG + uint32_t val; //!< DFLLnVAL + uint8_t freq_range; //!< Frequency Range +}; + +static inline void dfll_config_set_max_step(struct dfll_config *cfg, + uint16_t coarse, uint16_t fine) +{ + cfg->step = (SCIF_DFLL0STEP_CSTEP(coarse) + | SCIF_DFLL0STEP_FSTEP(fine)); +} + +static inline void dfll_priv_set_frequency_range(struct dfll_config *cfg, + uint32_t freq) +{ + if (freq < DFLL_MAX_RANGE3){ + cfg->freq_range = DFLL_RANGE3; + } + else if (freq < DFLL_MAX_RANGE2){ + cfg->freq_range = DFLL_RANGE2; + } + else if (freq < DFLL_MAX_RANGE1){ + cfg->freq_range = DFLL_RANGE1; + } + else { + cfg->freq_range = DFLL_RANGE0; + } + cfg->conf &= ~SCIF_DFLL0CONF_RANGE_Msk; + cfg->conf |=SCIF_DFLL0CONF_RANGE(cfg->freq_range); +} + +static inline void dfll_config_init_open_loop_mode(struct dfll_config *cfg) +{ + genclk_config_defaults(&cfg->ref_cfg, 0); + // Do a sync before reading a dfll conf register + SCIF->SCIF_DFLL0SYNC = SCIF_DFLL0SYNC_SYNC; + while (!(SCIF->SCIF_PCLKSR & SCIF_PCLKSR_DFLL0RDY)); + cfg->conf = SCIF->SCIF_DFLL0CONF; + // Select Open Loop Mode + cfg->conf &= ~SCIF_DFLL0CONF_MODE; + // Clear DFLL Frequency Range + cfg->freq_range = 0; + cfg->conf &= ~SCIF_DFLL0CONF_RANGE_Msk; + cfg->conf |= SCIF_DFLL0CONF_RANGE(cfg->freq_range); + + cfg->mul = 0; + cfg->step = 0; + cfg->ssg = 0; + cfg->val = 0; +} + +#ifdef CONFIG_DFLL0_FREQ +static inline void dfll_config_init_closed_loop_mode(struct dfll_config *cfg, + dfll_refclk_t refclk, uint16_t divide, uint16_t mul) +{ + /* + * Set up generic clock source with specified reference clock + * and divider. + */ + genclk_config_defaults(&cfg->ref_cfg, 0); + genclk_config_set_source(&cfg->ref_cfg, refclk); + genclk_config_set_divider(&cfg->ref_cfg, divide); + + // Do a sync before reading a dfll conf register + SCIF->SCIF_DFLL0SYNC = SCIF_DFLL0SYNC_SYNC; + while (!(SCIF->SCIF_PCLKSR & SCIF_PCLKSR_DFLL0RDY)); + cfg->conf = SCIF->SCIF_DFLL0CONF; + // Select Closed Loop Mode + cfg->conf |= SCIF_DFLL0CONF_MODE; + // Write DFLL Frequency Range + dfll_priv_set_frequency_range(cfg, CONFIG_DFLL0_FREQ); + + cfg->mul = mul; + cfg->val = 0; + /* + * Initial step length of 4. If this is set too high, the DFLL + * may fail to lock. + */ + dfll_config_set_max_step(cfg, 4, 4); + cfg->ssg = 0; +} +#endif + +static inline uint32_t dfll_priv_get_source_hz(dfll_refclk_t src) +{ + /* + * Only handle the cases that actually make sense as a DFLL + * source. The DFLL itself is obviously not one of those cases. + */ + switch (src) { + case GENCLK_SRC_RCSYS: + return OSC_RCSYS_NOMINAL_HZ; + +#ifdef BOARD_OSC32_HZ + case GENCLK_SRC_OSC32K: + return BOARD_OSC32_HZ; +#endif + +#ifdef BOARD_OSC0_HZ + case GENCLK_SRC_OSC0: + return BOARD_OSC0_HZ; +#endif + + case GENCLK_SRC_RC80M: + return OSC_RC80M_NOMINAL_HZ; + + case GENCLK_SRC_RC32K: + return OSC_RC32K_NOMINAL_HZ; + + default: + /* unhandled_case(src) */ + return 0; + } +} + +#define dfll_config_defaults(cfg, dfll_id) \ + dfll_config_init_closed_loop_mode(cfg, \ + CONFIG_DFLL##dfll_id##_SOURCE, \ + CONFIG_DFLL##dfll_id##_DIV, \ + CONFIG_DFLL##dfll_id##_MUL) + +#define dfll_get_default_rate(dfll_id) \ + ((dfll_priv_get_source_hz(CONFIG_DFLL##dfll_id##_SOURCE) \ + * CONFIG_DFLL##dfll_id##_MUL) \ + / CONFIG_DFLL##dfll_id##_DIV) + +static inline void dfll_config_set_initial_tuning(struct dfll_config *cfg, + uint16_t coarse, uint16_t fine) +{ + cfg->val = (SCIF_DFLL0VAL_COARSE(coarse) + | SCIF_DFLL0VAL_FINE(fine)); +} + +/** + * \brief Tune the DFLL configuration for a specific target frequency + * + * This will set the initial coarse and fine DFLL tuning to match the + * given target frequency. In open loop mode, this will cause the DFLL + * to run close to the specified frequency, though it may not match + * exactly. In closed loop mode, the DFLL will automatically tune itself + * to the target frequency regardless of the initial tuning, but this + * function may be used to set a starting point close to the desired + * frequency in order to reduce the startup time. + * + * \par Calculating the DFLL frequency + * + * \f{eqnarray*}{ + f_{DFLL} &=& \left[f_{min} + \left(f_{max} - f_{min}\right) + \frac{\mathrm{COARSE}}{\mathrm{COARSE}_{max}}\right] + \left(1 + x \frac{\mathrm{FINE} + - \mathrm{FINE}_{half}}{\mathrm{FINE}_{max}}\right) + = f_{coarse} \left(1 + x + \frac{\mathrm{FINE} + - \mathrm{FINE}_{half}}{\mathrm{FINE}_{max}}\right) \\ + \mathrm{COARSE} &=& \frac{\left(f_{DFLL} - f_{min}\right)} + {f_{max} - f_{min}} \mathrm{COARSE}_{max} \\ + f_{coarse} &=& f_{min} + \left(f_{max} - f_{min}\right) + \frac{\mathrm{COARSE}}{\mathrm{COARSE}_{max}} \\ + \mathrm{FINE} &=& \left(10 \frac{f_{DFLL} - f_{coarse}} + {f_{coarse}} + \mathrm{FINE}_{half}\right) / 4 + \f} + * + * \param cfg The DFLL configuration to be tuned. + * \param target_hz Target frequency in Hz. + */ +static inline void dfll_config_tune_for_target_hz(struct dfll_config *cfg, + uint32_t target_hz) +{ + uint32_t target_khz; + uint32_t coarse_khz; + uint32_t delta_khz; + uint32_t coarse; + uint32_t fine; + + target_khz = target_hz / 1000; + coarse = ((target_khz - DFLL_MIN_KHZ) * DFLL_COARSE_MAX) + / (DFLL_MAX_KHZ - DFLL_MIN_KHZ); + coarse_khz = DFLL_MIN_KHZ + (((DFLL_MAX_KHZ - DFLL_MIN_KHZ) + / DFLL_COARSE_MAX) * coarse); + delta_khz = target_khz - coarse_khz; + fine = (((delta_khz * DFLL_FINE_MAX) * 2) / coarse_khz) * 5; + fine += DFLL_FINE_HALF; + fine /= 4; + + dfll_config_set_initial_tuning(cfg, coarse, fine); + dfll_priv_set_frequency_range(cfg, target_hz); +} + +static inline void dfll_config_enable_ssg(struct dfll_config *cfg, + uint16_t amplitude, uint16_t step_size) +{ + cfg->ssg = (SCIF_DFLL0SSG_EN + | SCIF_DFLL0SSG_AMPLITUDE(amplitude) + | SCIF_DFLL0SSG_STEPSIZE(step_size)); +} + +static inline void dfll_config_disable_ssg(struct dfll_config *cfg) +{ + cfg->ssg = 0; +} + +extern void dfll_enable_open_loop(const struct dfll_config *cfg, + uint32_t dfll_id); +extern void dfll_disable_open_loop(uint32_t dfll_id); +extern void dfll_enable_closed_loop(const struct dfll_config *cfg, + uint32_t dfll_id); +extern void dfll_disable_closed_loop(uint32_t dfll_id); +#ifndef CHIP_GENCLK_H_INCLUDED +// This function already has a prototype in genclk.h. +extern void dfll_enable_config_defaults(uint32_t dfll_id); +#endif + +static inline bool dfll_is_coarse_locked(uint32_t dfll_id) +{ + UNUSED(dfll_id); + return !!(SCIF->SCIF_PCLKSR & SCIF_PCLKSR_DFLL0LOCKC); +} + +static inline bool dfll_is_fine_locked(uint32_t dfll_id) +{ + UNUSED(dfll_id); + return !!(SCIF->SCIF_PCLKSR & SCIF_PCLKSR_DFLL0LOCKF); +} + +static inline bool dfll_is_accurate_locked(uint32_t dfll_id) +{ + UNUSED(dfll_id); + + return (dfll_is_coarse_locked(dfll_id) && + dfll_is_fine_locked(dfll_id)); +} + +static inline void dfll_enable_source(dfll_refclk_t src) +{ + switch (src) { + case GENCLK_SRC_RCSYS: + /* Nothing to do */ + break; + +#ifdef BOARD_OSC32_HZ + case GENCLK_SRC_OSC32K: + if (!osc_is_ready(OSC_ID_OSC32)) { + osc_enable(OSC_ID_OSC32); + osc_wait_ready(OSC_ID_OSC32); + } + break; +#endif + +#ifdef BOARD_OSC0_HZ + case GENCLK_SRC_OSC0: + if (!osc_is_ready(OSC_ID_OSC0)) { + osc_enable(OSC_ID_OSC0); + osc_wait_ready(OSC_ID_OSC0); + } + break; +#endif + + case GENCLK_SRC_RC80M: + if (!osc_is_ready(OSC_ID_RC80M)) { + osc_enable(OSC_ID_RC80M); + osc_wait_ready(OSC_ID_RC80M); + } + break; + + case GENCLK_SRC_RC32K: + if (!osc_is_ready(OSC_ID_RC32K)) { + osc_enable(OSC_ID_RC32K); + osc_wait_ready(OSC_ID_RC32K); + } + break; + + default: + Assert(false); + break; + } +} + +#endif /* __ASSEMBLY__ */ + +//! @} + +#ifdef __cplusplus +} +#endif + +#endif /* CHIP_DFLL_H_INCLUDED */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/genclk.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/genclk.h new file mode 100644 index 000000000..3f5e74d45 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/genclk.h @@ -0,0 +1,238 @@ +/** + * \file + * + * \brief Chip-specific generic clock management + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +#ifndef CHIP_GENCLK_H_INCLUDED +#define CHIP_GENCLK_H_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +// dfll.h is not included to avoid a circular dependency. +extern void dfll_enable_config_defaults(uint32_t dfll_id); + +/** + * \weakgroup genclk_group + * @{ + */ + +//! \name Chip-specific generic clock definitions +//@{ + +#define GENCLK_DIV_MAX 256 + +#ifndef __ASSEMBLY__ + +#include +#include +#include + +enum genclk_source { + GENCLK_SRC_RCSYS = 0, //!< System RC oscillator + GENCLK_SRC_OSC32K = 1, //!< 32 kHz oscillator + GENCLK_SRC_DFLL = 2, //!< DFLL + GENCLK_SRC_OSC0 = 3, //!< Oscillator 0 + GENCLK_SRC_RC80M = 4, //!< 80 MHz RC oscillator + GENCLK_SRC_RCFAST = 5, //!< 4-8-12 MHz RC oscillator + GENCLK_SRC_RC1M = 6, //!< 1 MHz RC oscillator + GENCLK_SRC_CLK_CPU = 7, //!< CPU clock + GENCLK_SRC_CLK_HSB = 8, //!< High Speed Bus clock + GENCLK_SRC_CLK_PBA = 9, //!< Peripheral Bus A clock + GENCLK_SRC_CLK_PBB = 10, //!< Peripheral Bus B clock + GENCLK_SRC_CLK_PBC = 11, //!< Peripheral Bus C clock + GENCLK_SRC_CLK_PBD = 12, //!< Peripheral Bus D clock + GENCLK_SRC_RC32K = 13, //!< 32 kHz RC oscillator + GENCLK_SRC_CLK_1K = 15, //!< 1 kHz output from OSC32K + GENCLK_SRC_PLL0 = 16, //!< PLL0 + GENCLK_SRC_HRPCLK = 17, //!< High resolution prescaler + GENCLK_SRC_FPCLK = 18, //!< Fractional prescaler + GENCLK_SRC_GCLKIN0 = 19, //!< GCLKIN0 + GENCLK_SRC_GCLKIN1 = 20, //!< GCLKIN1 + GENCLK_SRC_GCLK11 = 21, //!< GCLK11 +}; + +//@} + +struct genclk_config { + uint32_t ctrl; +}; + +static inline void genclk_config_defaults(struct genclk_config *cfg, + uint32_t id) +{ + UNUSED(id); + cfg->ctrl = 0; +} + +static inline void genclk_config_read(struct genclk_config *cfg, + uint32_t id) +{ + cfg->ctrl = SCIF->SCIF_GCCTRL[id].SCIF_GCCTRL; +} + +static inline void genclk_config_write(const struct genclk_config *cfg, + uint32_t id) +{ + SCIF->SCIF_GCCTRL[id].SCIF_GCCTRL = cfg->ctrl; +} + +static inline void genclk_config_set_source(struct genclk_config *cfg, + enum genclk_source src) +{ + cfg->ctrl = (cfg->ctrl & ~SCIF_GCCTRL_OSCSEL_Msk) + | SCIF_GCCTRL_OSCSEL(src); +} + +static inline void genclk_config_set_divider(struct genclk_config *cfg, + uint32_t divider) +{ + Assert(divider > 0 && divider <= GENCLK_DIV_MAX); + + /* Clear all the bits we're about to modify */ + cfg->ctrl &= ~(SCIF_GCCTRL_DIVEN + | SCIF_GCCTRL_DIV_Msk); + + if (divider > 1) { + cfg->ctrl |= SCIF_GCCTRL_DIVEN; + cfg->ctrl |= SCIF_GCCTRL_DIV(((divider + 1) / 2) - 1); + } +} + +static inline void genclk_enable(const struct genclk_config *cfg, + uint32_t id) +{ + SCIF->SCIF_GCCTRL[id].SCIF_GCCTRL = cfg->ctrl | SCIF_GCCTRL_CEN; +} + +static inline void genclk_disable(uint32_t id) +{ + SCIF->SCIF_GCCTRL[id].SCIF_GCCTRL = 0; +} + +static inline void genclk_enable_source(enum genclk_source src) +{ + switch (src) { + case GENCLK_SRC_RCSYS: + case GENCLK_SRC_CLK_CPU: + case GENCLK_SRC_CLK_HSB: + case GENCLK_SRC_CLK_PBA: + case GENCLK_SRC_CLK_PBB: + case GENCLK_SRC_CLK_PBC: + case GENCLK_SRC_CLK_PBD: + // Nothing to do + break; + +#ifdef BOARD_OSC32_HZ + case GENCLK_SRC_OSC32K: + case GENCLK_SRC_CLK_1K: // The 1K linked on OSC32K + if (!osc_is_ready(OSC_ID_OSC32)) { + osc_enable(OSC_ID_OSC32); + osc_wait_ready(OSC_ID_OSC32); + } + break; +#endif + + case GENCLK_SRC_RC80M: + if (!osc_is_ready(OSC_ID_RC80M)) { + osc_enable(OSC_ID_RC80M); + osc_wait_ready(OSC_ID_RC80M); + } + break; + + case GENCLK_SRC_RCFAST: + if (!osc_is_ready(OSC_ID_RCFAST)) { + osc_enable(OSC_ID_RCFAST); + osc_wait_ready(OSC_ID_RCFAST); + } + break; + + case GENCLK_SRC_RC1M: + if (!osc_is_ready(OSC_ID_RC1M)) { + osc_enable(OSC_ID_RC1M); + osc_wait_ready(OSC_ID_RC1M); + } + break; + + case GENCLK_SRC_RC32K: + if (!osc_is_ready(OSC_ID_RC32K)) { + osc_enable(OSC_ID_RC32K); + osc_wait_ready(OSC_ID_RC32K); + } + break; + +#ifdef CONFIG_DFLL0_SOURCE + case GENCLK_SRC_DFLL: + dfll_enable_config_defaults(0); + break; +#endif + +#ifdef BOARD_OSC0_HZ + case GENCLK_SRC_OSC0: + if (!osc_is_ready(OSC_ID_OSC0)) { + osc_enable(OSC_ID_OSC0); + osc_wait_ready(OSC_ID_OSC0); + } + break; +#endif + +# ifdef CONFIG_PLL0_SOURCE + case GENCLK_SRC_PLL0: { + pll_enable_config_defaults(0); + break; + } +# endif + + default: + Assert(false); + break; + } +} + +#endif /* __ASSEMBLY__ */ + +//! @} + +#ifdef __cplusplus +} +#endif + +#endif /* CHIP_GENCLK_H_INCLUDED */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/osc.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/osc.c new file mode 100644 index 000000000..0c4ecf45c --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/osc.c @@ -0,0 +1,222 @@ +/** + * \file + * + * \brief Chip-specific oscillator management functions + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +#include + +#ifdef BOARD_OSC0_HZ +void osc_priv_enable_osc0(void) +{ + irqflags_t flags; + + flags = cpu_irq_save(); + SCIF->SCIF_UNLOCK = SCIF_UNLOCK_KEY(0xAAu) + | SCIF_UNLOCK_ADDR((uint32_t)&SCIF->SCIF_OSCCTRL0 - (uint32_t)SCIF); + SCIF->SCIF_OSCCTRL0 = + OSC0_STARTUP_VALUE +# if BOARD_OSC0_IS_XTAL == true + | OSC0_GAIN_VALUE +#endif + | OSC0_MODE_VALUE + | SCIF_OSCCTRL0_OSCEN; + cpu_irq_restore(flags); +} + +void osc_priv_disable_osc0(void) +{ + irqflags_t flags; + + flags = cpu_irq_save(); + SCIF->SCIF_UNLOCK = SCIF_UNLOCK_KEY(0xAAu) + | SCIF_UNLOCK_ADDR((uint32_t)&SCIF->SCIF_OSCCTRL0 - (uint32_t)SCIF); + SCIF->SCIF_OSCCTRL0 = 0; + cpu_irq_restore(flags); +} +#endif /* BOARD_OSC0_HZ */ + +#ifdef BOARD_OSC32_HZ +void osc_priv_enable_osc32(void) +{ + irqflags_t flags; + + flags = cpu_irq_save(); + BSCIF->BSCIF_UNLOCK = BSCIF_UNLOCK_KEY(0xAAu) + | BSCIF_UNLOCK_ADDR((uint32_t)&BSCIF->BSCIF_OSCCTRL32 - (uint32_t)BSCIF); + BSCIF->BSCIF_OSCCTRL32 = + OSC32_STARTUP_VALUE + | BOARD_OSC32_SELCURR + | OSC32_MODE_VALUE + | BSCIF_OSCCTRL32_EN1K + | BSCIF_OSCCTRL32_EN32K + | BSCIF_OSCCTRL32_OSC32EN; + cpu_irq_restore(flags); +} + +void osc_priv_disable_osc32(void) +{ + irqflags_t flags; + + flags = cpu_irq_save(); + BSCIF->BSCIF_UNLOCK = BSCIF_UNLOCK_KEY(0xAAu) + | BSCIF_UNLOCK_ADDR((uint32_t)&BSCIF->BSCIF_OSCCTRL32 - (uint32_t)BSCIF); + BSCIF->BSCIF_OSCCTRL32 &= ~BSCIF_OSCCTRL32_OSC32EN; + // Wait until OSC32 RDY flag is cleared. + while (BSCIF->BSCIF_PCLKSR & BSCIF_PCLKSR_OSC32RDY); + cpu_irq_restore(flags); +} +#endif /* BOARD_OSC32_HZ */ + +void osc_priv_enable_rc32k(void) +{ + irqflags_t flags; + uint32_t temp; + + flags = cpu_irq_save(); + temp = BSCIF->BSCIF_RC32KCR; + BSCIF->BSCIF_UNLOCK = BSCIF_UNLOCK_KEY(0xAAu) + | BSCIF_UNLOCK_ADDR((uint32_t)&BSCIF->BSCIF_RC32KCR - (uint32_t)BSCIF); + BSCIF->BSCIF_RC32KCR = temp | BSCIF_RC32KCR_EN32K | BSCIF_RC32KCR_EN; + cpu_irq_restore(flags); +} + +void osc_priv_disable_rc32k(void) +{ + irqflags_t flags; + uint32_t temp; + + flags = cpu_irq_save(); + temp = BSCIF->BSCIF_RC32KCR; + temp &= ~BSCIF_RC32KCR_EN; + BSCIF->BSCIF_UNLOCK = BSCIF_UNLOCK_KEY(0xAAu) + | BSCIF_UNLOCK_ADDR((uint32_t)&BSCIF->BSCIF_RC32KCR - (uint32_t)BSCIF); + BSCIF->BSCIF_RC32KCR = temp; + cpu_irq_restore(flags); +} + +void osc_priv_enable_rc1m(void) +{ + irqflags_t flags; + uint32_t temp; + + flags = cpu_irq_save(); + temp = BSCIF->BSCIF_RC1MCR; + BSCIF->BSCIF_UNLOCK = BSCIF_UNLOCK_KEY(0xAAu) + | BSCIF_UNLOCK_ADDR((uint32_t)&BSCIF->BSCIF_RC1MCR - (uint32_t)BSCIF); + BSCIF->BSCIF_RC1MCR = temp | BSCIF_RC1MCR_CLKOE; + cpu_irq_restore(flags); +} + +void osc_priv_disable_rc1m(void) +{ + irqflags_t flags; + uint32_t temp; + + flags = cpu_irq_save(); + temp = BSCIF->BSCIF_RC1MCR; + temp &= ~BSCIF_RC1MCR_CLKOE; + BSCIF->BSCIF_UNLOCK = BSCIF_UNLOCK_KEY(0xAAu) + | BSCIF_UNLOCK_ADDR((uint32_t)&BSCIF->BSCIF_RC1MCR - (uint32_t)BSCIF); + BSCIF->BSCIF_RC1MCR = temp; + cpu_irq_restore(flags); +} + +void osc_priv_enable_rc80m(void) +{ + irqflags_t flags; + uint32_t temp; + + flags = cpu_irq_save(); + temp = SCIF->SCIF_RC80MCR; + SCIF->SCIF_UNLOCK = SCIF_UNLOCK_KEY(0xAAu) + | SCIF_UNLOCK_ADDR((uint32_t)&SCIF->SCIF_RC80MCR - (uint32_t)SCIF); + SCIF->SCIF_RC80MCR = temp | SCIF_RC80MCR_EN; + cpu_irq_restore(flags); +} + +void osc_priv_disable_rc80m(void) +{ + irqflags_t flags; + uint32_t temp; + + flags = cpu_irq_save(); + temp = SCIF->SCIF_RC80MCR; + temp &= ~SCIF_RC80MCR_EN ; + SCIF->SCIF_UNLOCK = SCIF_UNLOCK_KEY(0xAAu) + | SCIF_UNLOCK_ADDR((uint32_t)&SCIF->SCIF_RC80MCR - (uint32_t)SCIF); + SCIF->SCIF_RC80MCR = temp; + cpu_irq_restore(flags); +} + +void osc_priv_enable_rcfast(void) +{ + irqflags_t flags; + uint32_t temp; + + flags = cpu_irq_save(); + // Let FCD and calibration value by default + temp = SCIF->SCIF_RCFASTCFG; + // Clear previous FRANGE value + temp &= ~SCIF_RCFASTCFG_FRANGE_Msk; + + SCIF->SCIF_UNLOCK = SCIF_UNLOCK_KEY(0xAAu) + | SCIF_UNLOCK_ADDR((uint32_t)&SCIF->SCIF_RCFASTCFG - (uint32_t)SCIF); + SCIF->SCIF_RCFASTCFG = temp | SCIF_RCFASTCFG_EN + | SCIF_RCFASTCFG_FRANGE(CONFIG_RCFAST_FRANGE); + cpu_irq_restore(flags); +} + +void osc_priv_disable_rcfast(void) +{ + irqflags_t flags; + uint32_t temp; + flags = cpu_irq_save(); + // Let FCD and calibration value by default + temp = SCIF->SCIF_RCFASTCFG; + // Clear previous FRANGE value + temp &= ~SCIF_RCFASTCFG_FRANGE_Msk; + // Disalbe RCFAST + temp &= ~SCIF_RCFASTCFG_EN; + SCIF->SCIF_UNLOCK = SCIF_UNLOCK_KEY(0xAAu) + | SCIF_UNLOCK_ADDR((uint32_t)&SCIF->SCIF_RCFASTCFG - (uint32_t)SCIF); + SCIF->SCIF_RCFASTCFG = temp; + cpu_irq_restore(flags); +} + diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/osc.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/osc.h new file mode 100644 index 000000000..faca56d38 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/osc.h @@ -0,0 +1,504 @@ +/** + * \file + * + * \brief Chip-specific oscillator management functions + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +#ifndef CHIP_OSC_H_INCLUDED +#define CHIP_OSC_H_INCLUDED + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * \weakgroup osc_group + * @{ + */ + +//! \name Oscillator identifiers +//@{ +#define OSC_ID_OSC0 0 //!< External Oscillator 0 +#define OSC_ID_OSC32 1 //!< External 32 kHz oscillator +#define OSC_ID_RC32K 2 //!< Internal 32 kHz RC oscillator +#define OSC_ID_RC80M 3 //!< Internal 80 MHz RC oscillator +#define OSC_ID_RCFAST 4 //!< Internal 4-8-12 MHz RCFAST oscillator +#define OSC_ID_RC1M 5 //!< Internal 1 MHz RC oscillator +#define OSC_ID_RCSYS 6 //!< Internal System RC oscillator +//@} + +//! \name OSC0 mode values +//@{ +//! External clock connected to XIN +#define OSC_MODE_EXTERNAL 0 +//! Crystal connected to XIN/XOUT +#define OSC_MODE_XTAL SCIF_OSCCTRL0_MODE +//@} + +//! \name OSC32 mode values +//@{ +//! External clock connected to XIN32 +#define OSC32_MODE_EXTERNAL BSCIF_OSCCTRL32_MODE(0) +//! Crystal connected to XIN32/XOUT32 +#define OSC32_MODE_XTAL BSCIF_OSCCTRL32_MODE(1) +//! Crystal connected to XIN32/XOUT32 in high current mode +#define OSC32_MODE_XTAL_HC BSCIF_OSCCTRL32_MODE(4) +//@} + +//! \name OSC0 startup values +//@{ +//! 0 cycles +#define OSC_STARTUP_0 SCIF_OSCCTRL0_STARTUP(0) +//! 64 cycles (560 us) +#define OSC_STARTUP_64 SCIF_OSCCTRL0_STARTUP(1) +//! 128 cycles (1.1 ms) +#define OSC_STARTUP_128 SCIF_OSCCTRL0_STARTUP(2) +//! 2048 cycles (18 ms) +#define OSC_STARTUP_2048 SCIF_OSCCTRL0_STARTUP(3) +//! 4096 cycles (36 ms) +#define OSC_STARTUP_4096 SCIF_OSCCTRL0_STARTUP(4) +//! 8192 cycles (71 ms) +#define OSC_STARTUP_8192 SCIF_OSCCTRL0_STARTUP(5) +//! 16384 cycles (143 ms) +#define OSC_STARTUP_16384 SCIF_OSCCTRL0_STARTUP(6) +//! 32768 cycles (285 ms) +#define OSC_STARTUP_32768 SCIF_OSCCTRL0_STARTUP(7) +//@} + +//! \name OSC32 startup values +//@{ +//! 0 cycles +#define OSC32_STARTUP_0 BSCIF_OSCCTRL32_STARTUP(0) +//! 128 cycles (1.1 ms) +#define OSC32_STARTUP_128 BSCIF_OSCCTRL32_STARTUP(1) +//! 8192 cycles (72.3 ms) +#define OSC32_STARTUP_8192 BSCIF_OSCCTRL32_STARTUP(2) +//! 16384 cycles (143 ms) +#define OSC32_STARTUP_16384 BSCIF_OSCCTRL32_STARTUP(3) +//! 65536 cycles (570 ms) +#define OSC32_STARTUP_65536 BSCIF_OSCCTRL32_STARTUP(4) +//! 131072 cycles (1.1 s) +#define OSC32_STARTUP_131072 BSCIF_OSCCTRL32_STARTUP(5) +//! 262144 cycles (2.3 s) +#define OSC32_STARTUP_262144 BSCIF_OSCCTRL32_STARTUP(6) +//! 524288 cycles (4.6 s) +#define OSC32_STARTUP_524288 BSCIF_OSCCTRL32_STARTUP(7) +//@} + +/** + * \def OSC0_STARTUP_TIMEOUT + * \brief Number of slow clock cycles to wait for OSC0 to start + * + * This is the number of slow clock cycles corresponding to + * OSC0_STARTUP_VALUE with an additional 25% safety margin. If the + * oscillator isn't running when this timeout has expired, it is assumed + * to have failed to start. + */ +/** + * \def OSC0_MODE_VALUE + * \brief Board-dependent value written to the MODE bitfield of + * PM_OSCCTRL(0) + */ +/** + * \def OSC0_STARTUP_VALUE + * \brief Board-dependent value written to the STARTUP bitfield of + * PM_OSCCTRL(0) + */ +#if defined(BOARD_OSC0_STARTUP_US) +# if BOARD_OSC0_STARTUP_US == 0 +# define OSC0_STARTUP_VALUE OSC_STARTUP_0 +# define OSC0_STARTUP_TIMEOUT 8 +# elif BOARD_OSC0_STARTUP_US <= 557 +# define OSC0_STARTUP_VALUE OSC_STARTUP_64 +# define OSC0_STARTUP_TIMEOUT 80 +# elif BOARD_OSC0_STARTUP_US <= 1100 +# define OSC0_STARTUP_VALUE OSC_STARTUP_128 +# define OSC0_STARTUP_TIMEOUT 160 +# elif BOARD_OSC0_STARTUP_US <= 18000 +# define OSC0_STARTUP_VALUE OSC_STARTUP_2048 +# define OSC0_STARTUP_TIMEOUT 2560 +# elif BOARD_OSC0_STARTUP_US <= 36000 +# define OSC0_STARTUP_VALUE OSC_STARTUP_4096 +# define OSC0_STARTUP_TIMEOUT 5120 +# elif BOARD_OSC0_STARTUP_US <= 71000 +# define OSC0_STARTUP_VALUE OSC_STARTUP_8192 +# define OSC0_STARTUP_TIMEOUT 10240 +# elif BOARD_OSC0_STARTUP_US <= 143000 +# define OSC0_STARTUP_VALUE OSC_STARTUP_16384 +# define OSC0_STARTUP_TIMEOUT 20480 +# elif BOARD_OSC0_STARTUP_US <= 285000 +# define OSC0_STARTUP_VALUE OSC_STARTUP_32768 +# define OSC0_STARTUP_TIMEOUT 40960 +# else +# error BOARD_OSC0_STARTUP_US is too high +# endif +# if BOARD_OSC0_IS_XTAL == true +# define OSC0_MODE_VALUE OSC_MODE_XTAL +# if BOARD_OSC0_HZ < 2000000 +# define OSC0_GAIN_VALUE SCIF_OSCCTRL0_GAIN(0) +# elif BOARD_OSC0_HZ < 4000000 +# define OSC0_GAIN_VALUE SCIF_OSCCTRL0_GAIN(1) +# elif BOARD_OSC0_HZ < 8000000 +# define OSC0_GAIN_VALUE SCIF_OSCCTRL0_GAIN(2) +# elif BOARD_OSC0_HZ < 16000000 +# define OSC0_GAIN_VALUE SCIF_OSCCTRL0_GAIN(3) +# else +# define OSC0_GAIN_VALUE ((0x1u << 4) | SCIF_OSCCTRL0_GAIN(0)) +# endif +# else +# define OSC0_MODE_VALUE OSC_MODE_EXTERNAL +# endif +#else +# if defined(BOARD_OSC0_HZ) +# error BOARD_OSC0_STARTUP_US must be defined by the board code +# endif +# ifdef __DOXYGEN__ +# define OSC0_STARTUP_VALUE UNDEFINED +# define OSC0_STARTUP_TIMEOUT UNDEFINED +# define OSC0_MODE_VALUE UNDEFINED +# endif +#endif + +#if defined(BOARD_OSC32_STARTUP_US) +# if BOARD_OSC32_STARTUP_US == 0 +# define OSC32_STARTUP_VALUE OSC32_STARTUP_0 +# elif BOARD_OSC32_STARTUP_US <= 1100 +# define OSC32_STARTUP_VALUE OSC32_STARTUP_128 +# elif BOARD_OSC32_STARTUP_US <= 72300 +# define OSC32_STARTUP_VALUE OSC32_STARTUP_8192 +# elif BOARD_OSC32_STARTUP_US <= 143000 +# define OSC32_STARTUP_VALUE OSC32_STARTUP_16384 +# elif BOARD_OSC32_STARTUP_US <= 570000 +# define OSC32_STARTUP_VALUE OSC32_STARTUP_65536 +# elif BOARD_OSC32_STARTUP_US <= 1100000 +# define OSC32_STARTUP_VALUE OSC32_STARTUP_131072 +# elif BOARD_OSC32_STARTUP_US <= 2300000 +# define OSC32_STARTUP_VALUE OSC32_STARTUP_262144 +# elif BOARD_OSC32_STARTUP_US <= 4600000 +# define OSC32_STARTUP_VALUE OSC32_STARTUP_524288 +# else +# error BOARD_OSC32_STARTUP_US is too high +# endif +# if BOARD_OSC32_IS_XTAL == true +# define OSC32_MODE_VALUE OSC32_MODE_XTAL +# else +# define OSC32_MODE_VALUE OSC32_MODE_EXTERNAL +# endif +#else +# if defined(BOARD_OSC32_HZ) +# error BOARD_OSC32_STARTUP_US must be defined by the board code +# endif +# ifdef __DOXYGEN__ +# define OSC32_STARTUP_VALUE UNDEFINED +# define OSC32_STARTUP_TIMEOUT UNDEFINED +# define OSC32_MODE_VALUE UNDEFINED +# endif +#endif + +// Use 4 MHz frequency range for RCFAST oscillator if config was empty. +#ifndef CONFIG_RCFAST_FRANGE +#define CONFIG_RCFAST_FRANGE 0 +#endif + +/** + * \name Board-specific configuration parameters + * The following definitions must be provided by the board code for all + * working oscillators on the board. + */ +//@{ +/** + * \def BOARD_OSC0_HZ + * \brief Clock frequency of OSC0 in Hz + */ +/** + * \def BOARD_OSC0_STARTUP_US + * \brief Startup time of OSC0 in microseconds + */ +/** + * \def BOARD_OSC0_IS_XTAL + * \brief OSC0 uses a crystal, not an external clock + */ +/** + * \def BOARD_OSC32_HZ + * \brief Clock frequency of OSC32 in Hz + */ +/** + * \def BOARD_OSC32_STARTUP_US + * \brief Startup time of OSC32 in microseconds + */ +/** + * \def BOARD_OSC32_IS_XTAL + * \brief OSC32 uses a crystal, not an external clock + */ +/** + * \def BOARD_OSC32_SELCURR + * \brief Crystal current selection for OSC32 + * + * If not defined, the recommended value (300nA) are used. + */ +#ifndef BOARD_OSC32_SELCURR +# define BOARD_OSC32_SELCURR BSCIF_OSCCTRL32_SELCURR(10) +#endif + +/** + * \name RC oscillator frequency limits + * The frequency of the internal RC oscillators may drift a bit as a + * result of temperature changes. These definitions provide upper and + * lower limits which may be used to calculate upper and lower limits of + * timeouts, derived clock frequencies, etc. + */ +//@{ +//! Nominal frequency of RCSYS in Hz +#define OSC_RCSYS_NOMINAL_HZ 115000 +//! Minimum frequency of RCSYS in Hz +#define OSC_RCSYS_MIN_HZ 100000 +//! Maximum frequency of RCSYS in Hz +#define OSC_RCSYS_MAX_HZ 120000 + +//! Nominal frequency of RC32K in Hz +#define OSC_RC32K_NOMINAL_HZ 32768 +//! Minimum frequency of RC32K in Hz +#define OSC_RC32K_MIN_HZ 20000 +//! Maximum frequency of RC32K in Hz +#define OSC_RC32K_MAX_HZ 44000 + +//! Nominal frequency of RC80M in Hz +#define OSC_RC80M_NOMINAL_HZ 80000000 + +//! Nominal frequency of RCFAST4M in Hz +#define OSC_RCFAST4M_NOMINAL_HZ 4000000 + +//! Nominal frequency of RCFAST8M in Hz +#define OSC_RCFAST8M_NOMINAL_HZ 8000000 + +//! Nominal frequency of RCFAST12M in Hz +#define OSC_RCFAST12M_NOMINAL_HZ 12000000 + +//! Nominal frequency of RC1M in Hz +#define OSC_RC1M_NOMINAL_HZ 1000000 +//@} + +#ifndef __ASSEMBLY__ + +#include + +extern void osc_priv_enable_osc0(void); +extern void osc_priv_disable_osc0(void); +extern void osc_priv_enable_osc32(void); +extern void osc_priv_disable_osc32(void); +extern void osc_priv_enable_rc32k(void); +extern void osc_priv_disable_rc32k(void); +extern void osc_priv_enable_rc80m(void); +extern void osc_priv_disable_rc80m(void); +extern void osc_priv_enable_rcfast(void); +extern void osc_priv_disable_rcfast(void); +extern void osc_priv_enable_rc1m(void); +extern void osc_priv_disable_rc1m(void); + +static inline void osc_enable(uint8_t id) +{ + switch (id) { +#ifdef BOARD_OSC0_HZ + case OSC_ID_OSC0: + osc_priv_enable_osc0(); + break; +#endif + +#ifdef BOARD_OSC32_HZ + case OSC_ID_OSC32: + osc_priv_enable_osc32(); + break; +#endif + + case OSC_ID_RC32K: + osc_priv_enable_rc32k(); + break; + + case OSC_ID_RC80M: + osc_priv_enable_rc80m(); + break; + + case OSC_ID_RCFAST: + osc_priv_enable_rcfast(); + break; + + case OSC_ID_RC1M: + osc_priv_enable_rc1m(); + break; + + case OSC_ID_RCSYS: + /* RCSYS is always running */ + break; + + default: + /* unhandled_case(id); */ + break; + } +} + +static inline void osc_disable(uint8_t id) +{ + switch (id) { +#ifdef BOARD_OSC0_HZ + case OSC_ID_OSC0: + osc_priv_disable_osc0(); + break; +#endif + +#ifdef BOARD_OSC32_HZ + case OSC_ID_OSC32: + osc_priv_disable_osc32(); + break; +#endif + + case OSC_ID_RC32K: + osc_priv_disable_rc32k(); + break; + + case OSC_ID_RC80M: + osc_priv_disable_rc80m(); + break; + + case OSC_ID_RCFAST: + osc_priv_disable_rcfast(); + break; + + case OSC_ID_RC1M: + osc_priv_disable_rc1m(); + break; + + case OSC_ID_RCSYS: + /* RCSYS is always running */ + break; + + default: + /* unhandled_case(id); */ + break; + } +} + +static inline bool osc_is_ready(uint8_t id) +{ + switch (id) { +#ifdef BOARD_OSC0_HZ + case OSC_ID_OSC0: + return !!(SCIF->SCIF_PCLKSR & SCIF_PCLKSR_OSC0RDY); +#endif + +#ifdef BOARD_OSC32_HZ + case OSC_ID_OSC32: + return !!(BSCIF->BSCIF_PCLKSR & BSCIF_PCLKSR_OSC32RDY); +#endif + + case OSC_ID_RC32K: + return !!(BSCIF->BSCIF_RC32KCR & (BSCIF_RC32KCR_EN)); + + case OSC_ID_RC80M: + return !!(SCIF->SCIF_RC80MCR & (SCIF_RC80MCR_EN)); + + case OSC_ID_RCFAST: + return !!(SCIF->SCIF_RCFASTCFG & (SCIF_RCFASTCFG_EN)); + + case OSC_ID_RC1M: + return !!(BSCIF->BSCIF_RC1MCR & (BSCIF_RC1MCR_CLKOE)); + + case OSC_ID_RCSYS: + /* RCSYS is always ready */ + return true; + + default: + /* unhandled_case(id); */ + return false; + } +} + +static inline uint32_t osc_get_rate(uint8_t id) +{ + switch (id) { +#ifdef BOARD_OSC0_HZ + case OSC_ID_OSC0: + return BOARD_OSC0_HZ; +#endif + +#ifdef BOARD_OSC32_HZ + case OSC_ID_OSC32: + return BOARD_OSC32_HZ; +#endif + + case OSC_ID_RC32K: + return OSC_RC32K_NOMINAL_HZ; + + case OSC_ID_RC80M: + return OSC_RC80M_NOMINAL_HZ; + + case OSC_ID_RCFAST: + if (CONFIG_RCFAST_FRANGE == 2) { + return OSC_RCFAST12M_NOMINAL_HZ; + + } else if (CONFIG_RCFAST_FRANGE == 1) { + return OSC_RCFAST8M_NOMINAL_HZ; + + } else { + return OSC_RCFAST4M_NOMINAL_HZ; + } + + case OSC_ID_RC1M: + return OSC_RC1M_NOMINAL_HZ; + + case OSC_ID_RCSYS: + return OSC_RCSYS_NOMINAL_HZ; + + default: + /* unhandled_case(id); */ + return 0; + } +} + +#endif /* !__ASSEMBLY__ */ + +//! @} + +#ifdef __cplusplus +} +#endif + +#endif /* CHIP_OSC_H_INCLUDED */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/pll.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/pll.c new file mode 100644 index 000000000..2baf1d1a4 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/pll.c @@ -0,0 +1,88 @@ +/** + * \file + * + * \brief Chip-specific PLL implementation + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +#include +#include + +#define SCIF_UNLOCK_PLL_REG(pll_id) \ + do { \ + SCIF->SCIF_UNLOCK = SCIF_UNLOCK_KEY(0xAAu) \ + | SCIF_UNLOCK_ADDR((uint32_t)&SCIF->SCIF_PLL[0].SCIF_PLL \ + + (4 * pll_id) - (uint32_t)SCIF); \ + } while (0) + +void pll_config_write(const struct pll_config *cfg, uint32_t pll_id) +{ + irqflags_t flags; + + Assert(pll_id < NR_PLLS); + + flags = cpu_irq_save(); + + SCIF_UNLOCK_PLL_REG(pll_id); + SCIF->SCIF_PLL[pll_id].SCIF_PLL = cfg->ctrl; + cpu_irq_restore(flags); +} + +void pll_enable(const struct pll_config *cfg, uint32_t pll_id) +{ + irqflags_t flags; + + Assert(pll_id < NR_PLLS); + + flags = cpu_irq_save(); + SCIF_UNLOCK_PLL_REG(pll_id); + SCIF->SCIF_PLL[pll_id].SCIF_PLL = cfg->ctrl | SCIF_PLL_PLLEN; + cpu_irq_restore(flags); +} + +void pll_disable(uint32_t pll_id) +{ + irqflags_t flags; + + Assert(pll_id < NR_PLLS); + + flags = cpu_irq_save(); + SCIF_UNLOCK_PLL_REG(pll_id); + SCIF->SCIF_PLL[pll_id].SCIF_PLL = 0; + cpu_irq_restore(flags); +} diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/pll.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/pll.h new file mode 100644 index 000000000..1240fce7c --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/pll.h @@ -0,0 +1,253 @@ +/** + * \file + * + * \brief Chip-specific PLL definitions + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +#ifndef CHIP_PLL_H_INCLUDED +#define CHIP_PLL_H_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +#define SCIF0_PLL_VCO_RANGE1_MAX_FREQ 240000000 +#define SCIF_PLL0_VCO_RANGE1_MIN_FREQ 160000000 +#define SCIF_PLL0_VCO_RANGE0_MAX_FREQ 180000000 +#define SCIF_PLL0_VCO_RANGE0_MIN_FREQ 80000000 + +/** + * \weakgroup pll_group + * @{ + */ + +#define PLL_MAX_STARTUP_CYCLES (SCIF_PLL_PLLCOUNT_Msk >> SCIF_PLL_PLLCOUNT_Pos) +#define NR_PLLS 1 + +/** + * \brief Number of milliseconds to wait for PLL lock + */ +#define PLL_TIMEOUT_MS \ + div_ceil(1000 * (PLL_MAX_STARTUP_CYCLES * 2), OSC_RCSYS_MIN_HZ) + +/** + * \note The PLL must run at twice this frequency internally, but the + * output frequency may be divided by two by setting the PLLOPT[1] bit. + */ +#define PLL_MIN_HZ 40000000 +#define PLL_MAX_HZ 240000000 + +//! \name Chip-specific PLL options +//@{ +//! VCO frequency range is 160-240 MHz (80-180 MHz if unset). +#define PLL_OPT_VCO_RANGE_HIGH 0 +//! Divide output frequency by two +#define PLL_OPT_OUTPUT_DIV 1 +//! Disable wide-bandwidth mode +#define PLL_OPT_WBM_DISABLE 2 +//! Number of PLL options +#define PLL_NR_OPTIONS 3 +//! The threshold above which to set the #PLL_OPT_VCO_RANGE_HIGH option +#define PLL_VCO_LOW_THRESHOLD ((SCIF_PLL0_VCO_RANGE1_MIN_FREQ \ + + SCIF_PLL0_VCO_RANGE0_MAX_FREQ) / 2) +//@} + +#ifndef __ASSEMBLY__ + +#include +#include + +enum pll_source { + PLL_SRC_OSC0 = 0, //!< Oscillator 0 + PLL_SRC_GCLK9 = 1, //!< Generic Clock 9 + PLL_NR_SOURCES, //!< Number of PLL sources +}; + +struct pll_config { + uint32_t ctrl; +}; + +#define pll_get_default_rate(pll_id) \ + ((osc_get_rate(CONFIG_PLL ## pll_id ## _SOURCE) \ + * CONFIG_PLL ## pll_id ## _MUL) \ + / CONFIG_PLL ## pll_id ## _DIV) + +static inline void pll_config_set_option(struct pll_config *cfg, + uint32_t option) +{ + Assert(option < PLL_NR_OPTIONS); + + cfg->ctrl |= 1U << (SCIF_PLL_PLLOPT_Pos + option); +} + +static inline void pll_config_clear_option(struct pll_config *cfg, + uint32_t option) +{ + Assert(option < PLL_NR_OPTIONS); + + cfg->ctrl &= ~(1U << (SCIF_PLL_PLLOPT_Pos + option)); +} + +/** + * The PLL options #PLL_OPT_VCO_RANGE_HIGH and #PLL_OPT_OUTPUT_DIV will + * be set automatically based on the calculated target frequency. + */ +static inline void pll_config_init(struct pll_config *cfg, + enum pll_source src, uint32_t divide, uint32_t mul) +{ +#define MUL_MIN 2 +#define MUL_MAX 16 +#define DIV_MIN 0 +#define DIV_MAX 15 + + uint32_t vco_hz; + + Assert(src < PLL_NR_SOURCES); + Assert(divide != 0); + + /* Calculate internal VCO frequency */ + vco_hz = osc_get_rate(src) * mul; + vco_hz /= divide; + Assert(vco_hz >= PLL_MIN_HZ); + Assert(vco_hz <= PLL_MAX_HZ); + + cfg->ctrl = 0; + + /* Bring the internal VCO frequency up to the minimum value */ + if ((vco_hz < PLL_MIN_HZ * 2) && (mul <= 8)) { + mul *= 2; + vco_hz *= 2; + pll_config_set_option(cfg, PLL_OPT_OUTPUT_DIV); + } + + /* Set VCO frequency range according to calculated value */ + if (vco_hz >= PLL_VCO_LOW_THRESHOLD) { + pll_config_set_option(cfg, PLL_OPT_VCO_RANGE_HIGH); + } + + Assert(mul > MUL_MIN && mul <= MUL_MAX); + Assert(divide > DIV_MIN && divide <= DIV_MAX); + + cfg->ctrl |= ((mul - 1) << SCIF_PLL_PLLMUL_Pos) + | (divide << SCIF_PLL_PLLDIV_Pos) + | (PLL_MAX_STARTUP_CYCLES << SCIF_PLL_PLLCOUNT_Pos) + | (src << SCIF_PLL_PLLOSC_Pos); +} + +#define pll_config_defaults(cfg, pll_id) \ + pll_config_init(cfg, \ + CONFIG_PLL ## pll_id ## _SOURCE, \ + CONFIG_PLL ## pll_id ## _DIV, \ + CONFIG_PLL ## pll_id ## _MUL) + +static inline void pll_config_read(struct pll_config *cfg, uint32_t pll_id) +{ + Assert(pll_id < NR_PLLS); + + cfg->ctrl = SCIF->SCIF_PLL[pll_id].SCIF_PLL; +} + +extern void pll_config_write(const struct pll_config *cfg, uint32_t pll_id); +extern void pll_enable(const struct pll_config *cfg, uint32_t pll_id); +extern void pll_disable(uint32_t pll_id); + +static inline bool pll_is_locked(uint32_t pll_id) +{ + Assert(pll_id < NR_PLLS); + return !!(SCIF->SCIF_PCLKSR & (1U << (6 + pll_id))); +} + +static inline void pll_enable_source(enum pll_source src) +{ + switch (src) { + case PLL_SRC_OSC0: + if (!osc_is_ready(OSC_ID_OSC0)) { + osc_enable(OSC_ID_OSC0); + osc_wait_ready(OSC_ID_OSC0); + } + break; +#ifdef CONFIG_GCLK9_SOURCE + case PLL_SRC_GCLK9: + SCIF->SCIF_GCCTRL[9].SCIF_GCCTRL = + SCIF_GCCTRL_OSCSEL(CONFIG_GCLK9_SOURCE) | + SCIF_GCCTRL_CEN; + break; +#endif + default: + Assert(false); + break; + } +} + +static inline void pll_enable_config_defaults(uint32_t pll_id) +{ + struct pll_config pllcfg; + + if (pll_is_locked(pll_id)) { + return; // Pll already running + } + + switch (pll_id) { +#ifdef CONFIG_PLL0_SOURCE + case 0: + pll_enable_source(CONFIG_PLL0_SOURCE); + pll_config_init(&pllcfg, + CONFIG_PLL0_SOURCE, + CONFIG_PLL0_DIV, + CONFIG_PLL0_MUL); + break; + +#endif + default: + Assert(false); + break; + } + pll_enable(&pllcfg, pll_id); + while (!pll_is_locked(pll_id)); +} + +#endif /* __ASSEMBLY__ */ + +//! @} + +#ifdef __cplusplus +} +#endif + +#endif /* CHIP_PLL_H_INCLUDED */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/sysclk.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/sysclk.c new file mode 100644 index 000000000..b1e170d33 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/sysclk.c @@ -0,0 +1,1008 @@ +/** + * \file + * + * \brief Chip-specific system clock management functions + * + * Copyright (c) 2012-2013 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#include +#include +#include +#include +#include +#include + +/** + * \weakgroup sysclk_group + * @{ + */ + +#if ((CONFIG_SYSCLK_CPU_DIV > CONFIG_SYSCLK_PBA_DIV) || \ + (CONFIG_SYSCLK_CPU_DIV > CONFIG_SYSCLK_PBB_DIV) || \ + (CONFIG_SYSCLK_CPU_DIV > CONFIG_SYSCLK_PBC_DIV) || \ + (CONFIG_SYSCLK_CPU_DIV > CONFIG_SYSCLK_PBD_DIV)) +# error CONFIG_SYSCLK_PBx_DIV must be equal to or more than CONFIG_SYSCLK_CPU_DIV. +#endif + +/** + * \internal + * \defgroup sysclk_internals_group System Clock internals + * + * System clock management is fairly straightforward apart from one + * thing: Enabling and disabling bus bridges. When all peripherals on a + * given bus are disabled, the bridge to the bus may be disabled. Only + * the PBA and PBB busses support this, and it is not practical to + * disable the PBA bridge as it includes the PM and SCIF modules, so turning + * it off would make it impossible to turn anything back on again. + * + * The system clock implementation keeps track of a reference count for + * PBB. When the reference count is zero, the bus bridge is disabled, otherwise + * it is enabled. + * + * @{ + */ + +/** + * \internal + * \name Initial module clock masks + * + * These are the mask values written to the xxxMASK registers during + * initialization if the user has overridden the default behavior of all clocks + * left enabled. These values assume that: + * - Debugging should be possible + * - The program may be running from flash + * - The PM should be available to unmask other clocks + * - All on-chip RAM should be available + * - SCIF, BPM, BSCIF and GPIO are made permanently available for now; this + * may change in the future. + */ +//@{ +//! \internal +//! \brief Initial value of CPUMASK +#define SYSCLK_INIT_MINIMAL_CPUMASK 0 + +//! \internal +//! \brief Initial value of HSBMASK +#define SYSCLK_INIT_MINIMAL_HSBMASK \ + ((1 << SYSCLK_HFLASHC_DATA) \ + | (1 << SYSCLK_PBB_BRIDGE) \ + | (1 << SYSCLK_PBC_BRIDGE) \ + | (1 << SYSCLK_PBD_BRIDGE)) + +//! \internal +//! \brief Initial value of PBAMASK +#define SYSCLK_INIT_MINIMAL_PBAMASK 0 + +//! \internal +//! \brief Initial value of PBBMASK +#define SYSCLK_INIT_MINIMAL_PBBMASK (1 << SYSCLK_HFLASHC_REGS) + +//! \internal +//! \brief Initial value of PBCMASK +#define SYSCLK_INIT_MINIMAL_PBCMASK \ + ((1 << SYSCLK_PM) \ + | (1 << SYSCLK_GPIO) \ + | (1 << SYSCLK_SCIF)) + +//! \internal +//! \brief Initial value of PBDMASK +#define SYSCLK_INIT_MINIMAL_PBDMASK \ + ((1 << SYSCLK_BPM) \ + | (1 << SYSCLK_BSCIF)) +//@} + +#if defined(CONFIG_SYSCLK_DEFAULT_RETURNS_SLOW_OSC) +/** + * \brief boolean signalling that the sysclk_init is done. + */ +bool sysclk_initialized = false; +#endif + +/** + * \internal + * \brief Enable a maskable module clock. + * \param bus_id Bus index, given by the \c PM_CLK_GRP_xxx definitions. + * \param module_index Index of the module to be enabled. This is the + * bit number in the corresponding xxxMASK register. + */ +void sysclk_priv_enable_module(uint32_t bus_id, uint32_t module_index) +{ + irqflags_t flags; + uint32_t mask; + + flags = cpu_irq_save(); + + /* Enable the clock */ + mask = *(&PM->PM_CPUMASK + bus_id); + mask |= 1U << module_index; + PM->PM_UNLOCK = PM_UNLOCK_KEY(0xAAu) | + BPM_UNLOCK_ADDR(((uint32_t)&PM->PM_CPUMASK - (uint32_t)PM) + (4 * bus_id)); + *(&PM->PM_CPUMASK + bus_id) = mask; + + cpu_irq_restore(flags); +} + +/** + * \internal + * \brief Disable a maskable module clock. + * \param bus_id Bus index, given by the \c PM_CLK_GRP_xxx definitions. + * \param module_index Index of the module to be disabled. This is the + * bit number in the corresponding xxxMASK register. + */ +void sysclk_priv_disable_module(uint32_t bus_id, uint32_t module_index) +{ + irqflags_t flags; + uint32_t mask; + + flags = cpu_irq_save(); + + /* Disable the clock */ + mask = *(&PM->PM_CPUMASK + bus_id); + mask &= ~(1U << module_index); + PM->PM_UNLOCK = PM_UNLOCK_KEY(0xAAu) | + BPM_UNLOCK_ADDR(((uint32_t)&PM->PM_CPUMASK - (uint32_t)PM) + (4 * bus_id)); + *(&PM->PM_CPUMASK + bus_id) = mask; + + cpu_irq_restore(flags); +} + +//! @} + +/** + * \brief Enable a module clock derived from the PBA clock + * \param index Index of the module clock in the PBAMASK register + */ +void sysclk_enable_pba_module(uint32_t index) +{ + irqflags_t flags; + + /* Enable the bridge if necessary */ + flags = cpu_irq_save(); + + if (PM->PM_PBAMASK == 0) { + sysclk_enable_hsb_module(SYSCLK_PBA_BRIDGE); + } + + cpu_irq_restore(flags); + + /* Enable the module */ + sysclk_priv_enable_module(PM_CLK_GRP_PBA, index); +} + +/** + * \brief Disable a module clock derived from the PBA clock + * \param index Index of the module clock in the PBAMASK register + */ +void sysclk_disable_pba_module(uint32_t index) +{ + irqflags_t flags; + + /* Disable the module */ + sysclk_priv_disable_module(PM_CLK_GRP_PBA, index); + + /* Disable the bridge if possible */ + flags = cpu_irq_save(); + + if (PM->PM_PBAMASK == 0) { + sysclk_disable_hsb_module(SYSCLK_PBA_BRIDGE); + } + + cpu_irq_restore(flags); +} + +/** + * \brief Enable a module clock derived from the PBB clock + * \param index Index of the module clock in the PBBMASK register + */ +void sysclk_enable_pbb_module(uint32_t index) +{ + irqflags_t flags; + + /* Enable the bridge if necessary */ + flags = cpu_irq_save(); + + if (PM->PM_PBBMASK == 0) { + sysclk_enable_hsb_module(SYSCLK_PBB_BRIDGE); + } + + cpu_irq_restore(flags); + + /* Enable the module */ + sysclk_priv_enable_module(PM_CLK_GRP_PBB, index); +} + +/** + * \brief Disable a module clock derived from the PBB clock + * \param index Index of the module clock in the PBBMASK register + */ +void sysclk_disable_pbb_module(uint32_t index) +{ + irqflags_t flags; + + /* Disable the module */ + sysclk_priv_disable_module(PM_CLK_GRP_PBB, index); + + /* Disable the bridge if possible */ + flags = cpu_irq_save(); + + if (PM->PM_PBBMASK == 0) { + sysclk_disable_hsb_module(SYSCLK_PBB_BRIDGE); + } + + cpu_irq_restore(flags); +} + +/** + * \brief Retrieves the current rate in Hz of the Peripheral Bus clock attached + * to the specified peripheral. + * + * \param module Pointer to the module's base address. + * + * \return Frequency of the bus attached to the specified peripheral, in Hz. + */ +uint32_t sysclk_get_peripheral_bus_hz(const volatile void *module) +{ + /* Fallthroughs intended for modules sharing the same peripheral bus. */ + switch ((uintptr_t)module) { + case IISC_ADDR: + case SPI_ADDR: + case TC0_ADDR: + case TC1_ADDR: + case TWIM0_ADDR: + case TWIS0_ADDR: + case TWIM1_ADDR: + case TWIS1_ADDR: + case USART0_ADDR: + case USART1_ADDR: + case USART2_ADDR: + case USART3_ADDR: + case ADCIFE_ADDR: + case DACC_ADDR: + case ACIFC_ADDR: + case GLOC_ADDR: + case ABDACB_ADDR: + case TRNG_ADDR: + case PARC_ADDR: + case CATB_ADDR: + case TWIM2_ADDR: + case TWIM3_ADDR: + case LCDCA_ADDR: + return sysclk_get_pba_hz(); + + case HFLASHC_ADDR: + case HCACHE_ADDR: + case HMATRIX_ADDR: + case PDCA_ADDR: + case CRCCU_ADDR: + case USBC_ADDR: + case PEVC_ADDR: + return sysclk_get_pbb_hz(); + + case PM_ADDR: + case CHIPID_ADDR: + case SCIF_ADDR: + case FREQM_ADDR: + case GPIO_ADDR: + return sysclk_get_pbc_hz(); + + case BPM_ADDR: + case BSCIF_ADDR: + case AST_ADDR: + case WDT_ADDR: + case EIC_ADDR: + case PICOUART_ADDR: + return sysclk_get_pbd_hz(); + + default: + Assert(false); + return 0; + } +} + +/** + * \brief Enable a peripheral's clock from its base address. + * + * Enables the clock to a peripheral, given its base address. If the peripheral + * has an associated clock on the HSB bus, this will be enabled also. + * + * \param module Pointer to the module's base address. + */ +void sysclk_enable_peripheral_clock(const volatile void *module) +{ + switch ((uintptr_t)module) { + case AESA_ADDR: + sysclk_enable_hsb_module(SYSCLK_AESA_HSB); + break; + + case IISC_ADDR: + sysclk_enable_pba_module(SYSCLK_IISC); + break; + + case SPI_ADDR: + sysclk_enable_pba_module(SYSCLK_SPI); + break; + + case TC0_ADDR: + sysclk_enable_pba_module(SYSCLK_TC0); + sysclk_enable_pba_divmask(PBA_DIVMASK_TIMER_CLOCK2 + | PBA_DIVMASK_TIMER_CLOCK3 + | PBA_DIVMASK_TIMER_CLOCK4 + | PBA_DIVMASK_TIMER_CLOCK5 + ); + break; + + case TC1_ADDR: + sysclk_enable_pba_module(SYSCLK_TC1); + sysclk_enable_pba_divmask(PBA_DIVMASK_TIMER_CLOCK2 + | PBA_DIVMASK_TIMER_CLOCK3 + | PBA_DIVMASK_TIMER_CLOCK4 + | PBA_DIVMASK_TIMER_CLOCK5 + ); + break; + + case TWIM0_ADDR: + sysclk_enable_pba_module(SYSCLK_TWIM0); + break; + + case TWIS0_ADDR: + sysclk_enable_pba_module(SYSCLK_TWIS0); + break; + + case TWIM1_ADDR: + sysclk_enable_pba_module(SYSCLK_TWIM1); + break; + + case TWIS1_ADDR: + sysclk_enable_pba_module(SYSCLK_TWIS1); + break; + + case USART0_ADDR: + sysclk_enable_pba_module(SYSCLK_USART0); + sysclk_enable_pba_divmask(PBA_DIVMASK_CLK_USART); + break; + + case USART1_ADDR: + sysclk_enable_pba_module(SYSCLK_USART1); + sysclk_enable_pba_divmask(PBA_DIVMASK_CLK_USART); + break; + + case USART2_ADDR: + sysclk_enable_pba_module(SYSCLK_USART2); + sysclk_enable_pba_divmask(PBA_DIVMASK_CLK_USART); + break; + + case USART3_ADDR: + sysclk_enable_pba_module(SYSCLK_USART3); + sysclk_enable_pba_divmask(PBA_DIVMASK_CLK_USART); + break; + + case ADCIFE_ADDR: + sysclk_enable_pba_module(SYSCLK_ADCIFE); + break; + + case DACC_ADDR: + sysclk_enable_pba_module(SYSCLK_DACC); + break; + + case ACIFC_ADDR: + sysclk_enable_pba_module(SYSCLK_ACIFC); + break; + + case GLOC_ADDR: + sysclk_enable_pba_module(SYSCLK_GLOC); + break; + + case ABDACB_ADDR: + sysclk_enable_pba_module(SYSCLK_ABDACB); + break; + + case TRNG_ADDR: + sysclk_enable_pba_module(SYSCLK_TRNG); + break; + + case PARC_ADDR: + sysclk_enable_pba_module(SYSCLK_PARC); + break; + + case CATB_ADDR: + sysclk_enable_pba_module(SYSCLK_CATB); + break; + + case TWIM2_ADDR: + sysclk_enable_pba_module(SYSCLK_TWIM2); + break; + + case TWIM3_ADDR: + sysclk_enable_pba_module(SYSCLK_TWIM3); + break; + + case LCDCA_ADDR: + sysclk_enable_pba_module(SYSCLK_LCDCA); + break; + + case HFLASHC_ADDR: + sysclk_enable_hsb_module(SYSCLK_HFLASHC_DATA); + sysclk_enable_pbb_module(SYSCLK_HFLASHC_REGS); + break; + + case HCACHE_ADDR: + sysclk_enable_hsb_module(SYSCLK_HRAMC1_DATA); + sysclk_enable_pbb_module(SYSCLK_HRAMC1_REGS); + break; + + case HMATRIX_ADDR: + sysclk_enable_pbb_module(SYSCLK_HMATRIX); + break; + + case PDCA_ADDR: + sysclk_enable_hsb_module(SYSCLK_PDCA_HSB); + sysclk_enable_pbb_module(SYSCLK_PDCA_PB); + break; + + case CRCCU_ADDR: + sysclk_enable_hsb_module(SYSCLK_CRCCU_DATA); + sysclk_enable_pbb_module(SYSCLK_CRCCU_REGS); + break; + + case USBC_ADDR: + sysclk_enable_hsb_module(SYSCLK_USBC_DATA); + sysclk_enable_pbb_module(SYSCLK_USBC_REGS); + break; + + case PEVC_ADDR: + sysclk_enable_pbb_module(SYSCLK_PEVC); + break; + + case PM_ADDR: + sysclk_enable_pbc_module(SYSCLK_PM); + break; + + case CHIPID_ADDR: + sysclk_enable_pbc_module(SYSCLK_CHIPID); + break; + + case SCIF_ADDR: + sysclk_enable_pbc_module(SYSCLK_SCIF); + break; + + case FREQM_ADDR: + sysclk_enable_pbc_module(SYSCLK_FREQM); + break; + + case GPIO_ADDR: + sysclk_enable_pbc_module(SYSCLK_GPIO); + break; + + case BPM_ADDR: + sysclk_enable_pbd_module(SYSCLK_BPM); + break; + + case BSCIF_ADDR: + sysclk_enable_pbd_module(SYSCLK_BSCIF); + break; + + case AST_ADDR: + sysclk_enable_pbd_module(SYSCLK_AST); + break; + + case WDT_ADDR: + sysclk_enable_pbd_module(SYSCLK_WDT); + break; + + case EIC_ADDR: + sysclk_enable_pbd_module(SYSCLK_EIC); + break; + + case PICOUART_ADDR: + sysclk_enable_pbd_module(SYSCLK_PICOUART); + break; + + default: + Assert(false); + return; + } +} + +/** + * \brief Disable a peripheral's clock from its base address. + * + * Disables the clock to a peripheral, given its base address. If the peripheral + * has an associated clock on the HSB bus, this will be disabled also. + * + * \param module Pointer to the module's base address. + */ +void sysclk_disable_peripheral_clock(const volatile void *module) +{ + switch ((uintptr_t)module) { + case AESA_ADDR: + sysclk_disable_hsb_module(SYSCLK_AESA_HSB); + break; + + case IISC_ADDR: + sysclk_disable_pba_module(SYSCLK_IISC); + break; + + case SPI_ADDR: + sysclk_disable_pba_module(SYSCLK_SPI); + break; + + case TC0_ADDR: + sysclk_disable_pba_module(SYSCLK_TC0); + break; + + case TC1_ADDR: + sysclk_disable_pba_module(SYSCLK_TC1); + break; + + case TWIM0_ADDR: + sysclk_disable_pba_module(SYSCLK_TWIM0); + break; + + case TWIS0_ADDR: + sysclk_disable_pba_module(SYSCLK_TWIS0); + break; + + case TWIM1_ADDR: + sysclk_disable_pba_module(SYSCLK_TWIM1); + break; + + case TWIS1_ADDR: + sysclk_disable_pba_module(SYSCLK_TWIS1); + break; + + case USART0_ADDR: + sysclk_disable_pba_module(SYSCLK_USART0); + break; + + case USART1_ADDR: + sysclk_disable_pba_module(SYSCLK_USART1); + break; + + case USART2_ADDR: + sysclk_disable_pba_module(SYSCLK_USART2); + break; + + case USART3_ADDR: + sysclk_disable_pba_module(SYSCLK_USART3); + break; + + case ADCIFE_ADDR: + sysclk_disable_pba_module(SYSCLK_ADCIFE); + break; + + case DACC_ADDR: + sysclk_disable_pba_module(SYSCLK_DACC); + break; + + case ACIFC_ADDR: + sysclk_disable_pba_module(SYSCLK_ACIFC); + break; + + case GLOC_ADDR: + sysclk_disable_pba_module(SYSCLK_GLOC); + break; + + case ABDACB_ADDR: + sysclk_disable_pba_module(SYSCLK_ABDACB); + break; + + case TRNG_ADDR: + sysclk_disable_pba_module(SYSCLK_TRNG); + break; + + case PARC_ADDR: + sysclk_disable_pba_module(SYSCLK_PARC); + break; + + case CATB_ADDR: + sysclk_disable_pba_module(SYSCLK_CATB); + break; + + case TWIM2_ADDR: + sysclk_disable_pba_module(SYSCLK_TWIM2); + break; + + case TWIM3_ADDR: + sysclk_disable_pba_module(SYSCLK_TWIM3); + break; + + case LCDCA_ADDR: + sysclk_disable_pba_module(SYSCLK_LCDCA); + break; + + case HFLASHC_ADDR: + sysclk_disable_pbb_module(SYSCLK_HFLASHC_REGS); + break; + + case HCACHE_ADDR: + sysclk_disable_hsb_module(SYSCLK_HRAMC1_DATA); + sysclk_disable_pbb_module(SYSCLK_HRAMC1_REGS); + break; + + case HMATRIX_ADDR: + sysclk_disable_pbb_module(SYSCLK_HMATRIX); + break; + + case PDCA_ADDR: + sysclk_disable_hsb_module(SYSCLK_PDCA_HSB); + sysclk_disable_pbb_module(SYSCLK_PDCA_PB); + break; + + case CRCCU_ADDR: + sysclk_disable_hsb_module(SYSCLK_CRCCU_DATA); + sysclk_disable_pbb_module(SYSCLK_CRCCU_REGS); + break; + + case USBC_ADDR: + sysclk_disable_hsb_module(SYSCLK_USBC_DATA); + sysclk_disable_pbb_module(SYSCLK_USBC_REGS); + break; + + case PEVC_ADDR: + sysclk_disable_pbb_module(SYSCLK_PEVC); + break; + + case PM_ADDR: + sysclk_disable_pbc_module(SYSCLK_PM); + break; + + case CHIPID_ADDR: + sysclk_disable_pbc_module(SYSCLK_CHIPID); + break; + + case SCIF_ADDR: + sysclk_disable_pbc_module(SYSCLK_SCIF); + break; + + case FREQM_ADDR: + sysclk_disable_pbc_module(SYSCLK_FREQM); + break; + + case GPIO_ADDR: + sysclk_disable_pbc_module(SYSCLK_GPIO); + break; + + case BPM_ADDR: + sysclk_disable_pbd_module(SYSCLK_BPM); + break; + + case BSCIF_ADDR: + sysclk_disable_pbd_module(SYSCLK_BSCIF); + break; + + case AST_ADDR: + sysclk_disable_pbd_module(SYSCLK_AST); + break; + + case WDT_ADDR: + sysclk_disable_pbd_module(SYSCLK_WDT); + break; + + case EIC_ADDR: + sysclk_disable_pbd_module(SYSCLK_EIC); + break; + + case PICOUART_ADDR: + sysclk_disable_pbd_module(SYSCLK_PICOUART); + break; + + default: + Assert(false); + return; + } + + // Disable PBA divided clock if possible. +#define PBADIV_CLKSRC_MASK (SYSCLK_TC0 | SYSCLK_TC1 \ + | SYSCLK_USART0 | SYSCLK_USART1 | SYSCLK_USART2 | SYSCLK_USART3) + if ((PM->PM_PBAMASK & PBADIV_CLKSRC_MASK) == 0) { + sysclk_disable_pba_divmask(PBA_DIVMASK_Msk); + } +} + + +/** + * \brief Set system clock prescaler configuration + * + * This function will change the system clock prescaler configuration to + * match the parameters. + * + * \note The parameters to this function are device-specific. + * + * \param cpu_shift The CPU clock will be divided by \f$2^{cpu\_shift}\f$ + * \param pba_shift The PBA clock will be divided by \f$2^{pba\_shift}\f$ + * \param pbb_shift The PBB clock will be divided by \f$2^{pbb\_shift}\f$ + * \param pbc_shift The PBC clock will be divided by \f$2^{pbc\_shift}\f$ + * \param pbd_shift The PBD clock will be divided by \f$2^{pbd\_shift}\f$ + */ +void sysclk_set_prescalers(uint32_t cpu_shift, + uint32_t pba_shift, uint32_t pbb_shift, + uint32_t pbc_shift, uint32_t pbd_shift) +{ + irqflags_t flags; + uint32_t cpu_cksel = 0; + uint32_t pba_cksel = 0; + uint32_t pbb_cksel = 0; + uint32_t pbc_cksel = 0; + uint32_t pbd_cksel = 0; + + Assert(cpu_shift <= pba_shift); + Assert(cpu_shift <= pbb_shift); + Assert(cpu_shift <= pbc_shift); + Assert(cpu_shift <= pbd_shift); + + if (cpu_shift > 0) { + cpu_cksel = (PM_CPUSEL_CPUSEL(cpu_shift - 1)) + | PM_CPUSEL_CPUDIV; + } + + if (pba_shift > 0) { + pba_cksel = (PM_PBASEL_PBSEL(pba_shift - 1)) + | PM_PBASEL_PBDIV; + } + + if (pbb_shift > 0) { + pbb_cksel = (PM_PBBSEL_PBSEL(pbb_shift - 1)) + | PM_PBBSEL_PBDIV; + } + + if (pbc_shift > 0) { + pbc_cksel = (PM_PBCSEL_PBSEL(pbc_shift - 1)) + | PM_PBCSEL_PBDIV; + } + + if (pbd_shift > 0) { + pbd_cksel = (PM_PBDSEL_PBSEL(pbd_shift - 1)) + | PM_PBDSEL_PBDIV; + } + + flags = cpu_irq_save(); + + PM->PM_UNLOCK = PM_UNLOCK_KEY(0xAAu) + | PM_UNLOCK_ADDR((uint32_t)&PM->PM_CPUSEL - (uint32_t)PM); + PM->PM_CPUSEL = cpu_cksel; + + PM->PM_UNLOCK = PM_UNLOCK_KEY(0xAAu) + | PM_UNLOCK_ADDR((uint32_t)&PM->PM_PBASEL - (uint32_t)PM); + PM->PM_PBASEL = pba_cksel; + + PM->PM_UNLOCK = PM_UNLOCK_KEY(0xAAu) + | PM_UNLOCK_ADDR((uint32_t)&PM->PM_PBBSEL - (uint32_t)PM); + PM->PM_PBBSEL = pbb_cksel; + + PM->PM_UNLOCK = PM_UNLOCK_KEY(0xAAu) + | PM_UNLOCK_ADDR((uint32_t)&PM->PM_PBCSEL - (uint32_t)PM); + PM->PM_PBCSEL = pbc_cksel; + + PM->PM_UNLOCK = PM_UNLOCK_KEY(0xAAu) + | PM_UNLOCK_ADDR((uint32_t)&PM->PM_PBDSEL - (uint32_t)PM); + PM->PM_PBDSEL = pbd_cksel; + + cpu_irq_restore(flags); +} + +/** + * \brief Change the source of the main system clock. + * + * \param src The new system clock source. Must be one of the constants + * from the System Clock Sources section. + */ +void sysclk_set_source(uint32_t src) +{ + irqflags_t flags; + Assert(src <= SYSCLK_SRC_RC1M); + + flags = cpu_irq_save(); + PM->PM_UNLOCK = PM_UNLOCK_KEY(0xAAu) + | PM_UNLOCK_ADDR((uint32_t)&PM->PM_MCCTRL - (uint32_t)PM); + PM->PM_MCCTRL = src; + cpu_irq_restore(flags); +} + +#if defined(CONFIG_USBCLK_SOURCE) || defined(__DOXYGEN__) +/** + * \brief Enable the USB generic clock + * + * \pre The USB generic clock must be configured to 48MHz. + * CONFIG_USBCLK_SOURCE and CONFIG_USBCLK_DIV must be defined with proper + * configuration. The selected clock source must also be configured. + */ +void sysclk_enable_usb(void) +{ + // Note: the SYSCLK_PBB_BRIDGE clock is enabled by + // sysclk_enable_pbb_module(). + sysclk_enable_pbb_module(SYSCLK_USBC_REGS); + sysclk_enable_hsb_module(SYSCLK_USBC_DATA); + + genclk_enable_config(7, CONFIG_USBCLK_SOURCE, CONFIG_USBCLK_DIV); +} + +/** + * \brief Disable the USB generic clock + */ +void sysclk_disable_usb(void) +{ + genclk_disable(7); +} +#endif // CONFIG_USBCLK_SOURCE + +void sysclk_init(void) +{ + uint32_t ps_value = 0; + bool is_fwu_enabled = false; + +#if CONFIG_HCACHE_ENABLE == 1 + /* Enable HCACHE */ + sysclk_enable_peripheral_clock(HCACHE); + HCACHE->HCACHE_CTRL = HCACHE_CTRL_CEN_YES; + while (!(HCACHE->HCACHE_SR & HCACHE_SR_CSTS_EN)); +#endif + + /* Set up system clock dividers if different from defaults */ + if ((CONFIG_SYSCLK_CPU_DIV > 0) || (CONFIG_SYSCLK_PBA_DIV > 0) || + (CONFIG_SYSCLK_PBB_DIV > 0) || (CONFIG_SYSCLK_PBC_DIV > 0) || + (CONFIG_SYSCLK_PBD_DIV > 0)) { + sysclk_set_prescalers(CONFIG_SYSCLK_CPU_DIV, + CONFIG_SYSCLK_PBA_DIV, + CONFIG_SYSCLK_PBB_DIV, + CONFIG_SYSCLK_PBC_DIV, + CONFIG_SYSCLK_PBD_DIV + ); + } + + /* Automatically select best power scaling mode */ +#ifdef CONFIG_FLASH_READ_MODE_HIGH_SPEED_ENABLE + ps_value = BPM_PS_2; + is_fwu_enabled = false; +#else + if (sysclk_get_cpu_hz() <= FLASH_FREQ_PS1_FWS_1_MAX_FREQ) { + ps_value = BPM_PS_1; + if (sysclk_get_cpu_hz() > FLASH_FREQ_PS1_FWS_0_MAX_FREQ) { + bpm_enable_fast_wakeup(BPM); + is_fwu_enabled = true; + } + } else { + ps_value = BPM_PS_0; + } +#endif + + /* Switch to system clock selected by user */ + if (CONFIG_SYSCLK_SOURCE == SYSCLK_SRC_RCSYS) { + /* Already running from RCSYS */ + } +#ifdef BOARD_OSC0_HZ + else if (CONFIG_SYSCLK_SOURCE == SYSCLK_SRC_OSC0) { + osc_enable(OSC_ID_OSC0); + osc_wait_ready(OSC_ID_OSC0); + // Set a flash wait state depending on the new cpu frequency. + flash_set_bus_freq(sysclk_get_cpu_hz(), ps_value, is_fwu_enabled); + sysclk_set_source(SYSCLK_SRC_OSC0); + } +#endif +#ifdef CONFIG_DFLL0_SOURCE + else if (CONFIG_SYSCLK_SOURCE == SYSCLK_SRC_DFLL) { + dfll_enable_config_defaults(0); + // Set a flash wait state depending on the new cpu frequency. + flash_set_bus_freq(sysclk_get_cpu_hz(), ps_value, is_fwu_enabled); + sysclk_set_source(SYSCLK_SRC_DFLL); + } +#endif +#ifdef CONFIG_PLL0_SOURCE + else if (CONFIG_SYSCLK_SOURCE == SYSCLK_SRC_PLL0) { + pll_enable_config_defaults(0); + // Set a flash wait state depending on the new cpu frequency. + flash_set_bus_freq(sysclk_get_cpu_hz(), ps_value, is_fwu_enabled); + sysclk_set_source(SYSCLK_SRC_PLL0); + } +#endif + else if (CONFIG_SYSCLK_SOURCE == SYSCLK_SRC_RC80M) { + osc_enable(OSC_ID_RC80M); + osc_wait_ready(OSC_ID_RC80M); + // Set a flash wait state depending on the new cpu frequency. + flash_set_bus_freq(sysclk_get_cpu_hz(), ps_value, is_fwu_enabled); + sysclk_set_source(SYSCLK_SRC_RC80M); + } + else if (CONFIG_SYSCLK_SOURCE == SYSCLK_SRC_RCFAST) { + osc_enable(OSC_ID_RCFAST); + osc_wait_ready(OSC_ID_RCFAST); + // Set a flash wait state depending on the new cpu frequency. + flash_set_bus_freq(sysclk_get_cpu_hz(), ps_value, is_fwu_enabled); + sysclk_set_source(SYSCLK_SRC_RCFAST); + } + else if (CONFIG_SYSCLK_SOURCE == SYSCLK_SRC_RC1M) { + osc_enable(OSC_ID_RC1M); + osc_wait_ready(OSC_ID_RC1M); + // Set a flash wait state depending on the new cpu frequency. + flash_set_bus_freq(sysclk_get_cpu_hz(), ps_value, is_fwu_enabled); + sysclk_set_source(SYSCLK_SRC_RC1M); + } + else { + Assert(false); + } + + /* Automatically switch to low power mode */ + bpm_configure_power_scaling(BPM, ps_value, BPM_PSCM_CPU_NOT_HALT); + while ((bpm_get_status(BPM) & BPM_SR_PSOK) == 0); + + /* If the user has specified clock masks, enable only requested clocks */ + irqflags_t const flags = cpu_irq_save(); +#if defined(CONFIG_SYSCLK_INIT_CPUMASK) + PM->PM_UNLOCK = PM_UNLOCK_KEY(0xAAu) + | PM_UNLOCK_ADDR((uint32_t)&PM->PM_CPUMASK - (uint32_t)PM); + PM->PM_CPUMASK = SYSCLK_INIT_MINIMAL_CPUMASK | CONFIG_SYSCLK_INIT_CPUMASK; +#endif + +#if defined(CONFIG_SYSCLK_INIT_HSBMASK) + PM->PM_UNLOCK = PM_UNLOCK_KEY(0xAAu) + | PM_UNLOCK_ADDR((uint32_t)&PM->PM_HSBMASK - (uint32_t)PM); + PM->PM_HSBMASK = SYSCLK_INIT_MINIMAL_HSBMASK | CONFIG_SYSCLK_INIT_HSBMASK; +#endif + +#if defined(CONFIG_SYSCLK_INIT_PBAMASK) + PM->PM_UNLOCK = PM_UNLOCK_KEY(0xAAu) + | PM_UNLOCK_ADDR((uint32_t)&PM->PM_PBAMASK - (uint32_t)PM); + PM->PM_PBAMASK = SYSCLK_INIT_MINIMAL_PBAMASK | CONFIG_SYSCLK_INIT_PBAMASK; +#endif + +#if defined(CONFIG_SYSCLK_INIT_PBBMASK) + PM->PM_UNLOCK = PM_UNLOCK_KEY(0xAAu) + | PM_UNLOCK_ADDR((uint32_t)&PM->PM_PBBMASK - (uint32_t)PM); + PM->PM_PBBMASK = SYSCLK_INIT_MINIMAL_PBBMASK | CONFIG_SYSCLK_INIT_PBBMASK; +#endif + +#if defined(CONFIG_SYSCLK_INIT_PBCMASK) + PM->PM_UNLOCK = PM_UNLOCK_KEY(0xAAu) + | PM_UNLOCK_ADDR((uint32_t)&PM->PM_PBCMASK - (uint32_t)PM); + PM->PM_PBCMASK = SYSCLK_INIT_MINIMAL_PBCMASK | CONFIG_SYSCLK_INIT_PBCMASK; +#endif + +#if defined(CONFIG_SYSCLK_INIT_PBDMASK) + PM->PM_UNLOCK = PM_UNLOCK_KEY(0xAAu) + | PM_UNLOCK_ADDR((uint32_t)&PM->PM_PBDMASK - (uint32_t)PM); + PM->PM_PBDMASK = SYSCLK_INIT_MINIMAL_PBDMASK | CONFIG_SYSCLK_INIT_PBDMASK; +#endif + + cpu_irq_restore(flags); + +#if (defined CONFIG_SYSCLK_DEFAULT_RETURNS_SLOW_OSC) + /* Signal that the internal frequencies are setup */ + sysclk_initialized = true; +#endif +} + +//! @} diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/sysclk.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/sysclk.h new file mode 100644 index 000000000..d083fbf89 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sam4l/sysclk.h @@ -0,0 +1,815 @@ +/** + * \file + * + * \brief Chip-specific system clock management functions + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +#ifndef CHIP_SYSCLK_H_INCLUDED +#define CHIP_SYSCLK_H_INCLUDED + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \page sysclk_quickstart Quick Start Guide for the System Clock Management service (SAM4L) + * + * This is the quick start guide for the \ref sysclk_group "System Clock Management" + * service, with step-by-step instructions on how to configure and use the service for + * specific use cases. + * + * \section sysclk_quickstart_usecases System Clock Management use cases + * - \ref sysclk_quickstart_basic + * + * \section sysclk_quickstart_basic Basic usage of the System Clock Management service + * This section will present a basic use case for the System Clock Management service. + * This use case will configure the main system clock to 48MHz, using an internal DFLL + * module to multiply the frequency of a crystal attached to the microcontroller. The + * peripheral bus clocks are scaled down from the speed of the main system clock. + * + * \subsection sysclk_quickstart_use_case_1_prereq Prerequisites + * - None + * + * \subsection sysclk_quickstart_use_case_1_setup_steps Initialization code + * Add to the application initialization code: + * \code + * sysclk_init(); + * \endcode + * + * \subsection sysclk_quickstart_use_case_1_setup_steps_workflow Workflow + * -# Configure the system clocks according to the settings in conf_clock.h: + * \code sysclk_init(); \endcode + * + * \subsection sysclk_quickstart_use_case_1_example_code Example code + * Add or uncomment the following in your conf_clock.h header file, commenting out all other + * definitions of the same symbol(s): + * \code + * #define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_DFLL0 + * + * // Fdfll = (Fclk * DFLL_mul) / DFLL_div + * #define CONFIG_DFLL0_SOURCE GENCLK_SRC_OSC32K + * #define CONFIG_DFLL0_FREQ 48000000UL + * #define CONFIG_DFLL0_MUL (CONFIG_DFLL0_FREQ / BOARD_OSC32_HZ) + * #define CONFIG_DFLL0_DIV 1 + * + * // Fbus = Fsys / (2 ^ BUS_div) + * #define CONFIG_SYSCLK_CPU_DIV 0 + * #define CONFIG_SYSCLK_PBA_DIV 1 + * #define CONFIG_SYSCLK_PBB_DIV 1 + * #define CONFIG_SYSCLK_PBC_DIV 1 + * #define CONFIG_SYSCLK_PBD_DIV 1 + * \endcode + * + * \subsection sysclk_quickstart_use_case_1_example_workflow Workflow + * -# Configure the main system clock to use the output of the DFLL0 module as its source: + * \code #define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_DFLL0 \endcode + * -# Configure the DFLL0 module to use external crystal oscillator OSC0 as its source: + * \code #define CONFIG_DFLL0_SOURCE GENCLK_SRC_OSC32K \endcode + * -# Configure the DFLL0 module to multiply the external oscillator OSC0 frequency up to 48MHz: + * \code + * #define CONFIG_DFLL0_FREQ 48000000UL + * #define CONFIG_DFLL0_MUL (CONFIG_DFLL0_FREQ / BOARD_OSC32_HZ) + * #define CONFIG_DFLL0_DIV 1 + * \endcode + * \note For user boards, \c BOARD_OSC0_HZ should be defined in the board \c conf_board.h configuration + * file as the frequency of the crystal attached to OSC0. + * -# Configure the main clock to run at the full 48MHz, scale the peripheral busses to run at one + * half (2 to the power of 1) of the system clock speed: + * \code + * #define CONFIG_SYSCLK_CPU_DIV 0 + * #define CONFIG_SYSCLK_PBA_DIV 1 + * #define CONFIG_SYSCLK_PBB_DIV 1 + * #define CONFIG_SYSCLK_PBC_DIV 1 + * #define CONFIG_SYSCLK_PBD_DIV 1 + * \endcode + * \note Some dividers are powers of two, while others are integer division factors. Refer to the + * formulas in the conf_clock.h template commented above each division define. + */ + + +/** + * \weakgroup sysclk_group + * @{ + */ + +//! \name System clock source +//@{ +#define SYSCLK_SRC_RCSYS 0 //!< System RC oscillator +#define SYSCLK_SRC_OSC0 1 //!< Oscillator 0 +#define SYSCLK_SRC_PLL0 2 //!< Phase Locked Loop 0 +#define SYSCLK_SRC_DFLL 3 //!< Digital Frequency Locked Loop +#define SYSCLK_SRC_RC80M 4 //!< 80 MHz RC oscillator +#define SYSCLK_SRC_RCFAST 5 //!< 4-8-12 MHz RC oscillator +#define SYSCLK_SRC_RC1M 6 //!< 1 MHz RC oscillator +//@} + +//! \name USB Clock Sources +//@{ +#define USBCLK_SRC_OSC0 GENCLK_SRC_OSC0 //!< Use OSC0 +#define USBCLK_SRC_PLL0 GENCLK_SRC_PLL0 //!< Use PLL0 +#define USBCLK_SRC_DFLL GENCLK_SRC_DFLL //!< Use DFLL +#define USBCLK_SRC_GCLKIN0 GENCLK_SRC_GCLKIN0 //!< Use GCLKIN0 +//@} + +//! \name Bus index of maskable module clocks +//@{ +#define PM_CLK_GRP_CPU 0 +#define PM_CLK_GRP_HSB 1 +#define PM_CLK_GRP_PBA 2 +#define PM_CLK_GRP_PBB 3 +#define PM_CLK_GRP_PBC 4 +#define PM_CLK_GRP_PBD 5 +//@} + +//! \name Clocks derived from the CPU clock +//@{ +//! On-Chip Debug system +#define SYSCLK_OCD 0 +//@} + +//! \name Clocks derived from the HSB clock +//@{ +//! PDCA memory interface +#define SYSCLK_PDCA_HSB 0 +//! Flash data interface +#define SYSCLK_HFLASHC_DATA 1 +//! HRAMC data interface +#define SYSCLK_HRAMC1_DATA 2 +//! USBC DMA and FIFO interface +#define SYSCLK_USBC_DATA 3 +//! CRCCU data interface +#define SYSCLK_CRCCU_DATA 4 +//! HSB<->PBA bridge +#define SYSCLK_PBA_BRIDGE 5 +//! HSB<->PBB bridge +#define SYSCLK_PBB_BRIDGE 6 +//! HSB<->PBC bridge +#define SYSCLK_PBC_BRIDGE 7 +//! HSB<->PBD bridge +#define SYSCLK_PBD_BRIDGE 8 +//! Advanced Encryption Standard +#define SYSCLK_AESA_HSB 9 +//@} + +//! \name Clocks derived from the PBA clock +//@{ +//! IISC Controller +#define SYSCLK_IISC 0 +//! SPI Controller +#define SYSCLK_SPI 1 +//! Timer/Counter 0 +#define SYSCLK_TC0 2 +//! Timer/Counter 1 +#define SYSCLK_TC1 3 +//! TWI Master 0 +#define SYSCLK_TWIM0 4 +//! TWI Slave 0 +#define SYSCLK_TWIS0 5 +//! TWI Master 1 +#define SYSCLK_TWIM1 6 +//! TWI Slave 1 +#define SYSCLK_TWIS1 7 +//! USART 0 +#define SYSCLK_USART0 8 +//! USART 1 +#define SYSCLK_USART1 9 +//! USART 2 +#define SYSCLK_USART2 10 +//! USART 3 +#define SYSCLK_USART3 11 +//! A/D Converter +#define SYSCLK_ADCIFE 12 +//! D/A Converter +#define SYSCLK_DACC 13 +//! Analog Comparator +#define SYSCLK_ACIFC 14 +//! Glue Logic Controller +#define SYSCLK_GLOC 15 +//! ABDACB Controller +#define SYSCLK_ABDACB 16 +//! TRNG Controller +#define SYSCLK_TRNG 17 +//! PARC Controller +#define SYSCLK_PARC 18 +//! Capacitive Touch +#define SYSCLK_CATB 19 +//! TWI Master 2 +#define SYSCLK_TWIM2 21 +//! TWI Master 3 +#define SYSCLK_TWIM3 22 +//! LCD Controller +#define SYSCLK_LCDCA 23 + +//@} + +//! \name Clocks derived from the PBB clock +//@{ +//! Flash Controller registers +#define SYSCLK_HFLASHC_REGS 0 +//! HRAMC Controller registers +#define SYSCLK_HRAMC1_REGS 1 +//! HSB Matrix configuration +#define SYSCLK_HMATRIX 2 +//! PDCA peripheral bus interface +#define SYSCLK_PDCA_PB 3 +//! CRCCU registers +#define SYSCLK_CRCCU_REGS 4 +//! USBC registers +#define SYSCLK_USBC_REGS 5 +//! PEVC Controller +#define SYSCLK_PEVC 6 +//@} + +//! \name Clocks derived from the PBC clock +//@{ +//! PM configuration +#define SYSCLK_PM 0 +//! CHIPID Controller +#define SYSCLK_CHIPID 1 +//! System Control Interface +#define SYSCLK_SCIF 2 +//! Frequency Meter +#define SYSCLK_FREQM 3 +//! General-Purpose I/O +#define SYSCLK_GPIO 4 +//@} + +//! \name Clocks derived from the PBD clock +//@{ +//! BPM configuration +#define SYSCLK_BPM 0 +//! BSCIF configuration +#define SYSCLK_BSCIF 1 +//! Asynchronous Timer +#define SYSCLK_AST 2 +//! Watchdog Timer +#define SYSCLK_WDT 3 +//! External Interrupt Controller +#define SYSCLK_EIC 4 +//! PICOUART +#define SYSCLK_PICOUART 5 +//@} + +//! \name Divided clock mask derived from the PBA clock +//@{ +//! TIMER_CLOCK2 mask +#define PBA_DIVMASK_TIMER_CLOCK2 (1u << 0) +//! TIMER_CLOCK3 mask +#define PBA_DIVMASK_TIMER_CLOCK3 (1u << 2) +//! CLK_USART/DIV mask +#define PBA_DIVMASK_CLK_USART (1u << 2) +//! TIMER_CLOCK4 mask +#define PBA_DIVMASK_TIMER_CLOCK4 (1u << 4) +//! TIMER_CLOCK5 mask +#define PBA_DIVMASK_TIMER_CLOCK5 (1u << 6) +//! Bitfield mask +#define PBA_DIVMASK_Msk (0x7Fu << 0) +//@} + +#ifndef __ASSEMBLY__ + +#include +#include +#include +#include +#include + +// Use the slow clock (RCOSC) with no prescaling if config was empty. +#ifndef CONFIG_SYSCLK_SOURCE +# define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_RCSYS +#endif /* CONFIG_SYSCLK_SOURCE */ + +/* + * Enable PicoCache for flash access by default. + * 0: disable PicoCache, 1: enable PicoCache. + */ +#ifndef CONFIG_HCACHE_ENABLE +#define CONFIG_HCACHE_ENABLE 1 +#endif + +/** + * \def CONFIG_SYSCLK_CPU_DIV + * \brief Configuration symbol for dividing the CPU clock frequency by + * \f$2^{CONFIG\_SYSCLK\_CPU\_DIV}\f$ + * + * If this symbol is not defined, the CPU clock frequency is not divided. + * + * This symbol may be defined in \ref conf_clock.h. + */ +#ifndef CONFIG_SYSCLK_CPU_DIV +# define CONFIG_SYSCLK_CPU_DIV 0 +#endif /* CONFIG_SYSCLK_CPU_DIV */ + +/** + * \def CONFIG_SYSCLK_INIT_HSBMASK + * \brief Configuration symbol for the HSB clocks enabled at power-on after the + * sysclock module has been initialized. By default, all HSB clocks are left + * enabled, however to save power these can be automatically disabled by defining + * this value to a mask of \c SYSCLOCK_xxx settings. + * + * If this symbol is not defined, then all HSB clocks are left enabled. + * + * This symbol may be defined in \ref conf_clock.h. + */ +#ifdef __DOXYGEN__ +# define CONFIG_SYSCLK_INIT_HSBMASK +#endif + +/** + * \def CONFIG_SYSCLK_PBA_DIV + * \brief Configuration symbol for dividing the PBA clock frequency by + * \f$2^{CONFIG\_SYSCLK\_PBA\_DIV}\f$ + * + * If this symbol is not defined, the PBA clock frequency is not divided. + * + * This symbol may be defined in \ref conf_clock.h. + */ +#ifndef CONFIG_SYSCLK_PBA_DIV +# define CONFIG_SYSCLK_PBA_DIV 0 +#endif /* CONFIG_SYSCLK_PBA_DIV */ + +/** + * \def CONFIG_SYSCLK_PBB_DIV + * \brief Configuration symbol for dividing the PBB clock frequency by + * \f$2^{CONFIG\_SYSCLK\_PBB\_DIV}\f$ + * + * If this symbol is not defined, the PBB clock frequency is not divided. + * + * This symbol may be defined in \ref conf_clock.h. + */ +#ifndef CONFIG_SYSCLK_PBB_DIV +# define CONFIG_SYSCLK_PBB_DIV 0 +#endif /* CONFIG_SYSCLK_PBB_DIV */ + +/** + * \def CONFIG_SYSCLK_PBC_DIV + * \brief Configuration symbol for dividing the PBC clock frequency by + * \f$2^{CONFIG\_SYSCLK\_PBC\_DIV}\f$ + * + * If this symbol is not defined, the PBC clock frequency is not divided. + * + * This symbol may be defined in \ref conf_clock.h. + */ +#ifndef CONFIG_SYSCLK_PBC_DIV +# define CONFIG_SYSCLK_PBC_DIV 0 +#endif /* CONFIG_SYSCLK_PBC_DIV */ + +/** + * \def CONFIG_SYSCLK_PBD_DIV + * \brief Configuration symbol for dividing the PBD clock frequency by + * \f$2^{CONFIG\_SYSCLK\_PBD\_DIV}\f$ + * + * If this symbol is not defined, the PBD clock frequency is not divided. + * + * This symbol may be defined in \ref conf_clock.h. + */ +#ifndef CONFIG_SYSCLK_PBD_DIV +# define CONFIG_SYSCLK_PBD_DIV 0 +#endif /* CONFIG_SYSCLK_PBD_DIV */ + +/** + * \def CONFIG_SYSCLK_INIT_CPUMASK + * \brief Configuration symbol for the CPU clocks enabled at power-on after the + * sysclock module has been initialized. By default, all CPU clocks are left + * enabled, however to save power these can be automatically disabled by defining + * this value to a mask of \c SYSCLOCK_xxx settings. + * + * If this symbol is not defined, then all CPU clocks are left enabled. + * + * This symbol may be defined in \ref conf_clock.h. + */ +#ifdef __DOXYGEN__ +# define CONFIG_SYSCLK_INIT_CPUMASK +#endif + +/** + * \def CONFIG_SYSCLK_INIT_PBAMASK + * \brief Configuration symbol for the PBA clocks enabled at power-on after the + * sysclock module has been initialized. By default, all PBA clocks are left + * enabled, however to save power these can be automatically disabled by defining + * this value to a mask of \c SYSCLOCK_xxx settings. + * + * If this symbol is not defined, then all PBA clocks are left enabled. + * + * This symbol may be defined in \ref conf_clock.h. + */ +#ifdef __DOXYGEN__ +# define CONFIG_SYSCLK_INIT_PBAMASK +#endif + +/** + * \def CONFIG_SYSCLK_INIT_PBBMASK + * \brief Configuration symbol for the PBB clocks enabled at power-on after the + * sysclock module has been initialized. By default, all PBB clocks are left + * enabled, however to save power these can be automatically disabled by defining + * this value to a mask of \c SYSCLOCK_xxx settings. + * + * If this symbol is not defined, then all PBB clocks are left enabled. + * + * This symbol may be defined in \ref conf_clock.h. + */ +#ifdef __DOXYGEN__ +# define CONFIG_SYSCLK_INIT_PBBMASK +#endif + +/** + * \def CONFIG_SYSCLK_INIT_PBCMASK + * \brief Configuration symbol for the PBC clocks enabled at power-on after the + * sysclock module has been initialized. By default, all PBC clocks are left + * enabled, however to save power these can be automatically disabled by defining + * this value to a mask of \c SYSCLOCK_xxx settings. + * + * If this symbol is not defined, then all PBC clocks are left enabled. + * + * This symbol may be defined in \ref conf_clock.h. + */ +#ifdef __DOXYGEN__ +# define CONFIG_SYSCLK_INIT_PBCMASK +#endif + +/** + * \def CONFIG_SYSCLK_INIT_PBDMASK + * \brief Configuration symbol for the PBD clocks enabled at power-on after the + * sysclock module has been initialized. By default, all PBD clocks are left + * enabled, however to save power these can be automatically disabled by defining + * this value to a mask of \c SYSCLOCK_xxx settings. + * + * If this symbol is not defined, then all PBD clocks are left enabled. + * + * This symbol may be defined in \ref conf_clock.h. + */ +#ifdef __DOXYGEN__ +# define CONFIG_SYSCLK_INIT_PBDMASK +#endif + +/** + * \def CONFIG_USBCLK_SOURCE + * \brief Configuration symbol for the USB generic clock source + * + * Sets the clock source to use for the USB. The source must also be properly + * configured. + * + * Define this to one of the \c USBCLK_SRC_xxx settings. Leave it undefined if + * USB is not required. + */ +#ifdef __DOXYGEN__ +# define CONFIG_USBCLK_SOURCE +#endif + +/** + * \def CONFIG_USBCLK_DIV + * \brief Configuration symbol for the USB generic clock divider setting + * + * Sets the clock division for the USB generic clock. If a USB clock source is + * selected with CONFIG_USBCLK_SOURCE, this configuration symbol must also be + * defined. + * + * Define this as any value that does not exceed \c GENCLK_DIV_MAX, and which + * will give a 48 MHz clock frequency from the selected source. + */ +#ifdef __DOXYGEN__ +# define CONFIG_USBCLK_DIV +#endif + +/** + * \name Querying the system clock and its derived clocks + * + * The following functions may be used to query the current frequency of + * the system clock and the CPU and bus clocks derived from it. + * sysclk_get_main_hz() and sysclk_get_cpu_hz() can be assumed to be + * available on all platforms, although some platforms may define + * additional accessors for various chip-internal bus clocks. These are + * usually not intended to be queried directly by generic code. + */ +//@{ + +/** + * \brief Return the current rate in Hz of the main system clock + * + * \todo This function assumes that the main clock source never changes + * once it's been set up, and that PLL0 always runs at the compile-time + * configured default rate. While this is probably the most common + * configuration, which we want to support as a special case for + * performance reasons, we will at some point need to support more + * dynamic setups as well. + */ +#if (defined CONFIG_SYSCLK_DEFAULT_RETURNS_SLOW_OSC) +extern bool sysclk_initialized; +#endif +static inline uint32_t sysclk_get_main_hz(void) +{ +#if (defined CONFIG_SYSCLK_DEFAULT_RETURNS_SLOW_OSC) + if (!sysclk_initialized ) { + return OSC_RCSYS_NOMINAL_HZ; + } +#endif + + if (CONFIG_SYSCLK_SOURCE == SYSCLK_SRC_RCSYS) { + return OSC_RCSYS_NOMINAL_HZ; + } + +#ifdef BOARD_OSC0_HZ + else if (CONFIG_SYSCLK_SOURCE == SYSCLK_SRC_OSC0) { + return BOARD_OSC0_HZ; + } +#endif + +#ifdef CONFIG_PLL0_SOURCE + else if (CONFIG_SYSCLK_SOURCE == SYSCLK_SRC_PLL0) { + return pll_get_default_rate(0); + } +#endif + +#ifdef CONFIG_DFLL0_SOURCE + else if (CONFIG_SYSCLK_SOURCE == SYSCLK_SRC_DFLL) { + return dfll_get_default_rate(0); + } +#endif + + else if (CONFIG_SYSCLK_SOURCE == SYSCLK_SRC_RC80M) { + return OSC_RC80M_NOMINAL_HZ; + } + + else if (CONFIG_SYSCLK_SOURCE == SYSCLK_SRC_RCFAST) { + if (CONFIG_RCFAST_FRANGE == 2) { + return OSC_RCFAST12M_NOMINAL_HZ; + } else if (CONFIG_RCFAST_FRANGE == 1) { + return OSC_RCFAST8M_NOMINAL_HZ; + } else { + return OSC_RCFAST4M_NOMINAL_HZ; + } + } + + else if (CONFIG_SYSCLK_SOURCE == SYSCLK_SRC_RC1M) { + return OSC_RC1M_NOMINAL_HZ; + } + + + else { + /* unhandled_case(CONFIG_SYSCLK_SOURCE); */ + return 0; + } +} + +/** + * \brief Return the current rate in Hz of the CPU clock + * + * \todo This function assumes that the CPU always runs at the system + * clock frequency. We want to support at least two more scenarios: + * Fixed CPU/bus clock dividers (config symbols) and dynamic CPU/bus + * clock dividers (which may change at run time). Ditto for all the bus + * clocks. + * + * \return Frequency of the CPU clock, in Hz. + */ +static inline uint32_t sysclk_get_cpu_hz(void) +{ + return sysclk_get_main_hz() >> CONFIG_SYSCLK_CPU_DIV; +} + +/** + * \brief Return the current rate in Hz of the High-Speed Bus clock + * + * \return Frequency of the High Speed Peripheral Bus clock, in Hz. + */ +static inline uint32_t sysclk_get_hsb_hz(void) +{ + return sysclk_get_main_hz() >> CONFIG_SYSCLK_CPU_DIV; +} + +/** + * \brief Return the current rate in Hz of the Peripheral Bus A clock + * + * \return Frequency of the Peripheral Bus A clock, in Hz. + */ +static inline uint32_t sysclk_get_pba_hz(void) +{ + return sysclk_get_main_hz() >> CONFIG_SYSCLK_PBA_DIV; +} + +/** + * \brief Return the current rate in Hz of the Peripheral Bus B clock + * + * \return Frequency of the Peripheral Bus B clock, in Hz. + */ +static inline uint32_t sysclk_get_pbb_hz(void) +{ + return sysclk_get_main_hz() >> CONFIG_SYSCLK_PBB_DIV; +} + +/** + * \brief Return the current rate in Hz of the Peripheral Bus C clock + * + * \return Frequency of the Peripheral Bus C clock, in Hz. + */ +static inline uint32_t sysclk_get_pbc_hz(void) +{ + return sysclk_get_main_hz() >> CONFIG_SYSCLK_PBC_DIV; +} + +/** + * \brief Return the current rate in Hz of the Peripheral Bus D clock + * + * \return Frequency of the Peripheral Bus D clock, in Hz. + */ +static inline uint32_t sysclk_get_pbd_hz(void) +{ + return sysclk_get_main_hz() >> CONFIG_SYSCLK_PBD_DIV; +} + +extern uint32_t sysclk_get_peripheral_bus_hz(const volatile void *module); +//@} + +extern void sysclk_priv_enable_module(uint32_t bus_id, uint32_t module_index); +extern void sysclk_priv_disable_module(uint32_t bus_id, uint32_t module_index); + +//! \name Enabling and disabling synchronous clocks +//@{ + +/** + * \brief Enable a module clock derived from the CPU clock + * \param index Index of the module clock in the CPUMASK register + */ +static inline void sysclk_enable_cpu_module(uint32_t index) +{ + sysclk_priv_enable_module(PM_CLK_GRP_CPU, index); +} + +/** + * \brief Disable a module clock derived from the CPU clock + * \param index Index of the module clock in the CPUMASK register + */ +static inline void sysclk_disable_cpu_module(uint32_t index) +{ + sysclk_priv_disable_module(PM_CLK_GRP_CPU, index); +} + +/** + * \brief Enable a module clock derived from the HSB clock + * \param index Index of the module clock in the HSBMASK register + */ +static inline void sysclk_enable_hsb_module(uint32_t index) +{ + sysclk_priv_enable_module(PM_CLK_GRP_HSB, index); +} + +/** + * \brief Disable a module clock derived from the HSB clock + * \param index Index of the module clock in the HSBMASK register + */ +static inline void sysclk_disable_hsb_module(uint32_t index) +{ + sysclk_priv_disable_module(PM_CLK_GRP_HSB, index); +} + +extern void sysclk_enable_pba_module(uint32_t index); +extern void sysclk_disable_pba_module(uint32_t index); +extern void sysclk_enable_pbb_module(uint32_t index); +extern void sysclk_disable_pbb_module(uint32_t index); + +/** + * \brief Enable a module clock derived from the PBC clock + * \param index Index of the module clock in the PBAMASK register + */ +static inline void sysclk_enable_pbc_module(uint32_t index) +{ + sysclk_priv_enable_module(PM_CLK_GRP_PBC, index); +} + +/** + * \brief Disable a module clock derived from the PBC clock + * \param index Index of the module clock in the PBAMASK register + */ +static inline void sysclk_disable_pbc_module(uint32_t index) +{ + sysclk_priv_disable_module(PM_CLK_GRP_PBC, index); +} + +/** + * \brief Enable a module clock derived from the PBD clock + * \param index Index of the module clock in the PBAMASK register + */ +static inline void sysclk_enable_pbd_module(uint32_t index) +{ + sysclk_priv_enable_module(PM_CLK_GRP_PBD, index); +} + +/** + * \brief Disable a module clock derived from the PBD clock + * \param index Index of the module clock in the PBAMASK register + */ +static inline void sysclk_disable_pbd_module(uint32_t index) +{ + sysclk_priv_disable_module(PM_CLK_GRP_PBD, index); +} + +/** + * \brief Enable divided clock mask derived from the PBA clock + * \param mask mask of the divided clock in the PBADIVMASK register + */ +static inline void sysclk_enable_pba_divmask(uint32_t mask) +{ + uint32_t temp_mask; + + temp_mask = PM->PM_PBADIVMASK; + temp_mask |= mask; + PM->PM_UNLOCK = PM_UNLOCK_KEY(0xAAu) + | PM_UNLOCK_ADDR((uint32_t)&PM->PM_PBADIVMASK - (uint32_t)PM); + PM->PM_PBADIVMASK = temp_mask; +} + +/** + * \brief Disable divided clock mask derived from the PBA clock + * \param mask mask of the divided clock in the PBADIVMASK register + */ +static inline void sysclk_disable_pba_divmask(uint32_t mask) +{ + uint32_t temp_mask; + + temp_mask = PM->PM_PBADIVMASK; + temp_mask &= ~mask; + PM->PM_UNLOCK = PM_UNLOCK_KEY(0xAAu) + | PM_UNLOCK_ADDR((uint32_t)&PM->PM_PBADIVMASK - (uint32_t)PM); + PM->PM_PBADIVMASK = temp_mask; +} + +extern void sysclk_enable_peripheral_clock(const volatile void *module); +extern void sysclk_disable_peripheral_clock(const volatile void *module); + +//@} + +//! \name System Clock Source and Prescaler configuration +//@{ + +extern void sysclk_set_prescalers(uint32_t cpu_shift, + uint32_t pba_shift, uint32_t pbb_shift, + uint32_t pbc_shift, uint32_t pbd_shift); +extern void sysclk_set_source(uint32_t src); + +//@} + +#if defined(CONFIG_USBCLK_SOURCE) || defined(__DOXYGEN__) + +/** + * \def USBCLK_STARTUP_TIMEOUT + * \brief Number of us to wait for USB clock to start + */ +#ifdef CONFIG_USBCLK_STARTUP_TIMEOUT +# define USBCLK_STARTUP_TIMEOUT (CONFIG_USBCLK_STARTUP_TIMEOUT) +#else +# define USBCLK_STARTUP_TIMEOUT (OSC0_STARTUP_TIMEOUT*(1000000/OSC_RCSYS_NOMINAL_HZ)) +#endif + +extern void sysclk_enable_usb(void); +extern void sysclk_disable_usb(void); +#endif + +extern void sysclk_init(void); + +#endif /* !__ASSEMBLY__ */ + +//! @} + +#ifdef __cplusplus +} +#endif + +#endif /* CHIP_SYSCLK_H_INCLUDED */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sysclk.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sysclk.h new file mode 100644 index 000000000..6a125a8bf --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/clock/sysclk.h @@ -0,0 +1,173 @@ +/** + * \file + * + * \brief System clock management + * + * Copyright (c) 2010-2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +#ifndef SYSCLK_H_INCLUDED +#define SYSCLK_H_INCLUDED + +#include "parts.h" +#include "conf_clock.h" + +#if SAM3S +# include "sam3s/sysclk.h" +#elif SAM3U +# include "sam3u/sysclk.h" +#elif SAM3N +# include "sam3n/sysclk.h" +#elif SAM3XA +# include "sam3x/sysclk.h" +#elif SAM4S +# include "sam4s/sysclk.h" +#elif SAM4E +# include "sam4e/sysclk.h" +#elif SAM4L +# include "sam4l/sysclk.h" +#elif (UC3A0 || UC3A1) +# include "uc3a0_a1/sysclk.h" +#elif UC3A3 +# include "uc3a3_a4/sysclk.h" +#elif UC3B +# include "uc3b0_b1/sysclk.h" +#elif UC3C +# include "uc3c/sysclk.h" +#elif UC3D +# include "uc3d/sysclk.h" +#elif UC3L +# include "uc3l/sysclk.h" +#elif XMEGA +# include "xmega/sysclk.h" +#elif MEGA +# include "mega/sysclk.h" +#else +# error Unsupported chip type +#endif + +/** + * \defgroup clk_group Clock Management + */ + +/** + * \ingroup clk_group + * \defgroup sysclk_group System Clock Management + * + * See \ref sysclk_quickstart. + * + * The sysclk API covers the system clock and all + * clocks derived from it. The system clock is a chip-internal clock on + * which all synchronous clocks, i.e. CPU and bus/peripheral + * clocks, are based. The system clock is typically generated from one + * of a variety of sources, which may include crystal and RC oscillators + * as well as PLLs. The clocks derived from the system clock are + * sometimes also known as synchronous clocks, since they + * always run synchronously with respect to each other, as opposed to + * generic clocks which may run from different oscillators or + * PLLs. + * + * Most applications should simply call sysclk_init() to initialize + * everything related to the system clock and its source (oscillator, + * PLL or DFLL), and leave it at that. More advanced applications, and + * platform-specific drivers, may require additional services from the + * clock system, some of which may be platform-specific. + * + * \section sysclk_group_platform Platform Dependencies + * + * The sysclk API is partially chip- or platform-specific. While all + * platforms provide mostly the same functionality, there are some + * variations around how different bus types and clock tree structures + * are handled. + * + * The following functions are available on all platforms with the same + * parameters and functionality. These functions may be called freely by + * portable applications, drivers and services: + * - sysclk_init() + * - sysclk_set_source() + * - sysclk_get_main_hz() + * - sysclk_get_cpu_hz() + * - sysclk_get_peripheral_bus_hz() + * + * The following functions are available on all platforms, but there may + * be variations in the function signature (i.e. parameters) and + * behavior. These functions are typically called by platform-specific + * parts of drivers, and applications that aren't intended to be + * portable: + * - sysclk_enable_peripheral_clock() + * - sysclk_disable_peripheral_clock() + * - sysclk_enable_module() + * - sysclk_disable_module() + * - sysclk_module_is_enabled() + * - sysclk_set_prescalers() + * + * All other functions should be considered platform-specific. + * Enabling/disabling clocks to specific peripherals as well as + * determining the speed of these clocks should be done by calling + * functions provided by the driver for that peripheral. + * + * @{ + */ + +//! \name System Clock Initialization +//@{ +/** + * \fn void sysclk_init(void) + * \brief Initialize the synchronous clock system. + * + * This function will initialize the system clock and its source. This + * includes: + * - Mask all synchronous clocks except for any clocks which are + * essential for normal operation (for example internal memory + * clocks). + * - Set up the system clock prescalers as specified by the + * application's configuration file. + * - Enable the clock source specified by the application's + * configuration file (oscillator or PLL) and wait for it to become + * stable. + * - Set the main system clock source to the clock specified by the + * application's configuration file. + * + * Since all non-essential peripheral clocks are initially disabled, it + * is the responsibility of the peripheral driver to re-enable any + * clocks that are needed for normal operation. + */ +//@} + +//! @} + +#endif /* SYSCLK_H_INCLUDED */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/ioport/ioport.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/ioport/ioport.h new file mode 100644 index 000000000..43d75ceed --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/ioport/ioport.h @@ -0,0 +1,536 @@ +/** + * \file + * + * \brief Common IOPORT service main header file for AVR, UC3 and ARM + * architectures. + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +#ifndef IOPORT_H +#define IOPORT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +/** + * \defgroup ioport_group Common IOPORT API + * + * See \ref ioport_quickstart. + * + * This is common IOPORT service for GPIO pin configuration and control in a + * standardized manner across the MEGA, MEGA_RF, XMEGA, UC3 and ARM devices. + * + * Port pin control code is optimized for each platform, and should produce + * both compact and fast execution times when used with constant values. + * + * \section dependencies Dependencies + * This driver depends on the following modules: + * - \ref sysclk_group for clock speed and functions. + * @{ + */ + +/** + * \def IOPORT_CREATE_PIN(port, pin) + * \brief Create IOPORT pin number + * + * Create a IOPORT pin number for use with the IOPORT functions. + * + * \param port IOPORT port (e.g. PORTA, PA or PIOA depending on chosen + * architecture) + * \param pin IOPORT zero-based index of the I/O pin + */ + +/** \brief IOPORT pin directions */ +enum ioport_direction { + IOPORT_DIR_INPUT, /*!< IOPORT input direction */ + IOPORT_DIR_OUTPUT, /*!< IOPORT output direction */ +}; + +/** \brief IOPORT levels */ +enum ioport_value { + IOPORT_PIN_LEVEL_LOW, /*!< IOPORT pin value low */ + IOPORT_PIN_LEVEL_HIGH, /*!< IOPORT pin value high */ +}; + +#if MEGA_RF +/** \brief IOPORT edge sense modes */ +enum ioport_sense { + IOPORT_SENSE_LEVEL, /*!< IOPORT sense low level */ + IOPORT_SENSE_BOTHEDGES, /*!< IOPORT sense both rising and falling edges */ + IOPORT_SENSE_FALLING, /*!< IOPORT sense falling edges */ + IOPORT_SENSE_RISING, /*!< IOPORT sense rising edges */ +}; +#elif SAM && !SAM4L +/** \brief IOPORT edge sense modes */ +enum ioport_sense { + IOPORT_SENSE_BOTHEDGES, /*!< IOPORT sense both rising and falling edges */ + IOPORT_SENSE_FALLING, /*!< IOPORT sense falling edges */ + IOPORT_SENSE_RISING, /*!< IOPORT sense rising edges */ + IOPORT_SENSE_LEVEL_LOW, /*!< IOPORT sense low level */ + IOPORT_SENSE_LEVEL_HIGH,/*!< IOPORT sense High level */ +}; +#else +enum ioport_sense { + IOPORT_SENSE_BOTHEDGES, /*!< IOPORT sense both rising and falling edges */ + IOPORT_SENSE_RISING, /*!< IOPORT sense rising edges */ + IOPORT_SENSE_FALLING, /*!< IOPORT sense falling edges */ +}; +#endif + + +#if XMEGA +# include "xmega/ioport.h" +# if defined(IOPORT_XMEGA_COMPAT) +# include "xmega/ioport_compat.h" +# endif +#elif MEGA +# include "mega/ioport.h" +#elif UC3 +# include "uc3/ioport.h" +#elif SAM +# if SAM4L +# include "sam/ioport_gpio.h" +# else +# include "sam/ioport_pio.h" +# endif +#endif + +/** + * \brief Initializes the IOPORT service, ready for use. + * + * This function must be called before using any other functions in the IOPORT + * service. + */ +static inline void ioport_init(void) +{ + arch_ioport_init(); +} + +/** + * \brief Enable an IOPORT pin, based on a pin created with \ref + * IOPORT_CREATE_PIN(). + * + * \param pin IOPORT pin to enable + */ +static inline void ioport_enable_pin(ioport_pin_t pin) +{ + arch_ioport_enable_pin(pin); +} + +/** + * \brief Enable multiple pins in a single IOPORT port. + * + * \param port IOPORT port to enable + * \param mask Mask of pins within the port to enable + */ +static inline void ioport_enable_port(ioport_port_t port, + ioport_port_mask_t mask) +{ + arch_ioport_enable_port(port, mask); +} + +/** + * \brief Disable IOPORT pin, based on a pin created with \ref + * IOPORT_CREATE_PIN(). + * + * \param pin IOPORT pin to disable + */ +static inline void ioport_disable_pin(ioport_pin_t pin) +{ + arch_ioport_disable_pin(pin); +} + +/** + * \brief Disable multiple pins in a single IOPORT port. + * + * \param port IOPORT port to disable + * \param mask Pin mask of pins to disable + */ +static inline void ioport_disable_port(ioport_port_t port, + ioport_port_mask_t mask) +{ + arch_ioport_disable_port(port, mask); +} + +/** + * \brief Set multiple pin modes in a single IOPORT port, such as pull-up, + * pull-down, etc. configuration. + * + * \param port IOPORT port to configure + * \param mask Pin mask of pins to configure + * \param mode Mode masks to configure for the specified pins (\ref + * ioport_modes) + */ +static inline void ioport_set_port_mode(ioport_port_t port, + ioport_port_mask_t mask, ioport_mode_t mode) +{ + arch_ioport_set_port_mode(port, mask, mode); +} + +/** + * \brief Set pin mode for one single IOPORT pin. + * + * \param pin IOPORT pin to configure + * \param mode Mode masks to configure for the specified pin (\ref ioport_modes) + */ +static inline void ioport_set_pin_mode(ioport_pin_t pin, ioport_mode_t mode) +{ + arch_ioport_set_pin_mode(pin, mode); +} + +/** + * \brief Reset multiple pin modes in a specified IOPORT port to defaults. + * + * \param port IOPORT port to configure + * \param mask Mask of pins whose mode configuration is to be reset + */ +static inline void ioport_reset_port_mode(ioport_port_t port, + ioport_port_mask_t mask) +{ + arch_ioport_set_port_mode(port, mask, 0); +} + +/** + * \brief Reset pin mode configuration for a single IOPORT pin + * + * \param pin IOPORT pin to configure + */ +static inline void ioport_reset_pin_mode(ioport_pin_t pin) +{ + arch_ioport_set_pin_mode(pin, 0); +} + +/** + * \brief Set I/O direction for a group of pins in a single IOPORT. + * + * \param port IOPORT port to configure + * \param mask Pin mask of pins to configure + * \param dir Direction to set for the specified pins (\ref ioport_direction) + */ +static inline void ioport_set_port_dir(ioport_port_t port, + ioport_port_mask_t mask, enum ioport_direction dir) +{ + arch_ioport_set_port_dir(port, mask, dir); +} + +/** + * \brief Set direction for a single IOPORT pin. + * + * \param pin IOPORT pin to configure + * \param dir Direction to set for the specified pin (\ref ioport_direction) + */ +static inline void ioport_set_pin_dir(ioport_pin_t pin, + enum ioport_direction dir) +{ + arch_ioport_set_pin_dir(pin, dir); +} + +/** + * \brief Set an IOPORT pin to a specified logical value. + * + * \param pin IOPORT pin to configure + * \param level Logical value of the pin + */ +static inline void ioport_set_pin_level(ioport_pin_t pin, bool level) +{ + arch_ioport_set_pin_level(pin, level); +} + +/** + * \brief Set a group of IOPORT pins in a single port to a specified logical + * value. + * + * \param port IOPORT port to write to + * \param mask Pin mask of pins to modify + * \param level Level of the pins to be modified + */ +static inline void ioport_set_port_level(ioport_port_t port, + ioport_port_mask_t mask, ioport_port_mask_t level) +{ + arch_ioport_set_port_level(port, mask, level); +} + +/** + * \brief Get current value of an IOPORT pin, which has been configured as an + * input. + * + * \param pin IOPORT pin to read + * \return Current logical value of the specified pin + */ +static inline bool ioport_get_pin_level(ioport_pin_t pin) +{ + return arch_ioport_get_pin_level(pin); +} + +/** + * \brief Get current value of several IOPORT pins in a single port, which have + * been configured as an inputs. + * + * \param port IOPORT port to read + * \param mask Pin mask of pins to read + * \return Logical levels of the specified pins from the read port, returned as + * a mask. + */ +static inline ioport_port_mask_t ioport_get_port_level(ioport_pin_t port, + ioport_port_mask_t mask) +{ + return arch_ioport_get_port_level(port, mask); +} + +/** + * \brief Toggle the value of an IOPORT pin, which has previously configured as + * an output. + * + * \param pin IOPORT pin to toggle + */ +static inline void ioport_toggle_pin_level(ioport_pin_t pin) +{ + arch_ioport_toggle_pin_level(pin); +} + +/** + * \brief Toggle the values of several IOPORT pins located in a single port. + * + * \param port IOPORT port to modify + * \param mask Pin mask of pins to toggle + */ +static inline void ioport_toggle_port_level(ioport_port_t port, + ioport_port_mask_t mask) +{ + arch_ioport_toggle_port_level(port, mask); +} + +/** + * \brief Set the pin sense mode of a single IOPORT pin. + * + * \param pin IOPORT pin to configure + * \param pin_sense Edge to sense for the pin (\ref ioport_sense) + */ +static inline void ioport_set_pin_sense_mode(ioport_pin_t pin, + enum ioport_sense pin_sense) +{ + arch_ioport_set_pin_sense_mode(pin, pin_sense); +} + +/** + * \brief Set the pin sense mode of a multiple IOPORT pins on a single port. + * + * \param port IOPORT port to configure + * \param mask Bitmask if pins whose edge sense is to be configured + * \param pin_sense Edge to sense for the pins (\ref ioport_sense) + */ +static inline void ioport_set_port_sense_mode(ioport_port_t port, + ioport_port_mask_t mask, + enum ioport_sense pin_sense) +{ + arch_ioport_set_port_sense_mode(port, mask, pin_sense); +} + +/** + * \brief Convert a pin ID into a its port ID. + * + * \param pin IOPORT pin ID to convert + * \retval Port ID for the given pin ID + */ +static inline ioport_port_t ioport_pin_to_port_id(ioport_pin_t pin) +{ + return arch_ioport_pin_to_port_id(pin); +} + +/** + * \brief Convert a pin ID into a bitmask mask for the given pin on its port. + * + * \param pin IOPORT pin ID to convert + * \retval Bitmask with a bit set that corresponds to the given pin ID in its port + */ +static inline ioport_port_mask_t ioport_pin_to_mask(ioport_pin_t pin) +{ + return arch_ioport_pin_to_mask(pin); +} + +/** @} */ + +/** + * \page ioport_quickstart Quick start guide for the common IOPORT service + * + * This is the quick start guide for the \ref ioport_group, with + * step-by-step instructions on how to configure and use the service in a + * selection of use cases. + * + * The use cases contain several code fragments. The code fragments in the + * steps for setup can be copied into a custom initialization function, while + * the steps for usage can be copied into, e.g., the main application function. + * + * \section ioport_quickstart_basic Basic use case + * In this use case we will configure one IO pin for button input and one for + * LED control. Then it will read the button state and output it on the LED. + * + * \section ioport_quickstart_basic_setup Setup steps + * + * \subsection ioport_quickstart_basic_setup_code Example code + * \code + * #define MY_LED IOPORT_CREATE_PIN(PORTA, 5) + * #define MY_BUTTON IOPORT_CREATE_PIN(PORTA, 6) + * + * ioport_init(); + * + * ioport_set_pin_dir(MY_LED, IOPORT_DIR_OUTPUT); + * ioport_set_pin_dir(MY_BUTTON, IOPORT_DIR_INPUT); + * ioport_set_pin_mode(MY_BUTTON, IOPORT_MODE_PULLUP); + * \endcode + * + * \subsection ioport_quickstart_basic_setup_flow Workflow + * -# It's useful to give the GPIOs symbolic names and this can be done with + * the \ref IOPORT_CREATE_PIN macro. We define one for a LED and one for a + * button. + * - \code + * #define MY_LED IOPORT_CREATE_PIN(PORTA, 5) + * #define MY_BUTTON IOPORT_CREATE_PIN(PORTA, 6) + * \endcode + * - \note The usefulness of the \ref IOPORT_CREATE_PIN macro and port names + * differ between architectures: + * - MEGA, MEGA_RF and XMEGA: Use \ref IOPORT_CREATE_PIN macro with port definitions + * PORTA, PORTB ... + * - UC3: Most convenient to pick up the device header file pin definition + * and us it directly. E.g.: AVR32_PIN_PB06 + * - SAM: Most convenient to pick up the device header file pin definition + * and us it directly. E.g.: PIO_PA5_IDX
+ * \ref IOPORT_CREATE_PIN can also be used with port definitions + * PIOA, PIOB ... + * -# Initialize the ioport service. This typically enables the IO module if + * needed. + * - \code ioport_init(); \endcode + * -# Set the LED GPIO as output: + * - \code ioport_set_pin_dir(MY_LED, IOPORT_DIR_OUTPUT); \endcode + * -# Set the button GPIO as input: + * - \code ioport_set_pin_dir(MY_BUTTON, IOPORT_DIR_INPUT); \endcode + * -# Enable pull-up for the button GPIO: + * - \code ioport_set_pin_mode(MY_BUTTON, IOPORT_MODE_PULLUP); \endcode + * + * \section ioport_quickstart_basic_usage Usage steps + * + * \subsection ioport_quickstart_basic_usage_code Example code + * \code + * bool value; + * + * value = ioport_get_pin_level(MY_BUTTON); + * ioport_set_pin_level(MY_LED, value); + * \endcode + * + * \subsection ioport_quickstart_basic_usage_flow Workflow + * -# Define a boolean variable for state storage: + * - \code bool value; \endcode + * -# Read out the button level into variable value: + * - \code value = ioport_get_pin_level(MY_BUTTON); \endcode + * -# Set the LED to read out value from the button: + * - \code ioport_set_pin_level(MY_LED, value); \endcode + * + * \section ioport_quickstart_advanced Advanced use cases + * - \subpage ioport_quickstart_use_case_1 : Port access + */ + +/** + * \page ioport_quickstart_use_case_1 Advanced use case doing port access + * + * In this case we will read out the pins from one whole port and write the + * read value to another port. + * + * \section ioport_quickstart_use_case_1_setup Setup steps + * + * \subsection ioport_quickstart_use_case_1_setup_code Example code + * \code + * #define IN_PORT IOPORT_PORTA + * #define OUT_PORT IOPORT_PORTB + * #define MASK 0x00000060 + * + * ioport_init(); + * + * ioport_set_port_dir(IN_PORT, MASK, IOPORT_DIR_INPUT); + * ioport_set_port_dir(OUT_PORT, MASK, IOPORT_DIR_OUTPUT); + * \endcode + * + * \subsection ioport_quickstart_basic_setup_flow Workflow + * -# It's useful to give the ports symbolic names: + * - \code + * #define IN_PORT IOPORT_PORTA + * #define OUT_PORT IOPORT_PORTB + * \endcode + * - \note The port names differ between architectures: + * - MEGA_RF, MEGA and XMEGA: There are predefined names for ports: IOPORT_PORTA, + * IOPORT_PORTB ... + * - UC3: Use the index value of the different IO blocks: 0, 1 ... + * - SAM: There are predefined names for ports: IOPORT_PIOA, IOPORT_PIOB + * ... + * -# Also useful to define a mask for the bits to work with: + * - \code #define MASK 0x00000060 \endcode + * -# Initialize the ioport service. This typically enables the IO module if + * needed. + * - \code ioport_init(); \endcode + * -# Set one of the ports as input: + * - \code ioport_set_pin_dir(IN_PORT, MASK, IOPORT_DIR_INPUT); \endcode + * -# Set the other port as output: + * - \code ioport_set_pin_dir(OUT_PORT, MASK, IOPORT_DIR_OUTPUT); \endcode + * + * \section ioport_quickstart_basic_usage Usage steps + * + * \subsection ioport_quickstart_basic_usage_code Example code + * \code + * ioport_port_mask_t value; + * + * value = ioport_get_port_level(IN_PORT, MASK); + * ioport_set_port_level(OUT_PORT, MASK, value); + * \endcode + * + * \subsection ioport_quickstart_basic_usage_flow Workflow + * -# Define a variable for port date storage: + * - \code ioport_port_mask_t value; \endcode + * -# Read out from one port: + * - \code value = ioport_get_port_level(IN_PORT, MASK); \endcode + * -# Put the read data out on the other port: + * - \code ioport_set_port_level(OUT_PORT, MASK, value); \endcode + */ + +#ifdef __cplusplus +} +#endif + +#endif /* IOPORT_H */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/ioport/sam/ioport_gpio.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/ioport/sam/ioport_gpio.h new file mode 100644 index 000000000..934bf679f --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/ioport/sam/ioport_gpio.h @@ -0,0 +1,302 @@ +/** + * \file + * + * \brief SAM architecture specific IOPORT service implementation header file. + * + * Copyright (c) 2012-2013 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +#ifndef IOPORT_SAM_H +#define IOPORT_SAM_H + +#include + +#define IOPORT_CREATE_PIN(port, pin) ((port) * 32 + (pin)) + +// Aliases +#define IOPORT_GPIOA 0 +#define IOPORT_GPIOB 1 +#define IOPORT_GPIOC 2 +#define IOPORT_GPIOD 3 +#define IOPORT_GPIOE 4 +#define IOPORT_GPIOF 5 + +/** + * \weakgroup ioport_group + * \section ioport_modes IOPORT Modes + * + * For details on these please see the device datasheet. + * + * @{ + */ + +/** \name IOPORT Mode bit definitions */ +/** @{ */ +#define IOPORT_MODE_MUX_MASK (7 << 0) /*!< MUX bits mask */ +#define IOPORT_MODE_MUX_BIT0 (1 << 0) /*!< MUX BIT0 mask */ +#define IOPORT_MODE_MUX_BIT1 (1 << 1) /*!< MUX BIT1 mask */ +#define IOPORT_MODE_MUX_A (0 << 0) /*!< MUX function A */ +#define IOPORT_MODE_MUX_B (1 << 0) /*!< MUX function B */ +#define IOPORT_MODE_MUX_C (2 << 0) /*!< MUX function C */ +#define IOPORT_MODE_MUX_D (3 << 0) /*!< MUX function D */ + +#define IOPORT_MODE_MUX_BIT2 (1 << 2) /*!< MUX BIT2 mask */ +#define IOPORT_MODE_MUX_E (4 << 0) /*!< MUX function E */ +#define IOPORT_MODE_MUX_F (5 << 0) /*!< MUX function F */ +#define IOPORT_MODE_MUX_G (6 << 0) /*!< MUX function G */ +#define IOPORT_MODE_MUX_H (7 << 0) /*!< MUX function H */ + +#define IOPORT_MODE_PULLUP (1 << 3) /*!< Pull-up */ +#define IOPORT_MODE_PULLDOWN (1 << 4) /*!< Pull-down */ +#define IOPORT_MODE_GLITCH_FILTER (1 << 6) /*!< Glitch filter */ +#define IOPORT_MODE_DRIVE_STRENGTH (1 << 7) /*!< Extra drive strength */ +/** @} */ + +/** @} */ + +typedef uint32_t ioport_mode_t; +typedef uint32_t ioport_pin_t; +typedef uint32_t ioport_port_t; +typedef uint32_t ioport_port_mask_t; + +__always_inline static ioport_port_t arch_ioport_pin_to_port_id(ioport_pin_t pin) +{ + return pin >> 5; +} + +__always_inline static volatile GpioPort *arch_ioport_port_to_base( + ioport_port_t port) +{ + return (volatile GpioPort *)(GPIO_ADDR + + port * sizeof(GpioPort)); +} + +__always_inline static volatile GpioPort *arch_ioport_pin_to_base(ioport_pin_t pin) +{ + return arch_ioport_port_to_base(arch_ioport_pin_to_port_id(pin)); +} + +__always_inline static ioport_port_mask_t arch_ioport_pin_to_mask(ioport_pin_t pin) +{ + return 1U << (pin & 0x1F); +} + +__always_inline static void arch_ioport_init(void) +{ + sysclk_enable_peripheral_clock(GPIO); +} + +__always_inline static void arch_ioport_enable_port(ioport_port_t port, + ioport_port_mask_t mask) +{ + arch_ioport_port_to_base(port)->GPIO_GPERS = mask; +} + +__always_inline static void arch_ioport_disable_port(ioport_port_t port, + ioport_port_mask_t mask) +{ + arch_ioport_port_to_base(port)->GPIO_GPERC = mask; +} + +__always_inline static void arch_ioport_enable_pin(ioport_pin_t pin) +{ + arch_ioport_enable_port(arch_ioport_pin_to_port_id(pin), + arch_ioport_pin_to_mask(pin)); +} + +__always_inline static void arch_ioport_disable_pin(ioport_pin_t pin) +{ + arch_ioport_disable_port(arch_ioport_pin_to_port_id(pin), + arch_ioport_pin_to_mask(pin)); +} + +__always_inline static void arch_ioport_set_port_mode(ioport_port_t port, + ioport_port_mask_t mask, ioport_mode_t mode) +{ + volatile GpioPort *base = arch_ioport_port_to_base(port); + + if (mode & IOPORT_MODE_PULLUP) { + base->GPIO_PUERS = mask; + } else { + base->GPIO_PUERC = mask; + } + +#ifdef IOPORT_MODE_PULLDOWN + if (mode & IOPORT_MODE_PULLDOWN) { + base->GPIO_PDERS = mask; + } else { + base->GPIO_PDERC = mask; + } +#endif + + if (mode & IOPORT_MODE_GLITCH_FILTER) { + base->GPIO_GFERS = mask; + } else { + base->GPIO_GFERC = mask; + } + +#ifdef IOPORT_MODE_DRIVE_STRENGTH + if (mode & IOPORT_MODE_DRIVE_STRENGTH) { + base->GPIO_ODCR0S = mask; + } else { + base->GPIO_ODCR0C = mask; + } +#endif + + if (mode & IOPORT_MODE_MUX_BIT0) { + base->GPIO_PMR0S = mask; + } else { + base->GPIO_PMR0C = mask; + } + + if (mode & IOPORT_MODE_MUX_BIT1) { + base->GPIO_PMR1S = mask; + } else { + base->GPIO_PMR1C = mask; + } + +#ifdef IOPORT_MODE_MUX_BIT2 + if (mode & IOPORT_MODE_MUX_BIT2) { + base->GPIO_PMR2S = mask; + } else { + base->GPIO_PMR2C = mask; + } +#endif +} + +__always_inline static void arch_ioport_set_pin_mode(ioport_pin_t pin, + ioport_mode_t mode) +{ + arch_ioport_set_port_mode(arch_ioport_pin_to_port_id(pin), + arch_ioport_pin_to_mask(pin), mode); +} + +__always_inline static void arch_ioport_set_port_dir(ioport_port_t port, + ioport_port_mask_t mask, unsigned char group_direction) +{ + if (group_direction == IOPORT_DIR_OUTPUT) { + arch_ioport_port_to_base(port)->GPIO_ODERS = mask; + // Always disable the Schmitt trigger for output pins. + arch_ioport_port_to_base(port)->GPIO_STERC = mask; + } else if (group_direction == IOPORT_DIR_INPUT) { + arch_ioport_port_to_base(port)->GPIO_ODERC = mask; + // Always enable the Schmitt trigger for input pins. + arch_ioport_port_to_base(port)->GPIO_STERS = mask; + } +} + +__always_inline static void arch_ioport_set_pin_dir(ioport_pin_t pin, + enum ioport_direction dir) +{ + if (dir == IOPORT_DIR_OUTPUT) { + arch_ioport_pin_to_base(pin)->GPIO_ODERS = arch_ioport_pin_to_mask(pin); + // Always disable the Schmitt trigger for output pins. + arch_ioport_pin_to_base(pin)->GPIO_STERC = arch_ioport_pin_to_mask(pin); + } else if (dir == IOPORT_DIR_INPUT) { + arch_ioport_pin_to_base(pin)->GPIO_ODERC = arch_ioport_pin_to_mask(pin); + // Always enable the Schmitt trigger for input pins. + arch_ioport_pin_to_base(pin)->GPIO_STERS = arch_ioport_pin_to_mask(pin); + } +} + +__always_inline static void arch_ioport_set_pin_level(ioport_pin_t pin, + bool level) +{ + if (level) { + arch_ioport_pin_to_base(pin)->GPIO_OVRS = arch_ioport_pin_to_mask(pin); + } else { + arch_ioport_pin_to_base(pin)->GPIO_OVRC = arch_ioport_pin_to_mask(pin); + } +} + +__always_inline static void arch_ioport_set_port_level(ioport_port_t port, + ioport_port_mask_t mask, ioport_port_mask_t level) +{ + volatile GpioPort *base = arch_ioport_port_to_base(port); + + base->GPIO_OVRS = mask & level; + base->GPIO_OVRC = mask & ~level; +} + +__always_inline static bool arch_ioport_get_pin_level(ioport_pin_t pin) +{ + return arch_ioport_pin_to_base(pin)->GPIO_PVR & arch_ioport_pin_to_mask(pin); +} + +__always_inline static ioport_port_mask_t arch_ioport_get_port_level( + ioport_port_t port, ioport_port_mask_t mask) +{ + return arch_ioport_port_to_base(port)->GPIO_PVR & mask; +} + +__always_inline static void arch_ioport_toggle_pin_level(ioport_pin_t pin) +{ + arch_ioport_pin_to_base(pin)->GPIO_OVRT = arch_ioport_pin_to_mask(pin); +} + +__always_inline static void arch_ioport_toggle_port_level(ioport_port_t port, + ioport_port_mask_t mask) +{ + arch_ioport_port_to_base(port)->GPIO_OVRT = mask; +} + +__always_inline static void arch_ioport_set_port_sense_mode(ioport_port_t port, + ioport_port_mask_t mask, enum ioport_sense pin_sense) +{ + volatile GpioPort *base = arch_ioport_port_to_base(port); + + if (pin_sense & 0x01) { + base->GPIO_IMR0S = mask; + } else { + base->GPIO_IMR0C = mask; + } + + if (pin_sense & 0x02) { + base->GPIO_IMR1S = mask; + } else { + base->GPIO_IMR1C = mask; + } +} + +__always_inline static void arch_ioport_set_pin_sense_mode(ioport_pin_t pin, + enum ioport_sense pin_sense) +{ + arch_ioport_set_port_sense_mode(arch_ioport_pin_to_port_id(pin), + arch_ioport_pin_to_mask(pin), pin_sense); +} + +#endif /* IOPORT_SAM_H */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/sleepmgr/sam4l/sleepmgr.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/sleepmgr/sam4l/sleepmgr.c new file mode 100644 index 000000000..453f411d6 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/sleepmgr/sam4l/sleepmgr.c @@ -0,0 +1,50 @@ +/** + * \file + * + * \brief Chip-specific sleep manager configuration + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +#include +#include + +#if defined(CONFIG_SLEEPMGR_ENABLE) || defined(__DOXYGEN__) + +uint8_t sleepmgr_locks[SLEEPMGR_NR_OF_MODES]; + +#endif /* CONFIG_SLEEPMGR_ENABLE */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/sleepmgr/sam4l/sleepmgr.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/sleepmgr/sam4l/sleepmgr.h new file mode 100644 index 000000000..c1ca20efa --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/sleepmgr/sam4l/sleepmgr.h @@ -0,0 +1,124 @@ +/** + * \file + * + * \brief Chip-specific sleep manager configuration + * + * Copyright (c) 2012 - 2013 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#ifndef SAM_SLEEPMGR_INCLUDED +#define SAM_SLEEPMGR_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include +#include "bpm.h" +#include "sleep.h" + +/** + * \weakgroup sleepmgr_group + * @{ + */ + +enum sleepmgr_mode { + /** Active mode. */ + SLEEPMGR_ACTIVE = 0, + + /** + * Sleep mode. + * Potential Wake Up sources: fast startup events and interrupt. + */ + SLEEPMGR_SLEEP_0, + SLEEPMGR_SLEEP_1, + SLEEPMGR_SLEEP_2, + SLEEPMGR_SLEEP_3, + + /** + * Wait mode. + * Potential Wake Up sources: fast startup events + */ + SLEEPMGR_WAIT, + + /** + * Retention mode. + * Potential Wake Up sources: fast startup events + */ + SLEEPMGR_RET, + + /** Backup mode. Potential Wake Up sources: WKUPs, SM, RTT, RTC. */ + SLEEPMGR_BACKUP, + + SLEEPMGR_NR_OF_MODES, +}; + +/** + * \internal + * \name Internal arrays + * @{ + */ +#if defined(CONFIG_SLEEPMGR_ENABLE) || defined(__DOXYGEN__) +/** Sleep mode lock counters */ +extern uint8_t sleepmgr_locks[]; +#endif /* CONFIG_SLEEPMGR_ENABLE */ +/** @} */ + +static inline void sleepmgr_sleep(const enum sleepmgr_mode sleep_mode) +{ + Assert(sleep_mode != SLEEPMGR_ACTIVE); +#ifdef CONFIG_SLEEPMGR_ENABLE + cpu_irq_disable(); + + /* Enter the sleep mode. */ + bpm_sleep(BPM, sleep_mode); +#else + UNUSED(sleep_mode); + cpu_irq_enable(); +#endif /* CONFIG_SLEEPMGR_ENABLE */ +} + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* SAM_SLEEPMGR_INCLUDED */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/sleepmgr/sleepmgr.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/sleepmgr/sleepmgr.h new file mode 100644 index 000000000..a5d6d4235 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/services/sleepmgr/sleepmgr.h @@ -0,0 +1,244 @@ +/** + * \file + * + * \brief Sleep manager + * + * Copyright (c) 2010 - 2013 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +#ifndef SLEEPMGR_H +#define SLEEPMGR_H + +#include +#include + +#if (SAM3S || SAM3U || SAM3N || SAM3XA || SAM4S || SAM4E) +# include "sam/sleepmgr.h" +#elif XMEGA +# include "xmega/sleepmgr.h" +#elif UC3 +# include "uc3/sleepmgr.h" +#elif SAM4L +# include "sam4l/sleepmgr.h" +#else +# error Unsupported device. +#endif + +/** + * \defgroup sleepmgr_group Sleep manager + * + * The sleep manager is a service for ensuring that the device is not put to + * sleep in deeper sleep modes than the system (e.g., peripheral drivers, + * services or the application) allows at any given time. + * + * It is based on the use of lock counting for the individual sleep modes, and + * will put the device to sleep in the shallowest sleep mode that has a non-zero + * lock count. The drivers/services/application can change these counts by use + * of \ref sleepmgr_lock_mode and \ref sleepmgr_unlock_mode. + * Refer to \ref sleepmgr_mode for a list of the sleep modes available for + * locking, and the device datasheet for information on their effect. + * + * The application must supply the file \ref conf_sleepmgr.h. + * + * For the sleep manager to be enabled, the symbol \ref CONFIG_SLEEPMGR_ENABLE + * must be defined, e.g., in \ref conf_sleepmgr.h. If this symbol is not + * defined, the functions are replaced with dummy functions and no RAM is used. + * + * @{ + */ + +/** + * \def CONFIG_SLEEPMGR_ENABLE + * \brief Configuration symbol for enabling the sleep manager + * + * If this symbol is not defined, the functions of this service are replaced + * with dummy functions. This is useful for reducing code size and execution + * time if the sleep manager is not needed in the application. + * + * This symbol may be defined in \ref conf_sleepmgr.h. + */ +#if defined(__DOXYGEN__) && !defined(CONFIG_SLEEPMGR_ENABLE) +# define CONFIG_SLEEPMGR_ENABLE +#endif + +/** + * \enum sleepmgr_mode + * \brief Sleep mode locks + * + * Identifiers for the different sleep mode locks. + */ + +/** + * \brief Initialize the lock counts + * + * Sets all lock counts to 0, except the very last one, which is set to 1. This + * is done to simplify the algorithm for finding the deepest allowable sleep + * mode in \ref sleepmgr_enter_sleep. + */ +static inline void sleepmgr_init(void) +{ +#ifdef CONFIG_SLEEPMGR_ENABLE + uint8_t i; + + for (i = 0; i < SLEEPMGR_NR_OF_MODES - 1; i++) { + sleepmgr_locks[i] = 0; + } + sleepmgr_locks[SLEEPMGR_NR_OF_MODES - 1] = 1; +#endif /* CONFIG_SLEEPMGR_ENABLE */ +} + +/** + * \brief Increase lock count for a sleep mode + * + * Increases the lock count for \a mode to ensure that the sleep manager does + * not put the device to sleep in the deeper sleep modes. + * + * \param mode Sleep mode to lock. + */ +static inline void sleepmgr_lock_mode(enum sleepmgr_mode mode) +{ +#ifdef CONFIG_SLEEPMGR_ENABLE + irqflags_t flags; + + Assert(sleepmgr_locks[mode] < 0xff); + + // Enter a critical section + flags = cpu_irq_save(); + + ++sleepmgr_locks[mode]; + + // Leave the critical section + cpu_irq_restore(flags); +#else + UNUSED(mode); +#endif /* CONFIG_SLEEPMGR_ENABLE */ +} + +/** + * \brief Decrease lock count for a sleep mode + * + * Decreases the lock count for \a mode. If the lock count reaches 0, the sleep + * manager can put the device to sleep in the deeper sleep modes. + * + * \param mode Sleep mode to unlock. + */ +static inline void sleepmgr_unlock_mode(enum sleepmgr_mode mode) +{ +#ifdef CONFIG_SLEEPMGR_ENABLE + irqflags_t flags; + + Assert(sleepmgr_locks[mode]); + + // Enter a critical section + flags = cpu_irq_save(); + + --sleepmgr_locks[mode]; + + // Leave the critical section + cpu_irq_restore(flags); +#else + UNUSED(mode); +#endif /* CONFIG_SLEEPMGR_ENABLE */ +} + + /** + * \brief Retrieves the deepest allowable sleep mode + * + * Searches through the sleep mode lock counts, starting at the shallowest sleep + * mode, until the first non-zero lock count is found. The deepest allowable + * sleep mode is then returned. + */ +static inline enum sleepmgr_mode sleepmgr_get_sleep_mode(void) +{ + enum sleepmgr_mode sleep_mode = SLEEPMGR_ACTIVE; + +#ifdef CONFIG_SLEEPMGR_ENABLE + uint8_t *lock_ptr = sleepmgr_locks; + + // Find first non-zero lock count, starting with the shallowest modes. + while (!(*lock_ptr)) { + lock_ptr++; + sleep_mode++; + } + + // Catch the case where one too many sleepmgr_unlock_mode() call has been + // performed on the deepest sleep mode. + Assert((uintptr_t)(lock_ptr - sleepmgr_locks) < SLEEPMGR_NR_OF_MODES); + +#endif /* CONFIG_SLEEPMGR_ENABLE */ + + return sleep_mode; +} + +/** + * \fn sleepmgr_enter_sleep + * \brief Go to sleep in the deepest allowed mode + * + * Searches through the sleep mode lock counts, starting at the shallowest sleep + * mode, until the first non-zero lock count is found. The device is then put to + * sleep in the sleep mode that corresponds to the lock. + * + * \note This function enables interrupts before going to sleep, and will leave + * them enabled upon return. This also applies if sleep is skipped due to ACTIVE + * mode being locked. + */ + +static inline void sleepmgr_enter_sleep(void) +{ +#ifdef CONFIG_SLEEPMGR_ENABLE + enum sleepmgr_mode sleep_mode; + + cpu_irq_disable(); + + // Find the deepest allowable sleep mode + sleep_mode = sleepmgr_get_sleep_mode(); + // Return right away if first mode (ACTIVE) is locked. + if (sleep_mode==SLEEPMGR_ACTIVE) { + cpu_irq_enable(); + return; + } + // Enter the deepest allowable sleep mode with interrupts enabled + sleepmgr_sleep(sleep_mode); +#else + cpu_irq_enable(); +#endif /* CONFIG_SLEEPMGR_ENABLE */ +} + + +//! @} + +#endif /* SLEEPMGR_H */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/utils/interrupt.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/utils/interrupt.h new file mode 100644 index 000000000..63686515e --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/utils/interrupt.h @@ -0,0 +1,139 @@ +/** + * \file + * + * \brief Global interrupt management for 8- and 32-bit AVR + * + * Copyright (c) 2010-2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +#ifndef UTILS_INTERRUPT_H +#define UTILS_INTERRUPT_H + +#include + +#if XMEGA || MEGA || TINY +# include "interrupt/interrupt_avr8.h" +#elif UC3 +# include "interrupt/interrupt_avr32.h" +#elif SAM3S || SAM3N || SAM3XA || SAM3U || SAM4S || SAM4L || SAM4E +# include "interrupt/interrupt_sam_nvic.h" +#else +# error Unsupported device. +#endif + +/** + * \defgroup interrupt_group Global interrupt management + * + * This is a driver for global enabling and disabling of interrupts. + * + * @{ + */ + +#if defined(__DOXYGEN__) +/** + * \def CONFIG_INTERRUPT_FORCE_INTC + * \brief Force usage of the ASF INTC driver + * + * Predefine this symbol when preprocessing to force the use of the ASF INTC driver. + * This is useful to ensure compatibilty accross compilers and shall be used only when required + * by the application needs. + */ +# define CONFIG_INTERRUPT_FORCE_INTC +#endif + +//! \name Global interrupt flags +//@{ +/** + * \typedef irqflags_t + * \brief Type used for holding state of interrupt flag + */ + +/** + * \def cpu_irq_enable + * \brief Enable interrupts globally + */ + +/** + * \def cpu_irq_disable + * \brief Disable interrupts globally + */ + +/** + * \fn irqflags_t cpu_irq_save(void) + * \brief Get and clear the global interrupt flags + * + * Use in conjunction with \ref cpu_irq_restore. + * + * \return Current state of interrupt flags. + * + * \note This function leaves interrupts disabled. + */ + +/** + * \fn void cpu_irq_restore(irqflags_t flags) + * \brief Restore global interrupt flags + * + * Use in conjunction with \ref cpu_irq_save. + * + * \param flags State to set interrupt flag to. + */ + +/** + * \fn bool cpu_irq_is_enabled_flags(irqflags_t flags) + * \brief Check if interrupts are globally enabled in supplied flags + * + * \param flags Currents state of interrupt flags. + * + * \return True if interrupts are enabled. + */ + +/** + * \def cpu_irq_is_enabled + * \brief Check if interrupts are globally enabled + * + * \return True if interrupts are enabled. + */ +//@} + +//! @} + +/** + * \ingroup interrupt_group + * \defgroup interrupt_deprecated_group Deprecated interrupt definitions + */ + +#endif /* UTILS_INTERRUPT_H */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/utils/interrupt/interrupt_sam_nvic.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/utils/interrupt/interrupt_sam_nvic.c new file mode 100644 index 000000000..a58826f72 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/utils/interrupt/interrupt_sam_nvic.c @@ -0,0 +1,47 @@ +/** + * \file + * + * \brief Global interrupt management for SAM3 and SAM4 (NVIC based) + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#include "interrupt_sam_nvic.h" + +//! Global NVIC interrupt enable status (by default it's enabled) +volatile bool g_interrupt_enabled = true; diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/utils/interrupt/interrupt_sam_nvic.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/utils/interrupt/interrupt_sam_nvic.h new file mode 100644 index 000000000..f032723a3 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/utils/interrupt/interrupt_sam_nvic.h @@ -0,0 +1,169 @@ +/** + * \file + * + * \brief Global interrupt management for SAM3 and SAM4 (NVIC based) + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#ifndef UTILS_INTERRUPT_INTERRUPT_H +#define UTILS_INTERRUPT_INTERRUPT_H + +#include +#include + +/** + * \weakgroup interrupt_group + * + * @{ + */ + +/** + * \name Interrupt Service Routine definition + * + * @{ + */ + +/** + * \brief Define service routine + * + * \note For NVIC devices the interrupt service routines are predefined to + * add to vector table in binary generation, so there is no service + * register at run time. The routine collections are in exceptions.h. + * + * Usage: + * \code + * ISR(foo_irq_handler) + * { + * // Function definition + * ... + * } + * \endcode + * + * \param func Name for the function. + */ +# define ISR(func) \ + void func (void) + +/** + * \brief Initialize interrupt vectors + * + * For NVIC the interrupt vectors are put in vector table. So nothing + * to do to initialize them, except defined the vector function with + * right name. + * + * This must be called prior to \ref irq_register_handler. + */ +# define irq_initialize_vectors() \ + do { \ + } while(0) + +/** + * \brief Register handler for interrupt + * + * For NVIC the interrupt vectors are put in vector table. So nothing + * to do to register them, except defined the vector function with + * right name. + * + * Usage: + * \code + * irq_initialize_vectors(); + * irq_register_handler(foo_irq_handler); + * \endcode + * + * \note The function \a func must be defined with the \ref ISR macro. + * \note The functions prototypes can be found in the device exception header + * files (exceptions.h). + */ +# define irq_register_handler(int_num, int_prio) \ + NVIC_ClearPendingIRQ( (IRQn_Type)int_num); \ + NVIC_SetPriority( (IRQn_Type)int_num, int_prio); \ + NVIC_EnableIRQ( (IRQn_Type)int_num); \ + +//@} + +# define cpu_irq_enable() \ + do { \ + g_interrupt_enabled = true; \ + __DMB(); \ + __enable_irq(); \ + } while (0) +# define cpu_irq_disable() \ + do { \ + __disable_irq(); \ + __DMB(); \ + g_interrupt_enabled = false; \ + } while (0) + +typedef uint32_t irqflags_t; +extern volatile bool g_interrupt_enabled; + +static inline irqflags_t cpu_irq_save(void) +{ + irqflags_t flags = g_interrupt_enabled; + cpu_irq_disable(); + return flags; +} + +static inline bool cpu_irq_is_enabled_flags(irqflags_t flags) +{ + return (flags); +} + +static inline void cpu_irq_restore(irqflags_t flags) +{ + if (cpu_irq_is_enabled_flags(flags)) + cpu_irq_enable(); +} + +#define cpu_irq_is_enabled() g_interrupt_enabled + +/** + * \weakgroup interrupt_deprecated_group + * @{ + */ + +#define Enable_global_interrupt() cpu_irq_enable() +#define Disable_global_interrupt() cpu_irq_disable() +#define Is_global_interrupt_enabled() cpu_irq_is_enabled() + +//@} + +//@} + +#endif /* UTILS_INTERRUPT_INTERRUPT_H */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/utils/parts.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/utils/parts.h new file mode 100644 index 000000000..f58511d5a --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/common/utils/parts.h @@ -0,0 +1,889 @@ +/** + * \file + * + * \brief Atmel part identification macros + * + * Copyright (C) 2012-2013 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#ifndef ATMEL_PARTS_H +#define ATMEL_PARTS_H + +/** + * \defgroup part_macros_group Atmel part identification macros + * + * This collection of macros identify which series and families that the various + * Atmel parts belong to. These can be used to select part-dependent sections of + * code at compile time. + * + * @{ + */ + +/** + * \name Convenience macros for part checking + * @{ + */ +/* ! Check GCC and IAR part definition for 8-bit AVR */ +#define AVR8_PART_IS_DEFINED(part) \ + (defined(__ ## part ## __) || defined(__AVR_ ## part ## __)) + +/* ! Check GCC and IAR part definition for 32-bit AVR */ +#define AVR32_PART_IS_DEFINED(part) \ + (defined(__AT32 ## part ## __) || defined(__AVR32_ ## part ## __)) + +/* ! Check GCC and IAR part definition for SAM */ +#define SAM_PART_IS_DEFINED(part) (defined(__ ## part ## __)) +/** @} */ + +/** + * \defgroup uc3_part_macros_group AVR UC3 parts + * @{ + */ + +/** + * \name AVR UC3 A series + * @{ + */ +#define UC3A0 ( \ + AVR32_PART_IS_DEFINED(UC3A0128) || \ + AVR32_PART_IS_DEFINED(UC3A0256) || \ + AVR32_PART_IS_DEFINED(UC3A0512) \ + ) + +#define UC3A1 ( \ + AVR32_PART_IS_DEFINED(UC3A1128) || \ + AVR32_PART_IS_DEFINED(UC3A1256) || \ + AVR32_PART_IS_DEFINED(UC3A1512) \ + ) + +#define UC3A3 ( \ + AVR32_PART_IS_DEFINED(UC3A364) || \ + AVR32_PART_IS_DEFINED(UC3A364S) || \ + AVR32_PART_IS_DEFINED(UC3A3128) || \ + AVR32_PART_IS_DEFINED(UC3A3128S) || \ + AVR32_PART_IS_DEFINED(UC3A3256) || \ + AVR32_PART_IS_DEFINED(UC3A3256S) \ + ) + +#define UC3A4 ( \ + AVR32_PART_IS_DEFINED(UC3A464) || \ + AVR32_PART_IS_DEFINED(UC3A464S) || \ + AVR32_PART_IS_DEFINED(UC3A4128) || \ + AVR32_PART_IS_DEFINED(UC3A4128S) || \ + AVR32_PART_IS_DEFINED(UC3A4256) || \ + AVR32_PART_IS_DEFINED(UC3A4256S) \ + ) +/** @} */ + +/** + * \name AVR UC3 B series + * @{ + */ +#define UC3B0 ( \ + AVR32_PART_IS_DEFINED(UC3B064) || \ + AVR32_PART_IS_DEFINED(UC3B0128) || \ + AVR32_PART_IS_DEFINED(UC3B0256) || \ + AVR32_PART_IS_DEFINED(UC3B0512) \ + ) + +#define UC3B1 ( \ + AVR32_PART_IS_DEFINED(UC3B164) || \ + AVR32_PART_IS_DEFINED(UC3B1128) || \ + AVR32_PART_IS_DEFINED(UC3B1256) || \ + AVR32_PART_IS_DEFINED(UC3B1512) \ + ) +/** @} */ + +/** + * \name AVR UC3 C series + * @{ + */ +#define UC3C0 ( \ + AVR32_PART_IS_DEFINED(UC3C064C) || \ + AVR32_PART_IS_DEFINED(UC3C0128C) || \ + AVR32_PART_IS_DEFINED(UC3C0256C) || \ + AVR32_PART_IS_DEFINED(UC3C0512C) \ + ) + +#define UC3C1 ( \ + AVR32_PART_IS_DEFINED(UC3C164C) || \ + AVR32_PART_IS_DEFINED(UC3C1128C) || \ + AVR32_PART_IS_DEFINED(UC3C1256C) || \ + AVR32_PART_IS_DEFINED(UC3C1512C) \ + ) + +#define UC3C2 ( \ + AVR32_PART_IS_DEFINED(UC3C264C) || \ + AVR32_PART_IS_DEFINED(UC3C2128C) || \ + AVR32_PART_IS_DEFINED(UC3C2256C) || \ + AVR32_PART_IS_DEFINED(UC3C2512C) \ + ) +/** @} */ + +/** + * \name AVR UC3 D series + * @{ + */ +#define UC3D3 ( \ + AVR32_PART_IS_DEFINED(UC64D3) || \ + AVR32_PART_IS_DEFINED(UC128D3) \ + ) + +#define UC3D4 ( \ + AVR32_PART_IS_DEFINED(UC64D4) || \ + AVR32_PART_IS_DEFINED(UC128D4) \ + ) +/** @} */ + +/** + * \name AVR UC3 L series + * @{ + */ +#define UC3L0 ( \ + AVR32_PART_IS_DEFINED(UC3L016) || \ + AVR32_PART_IS_DEFINED(UC3L032) || \ + AVR32_PART_IS_DEFINED(UC3L064) \ + ) + +#define UC3L0128 ( \ + AVR32_PART_IS_DEFINED(UC3L0128) \ + ) + +#define UC3L0256 ( \ + AVR32_PART_IS_DEFINED(UC3L0256) \ + ) + +#define UC3L3 ( \ + AVR32_PART_IS_DEFINED(UC64L3U) || \ + AVR32_PART_IS_DEFINED(UC128L3U) || \ + AVR32_PART_IS_DEFINED(UC256L3U) \ + ) + +#define UC3L4 ( \ + AVR32_PART_IS_DEFINED(UC64L4U) || \ + AVR32_PART_IS_DEFINED(UC128L4U) || \ + AVR32_PART_IS_DEFINED(UC256L4U) \ + ) + +#define UC3L3_L4 (UC3L3 || UC3L4) +/** @} */ + +/** + * \name AVR UC3 families + * @{ + */ +/** AVR UC3 A family */ +#define UC3A (UC3A0 || UC3A1 || UC3A3 || UC3A4) + +/** AVR UC3 B family */ +#define UC3B (UC3B0 || UC3B1) + +/** AVR UC3 C family */ +#define UC3C (UC3C0 || UC3C1 || UC3C2) + +/** AVR UC3 D family */ +#define UC3D (UC3D3 || UC3D4) + +/** AVR UC3 L family */ +#define UC3L (UC3L0 || UC3L0128 || UC3L0256 || UC3L3_L4) +/** @} */ + +/** AVR UC3 product line */ +#define UC3 (UC3A || UC3B || UC3C || UC3D || UC3L) + +/** @} */ + +/** + * \defgroup xmega_part_macros_group AVR XMEGA parts + * @{ + */ + +/** + * \name AVR XMEGA A series + * @{ + */ +#define XMEGA_A1 ( \ + AVR8_PART_IS_DEFINED(ATxmega64A1) || \ + AVR8_PART_IS_DEFINED(ATxmega128A1) \ + ) + +#define XMEGA_A3 ( \ + AVR8_PART_IS_DEFINED(ATxmega64A3) || \ + AVR8_PART_IS_DEFINED(ATxmega128A3) || \ + AVR8_PART_IS_DEFINED(ATxmega192A3) || \ + AVR8_PART_IS_DEFINED(ATxmega256A3) \ + ) + +#define XMEGA_A3B ( \ + AVR8_PART_IS_DEFINED(ATxmega256A3B) \ + ) + +#define XMEGA_A4 ( \ + AVR8_PART_IS_DEFINED(ATxmega16A4) || \ + AVR8_PART_IS_DEFINED(ATxmega32A4) \ + ) +/** @} */ + +/** + * \name AVR XMEGA AU series + * @{ + */ +#define XMEGA_A1U ( \ + AVR8_PART_IS_DEFINED(ATxmega64A1U) || \ + AVR8_PART_IS_DEFINED(ATxmega128A1U) \ + ) + +#define XMEGA_A3U ( \ + AVR8_PART_IS_DEFINED(ATxmega64A3U) || \ + AVR8_PART_IS_DEFINED(ATxmega128A3U) || \ + AVR8_PART_IS_DEFINED(ATxmega192A3U) || \ + AVR8_PART_IS_DEFINED(ATxmega256A3U) \ + ) + +#define XMEGA_A3BU ( \ + AVR8_PART_IS_DEFINED(ATxmega256A3BU) \ + ) + +#define XMEGA_A4U ( \ + AVR8_PART_IS_DEFINED(ATxmega16A4U) || \ + AVR8_PART_IS_DEFINED(ATxmega32A4U) || \ + AVR8_PART_IS_DEFINED(ATxmega64A4U) || \ + AVR8_PART_IS_DEFINED(ATxmega128A4U) \ + ) +/** @} */ + +/** + * \name AVR XMEGA B series + * @{ + */ +#define XMEGA_B1 ( \ + AVR8_PART_IS_DEFINED(ATxmega64B1) || \ + AVR8_PART_IS_DEFINED(ATxmega128B1) \ + ) + +#define XMEGA_B3 ( \ + AVR8_PART_IS_DEFINED(ATxmega64B3) || \ + AVR8_PART_IS_DEFINED(ATxmega128B3) \ + ) +/** @} */ + +/** + * \name AVR XMEGA C series + * @{ + */ +#define XMEGA_C3 ( \ + AVR8_PART_IS_DEFINED(ATxmega384C3) || \ + AVR8_PART_IS_DEFINED(ATxmega256C3) || \ + AVR8_PART_IS_DEFINED(ATxmega192C3) || \ + AVR8_PART_IS_DEFINED(ATxmega128C3) || \ + AVR8_PART_IS_DEFINED(ATxmega64C3) \ + ) + +#define XMEGA_C4 ( \ + AVR8_PART_IS_DEFINED(ATxmega32C4) || \ + AVR8_PART_IS_DEFINED(ATxmega16C4) \ + ) +/** @} */ + +/** + * \name AVR XMEGA D series + * @{ + */ +#define XMEGA_D3 ( \ + AVR8_PART_IS_DEFINED(ATxmega64D3) || \ + AVR8_PART_IS_DEFINED(ATxmega128D3) || \ + AVR8_PART_IS_DEFINED(ATxmega192D3) || \ + AVR8_PART_IS_DEFINED(ATxmega256D3) || \ + AVR8_PART_IS_DEFINED(ATxmega384D3) \ + ) + +#define XMEGA_D4 ( \ + AVR8_PART_IS_DEFINED(ATxmega16D4) || \ + AVR8_PART_IS_DEFINED(ATxmega32D4) || \ + AVR8_PART_IS_DEFINED(ATxmega64D4) || \ + AVR8_PART_IS_DEFINED(ATxmega128D4) \ + ) +/** @} */ + +/** + * \name AVR XMEGA E series + * @{ + */ +#define XMEGA_E5 ( \ + AVR8_PART_IS_DEFINED(ATxmega8E5) || \ + AVR8_PART_IS_DEFINED(ATxmega16E5) || \ + AVR8_PART_IS_DEFINED(ATxmega32E5) \ + ) +/** @} */ + + +/** + * \name AVR XMEGA families + * @{ + */ +/** AVR XMEGA A family */ +#define XMEGA_A (XMEGA_A1 || XMEGA_A3 || XMEGA_A3B || XMEGA_A4) + +/** AVR XMEGA AU family */ +#define XMEGA_AU (XMEGA_A1U || XMEGA_A3U || XMEGA_A3BU || XMEGA_A4U) + +/** AVR XMEGA B family */ +#define XMEGA_B (XMEGA_B1 || XMEGA_B3) + +/** AVR XMEGA C family */ +#define XMEGA_C (XMEGA_C3 || XMEGA_C4) + +/** AVR XMEGA D family */ +#define XMEGA_D (XMEGA_D3 || XMEGA_D4) + +/** AVR XMEGA E family */ +#define XMEGA_E (XMEGA_E5) +/** @} */ + + +/** AVR XMEGA product line */ +#define XMEGA (XMEGA_A || XMEGA_AU || XMEGA_B || XMEGA_C || XMEGA_D || XMEGA_E) + +/** @} */ + +/** + * \defgroup mega_part_macros_group megaAVR parts + * + * \note These megaAVR groupings are based on the groups in AVR Libc for the + * part header files. They are not names of official megaAVR device series or + * families. + * + * @{ + */ + +/** + * \name ATmegaxx0/xx1 subgroups + * @{ + */ +#define MEGA_XX0 ( \ + AVR8_PART_IS_DEFINED(ATmega640) || \ + AVR8_PART_IS_DEFINED(ATmega1280) || \ + AVR8_PART_IS_DEFINED(ATmega2560) \ + ) + +#define MEGA_XX1 ( \ + AVR8_PART_IS_DEFINED(ATmega1281) || \ + AVR8_PART_IS_DEFINED(ATmega2561) \ + ) +/** @} */ + +/** + * \name megaAVR groups + * @{ + */ +/** ATmegaxx0/xx1 group */ +#define MEGA_XX0_1 (MEGA_XX0 || MEGA_XX1) + +/** ATmegaxx4 group */ +#define MEGA_XX4 ( \ + AVR8_PART_IS_DEFINED(ATmega164A) || \ + AVR8_PART_IS_DEFINED(ATmega164PA) || \ + AVR8_PART_IS_DEFINED(ATmega324A) || \ + AVR8_PART_IS_DEFINED(ATmega324PA) || \ + AVR8_PART_IS_DEFINED(ATmega644) || \ + AVR8_PART_IS_DEFINED(ATmega644A) || \ + AVR8_PART_IS_DEFINED(ATmega644PA) || \ + AVR8_PART_IS_DEFINED(ATmega1284P) || \ + AVR8_PART_IS_DEFINED(ATmega128RFA1) \ + ) + +/** ATmegaxx4 group */ +#define MEGA_XX4_A ( \ + AVR8_PART_IS_DEFINED(ATmega164A) || \ + AVR8_PART_IS_DEFINED(ATmega164PA) || \ + AVR8_PART_IS_DEFINED(ATmega324A) || \ + AVR8_PART_IS_DEFINED(ATmega324PA) || \ + AVR8_PART_IS_DEFINED(ATmega644A) || \ + AVR8_PART_IS_DEFINED(ATmega644PA) || \ + AVR8_PART_IS_DEFINED(ATmega1284P) \ + ) + +/** ATmegaxx8 group */ +#define MEGA_XX8 ( \ + AVR8_PART_IS_DEFINED(ATmega48) || \ + AVR8_PART_IS_DEFINED(ATmega48A) || \ + AVR8_PART_IS_DEFINED(ATmega48PA) || \ + AVR8_PART_IS_DEFINED(ATmega88) || \ + AVR8_PART_IS_DEFINED(ATmega88A) || \ + AVR8_PART_IS_DEFINED(ATmega88PA) || \ + AVR8_PART_IS_DEFINED(ATmega168) || \ + AVR8_PART_IS_DEFINED(ATmega168A) || \ + AVR8_PART_IS_DEFINED(ATmega168PA) || \ + AVR8_PART_IS_DEFINED(ATmega328) || \ + AVR8_PART_IS_DEFINED(ATmega328P) \ + ) + +/** ATmegaxx8A/P/PA group */ +#define MEGA_XX8_A ( \ + AVR8_PART_IS_DEFINED(ATmega48A) || \ + AVR8_PART_IS_DEFINED(ATmega48PA) || \ + AVR8_PART_IS_DEFINED(ATmega88A) || \ + AVR8_PART_IS_DEFINED(ATmega88PA) || \ + AVR8_PART_IS_DEFINED(ATmega168A) || \ + AVR8_PART_IS_DEFINED(ATmega168PA) || \ + AVR8_PART_IS_DEFINED(ATmega328P) \ + ) + +/** ATmegaxx group */ +#define MEGA_XX ( \ + AVR8_PART_IS_DEFINED(ATmega16) || \ + AVR8_PART_IS_DEFINED(ATmega16A) || \ + AVR8_PART_IS_DEFINED(ATmega32) || \ + AVR8_PART_IS_DEFINED(ATmega32A) || \ + AVR8_PART_IS_DEFINED(ATmega64) || \ + AVR8_PART_IS_DEFINED(ATmega64A) || \ + AVR8_PART_IS_DEFINED(ATmega128) || \ + AVR8_PART_IS_DEFINED(ATmega128A) \ + ) + +/** ATmegaxxA/P/PA group */ +#define MEGA_XX_A ( \ + AVR8_PART_IS_DEFINED(ATmega16A) || \ + AVR8_PART_IS_DEFINED(ATmega32A) || \ + AVR8_PART_IS_DEFINED(ATmega64A) || \ + AVR8_PART_IS_DEFINED(ATmega128A) \ + ) +/** ATmegaxxRFA1 group */ +#define MEGA_RFA1 ( \ + AVR8_PART_IS_DEFINED(ATmega128RFA1) \ + ) + +/** ATmegaxxRFR2 group */ +#define MEGA_RFR2 ( \ + AVR8_PART_IS_DEFINED(ATmega64RFR2) || \ + AVR8_PART_IS_DEFINED(ATmega128RFR2) || \ + AVR8_PART_IS_DEFINED(ATmega256RFR2) \ + ) + +/** ATmegaxxRFxx group */ +#define MEGA_RF (MEGA_RFA1 || MEGA_RFR2) + +/** + * \name ATmegaxx_un0/un1/un2 subgroups + * @{ + */ +#define MEGA_XX_UN0 ( \ + AVR8_PART_IS_DEFINED(ATmega16) || \ + AVR8_PART_IS_DEFINED(ATmega16A) || \ + AVR8_PART_IS_DEFINED(ATmega32) || \ + AVR8_PART_IS_DEFINED(ATmega32A) \ + ) + +/** ATmegaxx group without power reduction and + * And interrupt sense register. + */ +#define MEGA_XX_UN1 ( \ + AVR8_PART_IS_DEFINED(ATmega64) || \ + AVR8_PART_IS_DEFINED(ATmega64A) || \ + AVR8_PART_IS_DEFINED(ATmega128) || \ + AVR8_PART_IS_DEFINED(ATmega128A) \ + ) + +/** ATmegaxx group without power reduction and + * And interrupt sense register. + */ +#define MEGA_XX_UN2 ( \ + AVR8_PART_IS_DEFINED(ATmega169P) || \ + AVR8_PART_IS_DEFINED(ATmega169PA) || \ + AVR8_PART_IS_DEFINED(ATmega329P) || \ + AVR8_PART_IS_DEFINED(ATmega329PA) \ + ) + +/** Devices added to complete megaAVR offering. + * Please do not use this group symbol as it is not intended + * to be permanent: the devices should be regrouped. + */ +#define MEGA_UNCATEGORIZED ( \ + AVR8_PART_IS_DEFINED(AT90CAN128) || \ + AVR8_PART_IS_DEFINED(AT90CAN32) || \ + AVR8_PART_IS_DEFINED(AT90CAN64) || \ + AVR8_PART_IS_DEFINED(AT90PWM1) || \ + AVR8_PART_IS_DEFINED(AT90PWM216) || \ + AVR8_PART_IS_DEFINED(AT90PWM2B) || \ + AVR8_PART_IS_DEFINED(AT90PWM316) || \ + AVR8_PART_IS_DEFINED(AT90PWM3B) || \ + AVR8_PART_IS_DEFINED(AT90PWM81) || \ + AVR8_PART_IS_DEFINED(AT90USB1286) || \ + AVR8_PART_IS_DEFINED(AT90USB1287) || \ + AVR8_PART_IS_DEFINED(AT90USB162) || \ + AVR8_PART_IS_DEFINED(AT90USB646) || \ + AVR8_PART_IS_DEFINED(AT90USB647) || \ + AVR8_PART_IS_DEFINED(AT90USB82) || \ + AVR8_PART_IS_DEFINED(ATmega1284) || \ + AVR8_PART_IS_DEFINED(ATmega162) || \ + AVR8_PART_IS_DEFINED(ATmega164P) || \ + AVR8_PART_IS_DEFINED(ATmega165A) || \ + AVR8_PART_IS_DEFINED(ATmega165P) || \ + AVR8_PART_IS_DEFINED(ATmega165PA) || \ + AVR8_PART_IS_DEFINED(ATmega168P) || \ + AVR8_PART_IS_DEFINED(ATmega169A) || \ + AVR8_PART_IS_DEFINED(ATmega16M1) || \ + AVR8_PART_IS_DEFINED(ATmega16U2) || \ + AVR8_PART_IS_DEFINED(ATmega16U4) || \ + AVR8_PART_IS_DEFINED(ATmega2564RFR2) || \ + AVR8_PART_IS_DEFINED(ATmega256RFA2) || \ + AVR8_PART_IS_DEFINED(ATmega324P) || \ + AVR8_PART_IS_DEFINED(ATmega325) || \ + AVR8_PART_IS_DEFINED(ATmega3250) || \ + AVR8_PART_IS_DEFINED(ATmega3250A) || \ + AVR8_PART_IS_DEFINED(ATmega3250P) || \ + AVR8_PART_IS_DEFINED(ATmega3250PA) || \ + AVR8_PART_IS_DEFINED(ATmega325A) || \ + AVR8_PART_IS_DEFINED(ATmega325P) || \ + AVR8_PART_IS_DEFINED(ATmega325PA) || \ + AVR8_PART_IS_DEFINED(ATmega329) || \ + AVR8_PART_IS_DEFINED(ATmega3290) || \ + AVR8_PART_IS_DEFINED(ATmega3290A) || \ + AVR8_PART_IS_DEFINED(ATmega3290P) || \ + AVR8_PART_IS_DEFINED(ATmega3290PA) || \ + AVR8_PART_IS_DEFINED(ATmega329A) || \ + AVR8_PART_IS_DEFINED(ATmega32M1) || \ + AVR8_PART_IS_DEFINED(ATmega32U2) || \ + AVR8_PART_IS_DEFINED(ATmega32U4) || \ + AVR8_PART_IS_DEFINED(ATmega48P) || \ + AVR8_PART_IS_DEFINED(ATmega644P) || \ + AVR8_PART_IS_DEFINED(ATmega645) || \ + AVR8_PART_IS_DEFINED(ATmega6450) || \ + AVR8_PART_IS_DEFINED(ATmega6450A) || \ + AVR8_PART_IS_DEFINED(ATmega6450P) || \ + AVR8_PART_IS_DEFINED(ATmega645A) || \ + AVR8_PART_IS_DEFINED(ATmega645P) || \ + AVR8_PART_IS_DEFINED(ATmega649) || \ + AVR8_PART_IS_DEFINED(ATmega6490) || \ + AVR8_PART_IS_DEFINED(ATmega6490A) || \ + AVR8_PART_IS_DEFINED(ATmega6490P) || \ + AVR8_PART_IS_DEFINED(ATmega649A) || \ + AVR8_PART_IS_DEFINED(ATmega649P) || \ + AVR8_PART_IS_DEFINED(ATmega64M1) || \ + AVR8_PART_IS_DEFINED(ATmega64RFA2) || \ + AVR8_PART_IS_DEFINED(ATmega8) || \ + AVR8_PART_IS_DEFINED(ATmega8515) || \ + AVR8_PART_IS_DEFINED(ATmega8535) || \ + AVR8_PART_IS_DEFINED(ATmega88P) || \ + AVR8_PART_IS_DEFINED(ATmega8A) || \ + AVR8_PART_IS_DEFINED(ATmega8U2) \ + ) + +/** Unspecified group */ +#define MEGA_UNSPECIFIED (MEGA_XX_UN0 || MEGA_XX_UN1 || MEGA_XX_UN2 || \ + MEGA_UNCATEGORIZED) + +/** @} */ + +/** megaAVR product line */ +#define MEGA (MEGA_XX0_1 || MEGA_XX4 || MEGA_XX8 || MEGA_XX || MEGA_RF || \ + MEGA_UNSPECIFIED) + +/** @} */ + +/** + * \defgroup tiny_part_macros_group tinyAVR parts + * + * @{ + */ + +/** + * \name tinyAVR groups + * @{ + */ + +/** Devices added to complete tinyAVR offering. + * Please do not use this group symbol as it is not intended + * to be permanent: the devices should be regrouped. + */ +#define TINY_UNCATEGORIZED ( \ + AVR8_PART_IS_DEFINED(ATtiny10) || \ + AVR8_PART_IS_DEFINED(ATtiny13) || \ + AVR8_PART_IS_DEFINED(ATtiny13A) || \ + AVR8_PART_IS_DEFINED(ATtiny1634) || \ + AVR8_PART_IS_DEFINED(ATtiny167) || \ + AVR8_PART_IS_DEFINED(ATtiny20) || \ + AVR8_PART_IS_DEFINED(ATtiny2313) || \ + AVR8_PART_IS_DEFINED(ATtiny2313A) || \ + AVR8_PART_IS_DEFINED(ATtiny24) || \ + AVR8_PART_IS_DEFINED(ATtiny24A) || \ + AVR8_PART_IS_DEFINED(ATtiny25) || \ + AVR8_PART_IS_DEFINED(ATtiny26) || \ + AVR8_PART_IS_DEFINED(ATtiny261) || \ + AVR8_PART_IS_DEFINED(ATtiny261A) || \ + AVR8_PART_IS_DEFINED(ATtiny4) || \ + AVR8_PART_IS_DEFINED(ATtiny40) || \ + AVR8_PART_IS_DEFINED(ATtiny4313) || \ + AVR8_PART_IS_DEFINED(ATtiny43U) || \ + AVR8_PART_IS_DEFINED(ATtiny44) || \ + AVR8_PART_IS_DEFINED(ATtiny44A) || \ + AVR8_PART_IS_DEFINED(ATtiny45) || \ + AVR8_PART_IS_DEFINED(ATtiny461) || \ + AVR8_PART_IS_DEFINED(ATtiny461A) || \ + AVR8_PART_IS_DEFINED(ATtiny48) || \ + AVR8_PART_IS_DEFINED(ATtiny5) || \ + AVR8_PART_IS_DEFINED(ATtiny828) || \ + AVR8_PART_IS_DEFINED(ATtiny84) || \ + AVR8_PART_IS_DEFINED(ATtiny84A) || \ + AVR8_PART_IS_DEFINED(ATtiny85) || \ + AVR8_PART_IS_DEFINED(ATtiny861) || \ + AVR8_PART_IS_DEFINED(ATtiny861A) || \ + AVR8_PART_IS_DEFINED(ATtiny87) || \ + AVR8_PART_IS_DEFINED(ATtiny88) || \ + AVR8_PART_IS_DEFINED(ATtiny9) \ + ) + +/** @} */ + +/** tinyAVR product line */ +#define TINY (TINY_UNCATEGORIZED) + +/** @} */ + +/** + * \defgroup sam_part_macros_group SAM parts + * @{ + */ + +/** + * \name SAM3S series + * @{ + */ +#define SAM3S1 ( \ + SAM_PART_IS_DEFINED(SAM3S1A) || \ + SAM_PART_IS_DEFINED(SAM3S1B) || \ + SAM_PART_IS_DEFINED(SAM3S1C) \ + ) + +#define SAM3S2 ( \ + SAM_PART_IS_DEFINED(SAM3S2A) || \ + SAM_PART_IS_DEFINED(SAM3S2B) || \ + SAM_PART_IS_DEFINED(SAM3S2C) \ + ) + +#define SAM3S4 ( \ + SAM_PART_IS_DEFINED(SAM3S4A) || \ + SAM_PART_IS_DEFINED(SAM3S4B) || \ + SAM_PART_IS_DEFINED(SAM3S4C) \ + ) + +#define SAM3S8 ( \ + SAM_PART_IS_DEFINED(SAM3S8B) || \ + SAM_PART_IS_DEFINED(SAM3S8C) \ + ) + +#define SAM3SD8 ( \ + SAM_PART_IS_DEFINED(SAM3SD8B) || \ + SAM_PART_IS_DEFINED(SAM3SD8C) \ + ) +/** @} */ + +/** + * \name SAM3U series + * @{ + */ +#define SAM3U1 ( \ + SAM_PART_IS_DEFINED(SAM3U1C) || \ + SAM_PART_IS_DEFINED(SAM3U1E) \ + ) + +#define SAM3U2 ( \ + SAM_PART_IS_DEFINED(SAM3U2C) || \ + SAM_PART_IS_DEFINED(SAM3U2E) \ + ) + +#define SAM3U4 ( \ + SAM_PART_IS_DEFINED(SAM3U4C) || \ + SAM_PART_IS_DEFINED(SAM3U4E) \ + ) +/** @} */ + +/** + * \name SAM3N series + * @{ + */ +#define SAM3N1 ( \ + SAM_PART_IS_DEFINED(SAM3N1A) || \ + SAM_PART_IS_DEFINED(SAM3N1B) || \ + SAM_PART_IS_DEFINED(SAM3N1C) \ + ) + +#define SAM3N2 ( \ + SAM_PART_IS_DEFINED(SAM3N2A) || \ + SAM_PART_IS_DEFINED(SAM3N2B) || \ + SAM_PART_IS_DEFINED(SAM3N2C) \ + ) + +#define SAM3N4 ( \ + SAM_PART_IS_DEFINED(SAM3N4A) || \ + SAM_PART_IS_DEFINED(SAM3N4B) || \ + SAM_PART_IS_DEFINED(SAM3N4C) \ + ) +/** @} */ + +/** + * \name SAM3X series + * @{ + */ +#define SAM3X4 ( \ + SAM_PART_IS_DEFINED(SAM3X4C) || \ + SAM_PART_IS_DEFINED(SAM3X4E) \ + ) + +#define SAM3X8 ( \ + SAM_PART_IS_DEFINED(SAM3X8C) || \ + SAM_PART_IS_DEFINED(SAM3X8E) || \ + SAM_PART_IS_DEFINED(SAM3X8H) \ + ) +/** @} */ + +/** + * \name SAM3A series + * @{ + */ +#define SAM3A4 ( \ + SAM_PART_IS_DEFINED(SAM3A4C) \ + ) + +#define SAM3A8 ( \ + SAM_PART_IS_DEFINED(SAM3A8C) \ + ) +/** @} */ + +/** + * \name SAM4S series + * @{ + */ +#define SAM4S8 ( \ + SAM_PART_IS_DEFINED(SAM4S8B) || \ + SAM_PART_IS_DEFINED(SAM4S8C) \ + ) + +#define SAM4S16 ( \ + SAM_PART_IS_DEFINED(SAM4S16B) || \ + SAM_PART_IS_DEFINED(SAM4S16C) \ + ) + +#define SAM4SA16 ( \ + SAM_PART_IS_DEFINED(SAM4SA16B) || \ + SAM_PART_IS_DEFINED(SAM4SA16C) \ + ) + +#define SAM4SD16 ( \ + SAM_PART_IS_DEFINED(SAM4SD16B) || \ + SAM_PART_IS_DEFINED(SAM4SD16C) \ + ) + +#define SAM4SD32 ( \ + SAM_PART_IS_DEFINED(SAM4SD32B) || \ + SAM_PART_IS_DEFINED(SAM4SD32C) \ + ) +/** @} */ + +/** + * \name SAM4L series + * @{ + */ +#define SAM4LS ( \ + SAM_PART_IS_DEFINED(SAM4LS2A) || \ + SAM_PART_IS_DEFINED(SAM4LS2B) || \ + SAM_PART_IS_DEFINED(SAM4LS2C) || \ + SAM_PART_IS_DEFINED(SAM4LS4A) || \ + SAM_PART_IS_DEFINED(SAM4LS4B) || \ + SAM_PART_IS_DEFINED(SAM4LS4C) \ + ) + +#define SAM4LC ( \ + SAM_PART_IS_DEFINED(SAM4LC2A) || \ + SAM_PART_IS_DEFINED(SAM4LC2B) || \ + SAM_PART_IS_DEFINED(SAM4LC2C) || \ + SAM_PART_IS_DEFINED(SAM4LC4A) || \ + SAM_PART_IS_DEFINED(SAM4LC4B) || \ + SAM_PART_IS_DEFINED(SAM4LC4C) \ + ) +/** @} */ + +/** + * \name SAM4E series + * @{ + */ +#define SAM4E8 ( \ + SAM_PART_IS_DEFINED(SAM4E8E) \ + ) + +#define SAM4E16 ( \ + SAM_PART_IS_DEFINED(SAM4E16E) \ + ) +/** @} */ + +/** + * \name SAM families + * @{ + */ +/** SAM3S Family */ +#define SAM3S (SAM3S1 || SAM3S2 || SAM3S4 || SAM3S8 || SAM3SD8) + +/** SAM3U Family */ +#define SAM3U (SAM3U1 || SAM3U2 || SAM3U4) + +/** SAM3N Family */ +#define SAM3N (SAM3N1 || SAM3N2 || SAM3N4) + +/** SAM3XA Family */ +#define SAM3XA (SAM3X4 || SAM3X8 || SAM3A4 || SAM3A8) + +/** SAM4S Family */ +#define SAM4S (SAM4S8 || SAM4S16 || SAM4SA16 || SAM4SD16 || SAM4SD32) + +/** SAM4L Family */ +#define SAM4L (SAM4LS || SAM4LC) + +/** SAM4E Family */ +#define SAM4E (SAM4E8 || SAM4E16) +/** @} */ + +/** SAM product line */ +#define SAM (SAM3S || SAM3U || SAM3N || SAM3XA || SAM4S || SAM4L || SAM4E) + +/** @} */ + +/** @} */ + +/** @} */ + +#endif /* ATMEL_PARTS_H */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/boards/sam4l_ek/init.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/boards/sam4l_ek/init.c new file mode 100644 index 000000000..a986cefa8 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/boards/sam4l_ek/init.c @@ -0,0 +1,220 @@ +/** + * \file + * + * \brief SAM4L-EK Board init. + * + * This file contains board initialization function. + * + * Copyright (c) 2012 - 2013 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +#include "compiler.h" +#include "sam4l_ek.h" +#include "conf_board.h" +#include "ioport.h" +#include "board.h" +/** + * \addtogroup sam4l_ek_group + * @{ + */ + +/** + * \brief Set peripheral mode for one single IOPORT pin. + * It will configure port mode and disable pin mode (but enable peripheral). + * \param pin IOPORT pin to configure + * \param mode Mode masks to configure for the specified pin (\ref ioport_modes) + */ +#define ioport_set_pin_peripheral_mode(pin, mode) \ + do {\ + ioport_set_pin_mode(pin, mode);\ + ioport_disable_pin(pin);\ + } while (0) + +void board_init(void) +{ + // Initialize IOPORTs + ioport_init(); + + // Put all pins to default state (input & pull-up) + uint32_t pin; + + for (pin = PIN_PA00; pin <= PIN_PC31; pin ++) { + // Skip output pins to configure later + if (pin == LED0_GPIO || pin == LCD_BL_GPIO +#ifdef CONF_BOARD_RS485 + || pin == RS485_USART_CTS_PIN +#endif + /* PA02 is not configured as it is driven by hardware + configuration */ + || pin == PIN_PA02) { + continue; + } + ioport_set_pin_dir(pin, IOPORT_DIR_INPUT); + ioport_set_pin_mode(pin, IOPORT_MODE_PULLUP); + } + + /* Configure the pins connected to LEDs as output and set their + * default initial state to high (LEDs off). + */ + ioport_set_pin_dir(LED0_GPIO, IOPORT_DIR_OUTPUT); + ioport_set_pin_level(LED0_GPIO, LED0_INACTIVE_LEVEL); + +#ifdef CONF_BOARD_EIC + // Set push button as external interrupt pin + ioport_set_pin_peripheral_mode(GPIO_PUSH_BUTTON_EIC_PIN, + GPIO_PUSH_BUTTON_EIC_PIN_MUX); + ioport_set_pin_peripheral_mode(GPIO_UNIT_TEST_EIC_PIN, + GPIO_UNIT_TEST_EIC_PIN_MUX); +#else + // Push button as input: already done, it's the default pin state +#endif + +#if (defined CONF_BOARD_BL) + // Configure LCD backlight + ioport_set_pin_dir(LCD_BL_GPIO, IOPORT_DIR_OUTPUT); + ioport_set_pin_level(LCD_BL_GPIO, LCD_BL_INACTIVE_LEVEL); +#endif + +#if (defined CONF_BOARD_USB_PORT) + ioport_set_pin_peripheral_mode(PIN_PA25A_USBC_DM, MUX_PA25A_USBC_DM); + ioport_set_pin_peripheral_mode(PIN_PA26A_USBC_DP, MUX_PA26A_USBC_DP); +# if defined(CONF_BOARD_USB_VBUS_DETECT) +# if defined(USB_VBUS_EIC) + ioport_set_pin_peripheral_mode(USB_VBUS_EIC, + USB_VBUS_EIC_MUX|USB_VBUS_FLAGS); +# elif defined(USB_VBUS_PIN) + ioport_set_pin_dir(USB_VBUS_PIN, IOPORT_DIR_INPUT); +# else +# warning USB_VBUS pin not defined +# endif +# endif +# if defined(CONF_BOARD_USB_ID_DETECT) +# if defined(USB_ID_EIC) + ioport_set_pin_peripheral_mode(USB_ID_EIC, + USB_ID_EIC_MUX|USB_ID_FLAGS); +# elif defined(USB_ID_PIN) + ioport_set_pin_dir(USB_ID_PIN, IOPORT_DIR_INPUT); +# else +# warning USB_ID pin not defined +# endif +# endif +# if defined(CONF_BOARD_USB_VBUS_CONTROL) +# if defined(USB_VBOF_PIN) + ioport_set_pin_dir(USB_VBOF_PIN, IOPORT_DIR_OUTPUT); + ioport_set_pin_level(USB_VBOF_PIN, USB_VBOF_INACTIVE_LEVEL); +# else +# warning USB_VBOF pin not defined +# endif +# if defined(CONF_BOARD_USB_VBUS_ERR_DETECT) +# if defined(USB_VBERR_EIC) + ioport_set_pin_peripheral_mode(USB_VBERR_EIC, + USB_VBERR_EIC_MUX|USB_VBERR_FLAGS); +# elif defined(USB_VBERR_PIN) + ioport_set_pin_dir(USB_VBERR_PIN, IOPORT_DIR_INPUT); +# else +# warning USB_VBERR pin not defined +# endif +# endif +# endif /* !(defined CONF_BOARD_USB_NO_VBUS_CONTROL) */ +#endif /* (defined CONF_BOARD_USB_PORT) */ + +#if defined (CONF_BOARD_COM_PORT) + ioport_set_pin_peripheral_mode(COM_PORT_RX_PIN, COM_PORT_RX_MUX); + ioport_set_pin_peripheral_mode(COM_PORT_TX_PIN, COM_PORT_TX_MUX); +#endif + +#if defined (CONF_BOARD_BM_USART) + ioport_set_pin_peripheral_mode(BM_USART_RX_PIN, BM_USART_RX_MUX); + ioport_set_pin_peripheral_mode(BM_USART_TX_PIN, BM_USART_TX_MUX); +#endif + +#ifdef CONF_BOARD_SPI + ioport_set_pin_peripheral_mode(PIN_PC04A_SPI_MISO, MUX_PC04A_SPI_MISO); + ioport_set_pin_peripheral_mode(PIN_PC05A_SPI_MOSI, MUX_PC05A_SPI_MOSI); + ioport_set_pin_peripheral_mode(PIN_PC06A_SPI_SCK, MUX_PC06A_SPI_SCK); + + #ifdef CONF_BOARD_SPI_NPCS0 + ioport_set_pin_peripheral_mode(PIN_PA02B_SPI_NPCS0, + MUX_PA02B_SPI_NPCS0); + #endif + #ifdef CONF_BOARD_SPI_NPCS2 + ioport_set_pin_peripheral_mode(PIN_PC00A_SPI_NPCS2, + MUX_PC00A_SPI_NPCS2); + #endif + #ifdef CONF_BOARD_SPI_NPCS3 + ioport_set_pin_peripheral_mode(PIN_PC01A_SPI_NPCS3, + MUX_PC01A_SPI_NPCS3); + #endif + +#endif + +#ifdef CONF_BOARD_RS485 + ioport_set_pin_peripheral_mode(RS485_USART_RX_PIN, RS485_USART_RX_MUX); + ioport_set_pin_peripheral_mode(RS485_USART_TX_PIN, RS485_USART_TX_MUX); + ioport_set_pin_peripheral_mode(RS485_USART_RTS_PIN, + RS485_USART_RTS_MUX); + ioport_set_pin_dir(RS485_USART_CTS_PIN, IOPORT_DIR_OUTPUT); + ioport_set_pin_level(RS485_USART_CTS_PIN, IOPORT_PIN_LEVEL_LOW); +#endif + +#ifdef CONF_BOARD_TWIMS1 + ioport_set_pin_peripheral_mode(TWIMS1_TWI_SCL_PIN, TWIMS1_TWI_SCL_MUX); + ioport_set_pin_peripheral_mode(TWIMS1_TWI_SDA_PIN, TWIMS1_TWI_SDA_MUX); +#endif + +#ifdef CONF_BOARD_USART0 + ioport_set_pin_peripheral_mode(USART0_RX_PIN, USART0_RX_MUX); + ioport_set_pin_peripheral_mode(USART0_TX_PIN, USART0_TX_MUX); +#endif + +#ifdef CONF_BOARD_DACC_VOUT + ioport_set_pin_peripheral_mode(DACC_VOUT_PIN, DACC_VOUT_MUX); +#endif + +#ifdef CONF_BOARD_ACIFC + ioport_set_pin_peripheral_mode(PIN_PA06E_ACIFC_ACAN0, MUX_PA06E_ACIFC_ACAN0); + ioport_set_pin_peripheral_mode(PIN_PA07E_ACIFC_ACAP0, MUX_PA07E_ACIFC_ACAP0); +#endif + +#ifdef CONF_BOARD_ABDACB_PORT + ioport_set_pin_peripheral_mode(ABDACB_AUDIO0_PIN, ABDACB_AUDIO0_MUX); + ioport_set_pin_peripheral_mode(ABDACB_AUDIO1_PIN, ABDACB_AUDIO1_MUX); +#endif +} +/** + * @} + */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/boards/sam4l_ek/sam4l_ek.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/boards/sam4l_ek/sam4l_ek.h new file mode 100644 index 000000000..31510b88e --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/boards/sam4l_ek/sam4l_ek.h @@ -0,0 +1,309 @@ +/** + * \file + * + * \brief SAM4L-EK Board header file. + * + * This file contains definitions and services related to the features of the + * SAM4L-EK Board. + * + * To use this board define BOARD=SAM4L_EK. + * + * Copyright (c) 2012 - 2013 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +#ifndef SAM4L_EK_INCLUDED +#define SAM4L_EK_INCLUDED + +#include "compiler.h" + +/** Name of the board */ +#define BOARD_NAME "SAM4L-EK" + +/** + * \defgroup sam4l_ek_group SAM4L-EK Board + * @{ + */ + +/** + * \defgroup sam4l_ek_feature_group Feature definitions + * @{ + */ + +//! \name Miscellaneous data +//@{ +//@} + +//! Osc frequency (Hz.) and startup time (RCOsc periods). +#define FOSC0 (12000000) + +//! Osc32 frequency (Hz.) and startup time (RCOsc periods). +#define FOSC32 (32768) + +/** + * \name Board oscillator configuration + * + */ +//@{ +#define BOARD_OSC32_IS_XTAL true +#define BOARD_OSC32_HZ FOSC32 +#define BOARD_OSC32_STARTUP_US (1100000) +#define BOARD_OSC32_SELCURR BSCIF_OSCCTRL32_SELCURR(10) +#define BOARD_OSC0_IS_XTAL true +#define BOARD_OSC0_HZ FOSC0 +#define BOARD_OSC0_STARTUP_US (1100) +//@} + +/*! \name Number of LEDs. + */ +//! @{ +#define LED_COUNT 1 +//! @} + +/** + * \name LEDs + * + * LED0 is a single yellow LED that is active low. + */ +//@{ +#define LED0 PC10 +#define LED0_GPIO PIN_PC10 +#define LED0_GPIO_MASK GPIO_PC10 +#if defined(SAM4L_EK_REV1) +# define LED0_ACTIVE_LEVEL IOPORT_PIN_LEVEL_LOW +# define LED0_INACTIVE_LEVEL IOPORT_PIN_LEVEL_HIGH +#else +# define LED0_ACTIVE_LEVEL IOPORT_PIN_LEVEL_HIGH +# define LED0_INACTIVE_LEVEL IOPORT_PIN_LEVEL_LOW +#endif +//@} + +/** + * \name LCD Backlight + */ +//@{ +#if defined(SAM4L_EK_REV1) +# define LCD_BL PA02 +# define LCD_BL_GPIO PIN_PA02 +# define LCD_BL_GPIO_MASK GPIO_PA02 +#else +# define LCD_BL PC14 +# define LCD_BL_GPIO PIN_PC14 +# define LCD_BL_GPIO_MASK GPIO_PC14 +#endif +#define LCD_BL_ACTIVE_LEVEL IOPORT_PIN_LEVEL_HIGH +#define LCD_BL_INACTIVE_LEVEL IOPORT_PIN_LEVEL_LOW +//@} + +/*! \name GPIO Connections of Push Buttons + */ +//! @{ +#define GPIO_PUSH_BUTTON_0 PIN_PC03 +#define GPIO_PUSH_BUTTON_0_MASK GPIO_PC03 +#define PUSH_BUTTON_0_DOWN_LEVEL IOPORT_PIN_LEVEL_LOW +#define PUSH_BUTTON_0_UP_LEVEL IOPORT_PIN_LEVEL_HIGH +//! @} + +/*! \name Push Button Connection on External Interrupt line + */ +//! @{ +#define GPIO_PUSH_BUTTON_EIC_PIN PIN_PC03B_EIC_EXTINT5 +#define GPIO_PUSH_BUTTON_EIC_PIN_MASK GPIO_PC03B_EIC_EXTINT5 +#define GPIO_PUSH_BUTTON_EIC_PIN_MUX MUX_PC03B_EIC_EXTINT5 +#define GPIO_PUSH_BUTTON_EIC_LINE 5 + +#define GPIO_UNIT_TEST_EIC_PIN PIN_PA06C_EIC_EXTINT1 +#define GPIO_UNIT_TEST_EIC_PIN_MASK GPIO_PA06C_EIC_EXTINT1 +#define GPIO_UNIT_TEST_EIC_PIN_MUX MUX_PA06C_EIC_EXTINT1 +#define GPIO_UNIT_TEST_EIC_LINE 1 + +#define GPIO_EIC_TRIG_PIN PIN_PB05 +//! @} + + +/*! \name GPIO Connections of Touch sensors + */ +//! @{ +#define GPIO_QTOUCH_SLIDER_0 PIN_PB02 +#define GPIO_QTOUCH_SLIDER_0_MASK GPIO_PB02 +#define GPIO_QTOUCH_SLIDER_0_MUX MUX_PB02G_CATB_SENSE23 +#define GPIO_QTOUCH_SLIDER_1 PIN_PA04 +#define GPIO_QTOUCH_SLIDER_1_MASK GPIO_PA04 +#define GPIO_QTOUCH_SLIDER_1_MUX MUX_PA04G_CATB_SENSE0 +#define GPIO_QTOUCH_SLIDER_2 PIN_PA05 +#define GPIO_QTOUCH_SLIDER_2_MASK GPIO_PA05 +#define GPIO_QTOUCH_SLIDER_2_MUX MUX_PA05G_CATB_SENSE1 +#define GPIO_QTOUCH_DISCHARGE PIN_PB03 +#define GPIO_QTOUCH_DISCHARGE_MASK GPIO_PB03 +#define GPIO_QTOUCH_DISCHARGE_MUX MUX_PB03G_CATB_DIS +#define GPIO_QTOUCH_BUTTON PIN_PB04 +#define GPIO_QTOUCH_BUTTON_MASK GPIO_PB04 +#define GPIO_QTOUCH_BUTTON_MUX MUX_PB04G_CATB_SENSE24 +//! @} + +/*! \name Touch sensors pin assignements + */ +//! @{ +#define QTOUCH_PINSEL_SLIDER_0 23 +#define QTOUCH_PINSEL_SLIDER_1 0 +#define QTOUCH_PINSEL_SLIDER_2 1 +#define QTOUCH_PINSEL_BUTTON 24 +//! @} + +/*! \name GPIO Connections of SAM4L4C VBUS monitoring + */ +//! @{ +#if defined(SAM4L_EK_REV1) +#define USB_VBUS_FLAGS IOPORT_MODE_GLITCH_FILTER +#define USB_VBUS_PIN PIN_PC14 /* As IO pin input */ +/* No EIC for VBus pin */ +#elif 0 // The Vbus monitoring can not be used on SAM4L_EK Rev. 2 +#define USB_VBUS_FLAGS IOPORT_MODE_GLITCH_FILTER +#define USB_VBUS_EIC PIN_PA06C_EIC_EXTINT1 /* As EIC input */ +#define USB_VBUS_EIC_MUX IOPORT_MODE_MUX_C +#define USB_VBUS_EIC_LINE 1 +#define USB_VBUS_EIC_IRQn EIC_1_IRQn +#endif +//! @} + +/*! \name GPIO Connections of SAM4L4C VBUS Power Control + */ +//! @{ +#define USB_VBOF_PIN PIN_PC08 /* As IO pin output */ +#define USB_VBOF_ACTIVE_LEVEL 0 +#define USB_VBOF_INACTIVE_LEVEL 1 +//! @} + +/*! \name GPIO Connections of SAM4L4C VBUS error detecting + */ +//! @{ +#define USB_VBERR_FLAGS IOPORT_MODE_PULLUP | IOPORT_MODE_GLITCH_FILTER +#define USB_VBERR_PIN PIN_PC07 /* As IO pin input */ +/* No EIC for VBErr pin */ +//! @} + +/*! \name GPIO Connections of SAM4L4C ID detecting + */ +//! @{ +#define USB_ID_FLAGS IOPORT_MODE_PULLUP | IOPORT_MODE_GLITCH_FILTER +#define USB_ID_PIN PIN_PB05 /* As IO pin input */ +/* No EIC for ID pin */ +//! @} + + +//! \name USART connections to GPIO for Virtual Com Port +// @{ +#define COM_PORT_USART USART2 +#define COM_PORT_USART_ID ID_USART2 +#define COM_PORT_RX_PIN PIN_PC11B_USART2_RXD +#define COM_PORT_RX_GPIO GPIO_PC11B_USART2_RXD +#define COM_PORT_RX_MUX MUX_PC11B_USART2_RXD +#define COM_PORT_TX_PIN PIN_PC12B_USART2_TXD +#define COM_PORT_TX_GPIO GPIO_PC12B_USART2_TXD +#define COM_PORT_TX_MUX MUX_PC12B_USART2_TXD +// @} + +//! \name USART connections to the Board Monitor +// @{ +#define BM_USART_USART USART0 +#define BM_USART_USART_ID ID_USART0 +#define BM_USART_RX_PIN PIN_PC02C_USART0_RXD +#define BM_USART_RX_GPIO GPIO_PC02C_USART0_RXD +#define BM_USART_RX_MUX MUX_PC02C_USART0_RXD +#define BM_USART_TX_PIN PIN_PA07B_USART0_TXD +#define BM_USART_TX_GPIO GPIO_PA07B_USART0_TXD +#define BM_USART_TX_MUX MUX_PA07B_USART0_TXD +// @} + +//! \name USART connections to the RS485 +// @{ +#define RS485_USART_USART USART0 +#define RS485_USART_USART_ID ID_USART0 +#define RS485_USART_RX_PIN PIN_PC02C_USART0_RXD +#define RS485_USART_RX_GPIO GPIO_PC02C_USART0_RXD +#define RS485_USART_RX_MUX MUX_PC02C_USART0_RXD +#define RS485_USART_TX_PIN PIN_PA07B_USART0_TXD +#define RS485_USART_TX_GPIO GPIO_PA07B_USART0_TXD +#define RS485_USART_TX_MUX MUX_PA07B_USART0_TXD +#define RS485_USART_RTS_PIN PIN_PA06B_USART0_RTS +#define RS485_USART_RTS_GPIO GPIO_PA06B_USART0_RTS +#define RS485_USART_RTS_MUX MUX_PA06B_USART0_RTS +#define RS485_USART_CTS_PIN PIN_PC08E_USART2_CTS +#define RS485_USART_CTS_GPIO GPIO_PC08E_USART2_CTS +#define RS485_USART_CTS_MUX MUX_PC08E_USART2_CTS +// @} + +//! \name TWIMS1 pins +// @{ +#define TWIMS1_TWI_SDA_PIN PIN_PB00A_TWIMS1_TWD +#define TWIMS1_TWI_SDA_GPIO GPIO_PB00A_TWIMS1_TWD +#define TWIMS1_TWI_SDA_MUX MUX_PB00A_TWIMS1_TWD +#define TWIMS1_TWI_SCL_PIN PIN_PB01A_TWIMS1_TWCK +#define TWIMS1_TWI_SCL_GPIO GPIO_PB01A_TWIMS1_TWCK +#define TWIMS1_TWI_SCL_MUX MUX_PB01A_TWIMS1_TWCK +// @} + +//! \name USART0 pins +// @{ +#define USART0_RX_PIN PIN_PC02C_USART0_RXD +#define USART0_RX_MUX MUX_PC02C_USART0_RXD +#define USART0_RX_GPIO GPIO_PC02C_USART0_RXD +#define USART0_TX_PIN PIN_PA07B_USART0_TXD +#define USART0_TX_MUX MUX_PA07B_USART0_TXD +#define USART0_TX_GPIO GPIO_PA07B_USART0_TXD +// @} + +//! \name DACC pins +// @{ +#define DACC_EXT_TRIG0_PIN PIN_PB04E_DACC_EXT_TRIG0 +#define DACC_EXT_TRIG0_GPIO GPIO_PB04E_DACC_EXT_TRIG0 +#define DACC_EXT_TRIG0_MUX MUX_PB04E_DACC_EXT_TRIG0 +#define DACC_VOUT_PIN PIN_PA06A_DACC_VOUT +#define DACC_VOUT_GPIO GPIO_PA06A_DACC_VOUT +#define DACC_VOUT_MUX MUX_PA06A_DACC_VOUT +// @} + +/* Select the SPI module that AT25DFx is connected to */ +#define AT25DFX_SPI_MODULE SPI + +/* Chip select used by AT25DFx components on the SPI module instance */ +#define AT25DFX_CS 2 + +/** + * @} + */ + +#endif /* SAM4L_EK_INCLUDED */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/ast/ast.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/ast/ast.c new file mode 100644 index 000000000..ef1fbed45 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/ast/ast.c @@ -0,0 +1,820 @@ +/** + * \file + * + * \brief AST driver for SAM. + * + * Copyright (C) 2012-2013 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#include "ast.h" +#include "sysclk.h" +#include "sleepmgr.h" +#include "conf_ast.h" + +/** + * \internal + * \brief AST callback function pointer array + */ +ast_callback_t ast_callback_pointer[AST_INTERRUPT_SOURCE_NUM]; + +/** + * \brief Check the status of AST. + * + * \param ast Base address of the AST. + * + * \return true If AST is enabled, else it will return false. + */ +bool ast_is_enabled(Ast *ast) +{ + while (ast_is_busy(ast)) { + } + return ((ast->AST_CR & AST_CR_EN) != 0); +} + +/** + * \brief Enable the AST. + * + * \param ast Base address of the AST. + */ +void ast_enable(Ast *ast) +{ + sysclk_enable_peripheral_clock(ast); + sleepmgr_lock_mode(SLEEPMGR_BACKUP); +} + +/** + * \brief Disable the AST. It also disables the AST module. + * + * \param ast Base address of the AST. + */ +void ast_disable(Ast *ast) +{ + /* Wait until the ast CTRL register is up-to-date */ + while (ast_is_busy(ast)) { + } + /* Disable the AST */ + ast->AST_CR &= ~(AST_CR_EN); + /* Wait until write is done */ + while (ast_is_busy(ast)) { + } + + sysclk_disable_peripheral_clock(ast); + sleepmgr_unlock_mode(SLEEPMGR_BACKUP); +} + +/** + * \brief This function enables the option to clear the counter on AST alarm. + * + * \param ast Base address of the AST. + * \param alarm_channel AST Alarm Channel. + */ +void ast_enable_counter_clear_on_alarm(Ast *ast, + uint8_t alarm_channel) +{ + /* Wait until the ast CTRL register is up-to-date */ + while (ast_is_busy(ast)) { + } + /* Enable Clear Counter on Alarm */ + ast->AST_CR + |= (alarm_channel ? 0 : AST_CR_CA0); + /* Wait until write is done */ + while (ast_is_busy(ast)) { + } +} + +/** + * \brief This function clears the AST periodic prescalar counter to zero. + * + * \param ast Base address of the AST. + */ +void ast_clear_prescalar(Ast *ast) +{ + /* Wait until the ast CTRL register is up-to-date */ + while (ast_is_busy(ast)) { + } + /* Clear Counter on Alarm */ + ast->AST_CR |= AST_CR_PCLR; + /* Wait until write is done */ + while (ast_is_busy(ast)) { + } +} + +/** + * \brief This function will initialize the AST module in + * calendar or counter Mode. It then enables the AST module. + * + * \note If you use the 32 KHz oscillator, it will enable this module. + * + * \param ast Base address of the AST. + * \param ast_conf The AST configuration + * + * \return 1 if the initialization succeeds otherwise it will return 0. + */ +uint32_t ast_set_config(Ast *ast, struct ast_config *ast_conf) +{ + uint32_t time_out = AST_POLL_TIMEOUT; + while (ast_is_clkbusy(ast)) { + if (--time_out == 0) { + return 0; + } + } + ast->AST_CLOCK = ast_conf->osc_type << AST_CLOCK_CSSEL_Pos; + time_out = AST_POLL_TIMEOUT; + while (ast_is_clkbusy(ast)) { + if (--time_out == 0) { + return 0; + } + } + ast->AST_CLOCK |= AST_CLOCK_CEN; + time_out = AST_POLL_TIMEOUT; + while (ast_is_clkbusy(ast)) { + if (--time_out == 0) { + return 0; + } + } + /* Set the new AST configuration */ + if (ast_conf->mode == AST_CALENDAR_MODE) { + ast->AST_CR = AST_CR_CAL | ast_conf->psel << AST_CR_PSEL_Pos; + } + + if (ast_conf->mode == AST_COUNTER_MODE) { + ast->AST_CR = ast_conf->psel << AST_CR_PSEL_Pos; + } + + /* Wait until the ast CTRL register is up-to-date */ + while (ast_is_busy(ast)) { + } + + /* Set the calendar */ + if (ast_conf->mode == AST_CALENDAR_MODE) { + ast_write_calendar_value(ast, ast_conf->calendar); + } + + if (ast_conf->mode == AST_COUNTER_MODE) { + ast_write_counter_value(ast, ast_conf->counter); + } + + /* Wait until the ast CTRL register is up-to-date */ + while (ast_is_busy(ast)) { + } + /* Enable the AST */ + ast->AST_CR |= AST_CR_EN; + /* Wait until write is done */ + while (ast_is_busy(ast)) { + } + + return 1; +} + +/** + * \brief Function to tune the AST prescalar frequency to the desired frequency + * + * \param ast Base address of the AST. + * \param input_freq Prescaled AST Clock Frequency + * \param tuned_freq Desired AST frequency + * + * \retval 0 If invalid frequency is passed + * \retval 1 If configuration succeeds + * + * \note Parameter Calculation: + * Formula: \n + * ADD=0 -> ft= fi(1 - (1/((div_ceil(256/value) * (2^exp)) + 1))) \n + * ADD=1 -> ft= fi(1 + (1/((div_ceil(256/value) * (2^exp)) - 1))) \n + * Specifications: \n + * exp > 0, value > 1 \n + * Let X = (2 ^ exp), Y = div_ceil(256 / value) \n + * Tuned Frequency -> ft \n + * Input Frequency -> fi \n + * + * IF ft < fi \n + * ADD = 0 \n + * Z = (ft / (fi - ft)) \n + * ELSE IF ft > fi \n + * ADD = 1 \n + * Z = (ft / (ft - fi)) \n + * ELSE \n + * exit function -> Tuned Frequency = Input Frequency \n + * + * The equation can be reduced to (X * Y) = Z + * + * Frequency Limits \n + * (1/((div_ceil(256/value) * (2^exp)) + 1)) should be min to get the lowest + * possible output from Digital Tuner.\n + * (1/((div_ceil(256/value) * (2^exp)) - 1)) should be min to get the highest + * possible output from Digital Tuner.\n + * For that, div_ceil(256/value) & (2^exp) should be minimum \n + * min (EXP) = 1 (Note: EXP > 0) \n + * min (div_ceil(256/value)) = 2 \n + * max (Ft) = (4*fi)/3 \n + * min (Ft) = (4*fi)/5 \n + * + * Using the above details, X & Y that will closely satisfy the equation is + * found in this function. + */ +uint32_t ast_configure_digital_tuner(Ast *ast, + uint32_t input_freq, uint32_t tuned_freq) +{ + bool add; + uint8_t value; + uint8_t exp; + uint32_t x, y, z; + uint32_t diff; + if (tuned_freq < input_freq) { + /* Check for Frequency Limit */ + if (tuned_freq < ((4 * input_freq) / 5)) { + return 0; + } + + /* Set the ADD to 0 when freq less than input freq */ + add = false; + /* Calculate the frequency difference */ + diff = input_freq - tuned_freq; + } else if (tuned_freq > input_freq) { + /* Check for Frequency Limit */ + if (tuned_freq > ((4 * input_freq) / 3)) { + return 0; + } + + /* Set the ADD to 1 when freq greater than input freq */ + add = true; + /* Calculate the frequency difference */ + diff = tuned_freq - input_freq; + } else { + /* required & input freq are equal */ + return 1; + } + + z = (tuned_freq) / (diff); + if ((tuned_freq % diff) > (diff / 2)) { + z++; + } + + /* + * Initialize with minimum possible values. + * exp value should be greater than zero, min(exp) = 1 -> min(x)= (2^1) + * = 2 + * y should be greater than one -> div_ceil(256/value) where value- 0 to + * 255 + * min(y) = div_ceil(256/255) = 2 + */ + y = 2; + x = 2; + exp = 1; + + /* + * Keep exp constant and increase y value until it reaches its limit. + * Increment exp and follow the same steps until we found the closest + * possible match for the required frequency. + */ + do { + if (y < 255) { + y++; + } else { + x = x << 1; + y = 2; + exp++; + } + } while (z > (x * y)); + /* Decrement y value after exit from loop */ + y = y - 1; + /* Find VALUE from y */ + value = div_ceil(256, y); + /* Initialize the Digital Tuner using the required parameters */ + ast_init_digital_tuner(ast, add, value, exp); + return 1; +} + +/** + * \brief This function will initialize the digital tuner of AST module. + * + * \param ast Base address of the AST. + * \param add set to true if frequency has to be increased, false if it + * has to be decreased. + * \param value Parameter used in the formula + * \param exp Parameter used in the formula + * + * \return 1 if the initialization succeeds otherwise it will return 0. + */ +void ast_init_digital_tuner(Ast *ast, bool add, + uint8_t value, uint8_t exp) +{ + /* Wait until the ast CTRL register is up-to-date */ + while (ast_is_busy(ast)) { + } + + if (add) { + ast->AST_DTR = AST_DTR_ADD | AST_DTR_VALUE(value) | AST_DTR_EXP( + exp); + } else { + ast->AST_DTR = AST_DTR_VALUE(value) | AST_DTR_EXP(exp); + } + + /* Wait until the ast CTRL register is up-to-date */ + while (ast_is_busy(ast)) { + } +} + +/** + * \brief This function will disable the digital tuner of AST module. + * + * \param ast Base address of the AST. + */ +void ast_disable_digital_tuner(Ast *ast) +{ + /* Wait until the ast CTRL register is up-to-date */ + while (ast_is_busy(ast)) { + } + ast->AST_DTR &= ~(AST_DTR_VALUE_Msk); + /* Wait until the ast CTRL register is up-to-date */ + while (ast_is_busy(ast)) { + } +} + +/** + * \brief This function sets the AST current calendar value. + * + * \param ast Base address of the AST. + * \param ast_calendar Startup date + */ +void ast_write_calendar_value(Ast *ast, + struct ast_calendar calendar) +{ + /* Wait until we can write into the VAL register */ + while (ast_is_busy(ast)) { + } + /* Set the new val value */ + ast->AST_CALV = calendar.field; + /* Wait until write is done */ + while (ast_is_busy(ast)) { + } +} + +/** + * \brief This function sets the AST current counter value. + * + * \param ast Base address of the AST. + * \param ast_counter Startup counter value + */ +void ast_write_counter_value(Ast *ast, + uint32_t ast_counter) +{ + /* Wait until we can write into the VAL register */ + while (ast_is_busy(ast)) { + } + /* Set the new val value */ + ast->AST_CV = ast_counter; + /* Wait until write is done */ + while (ast_is_busy(ast)) { + } +} + +/** + * \brief This function returns the AST current calendar value. + * + * \param ast Base address of the AST. + * + * \return The AST current calendar value. + */ +struct ast_calendar ast_read_calendar_value(Ast *ast) +{ + struct ast_calendar calendar; + calendar.field = ast->AST_CALV; + return calendar; +} + +/** + * \brief This function set the AST alarm0 value. + * + * \param ast Base address of the AST. + * \param alarm_value AST alarm0 value. + */ +void ast_write_alarm0_value(Ast *ast, uint32_t alarm_value) +{ + /* Wait until the ast CTRL register is up-to-date */ + while (ast_is_busy(ast)) { + } + /* Set the new alarm0 compare value */ + ast->AST_AR0 = alarm_value; + /* Wait until write is done */ + while (ast_is_busy(ast)) { + } +} + +/** + * \brief This function set the AST periodic0 value. + * + * \param ast Base address of the AST. + * \param pir AST periodic0. + */ +void ast_write_periodic0_value(Ast *ast, uint32_t pir) +{ + /* Wait until the ast CTRL register is up-to-date */ + while (ast_is_busy(ast)) { + } + /* Set the periodic prescaler value */ + ast->AST_PIR0 = pir; + /* Wait until write is done */ + while (ast_is_busy(ast)) { + } +} + +/** + * \brief This function enables the AST interrupts + * + * \param ast Base address of the AST. + * \param source AST Interrupts to be enabled + */ +void ast_enable_interrupt(Ast *ast, ast_interrupt_source_t source) +{ + /* Wait until the ast CTRL register is up-to-date */ + while (ast_is_busy(ast)) { + } + + switch (source) { + case AST_INTERRUPT_ALARM: + ast->AST_IER = AST_IER_ALARM0_1; + break; + + case AST_INTERRUPT_PER: + ast->AST_IER = AST_IER_PER0_1; + break; + + case AST_INTERRUPT_OVF: + ast->AST_IER = AST_IER_OVF_1; + break; + + case AST_INTERRUPT_READY: + ast->AST_IER = AST_IER_READY_1; + break; + + case AST_INTERRUPT_CLKREADY: + ast->AST_IER = AST_IER_CLKRDY_1; + break; + + default: + break; + } + + /* Wait until write is done */ + while (ast_is_busy(ast)) { + } +} + +/** + * \brief This function disables the AST interrupts. + * + * \param ast Base address of the AST. + * \param source AST Interrupts to be disabled + */ +void ast_disable_interrupt(Ast *ast, ast_interrupt_source_t source) +{ + /* Wait until the ast CTRL register is up-to-date */ + while (ast_is_busy(ast)) { + } + + switch (source) { + case AST_INTERRUPT_ALARM: + ast->AST_IDR = AST_IDR_ALARM0_1; + break; + + case AST_INTERRUPT_PER: + ast->AST_IDR = AST_IDR_PER0_1; + break; + + case AST_INTERRUPT_OVF: + ast->AST_IDR = AST_IDR_OVF_1; + break; + + case AST_INTERRUPT_READY: + ast->AST_IDR = AST_IDR_READY_1; + break; + + case AST_INTERRUPT_CLKREADY: + ast->AST_IDR = AST_IDR_CLKRDY_1; + break; + + default: + break; + } + + /* Wait until write is done */ + while (ast_is_busy(ast)) { + } +} + +/** + * \brief This function clears the AST status flags. + * + * \param ast Base address of the AST. + * \param source AST status flag to be cleared + */ +void ast_clear_interrupt_flag(Ast *ast, ast_interrupt_source_t source) +{ + /* Wait until the ast CTRL register is up-to-date */ + while (ast_is_busy(ast)) { + } + + switch (source) { + case AST_INTERRUPT_ALARM: + ast->AST_SCR = AST_SCR_ALARM0; + break; + + case AST_INTERRUPT_PER: + ast->AST_SCR = AST_SCR_PER0; + break; + + case AST_INTERRUPT_OVF: + ast->AST_SCR = AST_SCR_OVF; + break; + + case AST_INTERRUPT_READY: + ast->AST_SCR = AST_SCR_READY; + break; + + case AST_INTERRUPT_CLKREADY: + ast->AST_SCR = AST_SCR_CLKRDY; + break; + + default: + break; + } + + /* Wait until write is done */ + while (ast_is_busy(ast)) { + } +} + +/** + * \brief Set callback for AST + * + * \param ast Base address of the AST. + * \param source AST interrupt source. + * \param callback callback function pointer. + * \param irq_line interrupt line. + * \param irq_level interrupt level. + */ +void ast_set_callback(Ast *ast, ast_interrupt_source_t source, + ast_callback_t callback, uint8_t irq_line, uint8_t irq_level) +{ + ast_callback_pointer[source] = callback; + NVIC_ClearPendingIRQ((IRQn_Type)irq_line); + NVIC_SetPriority((IRQn_Type)irq_line, irq_level); + NVIC_EnableIRQ((IRQn_Type)irq_line); + ast_enable_interrupt(ast, source); +} + +/** + * \brief Interrupt handler for AST. + */ +void ast_interrupt_handler(void) +{ + uint32_t status, mask; + + status = ast_read_status(AST); + mask = ast_read_interrupt_mask(AST); + + if ((status & AST_SR_ALARM0) && (mask & AST_IMR_ALARM0)) { + ast_callback_pointer[AST_INTERRUPT_ALARM](); + } + + if ((status & AST_SR_PER0) && (mask & AST_IMR_PER0)) { + ast_callback_pointer[AST_INTERRUPT_PER](); + } + + if ((status & AST_SR_OVF) && (mask & AST_IMR_OVF_1)) { + ast_callback_pointer[AST_INTERRUPT_OVF](); + } + + if ((status & AST_SR_READY) && (mask & AST_IMR_READY_1)) { + ast_callback_pointer[AST_INTERRUPT_READY](); + } + + if ((status & AST_SR_CLKRDY) && (mask & AST_IMR_CLKRDY_1)) { + ast_callback_pointer[AST_INTERRUPT_CLKREADY](); + } +} + +/** + * \brief Interrupt handler for AST periodic. + */ +#ifdef AST_PER_ENABLE +void AST_PER_Handler(void) +{ + ast_interrupt_handler(); +} +#endif + +/** + * \brief Interrupt handler for AST alarm. + */ +#ifdef AST_ALARM_ENABLE +void AST_ALARM_Handler(void) +{ + ast_interrupt_handler(); +} + +#endif + +/** + * \brief Interrupt handler for AST periodic. + */ +#ifdef AST_OVF_ENABLE +void AST_OVF_Handler(void) +{ + ast_interrupt_handler(); +} + +#endif + +/** + * \brief Interrupt handler for AST alarm. + */ +#ifdef AST_READY_ENABLE +void AST_READY_Handler(void) +{ + ast_interrupt_handler(); +} + +#endif + +/** + * \brief Interrupt handler for AST periodic. + */ +#ifdef AST_CLKREADY_ENABLE +void AST_CLKREADY_Handler(void) +{ + ast_interrupt_handler(); +} + +#endif + +/** + * \brief This function enables the AST Asynchronous wake-up. + * + * \param ast Base address of the AST. + * \param source AST wake-up flag to be enabled. + */ +void ast_enable_wakeup(Ast *ast, ast_wakeup_source_t source) +{ + /* Wait until the ast CTRL register is up-to-date */ + while (ast_is_busy(ast)) { + } + + switch (source) { + case AST_WAKEUP_ALARM: + ast->AST_WER |= AST_WER_ALARM0_1; + break; + + case AST_WAKEUP_PER: + ast->AST_WER |= AST_WER_PER0_1; + break; + + case AST_WAKEUP_OVF: + ast->AST_WER |= AST_WER_OVF_1; + break; + + default: + break; + } + + /* Wait until write is done */ + while (ast_is_busy(ast)) { + } +} + +/** + * \brief This function disables the AST Asynchronous wake-up. + * 8 + * \param ast Base address of the AST. + * \param source AST wake-up flag to be disabled. + */ +void ast_disable_wakeup(Ast *ast, ast_wakeup_source_t source) +{ + /* Wait until the ast CTRL register is up-to-date */ + while (ast_is_busy(ast)) { + } + + switch (source) { + case AST_WAKEUP_ALARM: + ast->AST_WER &= ~AST_WER_ALARM0_1; + break; + + case AST_WAKEUP_PER: + ast->AST_WER &= ~AST_WER_PER0_1; + break; + + case AST_WAKEUP_OVF: + ast->AST_WER &= ~AST_WER_OVF_1; + break; + + default: + break; + } + + /* Wait until write is done */ + while (ast_is_busy(ast)) { + } +} + +/** + * \brief This function enables the AST event. + * + * \param ast Base address of the AST. + * \param source AST event flag to be enabled. + */ +void ast_enable_event(Ast *ast, ast_event_source_t source) +{ + /* Wait until the ast CTRL register is up-to-date */ + while (ast_is_busy(ast)) { + } + + switch (source) { + case AST_EVENT_ALARM: + ast->AST_EVE = AST_EVE_ALARM0; + break; + + case AST_EVENT_PER: + ast->AST_EVE = AST_EVE_PER0; + break; + + case AST_EVENT_OVF: + ast->AST_EVE = AST_EVE_OVF; + break; + + default: + break; + } + + /* Wait until write is done */ + while (ast_is_busy(ast)) { + } +} + +/** + * \brief This function disables the AST event. + * + * \param ast Base address of the AST. + * \param source AST event flag to be disabled. + */ +void ast_disable_event(Ast *ast, ast_event_source_t source) +{ + /* Wait until the ast CTRL register is up-to-date */ + while (ast_is_busy(ast)) { + } + + switch (source) { + case AST_EVENT_ALARM: + ast->AST_EVD = AST_EVD_ALARM0; + break; + + case AST_EVENT_PER: + ast->AST_EVD = AST_EVD_PER0; + break; + + case AST_EVENT_OVF: + ast->AST_EVD = AST_EVD_OVF; + break; + + default: + break; + } + + /* Wait until write is done */ + while (ast_is_busy(ast)) { + } +} diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/ast/ast.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/ast/ast.h new file mode 100644 index 000000000..60b033d1a --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/ast/ast.h @@ -0,0 +1,356 @@ +/** + * \file + * + * \brief AST driver for SAM. + * + * Copyright (C) 2012-2013 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#ifndef AST_H_INCLUDED +#define AST_H_INCLUDED + +/** + * \defgroup group_sam_drivers_ast AST - Asynchronous Timer + * + * Driver for the AST (Asynchronous Timer). + * Provides functions for configuring and operating the AST in the calendar or + * timer/counter modes. + * + * \{ + */ + +#include "compiler.h" + +/// @cond 0 */ +/**INDENT-OFF**/ +#ifdef __cplusplus +extern "C" { +#endif +/**INDENT-ON**/ +/// @endcond */ + +/** Timeout to prevent code hang in clock initialization */ +#define AST_POLL_TIMEOUT 10000 + +/** \name Predefined PSEL Values + */ +/* @{ */ + +/** + * The PSEL value to set the AST source clock (after the prescaler) to 1 Hz, + * when using an external 32-kHz crystal. + */ +#define AST_PSEL_32KHZ_1HZ 14 + +/** + * The PSEL value to set the AST source clock (after the prescaler) + * to 1.76 Hz when using the internal RC oscillator (~ 115 kHz) + */ +#define AST_PSEL_RC_1_76HZ 15 + +/* @} */ + +/* Description for Calendar Field.*/ +struct ast_calv { + uint32_t sec : 6; + uint32_t min : 6; + uint32_t hour : 5; + uint32_t day : 5; + uint32_t month : 4; + uint32_t year : 6; +}; + +/* Input when initializing AST in calendar mode.*/ +struct ast_calendar { + union { + uint32_t field; + struct ast_calv FIELD; + }; +}; + +typedef enum ast_mode { + AST_COUNTER_MODE = 0, + AST_CALENDAR_MODE = 1, +} ast_mode_t; + +typedef enum ast_oscillator_type { + AST_OSC_RC = 0, + AST_OSC_32KHZ = 1, + AST_OSC_PB = 2, + AST_OSC_GCLK = 3, + AST_OSC_1KHZ = 4, +} ast_oscillator_type_t; + +#define AST_INTERRUPT_SOURCE_NUM 5 +typedef enum ast_interrupt_source { + AST_INTERRUPT_ALARM = 0, + AST_INTERRUPT_PER, + AST_INTERRUPT_OVF, + AST_INTERRUPT_READY, + AST_INTERRUPT_CLKREADY, +} ast_interrupt_source_t; + +typedef enum ast_wakeup_source { + AST_WAKEUP_ALARM = 0, + AST_WAKEUP_PER, + AST_WAKEUP_OVF, +} ast_wakeup_source_t; + +typedef enum ast_event_source { + AST_EVENT_ALARM = 0, + AST_EVENT_PER, + AST_EVENT_OVF, +} ast_event_source_t; + +struct ast_config { + /* + * Mode: Calendar mode: + * \ref AST_CALENDAR_MODE or + * \ref Counter mode: AST_COUNTER_MODE. + */ + ast_mode_t mode; + /* Oscillator type */ + ast_oscillator_type_t osc_type; + /* Prescaler Value. */ + uint8_t psel; + /* Initial counter Value. */ + uint32_t counter; + /* Initial calendar Value. */ + struct ast_calendar calendar; +}; + +typedef void (*ast_callback_t)(void); + +bool ast_is_enabled(Ast *ast); + +void ast_enable(Ast *ast); +void ast_disable(Ast *ast); + +uint32_t ast_set_config(Ast *ast, struct ast_config *ast_conf); +void ast_set_callback(Ast *ast, ast_interrupt_source_t source, + ast_callback_t callback, uint8_t irq_line, uint8_t irq_level); +uint32_t ast_configure_digital_tuner(Ast *ast, uint32_t input_freq, + uint32_t tuned_freq); +void ast_init_digital_tuner(Ast *ast, bool add, uint8_t value, + uint8_t exp); +void ast_disable_digital_tuner(Ast *ast); + +void ast_write_calendar_value(Ast *ast, struct ast_calendar ast_calendar); +struct ast_calendar ast_read_calendar_value(Ast *ast); +void ast_write_counter_value(Ast *ast, uint32_t ast_counter); +void ast_enable_counter_clear_on_alarm(Ast *ast, uint8_t alarm_channel); +void ast_clear_prescalar(Ast *ast); + +/** + * \brief This function returns the AST current counter value. + * + * \param ast Base address of the AST. + * + * \return The AST current counter value. + */ +static inline uint32_t ast_read_counter_value(Ast *ast) +{ + return ast->AST_CV; +} + +/** + * \brief Check the busy status of AST clock + * + * \param ast Base address of the AST. + * + * \return 1 If AST clock is busy, else it will return 0. + */ +static inline bool ast_is_clkbusy(Ast *ast) +{ + return (ast->AST_SR & AST_SR_CLKBUSY) != 0; +} + +/** + * \brief Check the busy status of AST. + * + * \param ast Base address of the AST. + * + * \return 1 If AST is busy, else it will return 0. + */ +static inline bool ast_is_busy(Ast *ast) +{ + return (ast->AST_SR & AST_SR_BUSY) != 0; +} + +/** + * \brief Get status of AST. + * + * \param ast Base address of the AST (i.e. Ast). + * + * \return status of AST. + */ +static inline uint32_t ast_read_status(Ast *ast) +{ + return ast->AST_SR; +} + +/** + * \brief This function return the AST interrupts mask value. + * + * \param ast Base address of the AST. + * + * \return Interrupt mask value + */ +static inline uint32_t ast_read_interrupt_mask(Ast *ast) +{ + return ast->AST_IMR; +} + +void ast_write_alarm0_value(Ast *ast, uint32_t alarm_value); +void ast_write_periodic0_value(Ast *ast, uint32_t pir); + +void ast_enable_interrupt(Ast *ast, ast_interrupt_source_t source); +void ast_disable_interrupt(Ast *ast, ast_interrupt_source_t source); +void ast_clear_interrupt_flag(Ast *ast, ast_interrupt_source_t source); + +void ast_enable_wakeup(Ast *ast, ast_wakeup_source_t source); +void ast_disable_wakeup(Ast *ast, ast_wakeup_source_t source); + +void ast_enable_event(Ast *ast, ast_event_source_t source); +void ast_disable_event(Ast *ast, ast_event_source_t source); + +/// @cond 0 */ +/**INDENT-OFF**/ +#ifdef __cplusplus +} +#endif +/**INDENT-ON**/ +/// @endcond */ + +/** + * \} + */ + +/** + * \page sam_ast_quick_start Quick Start Guide for the AST driver + * + * This is the quick start guide for the \ref group_sam_drivers_ast, with + * step-by-step instructions on how to configure and use the driver for + * a specific use case.The code examples can be copied into e.g the main + * application loop or any other function that will need to control the + * AST module. + * + * \section ast_qs_use_cases Use cases + * - \ref ast_basic + * + * \section ast_basic AST basic usage + * + * This use case will demonstrate how to initialize the AST module to + * calendar or counter mode. + * + * + * \section ast_basic_setup Setup steps + * + * \subsection ast_basic_prereq Prerequisites + * + * This module requires the following service + * - \ref clk_group + * + * \subsection ast_basic_setup_code + * + * Add this to the main loop or a setup function: + * \code + * osc_priv_enable_osc32(); + * \endcode + * + * \subsection ast_basic_setup_workflow + * + * -# Enable the AST module + * - \code ast_enable(AST); \endcode + * -# Initialize the AST to counter mode + * - \code + * struct ast_config ast_conf; + * ast_conf.mode = AST_COUNTER_MODE; + * ast_conf.osc_type = AST_OSC_32KHZ; + * ast_conf.psel = AST_PSEL_32KHZ_1HZ; + * ast_conf.counter = 0; + * ast_set_config(AST, &ast_conf) + * \endcode + * -# Or initialize the AST to calendar mode + * - \code + * struct ast_calendar calendar; + * struct ast_config ast_conf; + * calendar.FIELD.sec = 0; + * calendar.FIELD.min = 15; + * calendar.FIELD.hour = 12; + * calendar.FIELD.day = 20; + * calendar.FIELD.month = 9; + * calendar.FIELD.year = 12; + * struct ast_config ast_conf; + * ast_conf.mode = AST_CALENDAR_MODE; + * ast_conf.osc_type = AST_OSC_32KHZ; + * ast_conf.psel = AST_PSEL_32KHZ_1HZ; + * ast_conf.calendar = calendar; + * ast_set_config(AST, &ast_conf) + * \endcode + * - \note We need to set the clock after prescaler to 1HZ. + * + * + * \section ast_basic_usage Usage steps + * + * \subsection ast_basic_usage_code + * + * We can get the calendar value by + * \code + * calendar = ast_read_calendar_value(AST); + * \endcode + * Or we can get the counter value by + * \code + * ast_counter = ast_read_counter_value(AST); + * \endcode + * + * We can set the alarm interrupt by + * \code + * ast_write_alarm0_value(AST, calendar.field + 1); + * ast_set_callback(AST, ast_interrupt_alarm, ast_alarm_callback, + * AST_ALARM_IRQn, 1); + * \endcode + * And we can set the periodic interrupt by + * \code + * ast_write_periodic0_value(AST, AST_PSEL_32KHZ_1HZ - 4); + * ast_set_callback(AST, ast_interrupt_per, ast_per_callback, + * AST_PER_IRQn, 1); + * \endcode + */ + +#endif /* AST_H_INCLUDED */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/bpm/bpm.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/bpm/bpm.c new file mode 100644 index 000000000..407034ec3 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/bpm/bpm.c @@ -0,0 +1,298 @@ +/** + * \file + * + * \brief BPM driver + * + * Copyright (c) 2012 - 2013 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#include "compiler.h" +#include "bpm.h" + +RAMFUNC bool bpm_ps_no_halt_exec(Bpm *bpm, uint32_t pmcon); +/** + * \brief Execute Power Scaling No Halt with a delay loop + * + * \note SysTick is used to check timeout. + * + * \param bpm BPM register base + * \param pmcon BPM_PMCON value to write + * + * \return PSOK status, true if set. + */ +RAMFUNC bool bpm_ps_no_halt_exec(Bpm *bpm, uint32_t pmcon) +{ + bool b_psok = false; + bool b_timeout = false; + BPM_UNLOCK(PMCON); + bpm->BPM_PMCON = pmcon; + do { + b_psok = (BPM->BPM_SR & BPM_SR_PSOK); + b_timeout = (SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk); + } while (!b_psok && !b_timeout); + return b_psok; +} + + +bool bpm_power_scaling_cpu_failsafe(Bpm *bpm, uint32_t ps_value, + uint32_t timeout) +{ + uint32_t pmcon = 0; + + /* Read last PM_CON value */ + pmcon = bpm->BPM_PMCON; + + /* Clear last PS Value & Write new one */ + pmcon &= ~BPM_PMCON_PS_Msk; + pmcon |= BPM_PMCON_PS(ps_value); + + /* Set PSCM Value: PS change no halt */ + pmcon |= BPM_PMCON_PSCM; + + /* Power Scaling Change Request */ + pmcon |= BPM_PMCON_PSCREQ; + + /* Execute power scaling no halt in RAM */ + irqflags_t flags; + bool b_psok; + uint32_t ctrl, load, val; + /* Avoid interrupt while flash halt */ + flags = cpu_irq_save(); + + /* Save SysTick */ + val = SysTick->VAL; + ctrl = SysTick->CTRL; + load = SysTick->LOAD; + /* Setup SysTick & start counting */ + SysTick->LOAD = timeout; + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk; + + b_psok = bpm_ps_no_halt_exec(bpm, pmcon); + + /* Restore SysTick */ + SysTick->CTRL = 0; + SysTick->LOAD = load; + SysTick->VAL = val; + SysTick->CTRL = ctrl; + + cpu_irq_restore(flags); + return b_psok; +} + +void bpm_power_scaling_cpu(Bpm *bpm, uint32_t ps_value) +{ + uint32_t pmcon = 0; + /* Read last PM_CON value */ + pmcon = bpm->BPM_PMCON; + /* Clear last PS Value */ + pmcon &= ~BPM_PMCON_PS_Msk; + /* Write new PS Value */ + pmcon |= BPM_PMCON_PS(ps_value); + /* PSCM: without CPU halt */ + pmcon |= BPM_PMCON_PSCM; + /* Power Scaling Change Request */ + pmcon |= BPM_PMCON_PSCREQ; + /* Unlock PMCON register */ + BPM_UNLOCK(PMCON); + /* Write back PM_CON value */ + bpm->BPM_PMCON = pmcon; +} + +void bpm_enable_fast_wakeup(Bpm *bpm) +{ + uint32_t pmcon = bpm->BPM_PMCON | BPM_PMCON_FASTWKUP; + BPM_UNLOCK(PMCON); + bpm->BPM_PMCON = pmcon; +} + +void bpm_disable_fast_wakeup(Bpm *bpm) +{ + uint32_t pmcon = bpm->BPM_PMCON & (~BPM_PMCON_FASTWKUP); + BPM_UNLOCK(PMCON); + bpm->BPM_PMCON = pmcon; +} + +void bpm_set_clk32_source(Bpm *bpm, uint32_t source) +{ + uint32_t pmcon; + + /* Read PMCON first */ + pmcon = bpm->BPM_PMCON; + if (source == BPM_CLK32_SOURCE_OSC32K) { + /* Clear CK32S for OSC32K */ + pmcon &= ~BPM_PMCON_CK32S; + } else { + /* Set CK32S for RC32K */ + pmcon |= BPM_PMCON_CK32S; + } + + /* Unlock PMCON register */ + BPM_UNLOCK(PMCON); + bpm->BPM_PMCON = pmcon; +} + +uint32_t bpm_get_backup_wakeup_cause(Bpm *bpm) +{ + return bpm->BPM_BKUPWCAUSE; +} + +void bpm_enable_wakeup_source(Bpm *bpm, uint32_t sources) +{ + /* Write BKUPWEN value */ + bpm->BPM_BKUPWEN |= sources; +} + +void bpm_disable_wakeup_source(Bpm *bpm, uint32_t sources) +{ + /* Write BKUPWEN value */ + bpm->BPM_BKUPWEN &= ~sources; +} + +void bpm_enable_backup_pin(Bpm *bpm, uint32_t backup_pins) +{ + /* Write back BKUPPMUX value */ + bpm->BPM_BKUPPMUX |= backup_pins; +} + +void bpm_disable_backup_pin(Bpm *bpm, uint32_t backup_pins) +{ + /* Write back BKUPPMUX value */ + bpm->BPM_BKUPPMUX &= ~backup_pins; +} + +void bpm_enable_io_retention(Bpm *bpm) +{ + bpm->BPM_IORET |= BPM_IORET_RET; +} + +void bpm_disable_io_retention(Bpm *bpm) +{ + bpm->BPM_IORET &= ~BPM_IORET_RET; +} + +void bpm_enable_interrupt(Bpm *bpm, uint32_t sources) +{ + bpm->BPM_IER = sources; +} + +void bpm_disable_interrupt(Bpm *bpm, uint32_t sources) +{ + bpm->BPM_IDR = sources; +} + +uint32_t bpm_get_interrupt_mask(Bpm *bpm) +{ + return bpm->BPM_IMR; +} + +uint32_t bpm_get_interrupt_status(Bpm *bpm) +{ + return bpm->BPM_ISR; +} + +void bpm_clear_interrupt(Bpm *bpm, uint32_t sources) +{ + bpm->BPM_ICR = sources; +} + +uint32_t bpm_get_status(Bpm *bpm) +{ + return bpm->BPM_SR; +} + +uint32_t bpm_get_version(Bpm *bpm) +{ + return bpm->BPM_VERSION; +} + +void bpm_sleep(Bpm *bpm, uint32_t sleep_mode) +{ + uint32_t pmcon; + + /* Read PMCON register */ + pmcon = bpm->BPM_PMCON; + pmcon &= ~BPM_PMCON_BKUP; + pmcon &= ~BPM_PMCON_RET; + pmcon &= ~BPM_PMCON_SLEEP_Msk; + + /* Unlock PMCON register */ + BPM_UNLOCK(PMCON); + + if (sleep_mode == BPM_SM_SLEEP_0) { + pmcon |= BPM_PMCON_SLEEP(0); + bpm->BPM_PMCON = pmcon; + SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk; + } else if (sleep_mode == BPM_SM_SLEEP_1) { + pmcon |= BPM_PMCON_SLEEP(1); + bpm->BPM_PMCON = pmcon; + SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk; + } else if (sleep_mode == BPM_SM_SLEEP_2) { + pmcon |= BPM_PMCON_SLEEP(2); + bpm->BPM_PMCON = pmcon; + SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk; + } else if (sleep_mode == BPM_SM_SLEEP_3) { + pmcon |= BPM_PMCON_SLEEP(3); + bpm->BPM_PMCON = pmcon; + SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk; + } else if (sleep_mode == BPM_SM_WAIT) { + bpm->BPM_PMCON = pmcon; + SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; + } else if (sleep_mode == BPM_SM_RET) { + pmcon |= BPM_PMCON_RET; + bpm->BPM_PMCON = pmcon; + SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; + } else { /* if (sleep_mode == BPM_SM_BACKUP) */ + pmcon |= BPM_PMCON_BKUP; + bpm->BPM_PMCON = pmcon; + SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; + } + + /* Wait until vreg is ok. */ + while(!(BSCIF->BSCIF_PCLKSR & BSCIF_PCLKSR_VREGOK)); + asm volatile ("wfi"); + /* ensure sleep request propagation to flash. */ + asm volatile ("nop"); + + /* The interrupts wake-up from the previous wfi, but there are still + * masked since we are in the critical section thanks to the previous + * set_pri_mask(1). Thus, we need to leave the critical section. + * Please note that we should probably use something like + * cpu_leave_critical(), using set_pri_mask(0) + */ + cpu_irq_enable(); +} diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/bpm/bpm.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/bpm/bpm.h new file mode 100644 index 000000000..eecb74aa9 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/bpm/bpm.h @@ -0,0 +1,501 @@ +/** + * \file + * + * \brief BPM driver. + * + * Copyright (C) 2012 - 2013 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#ifndef BPM_H_INCLUDED +#define BPM_H_INCLUDED + +#include "compiler.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup group_sam_drivers_bpm BPM - Backup Power Manager + * + * Driver for the BPM (Backup Power Manager). + * This driver provides access to the main features of the BPM controller. + * It provides functions for different power mode management. + * + * @{ + */ + +/** BPM unlock macro */ +#define BPM_UNLOCK(reg) \ + do { \ + BPM->BPM_UNLOCK = BPM_UNLOCK_KEY(0xAAu) \ + | BPM_UNLOCK_ADDR((uint32_t)&BPM->BPM_##reg - (uint32_t)BPM);\ + } while (0) + +/** \name Sleep mode definitions */ +/* @{ */ +#define BPM_SM_ACTIVE 0 /**< Active mode */ +#define BPM_SM_SLEEP_0 1 /**< Sleep mode 0 */ +#define BPM_SM_SLEEP_1 2 /**< Sleep mode 1 */ +#define BPM_SM_SLEEP_2 3 /**< Sleep mode 2 */ +#define BPM_SM_SLEEP_3 4 /**< Sleep mode 3 */ +#define BPM_SM_WAIT 5 /**< Wait mode */ +#define BPM_SM_RET 6 /**< Retention mode */ +#define BPM_SM_BACKUP 7 /**< Backup mode */ +/* @} */ + +/** \anchor power_scaling_change_mode */ +/** \name Power scaling change mode */ +/* @{ */ +/** Power scaling change mode: halting the CPU execution */ +#define BPM_PSCM_CPU_HALT 0 +/** Power scaling change mode: CPU execution not halted */ +#define BPM_PSCM_CPU_NOT_HALT 1 +/* @} */ + +/** \anchor power_scaling_mode_value */ +/** \name Power scaling mode value */ +/* @{ */ +/** Power scaling mode 0 */ +#define BPM_PS_0 0 +/** Power scaling mode 1 */ +#define BPM_PS_1 1 +/** Power scaling mode 2 */ +#define BPM_PS_2 2 +/* @} */ + +/** \anchor CLK32_32Khz_1Khz */ +/** \name CLK32 32Khz-1Khz clock source selection */ +/* @{ */ +/** OSC32K : Low frequency crystal oscillator */ +#define BPM_CLK32_SOURCE_OSC32K 0 +/** RC32K : Internal Low frequency RC oscillator */ +#define BPM_CLK32_SOURCE_RC32K 1 +/* @} */ + +/** \anchor backup_wake_up_sources */ +/** \name Backup wake up sources */ +/* @{ */ +/** EIC wake up */ +#define BPM_BKUP_WAKEUP_SRC_EIC (1UL << BPM_BKUPWEN_EIC) +/** AST wake up */ +#define BPM_BKUP_WAKEUP_SRC_AST (1UL << BPM_BKUPWEN_AST) +/** WDT wake up */ +#define BPM_BKUP_WAKEUP_SRC_WDT (1UL << BPM_BKUPWEN_WDT) +/** BOD33 wake up */ +#define BPM_BKUP_WAKEUP_SRC_BOD33 (1UL << BPM_BKUPWEN_BOD33) +/** BOD18 wake up */ +#define BPM_BKUP_WAKEUP_SRC_BOD18 (1UL << BPM_BKUPWEN_BOD18) +/** PICOUART wake up */ +#define BPM_BKUP_WAKEUP_SRC_PICOUART (1UL << BPM_BKUPWEN_PICOUART) +/* @} */ + +/** \anchor backup_pin_muxing */ +/** \name Backup pin muxing */ +/* @{ */ +#define BPM_BKUP_PIN_PB01_EIC0 BPM_BKUPPMUX_BKUPPMUX(0) +#define BPM_BKUP_PIN_PA06_EIC1 BPM_BKUPPMUX_BKUPPMUX(1) +#define BPM_BKUP_PIN_PA04_EIC2 BPM_BKUPPMUX_BKUPPMUX(2) +#define BPM_BKUP_PIN_PA05_EIC3 BPM_BKUPPMUX_BKUPPMUX(3) +#define BPM_BKUP_PIN_PA07_EIC4 BPM_BKUPPMUX_BKUPPMUX(4) +#define BPM_BKUP_PIN_PC03_EIC5 BPM_BKUPPMUX_BKUPPMUX(5) +#define BPM_BKUP_PIN_PC04_EIC6 BPM_BKUPPMUX_BKUPPMUX(6) +#define BPM_BKUP_PIN_PC05_EIC7 BPM_BKUPPMUX_BKUPPMUX(7) +#define BPM_BKUP_PIN_PC06_EIC8 BPM_BKUPPMUX_BKUPPMUX(8) +/* @} */ + +/** + * \name Power management + */ +/* @{ */ + +/** + * \brief Change Power Scaling mode + * + * PSOK is not checked while switching PS mode. + * + * \param bpm Base address of the BPM instance. + * \param ps_value Power scaling value, see \ref power_scaling_mode_value. + * + */ +void bpm_power_scaling_cpu(Bpm *bpm, uint32_t ps_value); + +/** + * \brief Change Power Scaling mode and check results + * + * Wait for a while to check if PSOK is ready. + * + * \param bpm Base address of the BPM instance. + * \param ps_value Power scaling value, see \ref power_scaling_mode_value. + * + * \param timeout Timeout, in number of processor clocks, max 0xFFFFFF. + * \return true if PSOK is ready. + */ +bool bpm_power_scaling_cpu_failsafe(Bpm *bpm, uint32_t ps_value, + uint32_t timeout); + +/** + * \brief Configure power scaling mode. + * + * While checking PSOK in power safe (no halt) mode, timeout is set to + * 240000 by default, which takes 20ms when 12MHz clock is used. + * + * \param bpm Base address of the BPM instance. + * \param ps_value Power scaling value, see \ref power_scaling_mode_value. + * + * \param no_halt No halt or Fail safe, see \c bpm_power_scaling_cpu() + * and bpm_power_scaling_cpu_failsafe() + * \return true if no error. + */ +__always_inline static +bool bpm_configure_power_scaling(Bpm *bpm, uint32_t ps_value, uint32_t no_halt) +{ + if (!no_halt) { + bpm_power_scaling_cpu(bpm, ps_value); + return true; + } + + return bpm_power_scaling_cpu_failsafe(bpm, ps_value, 240000); +} + +/** + * \brief Enable fast wakeup for analog modules. + * + * \param bpm Base address of the BPM instance. + */ +void bpm_enable_fast_wakeup(Bpm *bpm); + +/** + * \brief Disable fast wakeup for analog modules. + * + * \param bpm Base address of the BPM instance. + */ +void bpm_disable_fast_wakeup(Bpm *bpm); + +/** + * \brief Set clock source for 32KHz clock. + * + * \param bpm Base address of the BPM instance. + * \param source Clock source, see \ref CLK32_32Khz_1Khz. + */ +void bpm_set_clk32_source(Bpm *bpm, uint32_t source); + +/** + * \brief Get wakeup cause from backup mode. + * + * \param bpm Base address of the BPM instance. + */ +uint32_t bpm_get_backup_wakeup_cause(Bpm *bpm); + +/** + * \brief Enable wakeup source. + * + * \param bpm Base address of the BPM instance. + * \param sources Wakeup source mask, see \ref backup_wake_up_sources. + */ +void bpm_enable_wakeup_source(Bpm *bpm, uint32_t sources); + +/** + * \brief Disable wakeup source. + * + * \param bpm Base address of the BPM instance. + * \param sources Wakeup source mask, see \ref backup_wake_up_sources. + */ +void bpm_disable_wakeup_source(Bpm *bpm, uint32_t sources); + +/** + * \brief Enable backup pin for wakeup. + * + * \param bpm Base address of the BPM instance. + * \param backup_pins Backup pin mask, see \ref backup_pin_muxing. + */ +void bpm_enable_backup_pin(Bpm *bpm, uint32_t backup_pins); + +/** + * \brief Disable backup pin for wakeup. + * + * \param bpm Base address of the BPM instance. + * \param backup_pins Backup pin mask, see \ref backup_pin_muxing. + */ +void bpm_disable_backup_pin(Bpm *bpm, uint32_t backup_pins); + +/** + * \brief Enable IO retention for backup mode. + * + * \param bpm Base address of the BPM instance. + */ +void bpm_enable_io_retention(Bpm *bpm); + +/** + * \brief Disable IO retention for backup mode. + * + * \param bpm Base address of the BPM instance. + */ +void bpm_disable_io_retention(Bpm *bpm); +/* @} */ + +/** + * \name Interrupt and status management + */ +/* @{ */ + +/** + * \brief Enable interrupt with given sources mask. + * + * \param bpm Base address of the BPM instance. + * \param sources BPM interrupt source mask. + */ +void bpm_enable_interrupt(Bpm *bpm, uint32_t sources); + +/** + * \brief Disable interrupt with given sources mask. + * + * \param bpm Base address of the BPM instance. + * \param sources BPM interrupt source mask. + */ +void bpm_disable_interrupt(Bpm *bpm, uint32_t sources); + +/** + * \brief Get BPM interrupt mask. + * + * \param bpm Base address of the BPM instance. + * + * \return BPM interrupt mask. + */ +uint32_t bpm_get_interrupt_mask(Bpm *bpm); + +/** + * \brief Get BPM interrupt status. + * + * \param bpm Base address of the BPM instance. + * + * \return BPM interrupt status. + */ +uint32_t bpm_get_interrupt_status(Bpm *bpm); + +/** + * \brief Clear BPM interrupt. + * + * \param bpm Base address of the BPM instance. + * \param sources BPM interrupt source mask. + */ +void bpm_clear_interrupt(Bpm *bpm, uint32_t sources); + +/** + * \brief Get BPM status. + * + * \param bpm Base address of the BPM instance. + * + * \return BPM status. + */ +uint32_t bpm_get_status(Bpm *bpm); + +/** + * \brief Get version of BPM module. + * + * \param bpm Base address of the BPM instance. + * + * \return Version of BPM module. + */ +uint32_t bpm_get_version(Bpm *bpm); +/* @} */ + +/* @} */ +#ifdef __cplusplus +} +#endif + +/** + * \page sam_bpm_quickstart Quick start guide for the SAM BPM module + * + * This is the quick start guide for the + * \ref group_sam_drivers_bpm "BPM Module", with step-by-step instructions on + * how to configure and use the driver in a selection of use cases. + * + * The use cases contain several code fragments. The code fragments in the + * steps for setup can be copied into a custom initialization function, while + * the steps for usage can be copied into, e.g., the main application function. + * + * \section bpm_use_cases BPM use cases + * - \ref bpm_use_case_1 Basic use case - Entering Sleep Modes + * - \ref bpm_use_case_2 Advanced use case - Switch Power Scaling Modes + * + * \section bpm_use_case_1 Basic use case - Entering Sleep Modes + * In this use case, the BPM module can put system into different power saving + * modes. Check the current of the system to see consumptions. + * + * \section bpm_use_case_1_setup Setup + * + * \subsection bpm_use_case_1_setup_prereq Prerequisites + * Sleep mode itself does not require any IO input, but to wakeup an interrupt + * is needed. + * -# \ref ioport_group "Common IOPORT (for GPIO)" + * -# \ref sam_drivers_eic_group "External Interrupt Controller (EIC)" + * + * \subsection bpm_use_case_1_setup_prereq_code Code + * + * \code + * #define EIC_INT5_ENABLE + * \endcode + * + * The following code needs to be added to the user application, to wakeup + * system and switch to next power mode. + * \code + * static void push_button_eic_handler() + * { + * eic_line_clear_interrupt(EIC, GPIO_PUSH_BUTTON_EIC_LINE); + * } + * \endcode + * \code + * my_eic_init() + * { + * struct eic_line_config eic_opt={ + * EIC_MODE_EDGE_TRIGGERED, + * EIC_EDGE_FALLING_EDGE, + * EIC_LEVEL_LOW_LEVEL, + * EIC_FILTER_DISABLED, + * EIC_ASYNCH_MODE + * }; + * eic_enable(EIC); + * eic_line_set_config(EIC, GPIO_PUSH_BUTTON_EIC_LINE, &eic_opt); + * eic_line_set_callback(EIC, GPIO_PUSH_BUTTON_EIC_LINE, + * push_button_eic_handler, EIC_5_IRQn, 1); + * eic_line_enable(EIC, GPIO_PUSH_BUTTON_EIC_LINE); + * } + * \endcode + * + * \subsection bpm_use_case_1_setup_prereq_flow Workflow + * -# Ensure that ioport and eic driver is available. + * -# Ensure that push button is configured as external interrupt in + * conf_board.h: + * \code #define CONF_BOARD_EIC \endcode + * -# Add EIC initialize to application C-file: + * \code my_eic_init(); \endcode + * + * \section bpm_use_case_1_usage Use case + * + * \subsection bpm_use_case_1_usage_code Example code + * Add to application C-file: + * \code + * // Enable wakeup by EIC + * bpm_enable_wakeup_source(BPM, 1 << BPM_BKUPWEN_EIC); + * // Enable backup wakeup by Push button EIC line + * bpm_enable_backup_pin(BPM, 1 << GPIO_PUSH_BUTTON_EIC_LINE); + * // Retain I/O lines after wakeup from backup mode + * bpm_enable_io_retention(BPM); + * // Enable fast wakeup + * bpm_enable_fast_wakeup(BPM); + * // Enter wait mode + * // critical section when going to sleep + * cpu_irq_disable(); + * bpm_sleep(BPM, BPM_SM_WAIT); + * // Enter retention mode + * cpu_irq_disable(); + * bpm_sleep(BPM, BPM_SM_RET); + * // Enter backup mode + * cpu_irq_disable(); + * bpm_sleep(BPM, BPM_SM_BACKUP); + * while(1); + * \endcode + * + * \subsection bpm_use_case_1_usage_flow Workflow + * -# Enable wakeup by EIC: + * \code + * bpm_enable_wakeup_source(BPM, 1 << BPM_BKUPWEN_EIC); + * bpm_enable_backup_pin(BPM, 1 << GPIO_PUSH_BUTTON_EIC_LINE); + * \endcode + * -# Setup IO retention: + * \code bpm_enable_io_retention(BPM); \endcode + * -# Setup fast wakeup: + * \code bpm_enable_fast_wakeup(BPM); \endcode + * -# Enter sleep/wait/backup mode: + * \code + * // critical section when going to sleep + * cpu_irq_disable(); + * bpm_sleep(BPM, BPM_SM_WAIT); + * \endcode + */ + +/** + * \page bpm_use_case_2 Advanced use case - Switch Power Scaling Modes + * In this use case, the BPM module can switch the power scaling modes of the + * system. Check the current of the system to see consumptions. + * + * \section bpm_use_case_2_setup Setup + * \subsection bpm_use_case_2_setup_prereq Prerequisites + * Some power scaling modes only work on limited system clock frequency (The + * maximum CPU frequency under PS1 is 12MHz, other peripherals also have speed + * limitations), please refer to the electrical characteristics for more + * details. + * -# \ref clk_group "Clock management" + * + * \subsection bpm_use_case_2_setup_code Code + * Content of conf_clock.h + * \code + * #define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_RCFAST // Uses Fast RC + * #define CONFIG_RCFAST_FRANGE 2 // Fast RC is 12MHz + * \endcode + * + * \subsection bpm_use_case_2_setup_workflow Workflow + * -# Ensure that conf_clock.h is available and contains the following + * parameters which configure system clock to 12MHz fast RC: + * \code + * #define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_RCFAST // Uses Fast RC + * #define CONFIG_RCFAST_FRANGE 2 // Fast RC is 12MHz + * \endcode + * -# Initialize system clock with \c sysclk_init(). + * + * \section bpm_use_case_2_usage Use case + * + * \subsection bpm_use_case_2_usage_code Example code + * Add to application C-file: + * \code + * bpm_power_scaling_cpu(BPM, BPM_PMCON_PS(BPM_PS_1)); + * while((bpm_get_status(BPM) & BPM_SR_PSOK) == 0); + * while(1); + * \endcode + * + * \subsection bpm_use_case_2_usage_workflow Workflow + * -# Switch the power scaling mode: + * \code bpm_power_scaling_cpu(BPM, BPM_PMCON_PS(BPM_PS_1)); + * \endcode + * -# Wait power scaling done: + * \code while((bpm_get_status(BPM) & BPM_SR_PSOK) == 0); \endcode + */ + +#endif /* BPM_H_INCLUDED */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/bpm/sleep.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/bpm/sleep.h new file mode 100644 index 000000000..168ac7c93 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/bpm/sleep.h @@ -0,0 +1,141 @@ +/** + * \file + * + * \brief Sleep mode access + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#ifndef SLEEP_H +#define SLEEP_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/** + * \defgroup sleep_group Backup Power Manager (BPM) + * + * This is a stub on the SAM4L Backup Power Manager(BPM) for the sleepmgr service. + * + * \note To minimize the code overhead, these functions do not feature + * interrupt-protected access since they are likely to be called inside + * interrupt handlers or in applications where such protection is not + * necessary. If such protection is needed, it must be ensured by the calling + * code. + * + * @{ + */ + +#if defined(__DOXYGEN__) +/** + * \brief Sets the MCU in the specified sleep mode + * \param sleep_mode Sleep mode to set. + */ +#endif + +#include "bpm.h" + +static inline void bpm_sleep(Bpm *bpm, uint32_t sleep_mode) +{ + uint32_t pmcon; + + /* Read PMCON register */ + pmcon = bpm->BPM_PMCON; + pmcon &= ~BPM_PMCON_BKUP; + pmcon &= ~BPM_PMCON_RET; + pmcon &= ~BPM_PMCON_SLEEP_Msk; + + /* Unlock PMCON register */ + BPM_UNLOCK(PMCON); + + if (sleep_mode == BPM_SM_SLEEP_0) { + pmcon |= BPM_PMCON_SLEEP(0); + bpm->BPM_PMCON = pmcon; + SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk; + } else if (sleep_mode == BPM_SM_SLEEP_1) { + pmcon |= BPM_PMCON_SLEEP(1); + bpm->BPM_PMCON = pmcon; + SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk; + } else if (sleep_mode == BPM_SM_SLEEP_2) { + pmcon |= BPM_PMCON_SLEEP(2); + bpm->BPM_PMCON = pmcon; + SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk; + } else if (sleep_mode == BPM_SM_SLEEP_3) { + pmcon |= BPM_PMCON_SLEEP(3); + bpm->BPM_PMCON = pmcon; + SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk; + } else if (sleep_mode == BPM_SM_WAIT) { + bpm->BPM_PMCON = pmcon; + SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; + } else if (sleep_mode == BPM_SM_RET) { + pmcon |= BPM_PMCON_RET; + bpm->BPM_PMCON = pmcon; + SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; + } else { /* if (sleep_mode == BPM_SM_BACKUP) */ + pmcon |= BPM_PMCON_BKUP; + bpm->BPM_PMCON = pmcon; + SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; + } + + /* Wait until vreg is ok. */ + while(!(BSCIF->BSCIF_PCLKSR & BSCIF_PCLKSR_VREGOK)); + asm volatile ("wfi"); + /* ensure sleep request propagation to flash. */ + asm volatile ("nop"); + + /* The interrupts wake-up from the previous wfi, but there are still + * masked since we are in the critical section thanks to the previous + * set_pri_mask(1). Thus, we need to leave the critical section. + * Please note that we should probably use something like + * cpu_leave_critical(), using set_pri_mask(0) + */ + cpu_irq_enable(); +} + + +//! @} + +#ifdef __cplusplus +} +#endif + +#endif /* SLEEP_H */ + diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/flashcalw/flashcalw.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/flashcalw/flashcalw.c new file mode 100644 index 000000000..ceab39680 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/flashcalw/flashcalw.c @@ -0,0 +1,1823 @@ +/** + * \file + * + * \brief FlashCALW driver for SAM4L. + * + * Copyright (c) 2012-2013 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#include "flashcalw.h" +#include "sysclk.h" + +/// @cond 0 +/**INDENT-OFF**/ +#ifdef __cplusplus +extern "C" { +#endif +/**INDENT-ON**/ +/// @endcond + +/** + * \defgroup group_sam_drivers_flashcalw FLASHCALW - FLASH Controller Double-Word + * + * See \ref sam_flashcalw_quickstart. + * + * FLASHCALW interfaces a flash block with the 32-bit internal HSB bus. + * + * \{ + */ + +/*! \name Flash Properties + */ +//! @{ + +/*! \brief Gets the size of the whole flash array. + * + * \return The size of the whole flash array in Bytes. + */ +uint32_t flashcalw_get_flash_size(void) +{ + const uint16_t flash_size[(FLASHCALW_FPR_FSZ_Msk >> + FLASHCALW_FPR_FSZ_Pos) + 1] = { + 4, + 8, + 16, + 32, + 48, + 64, + 96, + 128, + 192, + 256, + 384, + 512, + 768, + 1024, + 2048, + }; + return ((uint32_t)flash_size[(HFLASHC->FLASHCALW_FPR & + FLASHCALW_FPR_FSZ_Msk) >> FLASHCALW_FPR_FSZ_Pos] << 10); +} + +/*! \brief Gets the total number of pages in the flash array. + * + * \return The total number of pages in the flash array. + */ +uint32_t flashcalw_get_page_count(void) +{ + return flashcalw_get_flash_size() / FLASH_PAGE_SIZE; +} + +/*! \brief Gets the number of pages in each flash region. + * + * \return The number of pages in each flash region. + */ +uint32_t flashcalw_get_page_count_per_region(void) +{ + return flashcalw_get_page_count() / FLASH_NB_OF_REGIONS; +} + +/*! \brief Gets the region number of a page. + * + * \param page_number The page number: + * \arg \c 0 to (flashcalw_get_page_count() - 1): a page number + * within the flash array; + * \arg < 0: the current page number. + * + * \return The region number of the specified page. + */ +uint32_t flashcalw_get_page_region(int32_t page_number) +{ + return ((page_number >= 0) ? page_number + : (int32_t)flashcalw_get_page_number()) + / flashcalw_get_page_count_per_region(); +} + +/*! \brief Gets the number of the first page of a region. + * + * \param region The region number: \c 0 to (FLASHCALW_REGIONS - 1). + * + * \return The number of the first page of the specified region. + */ +uint32_t flashcalw_get_region_first_page_number(uint32_t region) +{ + return region * flashcalw_get_page_count_per_region(); +} + + +//! @} + +/*! \name FLASHC Control + */ +//! @{ + +/*! \brief Gets the number of wait states of flash read accesses. + * + * \return The number of wait states of flash read accesses. + */ +uint32_t flashcalw_get_wait_state(void) +{ + return (HFLASHC->FLASHCALW_FCR & FLASHCALW_FCR_FWS ? 1 : 0); +} + +/*! \brief Sets the number of wait states of flash read accesses. + * + * \param wait_state The number of wait states of flash read accesses: \c 0 to + * \c 1. + */ +void flashcalw_set_wait_state(uint32_t wait_state) +{ + HFLASHC->FLASHCALW_FCR = (HFLASHC->FLASHCALW_FCR & ~FLASHCALW_FCR_FWS) + | (wait_state ? FLASHCALW_FCR_FWS_1 : + FLASHCALW_FCR_FWS_0); +} + +#define FLASH_FWS_0_MAX_FREQ CHIP_FREQ_FWS_0 +#define FLASH_FWS_1_MAX_FREQ CHIP_FREQ_FWS_1 +#define FLASH_HSEN_FWS_0_MAX_FREQ CHIP_FREQ_FLASH_HSEN_FWS_0 +#define FLASH_HSEN_FWS_1_MAX_FREQ CHIP_FREQ_FLASH_HSEN_FWS_1 + +/*! \brief Depending on the CPU frequency, on the Power Scaling mode and on the + * Fast Wakeup mode, set the wait states of flash read accesses and enable or + * disable the High speed read mode. + * + * \param cpu_f_hz The CPU frequency + * \param ps_value Power Scaling mode value (0, 1) + * \param is_fwu_enabled (boolean), Is fast wakeup mode enabled or not + */ +void flashcalw_set_flash_waitstate_and_readmode(uint32_t cpu_f_hz, + uint32_t ps_value, bool is_fwu_enabled) +{ +#ifdef CONFIG_FLASH_READ_MODE_HIGH_SPEED_ENABLE + UNUSED(ps_value); + UNUSED(is_fwu_enabled); + + if (cpu_f_hz > FLASH_FREQ_PS2_FWS_0_MAX_FREQ) { /* > 24MHz */ + /* Set a wait-state. */ + flashcalw_set_wait_state(1); + } else { + /* No wait-state. */ + flashcalw_set_wait_state(0); + } + + /* Enable the high-speed read mode. */ + flashcalw_issue_command(FLASHCALW_FCMD_CMD_HSEN, -1); +#else + if (ps_value == 0) { + if (cpu_f_hz > FLASH_FREQ_PS0_FWS_0_MAX_FREQ) { + // > 18MHz + if (cpu_f_hz <= FLASH_FREQ_PS0_FWS_1_MAX_FREQ) { + // <= 36MHz + /* Set a wait-state, disable the high-speed read + * mode. */ + flashcalw_set_wait_state(1); + flashcalw_issue_command( + FLASHCALW_FCMD_CMD_HSDIS, -1); + } else { + // > 36 MHz + /* Set a wait-state, enable the high-speed read + mode. */ + flashcalw_set_wait_state(1); + flashcalw_issue_command(FLASHCALW_FCMD_CMD_HSEN, + -1); + } + } else { // <= 18MHz + if((is_fwu_enabled == true) && + (cpu_f_hz <= FLASH_FREQ_PS1_FWS_1_FWU_MAX_FREQ)) + { + // <= 12MHz + /* Set a wait-state, disable the high-speed read + mode. */ + flashcalw_set_wait_state(1); + flashcalw_issue_command( + FLASHCALW_FCMD_CMD_HSDIS, -1); + } else { + /* No wait-state, disable the high-speed read + mode */ + flashcalw_set_wait_state(0); + flashcalw_issue_command( + FLASHCALW_FCMD_CMD_HSDIS, -1); + } + } + } else { /* ps_value == 1 */ + if (cpu_f_hz > FLASH_FREQ_PS0_FWS_0_MAX_FREQ) { /* > 8MHz */ + /* Set a wait-state. */ + flashcalw_set_wait_state(1); + } else { + /* No wait-state. */ + flashcalw_set_wait_state(0); + } + + /* Disable the high-speed read mode. */ + flashcalw_issue_command(FLASHCALW_FCMD_CMD_HSDIS, -1); + } +#endif +} + +/*! \brief Tells whether the Flash Ready interrupt is enabled. + * + * \return Whether the Flash Ready interrupt is enabled. + */ +bool flashcalw_is_ready_int_enabled(void) +{ + return ((HFLASHC->FLASHCALW_FCR & FLASHCALW_FCR_FRDY) != 0); +} + +/*! \brief Enables or disables the Flash Ready interrupt. + * + * \param enable Whether to enable the Flash Ready interrupt: \c true or + * \c false. + */ +void flashcalw_enable_ready_int(bool enable) +{ + HFLASHC->FLASHCALW_FCR + &= ((enable & + FLASHCALW_FCR_FRDY) | (~FLASHCALW_FCR_FRDY)); +} + +/*! \brief Tells whether the Lock Error interrupt is enabled. + * + * \return Whether the Lock Error interrupt is enabled. + */ +bool flashcalw_is_lock_error_int_enabled(void) +{ + return ((HFLASHC->FLASHCALW_FCR & FLASHCALW_FCR_LOCKE) != 0); +} + +/*! \brief Enables or disables the Lock Error interrupt. + * + * \param enable Whether to enable the Lock Error interrupt: \c true or + * \c false. + */ +void flashcalw_enable_lock_error_int(bool enable) +{ + HFLASHC->FLASHCALW_FCR + &= ((enable & + FLASHCALW_FCR_LOCKE) | (~FLASHCALW_FCR_LOCKE)); +} + +/*! \brief Tells whether the Programming Error interrupt is enabled. + * + * \return Whether the Programming Error interrupt is enabled. + */ +bool flashcalw_is_prog_error_int_enabled(void) +{ + return ((HFLASHC->FLASHCALW_FCR & FLASHCALW_FCR_PROGE) != 0); +} + +/*! \brief Enables or disables the Programming Error interrupt. + * + * \param enable Whether to enable the Programming Error interrupt: \c true or + * \c false. + */ +void flashcalw_enable_prog_error_int(bool enable) +{ + HFLASHC->FLASHCALW_FCR &= ((enable & + FLASHCALW_FCR_PROGE) | (~FLASHCALW_FCR_PROGE)); +} + + +//! @} + +/*! \name FLASHCALW Status + */ +//! @{ + +/*! \brief Tells whether the FLASHCALW is ready to run a new command. + * + * \return Whether the FLASHCALW is ready to run a new command. + */ +bool flashcalw_is_ready(void) +{ + return ((HFLASHC->FLASHCALW_FSR & FLASHCALW_FSR_FRDY) != 0); +} + +/*! \brief Waits actively until the FLASHCALW is ready to run a new command. + * + * This is the default function assigned to \ref flashcalw_wait_until_ready. + */ +void flashcalw_default_wait_until_ready(void) +{ + while (!flashcalw_is_ready()) { + } +} + +/** + * \brief Pointer to the function used by the driver when it needs to wait until + * the FLASHCALW is ready to run a new command. + * + * The default function is \ref flashcalw_default_wait_until_ready. + * The user may change this pointer to use another implementation. + */ +void(*volatile flashcalw_wait_until_ready) (void) + = flashcalw_default_wait_until_ready; + +/** + * \internal + * \brief Gets the error status of the FLASHCALW. + * + * \return The error status of the FLASHCALW built up from + * \c FLASHCALW_FSR_LOCKE and \c FLASHCALW_FSR_PROGE. + * + * \warning This hardware error status is cleared by all functions reading the + * Flash Status Register (FSR). This function is therefore not part of + * the driver's API which instead presents \ref flashcalw_is_lock_error + * and \ref flashcalw_is_programming_error. + */ +static uint32_t flashcalw_get_error_status(void) +{ + return HFLASHC->FLASHCALW_FSR & + (FLASHCALW_FSR_LOCKE | FLASHCALW_FSR_PROGE); +} + +/** + * \internal + * \brief Sticky error status of the FLASHCALW. + * + * This variable is updated by functions that issue FLASHCALW commands. It + * contains the cumulated FLASHCALW error status of all the FLASHCALW commands + * issued by a function. + */ +static uint32_t flashcalw_error_status = 0; + +/*! \brief Tells whether a Lock Error has occurred during the last function + * called that issued one or more FLASHCALW commands. + * + * \return Whether a Lock Error has occurred during the last function called + * that issued one or more FLASHCALW commands. + */ +bool flashcalw_is_lock_error(void) +{ + return ((flashcalw_error_status & FLASHCALW_FSR_LOCKE) != 0); +} + +/*! \brief Tells whether a Programming Error has occurred during the last + * function called that issued one or more FLASHCALW commands. + * + * \return Whether a Programming Error has occurred during the last function + * called that issued one or more FLASHCALW commands. + */ +bool flashcalw_is_programming_error(void) +{ + return ((flashcalw_error_status & FLASHCALW_FSR_PROGE) != 0); +} + +//! @} + +/*! \name FLASHCALW Command Control + */ +//! @{ + +/*! \brief Gets the last issued FLASHCALW command. + * + * \return The last issued FLASHCALW command. + */ +uint32_t flashcalw_get_command(void) +{ + return (HFLASHC->FLASHCALW_FCMD & FLASHCALW_FCMD_CMD_Msk); +} + +/*! \brief Gets the current FLASHCALW page number. + * + * \return The current FLASHCALW page number. + */ +uint32_t flashcalw_get_page_number(void) +{ + return ((HFLASHC->FLASHCALW_FCMD & FLASHCALW_FCMD_PAGEN_Msk) + >> FLASHCALW_FCMD_PAGEN_Pos); +} + + +/*! \brief Issues a FLASHCALW command. + * + * \param command The command: \c FLASHCALW_FCMD_CMD_x. + * \param page_number The page number to apply the command to: + * \arg \c 0 to (flashcalw_get_page_count() - 1): a page number + * within the flash array; + * \arg < 0: use this to apply the command to the current page number + * or if the command does not apply to any page number; + * \arg this argument may have other meanings according to the command. See + * the FLASHCALW chapter of the MCU datasheet. + * + * \warning A Lock Error is issued if the command violates the protection + * mechanism. + * + * \warning A Programming Error is issued if the command is invalid. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + */ +void flashcalw_issue_command(uint32_t command, int page_number) +{ + uint32_t tempo; + + flashcalw_wait_until_ready(); + tempo = HFLASHC->FLASHCALW_FCMD; + /* Clear the command bitfield. */ + tempo &= ~FLASHCALW_FCMD_CMD_Msk; + if (page_number >= 0) { + tempo = (FLASHCALW_FCMD_KEY_KEY + | FLASHCALW_FCMD_PAGEN(page_number) | command); + } else { + tempo |= (FLASHCALW_FCMD_KEY_KEY | command); + } + + HFLASHC->FLASHCALW_FCMD = tempo; + flashcalw_error_status = flashcalw_get_error_status(); + flashcalw_wait_until_ready(); +} + + +//! @} + +/*! \name FLASHCALW Global Commands + */ +//! @{ + +/*! \brief Issues a No Operation command to the FLASHCALW. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + */ +void flashcalw_no_operation(void) +{ + flashcalw_issue_command(FLASHCALW_FCMD_CMD_NOP, -1); +} + +/*! \brief Issues an Erase All command to the FLASHCALW. + * + * This command erases all bits in the flash array, the general-purpose fuse + * bits and the Security bit. The User page is not erased. + * + * This command also ensures that all volatile memories, such as register file + * and RAMs, are erased before the Security bit is erased, i.e. deactivated. + * + * \warning A Lock Error is issued if at least one region is locked or the + * bootloader protection is active. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + * + * \note An erase operation can only set bits. + */ +void flashcalw_erase_all(void) +{ + flashcalw_issue_command(FLASHCALW_FCMD_CMD_EA, -1); +} + + +//! @} + +/*! \name FLASHCALW Protection Mechanisms + */ +//! @{ + +/*! \brief Tells whether the Security bit is active. + * + * \return Whether the Security bit is active. + */ +bool flashcalw_is_security_bit_active(void) +{ + return ((HFLASHC->FLASHCALW_FSR & FLASHCALW_FSR_SECURITY) != 0); +} + +/*! \brief Activates the Security bit. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + */ +void flashcalw_set_security_bit(void) +{ + flashcalw_issue_command(FLASHCALW_FCMD_CMD_SSB, -1); +} + +/*! \brief Tells whether the region of a page is locked. + * + * \param page_number The page number: + * \arg \c 0 to (flashcalw_get_page_count() - 1): a page number + * within the flash array; + * \arg < 0: the current page number. + * + * \return Whether the region of the specified page is locked. + */ +bool flashcalw_is_page_region_locked(uint32_t page_number) +{ + return flashcalw_is_region_locked(flashcalw_get_page_region(page_number)); +} + +/*! \brief Tells whether a region is locked. + * + * \param region The region number: \c 0 to (FLASHCALW_REGIONS - 1). + * + * \return Whether the specified region is locked. + */ +bool flashcalw_is_region_locked(uint32_t region) +{ + return ((HFLASHC->FLASHCALW_FSR & FLASHCALW_FSR_LOCK0 + << (region & (FLASHCALW_REGIONS - 1))) != 0); +} + +/*! \brief Locks or unlocks the region of a page. + * + * \param page_number The page number: + * \arg \c 0 to (flashcalw_get_page_count() - 1): a page number + * within the flash array; + * \arg < 0: the current page number. + * \param lock Whether to lock the region of the specified page: \c true or + * \c false. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + */ +void flashcalw_lock_page_region(int page_number, bool lock) +{ + flashcalw_issue_command( + (lock) ? FLASHCALW_FCMD_CMD_LP : FLASHCALW_FCMD_CMD_UP, + page_number); +} + +/*! \brief Locks or unlocks a region. + * + * \param region The region number: \c 0 to (FLASHCALW_REGIONS - 1). + * \param lock Whether to lock the specified region: \c true or \c false. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + */ +void flashcalw_lock_region(uint32_t region, bool lock) +{ + flashcalw_lock_page_region(flashcalw_get_region_first_page_number( + region), lock); +} + +/*! \brief Locks or unlocks all regions. + * + * \param lock Whether to lock the regions: \c true or \c false. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + */ +void flashcalw_lock_all_regions(bool lock) +{ + uint32_t error_status = 0; + uint32_t region = FLASHCALW_REGIONS; + + while (region) { + flashcalw_lock_region(--region, lock); + error_status |= flashcalw_error_status; + } + flashcalw_error_status = error_status; +} + + +//! @} + +/*! \name Access to General-Purpose Fuses + */ +//! @{ + + +/*! \brief Reads a general-purpose fuse bit. + * + * \param gp_fuse_bit The general-purpose fuse bit: \c 0 to \c 63. + * + * \return The value of the specified general-purpose fuse bit. + * + * \note The actual number of general-purpose fuse bits implemented by hardware + * is given by \c FLASH_GPF_NUM. The other bits among the 64 are + * fixed at 1 by hardware. + */ +bool flashcalw_read_gp_fuse_bit(uint32_t gp_fuse_bit) +{ + return ((flashcalw_read_all_gp_fuses() & 1ULL << (gp_fuse_bit & 0x3F)) + != 0); +} + +/*! \brief Reads a general-purpose fuse bit-field. + * + * \param pos The bit-position of the general-purpose fuse bit-field: \c 0 to + * \c 63. + * \param width The bit-width of the general-purpose fuse bit-field: \c 0 to + * \c 64. + * + * \return The value of the specified general-purpose fuse bit-field. + * + * \note The actual number of general-purpose fuse bits implemented by hardware + * is given by \c FLASH_GPF_NUM. The other bits among the 64 are + * fixed at 1 by hardware. + */ +uint64_t flashcalw_read_gp_fuse_bitfield(uint32_t pos, uint32_t width) +{ + return flashcalw_read_all_gp_fuses() >> (pos & 0x3F) + & ((1ULL << Min(width, 64)) - 1); +} + +/*! \brief Reads a general-purpose fuse byte. + * + * \param gp_fuse_byte The general-purpose fuse byte: \c 0 to \c 7. + * + * \return The value of the specified general-purpose fuse byte. + * + * \note The actual number of general-purpose fuse bits implemented by hardware + * is given by \c FLASH_GPF_NUM. The other bits among the 64 are + * fixed at 1 by hardware. + */ +uint8_t flashcalw_read_gp_fuse_byte(uint32_t gp_fuse_byte) +{ + return flashcalw_read_all_gp_fuses() >> ((gp_fuse_byte & 0x07) << 3); +} + +/*! \brief Reads all general-purpose fuses. + * + * \return The value of all general-purpose fuses as a word. + * + * \note The actual number of general-purpose fuse bits implemented by hardware + * is given by \c FLASH_GPF_NUM. The other bits among the 64 are + * fixed at 1 by hardware. + */ +uint64_t flashcalw_read_all_gp_fuses(void) +{ + return HFLASHC->FLASHCALW_FGPFRLO | + (uint64_t)HFLASHC->FLASHCALW_FGPFRHI << 32; +} + +/*! \brief Erases a general-purpose fuse bit. + * + * \param gp_fuse_bit The general-purpose fuse bit: \c 0 to \c 63. + * \param check Whether to check erase: \c true or \c false. + * + * \return Whether the erase succeeded or always \c true if erase check was not + * requested. + * + * \warning A Lock Error is issued if the Security bit is active and the command + * is applied to BOOTPROT. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + * + * \note An erase operation can only set bits. + * + * \note The actual number of general-purpose fuse bits implemented by hardware + * is given by \c FLASH_GPF_NUM. The other bits among the 64 are + * fixed at 1 by hardware. + */ +bool flashcalw_erase_gp_fuse_bit(uint32_t gp_fuse_bit, bool check) +{ + flashcalw_issue_command(FLASHCALW_FCMD_CMD_EGPB, gp_fuse_bit & 0x3F); + return (check) ? flashcalw_read_gp_fuse_bit(gp_fuse_bit) : true; +} + +/*! \brief Erases a general-purpose fuse bit-field. + * + * \param pos The bit-position of the general-purpose fuse bit-field: \c 0 to + * \c 63. + * \param width The bit-width of the general-purpose fuse bit-field: \c 0 to + * \c 64. + * \param check Whether to check erase: \c true or \c false. + * + * \return Whether the erase succeeded or always \c true if erase check was not + * requested. + * + * \warning A Lock Error is issued if the Security bit is active and the command + * is applied to BOOTPROT. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + * + * \note An erase operation can only set bits. + * + * \note The actual number of general-purpose fuse bits implemented by hardware + * is given by \c FLASH_GPF_NUM. The other bits among the 64 are + * fixed at 1 by hardware. + */ +bool flashcalw_erase_gp_fuse_bitfield(uint32_t pos, uint32_t width, bool check) +{ + uint32_t error_status = 0; + uint32_t gp_fuse_bit; + + pos &= 0x3F; + width = Min(width, 64); + + for (gp_fuse_bit = pos; gp_fuse_bit < pos + width; gp_fuse_bit++) { + flashcalw_erase_gp_fuse_bit(gp_fuse_bit, false); + error_status |= flashcalw_error_status; + } + flashcalw_error_status = error_status; + return (check) ? (flashcalw_read_gp_fuse_bitfield(pos, width) + == (1ULL << width) - 1) : true; +} + +/*! \brief Erases a general-purpose fuse byte. + * + * \param gp_fuse_byte The general-purpose fuse byte: \c 0 to \c 7. + * \param check Whether to check erase: \c true or \c false. + * + * \return Whether the erase succeeded or always \c true if erase check was not + * requested. + * + * \warning A Lock Error is issued if the Security bit is active. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + * + * \note An erase operation can only set bits. + * + * \note The actual number of general-purpose fuse bits implemented by hardware + * is given by \c FLASH_GPF_NUM. The other bits among the 64 are + * fixed at 1 by hardware. + */ +bool flashcalw_erase_gp_fuse_byte(uint32_t gp_fuse_byte, bool check) +{ + uint32_t error_status; + uint32_t current_gp_fuse_byte; + uint64_t value = flashcalw_read_all_gp_fuses(); + + flashcalw_erase_all_gp_fuses(false); + error_status = flashcalw_error_status; + for (current_gp_fuse_byte = 0; current_gp_fuse_byte < 8; + current_gp_fuse_byte++, value >>= 8) { + if (current_gp_fuse_byte != gp_fuse_byte) { + flashcalw_write_gp_fuse_byte(current_gp_fuse_byte, + value); + error_status |= flashcalw_error_status; + } + } + flashcalw_error_status = error_status; + return (check) ? (flashcalw_read_gp_fuse_byte(gp_fuse_byte) == 0xFF) + : true; +} + +/*! \brief Erases all general-purpose fuses. + * + * \param check Whether to check erase: \c true or \c false. + * + * \return Whether the erase succeeded or always \c true if erase check was not + * requested. + * + * \warning A Lock Error is issued if the Security bit is active. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + * + * \note An erase operation can only set bits. + * + * \note The actual number of general-purpose fuse bits implemented by hardware + * is given by \c FLASH_GPF_NUM. The other bits among the 64 are + * fixed at 1 by hardware. + */ +bool flashcalw_erase_all_gp_fuses(bool check) +{ + flashcalw_issue_command(FLASHCALW_FCMD_CMD_EAGPF, -1); + return (check) ? (flashcalw_read_all_gp_fuses() == + 0xFFFFFFFFFFFFFFFFULL) : true; +} + +/*! \brief Writes a general-purpose fuse bit. + * + * \param gp_fuse_bit The general-purpose fuse bit: \c 0 to \c 63. + * \param value The value of the specified general-purpose fuse bit. + * + * \warning A Lock Error is issued if the Security bit is active and the command + * is applied to BOOTPROT. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + * + * \note A write operation can only clear bits; in other words, an erase + * operation must first be done if some bits need to be set to 1. + * + * \note The actual number of general-purpose fuse bits implemented by hardware + * is given by \c FLASH_GPF_NUM. The other bits among the 64 are + * fixed at 1 by hardware. + */ +void flashcalw_write_gp_fuse_bit(uint32_t gp_fuse_bit, bool value) +{ + if (!value) { + flashcalw_issue_command(FLASHCALW_FCMD_CMD_WGPB, gp_fuse_bit + & 0x3F); + } +} + +/*! \brief Writes a general-purpose fuse bit-field. + * + * \param pos The bit-position of the general-purpose fuse bit-field: \c 0 to + * \c 63. + * \param width The bit-width of the general-purpose fuse bit-field: \c 0 to + * \c 64. + * \param value The value of the specified general-purpose fuse bit-field. + * + * \warning A Lock Error is issued if the Security bit is active and the command + * is applied to BOOTPROT. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + * + * \note A write operation can only clear bits; in other words, an erase + * operation must first be done if some bits need to be set to 1. + * + * \note The actual number of general-purpose fuse bits implemented by hardware + * is given by \c FLASH_GPF_NUM. The other bits among the 64 are + * fixed at 1 by hardware. + */ +void flashcalw_write_gp_fuse_bitfield(uint32_t pos, uint32_t width, + uint64_t value) +{ + uint32_t error_status = 0; + uint32_t gp_fuse_bit; + + pos &= 0x3F; + width = Min(width, 64); + + for (gp_fuse_bit = pos; gp_fuse_bit < pos + width; + gp_fuse_bit++, value >>= 1) { + flashcalw_write_gp_fuse_bit(gp_fuse_bit, value & 0x01); + error_status |= flashcalw_error_status; + } + flashcalw_error_status = error_status; +} + +/*! \brief Writes a general-purpose fuse byte. + * + * \param gp_fuse_byte The general-purpose fuse byte: \c 0 to \c 7. + * \param value The value of the specified general-purpose fuse byte. + * + * \warning A Lock Error is issued if the Security bit is active. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + * + * \note A write operation can only clear bits; in other words, an erase + * operation must first be done if some bits need to be set to 1. + * + * \note The actual number of general-purpose fuse bits implemented by hardware + * is given by \c FLASH_GPF_NUM. The other bits among the 64 are + * fixed at 1 by hardware. + */ +void flashcalw_write_gp_fuse_byte(uint32_t gp_fuse_byte, uint8_t value) +{ + flashcalw_issue_command(FLASHCALW_FCMD_CMD_PGPFB, (gp_fuse_byte & 0x07) + | value << 3); +} + +/*! \brief Writes all general-purpose fuses. + * + * \param value The value of all general-purpose fuses as a word. + * + * \warning A Lock Error is issued if the Security bit is active. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + * + * \note A write operation can only clear bits; in other words, an erase + * operation must first be done if some bits need to be set to 1. + * + * \note The actual number of general-purpose fuse bits implemented by hardware + * is given by \c FLASH_GPF_NUM. The other bits among the 64 are + * fixed at 1 by hardware. + */ +void flashcalw_write_all_gp_fuses(uint64_t value) +{ + uint32_t error_status = 0; + uint32_t gp_fuse_byte; + + for (gp_fuse_byte = 0; gp_fuse_byte < 8; gp_fuse_byte++, value >>= 8) { + flashcalw_write_gp_fuse_byte(gp_fuse_byte, value); + error_status |= flashcalw_error_status; + } + flashcalw_error_status = error_status; +} + +/*! \brief Sets a general-purpose fuse bit with the appropriate erase and write + * operations. + * + * \param gp_fuse_bit The general-purpose fuse bit: \c 0 to \c 63. + * \param value The value of the specified general-purpose fuse bit. + * + * \warning A Lock Error is issued if the Security bit is active and the command + * is applied to BOOTPROT. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + * + * \note The actual number of general-purpose fuse bits implemented by hardware + * is given by \c FLASH_GPF_NUM. The other bits among the 64 are + * fixed at 1 by hardware. + */ +void flashcalw_set_gp_fuse_bit(uint32_t gp_fuse_bit, bool value) +{ + if (value) { + flashcalw_erase_gp_fuse_bit(gp_fuse_bit, false); + } else { + flashcalw_write_gp_fuse_bit(gp_fuse_bit, false); + } +} + +/*! \brief Sets a general-purpose fuse bit-field with the appropriate erase and + * write operations. + * + * \param pos The bit-position of the general-purpose fuse bit-field: \c 0 to + * \c 63. + * \param width The bit-width of the general-purpose fuse bit-field: \c 0 to + * \c 64. + * \param value The value of the specified general-purpose fuse bit-field. + * + * \warning A Lock Error is issued if the Security bit is active and the command + * is applied to BOOTPROT. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + * + * \note The actual number of general-purpose fuse bits implemented by hardware + * is given by \c FLASH_GPF_NUM. The other bits among the 64 are + * fixed at 1 by hardware. + */ +void flashcalw_set_gp_fuse_bitfield(uint32_t pos, uint32_t width, + uint64_t value) +{ + uint32_t error_status = 0; + uint32_t gp_fuse_bit; + + pos &= 0x3F; + width = Min(width, 64); + + for (gp_fuse_bit = pos; gp_fuse_bit < pos + width; + gp_fuse_bit++, value >>= 1) { + flashcalw_set_gp_fuse_bit(gp_fuse_bit, value & 0x01); + error_status |= flashcalw_error_status; + } + flashcalw_error_status = error_status; +} + +/*! \brief Sets a general-purpose fuse byte with the appropriate erase and write + * operations. + * + * \param gp_fuse_byte The general-purpose fuse byte: \c 0 to \c 7. + * \param value The value of the specified general-purpose fuse byte. + * + * \warning A Lock Error is issued if the Security bit is active. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + * + * \note The actual number of general-purpose fuse bits implemented by hardware + * is given by \c FLASH_GPF_NUM. The other bits among the 64 are + * fixed at 1 by hardware. + */ +void flashcalw_set_gp_fuse_byte(uint32_t gp_fuse_byte, uint8_t value) +{ + uint32_t error_status; + + switch (value) { + case 0xFF: + flashcalw_erase_gp_fuse_byte(gp_fuse_byte, false); + break; + + case 0x00: + flashcalw_write_gp_fuse_byte(gp_fuse_byte, 0x00); + break; + + default: + flashcalw_erase_gp_fuse_byte(gp_fuse_byte, false); + error_status = flashcalw_error_status; + flashcalw_write_gp_fuse_byte(gp_fuse_byte, value); + flashcalw_error_status |= error_status; + break; + } +} + +/*! \brief Sets all general-purpose fuses with the appropriate erase and write + * operations. + * + * \param value The value of all general-purpose fuses as a word. + * + * \warning A Lock Error is issued if the Security bit is active. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + * + * \note The actual number of general-purpose fuse bits implemented by hardware + * is given by \c FLASH_GPF_NUM. The other bits among the 64 are + * fixed at 1 by hardware. + */ +void flashcalw_set_all_gp_fuses(uint64_t value) +{ + uint32_t error_status; + + switch (value) { + case 0xFFFFFFFFFFFFFFFFULL: + flashcalw_erase_all_gp_fuses(false); + break; + + case 0x0000000000000000ULL: + flashcalw_write_all_gp_fuses(0x0000000000000000ULL); + break; + + default: + flashcalw_erase_all_gp_fuses(false); + error_status = flashcalw_error_status; + flashcalw_write_all_gp_fuses(value); + flashcalw_error_status |= error_status; + break; + } +} + + +//! @} + +/*! \name Access to Flash Pages + */ +//! @{ + + +/*! \brief Clears the page buffer. + * + * This command resets all bits in the page buffer to one. Write accesses to the + * page buffer can only change page buffer bits from one to zero. + * + * \warning The page buffer is not automatically reset after a page write. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + */ +void flashcalw_clear_page_buffer(void) +{ + flashcalw_issue_command(FLASHCALW_FCMD_CMD_CPB, -1); +} + +/*! \brief Tells whether the page to which the last Quick Page Read or Quick + * Page Read User Page command was applied was erased. + * + * \return Whether the page to which the last Quick Page Read or Quick Page Read + * User Page command was applied was erased. + */ +bool flashcalw_is_page_erased(void) +{ + return ((HFLASHC->FLASHCALW_FSR & FLASHCALW_FSR_QPRR) != 0); +} + +/*! \brief Applies the Quick Page Read command to a page. + * + * \param page_number The page number: + * \arg \c 0 to (flashcalw_get_page_count() - 1): a page number + * within the flash array; + * \arg < 0: the current page number. + * + * \return Whether the specified page is erased. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + */ +bool flashcalw_quick_page_read(int page_number) +{ + flashcalw_issue_command(FLASHCALW_FCMD_CMD_QPR, page_number); + return flashcalw_is_page_erased(); +} + +/*! \brief Erases a page. + * + * \param page_number The page number: + * \arg \c 0 to (flashcalw_get_page_count() - 1): a page number + * within the flash array; + * \arg < 0: the current page number. + * \param check Whether to check erase: \c true or \c false. + * + * \return Whether the erase succeeded or always \c true if erase check was not + * requested. + * + * \warning A Lock Error is issued if the command is applied to a page belonging + * to a locked region or to the bootloader protected area. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + * + * \note An erase operation can only set bits. + */ +bool flashcalw_erase_page(int page_number, bool check) +{ + bool page_erased = true; + + flashcalw_issue_command(FLASHCALW_FCMD_CMD_EP, page_number); + + if (check) { + uint32_t error_status = flashcalw_error_status; + page_erased = flashcalw_quick_page_read(-1); + flashcalw_error_status |= error_status; + } + + return page_erased; +} + +/*! \brief Erases all pages within the flash array. + * + * \param check Whether to check erase: \c true or \c false. + * + * \return Whether the erase succeeded or always \c true if erase check was not + * requested. + * + * \warning A Lock Error is issued if at least one region is locked or the + * bootloader protection is active. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + * + * \note An erase operation can only set bits. + */ +bool flashcalw_erase_all_pages(bool check) +{ + bool all_pages_erased = true; + uint32_t error_status = 0; + uint32_t page_number = flashcalw_get_page_count(); + + while (page_number) { + all_pages_erased &= flashcalw_erase_page(--page_number, check); + error_status |= flashcalw_error_status; + } + + flashcalw_error_status = error_status; + return all_pages_erased; +} + +/*! \brief Writes a page from the page buffer. + * + * \param page_number The page number: + * \arg \c 0 to (flashcalw_get_page_count() - 1): a page number + * within the flash array; + * \arg < 0: the current page number. + * + * \warning A Lock Error is issued if the command is applied to a page belonging + * to a locked region or to the bootloader protected area. + * + * \warning The page buffer is not automatically reset after a page write. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + * + * \note A write operation can only clear bits; in other words, an erase + * operation must first be done if some bits need to be set to 1. + */ +void flashcalw_write_page(int page_number) +{ + flashcalw_issue_command(FLASHCALW_FCMD_CMD_WP, page_number); +} + +/*! \brief Issues a Quick Page Read User Page command to the FLASHCALW. + * + * \return Whether the User page is erased. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + */ +bool flashcalw_quick_user_page_read(void) +{ + flashcalw_issue_command(FLASHCALW_FCMD_CMD_QPRUP, -1); + return flashcalw_is_page_erased(); +} + +/*! \brief Erases the User page. + * + * \param check Whether to check erase: \c true or \c false. + * + * \return Whether the erase succeeded or always \c true if erase check was not + * requested. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + * + * \note An erase operation can only set bits. + */ +bool flashcalw_erase_user_page(bool check) +{ + flashcalw_issue_command(FLASHCALW_FCMD_CMD_EUP, -1); + return (check) ? flashcalw_quick_user_page_read() : true; +} + +/*! \brief Writes the User page from the page buffer. + * + * \warning The page buffer is not automatically reset after a page write. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + * + * \note A write operation can only clear bits; in other words, an erase + * operation must first be done if some bits need to be set to 1. + */ +void flashcalw_write_user_page(void) +{ + flashcalw_issue_command(FLASHCALW_FCMD_CMD_WUP, -1); +} + +/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst + * from the repeated \a src source byte. + * + * All pointer and size alignments are supported. + * + * \param dst Pointer to flash destination. + * \param src Source byte. + * \param nbytes Number of bytes to set. + * \param erase Whether to erase before writing: \c true or \c false. + * + * \return The value of \a dst. + * + * \warning This function may be called with \a erase set to \c false only if + * the destination consists only of erased words, i.e. this function + * cannot be used to write only one bit of a previously written word. + * E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the + * resulting value in flash may be different from \c 0x00000000. + * + * \warning A Lock Error is issued if the command is applied to pages belonging + * to a locked region or to the bootloader protected area. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + */ +volatile void *flashcalw_memset8(volatile void *dst, uint8_t src, size_t nbytes, + bool erase) +{ + return flashcalw_memset16(dst, src | (uint16_t)src << 8, nbytes, erase); +} + +/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst + * from the repeated \a src big-endian source half-word. + * + * All pointer and size alignments are supported. + * + * \param dst Pointer to flash destination. + * \param src Source half-word. + * \param nbytes Number of bytes to set. + * \param erase Whether to erase before writing: \c true or \c false. + * + * \return The value of \a dst. + * + * \warning This function may be called with \a erase set to \c false only if + * the destination consists only of erased words, i.e. this function + * can not be used to write only one bit of a previously written word. + * E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the + * resulting value in flash may be different from \c 0x00000000. + * + * \warning A Lock Error is issued if the command is applied to pages belonging + * to a locked region or to the bootloader protected area. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + */ +volatile void *flashcalw_memset16(volatile void *dst, uint16_t src, + size_t nbytes, bool erase) +{ + return flashcalw_memset32(dst, src | (uint32_t)src << 16, nbytes, + erase); +} + +/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst + * from the repeated \a src big-endian source word. + * + * All pointer and size alignments are supported. + * + * \param dst Pointer to flash destination. + * \param src Source word. + * \param nbytes Number of bytes to set. + * \param erase Whether to erase before writing: \c true or \c false. + * + * \return The value of \a dst. + * + * \warning This function may be called with \a erase set to \c false only if + * the destination consists only of erased words, i.e. this function + * can not be used to write only one bit of a previously written word. + * E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the + * resulting value in flash may be different from \c 0x00000000. + * + * \warning A Lock Error is issued if the command is applied to pages belonging + * to a locked region or to the bootloader protected area. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + */ +volatile void *flashcalw_memset32(volatile void *dst, uint32_t src, + size_t nbytes, bool erase) +{ + return flashcalw_memset64(dst, src | (uint64_t)src << 32, nbytes, + erase); +} + +/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst + * from the repeated \a src big-endian source double-word. + * + * All pointer and size alignments are supported. + * + * \param dst Pointer to flash destination. + * \param src Source double-word. + * \param nbytes Number of bytes to set. + * \param erase Whether to erase before writing: \c true or \c false. + * + * \return The value of \a dst. + * + * \warning This function may be called with \a erase set to \c false only if + * the destination consists only of erased words, i.e. this function + * can not be used to write only one bit of a previously written word. + * E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the + * resulting value in flash may be different from \c 0x00000000. + * + * \warning A Lock Error is issued if the command is applied to pages belonging + * to a locked region or to the bootloader protected area. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + */ +volatile void *flashcalw_memset64(volatile void *dst, uint64_t src, + size_t nbytes, bool erase) +{ + /* Use aggregated pointers to have several alignments available for a + * same address. */ + UnionCVPtr flash_array_end; + UnionVPtr dest; + Union64 source = {0}; + StructCVPtr dest_end; + UnionCVPtr flash_page_source_end; + bool incomplete_flash_page_end; + Union64 flash_dword; + UnionVPtr tmp; + uint32_t error_status = 0; + uint32_t i; + + /* Reformat arguments. */ + flash_array_end.u8ptr = ((uint8_t *)FLASH_ADDR) + + flashcalw_get_flash_size(); + dest.u8ptr = dst; + for (i = (Get_align((uint32_t)dest.u8ptr, sizeof(uint64_t)) - 1) + & (sizeof(uint64_t) - 1); src; + i = (i - 1) & (sizeof(uint64_t) - 1)) { + source.u8[i] = src; + src >>= 8; + } + dest_end.u8ptr = dest.u8ptr + nbytes; + + /* If destination is outside flash, go to next flash page if any. */ + if (dest.u8ptr < (uint8_t *)FLASH_ADDR) { + dest.u8ptr = (uint8_t *)FLASH_ADDR; + } else if (flash_array_end.u8ptr <= dest.u8ptr && + dest.u8ptr < (uint8_t *)FLASH_USER_PAGE_ADDR) { + dest.u8ptr = (uint8_t *)FLASH_USER_PAGE_ADDR; + } + + /* If end of destination is outside flash, move it to the end of the + * previous flash page if any. */ + if (dest_end.u8ptr > + (((uint8_t *)FLASH_USER_PAGE_ADDR) + FLASH_PAGE_SIZE)) { + dest_end.u8ptr = (uint8_t *)FLASH_USER_PAGE_ADDR + + FLASH_PAGE_SIZE; + } else if ((uint8_t *)FLASH_USER_PAGE_ADDR >= dest_end.u8ptr && + dest_end.u8ptr > flash_array_end.u8ptr) { + dest_end.u8ptr = flash_array_end.u8ptr; + } + + /* Align each end of destination pointer with its natural boundary. */ + dest_end.u16ptr = (uint16_t *)Align_down((uint32_t)dest_end.u8ptr, + sizeof(uint16_t)); + dest_end.u32ptr = (uint32_t *)Align_down((uint32_t)dest_end.u16ptr, + sizeof(uint32_t)); + dest_end.u64ptr = (uint64_t *)Align_down((uint32_t)dest_end.u32ptr, + sizeof(uint64_t)); + + /* While end of destination is not reached... */ + while (dest.u8ptr < dest_end.u8ptr) { + /* Clear the page buffer in order to prepare data for a flash + * page write. */ + flashcalw_clear_page_buffer(); + error_status |= flashcalw_error_status; + + /* Determine where the source data will end in the current flash + * page. */ + flash_page_source_end.u64ptr + = (uint64_t *)Min((uint32_t)dest_end.u64ptr, + Align_down((uint32_t)dest.u8ptr, + (uint32_t)FLASH_PAGE_SIZE) + FLASH_PAGE_SIZE); + + /* Determine if the current destination page has an incomplete + * end. */ + incomplete_flash_page_end + = (Align_down((uint32_t)dest.u8ptr, + (uint32_t)FLASH_PAGE_SIZE) + >= Align_down((uint32_t)dest_end.u8ptr, + (uint32_t)FLASH_PAGE_SIZE)); + + /* Use a flash double-word buffer to manage unaligned accesses. */ + flash_dword.u64 = source.u64; + + /* If destination does not point to the beginning of the current + * flash page... */ + if (!Test_align((uint32_t)dest.u8ptr, FLASH_PAGE_SIZE)) { + /* Fill the beginning of the page buffer with the + * current flash page data. + * This is required by the hardware, even if page erase + * is not requested, in order to be able to write + * successfully to erased parts of flash pages that have + * already been written to. */ + for (tmp.u8ptr = (uint8_t *)Align_down((uint32_t)dest.u8ptr, + (uint32_t)FLASH_PAGE_SIZE); + tmp.u64ptr < (uint64_t *)Align_down( + (uint32_t)dest.u8ptr, + sizeof(uint64_t)); + tmp.u64ptr++) { + *tmp.u32ptr = *tmp.u32ptr; + *(tmp.u32ptr + 1) = *(tmp.u32ptr + 1); + } + + /* If destination is not 64-bit aligned... */ + if (!Test_align((uint32_t)dest.u8ptr, + sizeof(uint64_t))) { + /* Fill the beginning of the flash double-word + * buffer with the current flash page data. + * This is required by the hardware, even if + * page erase is not requested, in order to be + * able to write successfully to erased parts + * of flash pages that have already been written + * to. */ + for (i = 0; i < Get_align((uint32_t)dest.u8ptr, + sizeof(uint64_t)); i++) { + flash_dword.u8[i] = *tmp.u8ptr++; + } + + /* Align the destination pointer with its 64-bit + * boundary. */ + dest.u64ptr = (uint64_t *)Align_down( + (uint32_t)dest.u8ptr, + sizeof(uint64_t)); + + /* If the current destination double-word is not + * the last one... */ + if (dest.u64ptr < dest_end.u64ptr) { + /* Write the flash double-word buffer to + the page buffer and reinitialize it. */ + *dest.u32ptr++ = flash_dword.u32[0]; + *dest.u32ptr++ = flash_dword.u32[1]; + flash_dword.u64 = source.u64; + } + } + } + + /* Write the source data to the page buffer with 64-bit + * alignment. */ + for (i = flash_page_source_end.u64ptr - dest.u64ptr; i; i--) { + *dest.u32ptr++ = source.u32[0]; + *dest.u32ptr++ = source.u32[1]; + } + + /* If the current destination page has an incomplete end... */ + if (incomplete_flash_page_end) { + /* This is required by the hardware, even if page erase + * is not requested, in order to be able to write + * successfully to erased parts of flash pages that have + * already been written to. */ + { + tmp.u8ptr = (volatile uint8_t *)dest_end.u8ptr; + + /* If end of destination is not 64-bit aligned. */ + if (!Test_align((uint32_t)dest_end.u8ptr, + sizeof(uint64_t))) { + /* Fill the end of the flash double-word + * buffer with the current flash page + * data. */ + for (i = Get_align( + (uint32_t)dest_end.u8ptr, + sizeof(uint64_t)); + i < sizeof(uint64_t); + i++) { + flash_dword.u8[i] = *tmp.u8ptr++; + } + + /* Write the flash double-word buffer to + * the page buffer. */ + *dest.u32ptr++ = flash_dword.u32[0]; + *dest.u32ptr++ = flash_dword.u32[1]; + } + + /* Fill the end of the page buffer with the + current flash page data. */ + for (; !Test_align((uint32_t)tmp.u64ptr, + FLASH_PAGE_SIZE); tmp.u64ptr++){ + *tmp.u32ptr = *tmp.u32ptr; + *(tmp.u32ptr + 1) = *(tmp.u32ptr + 1); + } + } + } + + /* If the current flash page is in the flash array... */ + if (dest.u8ptr <= (uint8_t *)FLASH_USER_PAGE_ADDR) { + /* Erase the current page if requested and write it from + * the page buffer. */ + if (erase) { + flashcalw_erase_page(-1, false); + error_status |= flashcalw_error_status; + } + + flashcalw_write_page(-1); + error_status |= flashcalw_error_status; + + /* If the end of the flash array is reached, go to the + * User page. */ + if (dest.u8ptr >= flash_array_end.u8ptr) { + dest.u8ptr = (uint8_t *)FLASH_USER_PAGE_ADDR; + } + } else { + /* Erase the User page if requested and write it from + * the page buffer. */ + if (erase) { + flashcalw_erase_user_page(false); + error_status |= flashcalw_error_status; + } + + flashcalw_write_user_page(); + error_status |= flashcalw_error_status; + } + } + + /* Update the FLASHC error status. */ + flashcalw_error_status = error_status; + + /* Return the initial destination pointer as the standard memset + * function does. */ + return dst; +} + +/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst + * from the source pointed to by \a src. + * + * The destination areas that are not within the flash + * array or the User page are caught by an Assert() operation. + * + * All pointer and size alignments are supported. + * + * \param dst Pointer to flash destination. + * \param src Pointer to source data. + * \param nbytes Number of bytes to copy. + * \param erase Whether to erase before writing: \c true or \c false. + * + * \return The value of \a dst. + * + * \warning If copying takes place between areas that overlap, the behavior is + * undefined. + * + * \warning This function may be called with \a erase set to \c false only if + * the destination consists only of erased words, i.e. this function + * can not be used to write only one bit of a previously written word. + * E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the + * resulting value in flash may be different from \c 0x00000000. + * + * \warning A Lock Error is issued if the command is applied to pages belonging + * to a locked region or to the bootloader protected area. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + */ +volatile void *flashcalw_memcpy(volatile void *dst, const void *src, + size_t nbytes, bool erase) +{ + uint16_t page_pos; + Union64 flash_dword; + uint8_t i; + bool b_user_page; + uint32_t error_status = 0; + volatile uint8_t *flash_add; + volatile uint8_t *dest_add = (uint8_t *)dst; + const uint8_t *src_buf = (const uint8_t *)src; + + /* Copy area must be in flash array or flash user page */ + Assert((((uint8_t *)dst >= (uint8_t *)FLASH_ADDR) && + (((uint8_t *)dst + nbytes) + <= (((uint8_t *)FLASH_ADDR) + + flashcalw_get_flash_size()))) || + (((uint8_t *)dst >= (uint8_t *)FLASH_USER_PAGE_ADDR) && + (((uint8_t *)dst + nbytes) + <= (((uint8_t *)FLASH_USER_PAGE_ADDR) + + FLASH_PAGE_SIZE)))); + + b_user_page = (volatile uint8_t *)dst + >= (uint8_t *)FLASH_USER_PAGE_ADDR; + + flash_add = (uint8_t *)((uint32_t)dest_add + - ((uint32_t)dest_add % FLASH_PAGE_SIZE)); + + while (nbytes) { + /* Clear the page buffer in order to prepare data for a flash + * page write. */ + flashcalw_clear_page_buffer(); + error_status |= flashcalw_error_status; + + /* Loop in the page */ + for (page_pos = 0; page_pos < FLASH_PAGE_SIZE; + page_pos += sizeof(uint64_t)) { + /* Read the flash double-word buffer */ + flash_dword.u64 = *(volatile uint64_t *)flash_add; + + /* Update double-word if necessary */ + for (i = 0; i < sizeof(uint64_t); i++) { + if (nbytes && (flash_add == dest_add)) { + /* Update page with data source */ + flash_dword.u8[i] = *src_buf++; + dest_add++; + nbytes--; + } + + flash_add++; + } + + /* Write the flash double-word buffer to the page buffer */ + *(volatile uint64_t *)((uint32_t)flash_add + - sizeof(uint64_t)) = flash_dword.u64; + } + + /* Erase the current page if requested and write it from the + * page buffer. */ + if (erase) { + (b_user_page) ? flashcalw_erase_user_page(false) + : flashcalw_erase_page(-1, false); + error_status |= flashcalw_error_status; + } + + /* Write the page */ + (b_user_page) ? flashcalw_write_user_page() + : flashcalw_write_page(-1); + error_status |= flashcalw_error_status; + } + /* Update the FLASHC error status. */ + flashcalw_error_status = error_status; + + /* Return the initial destination pointer as the standard memcpy + * function does. */ + return dst; +} + +/** @} */ + + +/*! \name PicoCache interfaces + */ +//! @{ + +/** + * \brief Enable PicoCache. + */ +void flashcalw_picocache_enable(void) +{ + sysclk_enable_peripheral_clock(HCACHE); + HCACHE->HCACHE_CTRL = HCACHE_CTRL_CEN_YES; + + while (!(flashcalw_picocache_get_status() & HCACHE_SR_CSTS_EN)) { + } +} + +/** + * \brief Disable PicoCache. + */ +void flashcalw_picocache_disable(void) +{ + HCACHE->HCACHE_MAINT0 = HCACHE_MAINT0_INVALL_YES; + HCACHE->HCACHE_CTRL = HCACHE_CTRL_CEN_NO; + + while (flashcalw_picocache_get_status() != HCACHE_SR_CSTS_DIS) { + } + + sysclk_disable_peripheral_clock(HCACHE); +} + +/** + * \brief Get PicoCache status. + * + * \return 1 If PicoCahe is enabled, else disabled. + */ +uint32_t flashcalw_picocache_get_status(void) +{ + return HCACHE->HCACHE_SR; +} + +/** + * \brief Invalid all PicoCache lines. + */ +void flashcalw_picocache_invalid_all(void) +{ + HCACHE->HCACHE_MAINT0 = HCACHE_MAINT0_INVALL_YES; +} + +/** + * \brief Invalid specific cache line. + * + * \param index Lines to be invalid. + */ +void flashcalw_picocache_invalid_line(uint32_t index) +{ + /* Disable the cache controller */ + HCACHE->HCACHE_CTRL = HCACHE_CTRL_CEN_NO; + + /* Wait for disable successfully */ + while (flashcalw_picocache_get_status() != HCACHE_SR_CSTS_DIS) { + } + + /* Invalid the line */ + HCACHE->HCACHE_MAINT1 = index; + + /* Enable the cache again */ + HCACHE->HCACHE_CTRL = HCACHE_CTRL_CEN_YES; +} + +/** + * \brief Set PicoCache monitor mode. + * + * \param mode PicoCache mode, 0 for cycle, 1 for instruction hit and 2 for data + *hit. + */ +void flashcalw_picocache_set_monitor_mode(uint32_t mode) +{ + HCACHE->HCACHE_MCFG = mode; +} + +/** + * \brief Enable PicoCache monitor. + */ +void flashcalw_picocache_enable_monitor(void) +{ + HCACHE->HCACHE_MEN = HCACHE_MEN_MENABLE_EN; +} + +/** + * \brief Disable PicoCache monitor. + */ +void flashcalw_picocache_disable_monitor(void) +{ + HCACHE->HCACHE_MEN = HCACHE_MEN_MENABLE_DIS; +} + +/** + * \brief Reset PicoCache monitor. + */ +void flashcalw_picocache_reset_monitor( void ) +{ + HCACHE->HCACHE_MCTRL = HCACHE_MCTRL_SWRST_YES; +} + +/** + * \brief Get PicoCache monitor count number. + * + * \return Monitor counter number. + */ +uint32_t flashcalw_picocache_get_monitor_cnt( void ) +{ + return HCACHE->HCACHE_MSR; +} + +/** + * \brief Get PicoCache version. + * + * \return PicoCache version. + */ +uint32_t flashcalw_picocache_get_version( void ) +{ + return HCACHE->HCACHE_VERSION; +} + +/** @} */ + +/** + * \} + */ + +/// @cond 0 +/**INDENT-OFF**/ +#ifdef __cplusplus +} +#endif +/**INDENT-ON**/ +/// @endcond diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/flashcalw/flashcalw.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/flashcalw/flashcalw.h new file mode 100644 index 000000000..cd450a069 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/drivers/flashcalw/flashcalw.h @@ -0,0 +1,399 @@ +/** + * \file + * + * \brief FlashCALW driver for SAM4L. + * + * Copyright (c) 2012-2013 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#ifndef FLASHCALW_H_INCLUDED +#define FLASHCALW_H_INCLUDED + +#include +#include +#include "compiler.h" + +/* These defines should be part of the auto-generated header files */ +#if (!defined FLASH_PAGE_SIZE) +# define FLASH_PAGE_SIZE 512UL +#endif +#if (!defined FLASH_NB_OF_REGIONS) +# define FLASH_NB_OF_REGIONS 16 +#endif + + +/* ! Number of flash regions defined by the FLASHCALW. */ +#define FLASHCALW_REGIONS FLASH_NB_OF_REGIONS + +/** \brief Maximum operating frequency when FWS is 1 in PS0 mode and + the Fast wakeup is enabled */ +#define FLASH_FREQ_PS1_FWS_1_FWU_MAX_FREQ (12000000UL) +/** \brief Maximum operating frequency when FWS is 0 in PS0 mode */ +#define FLASH_FREQ_PS0_FWS_0_MAX_FREQ (18000000UL) +/** \brief Maximum operating frequency when FWS is 1 in PS0 mode */ +#define FLASH_FREQ_PS0_FWS_1_MAX_FREQ (36000000UL) +/** \brief Maximum operating frequency when FWS is 0 in PS1 mode */ +#define FLASH_FREQ_PS1_FWS_0_MAX_FREQ (8000000UL) +/** \brief Maximum operating frequency when FWS is 1 in PS1 mode */ +#define FLASH_FREQ_PS1_FWS_1_MAX_FREQ (12000000UL) +/** \brief Maximum operating frequency when FWS is 0 in PS2 mode */ +#define FLASH_FREQ_PS2_FWS_0_MAX_FREQ (24000000UL) +/** \brief Maximum operating frequency when FWS is 1 in PS2 mode */ +#define FLASH_FREQ_PS2_FWS_1_MAX_FREQ (48000000UL) +/*! \name Flash Properties + */ +//! @{ + +uint32_t flashcalw_get_flash_size(void); + +uint32_t flashcalw_get_page_count(void); + +uint32_t flashcalw_get_page_count_per_region(void); + +uint32_t flashcalw_get_page_region(int32_t page_number); + +uint32_t flashcalw_get_region_first_page_number(uint32_t region); + +//! @} + + +/*! \name FLASHCALW Control + */ +//! @{ + +uint32_t flashcalw_get_wait_state(void); + +void flashcalw_set_wait_state(uint32_t wait_state); + +void flashcalw_set_flash_waitstate_and_readmode(uint32_t cpu_f_hz, + uint32_t ps_value, bool is_fwu_enabled); + +/*! \brief Alias on the flashcalw_set_flash_waitstate_and_readmode() function. + * + * \param cpu_f_hz The CPU frequency + * \param ps_value (boolean), Power Scaling mode + * \param is_fwu_enabled (boolean), Fast wakeup mode + */ +#define flash_set_bus_freq(cpu_f_hz, ps_value, is_fwu_enabled) \ + flashcalw_set_flash_waitstate_and_readmode(cpu_f_hz, ps_value, is_fwu_enabled) + +bool flashcalw_is_ready_int_enabled(void); + +void flashcalw_enable_ready_int(bool enable); + +bool flashcalw_is_lock_error_int_enabled(void); + +void flashcalw_enable_lock_error_int(bool enable); + +bool flashcalw_is_prog_error_int_enabled(void); + +void flashcalw_enable_prog_error_int(bool enable); + +//! @} + + +/*! \name FLASHCALW Status + */ +//! @{ + +bool flashcalw_is_ready(void); + +void flashcalw_default_wait_until_ready(void); + +extern void (*volatile flashcalw_wait_until_ready)(void); + +bool flashcalw_is_lock_error(void); + +bool flashcalw_is_programming_error(void); + +//! @} + + +/*! \name FLASHCALW Command Control + */ +//! @{ + +uint32_t flashcalw_get_command(void); + +uint32_t flashcalw_get_page_number(void); + +void flashcalw_issue_command(uint32_t command, int page_number); + +//! @} + + +/*! \name FLASHCALW Global Commands + */ +//! @{ + +void flashcalw_no_operation(void); + +void flashcalw_erase_all(void); + +//! @} + + +/*! \name FLASHCALW Protection Mechanisms + */ +//! @{ + +bool flashcalw_is_security_bit_active(void); + +void flashcalw_set_security_bit(void); + +bool flashcalw_is_page_region_locked(uint32_t page_number); + +bool flashcalw_is_region_locked(uint32_t region); + +void flashcalw_lock_page_region(int page_number, bool lock); + +void flashcalw_lock_region(uint32_t region, bool lock); + +void flashcalw_lock_all_regions(bool lock); + +//! @} + + +/*! \name Access to General-Purpose Fuses + */ +//! @{ + +bool flashcalw_read_gp_fuse_bit(uint32_t gp_fuse_bit); + +uint64_t flashcalw_read_gp_fuse_bitfield(uint32_t pos, uint32_t width); + +uint8_t flashcalw_read_gp_fuse_byte(uint32_t gp_fuse_byte); + +uint64_t flashcalw_read_all_gp_fuses(void); + +bool flashcalw_erase_gp_fuse_bit(uint32_t gp_fuse_bit, bool check); + +bool flashcalw_erase_gp_fuse_bitfield(uint32_t pos, uint32_t width, + bool check); + +bool flashcalw_erase_gp_fuse_byte(uint32_t gp_fuse_byte, bool check); + +bool flashcalw_erase_all_gp_fuses(bool check); + +void flashcalw_write_gp_fuse_bit(uint32_t gp_fuse_bit, bool value); + +void flashcalw_write_gp_fuse_bitfield(uint32_t pos, uint32_t width, + uint64_t value); + +void flashcalw_write_gp_fuse_byte(uint32_t gp_fuse_byte, uint8_t value); + +void flashcalw_write_all_gp_fuses(uint64_t value); + +void flashcalw_set_gp_fuse_bit(uint32_t gp_fuse_bit, bool value); + +void flashcalw_set_gp_fuse_bitfield(uint32_t pos, uint32_t width, + uint64_t value); + +void flashcalw_set_gp_fuse_byte(uint32_t gp_fuse_byte, uint8_t value); + +void flashcalw_set_all_gp_fuses(uint64_t value); + +//! @} + + +/*! \name Access to Flash Pages + */ +//! @{ + +void flashcalw_clear_page_buffer(void); + +bool flashcalw_is_page_erased(void); + +bool flashcalw_quick_page_read(int page_number); + +bool flashcalw_erase_page(int page_number, bool check); + +bool flashcalw_erase_all_pages(bool check); + +void flashcalw_write_page(int page_number); + +bool flashcalw_quick_user_page_read(void); + +bool flashcalw_erase_user_page(bool check); + +void flashcalw_write_user_page(void); + +volatile void *flashcalw_memset8(volatile void *dst, uint8_t src, + size_t nbytes, bool erase); + +volatile void *flashcalw_memset16(volatile void *dst, uint16_t src, + size_t nbytes, bool erase); + +volatile void *flashcalw_memset32(volatile void *dst, uint32_t src, + size_t nbytes, bool erase); + +volatile void *flashcalw_memset64(volatile void *dst, uint64_t src, + size_t nbytes, bool erase); + +/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst + * from the repeated \a src big-endian source pattern. + * + * All pointer and size alignments are supported. + * + * \param dst Pointer to flash destination. + * \param src Source double-word. + * \param src_width \a src width in bits: 8, 16, 32 or 64. + * \param nbytes Number of bytes to set. + * \param erase Whether to erase before writing: \c true or \c false. + * + * \return The value of \a dst. + * + * \warning This function may be called with \a erase set to \c false only if + * the destination consists only of erased words, i.e. this function + * can not be used to write only one bit of a previously written word. + * E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the + * resulting value in flash may be different from \c 0x00000000. + * + * \warning A Lock Error is issued if the command is applied to pages belonging + * to a locked region or to the bootloader protected area. + * + * \note The FLASHCALW error status returned by \ref flashcalw_is_lock_error and + * \ref flashcalw_is_programming_error is updated. + */ +#define flashcalw_memset(dst, src, src_width, nbytes, erase) \ + TPASTE2(flashcalw_memset, src_width) ((dst), (src), (nbytes), (erase)) + +volatile void *flashcalw_memcpy(volatile void *dst, const void *src, + size_t nbytes, bool erase); + +//! @} + +/*! \name PicoCache interfaces. + */ +//! @{ + +void flashcalw_picocache_enable(void); + +void flashcalw_picocache_disable(void); + +uint32_t flashcalw_picocache_get_status(void); + +void flashcalw_picocache_invalid_all(void); + +void flashcalw_picocache_invalid_line(uint32_t index); + +void flashcalw_picocache_set_monitor_mode(uint32_t mode); + +void flashcalw_picocache_enable_monitor(void); + +void flashcalw_picocache_disable_monitor(void); + +void flashcalw_picocache_reset_monitor( void ); + +uint32_t flashcalw_picocache_get_monitor_cnt( void ); + +uint32_t flashcalw_picocache_get_version( void ); + +//! @} + +/** + * \page sam_flashcalw_quickstart Quickstart guide for SAM FLASHCALW driver + * + * This is the quickstart guide for the \ref group_sam_drivers_flashcalw + * "SAM FLASHCALW driver", with step-by-step instructions on how to + * configure and use the driver in a selection of use cases. + * + * The use cases contain several code fragments. The code fragments in the + * steps for setup can be copied into a custom initialization function, while + * the steps for usage can be copied into, e.g., the main application function. + * + * \section flashcalw_basic_use_case Basic use case + * In this basic use case, the last page page and the user page will be written + * with a specific magic number. + * + * \subsection sam_flashcalw_quickstart_prereq Prerequisites + * -# \ref sysclk_group "System Clock Management (Sysclock)" + * + * \section flashcalw_basic_use_case_setup Setup steps + * \note The CLK_FLASHCALW_AHB, CLK_FLASHCALW_APB are enabled + * by default. + * \subsection flashcalw_basic_use_case_setup_code Example code + * Enable the following macro in the conf_clock.h: + * \code + * #define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_RCFAST + * #define CONFIG_RCFAST_FRANGE 2 + * \endcode + * + * Add the following code in the application C-file: + * \code + * sysclk_init(); + * \endcode + * + * \subsection flashcalw_basic_use_case_setup_flow Workflow + * -# Set system clock source as fast RC oscillator: + * - \code #define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_RCFAST \endcode + * -# Set fast RC oscillator as 12MHz: + * - \code #define CONFIG_RCFAST_FRANGE 2 \endcode + * -# Initialize the system clock. + * - \code sysclk_init(); \endcode + * + * \section flashcalw_basic_use_case_usage Usage steps + * \subsection flashcalw_basic_use_case_usage_code Example code + * Add to, e.g., main loop in application C-file: + * \code + * #define MAGIC_NUM 0x4c4d5441 + * #define PAGE_ADDRESS (FLASH_ADDR + FLASH_SIZE - FLASH_PAGE_SIZE) + * #define USER_PAGE_ADDRESS (FLASH_USER_PAGE_ADDR + 8) + * static const uint32_t write_data = MAGIC_NUM; + * + * flashcalw_memcpy((void *)PAGE_ADDRESS, &write_data, 4, true); + * flashcalw_memcpy((void *)USER_PAGE_ADDRESS, &write_data, 4, true); + * \endcode + * + * \subsection flashcalw_basic_use_case_usage_flow Workflow + * -# Define the written locations and magic number: + * - \code #define MAGIC_NUM 0x4c4d5441 \endcode + * - \code #define PAGE_ADDRESS (FLASH_ADDR + FLASH_SIZE - FLASH_PAGE_SIZE) + * \endcode + * - \code USER_PAGE_ADDRESS (FLASH_USER_PAGE_ADDR + 8) \endcode + * - \note The storage location must not at the beginning of the user page as the first 2 + * words of the user page is reserved. + * - \code static const uint32_t write_data = MAGIC_NUM; \endcode + * -# Write the magic number to the flash array: + * - \code flashcalw_memcpy((void *)PAGE_ADDRESS, &write_data, 4, true); \endcode + * -# Write the magic number to the user page: + * - \code flashcalw_memcpy((void *)USER_PAGE_ADDRESS, &write_data, 4, true); + * \endcode + * + */ +#endif /* FLASHCALW_H_INCLUDED */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/include/sam4l.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/include/sam4l.h new file mode 100644 index 000000000..2ae33c6a8 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/include/sam4l.h @@ -0,0 +1,16184 @@ +/** + * \file + * + * Copyright (c) 2012-2013 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#ifndef SAM4L_H +#define SAM4L_H + +/** \addtogroup SAM4L_definitions SAM4L definitions + This file defines all structures and symbols for SAM4L: + - registers and bitfields + - peripheral base address + - peripheral ID + - PIO definitions +*/ +/*@{*/ + +#ifdef __cplusplus + extern "C" { +#endif + +#ifndef __ASSEMBLY__ +#include +#ifndef __cplusplus +typedef volatile const uint32_t RoReg; /**< Read only 32-bit register (volatile const unsigned int) */ +typedef volatile const uint16_t RoReg16; /**< Read only 16-bit register (volatile const unsigned int) */ +typedef volatile const uint8_t RoReg8; /**< Read only 8-bit register (volatile const unsigned int) */ +#else +typedef volatile uint32_t RoReg; /**< Read only 32-bit register (volatile const unsigned int) */ +typedef volatile uint16_t RoReg16; /**< Read only 16-bit register (volatile const unsigned int) */ +typedef volatile uint8_t RoReg8; /**< Read only 8-bit register (volatile const unsigned int) */ +#endif +typedef volatile uint32_t WoReg; /**< Write only 32-bit register (volatile unsigned int) */ +typedef volatile uint16_t WoReg16; /**< Write only 16-bit register (volatile unsigned int) */ +typedef volatile uint32_t WoReg8; /**< Write only 8-bit register (volatile unsigned int) */ +typedef volatile uint32_t RwReg; /**< Read-Write 32-bit register (volatile unsigned int) */ +typedef volatile uint16_t RwReg16; /**< Read-Write 16-bit register (volatile unsigned int) */ +typedef volatile uint8_t RwReg8; /**< Read-Write 8-bit register (volatile unsigned int) */ +#define CAST(type, value) ((type *)(value)) +#define REG_ACCESS(type, address) (*(type*)(address)) /**< C code: Register value */ +#else +#define CAST(type, value) (value) +#define REG_ACCESS(type, address) (address) /**< Assembly code: Register address */ +#endif + +/* ************************************************************************** */ +/* CMSIS DEFINITIONS FOR SAM4L */ +/* ************************************************************************** */ +/** \addtogroup SAM4L_cmsis CMSIS Definitions */ +/*@{*/ + + +/**< Interrupt Number Definition */ +typedef enum IRQn +{ +/****** Cortex-M4 Processor Exceptions Numbers ******************************/ + NonMaskableInt_IRQn = -14, /**< 2 Non Maskable Interrupt */ + HardFault_IRQn = -13, /**< 3 Cortex-M4 Hard Fault Interrupt */ + MemoryManagement_IRQn = -12, /**< 4 Cortex-M4 Memory Management Interrupt */ + BusFault_IRQn = -11, /**< 5 Cortex-M4 Bus Fault Interrupt */ + UsageFault_IRQn = -10, /**< 6 Cortex-M4 Usage Fault Interrupt */ + SVCall_IRQn = -5, /**< 11 Cortex-M4 SV Call Interrupt */ + DebugMonitor_IRQn = -4, /**< 12 Cortex-M4 Debug Monitor Interrupt */ + PendSV_IRQn = -2, /**< 14 Cortex-M4 Pend SV Interrupt */ + SysTick_IRQn = -1, /**< 15 Cortex-M4 System Tick Interrupt */ + /****** SAM4L specific Interrupt Numbers *********************************/ + HFLASHC_IRQn = 0, /**< 0 SAM4L Flash Controller (HFLASHC) */ + PDCA_0_IRQn = 1, /**< 1 SAM4L Peripheral DMA Controller (PDCA) */ + PDCA_1_IRQn = 2, /**< 2 SAM4L Peripheral DMA Controller (PDCA) */ + PDCA_2_IRQn = 3, /**< 3 SAM4L Peripheral DMA Controller (PDCA) */ + PDCA_3_IRQn = 4, /**< 4 SAM4L Peripheral DMA Controller (PDCA) */ + PDCA_4_IRQn = 5, /**< 5 SAM4L Peripheral DMA Controller (PDCA) */ + PDCA_5_IRQn = 6, /**< 6 SAM4L Peripheral DMA Controller (PDCA) */ + PDCA_6_IRQn = 7, /**< 7 SAM4L Peripheral DMA Controller (PDCA) */ + PDCA_7_IRQn = 8, /**< 8 SAM4L Peripheral DMA Controller (PDCA) */ + PDCA_8_IRQn = 9, /**< 9 SAM4L Peripheral DMA Controller (PDCA) */ + PDCA_9_IRQn = 10, /**< 10 SAM4L Peripheral DMA Controller (PDCA) */ + PDCA_10_IRQn = 11, /**< 11 SAM4L Peripheral DMA Controller (PDCA) */ + PDCA_11_IRQn = 12, /**< 12 SAM4L Peripheral DMA Controller (PDCA) */ + PDCA_12_IRQn = 13, /**< 13 SAM4L Peripheral DMA Controller (PDCA) */ + PDCA_13_IRQn = 14, /**< 14 SAM4L Peripheral DMA Controller (PDCA) */ + PDCA_14_IRQn = 15, /**< 15 SAM4L Peripheral DMA Controller (PDCA) */ + PDCA_15_IRQn = 16, /**< 16 SAM4L Peripheral DMA Controller (PDCA) */ + CRCCU_IRQn = 17, /**< 17 SAM4L CRC Calculation Unit (CRCCU) */ + USBC_IRQn = 18, /**< 18 SAM4L USB 2.0 Interface (USBC) */ + PEVC_TR_IRQn = 19, /**< 19 SAM4L Peripheral Event Controller (PEVC) */ + PEVC_OV_IRQn = 20, /**< 20 SAM4L Peripheral Event Controller (PEVC) */ + AESA_IRQn = 21, /**< 21 SAM4L Advanced Encryption Standard (AESA) */ + PM_IRQn = 22, /**< 22 SAM4L Power Manager (PM) */ + SCIF_IRQn = 23, /**< 23 SAM4L System Control Interface (SCIF) */ + FREQM_IRQn = 24, /**< 24 SAM4L Frequency Meter (FREQM) */ + GPIO_0_IRQn = 25, /**< 25 SAM4L General-Purpose Input/Output Controller (GPIO) */ + GPIO_1_IRQn = 26, /**< 26 SAM4L General-Purpose Input/Output Controller (GPIO) */ + GPIO_2_IRQn = 27, /**< 27 SAM4L General-Purpose Input/Output Controller (GPIO) */ + GPIO_3_IRQn = 28, /**< 28 SAM4L General-Purpose Input/Output Controller (GPIO) */ + GPIO_4_IRQn = 29, /**< 29 SAM4L General-Purpose Input/Output Controller (GPIO) */ + GPIO_5_IRQn = 30, /**< 30 SAM4L General-Purpose Input/Output Controller (GPIO) */ + GPIO_6_IRQn = 31, /**< 31 SAM4L General-Purpose Input/Output Controller (GPIO) */ + GPIO_7_IRQn = 32, /**< 32 SAM4L General-Purpose Input/Output Controller (GPIO) */ + GPIO_8_IRQn = 33, /**< 33 SAM4L General-Purpose Input/Output Controller (GPIO) */ + GPIO_9_IRQn = 34, /**< 34 SAM4L General-Purpose Input/Output Controller (GPIO) */ + GPIO_10_IRQn = 35, /**< 35 SAM4L General-Purpose Input/Output Controller (GPIO) */ + GPIO_11_IRQn = 36, /**< 36 SAM4L General-Purpose Input/Output Controller (GPIO) */ + BPM_IRQn = 37, /**< 37 SAM4L Backup Power Manager (BPM) */ + BSCIF_IRQn = 38, /**< 38 SAM4L Backup System Control Interface (BSCIF) */ + AST_ALARM_IRQn = 39, /**< 39 SAM4L Asynchronous Timer (AST) */ + AST_PER_IRQn = 40, /**< 40 SAM4L Asynchronous Timer (AST) */ + AST_OVF_IRQn = 41, /**< 41 SAM4L Asynchronous Timer (AST) */ + AST_READY_IRQn = 42, /**< 42 SAM4L Asynchronous Timer (AST) */ + AST_CLKREADY_IRQn = 43, /**< 43 SAM4L Asynchronous Timer (AST) */ + WDT_IRQn = 44, /**< 44 SAM4L Watchdog Timer (WDT) */ + EIC_1_IRQn = 45, /**< 45 SAM4L External Interrupt Controller (EIC) */ + EIC_2_IRQn = 46, /**< 46 SAM4L External Interrupt Controller (EIC) */ + EIC_3_IRQn = 47, /**< 47 SAM4L External Interrupt Controller (EIC) */ + EIC_4_IRQn = 48, /**< 48 SAM4L External Interrupt Controller (EIC) */ + EIC_5_IRQn = 49, /**< 49 SAM4L External Interrupt Controller (EIC) */ + EIC_6_IRQn = 50, /**< 50 SAM4L External Interrupt Controller (EIC) */ + EIC_7_IRQn = 51, /**< 51 SAM4L External Interrupt Controller (EIC) */ + EIC_8_IRQn = 52, /**< 52 SAM4L External Interrupt Controller (EIC) */ + IISC_IRQn = 53, /**< 53 SAM4L Inter-IC Sound (I2S) Controller (IISC) */ + SPI_IRQn = 54, /**< 54 SAM4L Serial Peripheral Interface (SPI) */ + TC00_IRQn = 55, /**< 55 SAM4L Timer/Counter 0 (TC0) */ + TC01_IRQn = 56, /**< 56 SAM4L Timer/Counter 0 (TC0) */ + TC02_IRQn = 57, /**< 57 SAM4L Timer/Counter 0 (TC0) */ + TC10_IRQn = 58, /**< 58 SAM4L Timer/Counter 1 (TC1) */ + TC11_IRQn = 59, /**< 59 SAM4L Timer/Counter 1 (TC1) */ + TC12_IRQn = 60, /**< 60 SAM4L Timer/Counter 1 (TC1) */ + TWIM0_IRQn = 61, /**< 61 SAM4L Two-wire Master Interface 0 (TWIM0) */ + TWIS0_IRQn = 62, /**< 62 SAM4L Two-wire Slave Interface 0 (TWIS0) */ + TWIM1_IRQn = 63, /**< 63 SAM4L Two-wire Master Interface 1 (TWIM1) */ + TWIS1_IRQn = 64, /**< 64 SAM4L Two-wire Slave Interface 1 (TWIS1) */ + USART0_IRQn = 65, /**< 65 SAM4L Universal Synchronous Asynchronous Receiver Transmitter 0 (USART0) */ + USART1_IRQn = 66, /**< 66 SAM4L Universal Synchronous Asynchronous Receiver Transmitter 1 (USART1) */ + USART2_IRQn = 67, /**< 67 SAM4L Universal Synchronous Asynchronous Receiver Transmitter 2 (USART2) */ + USART3_IRQn = 68, /**< 68 SAM4L Universal Synchronous Asynchronous Receiver Transmitter 3 (USART3) */ + ADCIFE_IRQn = 69, /**< 69 SAM4L ADC controller interface (ADCIFE) */ + DACC_IRQn = 70, /**< 70 SAM4L DAC Controller (DACC) */ + ACIFC_IRQn = 71, /**< 71 SAM4L Analog Comparator Interface (ACIFC) */ + ABDACB_IRQn = 72, /**< 72 SAM4L Audio Bitstream DAC (ABDACB) */ + TRNG_IRQn = 73, /**< 73 SAM4L True Random Number Generator (TRNG) */ + PARC_IRQn = 74, /**< 74 SAM4L Parallel Capture (PARC) */ + CATB_IRQn = 75, /**< 75 SAM4L Capacitive Touch Module B (CATB) */ + TWIM2_IRQn = 77, /**< 77 SAM4L Two-wire Master Interface 2 (TWIM2) */ + TWIM3_IRQn = 78, /**< 78 SAM4L Two-wire Master Interface 3 (TWIM3) */ + LCDCA_IRQn = 79 /**< 79 SAM4L LCD Controller (LCDCA) */ +} IRQn_Type; + + +/* Cortex-M4 core handlers */ +void Reset_Handler ( void ); +void NMI_Handler ( void ); +void HardFault_Handler ( void ); +void MemManage_Handler ( void ); +void BusFault_Handler ( void ); +void UsageFault_Handler ( void ); +void SVC_Handler ( void ); +void DebugMon_Handler ( void ); +void PendSV_Handler ( void ); +void SysTick_Handler ( void ); + +/* Peripherals handlers */ + +void HFLASHC_Handler( void ); +void PDCA_0_Handler( void ); +void PDCA_1_Handler( void ); +void PDCA_2_Handler( void ); +void PDCA_3_Handler( void ); +void PDCA_4_Handler( void ); +void PDCA_5_Handler( void ); +void PDCA_6_Handler( void ); +void PDCA_7_Handler( void ); +void PDCA_8_Handler( void ); +void PDCA_9_Handler( void ); +void PDCA_10_Handler( void ); +void PDCA_11_Handler( void ); +void PDCA_12_Handler( void ); +void PDCA_13_Handler( void ); +void PDCA_14_Handler( void ); +void PDCA_15_Handler( void ); +void CRCCU_Handler( void ); +void USBC_Handler( void ); +void PEVC_TR_Handler( void ); +void PEVC_OV_Handler( void ); +void AESA_Handler( void ); +void PM_Handler( void ); +void SCIF_Handler( void ); +void FREQM_Handler( void ); +void GPIO_0_Handler( void ); +void GPIO_1_Handler( void ); +void GPIO_2_Handler( void ); +void GPIO_3_Handler( void ); +void GPIO_4_Handler( void ); +void GPIO_5_Handler( void ); +void GPIO_6_Handler( void ); +void GPIO_7_Handler( void ); +void GPIO_8_Handler( void ); +void GPIO_9_Handler( void ); +void GPIO_10_Handler( void ); +void GPIO_11_Handler( void ); +void BPM_Handler( void ); +void BSCIF_Handler( void ); +void AST_ALARM_Handler( void ); +void AST_PER_Handler( void ); +void AST_OVF_Handler( void ); +void AST_READY_Handler( void ); +void AST_CLKREADY_Handler( void ); +void WDT_Handler( void ); +void EIC_1_Handler( void ); +void EIC_2_Handler( void ); +void EIC_3_Handler( void ); +void EIC_4_Handler( void ); +void EIC_5_Handler( void ); +void EIC_6_Handler( void ); +void EIC_7_Handler( void ); +void EIC_8_Handler( void ); +void IISC_Handler( void ); +void SPI_Handler( void ); +void TC00_Handler( void ); +void TC01_Handler( void ); +void TC02_Handler( void ); +void TC10_Handler( void ); +void TC11_Handler( void ); +void TC12_Handler( void ); +void TWIM0_Handler( void ); +void TWIS0_Handler( void ); +void TWIM1_Handler( void ); +void TWIS1_Handler( void ); +void USART0_Handler( void ); +void USART1_Handler( void ); +void USART2_Handler( void ); +void USART3_Handler( void ); +void ADCIFE_Handler( void ); +void DACC_Handler( void ); +void ACIFC_Handler( void ); +void ABDACB_Handler( void ); +void TRNG_Handler( void ); +void PARC_Handler( void ); +void CATB_Handler( void ); +void TWIM2_Handler( void ); +void TWIM3_Handler( void ); +void LCDCA_Handler( void ); + +/* + * \brief Configuration of the Cortex-M4 Processor and Core Peripherals + */ + +#define __MPU_PRESENT 1 /**< SAM4L does provide a MPU */ +#define __NVIC_PRIO_BITS 4 /**< SAM4L uses 4 Bits for the Priority Levels */ +#define __Vendor_SysTickConfig 0 /**< Set to 1 if different SysTick Config is used */ +#define __FPU_PRESENT 0 /**< SAM4L does not provide a FPU */ + +/** + * \brief CMSIS includes + */ + +#include + +/*@}*/ + +/* ************************************************************************** */ +/** SOFTWARE PERIPHERAL API DEFINITION FOR SAM4L */ +/* ************************************************************************** */ +/** \addtogroup SAM4L_api Peripheral Software API */ +/*@{*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR ABDACB */ +/* ============================================================================= */ +/** \addtogroup SAM4L_ABDACB Audio Bitstream DAC */ +/*@{*/ + +#define REV_ABDACB 0x100 + +#ifndef __ASSEMBLY__ +/** \brief ABDACB hardware registers */ +typedef struct { + RwReg ABDACB_CR; /**< \brief (ABDACB Offset: 0x00) Control Register */ + RwReg ABDACB_SDR0; /**< \brief (ABDACB Offset: 0x04) Sample Data Register 0 */ + RwReg ABDACB_SDR1; /**< \brief (ABDACB Offset: 0x08) Sample Data Register 1 */ + RwReg ABDACB_VCR0; /**< \brief (ABDACB Offset: 0x0C) Volume Control Register 0 */ + RwReg ABDACB_VCR1; /**< \brief (ABDACB Offset: 0x10) Volume Control Register 1 */ + WoReg ABDACB_IER; /**< \brief (ABDACB Offset: 0x14) Interrupt Enable Register */ + WoReg ABDACB_IDR; /**< \brief (ABDACB Offset: 0x18) Interupt Disable Register */ + RoReg ABDACB_IMR; /**< \brief (ABDACB Offset: 0x1C) Interrupt Mask Register */ + RoReg ABDACB_SR; /**< \brief (ABDACB Offset: 0x20) Status Register */ + WoReg ABDACB_SCR; /**< \brief (ABDACB Offset: 0x24) Status Clear Register */ + RoReg ABDACB_PARAMETER; /**< \brief (ABDACB Offset: 0x28) Parameter Register */ + RoReg ABDACB_VERSION; /**< \brief (ABDACB Offset: 0x2C) Version Register */ +} Abdacb; +#endif /* __ASSEMBLY__ */ +/* -------- ABDACB_CR : (ABDACB Offset: 0x00) Control Register -------- */ +#define ABDACB_CR_EN (0x1u << 0) /**< \brief (ABDACB_CR) Enable */ +#define ABDACB_CR_EN_0 (0x0u << 0) /**< \brief (ABDACB_CR) Audio DAC is disabled */ +#define ABDACB_CR_EN_1 (0x1u << 0) /**< \brief (ABDACB_CR) Audio DAC is enabled */ +#define ABDACB_CR_SWAP (0x1u << 1) /**< \brief (ABDACB_CR) Swap Channels */ +#define ABDACB_CR_SWAP_0 (0x0u << 1) /**< \brief (ABDACB_CR) The CHANNEL0 and CHANNEL1 samples will not be swapped when writing the Audio DAC Sample Data Register (SDR) */ +#define ABDACB_CR_SWAP_1 (0x1u << 1) /**< \brief (ABDACB_CR) The CHANNEL0 and CHANNEL1 samples will be swapped when writing the Audio DAC Sample Data Register (SDR) */ +#define ABDACB_CR_ALTUPR (0x1u << 3) /**< \brief (ABDACB_CR) Alternative up-sampling ratio */ +#define ABDACB_CR_CMOC (0x1u << 4) /**< \brief (ABDACB_CR) Common mode offset control */ +#define ABDACB_CR_MONO (0x1u << 5) /**< \brief (ABDACB_CR) Mono mode */ +#define ABDACB_CR_SWRST (0x1u << 7) /**< \brief (ABDACB_CR) Software reset */ +#define ABDACB_CR_DATAFORMAT_Pos 16 +#define ABDACB_CR_DATAFORMAT_Msk (0x7u << ABDACB_CR_DATAFORMAT_Pos) /**< \brief (ABDACB_CR) Data word format */ +#define ABDACB_CR_DATAFORMAT(value) ((ABDACB_CR_DATAFORMAT_Msk & ((value) << ABDACB_CR_DATAFORMAT_Pos))) +#define ABDACB_CR_FS_Pos 24 +#define ABDACB_CR_FS_Msk (0xFu << ABDACB_CR_FS_Pos) /**< \brief (ABDACB_CR) Sampling frequency */ +#define ABDACB_CR_FS(value) ((ABDACB_CR_FS_Msk & ((value) << ABDACB_CR_FS_Pos))) +/* -------- ABDACB_SDR0 : (ABDACB Offset: 0x04) Sample Data Register 0 -------- */ +#define ABDACB_SDR0_DATA_Pos 0 +#define ABDACB_SDR0_DATA_Msk (0xFFFFFFFFu << ABDACB_SDR0_DATA_Pos) /**< \brief (ABDACB_SDR0) Sample Data */ +#define ABDACB_SDR0_DATA(value) ((ABDACB_SDR0_DATA_Msk & ((value) << ABDACB_SDR0_DATA_Pos))) +/* -------- ABDACB_SDR1 : (ABDACB Offset: 0x08) Sample Data Register 1 -------- */ +#define ABDACB_SDR1_DATA_Pos 0 +#define ABDACB_SDR1_DATA_Msk (0xFFFFFFFFu << ABDACB_SDR1_DATA_Pos) /**< \brief (ABDACB_SDR1) Sample Data */ +#define ABDACB_SDR1_DATA(value) ((ABDACB_SDR1_DATA_Msk & ((value) << ABDACB_SDR1_DATA_Pos))) +/* -------- ABDACB_VCR0 : (ABDACB Offset: 0x0C) Volume Control Register 0 -------- */ +#define ABDACB_VCR0_VOLUME_Pos 0 +#define ABDACB_VCR0_VOLUME_Msk (0x7FFFu << ABDACB_VCR0_VOLUME_Pos) /**< \brief (ABDACB_VCR0) Volume Control */ +#define ABDACB_VCR0_VOLUME(value) ((ABDACB_VCR0_VOLUME_Msk & ((value) << ABDACB_VCR0_VOLUME_Pos))) +#define ABDACB_VCR0_MUTE (0x1u << 31) /**< \brief (ABDACB_VCR0) Mute */ +/* -------- ABDACB_VCR1 : (ABDACB Offset: 0x10) Volume Control Register 1 -------- */ +#define ABDACB_VCR1_VOLUME_Pos 0 +#define ABDACB_VCR1_VOLUME_Msk (0x7FFFu << ABDACB_VCR1_VOLUME_Pos) /**< \brief (ABDACB_VCR1) Volume Control */ +#define ABDACB_VCR1_VOLUME(value) ((ABDACB_VCR1_VOLUME_Msk & ((value) << ABDACB_VCR1_VOLUME_Pos))) +#define ABDACB_VCR1_MUTE (0x1u << 31) /**< \brief (ABDACB_VCR1) Mute */ +/* -------- ABDACB_IER : (ABDACB Offset: 0x14) Interrupt Enable Register -------- */ +#define ABDACB_IER_TXRDY (0x1u << 1) /**< \brief (ABDACB_IER) Transmit Ready Interrupt Enable */ +#define ABDACB_IER_TXRDY_0 (0x0u << 1) /**< \brief (ABDACB_IER) No effect */ +#define ABDACB_IER_TXRDY_1 (0x1u << 1) /**< \brief (ABDACB_IER) Enables the Audio DAC TX Ready interrupt */ +#define ABDACB_IER_TXUR (0x1u << 2) /**< \brief (ABDACB_IER) Transmit Underrun Interrupt Enable */ +#define ABDACB_IER_TXUR_0 (0x0u << 2) /**< \brief (ABDACB_IER) No effect */ +#define ABDACB_IER_TXUR_1 (0x1u << 2) /**< \brief (ABDACB_IER) Enables the Audio DAC Underrun interrupt */ +/* -------- ABDACB_IDR : (ABDACB Offset: 0x18) Interupt Disable Register -------- */ +#define ABDACB_IDR_TXRDY (0x1u << 1) /**< \brief (ABDACB_IDR) Transmit Ready Interrupt Disable */ +#define ABDACB_IDR_TXRDY_0 (0x0u << 1) /**< \brief (ABDACB_IDR) No effect */ +#define ABDACB_IDR_TXRDY_1 (0x1u << 1) /**< \brief (ABDACB_IDR) Disable the Audio DAC TX Ready interrupt */ +#define ABDACB_IDR_TXUR (0x1u << 2) /**< \brief (ABDACB_IDR) Transmit Underrun Interrupt Disable */ +#define ABDACB_IDR_TXUR_0 (0x0u << 2) /**< \brief (ABDACB_IDR) No effect */ +#define ABDACB_IDR_TXUR_1 (0x1u << 2) /**< \brief (ABDACB_IDR) Disable the Audio DAC Underrun interrupt */ +/* -------- ABDACB_IMR : (ABDACB Offset: 0x1C) Interrupt Mask Register -------- */ +#define ABDACB_IMR_TXRDY (0x1u << 1) /**< \brief (ABDACB_IMR) Transmit Ready Interrupt Mask */ +#define ABDACB_IMR_TXRDY_0 (0x0u << 1) /**< \brief (ABDACB_IMR) The Audio DAC TX Ready interrupt is disabled */ +#define ABDACB_IMR_TXRDY_1 (0x1u << 1) /**< \brief (ABDACB_IMR) The Audio DAC TX Ready interrupt is enabled */ +#define ABDACB_IMR_TXUR (0x1u << 2) /**< \brief (ABDACB_IMR) Transmit Underrun Interrupt Mask */ +#define ABDACB_IMR_TXUR_0 (0x0u << 2) /**< \brief (ABDACB_IMR) The Audio DAC Underrun interrupt is disabled */ +#define ABDACB_IMR_TXUR_1 (0x1u << 2) /**< \brief (ABDACB_IMR) The Audio DAC Underrun interrupt is enabled */ +/* -------- ABDACB_SR : (ABDACB Offset: 0x20) Status Register -------- */ +#define ABDACB_SR_BUSY (0x1u << 0) /**< \brief (ABDACB_SR) ABDACB Busy */ +#define ABDACB_SR_TXRDY (0x1u << 1) /**< \brief (ABDACB_SR) Transmit Ready */ +#define ABDACB_SR_TXRDY_0 (0x0u << 1) /**< \brief (ABDACB_SR) No Audio DAC TX Ready has occured since the last time ISR was read or since reset */ +#define ABDACB_SR_TXRDY_1 (0x1u << 1) /**< \brief (ABDACB_SR) At least one Audio DAC TX Ready has occured since the last time ISR was read or since reset */ +#define ABDACB_SR_TXUR (0x1u << 2) /**< \brief (ABDACB_SR) Transmit Underrun */ +#define ABDACB_SR_TXUR_0 (0x0u << 2) /**< \brief (ABDACB_SR) No Audio DAC Underrun has occured since the last time ISR was read or since reset */ +#define ABDACB_SR_TXUR_1 (0x1u << 2) /**< \brief (ABDACB_SR) At least one Audio DAC Underrun has occured since the last time ISR was read or since reset */ +/* -------- ABDACB_SCR : (ABDACB Offset: 0x24) Status Clear Register -------- */ +#define ABDACB_SCR_TXRDY (0x1u << 1) /**< \brief (ABDACB_SCR) Transmit Ready Interrupt Clear */ +#define ABDACB_SCR_TXRDY_0 (0x0u << 1) /**< \brief (ABDACB_SCR) No effect */ +#define ABDACB_SCR_TXRDY_1 (0x1u << 1) /**< \brief (ABDACB_SCR) Clear the Audio DAC TX Ready interrupt */ +#define ABDACB_SCR_TXUR (0x1u << 2) /**< \brief (ABDACB_SCR) Transmit Underrun Interrupt Clear */ +#define ABDACB_SCR_TXUR_0 (0x0u << 2) /**< \brief (ABDACB_SCR) No effect */ +#define ABDACB_SCR_TXUR_1 (0x1u << 2) /**< \brief (ABDACB_SCR) Clear the Audio DAC Underrun interrupt */ +/* -------- ABDACB_VERSION : (ABDACB Offset: 0x2C) Version Register -------- */ +#define ABDACB_VERSION_VERSION_Pos 0 +#define ABDACB_VERSION_VERSION_Msk (0xFFFu << ABDACB_VERSION_VERSION_Pos) /**< \brief (ABDACB_VERSION) Version Number */ +#define ABDACB_VERSION_VERSION(value) ((ABDACB_VERSION_VERSION_Msk & ((value) << ABDACB_VERSION_VERSION_Pos))) +#define ABDACB_VERSION_VARIANT_Pos 16 +#define ABDACB_VERSION_VARIANT_Msk (0xFu << ABDACB_VERSION_VARIANT_Pos) /**< \brief (ABDACB_VERSION) Variant Number */ +#define ABDACB_VERSION_VARIANT(value) ((ABDACB_VERSION_VARIANT_Msk & ((value) << ABDACB_VERSION_VARIANT_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR ACIFC */ +/* ============================================================================= */ +/** \addtogroup SAM4L_ACIFC Analog Comparator Interface */ +/*@{*/ + +#define REV_ACIFC 0x101 + +#ifndef __ASSEMBLY__ +/** \brief AcifcConf hardware registers */ +typedef struct { + RwReg ACIFC_CONF; /**< \brief (AcifcConf Offset: 0x00) AC Configuration Register */ +} AcifcConf; +/** \brief AcifcConfw hardware registers */ +typedef struct { + RwReg ACIFC_CONFW; /**< \brief (AcifcConfw Offset: 0x00) Window configuration Register */ +} AcifcConfw; +/** \brief ACIFC hardware registers */ +typedef struct { + RwReg ACIFC_CTRL; /**< \brief (ACIFC Offset: 0x00) Control Register */ + RoReg ACIFC_SR; /**< \brief (ACIFC Offset: 0x04) Status Register */ + RoReg Reserved1[2]; + WoReg ACIFC_IER; /**< \brief (ACIFC Offset: 0x10) Interrupt Enable Register */ + WoReg ACIFC_IDR; /**< \brief (ACIFC Offset: 0x14) Interrupt Disable Register */ + RoReg ACIFC_IMR; /**< \brief (ACIFC Offset: 0x18) Interrupt Mask Register */ + RoReg ACIFC_ISR; /**< \brief (ACIFC Offset: 0x1C) Interrupt Status Register */ + WoReg ACIFC_ICR; /**< \brief (ACIFC Offset: 0x20) Interrupt Status Clear Register */ + RwReg ACIFC_TR; /**< \brief (ACIFC Offset: 0x24) Test Register */ + RoReg Reserved2[2]; + RoReg ACIFC_PARAMETER; /**< \brief (ACIFC Offset: 0x30) Parameter Register */ + RoReg ACIFC_VERSION; /**< \brief (ACIFC Offset: 0x34) Version Register */ + RoReg Reserved3[18]; + AcifcConfw ACIFC_CONFW[4]; /**< \brief (ACIFC Offset: 0x80) AcifcConfw groups */ + RoReg Reserved4[16]; + AcifcConf ACIFC_CONF[8]; /**< \brief (ACIFC Offset: 0xD0) AcifcConf groups */ +} Acifc; +#endif /* __ASSEMBLY__ */ +/* -------- ACIFC_CTRL : (ACIFC Offset: 0x00) Control Register -------- */ +#define ACIFC_CTRL_EN (0x1u << 0) /**< \brief (ACIFC_CTRL) ACIFC Enable */ +#define ACIFC_CTRL_EVENTEN (0x1u << 1) /**< \brief (ACIFC_CTRL) Peripheral Event Trigger Enable */ +#define ACIFC_CTRL_USTART (0x1u << 4) /**< \brief (ACIFC_CTRL) User Start Single Comparison */ +#define ACIFC_CTRL_ESTART (0x1u << 5) /**< \brief (ACIFC_CTRL) Peripheral Event Start Single Comparison */ +#define ACIFC_CTRL_ACTEST (0x1u << 7) /**< \brief (ACIFC_CTRL) Analog Comparator Test Mode */ +/* -------- ACIFC_SR : (ACIFC Offset: 0x04) Status Register -------- */ +#define ACIFC_SR_ACCS0 (0x1u << 0) /**< \brief (ACIFC_SR) AC0 Current Comparison Status */ +#define ACIFC_SR_ACRDY0 (0x1u << 1) /**< \brief (ACIFC_SR) AC0 Ready */ +#define ACIFC_SR_ACCS1 (0x1u << 2) /**< \brief (ACIFC_SR) AC1 Current Comparison Status */ +#define ACIFC_SR_ACRDY1 (0x1u << 3) /**< \brief (ACIFC_SR) AC1 Ready */ +#define ACIFC_SR_ACCS2 (0x1u << 4) /**< \brief (ACIFC_SR) AC2 Current Comparison Status */ +#define ACIFC_SR_ACRDY2 (0x1u << 5) /**< \brief (ACIFC_SR) AC2 Ready */ +#define ACIFC_SR_ACCS3 (0x1u << 6) /**< \brief (ACIFC_SR) AC3 Current Comparison Status */ +#define ACIFC_SR_ACRDY3 (0x1u << 7) /**< \brief (ACIFC_SR) AC3 Ready */ +#define ACIFC_SR_ACCS4 (0x1u << 8) /**< \brief (ACIFC_SR) AC4 Current Comparison Status */ +#define ACIFC_SR_ACRDY4 (0x1u << 9) /**< \brief (ACIFC_SR) AC4 Ready */ +#define ACIFC_SR_ACCS5 (0x1u << 10) /**< \brief (ACIFC_SR) AC5 Current Comparison Status */ +#define ACIFC_SR_ACRDY5 (0x1u << 11) /**< \brief (ACIFC_SR) AC5 Ready */ +#define ACIFC_SR_ACCS6 (0x1u << 12) /**< \brief (ACIFC_SR) AC6 Current Comparison Status */ +#define ACIFC_SR_ACRDY6 (0x1u << 13) /**< \brief (ACIFC_SR) AC6 Ready */ +#define ACIFC_SR_ACCS7 (0x1u << 14) /**< \brief (ACIFC_SR) AC7 Current Comparison Status */ +#define ACIFC_SR_ACRDY7 (0x1u << 15) /**< \brief (ACIFC_SR) AC7 Ready */ +#define ACIFC_SR_WFCS0 (0x1u << 24) /**< \brief (ACIFC_SR) Window0 Mode Current Status */ +#define ACIFC_SR_WFCS1 (0x1u << 25) /**< \brief (ACIFC_SR) Window1 Mode Current Status */ +#define ACIFC_SR_WFCS2 (0x1u << 26) /**< \brief (ACIFC_SR) Window2 Mode Current Status */ +#define ACIFC_SR_WFCS3 (0x1u << 27) /**< \brief (ACIFC_SR) Window3 Mode Current Status */ +/* -------- ACIFC_IER : (ACIFC Offset: 0x10) Interrupt Enable Register -------- */ +#define ACIFC_IER_ACINT0 (0x1u << 0) /**< \brief (ACIFC_IER) AC0 Interrupt Enable */ +#define ACIFC_IER_SUTINT0 (0x1u << 1) /**< \brief (ACIFC_IER) AC0 Startup Time Interrupt Enable */ +#define ACIFC_IER_ACINT1 (0x1u << 2) /**< \brief (ACIFC_IER) AC1 Interrupt Enable */ +#define ACIFC_IER_SUTINT1 (0x1u << 3) /**< \brief (ACIFC_IER) AC1 Startup Time Interrupt Enable */ +#define ACIFC_IER_ACINT2 (0x1u << 4) /**< \brief (ACIFC_IER) AC2 Interrupt Enable */ +#define ACIFC_IER_SUTINT2 (0x1u << 5) /**< \brief (ACIFC_IER) AC2 Startup Time Interrupt Enable */ +#define ACIFC_IER_ACINT3 (0x1u << 6) /**< \brief (ACIFC_IER) AC3 Interrupt Enable */ +#define ACIFC_IER_SUTINT3 (0x1u << 7) /**< \brief (ACIFC_IER) AC3 Startup Time Interrupt Enable */ +#define ACIFC_IER_ACINT4 (0x1u << 8) /**< \brief (ACIFC_IER) AC4 Interrupt Enable */ +#define ACIFC_IER_SUTINT4 (0x1u << 9) /**< \brief (ACIFC_IER) AC4 Startup Time Interrupt Enable */ +#define ACIFC_IER_ACINT5 (0x1u << 10) /**< \brief (ACIFC_IER) AC5 Interrupt Enable */ +#define ACIFC_IER_SUTINT5 (0x1u << 11) /**< \brief (ACIFC_IER) AC5 Startup Time Interrupt Enable */ +#define ACIFC_IER_ACINT6 (0x1u << 12) /**< \brief (ACIFC_IER) AC6 Interrupt Enable */ +#define ACIFC_IER_SUTINT6 (0x1u << 13) /**< \brief (ACIFC_IER) AC6 Startup Time Interrupt Enable */ +#define ACIFC_IER_ACINT7 (0x1u << 14) /**< \brief (ACIFC_IER) AC7 Interrupt Enable */ +#define ACIFC_IER_SUTINT7 (0x1u << 15) /**< \brief (ACIFC_IER) AC7 Startup Time Interrupt Enable */ +#define ACIFC_IER_WFINT0 (0x1u << 24) /**< \brief (ACIFC_IER) Window0 Mode Interrupt Enable */ +#define ACIFC_IER_WFINT1 (0x1u << 25) /**< \brief (ACIFC_IER) Window1 Mode Interrupt Enable */ +#define ACIFC_IER_WFINT2 (0x1u << 26) /**< \brief (ACIFC_IER) Window2 Mode Interrupt Enable */ +#define ACIFC_IER_WFINT3 (0x1u << 27) /**< \brief (ACIFC_IER) Window3 Mode Interrupt Enable */ +/* -------- ACIFC_IDR : (ACIFC Offset: 0x14) Interrupt Disable Register -------- */ +#define ACIFC_IDR_ACINT0 (0x1u << 0) /**< \brief (ACIFC_IDR) AC0 Interrupt Disable */ +#define ACIFC_IDR_SUTINT0 (0x1u << 1) /**< \brief (ACIFC_IDR) AC0 Startup Time Interrupt Disable */ +#define ACIFC_IDR_ACINT1 (0x1u << 2) /**< \brief (ACIFC_IDR) AC1 Interrupt Disable */ +#define ACIFC_IDR_SUTINT1 (0x1u << 3) /**< \brief (ACIFC_IDR) AC1 Startup Time Interrupt Disable */ +#define ACIFC_IDR_ACINT2 (0x1u << 4) /**< \brief (ACIFC_IDR) AC2 Interrupt Disable */ +#define ACIFC_IDR_SUTINT2 (0x1u << 5) /**< \brief (ACIFC_IDR) AC2 Startup Time Interrupt Disable */ +#define ACIFC_IDR_ACINT3 (0x1u << 6) /**< \brief (ACIFC_IDR) AC3 Interrupt Disable */ +#define ACIFC_IDR_SUTINT3 (0x1u << 7) /**< \brief (ACIFC_IDR) AC3 Startup Time Interrupt Disable */ +#define ACIFC_IDR_ACINT4 (0x1u << 8) /**< \brief (ACIFC_IDR) AC4 Interrupt Disable */ +#define ACIFC_IDR_SUTINT4 (0x1u << 9) /**< \brief (ACIFC_IDR) AC4 Startup Time Interrupt Disable */ +#define ACIFC_IDR_ACINT5 (0x1u << 10) /**< \brief (ACIFC_IDR) AC5 Interrupt Disable */ +#define ACIFC_IDR_SUTINT5 (0x1u << 11) /**< \brief (ACIFC_IDR) AC5 Startup Time Interrupt Disable */ +#define ACIFC_IDR_ACINT6 (0x1u << 12) /**< \brief (ACIFC_IDR) AC6 Interrupt Disable */ +#define ACIFC_IDR_SUTINT6 (0x1u << 13) /**< \brief (ACIFC_IDR) AC6 Startup Time Interrupt Disable */ +#define ACIFC_IDR_ACINT7 (0x1u << 14) /**< \brief (ACIFC_IDR) AC7 Interrupt Disable */ +#define ACIFC_IDR_SUTINT7 (0x1u << 15) /**< \brief (ACIFC_IDR) AC7 Startup Time Interrupt Disable */ +#define ACIFC_IDR_WFINT0 (0x1u << 24) /**< \brief (ACIFC_IDR) Window0 Mode Interrupt Disable */ +#define ACIFC_IDR_WFINT1 (0x1u << 25) /**< \brief (ACIFC_IDR) Window1 Mode Interrupt Disable */ +#define ACIFC_IDR_WFINT2 (0x1u << 26) /**< \brief (ACIFC_IDR) Window2 Mode Interrupt Disable */ +#define ACIFC_IDR_WFINT3 (0x1u << 27) /**< \brief (ACIFC_IDR) Window3 Mode Interrupt Disable */ +/* -------- ACIFC_IMR : (ACIFC Offset: 0x18) Interrupt Mask Register -------- */ +#define ACIFC_IMR_ACINT0 (0x1u << 0) /**< \brief (ACIFC_IMR) AC0 Interrupt Mask */ +#define ACIFC_IMR_SUTINT0 (0x1u << 1) /**< \brief (ACIFC_IMR) AC0 Startup Time Interrupt Mask */ +#define ACIFC_IMR_ACINT1 (0x1u << 2) /**< \brief (ACIFC_IMR) AC1 Interrupt Mask */ +#define ACIFC_IMR_SUTINT1 (0x1u << 3) /**< \brief (ACIFC_IMR) AC1 Startup Time Interrupt Mask */ +#define ACIFC_IMR_ACINT2 (0x1u << 4) /**< \brief (ACIFC_IMR) AC2 Interrupt Mask */ +#define ACIFC_IMR_SUTINT2 (0x1u << 5) /**< \brief (ACIFC_IMR) AC2 Startup Time Interrupt Mask */ +#define ACIFC_IMR_ACINT3 (0x1u << 6) /**< \brief (ACIFC_IMR) AC3 Interrupt Mask */ +#define ACIFC_IMR_SUTINT3 (0x1u << 7) /**< \brief (ACIFC_IMR) AC3 Startup Time Interrupt Mask */ +#define ACIFC_IMR_ACINT4 (0x1u << 8) /**< \brief (ACIFC_IMR) AC4 Interrupt Mask */ +#define ACIFC_IMR_SUTINT4 (0x1u << 9) /**< \brief (ACIFC_IMR) AC4 Startup Time Interrupt Mask */ +#define ACIFC_IMR_ACINT5 (0x1u << 10) /**< \brief (ACIFC_IMR) AC5 Interrupt Mask */ +#define ACIFC_IMR_SUTINT5 (0x1u << 11) /**< \brief (ACIFC_IMR) AC5 Startup Time Interrupt Mask */ +#define ACIFC_IMR_ACINT6 (0x1u << 12) /**< \brief (ACIFC_IMR) AC6 Interrupt Mask */ +#define ACIFC_IMR_SUTINT6 (0x1u << 13) /**< \brief (ACIFC_IMR) AC6 Startup Time Interrupt Mask */ +#define ACIFC_IMR_ACINT7 (0x1u << 14) /**< \brief (ACIFC_IMR) AC7 Interrupt Mask */ +#define ACIFC_IMR_SUTINT7 (0x1u << 15) /**< \brief (ACIFC_IMR) AC7 Startup Time Interrupt Mask */ +#define ACIFC_IMR_WFINT0 (0x1u << 24) /**< \brief (ACIFC_IMR) Window0 Mode Interrupt Mask */ +#define ACIFC_IMR_WFINT1 (0x1u << 25) /**< \brief (ACIFC_IMR) Window1 Mode Interrupt Mask */ +#define ACIFC_IMR_WFINT2 (0x1u << 26) /**< \brief (ACIFC_IMR) Window2 Mode Interrupt Mask */ +#define ACIFC_IMR_WFINT3 (0x1u << 27) /**< \brief (ACIFC_IMR) Window3 Mode Interrupt Mask */ +/* -------- ACIFC_ISR : (ACIFC Offset: 0x1C) Interrupt Status Register -------- */ +#define ACIFC_ISR_ACINT0 (0x1u << 0) /**< \brief (ACIFC_ISR) AC0 Interrupt Status */ +#define ACIFC_ISR_SUTINT0 (0x1u << 1) /**< \brief (ACIFC_ISR) AC0 Startup Time Interrupt Status */ +#define ACIFC_ISR_ACINT1 (0x1u << 2) /**< \brief (ACIFC_ISR) AC1 Interrupt Status */ +#define ACIFC_ISR_SUTINT1 (0x1u << 3) /**< \brief (ACIFC_ISR) AC1 Startup Time Interrupt Status */ +#define ACIFC_ISR_ACINT2 (0x1u << 4) /**< \brief (ACIFC_ISR) AC2 Interrupt Status */ +#define ACIFC_ISR_SUTINT2 (0x1u << 5) /**< \brief (ACIFC_ISR) AC2 Startup Time Interrupt Status */ +#define ACIFC_ISR_ACINT3 (0x1u << 6) /**< \brief (ACIFC_ISR) AC3 Interrupt Status */ +#define ACIFC_ISR_SUTINT3 (0x1u << 7) /**< \brief (ACIFC_ISR) AC3 Startup Time Interrupt Status */ +#define ACIFC_ISR_ACINT4 (0x1u << 8) /**< \brief (ACIFC_ISR) AC4 Interrupt Status */ +#define ACIFC_ISR_SUTINT4 (0x1u << 9) /**< \brief (ACIFC_ISR) AC4 Startup Time Interrupt Status */ +#define ACIFC_ISR_ACINT5 (0x1u << 10) /**< \brief (ACIFC_ISR) AC5 Interrupt Status */ +#define ACIFC_ISR_SUTINT5 (0x1u << 11) /**< \brief (ACIFC_ISR) AC5 Startup Time Interrupt Status */ +#define ACIFC_ISR_ACINT6 (0x1u << 12) /**< \brief (ACIFC_ISR) AC6 Interrupt Status */ +#define ACIFC_ISR_SUTINT6 (0x1u << 13) /**< \brief (ACIFC_ISR) AC6 Startup Time Interrupt Status */ +#define ACIFC_ISR_ACINT7 (0x1u << 14) /**< \brief (ACIFC_ISR) AC7 Interrupt Status */ +#define ACIFC_ISR_SUTINT7 (0x1u << 15) /**< \brief (ACIFC_ISR) AC7 Startup Time Interrupt Status */ +#define ACIFC_ISR_WFINT0 (0x1u << 24) /**< \brief (ACIFC_ISR) Window0 Mode Interrupt Status */ +#define ACIFC_ISR_WFINT1 (0x1u << 25) /**< \brief (ACIFC_ISR) Window1 Mode Interrupt Status */ +#define ACIFC_ISR_WFINT2 (0x1u << 26) /**< \brief (ACIFC_ISR) Window2 Mode Interrupt Status */ +#define ACIFC_ISR_WFINT3 (0x1u << 27) /**< \brief (ACIFC_ISR) Window3 Mode Interrupt Status */ +/* -------- ACIFC_ICR : (ACIFC Offset: 0x20) Interrupt Status Clear Register -------- */ +#define ACIFC_ICR_ACINT0 (0x1u << 0) /**< \brief (ACIFC_ICR) AC0 Interrupt Status Clear */ +#define ACIFC_ICR_SUTINT0 (0x1u << 1) /**< \brief (ACIFC_ICR) AC0 Startup Time Interrupt Status Clear */ +#define ACIFC_ICR_ACINT1 (0x1u << 2) /**< \brief (ACIFC_ICR) AC1 Interrupt Status Clear */ +#define ACIFC_ICR_SUTINT1 (0x1u << 3) /**< \brief (ACIFC_ICR) AC1 Startup Time Interrupt Status Clear */ +#define ACIFC_ICR_ACINT2 (0x1u << 4) /**< \brief (ACIFC_ICR) AC2 Interrupt Status Clear */ +#define ACIFC_ICR_SUTINT2 (0x1u << 5) /**< \brief (ACIFC_ICR) AC2 Startup Time Interrupt Status Clear */ +#define ACIFC_ICR_ACINT3 (0x1u << 6) /**< \brief (ACIFC_ICR) AC3 Interrupt Status Clear */ +#define ACIFC_ICR_SUTINT3 (0x1u << 7) /**< \brief (ACIFC_ICR) AC3 Startup Time Interrupt Status Clear */ +#define ACIFC_ICR_ACINT4 (0x1u << 8) /**< \brief (ACIFC_ICR) AC4 Interrupt Status Clear */ +#define ACIFC_ICR_SUTINT4 (0x1u << 9) /**< \brief (ACIFC_ICR) AC4 Startup Time Interrupt Status Clear */ +#define ACIFC_ICR_ACINT5 (0x1u << 10) /**< \brief (ACIFC_ICR) AC5 Interrupt Status Clear */ +#define ACIFC_ICR_SUTINT5 (0x1u << 11) /**< \brief (ACIFC_ICR) AC5 Startup Time Interrupt Status Clear */ +#define ACIFC_ICR_ACINT6 (0x1u << 12) /**< \brief (ACIFC_ICR) AC6 Interrupt Status Clear */ +#define ACIFC_ICR_SUTINT6 (0x1u << 13) /**< \brief (ACIFC_ICR) AC6 Startup Time Interrupt Status Clear */ +#define ACIFC_ICR_ACINT7 (0x1u << 14) /**< \brief (ACIFC_ICR) AC7 Interrupt Status Clear */ +#define ACIFC_ICR_SUTINT7 (0x1u << 15) /**< \brief (ACIFC_ICR) AC7 Startup Time Interrupt Status Clear */ +#define ACIFC_ICR_WFINT0 (0x1u << 24) /**< \brief (ACIFC_ICR) Window0 Mode Interrupt Status Clear */ +#define ACIFC_ICR_WFINT1 (0x1u << 25) /**< \brief (ACIFC_ICR) Window1 Mode Interrupt Status Clear */ +#define ACIFC_ICR_WFINT2 (0x1u << 26) /**< \brief (ACIFC_ICR) Window2 Mode Interrupt Status Clear */ +#define ACIFC_ICR_WFINT3 (0x1u << 27) /**< \brief (ACIFC_ICR) Window3 Mode Interrupt Status Clear */ +/* -------- ACIFC_TR : (ACIFC Offset: 0x24) Test Register -------- */ +#define ACIFC_TR_ACTEST0 (0x1u << 0) /**< \brief (ACIFC_TR) AC0 Output Override Value */ +#define ACIFC_TR_ACTEST1 (0x1u << 1) /**< \brief (ACIFC_TR) AC1 Output Override Value */ +#define ACIFC_TR_ACTEST2 (0x1u << 2) /**< \brief (ACIFC_TR) AC2 Output Override Value */ +#define ACIFC_TR_ACTEST3 (0x1u << 3) /**< \brief (ACIFC_TR) AC3 Output Override Value */ +#define ACIFC_TR_ACTEST4 (0x1u << 4) /**< \brief (ACIFC_TR) AC4 Output Override Value */ +#define ACIFC_TR_ACTEST5 (0x1u << 5) /**< \brief (ACIFC_TR) AC5 Output Override Value */ +#define ACIFC_TR_ACTEST6 (0x1u << 6) /**< \brief (ACIFC_TR) AC6 Output Override Value */ +#define ACIFC_TR_ACTEST7 (0x1u << 7) /**< \brief (ACIFC_TR) AC7 Output Override Value */ +/* -------- ACIFC_PARAMETER : (ACIFC Offset: 0x30) Parameter Register -------- */ +#define ACIFC_PARAMETER_ACIMPL0 (0x1u << 0) /**< \brief (ACIFC_PARAMETER) Analog Comparator 0 Implemented */ +#define ACIFC_PARAMETER_ACIMPL1 (0x1u << 1) /**< \brief (ACIFC_PARAMETER) Analog Comparator 1 Implemented */ +#define ACIFC_PARAMETER_ACIMPL2 (0x1u << 2) /**< \brief (ACIFC_PARAMETER) Analog Comparator 2 Implemented */ +#define ACIFC_PARAMETER_ACIMPL3 (0x1u << 3) /**< \brief (ACIFC_PARAMETER) Analog Comparator 3 Implemented */ +#define ACIFC_PARAMETER_ACIMPL4 (0x1u << 4) /**< \brief (ACIFC_PARAMETER) Analog Comparator 4 Implemented */ +#define ACIFC_PARAMETER_ACIMPL5 (0x1u << 5) /**< \brief (ACIFC_PARAMETER) Analog Comparator 5 Implemented */ +#define ACIFC_PARAMETER_ACIMPL6 (0x1u << 6) /**< \brief (ACIFC_PARAMETER) Analog Comparator 6 Implemented */ +#define ACIFC_PARAMETER_ACIMPL7 (0x1u << 7) /**< \brief (ACIFC_PARAMETER) Analog Comparator 7 Implemented */ +#define ACIFC_PARAMETER_WIMPL0 (0x1u << 16) /**< \brief (ACIFC_PARAMETER) Window0 Mode Implemented */ +#define ACIFC_PARAMETER_WIMPL1 (0x1u << 17) /**< \brief (ACIFC_PARAMETER) Window1 Mode Implemented */ +#define ACIFC_PARAMETER_WIMPL2 (0x1u << 18) /**< \brief (ACIFC_PARAMETER) Window2 Mode Implemented */ +#define ACIFC_PARAMETER_WIMPL3 (0x1u << 19) /**< \brief (ACIFC_PARAMETER) Window3 Mode Implemented */ +/* -------- ACIFC_VERSION : (ACIFC Offset: 0x34) Version Register -------- */ +#define ACIFC_VERSION_VERSION_Pos 0 +#define ACIFC_VERSION_VERSION_Msk (0xFFFu << ACIFC_VERSION_VERSION_Pos) /**< \brief (ACIFC_VERSION) Version Number */ +#define ACIFC_VERSION_VERSION(value) ((ACIFC_VERSION_VERSION_Msk & ((value) << ACIFC_VERSION_VERSION_Pos))) +#define ACIFC_VERSION_VARIANT_Pos 16 +#define ACIFC_VERSION_VARIANT_Msk (0xFu << ACIFC_VERSION_VARIANT_Pos) /**< \brief (ACIFC_VERSION) Variant Number */ +#define ACIFC_VERSION_VARIANT(value) ((ACIFC_VERSION_VARIANT_Msk & ((value) << ACIFC_VERSION_VARIANT_Pos))) +/* -------- ACIFC_CONFW : (ACIFC Offset: 0x80) Confw Window configuration Register -------- */ +#define ACIFC_CONFW_WIS_Pos 0 +#define ACIFC_CONFW_WIS_Msk (0x7u << ACIFC_CONFW_WIS_Pos) /**< \brief (ACIFC_CONFW) Window Mode Interrupt Settings */ +#define ACIFC_CONFW_WIS(value) ((ACIFC_CONFW_WIS_Msk & ((value) << ACIFC_CONFW_WIS_Pos))) +#define ACIFC_CONFW_WEVSRC_Pos 8 +#define ACIFC_CONFW_WEVSRC_Msk (0x7u << ACIFC_CONFW_WEVSRC_Pos) /**< \brief (ACIFC_CONFW) Peripheral Event Sourse Selection for Window Mode */ +#define ACIFC_CONFW_WEVSRC(value) ((ACIFC_CONFW_WEVSRC_Msk & ((value) << ACIFC_CONFW_WEVSRC_Pos))) +#define ACIFC_CONFW_WEVEN (0x1u << 11) /**< \brief (ACIFC_CONFW) Window Peripheral Event Enable */ +#define ACIFC_CONFW_WFEN (0x1u << 16) /**< \brief (ACIFC_CONFW) Window Mode Enable */ +/* -------- ACIFC_CONF : (ACIFC Offset: 0xD0) Conf AC Configuration Register -------- */ +#define ACIFC_CONF_IS_Pos 0 +#define ACIFC_CONF_IS_Msk (0x3u << ACIFC_CONF_IS_Pos) /**< \brief (ACIFC_CONF) Interupt Settings */ +#define ACIFC_CONF_IS(value) ((ACIFC_CONF_IS_Msk & ((value) << ACIFC_CONF_IS_Pos))) +#define ACIFC_CONF_MODE_Pos 4 +#define ACIFC_CONF_MODE_Msk (0x3u << ACIFC_CONF_MODE_Pos) /**< \brief (ACIFC_CONF) Analog Comparator Mode */ +#define ACIFC_CONF_MODE(value) ((ACIFC_CONF_MODE_Msk & ((value) << ACIFC_CONF_MODE_Pos))) +#define ACIFC_CONF_INSELN_Pos 8 +#define ACIFC_CONF_INSELN_Msk (0x3u << ACIFC_CONF_INSELN_Pos) /**< \brief (ACIFC_CONF) Negative Input Select */ +#define ACIFC_CONF_INSELN(value) ((ACIFC_CONF_INSELN_Msk & ((value) << ACIFC_CONF_INSELN_Pos))) +#define ACIFC_CONF_EVENN (0x1u << 16) /**< \brief (ACIFC_CONF) Peripheral Event Enable Negative */ +#define ACIFC_CONF_EVENP (0x1u << 17) /**< \brief (ACIFC_CONF) Peripheral Event Enable Positive */ +#define ACIFC_CONF_HYS_Pos 24 +#define ACIFC_CONF_HYS_Msk (0x3u << ACIFC_CONF_HYS_Pos) /**< \brief (ACIFC_CONF) Hysteresis Voltage Value */ +#define ACIFC_CONF_HYS(value) ((ACIFC_CONF_HYS_Msk & ((value) << ACIFC_CONF_HYS_Pos))) +#define ACIFC_CONF_FAST (0x1u << 26) /**< \brief (ACIFC_CONF) Fast Mode Enable */ +#define ACIFC_CONF_ALWAYSON (0x1u << 27) /**< \brief (ACIFC_CONF) Always On */ + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR ADCIFE */ +/* ============================================================================= */ +/** \addtogroup SAM4L_ADCIFE ADC controller interface */ +/*@{*/ + +#define REV_ADCIFE 0x100 + +#ifndef __ASSEMBLY__ +/** \brief ADCIFE hardware registers */ +typedef struct { + WoReg ADCIFE_CR; /**< \brief (ADCIFE Offset: 0x00) Control Register */ + RwReg ADCIFE_CFG; /**< \brief (ADCIFE Offset: 0x04) Configuration Register */ + RoReg ADCIFE_SR; /**< \brief (ADCIFE Offset: 0x08) Status Register */ + WoReg ADCIFE_SCR; /**< \brief (ADCIFE Offset: 0x0C) Status Clear Register */ + RwReg ADCIFE_RTS; /**< \brief (ADCIFE Offset: 0x10) Resistive Touch Screen Register */ + RwReg ADCIFE_SEQCFG; /**< \brief (ADCIFE Offset: 0x14) Sequencer Configuration Register */ + WoReg ADCIFE_CDMA; /**< \brief (ADCIFE Offset: 0x18) Configuration Direct Memory Access Register */ + RwReg ADCIFE_TIM; /**< \brief (ADCIFE Offset: 0x1C) Timing Configuration Register */ + RwReg ADCIFE_ITIMER; /**< \brief (ADCIFE Offset: 0x20) Internal Timer Register */ + RwReg ADCIFE_WCFG; /**< \brief (ADCIFE Offset: 0x24) Window Monitor Configuration Register */ + RwReg ADCIFE_WTH; /**< \brief (ADCIFE Offset: 0x28) Window Monitor Threshold Configuration Register */ + RoReg ADCIFE_LCV; /**< \brief (ADCIFE Offset: 0x2C) Sequencer Last Converted Value Register */ + WoReg ADCIFE_IER; /**< \brief (ADCIFE Offset: 0x30) Interrupt Enable Register */ + WoReg ADCIFE_IDR; /**< \brief (ADCIFE Offset: 0x34) Interrupt Disable Register */ + RoReg ADCIFE_IMR; /**< \brief (ADCIFE Offset: 0x38) Interrupt Mask Register */ + RwReg ADCIFE_CALIB; /**< \brief (ADCIFE Offset: 0x3C) Calibration Register */ + RoReg ADCIFE_VERSION; /**< \brief (ADCIFE Offset: 0x40) Version Register */ + RoReg ADCIFE_PARAMETER; /**< \brief (ADCIFE Offset: 0x44) Parameter Register */ +} Adcife; +#endif /* __ASSEMBLY__ */ +/* -------- ADCIFE_CR : (ADCIFE Offset: 0x00) Control Register -------- */ +#define ADCIFE_CR_SWRST (0x1u << 0) /**< \brief (ADCIFE_CR) Software reset */ +#define ADCIFE_CR_TSTOP (0x1u << 1) /**< \brief (ADCIFE_CR) Internal timer stop bit */ +#define ADCIFE_CR_TSTART (0x1u << 2) /**< \brief (ADCIFE_CR) Internal timer start bit */ +#define ADCIFE_CR_STRIG (0x1u << 3) /**< \brief (ADCIFE_CR) Sequencer trigger */ +#define ADCIFE_CR_REFBUFEN (0x1u << 4) /**< \brief (ADCIFE_CR) Reference buffer enable */ +#define ADCIFE_CR_REFBUFDIS (0x1u << 5) /**< \brief (ADCIFE_CR) Reference buffer disable */ +#define ADCIFE_CR_EN (0x1u << 8) /**< \brief (ADCIFE_CR) ADCIFD enable */ +#define ADCIFE_CR_DIS (0x1u << 9) /**< \brief (ADCIFE_CR) ADCIFD disable */ +#define ADCIFE_CR_BGREQEN (0x1u << 10) /**< \brief (ADCIFE_CR) Bandgap buffer request enable */ +#define ADCIFE_CR_BGREQDIS (0x1u << 11) /**< \brief (ADCIFE_CR) Bandgap buffer request disable */ +/* -------- ADCIFE_CFG : (ADCIFE Offset: 0x04) Configuration Register -------- */ +#define ADCIFE_CFG_REFSEL_Pos 1 +#define ADCIFE_CFG_REFSEL_Msk (0x7u << ADCIFE_CFG_REFSEL_Pos) /**< \brief (ADCIFE_CFG) ADC Reference Selection */ +#define ADCIFE_CFG_REFSEL(value) ((ADCIFE_CFG_REFSEL_Msk & ((value) << ADCIFE_CFG_REFSEL_Pos))) +#define ADCIFE_CFG_SPEED_Pos 4 +#define ADCIFE_CFG_SPEED_Msk (0x3u << ADCIFE_CFG_SPEED_Pos) /**< \brief (ADCIFE_CFG) ADC current reduction */ +#define ADCIFE_CFG_SPEED(value) ((ADCIFE_CFG_SPEED_Msk & ((value) << ADCIFE_CFG_SPEED_Pos))) +#define ADCIFE_CFG_CLKSEL (0x1u << 6) /**< \brief (ADCIFE_CFG) Clock Selection for sequencer/ADC cell */ +#define ADCIFE_CFG_PRESCAL_Pos 8 +#define ADCIFE_CFG_PRESCAL_Msk (0x7u << ADCIFE_CFG_PRESCAL_Pos) /**< \brief (ADCIFE_CFG) Prescaler Rate Selection */ +#define ADCIFE_CFG_PRESCAL(value) ((ADCIFE_CFG_PRESCAL_Msk & ((value) << ADCIFE_CFG_PRESCAL_Pos))) +/* -------- ADCIFE_SR : (ADCIFE Offset: 0x08) Status Register -------- */ +#define ADCIFE_SR_SEOC (0x1u << 0) /**< \brief (ADCIFE_SR) Sequencer end of conversion */ +#define ADCIFE_SR_LOVR (0x1u << 1) /**< \brief (ADCIFE_SR) Sequencer last converted value overrun */ +#define ADCIFE_SR_WM (0x1u << 2) /**< \brief (ADCIFE_SR) Window monitor */ +#define ADCIFE_SR_SMTRG (0x1u << 3) /**< \brief (ADCIFE_SR) Sequencer missed trigger event */ +#define ADCIFE_SR_SUTD (0x1u << 4) /**< \brief (ADCIFE_SR) Start-up time done */ +#define ADCIFE_SR_TTO (0x1u << 5) /**< \brief (ADCIFE_SR) Timer time-out */ +#define ADCIFE_SR_EN (0x1u << 24) /**< \brief (ADCIFE_SR) Enable Status */ +#define ADCIFE_SR_TBUSY (0x1u << 25) /**< \brief (ADCIFE_SR) Timer busy */ +#define ADCIFE_SR_SBUSY (0x1u << 26) /**< \brief (ADCIFE_SR) Sequencer busy */ +#define ADCIFE_SR_CBUSY (0x1u << 27) /**< \brief (ADCIFE_SR) Conversion busy */ +#define ADCIFE_SR_REFBUF (0x1u << 28) /**< \brief (ADCIFE_SR) Reference buffer status */ +/* -------- ADCIFE_SCR : (ADCIFE Offset: 0x0C) Status Clear Register -------- */ +#define ADCIFE_SCR_SEOC (0x1u << 0) /**< \brief (ADCIFE_SCR) Sequencer end of conversion */ +#define ADCIFE_SCR_LOVR (0x1u << 1) /**< \brief (ADCIFE_SCR) Sequencer last converted value overrun */ +#define ADCIFE_SCR_WM (0x1u << 2) /**< \brief (ADCIFE_SCR) Window monitor */ +#define ADCIFE_SCR_SMTRG (0x1u << 3) /**< \brief (ADCIFE_SCR) Sequencer missed trigger event */ +#define ADCIFE_SCR_SUTD (0x1u << 4) /**< \brief (ADCIFE_SCR) Start-up time done */ +#define ADCIFE_SCR_TTO (0x1u << 5) /**< \brief (ADCIFE_SCR) Timer time-out */ +/* -------- ADCIFE_RTS : (ADCIFE Offset: 0x10) Resistive Touch Screen Register -------- */ +/* -------- ADCIFE_SEQCFG : (ADCIFE Offset: 0x14) Sequencer Configuration Register -------- */ +#define ADCIFE_SEQCFG_HWLA (0x1u << 0) /**< \brief (ADCIFE_SEQCFG) Half word left adjust */ +#define ADCIFE_SEQCFG_BIPOLAR (0x1u << 2) /**< \brief (ADCIFE_SEQCFG) Bipolar Mode */ +#define ADCIFE_SEQCFG_GAIN_Pos 4 +#define ADCIFE_SEQCFG_GAIN_Msk (0x7u << ADCIFE_SEQCFG_GAIN_Pos) /**< \brief (ADCIFE_SEQCFG) Gain factor */ +#define ADCIFE_SEQCFG_GAIN(value) ((ADCIFE_SEQCFG_GAIN_Msk & ((value) << ADCIFE_SEQCFG_GAIN_Pos))) +#define ADCIFE_SEQCFG_GCOMP (0x1u << 7) /**< \brief (ADCIFE_SEQCFG) Gain Compensation */ +#define ADCIFE_SEQCFG_TRGSEL_Pos 8 +#define ADCIFE_SEQCFG_TRGSEL_Msk (0x7u << ADCIFE_SEQCFG_TRGSEL_Pos) /**< \brief (ADCIFE_SEQCFG) Trigger selection */ +#define ADCIFE_SEQCFG_TRGSEL(value) ((ADCIFE_SEQCFG_TRGSEL_Msk & ((value) << ADCIFE_SEQCFG_TRGSEL_Pos))) +#define ADCIFE_SEQCFG_RES (0x1u << 12) /**< \brief (ADCIFE_SEQCFG) Resolution */ +#define ADCIFE_SEQCFG_INTERNAL_Pos 14 +#define ADCIFE_SEQCFG_INTERNAL_Msk (0x3u << ADCIFE_SEQCFG_INTERNAL_Pos) /**< \brief (ADCIFE_SEQCFG) Internal Voltage Source Selection */ +#define ADCIFE_SEQCFG_INTERNAL(value) ((ADCIFE_SEQCFG_INTERNAL_Msk & ((value) << ADCIFE_SEQCFG_INTERNAL_Pos))) +#define ADCIFE_SEQCFG_MUXPOS_Pos 16 +#define ADCIFE_SEQCFG_MUXPOS_Msk (0xFu << ADCIFE_SEQCFG_MUXPOS_Pos) /**< \brief (ADCIFE_SEQCFG) MUX selection on Positive ADC input channel */ +#define ADCIFE_SEQCFG_MUXPOS(value) ((ADCIFE_SEQCFG_MUXPOS_Msk & ((value) << ADCIFE_SEQCFG_MUXPOS_Pos))) +#define ADCIFE_SEQCFG_MUXNEG_Pos 20 +#define ADCIFE_SEQCFG_MUXNEG_Msk (0x7u << ADCIFE_SEQCFG_MUXNEG_Pos) /**< \brief (ADCIFE_SEQCFG) MUX selection on Negative ADC input channel */ +#define ADCIFE_SEQCFG_MUXNEG(value) ((ADCIFE_SEQCFG_MUXNEG_Msk & ((value) << ADCIFE_SEQCFG_MUXNEG_Pos))) +#define ADCIFE_SEQCFG_ZOOMRANGE_Pos 28 +#define ADCIFE_SEQCFG_ZOOMRANGE_Msk (0x7u << ADCIFE_SEQCFG_ZOOMRANGE_Pos) /**< \brief (ADCIFE_SEQCFG) Zoom shift/unipolar reference source selection */ +#define ADCIFE_SEQCFG_ZOOMRANGE(value) ((ADCIFE_SEQCFG_ZOOMRANGE_Msk & ((value) << ADCIFE_SEQCFG_ZOOMRANGE_Pos))) +/* -------- ADCIFE_FIRST_DMA_WORD_CDMA : (ADCIFE Offset: 0x18) Configuration Direct Memory Access Register -------- */ +#define ADCIFE_FIRST_DMA_WORD_CDMA_HWLA (0x1u << 0) /**< \brief (ADCIFE_FIRST_DMA_WORD_CDMA) */ +#define ADCIFE_FIRST_DMA_WORD_CDMA_BIPOLAR (0x1u << 2) /**< \brief (ADCIFE_FIRST_DMA_WORD_CDMA) */ +#define ADCIFE_FIRST_DMA_WORD_CDMA_STRIG (0x1u << 3) /**< \brief (ADCIFE_FIRST_DMA_WORD_CDMA) */ +#define ADCIFE_FIRST_DMA_WORD_CDMA_GAIN_Pos 4 +#define ADCIFE_FIRST_DMA_WORD_CDMA_GAIN_Msk (0x7u << ADCIFE_FIRST_DMA_WORD_CDMA_GAIN_Pos) /**< \brief (ADCIFE_FIRST_DMA_WORD_CDMA) */ +#define ADCIFE_FIRST_DMA_WORD_CDMA_GAIN(value) ((ADCIFE_FIRST_DMA_WORD_CDMA_GAIN_Msk & ((value) << ADCIFE_FIRST_DMA_WORD_CDMA_GAIN_Pos))) +#define ADCIFE_FIRST_DMA_WORD_CDMA_GCOMP (0x1u << 7) /**< \brief (ADCIFE_FIRST_DMA_WORD_CDMA) */ +#define ADCIFE_FIRST_DMA_WORD_CDMA_ENSTUP (0x1u << 8) /**< \brief (ADCIFE_FIRST_DMA_WORD_CDMA) */ +#define ADCIFE_FIRST_DMA_WORD_CDMA_RES (0x1u << 12) /**< \brief (ADCIFE_FIRST_DMA_WORD_CDMA) */ +#define ADCIFE_FIRST_DMA_WORD_CDMA_TSS (0x1u << 13) /**< \brief (ADCIFE_FIRST_DMA_WORD_CDMA) Internal timer start or stop bit */ +#define ADCIFE_FIRST_DMA_WORD_CDMA_INTERNAL_Pos 14 +#define ADCIFE_FIRST_DMA_WORD_CDMA_INTERNAL_Msk (0x3u << ADCIFE_FIRST_DMA_WORD_CDMA_INTERNAL_Pos) /**< \brief (ADCIFE_FIRST_DMA_WORD_CDMA) */ +#define ADCIFE_FIRST_DMA_WORD_CDMA_INTERNAL(value) ((ADCIFE_FIRST_DMA_WORD_CDMA_INTERNAL_Msk & ((value) << ADCIFE_FIRST_DMA_WORD_CDMA_INTERNAL_Pos))) +#define ADCIFE_FIRST_DMA_WORD_CDMA_MUXPOS_Pos 16 +#define ADCIFE_FIRST_DMA_WORD_CDMA_MUXPOS_Msk (0xFu << ADCIFE_FIRST_DMA_WORD_CDMA_MUXPOS_Pos) /**< \brief (ADCIFE_FIRST_DMA_WORD_CDMA) */ +#define ADCIFE_FIRST_DMA_WORD_CDMA_MUXPOS(value) ((ADCIFE_FIRST_DMA_WORD_CDMA_MUXPOS_Msk & ((value) << ADCIFE_FIRST_DMA_WORD_CDMA_MUXPOS_Pos))) +#define ADCIFE_FIRST_DMA_WORD_CDMA_MUXNEG_Pos 20 +#define ADCIFE_FIRST_DMA_WORD_CDMA_MUXNEG_Msk (0x7u << ADCIFE_FIRST_DMA_WORD_CDMA_MUXNEG_Pos) /**< \brief (ADCIFE_FIRST_DMA_WORD_CDMA) */ +#define ADCIFE_FIRST_DMA_WORD_CDMA_MUXNEG(value) ((ADCIFE_FIRST_DMA_WORD_CDMA_MUXNEG_Msk & ((value) << ADCIFE_FIRST_DMA_WORD_CDMA_MUXNEG_Pos))) +#define ADCIFE_FIRST_DMA_WORD_CDMA_ZOOMRANGE_Pos 28 +#define ADCIFE_FIRST_DMA_WORD_CDMA_ZOOMRANGE_Msk (0x7u << ADCIFE_FIRST_DMA_WORD_CDMA_ZOOMRANGE_Pos) /**< \brief (ADCIFE_FIRST_DMA_WORD_CDMA) */ +#define ADCIFE_FIRST_DMA_WORD_CDMA_ZOOMRANGE(value) ((ADCIFE_FIRST_DMA_WORD_CDMA_ZOOMRANGE_Msk & ((value) << ADCIFE_FIRST_DMA_WORD_CDMA_ZOOMRANGE_Pos))) +#define ADCIFE_FIRST_DMA_WORD_CDMA_DW (0x1u << 31) /**< \brief (ADCIFE_FIRST_DMA_WORD_CDMA) Double Word transmitting */ +/* -------- ADCIFE_SECOND_DMA_WORD_CDMA : (ADCIFE Offset: 0x18) Configuration Direct Memory Access Register -------- */ +#define ADCIFE_SECOND_DMA_WORD_CDMA_LT_Pos 0 +#define ADCIFE_SECOND_DMA_WORD_CDMA_LT_Msk (0xFFFu << ADCIFE_SECOND_DMA_WORD_CDMA_LT_Pos) /**< \brief (ADCIFE_SECOND_DMA_WORD_CDMA) */ +#define ADCIFE_SECOND_DMA_WORD_CDMA_LT(value) ((ADCIFE_SECOND_DMA_WORD_CDMA_LT_Msk & ((value) << ADCIFE_SECOND_DMA_WORD_CDMA_LT_Pos))) +#define ADCIFE_SECOND_DMA_WORD_CDMA_WM_Pos 12 +#define ADCIFE_SECOND_DMA_WORD_CDMA_WM_Msk (0x7u << ADCIFE_SECOND_DMA_WORD_CDMA_WM_Pos) /**< \brief (ADCIFE_SECOND_DMA_WORD_CDMA) */ +#define ADCIFE_SECOND_DMA_WORD_CDMA_WM(value) ((ADCIFE_SECOND_DMA_WORD_CDMA_WM_Msk & ((value) << ADCIFE_SECOND_DMA_WORD_CDMA_WM_Pos))) +#define ADCIFE_SECOND_DMA_WORD_CDMA_HT_Pos 16 +#define ADCIFE_SECOND_DMA_WORD_CDMA_HT_Msk (0xFFFu << ADCIFE_SECOND_DMA_WORD_CDMA_HT_Pos) /**< \brief (ADCIFE_SECOND_DMA_WORD_CDMA) */ +#define ADCIFE_SECOND_DMA_WORD_CDMA_HT(value) ((ADCIFE_SECOND_DMA_WORD_CDMA_HT_Msk & ((value) << ADCIFE_SECOND_DMA_WORD_CDMA_HT_Pos))) +#define ADCIFE_SECOND_DMA_WORD_CDMA_DW (0x1u << 31) /**< \brief (ADCIFE_SECOND_DMA_WORD_CDMA) */ +/* -------- ADCIFE_CDMA : (ADCIFE Offset: 0x18) Configuration Direct Memory Access Register -------- */ +#define ADCIFE_CDMA_HWLA (0x1u << 0) /**< \brief (ADCIFE_CDMA) */ +#define ADCIFE_CDMA_LT_Pos 0 +#define ADCIFE_CDMA_LT_Msk (0xFFFu << ADCIFE_CDMA_LT_Pos) /**< \brief (ADCIFE_CDMA) */ +#define ADCIFE_CDMA_LT(value) ((ADCIFE_CDMA_LT_Msk & ((value) << ADCIFE_CDMA_LT_Pos))) +#define ADCIFE_CDMA_BIPOLAR (0x1u << 2) /**< \brief (ADCIFE_CDMA) */ +#define ADCIFE_CDMA_STRIG (0x1u << 3) /**< \brief (ADCIFE_CDMA) */ +#define ADCIFE_CDMA_GAIN_Pos 4 +#define ADCIFE_CDMA_GAIN_Msk (0x7u << ADCIFE_CDMA_GAIN_Pos) /**< \brief (ADCIFE_CDMA) */ +#define ADCIFE_CDMA_GAIN(value) ((ADCIFE_CDMA_GAIN_Msk & ((value) << ADCIFE_CDMA_GAIN_Pos))) +#define ADCIFE_CDMA_GCOMP (0x1u << 7) /**< \brief (ADCIFE_CDMA) */ +#define ADCIFE_CDMA_ENSTUP (0x1u << 8) /**< \brief (ADCIFE_CDMA) */ +#define ADCIFE_CDMA_RES (0x1u << 12) /**< \brief (ADCIFE_CDMA) */ +#define ADCIFE_CDMA_WM_Pos 12 +#define ADCIFE_CDMA_WM_Msk (0x7u << ADCIFE_CDMA_WM_Pos) /**< \brief (ADCIFE_CDMA) */ +#define ADCIFE_CDMA_WM(value) ((ADCIFE_CDMA_WM_Msk & ((value) << ADCIFE_CDMA_WM_Pos))) +#define ADCIFE_CDMA_TSS (0x1u << 13) /**< \brief (ADCIFE_CDMA) Internal timer start or stop bit */ +#define ADCIFE_CDMA_INTERNAL_Pos 14 +#define ADCIFE_CDMA_INTERNAL_Msk (0x3u << ADCIFE_CDMA_INTERNAL_Pos) /**< \brief (ADCIFE_CDMA) */ +#define ADCIFE_CDMA_INTERNAL(value) ((ADCIFE_CDMA_INTERNAL_Msk & ((value) << ADCIFE_CDMA_INTERNAL_Pos))) +#define ADCIFE_CDMA_MUXPOS_Pos 16 +#define ADCIFE_CDMA_MUXPOS_Msk (0xFu << ADCIFE_CDMA_MUXPOS_Pos) /**< \brief (ADCIFE_CDMA) */ +#define ADCIFE_CDMA_MUXPOS(value) ((ADCIFE_CDMA_MUXPOS_Msk & ((value) << ADCIFE_CDMA_MUXPOS_Pos))) +#define ADCIFE_CDMA_HT_Pos 16 +#define ADCIFE_CDMA_HT_Msk (0xFFFu << ADCIFE_CDMA_HT_Pos) /**< \brief (ADCIFE_CDMA) */ +#define ADCIFE_CDMA_HT(value) ((ADCIFE_CDMA_HT_Msk & ((value) << ADCIFE_CDMA_HT_Pos))) +#define ADCIFE_CDMA_MUXNEG_Pos 20 +#define ADCIFE_CDMA_MUXNEG_Msk (0x7u << ADCIFE_CDMA_MUXNEG_Pos) /**< \brief (ADCIFE_CDMA) */ +#define ADCIFE_CDMA_MUXNEG(value) ((ADCIFE_CDMA_MUXNEG_Msk & ((value) << ADCIFE_CDMA_MUXNEG_Pos))) +#define ADCIFE_CDMA_ZOOMRANGE_Pos 28 +#define ADCIFE_CDMA_ZOOMRANGE_Msk (0x7u << ADCIFE_CDMA_ZOOMRANGE_Pos) /**< \brief (ADCIFE_CDMA) */ +#define ADCIFE_CDMA_ZOOMRANGE(value) ((ADCIFE_CDMA_ZOOMRANGE_Msk & ((value) << ADCIFE_CDMA_ZOOMRANGE_Pos))) +#define ADCIFE_CDMA_DW (0x1u << 31) /**< \brief (ADCIFE_CDMA) Double Word transmitting */ + +/* -------- ADCIFE_TIM : (ADCIFE Offset: 0x1C) Timing Configuration Register -------- */ +#define ADCIFE_TIM_STARTUP_Pos 0 +#define ADCIFE_TIM_STARTUP_Msk (0x1Fu << ADCIFE_TIM_STARTUP_Pos) /**< \brief (ADCIFE_TIM) Startup time */ +#define ADCIFE_TIM_STARTUP(value) ((ADCIFE_TIM_STARTUP_Msk & ((value) << ADCIFE_TIM_STARTUP_Pos))) +#define ADCIFE_TIM_ENSTUP (0x1u << 8) /**< \brief (ADCIFE_TIM) Enable Startup */ +/* -------- ADCIFE_ITIMER : (ADCIFE Offset: 0x20) Internal Timer Register -------- */ +#define ADCIFE_ITIMER_ITMC_Pos 0 +#define ADCIFE_ITIMER_ITMC_Msk (0xFFFFu << ADCIFE_ITIMER_ITMC_Pos) /**< \brief (ADCIFE_ITIMER) Internal timer max counter */ +#define ADCIFE_ITIMER_ITMC(value) ((ADCIFE_ITIMER_ITMC_Msk & ((value) << ADCIFE_ITIMER_ITMC_Pos))) +/* -------- ADCIFE_WCFG : (ADCIFE Offset: 0x24) Window Monitor Configuration Register -------- */ +#define ADCIFE_WCFG_WM_Pos 12 +#define ADCIFE_WCFG_WM_Msk (0x7u << ADCIFE_WCFG_WM_Pos) /**< \brief (ADCIFE_WCFG) Window Monitor Mode */ +#define ADCIFE_WCFG_WM(value) ((ADCIFE_WCFG_WM_Msk & ((value) << ADCIFE_WCFG_WM_Pos))) +/* -------- ADCIFE_WTH : (ADCIFE Offset: 0x28) Window Monitor Threshold Configuration Register -------- */ +#define ADCIFE_WTH_LT_Pos 0 +#define ADCIFE_WTH_LT_Msk (0xFFFu << ADCIFE_WTH_LT_Pos) /**< \brief (ADCIFE_WTH) Low threshold */ +#define ADCIFE_WTH_LT(value) ((ADCIFE_WTH_LT_Msk & ((value) << ADCIFE_WTH_LT_Pos))) +#define ADCIFE_WTH_HT_Pos 16 +#define ADCIFE_WTH_HT_Msk (0xFFFu << ADCIFE_WTH_HT_Pos) /**< \brief (ADCIFE_WTH) High Threshold */ +#define ADCIFE_WTH_HT(value) ((ADCIFE_WTH_HT_Msk & ((value) << ADCIFE_WTH_HT_Pos))) +/* -------- ADCIFE_LCV : (ADCIFE Offset: 0x2C) Sequencer Last Converted Value Register -------- */ +#define ADCIFE_LCV_LCV_Pos 0 +#define ADCIFE_LCV_LCV_Msk (0xFFFFu << ADCIFE_LCV_LCV_Pos) /**< \brief (ADCIFE_LCV) Last converted value */ +#define ADCIFE_LCV_LCV(value) ((ADCIFE_LCV_LCV_Msk & ((value) << ADCIFE_LCV_LCV_Pos))) +#define ADCIFE_LCV_LCPC_Pos 16 +#define ADCIFE_LCV_LCPC_Msk (0xFu << ADCIFE_LCV_LCPC_Pos) /**< \brief (ADCIFE_LCV) Last converted positive channel */ +#define ADCIFE_LCV_LCPC(value) ((ADCIFE_LCV_LCPC_Msk & ((value) << ADCIFE_LCV_LCPC_Pos))) +#define ADCIFE_LCV_LCNC_Pos 20 +#define ADCIFE_LCV_LCNC_Msk (0x7u << ADCIFE_LCV_LCNC_Pos) /**< \brief (ADCIFE_LCV) Last converted negative channel */ +#define ADCIFE_LCV_LCNC(value) ((ADCIFE_LCV_LCNC_Msk & ((value) << ADCIFE_LCV_LCNC_Pos))) +/* -------- ADCIFE_IER : (ADCIFE Offset: 0x30) Interrupt Enable Register -------- */ +#define ADCIFE_IER_SEOC (0x1u << 0) /**< \brief (ADCIFE_IER) Sequencer end of conversion Interrupt Enable */ +#define ADCIFE_IER_LOVR (0x1u << 1) /**< \brief (ADCIFE_IER) Sequencer last converted value overrun Interrupt Enable */ +#define ADCIFE_IER_WM (0x1u << 2) /**< \brief (ADCIFE_IER) Window monitor Interrupt Enable */ +#define ADCIFE_IER_SMTRG (0x1u << 3) /**< \brief (ADCIFE_IER) Sequencer missed trigger event Interrupt Enable */ +#define ADCIFE_IER_TTO (0x1u << 5) /**< \brief (ADCIFE_IER) Timer time-out Interrupt Enable */ +/* -------- ADCIFE_IDR : (ADCIFE Offset: 0x34) Interrupt Disable Register -------- */ +#define ADCIFE_IDR_SEOC (0x1u << 0) /**< \brief (ADCIFE_IDR) Sequencer end of conversion Interrupt Disable */ +#define ADCIFE_IDR_LOVR (0x1u << 1) /**< \brief (ADCIFE_IDR) Sequencer last converted value overrun Interrupt Disable */ +#define ADCIFE_IDR_WM (0x1u << 2) /**< \brief (ADCIFE_IDR) Window monitor Interrupt Disable */ +#define ADCIFE_IDR_SMTRG (0x1u << 3) /**< \brief (ADCIFE_IDR) Sequencer missed trigger event Interrupt Disable */ +#define ADCIFE_IDR_TTO (0x1u << 5) /**< \brief (ADCIFE_IDR) Timer time-out Interrupt Disable */ +/* -------- ADCIFE_IMR : (ADCIFE Offset: 0x38) Interrupt Mask Register -------- */ +#define ADCIFE_IMR_SEOC (0x1u << 0) /**< \brief (ADCIFE_IMR) Sequencer end of conversion Interrupt Mask */ +#define ADCIFE_IMR_LOVR (0x1u << 1) /**< \brief (ADCIFE_IMR) Sequencer last converted value overrun Interrupt Mask */ +#define ADCIFE_IMR_WM (0x1u << 2) /**< \brief (ADCIFE_IMR) Window monitor Interrupt Mask */ +#define ADCIFE_IMR_SMTRG (0x1u << 3) /**< \brief (ADCIFE_IMR) Sequencer missed trigger event Interrupt Mask */ +#define ADCIFE_IMR_TTO (0x1u << 5) /**< \brief (ADCIFE_IMR) Timer time-out Interrupt Mask */ +/* -------- ADCIFE_CALIB : (ADCIFE Offset: 0x3C) Calibration Register -------- */ +#define ADCIFE_CALIB_CALIB_Pos 0 +#define ADCIFE_CALIB_CALIB_Msk (0xFFu << ADCIFE_CALIB_CALIB_Pos) /**< \brief (ADCIFE_CALIB) Calibration Value */ +#define ADCIFE_CALIB_CALIB(value) ((ADCIFE_CALIB_CALIB_Msk & ((value) << ADCIFE_CALIB_CALIB_Pos))) +#define ADCIFE_CALIB_BIASSEL (0x1u << 8) /**< \brief (ADCIFE_CALIB) Select bias mode */ +#define ADCIFE_CALIB_BIASCAL_Pos 12 +#define ADCIFE_CALIB_BIASCAL_Msk (0xFu << ADCIFE_CALIB_BIASCAL_Pos) /**< \brief (ADCIFE_CALIB) Bias Calibration */ +#define ADCIFE_CALIB_BIASCAL(value) ((ADCIFE_CALIB_BIASCAL_Msk & ((value) << ADCIFE_CALIB_BIASCAL_Pos))) +#define ADCIFE_CALIB_FCD (0x1u << 16) /**< \brief (ADCIFE_CALIB) Flash Calibration Done */ +/* -------- ADCIFE_VERSION : (ADCIFE Offset: 0x40) Version Register -------- */ +#define ADCIFE_VERSION_VERSION_Pos 0 +#define ADCIFE_VERSION_VERSION_Msk (0xFFFu << ADCIFE_VERSION_VERSION_Pos) /**< \brief (ADCIFE_VERSION) Version number */ +#define ADCIFE_VERSION_VERSION(value) ((ADCIFE_VERSION_VERSION_Msk & ((value) << ADCIFE_VERSION_VERSION_Pos))) +#define ADCIFE_VERSION_VARIANT_Pos 16 +#define ADCIFE_VERSION_VARIANT_Msk (0xFu << ADCIFE_VERSION_VARIANT_Pos) /**< \brief (ADCIFE_VERSION) Variant number */ +#define ADCIFE_VERSION_VARIANT(value) ((ADCIFE_VERSION_VARIANT_Msk & ((value) << ADCIFE_VERSION_VARIANT_Pos))) +/* -------- ADCIFE_PARAMETER : (ADCIFE Offset: 0x44) Parameter Register -------- */ +#define ADCIFE_PARAMETER_N_Pos 0 +#define ADCIFE_PARAMETER_N_Msk (0xFFu << ADCIFE_PARAMETER_N_Pos) /**< \brief (ADCIFE_PARAMETER) Number of channels */ +#define ADCIFE_PARAMETER_N(value) ((ADCIFE_PARAMETER_N_Msk & ((value) << ADCIFE_PARAMETER_N_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR AESA */ +/* ============================================================================= */ +/** \addtogroup SAM4L_AESA Advanced Encryption Standard */ +/*@{*/ + +#define REV_AESA 0x102 + +#ifndef __ASSEMBLY__ +/** \brief AesaInitvect hardware registers */ +typedef struct { + WoReg AESA_INITVECT; /**< \brief (AesaInitvect Offset: 0x00) Initialization Vector Register 0 */ +} AesaInitvect; +/** \brief AesaKey hardware registers */ +typedef struct { + WoReg AESA_KEY; /**< \brief (AesaKey Offset: 0x00) Key Register 0 */ +} AesaKey; +/** \brief AESA hardware registers */ +typedef struct { + RwReg AESA_CTRL; /**< \brief (AESA Offset: 0x00) Control Register */ + RwReg AESA_MODE; /**< \brief (AESA Offset: 0x04) Mode Register */ + RwReg AESA_DATABUFPTR; /**< \brief (AESA Offset: 0x08) Data Buffer Pointer Register */ + RoReg AESA_SR; /**< \brief (AESA Offset: 0x0C) Status Register */ + WoReg AESA_IER; /**< \brief (AESA Offset: 0x10) Interrupt Enable Register */ + WoReg AESA_IDR; /**< \brief (AESA Offset: 0x14) Interrupt Disable Register */ + RoReg AESA_IMR; /**< \brief (AESA Offset: 0x18) Interrupt Mask Register */ + RoReg Reserved1[1]; + AesaKey AESA_KEY[8]; /**< \brief (AESA Offset: 0x20) AesaKey groups */ + AesaInitvect AESA_INITVECT[4]; /**< \brief (AESA Offset: 0x40) AesaInitvect groups */ + WoReg AESA_IDATA; /**< \brief (AESA Offset: 0x50) Input Data Register */ + RoReg Reserved2[3]; + RoReg AESA_ODATA; /**< \brief (AESA Offset: 0x60) Output Data Register */ + RoReg Reserved3[3]; + WoReg AESA_DRNGSEED; /**< \brief (AESA Offset: 0x70) DRNG Seed Register */ + RoReg Reserved4[33]; + RoReg AESA_PARAMETER; /**< \brief (AESA Offset: 0xF8) Parameter Register */ + RoReg AESA_VERSION; /**< \brief (AESA Offset: 0xFC) Version Register */ +} Aesa; +#endif /* __ASSEMBLY__ */ +/* -------- AESA_CTRL : (AESA Offset: 0x00) Control Register -------- */ +#define AESA_CTRL_ENABLE (0x1u << 0) /**< \brief (AESA_CTRL) Enable Module */ +#define AESA_CTRL_DKEYGEN (0x1u << 1) /**< \brief (AESA_CTRL) Decryption Key Generate */ +#define AESA_CTRL_NEWMSG (0x1u << 2) /**< \brief (AESA_CTRL) New Message */ +#define AESA_CTRL_SWRST (0x1u << 8) /**< \brief (AESA_CTRL) Software Reset */ +/* -------- AESA_MODE : (AESA Offset: 0x04) Mode Register -------- */ +#define AESA_MODE_ENCRYPT (0x1u << 0) /**< \brief (AESA_MODE) Encryption */ +#define AESA_MODE_KEYSIZE_Pos 1 +#define AESA_MODE_KEYSIZE_Msk (0x3u << AESA_MODE_KEYSIZE_Pos) /**< \brief (AESA_MODE) Key Size */ +#define AESA_MODE_KEYSIZE(value) ((AESA_MODE_KEYSIZE_Msk & ((value) << AESA_MODE_KEYSIZE_Pos))) +#define AESA_MODE_DMA (0x1u << 3) /**< \brief (AESA_MODE) DMA Mode */ +#define AESA_MODE_OPMODE_Pos 4 +#define AESA_MODE_OPMODE_Msk (0x7u << AESA_MODE_OPMODE_Pos) /**< \brief (AESA_MODE) Confidentiality Mode of Operation */ +#define AESA_MODE_OPMODE(value) ((AESA_MODE_OPMODE_Msk & ((value) << AESA_MODE_OPMODE_Pos))) +#define AESA_MODE_CFBS_Pos 8 +#define AESA_MODE_CFBS_Msk (0x7u << AESA_MODE_CFBS_Pos) /**< \brief (AESA_MODE) Cipher Feedback Data Segment Size */ +#define AESA_MODE_CFBS(value) ((AESA_MODE_CFBS_Msk & ((value) << AESA_MODE_CFBS_Pos))) +#define AESA_MODE_CTYPE_Pos 16 +#define AESA_MODE_CTYPE_Msk (0xFu << AESA_MODE_CTYPE_Pos) /**< \brief (AESA_MODE) Countermeasure Type */ +#define AESA_MODE_CTYPE(value) ((AESA_MODE_CTYPE_Msk & ((value) << AESA_MODE_CTYPE_Pos))) +/* -------- AESA_DATABUFPTR : (AESA Offset: 0x08) Data Buffer Pointer Register -------- */ +#define AESA_DATABUFPTR_IDATAW_Pos 0 +#define AESA_DATABUFPTR_IDATAW_Msk (0x3u << AESA_DATABUFPTR_IDATAW_Pos) /**< \brief (AESA_DATABUFPTR) Input Data Word */ +#define AESA_DATABUFPTR_IDATAW(value) ((AESA_DATABUFPTR_IDATAW_Msk & ((value) << AESA_DATABUFPTR_IDATAW_Pos))) +#define AESA_DATABUFPTR_ODATAW_Pos 4 +#define AESA_DATABUFPTR_ODATAW_Msk (0x3u << AESA_DATABUFPTR_ODATAW_Pos) /**< \brief (AESA_DATABUFPTR) Output Data Word */ +#define AESA_DATABUFPTR_ODATAW(value) ((AESA_DATABUFPTR_ODATAW_Msk & ((value) << AESA_DATABUFPTR_ODATAW_Pos))) +/* -------- AESA_SR : (AESA Offset: 0x0C) Status Register -------- */ +#define AESA_SR_ODATARDY (0x1u << 0) /**< \brief (AESA_SR) Output Data Ready */ +#define AESA_SR_IBUFRDY (0x1u << 16) /**< \brief (AESA_SR) Input Buffer Ready */ +/* -------- AESA_IER : (AESA Offset: 0x10) Interrupt Enable Register -------- */ +#define AESA_IER_ODATARDY (0x1u << 0) /**< \brief (AESA_IER) Output Data Ready Interrupt Enable */ +#define AESA_IER_IBUFRDY (0x1u << 16) /**< \brief (AESA_IER) Input Buffer Ready Interrupt Enable */ +/* -------- AESA_IDR : (AESA Offset: 0x14) Interrupt Disable Register -------- */ +#define AESA_IDR_ODATARDY (0x1u << 0) /**< \brief (AESA_IDR) Output Data Ready Interrupt Disable */ +#define AESA_IDR_IBUFRDY (0x1u << 16) /**< \brief (AESA_IDR) Input Buffer Ready Interrupt Disable */ +/* -------- AESA_IMR : (AESA Offset: 0x18) Interrupt Mask Register -------- */ +#define AESA_IMR_ODATARDY (0x1u << 0) /**< \brief (AESA_IMR) Output Data Ready Interrupt Mask */ +#define AESA_IMR_IBUFRDY (0x1u << 16) /**< \brief (AESA_IMR) Input Buffer Ready Interrupt Mask */ +/* -------- AESA_KEY : (AESA Offset: 0x20) Key Key Register 0 -------- */ +#define AESA_KEY_KEY0_Pos 0 +#define AESA_KEY_KEY0_Msk (0xFFFFFFFFu << AESA_KEY_KEY0_Pos) /**< \brief (AESA_KEY) Key Word 0 */ +#define AESA_KEY_KEY0(value) ((AESA_KEY_KEY0_Msk & ((value) << AESA_KEY_KEY0_Pos))) +/* -------- AESA_INITVECT : (AESA Offset: 0x40) Initvect Initialization Vector Register 0 -------- */ +#define AESA_INITVECT_INITVECT0_Pos 0 +#define AESA_INITVECT_INITVECT0_Msk (0xFFFFFFFFu << AESA_INITVECT_INITVECT0_Pos) /**< \brief (AESA_INITVECT) Initialization Vector Word 0 */ +#define AESA_INITVECT_INITVECT0(value) ((AESA_INITVECT_INITVECT0_Msk & ((value) << AESA_INITVECT_INITVECT0_Pos))) +/* -------- AESA_IDATA : (AESA Offset: 0x50) Input Data Register -------- */ +#define AESA_IDATA_IDATA_Pos 0 +#define AESA_IDATA_IDATA_Msk (0xFFFFFFFFu << AESA_IDATA_IDATA_Pos) /**< \brief (AESA_IDATA) Input Data */ +#define AESA_IDATA_IDATA(value) ((AESA_IDATA_IDATA_Msk & ((value) << AESA_IDATA_IDATA_Pos))) +/* -------- AESA_ODATA : (AESA Offset: 0x60) Output Data Register -------- */ +#define AESA_ODATA_ODATA_Pos 0 +#define AESA_ODATA_ODATA_Msk (0xFFFFFFFFu << AESA_ODATA_ODATA_Pos) /**< \brief (AESA_ODATA) Output Data */ +#define AESA_ODATA_ODATA(value) ((AESA_ODATA_ODATA_Msk & ((value) << AESA_ODATA_ODATA_Pos))) +/* -------- AESA_DRNGSEED : (AESA Offset: 0x70) DRNG Seed Register -------- */ +#define AESA_DRNGSEED_SEED_Pos 0 +#define AESA_DRNGSEED_SEED_Msk (0xFFFFFFFFu << AESA_DRNGSEED_SEED_Pos) /**< \brief (AESA_DRNGSEED) DRNG Seed */ +#define AESA_DRNGSEED_SEED(value) ((AESA_DRNGSEED_SEED_Msk & ((value) << AESA_DRNGSEED_SEED_Pos))) +/* -------- AESA_PARAMETER : (AESA Offset: 0xF8) Parameter Register -------- */ +#define AESA_PARAMETER_KEYSIZE_Pos 0 +#define AESA_PARAMETER_KEYSIZE_Msk (0x3u << AESA_PARAMETER_KEYSIZE_Pos) /**< \brief (AESA_PARAMETER) Maximum Key Size */ +#define AESA_PARAMETER_KEYSIZE(value) ((AESA_PARAMETER_KEYSIZE_Msk & ((value) << AESA_PARAMETER_KEYSIZE_Pos))) +#define AESA_PARAMETER_OPMODE_Pos 2 +#define AESA_PARAMETER_OPMODE_Msk (0x7u << AESA_PARAMETER_OPMODE_Pos) /**< \brief (AESA_PARAMETER) Maximum Number of Confidentiality Modes of Operation */ +#define AESA_PARAMETER_OPMODE(value) ((AESA_PARAMETER_OPMODE_Msk & ((value) << AESA_PARAMETER_OPMODE_Pos))) +#define AESA_PARAMETER_CTRMEAS (0x1u << 8) /**< \brief (AESA_PARAMETER) Countermeasures */ +/* -------- AESA_VERSION : (AESA Offset: 0xFC) Version Register -------- */ +#define AESA_VERSION_VERSION_Pos 0 +#define AESA_VERSION_VERSION_Msk (0xFFFu << AESA_VERSION_VERSION_Pos) /**< \brief (AESA_VERSION) Version Number */ +#define AESA_VERSION_VERSION(value) ((AESA_VERSION_VERSION_Msk & ((value) << AESA_VERSION_VERSION_Pos))) +#define AESA_VERSION_VARIANT_Pos 16 +#define AESA_VERSION_VARIANT_Msk (0xFu << AESA_VERSION_VARIANT_Pos) /**< \brief (AESA_VERSION) Variant Number */ +#define AESA_VERSION_VARIANT(value) ((AESA_VERSION_VARIANT_Msk & ((value) << AESA_VERSION_VARIANT_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR AST */ +/* ============================================================================= */ +/** \addtogroup SAM4L_AST Asynchronous Timer */ +/*@{*/ + +#define REV_AST 0x311 + +#ifndef __ASSEMBLY__ +/** \brief AST hardware registers */ +typedef struct { + RwReg AST_CR; /**< \brief (AST Offset: 0x00) Control Register */ + RwReg AST_CV; /**< \brief (AST Offset: 0x04) Counter Value */ + RoReg AST_SR; /**< \brief (AST Offset: 0x08) Status Register */ + WoReg AST_SCR; /**< \brief (AST Offset: 0x0C) Status Clear Register */ + WoReg AST_IER; /**< \brief (AST Offset: 0x10) Interrupt Enable Register */ + WoReg AST_IDR; /**< \brief (AST Offset: 0x14) Interrupt Disable Register */ + RoReg AST_IMR; /**< \brief (AST Offset: 0x18) Interrupt Mask Register */ + RwReg AST_WER; /**< \brief (AST Offset: 0x1C) Wake Enable Register */ + RwReg AST_AR0; /**< \brief (AST Offset: 0x20) Alarm Register 0 */ + RwReg AST_AR1; /**< \brief (AST Offset: 0x24) Alarm Register 1 */ + RoReg Reserved1[2]; + RwReg AST_PIR0; /**< \brief (AST Offset: 0x30) Periodic Interval Register 0 */ + RwReg AST_PIR1; /**< \brief (AST Offset: 0x34) Periodic Interval Register 1 */ + RoReg Reserved2[2]; + RwReg AST_CLOCK; /**< \brief (AST Offset: 0x40) Clock Control Register */ + RwReg AST_DTR; /**< \brief (AST Offset: 0x44) Digital Tuner Register */ + WoReg AST_EVE; /**< \brief (AST Offset: 0x48) Event Enable Register */ + WoReg AST_EVD; /**< \brief (AST Offset: 0x4C) Event Disable Register */ + RoReg AST_EVM; /**< \brief (AST Offset: 0x50) Event Mask Register */ + RwReg AST_CALV; /**< \brief (AST Offset: 0x54) Calendar Value */ + RoReg Reserved3[38]; + RoReg AST_PARAMETER; /**< \brief (AST Offset: 0xF0) Parameter Register */ + RoReg Reserved4[2]; + RoReg AST_VERSION; /**< \brief (AST Offset: 0xFC) Version Register */ +} Ast; +#endif /* __ASSEMBLY__ */ +/* -------- AST_CR : (AST Offset: 0x00) Control Register -------- */ +#define AST_CR_EN (0x1u << 0) /**< \brief (AST_CR) Enable */ +#define AST_CR_EN_0 (0x0u << 0) /**< \brief (AST_CR) The AST is disabled. */ +#define AST_CR_EN_1 (0x1u << 0) /**< \brief (AST_CR) The AST is enabled */ +#define AST_CR_PCLR (0x1u << 1) /**< \brief (AST_CR) Prescaler Clear */ +#define AST_CR_CAL (0x1u << 2) /**< \brief (AST_CR) Calendar mode */ +#define AST_CR_CA0 (0x1u << 8) /**< \brief (AST_CR) Clear on Alarm 0 */ +#define AST_CR_CA1 (0x1u << 9) /**< \brief (AST_CR) Clear on Alarm 1 */ +#define AST_CR_PSEL_Pos 16 +#define AST_CR_PSEL_Msk (0x1Fu << AST_CR_PSEL_Pos) /**< \brief (AST_CR) Prescaler Select */ +#define AST_CR_PSEL(value) ((AST_CR_PSEL_Msk & ((value) << AST_CR_PSEL_Pos))) +/* -------- AST_CV : (AST Offset: 0x04) Counter Value -------- */ +#define AST_CV_VALUE_Pos 0 +#define AST_CV_VALUE_Msk (0xFFFFFFFFu << AST_CV_VALUE_Pos) /**< \brief (AST_CV) AST Value */ +#define AST_CV_VALUE(value) ((AST_CV_VALUE_Msk & ((value) << AST_CV_VALUE_Pos))) +/* -------- AST_SR : (AST Offset: 0x08) Status Register -------- */ +#define AST_SR_OVF (0x1u << 0) /**< \brief (AST_SR) Overflow */ +#define AST_SR_ALARM0 (0x1u << 8) /**< \brief (AST_SR) Alarm 0 */ +#define AST_SR_ALARM1 (0x1u << 9) /**< \brief (AST_SR) Alarm 1 */ +#define AST_SR_PER0 (0x1u << 16) /**< \brief (AST_SR) Periodic 0 */ +#define AST_SR_PER1 (0x1u << 17) /**< \brief (AST_SR) Periodic 1 */ +#define AST_SR_BUSY (0x1u << 24) /**< \brief (AST_SR) AST Busy */ +#define AST_SR_BUSY_0 (0x0u << 24) /**< \brief (AST_SR) The AST accepts writes to CV, WER, DTR, SCR, AR, PIR and CR */ +#define AST_SR_BUSY_1 (0x1u << 24) /**< \brief (AST_SR) The AST is busy and will discard writes to CV, WER, DTR, SCR, AR, PIR and CR */ +#define AST_SR_READY (0x1u << 25) /**< \brief (AST_SR) AST Ready */ +#define AST_SR_CLKBUSY (0x1u << 28) /**< \brief (AST_SR) Clock Busy */ +#define AST_SR_CLKBUSY_0 (0x0u << 28) /**< \brief (AST_SR) The clock is ready and can be changed */ +#define AST_SR_CLKBUSY_1 (0x1u << 28) /**< \brief (AST_SR) CEN has been written and the clock is busy */ +#define AST_SR_CLKRDY (0x1u << 29) /**< \brief (AST_SR) Clock Ready */ +/* -------- AST_SCR : (AST Offset: 0x0C) Status Clear Register -------- */ +#define AST_SCR_OVF (0x1u << 0) /**< \brief (AST_SCR) Overflow */ +#define AST_SCR_ALARM0 (0x1u << 8) /**< \brief (AST_SCR) Alarm 0 */ +#define AST_SCR_ALARM1 (0x1u << 9) /**< \brief (AST_SCR) Alarm 1 */ +#define AST_SCR_PER0 (0x1u << 16) /**< \brief (AST_SCR) Periodic 0 */ +#define AST_SCR_PER1 (0x1u << 17) /**< \brief (AST_SCR) Periodic 1 */ +#define AST_SCR_READY (0x1u << 25) /**< \brief (AST_SCR) AST Ready */ +#define AST_SCR_CLKRDY (0x1u << 29) /**< \brief (AST_SCR) Clock Ready */ +/* -------- AST_IER : (AST Offset: 0x10) Interrupt Enable Register -------- */ +#define AST_IER_OVF (0x1u << 0) /**< \brief (AST_IER) Overflow */ +#define AST_IER_OVF_0 (0x0u << 0) /**< \brief (AST_IER) No effect */ +#define AST_IER_OVF_1 (0x1u << 0) /**< \brief (AST_IER) Enable Interrupt. */ +#define AST_IER_ALARM0 (0x1u << 8) /**< \brief (AST_IER) Alarm 0 */ +#define AST_IER_ALARM0_0 (0x0u << 8) /**< \brief (AST_IER) No effect */ +#define AST_IER_ALARM0_1 (0x1u << 8) /**< \brief (AST_IER) Enable interrupt */ +#define AST_IER_ALARM1 (0x1u << 9) /**< \brief (AST_IER) Alarm 1 */ +#define AST_IER_ALARM1_0 (0x0u << 9) /**< \brief (AST_IER) No effect */ +#define AST_IER_ALARM1_1 (0x1u << 9) /**< \brief (AST_IER) Enable interrupt */ +#define AST_IER_PER0 (0x1u << 16) /**< \brief (AST_IER) Periodic 0 */ +#define AST_IER_PER0_0 (0x0u << 16) /**< \brief (AST_IER) No effect */ +#define AST_IER_PER0_1 (0x1u << 16) /**< \brief (AST_IER) Enable interrupt */ +#define AST_IER_PER1 (0x1u << 17) /**< \brief (AST_IER) Periodic 1 */ +#define AST_IER_PER1_0 (0x0u << 17) /**< \brief (AST_IER) No effect */ +#define AST_IER_PER1_1 (0x1u << 17) /**< \brief (AST_IER) Enable interrupt */ +#define AST_IER_READY (0x1u << 25) /**< \brief (AST_IER) AST Ready */ +#define AST_IER_READY_0 (0x0u << 25) /**< \brief (AST_IER) No effect */ +#define AST_IER_READY_1 (0x1u << 25) /**< \brief (AST_IER) Enable interrupt */ +#define AST_IER_CLKRDY (0x1u << 29) /**< \brief (AST_IER) Clock Ready */ +#define AST_IER_CLKRDY_0 (0x0u << 29) /**< \brief (AST_IER) No effect */ +#define AST_IER_CLKRDY_1 (0x1u << 29) /**< \brief (AST_IER) Enable interrupt */ +/* -------- AST_IDR : (AST Offset: 0x14) Interrupt Disable Register -------- */ +#define AST_IDR_OVF (0x1u << 0) /**< \brief (AST_IDR) Overflow */ +#define AST_IDR_OVF_0 (0x0u << 0) /**< \brief (AST_IDR) No effect */ +#define AST_IDR_OVF_1 (0x1u << 0) /**< \brief (AST_IDR) Disable Interrupt. */ +#define AST_IDR_ALARM0 (0x1u << 8) /**< \brief (AST_IDR) Alarm 0 */ +#define AST_IDR_ALARM0_0 (0x0u << 8) /**< \brief (AST_IDR) No effect */ +#define AST_IDR_ALARM0_1 (0x1u << 8) /**< \brief (AST_IDR) Disable interrupt */ +#define AST_IDR_ALARM1 (0x1u << 9) /**< \brief (AST_IDR) Alarm 1 */ +#define AST_IDR_ALARM1_0 (0x0u << 9) /**< \brief (AST_IDR) No effect */ +#define AST_IDR_ALARM1_1 (0x1u << 9) /**< \brief (AST_IDR) Disable interrupt */ +#define AST_IDR_PER0 (0x1u << 16) /**< \brief (AST_IDR) Periodic 0 */ +#define AST_IDR_PER0_0 (0x0u << 16) /**< \brief (AST_IDR) No effet */ +#define AST_IDR_PER0_1 (0x1u << 16) /**< \brief (AST_IDR) Disalbe interrupt */ +#define AST_IDR_PER1 (0x1u << 17) /**< \brief (AST_IDR) Periodic 1 */ +#define AST_IDR_PER1_0 (0x0u << 17) /**< \brief (AST_IDR) No effect */ +#define AST_IDR_PER1_1 (0x1u << 17) /**< \brief (AST_IDR) Disable interrupt */ +#define AST_IDR_READY (0x1u << 25) /**< \brief (AST_IDR) AST Ready */ +#define AST_IDR_READY_0 (0x0u << 25) /**< \brief (AST_IDR) No effect */ +#define AST_IDR_READY_1 (0x1u << 25) /**< \brief (AST_IDR) Disable interrupt */ +#define AST_IDR_CLKRDY (0x1u << 29) /**< \brief (AST_IDR) Clock Ready */ +#define AST_IDR_CLKRDY_0 (0x0u << 29) /**< \brief (AST_IDR) No effect */ +#define AST_IDR_CLKRDY_1 (0x1u << 29) /**< \brief (AST_IDR) Disable interrupt */ +/* -------- AST_IMR : (AST Offset: 0x18) Interrupt Mask Register -------- */ +#define AST_IMR_OVF (0x1u << 0) /**< \brief (AST_IMR) Overflow */ +#define AST_IMR_OVF_0 (0x0u << 0) /**< \brief (AST_IMR) Interrupt is disabled */ +#define AST_IMR_OVF_1 (0x1u << 0) /**< \brief (AST_IMR) Interrupt is enabled. */ +#define AST_IMR_ALARM0 (0x1u << 8) /**< \brief (AST_IMR) Alarm 0 */ +#define AST_IMR_ALARM0_0 (0x0u << 8) /**< \brief (AST_IMR) Interupt is disabled */ +#define AST_IMR_ALARM0_1 (0x1u << 8) /**< \brief (AST_IMR) Interrupt is enabled */ +#define AST_IMR_ALARM1 (0x1u << 9) /**< \brief (AST_IMR) Alarm 1 */ +#define AST_IMR_ALARM1_0 (0x0u << 9) /**< \brief (AST_IMR) Interrupt is disabled */ +#define AST_IMR_ALARM1_1 (0x1u << 9) /**< \brief (AST_IMR) Interrupt is enabled */ +#define AST_IMR_PER0 (0x1u << 16) /**< \brief (AST_IMR) Periodic 0 */ +#define AST_IMR_PER0_0 (0x0u << 16) /**< \brief (AST_IMR) Interrupt is disabled */ +#define AST_IMR_PER0_1 (0x1u << 16) /**< \brief (AST_IMR) Interrupt is enabled */ +#define AST_IMR_PER1 (0x1u << 17) /**< \brief (AST_IMR) Periodic 1 */ +#define AST_IMR_PER1_0 (0x0u << 17) /**< \brief (AST_IMR) Interrupt is disabled */ +#define AST_IMR_PER1_1 (0x1u << 17) /**< \brief (AST_IMR) Interrupt is enabled */ +#define AST_IMR_READY (0x1u << 25) /**< \brief (AST_IMR) AST Ready */ +#define AST_IMR_READY_0 (0x0u << 25) /**< \brief (AST_IMR) Interrupt is disabled */ +#define AST_IMR_READY_1 (0x1u << 25) /**< \brief (AST_IMR) Interrupt is enabled */ +#define AST_IMR_CLKRDY (0x1u << 29) /**< \brief (AST_IMR) Clock Ready */ +#define AST_IMR_CLKRDY_0 (0x0u << 29) /**< \brief (AST_IMR) Interrupt is disabled */ +#define AST_IMR_CLKRDY_1 (0x1u << 29) /**< \brief (AST_IMR) Interrupt is enabled */ +/* -------- AST_WER : (AST Offset: 0x1C) Wake Enable Register -------- */ +#define AST_WER_OVF (0x1u << 0) /**< \brief (AST_WER) Overflow */ +#define AST_WER_OVF_0 (0x0u << 0) /**< \brief (AST_WER) The corresponing event will not wake up the CPU from sleep mode */ +#define AST_WER_OVF_1 (0x1u << 0) /**< \brief (AST_WER) The corresponding event will wake up the CPU from sleep mode */ +#define AST_WER_ALARM0 (0x1u << 8) /**< \brief (AST_WER) Alarm 0 */ +#define AST_WER_ALARM0_0 (0x0u << 8) /**< \brief (AST_WER) The corresponing event will not wake up the CPU from sleep mode */ +#define AST_WER_ALARM0_1 (0x1u << 8) /**< \brief (AST_WER) The corresponding event will wake up the CPU from sleep mode */ +#define AST_WER_ALARM1 (0x1u << 9) /**< \brief (AST_WER) Alarm 1 */ +#define AST_WER_ALARM1_0 (0x0u << 9) /**< \brief (AST_WER) The corresponing event will not wake up the CPU from sleep mode */ +#define AST_WER_ALARM1_1 (0x1u << 9) /**< \brief (AST_WER) The corresponding event will wake up the CPU from sleep mode */ +#define AST_WER_PER0 (0x1u << 16) /**< \brief (AST_WER) Periodic 0 */ +#define AST_WER_PER0_0 (0x0u << 16) /**< \brief (AST_WER) The corresponing event will not wake up the CPU from sleep mode */ +#define AST_WER_PER0_1 (0x1u << 16) /**< \brief (AST_WER) The corresponding event will wake up the CPU from sleep mode */ +#define AST_WER_PER1 (0x1u << 17) /**< \brief (AST_WER) Periodic 1 */ +#define AST_WER_PER1_0 (0x0u << 17) /**< \brief (AST_WER) The corresponing event will not wake up the CPU from sleep mode */ +#define AST_WER_PER1_1 (0x1u << 17) /**< \brief (AST_WER) The corresponding event will wake up the CPU from sleep mode */ +/* -------- AST_AR0 : (AST Offset: 0x20) Alarm Register 0 -------- */ +#define AST_AR0_VALUE_Pos 0 +#define AST_AR0_VALUE_Msk (0xFFFFFFFFu << AST_AR0_VALUE_Pos) /**< \brief (AST_AR0) Alarm Value */ +#define AST_AR0_VALUE(value) ((AST_AR0_VALUE_Msk & ((value) << AST_AR0_VALUE_Pos))) +/* -------- AST_AR1 : (AST Offset: 0x24) Alarm Register 1 -------- */ +#define AST_AR1_VALUE_Pos 0 +#define AST_AR1_VALUE_Msk (0xFFFFFFFFu << AST_AR1_VALUE_Pos) /**< \brief (AST_AR1) Alarm Value */ +#define AST_AR1_VALUE(value) ((AST_AR1_VALUE_Msk & ((value) << AST_AR1_VALUE_Pos))) +/* -------- AST_PIR0 : (AST Offset: 0x30) Periodic Interval Register 0 -------- */ +#define AST_PIR0_INSEL_Pos 0 +#define AST_PIR0_INSEL_Msk (0x1Fu << AST_PIR0_INSEL_Pos) /**< \brief (AST_PIR0) Interval Select */ +#define AST_PIR0_INSEL(value) ((AST_PIR0_INSEL_Msk & ((value) << AST_PIR0_INSEL_Pos))) +/* -------- AST_PIR1 : (AST Offset: 0x34) Periodic Interval Register 1 -------- */ +#define AST_PIR1_INSEL_Pos 0 +#define AST_PIR1_INSEL_Msk (0x1Fu << AST_PIR1_INSEL_Pos) /**< \brief (AST_PIR1) Interval Select */ +#define AST_PIR1_INSEL(value) ((AST_PIR1_INSEL_Msk & ((value) << AST_PIR1_INSEL_Pos))) +/* -------- AST_CLOCK : (AST Offset: 0x40) Clock Control Register -------- */ +#define AST_CLOCK_CEN (0x1u << 0) /**< \brief (AST_CLOCK) Clock Enable */ +#define AST_CLOCK_CEN_0 (0x0u << 0) /**< \brief (AST_CLOCK) The clock is disabled */ +#define AST_CLOCK_CEN_1 (0x1u << 0) /**< \brief (AST_CLOCK) The clock is enabled */ +#define AST_CLOCK_CSSEL_Pos 8 +#define AST_CLOCK_CSSEL_Msk (0x7u << AST_CLOCK_CSSEL_Pos) /**< \brief (AST_CLOCK) Clock Source Selection */ +#define AST_CLOCK_CSSEL(value) ((AST_CLOCK_CSSEL_Msk & ((value) << AST_CLOCK_CSSEL_Pos))) +#define AST_CLOCK_CSSEL_SLOWCLOCK (0x0u << 8) /**< \brief (AST_CLOCK) Slow clock */ +#define AST_CLOCK_CSSEL_32KHZCLK (0x1u << 8) /**< \brief (AST_CLOCK) 32 kHz clock */ +#define AST_CLOCK_CSSEL_PBCLOCK (0x2u << 8) /**< \brief (AST_CLOCK) PB clock */ +#define AST_CLOCK_CSSEL_GCLK (0x3u << 8) /**< \brief (AST_CLOCK) Generic clock */ +#define AST_CLOCK_CSSEL_1KHZCLK (0x4u << 8) /**< \brief (AST_CLOCK) 1kHz clock from 32 kHz oscillator */ +/* -------- AST_DTR : (AST Offset: 0x44) Digital Tuner Register -------- */ +#define AST_DTR_EXP_Pos 0 +#define AST_DTR_EXP_Msk (0x1Fu << AST_DTR_EXP_Pos) /**< \brief (AST_DTR) EXP */ +#define AST_DTR_EXP(value) ((AST_DTR_EXP_Msk & ((value) << AST_DTR_EXP_Pos))) +#define AST_DTR_ADD (0x1u << 5) /**< \brief (AST_DTR) ADD */ +#define AST_DTR_VALUE_Pos 8 +#define AST_DTR_VALUE_Msk (0xFFu << AST_DTR_VALUE_Pos) /**< \brief (AST_DTR) VALUE */ +#define AST_DTR_VALUE(value) ((AST_DTR_VALUE_Msk & ((value) << AST_DTR_VALUE_Pos))) +/* -------- AST_EVE : (AST Offset: 0x48) Event Enable Register -------- */ +#define AST_EVE_OVF (0x1u << 0) /**< \brief (AST_EVE) Overflow */ +#define AST_EVE_ALARM0 (0x1u << 8) /**< \brief (AST_EVE) Alarm 0 */ +#define AST_EVE_ALARM1 (0x1u << 9) /**< \brief (AST_EVE) Alarm 1 */ +#define AST_EVE_PER0 (0x1u << 16) /**< \brief (AST_EVE) Perioidc 0 */ +#define AST_EVE_PER1 (0x1u << 17) /**< \brief (AST_EVE) Periodic 1 */ +/* -------- AST_EVD : (AST Offset: 0x4C) Event Disable Register -------- */ +#define AST_EVD_OVF (0x1u << 0) /**< \brief (AST_EVD) Overflow */ +#define AST_EVD_ALARM0 (0x1u << 8) /**< \brief (AST_EVD) Alarm 0 */ +#define AST_EVD_ALARM1 (0x1u << 9) /**< \brief (AST_EVD) Alarm 1 */ +#define AST_EVD_PER0 (0x1u << 16) /**< \brief (AST_EVD) Perioidc 0 */ +#define AST_EVD_PER1 (0x1u << 17) /**< \brief (AST_EVD) Periodic 1 */ +/* -------- AST_EVM : (AST Offset: 0x50) Event Mask Register -------- */ +#define AST_EVM_OVF (0x1u << 0) /**< \brief (AST_EVM) Overflow */ +#define AST_EVM_ALARM0 (0x1u << 8) /**< \brief (AST_EVM) Alarm 0 */ +#define AST_EVM_ALARM1 (0x1u << 9) /**< \brief (AST_EVM) Alarm 1 */ +#define AST_EVM_PER0 (0x1u << 16) /**< \brief (AST_EVM) Perioidc 0 */ +#define AST_EVM_PER1 (0x1u << 17) /**< \brief (AST_EVM) Periodic 1 */ +/* -------- AST_CALV : (AST Offset: 0x54) Calendar Value -------- */ +#define AST_CALV_SEC_Pos 0 +#define AST_CALV_SEC_Msk (0x3Fu << AST_CALV_SEC_Pos) /**< \brief (AST_CALV) Second */ +#define AST_CALV_SEC(value) ((AST_CALV_SEC_Msk & ((value) << AST_CALV_SEC_Pos))) +#define AST_CALV_MIN_Pos 6 +#define AST_CALV_MIN_Msk (0x3Fu << AST_CALV_MIN_Pos) /**< \brief (AST_CALV) Minute */ +#define AST_CALV_MIN(value) ((AST_CALV_MIN_Msk & ((value) << AST_CALV_MIN_Pos))) +#define AST_CALV_HOUR_Pos 12 +#define AST_CALV_HOUR_Msk (0x1Fu << AST_CALV_HOUR_Pos) /**< \brief (AST_CALV) Hour */ +#define AST_CALV_HOUR(value) ((AST_CALV_HOUR_Msk & ((value) << AST_CALV_HOUR_Pos))) +#define AST_CALV_DAY_Pos 17 +#define AST_CALV_DAY_Msk (0x1Fu << AST_CALV_DAY_Pos) /**< \brief (AST_CALV) Day */ +#define AST_CALV_DAY(value) ((AST_CALV_DAY_Msk & ((value) << AST_CALV_DAY_Pos))) +#define AST_CALV_MONTH_Pos 22 +#define AST_CALV_MONTH_Msk (0xFu << AST_CALV_MONTH_Pos) /**< \brief (AST_CALV) Month */ +#define AST_CALV_MONTH(value) ((AST_CALV_MONTH_Msk & ((value) << AST_CALV_MONTH_Pos))) +#define AST_CALV_YEAR_Pos 26 +#define AST_CALV_YEAR_Msk (0x3Fu << AST_CALV_YEAR_Pos) /**< \brief (AST_CALV) Year */ +#define AST_CALV_YEAR(value) ((AST_CALV_YEAR_Msk & ((value) << AST_CALV_YEAR_Pos))) +/* -------- AST_PARAMETER : (AST Offset: 0xF0) Parameter Register -------- */ +#define AST_PARAMETER_DT (0x1u << 0) /**< \brief (AST_PARAMETER) Digital Tuner */ +#define AST_PARAMETER_DT_OFF (0x0u << 0) /**< \brief (AST_PARAMETER) Digital tuner off */ +#define AST_PARAMETER_DT_ON (0x1u << 0) /**< \brief (AST_PARAMETER) Digital tuner on */ +#define AST_PARAMETER_DTEXPWA (0x1u << 1) /**< \brief (AST_PARAMETER) Digital Tuner Exponent Writeable */ +#define AST_PARAMETER_DTEXPWA_0 (0x0u << 1) /**< \brief (AST_PARAMETER) Digital tuner exponent is a constant value. Writes to EXP bitfield in DTR will be discarded. */ +#define AST_PARAMETER_DTEXPWA_1 (0x1u << 1) /**< \brief (AST_PARAMETER) Digital tuner exponent is chosen by writing to EXP bitfield in DTR */ +#define AST_PARAMETER_DTEXPVALUE_Pos 2 +#define AST_PARAMETER_DTEXPVALUE_Msk (0x1Fu << AST_PARAMETER_DTEXPVALUE_Pos) /**< \brief (AST_PARAMETER) Digital Tuner Exponent Value */ +#define AST_PARAMETER_DTEXPVALUE(value) ((AST_PARAMETER_DTEXPVALUE_Msk & ((value) << AST_PARAMETER_DTEXPVALUE_Pos))) +#define AST_PARAMETER_NUMAR_Pos 8 +#define AST_PARAMETER_NUMAR_Msk (0x3u << AST_PARAMETER_NUMAR_Pos) /**< \brief (AST_PARAMETER) Number of alarm comparators */ +#define AST_PARAMETER_NUMAR(value) ((AST_PARAMETER_NUMAR_Msk & ((value) << AST_PARAMETER_NUMAR_Pos))) +#define AST_PARAMETER_NUMAR_ZERO (0x0u << 8) /**< \brief (AST_PARAMETER) No alarm comparators */ +#define AST_PARAMETER_NUMAR_ONE (0x1u << 8) /**< \brief (AST_PARAMETER) One alarm comparator */ +#define AST_PARAMETER_NUMAR_TWO (0x2u << 8) /**< \brief (AST_PARAMETER) Two alarm comparators */ +#define AST_PARAMETER_NUMPIR (0x1u << 12) /**< \brief (AST_PARAMETER) Number of periodic comparators */ +#define AST_PARAMETER_NUMPIR_ONE (0x0u << 12) /**< \brief (AST_PARAMETER) One periodic comparator */ +#define AST_PARAMETER_NUMPIR_TWO (0x1u << 12) /**< \brief (AST_PARAMETER) Two periodic comparators */ +#define AST_PARAMETER_PIR0WA (0x1u << 14) /**< \brief (AST_PARAMETER) Periodic Interval 0 Writeable */ +#define AST_PARAMETER_PIR0WA_0 (0x0u << 14) /**< \brief (AST_PARAMETER) Periodic alarm prescaler 0 tapping is a constant value. Writes to INSEL bitfield in PIR0 will be discarded. */ +#define AST_PARAMETER_PIR0WA_1 (0x1u << 14) /**< \brief (AST_PARAMETER) Periodic alarm prescaler 0 tapping is chosen by writing to INSEL bitfield in PIR0 */ +#define AST_PARAMETER_PIR1WA (0x1u << 15) /**< \brief (AST_PARAMETER) Periodic Interval 1 Writeable */ +#define AST_PARAMETER_PIR1WA_0 (0x0u << 15) /**< \brief (AST_PARAMETER) Writes to PIR1 will be discarded */ +#define AST_PARAMETER_PIR1WA_1 (0x1u << 15) /**< \brief (AST_PARAMETER) PIR1 can be written */ +#define AST_PARAMETER_PER0VALUE_Pos 16 +#define AST_PARAMETER_PER0VALUE_Msk (0x1Fu << AST_PARAMETER_PER0VALUE_Pos) /**< \brief (AST_PARAMETER) Periodic Interval 0 Value */ +#define AST_PARAMETER_PER0VALUE(value) ((AST_PARAMETER_PER0VALUE_Msk & ((value) << AST_PARAMETER_PER0VALUE_Pos))) +#define AST_PARAMETER_PER1VALUE_Pos 24 +#define AST_PARAMETER_PER1VALUE_Msk (0x1Fu << AST_PARAMETER_PER1VALUE_Pos) /**< \brief (AST_PARAMETER) Periodic Interval 1 Value */ +#define AST_PARAMETER_PER1VALUE(value) ((AST_PARAMETER_PER1VALUE_Msk & ((value) << AST_PARAMETER_PER1VALUE_Pos))) +/* -------- AST_VERSION : (AST Offset: 0xFC) Version Register -------- */ +#define AST_VERSION_VERSION_Pos 0 +#define AST_VERSION_VERSION_Msk (0xFFFu << AST_VERSION_VERSION_Pos) /**< \brief (AST_VERSION) Version Number */ +#define AST_VERSION_VERSION(value) ((AST_VERSION_VERSION_Msk & ((value) << AST_VERSION_VERSION_Pos))) +#define AST_VERSION_VARIANT_Pos 16 +#define AST_VERSION_VARIANT_Msk (0xFu << AST_VERSION_VARIANT_Pos) /**< \brief (AST_VERSION) Variant Number */ +#define AST_VERSION_VARIANT(value) ((AST_VERSION_VARIANT_Msk & ((value) << AST_VERSION_VARIANT_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR BPM */ +/* ============================================================================= */ +/** \addtogroup SAM4L_BPM Backup Power Manager */ +/*@{*/ + +#define REV_BPM 0x120 + +#ifndef __ASSEMBLY__ +/** \brief BPM hardware registers */ +typedef struct { + WoReg BPM_IER; /**< \brief (BPM Offset: 0x00) Interrupt Enable Register */ + WoReg BPM_IDR; /**< \brief (BPM Offset: 0x04) Interrupt Disable Register */ + RoReg BPM_IMR; /**< \brief (BPM Offset: 0x08) Interrupt Mask Register */ + RoReg BPM_ISR; /**< \brief (BPM Offset: 0x0C) Interrupt Status Register */ + WoReg BPM_ICR; /**< \brief (BPM Offset: 0x10) Interrupt Clear Register */ + RoReg BPM_SR; /**< \brief (BPM Offset: 0x14) Status Register */ + WoReg BPM_UNLOCK; /**< \brief (BPM Offset: 0x18) Unlock Register */ + RwReg BPM_PMCON; /**< \brief (BPM Offset: 0x1C) Power Mode Control Register */ + RoReg Reserved1[2]; + RoReg BPM_BKUPWCAUSE; /**< \brief (BPM Offset: 0x28) Backup Wake up Cause Register */ + RwReg BPM_BKUPWEN; /**< \brief (BPM Offset: 0x2C) Backup Wake up Enable Register */ + RwReg BPM_BKUPPMUX; /**< \brief (BPM Offset: 0x30) Backup Pin Muxing Register */ + RwReg BPM_IORET; /**< \brief (BPM Offset: 0x34) Input Output Retention Register */ + RoReg Reserved2[2]; + RwReg BPM_BPR; /**< \brief (BPM Offset: 0x40) Bypass Register */ + RoReg BPM_FWRUNPS; /**< \brief (BPM Offset: 0x44) Factory Word Run PS Register */ + RoReg BPM_FWPSAVEPS; /**< \brief (BPM Offset: 0x48) Factory Word Power Save PS Register */ + RoReg Reserved3[44]; + RoReg BPM_VERSION; /**< \brief (BPM Offset: 0xFC) Version Register */ +} Bpm; +#endif /* __ASSEMBLY__ */ +/* -------- BPM_IER : (BPM Offset: 0x00) Interrupt Enable Register -------- */ +#define BPM_IER_PSOK (0x1u << 0) /**< \brief (BPM_IER) Power Scaling OK Interrupt Enable */ +#define BPM_IER_AE (0x1u << 31) /**< \brief (BPM_IER) Access Error Interrupt Enable */ +/* -------- BPM_IDR : (BPM Offset: 0x04) Interrupt Disable Register -------- */ +#define BPM_IDR_PSOK (0x1u << 0) /**< \brief (BPM_IDR) Power Scaling OK Interrupt Disable */ +#define BPM_IDR_AE (0x1u << 31) /**< \brief (BPM_IDR) Access Error Interrupt Disable */ +/* -------- BPM_IMR : (BPM Offset: 0x08) Interrupt Mask Register -------- */ +#define BPM_IMR_PSOK (0x1u << 0) /**< \brief (BPM_IMR) Power Scaling OK Interrupt Mask */ +#define BPM_IMR_AE (0x1u << 31) /**< \brief (BPM_IMR) Access Error Interrupt Mask */ +/* -------- BPM_ISR : (BPM Offset: 0x0C) Interrupt Status Register -------- */ +#define BPM_ISR_PSOK (0x1u << 0) /**< \brief (BPM_ISR) Power Scaling OK Interrupt Status */ +#define BPM_ISR_AE (0x1u << 31) /**< \brief (BPM_ISR) Access Error Interrupt Status */ +/* -------- BPM_ICR : (BPM Offset: 0x10) Interrupt Clear Register -------- */ +#define BPM_ICR_PSOK (0x1u << 0) /**< \brief (BPM_ICR) Power Scaling OK Interrupt Status Clear */ +#define BPM_ICR_AE (0x1u << 31) /**< \brief (BPM_ICR) Access Error Interrupt Status Clear */ +/* -------- BPM_SR : (BPM Offset: 0x14) Status Register -------- */ +#define BPM_SR_PSOK (0x1u << 0) /**< \brief (BPM_SR) Power Scaling OK Status */ +/* -------- BPM_UNLOCK : (BPM Offset: 0x18) Unlock Register -------- */ +#define BPM_UNLOCK_ADDR_Pos 0 +#define BPM_UNLOCK_ADDR_Msk (0x3FFu << BPM_UNLOCK_ADDR_Pos) /**< \brief (BPM_UNLOCK) Unlock Address */ +#define BPM_UNLOCK_ADDR(value) ((BPM_UNLOCK_ADDR_Msk & ((value) << BPM_UNLOCK_ADDR_Pos))) +#define BPM_UNLOCK_KEY_Pos 24 +#define BPM_UNLOCK_KEY_Msk (0xFFu << BPM_UNLOCK_KEY_Pos) /**< \brief (BPM_UNLOCK) Unlock Key */ +#define BPM_UNLOCK_KEY(value) ((BPM_UNLOCK_KEY_Msk & ((value) << BPM_UNLOCK_KEY_Pos))) +/* -------- BPM_PMCON : (BPM Offset: 0x1C) Power Mode Control Register -------- */ +#define BPM_PMCON_PS_Pos 0 +#define BPM_PMCON_PS_Msk (0x3u << BPM_PMCON_PS_Pos) /**< \brief (BPM_PMCON) Power Scaling Configuration Value */ +#define BPM_PMCON_PS(value) ((BPM_PMCON_PS_Msk & ((value) << BPM_PMCON_PS_Pos))) +#define BPM_PMCON_PSCREQ (0x1u << 2) /**< \brief (BPM_PMCON) Power Scaling Change Request */ +#define BPM_PMCON_PSCM (0x1u << 3) /**< \brief (BPM_PMCON) Power Scaling Change Mode */ +#define BPM_PMCON_BKUP (0x1u << 8) /**< \brief (BPM_PMCON) BACKUP Mode */ +#define BPM_PMCON_RET (0x1u << 9) /**< \brief (BPM_PMCON) RETENTION Mode */ +#define BPM_PMCON_SLEEP_Pos 12 +#define BPM_PMCON_SLEEP_Msk (0x3u << BPM_PMCON_SLEEP_Pos) /**< \brief (BPM_PMCON) SLEEP mode Configuration */ +#define BPM_PMCON_SLEEP(value) ((BPM_PMCON_SLEEP_Msk & ((value) << BPM_PMCON_SLEEP_Pos))) +#define BPM_PMCON_CK32S (0x1u << 16) /**< \brief (BPM_PMCON) 32Khz-1Khz Clock Source Selection */ +#define BPM_PMCON_FASTWKUP (0x1u << 24) /**< \brief (BPM_PMCON) Fast Wakeup */ +/* -------- BPM_BKUPPMUX : (BPM Offset: 0x30) Backup Pin Muxing Register -------- */ +#define BPM_BKUPPMUX_BKUPPMUX_Pos 0 +#define BPM_BKUPPMUX_BKUPPMUX_Msk (0x1FFu << BPM_BKUPPMUX_BKUPPMUX_Pos) /**< \brief (BPM_BKUPPMUX) Backup Pin Muxing */ +#define BPM_BKUPPMUX_BKUPPMUX(value) ((BPM_BKUPPMUX_BKUPPMUX_Msk & ((value) << BPM_BKUPPMUX_BKUPPMUX_Pos))) +/* -------- BPM_IORET : (BPM Offset: 0x34) Input Output Retention Register -------- */ +#define BPM_IORET_RET (0x1u << 0) /**< \brief (BPM_IORET) Retention on I/O lines after waking up from the BACKUP mode */ +/* -------- BPM_BPR : (BPM Offset: 0x40) Bypass Register -------- */ +#define BPM_BPR_RUNPSPB (0x1u << 0) /**< \brief (BPM_BPR) Run Mode Power Scaling Preset Bypass */ +#define BPM_BPR_PSMPSPB (0x1u << 1) /**< \brief (BPM_BPR) Power Save Mode Power Scaling Preset Bypass */ +#define BPM_BPR_SEQSTN (0x1u << 2) /**< \brief (BPM_BPR) Sequencial Startup from ULP (Active Low) */ +#define BPM_BPR_PSBTD (0x1u << 3) /**< \brief (BPM_BPR) Power Scaling Bias Timing Disable */ +#define BPM_BPR_PSHFD (0x1u << 4) /**< \brief (BPM_BPR) Power Scaling Halt Flash Until VREGOK Disable */ +#define BPM_BPR_DLYRSTD (0x1u << 5) /**< \brief (BPM_BPR) Delaying Reset Disable */ +#define BPM_BPR_BIASSEN (0x1u << 6) /**< \brief (BPM_BPR) Bias Switch Enable */ +#define BPM_BPR_LATSEN (0x1u << 7) /**< \brief (BPM_BPR) Latdel Switch Enable */ +#define BPM_BPR_BOD18CONT (0x1u << 8) /**< \brief (BPM_BPR) BOD18 in continuous mode not disabled in WAIT/RET/BACKUP modes */ +#define BPM_BPR_POBS (0x1u << 9) /**< \brief (BPM_BPR) Pico Uart Observability */ +#define BPM_BPR_FFFW (0x1u << 10) /**< \brief (BPM_BPR) Force Flash Fast Wakeup */ +#define BPM_BPR_FBRDYEN (0x1u << 11) /**< \brief (BPM_BPR) Flash Bias Ready Enable */ +#define BPM_BPR_FVREFSEN (0x1u << 12) /**< \brief (BPM_BPR) Flash Vref Switch Enable */ +/* -------- BPM_FWRUNPS : (BPM Offset: 0x44) Factory Word Run PS Register -------- */ +#define BPM_FWRUNPS_REGLEVEL_Pos 0 +#define BPM_FWRUNPS_REGLEVEL_Msk (0xFu << BPM_FWRUNPS_REGLEVEL_Pos) /**< \brief (BPM_FWRUNPS) Regulator Voltage Level */ +#define BPM_FWRUNPS_REGLEVEL(value) ((BPM_FWRUNPS_REGLEVEL_Msk & ((value) << BPM_FWRUNPS_REGLEVEL_Pos))) +#define BPM_FWRUNPS_REGTYPE_Pos 4 +#define BPM_FWRUNPS_REGTYPE_Msk (0x3u << BPM_FWRUNPS_REGTYPE_Pos) /**< \brief (BPM_FWRUNPS) Regulator Type */ +#define BPM_FWRUNPS_REGTYPE(value) ((BPM_FWRUNPS_REGTYPE_Msk & ((value) << BPM_FWRUNPS_REGTYPE_Pos))) +#define BPM_FWRUNPS_REGTYPE_NORMAL (0x0u << 4) /**< \brief (BPM_FWRUNPS) */ +#define BPM_FWRUNPS_REGTYPE_LP (0x1u << 4) /**< \brief (BPM_FWRUNPS) */ +#define BPM_FWRUNPS_REGTYPE_XULP (0x2u << 4) /**< \brief (BPM_FWRUNPS) */ +#define BPM_FWRUNPS_REFTYPE_Pos 6 +#define BPM_FWRUNPS_REFTYPE_Msk (0x3u << BPM_FWRUNPS_REFTYPE_Pos) /**< \brief (BPM_FWRUNPS) Reference Type */ +#define BPM_FWRUNPS_REFTYPE(value) ((BPM_FWRUNPS_REFTYPE_Msk & ((value) << BPM_FWRUNPS_REFTYPE_Pos))) +#define BPM_FWRUNPS_REFTYPE_BOTH (0x0u << 6) /**< \brief (BPM_FWRUNPS) */ +#define BPM_FWRUNPS_REFTYPE_BG (0x1u << 6) /**< \brief (BPM_FWRUNPS) */ +#define BPM_FWRUNPS_REFTYPE_LPBG (0x2u << 6) /**< \brief (BPM_FWRUNPS) */ +#define BPM_FWRUNPS_REFTYPE_INTERNAL (0x3u << 6) /**< \brief (BPM_FWRUNPS) */ +#define BPM_FWRUNPS_FLASHLATDEL_Pos 8 +#define BPM_FWRUNPS_FLASHLATDEL_Msk (0x1Fu << BPM_FWRUNPS_FLASHLATDEL_Pos) /**< \brief (BPM_FWRUNPS) Flash Latch Delay Value */ +#define BPM_FWRUNPS_FLASHLATDEL(value) ((BPM_FWRUNPS_FLASHLATDEL_Msk & ((value) << BPM_FWRUNPS_FLASHLATDEL_Pos))) +#define BPM_FWRUNPS_FLASHBIAS_Pos 13 +#define BPM_FWRUNPS_FLASHBIAS_Msk (0xFu << BPM_FWRUNPS_FLASHBIAS_Pos) /**< \brief (BPM_FWRUNPS) Flash Bias Value */ +#define BPM_FWRUNPS_FLASHBIAS(value) ((BPM_FWRUNPS_FLASHBIAS_Msk & ((value) << BPM_FWRUNPS_FLASHBIAS_Pos))) +#define BPM_FWRUNPS_FPPW (0x1u << 17) /**< \brief (BPM_FWRUNPS) Flash Pico Power Mode */ +#define BPM_FWRUNPS_RC115_Pos 18 +#define BPM_FWRUNPS_RC115_Msk (0x7Fu << BPM_FWRUNPS_RC115_Pos) /**< \brief (BPM_FWRUNPS) RC 115KHZ Calibration Value */ +#define BPM_FWRUNPS_RC115(value) ((BPM_FWRUNPS_RC115_Msk & ((value) << BPM_FWRUNPS_RC115_Pos))) +#define BPM_FWRUNPS_RCFAST_Pos 25 +#define BPM_FWRUNPS_RCFAST_Msk (0x7Fu << BPM_FWRUNPS_RCFAST_Pos) /**< \brief (BPM_FWRUNPS) RCFAST Calibration Value */ +#define BPM_FWRUNPS_RCFAST(value) ((BPM_FWRUNPS_RCFAST_Msk & ((value) << BPM_FWRUNPS_RCFAST_Pos))) +/* -------- BPM_FWPSAVEPS : (BPM Offset: 0x48) Factory Word Power Save PS Register -------- */ +#define BPM_FWPSAVEPS_WREGLEVEL_Pos 0 +#define BPM_FWPSAVEPS_WREGLEVEL_Msk (0xFu << BPM_FWPSAVEPS_WREGLEVEL_Pos) /**< \brief (BPM_FWPSAVEPS) Wait mode Regulator Level */ +#define BPM_FWPSAVEPS_WREGLEVEL(value) ((BPM_FWPSAVEPS_WREGLEVEL_Msk & ((value) << BPM_FWPSAVEPS_WREGLEVEL_Pos))) +#define BPM_FWPSAVEPS_WBIAS_Pos 4 +#define BPM_FWPSAVEPS_WBIAS_Msk (0xFu << BPM_FWPSAVEPS_WBIAS_Pos) /**< \brief (BPM_FWPSAVEPS) Bias in wait mode */ +#define BPM_FWPSAVEPS_WBIAS(value) ((BPM_FWPSAVEPS_WBIAS_Msk & ((value) << BPM_FWPSAVEPS_WBIAS_Pos))) +#define BPM_FWPSAVEPS_WLATDEL_Pos 8 +#define BPM_FWPSAVEPS_WLATDEL_Msk (0x1Fu << BPM_FWPSAVEPS_WLATDEL_Pos) /**< \brief (BPM_FWPSAVEPS) Flash Latdel in wait mode */ +#define BPM_FWPSAVEPS_WLATDEL(value) ((BPM_FWPSAVEPS_WLATDEL_Msk & ((value) << BPM_FWPSAVEPS_WLATDEL_Pos))) +#define BPM_FWPSAVEPS_RREGLEVEL_Pos 13 +#define BPM_FWPSAVEPS_RREGLEVEL_Msk (0xFu << BPM_FWPSAVEPS_RREGLEVEL_Pos) /**< \brief (BPM_FWPSAVEPS) Retention mode Regulator Level */ +#define BPM_FWPSAVEPS_RREGLEVEL(value) ((BPM_FWPSAVEPS_RREGLEVEL_Msk & ((value) << BPM_FWPSAVEPS_RREGLEVEL_Pos))) +#define BPM_FWPSAVEPS_RBIAS_Pos 17 +#define BPM_FWPSAVEPS_RBIAS_Msk (0xFu << BPM_FWPSAVEPS_RBIAS_Pos) /**< \brief (BPM_FWPSAVEPS) Bias in Retention mode */ +#define BPM_FWPSAVEPS_RBIAS(value) ((BPM_FWPSAVEPS_RBIAS_Msk & ((value) << BPM_FWPSAVEPS_RBIAS_Pos))) +#define BPM_FWPSAVEPS_RLATDEL_Pos 21 +#define BPM_FWPSAVEPS_RLATDEL_Msk (0x1Fu << BPM_FWPSAVEPS_RLATDEL_Pos) /**< \brief (BPM_FWPSAVEPS) Flash Latdel in Retention mode */ +#define BPM_FWPSAVEPS_RLATDEL(value) ((BPM_FWPSAVEPS_RLATDEL_Msk & ((value) << BPM_FWPSAVEPS_RLATDEL_Pos))) +#define BPM_FWPSAVEPS_BREGLEVEL_Pos 26 +#define BPM_FWPSAVEPS_BREGLEVEL_Msk (0xFu << BPM_FWPSAVEPS_BREGLEVEL_Pos) /**< \brief (BPM_FWPSAVEPS) Backup mode Regulator Level */ +#define BPM_FWPSAVEPS_BREGLEVEL(value) ((BPM_FWPSAVEPS_BREGLEVEL_Msk & ((value) << BPM_FWPSAVEPS_BREGLEVEL_Pos))) +#define BPM_FWPSAVEPS_POR18DIS (0x1u << 30) /**< \brief (BPM_FWPSAVEPS) POR 18 Disable */ +#define BPM_FWPSAVEPS_FWSAS (0x1u << 31) /**< \brief (BPM_FWPSAVEPS) Flash Wait State Automatic Switching */ +/* -------- BPM_VERSION : (BPM Offset: 0xFC) Version Register -------- */ +#define BPM_VERSION_VERSION_Pos 0 +#define BPM_VERSION_VERSION_Msk (0xFFFu << BPM_VERSION_VERSION_Pos) /**< \brief (BPM_VERSION) Version Number */ +#define BPM_VERSION_VERSION(value) ((BPM_VERSION_VERSION_Msk & ((value) << BPM_VERSION_VERSION_Pos))) +#define BPM_VERSION_VARIANT_Pos 16 +#define BPM_VERSION_VARIANT_Msk (0xFu << BPM_VERSION_VARIANT_Pos) /**< \brief (BPM_VERSION) Variant Number */ +#define BPM_VERSION_VARIANT(value) ((BPM_VERSION_VARIANT_Msk & ((value) << BPM_VERSION_VARIANT_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR BSCIF */ +/* ============================================================================= */ +/** \addtogroup SAM4L_BSCIF Backup System Control Interface */ +/*@{*/ + +#define REV_BSCIF 0x100 + +#ifndef __ASSEMBLY__ +/** \brief BscifBr hardware registers */ +typedef struct { + RwReg BSCIF_BR; /**< \brief (BscifBr Offset: 0x000) Backup Register */ +} BscifBr; +/** \brief BSCIF hardware registers */ +typedef struct { + WoReg BSCIF_IER; /**< \brief (BSCIF Offset: 0x000) Interrupt Enable Register */ + WoReg BSCIF_IDR; /**< \brief (BSCIF Offset: 0x004) Interrupt Disable Register */ + RoReg BSCIF_IMR; /**< \brief (BSCIF Offset: 0x008) Interrupt Mask Register */ + RoReg BSCIF_ISR; /**< \brief (BSCIF Offset: 0x00C) Interrupt Status Register */ + WoReg BSCIF_ICR; /**< \brief (BSCIF Offset: 0x010) Interrupt Clear Register */ + RoReg BSCIF_PCLKSR; /**< \brief (BSCIF Offset: 0x014) Power and Clocks Status Register */ + WoReg BSCIF_UNLOCK; /**< \brief (BSCIF Offset: 0x018) Unlock Register */ + RwReg BSCIF_CSCR; /**< \brief (BSCIF Offset: 0x01C) Chip Specific Configuration Register */ + RwReg BSCIF_OSCCTRL32; /**< \brief (BSCIF Offset: 0x020) Oscillator 32 Control Register */ + RwReg BSCIF_RC32KCR; /**< \brief (BSCIF Offset: 0x024) 32 kHz RC Oscillator Control Register */ + RwReg BSCIF_RC32KTUNE; /**< \brief (BSCIF Offset: 0x028) 32kHz RC Oscillator Tuning Register */ + RwReg BSCIF_BOD33CTRL; /**< \brief (BSCIF Offset: 0x02C) BOD33 Control Register */ + RwReg BSCIF_BOD33LEVEL; /**< \brief (BSCIF Offset: 0x030) BOD33 Level Register */ + RwReg BSCIF_BOD33SAMPLING; /**< \brief (BSCIF Offset: 0x034) BOD33 Sampling Control Register */ + RwReg BSCIF_BOD18CTRL; /**< \brief (BSCIF Offset: 0x038) BOD18 Control Register */ + RwReg BSCIF_BOD18LEVEL; /**< \brief (BSCIF Offset: 0x03C) BOD18 Level Register */ + RoReg Reserved1[1]; + RwReg BSCIF_VREGCR; /**< \brief (BSCIF Offset: 0x044) Voltage Regulator Configuration Register */ + RoReg Reserved2[1]; + RwReg BSCIF_VREGNCSR; /**< \brief (BSCIF Offset: 0x04C) Normal Mode Control and Status Register */ + RwReg BSCIF_VREGLPCSR; /**< \brief (BSCIF Offset: 0x050) LP Mode Control and Status Register */ + RoReg Reserved3[1]; + RwReg BSCIF_RC1MCR; /**< \brief (BSCIF Offset: 0x058) 1MHz RC Clock Configuration Register */ + RwReg BSCIF_BGCR; /**< \brief (BSCIF Offset: 0x05C) Bandgap Calibration Register */ + RwReg BSCIF_BGCTRL; /**< \brief (BSCIF Offset: 0x060) Bandgap Control Register */ + RoReg BSCIF_BGSR; /**< \brief (BSCIF Offset: 0x064) Bandgap Status Register */ + RoReg Reserved4[4]; + BscifBr BSCIF_BR[4]; /**< \brief (BSCIF Offset: 0x078) BscifBr groups */ + RoReg Reserved5[215]; + RoReg BSCIF_BRIFBVERSION; /**< \brief (BSCIF Offset: 0x3E4) Backup Register Interface Version Register */ + RoReg BSCIF_BGREFIFBVERSION; /**< \brief (BSCIF Offset: 0x3E8) BGREFIFB Version Register */ + RoReg BSCIF_VREGIFGVERSION; /**< \brief (BSCIF Offset: 0x3EC) VREGIFA Version Register */ + RoReg BSCIF_BODIFCVERSION; /**< \brief (BSCIF Offset: 0x3F0) BODIFC Version Register */ + RoReg BSCIF_RC32KIFBVERSION; /**< \brief (BSCIF Offset: 0x3F4) 32 kHz RC Oscillator Version Register */ + RoReg BSCIF_OSC32IFAVERSION; /**< \brief (BSCIF Offset: 0x3F8) 32 KHz Oscillator Version Register */ + RoReg BSCIF_VERSION; /**< \brief (BSCIF Offset: 0x3FC) BSCIF Version Register */ +} Bscif; +#endif /* __ASSEMBLY__ */ +/* -------- BSCIF_IER : (BSCIF Offset: 0x000) Interrupt Enable Register -------- */ +#define BSCIF_IER_OSC32RDY (0x1u << 0) /**< \brief (BSCIF_IER) */ +#define BSCIF_IER_RC32KRDY (0x1u << 1) /**< \brief (BSCIF_IER) */ +#define BSCIF_IER_RC32KLOCK (0x1u << 2) /**< \brief (BSCIF_IER) */ +#define BSCIF_IER_RC32KREFE (0x1u << 3) /**< \brief (BSCIF_IER) */ +#define BSCIF_IER_RC32KSAT (0x1u << 4) /**< \brief (BSCIF_IER) */ +#define BSCIF_IER_BOD33DET (0x1u << 5) /**< \brief (BSCIF_IER) BOD33 Detected */ +#define BSCIF_IER_BOD18DET (0x1u << 6) /**< \brief (BSCIF_IER) BOD18 Detected */ +#define BSCIF_IER_BOD33SYNRDY (0x1u << 7) /**< \brief (BSCIF_IER) BOD33 Synchronization Ready */ +#define BSCIF_IER_BOD18SYNRDY (0x1u << 8) /**< \brief (BSCIF_IER) BOD18 Synchronization Ready */ +#define BSCIF_IER_SSWRDY (0x1u << 9) /**< \brief (BSCIF_IER) VREG Stop Switching Ready */ +#define BSCIF_IER_VREGOK (0x1u << 10) /**< \brief (BSCIF_IER) Main VREG OK */ +#define BSCIF_IER_LPBGRDY (0x1u << 12) /**< \brief (BSCIF_IER) Low Power Bandgap Voltage Reference Ready */ +#define BSCIF_IER_AE (0x1u << 31) /**< \brief (BSCIF_IER) Access Error */ +/* -------- BSCIF_IDR : (BSCIF Offset: 0x004) Interrupt Disable Register -------- */ +#define BSCIF_IDR_OSC32RDY (0x1u << 0) /**< \brief (BSCIF_IDR) */ +#define BSCIF_IDR_RC32KRDY (0x1u << 1) /**< \brief (BSCIF_IDR) */ +#define BSCIF_IDR_RC32KLOCK (0x1u << 2) /**< \brief (BSCIF_IDR) */ +#define BSCIF_IDR_RC32KREFE (0x1u << 3) /**< \brief (BSCIF_IDR) */ +#define BSCIF_IDR_RC32KSAT (0x1u << 4) /**< \brief (BSCIF_IDR) */ +#define BSCIF_IDR_BOD33DET (0x1u << 5) /**< \brief (BSCIF_IDR) BOD33 Detected */ +#define BSCIF_IDR_BOD18DET (0x1u << 6) /**< \brief (BSCIF_IDR) BOD18 Detected */ +#define BSCIF_IDR_BOD33SYNRDY (0x1u << 7) /**< \brief (BSCIF_IDR) BOD33 Synchronization Ready */ +#define BSCIF_IDR_BOD18SYNRDY (0x1u << 8) /**< \brief (BSCIF_IDR) BOD18 Synchronization Ready */ +#define BSCIF_IDR_SSWRDY (0x1u << 9) /**< \brief (BSCIF_IDR) VREG Stop Switching Ready */ +#define BSCIF_IDR_VREGOK (0x1u << 10) /**< \brief (BSCIF_IDR) Mai n VREG OK */ +#define BSCIF_IDR_LPBGRDY (0x1u << 12) /**< \brief (BSCIF_IDR) Low Power Bandgap Voltage Reference Ready */ +#define BSCIF_IDR_AE (0x1u << 31) /**< \brief (BSCIF_IDR) Access Error */ +/* -------- BSCIF_IMR : (BSCIF Offset: 0x008) Interrupt Mask Register -------- */ +#define BSCIF_IMR_OSC32RDY (0x1u << 0) /**< \brief (BSCIF_IMR) */ +#define BSCIF_IMR_RC32KRDY (0x1u << 1) /**< \brief (BSCIF_IMR) */ +#define BSCIF_IMR_RC32KLOCK (0x1u << 2) /**< \brief (BSCIF_IMR) */ +#define BSCIF_IMR_RC32KREFE (0x1u << 3) /**< \brief (BSCIF_IMR) */ +#define BSCIF_IMR_RC32KSAT (0x1u << 4) /**< \brief (BSCIF_IMR) */ +#define BSCIF_IMR_BOD33DET (0x1u << 5) /**< \brief (BSCIF_IMR) BOD33 Detected */ +#define BSCIF_IMR_BOD18DET (0x1u << 6) /**< \brief (BSCIF_IMR) BOD18 Detected */ +#define BSCIF_IMR_BOD33SYNRDY (0x1u << 7) /**< \brief (BSCIF_IMR) BOD33 Synchronization Ready */ +#define BSCIF_IMR_BOD18SYNRDY (0x1u << 8) /**< \brief (BSCIF_IMR) BOD18 Synchronization Ready */ +#define BSCIF_IMR_SSWRDY (0x1u << 9) /**< \brief (BSCIF_IMR) VREG Stop Switching Ready */ +#define BSCIF_IMR_VREGOK (0x1u << 10) /**< \brief (BSCIF_IMR) Main VREG OK */ +#define BSCIF_IMR_LPBGRDY (0x1u << 12) /**< \brief (BSCIF_IMR) Low Power Bandgap Voltage Reference Ready */ +#define BSCIF_IMR_AE (0x1u << 31) /**< \brief (BSCIF_IMR) Access Error */ +/* -------- BSCIF_ISR : (BSCIF Offset: 0x00C) Interrupt Status Register -------- */ +#define BSCIF_ISR_OSC32RDY (0x1u << 0) /**< \brief (BSCIF_ISR) */ +#define BSCIF_ISR_RC32KRDY (0x1u << 1) /**< \brief (BSCIF_ISR) */ +#define BSCIF_ISR_RC32KLOCK (0x1u << 2) /**< \brief (BSCIF_ISR) */ +#define BSCIF_ISR_RC32KREFE (0x1u << 3) /**< \brief (BSCIF_ISR) */ +#define BSCIF_ISR_RC32KSAT (0x1u << 4) /**< \brief (BSCIF_ISR) */ +#define BSCIF_ISR_BOD33DET (0x1u << 5) /**< \brief (BSCIF_ISR) BOD33 Detected */ +#define BSCIF_ISR_BOD18DET (0x1u << 6) /**< \brief (BSCIF_ISR) BOD18 Detected */ +#define BSCIF_ISR_BOD33SYNRDY (0x1u << 7) /**< \brief (BSCIF_ISR) BOD33 Synchronization Ready */ +#define BSCIF_ISR_BOD18SYNRDY (0x1u << 8) /**< \brief (BSCIF_ISR) BOD18 Synchronization Ready */ +#define BSCIF_ISR_SSWRDY (0x1u << 9) /**< \brief (BSCIF_ISR) VREG Stop Switching Ready */ +#define BSCIF_ISR_VREGOK (0x1u << 10) /**< \brief (BSCIF_ISR) Main VREG OK */ +#define BSCIF_ISR_LPBGRDY (0x1u << 12) /**< \brief (BSCIF_ISR) Low Power Bandgap Voltage Reference Ready */ +#define BSCIF_ISR_AE (0x1u << 31) /**< \brief (BSCIF_ISR) Access Error */ +/* -------- BSCIF_ICR : (BSCIF Offset: 0x010) Interrupt Clear Register -------- */ +#define BSCIF_ICR_OSC32RDY (0x1u << 0) /**< \brief (BSCIF_ICR) */ +#define BSCIF_ICR_RC32KRDY (0x1u << 1) /**< \brief (BSCIF_ICR) */ +#define BSCIF_ICR_RC32KLOCK (0x1u << 2) /**< \brief (BSCIF_ICR) */ +#define BSCIF_ICR_RC32KREFE (0x1u << 3) /**< \brief (BSCIF_ICR) */ +#define BSCIF_ICR_RC32KSAT (0x1u << 4) /**< \brief (BSCIF_ICR) */ +#define BSCIF_ICR_BOD33DET (0x1u << 5) /**< \brief (BSCIF_ICR) BOD33 Detected */ +#define BSCIF_ICR_BOD18DET (0x1u << 6) /**< \brief (BSCIF_ICR) BOD18 Detected */ +#define BSCIF_ICR_BOD33SYNRDY (0x1u << 7) /**< \brief (BSCIF_ICR) BOD33 Synchronization Ready */ +#define BSCIF_ICR_BOD18SYNRDY (0x1u << 8) /**< \brief (BSCIF_ICR) BOD18 Synchronization Ready */ +#define BSCIF_ICR_SSWRDY (0x1u << 9) /**< \brief (BSCIF_ICR) VREG Stop Switching Ready */ +#define BSCIF_ICR_VREGOK (0x1u << 10) /**< \brief (BSCIF_ICR) Main VREG OK */ +#define BSCIF_ICR_LPBGRDY (0x1u << 12) /**< \brief (BSCIF_ICR) Low Power Bandgap Voltage Reference Ready */ +#define BSCIF_ICR_AE (0x1u << 31) /**< \brief (BSCIF_ICR) Access Error */ +/* -------- BSCIF_PCLKSR : (BSCIF Offset: 0x014) Power and Clocks Status Register -------- */ +#define BSCIF_PCLKSR_OSC32RDY (0x1u << 0) /**< \brief (BSCIF_PCLKSR) */ +#define BSCIF_PCLKSR_RC32KRDY (0x1u << 1) /**< \brief (BSCIF_PCLKSR) */ +#define BSCIF_PCLKSR_RC32KLOCK (0x1u << 2) /**< \brief (BSCIF_PCLKSR) */ +#define BSCIF_PCLKSR_RC32KREFE (0x1u << 3) /**< \brief (BSCIF_PCLKSR) */ +#define BSCIF_PCLKSR_RC32KSAT (0x1u << 4) /**< \brief (BSCIF_PCLKSR) */ +#define BSCIF_PCLKSR_BOD33DET (0x1u << 5) /**< \brief (BSCIF_PCLKSR) BOD33 Detected */ +#define BSCIF_PCLKSR_BOD18DET (0x1u << 6) /**< \brief (BSCIF_PCLKSR) BOD18 Detected */ +#define BSCIF_PCLKSR_BOD33SYNRDY (0x1u << 7) /**< \brief (BSCIF_PCLKSR) BOD33 Synchronization Ready */ +#define BSCIF_PCLKSR_BOD18SYNRDY (0x1u << 8) /**< \brief (BSCIF_PCLKSR) BOD18 Synchronization Ready */ +#define BSCIF_PCLKSR_SSWRDY (0x1u << 9) /**< \brief (BSCIF_PCLKSR) VREG Stop Switching Ready */ +#define BSCIF_PCLKSR_VREGOK (0x1u << 10) /**< \brief (BSCIF_PCLKSR) Main VREG OK */ +#define BSCIF_PCLKSR_RC1MRDY (0x1u << 11) /**< \brief (BSCIF_PCLKSR) RC 1MHz Oscillator Ready */ +#define BSCIF_PCLKSR_LPBGRDY (0x1u << 12) /**< \brief (BSCIF_PCLKSR) Low Power Bandgap Voltage Reference Ready */ +/* -------- BSCIF_UNLOCK : (BSCIF Offset: 0x018) Unlock Register -------- */ +#define BSCIF_UNLOCK_ADDR_Pos 0 +#define BSCIF_UNLOCK_ADDR_Msk (0x3FFu << BSCIF_UNLOCK_ADDR_Pos) /**< \brief (BSCIF_UNLOCK) Unlock Address */ +#define BSCIF_UNLOCK_ADDR(value) ((BSCIF_UNLOCK_ADDR_Msk & ((value) << BSCIF_UNLOCK_ADDR_Pos))) +#define BSCIF_UNLOCK_KEY_Pos 24 +#define BSCIF_UNLOCK_KEY_Msk (0xFFu << BSCIF_UNLOCK_KEY_Pos) /**< \brief (BSCIF_UNLOCK) Unlock Key */ +#define BSCIF_UNLOCK_KEY(value) ((BSCIF_UNLOCK_KEY_Msk & ((value) << BSCIF_UNLOCK_KEY_Pos))) +#define BSCIF_UNLOCK_KEY_VALID (0xAAu << 24) /**< \brief (BSCIF_UNLOCK) Valid Key to Unlock register */ +/* -------- BSCIF_CSCR : (BSCIF Offset: 0x01C) Chip Specific Configuration Register -------- */ +/* -------- BSCIF_OSCCTRL32 : (BSCIF Offset: 0x020) Oscillator 32 Control Register -------- */ +#define BSCIF_OSCCTRL32_OSC32EN (0x1u << 0) /**< \brief (BSCIF_OSCCTRL32) 32 KHz Oscillator Enable */ +#define BSCIF_OSCCTRL32_PINSEL (0x1u << 1) /**< \brief (BSCIF_OSCCTRL32) Pins Select */ +#define BSCIF_OSCCTRL32_EN32K (0x1u << 2) /**< \brief (BSCIF_OSCCTRL32) 32 KHz output Enable */ +#define BSCIF_OSCCTRL32_EN1K (0x1u << 3) /**< \brief (BSCIF_OSCCTRL32) 1 KHz output Enable */ +#define BSCIF_OSCCTRL32_MODE_Pos 8 +#define BSCIF_OSCCTRL32_MODE_Msk (0x7u << BSCIF_OSCCTRL32_MODE_Pos) /**< \brief (BSCIF_OSCCTRL32) Oscillator Mode */ +#define BSCIF_OSCCTRL32_MODE(value) ((BSCIF_OSCCTRL32_MODE_Msk & ((value) << BSCIF_OSCCTRL32_MODE_Pos))) +#define BSCIF_OSCCTRL32_SELCURR_Pos 12 +#define BSCIF_OSCCTRL32_SELCURR_Msk (0xFu << BSCIF_OSCCTRL32_SELCURR_Pos) /**< \brief (BSCIF_OSCCTRL32) Current selection */ +#define BSCIF_OSCCTRL32_SELCURR(value) ((BSCIF_OSCCTRL32_SELCURR_Msk & ((value) << BSCIF_OSCCTRL32_SELCURR_Pos))) +#define BSCIF_OSCCTRL32_STARTUP_Pos 16 +#define BSCIF_OSCCTRL32_STARTUP_Msk (0x7u << BSCIF_OSCCTRL32_STARTUP_Pos) /**< \brief (BSCIF_OSCCTRL32) Oscillator Start-up Time */ +#define BSCIF_OSCCTRL32_STARTUP(value) ((BSCIF_OSCCTRL32_STARTUP_Msk & ((value) << BSCIF_OSCCTRL32_STARTUP_Pos))) +/* -------- BSCIF_RC32KCR : (BSCIF Offset: 0x024) 32 kHz RC Oscillator Control Register -------- */ +#define BSCIF_RC32KCR_EN (0x1u << 0) /**< \brief (BSCIF_RC32KCR) Enable as Generic clock source */ +#define BSCIF_RC32KCR_TCEN (0x1u << 1) /**< \brief (BSCIF_RC32KCR) Temperature Compensation Enable */ +#define BSCIF_RC32KCR_EN32K (0x1u << 2) /**< \brief (BSCIF_RC32KCR) Enable 32 KHz output */ +#define BSCIF_RC32KCR_EN1K (0x1u << 3) /**< \brief (BSCIF_RC32KCR) Enable 1 kHz output */ +#define BSCIF_RC32KCR_MODE (0x1u << 4) /**< \brief (BSCIF_RC32KCR) Mode Selection */ +#define BSCIF_RC32KCR_REF (0x1u << 5) /**< \brief (BSCIF_RC32KCR) Reference select */ +#define BSCIF_RC32KCR_FCD (0x1u << 7) /**< \brief (BSCIF_RC32KCR) Flash calibration done */ +/* -------- BSCIF_RC32KTUNE : (BSCIF Offset: 0x028) 32kHz RC Oscillator Tuning Register -------- */ +#define BSCIF_RC32KTUNE_FINE_Pos 0 +#define BSCIF_RC32KTUNE_FINE_Msk (0x3Fu << BSCIF_RC32KTUNE_FINE_Pos) /**< \brief (BSCIF_RC32KTUNE) Fine value */ +#define BSCIF_RC32KTUNE_FINE(value) ((BSCIF_RC32KTUNE_FINE_Msk & ((value) << BSCIF_RC32KTUNE_FINE_Pos))) +#define BSCIF_RC32KTUNE_COARSE_Pos 16 +#define BSCIF_RC32KTUNE_COARSE_Msk (0x7Fu << BSCIF_RC32KTUNE_COARSE_Pos) /**< \brief (BSCIF_RC32KTUNE) Coarse Value */ +#define BSCIF_RC32KTUNE_COARSE(value) ((BSCIF_RC32KTUNE_COARSE_Msk & ((value) << BSCIF_RC32KTUNE_COARSE_Pos))) +/* -------- BSCIF_BOD33CTRL : (BSCIF Offset: 0x02C) BOD33 Control Register -------- */ +#define BSCIF_BOD33CTRL_EN (0x1u << 0) /**< \brief (BSCIF_BOD33CTRL) Enable */ +#define BSCIF_BOD33CTRL_HYST (0x1u << 1) /**< \brief (BSCIF_BOD33CTRL) BOD Hysteresis */ +#define BSCIF_BOD33CTRL_ACTION_Pos 8 +#define BSCIF_BOD33CTRL_ACTION_Msk (0x3u << BSCIF_BOD33CTRL_ACTION_Pos) /**< \brief (BSCIF_BOD33CTRL) Action */ +#define BSCIF_BOD33CTRL_ACTION(value) ((BSCIF_BOD33CTRL_ACTION_Msk & ((value) << BSCIF_BOD33CTRL_ACTION_Pos))) +#define BSCIF_BOD33CTRL_MODE (0x1u << 16) /**< \brief (BSCIF_BOD33CTRL) Operation modes */ +#define BSCIF_BOD33CTRL_FCD (0x1u << 30) /**< \brief (BSCIF_BOD33CTRL) BOD Fuse Calibration Done */ +#define BSCIF_BOD33CTRL_SFV (0x1u << 31) /**< \brief (BSCIF_BOD33CTRL) BOD Control Register Store Final Value */ +/* -------- BSCIF_BOD33LEVEL : (BSCIF Offset: 0x030) BOD33 Level Register -------- */ +#define BSCIF_BOD33LEVEL_VAL_Pos 0 +#define BSCIF_BOD33LEVEL_VAL_Msk (0x3Fu << BSCIF_BOD33LEVEL_VAL_Pos) /**< \brief (BSCIF_BOD33LEVEL) BOD Value */ +#define BSCIF_BOD33LEVEL_VAL(value) ((BSCIF_BOD33LEVEL_VAL_Msk & ((value) << BSCIF_BOD33LEVEL_VAL_Pos))) +/* -------- BSCIF_BOD33SAMPLING : (BSCIF Offset: 0x034) BOD33 Sampling Control Register -------- */ +#define BSCIF_BOD33SAMPLING_CEN (0x1u << 0) /**< \brief (BSCIF_BOD33SAMPLING) Clock Enable */ +#define BSCIF_BOD33SAMPLING_CSSEL (0x1u << 1) /**< \brief (BSCIF_BOD33SAMPLING) Clock Source Select */ +#define BSCIF_BOD33SAMPLING_PSEL_Pos 8 +#define BSCIF_BOD33SAMPLING_PSEL_Msk (0xFu << BSCIF_BOD33SAMPLING_PSEL_Pos) /**< \brief (BSCIF_BOD33SAMPLING) Prescaler Select */ +#define BSCIF_BOD33SAMPLING_PSEL(value) ((BSCIF_BOD33SAMPLING_PSEL_Msk & ((value) << BSCIF_BOD33SAMPLING_PSEL_Pos))) +/* -------- BSCIF_BOD18CTRL : (BSCIF Offset: 0x038) BOD18 Control Register -------- */ +#define BSCIF_BOD18CTRL_EN (0x1u << 0) /**< \brief (BSCIF_BOD18CTRL) Enable */ +#define BSCIF_BOD18CTRL_HYST (0x1u << 1) /**< \brief (BSCIF_BOD18CTRL) BOD Hysteresis */ +#define BSCIF_BOD18CTRL_ACTION_Pos 8 +#define BSCIF_BOD18CTRL_ACTION_Msk (0x3u << BSCIF_BOD18CTRL_ACTION_Pos) /**< \brief (BSCIF_BOD18CTRL) Action */ +#define BSCIF_BOD18CTRL_ACTION(value) ((BSCIF_BOD18CTRL_ACTION_Msk & ((value) << BSCIF_BOD18CTRL_ACTION_Pos))) +#define BSCIF_BOD18CTRL_MODE (0x1u << 16) /**< \brief (BSCIF_BOD18CTRL) Operation modes */ +#define BSCIF_BOD18CTRL_FCD (0x1u << 30) /**< \brief (BSCIF_BOD18CTRL) BOD Fuse Calibration Done */ +#define BSCIF_BOD18CTRL_SFV (0x1u << 31) /**< \brief (BSCIF_BOD18CTRL) BOD Control Register Store Final Value */ +/* -------- BSCIF_BOD18LEVEL : (BSCIF Offset: 0x03C) BOD18 Level Register -------- */ +#define BSCIF_BOD18LEVEL_VAL_Pos 0 +#define BSCIF_BOD18LEVEL_VAL_Msk (0x3Fu << BSCIF_BOD18LEVEL_VAL_Pos) /**< \brief (BSCIF_BOD18LEVEL) BOD Value */ +#define BSCIF_BOD18LEVEL_VAL(value) ((BSCIF_BOD18LEVEL_VAL_Msk & ((value) << BSCIF_BOD18LEVEL_VAL_Pos))) +#define BSCIF_BOD18LEVEL_RANGE (0x1u << 31) /**< \brief (BSCIF_BOD18LEVEL) BOD Threshold Range */ +/* -------- BSCIF_VREGCR : (BSCIF Offset: 0x044) Voltage Regulator Configuration Register -------- */ +#define BSCIF_VREGCR_DIS (0x1u << 0) /**< \brief (BSCIF_VREGCR) Voltage Regulator disable */ +#define BSCIF_VREGCR_SSG (0x1u << 8) /**< \brief (BSCIF_VREGCR) Spread Spectrum Generator Enable */ +#define BSCIF_VREGCR_SSW (0x1u << 9) /**< \brief (BSCIF_VREGCR) Stop Switching */ +#define BSCIF_VREGCR_SSWEVT (0x1u << 10) /**< \brief (BSCIF_VREGCR) Stop Switching On Event Enable */ +#define BSCIF_VREGCR_SFV (0x1u << 31) /**< \brief (BSCIF_VREGCR) Store Final Value */ +/* -------- BSCIF_VREGNCSR : (BSCIF Offset: 0x04C) Normal Mode Control and Status Register -------- */ +/* -------- BSCIF_VREGLPCSR : (BSCIF Offset: 0x050) LP Mode Control and Status Register -------- */ +/* -------- BSCIF_RC1MCR : (BSCIF Offset: 0x058) 1MHz RC Clock Configuration Register -------- */ +#define BSCIF_RC1MCR_CLKOE (0x1u << 0) /**< \brief (BSCIF_RC1MCR) 1MHz RC Osc Clock Output Enable */ +#define BSCIF_RC1MCR_FCD (0x1u << 7) /**< \brief (BSCIF_RC1MCR) Flash Calibration Done */ +#define BSCIF_RC1MCR_CLKCAL_Pos 8 +#define BSCIF_RC1MCR_CLKCAL_Msk (0x1Fu << BSCIF_RC1MCR_CLKCAL_Pos) /**< \brief (BSCIF_RC1MCR) 1MHz RC Osc Calibration */ +#define BSCIF_RC1MCR_CLKCAL(value) ((BSCIF_RC1MCR_CLKCAL_Msk & ((value) << BSCIF_RC1MCR_CLKCAL_Pos))) +/* -------- BSCIF_BGCR : (BSCIF Offset: 0x05C) Bandgap Calibration Register -------- */ +/* -------- BSCIF_BGCTRL : (BSCIF Offset: 0x060) Bandgap Control Register -------- */ +#define BSCIF_BGCTRL_ADCISEL_Pos 0 +#define BSCIF_BGCTRL_ADCISEL_Msk (0x3u << BSCIF_BGCTRL_ADCISEL_Pos) /**< \brief (BSCIF_BGCTRL) ADC Input Selection */ +#define BSCIF_BGCTRL_ADCISEL(value) ((BSCIF_BGCTRL_ADCISEL_Msk & ((value) << BSCIF_BGCTRL_ADCISEL_Pos))) +#define BSCIF_BGCTRL_ADCISEL_DIS (0x0u << 0) /**< \brief (BSCIF_BGCTRL) */ +#define BSCIF_BGCTRL_ADCISEL_VTEMP (0x1u << 0) /**< \brief (BSCIF_BGCTRL) */ +#define BSCIF_BGCTRL_ADCISEL_VREF (0x2u << 0) /**< \brief (BSCIF_BGCTRL) */ +#define BSCIF_BGCTRL_TSEN (0x1u << 8) /**< \brief (BSCIF_BGCTRL) Temperature Sensor Enable */ +/* -------- BSCIF_BGSR : (BSCIF Offset: 0x064) Bandgap Status Register -------- */ +#define BSCIF_BGSR_BGBUFRDY_Pos 0 +#define BSCIF_BGSR_BGBUFRDY_Msk (0xFFu << BSCIF_BGSR_BGBUFRDY_Pos) /**< \brief (BSCIF_BGSR) Bandgap Buffer Ready */ +#define BSCIF_BGSR_BGBUFRDY(value) ((BSCIF_BGSR_BGBUFRDY_Msk & ((value) << BSCIF_BGSR_BGBUFRDY_Pos))) +#define BSCIF_BGSR_BGBUFRDY_FLASH (0x1u << 0) /**< \brief (BSCIF_BGSR) */ +#define BSCIF_BGSR_BGBUFRDY_PLL (0x2u << 0) /**< \brief (BSCIF_BGSR) */ +#define BSCIF_BGSR_BGBUFRDY_VREG (0x4u << 0) /**< \brief (BSCIF_BGSR) */ +#define BSCIF_BGSR_BGBUFRDY_BUFRR (0x8u << 0) /**< \brief (BSCIF_BGSR) */ +#define BSCIF_BGSR_BGBUFRDY_ADC (0x10u << 0) /**< \brief (BSCIF_BGSR) */ +#define BSCIF_BGSR_BGBUFRDY_LCD (0x20u << 0) /**< \brief (BSCIF_BGSR) */ +#define BSCIF_BGSR_BGRDY (0x1u << 16) /**< \brief (BSCIF_BGSR) Bandgap Voltage Reference Ready */ +#define BSCIF_BGSR_LPBGRDY (0x1u << 17) /**< \brief (BSCIF_BGSR) Low Power Bandgap Voltage Reference Ready */ +#define BSCIF_BGSR_VREF_Pos 18 +#define BSCIF_BGSR_VREF_Msk (0x3u << BSCIF_BGSR_VREF_Pos) /**< \brief (BSCIF_BGSR) Voltage Reference Used by the System */ +#define BSCIF_BGSR_VREF(value) ((BSCIF_BGSR_VREF_Msk & ((value) << BSCIF_BGSR_VREF_Pos))) +/* -------- BSCIF_BRIFBVERSION : (BSCIF Offset: 0x3E4) Backup Register Interface Version Register -------- */ +#define BSCIF_BRIFBVERSION_VERSION_Pos 0 +#define BSCIF_BRIFBVERSION_VERSION_Msk (0xFFFu << BSCIF_BRIFBVERSION_VERSION_Pos) /**< \brief (BSCIF_BRIFBVERSION) Version Number */ +#define BSCIF_BRIFBVERSION_VERSION(value) ((BSCIF_BRIFBVERSION_VERSION_Msk & ((value) << BSCIF_BRIFBVERSION_VERSION_Pos))) +#define BSCIF_BRIFBVERSION_VARIANT_Pos 16 +#define BSCIF_BRIFBVERSION_VARIANT_Msk (0xFu << BSCIF_BRIFBVERSION_VARIANT_Pos) /**< \brief (BSCIF_BRIFBVERSION) Variant Number */ +#define BSCIF_BRIFBVERSION_VARIANT(value) ((BSCIF_BRIFBVERSION_VARIANT_Msk & ((value) << BSCIF_BRIFBVERSION_VARIANT_Pos))) +/* -------- BSCIF_BGREFIFBVERSION : (BSCIF Offset: 0x3E8) BGREFIFB Version Register -------- */ +#define BSCIF_BGREFIFBVERSION_VERSION_Pos 0 +#define BSCIF_BGREFIFBVERSION_VERSION_Msk (0xFFFu << BSCIF_BGREFIFBVERSION_VERSION_Pos) /**< \brief (BSCIF_BGREFIFBVERSION) Version Number */ +#define BSCIF_BGREFIFBVERSION_VERSION(value) ((BSCIF_BGREFIFBVERSION_VERSION_Msk & ((value) << BSCIF_BGREFIFBVERSION_VERSION_Pos))) +#define BSCIF_BGREFIFBVERSION_VARIANT_Pos 16 +#define BSCIF_BGREFIFBVERSION_VARIANT_Msk (0xFu << BSCIF_BGREFIFBVERSION_VARIANT_Pos) /**< \brief (BSCIF_BGREFIFBVERSION) Variant Number */ +#define BSCIF_BGREFIFBVERSION_VARIANT(value) ((BSCIF_BGREFIFBVERSION_VARIANT_Msk & ((value) << BSCIF_BGREFIFBVERSION_VARIANT_Pos))) +/* -------- BSCIF_VREGIFGVERSION : (BSCIF Offset: 0x3EC) VREGIFA Version Register -------- */ +#define BSCIF_VREGIFGVERSION_VERSION_Pos 0 +#define BSCIF_VREGIFGVERSION_VERSION_Msk (0xFFFu << BSCIF_VREGIFGVERSION_VERSION_Pos) /**< \brief (BSCIF_VREGIFGVERSION) Version Number */ +#define BSCIF_VREGIFGVERSION_VERSION(value) ((BSCIF_VREGIFGVERSION_VERSION_Msk & ((value) << BSCIF_VREGIFGVERSION_VERSION_Pos))) +#define BSCIF_VREGIFGVERSION_VARIANT_Pos 16 +#define BSCIF_VREGIFGVERSION_VARIANT_Msk (0xFu << BSCIF_VREGIFGVERSION_VARIANT_Pos) /**< \brief (BSCIF_VREGIFGVERSION) Variant Number */ +#define BSCIF_VREGIFGVERSION_VARIANT(value) ((BSCIF_VREGIFGVERSION_VARIANT_Msk & ((value) << BSCIF_VREGIFGVERSION_VARIANT_Pos))) +/* -------- BSCIF_BODIFCVERSION : (BSCIF Offset: 0x3F0) BODIFC Version Register -------- */ +#define BSCIF_BODIFCVERSION_VERSION_Pos 0 +#define BSCIF_BODIFCVERSION_VERSION_Msk (0xFFFu << BSCIF_BODIFCVERSION_VERSION_Pos) /**< \brief (BSCIF_BODIFCVERSION) Version Number */ +#define BSCIF_BODIFCVERSION_VERSION(value) ((BSCIF_BODIFCVERSION_VERSION_Msk & ((value) << BSCIF_BODIFCVERSION_VERSION_Pos))) +#define BSCIF_BODIFCVERSION_VARIANT_Pos 16 +#define BSCIF_BODIFCVERSION_VARIANT_Msk (0xFu << BSCIF_BODIFCVERSION_VARIANT_Pos) /**< \brief (BSCIF_BODIFCVERSION) Variant Number */ +#define BSCIF_BODIFCVERSION_VARIANT(value) ((BSCIF_BODIFCVERSION_VARIANT_Msk & ((value) << BSCIF_BODIFCVERSION_VARIANT_Pos))) +/* -------- BSCIF_RC32KIFBVERSION : (BSCIF Offset: 0x3F4) 32 kHz RC Oscillator Version Register -------- */ +#define BSCIF_RC32KIFBVERSION_VERSION_Pos 0 +#define BSCIF_RC32KIFBVERSION_VERSION_Msk (0xFFFu << BSCIF_RC32KIFBVERSION_VERSION_Pos) /**< \brief (BSCIF_RC32KIFBVERSION) Version number */ +#define BSCIF_RC32KIFBVERSION_VERSION(value) ((BSCIF_RC32KIFBVERSION_VERSION_Msk & ((value) << BSCIF_RC32KIFBVERSION_VERSION_Pos))) +#define BSCIF_RC32KIFBVERSION_VARIANT_Pos 16 +#define BSCIF_RC32KIFBVERSION_VARIANT_Msk (0xFu << BSCIF_RC32KIFBVERSION_VARIANT_Pos) /**< \brief (BSCIF_RC32KIFBVERSION) Variant number */ +#define BSCIF_RC32KIFBVERSION_VARIANT(value) ((BSCIF_RC32KIFBVERSION_VARIANT_Msk & ((value) << BSCIF_RC32KIFBVERSION_VARIANT_Pos))) +/* -------- BSCIF_OSC32IFAVERSION : (BSCIF Offset: 0x3F8) 32 KHz Oscillator Version Register -------- */ +#define BSCIF_OSC32IFAVERSION_VERSION_Pos 0 +#define BSCIF_OSC32IFAVERSION_VERSION_Msk (0xFFFu << BSCIF_OSC32IFAVERSION_VERSION_Pos) /**< \brief (BSCIF_OSC32IFAVERSION) Version number */ +#define BSCIF_OSC32IFAVERSION_VERSION(value) ((BSCIF_OSC32IFAVERSION_VERSION_Msk & ((value) << BSCIF_OSC32IFAVERSION_VERSION_Pos))) +#define BSCIF_OSC32IFAVERSION_VARIANT_Pos 16 +#define BSCIF_OSC32IFAVERSION_VARIANT_Msk (0xFu << BSCIF_OSC32IFAVERSION_VARIANT_Pos) /**< \brief (BSCIF_OSC32IFAVERSION) Variant nubmer */ +#define BSCIF_OSC32IFAVERSION_VARIANT(value) ((BSCIF_OSC32IFAVERSION_VARIANT_Msk & ((value) << BSCIF_OSC32IFAVERSION_VARIANT_Pos))) +/* -------- BSCIF_VERSION : (BSCIF Offset: 0x3FC) BSCIF Version Register -------- */ +#define BSCIF_VERSION_VERSION_Pos 0 +#define BSCIF_VERSION_VERSION_Msk (0xFFFu << BSCIF_VERSION_VERSION_Pos) /**< \brief (BSCIF_VERSION) Version Number */ +#define BSCIF_VERSION_VERSION(value) ((BSCIF_VERSION_VERSION_Msk & ((value) << BSCIF_VERSION_VERSION_Pos))) +#define BSCIF_VERSION_VARIANT_Pos 16 +#define BSCIF_VERSION_VARIANT_Msk (0xFu << BSCIF_VERSION_VARIANT_Pos) /**< \brief (BSCIF_VERSION) Variant Number */ +#define BSCIF_VERSION_VARIANT(value) ((BSCIF_VERSION_VARIANT_Msk & ((value) << BSCIF_VERSION_VARIANT_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR CATB */ +/* ============================================================================= */ +/** \addtogroup SAM4L_CATB Capacitive Touch Module B */ +/*@{*/ + +#define REV_CATB 0x100 + +#ifndef __ASSEMBLY__ +/** \brief CatbIntch hardware registers */ +typedef struct { + RoReg CATB_INTCH; /**< \brief (CatbIntch Offset: 0x00) In-Touch Status Register 0 */ +} CatbIntch; +/** \brief CatbIntchclr hardware registers */ +typedef struct { + WoReg CATB_INTCHCLR; /**< \brief (CatbIntchclr Offset: 0x00) In-Touch Status Clear Register 0 */ +} CatbIntchclr; +/** \brief CatbOuttch hardware registers */ +typedef struct { + RoReg CATB_OUTTCH; /**< \brief (CatbOuttch Offset: 0x00) Out-of-Touch Status Register 0 */ +} CatbOuttch; +/** \brief CatbOuttchclr hardware registers */ +typedef struct { + WoReg CATB_OUTTCHCLR; /**< \brief (CatbOuttchclr Offset: 0x00) Out-of-Touch Status Clear Register 0 */ +} CatbOuttchclr; +/** \brief CATB hardware registers */ +#define CATB_STATUS_REG_NUMBER 1 +typedef struct { + RwReg CATB_CR; /**< \brief (CATB Offset: 0x00) Control Register */ + RwReg CATB_CNTCR; /**< \brief (CATB Offset: 0x04) Counter Control Register */ + RwReg CATB_IDLE; /**< \brief (CATB Offset: 0x08) Sensor Idle Level */ + RoReg CATB_LEVEL; /**< \brief (CATB Offset: 0x0C) Sensor Relative Level */ + RoReg CATB_RAW; /**< \brief (CATB Offset: 0x10) Sensor Raw Value */ + RwReg CATB_TIMING; /**< \brief (CATB Offset: 0x14) Filter Timing Register */ + RwReg CATB_THRESH; /**< \brief (CATB Offset: 0x18) Threshold Register */ + RwReg CATB_PINSEL; /**< \brief (CATB Offset: 0x1C) Pin Selection Register */ + RwReg CATB_DMA; /**< \brief (CATB Offset: 0x20) Direct Memory Access Register */ + RoReg CATB_ISR; /**< \brief (CATB Offset: 0x24) Interrupt Status Register */ + WoReg CATB_IER; /**< \brief (CATB Offset: 0x28) Interrupt Enable Register */ + WoReg CATB_IDR; /**< \brief (CATB Offset: 0x2C) Interrupt Disable Register */ + RoReg CATB_IMR; /**< \brief (CATB Offset: 0x30) Interrupt Mask Register */ + WoReg CATB_SCR; /**< \brief (CATB Offset: 0x34) Status Clear Register */ + RoReg Reserved1[2]; + CatbIntch CATB_INTCH[CATB_STATUS_REG_NUMBER]; /**< \brief (CATB Offset: 0x40) CatbIntch groups */ + CatbIntch Reserved2[4 - CATB_STATUS_REG_NUMBER]; + CatbIntchclr CATB_INTCHCLR[CATB_STATUS_REG_NUMBER]; /**< \brief (CATB Offset: 0x50) CatbIntchclr groups */ + CatbIntchclr Reserved3[4 - CATB_STATUS_REG_NUMBER]; + CatbOuttch CATB_OUTTCH[CATB_STATUS_REG_NUMBER]; /**< \brief (CATB Offset: 0x60) CatbOuttch groups */ + CatbOuttch Reserved4[4 - CATB_STATUS_REG_NUMBER]; + CatbOuttchclr CATB_OUTTCHCLR[CATB_STATUS_REG_NUMBER]; /**< \brief (CATB Offset: 0x70) CatbOuttchclr groups */ + CatbOuttchclr Reserved5[4 - CATB_STATUS_REG_NUMBER]; + RoReg Reserved6[30]; + RoReg CATB_PARAMETER; /**< \brief (CATB Offset: 0xF8) Parameter Register */ + RoReg CATB_VERSION; /**< \brief (CATB Offset: 0xFC) Version Register */ +} Catb; +#endif /* __ASSEMBLY__ */ +/* -------- CATB_CR : (CATB Offset: 0x00) Control Register -------- */ +#define CATB_CR_EN (0x1u << 0) /**< \brief (CATB_CR) Module Enable */ +#define CATB_CR_RUN (0x1u << 1) /**< \brief (CATB_CR) Start Operation */ +#define CATB_CR_IIDLE (0x1u << 2) /**< \brief (CATB_CR) Initialize Idle Value */ +#define CATB_CR_ETRIG (0x1u << 3) /**< \brief (CATB_CR) Event Triggered Operation */ +#define CATB_CR_INTRES (0x1u << 4) /**< \brief (CATB_CR) Internal Resistors */ +#define CATB_CR_CKSEL (0x1u << 5) /**< \brief (CATB_CR) Clock Select */ +#define CATB_CR_DIFF (0x1u << 6) /**< \brief (CATB_CR) Differential Mode */ +#define CATB_CR_DMAEN (0x1u << 7) /**< \brief (CATB_CR) DMA Enable */ +#define CATB_CR_ESAMPLES_Pos 8 +#define CATB_CR_ESAMPLES_Msk (0x7Fu << CATB_CR_ESAMPLES_Pos) /**< \brief (CATB_CR) Number of Event Samples */ +#define CATB_CR_ESAMPLES(value) ((CATB_CR_ESAMPLES_Msk & ((value) << CATB_CR_ESAMPLES_Pos))) +#define CATB_CR_CHARGET_Pos 16 +#define CATB_CR_CHARGET_Msk (0xFu << CATB_CR_CHARGET_Pos) /**< \brief (CATB_CR) Charge Time */ +#define CATB_CR_CHARGET(value) ((CATB_CR_CHARGET_Msk & ((value) << CATB_CR_CHARGET_Pos))) +#define CATB_CR_SWRST (0x1u << 31) /**< \brief (CATB_CR) Software Reset */ +/* -------- CATB_CNTCR : (CATB Offset: 0x04) Counter Control Register -------- */ +#define CATB_CNTCR_TOP_Pos 0 +#define CATB_CNTCR_TOP_Msk (0xFFFFFFu << CATB_CNTCR_TOP_Pos) /**< \brief (CATB_CNTCR) Counter Top Value */ +#define CATB_CNTCR_TOP(value) ((CATB_CNTCR_TOP_Msk & ((value) << CATB_CNTCR_TOP_Pos))) +#define CATB_CNTCR_SPREAD_Pos 24 +#define CATB_CNTCR_SPREAD_Msk (0xFu << CATB_CNTCR_SPREAD_Pos) /**< \brief (CATB_CNTCR) Spread Spectrum */ +#define CATB_CNTCR_SPREAD(value) ((CATB_CNTCR_SPREAD_Msk & ((value) << CATB_CNTCR_SPREAD_Pos))) +#define CATB_CNTCR_REPEAT_Pos 28 +#define CATB_CNTCR_REPEAT_Msk (0x7u << CATB_CNTCR_REPEAT_Pos) /**< \brief (CATB_CNTCR) Repeat Measurements */ +#define CATB_CNTCR_REPEAT(value) ((CATB_CNTCR_REPEAT_Msk & ((value) << CATB_CNTCR_REPEAT_Pos))) +/* -------- CATB_IDLE : (CATB Offset: 0x08) Sensor Idle Level -------- */ +#define CATB_IDLE_FIDLE_Pos 0 +#define CATB_IDLE_FIDLE_Msk (0xFFFu << CATB_IDLE_FIDLE_Pos) /**< \brief (CATB_IDLE) Fractional Sensor Idle */ +#define CATB_IDLE_FIDLE(value) ((CATB_IDLE_FIDLE_Msk & ((value) << CATB_IDLE_FIDLE_Pos))) +#define CATB_IDLE_RIDLE_Pos 12 +#define CATB_IDLE_RIDLE_Msk (0xFFFFu << CATB_IDLE_RIDLE_Pos) /**< \brief (CATB_IDLE) Integer Sensor Idle */ +#define CATB_IDLE_RIDLE(value) ((CATB_IDLE_RIDLE_Msk & ((value) << CATB_IDLE_RIDLE_Pos))) +/* -------- CATB_LEVEL : (CATB Offset: 0x0C) Sensor Relative Level -------- */ +#define CATB_LEVEL_FLEVEL_Pos 0 +#define CATB_LEVEL_FLEVEL_Msk (0xFFFu << CATB_LEVEL_FLEVEL_Pos) /**< \brief (CATB_LEVEL) Fractional Sensor Level */ +#define CATB_LEVEL_FLEVEL(value) ((CATB_LEVEL_FLEVEL_Msk & ((value) << CATB_LEVEL_FLEVEL_Pos))) +#define CATB_LEVEL_RLEVEL_Pos 12 +#define CATB_LEVEL_RLEVEL_Msk (0xFFu << CATB_LEVEL_RLEVEL_Pos) /**< \brief (CATB_LEVEL) Integer Sensor Level */ +#define CATB_LEVEL_RLEVEL(value) ((CATB_LEVEL_RLEVEL_Msk & ((value) << CATB_LEVEL_RLEVEL_Pos))) +/* -------- CATB_RAW : (CATB Offset: 0x10) Sensor Raw Value -------- */ +#define CATB_RAW_RAWA_Pos 16 +#define CATB_RAW_RAWA_Msk (0xFFu << CATB_RAW_RAWA_Pos) /**< \brief (CATB_RAW) Current Sensor Raw Value */ +#define CATB_RAW_RAWA(value) ((CATB_RAW_RAWA_Msk & ((value) << CATB_RAW_RAWA_Pos))) +#define CATB_RAW_RAWB_Pos 24 +#define CATB_RAW_RAWB_Msk (0xFFu << CATB_RAW_RAWB_Pos) /**< \brief (CATB_RAW) Last Sensor Raw Value */ +#define CATB_RAW_RAWB(value) ((CATB_RAW_RAWB_Msk & ((value) << CATB_RAW_RAWB_Pos))) +/* -------- CATB_TIMING : (CATB Offset: 0x14) Filter Timing Register -------- */ +#define CATB_TIMING_TLEVEL_Pos 0 +#define CATB_TIMING_TLEVEL_Msk (0xFFFu << CATB_TIMING_TLEVEL_Pos) /**< \brief (CATB_TIMING) Relative Level Smoothing */ +#define CATB_TIMING_TLEVEL(value) ((CATB_TIMING_TLEVEL_Msk & ((value) << CATB_TIMING_TLEVEL_Pos))) +#define CATB_TIMING_TIDLE_Pos 16 +#define CATB_TIMING_TIDLE_Msk (0xFFFu << CATB_TIMING_TIDLE_Pos) /**< \brief (CATB_TIMING) Idle Smoothening */ +#define CATB_TIMING_TIDLE(value) ((CATB_TIMING_TIDLE_Msk & ((value) << CATB_TIMING_TIDLE_Pos))) +/* -------- CATB_THRESH : (CATB Offset: 0x18) Threshold Register -------- */ +#define CATB_THRESH_FTHRESH_Pos 0 +#define CATB_THRESH_FTHRESH_Msk (0xFFFu << CATB_THRESH_FTHRESH_Pos) /**< \brief (CATB_THRESH) Fractional part of Threshold Value */ +#define CATB_THRESH_FTHRESH(value) ((CATB_THRESH_FTHRESH_Msk & ((value) << CATB_THRESH_FTHRESH_Pos))) +#define CATB_THRESH_RTHRESH_Pos 12 +#define CATB_THRESH_RTHRESH_Msk (0xFFu << CATB_THRESH_RTHRESH_Pos) /**< \brief (CATB_THRESH) Rational part of Threshold Value */ +#define CATB_THRESH_RTHRESH(value) ((CATB_THRESH_RTHRESH_Msk & ((value) << CATB_THRESH_RTHRESH_Pos))) +#define CATB_THRESH_DIR (0x1u << 23) /**< \brief (CATB_THRESH) Threshold Direction */ +#define CATB_THRESH_LENGTH_Pos 24 +#define CATB_THRESH_LENGTH_Msk (0x1Fu << CATB_THRESH_LENGTH_Pos) /**< \brief (CATB_THRESH) Threshold Length */ +#define CATB_THRESH_LENGTH(value) ((CATB_THRESH_LENGTH_Msk & ((value) << CATB_THRESH_LENGTH_Pos))) +/* -------- CATB_PINSEL : (CATB Offset: 0x1C) Pin Selection Register -------- */ +#define CATB_PINSEL_PINSEL_Pos 0 +#define CATB_PINSEL_PINSEL_Msk (0xFFu << CATB_PINSEL_PINSEL_Pos) /**< \brief (CATB_PINSEL) Pin Select */ +#define CATB_PINSEL_PINSEL(value) ((CATB_PINSEL_PINSEL_Msk & ((value) << CATB_PINSEL_PINSEL_Pos))) +/* -------- CATB_DMA : (CATB Offset: 0x20) Direct Memory Access Register -------- */ +#define CATB_DMA_DMA_Pos 0 +#define CATB_DMA_DMA_Msk (0xFFFFFFFFu << CATB_DMA_DMA_Pos) /**< \brief (CATB_DMA) Direct Memory Access */ +#define CATB_DMA_DMA(value) ((CATB_DMA_DMA_Msk & ((value) << CATB_DMA_DMA_Pos))) +/* -------- CATB_ISR : (CATB Offset: 0x24) Interrupt Status Register -------- */ +#define CATB_ISR_SAMPLE (0x1u << 0) /**< \brief (CATB_ISR) Sample Ready Interrupt Status */ +#define CATB_ISR_INTCH (0x1u << 1) /**< \brief (CATB_ISR) In-touch Interrupt Status */ +#define CATB_ISR_OUTTCH (0x1u << 2) /**< \brief (CATB_ISR) Out-of-Touch Interrupt Status */ +/* -------- CATB_IER : (CATB Offset: 0x28) Interrupt Enable Register -------- */ +#define CATB_IER_SAMPLE (0x1u << 0) /**< \brief (CATB_IER) Sample Ready Interrupt Enable */ +#define CATB_IER_INTCH (0x1u << 1) /**< \brief (CATB_IER) In-touch Interrupt Enable */ +#define CATB_IER_OUTTCH (0x1u << 2) /**< \brief (CATB_IER) Out-of-Touch Interrupt Enable */ +/* -------- CATB_IDR : (CATB Offset: 0x2C) Interrupt Disable Register -------- */ +#define CATB_IDR_SAMPLE (0x1u << 0) /**< \brief (CATB_IDR) Sample Ready Interrupt Disable */ +#define CATB_IDR_INTCH (0x1u << 1) /**< \brief (CATB_IDR) In-touch Interrupt Disable */ +#define CATB_IDR_OUTTCH (0x1u << 2) /**< \brief (CATB_IDR) Out-of-Touch Interrupt Disable */ +/* -------- CATB_IMR : (CATB Offset: 0x30) Interrupt Mask Register -------- */ +#define CATB_IMR_SAMPLE (0x1u << 0) /**< \brief (CATB_IMR) Sample Ready Interrupt Mask */ +#define CATB_IMR_INTCH (0x1u << 1) /**< \brief (CATB_IMR) In-touch Interrupt Mask */ +#define CATB_IMR_OUTTCH (0x1u << 2) /**< \brief (CATB_IMR) Out-of-Touch Interrupt Mask */ +/* -------- CATB_SCR : (CATB Offset: 0x34) Status Clear Register -------- */ +#define CATB_SCR_SAMPLE (0x1u << 0) /**< \brief (CATB_SCR) Sample Ready */ +#define CATB_SCR_INTCH (0x1u << 1) /**< \brief (CATB_SCR) In-touch */ +#define CATB_SCR_OUTTCH (0x1u << 2) /**< \brief (CATB_SCR) Out-of-Touch */ +/* -------- CATB_INTCH : (CATB Offset: 0x40) Intch In-Touch Status Register 0 -------- */ +#define CATB_INTCH_INTCH_Pos 0 +#define CATB_INTCH_INTCH_Msk (0xFFFFFFFFu << CATB_INTCH_INTCH_Pos) /**< \brief (CATB_INTCH) In-Touch */ +#define CATB_INTCH_INTCH(value) ((CATB_INTCH_INTCH_Msk & ((value) << CATB_INTCH_INTCH_Pos))) +/* -------- CATB_INTCHCLR : (CATB Offset: 0x50) Intchclr In-Touch Status Clear Register 0 -------- */ +#define CATB_INTCHCLR_INTCHCLR_Pos 0 +#define CATB_INTCHCLR_INTCHCLR_Msk (0xFFFFFFFFu << CATB_INTCHCLR_INTCHCLR_Pos) /**< \brief (CATB_INTCHCLR) In-Touch Clear */ +#define CATB_INTCHCLR_INTCHCLR(value) ((CATB_INTCHCLR_INTCHCLR_Msk & ((value) << CATB_INTCHCLR_INTCHCLR_Pos))) +/* -------- CATB_OUTTCH : (CATB Offset: 0x60) Outtch Out-of-Touch Status Register 0 -------- */ +#define CATB_OUTTCH_OUTTCH_Pos 0 +#define CATB_OUTTCH_OUTTCH_Msk (0xFFFFFFFFu << CATB_OUTTCH_OUTTCH_Pos) /**< \brief (CATB_OUTTCH) Out-of-Touch */ +#define CATB_OUTTCH_OUTTCH(value) ((CATB_OUTTCH_OUTTCH_Msk & ((value) << CATB_OUTTCH_OUTTCH_Pos))) +/* -------- CATB_OUTTCHCLR : (CATB Offset: 0x70) Outtchclr Out-of-Touch Status Clear Register 0 -------- */ +#define CATB_OUTTCHCLR_OUTTCHCLR_Pos 0 +#define CATB_OUTTCHCLR_OUTTCHCLR_Msk (0xFFFFFFFFu << CATB_OUTTCHCLR_OUTTCHCLR_Pos) /**< \brief (CATB_OUTTCHCLR) Out of Touch */ +#define CATB_OUTTCHCLR_OUTTCHCLR(value) ((CATB_OUTTCHCLR_OUTTCHCLR_Msk & ((value) << CATB_OUTTCHCLR_OUTTCHCLR_Pos))) +/* -------- CATB_PARAMETER : (CATB Offset: 0xF8) Parameter Register -------- */ +#define CATB_PARAMETER_NPINS_Pos 0 +#define CATB_PARAMETER_NPINS_Msk (0xFFu << CATB_PARAMETER_NPINS_Pos) /**< \brief (CATB_PARAMETER) Number of Pins */ +#define CATB_PARAMETER_NPINS(value) ((CATB_PARAMETER_NPINS_Msk & ((value) << CATB_PARAMETER_NPINS_Pos))) +#define CATB_PARAMETER_NSTATUS_Pos 8 +#define CATB_PARAMETER_NSTATUS_Msk (0xFFu << CATB_PARAMETER_NSTATUS_Pos) /**< \brief (CATB_PARAMETER) Number of Status bits */ +#define CATB_PARAMETER_NSTATUS(value) ((CATB_PARAMETER_NSTATUS_Msk & ((value) << CATB_PARAMETER_NSTATUS_Pos))) +#define CATB_PARAMETER_FRACTIONAL_Pos 16 +#define CATB_PARAMETER_FRACTIONAL_Msk (0xFu << CATB_PARAMETER_FRACTIONAL_Pos) /**< \brief (CATB_PARAMETER) Number of Fractional bits */ +#define CATB_PARAMETER_FRACTIONAL(value) ((CATB_PARAMETER_FRACTIONAL_Msk & ((value) << CATB_PARAMETER_FRACTIONAL_Pos))) +/* -------- CATB_VERSION : (CATB Offset: 0xFC) Version Register -------- */ +#define CATB_VERSION_VERSION_Pos 0 +#define CATB_VERSION_VERSION_Msk (0xFFFu << CATB_VERSION_VERSION_Pos) /**< \brief (CATB_VERSION) Version number */ +#define CATB_VERSION_VERSION(value) ((CATB_VERSION_VERSION_Msk & ((value) << CATB_VERSION_VERSION_Pos))) +#define CATB_VERSION_VARIANT_Pos 16 +#define CATB_VERSION_VARIANT_Msk (0xFu << CATB_VERSION_VARIANT_Pos) /**< \brief (CATB_VERSION) Variant number */ +#define CATB_VERSION_VARIANT(value) ((CATB_VERSION_VARIANT_Msk & ((value) << CATB_VERSION_VARIANT_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR CHIPID */ +/* ============================================================================= */ +/** \addtogroup SAM4L_CHIPID Chip ID Registers */ +/*@{*/ + +#define REV_CHIPID 0x100 + +#ifndef __ASSEMBLY__ +/** \brief CHIPID hardware registers */ +typedef struct { + RoReg Reserved1[208]; + RoReg CHIPID_CIDR; /**< \brief (CHIPID Offset: 0x340) Chip ID Register */ + RoReg CHIPID_EXID; /**< \brief (CHIPID Offset: 0x344) Chip ID Extension Register */ +} Chipid; +#endif /* __ASSEMBLY__ */ + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR CRCCU */ +/* ============================================================================= */ +/** \addtogroup SAM4L_CRCCU CRC Calculation Unit */ +/*@{*/ + +#define REV_CRCCU 0x202 + +#ifndef __ASSEMBLY__ +/** \brief CRCCU hardware registers */ +typedef struct { + RwReg CRCCU_DSCR; /**< \brief (CRCCU Offset: 0x00) Descriptor Base Register */ + RoReg Reserved1[1]; + WoReg CRCCU_DMAEN; /**< \brief (CRCCU Offset: 0x08) DMA Enable Register */ + WoReg CRCCU_DMADIS; /**< \brief (CRCCU Offset: 0x0C) DMA Disable Register */ + RoReg CRCCU_DMASR; /**< \brief (CRCCU Offset: 0x10) DMA Status Register */ + WoReg CRCCU_DMAIER; /**< \brief (CRCCU Offset: 0x14) DMA Interrupt Enable Register */ + WoReg CRCCU_DMAIDR; /**< \brief (CRCCU Offset: 0x18) DMA Interrupt Disable Register */ + RoReg CRCCU_DMAIMR; /**< \brief (CRCCU Offset: 0x1C) DMA Interrupt Mask Register */ + RoReg CRCCU_DMAISR; /**< \brief (CRCCU Offset: 0x20) DMA Interrupt Status Register */ + RoReg Reserved2[4]; + WoReg CRCCU_CR; /**< \brief (CRCCU Offset: 0x34) Control Register */ + RwReg CRCCU_MR; /**< \brief (CRCCU Offset: 0x38) Mode Register */ + RoReg CRCCU_SR; /**< \brief (CRCCU Offset: 0x3C) Status Register */ + WoReg CRCCU_IER; /**< \brief (CRCCU Offset: 0x40) Interrupt Enable Register */ + WoReg CRCCU_IDR; /**< \brief (CRCCU Offset: 0x44) Interrupt Disable Register */ + RoReg CRCCU_IMR; /**< \brief (CRCCU Offset: 0x48) Interrupt Mask Register */ + RoReg CRCCU_ISR; /**< \brief (CRCCU Offset: 0x4C) Interrupt Status Register */ + RoReg Reserved3[43]; + RoReg CRCCU_VERSION; /**< \brief (CRCCU Offset: 0xFC) Version Register */ +} Crccu; +#endif /* __ASSEMBLY__ */ +/* -------- CRCCU_DSCR : (CRCCU Offset: 0x00) Descriptor Base Register -------- */ +#define CRCCU_DSCR_DSCR_Pos 9 +#define CRCCU_DSCR_DSCR_Msk (0x7FFFFFu << CRCCU_DSCR_DSCR_Pos) /**< \brief (CRCCU_DSCR) Description Base Address */ +#define CRCCU_DSCR_DSCR(value) ((CRCCU_DSCR_DSCR_Msk & ((value) << CRCCU_DSCR_DSCR_Pos))) +/* -------- CRCCU_DMAEN : (CRCCU Offset: 0x08) DMA Enable Register -------- */ +#define CRCCU_DMAEN_DMAEN (0x1u << 0) /**< \brief (CRCCU_DMAEN) DMA Enable */ +/* -------- CRCCU_DMADIS : (CRCCU Offset: 0x0C) DMA Disable Register -------- */ +#define CRCCU_DMADIS_DMADIS (0x1u << 0) /**< \brief (CRCCU_DMADIS) DMA Disable */ +/* -------- CRCCU_DMASR : (CRCCU Offset: 0x10) DMA Status Register -------- */ +#define CRCCU_DMASR_DMASR (0x1u << 0) /**< \brief (CRCCU_DMASR) DMA Channel Status */ +/* -------- CRCCU_DMAIER : (CRCCU Offset: 0x14) DMA Interrupt Enable Register -------- */ +#define CRCCU_DMAIER_DMAIER (0x1u << 0) /**< \brief (CRCCU_DMAIER) DMA Interrupt Enable */ +/* -------- CRCCU_DMAIDR : (CRCCU Offset: 0x18) DMA Interrupt Disable Register -------- */ +#define CRCCU_DMAIDR_DMAIDR (0x1u << 0) /**< \brief (CRCCU_DMAIDR) DMA Interrupt Disable */ +/* -------- CRCCU_DMAIMR : (CRCCU Offset: 0x1C) DMA Interrupt Mask Register -------- */ +#define CRCCU_DMAIMR_DMAIMR (0x1u << 0) /**< \brief (CRCCU_DMAIMR) DMA Interrupt Mask */ +/* -------- CRCCU_DMAISR : (CRCCU Offset: 0x20) DMA Interrupt Status Register -------- */ +#define CRCCU_DMAISR_DMAISR (0x1u << 0) /**< \brief (CRCCU_DMAISR) DMA Interrupt Status */ +/* -------- CRCCU_CR : (CRCCU Offset: 0x34) Control Register -------- */ +#define CRCCU_CR_RESET (0x1u << 0) /**< \brief (CRCCU_CR) Reset CRCComputation */ +/* -------- CRCCU_MR : (CRCCU Offset: 0x38) Mode Register -------- */ +#define CRCCU_MR_ENABLE (0x1u << 0) /**< \brief (CRCCU_MR) CRC Computation Enable */ +#define CRCCU_MR_COMPARE (0x1u << 1) /**< \brief (CRCCU_MR) CRC Compare */ +#define CRCCU_MR_PTYPE_Pos 2 +#define CRCCU_MR_PTYPE_Msk (0x3u << CRCCU_MR_PTYPE_Pos) /**< \brief (CRCCU_MR) Polynomial Type */ +#define CRCCU_MR_PTYPE(value) ((CRCCU_MR_PTYPE_Msk & ((value) << CRCCU_MR_PTYPE_Pos))) +#define CRCCU_MR_DIVIDER_Pos 4 +#define CRCCU_MR_DIVIDER_Msk (0xFu << CRCCU_MR_DIVIDER_Pos) /**< \brief (CRCCU_MR) Bandwidth Divider */ +#define CRCCU_MR_DIVIDER(value) ((CRCCU_MR_DIVIDER_Msk & ((value) << CRCCU_MR_DIVIDER_Pos))) +/* -------- CRCCU_SR : (CRCCU Offset: 0x3C) Status Register -------- */ +#define CRCCU_SR_CRC_Pos 0 +#define CRCCU_SR_CRC_Msk (0xFFFFFFFFu << CRCCU_SR_CRC_Pos) /**< \brief (CRCCU_SR) Cyclic Redundancy Check Value */ +#define CRCCU_SR_CRC(value) ((CRCCU_SR_CRC_Msk & ((value) << CRCCU_SR_CRC_Pos))) +/* -------- CRCCU_IER : (CRCCU Offset: 0x40) Interrupt Enable Register -------- */ +#define CRCCU_IER_ERRIER (0x1u << 0) /**< \brief (CRCCU_IER) CRC Error Interrupt Enable */ +/* -------- CRCCU_IDR : (CRCCU Offset: 0x44) Interrupt Disable Register -------- */ +#define CRCCU_IDR_ERRIDR (0x1u << 0) /**< \brief (CRCCU_IDR) CRC Error Interrupt Disable */ +/* -------- CRCCU_IMR : (CRCCU Offset: 0x48) Interrupt Mask Register -------- */ +#define CRCCU_IMR_ERRIMR (0x1u << 0) /**< \brief (CRCCU_IMR) CRC Error Interrupt Mask */ +/* -------- CRCCU_ISR : (CRCCU Offset: 0x4C) Interrupt Status Register -------- */ +#define CRCCU_ISR_ERRISR (0x1u << 0) /**< \brief (CRCCU_ISR) CRC Error Interrupt Status */ +/* -------- CRCCU_VERSION : (CRCCU Offset: 0xFC) Version Register -------- */ +#define CRCCU_VERSION_VERSION_Pos 0 +#define CRCCU_VERSION_VERSION_Msk (0xFFFu << CRCCU_VERSION_VERSION_Pos) /**< \brief (CRCCU_VERSION) Version Number */ +#define CRCCU_VERSION_VERSION(value) ((CRCCU_VERSION_VERSION_Msk & ((value) << CRCCU_VERSION_VERSION_Pos))) +#define CRCCU_VERSION_VARIANT_Pos 16 +#define CRCCU_VERSION_VARIANT_Msk (0xFu << CRCCU_VERSION_VARIANT_Pos) /**< \brief (CRCCU_VERSION) Variant Number */ +#define CRCCU_VERSION_VARIANT(value) ((CRCCU_VERSION_VARIANT_Msk & ((value) << CRCCU_VERSION_VARIANT_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR DACC */ +/* ============================================================================= */ +/** \addtogroup SAM4L_DACC DAC Controller */ +/*@{*/ + +#define REV_DACC 0x111 + +#ifndef __ASSEMBLY__ +/** \brief DACC hardware registers */ +typedef struct { + WoReg DACC_CR; /**< \brief (DACC Offset: 0x00) Control Register */ + RwReg DACC_MR; /**< \brief (DACC Offset: 0x04) Mode Register */ + WoReg DACC_CDR; /**< \brief (DACC Offset: 0x08) Conversion Data Register */ + WoReg DACC_IER; /**< \brief (DACC Offset: 0x0C) Interrupt Enable Register */ + WoReg DACC_IDR; /**< \brief (DACC Offset: 0x10) Interrupt Disable Register */ + RoReg DACC_IMR; /**< \brief (DACC Offset: 0x14) Interrupt Mask Register */ + RoReg DACC_ISR; /**< \brief (DACC Offset: 0x18) Interrupt Status Register */ + RoReg Reserved1[50]; + RwReg DACC_WPMR; /**< \brief (DACC Offset: 0xE4) Write Protect Mode Register */ + RoReg DACC_WPSR; /**< \brief (DACC Offset: 0xE8) Write Protect Status Register */ + RoReg Reserved2[4]; + RoReg DACC_VERSION; /**< \brief (DACC Offset: 0xFC) Version Register */ +} Dacc; +#endif /* __ASSEMBLY__ */ +/* -------- DACC_CR : (DACC Offset: 0x00) Control Register -------- */ +#define DACC_CR_SWRST (0x1u << 0) /**< \brief (DACC_CR) Software Reset */ +/* -------- DACC_MR : (DACC Offset: 0x04) Mode Register -------- */ +#define DACC_MR_TRGEN (0x1u << 0) /**< \brief (DACC_MR) Trigger Enable */ +#define DACC_MR_TRGSEL_Pos 1 +#define DACC_MR_TRGSEL_Msk (0x7u << DACC_MR_TRGSEL_Pos) /**< \brief (DACC_MR) Trigger Selection */ +#define DACC_MR_TRGSEL(value) ((DACC_MR_TRGSEL_Msk & ((value) << DACC_MR_TRGSEL_Pos))) +#define DACC_MR_DACEN (0x1u << 4) /**< \brief (DACC_MR) DAC Enable */ +#define DACC_MR_WORD (0x1u << 5) /**< \brief (DACC_MR) Word Transfer */ +#define DACC_MR_STARTUP_Pos 8 +#define DACC_MR_STARTUP_Msk (0xFFu << DACC_MR_STARTUP_Pos) /**< \brief (DACC_MR) Startup Time Selection */ +#define DACC_MR_STARTUP(value) ((DACC_MR_STARTUP_Msk & ((value) << DACC_MR_STARTUP_Pos))) +#define DACC_MR_CLKDIV_Pos 16 +#define DACC_MR_CLKDIV_Msk (0xFFFFu << DACC_MR_CLKDIV_Pos) /**< \brief (DACC_MR) Clock Divider for Internal Trigger */ +#define DACC_MR_CLKDIV(value) ((DACC_MR_CLKDIV_Msk & ((value) << DACC_MR_CLKDIV_Pos))) +/* -------- DACC_CDR : (DACC Offset: 0x08) Conversion Data Register -------- */ +#define DACC_CDR_DATA_Pos 0 +#define DACC_CDR_DATA_Msk (0xFFFFFFFFu << DACC_CDR_DATA_Pos) /**< \brief (DACC_CDR) Data to Convert */ +#define DACC_CDR_DATA(value) ((DACC_CDR_DATA_Msk & ((value) << DACC_CDR_DATA_Pos))) +/* -------- DACC_IER : (DACC Offset: 0x0C) Interrupt Enable Register -------- */ +#define DACC_IER_TXRDY (0x1u << 0) /**< \brief (DACC_IER) Transmit Ready Interrupt Enable */ +/* -------- DACC_IDR : (DACC Offset: 0x10) Interrupt Disable Register -------- */ +#define DACC_IDR_TXRDY (0x1u << 0) /**< \brief (DACC_IDR) Transmit Ready Interrupt Disable */ +/* -------- DACC_IMR : (DACC Offset: 0x14) Interrupt Mask Register -------- */ +#define DACC_IMR_TXRDY (0x1u << 0) /**< \brief (DACC_IMR) Transmit Ready Interrupt Mask */ +/* -------- DACC_ISR : (DACC Offset: 0x18) Interrupt Status Register -------- */ +#define DACC_ISR_TXRDY (0x1u << 0) /**< \brief (DACC_ISR) Transmit Ready Interrupt Status */ +/* -------- DACC_WPMR : (DACC Offset: 0xE4) Write Protect Mode Register -------- */ +#define DACC_WPMR_WPEN (0x1u << 0) /**< \brief (DACC_WPMR) Write Protect Enable */ +#define DACC_WPMR_WPKEY_Pos 8 +#define DACC_WPMR_WPKEY_Msk (0xFFFFFFu << DACC_WPMR_WPKEY_Pos) /**< \brief (DACC_WPMR) Write Protect Key */ +#define DACC_WPMR_WPKEY(value) ((DACC_WPMR_WPKEY_Msk & ((value) << DACC_WPMR_WPKEY_Pos))) +/* -------- DACC_WPSR : (DACC Offset: 0xE8) Write Protect Status Register -------- */ +#define DACC_WPSR_WPROTERR (0x1u << 0) /**< \brief (DACC_WPSR) Write Protection Error */ +#define DACC_WPSR_WPROTADDR_Pos 8 +#define DACC_WPSR_WPROTADDR_Msk (0xFFu << DACC_WPSR_WPROTADDR_Pos) /**< \brief (DACC_WPSR) Write Protection Error Address */ +#define DACC_WPSR_WPROTADDR(value) ((DACC_WPSR_WPROTADDR_Msk & ((value) << DACC_WPSR_WPROTADDR_Pos))) +/* -------- DACC_VERSION : (DACC Offset: 0xFC) Version Register -------- */ +#define DACC_VERSION_VERSION_Pos 0 +#define DACC_VERSION_VERSION_Msk (0xFFFu << DACC_VERSION_VERSION_Pos) /**< \brief (DACC_VERSION) Version Number */ +#define DACC_VERSION_VERSION(value) ((DACC_VERSION_VERSION_Msk & ((value) << DACC_VERSION_VERSION_Pos))) +#define DACC_VERSION_VARIANT_Pos 16 +#define DACC_VERSION_VARIANT_Msk (0x7u << DACC_VERSION_VARIANT_Pos) /**< \brief (DACC_VERSION) Variant Number */ +#define DACC_VERSION_VARIANT(value) ((DACC_VERSION_VARIANT_Msk & ((value) << DACC_VERSION_VARIANT_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR EIC */ +/* ============================================================================= */ +/** \addtogroup SAM4L_EIC External Interrupt Controller */ +/*@{*/ + +#define REV_EIC 0x302 + +#ifndef __ASSEMBLY__ +/** \brief EIC hardware registers */ +typedef struct { + WoReg EIC_IER; /**< \brief (EIC Offset: 0x000) Interrupt Enable Register */ + WoReg EIC_IDR; /**< \brief (EIC Offset: 0x004) Interrupt Disable Register */ + RoReg EIC_IMR; /**< \brief (EIC Offset: 0x008) Interrupt Mask Register */ + RoReg EIC_ISR; /**< \brief (EIC Offset: 0x00C) Interrupt Status Register */ + WoReg EIC_ICR; /**< \brief (EIC Offset: 0x010) Interrupt Clear Register */ + RwReg EIC_MODE; /**< \brief (EIC Offset: 0x014) Mode Register */ + RwReg EIC_EDGE; /**< \brief (EIC Offset: 0x018) Edge Register */ + RwReg EIC_LEVEL; /**< \brief (EIC Offset: 0x01C) Level Register */ + RwReg EIC_FILTER; /**< \brief (EIC Offset: 0x020) Filter Register */ + RoReg Reserved1[1]; + RwReg EIC_ASYNC; /**< \brief (EIC Offset: 0x028) Asynchronous Register */ + RoReg Reserved2[1]; + WoReg EIC_EN; /**< \brief (EIC Offset: 0x030) Enable Register */ + WoReg EIC_DIS; /**< \brief (EIC Offset: 0x034) Disable Register */ + RoReg EIC_CTRL; /**< \brief (EIC Offset: 0x038) Control Register */ + RoReg Reserved3[240]; + RoReg EIC_VERSION; /**< \brief (EIC Offset: 0x3FC) Version Register */ +} Eic; +#endif /* __ASSEMBLY__ */ +/* -------- EIC_IER : (EIC Offset: 0x000) Interrupt Enable Register -------- */ +#define EIC_IER_NMI (0x1u << 0) /**< \brief (EIC_IER) External Non Maskable CPU interrupt */ +#define EIC_IER_INT1 (0x1u << 1) /**< \brief (EIC_IER) External Interrupt 1 */ +#define EIC_IER_INT1_0 (0x0u << 1) /**< \brief (EIC_IER) No effect */ +#define EIC_IER_INT1_1 (0x1u << 1) /**< \brief (EIC_IER) Enable Interrupt. */ +#define EIC_IER_INT2 (0x1u << 2) /**< \brief (EIC_IER) External Interrupt 2 */ +#define EIC_IER_INT2_0 (0x0u << 2) /**< \brief (EIC_IER) No effect */ +#define EIC_IER_INT2_1 (0x1u << 2) /**< \brief (EIC_IER) Enable Interrupt. */ +#define EIC_IER_INT3 (0x1u << 3) /**< \brief (EIC_IER) External Interrupt 3 */ +#define EIC_IER_INT3_0 (0x0u << 3) /**< \brief (EIC_IER) No effect */ +#define EIC_IER_INT3_1 (0x1u << 3) /**< \brief (EIC_IER) Enable Interrupt. */ +#define EIC_IER_INT4 (0x1u << 4) /**< \brief (EIC_IER) External Interrupt 4 */ +#define EIC_IER_INT4_0 (0x0u << 4) /**< \brief (EIC_IER) No effect */ +#define EIC_IER_INT4_1 (0x1u << 4) /**< \brief (EIC_IER) Enable Interrupt. */ +#define EIC_IER_INT5 (0x1u << 5) /**< \brief (EIC_IER) External Interrupt 5 */ +#define EIC_IER_INT6 (0x1u << 6) /**< \brief (EIC_IER) External Interrupt 6 */ +#define EIC_IER_INT7 (0x1u << 7) /**< \brief (EIC_IER) External Interrupt 7 */ +#define EIC_IER_INT8 (0x1u << 8) /**< \brief (EIC_IER) External Interrupt 8 */ +#define EIC_IER_INT9 (0x1u << 9) /**< \brief (EIC_IER) External Interrupt 9 */ +#define EIC_IER_INT10 (0x1u << 10) /**< \brief (EIC_IER) External Interrupt 10 */ +#define EIC_IER_INT11 (0x1u << 11) /**< \brief (EIC_IER) External Interrupt 11 */ +#define EIC_IER_INT12 (0x1u << 12) /**< \brief (EIC_IER) External Interrupt 12 */ +#define EIC_IER_INT13 (0x1u << 13) /**< \brief (EIC_IER) External Interrupt 13 */ +#define EIC_IER_INT14 (0x1u << 14) /**< \brief (EIC_IER) External Interrupt 14 */ +#define EIC_IER_INT15 (0x1u << 15) /**< \brief (EIC_IER) External Interrupt 15 */ +/* -------- EIC_IDR : (EIC Offset: 0x004) Interrupt Disable Register -------- */ +#define EIC_IDR_NMI (0x1u << 0) /**< \brief (EIC_IDR) External Non Maskable CPU interrupt */ +#define EIC_IDR_INT1 (0x1u << 1) /**< \brief (EIC_IDR) External Interrupt 1 */ +#define EIC_IDR_INT1_0 (0x0u << 1) /**< \brief (EIC_IDR) No effect */ +#define EIC_IDR_INT1_1 (0x1u << 1) /**< \brief (EIC_IDR) Disable Interrupt. */ +#define EIC_IDR_INT2 (0x1u << 2) /**< \brief (EIC_IDR) External Interrupt 2 */ +#define EIC_IDR_INT2_0 (0x0u << 2) /**< \brief (EIC_IDR) No effect */ +#define EIC_IDR_INT2_1 (0x1u << 2) /**< \brief (EIC_IDR) Disable Interrupt. */ +#define EIC_IDR_INT3 (0x1u << 3) /**< \brief (EIC_IDR) External Interrupt 3 */ +#define EIC_IDR_INT3_0 (0x0u << 3) /**< \brief (EIC_IDR) No effect */ +#define EIC_IDR_INT3_1 (0x1u << 3) /**< \brief (EIC_IDR) Disable Interrupt. */ +#define EIC_IDR_INT4 (0x1u << 4) /**< \brief (EIC_IDR) External Interrupt 4 */ +#define EIC_IDR_INT4_0 (0x0u << 4) /**< \brief (EIC_IDR) No effect */ +#define EIC_IDR_INT4_1 (0x1u << 4) /**< \brief (EIC_IDR) Disable Interrupt. */ +#define EIC_IDR_INT5 (0x1u << 5) /**< \brief (EIC_IDR) External Interrupt 5 */ +#define EIC_IDR_INT6 (0x1u << 6) /**< \brief (EIC_IDR) External Interrupt 6 */ +#define EIC_IDR_INT7 (0x1u << 7) /**< \brief (EIC_IDR) External Interrupt 7 */ +#define EIC_IDR_INT8 (0x1u << 8) /**< \brief (EIC_IDR) External Interrupt 8 */ +#define EIC_IDR_INT9 (0x1u << 9) /**< \brief (EIC_IDR) External Interrupt 9 */ +#define EIC_IDR_INT10 (0x1u << 10) /**< \brief (EIC_IDR) External Interrupt 10 */ +#define EIC_IDR_INT11 (0x1u << 11) /**< \brief (EIC_IDR) External Interrupt 11 */ +#define EIC_IDR_INT12 (0x1u << 12) /**< \brief (EIC_IDR) External Interrupt 12 */ +#define EIC_IDR_INT13 (0x1u << 13) /**< \brief (EIC_IDR) External Interrupt 13 */ +#define EIC_IDR_INT14 (0x1u << 14) /**< \brief (EIC_IDR) External Interrupt 14 */ +#define EIC_IDR_INT15 (0x1u << 15) /**< \brief (EIC_IDR) External Interrupt 15 */ +/* -------- EIC_IMR : (EIC Offset: 0x008) Interrupt Mask Register -------- */ +#define EIC_IMR_NMI (0x1u << 0) /**< \brief (EIC_IMR) External Non Maskable CPU interrupt */ +#define EIC_IMR_INT1 (0x1u << 1) /**< \brief (EIC_IMR) External Interrupt 1 */ +#define EIC_IMR_INT1_0 (0x0u << 1) /**< \brief (EIC_IMR) Interrupt is disabled */ +#define EIC_IMR_INT1_1 (0x1u << 1) /**< \brief (EIC_IMR) Interrupt is enabled. */ +#define EIC_IMR_INT2 (0x1u << 2) /**< \brief (EIC_IMR) External Interrupt 2 */ +#define EIC_IMR_INT2_0 (0x0u << 2) /**< \brief (EIC_IMR) Interrupt is disabled */ +#define EIC_IMR_INT2_1 (0x1u << 2) /**< \brief (EIC_IMR) Interrupt is enabled. */ +#define EIC_IMR_INT3 (0x1u << 3) /**< \brief (EIC_IMR) External Interrupt 3 */ +#define EIC_IMR_INT3_0 (0x0u << 3) /**< \brief (EIC_IMR) Interrupt is disabled */ +#define EIC_IMR_INT3_1 (0x1u << 3) /**< \brief (EIC_IMR) Interrupt is enabled. */ +#define EIC_IMR_INT4 (0x1u << 4) /**< \brief (EIC_IMR) External Interrupt 4 */ +#define EIC_IMR_INT4_0 (0x0u << 4) /**< \brief (EIC_IMR) Interrupt is disabled */ +#define EIC_IMR_INT4_1 (0x1u << 4) /**< \brief (EIC_IMR) Interrupt is enabled. */ +#define EIC_IMR_INT5 (0x1u << 5) /**< \brief (EIC_IMR) External Interrupt 5 */ +#define EIC_IMR_INT6 (0x1u << 6) /**< \brief (EIC_IMR) External Interrupt 6 */ +#define EIC_IMR_INT7 (0x1u << 7) /**< \brief (EIC_IMR) External Interrupt 7 */ +#define EIC_IMR_INT8 (0x1u << 8) /**< \brief (EIC_IMR) External Interrupt 8 */ +#define EIC_IMR_INT9 (0x1u << 9) /**< \brief (EIC_IMR) External Interrupt 9 */ +#define EIC_IMR_INT10 (0x1u << 10) /**< \brief (EIC_IMR) External Interrupt 10 */ +#define EIC_IMR_INT11 (0x1u << 11) /**< \brief (EIC_IMR) External Interrupt 11 */ +#define EIC_IMR_INT12 (0x1u << 12) /**< \brief (EIC_IMR) External Interrupt 12 */ +#define EIC_IMR_INT13 (0x1u << 13) /**< \brief (EIC_IMR) External Interrupt 13 */ +#define EIC_IMR_INT14 (0x1u << 14) /**< \brief (EIC_IMR) External Interrupt 14 */ +#define EIC_IMR_INT15 (0x1u << 15) /**< \brief (EIC_IMR) External Interrupt 15 */ +/* -------- EIC_ISR : (EIC Offset: 0x00C) Interrupt Status Register -------- */ +#define EIC_ISR_NMI (0x1u << 0) /**< \brief (EIC_ISR) External Non Maskable CPU interrupt */ +#define EIC_ISR_INT1 (0x1u << 1) /**< \brief (EIC_ISR) External Interrupt 1 */ +#define EIC_ISR_INT1_0 (0x0u << 1) /**< \brief (EIC_ISR) An interrupt event has not occurred */ +#define EIC_ISR_INT1_1 (0x1u << 1) /**< \brief (EIC_ISR) An interrupt event has occurred. */ +#define EIC_ISR_INT2 (0x1u << 2) /**< \brief (EIC_ISR) External Interrupt 2 */ +#define EIC_ISR_INT2_0 (0x0u << 2) /**< \brief (EIC_ISR) An interrupt event has not occurred */ +#define EIC_ISR_INT2_1 (0x1u << 2) /**< \brief (EIC_ISR) An interrupt event has occurred. */ +#define EIC_ISR_INT3 (0x1u << 3) /**< \brief (EIC_ISR) External Interrupt 3 */ +#define EIC_ISR_INT3_0 (0x0u << 3) /**< \brief (EIC_ISR) An interrupt event has not occurred */ +#define EIC_ISR_INT3_1 (0x1u << 3) /**< \brief (EIC_ISR) An interrupt event has occurred. */ +#define EIC_ISR_INT4 (0x1u << 4) /**< \brief (EIC_ISR) External Interrupt 4 */ +#define EIC_ISR_INT4_0 (0x0u << 4) /**< \brief (EIC_ISR) An interrupt event has not occurred */ +#define EIC_ISR_INT4_1 (0x1u << 4) /**< \brief (EIC_ISR) An interrupt event has occurred. */ +#define EIC_ISR_INT5 (0x1u << 5) /**< \brief (EIC_ISR) External Interrupt 5 */ +#define EIC_ISR_INT6 (0x1u << 6) /**< \brief (EIC_ISR) External Interrupt 6 */ +#define EIC_ISR_INT7 (0x1u << 7) /**< \brief (EIC_ISR) External Interrupt 7 */ +#define EIC_ISR_INT8 (0x1u << 8) /**< \brief (EIC_ISR) External Interrupt 8 */ +#define EIC_ISR_INT9 (0x1u << 9) /**< \brief (EIC_ISR) External Interrupt 9 */ +#define EIC_ISR_INT10 (0x1u << 10) /**< \brief (EIC_ISR) External Interrupt 10 */ +#define EIC_ISR_INT11 (0x1u << 11) /**< \brief (EIC_ISR) External Interrupt 11 */ +#define EIC_ISR_INT12 (0x1u << 12) /**< \brief (EIC_ISR) External Interrupt 12 */ +#define EIC_ISR_INT13 (0x1u << 13) /**< \brief (EIC_ISR) External Interrupt 13 */ +#define EIC_ISR_INT14 (0x1u << 14) /**< \brief (EIC_ISR) External Interrupt 14 */ +#define EIC_ISR_INT15 (0x1u << 15) /**< \brief (EIC_ISR) External Interrupt 15 */ +/* -------- EIC_ICR : (EIC Offset: 0x010) Interrupt Clear Register -------- */ +#define EIC_ICR_NMI (0x1u << 0) /**< \brief (EIC_ICR) External Non Maskable CPU interrupt */ +#define EIC_ICR_INT1 (0x1u << 1) /**< \brief (EIC_ICR) External Interrupt 1 */ +#define EIC_ICR_INT1_0 (0x0u << 1) /**< \brief (EIC_ICR) No effect */ +#define EIC_ICR_INT1_1 (0x1u << 1) /**< \brief (EIC_ICR) Clear Interrupt. */ +#define EIC_ICR_INT2 (0x1u << 2) /**< \brief (EIC_ICR) External Interrupt 2 */ +#define EIC_ICR_INT2_0 (0x0u << 2) /**< \brief (EIC_ICR) No effect */ +#define EIC_ICR_INT2_1 (0x1u << 2) /**< \brief (EIC_ICR) Clear Interrupt. */ +#define EIC_ICR_INT3 (0x1u << 3) /**< \brief (EIC_ICR) External Interrupt 3 */ +#define EIC_ICR_INT3_0 (0x0u << 3) /**< \brief (EIC_ICR) No effect */ +#define EIC_ICR_INT3_1 (0x1u << 3) /**< \brief (EIC_ICR) Clear Interrupt. */ +#define EIC_ICR_INT4 (0x1u << 4) /**< \brief (EIC_ICR) External Interrupt 4 */ +#define EIC_ICR_INT4_0 (0x0u << 4) /**< \brief (EIC_ICR) No effect */ +#define EIC_ICR_INT4_1 (0x1u << 4) /**< \brief (EIC_ICR) Clear Interrupt. */ +#define EIC_ICR_INT5 (0x1u << 5) /**< \brief (EIC_ICR) External Interrupt 5 */ +#define EIC_ICR_INT6 (0x1u << 6) /**< \brief (EIC_ICR) External Interrupt 6 */ +#define EIC_ICR_INT7 (0x1u << 7) /**< \brief (EIC_ICR) External Interrupt 7 */ +#define EIC_ICR_INT8 (0x1u << 8) /**< \brief (EIC_ICR) External Interrupt 8 */ +#define EIC_ICR_INT9 (0x1u << 9) /**< \brief (EIC_ICR) External Interrupt 9 */ +#define EIC_ICR_INT10 (0x1u << 10) /**< \brief (EIC_ICR) External Interrupt 10 */ +#define EIC_ICR_INT11 (0x1u << 11) /**< \brief (EIC_ICR) External Interrupt 11 */ +#define EIC_ICR_INT12 (0x1u << 12) /**< \brief (EIC_ICR) External Interrupt 12 */ +#define EIC_ICR_INT13 (0x1u << 13) /**< \brief (EIC_ICR) External Interrupt 13 */ +#define EIC_ICR_INT14 (0x1u << 14) /**< \brief (EIC_ICR) External Interrupt 14 */ +#define EIC_ICR_INT15 (0x1u << 15) /**< \brief (EIC_ICR) External Interrupt 15 */ +/* -------- EIC_MODE : (EIC Offset: 0x014) Mode Register -------- */ +#define EIC_MODE_NMI (0x1u << 0) /**< \brief (EIC_MODE) External Non Maskable CPU interrupt */ +#define EIC_MODE_INT1 (0x1u << 1) /**< \brief (EIC_MODE) External Interrupt 1 */ +#define EIC_MODE_INT1_0 (0x0u << 1) /**< \brief (EIC_MODE) Edge triggered interrupt */ +#define EIC_MODE_INT1_1 (0x1u << 1) /**< \brief (EIC_MODE) Level triggered interrupt */ +#define EIC_MODE_INT2 (0x1u << 2) /**< \brief (EIC_MODE) External Interrupt 2 */ +#define EIC_MODE_INT2_0 (0x0u << 2) /**< \brief (EIC_MODE) Edge triggered interrupt */ +#define EIC_MODE_INT2_1 (0x1u << 2) /**< \brief (EIC_MODE) Level triggered interrupt */ +#define EIC_MODE_INT3 (0x1u << 3) /**< \brief (EIC_MODE) External Interrupt 3 */ +#define EIC_MODE_INT3_0 (0x0u << 3) /**< \brief (EIC_MODE) Edge triggered interrupt */ +#define EIC_MODE_INT3_1 (0x1u << 3) /**< \brief (EIC_MODE) Level triggered interrupt */ +#define EIC_MODE_INT4 (0x1u << 4) /**< \brief (EIC_MODE) External Interrupt 4 */ +#define EIC_MODE_INT4_0 (0x0u << 4) /**< \brief (EIC_MODE) Edge triggered interrupt */ +#define EIC_MODE_INT4_1 (0x1u << 4) /**< \brief (EIC_MODE) Level triggered interrupt */ +#define EIC_MODE_INT5 (0x1u << 5) /**< \brief (EIC_MODE) External Interrupt 5 */ +#define EIC_MODE_INT6 (0x1u << 6) /**< \brief (EIC_MODE) External Interrupt 6 */ +#define EIC_MODE_INT7 (0x1u << 7) /**< \brief (EIC_MODE) External Interrupt 7 */ +#define EIC_MODE_INT8 (0x1u << 8) /**< \brief (EIC_MODE) External Interrupt 8 */ +#define EIC_MODE_INT9 (0x1u << 9) /**< \brief (EIC_MODE) External Interrupt 9 */ +#define EIC_MODE_INT10 (0x1u << 10) /**< \brief (EIC_MODE) External Interrupt 10 */ +#define EIC_MODE_INT11 (0x1u << 11) /**< \brief (EIC_MODE) External Interrupt 11 */ +#define EIC_MODE_INT12 (0x1u << 12) /**< \brief (EIC_MODE) External Interrupt 12 */ +#define EIC_MODE_INT13 (0x1u << 13) /**< \brief (EIC_MODE) External Interrupt 13 */ +#define EIC_MODE_INT14 (0x1u << 14) /**< \brief (EIC_MODE) External Interrupt 14 */ +#define EIC_MODE_INT15 (0x1u << 15) /**< \brief (EIC_MODE) External Interrupt 15 */ +/* -------- EIC_EDGE : (EIC Offset: 0x018) Edge Register -------- */ +#define EIC_EDGE_NMI (0x1u << 0) /**< \brief (EIC_EDGE) External Non Maskable CPU interrupt */ +#define EIC_EDGE_INT1 (0x1u << 1) /**< \brief (EIC_EDGE) External Interrupt 1 */ +#define EIC_EDGE_INT1_0 (0x0u << 1) /**< \brief (EIC_EDGE) Triggers on falling edge */ +#define EIC_EDGE_INT1_1 (0x1u << 1) /**< \brief (EIC_EDGE) Triggers on rising edge. */ +#define EIC_EDGE_INT2 (0x1u << 2) /**< \brief (EIC_EDGE) External Interrupt 2 */ +#define EIC_EDGE_INT2_0 (0x0u << 2) /**< \brief (EIC_EDGE) Triggers on falling edge */ +#define EIC_EDGE_INT2_1 (0x1u << 2) /**< \brief (EIC_EDGE) Triggers on rising edge. */ +#define EIC_EDGE_INT3 (0x1u << 3) /**< \brief (EIC_EDGE) External Interrupt 3 */ +#define EIC_EDGE_INT3_0 (0x0u << 3) /**< \brief (EIC_EDGE) Triggers on falling edge */ +#define EIC_EDGE_INT3_1 (0x1u << 3) /**< \brief (EIC_EDGE) Triggers on rising edge. */ +#define EIC_EDGE_INT4 (0x1u << 4) /**< \brief (EIC_EDGE) External Interrupt 4 */ +#define EIC_EDGE_INT4_0 (0x0u << 4) /**< \brief (EIC_EDGE) Triggers on falling edge */ +#define EIC_EDGE_INT4_1 (0x1u << 4) /**< \brief (EIC_EDGE) Triggers on rising edge. */ +#define EIC_EDGE_INT5 (0x1u << 5) /**< \brief (EIC_EDGE) External Interrupt 5 */ +#define EIC_EDGE_INT6 (0x1u << 6) /**< \brief (EIC_EDGE) External Interrupt 6 */ +#define EIC_EDGE_INT7 (0x1u << 7) /**< \brief (EIC_EDGE) External Interrupt 7 */ +#define EIC_EDGE_INT8 (0x1u << 8) /**< \brief (EIC_EDGE) External Interrupt 8 */ +#define EIC_EDGE_INT9 (0x1u << 9) /**< \brief (EIC_EDGE) External Interrupt 9 */ +#define EIC_EDGE_INT10 (0x1u << 10) /**< \brief (EIC_EDGE) External Interrupt 10 */ +#define EIC_EDGE_INT11 (0x1u << 11) /**< \brief (EIC_EDGE) External Interrupt 11 */ +#define EIC_EDGE_INT12 (0x1u << 12) /**< \brief (EIC_EDGE) External Interrupt 12 */ +#define EIC_EDGE_INT13 (0x1u << 13) /**< \brief (EIC_EDGE) External Interrupt 13 */ +#define EIC_EDGE_INT14 (0x1u << 14) /**< \brief (EIC_EDGE) External Interrupt 14 */ +#define EIC_EDGE_INT15 (0x1u << 15) /**< \brief (EIC_EDGE) External Interrupt 15 */ +/* -------- EIC_LEVEL : (EIC Offset: 0x01C) Level Register -------- */ +#define EIC_LEVEL_NMI (0x1u << 0) /**< \brief (EIC_LEVEL) External Non Maskable CPU interrupt */ +#define EIC_LEVEL_INT1 (0x1u << 1) /**< \brief (EIC_LEVEL) External Interrupt 1 */ +#define EIC_LEVEL_INT2 (0x1u << 2) /**< \brief (EIC_LEVEL) External Interrupt 2 */ +#define EIC_LEVEL_INT3 (0x1u << 3) /**< \brief (EIC_LEVEL) External Interrupt 3 */ +#define EIC_LEVEL_INT4 (0x1u << 4) /**< \brief (EIC_LEVEL) External Interrupt 4 */ +#define EIC_LEVEL_INT5 (0x1u << 5) /**< \brief (EIC_LEVEL) External Interrupt 5 */ +#define EIC_LEVEL_INT6 (0x1u << 6) /**< \brief (EIC_LEVEL) External Interrupt 6 */ +#define EIC_LEVEL_INT7 (0x1u << 7) /**< \brief (EIC_LEVEL) External Interrupt 7 */ +#define EIC_LEVEL_INT8 (0x1u << 8) /**< \brief (EIC_LEVEL) External Interrupt 8 */ +#define EIC_LEVEL_INT9 (0x1u << 9) /**< \brief (EIC_LEVEL) External Interrupt 9 */ +#define EIC_LEVEL_INT10 (0x1u << 10) /**< \brief (EIC_LEVEL) External Interrupt 10 */ +#define EIC_LEVEL_INT11 (0x1u << 11) /**< \brief (EIC_LEVEL) External Interrupt 11 */ +#define EIC_LEVEL_INT12 (0x1u << 12) /**< \brief (EIC_LEVEL) External Interrupt 12 */ +#define EIC_LEVEL_INT13 (0x1u << 13) /**< \brief (EIC_LEVEL) External Interrupt 13 */ +#define EIC_LEVEL_INT14 (0x1u << 14) /**< \brief (EIC_LEVEL) External Interrupt 14 */ +#define EIC_LEVEL_INT15 (0x1u << 15) /**< \brief (EIC_LEVEL) External Interrupt 15 */ +/* -------- EIC_FILTER : (EIC Offset: 0x020) Filter Register -------- */ +#define EIC_FILTER_NMI (0x1u << 0) /**< \brief (EIC_FILTER) External Non Maskable CPU interrupt */ +#define EIC_FILTER_INT1 (0x1u << 1) /**< \brief (EIC_FILTER) External Interrupt 1 */ +#define EIC_FILTER_INT2 (0x1u << 2) /**< \brief (EIC_FILTER) External Interrupt 2 */ +#define EIC_FILTER_INT3 (0x1u << 3) /**< \brief (EIC_FILTER) External Interrupt 3 */ +#define EIC_FILTER_INT4 (0x1u << 4) /**< \brief (EIC_FILTER) External Interrupt 4 */ +#define EIC_FILTER_INT5 (0x1u << 5) /**< \brief (EIC_FILTER) External Interrupt 5 */ +#define EIC_FILTER_INT6 (0x1u << 6) /**< \brief (EIC_FILTER) External Interrupt 6 */ +#define EIC_FILTER_INT7 (0x1u << 7) /**< \brief (EIC_FILTER) External Interrupt 7 */ +#define EIC_FILTER_INT8 (0x1u << 8) /**< \brief (EIC_FILTER) External Interrupt 8 */ +#define EIC_FILTER_INT9 (0x1u << 9) /**< \brief (EIC_FILTER) External Interrupt 9 */ +#define EIC_FILTER_INT10 (0x1u << 10) /**< \brief (EIC_FILTER) External Interrupt 10 */ +#define EIC_FILTER_INT11 (0x1u << 11) /**< \brief (EIC_FILTER) External Interrupt 11 */ +#define EIC_FILTER_INT12 (0x1u << 12) /**< \brief (EIC_FILTER) External Interrupt 12 */ +#define EIC_FILTER_INT13 (0x1u << 13) /**< \brief (EIC_FILTER) External Interrupt 13 */ +#define EIC_FILTER_INT14 (0x1u << 14) /**< \brief (EIC_FILTER) External Interrupt 14 */ +#define EIC_FILTER_INT15 (0x1u << 15) /**< \brief (EIC_FILTER) External Interrupt 15 */ +/* -------- EIC_ASYNC : (EIC Offset: 0x028) Asynchronous Register -------- */ +#define EIC_ASYNC_NMI (0x1u << 0) /**< \brief (EIC_ASYNC) External Non Maskable CPU interrupt */ +#define EIC_ASYNC_INT1 (0x1u << 1) /**< \brief (EIC_ASYNC) External Interrupt 1 */ +#define EIC_ASYNC_INT2 (0x1u << 2) /**< \brief (EIC_ASYNC) External Interrupt 2 */ +#define EIC_ASYNC_INT3 (0x1u << 3) /**< \brief (EIC_ASYNC) External Interrupt 3 */ +#define EIC_ASYNC_INT4 (0x1u << 4) /**< \brief (EIC_ASYNC) External Interrupt 4 */ +#define EIC_ASYNC_INT5 (0x1u << 5) /**< \brief (EIC_ASYNC) External Interrupt 5 */ +#define EIC_ASYNC_INT6 (0x1u << 6) /**< \brief (EIC_ASYNC) External Interrupt 6 */ +#define EIC_ASYNC_INT7 (0x1u << 7) /**< \brief (EIC_ASYNC) External Interrupt 7 */ +#define EIC_ASYNC_INT8 (0x1u << 8) /**< \brief (EIC_ASYNC) External Interrupt 8 */ +#define EIC_ASYNC_INT9 (0x1u << 9) /**< \brief (EIC_ASYNC) External Interrupt 9 */ +#define EIC_ASYNC_INT10 (0x1u << 10) /**< \brief (EIC_ASYNC) External Interrupt 10 */ +#define EIC_ASYNC_INT11 (0x1u << 11) /**< \brief (EIC_ASYNC) External Interrupt 11 */ +#define EIC_ASYNC_INT12 (0x1u << 12) /**< \brief (EIC_ASYNC) External Interrupt 12 */ +#define EIC_ASYNC_INT13 (0x1u << 13) /**< \brief (EIC_ASYNC) External Interrupt 13 */ +#define EIC_ASYNC_INT14 (0x1u << 14) /**< \brief (EIC_ASYNC) External Interrupt 14 */ +#define EIC_ASYNC_INT15 (0x1u << 15) /**< \brief (EIC_ASYNC) External Interrupt 15 */ +/* -------- EIC_EN : (EIC Offset: 0x030) Enable Register -------- */ +#define EIC_EN_NMI (0x1u << 0) /**< \brief (EIC_EN) External Non Maskable CPU interrupt */ +#define EIC_EN_INT1 (0x1u << 1) /**< \brief (EIC_EN) External Interrupt 1 */ +#define EIC_EN_INT2 (0x1u << 2) /**< \brief (EIC_EN) External Interrupt 2 */ +#define EIC_EN_INT3 (0x1u << 3) /**< \brief (EIC_EN) External Interrupt 3 */ +#define EIC_EN_INT4 (0x1u << 4) /**< \brief (EIC_EN) External Interrupt 4 */ +#define EIC_EN_INT5 (0x1u << 5) /**< \brief (EIC_EN) External Interrupt 5 */ +#define EIC_EN_INT6 (0x1u << 6) /**< \brief (EIC_EN) External Interrupt 6 */ +#define EIC_EN_INT7 (0x1u << 7) /**< \brief (EIC_EN) External Interrupt 7 */ +#define EIC_EN_INT8 (0x1u << 8) /**< \brief (EIC_EN) External Interrupt 8 */ +#define EIC_EN_INT9 (0x1u << 9) /**< \brief (EIC_EN) External Interrupt 9 */ +#define EIC_EN_INT10 (0x1u << 10) /**< \brief (EIC_EN) External Interrupt 10 */ +#define EIC_EN_INT11 (0x1u << 11) /**< \brief (EIC_EN) External Interrupt 11 */ +#define EIC_EN_INT12 (0x1u << 12) /**< \brief (EIC_EN) External Interrupt 12 */ +#define EIC_EN_INT13 (0x1u << 13) /**< \brief (EIC_EN) External Interrupt 13 */ +#define EIC_EN_INT14 (0x1u << 14) /**< \brief (EIC_EN) External Interrupt 14 */ +#define EIC_EN_INT15 (0x1u << 15) /**< \brief (EIC_EN) External Interrupt 15 */ +/* -------- EIC_DIS : (EIC Offset: 0x034) Disable Register -------- */ +#define EIC_DIS_NMI (0x1u << 0) /**< \brief (EIC_DIS) External Non Maskable CPU interrupt */ +#define EIC_DIS_INT1 (0x1u << 1) /**< \brief (EIC_DIS) External Interrupt 1 */ +#define EIC_DIS_INT2 (0x1u << 2) /**< \brief (EIC_DIS) External Interrupt 2 */ +#define EIC_DIS_INT3 (0x1u << 3) /**< \brief (EIC_DIS) External Interrupt 3 */ +#define EIC_DIS_INT4 (0x1u << 4) /**< \brief (EIC_DIS) External Interrupt 4 */ +#define EIC_DIS_INT5 (0x1u << 5) /**< \brief (EIC_DIS) External Interrupt 5 */ +#define EIC_DIS_INT6 (0x1u << 6) /**< \brief (EIC_DIS) External Interrupt 6 */ +#define EIC_DIS_INT7 (0x1u << 7) /**< \brief (EIC_DIS) External Interrupt 7 */ +#define EIC_DIS_INT8 (0x1u << 8) /**< \brief (EIC_DIS) External Interrupt 8 */ +#define EIC_DIS_INT9 (0x1u << 9) /**< \brief (EIC_DIS) External Interrupt 9 */ +#define EIC_DIS_INT10 (0x1u << 10) /**< \brief (EIC_DIS) External Interrupt 10 */ +#define EIC_DIS_INT11 (0x1u << 11) /**< \brief (EIC_DIS) External Interrupt 11 */ +#define EIC_DIS_INT12 (0x1u << 12) /**< \brief (EIC_DIS) External Interrupt 12 */ +#define EIC_DIS_INT13 (0x1u << 13) /**< \brief (EIC_DIS) External Interrupt 13 */ +#define EIC_DIS_INT14 (0x1u << 14) /**< \brief (EIC_DIS) External Interrupt 14 */ +#define EIC_DIS_INT15 (0x1u << 15) /**< \brief (EIC_DIS) External Interrupt 15 */ +/* -------- EIC_CTRL : (EIC Offset: 0x038) Control Register -------- */ +#define EIC_CTRL_NMI (0x1u << 0) /**< \brief (EIC_CTRL) External Non Maskable CPU interrupt */ +#define EIC_CTRL_INT1 (0x1u << 1) /**< \brief (EIC_CTRL) External Interrupt 1 */ +#define EIC_CTRL_INT2 (0x1u << 2) /**< \brief (EIC_CTRL) External Interrupt 2 */ +#define EIC_CTRL_INT3 (0x1u << 3) /**< \brief (EIC_CTRL) External Interrupt 3 */ +#define EIC_CTRL_INT4 (0x1u << 4) /**< \brief (EIC_CTRL) External Interrupt 4 */ +#define EIC_CTRL_INT5 (0x1u << 5) /**< \brief (EIC_CTRL) External Interrupt 5 */ +#define EIC_CTRL_INT6 (0x1u << 6) /**< \brief (EIC_CTRL) External Interrupt 6 */ +#define EIC_CTRL_INT7 (0x1u << 7) /**< \brief (EIC_CTRL) External Interrupt 7 */ +#define EIC_CTRL_INT8 (0x1u << 8) /**< \brief (EIC_CTRL) External Interrupt 8 */ +#define EIC_CTRL_INT9 (0x1u << 9) /**< \brief (EIC_CTRL) External Interrupt 9 */ +#define EIC_CTRL_INT10 (0x1u << 10) /**< \brief (EIC_CTRL) External Interrupt 10 */ +#define EIC_CTRL_INT11 (0x1u << 11) /**< \brief (EIC_CTRL) External Interrupt 11 */ +#define EIC_CTRL_INT12 (0x1u << 12) /**< \brief (EIC_CTRL) External Interrupt 12 */ +#define EIC_CTRL_INT13 (0x1u << 13) /**< \brief (EIC_CTRL) External Interrupt 13 */ +#define EIC_CTRL_INT14 (0x1u << 14) /**< \brief (EIC_CTRL) External Interrupt 14 */ +#define EIC_CTRL_INT15 (0x1u << 15) /**< \brief (EIC_CTRL) External Interrupt 15 */ +/* -------- EIC_VERSION : (EIC Offset: 0x3FC) Version Register -------- */ +#define EIC_VERSION_VERSION_Pos 0 +#define EIC_VERSION_VERSION_Msk (0xFFFu << EIC_VERSION_VERSION_Pos) /**< \brief (EIC_VERSION) Version bits */ +#define EIC_VERSION_VERSION(value) ((EIC_VERSION_VERSION_Msk & ((value) << EIC_VERSION_VERSION_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR FLASHCALW */ +/* ============================================================================= */ +/** \addtogroup SAM4L_FLASHCALW Flash Controller */ +/*@{*/ + +#define REV_FLASHCALW 0x110 + +#ifndef __ASSEMBLY__ +/** \brief FLASHCALW hardware registers */ +typedef struct { + RwReg FLASHCALW_FCR; /**< \brief (FLASHCALW Offset: 0x00) Flash Controller Control Register */ + RwReg FLASHCALW_FCMD; /**< \brief (FLASHCALW Offset: 0x04) Flash Controller Command Register */ + RwReg FLASHCALW_FSR; /**< \brief (FLASHCALW Offset: 0x08) Flash Controller Status Register */ + RoReg FLASHCALW_FPR; /**< \brief (FLASHCALW Offset: 0x0C) Flash Controller Parameter Register */ + RoReg FLASHCALW_VERSION; /**< \brief (FLASHCALW Offset: 0x10) Flash Controller Version Register */ + RwReg FLASHCALW_FGPFRHI; /**< \brief (FLASHCALW Offset: 0x14) Flash Controller General Purpose Fuse Register High */ + RwReg FLASHCALW_FGPFRLO; /**< \brief (FLASHCALW Offset: 0x18) Flash Controller General Purpose Fuse Register Low */ +} Flashcalw; +#endif /* __ASSEMBLY__ */ +/* -------- FLASHCALW_FCR : (FLASHCALW Offset: 0x00) Flash Controller Control Register -------- */ +#define FLASHCALW_FCR_FRDY (0x1u << 0) /**< \brief (FLASHCALW_FCR) Flash Ready Interrupt Enable */ +#define FLASHCALW_FCR_FRDY_0 (0x0u << 0) /**< \brief (FLASHCALW_FCR) Flash Ready does not generate an interrupt */ +#define FLASHCALW_FCR_FRDY_1 (0x1u << 0) /**< \brief (FLASHCALW_FCR) Flash Ready generates an interrupt */ +#define FLASHCALW_FCR_LOCKE (0x1u << 2) /**< \brief (FLASHCALW_FCR) Lock Error Interrupt Enable */ +#define FLASHCALW_FCR_LOCKE_0 (0x0u << 2) /**< \brief (FLASHCALW_FCR) Lock Error does not generate an interrupt */ +#define FLASHCALW_FCR_LOCKE_1 (0x1u << 2) /**< \brief (FLASHCALW_FCR) Lock Error generates an interrupt */ +#define FLASHCALW_FCR_PROGE (0x1u << 3) /**< \brief (FLASHCALW_FCR) Programming Error Interrupt Enable */ +#define FLASHCALW_FCR_PROGE_0 (0x0u << 3) /**< \brief (FLASHCALW_FCR) Programming Error does not generate an interrupt */ +#define FLASHCALW_FCR_PROGE_1 (0x1u << 3) /**< \brief (FLASHCALW_FCR) Programming Error generates an interrupt */ +#define FLASHCALW_FCR_FWS (0x1u << 6) /**< \brief (FLASHCALW_FCR) Flash Wait State */ +#define FLASHCALW_FCR_FWS_0 (0x0u << 6) /**< \brief (FLASHCALW_FCR) The flash is read with 0 wait states */ +#define FLASHCALW_FCR_FWS_1 (0x1u << 6) /**< \brief (FLASHCALW_FCR) The flash is read with 1 wait states */ +#define FLASHCALW_FCR_WS1OPT (0x1u << 7) /**< \brief (FLASHCALW_FCR) Wait State 1 Optimization */ +/* -------- FLASHCALW_FCMD : (FLASHCALW Offset: 0x04) Flash Controller Command Register -------- */ +#define FLASHCALW_FCMD_CMD_Pos 0 +#define FLASHCALW_FCMD_CMD_Msk (0x3Fu << FLASHCALW_FCMD_CMD_Pos) /**< \brief (FLASHCALW_FCMD) Command */ +#define FLASHCALW_FCMD_CMD(value) ((FLASHCALW_FCMD_CMD_Msk & ((value) << FLASHCALW_FCMD_CMD_Pos))) +#define FLASHCALW_FCMD_CMD_NOP (0x0u << 0) /**< \brief (FLASHCALW_FCMD) No Operation */ +#define FLASHCALW_FCMD_CMD_WP (0x1u << 0) /**< \brief (FLASHCALW_FCMD) Write Page */ +#define FLASHCALW_FCMD_CMD_EP (0x2u << 0) /**< \brief (FLASHCALW_FCMD) Erase Page */ +#define FLASHCALW_FCMD_CMD_CPB (0x3u << 0) /**< \brief (FLASHCALW_FCMD) Clear Page Buffer */ +#define FLASHCALW_FCMD_CMD_LP (0x4u << 0) /**< \brief (FLASHCALW_FCMD) Lock Region containing page */ +#define FLASHCALW_FCMD_CMD_UP (0x5u << 0) /**< \brief (FLASHCALW_FCMD) Unlock Region containing page */ +#define FLASHCALW_FCMD_CMD_EA (0x6u << 0) /**< \brief (FLASHCALW_FCMD) Erase All, including secuity and fuse bits */ +#define FLASHCALW_FCMD_CMD_WGPB (0x7u << 0) /**< \brief (FLASHCALW_FCMD) Write General-Purpose fuse Bit */ +#define FLASHCALW_FCMD_CMD_EGPB (0x8u << 0) /**< \brief (FLASHCALW_FCMD) Erase General-Purpose fuse Bit */ +#define FLASHCALW_FCMD_CMD_SSB (0x9u << 0) /**< \brief (FLASHCALW_FCMD) Set Security Bit */ +#define FLASHCALW_FCMD_CMD_PGPFB (0xAu << 0) /**< \brief (FLASHCALW_FCMD) Program GPFuse Byte */ +#define FLASHCALW_FCMD_CMD_EAGPF (0xBu << 0) /**< \brief (FLASHCALW_FCMD) Erase All GP Fuses */ +#define FLASHCALW_FCMD_CMD_QPR (0xCu << 0) /**< \brief (FLASHCALW_FCMD) Quick Page Read */ +#define FLASHCALW_FCMD_CMD_WUP (0xDu << 0) /**< \brief (FLASHCALW_FCMD) Write User Page */ +#define FLASHCALW_FCMD_CMD_EUP (0xEu << 0) /**< \brief (FLASHCALW_FCMD) Erase User Page */ +#define FLASHCALW_FCMD_CMD_QPRUP (0xFu << 0) /**< \brief (FLASHCALW_FCMD) Quick Page Read User Page */ +#define FLASHCALW_FCMD_PAGEN_Pos 8 +#define FLASHCALW_FCMD_PAGEN_Msk (0xFFFFu << FLASHCALW_FCMD_PAGEN_Pos) /**< \brief (FLASHCALW_FCMD) Page number */ +#define FLASHCALW_FCMD_PAGEN(value) ((FLASHCALW_FCMD_PAGEN_Msk & ((value) << FLASHCALW_FCMD_PAGEN_Pos))) +#define FLASHCALW_FCMD_KEY_Pos 24 +#define FLASHCALW_FCMD_KEY_Msk (0xFFu << FLASHCALW_FCMD_KEY_Pos) /**< \brief (FLASHCALW_FCMD) Write protection key */ +#define FLASHCALW_FCMD_KEY(value) ((FLASHCALW_FCMD_KEY_Msk & ((value) << FLASHCALW_FCMD_KEY_Pos))) +#define FLASHCALW_FCMD_KEY_KEY (0xA5u << 24) /**< \brief (FLASHCALW_FCMD) */ +/* -------- FLASHCALW_FSR : (FLASHCALW Offset: 0x08) Flash Controller Status Register -------- */ +#define FLASHCALW_FSR_FRDY (0x1u << 0) /**< \brief (FLASHCALW_FSR) Flash Ready Status */ +#define FLASHCALW_FSR_LOCKE (0x1u << 2) /**< \brief (FLASHCALW_FSR) Lock Error Status */ +#define FLASHCALW_FSR_PROGE (0x1u << 3) /**< \brief (FLASHCALW_FSR) Programming Error Status */ +#define FLASHCALW_FSR_SECURITY (0x1u << 4) /**< \brief (FLASHCALW_FSR) Security Bit Status */ +#define FLASHCALW_FSR_QPRR (0x1u << 5) /**< \brief (FLASHCALW_FSR) Quick Page Read Result */ +#define FLASHCALW_FSR_HSMODE (0x1u << 6) /**< \brief (FLASHCALW_FSR) High Speed Mode */ +#define FLASHCALW_FSR_ECCERR_Pos 8 +#define FLASHCALW_FSR_ECCERR_Msk (0x3u << FLASHCALW_FSR_ECCERR_Pos) /**< \brief (FLASHCALW_FSR) ECC Error Status */ +#define FLASHCALW_FSR_ECCERR(value) ((FLASHCALW_FSR_ECCERR_Msk & ((value) << FLASHCALW_FSR_ECCERR_Pos))) +#define FLASHCALW_FSR_ECCERR_NOERROR (0x0u << 8) /**< \brief (FLASHCALW_FSR) no error */ +#define FLASHCALW_FSR_ECCERR_ONEECCERR (0x1u << 8) /**< \brief (FLASHCALW_FSR) one ECC error detected */ +#define FLASHCALW_FSR_ECCERR_TWOECCERR (0x2u << 8) /**< \brief (FLASHCALW_FSR) two ECC errors detected */ +#define FLASHCALW_FSR_LOCK0 (0x1u << 16) /**< \brief (FLASHCALW_FSR) Lock Region 0 Lock Status */ +#define FLASHCALW_FSR_LOCK1 (0x1u << 17) /**< \brief (FLASHCALW_FSR) Lock Region 1 Lock Status */ +#define FLASHCALW_FSR_LOCK2 (0x1u << 18) /**< \brief (FLASHCALW_FSR) Lock Region 2 Lock Status */ +#define FLASHCALW_FSR_LOCK3 (0x1u << 19) /**< \brief (FLASHCALW_FSR) Lock Region 3 Lock Status */ +#define FLASHCALW_FSR_LOCK4 (0x1u << 20) /**< \brief (FLASHCALW_FSR) Lock Region 4 Lock Status */ +#define FLASHCALW_FSR_LOCK5 (0x1u << 21) /**< \brief (FLASHCALW_FSR) Lock Region 5 Lock Status */ +#define FLASHCALW_FSR_LOCK6 (0x1u << 22) /**< \brief (FLASHCALW_FSR) Lock Region 6 Lock Status */ +#define FLASHCALW_FSR_LOCK7 (0x1u << 23) /**< \brief (FLASHCALW_FSR) Lock Region 7 Lock Status */ +#define FLASHCALW_FSR_LOCK8 (0x1u << 24) /**< \brief (FLASHCALW_FSR) Lock Region 8 Lock Status */ +#define FLASHCALW_FSR_LOCK9 (0x1u << 25) /**< \brief (FLASHCALW_FSR) Lock Region 9 Lock Status */ +#define FLASHCALW_FSR_LOCK10 (0x1u << 26) /**< \brief (FLASHCALW_FSR) Lock Region 10 Lock Status */ +#define FLASHCALW_FSR_LOCK11 (0x1u << 27) /**< \brief (FLASHCALW_FSR) Lock Region 11 Lock Status */ +#define FLASHCALW_FSR_LOCK12 (0x1u << 28) /**< \brief (FLASHCALW_FSR) Lock Region 12 Lock Status */ +#define FLASHCALW_FSR_LOCK13 (0x1u << 29) /**< \brief (FLASHCALW_FSR) Lock Region 13 Lock Status */ +#define FLASHCALW_FSR_LOCK14 (0x1u << 30) /**< \brief (FLASHCALW_FSR) Lock Region 14 Lock Status */ +#define FLASHCALW_FSR_LOCK15 (0x1u << 31) /**< \brief (FLASHCALW_FSR) Lock Region 15 Lock Status */ +/* -------- FLASHCALW_FPR : (FLASHCALW Offset: 0x0C) Flash Controller Parameter Register -------- */ +#define FLASHCALW_FPR_FSZ_Pos 0 +#define FLASHCALW_FPR_FSZ_Msk (0xFu << FLASHCALW_FPR_FSZ_Pos) /**< \brief (FLASHCALW_FPR) Flash Size */ +#define FLASHCALW_FPR_FSZ(value) ((FLASHCALW_FPR_FSZ_Msk & ((value) << FLASHCALW_FPR_FSZ_Pos))) +#define FLASHCALW_FPR_PSZ_Pos 8 +#define FLASHCALW_FPR_PSZ_Msk (0x7u << FLASHCALW_FPR_PSZ_Pos) /**< \brief (FLASHCALW_FPR) Page Size */ +#define FLASHCALW_FPR_PSZ(value) ((FLASHCALW_FPR_PSZ_Msk & ((value) << FLASHCALW_FPR_PSZ_Pos))) +/* -------- FLASHCALW_VERSION : (FLASHCALW Offset: 0x10) Flash Controller Version Register -------- */ +#define FLASHCALW_VERSION_VERSION_Pos 0 +#define FLASHCALW_VERSION_VERSION_Msk (0xFFFu << FLASHCALW_VERSION_VERSION_Pos) /**< \brief (FLASHCALW_VERSION) Version Number */ +#define FLASHCALW_VERSION_VERSION(value) ((FLASHCALW_VERSION_VERSION_Msk & ((value) << FLASHCALW_VERSION_VERSION_Pos))) +#define FLASHCALW_VERSION_VARIANT_Pos 16 +#define FLASHCALW_VERSION_VARIANT_Msk (0xFu << FLASHCALW_VERSION_VARIANT_Pos) /**< \brief (FLASHCALW_VERSION) Variant Number */ +#define FLASHCALW_VERSION_VARIANT(value) ((FLASHCALW_VERSION_VARIANT_Msk & ((value) << FLASHCALW_VERSION_VARIANT_Pos))) +/* -------- FLASHCALW_FGPFRHI : (FLASHCALW Offset: 0x14) Flash Controller General Purpose Fuse Register High -------- */ +#define FLASHCALW_FGPFRHI_GPF32 (0x1u << 0) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 32 */ +#define FLASHCALW_FGPFRHI_GPF33 (0x1u << 1) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 33 */ +#define FLASHCALW_FGPFRHI_GPF34 (0x1u << 2) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 34 */ +#define FLASHCALW_FGPFRHI_GPF35 (0x1u << 3) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 35 */ +#define FLASHCALW_FGPFRHI_GPF36 (0x1u << 4) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 36 */ +#define FLASHCALW_FGPFRHI_GPF37 (0x1u << 5) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 37 */ +#define FLASHCALW_FGPFRHI_GPF38 (0x1u << 6) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 38 */ +#define FLASHCALW_FGPFRHI_GPF39 (0x1u << 7) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 39 */ +#define FLASHCALW_FGPFRHI_GPF40 (0x1u << 8) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 40 */ +#define FLASHCALW_FGPFRHI_GPF41 (0x1u << 9) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 41 */ +#define FLASHCALW_FGPFRHI_GPF42 (0x1u << 10) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 42 */ +#define FLASHCALW_FGPFRHI_GPF43 (0x1u << 11) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 43 */ +#define FLASHCALW_FGPFRHI_GPF44 (0x1u << 12) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 44 */ +#define FLASHCALW_FGPFRHI_GPF45 (0x1u << 13) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 45 */ +#define FLASHCALW_FGPFRHI_GPF46 (0x1u << 14) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 46 */ +#define FLASHCALW_FGPFRHI_GPF47 (0x1u << 15) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 47 */ +#define FLASHCALW_FGPFRHI_GPF48 (0x1u << 16) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 48 */ +#define FLASHCALW_FGPFRHI_GPF49 (0x1u << 17) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 49 */ +#define FLASHCALW_FGPFRHI_GPF50 (0x1u << 18) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 50 */ +#define FLASHCALW_FGPFRHI_GPF51 (0x1u << 19) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 51 */ +#define FLASHCALW_FGPFRHI_GPF52 (0x1u << 20) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 52 */ +#define FLASHCALW_FGPFRHI_GPF53 (0x1u << 21) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 53 */ +#define FLASHCALW_FGPFRHI_GPF54 (0x1u << 22) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 54 */ +#define FLASHCALW_FGPFRHI_GPF55 (0x1u << 23) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 55 */ +#define FLASHCALW_FGPFRHI_GPF56 (0x1u << 24) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 56 */ +#define FLASHCALW_FGPFRHI_GPF57 (0x1u << 25) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 57 */ +#define FLASHCALW_FGPFRHI_GPF58 (0x1u << 26) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 58 */ +#define FLASHCALW_FGPFRHI_GPF59 (0x1u << 27) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 59 */ +#define FLASHCALW_FGPFRHI_GPF60 (0x1u << 28) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 60 */ +#define FLASHCALW_FGPFRHI_GPF61 (0x1u << 29) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 61 */ +#define FLASHCALW_FGPFRHI_GPF62 (0x1u << 30) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 62 */ +#define FLASHCALW_FGPFRHI_GPF63 (0x1u << 31) /**< \brief (FLASHCALW_FGPFRHI) General Purpose Fuse 63 */ +/* -------- FLASHCALW_FGPFRLO : (FLASHCALW Offset: 0x18) Flash Controller General Purpose Fuse Register Low -------- */ +#define FLASHCALW_FGPFRLO_LOCK0 (0x1u << 0) /**< \brief (FLASHCALW_FGPFRLO) Lock Bit 0 */ +#define FLASHCALW_FGPFRLO_LOCK1 (0x1u << 1) /**< \brief (FLASHCALW_FGPFRLO) Lock Bit 1 */ +#define FLASHCALW_FGPFRLO_LOCK2 (0x1u << 2) /**< \brief (FLASHCALW_FGPFRLO) Lock Bit 2 */ +#define FLASHCALW_FGPFRLO_LOCK3 (0x1u << 3) /**< \brief (FLASHCALW_FGPFRLO) Lock Bit 3 */ +#define FLASHCALW_FGPFRLO_LOCK4 (0x1u << 4) /**< \brief (FLASHCALW_FGPFRLO) Lock Bit 4 */ +#define FLASHCALW_FGPFRLO_LOCK5 (0x1u << 5) /**< \brief (FLASHCALW_FGPFRLO) Lock Bit 5 */ +#define FLASHCALW_FGPFRLO_LOCK6 (0x1u << 6) /**< \brief (FLASHCALW_FGPFRLO) Lock Bit 6 */ +#define FLASHCALW_FGPFRLO_LOCK7 (0x1u << 7) /**< \brief (FLASHCALW_FGPFRLO) Lock Bit 7 */ +#define FLASHCALW_FGPFRLO_LOCK8 (0x1u << 8) /**< \brief (FLASHCALW_FGPFRLO) Lock Bit 8 */ +#define FLASHCALW_FGPFRLO_LOCK9 (0x1u << 9) /**< \brief (FLASHCALW_FGPFRLO) Lock Bit 9 */ +#define FLASHCALW_FGPFRLO_LOCK10 (0x1u << 10) /**< \brief (FLASHCALW_FGPFRLO) Lock Bit 10 */ +#define FLASHCALW_FGPFRLO_LOCK11 (0x1u << 11) /**< \brief (FLASHCALW_FGPFRLO) Lock Bit 11 */ +#define FLASHCALW_FGPFRLO_LOCK12 (0x1u << 12) /**< \brief (FLASHCALW_FGPFRLO) Lock Bit 12 */ +#define FLASHCALW_FGPFRLO_LOCK13 (0x1u << 13) /**< \brief (FLASHCALW_FGPFRLO) Lock Bit 13 */ +#define FLASHCALW_FGPFRLO_LOCK14 (0x1u << 14) /**< \brief (FLASHCALW_FGPFRLO) Lock Bit 14 */ +#define FLASHCALW_FGPFRLO_LOCK15 (0x1u << 15) /**< \brief (FLASHCALW_FGPFRLO) Lock Bit 15 */ +#define FLASHCALW_FGPFRLO_GPF16 (0x1u << 16) /**< \brief (FLASHCALW_FGPFRLO) General Purpose Fuse 16 */ +#define FLASHCALW_FGPFRLO_GPF17 (0x1u << 17) /**< \brief (FLASHCALW_FGPFRLO) General Purpose Fuse 17 */ +#define FLASHCALW_FGPFRLO_GPF18 (0x1u << 18) /**< \brief (FLASHCALW_FGPFRLO) General Purpose Fuse 18 */ +#define FLASHCALW_FGPFRLO_GPF19 (0x1u << 19) /**< \brief (FLASHCALW_FGPFRLO) General Purpose Fuse 19 */ +#define FLASHCALW_FGPFRLO_GPF20 (0x1u << 20) /**< \brief (FLASHCALW_FGPFRLO) General Purpose Fuse 20 */ +#define FLASHCALW_FGPFRLO_GPF21 (0x1u << 21) /**< \brief (FLASHCALW_FGPFRLO) General Purpose Fuse 21 */ +#define FLASHCALW_FGPFRLO_GPF22 (0x1u << 22) /**< \brief (FLASHCALW_FGPFRLO) General Purpose Fuse 22 */ +#define FLASHCALW_FGPFRLO_GPF23 (0x1u << 23) /**< \brief (FLASHCALW_FGPFRLO) General Purpose Fuse 23 */ +#define FLASHCALW_FGPFRLO_GPF24 (0x1u << 24) /**< \brief (FLASHCALW_FGPFRLO) General Purpose Fuse 24 */ +#define FLASHCALW_FGPFRLO_GPF25 (0x1u << 25) /**< \brief (FLASHCALW_FGPFRLO) General Purpose Fuse 25 */ +#define FLASHCALW_FGPFRLO_GPF26 (0x1u << 26) /**< \brief (FLASHCALW_FGPFRLO) General Purpose Fuse 26 */ +#define FLASHCALW_FGPFRLO_GPF27 (0x1u << 27) /**< \brief (FLASHCALW_FGPFRLO) General Purpose Fuse 27 */ +#define FLASHCALW_FGPFRLO_GPF28 (0x1u << 28) /**< \brief (FLASHCALW_FGPFRLO) General Purpose Fuse 28 */ +#define FLASHCALW_FGPFRLO_GPF29 (0x1u << 29) /**< \brief (FLASHCALW_FGPFRLO) General Purpose Fuse 29 */ +#define FLASHCALW_FGPFRLO_GPF30 (0x1u << 30) /**< \brief (FLASHCALW_FGPFRLO) General Purpose Fuse 30 */ +#define FLASHCALW_FGPFRLO_GPF31 (0x1u << 31) /**< \brief (FLASHCALW_FGPFRLO) General Purpose Fuse 31 */ + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR FREQM */ +/* ============================================================================= */ +/** \addtogroup SAM4L_FREQM Frequency Meter */ +/*@{*/ + +#define REV_FREQM 0x311 + +#ifndef __ASSEMBLY__ +/** \brief FREQM hardware registers */ +typedef struct { + WoReg FREQM_CTRL; /**< \brief (FREQM Offset: 0x000) Control register */ + RwReg FREQM_MODE; /**< \brief (FREQM Offset: 0x004) Mode register */ + RoReg FREQM_STATUS; /**< \brief (FREQM Offset: 0x008) Status register */ + RoReg FREQM_VALUE; /**< \brief (FREQM Offset: 0x00C) Value register */ + WoReg FREQM_IER; /**< \brief (FREQM Offset: 0x010) Interrupt Enable Register */ + WoReg FREQM_IDR; /**< \brief (FREQM Offset: 0x014) Interrupt Diable Register */ + RoReg FREQM_IMR; /**< \brief (FREQM Offset: 0x018) Interrupt Mask Register */ + RoReg FREQM_ISR; /**< \brief (FREQM Offset: 0x01C) Interrupt Status Register */ + WoReg FREQM_ICR; /**< \brief (FREQM Offset: 0x020) Interrupt Clear Register */ + RoReg Reserved1[246]; + RoReg FREQM_VERSION; /**< \brief (FREQM Offset: 0x3FC) Version Register */ +} Freqm; +#endif /* __ASSEMBLY__ */ +/* -------- FREQM_CTRL : (FREQM Offset: 0x000) Control register -------- */ +#define FREQM_CTRL_START (0x1u << 0) /**< \brief (FREQM_CTRL) Start frequency measurement */ +/* -------- FREQM_MODE : (FREQM Offset: 0x004) Mode register -------- */ +#define FREQM_MODE_REFSEL_Pos 0 +#define FREQM_MODE_REFSEL_Msk (0x3u << FREQM_MODE_REFSEL_Pos) /**< \brief (FREQM_MODE) Reference Clock Selection */ +#define FREQM_MODE_REFSEL(value) ((FREQM_MODE_REFSEL_Msk & ((value) << FREQM_MODE_REFSEL_Pos))) +#define FREQM_MODE_REFNUM_Pos 8 +#define FREQM_MODE_REFNUM_Msk (0xFFu << FREQM_MODE_REFNUM_Pos) /**< \brief (FREQM_MODE) Number of Reference CLock Cycles */ +#define FREQM_MODE_REFNUM(value) ((FREQM_MODE_REFNUM_Msk & ((value) << FREQM_MODE_REFNUM_Pos))) +#define FREQM_MODE_CLKSEL_Pos 16 +#define FREQM_MODE_CLKSEL_Msk (0x1Fu << FREQM_MODE_CLKSEL_Pos) /**< \brief (FREQM_MODE) Clock Source Selection */ +#define FREQM_MODE_CLKSEL(value) ((FREQM_MODE_CLKSEL_Msk & ((value) << FREQM_MODE_CLKSEL_Pos))) +#define FREQM_MODE_REFCEN (0x1u << 31) /**< \brief (FREQM_MODE) Reference Clock Enable */ +/* -------- FREQM_STATUS : (FREQM Offset: 0x008) Status register -------- */ +#define FREQM_STATUS_BUSY (0x1u << 0) /**< \brief (FREQM_STATUS) Frequency measurement on-going */ +#define FREQM_STATUS_RCLKBUSY (0x1u << 1) /**< \brief (FREQM_STATUS) Reference Clock busy */ +/* -------- FREQM_VALUE : (FREQM Offset: 0x00C) Value register -------- */ +#define FREQM_VALUE_VALUE_Pos 0 +#define FREQM_VALUE_VALUE_Msk (0xFFFFFFu << FREQM_VALUE_VALUE_Pos) /**< \brief (FREQM_VALUE) Measured frequency */ +#define FREQM_VALUE_VALUE(value) ((FREQM_VALUE_VALUE_Msk & ((value) << FREQM_VALUE_VALUE_Pos))) +/* -------- FREQM_IER : (FREQM Offset: 0x010) Interrupt Enable Register -------- */ +#define FREQM_IER_DONE (0x1u << 0) /**< \brief (FREQM_IER) Frequency measurment done */ +#define FREQM_IER_RCLKRDY (0x1u << 1) /**< \brief (FREQM_IER) Reference Clock ready */ +/* -------- FREQM_IDR : (FREQM Offset: 0x014) Interrupt Diable Register -------- */ +#define FREQM_IDR_DONE (0x1u << 0) /**< \brief (FREQM_IDR) Frequency measurment done */ +#define FREQM_IDR_RCLKRDY (0x1u << 1) /**< \brief (FREQM_IDR) Reference Clock ready */ +/* -------- FREQM_IMR : (FREQM Offset: 0x018) Interrupt Mask Register -------- */ +#define FREQM_IMR_DONE (0x1u << 0) /**< \brief (FREQM_IMR) Frequency measurment done */ +#define FREQM_IMR_RCLKRDY (0x1u << 1) /**< \brief (FREQM_IMR) Reference Clock ready */ +/* -------- FREQM_ISR : (FREQM Offset: 0x01C) Interrupt Status Register -------- */ +#define FREQM_ISR_DONE (0x1u << 0) /**< \brief (FREQM_ISR) Frequency measurment done */ +#define FREQM_ISR_RCLKRDY (0x1u << 1) /**< \brief (FREQM_ISR) Reference Clock ready */ +/* -------- FREQM_ICR : (FREQM Offset: 0x020) Interrupt Clear Register -------- */ +#define FREQM_ICR_DONE (0x1u << 0) /**< \brief (FREQM_ICR) Frequency measurment done */ +#define FREQM_ICR_RCLKRDY (0x1u << 1) /**< \brief (FREQM_ICR) Reference Clock ready */ +/* -------- FREQM_VERSION : (FREQM Offset: 0x3FC) Version Register -------- */ +#define FREQM_VERSION_VERSION_Pos 0 +#define FREQM_VERSION_VERSION_Msk (0xFFFu << FREQM_VERSION_VERSION_Pos) /**< \brief (FREQM_VERSION) Version number */ +#define FREQM_VERSION_VERSION(value) ((FREQM_VERSION_VERSION_Msk & ((value) << FREQM_VERSION_VERSION_Pos))) +#define FREQM_VERSION_VARIANT_Pos 16 +#define FREQM_VERSION_VARIANT_Msk (0xFu << FREQM_VERSION_VARIANT_Pos) /**< \brief (FREQM_VERSION) Variant number */ +#define FREQM_VERSION_VARIANT(value) ((FREQM_VERSION_VARIANT_Msk & ((value) << FREQM_VERSION_VARIANT_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR GLOC */ +/* ============================================================================= */ +/** \addtogroup SAM4L_GLOC Glue Logic Controller */ +/*@{*/ + +#define REV_GLOC 0x102 + +#ifndef __ASSEMBLY__ +/** \brief GlocLut hardware registers */ +typedef struct { + RwReg GLOC_CR; /**< \brief (GlocLut Offset: 0x00) Control Register */ + RwReg GLOC_TRUTH; /**< \brief (GlocLut Offset: 0x04) Truth Register */ +} GlocLut; +/** \brief GLOC hardware registers */ +#define GLOC_LUTS 2 +typedef struct { + GlocLut GLOC_LUT[GLOC_LUTS]; /**< \brief (GLOC Offset: 0x00) GlocLut groups */ + GlocLut Reserved1[7 - GLOC_LUTS]; + RoReg GLOC_PARAMETER; /**< \brief (GLOC Offset: 0x38) Parameter Register */ + RoReg GLOC_VERSION; /**< \brief (GLOC Offset: 0x3C) Version Register */ +} Gloc; +#endif /* __ASSEMBLY__ */ +/* -------- GLOC_CR : (GLOC Offset: 0x00) Lut Control Register -------- */ +#define GLOC_CR_AEN_Pos 0 +#define GLOC_CR_AEN_Msk (0xFu << GLOC_CR_AEN_Pos) /**< \brief (GLOC_CR) Input mask */ +#define GLOC_CR_AEN(value) ((GLOC_CR_AEN_Msk & ((value) << GLOC_CR_AEN_Pos))) +#define GLOC_CR_FILTEN (0x1u << 31) /**< \brief (GLOC_CR) Filter enable */ +/* -------- GLOC_TRUTH : (GLOC Offset: 0x04) Lut Truth Register -------- */ +#define GLOC_TRUTH_TRUTH_Pos 0 +#define GLOC_TRUTH_TRUTH_Msk (0xFFFFu << GLOC_TRUTH_TRUTH_Pos) /**< \brief (GLOC_TRUTH) Truth */ +#define GLOC_TRUTH_TRUTH(value) ((GLOC_TRUTH_TRUTH_Msk & ((value) << GLOC_TRUTH_TRUTH_Pos))) +/* -------- GLOC_PARAMETER : (GLOC Offset: 0x38) Parameter Register -------- */ +#define GLOC_PARAMETER_LUTS_Pos 0 +#define GLOC_PARAMETER_LUTS_Msk (0xFFu << GLOC_PARAMETER_LUTS_Pos) /**< \brief (GLOC_PARAMETER) LUTs */ +#define GLOC_PARAMETER_LUTS(value) ((GLOC_PARAMETER_LUTS_Msk & ((value) << GLOC_PARAMETER_LUTS_Pos))) +/* -------- GLOC_VERSION : (GLOC Offset: 0x3C) Version Register -------- */ +#define GLOC_VERSION_VERSION_Pos 0 +#define GLOC_VERSION_VERSION_Msk (0xFFFu << GLOC_VERSION_VERSION_Pos) /**< \brief (GLOC_VERSION) Version */ +#define GLOC_VERSION_VERSION(value) ((GLOC_VERSION_VERSION_Msk & ((value) << GLOC_VERSION_VERSION_Pos))) +#define GLOC_VERSION_VARIANT_Pos 16 +#define GLOC_VERSION_VARIANT_Msk (0xFu << GLOC_VERSION_VARIANT_Pos) /**< \brief (GLOC_VERSION) Variant */ +#define GLOC_VERSION_VARIANT(value) ((GLOC_VERSION_VARIANT_Msk & ((value) << GLOC_VERSION_VARIANT_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR GPIO */ +/* ============================================================================= */ +/** \addtogroup SAM4L_GPIO General-Purpose Input/Output Controller */ +/*@{*/ + +#define REV_GPIO 0x215 + +#ifndef __ASSEMBLY__ +/** \brief GpioPort hardware registers */ +typedef struct { + RwReg GPIO_GPER; /**< \brief (GpioPort Offset: 0x000) GPIO Enable Register */ + WoReg GPIO_GPERS; /**< \brief (GpioPort Offset: 0x004) GPIO Enable Register - Set */ + WoReg GPIO_GPERC; /**< \brief (GpioPort Offset: 0x008) GPIO Enable Register - Clear */ + WoReg GPIO_GPERT; /**< \brief (GpioPort Offset: 0x00C) GPIO Enable Register - Toggle */ + RwReg GPIO_PMR0; /**< \brief (GpioPort Offset: 0x010) Peripheral Mux Register 0 */ + WoReg GPIO_PMR0S; /**< \brief (GpioPort Offset: 0x014) Peripheral Mux Register 0 - Set */ + WoReg GPIO_PMR0C; /**< \brief (GpioPort Offset: 0x018) Peripheral Mux Register 0 - Clear */ + WoReg GPIO_PMR0T; /**< \brief (GpioPort Offset: 0x01C) Peripheral Mux Register 0 - Toggle */ + RwReg GPIO_PMR1; /**< \brief (GpioPort Offset: 0x020) Peripheral Mux Register 1 */ + WoReg GPIO_PMR1S; /**< \brief (GpioPort Offset: 0x024) Peripheral Mux Register 1 - Set */ + WoReg GPIO_PMR1C; /**< \brief (GpioPort Offset: 0x028) Peripheral Mux Register 1 - Clear */ + WoReg GPIO_PMR1T; /**< \brief (GpioPort Offset: 0x02C) Peripheral Mux Register 1 - Toggle */ + RwReg GPIO_PMR2; /**< \brief (GpioPort Offset: 0x030) Peripheral Mux Register 2 */ + WoReg GPIO_PMR2S; /**< \brief (GpioPort Offset: 0x034) Peripheral Mux Register 2 - Set */ + WoReg GPIO_PMR2C; /**< \brief (GpioPort Offset: 0x038) Peripheral Mux Register 2 - Clear */ + WoReg GPIO_PMR2T; /**< \brief (GpioPort Offset: 0x03C) Peripheral Mux Register 2 - Toggle */ + RwReg GPIO_ODER; /**< \brief (GpioPort Offset: 0x040) Output Driver Enable Register */ + WoReg GPIO_ODERS; /**< \brief (GpioPort Offset: 0x044) Output Driver Enable Register - Set */ + WoReg GPIO_ODERC; /**< \brief (GpioPort Offset: 0x048) Output Driver Enable Register - Clear */ + WoReg GPIO_ODERT; /**< \brief (GpioPort Offset: 0x04C) Output Driver Enable Register - Toggle */ + RwReg GPIO_OVR; /**< \brief (GpioPort Offset: 0x050) Output Value Register */ + WoReg GPIO_OVRS; /**< \brief (GpioPort Offset: 0x054) Output Value Register - Set */ + WoReg GPIO_OVRC; /**< \brief (GpioPort Offset: 0x058) Output Value Register - Clear */ + WoReg GPIO_OVRT; /**< \brief (GpioPort Offset: 0x05C) Output Value Register - Toggle */ + RoReg GPIO_PVR; /**< \brief (GpioPort Offset: 0x060) Pin Value Register */ + RoReg Reserved1[3]; + RwReg GPIO_PUER; /**< \brief (GpioPort Offset: 0x070) Pull-up Enable Register */ + WoReg GPIO_PUERS; /**< \brief (GpioPort Offset: 0x074) Pull-up Enable Register - Set */ + WoReg GPIO_PUERC; /**< \brief (GpioPort Offset: 0x078) Pull-up Enable Register - Clear */ + WoReg GPIO_PUERT; /**< \brief (GpioPort Offset: 0x07C) Pull-up Enable Register - Toggle */ + RwReg GPIO_PDER; /**< \brief (GpioPort Offset: 0x080) Pull-down Enable Register */ + WoReg GPIO_PDERS; /**< \brief (GpioPort Offset: 0x084) Pull-down Enable Register - Set */ + WoReg GPIO_PDERC; /**< \brief (GpioPort Offset: 0x088) Pull-down Enable Register - Clear */ + WoReg GPIO_PDERT; /**< \brief (GpioPort Offset: 0x08C) Pull-down Enable Register - Toggle */ + RwReg GPIO_IER; /**< \brief (GpioPort Offset: 0x090) Interrupt Enable Register */ + WoReg GPIO_IERS; /**< \brief (GpioPort Offset: 0x094) Interrupt Enable Register - Set */ + WoReg GPIO_IERC; /**< \brief (GpioPort Offset: 0x098) Interrupt Enable Register - Clear */ + WoReg GPIO_IERT; /**< \brief (GpioPort Offset: 0x09C) Interrupt Enable Register - Toggle */ + RwReg GPIO_IMR0; /**< \brief (GpioPort Offset: 0x0A0) Interrupt Mode Register 0 */ + WoReg GPIO_IMR0S; /**< \brief (GpioPort Offset: 0x0A4) Interrupt Mode Register 0 - Set */ + WoReg GPIO_IMR0C; /**< \brief (GpioPort Offset: 0x0A8) Interrupt Mode Register 0 - Clear */ + WoReg GPIO_IMR0T; /**< \brief (GpioPort Offset: 0x0AC) Interrupt Mode Register 0 - Toggle */ + RwReg GPIO_IMR1; /**< \brief (GpioPort Offset: 0x0B0) Interrupt Mode Register 1 */ + WoReg GPIO_IMR1S; /**< \brief (GpioPort Offset: 0x0B4) Interrupt Mode Register 1 - Set */ + WoReg GPIO_IMR1C; /**< \brief (GpioPort Offset: 0x0B8) Interrupt Mode Register 1 - Clear */ + WoReg GPIO_IMR1T; /**< \brief (GpioPort Offset: 0x0BC) Interrupt Mode Register 1 - Toggle */ + RwReg GPIO_GFER; /**< \brief (GpioPort Offset: 0x0C0) Glitch Filter Enable Register */ + WoReg GPIO_GFERS; /**< \brief (GpioPort Offset: 0x0C4) Glitch Filter Enable Register - Set */ + WoReg GPIO_GFERC; /**< \brief (GpioPort Offset: 0x0C8) Glitch Filter Enable Register - Clear */ + WoReg GPIO_GFERT; /**< \brief (GpioPort Offset: 0x0CC) Glitch Filter Enable Register - Toggle */ + RoReg GPIO_IFR; /**< \brief (GpioPort Offset: 0x0D0) Interrupt Flag Register */ + RoReg Reserved2[1]; + WoReg GPIO_IFRC; /**< \brief (GpioPort Offset: 0x0D8) Interrupt Flag Register - Clear */ + RoReg Reserved3[1]; + RwReg GPIO_ODMER; /**< \brief (GpioPort Offset: 0x0E0) Open Drain Mode Register */ + WoReg GPIO_ODMERS; /**< \brief (GpioPort Offset: 0x0E4) Open Drain Mode Register - Set */ + WoReg GPIO_ODMERC; /**< \brief (GpioPort Offset: 0x0E8) Open Drain Mode Register - Clear */ + WoReg GPIO_ODMERT; /**< \brief (GpioPort Offset: 0x0EC) Open Drain Mode Register - Toggle */ + RoReg Reserved4[4]; + RwReg GPIO_ODCR0; /**< \brief (GpioPort Offset: 0x100) Output Driving Capability Register 0 */ + RwReg GPIO_ODCR0S; /**< \brief (GpioPort Offset: 0x104) Output Driving Capability Register 0 - Set */ + RwReg GPIO_ODCR0C; /**< \brief (GpioPort Offset: 0x108) Output Driving Capability Register 0 - Clear */ + RwReg GPIO_ODCR0T; /**< \brief (GpioPort Offset: 0x10C) Output Driving Capability Register 0 - Toggle */ + RwReg GPIO_ODCR1; /**< \brief (GpioPort Offset: 0x110) Output Driving Capability Register 1 */ + RwReg GPIO_ODCR1S; /**< \brief (GpioPort Offset: 0x114) Output Driving Capability Register 1 - Set */ + RwReg GPIO_ODCR1C; /**< \brief (GpioPort Offset: 0x118) Output Driving Capability Register 1 - Clear */ + RwReg GPIO_ODCR1T; /**< \brief (GpioPort Offset: 0x11C) Output Driving Capability Register 1 - Toggle */ + RoReg Reserved5[4]; + RwReg GPIO_OSRR0; /**< \brief (GpioPort Offset: 0x130) Output Slew Rate Register 0 */ + RwReg GPIO_OSRR0S; /**< \brief (GpioPort Offset: 0x134) Output Slew Rate Register 0 - Set */ + RwReg GPIO_OSRR0C; /**< \brief (GpioPort Offset: 0x138) Output Slew Rate Register 0 - Clear */ + RwReg GPIO_OSRR0T; /**< \brief (GpioPort Offset: 0x13C) Output Slew Rate Register 0 - Toggle */ + RoReg Reserved6[8]; + RwReg GPIO_STER; /**< \brief (GpioPort Offset: 0x160) Schmitt Trigger Enable Register */ + RwReg GPIO_STERS; /**< \brief (GpioPort Offset: 0x164) Schmitt Trigger Enable Register - Set */ + RwReg GPIO_STERC; /**< \brief (GpioPort Offset: 0x168) Schmitt Trigger Enable Register - Clear */ + RwReg GPIO_STERT; /**< \brief (GpioPort Offset: 0x16C) Schmitt Trigger Enable Register - Toggle */ + RoReg Reserved7[4]; + RwReg GPIO_EVER; /**< \brief (GpioPort Offset: 0x180) Event Enable Register */ + WoReg GPIO_EVERS; /**< \brief (GpioPort Offset: 0x184) Event Enable Register - Set */ + WoReg GPIO_EVERC; /**< \brief (GpioPort Offset: 0x188) Event Enable Register - Clear */ + WoReg GPIO_EVERT; /**< \brief (GpioPort Offset: 0x18C) Event Enable Register - Toggle */ + RoReg Reserved8[4]; + RwReg GPIO_LOCK; /**< \brief (GpioPort Offset: 0x1A0) Lock Register */ + WoReg GPIO_LOCKS; /**< \brief (GpioPort Offset: 0x1A4) Lock Register - Set */ + WoReg GPIO_LOCKC; /**< \brief (GpioPort Offset: 0x1A8) Lock Register - Clear */ + WoReg GPIO_LOCKT; /**< \brief (GpioPort Offset: 0x1AC) Lock Register - Toggle */ + RoReg Reserved9[12]; + WoReg GPIO_UNLOCK; /**< \brief (GpioPort Offset: 0x1E0) Unlock Register */ + RwReg GPIO_ASR; /**< \brief (GpioPort Offset: 0x1E4) Access Status Register */ + RoReg Reserved10[4]; + RoReg GPIO_PARAMETER; /**< \brief (GpioPort Offset: 0x1F8) Parameter Register */ + RoReg GPIO_VERSION; /**< \brief (GpioPort Offset: 0x1FC) Version Register */ +} GpioPort; +/** \brief GPIO hardware registers */ +#define GPIO_PORT_LENGTH 3 +typedef struct { + GpioPort GPIO_PORT[GPIO_PORT_LENGTH]; /**< \brief (GPIO Offset: 0x000) GpioPort groups */ + GpioPort Reserved1[64 - GPIO_PORT_LENGTH]; +} Gpio; +#endif /* __ASSEMBLY__ */ +/* -------- GPIO_GPER : (GPIO Offset: 0x000) Port GPIO Enable Register -------- */ +#define GPIO_GPER_P0 (0x1u << 0) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P1 (0x1u << 1) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P2 (0x1u << 2) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P3 (0x1u << 3) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P4 (0x1u << 4) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P5 (0x1u << 5) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P6 (0x1u << 6) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P7 (0x1u << 7) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P8 (0x1u << 8) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P9 (0x1u << 9) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P10 (0x1u << 10) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P11 (0x1u << 11) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P12 (0x1u << 12) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P13 (0x1u << 13) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P14 (0x1u << 14) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P15 (0x1u << 15) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P16 (0x1u << 16) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P17 (0x1u << 17) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P18 (0x1u << 18) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P19 (0x1u << 19) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P20 (0x1u << 20) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P21 (0x1u << 21) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P22 (0x1u << 22) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P23 (0x1u << 23) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P24 (0x1u << 24) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P25 (0x1u << 25) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P26 (0x1u << 26) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P27 (0x1u << 27) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P28 (0x1u << 28) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P29 (0x1u << 29) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P30 (0x1u << 30) /**< \brief (GPIO_GPER) GPIO Enable */ +#define GPIO_GPER_P31 (0x1u << 31) /**< \brief (GPIO_GPER) GPIO Enable */ +/* -------- GPIO_GPERS : (GPIO Offset: 0x004) Port GPIO Enable Register - Set -------- */ +#define GPIO_GPERS_P0 (0x1u << 0) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P1 (0x1u << 1) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P2 (0x1u << 2) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P3 (0x1u << 3) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P4 (0x1u << 4) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P5 (0x1u << 5) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P6 (0x1u << 6) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P7 (0x1u << 7) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P8 (0x1u << 8) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P9 (0x1u << 9) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P10 (0x1u << 10) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P11 (0x1u << 11) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P12 (0x1u << 12) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P13 (0x1u << 13) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P14 (0x1u << 14) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P15 (0x1u << 15) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P16 (0x1u << 16) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P17 (0x1u << 17) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P18 (0x1u << 18) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P19 (0x1u << 19) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P20 (0x1u << 20) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P21 (0x1u << 21) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P22 (0x1u << 22) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P23 (0x1u << 23) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P24 (0x1u << 24) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P25 (0x1u << 25) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P26 (0x1u << 26) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P27 (0x1u << 27) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P28 (0x1u << 28) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P29 (0x1u << 29) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P30 (0x1u << 30) /**< \brief (GPIO_GPERS) GPIO Enable */ +#define GPIO_GPERS_P31 (0x1u << 31) /**< \brief (GPIO_GPERS) GPIO Enable */ +/* -------- GPIO_GPERC : (GPIO Offset: 0x008) Port GPIO Enable Register - Clear -------- */ +#define GPIO_GPERC_P0 (0x1u << 0) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P1 (0x1u << 1) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P2 (0x1u << 2) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P3 (0x1u << 3) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P4 (0x1u << 4) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P5 (0x1u << 5) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P6 (0x1u << 6) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P7 (0x1u << 7) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P8 (0x1u << 8) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P9 (0x1u << 9) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P10 (0x1u << 10) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P11 (0x1u << 11) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P12 (0x1u << 12) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P13 (0x1u << 13) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P14 (0x1u << 14) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P15 (0x1u << 15) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P16 (0x1u << 16) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P17 (0x1u << 17) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P18 (0x1u << 18) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P19 (0x1u << 19) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P20 (0x1u << 20) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P21 (0x1u << 21) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P22 (0x1u << 22) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P23 (0x1u << 23) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P24 (0x1u << 24) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P25 (0x1u << 25) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P26 (0x1u << 26) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P27 (0x1u << 27) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P28 (0x1u << 28) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P29 (0x1u << 29) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P30 (0x1u << 30) /**< \brief (GPIO_GPERC) GPIO Enable */ +#define GPIO_GPERC_P31 (0x1u << 31) /**< \brief (GPIO_GPERC) GPIO Enable */ +/* -------- GPIO_GPERT : (GPIO Offset: 0x00C) Port GPIO Enable Register - Toggle -------- */ +#define GPIO_GPERT_P0 (0x1u << 0) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P1 (0x1u << 1) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P2 (0x1u << 2) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P3 (0x1u << 3) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P4 (0x1u << 4) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P5 (0x1u << 5) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P6 (0x1u << 6) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P7 (0x1u << 7) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P8 (0x1u << 8) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P9 (0x1u << 9) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P10 (0x1u << 10) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P11 (0x1u << 11) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P12 (0x1u << 12) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P13 (0x1u << 13) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P14 (0x1u << 14) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P15 (0x1u << 15) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P16 (0x1u << 16) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P17 (0x1u << 17) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P18 (0x1u << 18) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P19 (0x1u << 19) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P20 (0x1u << 20) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P21 (0x1u << 21) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P22 (0x1u << 22) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P23 (0x1u << 23) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P24 (0x1u << 24) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P25 (0x1u << 25) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P26 (0x1u << 26) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P27 (0x1u << 27) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P28 (0x1u << 28) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P29 (0x1u << 29) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P30 (0x1u << 30) /**< \brief (GPIO_GPERT) GPIO Enable */ +#define GPIO_GPERT_P31 (0x1u << 31) /**< \brief (GPIO_GPERT) GPIO Enable */ +/* -------- GPIO_PMR0 : (GPIO Offset: 0x010) Port Peripheral Mux Register 0 -------- */ +#define GPIO_PMR0_P0 (0x1u << 0) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P1 (0x1u << 1) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P2 (0x1u << 2) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P3 (0x1u << 3) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P4 (0x1u << 4) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P5 (0x1u << 5) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P6 (0x1u << 6) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P7 (0x1u << 7) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P8 (0x1u << 8) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P9 (0x1u << 9) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P10 (0x1u << 10) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P11 (0x1u << 11) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P12 (0x1u << 12) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P13 (0x1u << 13) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P14 (0x1u << 14) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P15 (0x1u << 15) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P16 (0x1u << 16) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P17 (0x1u << 17) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P18 (0x1u << 18) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P19 (0x1u << 19) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P20 (0x1u << 20) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P21 (0x1u << 21) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P22 (0x1u << 22) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P23 (0x1u << 23) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P24 (0x1u << 24) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P25 (0x1u << 25) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P26 (0x1u << 26) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P27 (0x1u << 27) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P28 (0x1u << 28) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P29 (0x1u << 29) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P30 (0x1u << 30) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0_P31 (0x1u << 31) /**< \brief (GPIO_PMR0) Peripheral Multiplexer Select bit 0 */ +/* -------- GPIO_PMR0S : (GPIO Offset: 0x014) Port Peripheral Mux Register 0 - Set -------- */ +#define GPIO_PMR0S_P0 (0x1u << 0) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P1 (0x1u << 1) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P2 (0x1u << 2) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P3 (0x1u << 3) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P4 (0x1u << 4) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P5 (0x1u << 5) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P6 (0x1u << 6) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P7 (0x1u << 7) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P8 (0x1u << 8) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P9 (0x1u << 9) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P10 (0x1u << 10) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P11 (0x1u << 11) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P12 (0x1u << 12) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P13 (0x1u << 13) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P14 (0x1u << 14) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P15 (0x1u << 15) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P16 (0x1u << 16) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P17 (0x1u << 17) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P18 (0x1u << 18) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P19 (0x1u << 19) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P20 (0x1u << 20) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P21 (0x1u << 21) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P22 (0x1u << 22) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P23 (0x1u << 23) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P24 (0x1u << 24) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P25 (0x1u << 25) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P26 (0x1u << 26) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P27 (0x1u << 27) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P28 (0x1u << 28) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P29 (0x1u << 29) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P30 (0x1u << 30) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0S_P31 (0x1u << 31) /**< \brief (GPIO_PMR0S) Peripheral Multiplexer Select bit 0 */ +/* -------- GPIO_PMR0C : (GPIO Offset: 0x018) Port Peripheral Mux Register 0 - Clear -------- */ +#define GPIO_PMR0C_P0 (0x1u << 0) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P1 (0x1u << 1) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P2 (0x1u << 2) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P3 (0x1u << 3) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P4 (0x1u << 4) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P5 (0x1u << 5) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P6 (0x1u << 6) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P7 (0x1u << 7) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P8 (0x1u << 8) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P9 (0x1u << 9) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P10 (0x1u << 10) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P11 (0x1u << 11) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P12 (0x1u << 12) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P13 (0x1u << 13) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P14 (0x1u << 14) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P15 (0x1u << 15) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P16 (0x1u << 16) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P17 (0x1u << 17) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P18 (0x1u << 18) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P19 (0x1u << 19) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P20 (0x1u << 20) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P21 (0x1u << 21) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P22 (0x1u << 22) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P23 (0x1u << 23) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P24 (0x1u << 24) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P25 (0x1u << 25) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P26 (0x1u << 26) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P27 (0x1u << 27) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P28 (0x1u << 28) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P29 (0x1u << 29) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P30 (0x1u << 30) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0C_P31 (0x1u << 31) /**< \brief (GPIO_PMR0C) Peripheral Multiplexer Select bit 0 */ +/* -------- GPIO_PMR0T : (GPIO Offset: 0x01C) Port Peripheral Mux Register 0 - Toggle -------- */ +#define GPIO_PMR0T_P0 (0x1u << 0) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P1 (0x1u << 1) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P2 (0x1u << 2) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P3 (0x1u << 3) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P4 (0x1u << 4) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P5 (0x1u << 5) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P6 (0x1u << 6) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P7 (0x1u << 7) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P8 (0x1u << 8) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P9 (0x1u << 9) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P10 (0x1u << 10) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P11 (0x1u << 11) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P12 (0x1u << 12) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P13 (0x1u << 13) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P14 (0x1u << 14) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P15 (0x1u << 15) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P16 (0x1u << 16) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P17 (0x1u << 17) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P18 (0x1u << 18) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P19 (0x1u << 19) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P20 (0x1u << 20) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P21 (0x1u << 21) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P22 (0x1u << 22) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P23 (0x1u << 23) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P24 (0x1u << 24) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P25 (0x1u << 25) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P26 (0x1u << 26) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P27 (0x1u << 27) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P28 (0x1u << 28) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P29 (0x1u << 29) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P30 (0x1u << 30) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +#define GPIO_PMR0T_P31 (0x1u << 31) /**< \brief (GPIO_PMR0T) Peripheral Multiplexer Select bit 0 */ +/* -------- GPIO_PMR1 : (GPIO Offset: 0x020) Port Peripheral Mux Register 1 -------- */ +#define GPIO_PMR1_P0 (0x1u << 0) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P1 (0x1u << 1) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P2 (0x1u << 2) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P3 (0x1u << 3) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P4 (0x1u << 4) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P5 (0x1u << 5) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P6 (0x1u << 6) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P7 (0x1u << 7) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P8 (0x1u << 8) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P9 (0x1u << 9) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P10 (0x1u << 10) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P11 (0x1u << 11) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P12 (0x1u << 12) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P13 (0x1u << 13) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P14 (0x1u << 14) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P15 (0x1u << 15) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P16 (0x1u << 16) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P17 (0x1u << 17) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P18 (0x1u << 18) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P19 (0x1u << 19) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P20 (0x1u << 20) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P21 (0x1u << 21) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P22 (0x1u << 22) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P23 (0x1u << 23) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P24 (0x1u << 24) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P25 (0x1u << 25) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P26 (0x1u << 26) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P27 (0x1u << 27) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P28 (0x1u << 28) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P29 (0x1u << 29) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P30 (0x1u << 30) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1_P31 (0x1u << 31) /**< \brief (GPIO_PMR1) Peripheral Multiplexer Select bit 1 */ +/* -------- GPIO_PMR1S : (GPIO Offset: 0x024) Port Peripheral Mux Register 1 - Set -------- */ +#define GPIO_PMR1S_P0 (0x1u << 0) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P1 (0x1u << 1) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P2 (0x1u << 2) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P3 (0x1u << 3) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P4 (0x1u << 4) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P5 (0x1u << 5) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P6 (0x1u << 6) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P7 (0x1u << 7) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P8 (0x1u << 8) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P9 (0x1u << 9) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P10 (0x1u << 10) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P11 (0x1u << 11) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P12 (0x1u << 12) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P13 (0x1u << 13) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P14 (0x1u << 14) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P15 (0x1u << 15) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P16 (0x1u << 16) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P17 (0x1u << 17) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P18 (0x1u << 18) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P19 (0x1u << 19) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P20 (0x1u << 20) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P21 (0x1u << 21) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P22 (0x1u << 22) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P23 (0x1u << 23) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P24 (0x1u << 24) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P25 (0x1u << 25) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P26 (0x1u << 26) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P27 (0x1u << 27) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P28 (0x1u << 28) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P29 (0x1u << 29) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P30 (0x1u << 30) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1S_P31 (0x1u << 31) /**< \brief (GPIO_PMR1S) Peripheral Multiplexer Select bit 1 */ +/* -------- GPIO_PMR1C : (GPIO Offset: 0x028) Port Peripheral Mux Register 1 - Clear -------- */ +#define GPIO_PMR1C_P0 (0x1u << 0) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P1 (0x1u << 1) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P2 (0x1u << 2) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P3 (0x1u << 3) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P4 (0x1u << 4) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P5 (0x1u << 5) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P6 (0x1u << 6) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P7 (0x1u << 7) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P8 (0x1u << 8) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P9 (0x1u << 9) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P10 (0x1u << 10) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P11 (0x1u << 11) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P12 (0x1u << 12) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P13 (0x1u << 13) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P14 (0x1u << 14) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P15 (0x1u << 15) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P16 (0x1u << 16) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P17 (0x1u << 17) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P18 (0x1u << 18) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P19 (0x1u << 19) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P20 (0x1u << 20) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P21 (0x1u << 21) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P22 (0x1u << 22) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P23 (0x1u << 23) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P24 (0x1u << 24) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P25 (0x1u << 25) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P26 (0x1u << 26) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P27 (0x1u << 27) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P28 (0x1u << 28) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P29 (0x1u << 29) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P30 (0x1u << 30) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1C_P31 (0x1u << 31) /**< \brief (GPIO_PMR1C) Peripheral Multiplexer Select bit 1 */ +/* -------- GPIO_PMR1T : (GPIO Offset: 0x02C) Port Peripheral Mux Register 1 - Toggle -------- */ +#define GPIO_PMR1T_P0 (0x1u << 0) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P1 (0x1u << 1) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P2 (0x1u << 2) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P3 (0x1u << 3) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P4 (0x1u << 4) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P5 (0x1u << 5) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P6 (0x1u << 6) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P7 (0x1u << 7) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P8 (0x1u << 8) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P9 (0x1u << 9) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P10 (0x1u << 10) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P11 (0x1u << 11) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P12 (0x1u << 12) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P13 (0x1u << 13) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P14 (0x1u << 14) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P15 (0x1u << 15) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P16 (0x1u << 16) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P17 (0x1u << 17) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P18 (0x1u << 18) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P19 (0x1u << 19) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P20 (0x1u << 20) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P21 (0x1u << 21) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P22 (0x1u << 22) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P23 (0x1u << 23) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P24 (0x1u << 24) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P25 (0x1u << 25) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P26 (0x1u << 26) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P27 (0x1u << 27) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P28 (0x1u << 28) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P29 (0x1u << 29) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P30 (0x1u << 30) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +#define GPIO_PMR1T_P31 (0x1u << 31) /**< \brief (GPIO_PMR1T) Peripheral Multiplexer Select bit 1 */ +/* -------- GPIO_PMR2 : (GPIO Offset: 0x030) Port Peripheral Mux Register 2 -------- */ +#define GPIO_PMR2_P0 (0x1u << 0) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P1 (0x1u << 1) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P2 (0x1u << 2) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P3 (0x1u << 3) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P4 (0x1u << 4) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P5 (0x1u << 5) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P6 (0x1u << 6) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P7 (0x1u << 7) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P8 (0x1u << 8) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P9 (0x1u << 9) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P10 (0x1u << 10) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P11 (0x1u << 11) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P12 (0x1u << 12) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P13 (0x1u << 13) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P14 (0x1u << 14) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P15 (0x1u << 15) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P16 (0x1u << 16) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P17 (0x1u << 17) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P18 (0x1u << 18) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P19 (0x1u << 19) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P20 (0x1u << 20) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P21 (0x1u << 21) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P22 (0x1u << 22) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P23 (0x1u << 23) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P24 (0x1u << 24) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P25 (0x1u << 25) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P26 (0x1u << 26) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P27 (0x1u << 27) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P28 (0x1u << 28) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P29 (0x1u << 29) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P30 (0x1u << 30) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2_P31 (0x1u << 31) /**< \brief (GPIO_PMR2) Peripheral Multiplexer Select bit 2 */ +/* -------- GPIO_PMR2S : (GPIO Offset: 0x034) Port Peripheral Mux Register 2 - Set -------- */ +#define GPIO_PMR2S_P0 (0x1u << 0) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P1 (0x1u << 1) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P2 (0x1u << 2) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P3 (0x1u << 3) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P4 (0x1u << 4) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P5 (0x1u << 5) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P6 (0x1u << 6) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P7 (0x1u << 7) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P8 (0x1u << 8) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P9 (0x1u << 9) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P10 (0x1u << 10) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P11 (0x1u << 11) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P12 (0x1u << 12) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P13 (0x1u << 13) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P14 (0x1u << 14) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P15 (0x1u << 15) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P16 (0x1u << 16) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P17 (0x1u << 17) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P18 (0x1u << 18) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P19 (0x1u << 19) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P20 (0x1u << 20) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P21 (0x1u << 21) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P22 (0x1u << 22) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P23 (0x1u << 23) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P24 (0x1u << 24) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P25 (0x1u << 25) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P26 (0x1u << 26) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P27 (0x1u << 27) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P28 (0x1u << 28) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P29 (0x1u << 29) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P30 (0x1u << 30) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2S_P31 (0x1u << 31) /**< \brief (GPIO_PMR2S) Peripheral Multiplexer Select bit 2 */ +/* -------- GPIO_PMR2C : (GPIO Offset: 0x038) Port Peripheral Mux Register 2 - Clear -------- */ +#define GPIO_PMR2C_P0 (0x1u << 0) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P1 (0x1u << 1) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P2 (0x1u << 2) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P3 (0x1u << 3) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P4 (0x1u << 4) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P5 (0x1u << 5) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P6 (0x1u << 6) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P7 (0x1u << 7) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P8 (0x1u << 8) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P9 (0x1u << 9) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P10 (0x1u << 10) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P11 (0x1u << 11) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P12 (0x1u << 12) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P13 (0x1u << 13) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P14 (0x1u << 14) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P15 (0x1u << 15) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P16 (0x1u << 16) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P17 (0x1u << 17) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P18 (0x1u << 18) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P19 (0x1u << 19) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P20 (0x1u << 20) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P21 (0x1u << 21) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P22 (0x1u << 22) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P23 (0x1u << 23) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P24 (0x1u << 24) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P25 (0x1u << 25) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P26 (0x1u << 26) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P27 (0x1u << 27) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P28 (0x1u << 28) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P29 (0x1u << 29) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P30 (0x1u << 30) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2C_P31 (0x1u << 31) /**< \brief (GPIO_PMR2C) Peripheral Multiplexer Select bit 2 */ +/* -------- GPIO_PMR2T : (GPIO Offset: 0x03C) Port Peripheral Mux Register 2 - Toggle -------- */ +#define GPIO_PMR2T_P0 (0x1u << 0) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P1 (0x1u << 1) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P2 (0x1u << 2) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P3 (0x1u << 3) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P4 (0x1u << 4) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P5 (0x1u << 5) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P6 (0x1u << 6) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P7 (0x1u << 7) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P8 (0x1u << 8) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P9 (0x1u << 9) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P10 (0x1u << 10) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P11 (0x1u << 11) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P12 (0x1u << 12) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P13 (0x1u << 13) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P14 (0x1u << 14) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P15 (0x1u << 15) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P16 (0x1u << 16) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P17 (0x1u << 17) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P18 (0x1u << 18) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P19 (0x1u << 19) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P20 (0x1u << 20) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P21 (0x1u << 21) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P22 (0x1u << 22) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P23 (0x1u << 23) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P24 (0x1u << 24) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P25 (0x1u << 25) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P26 (0x1u << 26) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P27 (0x1u << 27) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P28 (0x1u << 28) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P29 (0x1u << 29) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P30 (0x1u << 30) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +#define GPIO_PMR2T_P31 (0x1u << 31) /**< \brief (GPIO_PMR2T) Peripheral Multiplexer Select bit 2 */ +/* -------- GPIO_ODER : (GPIO Offset: 0x040) Port Output Driver Enable Register -------- */ +#define GPIO_ODER_P0 (0x1u << 0) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P1 (0x1u << 1) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P2 (0x1u << 2) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P3 (0x1u << 3) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P4 (0x1u << 4) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P5 (0x1u << 5) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P6 (0x1u << 6) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P7 (0x1u << 7) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P8 (0x1u << 8) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P9 (0x1u << 9) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P10 (0x1u << 10) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P11 (0x1u << 11) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P12 (0x1u << 12) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P13 (0x1u << 13) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P14 (0x1u << 14) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P15 (0x1u << 15) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P16 (0x1u << 16) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P17 (0x1u << 17) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P18 (0x1u << 18) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P19 (0x1u << 19) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P20 (0x1u << 20) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P21 (0x1u << 21) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P22 (0x1u << 22) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P23 (0x1u << 23) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P24 (0x1u << 24) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P25 (0x1u << 25) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P26 (0x1u << 26) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P27 (0x1u << 27) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P28 (0x1u << 28) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P29 (0x1u << 29) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P30 (0x1u << 30) /**< \brief (GPIO_ODER) Output Driver Enable */ +#define GPIO_ODER_P31 (0x1u << 31) /**< \brief (GPIO_ODER) Output Driver Enable */ +/* -------- GPIO_ODERS : (GPIO Offset: 0x044) Port Output Driver Enable Register - Set -------- */ +#define GPIO_ODERS_P0 (0x1u << 0) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P1 (0x1u << 1) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P2 (0x1u << 2) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P3 (0x1u << 3) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P4 (0x1u << 4) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P5 (0x1u << 5) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P6 (0x1u << 6) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P7 (0x1u << 7) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P8 (0x1u << 8) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P9 (0x1u << 9) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P10 (0x1u << 10) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P11 (0x1u << 11) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P12 (0x1u << 12) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P13 (0x1u << 13) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P14 (0x1u << 14) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P15 (0x1u << 15) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P16 (0x1u << 16) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P17 (0x1u << 17) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P18 (0x1u << 18) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P19 (0x1u << 19) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P20 (0x1u << 20) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P21 (0x1u << 21) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P22 (0x1u << 22) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P23 (0x1u << 23) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P24 (0x1u << 24) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P25 (0x1u << 25) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P26 (0x1u << 26) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P27 (0x1u << 27) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P28 (0x1u << 28) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P29 (0x1u << 29) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P30 (0x1u << 30) /**< \brief (GPIO_ODERS) Output Driver Enable */ +#define GPIO_ODERS_P31 (0x1u << 31) /**< \brief (GPIO_ODERS) Output Driver Enable */ +/* -------- GPIO_ODERC : (GPIO Offset: 0x048) Port Output Driver Enable Register - Clear -------- */ +#define GPIO_ODERC_P0 (0x1u << 0) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P1 (0x1u << 1) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P2 (0x1u << 2) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P3 (0x1u << 3) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P4 (0x1u << 4) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P5 (0x1u << 5) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P6 (0x1u << 6) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P7 (0x1u << 7) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P8 (0x1u << 8) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P9 (0x1u << 9) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P10 (0x1u << 10) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P11 (0x1u << 11) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P12 (0x1u << 12) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P13 (0x1u << 13) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P14 (0x1u << 14) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P15 (0x1u << 15) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P16 (0x1u << 16) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P17 (0x1u << 17) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P18 (0x1u << 18) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P19 (0x1u << 19) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P20 (0x1u << 20) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P21 (0x1u << 21) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P22 (0x1u << 22) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P23 (0x1u << 23) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P24 (0x1u << 24) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P25 (0x1u << 25) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P26 (0x1u << 26) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P27 (0x1u << 27) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P28 (0x1u << 28) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P29 (0x1u << 29) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P30 (0x1u << 30) /**< \brief (GPIO_ODERC) Output Driver Enable */ +#define GPIO_ODERC_P31 (0x1u << 31) /**< \brief (GPIO_ODERC) Output Driver Enable */ +/* -------- GPIO_ODERT : (GPIO Offset: 0x04C) Port Output Driver Enable Register - Toggle -------- */ +#define GPIO_ODERT_P0 (0x1u << 0) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P1 (0x1u << 1) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P2 (0x1u << 2) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P3 (0x1u << 3) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P4 (0x1u << 4) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P5 (0x1u << 5) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P6 (0x1u << 6) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P7 (0x1u << 7) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P8 (0x1u << 8) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P9 (0x1u << 9) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P10 (0x1u << 10) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P11 (0x1u << 11) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P12 (0x1u << 12) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P13 (0x1u << 13) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P14 (0x1u << 14) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P15 (0x1u << 15) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P16 (0x1u << 16) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P17 (0x1u << 17) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P18 (0x1u << 18) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P19 (0x1u << 19) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P20 (0x1u << 20) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P21 (0x1u << 21) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P22 (0x1u << 22) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P23 (0x1u << 23) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P24 (0x1u << 24) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P25 (0x1u << 25) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P26 (0x1u << 26) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P27 (0x1u << 27) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P28 (0x1u << 28) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P29 (0x1u << 29) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P30 (0x1u << 30) /**< \brief (GPIO_ODERT) Output Driver Enable */ +#define GPIO_ODERT_P31 (0x1u << 31) /**< \brief (GPIO_ODERT) Output Driver Enable */ +/* -------- GPIO_OVR : (GPIO Offset: 0x050) Port Output Value Register -------- */ +#define GPIO_OVR_P0 (0x1u << 0) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P1 (0x1u << 1) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P2 (0x1u << 2) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P3 (0x1u << 3) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P4 (0x1u << 4) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P5 (0x1u << 5) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P6 (0x1u << 6) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P7 (0x1u << 7) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P8 (0x1u << 8) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P9 (0x1u << 9) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P10 (0x1u << 10) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P11 (0x1u << 11) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P12 (0x1u << 12) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P13 (0x1u << 13) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P14 (0x1u << 14) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P15 (0x1u << 15) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P16 (0x1u << 16) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P17 (0x1u << 17) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P18 (0x1u << 18) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P19 (0x1u << 19) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P20 (0x1u << 20) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P21 (0x1u << 21) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P22 (0x1u << 22) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P23 (0x1u << 23) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P24 (0x1u << 24) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P25 (0x1u << 25) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P26 (0x1u << 26) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P27 (0x1u << 27) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P28 (0x1u << 28) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P29 (0x1u << 29) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P30 (0x1u << 30) /**< \brief (GPIO_OVR) Output Value */ +#define GPIO_OVR_P31 (0x1u << 31) /**< \brief (GPIO_OVR) Output Value */ +/* -------- GPIO_OVRS : (GPIO Offset: 0x054) Port Output Value Register - Set -------- */ +#define GPIO_OVRS_P0 (0x1u << 0) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P1 (0x1u << 1) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P2 (0x1u << 2) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P3 (0x1u << 3) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P4 (0x1u << 4) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P5 (0x1u << 5) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P6 (0x1u << 6) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P7 (0x1u << 7) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P8 (0x1u << 8) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P9 (0x1u << 9) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P10 (0x1u << 10) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P11 (0x1u << 11) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P12 (0x1u << 12) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P13 (0x1u << 13) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P14 (0x1u << 14) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P15 (0x1u << 15) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P16 (0x1u << 16) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P17 (0x1u << 17) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P18 (0x1u << 18) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P19 (0x1u << 19) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P20 (0x1u << 20) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P21 (0x1u << 21) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P22 (0x1u << 22) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P23 (0x1u << 23) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P24 (0x1u << 24) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P25 (0x1u << 25) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P26 (0x1u << 26) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P27 (0x1u << 27) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P28 (0x1u << 28) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P29 (0x1u << 29) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P30 (0x1u << 30) /**< \brief (GPIO_OVRS) Output Value */ +#define GPIO_OVRS_P31 (0x1u << 31) /**< \brief (GPIO_OVRS) Output Value */ +/* -------- GPIO_OVRC : (GPIO Offset: 0x058) Port Output Value Register - Clear -------- */ +#define GPIO_OVRC_P0 (0x1u << 0) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P1 (0x1u << 1) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P2 (0x1u << 2) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P3 (0x1u << 3) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P4 (0x1u << 4) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P5 (0x1u << 5) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P6 (0x1u << 6) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P7 (0x1u << 7) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P8 (0x1u << 8) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P9 (0x1u << 9) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P10 (0x1u << 10) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P11 (0x1u << 11) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P12 (0x1u << 12) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P13 (0x1u << 13) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P14 (0x1u << 14) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P15 (0x1u << 15) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P16 (0x1u << 16) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P17 (0x1u << 17) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P18 (0x1u << 18) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P19 (0x1u << 19) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P20 (0x1u << 20) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P21 (0x1u << 21) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P22 (0x1u << 22) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P23 (0x1u << 23) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P24 (0x1u << 24) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P25 (0x1u << 25) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P26 (0x1u << 26) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P27 (0x1u << 27) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P28 (0x1u << 28) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P29 (0x1u << 29) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P30 (0x1u << 30) /**< \brief (GPIO_OVRC) Output Value */ +#define GPIO_OVRC_P31 (0x1u << 31) /**< \brief (GPIO_OVRC) Output Value */ +/* -------- GPIO_OVRT : (GPIO Offset: 0x05C) Port Output Value Register - Toggle -------- */ +#define GPIO_OVRT_P0 (0x1u << 0) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P1 (0x1u << 1) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P2 (0x1u << 2) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P3 (0x1u << 3) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P4 (0x1u << 4) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P5 (0x1u << 5) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P6 (0x1u << 6) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P7 (0x1u << 7) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P8 (0x1u << 8) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P9 (0x1u << 9) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P10 (0x1u << 10) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P11 (0x1u << 11) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P12 (0x1u << 12) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P13 (0x1u << 13) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P14 (0x1u << 14) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P15 (0x1u << 15) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P16 (0x1u << 16) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P17 (0x1u << 17) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P18 (0x1u << 18) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P19 (0x1u << 19) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P20 (0x1u << 20) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P21 (0x1u << 21) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P22 (0x1u << 22) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P23 (0x1u << 23) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P24 (0x1u << 24) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P25 (0x1u << 25) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P26 (0x1u << 26) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P27 (0x1u << 27) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P28 (0x1u << 28) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P29 (0x1u << 29) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P30 (0x1u << 30) /**< \brief (GPIO_OVRT) Output Value */ +#define GPIO_OVRT_P31 (0x1u << 31) /**< \brief (GPIO_OVRT) Output Value */ +/* -------- GPIO_PVR : (GPIO Offset: 0x060) Port Pin Value Register -------- */ +#define GPIO_PVR_P0 (0x1u << 0) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P1 (0x1u << 1) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P2 (0x1u << 2) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P3 (0x1u << 3) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P4 (0x1u << 4) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P5 (0x1u << 5) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P6 (0x1u << 6) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P7 (0x1u << 7) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P8 (0x1u << 8) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P9 (0x1u << 9) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P10 (0x1u << 10) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P11 (0x1u << 11) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P12 (0x1u << 12) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P13 (0x1u << 13) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P14 (0x1u << 14) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P15 (0x1u << 15) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P16 (0x1u << 16) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P17 (0x1u << 17) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P18 (0x1u << 18) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P19 (0x1u << 19) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P20 (0x1u << 20) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P21 (0x1u << 21) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P22 (0x1u << 22) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P23 (0x1u << 23) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P24 (0x1u << 24) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P25 (0x1u << 25) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P26 (0x1u << 26) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P27 (0x1u << 27) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P28 (0x1u << 28) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P29 (0x1u << 29) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P30 (0x1u << 30) /**< \brief (GPIO_PVR) Pin Value */ +#define GPIO_PVR_P31 (0x1u << 31) /**< \brief (GPIO_PVR) Pin Value */ +/* -------- GPIO_PUER : (GPIO Offset: 0x070) Port Pull-up Enable Register -------- */ +#define GPIO_PUER_P0 (0x1u << 0) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P1 (0x1u << 1) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P2 (0x1u << 2) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P3 (0x1u << 3) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P4 (0x1u << 4) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P5 (0x1u << 5) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P6 (0x1u << 6) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P7 (0x1u << 7) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P8 (0x1u << 8) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P9 (0x1u << 9) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P10 (0x1u << 10) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P11 (0x1u << 11) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P12 (0x1u << 12) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P13 (0x1u << 13) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P14 (0x1u << 14) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P15 (0x1u << 15) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P16 (0x1u << 16) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P17 (0x1u << 17) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P18 (0x1u << 18) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P19 (0x1u << 19) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P20 (0x1u << 20) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P21 (0x1u << 21) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P22 (0x1u << 22) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P23 (0x1u << 23) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P24 (0x1u << 24) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P25 (0x1u << 25) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P26 (0x1u << 26) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P27 (0x1u << 27) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P28 (0x1u << 28) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P29 (0x1u << 29) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P30 (0x1u << 30) /**< \brief (GPIO_PUER) Pull-up Enable */ +#define GPIO_PUER_P31 (0x1u << 31) /**< \brief (GPIO_PUER) Pull-up Enable */ +/* -------- GPIO_PUERS : (GPIO Offset: 0x074) Port Pull-up Enable Register - Set -------- */ +#define GPIO_PUERS_P0 (0x1u << 0) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P1 (0x1u << 1) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P2 (0x1u << 2) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P3 (0x1u << 3) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P4 (0x1u << 4) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P5 (0x1u << 5) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P6 (0x1u << 6) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P7 (0x1u << 7) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P8 (0x1u << 8) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P9 (0x1u << 9) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P10 (0x1u << 10) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P11 (0x1u << 11) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P12 (0x1u << 12) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P13 (0x1u << 13) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P14 (0x1u << 14) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P15 (0x1u << 15) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P16 (0x1u << 16) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P17 (0x1u << 17) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P18 (0x1u << 18) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P19 (0x1u << 19) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P20 (0x1u << 20) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P21 (0x1u << 21) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P22 (0x1u << 22) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P23 (0x1u << 23) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P24 (0x1u << 24) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P25 (0x1u << 25) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P26 (0x1u << 26) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P27 (0x1u << 27) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P28 (0x1u << 28) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P29 (0x1u << 29) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P30 (0x1u << 30) /**< \brief (GPIO_PUERS) Pull-up Enable */ +#define GPIO_PUERS_P31 (0x1u << 31) /**< \brief (GPIO_PUERS) Pull-up Enable */ +/* -------- GPIO_PUERC : (GPIO Offset: 0x078) Port Pull-up Enable Register - Clear -------- */ +#define GPIO_PUERC_P0 (0x1u << 0) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P1 (0x1u << 1) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P2 (0x1u << 2) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P3 (0x1u << 3) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P4 (0x1u << 4) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P5 (0x1u << 5) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P6 (0x1u << 6) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P7 (0x1u << 7) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P8 (0x1u << 8) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P9 (0x1u << 9) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P10 (0x1u << 10) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P11 (0x1u << 11) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P12 (0x1u << 12) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P13 (0x1u << 13) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P14 (0x1u << 14) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P15 (0x1u << 15) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P16 (0x1u << 16) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P17 (0x1u << 17) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P18 (0x1u << 18) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P19 (0x1u << 19) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P20 (0x1u << 20) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P21 (0x1u << 21) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P22 (0x1u << 22) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P23 (0x1u << 23) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P24 (0x1u << 24) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P25 (0x1u << 25) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P26 (0x1u << 26) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P27 (0x1u << 27) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P28 (0x1u << 28) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P29 (0x1u << 29) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P30 (0x1u << 30) /**< \brief (GPIO_PUERC) Pull-up Enable */ +#define GPIO_PUERC_P31 (0x1u << 31) /**< \brief (GPIO_PUERC) Pull-up Enable */ +/* -------- GPIO_PUERT : (GPIO Offset: 0x07C) Port Pull-up Enable Register - Toggle -------- */ +#define GPIO_PUERT_P0 (0x1u << 0) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P1 (0x1u << 1) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P2 (0x1u << 2) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P3 (0x1u << 3) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P4 (0x1u << 4) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P5 (0x1u << 5) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P6 (0x1u << 6) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P7 (0x1u << 7) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P8 (0x1u << 8) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P9 (0x1u << 9) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P10 (0x1u << 10) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P11 (0x1u << 11) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P12 (0x1u << 12) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P13 (0x1u << 13) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P14 (0x1u << 14) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P15 (0x1u << 15) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P16 (0x1u << 16) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P17 (0x1u << 17) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P18 (0x1u << 18) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P19 (0x1u << 19) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P20 (0x1u << 20) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P21 (0x1u << 21) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P22 (0x1u << 22) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P23 (0x1u << 23) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P24 (0x1u << 24) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P25 (0x1u << 25) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P26 (0x1u << 26) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P27 (0x1u << 27) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P28 (0x1u << 28) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P29 (0x1u << 29) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P30 (0x1u << 30) /**< \brief (GPIO_PUERT) Pull-up Enable */ +#define GPIO_PUERT_P31 (0x1u << 31) /**< \brief (GPIO_PUERT) Pull-up Enable */ +/* -------- GPIO_PDER : (GPIO Offset: 0x080) Port Pull-down Enable Register -------- */ +#define GPIO_PDER_P0 (0x1u << 0) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P1 (0x1u << 1) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P2 (0x1u << 2) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P3 (0x1u << 3) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P4 (0x1u << 4) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P5 (0x1u << 5) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P6 (0x1u << 6) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P7 (0x1u << 7) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P8 (0x1u << 8) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P9 (0x1u << 9) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P10 (0x1u << 10) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P11 (0x1u << 11) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P12 (0x1u << 12) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P13 (0x1u << 13) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P14 (0x1u << 14) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P15 (0x1u << 15) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P16 (0x1u << 16) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P17 (0x1u << 17) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P18 (0x1u << 18) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P19 (0x1u << 19) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P20 (0x1u << 20) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P21 (0x1u << 21) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P22 (0x1u << 22) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P23 (0x1u << 23) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P24 (0x1u << 24) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P25 (0x1u << 25) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P26 (0x1u << 26) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P27 (0x1u << 27) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P28 (0x1u << 28) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P29 (0x1u << 29) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P30 (0x1u << 30) /**< \brief (GPIO_PDER) Pull-down Enable */ +#define GPIO_PDER_P31 (0x1u << 31) /**< \brief (GPIO_PDER) Pull-down Enable */ +/* -------- GPIO_PDERS : (GPIO Offset: 0x084) Port Pull-down Enable Register - Set -------- */ +#define GPIO_PDERS_P0 (0x1u << 0) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P1 (0x1u << 1) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P2 (0x1u << 2) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P3 (0x1u << 3) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P4 (0x1u << 4) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P5 (0x1u << 5) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P6 (0x1u << 6) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P7 (0x1u << 7) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P8 (0x1u << 8) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P9 (0x1u << 9) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P10 (0x1u << 10) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P11 (0x1u << 11) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P12 (0x1u << 12) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P13 (0x1u << 13) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P14 (0x1u << 14) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P15 (0x1u << 15) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P16 (0x1u << 16) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P17 (0x1u << 17) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P18 (0x1u << 18) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P19 (0x1u << 19) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P20 (0x1u << 20) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P21 (0x1u << 21) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P22 (0x1u << 22) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P23 (0x1u << 23) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P24 (0x1u << 24) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P25 (0x1u << 25) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P26 (0x1u << 26) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P27 (0x1u << 27) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P28 (0x1u << 28) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P29 (0x1u << 29) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P30 (0x1u << 30) /**< \brief (GPIO_PDERS) Pull-down Enable */ +#define GPIO_PDERS_P31 (0x1u << 31) /**< \brief (GPIO_PDERS) Pull-down Enable */ +/* -------- GPIO_PDERC : (GPIO Offset: 0x088) Port Pull-down Enable Register - Clear -------- */ +#define GPIO_PDERC_P0 (0x1u << 0) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P1 (0x1u << 1) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P2 (0x1u << 2) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P3 (0x1u << 3) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P4 (0x1u << 4) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P5 (0x1u << 5) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P6 (0x1u << 6) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P7 (0x1u << 7) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P8 (0x1u << 8) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P9 (0x1u << 9) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P10 (0x1u << 10) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P11 (0x1u << 11) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P12 (0x1u << 12) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P13 (0x1u << 13) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P14 (0x1u << 14) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P15 (0x1u << 15) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P16 (0x1u << 16) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P17 (0x1u << 17) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P18 (0x1u << 18) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P19 (0x1u << 19) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P20 (0x1u << 20) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P21 (0x1u << 21) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P22 (0x1u << 22) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P23 (0x1u << 23) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P24 (0x1u << 24) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P25 (0x1u << 25) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P26 (0x1u << 26) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P27 (0x1u << 27) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P28 (0x1u << 28) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P29 (0x1u << 29) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P30 (0x1u << 30) /**< \brief (GPIO_PDERC) Pull-down Enable */ +#define GPIO_PDERC_P31 (0x1u << 31) /**< \brief (GPIO_PDERC) Pull-down Enable */ +/* -------- GPIO_PDERT : (GPIO Offset: 0x08C) Port Pull-down Enable Register - Toggle -------- */ +#define GPIO_PDERT_P0 (0x1u << 0) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P1 (0x1u << 1) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P2 (0x1u << 2) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P3 (0x1u << 3) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P4 (0x1u << 4) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P5 (0x1u << 5) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P6 (0x1u << 6) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P7 (0x1u << 7) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P8 (0x1u << 8) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P9 (0x1u << 9) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P10 (0x1u << 10) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P11 (0x1u << 11) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P12 (0x1u << 12) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P13 (0x1u << 13) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P14 (0x1u << 14) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P15 (0x1u << 15) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P16 (0x1u << 16) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P17 (0x1u << 17) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P18 (0x1u << 18) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P19 (0x1u << 19) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P20 (0x1u << 20) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P21 (0x1u << 21) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P22 (0x1u << 22) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P23 (0x1u << 23) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P24 (0x1u << 24) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P25 (0x1u << 25) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P26 (0x1u << 26) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P27 (0x1u << 27) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P28 (0x1u << 28) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P29 (0x1u << 29) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P30 (0x1u << 30) /**< \brief (GPIO_PDERT) Pull-down Enable */ +#define GPIO_PDERT_P31 (0x1u << 31) /**< \brief (GPIO_PDERT) Pull-down Enable */ +/* -------- GPIO_IER : (GPIO Offset: 0x090) Port Interrupt Enable Register -------- */ +#define GPIO_IER_P0 (0x1u << 0) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P1 (0x1u << 1) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P2 (0x1u << 2) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P3 (0x1u << 3) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P4 (0x1u << 4) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P5 (0x1u << 5) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P6 (0x1u << 6) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P7 (0x1u << 7) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P8 (0x1u << 8) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P9 (0x1u << 9) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P10 (0x1u << 10) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P11 (0x1u << 11) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P12 (0x1u << 12) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P13 (0x1u << 13) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P14 (0x1u << 14) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P15 (0x1u << 15) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P16 (0x1u << 16) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P17 (0x1u << 17) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P18 (0x1u << 18) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P19 (0x1u << 19) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P20 (0x1u << 20) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P21 (0x1u << 21) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P22 (0x1u << 22) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P23 (0x1u << 23) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P24 (0x1u << 24) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P25 (0x1u << 25) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P26 (0x1u << 26) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P27 (0x1u << 27) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P28 (0x1u << 28) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P29 (0x1u << 29) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P30 (0x1u << 30) /**< \brief (GPIO_IER) Interrupt Enable */ +#define GPIO_IER_P31 (0x1u << 31) /**< \brief (GPIO_IER) Interrupt Enable */ +/* -------- GPIO_IERS : (GPIO Offset: 0x094) Port Interrupt Enable Register - Set -------- */ +#define GPIO_IERS_P0 (0x1u << 0) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P1 (0x1u << 1) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P2 (0x1u << 2) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P3 (0x1u << 3) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P4 (0x1u << 4) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P5 (0x1u << 5) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P6 (0x1u << 6) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P7 (0x1u << 7) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P8 (0x1u << 8) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P9 (0x1u << 9) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P10 (0x1u << 10) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P11 (0x1u << 11) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P12 (0x1u << 12) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P13 (0x1u << 13) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P14 (0x1u << 14) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P15 (0x1u << 15) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P16 (0x1u << 16) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P17 (0x1u << 17) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P18 (0x1u << 18) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P19 (0x1u << 19) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P20 (0x1u << 20) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P21 (0x1u << 21) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P22 (0x1u << 22) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P23 (0x1u << 23) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P24 (0x1u << 24) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P25 (0x1u << 25) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P26 (0x1u << 26) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P27 (0x1u << 27) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P28 (0x1u << 28) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P29 (0x1u << 29) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P30 (0x1u << 30) /**< \brief (GPIO_IERS) Interrupt Enable */ +#define GPIO_IERS_P31 (0x1u << 31) /**< \brief (GPIO_IERS) Interrupt Enable */ +/* -------- GPIO_IERC : (GPIO Offset: 0x098) Port Interrupt Enable Register - Clear -------- */ +#define GPIO_IERC_P0 (0x1u << 0) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P1 (0x1u << 1) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P2 (0x1u << 2) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P3 (0x1u << 3) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P4 (0x1u << 4) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P5 (0x1u << 5) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P6 (0x1u << 6) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P7 (0x1u << 7) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P8 (0x1u << 8) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P9 (0x1u << 9) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P10 (0x1u << 10) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P11 (0x1u << 11) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P12 (0x1u << 12) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P13 (0x1u << 13) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P14 (0x1u << 14) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P15 (0x1u << 15) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P16 (0x1u << 16) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P17 (0x1u << 17) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P18 (0x1u << 18) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P19 (0x1u << 19) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P20 (0x1u << 20) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P21 (0x1u << 21) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P22 (0x1u << 22) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P23 (0x1u << 23) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P24 (0x1u << 24) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P25 (0x1u << 25) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P26 (0x1u << 26) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P27 (0x1u << 27) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P28 (0x1u << 28) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P29 (0x1u << 29) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P30 (0x1u << 30) /**< \brief (GPIO_IERC) Interrupt Enable */ +#define GPIO_IERC_P31 (0x1u << 31) /**< \brief (GPIO_IERC) Interrupt Enable */ +/* -------- GPIO_IERT : (GPIO Offset: 0x09C) Port Interrupt Enable Register - Toggle -------- */ +#define GPIO_IERT_P0 (0x1u << 0) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P1 (0x1u << 1) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P2 (0x1u << 2) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P3 (0x1u << 3) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P4 (0x1u << 4) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P5 (0x1u << 5) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P6 (0x1u << 6) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P7 (0x1u << 7) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P8 (0x1u << 8) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P9 (0x1u << 9) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P10 (0x1u << 10) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P11 (0x1u << 11) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P12 (0x1u << 12) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P13 (0x1u << 13) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P14 (0x1u << 14) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P15 (0x1u << 15) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P16 (0x1u << 16) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P17 (0x1u << 17) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P18 (0x1u << 18) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P19 (0x1u << 19) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P20 (0x1u << 20) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P21 (0x1u << 21) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P22 (0x1u << 22) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P23 (0x1u << 23) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P24 (0x1u << 24) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P25 (0x1u << 25) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P26 (0x1u << 26) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P27 (0x1u << 27) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P28 (0x1u << 28) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P29 (0x1u << 29) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P30 (0x1u << 30) /**< \brief (GPIO_IERT) Interrupt Enable */ +#define GPIO_IERT_P31 (0x1u << 31) /**< \brief (GPIO_IERT) Interrupt Enable */ +/* -------- GPIO_IMR0 : (GPIO Offset: 0x0A0) Port Interrupt Mode Register 0 -------- */ +#define GPIO_IMR0_P0 (0x1u << 0) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P1 (0x1u << 1) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P2 (0x1u << 2) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P3 (0x1u << 3) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P4 (0x1u << 4) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P5 (0x1u << 5) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P6 (0x1u << 6) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P7 (0x1u << 7) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P8 (0x1u << 8) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P9 (0x1u << 9) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P10 (0x1u << 10) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P11 (0x1u << 11) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P12 (0x1u << 12) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P13 (0x1u << 13) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P14 (0x1u << 14) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P15 (0x1u << 15) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P16 (0x1u << 16) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P17 (0x1u << 17) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P18 (0x1u << 18) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P19 (0x1u << 19) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P20 (0x1u << 20) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P21 (0x1u << 21) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P22 (0x1u << 22) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P23 (0x1u << 23) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P24 (0x1u << 24) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P25 (0x1u << 25) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P26 (0x1u << 26) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P27 (0x1u << 27) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P28 (0x1u << 28) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P29 (0x1u << 29) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P30 (0x1u << 30) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +#define GPIO_IMR0_P31 (0x1u << 31) /**< \brief (GPIO_IMR0) Interrupt Mode Bit 0 */ +/* -------- GPIO_IMR0S : (GPIO Offset: 0x0A4) Port Interrupt Mode Register 0 - Set -------- */ +#define GPIO_IMR0S_P0 (0x1u << 0) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P1 (0x1u << 1) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P2 (0x1u << 2) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P3 (0x1u << 3) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P4 (0x1u << 4) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P5 (0x1u << 5) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P6 (0x1u << 6) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P7 (0x1u << 7) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P8 (0x1u << 8) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P9 (0x1u << 9) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P10 (0x1u << 10) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P11 (0x1u << 11) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P12 (0x1u << 12) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P13 (0x1u << 13) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P14 (0x1u << 14) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P15 (0x1u << 15) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P16 (0x1u << 16) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P17 (0x1u << 17) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P18 (0x1u << 18) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P19 (0x1u << 19) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P20 (0x1u << 20) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P21 (0x1u << 21) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P22 (0x1u << 22) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P23 (0x1u << 23) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P24 (0x1u << 24) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P25 (0x1u << 25) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P26 (0x1u << 26) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P27 (0x1u << 27) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P28 (0x1u << 28) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P29 (0x1u << 29) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P30 (0x1u << 30) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +#define GPIO_IMR0S_P31 (0x1u << 31) /**< \brief (GPIO_IMR0S) Interrupt Mode Bit 0 */ +/* -------- GPIO_IMR0C : (GPIO Offset: 0x0A8) Port Interrupt Mode Register 0 - Clear -------- */ +#define GPIO_IMR0C_P0 (0x1u << 0) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P1 (0x1u << 1) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P2 (0x1u << 2) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P3 (0x1u << 3) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P4 (0x1u << 4) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P5 (0x1u << 5) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P6 (0x1u << 6) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P7 (0x1u << 7) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P8 (0x1u << 8) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P9 (0x1u << 9) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P10 (0x1u << 10) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P11 (0x1u << 11) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P12 (0x1u << 12) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P13 (0x1u << 13) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P14 (0x1u << 14) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P15 (0x1u << 15) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P16 (0x1u << 16) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P17 (0x1u << 17) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P18 (0x1u << 18) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P19 (0x1u << 19) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P20 (0x1u << 20) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P21 (0x1u << 21) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P22 (0x1u << 22) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P23 (0x1u << 23) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P24 (0x1u << 24) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P25 (0x1u << 25) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P26 (0x1u << 26) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P27 (0x1u << 27) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P28 (0x1u << 28) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P29 (0x1u << 29) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P30 (0x1u << 30) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +#define GPIO_IMR0C_P31 (0x1u << 31) /**< \brief (GPIO_IMR0C) Interrupt Mode Bit 0 */ +/* -------- GPIO_IMR0T : (GPIO Offset: 0x0AC) Port Interrupt Mode Register 0 - Toggle -------- */ +#define GPIO_IMR0T_P0 (0x1u << 0) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P1 (0x1u << 1) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P2 (0x1u << 2) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P3 (0x1u << 3) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P4 (0x1u << 4) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P5 (0x1u << 5) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P6 (0x1u << 6) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P7 (0x1u << 7) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P8 (0x1u << 8) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P9 (0x1u << 9) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P10 (0x1u << 10) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P11 (0x1u << 11) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P12 (0x1u << 12) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P13 (0x1u << 13) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P14 (0x1u << 14) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P15 (0x1u << 15) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P16 (0x1u << 16) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P17 (0x1u << 17) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P18 (0x1u << 18) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P19 (0x1u << 19) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P20 (0x1u << 20) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P21 (0x1u << 21) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P22 (0x1u << 22) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P23 (0x1u << 23) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P24 (0x1u << 24) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P25 (0x1u << 25) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P26 (0x1u << 26) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P27 (0x1u << 27) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P28 (0x1u << 28) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P29 (0x1u << 29) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P30 (0x1u << 30) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +#define GPIO_IMR0T_P31 (0x1u << 31) /**< \brief (GPIO_IMR0T) Interrupt Mode Bit 0 */ +/* -------- GPIO_IMR1 : (GPIO Offset: 0x0B0) Port Interrupt Mode Register 1 -------- */ +#define GPIO_IMR1_P0 (0x1u << 0) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P1 (0x1u << 1) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P2 (0x1u << 2) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P3 (0x1u << 3) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P4 (0x1u << 4) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P5 (0x1u << 5) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P6 (0x1u << 6) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P7 (0x1u << 7) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P8 (0x1u << 8) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P9 (0x1u << 9) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P10 (0x1u << 10) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P11 (0x1u << 11) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P12 (0x1u << 12) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P13 (0x1u << 13) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P14 (0x1u << 14) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P15 (0x1u << 15) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P16 (0x1u << 16) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P17 (0x1u << 17) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P18 (0x1u << 18) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P19 (0x1u << 19) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P20 (0x1u << 20) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P21 (0x1u << 21) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P22 (0x1u << 22) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P23 (0x1u << 23) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P24 (0x1u << 24) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P25 (0x1u << 25) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P26 (0x1u << 26) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P27 (0x1u << 27) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P28 (0x1u << 28) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P29 (0x1u << 29) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P30 (0x1u << 30) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +#define GPIO_IMR1_P31 (0x1u << 31) /**< \brief (GPIO_IMR1) Interrupt Mode Bit 1 */ +/* -------- GPIO_IMR1S : (GPIO Offset: 0x0B4) Port Interrupt Mode Register 1 - Set -------- */ +#define GPIO_IMR1S_P0 (0x1u << 0) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P1 (0x1u << 1) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P2 (0x1u << 2) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P3 (0x1u << 3) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P4 (0x1u << 4) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P5 (0x1u << 5) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P6 (0x1u << 6) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P7 (0x1u << 7) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P8 (0x1u << 8) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P9 (0x1u << 9) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P10 (0x1u << 10) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P11 (0x1u << 11) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P12 (0x1u << 12) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P13 (0x1u << 13) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P14 (0x1u << 14) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P15 (0x1u << 15) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P16 (0x1u << 16) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P17 (0x1u << 17) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P18 (0x1u << 18) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P19 (0x1u << 19) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P20 (0x1u << 20) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P21 (0x1u << 21) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P22 (0x1u << 22) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P23 (0x1u << 23) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P24 (0x1u << 24) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P25 (0x1u << 25) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P26 (0x1u << 26) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P27 (0x1u << 27) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P28 (0x1u << 28) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P29 (0x1u << 29) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P30 (0x1u << 30) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +#define GPIO_IMR1S_P31 (0x1u << 31) /**< \brief (GPIO_IMR1S) Interrupt Mode Bit 1 */ +/* -------- GPIO_IMR1C : (GPIO Offset: 0x0B8) Port Interrupt Mode Register 1 - Clear -------- */ +#define GPIO_IMR1C_P0 (0x1u << 0) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P1 (0x1u << 1) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P2 (0x1u << 2) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P3 (0x1u << 3) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P4 (0x1u << 4) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P5 (0x1u << 5) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P6 (0x1u << 6) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P7 (0x1u << 7) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P8 (0x1u << 8) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P9 (0x1u << 9) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P10 (0x1u << 10) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P11 (0x1u << 11) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P12 (0x1u << 12) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P13 (0x1u << 13) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P14 (0x1u << 14) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P15 (0x1u << 15) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P16 (0x1u << 16) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P17 (0x1u << 17) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P18 (0x1u << 18) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P19 (0x1u << 19) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P20 (0x1u << 20) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P21 (0x1u << 21) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P22 (0x1u << 22) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P23 (0x1u << 23) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P24 (0x1u << 24) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P25 (0x1u << 25) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P26 (0x1u << 26) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P27 (0x1u << 27) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P28 (0x1u << 28) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P29 (0x1u << 29) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P30 (0x1u << 30) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +#define GPIO_IMR1C_P31 (0x1u << 31) /**< \brief (GPIO_IMR1C) Interrupt Mode Bit 1 */ +/* -------- GPIO_IMR1T : (GPIO Offset: 0x0BC) Port Interrupt Mode Register 1 - Toggle -------- */ +#define GPIO_IMR1T_P0 (0x1u << 0) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P1 (0x1u << 1) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P2 (0x1u << 2) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P3 (0x1u << 3) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P4 (0x1u << 4) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P5 (0x1u << 5) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P6 (0x1u << 6) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P7 (0x1u << 7) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P8 (0x1u << 8) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P9 (0x1u << 9) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P10 (0x1u << 10) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P11 (0x1u << 11) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P12 (0x1u << 12) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P13 (0x1u << 13) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P14 (0x1u << 14) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P15 (0x1u << 15) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P16 (0x1u << 16) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P17 (0x1u << 17) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P18 (0x1u << 18) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P19 (0x1u << 19) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P20 (0x1u << 20) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P21 (0x1u << 21) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P22 (0x1u << 22) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P23 (0x1u << 23) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P24 (0x1u << 24) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P25 (0x1u << 25) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P26 (0x1u << 26) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P27 (0x1u << 27) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P28 (0x1u << 28) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P29 (0x1u << 29) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P30 (0x1u << 30) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +#define GPIO_IMR1T_P31 (0x1u << 31) /**< \brief (GPIO_IMR1T) Interrupt Mode Bit 1 */ +/* -------- GPIO_GFER : (GPIO Offset: 0x0C0) Port Glitch Filter Enable Register -------- */ +#define GPIO_GFER_P0 (0x1u << 0) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P1 (0x1u << 1) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P2 (0x1u << 2) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P3 (0x1u << 3) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P4 (0x1u << 4) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P5 (0x1u << 5) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P6 (0x1u << 6) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P7 (0x1u << 7) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P8 (0x1u << 8) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P9 (0x1u << 9) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P10 (0x1u << 10) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P11 (0x1u << 11) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P12 (0x1u << 12) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P13 (0x1u << 13) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P14 (0x1u << 14) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P15 (0x1u << 15) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P16 (0x1u << 16) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P17 (0x1u << 17) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P18 (0x1u << 18) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P19 (0x1u << 19) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P20 (0x1u << 20) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P21 (0x1u << 21) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P22 (0x1u << 22) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P23 (0x1u << 23) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P24 (0x1u << 24) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P25 (0x1u << 25) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P26 (0x1u << 26) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P27 (0x1u << 27) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P28 (0x1u << 28) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P29 (0x1u << 29) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P30 (0x1u << 30) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +#define GPIO_GFER_P31 (0x1u << 31) /**< \brief (GPIO_GFER) Glitch Filter Enable */ +/* -------- GPIO_GFERS : (GPIO Offset: 0x0C4) Port Glitch Filter Enable Register - Set -------- */ +#define GPIO_GFERS_P0 (0x1u << 0) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P1 (0x1u << 1) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P2 (0x1u << 2) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P3 (0x1u << 3) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P4 (0x1u << 4) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P5 (0x1u << 5) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P6 (0x1u << 6) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P7 (0x1u << 7) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P8 (0x1u << 8) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P9 (0x1u << 9) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P10 (0x1u << 10) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P11 (0x1u << 11) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P12 (0x1u << 12) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P13 (0x1u << 13) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P14 (0x1u << 14) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P15 (0x1u << 15) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P16 (0x1u << 16) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P17 (0x1u << 17) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P18 (0x1u << 18) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P19 (0x1u << 19) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P20 (0x1u << 20) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P21 (0x1u << 21) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P22 (0x1u << 22) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P23 (0x1u << 23) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P24 (0x1u << 24) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P25 (0x1u << 25) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P26 (0x1u << 26) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P27 (0x1u << 27) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P28 (0x1u << 28) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P29 (0x1u << 29) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P30 (0x1u << 30) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +#define GPIO_GFERS_P31 (0x1u << 31) /**< \brief (GPIO_GFERS) Glitch Filter Enable */ +/* -------- GPIO_GFERC : (GPIO Offset: 0x0C8) Port Glitch Filter Enable Register - Clear -------- */ +#define GPIO_GFERC_P0 (0x1u << 0) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P1 (0x1u << 1) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P2 (0x1u << 2) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P3 (0x1u << 3) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P4 (0x1u << 4) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P5 (0x1u << 5) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P6 (0x1u << 6) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P7 (0x1u << 7) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P8 (0x1u << 8) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P9 (0x1u << 9) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P10 (0x1u << 10) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P11 (0x1u << 11) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P12 (0x1u << 12) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P13 (0x1u << 13) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P14 (0x1u << 14) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P15 (0x1u << 15) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P16 (0x1u << 16) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P17 (0x1u << 17) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P18 (0x1u << 18) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P19 (0x1u << 19) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P20 (0x1u << 20) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P21 (0x1u << 21) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P22 (0x1u << 22) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P23 (0x1u << 23) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P24 (0x1u << 24) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P25 (0x1u << 25) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P26 (0x1u << 26) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P27 (0x1u << 27) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P28 (0x1u << 28) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P29 (0x1u << 29) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P30 (0x1u << 30) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +#define GPIO_GFERC_P31 (0x1u << 31) /**< \brief (GPIO_GFERC) Glitch Filter Enable */ +/* -------- GPIO_GFERT : (GPIO Offset: 0x0CC) Port Glitch Filter Enable Register - Toggle -------- */ +#define GPIO_GFERT_P0 (0x1u << 0) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P1 (0x1u << 1) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P2 (0x1u << 2) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P3 (0x1u << 3) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P4 (0x1u << 4) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P5 (0x1u << 5) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P6 (0x1u << 6) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P7 (0x1u << 7) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P8 (0x1u << 8) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P9 (0x1u << 9) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P10 (0x1u << 10) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P11 (0x1u << 11) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P12 (0x1u << 12) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P13 (0x1u << 13) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P14 (0x1u << 14) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P15 (0x1u << 15) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P16 (0x1u << 16) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P17 (0x1u << 17) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P18 (0x1u << 18) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P19 (0x1u << 19) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P20 (0x1u << 20) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P21 (0x1u << 21) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P22 (0x1u << 22) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P23 (0x1u << 23) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P24 (0x1u << 24) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P25 (0x1u << 25) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P26 (0x1u << 26) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P27 (0x1u << 27) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P28 (0x1u << 28) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P29 (0x1u << 29) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P30 (0x1u << 30) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +#define GPIO_GFERT_P31 (0x1u << 31) /**< \brief (GPIO_GFERT) Glitch Filter Enable */ +/* -------- GPIO_IFR : (GPIO Offset: 0x0D0) Port Interrupt Flag Register -------- */ +#define GPIO_IFR_P0 (0x1u << 0) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P1 (0x1u << 1) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P2 (0x1u << 2) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P3 (0x1u << 3) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P4 (0x1u << 4) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P5 (0x1u << 5) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P6 (0x1u << 6) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P7 (0x1u << 7) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P8 (0x1u << 8) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P9 (0x1u << 9) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P10 (0x1u << 10) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P11 (0x1u << 11) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P12 (0x1u << 12) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P13 (0x1u << 13) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P14 (0x1u << 14) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P15 (0x1u << 15) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P16 (0x1u << 16) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P17 (0x1u << 17) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P18 (0x1u << 18) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P19 (0x1u << 19) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P20 (0x1u << 20) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P21 (0x1u << 21) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P22 (0x1u << 22) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P23 (0x1u << 23) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P24 (0x1u << 24) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P25 (0x1u << 25) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P26 (0x1u << 26) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P27 (0x1u << 27) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P28 (0x1u << 28) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P29 (0x1u << 29) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P30 (0x1u << 30) /**< \brief (GPIO_IFR) Interrupt Flag */ +#define GPIO_IFR_P31 (0x1u << 31) /**< \brief (GPIO_IFR) Interrupt Flag */ +/* -------- GPIO_IFRC : (GPIO Offset: 0x0D8) Port Interrupt Flag Register - Clear -------- */ +#define GPIO_IFRC_P0 (0x1u << 0) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P1 (0x1u << 1) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P2 (0x1u << 2) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P3 (0x1u << 3) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P4 (0x1u << 4) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P5 (0x1u << 5) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P6 (0x1u << 6) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P7 (0x1u << 7) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P8 (0x1u << 8) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P9 (0x1u << 9) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P10 (0x1u << 10) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P11 (0x1u << 11) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P12 (0x1u << 12) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P13 (0x1u << 13) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P14 (0x1u << 14) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P15 (0x1u << 15) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P16 (0x1u << 16) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P17 (0x1u << 17) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P18 (0x1u << 18) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P19 (0x1u << 19) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P20 (0x1u << 20) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P21 (0x1u << 21) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P22 (0x1u << 22) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P23 (0x1u << 23) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P24 (0x1u << 24) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P25 (0x1u << 25) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P26 (0x1u << 26) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P27 (0x1u << 27) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P28 (0x1u << 28) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P29 (0x1u << 29) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P30 (0x1u << 30) /**< \brief (GPIO_IFRC) Interrupt Flag */ +#define GPIO_IFRC_P31 (0x1u << 31) /**< \brief (GPIO_IFRC) Interrupt Flag */ +/* -------- GPIO_ODMER : (GPIO Offset: 0x0E0) Port Open Drain Mode Register -------- */ +#define GPIO_ODMER_P0 (0x1u << 0) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P1 (0x1u << 1) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P2 (0x1u << 2) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P3 (0x1u << 3) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P4 (0x1u << 4) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P5 (0x1u << 5) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P6 (0x1u << 6) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P7 (0x1u << 7) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P8 (0x1u << 8) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P9 (0x1u << 9) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P10 (0x1u << 10) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P11 (0x1u << 11) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P12 (0x1u << 12) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P13 (0x1u << 13) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P14 (0x1u << 14) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P15 (0x1u << 15) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P16 (0x1u << 16) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P17 (0x1u << 17) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P18 (0x1u << 18) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P19 (0x1u << 19) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P20 (0x1u << 20) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P21 (0x1u << 21) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P22 (0x1u << 22) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P23 (0x1u << 23) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P24 (0x1u << 24) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P25 (0x1u << 25) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P26 (0x1u << 26) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P27 (0x1u << 27) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P28 (0x1u << 28) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P29 (0x1u << 29) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P30 (0x1u << 30) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +#define GPIO_ODMER_P31 (0x1u << 31) /**< \brief (GPIO_ODMER) Open Drain Mode Enable */ +/* -------- GPIO_ODMERS : (GPIO Offset: 0x0E4) Port Open Drain Mode Register - Set -------- */ +#define GPIO_ODMERS_P0 (0x1u << 0) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P1 (0x1u << 1) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P2 (0x1u << 2) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P3 (0x1u << 3) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P4 (0x1u << 4) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P5 (0x1u << 5) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P6 (0x1u << 6) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P7 (0x1u << 7) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P8 (0x1u << 8) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P9 (0x1u << 9) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P10 (0x1u << 10) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P11 (0x1u << 11) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P12 (0x1u << 12) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P13 (0x1u << 13) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P14 (0x1u << 14) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P15 (0x1u << 15) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P16 (0x1u << 16) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P17 (0x1u << 17) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P18 (0x1u << 18) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P19 (0x1u << 19) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P20 (0x1u << 20) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P21 (0x1u << 21) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P22 (0x1u << 22) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P23 (0x1u << 23) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P24 (0x1u << 24) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P25 (0x1u << 25) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P26 (0x1u << 26) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P27 (0x1u << 27) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P28 (0x1u << 28) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P29 (0x1u << 29) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P30 (0x1u << 30) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +#define GPIO_ODMERS_P31 (0x1u << 31) /**< \brief (GPIO_ODMERS) Open Drain Mode Enable */ +/* -------- GPIO_ODMERC : (GPIO Offset: 0x0E8) Port Open Drain Mode Register - Clear -------- */ +#define GPIO_ODMERC_P0 (0x1u << 0) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P1 (0x1u << 1) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P2 (0x1u << 2) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P3 (0x1u << 3) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P4 (0x1u << 4) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P5 (0x1u << 5) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P6 (0x1u << 6) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P7 (0x1u << 7) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P8 (0x1u << 8) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P9 (0x1u << 9) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P10 (0x1u << 10) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P11 (0x1u << 11) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P12 (0x1u << 12) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P13 (0x1u << 13) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P14 (0x1u << 14) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P15 (0x1u << 15) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P16 (0x1u << 16) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P17 (0x1u << 17) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P18 (0x1u << 18) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P19 (0x1u << 19) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P20 (0x1u << 20) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P21 (0x1u << 21) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P22 (0x1u << 22) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P23 (0x1u << 23) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P24 (0x1u << 24) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P25 (0x1u << 25) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P26 (0x1u << 26) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P27 (0x1u << 27) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P28 (0x1u << 28) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P29 (0x1u << 29) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P30 (0x1u << 30) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +#define GPIO_ODMERC_P31 (0x1u << 31) /**< \brief (GPIO_ODMERC) Open Drain Mode Enable */ +/* -------- GPIO_ODMERT : (GPIO Offset: 0x0EC) Port Open Drain Mode Register - Toggle -------- */ +#define GPIO_ODMERT_P0 (0x1u << 0) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P1 (0x1u << 1) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P2 (0x1u << 2) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P3 (0x1u << 3) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P4 (0x1u << 4) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P5 (0x1u << 5) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P6 (0x1u << 6) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P7 (0x1u << 7) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P8 (0x1u << 8) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P9 (0x1u << 9) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P10 (0x1u << 10) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P11 (0x1u << 11) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P12 (0x1u << 12) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P13 (0x1u << 13) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P14 (0x1u << 14) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P15 (0x1u << 15) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P16 (0x1u << 16) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P17 (0x1u << 17) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P18 (0x1u << 18) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P19 (0x1u << 19) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P20 (0x1u << 20) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P21 (0x1u << 21) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P22 (0x1u << 22) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P23 (0x1u << 23) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P24 (0x1u << 24) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P25 (0x1u << 25) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P26 (0x1u << 26) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P27 (0x1u << 27) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P28 (0x1u << 28) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P29 (0x1u << 29) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P30 (0x1u << 30) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +#define GPIO_ODMERT_P31 (0x1u << 31) /**< \brief (GPIO_ODMERT) Open Drain Mode Enable */ +/* -------- GPIO_ODCR0 : (GPIO Offset: 0x100) Port Output Driving Capability Register 0 -------- */ +#define GPIO_ODCR0_P0 (0x1u << 0) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P1 (0x1u << 1) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P2 (0x1u << 2) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P3 (0x1u << 3) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P4 (0x1u << 4) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P5 (0x1u << 5) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P6 (0x1u << 6) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P7 (0x1u << 7) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P8 (0x1u << 8) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P9 (0x1u << 9) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P10 (0x1u << 10) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P11 (0x1u << 11) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P12 (0x1u << 12) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P13 (0x1u << 13) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P14 (0x1u << 14) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P15 (0x1u << 15) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P16 (0x1u << 16) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P17 (0x1u << 17) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P18 (0x1u << 18) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P19 (0x1u << 19) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P20 (0x1u << 20) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P21 (0x1u << 21) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P22 (0x1u << 22) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P23 (0x1u << 23) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P24 (0x1u << 24) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P25 (0x1u << 25) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P26 (0x1u << 26) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P27 (0x1u << 27) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P28 (0x1u << 28) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P29 (0x1u << 29) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P30 (0x1u << 30) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0_P31 (0x1u << 31) /**< \brief (GPIO_ODCR0) Output Driving Capability Register Bit 0 */ +/* -------- GPIO_ODCR0S : (GPIO Offset: 0x104) Port Output Driving Capability Register 0 - Set -------- */ +#define GPIO_ODCR0S_P0 (0x1u << 0) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P1 (0x1u << 1) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P2 (0x1u << 2) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P3 (0x1u << 3) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P4 (0x1u << 4) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P5 (0x1u << 5) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P6 (0x1u << 6) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P7 (0x1u << 7) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P8 (0x1u << 8) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P9 (0x1u << 9) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P10 (0x1u << 10) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P11 (0x1u << 11) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P12 (0x1u << 12) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P13 (0x1u << 13) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P14 (0x1u << 14) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P15 (0x1u << 15) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P16 (0x1u << 16) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P17 (0x1u << 17) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P18 (0x1u << 18) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P19 (0x1u << 19) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P20 (0x1u << 20) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P21 (0x1u << 21) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P22 (0x1u << 22) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P23 (0x1u << 23) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P24 (0x1u << 24) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P25 (0x1u << 25) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P26 (0x1u << 26) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P27 (0x1u << 27) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P28 (0x1u << 28) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P29 (0x1u << 29) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P30 (0x1u << 30) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0S_P31 (0x1u << 31) /**< \brief (GPIO_ODCR0S) Output Driving Capability Register Bit 0 */ +/* -------- GPIO_ODCR0C : (GPIO Offset: 0x108) Port Output Driving Capability Register 0 - Clear -------- */ +#define GPIO_ODCR0C_P0 (0x1u << 0) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P1 (0x1u << 1) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P2 (0x1u << 2) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P3 (0x1u << 3) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P4 (0x1u << 4) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P5 (0x1u << 5) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P6 (0x1u << 6) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P7 (0x1u << 7) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P8 (0x1u << 8) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P9 (0x1u << 9) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P10 (0x1u << 10) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P11 (0x1u << 11) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P12 (0x1u << 12) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P13 (0x1u << 13) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P14 (0x1u << 14) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P15 (0x1u << 15) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P16 (0x1u << 16) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P17 (0x1u << 17) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P18 (0x1u << 18) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P19 (0x1u << 19) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P20 (0x1u << 20) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P21 (0x1u << 21) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P22 (0x1u << 22) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P23 (0x1u << 23) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P24 (0x1u << 24) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P25 (0x1u << 25) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P26 (0x1u << 26) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P27 (0x1u << 27) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P28 (0x1u << 28) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P29 (0x1u << 29) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P30 (0x1u << 30) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0C_P31 (0x1u << 31) /**< \brief (GPIO_ODCR0C) Output Driving Capability Register Bit 0 */ +/* -------- GPIO_ODCR0T : (GPIO Offset: 0x10C) Port Output Driving Capability Register 0 - Toggle -------- */ +#define GPIO_ODCR0T_P0 (0x1u << 0) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P1 (0x1u << 1) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P2 (0x1u << 2) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P3 (0x1u << 3) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P4 (0x1u << 4) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P5 (0x1u << 5) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P6 (0x1u << 6) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P7 (0x1u << 7) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P8 (0x1u << 8) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P9 (0x1u << 9) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P10 (0x1u << 10) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P11 (0x1u << 11) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P12 (0x1u << 12) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P13 (0x1u << 13) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P14 (0x1u << 14) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P15 (0x1u << 15) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P16 (0x1u << 16) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P17 (0x1u << 17) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P18 (0x1u << 18) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P19 (0x1u << 19) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P20 (0x1u << 20) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P21 (0x1u << 21) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P22 (0x1u << 22) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P23 (0x1u << 23) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P24 (0x1u << 24) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P25 (0x1u << 25) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P26 (0x1u << 26) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P27 (0x1u << 27) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P28 (0x1u << 28) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P29 (0x1u << 29) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P30 (0x1u << 30) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +#define GPIO_ODCR0T_P31 (0x1u << 31) /**< \brief (GPIO_ODCR0T) Output Driving Capability Register Bit 0 */ +/* -------- GPIO_ODCR1 : (GPIO Offset: 0x110) Port Output Driving Capability Register 1 -------- */ +#define GPIO_ODCR1_P0 (0x1u << 0) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P1 (0x1u << 1) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P2 (0x1u << 2) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P3 (0x1u << 3) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P4 (0x1u << 4) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P5 (0x1u << 5) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P6 (0x1u << 6) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P7 (0x1u << 7) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P8 (0x1u << 8) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P9 (0x1u << 9) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P10 (0x1u << 10) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P11 (0x1u << 11) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P12 (0x1u << 12) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P13 (0x1u << 13) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P14 (0x1u << 14) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P15 (0x1u << 15) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P16 (0x1u << 16) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P17 (0x1u << 17) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P18 (0x1u << 18) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P19 (0x1u << 19) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P20 (0x1u << 20) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P21 (0x1u << 21) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P22 (0x1u << 22) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P23 (0x1u << 23) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P24 (0x1u << 24) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P25 (0x1u << 25) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P26 (0x1u << 26) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P27 (0x1u << 27) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P28 (0x1u << 28) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P29 (0x1u << 29) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P30 (0x1u << 30) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1_P31 (0x1u << 31) /**< \brief (GPIO_ODCR1) Output Driving Capability Register Bit 1 */ +/* -------- GPIO_ODCR1S : (GPIO Offset: 0x114) Port Output Driving Capability Register 1 - Set -------- */ +#define GPIO_ODCR1S_P0 (0x1u << 0) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P1 (0x1u << 1) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P2 (0x1u << 2) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P3 (0x1u << 3) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P4 (0x1u << 4) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P5 (0x1u << 5) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P6 (0x1u << 6) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P7 (0x1u << 7) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P8 (0x1u << 8) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P9 (0x1u << 9) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P10 (0x1u << 10) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P11 (0x1u << 11) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P12 (0x1u << 12) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P13 (0x1u << 13) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P14 (0x1u << 14) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P15 (0x1u << 15) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P16 (0x1u << 16) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P17 (0x1u << 17) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P18 (0x1u << 18) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P19 (0x1u << 19) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P20 (0x1u << 20) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P21 (0x1u << 21) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P22 (0x1u << 22) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P23 (0x1u << 23) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P24 (0x1u << 24) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P25 (0x1u << 25) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P26 (0x1u << 26) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P27 (0x1u << 27) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P28 (0x1u << 28) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P29 (0x1u << 29) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P30 (0x1u << 30) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1S_P31 (0x1u << 31) /**< \brief (GPIO_ODCR1S) Output Driving Capability Register Bit 1 */ +/* -------- GPIO_ODCR1C : (GPIO Offset: 0x118) Port Output Driving Capability Register 1 - Clear -------- */ +#define GPIO_ODCR1C_P0 (0x1u << 0) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P1 (0x1u << 1) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P2 (0x1u << 2) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P3 (0x1u << 3) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P4 (0x1u << 4) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P5 (0x1u << 5) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P6 (0x1u << 6) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P7 (0x1u << 7) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P8 (0x1u << 8) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P9 (0x1u << 9) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P10 (0x1u << 10) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P11 (0x1u << 11) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P12 (0x1u << 12) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P13 (0x1u << 13) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P14 (0x1u << 14) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P15 (0x1u << 15) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P16 (0x1u << 16) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P17 (0x1u << 17) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P18 (0x1u << 18) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P19 (0x1u << 19) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P20 (0x1u << 20) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P21 (0x1u << 21) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P22 (0x1u << 22) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P23 (0x1u << 23) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P24 (0x1u << 24) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P25 (0x1u << 25) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P26 (0x1u << 26) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P27 (0x1u << 27) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P28 (0x1u << 28) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P29 (0x1u << 29) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P30 (0x1u << 30) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1C_P31 (0x1u << 31) /**< \brief (GPIO_ODCR1C) Output Driving Capability Register Bit 1 */ +/* -------- GPIO_ODCR1T : (GPIO Offset: 0x11C) Port Output Driving Capability Register 1 - Toggle -------- */ +#define GPIO_ODCR1T_P0 (0x1u << 0) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P1 (0x1u << 1) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P2 (0x1u << 2) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P3 (0x1u << 3) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P4 (0x1u << 4) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P5 (0x1u << 5) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P6 (0x1u << 6) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P7 (0x1u << 7) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P8 (0x1u << 8) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P9 (0x1u << 9) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P10 (0x1u << 10) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P11 (0x1u << 11) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P12 (0x1u << 12) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P13 (0x1u << 13) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P14 (0x1u << 14) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P15 (0x1u << 15) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P16 (0x1u << 16) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P17 (0x1u << 17) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P18 (0x1u << 18) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P19 (0x1u << 19) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P20 (0x1u << 20) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P21 (0x1u << 21) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P22 (0x1u << 22) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P23 (0x1u << 23) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P24 (0x1u << 24) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P25 (0x1u << 25) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P26 (0x1u << 26) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P27 (0x1u << 27) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P28 (0x1u << 28) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P29 (0x1u << 29) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P30 (0x1u << 30) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +#define GPIO_ODCR1T_P31 (0x1u << 31) /**< \brief (GPIO_ODCR1T) Output Driving Capability Register Bit 1 */ +/* -------- GPIO_OSRR0 : (GPIO Offset: 0x130) Port Output Slew Rate Register 0 -------- */ +#define GPIO_OSRR0_P0 (0x1u << 0) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P1 (0x1u << 1) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P2 (0x1u << 2) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P3 (0x1u << 3) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P4 (0x1u << 4) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P5 (0x1u << 5) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P6 (0x1u << 6) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P7 (0x1u << 7) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P8 (0x1u << 8) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P9 (0x1u << 9) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P10 (0x1u << 10) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P11 (0x1u << 11) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P12 (0x1u << 12) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P13 (0x1u << 13) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P14 (0x1u << 14) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P15 (0x1u << 15) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P16 (0x1u << 16) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P17 (0x1u << 17) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P18 (0x1u << 18) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P19 (0x1u << 19) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P20 (0x1u << 20) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P21 (0x1u << 21) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P22 (0x1u << 22) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P23 (0x1u << 23) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P24 (0x1u << 24) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P25 (0x1u << 25) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P26 (0x1u << 26) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P27 (0x1u << 27) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P28 (0x1u << 28) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P29 (0x1u << 29) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P30 (0x1u << 30) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +#define GPIO_OSRR0_P31 (0x1u << 31) /**< \brief (GPIO_OSRR0) Output Slew Rate Control Enable */ +/* -------- GPIO_OSRR0S : (GPIO Offset: 0x134) Port Output Slew Rate Register 0 - Set -------- */ +#define GPIO_OSRR0S_P0 (0x1u << 0) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P1 (0x1u << 1) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P2 (0x1u << 2) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P3 (0x1u << 3) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P4 (0x1u << 4) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P5 (0x1u << 5) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P6 (0x1u << 6) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P7 (0x1u << 7) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P8 (0x1u << 8) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P9 (0x1u << 9) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P10 (0x1u << 10) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P11 (0x1u << 11) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P12 (0x1u << 12) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P13 (0x1u << 13) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P14 (0x1u << 14) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P15 (0x1u << 15) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P16 (0x1u << 16) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P17 (0x1u << 17) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P18 (0x1u << 18) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P19 (0x1u << 19) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P20 (0x1u << 20) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P21 (0x1u << 21) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P22 (0x1u << 22) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P23 (0x1u << 23) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P24 (0x1u << 24) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P25 (0x1u << 25) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P26 (0x1u << 26) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P27 (0x1u << 27) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P28 (0x1u << 28) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P29 (0x1u << 29) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P30 (0x1u << 30) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +#define GPIO_OSRR0S_P31 (0x1u << 31) /**< \brief (GPIO_OSRR0S) Output Slew Rate Control Enable */ +/* -------- GPIO_OSRR0C : (GPIO Offset: 0x138) Port Output Slew Rate Register 0 - Clear -------- */ +#define GPIO_OSRR0C_P0 (0x1u << 0) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P1 (0x1u << 1) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P2 (0x1u << 2) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P3 (0x1u << 3) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P4 (0x1u << 4) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P5 (0x1u << 5) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P6 (0x1u << 6) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P7 (0x1u << 7) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P8 (0x1u << 8) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P9 (0x1u << 9) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P10 (0x1u << 10) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P11 (0x1u << 11) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P12 (0x1u << 12) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P13 (0x1u << 13) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P14 (0x1u << 14) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P15 (0x1u << 15) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P16 (0x1u << 16) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P17 (0x1u << 17) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P18 (0x1u << 18) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P19 (0x1u << 19) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P20 (0x1u << 20) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P21 (0x1u << 21) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P22 (0x1u << 22) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P23 (0x1u << 23) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P24 (0x1u << 24) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P25 (0x1u << 25) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P26 (0x1u << 26) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P27 (0x1u << 27) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P28 (0x1u << 28) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P29 (0x1u << 29) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P30 (0x1u << 30) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +#define GPIO_OSRR0C_P31 (0x1u << 31) /**< \brief (GPIO_OSRR0C) Output Slew Rate Control Enable */ +/* -------- GPIO_OSRR0T : (GPIO Offset: 0x13C) Port Output Slew Rate Register 0 - Toggle -------- */ +#define GPIO_OSRR0T_P0 (0x1u << 0) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P1 (0x1u << 1) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P2 (0x1u << 2) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P3 (0x1u << 3) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P4 (0x1u << 4) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P5 (0x1u << 5) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P6 (0x1u << 6) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P7 (0x1u << 7) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P8 (0x1u << 8) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P9 (0x1u << 9) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P10 (0x1u << 10) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P11 (0x1u << 11) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P12 (0x1u << 12) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P13 (0x1u << 13) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P14 (0x1u << 14) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P15 (0x1u << 15) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P16 (0x1u << 16) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P17 (0x1u << 17) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P18 (0x1u << 18) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P19 (0x1u << 19) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P20 (0x1u << 20) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P21 (0x1u << 21) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P22 (0x1u << 22) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P23 (0x1u << 23) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P24 (0x1u << 24) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P25 (0x1u << 25) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P26 (0x1u << 26) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P27 (0x1u << 27) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P28 (0x1u << 28) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P29 (0x1u << 29) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P30 (0x1u << 30) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +#define GPIO_OSRR0T_P31 (0x1u << 31) /**< \brief (GPIO_OSRR0T) Output Slew Rate Control Enable */ +/* -------- GPIO_STER : (GPIO Offset: 0x160) Port Schmitt Trigger Enable Register -------- */ +#define GPIO_STER_P0 (0x1u << 0) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P1 (0x1u << 1) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P2 (0x1u << 2) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P3 (0x1u << 3) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P4 (0x1u << 4) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P5 (0x1u << 5) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P6 (0x1u << 6) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P7 (0x1u << 7) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P8 (0x1u << 8) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P9 (0x1u << 9) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P10 (0x1u << 10) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P11 (0x1u << 11) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P12 (0x1u << 12) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P13 (0x1u << 13) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P14 (0x1u << 14) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P15 (0x1u << 15) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P16 (0x1u << 16) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P17 (0x1u << 17) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P18 (0x1u << 18) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P19 (0x1u << 19) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P20 (0x1u << 20) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P21 (0x1u << 21) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P22 (0x1u << 22) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P23 (0x1u << 23) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P24 (0x1u << 24) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P25 (0x1u << 25) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P26 (0x1u << 26) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P27 (0x1u << 27) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P28 (0x1u << 28) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P29 (0x1u << 29) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P30 (0x1u << 30) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +#define GPIO_STER_P31 (0x1u << 31) /**< \brief (GPIO_STER) Schmitt Trigger Enable */ +/* -------- GPIO_STERS : (GPIO Offset: 0x164) Port Schmitt Trigger Enable Register - Set -------- */ +#define GPIO_STERS_P0 (0x1u << 0) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P1 (0x1u << 1) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P2 (0x1u << 2) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P3 (0x1u << 3) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P4 (0x1u << 4) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P5 (0x1u << 5) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P6 (0x1u << 6) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P7 (0x1u << 7) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P8 (0x1u << 8) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P9 (0x1u << 9) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P10 (0x1u << 10) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P11 (0x1u << 11) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P12 (0x1u << 12) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P13 (0x1u << 13) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P14 (0x1u << 14) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P15 (0x1u << 15) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P16 (0x1u << 16) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P17 (0x1u << 17) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P18 (0x1u << 18) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P19 (0x1u << 19) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P20 (0x1u << 20) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P21 (0x1u << 21) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P22 (0x1u << 22) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P23 (0x1u << 23) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P24 (0x1u << 24) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P25 (0x1u << 25) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P26 (0x1u << 26) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P27 (0x1u << 27) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P28 (0x1u << 28) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P29 (0x1u << 29) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P30 (0x1u << 30) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +#define GPIO_STERS_P31 (0x1u << 31) /**< \brief (GPIO_STERS) Schmitt Trigger Enable */ +/* -------- GPIO_STERC : (GPIO Offset: 0x168) Port Schmitt Trigger Enable Register - Clear -------- */ +#define GPIO_STERC_P0 (0x1u << 0) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P1 (0x1u << 1) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P2 (0x1u << 2) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P3 (0x1u << 3) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P4 (0x1u << 4) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P5 (0x1u << 5) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P6 (0x1u << 6) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P7 (0x1u << 7) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P8 (0x1u << 8) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P9 (0x1u << 9) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P10 (0x1u << 10) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P11 (0x1u << 11) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P12 (0x1u << 12) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P13 (0x1u << 13) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P14 (0x1u << 14) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P15 (0x1u << 15) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P16 (0x1u << 16) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P17 (0x1u << 17) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P18 (0x1u << 18) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P19 (0x1u << 19) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P20 (0x1u << 20) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P21 (0x1u << 21) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P22 (0x1u << 22) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P23 (0x1u << 23) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P24 (0x1u << 24) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P25 (0x1u << 25) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P26 (0x1u << 26) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P27 (0x1u << 27) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P28 (0x1u << 28) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P29 (0x1u << 29) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P30 (0x1u << 30) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +#define GPIO_STERC_P31 (0x1u << 31) /**< \brief (GPIO_STERC) Schmitt Trigger Enable */ +/* -------- GPIO_STERT : (GPIO Offset: 0x16C) Port Schmitt Trigger Enable Register - Toggle -------- */ +#define GPIO_STERT_P0 (0x1u << 0) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P1 (0x1u << 1) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P2 (0x1u << 2) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P3 (0x1u << 3) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P4 (0x1u << 4) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P5 (0x1u << 5) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P6 (0x1u << 6) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P7 (0x1u << 7) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P8 (0x1u << 8) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P9 (0x1u << 9) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P10 (0x1u << 10) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P11 (0x1u << 11) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P12 (0x1u << 12) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P13 (0x1u << 13) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P14 (0x1u << 14) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P15 (0x1u << 15) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P16 (0x1u << 16) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P17 (0x1u << 17) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P18 (0x1u << 18) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P19 (0x1u << 19) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P20 (0x1u << 20) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P21 (0x1u << 21) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P22 (0x1u << 22) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P23 (0x1u << 23) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P24 (0x1u << 24) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P25 (0x1u << 25) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P26 (0x1u << 26) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P27 (0x1u << 27) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P28 (0x1u << 28) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P29 (0x1u << 29) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P30 (0x1u << 30) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +#define GPIO_STERT_P31 (0x1u << 31) /**< \brief (GPIO_STERT) Schmitt Trigger Enable */ +/* -------- GPIO_EVER : (GPIO Offset: 0x180) Port Event Enable Register -------- */ +#define GPIO_EVER_P0 (0x1u << 0) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P1 (0x1u << 1) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P2 (0x1u << 2) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P3 (0x1u << 3) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P4 (0x1u << 4) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P5 (0x1u << 5) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P6 (0x1u << 6) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P7 (0x1u << 7) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P8 (0x1u << 8) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P9 (0x1u << 9) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P10 (0x1u << 10) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P11 (0x1u << 11) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P12 (0x1u << 12) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P13 (0x1u << 13) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P14 (0x1u << 14) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P15 (0x1u << 15) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P16 (0x1u << 16) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P17 (0x1u << 17) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P18 (0x1u << 18) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P19 (0x1u << 19) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P20 (0x1u << 20) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P21 (0x1u << 21) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P22 (0x1u << 22) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P23 (0x1u << 23) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P24 (0x1u << 24) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P25 (0x1u << 25) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P26 (0x1u << 26) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P27 (0x1u << 27) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P28 (0x1u << 28) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P29 (0x1u << 29) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P30 (0x1u << 30) /**< \brief (GPIO_EVER) Event Enable */ +#define GPIO_EVER_P31 (0x1u << 31) /**< \brief (GPIO_EVER) Event Enable */ +/* -------- GPIO_EVERS : (GPIO Offset: 0x184) Port Event Enable Register - Set -------- */ +#define GPIO_EVERS_P0 (0x1u << 0) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P1 (0x1u << 1) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P2 (0x1u << 2) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P3 (0x1u << 3) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P4 (0x1u << 4) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P5 (0x1u << 5) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P6 (0x1u << 6) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P7 (0x1u << 7) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P8 (0x1u << 8) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P9 (0x1u << 9) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P10 (0x1u << 10) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P11 (0x1u << 11) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P12 (0x1u << 12) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P13 (0x1u << 13) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P14 (0x1u << 14) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P15 (0x1u << 15) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P16 (0x1u << 16) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P17 (0x1u << 17) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P18 (0x1u << 18) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P19 (0x1u << 19) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P20 (0x1u << 20) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P21 (0x1u << 21) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P22 (0x1u << 22) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P23 (0x1u << 23) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P24 (0x1u << 24) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P25 (0x1u << 25) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P26 (0x1u << 26) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P27 (0x1u << 27) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P28 (0x1u << 28) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P29 (0x1u << 29) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P30 (0x1u << 30) /**< \brief (GPIO_EVERS) Event Enable */ +#define GPIO_EVERS_P31 (0x1u << 31) /**< \brief (GPIO_EVERS) Event Enable */ +/* -------- GPIO_EVERC : (GPIO Offset: 0x188) Port Event Enable Register - Clear -------- */ +#define GPIO_EVERC_P0 (0x1u << 0) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P1 (0x1u << 1) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P2 (0x1u << 2) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P3 (0x1u << 3) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P4 (0x1u << 4) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P5 (0x1u << 5) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P6 (0x1u << 6) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P7 (0x1u << 7) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P8 (0x1u << 8) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P9 (0x1u << 9) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P10 (0x1u << 10) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P11 (0x1u << 11) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P12 (0x1u << 12) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P13 (0x1u << 13) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P14 (0x1u << 14) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P15 (0x1u << 15) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P16 (0x1u << 16) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P17 (0x1u << 17) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P18 (0x1u << 18) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P19 (0x1u << 19) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P20 (0x1u << 20) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P21 (0x1u << 21) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P22 (0x1u << 22) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P23 (0x1u << 23) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P24 (0x1u << 24) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P25 (0x1u << 25) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P26 (0x1u << 26) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P27 (0x1u << 27) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P28 (0x1u << 28) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P29 (0x1u << 29) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P30 (0x1u << 30) /**< \brief (GPIO_EVERC) Event Enable */ +#define GPIO_EVERC_P31 (0x1u << 31) /**< \brief (GPIO_EVERC) Event Enable */ +/* -------- GPIO_EVERT : (GPIO Offset: 0x18C) Port Event Enable Register - Toggle -------- */ +#define GPIO_EVERT_P0 (0x1u << 0) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P1 (0x1u << 1) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P2 (0x1u << 2) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P3 (0x1u << 3) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P4 (0x1u << 4) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P5 (0x1u << 5) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P6 (0x1u << 6) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P7 (0x1u << 7) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P8 (0x1u << 8) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P9 (0x1u << 9) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P10 (0x1u << 10) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P11 (0x1u << 11) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P12 (0x1u << 12) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P13 (0x1u << 13) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P14 (0x1u << 14) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P15 (0x1u << 15) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P16 (0x1u << 16) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P17 (0x1u << 17) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P18 (0x1u << 18) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P19 (0x1u << 19) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P20 (0x1u << 20) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P21 (0x1u << 21) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P22 (0x1u << 22) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P23 (0x1u << 23) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P24 (0x1u << 24) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P25 (0x1u << 25) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P26 (0x1u << 26) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P27 (0x1u << 27) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P28 (0x1u << 28) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P29 (0x1u << 29) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P30 (0x1u << 30) /**< \brief (GPIO_EVERT) Event Enable */ +#define GPIO_EVERT_P31 (0x1u << 31) /**< \brief (GPIO_EVERT) Event Enable */ +/* -------- GPIO_LOCK : (GPIO Offset: 0x1A0) Port Lock Register -------- */ +#define GPIO_LOCK_P0 (0x1u << 0) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P1 (0x1u << 1) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P2 (0x1u << 2) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P3 (0x1u << 3) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P4 (0x1u << 4) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P5 (0x1u << 5) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P6 (0x1u << 6) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P7 (0x1u << 7) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P8 (0x1u << 8) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P9 (0x1u << 9) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P10 (0x1u << 10) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P11 (0x1u << 11) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P12 (0x1u << 12) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P13 (0x1u << 13) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P14 (0x1u << 14) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P15 (0x1u << 15) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P16 (0x1u << 16) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P17 (0x1u << 17) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P18 (0x1u << 18) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P19 (0x1u << 19) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P20 (0x1u << 20) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P21 (0x1u << 21) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P22 (0x1u << 22) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P23 (0x1u << 23) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P24 (0x1u << 24) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P25 (0x1u << 25) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P26 (0x1u << 26) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P27 (0x1u << 27) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P28 (0x1u << 28) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P29 (0x1u << 29) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P30 (0x1u << 30) /**< \brief (GPIO_LOCK) Lock State */ +#define GPIO_LOCK_P31 (0x1u << 31) /**< \brief (GPIO_LOCK) Lock State */ +/* -------- GPIO_LOCKS : (GPIO Offset: 0x1A4) Port Lock Register - Set -------- */ +#define GPIO_LOCKS_P0 (0x1u << 0) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P1 (0x1u << 1) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P2 (0x1u << 2) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P3 (0x1u << 3) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P4 (0x1u << 4) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P5 (0x1u << 5) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P6 (0x1u << 6) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P7 (0x1u << 7) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P8 (0x1u << 8) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P9 (0x1u << 9) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P10 (0x1u << 10) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P11 (0x1u << 11) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P12 (0x1u << 12) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P13 (0x1u << 13) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P14 (0x1u << 14) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P15 (0x1u << 15) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P16 (0x1u << 16) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P17 (0x1u << 17) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P18 (0x1u << 18) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P19 (0x1u << 19) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P20 (0x1u << 20) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P21 (0x1u << 21) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P22 (0x1u << 22) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P23 (0x1u << 23) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P24 (0x1u << 24) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P25 (0x1u << 25) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P26 (0x1u << 26) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P27 (0x1u << 27) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P28 (0x1u << 28) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P29 (0x1u << 29) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P30 (0x1u << 30) /**< \brief (GPIO_LOCKS) Lock State */ +#define GPIO_LOCKS_P31 (0x1u << 31) /**< \brief (GPIO_LOCKS) Lock State */ +/* -------- GPIO_LOCKC : (GPIO Offset: 0x1A8) Port Lock Register - Clear -------- */ +#define GPIO_LOCKC_P0 (0x1u << 0) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P1 (0x1u << 1) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P2 (0x1u << 2) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P3 (0x1u << 3) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P4 (0x1u << 4) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P5 (0x1u << 5) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P6 (0x1u << 6) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P7 (0x1u << 7) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P8 (0x1u << 8) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P9 (0x1u << 9) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P10 (0x1u << 10) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P11 (0x1u << 11) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P12 (0x1u << 12) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P13 (0x1u << 13) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P14 (0x1u << 14) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P15 (0x1u << 15) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P16 (0x1u << 16) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P17 (0x1u << 17) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P18 (0x1u << 18) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P19 (0x1u << 19) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P20 (0x1u << 20) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P21 (0x1u << 21) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P22 (0x1u << 22) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P23 (0x1u << 23) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P24 (0x1u << 24) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P25 (0x1u << 25) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P26 (0x1u << 26) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P27 (0x1u << 27) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P28 (0x1u << 28) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P29 (0x1u << 29) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P30 (0x1u << 30) /**< \brief (GPIO_LOCKC) Lock State */ +#define GPIO_LOCKC_P31 (0x1u << 31) /**< \brief (GPIO_LOCKC) Lock State */ +/* -------- GPIO_LOCKT : (GPIO Offset: 0x1AC) Port Lock Register - Toggle -------- */ +#define GPIO_LOCKT_P0 (0x1u << 0) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P1 (0x1u << 1) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P2 (0x1u << 2) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P3 (0x1u << 3) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P4 (0x1u << 4) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P5 (0x1u << 5) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P6 (0x1u << 6) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P7 (0x1u << 7) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P8 (0x1u << 8) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P9 (0x1u << 9) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P10 (0x1u << 10) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P11 (0x1u << 11) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P12 (0x1u << 12) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P13 (0x1u << 13) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P14 (0x1u << 14) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P15 (0x1u << 15) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P16 (0x1u << 16) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P17 (0x1u << 17) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P18 (0x1u << 18) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P19 (0x1u << 19) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P20 (0x1u << 20) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P21 (0x1u << 21) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P22 (0x1u << 22) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P23 (0x1u << 23) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P24 (0x1u << 24) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P25 (0x1u << 25) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P26 (0x1u << 26) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P27 (0x1u << 27) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P28 (0x1u << 28) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P29 (0x1u << 29) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P30 (0x1u << 30) /**< \brief (GPIO_LOCKT) Lock State */ +#define GPIO_LOCKT_P31 (0x1u << 31) /**< \brief (GPIO_LOCKT) Lock State */ +/* -------- GPIO_UNLOCK : (GPIO Offset: 0x1E0) Port Unlock Register -------- */ +#define GPIO_UNLOCK_OFFSET_Pos 0 +#define GPIO_UNLOCK_OFFSET_Msk (0x3FFu << GPIO_UNLOCK_OFFSET_Pos) /**< \brief (GPIO_UNLOCK) Offset Register */ +#define GPIO_UNLOCK_OFFSET(value) ((GPIO_UNLOCK_OFFSET_Msk & ((value) << GPIO_UNLOCK_OFFSET_Pos))) +#define GPIO_UNLOCK_KEY_Pos 24 +#define GPIO_UNLOCK_KEY_Msk (0xFFu << GPIO_UNLOCK_KEY_Pos) /**< \brief (GPIO_UNLOCK) Unlocking Key */ +#define GPIO_UNLOCK_KEY(value) ((GPIO_UNLOCK_KEY_Msk & ((value) << GPIO_UNLOCK_KEY_Pos))) +/* -------- GPIO_ASR : (GPIO Offset: 0x1E4) Port Access Status Register -------- */ +#define GPIO_ASR_AR (0x1u << 0) /**< \brief (GPIO_ASR) Access Error */ +/* -------- GPIO_PARAMETER : (GPIO Offset: 0x1F8) Port Parameter Register -------- */ +#define GPIO_PARAMETER_PARAMETER_Pos 0 +#define GPIO_PARAMETER_PARAMETER_Msk (0xFFFFFFFFu << GPIO_PARAMETER_PARAMETER_Pos) /**< \brief (GPIO_PARAMETER) Parameter */ +#define GPIO_PARAMETER_PARAMETER(value) ((GPIO_PARAMETER_PARAMETER_Msk & ((value) << GPIO_PARAMETER_PARAMETER_Pos))) +/* -------- GPIO_VERSION : (GPIO Offset: 0x1FC) Port Version Register -------- */ +#define GPIO_VERSION_VERSION_Pos 0 +#define GPIO_VERSION_VERSION_Msk (0xFFFu << GPIO_VERSION_VERSION_Pos) /**< \brief (GPIO_VERSION) Version Number */ +#define GPIO_VERSION_VERSION(value) ((GPIO_VERSION_VERSION_Msk & ((value) << GPIO_VERSION_VERSION_Pos))) +#define GPIO_VERSION_VARIANT_Pos 16 +#define GPIO_VERSION_VARIANT_Msk (0xFu << GPIO_VERSION_VARIANT_Pos) /**< \brief (GPIO_VERSION) Variant Number */ +#define GPIO_VERSION_VARIANT(value) ((GPIO_VERSION_VARIANT_Msk & ((value) << GPIO_VERSION_VARIANT_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR HCACHE */ +/* ============================================================================= */ +/** \addtogroup SAM4L_HCACHE Cortex M I&D Cache Controller */ +/*@{*/ + +#define REV_HCACHE 0x101 + +#ifndef __ASSEMBLY__ +/** \brief HCACHE hardware registers */ +typedef struct { + RoReg Reserved1[2]; + WoReg HCACHE_CTRL; /**< \brief (HCACHE Offset: 0x08) Control Register */ + RwReg HCACHE_SR; /**< \brief (HCACHE Offset: 0x0C) Status Register */ + RoReg Reserved2[4]; + WoReg HCACHE_MAINT0; /**< \brief (HCACHE Offset: 0x20) Maintenance Register 0 */ + WoReg HCACHE_MAINT1; /**< \brief (HCACHE Offset: 0x24) Maintenance Register 1 */ + RwReg HCACHE_MCFG; /**< \brief (HCACHE Offset: 0x28) Monitor Configuration Register */ + RwReg HCACHE_MEN; /**< \brief (HCACHE Offset: 0x2C) Monitor Enable Register */ + WoReg HCACHE_MCTRL; /**< \brief (HCACHE Offset: 0x30) Monitor Control Register */ + RoReg HCACHE_MSR; /**< \brief (HCACHE Offset: 0x34) Monitor Status Register */ + RoReg Reserved3[49]; + RoReg HCACHE_VERSION; /**< \brief (HCACHE Offset: 0xFC) Version Register */ +} Hcache; +#endif /* __ASSEMBLY__ */ +/* -------- HCACHE_CTRL : (HCACHE Offset: 0x08) Control Register -------- */ +#define HCACHE_CTRL_CEN (0x1u << 0) /**< \brief (HCACHE_CTRL) Cache Enable */ +#define HCACHE_CTRL_CEN_NO (0x0u << 0) /**< \brief (HCACHE_CTRL) Disable Cache Controller */ +#define HCACHE_CTRL_CEN_YES (0x1u << 0) /**< \brief (HCACHE_CTRL) Enable Cache Controller */ +/* -------- HCACHE_SR : (HCACHE Offset: 0x0C) Status Register -------- */ +#define HCACHE_SR_CSTS (0x1u << 0) /**< \brief (HCACHE_SR) Cache Controller Status */ +#define HCACHE_SR_CSTS_DIS (0x0u << 0) /**< \brief (HCACHE_SR) Cache Controller Disabled */ +#define HCACHE_SR_CSTS_EN (0x1u << 0) /**< \brief (HCACHE_SR) Cache Controller Enabled */ +/* -------- HCACHE_MAINT0 : (HCACHE Offset: 0x20) Maintenance Register 0 -------- */ +#define HCACHE_MAINT0_INVALL (0x1u << 0) /**< \brief (HCACHE_MAINT0) Cache Controller Invalidate All */ +#define HCACHE_MAINT0_INVALL_NO (0x0u << 0) /**< \brief (HCACHE_MAINT0) No effect */ +#define HCACHE_MAINT0_INVALL_YES (0x1u << 0) /**< \brief (HCACHE_MAINT0) Invalidate all cache entries */ +/* -------- HCACHE_MAINT1 : (HCACHE Offset: 0x24) Maintenance Register 1 -------- */ +#define HCACHE_MAINT1_INDEX_Pos 4 +#define HCACHE_MAINT1_INDEX_Msk (0xFu << HCACHE_MAINT1_INDEX_Pos) /**< \brief (HCACHE_MAINT1) Invalidate Index */ +#define HCACHE_MAINT1_INDEX(value) ((HCACHE_MAINT1_INDEX_Msk & ((value) << HCACHE_MAINT1_INDEX_Pos))) +/* -------- HCACHE_MCFG : (HCACHE Offset: 0x28) Monitor Configuration Register -------- */ +#define HCACHE_MCFG_MODE_Pos 0 +#define HCACHE_MCFG_MODE_Msk (0x3u << HCACHE_MCFG_MODE_Pos) /**< \brief (HCACHE_MCFG) Cache Controller Monitor Counter Mode */ +#define HCACHE_MCFG_MODE(value) ((HCACHE_MCFG_MODE_Msk & ((value) << HCACHE_MCFG_MODE_Pos))) +#define HCACHE_MCFG_MODE_CYCLE (0x0u << 0) /**< \brief (HCACHE_MCFG) Cycle Counter */ +#define HCACHE_MCFG_MODE_IHIT (0x1u << 0) /**< \brief (HCACHE_MCFG) Instruction Hit Counter */ +#define HCACHE_MCFG_MODE_DHIT (0x2u << 0) /**< \brief (HCACHE_MCFG) Data Hit Counter */ +/* -------- HCACHE_MEN : (HCACHE Offset: 0x2C) Monitor Enable Register -------- */ +#define HCACHE_MEN_MENABLE (0x1u << 0) /**< \brief (HCACHE_MEN) Monitor Enable */ +#define HCACHE_MEN_MENABLE_DIS (0x0u << 0) /**< \brief (HCACHE_MEN) Disable Monitor Counter */ +#define HCACHE_MEN_MENABLE_EN (0x1u << 0) /**< \brief (HCACHE_MEN) Enable Monitor Counter */ +/* -------- HCACHE_MCTRL : (HCACHE Offset: 0x30) Monitor Control Register -------- */ +#define HCACHE_MCTRL_SWRST (0x1u << 0) /**< \brief (HCACHE_MCTRL) Monitor Software Reset */ +#define HCACHE_MCTRL_SWRST_NO (0x0u << 0) /**< \brief (HCACHE_MCTRL) No effect */ +#define HCACHE_MCTRL_SWRST_YES (0x1u << 0) /**< \brief (HCACHE_MCTRL) Reset event counter register */ +/* -------- HCACHE_MSR : (HCACHE Offset: 0x34) Monitor Status Register -------- */ +#define HCACHE_MSR_EVENTCNT_Pos 0 +#define HCACHE_MSR_EVENTCNT_Msk (0xFFFFFFFFu << HCACHE_MSR_EVENTCNT_Pos) /**< \brief (HCACHE_MSR) Monitor Event Counter */ +#define HCACHE_MSR_EVENTCNT(value) ((HCACHE_MSR_EVENTCNT_Msk & ((value) << HCACHE_MSR_EVENTCNT_Pos))) +/* -------- HCACHE_VERSION : (HCACHE Offset: 0xFC) Version Register -------- */ +#define HCACHE_VERSION_VERSION_Pos 0 +#define HCACHE_VERSION_VERSION_Msk (0xFFFu << HCACHE_VERSION_VERSION_Pos) /**< \brief (HCACHE_VERSION) VERSION */ +#define HCACHE_VERSION_VERSION(value) ((HCACHE_VERSION_VERSION_Msk & ((value) << HCACHE_VERSION_VERSION_Pos))) +#define HCACHE_VERSION_MFN_Pos 16 +#define HCACHE_VERSION_MFN_Msk (0xFu << HCACHE_VERSION_MFN_Pos) /**< \brief (HCACHE_VERSION) MFN */ +#define HCACHE_VERSION_MFN(value) ((HCACHE_VERSION_MFN_Msk & ((value) << HCACHE_VERSION_MFN_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR HMATRIXB */ +/* ============================================================================= */ +/** \addtogroup SAM4L_HMATRIXB HSB Matrix */ +/*@{*/ + +#define REV_HMATRIXB 0x130 + +#ifndef __ASSEMBLY__ +/** \brief HmatrixbMcfg hardware registers */ +typedef struct { + RwReg HMATRIXB_MCFG; /**< \brief (HmatrixbMcfg Offset: 0x000) Master Configuration Register 0 */ +} HmatrixbMcfg; +/** \brief HmatrixbPrs hardware registers */ +typedef struct { + RwReg HMATRIXB_PRAS; /**< \brief (HmatrixbPrs Offset: 0x000) Priority Register A for Slave 0 */ + RwReg HMATRIXB_PRBS; /**< \brief (HmatrixbPrs Offset: 0x004) Priority Register B for Slave 0 */ +} HmatrixbPrs; +/** \brief HmatrixbScfg hardware registers */ +typedef struct { + RwReg HMATRIXB_SCFG; /**< \brief (HmatrixbScfg Offset: 0x000) Slave Configuration Register 0 */ +} HmatrixbScfg; +/** \brief HmatrixbSfr hardware registers */ +typedef struct { + RwReg HMATRIXB_SFR; /**< \brief (HmatrixbSfr Offset: 0x000) Special Function Register 0 */ +} HmatrixbSfr; +/** \brief HMATRIXB hardware registers */ +typedef struct { + HmatrixbMcfg HMATRIXB_MCFG[16]; /**< \brief (HMATRIXB Offset: 0x000) HmatrixbMcfg groups */ + HmatrixbScfg HMATRIXB_SCFG[16]; /**< \brief (HMATRIXB Offset: 0x040) HmatrixbScfg groups */ + HmatrixbPrs HMATRIXB_PRS[16]; /**< \brief (HMATRIXB Offset: 0x080) HmatrixbPrs groups */ + RwReg HMATRIXB_MRCR; /**< \brief (HMATRIXB Offset: 0x100) Master Remap Control Register */ + RoReg Reserved1[3]; + HmatrixbSfr HMATRIXB_SFR[16]; /**< \brief (HMATRIXB Offset: 0x110) HmatrixbSfr groups */ +} Hmatrixb; +#endif /* __ASSEMBLY__ */ +/* -------- HMATRIXB_MCFG : (HMATRIXB Offset: 0x000) Mcfg Master Configuration Register 0 -------- */ +#define HMATRIXB_MCFG_ULBT_Pos 0 +#define HMATRIXB_MCFG_ULBT_Msk (0x7u << HMATRIXB_MCFG_ULBT_Pos) /**< \brief (HMATRIXB_MCFG) Undefined Length Burst Type */ +#define HMATRIXB_MCFG_ULBT(value) ((HMATRIXB_MCFG_ULBT_Msk & ((value) << HMATRIXB_MCFG_ULBT_Pos))) +#define HMATRIXB_MCFG_ULBT_INFINITE (0x0u << 0) /**< \brief (HMATRIXB_MCFG) Infinite Length */ +#define HMATRIXB_MCFG_ULBT_SINGLE (0x1u << 0) /**< \brief (HMATRIXB_MCFG) Single Access */ +#define HMATRIXB_MCFG_ULBT_FOUR_BEAT (0x2u << 0) /**< \brief (HMATRIXB_MCFG) Four Beat Burst */ +#define HMATRIXB_MCFG_ULBT_EIGHT_BEAT (0x3u << 0) /**< \brief (HMATRIXB_MCFG) Eight Beat Burst */ +#define HMATRIXB_MCFG_ULBT_SIXTEEN_BEAT (0x4u << 0) /**< \brief (HMATRIXB_MCFG) Sixteen Beat Burst */ +/* -------- HMATRIXB_SCFG : (HMATRIXB Offset: 0x040) Scfg Slave Configuration Register 0 -------- */ +#define HMATRIXB_SCFG_SLOT_CYCLE_Pos 0 +#define HMATRIXB_SCFG_SLOT_CYCLE_Msk (0xFFu << HMATRIXB_SCFG_SLOT_CYCLE_Pos) /**< \brief (HMATRIXB_SCFG) Maximum Number of Allowed Cycles for a Burst */ +#define HMATRIXB_SCFG_SLOT_CYCLE(value) ((HMATRIXB_SCFG_SLOT_CYCLE_Msk & ((value) << HMATRIXB_SCFG_SLOT_CYCLE_Pos))) +#define HMATRIXB_SCFG_DEFMSTR_TYPE_Pos 16 +#define HMATRIXB_SCFG_DEFMSTR_TYPE_Msk (0x3u << HMATRIXB_SCFG_DEFMSTR_TYPE_Pos) /**< \brief (HMATRIXB_SCFG) Default Master Type */ +#define HMATRIXB_SCFG_DEFMSTR_TYPE(value) ((HMATRIXB_SCFG_DEFMSTR_TYPE_Msk & ((value) << HMATRIXB_SCFG_DEFMSTR_TYPE_Pos))) +#define HMATRIXB_SCFG_DEFMSTR_TYPE_NO_DEFAULT (0x0u << 16) /**< \brief (HMATRIXB_SCFG) No Default Master. At the end of current slave access, if no other master request is pending, the slave is deconnected from all masters. This resusts in having a one cycle latency for the first transfer of a burst. */ +#define HMATRIXB_SCFG_DEFMSTR_TYPE_LAST_DEFAULT (0x1u << 16) /**< \brief (HMATRIXB_SCFG) Last Default Master At the end of current slave access, if no other master request is pending, the slave stay connected with the last master havingaccessed it.This resusts in not having the one cycle latency when the last master re-trying access on the slave. */ +#define HMATRIXB_SCFG_DEFMSTR_TYPE_FIXED_DEFAULT (0x2u << 16) /**< \brief (HMATRIXB_SCFG) Fixed Default Master At the end of current slave access, if no other master request is pending, the slave connects with fixed master which numberis in FIXED_DEFMSTR register.This resusts in not having the one cycle latency when the fixed master re-trying access on the slave. */ +#define HMATRIXB_SCFG_FIXED_DEFMSTR_Pos 18 +#define HMATRIXB_SCFG_FIXED_DEFMSTR_Msk (0xFu << HMATRIXB_SCFG_FIXED_DEFMSTR_Pos) /**< \brief (HMATRIXB_SCFG) Fixed Index of Default Master */ +#define HMATRIXB_SCFG_FIXED_DEFMSTR(value) ((HMATRIXB_SCFG_FIXED_DEFMSTR_Msk & ((value) << HMATRIXB_SCFG_FIXED_DEFMSTR_Pos))) +#define HMATRIXB_SCFG_ARBT (0x1u << 24) /**< \brief (HMATRIXB_SCFG) Arbitration Type */ +#define HMATRIXB_SCFG_ARBT_ROUND_ROBIN (0x0u << 24) /**< \brief (HMATRIXB_SCFG) Round-Robin Arbitration */ +#define HMATRIXB_SCFG_ARBT_FIXED_PRIORITY (0x1u << 24) /**< \brief (HMATRIXB_SCFG) Fixed Priority Arbitration */ +/* -------- HMATRIXB_PRAS : (HMATRIXB Offset: 0x080) Prs Priority Register A for Slave 0 -------- */ +#define HMATRIXB_PRAS_M0PR_Pos 0 +#define HMATRIXB_PRAS_M0PR_Msk (0xFu << HMATRIXB_PRAS_M0PR_Pos) /**< \brief (HMATRIXB_PRAS) Master 0 Priority */ +#define HMATRIXB_PRAS_M0PR(value) ((HMATRIXB_PRAS_M0PR_Msk & ((value) << HMATRIXB_PRAS_M0PR_Pos))) +#define HMATRIXB_PRAS_M1PR_Pos 4 +#define HMATRIXB_PRAS_M1PR_Msk (0xFu << HMATRIXB_PRAS_M1PR_Pos) /**< \brief (HMATRIXB_PRAS) Master 1 Priority */ +#define HMATRIXB_PRAS_M1PR(value) ((HMATRIXB_PRAS_M1PR_Msk & ((value) << HMATRIXB_PRAS_M1PR_Pos))) +#define HMATRIXB_PRAS_M2PR_Pos 8 +#define HMATRIXB_PRAS_M2PR_Msk (0xFu << HMATRIXB_PRAS_M2PR_Pos) /**< \brief (HMATRIXB_PRAS) Master 2 Priority */ +#define HMATRIXB_PRAS_M2PR(value) ((HMATRIXB_PRAS_M2PR_Msk & ((value) << HMATRIXB_PRAS_M2PR_Pos))) +#define HMATRIXB_PRAS_M3PR_Pos 12 +#define HMATRIXB_PRAS_M3PR_Msk (0xFu << HMATRIXB_PRAS_M3PR_Pos) /**< \brief (HMATRIXB_PRAS) Master 3 Priority */ +#define HMATRIXB_PRAS_M3PR(value) ((HMATRIXB_PRAS_M3PR_Msk & ((value) << HMATRIXB_PRAS_M3PR_Pos))) +#define HMATRIXB_PRAS_M4PR_Pos 16 +#define HMATRIXB_PRAS_M4PR_Msk (0xFu << HMATRIXB_PRAS_M4PR_Pos) /**< \brief (HMATRIXB_PRAS) Master 4 Priority */ +#define HMATRIXB_PRAS_M4PR(value) ((HMATRIXB_PRAS_M4PR_Msk & ((value) << HMATRIXB_PRAS_M4PR_Pos))) +#define HMATRIXB_PRAS_M5PR_Pos 20 +#define HMATRIXB_PRAS_M5PR_Msk (0xFu << HMATRIXB_PRAS_M5PR_Pos) /**< \brief (HMATRIXB_PRAS) Master 5 Priority */ +#define HMATRIXB_PRAS_M5PR(value) ((HMATRIXB_PRAS_M5PR_Msk & ((value) << HMATRIXB_PRAS_M5PR_Pos))) +#define HMATRIXB_PRAS_M6PR_Pos 24 +#define HMATRIXB_PRAS_M6PR_Msk (0xFu << HMATRIXB_PRAS_M6PR_Pos) /**< \brief (HMATRIXB_PRAS) Master 6 Priority */ +#define HMATRIXB_PRAS_M6PR(value) ((HMATRIXB_PRAS_M6PR_Msk & ((value) << HMATRIXB_PRAS_M6PR_Pos))) +#define HMATRIXB_PRAS_M7PR_Pos 28 +#define HMATRIXB_PRAS_M7PR_Msk (0xFu << HMATRIXB_PRAS_M7PR_Pos) /**< \brief (HMATRIXB_PRAS) Master 7 Priority */ +#define HMATRIXB_PRAS_M7PR(value) ((HMATRIXB_PRAS_M7PR_Msk & ((value) << HMATRIXB_PRAS_M7PR_Pos))) +/* -------- HMATRIXB_PRBS : (HMATRIXB Offset: 0x084) Prs Priority Register B for Slave 0 -------- */ +#define HMATRIXB_PRBS_M8PR_Pos 0 +#define HMATRIXB_PRBS_M8PR_Msk (0xFu << HMATRIXB_PRBS_M8PR_Pos) /**< \brief (HMATRIXB_PRBS) Master 8 Priority */ +#define HMATRIXB_PRBS_M8PR(value) ((HMATRIXB_PRBS_M8PR_Msk & ((value) << HMATRIXB_PRBS_M8PR_Pos))) +#define HMATRIXB_PRBS_M9PR_Pos 4 +#define HMATRIXB_PRBS_M9PR_Msk (0xFu << HMATRIXB_PRBS_M9PR_Pos) /**< \brief (HMATRIXB_PRBS) Master 9 Priority */ +#define HMATRIXB_PRBS_M9PR(value) ((HMATRIXB_PRBS_M9PR_Msk & ((value) << HMATRIXB_PRBS_M9PR_Pos))) +#define HMATRIXB_PRBS_M10PR_Pos 8 +#define HMATRIXB_PRBS_M10PR_Msk (0xFu << HMATRIXB_PRBS_M10PR_Pos) /**< \brief (HMATRIXB_PRBS) Master 10 Priority */ +#define HMATRIXB_PRBS_M10PR(value) ((HMATRIXB_PRBS_M10PR_Msk & ((value) << HMATRIXB_PRBS_M10PR_Pos))) +#define HMATRIXB_PRBS_M11PR_Pos 12 +#define HMATRIXB_PRBS_M11PR_Msk (0xFu << HMATRIXB_PRBS_M11PR_Pos) /**< \brief (HMATRIXB_PRBS) Master 11 Priority */ +#define HMATRIXB_PRBS_M11PR(value) ((HMATRIXB_PRBS_M11PR_Msk & ((value) << HMATRIXB_PRBS_M11PR_Pos))) +#define HMATRIXB_PRBS_M12PR_Pos 16 +#define HMATRIXB_PRBS_M12PR_Msk (0xFu << HMATRIXB_PRBS_M12PR_Pos) /**< \brief (HMATRIXB_PRBS) Master 12 Priority */ +#define HMATRIXB_PRBS_M12PR(value) ((HMATRIXB_PRBS_M12PR_Msk & ((value) << HMATRIXB_PRBS_M12PR_Pos))) +#define HMATRIXB_PRBS_M13PR_Pos 20 +#define HMATRIXB_PRBS_M13PR_Msk (0xFu << HMATRIXB_PRBS_M13PR_Pos) /**< \brief (HMATRIXB_PRBS) Master 13 Priority */ +#define HMATRIXB_PRBS_M13PR(value) ((HMATRIXB_PRBS_M13PR_Msk & ((value) << HMATRIXB_PRBS_M13PR_Pos))) +#define HMATRIXB_PRBS_M14PR_Pos 24 +#define HMATRIXB_PRBS_M14PR_Msk (0xFu << HMATRIXB_PRBS_M14PR_Pos) /**< \brief (HMATRIXB_PRBS) Master 14 Priority */ +#define HMATRIXB_PRBS_M14PR(value) ((HMATRIXB_PRBS_M14PR_Msk & ((value) << HMATRIXB_PRBS_M14PR_Pos))) +#define HMATRIXB_PRBS_M15PR_Pos 28 +#define HMATRIXB_PRBS_M15PR_Msk (0xFu << HMATRIXB_PRBS_M15PR_Pos) /**< \brief (HMATRIXB_PRBS) Master 15 Priority */ +#define HMATRIXB_PRBS_M15PR(value) ((HMATRIXB_PRBS_M15PR_Msk & ((value) << HMATRIXB_PRBS_M15PR_Pos))) +/* -------- HMATRIXB_MRCR : (HMATRIXB Offset: 0x100) Master Remap Control Register -------- */ +#define HMATRIXB_MRCR_RCB0 (0x1u << 0) /**< \brief (HMATRIXB_MRCR) Remap Command bit for Master 0 */ +#define HMATRIXB_MRCR_RCB0_0 (0x0u << 0) /**< \brief (HMATRIXB_MRCR) Disable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB0_1 (0x1u << 0) /**< \brief (HMATRIXB_MRCR) Enable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB1 (0x1u << 1) /**< \brief (HMATRIXB_MRCR) Remap Command bit for Master 1 */ +#define HMATRIXB_MRCR_RCB1_0 (0x0u << 1) /**< \brief (HMATRIXB_MRCR) Disable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB1_1 (0x1u << 1) /**< \brief (HMATRIXB_MRCR) Enable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB2 (0x1u << 2) /**< \brief (HMATRIXB_MRCR) Remap Command bit for Master 2 */ +#define HMATRIXB_MRCR_RCB2_0 (0x0u << 2) /**< \brief (HMATRIXB_MRCR) Disable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB2_1 (0x1u << 2) /**< \brief (HMATRIXB_MRCR) Enable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB3 (0x1u << 3) /**< \brief (HMATRIXB_MRCR) Remap Command bit for Master 3 */ +#define HMATRIXB_MRCR_RCB3_0 (0x0u << 3) /**< \brief (HMATRIXB_MRCR) Disable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB3_1 (0x1u << 3) /**< \brief (HMATRIXB_MRCR) Enable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB4 (0x1u << 4) /**< \brief (HMATRIXB_MRCR) Remap Command bit for Master 4 */ +#define HMATRIXB_MRCR_RCB4_0 (0x0u << 4) /**< \brief (HMATRIXB_MRCR) Disable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB4_1 (0x1u << 4) /**< \brief (HMATRIXB_MRCR) Enable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB5 (0x1u << 5) /**< \brief (HMATRIXB_MRCR) Remap Command bit for Master 5 */ +#define HMATRIXB_MRCR_RCB5_0 (0x0u << 5) /**< \brief (HMATRIXB_MRCR) Disable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB5_1 (0x1u << 5) /**< \brief (HMATRIXB_MRCR) Enable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB6 (0x1u << 6) /**< \brief (HMATRIXB_MRCR) Remap Command bit for Master 6 */ +#define HMATRIXB_MRCR_RCB6_0 (0x0u << 6) /**< \brief (HMATRIXB_MRCR) Disable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB6_1 (0x1u << 6) /**< \brief (HMATRIXB_MRCR) Enable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB7 (0x1u << 7) /**< \brief (HMATRIXB_MRCR) Remap Command bit for Master 7 */ +#define HMATRIXB_MRCR_RCB7_0 (0x0u << 7) /**< \brief (HMATRIXB_MRCR) Disable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB7_1 (0x1u << 7) /**< \brief (HMATRIXB_MRCR) Enable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB8 (0x1u << 8) /**< \brief (HMATRIXB_MRCR) Remap Command bit for Master 8 */ +#define HMATRIXB_MRCR_RCB8_0 (0x0u << 8) /**< \brief (HMATRIXB_MRCR) Disable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB8_1 (0x1u << 8) /**< \brief (HMATRIXB_MRCR) Enable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB9 (0x1u << 9) /**< \brief (HMATRIXB_MRCR) Remap Command bit for Master 9 */ +#define HMATRIXB_MRCR_RCB9_0 (0x0u << 9) /**< \brief (HMATRIXB_MRCR) Disable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB9_1 (0x1u << 9) /**< \brief (HMATRIXB_MRCR) Enable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB10 (0x1u << 10) /**< \brief (HMATRIXB_MRCR) Remap Command bit for Master 10 */ +#define HMATRIXB_MRCR_RCB10_0 (0x0u << 10) /**< \brief (HMATRIXB_MRCR) Disable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB10_1 (0x1u << 10) /**< \brief (HMATRIXB_MRCR) Enable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB11 (0x1u << 11) /**< \brief (HMATRIXB_MRCR) Remap Command bit for Master 11 */ +#define HMATRIXB_MRCR_RCB11_0 (0x0u << 11) /**< \brief (HMATRIXB_MRCR) Disable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB11_1 (0x1u << 11) /**< \brief (HMATRIXB_MRCR) Enable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB12 (0x1u << 12) /**< \brief (HMATRIXB_MRCR) Remap Command bit for Master 12 */ +#define HMATRIXB_MRCR_RCB12_0 (0x0u << 12) /**< \brief (HMATRIXB_MRCR) Disable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB12_1 (0x1u << 12) /**< \brief (HMATRIXB_MRCR) Enable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB13 (0x1u << 13) /**< \brief (HMATRIXB_MRCR) Remap Command bit for Master 13 */ +#define HMATRIXB_MRCR_RCB13_0 (0x0u << 13) /**< \brief (HMATRIXB_MRCR) Disable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB13_1 (0x1u << 13) /**< \brief (HMATRIXB_MRCR) Enable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB14 (0x1u << 14) /**< \brief (HMATRIXB_MRCR) Remap Command bit for Master 14 */ +#define HMATRIXB_MRCR_RCB14_0 (0x0u << 14) /**< \brief (HMATRIXB_MRCR) Disable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB14_1 (0x1u << 14) /**< \brief (HMATRIXB_MRCR) Enable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB15 (0x1u << 15) /**< \brief (HMATRIXB_MRCR) Remap Command bit for Master 15 */ +#define HMATRIXB_MRCR_RCB15_0 (0x0u << 15) /**< \brief (HMATRIXB_MRCR) Disable remapped address decoding for master */ +#define HMATRIXB_MRCR_RCB15_1 (0x1u << 15) /**< \brief (HMATRIXB_MRCR) Enable remapped address decoding for master */ +/* -------- HMATRIXB_SFR : (HMATRIXB Offset: 0x110) Sfr Special Function Register 0 -------- */ +#define HMATRIXB_SFR_SFR_Pos 0 +#define HMATRIXB_SFR_SFR_Msk (0xFFFFFFFFu << HMATRIXB_SFR_SFR_Pos) /**< \brief (HMATRIXB_SFR) Special Function Register */ +#define HMATRIXB_SFR_SFR(value) ((HMATRIXB_SFR_SFR_Msk & ((value) << HMATRIXB_SFR_SFR_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR IISC */ +/* ============================================================================= */ +/** \addtogroup SAM4L_IISC Inter-IC Sound (I2S) Controller */ +/*@{*/ + +#define REV_IISC 0x100 + +#ifndef __ASSEMBLY__ +/** \brief IISC hardware registers */ +typedef struct { + WoReg IISC_CR; /**< \brief (IISC Offset: 0x00) Control Register */ + RwReg IISC_MR; /**< \brief (IISC Offset: 0x04) Mode Register */ + RoReg IISC_SR; /**< \brief (IISC Offset: 0x08) Status Register */ + WoReg IISC_SCR; /**< \brief (IISC Offset: 0x0C) Status Clear Register */ + WoReg IISC_SSR; /**< \brief (IISC Offset: 0x10) Status Set Register */ + WoReg IISC_IER; /**< \brief (IISC Offset: 0x14) Interrupt Enable Register */ + WoReg IISC_IDR; /**< \brief (IISC Offset: 0x18) Interrupt Disable Register */ + RoReg IISC_IMR; /**< \brief (IISC Offset: 0x1C) Interrupt Mask Register */ + RoReg IISC_RHR; /**< \brief (IISC Offset: 0x20) Receive Holding Register */ + WoReg IISC_THR; /**< \brief (IISC Offset: 0x24) Transmit Holding Register */ + RoReg IISC_VERSION; /**< \brief (IISC Offset: 0x28) Version Register */ + RoReg IISC_PARAMETER; /**< \brief (IISC Offset: 0x2C) Parameter Register */ +} Iisc; +#endif /* __ASSEMBLY__ */ +/* -------- IISC_CR : (IISC Offset: 0x00) Control Register -------- */ +#define IISC_CR_RXEN (0x1u << 0) /**< \brief (IISC_CR) Receive Enable */ +#define IISC_CR_RXEN_OFF (0x0u << 0) /**< \brief (IISC_CR) No effect */ +#define IISC_CR_RXEN_ON (0x1u << 0) /**< \brief (IISC_CR) Enables Data Receive if RXDIS is not set */ +#define IISC_CR_RXDIS (0x1u << 1) /**< \brief (IISC_CR) Receive Disable */ +#define IISC_CR_RXDIS_OFF (0x0u << 1) /**< \brief (IISC_CR) No effect */ +#define IISC_CR_RXDIS_ON (0x1u << 1) /**< \brief (IISC_CR) Disables Data Receive */ +#define IISC_CR_CKEN (0x1u << 2) /**< \brief (IISC_CR) Clocks Enable */ +#define IISC_CR_CKEN_OFF (0x0u << 2) /**< \brief (IISC_CR) No effect */ +#define IISC_CR_CKEN_ON (0x1u << 2) /**< \brief (IISC_CR) Enables clocks if CKDIS is not set */ +#define IISC_CR_CKDIS (0x1u << 3) /**< \brief (IISC_CR) Clocks Disable */ +#define IISC_CR_CKDIS_OFF (0x0u << 3) /**< \brief (IISC_CR) No effect */ +#define IISC_CR_CKDIS_ON (0x1u << 3) /**< \brief (IISC_CR) Disables clocks */ +#define IISC_CR_TXEN (0x1u << 4) /**< \brief (IISC_CR) Transmit Enable */ +#define IISC_CR_TXEN_OFF (0x0u << 4) /**< \brief (IISC_CR) No effect */ +#define IISC_CR_TXEN_ON (0x1u << 4) /**< \brief (IISC_CR) Enables Data Transmit if TXDIS is not set */ +#define IISC_CR_TXDIS (0x1u << 5) /**< \brief (IISC_CR) Transmit Disable */ +#define IISC_CR_TXDIS_OFF (0x0u << 5) /**< \brief (IISC_CR) No effect */ +#define IISC_CR_TXDIS_ON (0x1u << 5) /**< \brief (IISC_CR) Disables Data Transmit */ +#define IISC_CR_SWRST (0x1u << 7) /**< \brief (IISC_CR) Software Reset */ +#define IISC_CR_SWRST_OFF (0x0u << 7) /**< \brief (IISC_CR) No effect */ +#define IISC_CR_SWRST_ON (0x1u << 7) /**< \brief (IISC_CR) Performs a software reset. Has priority on any other bit in CR */ +/* -------- IISC_MR : (IISC Offset: 0x04) Mode Register -------- */ +#define IISC_MR_MODE (0x1u << 0) /**< \brief (IISC_MR) Master/Slave/Controller Mode */ +#define IISC_MR_MODE_SLAVE (0x0u << 0) /**< \brief (IISC_MR) Slave mode (only serial data handled, clocks received from external master or controller) */ +#define IISC_MR_MODE_MASTER (0x1u << 0) /**< \brief (IISC_MR) Master mode (clocks generated and output by IISC, serial data handled if CR.RXEN and/or CR.TXEN written to 1) */ +#define IISC_MR_DATALENGTH_Pos 2 +#define IISC_MR_DATALENGTH_Msk (0x7u << IISC_MR_DATALENGTH_Pos) /**< \brief (IISC_MR) Data Word Length */ +#define IISC_MR_DATALENGTH(value) ((IISC_MR_DATALENGTH_Msk & ((value) << IISC_MR_DATALENGTH_Pos))) +#define IISC_MR_DATALENGTH_32 (0x0u << 2) /**< \brief (IISC_MR) 32 bits */ +#define IISC_MR_DATALENGTH_24 (0x1u << 2) /**< \brief (IISC_MR) 24 bits */ +#define IISC_MR_DATALENGTH_20 (0x2u << 2) /**< \brief (IISC_MR) 20 bits */ +#define IISC_MR_DATALENGTH_18 (0x3u << 2) /**< \brief (IISC_MR) 18 bits */ +#define IISC_MR_DATALENGTH_16 (0x4u << 2) /**< \brief (IISC_MR) 16 bits */ +#define IISC_MR_DATALENGTH_16C (0x5u << 2) /**< \brief (IISC_MR) 16 bits compact stereo */ +#define IISC_MR_DATALENGTH_8 (0x6u << 2) /**< \brief (IISC_MR) 8 bits */ +#define IISC_MR_DATALENGTH_8C (0x7u << 2) /**< \brief (IISC_MR) 8 bits compact stereo */ +#define IISC_MR_RXMONO (0x1u << 8) /**< \brief (IISC_MR) Receiver Mono */ +#define IISC_MR_RXMONO_STEREO (0x0u << 8) /**< \brief (IISC_MR) Normal mode */ +#define IISC_MR_RXMONO_MONO (0x1u << 8) /**< \brief (IISC_MR) Left channel data is duplicated to right channel */ +#define IISC_MR_RXDMA (0x1u << 9) /**< \brief (IISC_MR) Single or Multiple DMA Channels for Receiver */ +#define IISC_MR_RXDMA_SINGLE (0x0u << 9) /**< \brief (IISC_MR) Single DMA channel */ +#define IISC_MR_RXDMA_MULTIPLE (0x1u << 9) /**< \brief (IISC_MR) One DMA channel per data channel */ +#define IISC_MR_RXLOOP (0x1u << 10) /**< \brief (IISC_MR) Loop-back Test Mode */ +#define IISC_MR_RXLOOP_OFF (0x0u << 10) /**< \brief (IISC_MR) Normal mode */ +#define IISC_MR_RXLOOP_ON (0x1u << 10) /**< \brief (IISC_MR) ISDO internally connected to ISDI */ +#define IISC_MR_TXMONO (0x1u << 12) /**< \brief (IISC_MR) Transmitter Mono */ +#define IISC_MR_TXMONO_STEREO (0x0u << 12) /**< \brief (IISC_MR) Normal mode */ +#define IISC_MR_TXMONO_MONO (0x1u << 12) /**< \brief (IISC_MR) Left channel data is duplicated to right channel */ +#define IISC_MR_TXDMA (0x1u << 13) /**< \brief (IISC_MR) Single or Multiple DMA Channels for Transmitter */ +#define IISC_MR_TXDMA_SINGLE (0x0u << 13) /**< \brief (IISC_MR) Single DMA channel */ +#define IISC_MR_TXDMA_MULTIPLE (0x1u << 13) /**< \brief (IISC_MR) One DMA channel per data channel */ +#define IISC_MR_TXSAME (0x1u << 14) /**< \brief (IISC_MR) Transmit Data when Underrun */ +#define IISC_MR_TXSAME_ZERO (0x0u << 14) /**< \brief (IISC_MR) Zero data transmitted in case of underrun */ +#define IISC_MR_TXSAME_SAME (0x1u << 14) /**< \brief (IISC_MR) Last data transmitted in case of underrun */ +#define IISC_MR_IMCKFS_Pos 24 +#define IISC_MR_IMCKFS_Msk (0x3Fu << IISC_MR_IMCKFS_Pos) /**< \brief (IISC_MR) Master Clock to fs Ratio */ +#define IISC_MR_IMCKFS(value) ((IISC_MR_IMCKFS_Msk & ((value) << IISC_MR_IMCKFS_Pos))) +#define IISC_MR_IMCKFS_16 (0x0u << 24) /**< \brief (IISC_MR) 16 fs */ +#define IISC_MR_IMCKFS_32 (0x1u << 24) /**< \brief (IISC_MR) 32 fs */ +#define IISC_MR_IMCKFS_64 (0x3u << 24) /**< \brief (IISC_MR) 64 fs */ +#define IISC_MR_IMCKFS_128 (0x7u << 24) /**< \brief (IISC_MR) 128 fs */ +#define IISC_MR_IMCKFS_256 (0xFu << 24) /**< \brief (IISC_MR) 256 fs */ +#define IISC_MR_IMCKFS_384 (0x17u << 24) /**< \brief (IISC_MR) 384 fs */ +#define IISC_MR_IMCKFS_512 (0x1Fu << 24) /**< \brief (IISC_MR) 512 fs */ +#define IISC_MR_IMCKFS_768 (0x2Fu << 24) /**< \brief (IISC_MR) 768 fs */ +#define IISC_MR_IMCKFS_1024 (0x3Fu << 24) /**< \brief (IISC_MR) 1024 fs */ +#define IISC_MR_IMCKMODE (0x1u << 30) /**< \brief (IISC_MR) Master Clock Mode */ +#define IISC_MR_IMCKMODE_NO_IMCK (0x0u << 30) /**< \brief (IISC_MR) No IMCK generated */ +#define IISC_MR_IMCKMODE_IMCK (0x1u << 30) /**< \brief (IISC_MR) IMCK generated */ +#define IISC_MR_IWS24 (0x1u << 31) /**< \brief (IISC_MR) IWS Data Slot Width */ +#define IISC_MR_IWS24_32 (0x0u << 31) /**< \brief (IISC_MR) IWS Data Slot is 32-bit wide for DATALENGTH=18/20/24-bit */ +#define IISC_MR_IWS24_24 (0x1u << 31) /**< \brief (IISC_MR) IWS Data Slot is 24-bit wide for DATALENGTH=18/20/24-bit */ +/* -------- IISC_SR : (IISC Offset: 0x08) Status Register -------- */ +#define IISC_SR_RXEN (0x1u << 0) /**< \brief (IISC_SR) Receive Enable */ +#define IISC_SR_RXEN_OFF (0x0u << 0) /**< \brief (IISC_SR) Receiver is effectively disabled, following a CR.RXDIS or CR.SWRST request */ +#define IISC_SR_RXEN_ON (0x1u << 0) /**< \brief (IISC_SR) Receiver is effectively enabled, following a CR.RXEN request */ +#define IISC_SR_RXRDY (0x1u << 1) /**< \brief (IISC_SR) Receive Ready */ +#define IISC_SR_RXRDY_EMPTY (0x0u << 1) /**< \brief (IISC_SR) The register RHR is empty and can't be read */ +#define IISC_SR_RXRDY_FULL (0x1u << 1) /**< \brief (IISC_SR) The register RHR is full and is ready to be read */ +#define IISC_SR_RXOR (0x1u << 2) /**< \brief (IISC_SR) Receive Overrun */ +#define IISC_SR_RXOR_NO (0x0u << 2) /**< \brief (IISC_SR) No overrun */ +#define IISC_SR_RXOR_YES (0x1u << 2) /**< \brief (IISC_SR) The previous received data has not been read. This data is lost */ +#define IISC_SR_TXEN (0x1u << 4) /**< \brief (IISC_SR) Transmit Enable */ +#define IISC_SR_TXEN_OFF (0x0u << 4) /**< \brief (IISC_SR) Transmitter is effectively disabled, following a CR.TXDIS or CR.SWRST request */ +#define IISC_SR_TXEN_ON (0x1u << 4) /**< \brief (IISC_SR) Transmitter is effectively enabled, following a CR.TXEN request */ +#define IISC_SR_TXRDY (0x1u << 5) /**< \brief (IISC_SR) Transmit Ready */ +#define IISC_SR_TXRDY_FULL (0x0u << 5) /**< \brief (IISC_SR) The register THR is full and can't be written */ +#define IISC_SR_TXRDY_EMPTY (0x1u << 5) /**< \brief (IISC_SR) The register THR is empty and is ready to be written */ +#define IISC_SR_TXUR (0x1u << 6) /**< \brief (IISC_SR) Transmit Underrun */ +#define IISC_SR_TXUR_NO (0x0u << 6) /**< \brief (IISC_SR) No underrun */ +#define IISC_SR_TXUR_YES (0x1u << 6) /**< \brief (IISC_SR) The last bit of the last data written to the register THR has been set. Until the next write to THR, data will be sent according to MR.TXSAME field */ +#define IISC_SR_RXORCH_Pos 8 +#define IISC_SR_RXORCH_Msk (0x3u << IISC_SR_RXORCH_Pos) /**< \brief (IISC_SR) Receive Overrun Channels */ +#define IISC_SR_RXORCH(value) ((IISC_SR_RXORCH_Msk & ((value) << IISC_SR_RXORCH_Pos))) +#define IISC_SR_RXORCH_LEFT (0x0u << 8) /**< \brief (IISC_SR) Overrun first occurred on left channel */ +#define IISC_SR_RXORCH_RIGHT (0x1u << 8) /**< \brief (IISC_SR) Overrun first occurred on right channel */ +#define IISC_SR_TXURCH_Pos 20 +#define IISC_SR_TXURCH_Msk (0x3u << IISC_SR_TXURCH_Pos) /**< \brief (IISC_SR) Transmit Underrun Channels */ +#define IISC_SR_TXURCH(value) ((IISC_SR_TXURCH_Msk & ((value) << IISC_SR_TXURCH_Pos))) +#define IISC_SR_TXURCH_LEFT (0x0u << 20) /**< \brief (IISC_SR) Underrun first occurred on left channel */ +#define IISC_SR_TXURCH_RIGHT (0x1u << 20) /**< \brief (IISC_SR) Underrun first occurred on right channel */ +/* -------- IISC_SCR : (IISC Offset: 0x0C) Status Clear Register -------- */ +#define IISC_SCR_RXOR (0x1u << 2) /**< \brief (IISC_SCR) Receive Overrun */ +#define IISC_SCR_RXOR_NO (0x0u << 2) /**< \brief (IISC_SCR) No effect */ +#define IISC_SCR_RXOR_CLEAR (0x1u << 2) /**< \brief (IISC_SCR) Clears the corresponding SR bit */ +#define IISC_SCR_TXUR (0x1u << 6) /**< \brief (IISC_SCR) Transmit Underrun */ +#define IISC_SCR_TXUR_NO (0x0u << 6) /**< \brief (IISC_SCR) No effect */ +#define IISC_SCR_TXUR_CLEAR (0x1u << 6) /**< \brief (IISC_SCR) Clears the corresponding SR bit */ +#define IISC_SCR_RXORCH_Pos 8 +#define IISC_SCR_RXORCH_Msk (0x3u << IISC_SCR_RXORCH_Pos) /**< \brief (IISC_SCR) Receive Overrun Channels */ +#define IISC_SCR_RXORCH(value) ((IISC_SCR_RXORCH_Msk & ((value) << IISC_SCR_RXORCH_Pos))) +#define IISC_SCR_TXURCH_Pos 20 +#define IISC_SCR_TXURCH_Msk (0x3u << IISC_SCR_TXURCH_Pos) /**< \brief (IISC_SCR) Transmit Underrun Channels */ +#define IISC_SCR_TXURCH(value) ((IISC_SCR_TXURCH_Msk & ((value) << IISC_SCR_TXURCH_Pos))) +/* -------- IISC_SSR : (IISC Offset: 0x10) Status Set Register -------- */ +#define IISC_SSR_RXOR (0x1u << 2) /**< \brief (IISC_SSR) Receive Overrun */ +#define IISC_SSR_RXOR_NO (0x0u << 2) /**< \brief (IISC_SSR) No effect */ +#define IISC_SSR_RXOR_SET (0x1u << 2) /**< \brief (IISC_SSR) Sets corresponding SR bit */ +#define IISC_SSR_TXUR (0x1u << 6) /**< \brief (IISC_SSR) Transmit Underrun */ +#define IISC_SSR_TXUR_NO (0x0u << 6) /**< \brief (IISC_SSR) No effect */ +#define IISC_SSR_TXUR_SET (0x1u << 6) /**< \brief (IISC_SSR) Sets corresponding SR bit */ +#define IISC_SSR_RXORCH_Pos 8 +#define IISC_SSR_RXORCH_Msk (0x3u << IISC_SSR_RXORCH_Pos) /**< \brief (IISC_SSR) Receive Overrun Channels */ +#define IISC_SSR_RXORCH(value) ((IISC_SSR_RXORCH_Msk & ((value) << IISC_SSR_RXORCH_Pos))) +#define IISC_SSR_TXURCH_Pos 20 +#define IISC_SSR_TXURCH_Msk (0x3u << IISC_SSR_TXURCH_Pos) /**< \brief (IISC_SSR) Transmit Underrun Channels */ +#define IISC_SSR_TXURCH(value) ((IISC_SSR_TXURCH_Msk & ((value) << IISC_SSR_TXURCH_Pos))) +/* -------- IISC_IER : (IISC Offset: 0x14) Interrupt Enable Register -------- */ +#define IISC_IER_RXRDY (0x1u << 1) /**< \brief (IISC_IER) Receiver Ready Interrupt Enable */ +#define IISC_IER_RXRDY_OFF (0x0u << 1) /**< \brief (IISC_IER) No effect */ +#define IISC_IER_RXRDY_ON (0x1u << 1) /**< \brief (IISC_IER) Enables the corresponding interrupt */ +#define IISC_IER_RXOR (0x1u << 2) /**< \brief (IISC_IER) Receive Overrun Interrupt Enable */ +#define IISC_IER_RXOR_OFF (0x0u << 2) /**< \brief (IISC_IER) No effect */ +#define IISC_IER_RXOR_ON (0x1u << 2) /**< \brief (IISC_IER) Enables the corresponding interrupt */ +#define IISC_IER_TXRDY (0x1u << 5) /**< \brief (IISC_IER) Transmit Ready Interrupt Enable */ +#define IISC_IER_TXRDY_OFF (0x0u << 5) /**< \brief (IISC_IER) No effect */ +#define IISC_IER_TXRDY_ON (0x1u << 5) /**< \brief (IISC_IER) Enables the corresponding interrupt */ +#define IISC_IER_TXUR (0x1u << 6) /**< \brief (IISC_IER) Transmit Underrun Interrupt Enable */ +#define IISC_IER_TXUR_OFF (0x0u << 6) /**< \brief (IISC_IER) No effect */ +#define IISC_IER_TXUR_ON (0x1u << 6) /**< \brief (IISC_IER) Enables the corresponding interrupt */ +/* -------- IISC_IDR : (IISC Offset: 0x18) Interrupt Disable Register -------- */ +#define IISC_IDR_RXRDY (0x1u << 1) /**< \brief (IISC_IDR) Receive Ready Interrupt Disable */ +#define IISC_IDR_RXRDY_OFF (0x0u << 1) /**< \brief (IISC_IDR) No effect */ +#define IISC_IDR_RXRDY_ON (0x1u << 1) /**< \brief (IISC_IDR) Disables the corresponding interrupt */ +#define IISC_IDR_RXOR (0x1u << 2) /**< \brief (IISC_IDR) Receive Overrun Interrupt Disable */ +#define IISC_IDR_RXOR_OFF (0x0u << 2) /**< \brief (IISC_IDR) No effect */ +#define IISC_IDR_RXOR_ON (0x1u << 2) /**< \brief (IISC_IDR) Disables the corresponding interrupt */ +#define IISC_IDR_TXRDY (0x1u << 5) /**< \brief (IISC_IDR) Transmit Ready Interrupt Disable */ +#define IISC_IDR_TXRDY_OFF (0x0u << 5) /**< \brief (IISC_IDR) No effect */ +#define IISC_IDR_TXRDY_ON (0x1u << 5) /**< \brief (IISC_IDR) Disables the corresponding interrupt */ +#define IISC_IDR_TXUR (0x1u << 6) /**< \brief (IISC_IDR) Transmit Underrun Interrupt Disable */ +#define IISC_IDR_TXUR_OFF (0x0u << 6) /**< \brief (IISC_IDR) No effect */ +#define IISC_IDR_TXUR_ON (0x1u << 6) /**< \brief (IISC_IDR) Disables the corresponding interrupt */ +/* -------- IISC_IMR : (IISC Offset: 0x1C) Interrupt Mask Register -------- */ +#define IISC_IMR_RXRDY (0x1u << 1) /**< \brief (IISC_IMR) Receive Ready Interrupt Mask */ +#define IISC_IMR_RXRDY_DISABLED (0x0u << 1) /**< \brief (IISC_IMR) The corresponding interrupt is disabled */ +#define IISC_IMR_RXRDY_ENABLED (0x1u << 1) /**< \brief (IISC_IMR) The corresponding interrupt is enabled */ +#define IISC_IMR_RXOR (0x1u << 2) /**< \brief (IISC_IMR) Receive Overrun Interrupt Mask */ +#define IISC_IMR_RXOR_DISABLED (0x0u << 2) /**< \brief (IISC_IMR) The corresponding interrupt is disabled */ +#define IISC_IMR_RXOR_ENABLED (0x1u << 2) /**< \brief (IISC_IMR) The corresponding interrupt is enabled */ +#define IISC_IMR_TXRDY (0x1u << 5) /**< \brief (IISC_IMR) Transmit Ready Interrupt Mask */ +#define IISC_IMR_TXRDY_DISABLED (0x0u << 5) /**< \brief (IISC_IMR) The corresponding interrupt is disabled */ +#define IISC_IMR_TXRDY_ENABLED (0x1u << 5) /**< \brief (IISC_IMR) The corresponding interrupt is enabled */ +#define IISC_IMR_TXUR (0x1u << 6) /**< \brief (IISC_IMR) Transmit Underrun Interrupt Mask */ +#define IISC_IMR_TXUR_DISABLED (0x0u << 6) /**< \brief (IISC_IMR) The corresponding interrupt is disabled */ +#define IISC_IMR_TXUR_ENABLED (0x1u << 6) /**< \brief (IISC_IMR) The corresponding interrupt is enabled */ +/* -------- IISC_RHR : (IISC Offset: 0x20) Receive Holding Register -------- */ +#define IISC_RHR_RDAT_Pos 0 +#define IISC_RHR_RDAT_Msk (0xFFFFFFFFu << IISC_RHR_RDAT_Pos) /**< \brief (IISC_RHR) Receive Data */ +#define IISC_RHR_RDAT(value) ((IISC_RHR_RDAT_Msk & ((value) << IISC_RHR_RDAT_Pos))) +/* -------- IISC_THR : (IISC Offset: 0x24) Transmit Holding Register -------- */ +#define IISC_THR_TDAT_Pos 0 +#define IISC_THR_TDAT_Msk (0xFFFFFFFFu << IISC_THR_TDAT_Pos) /**< \brief (IISC_THR) Transmit Data */ +#define IISC_THR_TDAT(value) ((IISC_THR_TDAT_Msk & ((value) << IISC_THR_TDAT_Pos))) +/* -------- IISC_VERSION : (IISC Offset: 0x28) Version Register -------- */ +#define IISC_VERSION_VERSION_Pos 0 +#define IISC_VERSION_VERSION_Msk (0xFFFu << IISC_VERSION_VERSION_Pos) /**< \brief (IISC_VERSION) Reserved. Value subject to change. No functionality associated. This is the Atmel internal version of the macrocell. */ +#define IISC_VERSION_VERSION(value) ((IISC_VERSION_VERSION_Msk & ((value) << IISC_VERSION_VERSION_Pos))) +#define IISC_VERSION_VARIANT_Pos 16 +#define IISC_VERSION_VARIANT_Msk (0xFu << IISC_VERSION_VARIANT_Pos) /**< \brief (IISC_VERSION) Reserved. Value subject to change. No functionality associated. */ +#define IISC_VERSION_VARIANT(value) ((IISC_VERSION_VARIANT_Msk & ((value) << IISC_VERSION_VARIANT_Pos))) +/* -------- IISC_PARAMETER : (IISC Offset: 0x2C) Parameter Register -------- */ +#define IISC_PARAMETER_FORMAT (0x1u << 7) /**< \brief (IISC_PARAMETER) Data protocol format */ +#define IISC_PARAMETER_FORMAT_I2S (0x0u << 7) /**< \brief (IISC_PARAMETER) I2S format, stereo with IWS low for left channel */ +#define IISC_PARAMETER_NBCHAN_Pos 16 +#define IISC_PARAMETER_NBCHAN_Msk (0x1Fu << IISC_PARAMETER_NBCHAN_Pos) /**< \brief (IISC_PARAMETER) Maximum number of channels - 1 */ +#define IISC_PARAMETER_NBCHAN(value) ((IISC_PARAMETER_NBCHAN_Msk & ((value) << IISC_PARAMETER_NBCHAN_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR LCDCA */ +/* ============================================================================= */ +/** \addtogroup SAM4L_LCDCA LCD Controller */ +/*@{*/ + +#define REV_LCDCA 0x100 + +#ifndef __ASSEMBLY__ +/** \brief LCDCA hardware registers */ +typedef struct { + WoReg LCDCA_CR; /**< \brief (LCDCA Offset: 0x00) Control Register */ + RwReg LCDCA_CFG; /**< \brief (LCDCA Offset: 0x04) Configuration Register */ + RwReg LCDCA_TIM; /**< \brief (LCDCA Offset: 0x08) Timing Register */ + RoReg LCDCA_SR; /**< \brief (LCDCA Offset: 0x0C) Status Register */ + WoReg LCDCA_SCR; /**< \brief (LCDCA Offset: 0x10) Status Clear Register */ + RwReg LCDCA_DRL0; /**< \brief (LCDCA Offset: 0x14) Data Register Low 0 */ + RwReg LCDCA_DRH0; /**< \brief (LCDCA Offset: 0x18) Data Register High 0 */ + RwReg LCDCA_DRL1; /**< \brief (LCDCA Offset: 0x1C) Data Register Low 1 */ + RwReg LCDCA_DRH1; /**< \brief (LCDCA Offset: 0x20) Data Register High 1 */ + RwReg LCDCA_DRL2; /**< \brief (LCDCA Offset: 0x24) Data Register Low 2 */ + RwReg LCDCA_DRH2; /**< \brief (LCDCA Offset: 0x28) Data Register High 2 */ + RwReg LCDCA_DRL3; /**< \brief (LCDCA Offset: 0x2C) Data Register Low 3 */ + RwReg LCDCA_DRH3; /**< \brief (LCDCA Offset: 0x30) Data Register High 3 */ + WoReg LCDCA_IADR; /**< \brief (LCDCA Offset: 0x34) Indirect Access Data Register */ + RwReg LCDCA_BCFG; /**< \brief (LCDCA Offset: 0x38) Blink Configuration Register */ + RwReg LCDCA_CSRCFG; /**< \brief (LCDCA Offset: 0x3C) Circular Shift Register Configuration */ + RwReg LCDCA_CMCFG; /**< \brief (LCDCA Offset: 0x40) Character Mapping Configuration Register */ + WoReg LCDCA_CMDR; /**< \brief (LCDCA Offset: 0x44) Character Mapping Data Register */ + RwReg LCDCA_ACMCFG; /**< \brief (LCDCA Offset: 0x48) Automated Character Mapping Configuration Register */ + WoReg LCDCA_ACMDR; /**< \brief (LCDCA Offset: 0x4C) Automated Character Mapping Data Register */ + RwReg LCDCA_ABMCFG; /**< \brief (LCDCA Offset: 0x50) Automated Bit Mapping Configuration Register */ + WoReg LCDCA_ABMDR; /**< \brief (LCDCA Offset: 0x54) Automated Bit Mapping Data Register */ + WoReg LCDCA_IER; /**< \brief (LCDCA Offset: 0x58) Interrupt Enable Register */ + WoReg LCDCA_IDR; /**< \brief (LCDCA Offset: 0x5C) Interrupt Disable Register */ + RoReg LCDCA_IMR; /**< \brief (LCDCA Offset: 0x60) Interrupt Mask Register */ + RoReg LCDCA_VERSION; /**< \brief (LCDCA Offset: 0x64) Version Register */ +} Lcdca; +#endif /* __ASSEMBLY__ */ +/* -------- LCDCA_CR : (LCDCA Offset: 0x00) Control Register -------- */ +#define LCDCA_CR_DIS (0x1u << 0) /**< \brief (LCDCA_CR) Disable */ +#define LCDCA_CR_EN (0x1u << 1) /**< \brief (LCDCA_CR) Enable */ +#define LCDCA_CR_FC0DIS (0x1u << 2) /**< \brief (LCDCA_CR) Frame Counter 0 Disable */ +#define LCDCA_CR_FC0EN (0x1u << 3) /**< \brief (LCDCA_CR) Frame Counter 0 Enable */ +#define LCDCA_CR_FC1DIS (0x1u << 4) /**< \brief (LCDCA_CR) Frame Counter 1 Disable */ +#define LCDCA_CR_FC1EN (0x1u << 5) /**< \brief (LCDCA_CR) Frame Counter 1 Enable */ +#define LCDCA_CR_FC2DIS (0x1u << 6) /**< \brief (LCDCA_CR) Frame Counter 2 Disable */ +#define LCDCA_CR_FC2EN (0x1u << 7) /**< \brief (LCDCA_CR) Frame Counter 2 Enable */ +#define LCDCA_CR_CDM (0x1u << 8) /**< \brief (LCDCA_CR) Clear Display Memory */ +#define LCDCA_CR_WDIS (0x1u << 9) /**< \brief (LCDCA_CR) Wake up Disable */ +#define LCDCA_CR_WEN (0x1u << 10) /**< \brief (LCDCA_CR) Wake up Enable */ +#define LCDCA_CR_BSTART (0x1u << 11) /**< \brief (LCDCA_CR) Blinking Start */ +#define LCDCA_CR_BSTOP (0x1u << 12) /**< \brief (LCDCA_CR) Blinking Stop */ +#define LCDCA_CR_CSTART (0x1u << 13) /**< \brief (LCDCA_CR) Circular Shift Start */ +#define LCDCA_CR_CSTOP (0x1u << 14) /**< \brief (LCDCA_CR) Circular Shift Stop */ +/* -------- LCDCA_CFG : (LCDCA Offset: 0x04) Configuration Register -------- */ +#define LCDCA_CFG_XBIAS (0x1u << 0) /**< \brief (LCDCA_CFG) External Bias Generation */ +#define LCDCA_CFG_WMOD (0x1u << 1) /**< \brief (LCDCA_CFG) Waveform Mode */ +#define LCDCA_CFG_BLANK (0x1u << 2) /**< \brief (LCDCA_CFG) Blank LCD */ +#define LCDCA_CFG_LOCK (0x1u << 3) /**< \brief (LCDCA_CFG) Lock */ +#define LCDCA_CFG_DUTY_Pos 8 +#define LCDCA_CFG_DUTY_Msk (0x3u << LCDCA_CFG_DUTY_Pos) /**< \brief (LCDCA_CFG) Duty Select */ +#define LCDCA_CFG_DUTY(value) ((LCDCA_CFG_DUTY_Msk & ((value) << LCDCA_CFG_DUTY_Pos))) +#define LCDCA_CFG_FCST_Pos 16 +#define LCDCA_CFG_FCST_Msk (0x3Fu << LCDCA_CFG_FCST_Pos) /**< \brief (LCDCA_CFG) Fine Contrast */ +#define LCDCA_CFG_FCST(value) ((LCDCA_CFG_FCST_Msk & ((value) << LCDCA_CFG_FCST_Pos))) +#define LCDCA_CFG_NSU_Pos 24 +#define LCDCA_CFG_NSU_Msk (0x3Fu << LCDCA_CFG_NSU_Pos) /**< \brief (LCDCA_CFG) Number of Segment Terminals in Use */ +#define LCDCA_CFG_NSU(value) ((LCDCA_CFG_NSU_Msk & ((value) << LCDCA_CFG_NSU_Pos))) +/* -------- LCDCA_TIM : (LCDCA Offset: 0x08) Timing Register -------- */ +#define LCDCA_TIM_PRESC (0x1u << 0) /**< \brief (LCDCA_TIM) LCD Prescaler Select */ +#define LCDCA_TIM_CLKDIV_Pos 1 +#define LCDCA_TIM_CLKDIV_Msk (0x7u << LCDCA_TIM_CLKDIV_Pos) /**< \brief (LCDCA_TIM) LCD Clock Division */ +#define LCDCA_TIM_CLKDIV(value) ((LCDCA_TIM_CLKDIV_Msk & ((value) << LCDCA_TIM_CLKDIV_Pos))) +#define LCDCA_TIM_FC0_Pos 8 +#define LCDCA_TIM_FC0_Msk (0x1Fu << LCDCA_TIM_FC0_Pos) /**< \brief (LCDCA_TIM) Frame Counter 0 */ +#define LCDCA_TIM_FC0(value) ((LCDCA_TIM_FC0_Msk & ((value) << LCDCA_TIM_FC0_Pos))) +#define LCDCA_TIM_FC0PB (0x1u << 13) /**< \brief (LCDCA_TIM) Frame Counter 0 Prescaler Bypass */ +#define LCDCA_TIM_FC1_Pos 16 +#define LCDCA_TIM_FC1_Msk (0x1Fu << LCDCA_TIM_FC1_Pos) /**< \brief (LCDCA_TIM) Frame Counter 1 */ +#define LCDCA_TIM_FC1(value) ((LCDCA_TIM_FC1_Msk & ((value) << LCDCA_TIM_FC1_Pos))) +#define LCDCA_TIM_FC2_Pos 24 +#define LCDCA_TIM_FC2_Msk (0x1Fu << LCDCA_TIM_FC2_Pos) /**< \brief (LCDCA_TIM) Frame Counter 2 */ +#define LCDCA_TIM_FC2(value) ((LCDCA_TIM_FC2_Msk & ((value) << LCDCA_TIM_FC2_Pos))) +/* -------- LCDCA_SR : (LCDCA Offset: 0x0C) Status Register -------- */ +#define LCDCA_SR_FC0R (0x1u << 0) /**< \brief (LCDCA_SR) Frame Counter 0 Rollover */ +#define LCDCA_SR_FC0S (0x1u << 1) /**< \brief (LCDCA_SR) Frame Counter 0 Status */ +#define LCDCA_SR_FC1S (0x1u << 2) /**< \brief (LCDCA_SR) Frame Counter 1 Status */ +#define LCDCA_SR_FC2S (0x1u << 3) /**< \brief (LCDCA_SR) Frame Counter 2 Status */ +#define LCDCA_SR_EN (0x1u << 4) /**< \brief (LCDCA_SR) LCDCA Status */ +#define LCDCA_SR_WEN (0x1u << 5) /**< \brief (LCDCA_SR) Wake up Status */ +#define LCDCA_SR_BLKS (0x1u << 6) /**< \brief (LCDCA_SR) Blink Status */ +#define LCDCA_SR_CSRS (0x1u << 7) /**< \brief (LCDCA_SR) Circular Shift Register Status */ +#define LCDCA_SR_CPS (0x1u << 8) /**< \brief (LCDCA_SR) Charge Pump Status */ +/* -------- LCDCA_SCR : (LCDCA Offset: 0x10) Status Clear Register -------- */ +#define LCDCA_SCR_FC0R (0x1u << 0) /**< \brief (LCDCA_SCR) Frame Counter 0 Rollover */ +/* -------- LCDCA_DRL0 : (LCDCA Offset: 0x14) Data Register Low 0 -------- */ +#define LCDCA_DRL0_DATA_Pos 0 +#define LCDCA_DRL0_DATA_Msk (0xFFFFFFFFu << LCDCA_DRL0_DATA_Pos) /**< \brief (LCDCA_DRL0) Segments Value */ +#define LCDCA_DRL0_DATA(value) ((LCDCA_DRL0_DATA_Msk & ((value) << LCDCA_DRL0_DATA_Pos))) +/* -------- LCDCA_DRH0 : (LCDCA Offset: 0x18) Data Register High 0 -------- */ +#define LCDCA_DRH0_DATA_Pos 0 +#define LCDCA_DRH0_DATA_Msk (0xFFu << LCDCA_DRH0_DATA_Pos) /**< \brief (LCDCA_DRH0) Segments Value */ +#define LCDCA_DRH0_DATA(value) ((LCDCA_DRH0_DATA_Msk & ((value) << LCDCA_DRH0_DATA_Pos))) +/* -------- LCDCA_DRL1 : (LCDCA Offset: 0x1C) Data Register Low 1 -------- */ +#define LCDCA_DRL1_DATA_Pos 0 +#define LCDCA_DRL1_DATA_Msk (0xFFFFFFFFu << LCDCA_DRL1_DATA_Pos) /**< \brief (LCDCA_DRL1) Segments Value */ +#define LCDCA_DRL1_DATA(value) ((LCDCA_DRL1_DATA_Msk & ((value) << LCDCA_DRL1_DATA_Pos))) +/* -------- LCDCA_DRH1 : (LCDCA Offset: 0x20) Data Register High 1 -------- */ +#define LCDCA_DRH1_DATA_Pos 0 +#define LCDCA_DRH1_DATA_Msk (0xFFu << LCDCA_DRH1_DATA_Pos) /**< \brief (LCDCA_DRH1) Segments Value */ +#define LCDCA_DRH1_DATA(value) ((LCDCA_DRH1_DATA_Msk & ((value) << LCDCA_DRH1_DATA_Pos))) +/* -------- LCDCA_DRL2 : (LCDCA Offset: 0x24) Data Register Low 2 -------- */ +#define LCDCA_DRL2_DATA_Pos 0 +#define LCDCA_DRL2_DATA_Msk (0xFFFFFFFFu << LCDCA_DRL2_DATA_Pos) /**< \brief (LCDCA_DRL2) Segments Value */ +#define LCDCA_DRL2_DATA(value) ((LCDCA_DRL2_DATA_Msk & ((value) << LCDCA_DRL2_DATA_Pos))) +/* -------- LCDCA_DRH2 : (LCDCA Offset: 0x28) Data Register High 2 -------- */ +#define LCDCA_DRH2_DATA_Pos 0 +#define LCDCA_DRH2_DATA_Msk (0xFFu << LCDCA_DRH2_DATA_Pos) /**< \brief (LCDCA_DRH2) Segments Value */ +#define LCDCA_DRH2_DATA(value) ((LCDCA_DRH2_DATA_Msk & ((value) << LCDCA_DRH2_DATA_Pos))) +/* -------- LCDCA_DRL3 : (LCDCA Offset: 0x2C) Data Register Low 3 -------- */ +#define LCDCA_DRL3_DATA_Pos 0 +#define LCDCA_DRL3_DATA_Msk (0xFFFFFFFFu << LCDCA_DRL3_DATA_Pos) /**< \brief (LCDCA_DRL3) Segments Value */ +#define LCDCA_DRL3_DATA(value) ((LCDCA_DRL3_DATA_Msk & ((value) << LCDCA_DRL3_DATA_Pos))) +/* -------- LCDCA_DRH3 : (LCDCA Offset: 0x30) Data Register High 3 -------- */ +#define LCDCA_DRH3_DATA_Pos 0 +#define LCDCA_DRH3_DATA_Msk (0xFFu << LCDCA_DRH3_DATA_Pos) /**< \brief (LCDCA_DRH3) Segments Value */ +#define LCDCA_DRH3_DATA(value) ((LCDCA_DRH3_DATA_Msk & ((value) << LCDCA_DRH3_DATA_Pos))) +/* -------- LCDCA_IADR : (LCDCA Offset: 0x34) Indirect Access Data Register -------- */ +#define LCDCA_IADR_DATA_Pos 0 +#define LCDCA_IADR_DATA_Msk (0xFFu << LCDCA_IADR_DATA_Pos) /**< \brief (LCDCA_IADR) Segments Value */ +#define LCDCA_IADR_DATA(value) ((LCDCA_IADR_DATA_Msk & ((value) << LCDCA_IADR_DATA_Pos))) +#define LCDCA_IADR_DMASK_Pos 8 +#define LCDCA_IADR_DMASK_Msk (0xFFu << LCDCA_IADR_DMASK_Pos) /**< \brief (LCDCA_IADR) Data Mask */ +#define LCDCA_IADR_DMASK(value) ((LCDCA_IADR_DMASK_Msk & ((value) << LCDCA_IADR_DMASK_Pos))) +#define LCDCA_IADR_OFF_Pos 16 +#define LCDCA_IADR_OFF_Msk (0x1Fu << LCDCA_IADR_OFF_Pos) /**< \brief (LCDCA_IADR) Byte Offset */ +#define LCDCA_IADR_OFF(value) ((LCDCA_IADR_OFF_Msk & ((value) << LCDCA_IADR_OFF_Pos))) +/* -------- LCDCA_BCFG : (LCDCA Offset: 0x38) Blink Configuration Register -------- */ +#define LCDCA_BCFG_MODE (0x1u << 0) /**< \brief (LCDCA_BCFG) Blinking Mode */ +#define LCDCA_BCFG_FCS_Pos 1 +#define LCDCA_BCFG_FCS_Msk (0x3u << LCDCA_BCFG_FCS_Pos) /**< \brief (LCDCA_BCFG) Frame Counter Selection */ +#define LCDCA_BCFG_FCS(value) ((LCDCA_BCFG_FCS_Msk & ((value) << LCDCA_BCFG_FCS_Pos))) +#define LCDCA_BCFG_BSS0_Pos 8 +#define LCDCA_BCFG_BSS0_Msk (0xFu << LCDCA_BCFG_BSS0_Pos) /**< \brief (LCDCA_BCFG) Blink Segment Selection 0 */ +#define LCDCA_BCFG_BSS0(value) ((LCDCA_BCFG_BSS0_Msk & ((value) << LCDCA_BCFG_BSS0_Pos))) +#define LCDCA_BCFG_BSS1_Pos 12 +#define LCDCA_BCFG_BSS1_Msk (0xFu << LCDCA_BCFG_BSS1_Pos) /**< \brief (LCDCA_BCFG) Blink Segment Selection 1 */ +#define LCDCA_BCFG_BSS1(value) ((LCDCA_BCFG_BSS1_Msk & ((value) << LCDCA_BCFG_BSS1_Pos))) +/* -------- LCDCA_CSRCFG : (LCDCA Offset: 0x3C) Circular Shift Register Configuration -------- */ +#define LCDCA_CSRCFG_DIR (0x1u << 0) /**< \brief (LCDCA_CSRCFG) Direction */ +#define LCDCA_CSRCFG_FCS_Pos 1 +#define LCDCA_CSRCFG_FCS_Msk (0x3u << LCDCA_CSRCFG_FCS_Pos) /**< \brief (LCDCA_CSRCFG) Frame Counter Selection */ +#define LCDCA_CSRCFG_FCS(value) ((LCDCA_CSRCFG_FCS_Msk & ((value) << LCDCA_CSRCFG_FCS_Pos))) +#define LCDCA_CSRCFG_SIZE_Pos 3 +#define LCDCA_CSRCFG_SIZE_Msk (0x7u << LCDCA_CSRCFG_SIZE_Pos) /**< \brief (LCDCA_CSRCFG) Size */ +#define LCDCA_CSRCFG_SIZE(value) ((LCDCA_CSRCFG_SIZE_Msk & ((value) << LCDCA_CSRCFG_SIZE_Pos))) +#define LCDCA_CSRCFG_DATA_Pos 8 +#define LCDCA_CSRCFG_DATA_Msk (0xFFu << LCDCA_CSRCFG_DATA_Pos) /**< \brief (LCDCA_CSRCFG) Circular Shift Register Value */ +#define LCDCA_CSRCFG_DATA(value) ((LCDCA_CSRCFG_DATA_Msk & ((value) << LCDCA_CSRCFG_DATA_Pos))) +/* -------- LCDCA_CMCFG : (LCDCA Offset: 0x40) Character Mapping Configuration Register -------- */ +#define LCDCA_CMCFG_DREV (0x1u << 0) /**< \brief (LCDCA_CMCFG) Digit Reverse Mode */ +#define LCDCA_CMCFG_TDG_Pos 1 +#define LCDCA_CMCFG_TDG_Msk (0x3u << LCDCA_CMCFG_TDG_Pos) /**< \brief (LCDCA_CMCFG) Type of Digit */ +#define LCDCA_CMCFG_TDG(value) ((LCDCA_CMCFG_TDG_Msk & ((value) << LCDCA_CMCFG_TDG_Pos))) +#define LCDCA_CMCFG_STSEG_Pos 8 +#define LCDCA_CMCFG_STSEG_Msk (0x3Fu << LCDCA_CMCFG_STSEG_Pos) /**< \brief (LCDCA_CMCFG) Start Segment */ +#define LCDCA_CMCFG_STSEG(value) ((LCDCA_CMCFG_STSEG_Msk & ((value) << LCDCA_CMCFG_STSEG_Pos))) +/* -------- LCDCA_CMDR : (LCDCA Offset: 0x44) Character Mapping Data Register -------- */ +#define LCDCA_CMDR_ASCII_Pos 0 +#define LCDCA_CMDR_ASCII_Msk (0x7Fu << LCDCA_CMDR_ASCII_Pos) /**< \brief (LCDCA_CMDR) ASCII Code */ +#define LCDCA_CMDR_ASCII(value) ((LCDCA_CMDR_ASCII_Msk & ((value) << LCDCA_CMDR_ASCII_Pos))) +/* -------- LCDCA_ACMCFG : (LCDCA Offset: 0x48) Automated Character Mapping Configuration Register -------- */ +#define LCDCA_ACMCFG_EN (0x1u << 0) /**< \brief (LCDCA_ACMCFG) Enable */ +#define LCDCA_ACMCFG_FCS_Pos 1 +#define LCDCA_ACMCFG_FCS_Msk (0x3u << LCDCA_ACMCFG_FCS_Pos) /**< \brief (LCDCA_ACMCFG) Frame Counter Selection */ +#define LCDCA_ACMCFG_FCS(value) ((LCDCA_ACMCFG_FCS_Msk & ((value) << LCDCA_ACMCFG_FCS_Pos))) +#define LCDCA_ACMCFG_MODE (0x1u << 3) /**< \brief (LCDCA_ACMCFG) Mode (sequential or scrolling) */ +#define LCDCA_ACMCFG_DREV (0x1u << 4) /**< \brief (LCDCA_ACMCFG) Digit Reverse */ +#define LCDCA_ACMCFG_TDG_Pos 5 +#define LCDCA_ACMCFG_TDG_Msk (0x3u << LCDCA_ACMCFG_TDG_Pos) /**< \brief (LCDCA_ACMCFG) Type of Digit */ +#define LCDCA_ACMCFG_TDG(value) ((LCDCA_ACMCFG_TDG_Msk & ((value) << LCDCA_ACMCFG_TDG_Pos))) +#define LCDCA_ACMCFG_STSEG_Pos 8 +#define LCDCA_ACMCFG_STSEG_Msk (0x3Fu << LCDCA_ACMCFG_STSEG_Pos) /**< \brief (LCDCA_ACMCFG) Start Segment */ +#define LCDCA_ACMCFG_STSEG(value) ((LCDCA_ACMCFG_STSEG_Msk & ((value) << LCDCA_ACMCFG_STSEG_Pos))) +#define LCDCA_ACMCFG_STEPS_Pos 16 +#define LCDCA_ACMCFG_STEPS_Msk (0xFFu << LCDCA_ACMCFG_STEPS_Pos) /**< \brief (LCDCA_ACMCFG) Scrolling Steps */ +#define LCDCA_ACMCFG_STEPS(value) ((LCDCA_ACMCFG_STEPS_Msk & ((value) << LCDCA_ACMCFG_STEPS_Pos))) +#define LCDCA_ACMCFG_DIGN_Pos 24 +#define LCDCA_ACMCFG_DIGN_Msk (0xFu << LCDCA_ACMCFG_DIGN_Pos) /**< \brief (LCDCA_ACMCFG) Digit Number */ +#define LCDCA_ACMCFG_DIGN(value) ((LCDCA_ACMCFG_DIGN_Msk & ((value) << LCDCA_ACMCFG_DIGN_Pos))) +/* -------- LCDCA_ACMDR : (LCDCA Offset: 0x4C) Automated Character Mapping Data Register -------- */ +#define LCDCA_ACMDR_ASCII_Pos 0 +#define LCDCA_ACMDR_ASCII_Msk (0x7Fu << LCDCA_ACMDR_ASCII_Pos) /**< \brief (LCDCA_ACMDR) ASCII Code */ +#define LCDCA_ACMDR_ASCII(value) ((LCDCA_ACMDR_ASCII_Msk & ((value) << LCDCA_ACMDR_ASCII_Pos))) +/* -------- LCDCA_ABMCFG : (LCDCA Offset: 0x50) Automated Bit Mapping Configuration Register -------- */ +#define LCDCA_ABMCFG_EN (0x1u << 0) /**< \brief (LCDCA_ABMCFG) Enable */ +#define LCDCA_ABMCFG_FCS_Pos 1 +#define LCDCA_ABMCFG_FCS_Msk (0x3u << LCDCA_ABMCFG_FCS_Pos) /**< \brief (LCDCA_ABMCFG) Frame Counter Selection */ +#define LCDCA_ABMCFG_FCS(value) ((LCDCA_ABMCFG_FCS_Msk & ((value) << LCDCA_ABMCFG_FCS_Pos))) +#define LCDCA_ABMCFG_SIZE_Pos 8 +#define LCDCA_ABMCFG_SIZE_Msk (0x1Fu << LCDCA_ABMCFG_SIZE_Pos) /**< \brief (LCDCA_ABMCFG) Size */ +#define LCDCA_ABMCFG_SIZE(value) ((LCDCA_ABMCFG_SIZE_Msk & ((value) << LCDCA_ABMCFG_SIZE_Pos))) +/* -------- LCDCA_ABMDR : (LCDCA Offset: 0x54) Automated Bit Mapping Data Register -------- */ +#define LCDCA_ABMDR_DATA_Pos 0 +#define LCDCA_ABMDR_DATA_Msk (0xFFu << LCDCA_ABMDR_DATA_Pos) /**< \brief (LCDCA_ABMDR) Segments Value */ +#define LCDCA_ABMDR_DATA(value) ((LCDCA_ABMDR_DATA_Msk & ((value) << LCDCA_ABMDR_DATA_Pos))) +#define LCDCA_ABMDR_DMASK_Pos 8 +#define LCDCA_ABMDR_DMASK_Msk (0xFFu << LCDCA_ABMDR_DMASK_Pos) /**< \brief (LCDCA_ABMDR) Data Mask */ +#define LCDCA_ABMDR_DMASK(value) ((LCDCA_ABMDR_DMASK_Msk & ((value) << LCDCA_ABMDR_DMASK_Pos))) +#define LCDCA_ABMDR_OFF_Pos 16 +#define LCDCA_ABMDR_OFF_Msk (0x1Fu << LCDCA_ABMDR_OFF_Pos) /**< \brief (LCDCA_ABMDR) Byte Offset */ +#define LCDCA_ABMDR_OFF(value) ((LCDCA_ABMDR_OFF_Msk & ((value) << LCDCA_ABMDR_OFF_Pos))) +/* -------- LCDCA_IER : (LCDCA Offset: 0x58) Interrupt Enable Register -------- */ +#define LCDCA_IER_FC0R (0x1u << 0) /**< \brief (LCDCA_IER) Frame Counter 0 Rollover */ +/* -------- LCDCA_IDR : (LCDCA Offset: 0x5C) Interrupt Disable Register -------- */ +#define LCDCA_IDR_FC0R (0x1u << 0) /**< \brief (LCDCA_IDR) Frame Counter 0 Rollover */ +/* -------- LCDCA_IMR : (LCDCA Offset: 0x60) Interrupt Mask Register -------- */ +#define LCDCA_IMR_FC0R (0x1u << 0) /**< \brief (LCDCA_IMR) Frame Counter 0 Rollover */ +/* -------- LCDCA_VERSION : (LCDCA Offset: 0x64) Version Register -------- */ +#define LCDCA_VERSION_VERSION_Pos 0 +#define LCDCA_VERSION_VERSION_Msk (0xFFFu << LCDCA_VERSION_VERSION_Pos) /**< \brief (LCDCA_VERSION) Version Number */ +#define LCDCA_VERSION_VERSION(value) ((LCDCA_VERSION_VERSION_Msk & ((value) << LCDCA_VERSION_VERSION_Pos))) +#define LCDCA_VERSION_VARIANT_Pos 16 +#define LCDCA_VERSION_VARIANT_Msk (0xFu << LCDCA_VERSION_VARIANT_Pos) /**< \brief (LCDCA_VERSION) Variant Number */ +#define LCDCA_VERSION_VARIANT(value) ((LCDCA_VERSION_VARIANT_Msk & ((value) << LCDCA_VERSION_VARIANT_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR PARC */ +/* ============================================================================= */ +/** \addtogroup SAM4L_PARC Parallel Capture */ +/*@{*/ + +#define REV_PARC 0x100 + +#ifndef __ASSEMBLY__ +/** \brief PARC hardware registers */ +typedef struct { + RwReg PARC_CFG; /**< \brief (PARC Offset: 0x00) Configuration Register */ + RwReg PARC_CR; /**< \brief (PARC Offset: 0x04) Control Register */ + WoReg PARC_IER; /**< \brief (PARC Offset: 0x08) Interrupt Enable Register */ + WoReg PARC_IDR; /**< \brief (PARC Offset: 0x0C) Interrupt Disable Register */ + RoReg PARC_IMR; /**< \brief (PARC Offset: 0x10) Interrupt Mask Register */ + RoReg PARC_SR; /**< \brief (PARC Offset: 0x14) Status Register */ + WoReg PARC_ICR; /**< \brief (PARC Offset: 0x18) Interrupt Status Clear Register */ + RoReg PARC_RHR; /**< \brief (PARC Offset: 0x1C) Receive Holding Register */ + RoReg PARC_VERSION; /**< \brief (PARC Offset: 0x20) Version Register */ +} Parc; +#endif /* __ASSEMBLY__ */ +/* -------- PARC_CFG : (PARC Offset: 0x00) Configuration Register -------- */ +#define PARC_CFG_DSIZE_Pos 0 +#define PARC_CFG_DSIZE_Msk (0x3u << PARC_CFG_DSIZE_Pos) /**< \brief (PARC_CFG) Data Size */ +#define PARC_CFG_DSIZE(value) ((PARC_CFG_DSIZE_Msk & ((value) << PARC_CFG_DSIZE_Pos))) +#define PARC_CFG_SMODE_Pos 2 +#define PARC_CFG_SMODE_Msk (0x3u << PARC_CFG_SMODE_Pos) /**< \brief (PARC_CFG) Sampling Mode */ +#define PARC_CFG_SMODE(value) ((PARC_CFG_SMODE_Msk & ((value) << PARC_CFG_SMODE_Pos))) +#define PARC_CFG_EMODE (0x1u << 4) /**< \brief (PARC_CFG) Events Mode */ +#define PARC_CFG_EDGE (0x1u << 5) /**< \brief (PARC_CFG) Sampling Edge Select */ +#define PARC_CFG_HALF (0x1u << 6) /**< \brief (PARC_CFG) Half Capture */ +#define PARC_CFG_ODD (0x1u << 7) /**< \brief (PARC_CFG) Odd Capture */ +/* -------- PARC_CR : (PARC Offset: 0x04) Control Register -------- */ +#define PARC_CR_EN (0x1u << 0) /**< \brief (PARC_CR) Enable */ +#define PARC_CR_DIS (0x1u << 1) /**< \brief (PARC_CR) Disable */ +#define PARC_CR_START (0x1u << 2) /**< \brief (PARC_CR) Start Capture */ +#define PARC_CR_STOP (0x1u << 3) /**< \brief (PARC_CR) Stop Capture */ +/* -------- PARC_IER : (PARC Offset: 0x08) Interrupt Enable Register -------- */ +#define PARC_IER_DRDY (0x1u << 2) /**< \brief (PARC_IER) Data Ready Interrupt Enable */ +#define PARC_IER_OVR (0x1u << 3) /**< \brief (PARC_IER) Overrun Interrupt Enable */ +/* -------- PARC_IDR : (PARC Offset: 0x0C) Interrupt Disable Register -------- */ +#define PARC_IDR_DRDY (0x1u << 2) /**< \brief (PARC_IDR) Data Ready Interrupt Disable */ +#define PARC_IDR_OVR (0x1u << 3) /**< \brief (PARC_IDR) Overrun Interrupt Disable */ +/* -------- PARC_IMR : (PARC Offset: 0x10) Interrupt Mask Register -------- */ +#define PARC_IMR_DRDY (0x1u << 2) /**< \brief (PARC_IMR) Data Ready Interrupt Mask */ +#define PARC_IMR_OVR (0x1u << 3) /**< \brief (PARC_IMR) Overrun Interrupt Mask */ +/* -------- PARC_SR : (PARC Offset: 0x14) Status Register -------- */ +#define PARC_SR_EN (0x1u << 0) /**< \brief (PARC_SR) Enable Status */ +#define PARC_SR_CS (0x1u << 1) /**< \brief (PARC_SR) Capture Status */ +#define PARC_SR_DRDY (0x1u << 2) /**< \brief (PARC_SR) Data Ready Interrupt Status */ +#define PARC_SR_OVR (0x1u << 3) /**< \brief (PARC_SR) Overrun Interrupt Status */ +/* -------- PARC_ICR : (PARC Offset: 0x18) Interrupt Status Clear Register -------- */ +#define PARC_ICR_DRDY (0x1u << 2) /**< \brief (PARC_ICR) Data Ready Interrupt Status Clear */ +#define PARC_ICR_OVR (0x1u << 3) /**< \brief (PARC_ICR) Overrun Interrupt Status Clear */ +/* -------- PARC_RHR : (PARC Offset: 0x1C) Receive Holding Register -------- */ +#define PARC_RHR_CDATA_Pos 0 +#define PARC_RHR_CDATA_Msk (0xFFFFFFFFu << PARC_RHR_CDATA_Pos) /**< \brief (PARC_RHR) Captured Data */ +#define PARC_RHR_CDATA(value) ((PARC_RHR_CDATA_Msk & ((value) << PARC_RHR_CDATA_Pos))) +/* -------- PARC_VERSION : (PARC Offset: 0x20) Version Register -------- */ +#define PARC_VERSION_VERSION_Pos 0 +#define PARC_VERSION_VERSION_Msk (0xFFFu << PARC_VERSION_VERSION_Pos) /**< \brief (PARC_VERSION) Version Number */ +#define PARC_VERSION_VERSION(value) ((PARC_VERSION_VERSION_Msk & ((value) << PARC_VERSION_VERSION_Pos))) +#define PARC_VERSION_VARIANT_Pos 16 +#define PARC_VERSION_VARIANT_Msk (0xFu << PARC_VERSION_VARIANT_Pos) /**< \brief (PARC_VERSION) Variant Number */ +#define PARC_VERSION_VARIANT(value) ((PARC_VERSION_VARIANT_Msk & ((value) << PARC_VERSION_VARIANT_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR PDCA */ +/* ============================================================================= */ +/** \addtogroup SAM4L_PDCA Peripheral DMA Controller */ +/*@{*/ + +#define REV_PDCA 0x124 + +#ifndef __ASSEMBLY__ +/** \brief PdcaChannel hardware registers */ +typedef struct { + RwReg PDCA_MAR; /**< \brief (PdcaChannel Offset: 0x000) Memory Address Register */ + RwReg PDCA_PSR; /**< \brief (PdcaChannel Offset: 0x004) Peripheral Select Register */ + RwReg PDCA_TCR; /**< \brief (PdcaChannel Offset: 0x008) Transfer Counter Register */ + RwReg PDCA_MARR; /**< \brief (PdcaChannel Offset: 0x00C) Memory Address Reload Register */ + RwReg PDCA_TCRR; /**< \brief (PdcaChannel Offset: 0x010) Transfer Counter Reload Register */ + WoReg PDCA_CR; /**< \brief (PdcaChannel Offset: 0x014) Control Register */ + RwReg PDCA_MR; /**< \brief (PdcaChannel Offset: 0x018) Mode Register */ + RoReg PDCA_SR; /**< \brief (PdcaChannel Offset: 0x01C) Status Register */ + WoReg PDCA_IER; /**< \brief (PdcaChannel Offset: 0x020) Interrupt Enable Register */ + WoReg PDCA_IDR; /**< \brief (PdcaChannel Offset: 0x024) Interrupt Disable Register */ + RoReg PDCA_IMR; /**< \brief (PdcaChannel Offset: 0x028) Interrupt Mask Register */ + RoReg PDCA_ISR; /**< \brief (PdcaChannel Offset: 0x02C) Interrupt Status Register */ + RoReg Reserved1[4]; +} PdcaChannel; +/** \brief PDCA hardware registers */ +#define PDCA_CHANNEL_LENGTH 16 +typedef struct { + PdcaChannel PDCA_CHANNEL[PDCA_CHANNEL_LENGTH]; /**< \brief (PDCA Offset: 0x000) PdcaChannel groups */ + PdcaChannel Reserved1[32 - PDCA_CHANNEL_LENGTH]; + RwReg PDCA_PCONTROL; /**< \brief (PDCA Offset: 0x800) Performance Control Register */ + RoReg PDCA_PRDATA0; /**< \brief (PDCA Offset: 0x804) Channel 0 Read Data Cycles */ + RoReg PDCA_PRSTALL0; /**< \brief (PDCA Offset: 0x808) Channel 0 Read Stall Cycles */ + RoReg PDCA_PRLAT0; /**< \brief (PDCA Offset: 0x80C) Channel 0 Read Max Latency */ + RoReg PDCA_PWDATA0; /**< \brief (PDCA Offset: 0x810) Channel 0 Write Data Cycles */ + RoReg PDCA_PWSTALL0; /**< \brief (PDCA Offset: 0x814) Channel 0 Write Stall Cycles */ + RoReg PDCA_PWLAT0; /**< \brief (PDCA Offset: 0x818) Channel0 Write Max Latency */ + RoReg PDCA_PRDATA1; /**< \brief (PDCA Offset: 0x81C) Channel 1 Read Data Cycles */ + RoReg PDCA_PRSTALL1; /**< \brief (PDCA Offset: 0x820) Channel Read Stall Cycles */ + RoReg PDCA_PRLAT1; /**< \brief (PDCA Offset: 0x824) Channel 1 Read Max Latency */ + RoReg PDCA_PWDATA1; /**< \brief (PDCA Offset: 0x828) Channel 1 Write Data Cycles */ + RoReg PDCA_PWSTALL1; /**< \brief (PDCA Offset: 0x82C) Channel 1 Write stall Cycles */ + RoReg PDCA_PWLAT1; /**< \brief (PDCA Offset: 0x830) Channel 1 Read Max Latency */ + RoReg PDCA_VERSION; /**< \brief (PDCA Offset: 0x834) Version Register */ +} Pdca; +#endif /* __ASSEMBLY__ */ +/* -------- PDCA_MAR : (PDCA Offset: 0x000) Channel Memory Address Register -------- */ +#define PDCA_MAR_MADDR_Pos 0 +#define PDCA_MAR_MADDR_Msk (0xFFFFFFFFu << PDCA_MAR_MADDR_Pos) /**< \brief (PDCA_MAR) Memory Address */ +#define PDCA_MAR_MADDR(value) ((PDCA_MAR_MADDR_Msk & ((value) << PDCA_MAR_MADDR_Pos))) +/* -------- PDCA_PSR : (PDCA Offset: 0x004) Channel Peripheral Select Register -------- */ +#define PDCA_PSR_PID_Pos 0 +#define PDCA_PSR_PID_Msk (0xFFu << PDCA_PSR_PID_Pos) /**< \brief (PDCA_PSR) Peripheral Identifier */ +#define PDCA_PSR_PID(value) ((PDCA_PSR_PID_Msk & ((value) << PDCA_PSR_PID_Pos))) +/* -------- PDCA_TCR : (PDCA Offset: 0x008) Channel Transfer Counter Register -------- */ +#define PDCA_TCR_TCV_Pos 0 +#define PDCA_TCR_TCV_Msk (0xFFFFu << PDCA_TCR_TCV_Pos) /**< \brief (PDCA_TCR) Transfer Counter Value */ +#define PDCA_TCR_TCV(value) ((PDCA_TCR_TCV_Msk & ((value) << PDCA_TCR_TCV_Pos))) +/* -------- PDCA_MARR : (PDCA Offset: 0x00C) Channel Memory Address Reload Register -------- */ +#define PDCA_MARR_MARV_Pos 0 +#define PDCA_MARR_MARV_Msk (0xFFFFFFFFu << PDCA_MARR_MARV_Pos) /**< \brief (PDCA_MARR) Memory Address Reload Value */ +#define PDCA_MARR_MARV(value) ((PDCA_MARR_MARV_Msk & ((value) << PDCA_MARR_MARV_Pos))) +/* -------- PDCA_TCRR : (PDCA Offset: 0x010) Channel Transfer Counter Reload Register -------- */ +#define PDCA_TCRR_TCRV_Pos 0 +#define PDCA_TCRR_TCRV_Msk (0xFFFFu << PDCA_TCRR_TCRV_Pos) /**< \brief (PDCA_TCRR) Transfer Counter Reload Value */ +#define PDCA_TCRR_TCRV(value) ((PDCA_TCRR_TCRV_Msk & ((value) << PDCA_TCRR_TCRV_Pos))) +/* -------- PDCA_CR : (PDCA Offset: 0x014) Channel Control Register -------- */ +#define PDCA_CR_TEN (0x1u << 0) /**< \brief (PDCA_CR) Transfer Enable */ +#define PDCA_CR_TDIS (0x1u << 1) /**< \brief (PDCA_CR) Transfer Disable */ +#define PDCA_CR_ECLR (0x1u << 8) /**< \brief (PDCA_CR) Error Clear */ +/* -------- PDCA_MR : (PDCA Offset: 0x018) Channel Mode Register -------- */ +#define PDCA_MR_SIZE_Pos 0 +#define PDCA_MR_SIZE_Msk (0x3u << PDCA_MR_SIZE_Pos) /**< \brief (PDCA_MR) Transfer size */ +#define PDCA_MR_SIZE(value) ((PDCA_MR_SIZE_Msk & ((value) << PDCA_MR_SIZE_Pos))) +#define PDCA_MR_SIZE_BYTE (0x0u << 0) /**< \brief (PDCA_MR) */ +#define PDCA_MR_SIZE_HALF_WORD (0x1u << 0) /**< \brief (PDCA_MR) */ +#define PDCA_MR_SIZE_WORD (0x2u << 0) /**< \brief (PDCA_MR) */ +#define PDCA_MR_ETRIG (0x1u << 2) /**< \brief (PDCA_MR) Event trigger */ +#define PDCA_MR_RING (0x1u << 3) /**< \brief (PDCA_MR) Ring Buffer */ +/* -------- PDCA_SR : (PDCA Offset: 0x01C) Channel Status Register -------- */ +#define PDCA_SR_TEN (0x1u << 0) /**< \brief (PDCA_SR) Transfer Enabled */ +/* -------- PDCA_IER : (PDCA Offset: 0x020) Channel Interrupt Enable Register -------- */ +#define PDCA_IER_RCZ (0x1u << 0) /**< \brief (PDCA_IER) Reload Counter Zero */ +#define PDCA_IER_TRC (0x1u << 1) /**< \brief (PDCA_IER) Transfer Complete */ +#define PDCA_IER_TERR (0x1u << 2) /**< \brief (PDCA_IER) Transfer Error */ +/* -------- PDCA_IDR : (PDCA Offset: 0x024) Channel Interrupt Disable Register -------- */ +#define PDCA_IDR_RCZ (0x1u << 0) /**< \brief (PDCA_IDR) Reload Counter Zero */ +#define PDCA_IDR_TRC (0x1u << 1) /**< \brief (PDCA_IDR) Transfer Complete */ +#define PDCA_IDR_TERR (0x1u << 2) /**< \brief (PDCA_IDR) Transfer Error */ +/* -------- PDCA_IMR : (PDCA Offset: 0x028) Channel Interrupt Mask Register -------- */ +#define PDCA_IMR_RCZ (0x1u << 0) /**< \brief (PDCA_IMR) Reload Counter Zero */ +#define PDCA_IMR_TRC (0x1u << 1) /**< \brief (PDCA_IMR) Transfer Complete */ +#define PDCA_IMR_TERR (0x1u << 2) /**< \brief (PDCA_IMR) Transfer Error */ +/* -------- PDCA_ISR : (PDCA Offset: 0x02C) Channel Interrupt Status Register -------- */ +#define PDCA_ISR_RCZ (0x1u << 0) /**< \brief (PDCA_ISR) Reload Counter Zero */ +#define PDCA_ISR_TRC (0x1u << 1) /**< \brief (PDCA_ISR) Transfer Complete */ +#define PDCA_ISR_TERR (0x1u << 2) /**< \brief (PDCA_ISR) Transfer Error */ +/* -------- PDCA_PCONTROL : (PDCA Offset: 0x800) Performance Control Register -------- */ +#define PDCA_PCONTROL_CH0EN (0x1u << 0) /**< \brief (PDCA_PCONTROL) Channel 0 Enabled */ +#define PDCA_PCONTROL_CH1EN (0x1u << 1) /**< \brief (PDCA_PCONTROL) Channel 1 Enabled. */ +#define PDCA_PCONTROL_CH0OF (0x1u << 4) /**< \brief (PDCA_PCONTROL) Channel 0 Overflow Freeze */ +#define PDCA_PCONTROL_CH1OF (0x1u << 5) /**< \brief (PDCA_PCONTROL) Channel 1 overflow freeze */ +#define PDCA_PCONTROL_CH0RES (0x1u << 8) /**< \brief (PDCA_PCONTROL) Channel 0 counter reset */ +#define PDCA_PCONTROL_CH1RES (0x1u << 9) /**< \brief (PDCA_PCONTROL) Channel 1 counter reset */ +#define PDCA_PCONTROL_MON0CH_Pos 16 +#define PDCA_PCONTROL_MON0CH_Msk (0x3Fu << PDCA_PCONTROL_MON0CH_Pos) /**< \brief (PDCA_PCONTROL) PDCA Channel to monitor with counter 0 */ +#define PDCA_PCONTROL_MON0CH(value) ((PDCA_PCONTROL_MON0CH_Msk & ((value) << PDCA_PCONTROL_MON0CH_Pos))) +#define PDCA_PCONTROL_MON1CH_Pos 24 +#define PDCA_PCONTROL_MON1CH_Msk (0x3Fu << PDCA_PCONTROL_MON1CH_Pos) /**< \brief (PDCA_PCONTROL) PDCA Channel to monitor with counter 1 */ +#define PDCA_PCONTROL_MON1CH(value) ((PDCA_PCONTROL_MON1CH_Msk & ((value) << PDCA_PCONTROL_MON1CH_Pos))) +/* -------- PDCA_PRDATA0 : (PDCA Offset: 0x804) Channel 0 Read Data Cycles -------- */ +#define PDCA_PRDATA0_DATA_Pos 0 +#define PDCA_PRDATA0_DATA_Msk (0xFFFFFFFFu << PDCA_PRDATA0_DATA_Pos) /**< \brief (PDCA_PRDATA0) Data Cycles Counted Since Last reset */ +#define PDCA_PRDATA0_DATA(value) ((PDCA_PRDATA0_DATA_Msk & ((value) << PDCA_PRDATA0_DATA_Pos))) +/* -------- PDCA_PRSTALL0 : (PDCA Offset: 0x808) Channel 0 Read Stall Cycles -------- */ +#define PDCA_PRSTALL0_STALL_Pos 0 +#define PDCA_PRSTALL0_STALL_Msk (0xFFFFFFFFu << PDCA_PRSTALL0_STALL_Pos) /**< \brief (PDCA_PRSTALL0) Stall Cycles counted since last reset */ +#define PDCA_PRSTALL0_STALL(value) ((PDCA_PRSTALL0_STALL_Msk & ((value) << PDCA_PRSTALL0_STALL_Pos))) +/* -------- PDCA_PRLAT0 : (PDCA Offset: 0x80C) Channel 0 Read Max Latency -------- */ +#define PDCA_PRLAT0_LAT_Pos 0 +#define PDCA_PRLAT0_LAT_Msk (0xFFFFu << PDCA_PRLAT0_LAT_Pos) /**< \brief (PDCA_PRLAT0) Maximum Transfer Initiation cycles counted since last reset */ +#define PDCA_PRLAT0_LAT(value) ((PDCA_PRLAT0_LAT_Msk & ((value) << PDCA_PRLAT0_LAT_Pos))) +/* -------- PDCA_PWDATA0 : (PDCA Offset: 0x810) Channel 0 Write Data Cycles -------- */ +#define PDCA_PWDATA0_DATA_Pos 0 +#define PDCA_PWDATA0_DATA_Msk (0xFFFFFFFFu << PDCA_PWDATA0_DATA_Pos) /**< \brief (PDCA_PWDATA0) Data Cycles Counted since last Reset */ +#define PDCA_PWDATA0_DATA(value) ((PDCA_PWDATA0_DATA_Msk & ((value) << PDCA_PWDATA0_DATA_Pos))) +/* -------- PDCA_PWSTALL0 : (PDCA Offset: 0x814) Channel 0 Write Stall Cycles -------- */ +#define PDCA_PWSTALL0_STALL_Pos 0 +#define PDCA_PWSTALL0_STALL_Msk (0xFFFFFFFFu << PDCA_PWSTALL0_STALL_Pos) /**< \brief (PDCA_PWSTALL0) Stall cycles counted since last reset */ +#define PDCA_PWSTALL0_STALL(value) ((PDCA_PWSTALL0_STALL_Msk & ((value) << PDCA_PWSTALL0_STALL_Pos))) +/* -------- PDCA_PWLAT0 : (PDCA Offset: 0x818) Channel0 Write Max Latency -------- */ +#define PDCA_PWLAT0_LAT_Pos 0 +#define PDCA_PWLAT0_LAT_Msk (0xFFFFu << PDCA_PWLAT0_LAT_Pos) /**< \brief (PDCA_PWLAT0) Maximum transfer initiation cycles counted since last reset */ +#define PDCA_PWLAT0_LAT(value) ((PDCA_PWLAT0_LAT_Msk & ((value) << PDCA_PWLAT0_LAT_Pos))) +/* -------- PDCA_PRDATA1 : (PDCA Offset: 0x81C) Channel 1 Read Data Cycles -------- */ +#define PDCA_PRDATA1_DATA_Pos 0 +#define PDCA_PRDATA1_DATA_Msk (0xFFFFFFFFu << PDCA_PRDATA1_DATA_Pos) /**< \brief (PDCA_PRDATA1) Data Cycles Counted Since Last reset */ +#define PDCA_PRDATA1_DATA(value) ((PDCA_PRDATA1_DATA_Msk & ((value) << PDCA_PRDATA1_DATA_Pos))) +/* -------- PDCA_PRSTALL1 : (PDCA Offset: 0x820) Channel Read Stall Cycles -------- */ +#define PDCA_PRSTALL1_STALL_Pos 0 +#define PDCA_PRSTALL1_STALL_Msk (0xFFFFFFFFu << PDCA_PRSTALL1_STALL_Pos) /**< \brief (PDCA_PRSTALL1) Stall Cycles Counted since last reset */ +#define PDCA_PRSTALL1_STALL(value) ((PDCA_PRSTALL1_STALL_Msk & ((value) << PDCA_PRSTALL1_STALL_Pos))) +/* -------- PDCA_PRLAT1 : (PDCA Offset: 0x824) Channel 1 Read Max Latency -------- */ +#define PDCA_PRLAT1_LAT_Pos 0 +#define PDCA_PRLAT1_LAT_Msk (0xFFFFu << PDCA_PRLAT1_LAT_Pos) /**< \brief (PDCA_PRLAT1) Maximum Transfer initiation cycles counted since last reset */ +#define PDCA_PRLAT1_LAT(value) ((PDCA_PRLAT1_LAT_Msk & ((value) << PDCA_PRLAT1_LAT_Pos))) +/* -------- PDCA_PWDATA1 : (PDCA Offset: 0x828) Channel 1 Write Data Cycles -------- */ +#define PDCA_PWDATA1_DATA_Pos 0 +#define PDCA_PWDATA1_DATA_Msk (0xFFFFFFFFu << PDCA_PWDATA1_DATA_Pos) /**< \brief (PDCA_PWDATA1) Data cycles Counted Since last reset */ +#define PDCA_PWDATA1_DATA(value) ((PDCA_PWDATA1_DATA_Msk & ((value) << PDCA_PWDATA1_DATA_Pos))) +/* -------- PDCA_PWSTALL1 : (PDCA Offset: 0x82C) Channel 1 Write stall Cycles -------- */ +#define PDCA_PWSTALL1_STALL_Pos 0 +#define PDCA_PWSTALL1_STALL_Msk (0xFFFFFFFFu << PDCA_PWSTALL1_STALL_Pos) /**< \brief (PDCA_PWSTALL1) Stall cycles counted since last reset */ +#define PDCA_PWSTALL1_STALL(value) ((PDCA_PWSTALL1_STALL_Msk & ((value) << PDCA_PWSTALL1_STALL_Pos))) +/* -------- PDCA_PWLAT1 : (PDCA Offset: 0x830) Channel 1 Read Max Latency -------- */ +#define PDCA_PWLAT1_LAT_Pos 0 +#define PDCA_PWLAT1_LAT_Msk (0xFFFFu << PDCA_PWLAT1_LAT_Pos) /**< \brief (PDCA_PWLAT1) Maximum transfer initiation cycles counted since last reset */ +#define PDCA_PWLAT1_LAT(value) ((PDCA_PWLAT1_LAT_Msk & ((value) << PDCA_PWLAT1_LAT_Pos))) +/* -------- PDCA_VERSION : (PDCA Offset: 0x834) Version Register -------- */ +#define PDCA_VERSION_VERSION_Pos 0 +#define PDCA_VERSION_VERSION_Msk (0xFFFu << PDCA_VERSION_VERSION_Pos) /**< \brief (PDCA_VERSION) Version Number */ +#define PDCA_VERSION_VERSION(value) ((PDCA_VERSION_VERSION_Msk & ((value) << PDCA_VERSION_VERSION_Pos))) +#define PDCA_VERSION_VARIANT_Pos 16 +#define PDCA_VERSION_VARIANT_Msk (0xFu << PDCA_VERSION_VARIANT_Pos) /**< \brief (PDCA_VERSION) Variant Number */ +#define PDCA_VERSION_VARIANT(value) ((PDCA_VERSION_VARIANT_Msk & ((value) << PDCA_VERSION_VARIANT_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR PEVC */ +/* ============================================================================= */ +/** \addtogroup SAM4L_PEVC Peripheral Event Controller */ +/*@{*/ + +#define REV_PEVC 0x200 + +#ifndef __ASSEMBLY__ +/** \brief PevcChmx hardware registers */ +typedef struct { + RwReg PEVC_CHMX; /**< \brief (PevcChmx Offset: 0x000) Channel Multiplexer 0 */ +} PevcChmx; +/** \brief PevcEvs hardware registers */ +typedef struct { + RwReg PEVC_EVS; /**< \brief (PevcEvs Offset: 0x000) Event Shaper 0 */ +} PevcEvs; +/** \brief PEVC hardware registers */ +#define PEVC_TRIGOUT_BITS 19 +#define PEVC_EVIN_BITS 31 +typedef struct { + RoReg PEVC_CHSR; /**< \brief (PEVC Offset: 0x000) Channel Status Register */ + WoReg PEVC_CHER; /**< \brief (PEVC Offset: 0x004) Channel Enable Register */ + WoReg PEVC_CHDR; /**< \brief (PEVC Offset: 0x008) Channel Disable Register */ + RoReg Reserved1[1]; + WoReg PEVC_SEV; /**< \brief (PEVC Offset: 0x010) Software Event */ + RoReg PEVC_BUSY; /**< \brief (PEVC Offset: 0x014) Channel / User Busy */ + RoReg Reserved2[2]; + WoReg PEVC_TRIER; /**< \brief (PEVC Offset: 0x020) Trigger Interrupt Mask Enable Register */ + WoReg PEVC_TRIDR; /**< \brief (PEVC Offset: 0x024) Trigger Interrupt Mask Disable Register */ + RoReg PEVC_TRIMR; /**< \brief (PEVC Offset: 0x028) Trigger Interrupt Mask Register */ + RoReg Reserved3[1]; + RoReg PEVC_TRSR; /**< \brief (PEVC Offset: 0x030) Trigger Status Register */ + WoReg PEVC_TRSCR; /**< \brief (PEVC Offset: 0x034) Trigger Status Clear Register */ + RoReg Reserved4[2]; + WoReg PEVC_OVIER; /**< \brief (PEVC Offset: 0x040) Overrun Interrupt Mask Enable Register */ + WoReg PEVC_OVIDR; /**< \brief (PEVC Offset: 0x044) Overrun Interrupt Mask Disable Register */ + RoReg PEVC_OVIMR; /**< \brief (PEVC Offset: 0x048) Overrun Interrupt Mask Register */ + RoReg Reserved5[1]; + RoReg PEVC_OVSR; /**< \brief (PEVC Offset: 0x050) Overrun Status Register */ + WoReg PEVC_OVSCR; /**< \brief (PEVC Offset: 0x054) Overrun Status Clear Register */ + RoReg Reserved6[42]; + PevcChmx PEVC_CHMX[PEVC_TRIGOUT_BITS]; /**< \brief (PEVC Offset: 0x100) PevcChmx groups */ + PevcChmx Reserved7[32 - PEVC_TRIGOUT_BITS]; + RoReg Reserved8[32]; + PevcEvs PEVC_EVS[PEVC_EVIN_BITS]; /**< \brief (PEVC Offset: 0x200) PevcEvs groups */ + PevcEvs Reserved9[64 - PEVC_EVIN_BITS]; + RwReg PEVC_IGFDR; /**< \brief (PEVC Offset: 0x300) Input Glitch Filter Divider Register */ + RoReg Reserved10[61]; + RoReg PEVC_PARAMETER; /**< \brief (PEVC Offset: 0x3F8) Parameter */ + RoReg PEVC_VERSION; /**< \brief (PEVC Offset: 0x3FC) Version */ +} Pevc; +#endif /* __ASSEMBLY__ */ +/* -------- PEVC_CHSR : (PEVC Offset: 0x000) Channel Status Register -------- */ +#define PEVC_CHSR_CHS_Pos 0 +#define PEVC_CHSR_CHS_Msk (0xFFFFFFFFu << PEVC_CHSR_CHS_Pos) /**< \brief (PEVC_CHSR) Channel Status */ +#define PEVC_CHSR_CHS(value) ((PEVC_CHSR_CHS_Msk & ((value) << PEVC_CHSR_CHS_Pos))) +#define PEVC_CHSR_CHS_0 (0x0u << 0) /**< \brief (PEVC_CHSR) Channel j Disabled */ +#define PEVC_CHSR_CHS_1 (0x1u << 0) /**< \brief (PEVC_CHSR) Channel j Enabled */ +/* -------- PEVC_CHER : (PEVC Offset: 0x004) Channel Enable Register -------- */ +#define PEVC_CHER_CHE_Pos 0 +#define PEVC_CHER_CHE_Msk (0xFFFFFFFFu << PEVC_CHER_CHE_Pos) /**< \brief (PEVC_CHER) Channel Enable */ +#define PEVC_CHER_CHE(value) ((PEVC_CHER_CHE_Msk & ((value) << PEVC_CHER_CHE_Pos))) +#define PEVC_CHER_CHE_0 (0x0u << 0) /**< \brief (PEVC_CHER) No Action */ +#define PEVC_CHER_CHE_1 (0x1u << 0) /**< \brief (PEVC_CHER) Enable Channel j */ +/* -------- PEVC_CHDR : (PEVC Offset: 0x008) Channel Disable Register -------- */ +#define PEVC_CHDR_CHD_Pos 0 +#define PEVC_CHDR_CHD_Msk (0xFFFFFFFFu << PEVC_CHDR_CHD_Pos) /**< \brief (PEVC_CHDR) Channel Disable */ +#define PEVC_CHDR_CHD(value) ((PEVC_CHDR_CHD_Msk & ((value) << PEVC_CHDR_CHD_Pos))) +#define PEVC_CHDR_CHD_0 (0x0u << 0) /**< \brief (PEVC_CHDR) No Action */ +#define PEVC_CHDR_CHD_1 (0x1u << 0) /**< \brief (PEVC_CHDR) Disable Channel j */ +/* -------- PEVC_SEV : (PEVC Offset: 0x010) Software Event -------- */ +#define PEVC_SEV_SEV_Pos 0 +#define PEVC_SEV_SEV_Msk (0xFFFFFFFFu << PEVC_SEV_SEV_Pos) /**< \brief (PEVC_SEV) Software Event */ +#define PEVC_SEV_SEV(value) ((PEVC_SEV_SEV_Msk & ((value) << PEVC_SEV_SEV_Pos))) +#define PEVC_SEV_SEV_0 (0x0u << 0) /**< \brief (PEVC_SEV) No Action */ +#define PEVC_SEV_SEV_1 (0x1u << 0) /**< \brief (PEVC_SEV) CPU forces software event to channel j */ +/* -------- PEVC_BUSY : (PEVC Offset: 0x014) Channel / User Busy -------- */ +#define PEVC_BUSY_BUSY_Pos 0 +#define PEVC_BUSY_BUSY_Msk (0xFFFFFFFFu << PEVC_BUSY_BUSY_Pos) /**< \brief (PEVC_BUSY) Channel Status */ +#define PEVC_BUSY_BUSY(value) ((PEVC_BUSY_BUSY_Msk & ((value) << PEVC_BUSY_BUSY_Pos))) +#define PEVC_BUSY_BUSY_0 (0x0u << 0) /**< \brief (PEVC_BUSY) No Action */ +#define PEVC_BUSY_BUSY_1 (0x1u << 0) /**< \brief (PEVC_BUSY) Channel j or User j is Busy */ +/* -------- PEVC_TRIER : (PEVC Offset: 0x020) Trigger Interrupt Mask Enable Register -------- */ +#define PEVC_TRIER_TRIE_Pos 0 +#define PEVC_TRIER_TRIE_Msk (0xFFFFFFFFu << PEVC_TRIER_TRIE_Pos) /**< \brief (PEVC_TRIER) Trigger Interrupt Enable */ +#define PEVC_TRIER_TRIE(value) ((PEVC_TRIER_TRIE_Msk & ((value) << PEVC_TRIER_TRIE_Pos))) +#define PEVC_TRIER_TRIE_0 (0x0u << 0) /**< \brief (PEVC_TRIER) No Action */ +#define PEVC_TRIER_TRIE_1 (0x1u << 0) /**< \brief (PEVC_TRIER) Enable Trigger j Interrupt */ +/* -------- PEVC_TRIDR : (PEVC Offset: 0x024) Trigger Interrupt Mask Disable Register -------- */ +#define PEVC_TRIDR_TRID_Pos 0 +#define PEVC_TRIDR_TRID_Msk (0xFFFFFFFFu << PEVC_TRIDR_TRID_Pos) /**< \brief (PEVC_TRIDR) Trigger Interrupt Disable */ +#define PEVC_TRIDR_TRID(value) ((PEVC_TRIDR_TRID_Msk & ((value) << PEVC_TRIDR_TRID_Pos))) +#define PEVC_TRIDR_TRID_0 (0x0u << 0) /**< \brief (PEVC_TRIDR) No Action */ +#define PEVC_TRIDR_TRID_1 (0x1u << 0) /**< \brief (PEVC_TRIDR) Disable Trigger j Interrupt */ +/* -------- PEVC_TRIMR : (PEVC Offset: 0x028) Trigger Interrupt Mask Register -------- */ +#define PEVC_TRIMR_TRIM_Pos 0 +#define PEVC_TRIMR_TRIM_Msk (0xFFFFFFFFu << PEVC_TRIMR_TRIM_Pos) /**< \brief (PEVC_TRIMR) Trigger Interrupt Mask */ +#define PEVC_TRIMR_TRIM(value) ((PEVC_TRIMR_TRIM_Msk & ((value) << PEVC_TRIMR_TRIM_Pos))) +#define PEVC_TRIMR_TRIM_0 (0x0u << 0) /**< \brief (PEVC_TRIMR) Trigger j Interrupt Disabled */ +#define PEVC_TRIMR_TRIM_1 (0x1u << 0) /**< \brief (PEVC_TRIMR) Trigger j Interrupt Enabled */ +/* -------- PEVC_TRSR : (PEVC Offset: 0x030) Trigger Status Register -------- */ +#define PEVC_TRSR_TRS_Pos 0 +#define PEVC_TRSR_TRS_Msk (0xFFFFFFFFu << PEVC_TRSR_TRS_Pos) /**< \brief (PEVC_TRSR) Trigger Interrupt Status */ +#define PEVC_TRSR_TRS(value) ((PEVC_TRSR_TRS_Msk & ((value) << PEVC_TRSR_TRS_Pos))) +#define PEVC_TRSR_TRS_0 (0x0u << 0) /**< \brief (PEVC_TRSR) Channel j did not send out an Event in the past */ +#define PEVC_TRSR_TRS_1 (0x1u << 0) /**< \brief (PEVC_TRSR) Channel j did send out an Event in the past */ +/* -------- PEVC_TRSCR : (PEVC Offset: 0x034) Trigger Status Clear Register -------- */ +#define PEVC_TRSCR_TRSC_Pos 0 +#define PEVC_TRSCR_TRSC_Msk (0xFFFFFFFFu << PEVC_TRSCR_TRSC_Pos) /**< \brief (PEVC_TRSCR) Trigger Interrupt Status Clear */ +#define PEVC_TRSCR_TRSC(value) ((PEVC_TRSCR_TRSC_Msk & ((value) << PEVC_TRSCR_TRSC_Pos))) +#define PEVC_TRSCR_TRSC_0 (0x0u << 0) /**< \brief (PEVC_TRSCR) No Action */ +#define PEVC_TRSCR_TRSC_1 (0x1u << 0) /**< \brief (PEVC_TRSCR) Clear TRSR[j] */ +/* -------- PEVC_OVIER : (PEVC Offset: 0x040) Overrun Interrupt Mask Enable Register -------- */ +#define PEVC_OVIER_OVIE_Pos 0 +#define PEVC_OVIER_OVIE_Msk (0xFFFFFFFFu << PEVC_OVIER_OVIE_Pos) /**< \brief (PEVC_OVIER) Overrun Interrupt Enable */ +#define PEVC_OVIER_OVIE(value) ((PEVC_OVIER_OVIE_Msk & ((value) << PEVC_OVIER_OVIE_Pos))) +#define PEVC_OVIER_OVIE_0 (0x0u << 0) /**< \brief (PEVC_OVIER) No Action */ +#define PEVC_OVIER_OVIE_1 (0x1u << 0) /**< \brief (PEVC_OVIER) Enable Overrun Interrupt for Channel j */ +/* -------- PEVC_OVIDR : (PEVC Offset: 0x044) Overrun Interrupt Mask Disable Register -------- */ +#define PEVC_OVIDR_OVID_Pos 0 +#define PEVC_OVIDR_OVID_Msk (0xFFFFFFFFu << PEVC_OVIDR_OVID_Pos) /**< \brief (PEVC_OVIDR) Overrun Interrupt Disable */ +#define PEVC_OVIDR_OVID(value) ((PEVC_OVIDR_OVID_Msk & ((value) << PEVC_OVIDR_OVID_Pos))) +#define PEVC_OVIDR_OVID_0 (0x0u << 0) /**< \brief (PEVC_OVIDR) No Action */ +#define PEVC_OVIDR_OVID_1 (0x1u << 0) /**< \brief (PEVC_OVIDR) Enable Overrun Interrupt for Channel j */ +/* -------- PEVC_OVIMR : (PEVC Offset: 0x048) Overrun Interrupt Mask Register -------- */ +#define PEVC_OVIMR_OVIM_Pos 0 +#define PEVC_OVIMR_OVIM_Msk (0xFFFFFFFFu << PEVC_OVIMR_OVIM_Pos) /**< \brief (PEVC_OVIMR) Overrun Interrupt Mask */ +#define PEVC_OVIMR_OVIM(value) ((PEVC_OVIMR_OVIM_Msk & ((value) << PEVC_OVIMR_OVIM_Pos))) +#define PEVC_OVIMR_OVIM_0 (0x0u << 0) /**< \brief (PEVC_OVIMR) Overrun Interrupt for Channel j Disabled */ +#define PEVC_OVIMR_OVIM_1 (0x1u << 0) /**< \brief (PEVC_OVIMR) Overrun Interrupt for Channel j Enabled */ +/* -------- PEVC_OVSR : (PEVC Offset: 0x050) Overrun Status Register -------- */ +#define PEVC_OVSR_OVS_Pos 0 +#define PEVC_OVSR_OVS_Msk (0xFFFFFFFFu << PEVC_OVSR_OVS_Pos) /**< \brief (PEVC_OVSR) Overrun Interrupt Status */ +#define PEVC_OVSR_OVS(value) ((PEVC_OVSR_OVS_Msk & ((value) << PEVC_OVSR_OVS_Pos))) +#define PEVC_OVSR_OVS_0 (0x0u << 0) /**< \brief (PEVC_OVSR) No Overrun occured on Channel j */ +#define PEVC_OVSR_OVS_1 (0x1u << 0) /**< \brief (PEVC_OVSR) Overrun occured on Channel j */ +/* -------- PEVC_OVSCR : (PEVC Offset: 0x054) Overrun Status Clear Register -------- */ +#define PEVC_OVSCR_OVSC_Pos 0 +#define PEVC_OVSCR_OVSC_Msk (0xFFFFFFFFu << PEVC_OVSCR_OVSC_Pos) /**< \brief (PEVC_OVSCR) Overrun Interrupt Status Clear */ +#define PEVC_OVSCR_OVSC(value) ((PEVC_OVSCR_OVSC_Msk & ((value) << PEVC_OVSCR_OVSC_Pos))) +#define PEVC_OVSCR_OVSC_0 (0x0u << 0) /**< \brief (PEVC_OVSCR) No Action */ +#define PEVC_OVSCR_OVSC_1 (0x1u << 0) /**< \brief (PEVC_OVSCR) Clear Overrun Status Bit j */ +/* -------- PEVC_CHMX : (PEVC Offset: 0x100) Chmx Channel Multiplexer 0 -------- */ +#define PEVC_CHMX_EVMX_Pos 0 +#define PEVC_CHMX_EVMX_Msk (0x3Fu << PEVC_CHMX_EVMX_Pos) /**< \brief (PEVC_CHMX) Event Multiplexer */ +#define PEVC_CHMX_EVMX(value) ((PEVC_CHMX_EVMX_Msk & ((value) << PEVC_CHMX_EVMX_Pos))) +#define PEVC_CHMX_EVMX_0 (0x0u << 0) /**< \brief (PEVC_CHMX) Event 0 */ +#define PEVC_CHMX_EVMX_1 (0x1u << 0) /**< \brief (PEVC_CHMX) Event 1 */ +#define PEVC_CHMX_SMX (0x1u << 8) /**< \brief (PEVC_CHMX) Software Event Multiplexer */ +#define PEVC_CHMX_SMX_0 (0x0u << 8) /**< \brief (PEVC_CHMX) Hardware events */ +#define PEVC_CHMX_SMX_1 (0x1u << 8) /**< \brief (PEVC_CHMX) Software event */ +/* -------- PEVC_EVS : (PEVC Offset: 0x200) Evs Event Shaper 0 -------- */ +#define PEVC_EVS_EN (0x1u << 0) /**< \brief (PEVC_EVS) Event Shaper Enable */ +#define PEVC_EVS_EN_0 (0x0u << 0) /**< \brief (PEVC_EVS) No Action */ +#define PEVC_EVS_EN_1 (0x1u << 0) /**< \brief (PEVC_EVS) Event Shaper enable */ +#define PEVC_EVS_IGFR (0x1u << 16) /**< \brief (PEVC_EVS) Input Glitch Filter Rise */ +#define PEVC_EVS_IGFR_0 (0x0u << 16) /**< \brief (PEVC_EVS) No Action */ +#define PEVC_EVS_IGFR_1 (0x1u << 16) /**< \brief (PEVC_EVS) Input Glitch Filter : a rising edge on event input will raise trigger output */ +#define PEVC_EVS_IGFF (0x1u << 17) /**< \brief (PEVC_EVS) Input Glitch Filter Fall */ +#define PEVC_EVS_IGFF_0 (0x0u << 17) /**< \brief (PEVC_EVS) No Action */ +#define PEVC_EVS_IGFF_1 (0x1u << 17) /**< \brief (PEVC_EVS) Input Glitch Filter : a falling edge on event input will raise trigger output */ +#define PEVC_EVS_IGFON (0x1u << 18) /**< \brief (PEVC_EVS) Input Glitch Filter Status */ +/* -------- PEVC_IGFDR : (PEVC Offset: 0x300) Input Glitch Filter Divider Register -------- */ +#define PEVC_IGFDR_IGFDR_Pos 0 +#define PEVC_IGFDR_IGFDR_Msk (0xFu << PEVC_IGFDR_IGFDR_Pos) /**< \brief (PEVC_IGFDR) Input Glitch Filter Divider Register */ +#define PEVC_IGFDR_IGFDR(value) ((PEVC_IGFDR_IGFDR_Msk & ((value) << PEVC_IGFDR_IGFDR_Pos))) +/* -------- PEVC_PARAMETER : (PEVC Offset: 0x3F8) Parameter -------- */ +#define PEVC_PARAMETER_IGF_COUNT_Pos 0 +#define PEVC_PARAMETER_IGF_COUNT_Msk (0xFFu << PEVC_PARAMETER_IGF_COUNT_Pos) /**< \brief (PEVC_PARAMETER) Number of Input Glitch Filters */ +#define PEVC_PARAMETER_IGF_COUNT(value) ((PEVC_PARAMETER_IGF_COUNT_Msk & ((value) << PEVC_PARAMETER_IGF_COUNT_Pos))) +#define PEVC_PARAMETER_EVS_COUNT_Pos 8 +#define PEVC_PARAMETER_EVS_COUNT_Msk (0xFFu << PEVC_PARAMETER_EVS_COUNT_Pos) /**< \brief (PEVC_PARAMETER) Number of Event Shapers */ +#define PEVC_PARAMETER_EVS_COUNT(value) ((PEVC_PARAMETER_EVS_COUNT_Msk & ((value) << PEVC_PARAMETER_EVS_COUNT_Pos))) +#define PEVC_PARAMETER_EVIN_Pos 16 +#define PEVC_PARAMETER_EVIN_Msk (0xFFu << PEVC_PARAMETER_EVIN_Pos) /**< \brief (PEVC_PARAMETER) Number of Event Inputs / Generators */ +#define PEVC_PARAMETER_EVIN(value) ((PEVC_PARAMETER_EVIN_Msk & ((value) << PEVC_PARAMETER_EVIN_Pos))) +#define PEVC_PARAMETER_TRIGOUT_Pos 24 +#define PEVC_PARAMETER_TRIGOUT_Msk (0xFFu << PEVC_PARAMETER_TRIGOUT_Pos) /**< \brief (PEVC_PARAMETER) Number of Trigger Outputs / Channels / Users */ +#define PEVC_PARAMETER_TRIGOUT(value) ((PEVC_PARAMETER_TRIGOUT_Msk & ((value) << PEVC_PARAMETER_TRIGOUT_Pos))) +/* -------- PEVC_VERSION : (PEVC Offset: 0x3FC) Version -------- */ +#define PEVC_VERSION_VERSION_Pos 0 +#define PEVC_VERSION_VERSION_Msk (0xFFFu << PEVC_VERSION_VERSION_Pos) /**< \brief (PEVC_VERSION) Version Number */ +#define PEVC_VERSION_VERSION(value) ((PEVC_VERSION_VERSION_Msk & ((value) << PEVC_VERSION_VERSION_Pos))) +#define PEVC_VERSION_VARIANT_Pos 16 +#define PEVC_VERSION_VARIANT_Msk (0xFu << PEVC_VERSION_VARIANT_Pos) /**< \brief (PEVC_VERSION) Variant Number */ +#define PEVC_VERSION_VARIANT(value) ((PEVC_VERSION_VARIANT_Msk & ((value) << PEVC_VERSION_VARIANT_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR PICOUART */ +/* ============================================================================= */ +/** \addtogroup SAM4L_PICOUART Pico UART */ +/*@{*/ + +#define REV_PICOUART 0x101 + +#ifndef __ASSEMBLY__ +/** \brief PICOUART hardware registers */ +typedef struct { + WoReg PICOUART_CR; /**< \brief (PICOUART Offset: 0x00) Control Register */ + RwReg PICOUART_CFG; /**< \brief (PICOUART Offset: 0x04) Configuration Register */ + RoReg PICOUART_SR; /**< \brief (PICOUART Offset: 0x08) Status Register */ + RoReg PICOUART_RHR; /**< \brief (PICOUART Offset: 0x0C) Receive Holding Register */ + RoReg Reserved1[4]; + RoReg PICOUART_VERSION; /**< \brief (PICOUART Offset: 0x20) Version Register */ +} Picouart; +#endif /* __ASSEMBLY__ */ +/* -------- PICOUART_CR : (PICOUART Offset: 0x00) Control Register -------- */ +#define PICOUART_CR_EN (0x1u << 0) /**< \brief (PICOUART_CR) Enable */ +#define PICOUART_CR_DIS (0x1u << 1) /**< \brief (PICOUART_CR) Disable */ +/* -------- PICOUART_CFG : (PICOUART Offset: 0x04) Configuration Register -------- */ +#define PICOUART_CFG_SOURCE_Pos 0 +#define PICOUART_CFG_SOURCE_Msk (0x3u << PICOUART_CFG_SOURCE_Pos) /**< \brief (PICOUART_CFG) Source Enable Mode */ +#define PICOUART_CFG_SOURCE(value) ((PICOUART_CFG_SOURCE_Msk & ((value) << PICOUART_CFG_SOURCE_Pos))) +#define PICOUART_CFG_ACTION (0x1u << 2) /**< \brief (PICOUART_CFG) Action to perform */ +#define PICOUART_CFG_MATCH_Pos 8 +#define PICOUART_CFG_MATCH_Msk (0xFFu << PICOUART_CFG_MATCH_Pos) /**< \brief (PICOUART_CFG) Data Match */ +#define PICOUART_CFG_MATCH(value) ((PICOUART_CFG_MATCH_Msk & ((value) << PICOUART_CFG_MATCH_Pos))) +/* -------- PICOUART_SR : (PICOUART Offset: 0x08) Status Register -------- */ +#define PICOUART_SR_EN (0x1u << 0) /**< \brief (PICOUART_SR) Enable Interrupt Status */ +#define PICOUART_SR_DRDY (0x1u << 1) /**< \brief (PICOUART_SR) Data Ready Interrupt Status */ +/* -------- PICOUART_RHR : (PICOUART Offset: 0x0C) Receive Holding Register -------- */ +#define PICOUART_RHR_CDATA_Pos 0 +#define PICOUART_RHR_CDATA_Msk (0xFFFFFFFFu << PICOUART_RHR_CDATA_Pos) /**< \brief (PICOUART_RHR) Received Data */ +#define PICOUART_RHR_CDATA(value) ((PICOUART_RHR_CDATA_Msk & ((value) << PICOUART_RHR_CDATA_Pos))) +/* -------- PICOUART_VERSION : (PICOUART Offset: 0x20) Version Register -------- */ +#define PICOUART_VERSION_VERSION_Pos 0 +#define PICOUART_VERSION_VERSION_Msk (0xFFFu << PICOUART_VERSION_VERSION_Pos) /**< \brief (PICOUART_VERSION) Version Number */ +#define PICOUART_VERSION_VERSION(value) ((PICOUART_VERSION_VERSION_Msk & ((value) << PICOUART_VERSION_VERSION_Pos))) +#define PICOUART_VERSION_VARIANT_Pos 16 +#define PICOUART_VERSION_VARIANT_Msk (0xFu << PICOUART_VERSION_VARIANT_Pos) /**< \brief (PICOUART_VERSION) Variant Number */ +#define PICOUART_VERSION_VARIANT(value) ((PICOUART_VERSION_VARIANT_Msk & ((value) << PICOUART_VERSION_VARIANT_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR PM */ +/* ============================================================================= */ +/** \addtogroup SAM4L_PM Power Manager */ +/*@{*/ + +#define REV_PM 0x441 + +#ifndef __ASSEMBLY__ +/** \brief PM hardware registers */ +typedef struct { + RwReg PM_MCCTRL; /**< \brief (PM Offset: 0x000) Main Clock Control */ + RwReg PM_CPUSEL; /**< \brief (PM Offset: 0x004) CPU Clock Select */ + RoReg Reserved1[1]; + RwReg PM_PBASEL; /**< \brief (PM Offset: 0x00C) PBA Clock Select */ + RwReg PM_PBBSEL; /**< \brief (PM Offset: 0x010) PBB Clock Select */ + RwReg PM_PBCSEL; /**< \brief (PM Offset: 0x014) PBC Clock Select */ + RwReg PM_PBDSEL; /**< \brief (PM Offset: 0x018) PBD Clock Select */ + RoReg Reserved2[1]; + RwReg PM_CPUMASK; /**< \brief (PM Offset: 0x020) CPU Mask */ + RwReg PM_HSBMASK; /**< \brief (PM Offset: 0x024) HSB Mask */ + RwReg PM_PBAMASK; /**< \brief (PM Offset: 0x028) PBA Mask */ + RwReg PM_PBBMASK; /**< \brief (PM Offset: 0x02C) PBB Mask */ + RwReg PM_PBCMASK; /**< \brief (PM Offset: 0x030) PBC Mask */ + RwReg PM_PBDMASK; /**< \brief (PM Offset: 0x034) PBD Mask */ + RoReg Reserved3[2]; + RwReg PM_PBADIVMASK; /**< \brief (PM Offset: 0x040) PBA Divided Clock Mask */ + RoReg Reserved4[4]; + RwReg PM_CFDCTRL; /**< \brief (PM Offset: 0x054) Clock Failure Detector Control */ + WoReg PM_UNLOCK; /**< \brief (PM Offset: 0x058) Unlock Register */ + RoReg Reserved5[25]; + WoReg PM_IER; /**< \brief (PM Offset: 0x0C0) Interrupt Enable Register */ + WoReg PM_IDR; /**< \brief (PM Offset: 0x0C4) Interrupt Disable Register */ + RoReg PM_IMR; /**< \brief (PM Offset: 0x0C8) Interrupt Mask Register */ + RoReg PM_ISR; /**< \brief (PM Offset: 0x0CC) Interrupt Status Register */ + WoReg PM_ICR; /**< \brief (PM Offset: 0x0D0) Interrupt Clear Register */ + RoReg PM_SR; /**< \brief (PM Offset: 0x0D4) Status Register */ + RoReg Reserved6[34]; + RwReg PM_PPCR; /**< \brief (PM Offset: 0x160) Peripheral Power Control Register */ + RoReg Reserved7[7]; + RoReg PM_RCAUSE; /**< \brief (PM Offset: 0x180) Reset Cause Register */ + RoReg PM_WCAUSE; /**< \brief (PM Offset: 0x184) Wake Cause Register */ + RwReg PM_AWEN; /**< \brief (PM Offset: 0x188) Asynchronous Wake Enable */ + RoReg Reserved8[1]; + RwReg PM_OBS; /**< \brief (PM Offset: 0x190) Obsvervability */ + RwReg PM_FASTSLEEP; /**< \brief (PM Offset: 0x194) Fast Sleep Register */ + RoReg Reserved9[152]; + RoReg PM_CONFIG; /**< \brief (PM Offset: 0x3F8) Configuration Register */ + RoReg PM_VERSION; /**< \brief (PM Offset: 0x3FC) Version Register */ +} Pm; +#endif /* __ASSEMBLY__ */ +/* -------- PM_MCCTRL : (PM Offset: 0x000) Main Clock Control -------- */ +#define PM_MCCTRL_MCSEL_Pos 0 +#define PM_MCCTRL_MCSEL_Msk (0x7u << PM_MCCTRL_MCSEL_Pos) /**< \brief (PM_MCCTRL) Main Clock Select */ +#define PM_MCCTRL_MCSEL(value) ((PM_MCCTRL_MCSEL_Msk & ((value) << PM_MCCTRL_MCSEL_Pos))) +/* -------- PM_CPUSEL : (PM Offset: 0x004) CPU Clock Select -------- */ +#define PM_CPUSEL_CPUSEL_Pos 0 +#define PM_CPUSEL_CPUSEL_Msk (0x7u << PM_CPUSEL_CPUSEL_Pos) /**< \brief (PM_CPUSEL) CPU Clock Select */ +#define PM_CPUSEL_CPUSEL(value) ((PM_CPUSEL_CPUSEL_Msk & ((value) << PM_CPUSEL_CPUSEL_Pos))) +#define PM_CPUSEL_CPUSEL_0 (0x0u << 0) /**< \brief (PM_CPUSEL) fCPU:fmain. CPUDIV: */ +#define PM_CPUSEL_CPUSEL_1 (0x1u << 0) /**< \brief (PM_CPUSEL) fCPU:fmain / 2^(CPUSEL+1) */ +#define PM_CPUSEL_CPUDIV (0x1u << 7) /**< \brief (PM_CPUSEL) CPU Division */ +/* -------- PM_PBASEL : (PM Offset: 0x00C) PBA Clock Select -------- */ +#define PM_PBASEL_PBSEL_Pos 0 +#define PM_PBASEL_PBSEL_Msk (0x7u << PM_PBASEL_PBSEL_Pos) /**< \brief (PM_PBASEL) PBA Clock Select */ +#define PM_PBASEL_PBSEL(value) ((PM_PBASEL_PBSEL_Msk & ((value) << PM_PBASEL_PBSEL_Pos))) +#define PM_PBASEL_PBDIV (0x1u << 7) /**< \brief (PM_PBASEL) PBA Division Select */ +/* -------- PM_PBBSEL : (PM Offset: 0x010) PBB Clock Select -------- */ +#define PM_PBBSEL_PBSEL_Pos 0 +#define PM_PBBSEL_PBSEL_Msk (0x7u << PM_PBBSEL_PBSEL_Pos) /**< \brief (PM_PBBSEL) PBB Clock Select */ +#define PM_PBBSEL_PBSEL(value) ((PM_PBBSEL_PBSEL_Msk & ((value) << PM_PBBSEL_PBSEL_Pos))) +#define PM_PBBSEL_PBDIV (0x1u << 7) /**< \brief (PM_PBBSEL) PBB Division Select */ +/* -------- PM_PBCSEL : (PM Offset: 0x014) PBC Clock Select -------- */ +#define PM_PBCSEL_PBSEL_Pos 0 +#define PM_PBCSEL_PBSEL_Msk (0x7u << PM_PBCSEL_PBSEL_Pos) /**< \brief (PM_PBCSEL) PBC Clock Select */ +#define PM_PBCSEL_PBSEL(value) ((PM_PBCSEL_PBSEL_Msk & ((value) << PM_PBCSEL_PBSEL_Pos))) +#define PM_PBCSEL_PBDIV (0x1u << 7) /**< \brief (PM_PBCSEL) PBC Division Select */ +/* -------- PM_PBDSEL : (PM Offset: 0x018) PBD Clock Select -------- */ +#define PM_PBDSEL_PBSEL_Pos 0 +#define PM_PBDSEL_PBSEL_Msk (0x7u << PM_PBDSEL_PBSEL_Pos) /**< \brief (PM_PBDSEL) PBD Clock Select */ +#define PM_PBDSEL_PBSEL(value) ((PM_PBDSEL_PBSEL_Msk & ((value) << PM_PBDSEL_PBSEL_Pos))) +#define PM_PBDSEL_PBDIV (0x1u << 7) /**< \brief (PM_PBDSEL) PBD Division Select */ +/* -------- PM_CPUMASK : (PM Offset: 0x020) CPU Mask -------- */ +#define PM_CPUMASK_OCD (0x1u << 0) /**< \brief (PM_CPUMASK) OCD CPU Clock Mask */ +/* -------- PM_HSBMASK : (PM Offset: 0x024) HSB Mask -------- */ +#define PM_HSBMASK_PDCA (0x1u << 0) /**< \brief (PM_HSBMASK) PDCA HSB Clock Mask */ +#define PM_HSBMASK_HFLASHC (0x1u << 1) /**< \brief (PM_HSBMASK) HFLASHC HSB Clock Mask */ +#define PM_HSBMASK_HRAMC1 (0x1u << 2) /**< \brief (PM_HSBMASK) HRAMC1 HSB Clock Mask */ +#define PM_HSBMASK_USBC (0x1u << 3) /**< \brief (PM_HSBMASK) USBC HSB Clock Mask */ +#define PM_HSBMASK_CRCCU (0x1u << 4) /**< \brief (PM_HSBMASK) CRCCU HSB Clock Mask */ +#define PM_HSBMASK_HTOP0 (0x1u << 5) /**< \brief (PM_HSBMASK) HTOP0 HSB Clock Mask */ +#define PM_HSBMASK_HTOP1 (0x1u << 6) /**< \brief (PM_HSBMASK) HTOP1 HSB Clock Mask */ +#define PM_HSBMASK_HTOP2 (0x1u << 7) /**< \brief (PM_HSBMASK) HTOP2 HSB Clock Mask */ +#define PM_HSBMASK_HTOP3 (0x1u << 8) /**< \brief (PM_HSBMASK) HTOP3 HSB Clock Mask */ +#define PM_HSBMASK_AESA (0x1u << 9) /**< \brief (PM_HSBMASK) AESA HSB Clock Mask */ +/* -------- PM_PBAMASK : (PM Offset: 0x028) PBA Mask -------- */ +#define PM_PBAMASK_IISC (0x1u << 0) /**< \brief (PM_PBAMASK) IISC PB Clock Mask */ +#define PM_PBAMASK_SPI (0x1u << 1) /**< \brief (PM_PBAMASK) SPI PB Clock Mask */ +#define PM_PBAMASK_TC0 (0x1u << 2) /**< \brief (PM_PBAMASK) TC0 PB Clock Mask */ +#define PM_PBAMASK_TC1 (0x1u << 3) /**< \brief (PM_PBAMASK) TC1 PB Clock Mask */ +#define PM_PBAMASK_TWIM0 (0x1u << 4) /**< \brief (PM_PBAMASK) TWIM0 PB Clock Mask */ +#define PM_PBAMASK_TWIS0 (0x1u << 5) /**< \brief (PM_PBAMASK) TWIS0 PB Clock Mask */ +#define PM_PBAMASK_TWIM1 (0x1u << 6) /**< \brief (PM_PBAMASK) TWIM1 PB Clock Mask */ +#define PM_PBAMASK_TWIS1 (0x1u << 7) /**< \brief (PM_PBAMASK) TWIS1 PB Clock Mask */ +#define PM_PBAMASK_USART0 (0x1u << 8) /**< \brief (PM_PBAMASK) USART0 PB Clock Mask */ +#define PM_PBAMASK_USART1 (0x1u << 9) /**< \brief (PM_PBAMASK) USART1 PB Clock Mask */ +#define PM_PBAMASK_USART2 (0x1u << 10) /**< \brief (PM_PBAMASK) USART2 PB Clock Mask */ +#define PM_PBAMASK_USART3 (0x1u << 11) /**< \brief (PM_PBAMASK) USART3 PB Clock Mask */ +#define PM_PBAMASK_ADCIFE (0x1u << 12) /**< \brief (PM_PBAMASK) ADCIFE PB Clock Mask */ +#define PM_PBAMASK_DACC (0x1u << 13) /**< \brief (PM_PBAMASK) DACC PB Clock Mask */ +#define PM_PBAMASK_ACIFC (0x1u << 14) /**< \brief (PM_PBAMASK) ACIFC PB Clock Mask */ +#define PM_PBAMASK_GLOC (0x1u << 15) /**< \brief (PM_PBAMASK) GLOC PB Clock Mask */ +#define PM_PBAMASK_ABDACB (0x1u << 16) /**< \brief (PM_PBAMASK) ABDACB PB Clock Mask */ +#define PM_PBAMASK_TRNG (0x1u << 17) /**< \brief (PM_PBAMASK) TRNG PB Clock Mask */ +#define PM_PBAMASK_PARC (0x1u << 18) /**< \brief (PM_PBAMASK) PARC PB Clock Mask */ +#define PM_PBAMASK_CATB (0x1u << 19) /**< \brief (PM_PBAMASK) CATB PB Clock Mask */ +#define PM_PBAMASK_TWIM2 (0x1u << 21) /**< \brief (PM_PBAMASK) TWIM2 PB Clock Mask */ +#define PM_PBAMASK_TWIM3 (0x1u << 22) /**< \brief (PM_PBAMASK) TWIM3 PB Clock Mask */ +#define PM_PBAMASK_LCDCA (0x1u << 23) /**< \brief (PM_PBAMASK) LCDCA PB Clock Mask */ +/* -------- PM_PBBMASK : (PM Offset: 0x02C) PBB Mask -------- */ +#define PM_PBBMASK_HFLASHC (0x1u << 0) /**< \brief (PM_PBBMASK) HFLASHC PB Clock Mask */ +#define PM_PBBMASK_HCACHE (0x1u << 1) /**< \brief (PM_PBBMASK) HCACHE PB Clock Mask */ +#define PM_PBBMASK_HMATRIX (0x1u << 2) /**< \brief (PM_PBBMASK) HMATRIX PB Clock Mask */ +#define PM_PBBMASK_PDCA (0x1u << 3) /**< \brief (PM_PBBMASK) PDCA PB Clock Mask */ +#define PM_PBBMASK_CRCCU (0x1u << 4) /**< \brief (PM_PBBMASK) CRCCU PB Clock Mask */ +#define PM_PBBMASK_USBC (0x1u << 5) /**< \brief (PM_PBBMASK) USBC PB Clock Mask */ +#define PM_PBBMASK_PEVC (0x1u << 6) /**< \brief (PM_PBBMASK) PEVC PB Clock Mask */ +/* -------- PM_PBCMASK : (PM Offset: 0x030) PBC Mask -------- */ +#define PM_PBCMASK_PM (0x1u << 0) /**< \brief (PM_PBCMASK) PM PB Clock Mask */ +#define PM_PBCMASK_CHIPID (0x1u << 1) /**< \brief (PM_PBCMASK) CHIPID PB Clock Mask */ +#define PM_PBCMASK_SCIF (0x1u << 2) /**< \brief (PM_PBCMASK) SCIF PB Clock Mask */ +#define PM_PBCMASK_FREQM (0x1u << 3) /**< \brief (PM_PBCMASK) FREQM PB Clock Mask */ +#define PM_PBCMASK_GPIO (0x1u << 4) /**< \brief (PM_PBCMASK) GPIO PB Clock Mask */ +/* -------- PM_PBDMASK : (PM Offset: 0x034) PBD Mask -------- */ +#define PM_PBDMASK_BPM (0x1u << 0) /**< \brief (PM_PBDMASK) BPM PB Clock Mask */ +#define PM_PBDMASK_BSCIF (0x1u << 1) /**< \brief (PM_PBDMASK) BSCIF PB Clock Mask */ +#define PM_PBDMASK_AST (0x1u << 2) /**< \brief (PM_PBDMASK) AST PB Clock Mask */ +#define PM_PBDMASK_WDT (0x1u << 3) /**< \brief (PM_PBDMASK) WDT PB Clock Mask */ +#define PM_PBDMASK_EIC (0x1u << 4) /**< \brief (PM_PBDMASK) EIC PB Clock Mask */ +#define PM_PBDMASK_PICOUART (0x1u << 5) /**< \brief (PM_PBDMASK) PICOUART PB Clock Mask */ +/* -------- PM_CFDCTRL : (PM Offset: 0x054) Clock Failure Detector Control -------- */ +#define PM_CFDCTRL_CFDEN (0x1u << 0) /**< \brief (PM_CFDCTRL) Clock Failure Detection Enable */ +#define PM_CFDCTRL_SFV (0x1u << 31) /**< \brief (PM_CFDCTRL) Store Final Value */ +/* -------- PM_UNLOCK : (PM Offset: 0x058) Unlock Register -------- */ +#define PM_UNLOCK_ADDR_Pos 0 +#define PM_UNLOCK_ADDR_Msk (0x3FFu << PM_UNLOCK_ADDR_Pos) /**< \brief (PM_UNLOCK) Unlock Address */ +#define PM_UNLOCK_ADDR(value) ((PM_UNLOCK_ADDR_Msk & ((value) << PM_UNLOCK_ADDR_Pos))) +#define PM_UNLOCK_KEY_Pos 24 +#define PM_UNLOCK_KEY_Msk (0xFFu << PM_UNLOCK_KEY_Pos) /**< \brief (PM_UNLOCK) Unlock Key */ +#define PM_UNLOCK_KEY(value) ((PM_UNLOCK_KEY_Msk & ((value) << PM_UNLOCK_KEY_Pos))) +/* -------- PM_IER : (PM Offset: 0x0C0) Interrupt Enable Register -------- */ +#define PM_IER_CFD (0x1u << 0) /**< \brief (PM_IER) Clock Failure Detected Interrupt Enable */ +#define PM_IER_CKRDY (0x1u << 5) /**< \brief (PM_IER) Clock Ready Interrupt Enable */ +#define PM_IER_WAKE (0x1u << 8) /**< \brief (PM_IER) Wake up Interrupt Enable */ +#define PM_IER_WAKE_0 (0x0u << 8) /**< \brief (PM_IER) No effect */ +#define PM_IER_WAKE_1 (0x1u << 8) /**< \brief (PM_IER) Disable Interrupt. */ +#define PM_IER_AE (0x1u << 31) /**< \brief (PM_IER) Access Error Interrupt Enable */ +/* -------- PM_IDR : (PM Offset: 0x0C4) Interrupt Disable Register -------- */ +#define PM_IDR_CFD (0x1u << 0) /**< \brief (PM_IDR) Clock Failure Detected Interrupt Disable */ +#define PM_IDR_CKRDY (0x1u << 5) /**< \brief (PM_IDR) Clock Ready Interrupt Disable */ +#define PM_IDR_WAKE (0x1u << 8) /**< \brief (PM_IDR) Wake up Interrupt Disable */ +#define PM_IDR_WAKE_0 (0x0u << 8) /**< \brief (PM_IDR) No effect */ +#define PM_IDR_WAKE_1 (0x1u << 8) /**< \brief (PM_IDR) Disable Interrupt. */ +#define PM_IDR_AE (0x1u << 31) /**< \brief (PM_IDR) Access Error Interrupt Disable */ +/* -------- PM_IMR : (PM Offset: 0x0C8) Interrupt Mask Register -------- */ +#define PM_IMR_CFD (0x1u << 0) /**< \brief (PM_IMR) Clock Failure Detected Interrupt Mask */ +#define PM_IMR_CKRDY (0x1u << 5) /**< \brief (PM_IMR) Clock Ready Interrupt Mask */ +#define PM_IMR_WAKE (0x1u << 8) /**< \brief (PM_IMR) Wake up Interrupt Mask */ +#define PM_IMR_WAKE_0 (0x0u << 8) /**< \brief (PM_IMR) No effect */ +#define PM_IMR_WAKE_1 (0x1u << 8) /**< \brief (PM_IMR) Disable Interrupt. */ +#define PM_IMR_AE (0x1u << 31) /**< \brief (PM_IMR) Access Error Interrupt Mask */ +/* -------- PM_ISR : (PM Offset: 0x0CC) Interrupt Status Register -------- */ +#define PM_ISR_CFD (0x1u << 0) /**< \brief (PM_ISR) Clock Failure Detected Interrupt Status */ +#define PM_ISR_CKRDY (0x1u << 5) /**< \brief (PM_ISR) Clock Ready Interrupt Status */ +#define PM_ISR_WAKE (0x1u << 8) /**< \brief (PM_ISR) Wake up Interrupt Status */ +#define PM_ISR_WAKE_0 (0x0u << 8) /**< \brief (PM_ISR) No effect */ +#define PM_ISR_WAKE_1 (0x1u << 8) /**< \brief (PM_ISR) Disable Interrupt. */ +#define PM_ISR_AE (0x1u << 31) /**< \brief (PM_ISR) Access Error Interrupt Status */ +/* -------- PM_ICR : (PM Offset: 0x0D0) Interrupt Clear Register -------- */ +#define PM_ICR_CFD (0x1u << 0) /**< \brief (PM_ICR) Clock Failure Detected Interrupt Status Clear */ +#define PM_ICR_CKRDY (0x1u << 5) /**< \brief (PM_ICR) Clock Ready Interrupt Status Clear */ +#define PM_ICR_WAKE (0x1u << 8) /**< \brief (PM_ICR) Wake up Interrupt Status Clear */ +#define PM_ICR_AE (0x1u << 31) /**< \brief (PM_ICR) Access Error Interrupt Status Clear */ +/* -------- PM_SR : (PM Offset: 0x0D4) Status Register -------- */ +#define PM_SR_CFD (0x1u << 0) /**< \brief (PM_SR) Clock Failure Detected */ +#define PM_SR_OCP (0x1u << 1) /**< \brief (PM_SR) Over Clock Detected */ +#define PM_SR_CKRDY (0x1u << 5) /**< \brief (PM_SR) Clock Ready */ +#define PM_SR_WAKE (0x1u << 8) /**< \brief (PM_SR) Wake up */ +#define PM_SR_WAKE_0 (0x0u << 8) /**< \brief (PM_SR) No effect */ +#define PM_SR_WAKE_1 (0x1u << 8) /**< \brief (PM_SR) Disable Interrupt. */ +#define PM_SR_PERRDY (0x1u << 28) /**< \brief (PM_SR) Peripheral Ready */ +#define PM_SR_AE (0x1u << 31) /**< \brief (PM_SR) Access Error */ +/* -------- PM_PPCR : (PM Offset: 0x160) Peripheral Power Control Register -------- */ +#define PM_PPCR_RSTPUN (0x1u << 0) /**< \brief (PM_PPCR) Reset Pullup */ +#define PM_PPCR_CATBRCMASK (0x1u << 1) /**< \brief (PM_PPCR) CAT Request Clock Mask */ +#define PM_PPCR_ACIFCRCMASK (0x1u << 2) /**< \brief (PM_PPCR) ACIFC Request Clock Mask */ +#define PM_PPCR_ASTRCMASK (0x1u << 3) /**< \brief (PM_PPCR) AST Request Clock Mask */ +#define PM_PPCR_TWIS0RCMASK (0x1u << 4) /**< \brief (PM_PPCR) TWIS0 Request Clock Mask */ +#define PM_PPCR_TWIS1RCMASK (0x1u << 5) /**< \brief (PM_PPCR) TWIS1 Request Clock Mask */ +#define PM_PPCR_PEVCRCMASK (0x1u << 6) /**< \brief (PM_PPCR) PEVC Request Clock Mask */ +#define PM_PPCR_ADCIFERCMASK (0x1u << 7) /**< \brief (PM_PPCR) ADCIFE Request Clock Mask */ +#define PM_PPCR_VREGRCMASK (0x1u << 8) /**< \brief (PM_PPCR) VREG Request Clock Mask */ +#define PM_PPCR_FWBGREF (0x1u << 9) /**< \brief (PM_PPCR) Flash Wait BGREF */ +#define PM_PPCR_FWBOD18 (0x1u << 10) /**< \brief (PM_PPCR) Flash Wait BOD18 */ +/* -------- PM_RCAUSE : (PM Offset: 0x180) Reset Cause Register -------- */ +#define PM_RCAUSE_POR (0x1u << 0) /**< \brief (PM_RCAUSE) Power-on Reset */ +#define PM_RCAUSE_BOD (0x1u << 1) /**< \brief (PM_RCAUSE) Brown-out Reset */ +#define PM_RCAUSE_EXT (0x1u << 2) /**< \brief (PM_RCAUSE) External Reset Pin */ +#define PM_RCAUSE_WDT (0x1u << 3) /**< \brief (PM_RCAUSE) Watchdog Reset */ +#define PM_RCAUSE_OCDRST (0x1u << 8) /**< \brief (PM_RCAUSE) OCD Reset */ +#define PM_RCAUSE_POR33 (0x1u << 10) /**< \brief (PM_RCAUSE) Power-on Reset */ +#define PM_RCAUSE_BOD33 (0x1u << 13) /**< \brief (PM_RCAUSE) Brown-out 3.3V Reset */ +/* -------- PM_WCAUSE : (PM Offset: 0x184) Wake Cause Register -------- */ +#define PM_WCAUSE_TWI_SLAVE_0 (0x1u << 0) /**< \brief (PM_WCAUSE) Two-wire Slave Interface 0 */ +#define PM_WCAUSE_TWI_SLAVE_1 (0x1u << 1) /**< \brief (PM_WCAUSE) Two-wire Slave Interface 1 */ +#define PM_WCAUSE_USBC (0x1u << 2) /**< \brief (PM_WCAUSE) USB Device and Embedded Host Interface */ +#define PM_WCAUSE_PSOK (0x1u << 3) /**< \brief (PM_WCAUSE) Power Scaling OK */ +#define PM_WCAUSE_BOD18_IRQ (0x1u << 4) /**< \brief (PM_WCAUSE) BOD18 Interrupt */ +#define PM_WCAUSE_BOD33_IRQ (0x1u << 5) /**< \brief (PM_WCAUSE) BOD33 Interrupt */ +#define PM_WCAUSE_PICOUART (0x1u << 6) /**< \brief (PM_WCAUSE) Picopower UART */ +#define PM_WCAUSE_LCDCA (0x1u << 7) /**< \brief (PM_WCAUSE) LCD Controller */ +#define PM_WCAUSE_EIC (0x1u << 16) /**< \brief (PM_WCAUSE) External Interrupt Controller */ +#define PM_WCAUSE_AST (0x1u << 17) /**< \brief (PM_WCAUSE) Asynchronous Timer */ +/* -------- PM_AWEN : (PM Offset: 0x188) Asynchronous Wake Enable -------- */ +#define PM_AWEN_AWEN_Pos 0 +#define PM_AWEN_AWEN_Msk (0xFFFFFFFFu << PM_AWEN_AWEN_Pos) /**< \brief (PM_AWEN) Asynchronous Wake Up */ +#define PM_AWEN_AWEN(value) ((PM_AWEN_AWEN_Msk & ((value) << PM_AWEN_AWEN_Pos))) +/* -------- PM_OBS : (PM Offset: 0x190) Obsvervability -------- */ +/* -------- PM_FASTSLEEP : (PM Offset: 0x194) Fast Sleep Register -------- */ +#define PM_FASTSLEEP_OSC (0x1u << 0) /**< \brief (PM_FASTSLEEP) Oscillator */ +#define PM_FASTSLEEP_PLL (0x1u << 8) /**< \brief (PM_FASTSLEEP) PLL */ +#define PM_FASTSLEEP_FASTRCOSC_Pos 16 +#define PM_FASTSLEEP_FASTRCOSC_Msk (0x1Fu << PM_FASTSLEEP_FASTRCOSC_Pos) /**< \brief (PM_FASTSLEEP) RC80 or FLO */ +#define PM_FASTSLEEP_FASTRCOSC(value) ((PM_FASTSLEEP_FASTRCOSC_Msk & ((value) << PM_FASTSLEEP_FASTRCOSC_Pos))) +#define PM_FASTSLEEP_DFLL (0x1u << 24) /**< \brief (PM_FASTSLEEP) DFLL */ +/* -------- PM_CONFIG : (PM Offset: 0x3F8) Configuration Register -------- */ +#define PM_CONFIG_PBA (0x1u << 0) /**< \brief (PM_CONFIG) APBA Implemented */ +#define PM_CONFIG_PBB (0x1u << 1) /**< \brief (PM_CONFIG) APBB Implemented */ +#define PM_CONFIG_PBC (0x1u << 2) /**< \brief (PM_CONFIG) APBC Implemented */ +#define PM_CONFIG_PBD (0x1u << 3) /**< \brief (PM_CONFIG) APBD Implemented */ +#define PM_CONFIG_HSBPEVC (0x1u << 7) /**< \brief (PM_CONFIG) HSB PEVC Clock Implemented */ +/* -------- PM_VERSION : (PM Offset: 0x3FC) Version Register -------- */ +#define PM_VERSION_VERSION_Pos 0 +#define PM_VERSION_VERSION_Msk (0xFFFu << PM_VERSION_VERSION_Pos) /**< \brief (PM_VERSION) Version number */ +#define PM_VERSION_VERSION(value) ((PM_VERSION_VERSION_Msk & ((value) << PM_VERSION_VERSION_Pos))) +#define PM_VERSION_VARIANT_Pos 16 +#define PM_VERSION_VARIANT_Msk (0xFu << PM_VERSION_VARIANT_Pos) /**< \brief (PM_VERSION) Variant number */ +#define PM_VERSION_VARIANT(value) ((PM_VERSION_VARIANT_Msk & ((value) << PM_VERSION_VARIANT_Pos))) + +/*@}*/ + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR SCIF */ +/* ============================================================================= */ +/** \addtogroup SAM4L_SCIF System Control Interface */ +/*@{*/ + +#define REV_SCIF 0x130 + +#ifndef __ASSEMBLY__ +/** \brief ScifGcctrl hardware registers */ +typedef struct { + RwReg SCIF_GCCTRL; /**< \brief (ScifGcctrl Offset: 0x000) Generic Clock Control */ +} ScifGcctrl; +/** \brief ScifPll hardware registers */ +typedef struct { + RwReg SCIF_PLL; /**< \brief (ScifPll Offset: 0x000) PLL0 Control Register */ +} ScifPll; +/** \brief SCIF hardware registers */ +typedef struct { + WoReg SCIF_IER; /**< \brief (SCIF Offset: 0x000) Interrupt Enable Register */ + WoReg SCIF_IDR; /**< \brief (SCIF Offset: 0x004) Interrupt Disable Register */ + RoReg SCIF_IMR; /**< \brief (SCIF Offset: 0x008) Interrupt Mask Register */ + RoReg SCIF_ISR; /**< \brief (SCIF Offset: 0x00C) Interrupt Status Register */ + WoReg SCIF_ICR; /**< \brief (SCIF Offset: 0x010) Interrupt Clear Register */ + RoReg SCIF_PCLKSR; /**< \brief (SCIF Offset: 0x014) Power and Clocks Status Register */ + WoReg SCIF_UNLOCK; /**< \brief (SCIF Offset: 0x018) Unlock Register */ + RwReg SCIF_CSCR; /**< \brief (SCIF Offset: 0x01C) Chip Specific Configuration Register */ + RwReg SCIF_OSCCTRL0; /**< \brief (SCIF Offset: 0x020) Oscillator Control Register */ + ScifPll SCIF_PLL[1]; /**< \brief (SCIF Offset: 0x024) ScifPll groups */ + RwReg SCIF_DFLL0CONF; /**< \brief (SCIF Offset: 0x028) DFLL0 Config Register */ + RwReg SCIF_DFLL0VAL; /**< \brief (SCIF Offset: 0x02C) DFLL Value Register */ + RwReg SCIF_DFLL0MUL; /**< \brief (SCIF Offset: 0x030) DFLL0 Multiplier Register */ + RwReg SCIF_DFLL0STEP; /**< \brief (SCIF Offset: 0x034) DFLL0 Step Register */ + RwReg SCIF_DFLL0SSG; /**< \brief (SCIF Offset: 0x038) DFLL0 Spread Spectrum Generator Control Register */ + RoReg SCIF_DFLL0RATIO; /**< \brief (SCIF Offset: 0x03C) DFLL0 Ratio Registe */ + WoReg SCIF_DFLL0SYNC; /**< \brief (SCIF Offset: 0x040) DFLL0 Synchronization Register */ + RwReg SCIF_RCCR; /**< \brief (SCIF Offset: 0x044) System RC Oscillator Calibration Register */ + RwReg SCIF_RCFASTCFG; /**< \brief (SCIF Offset: 0x048) 4/8/12 MHz RC Oscillator Configuration +Register */ + RwReg SCIF_RCFASTSR; /**< \brief (SCIF Offset: 0x04C) 4/8/12 MHz RC Oscillator Status Register */ + RwReg SCIF_RC80MCR; /**< \brief (SCIF Offset: 0x050) 80 MHz RC Oscillator Register */ + RoReg Reserved1[4]; + RwReg SCIF_HRPCR; /**< \brief (SCIF Offset: 0x064) High Resolution Prescaler Control Register */ + RwReg SCIF_FPCR; /**< \brief (SCIF Offset: 0x068) Fractional Prescaler Control Register */ + RwReg SCIF_FPMUL; /**< \brief (SCIF Offset: 0x06C) Fractional Prescaler Multiplier Register */ + RwReg SCIF_FPDIV; /**< \brief (SCIF Offset: 0x070) Fractional Prescaler DIVIDER Register */ + ScifGcctrl SCIF_GCCTRL[12]; /**< \brief (SCIF Offset: 0x074) ScifGcctrl groups */ + RoReg Reserved2[205]; + RoReg SCIF_RCFASTVERSION; /**< \brief (SCIF Offset: 0x3D8) 4/8/12 MHz RC Oscillator Version Register */ + RoReg SCIF_GCLKPRESCVERSION; /**< \brief (SCIF Offset: 0x3DC) Generic Clock Prescaler Version Register */ + RoReg SCIF_PLLIFAVERSION; /**< \brief (SCIF Offset: 0x3E0) PLL Version Register */ + RoReg SCIF_OSCIFAVERSION; /**< \brief (SCIF Offset: 0x3E4) Oscillator 0 Version Register */ + RoReg SCIF_DFLLIFBVERSION; /**< \brief (SCIF Offset: 0x3E8) DFLL Version Register */ + RoReg SCIF_RCOSCIFAVERSION; /**< \brief (SCIF Offset: 0x3EC) System RC Oscillator Version Register */ + RoReg SCIF_FLOVERSION; /**< \brief (SCIF Offset: 0x3F0) Frequency Locked Oscillator Version Register */ + RoReg SCIF_RC80MVERSION; /**< \brief (SCIF Offset: 0x3F4) 80MHz RC Oscillator Version Register */ + RoReg SCIF_GCLKIFVERSION; /**< \brief (SCIF Offset: 0x3F8) Generic Clock Version Register */ + RoReg SCIF_VERSION; /**< \brief (SCIF Offset: 0x3FC) SCIF Version Register */ +} Scif; +#endif /* __ASSEMBLY__ */ +/* -------- SCIF_IER : (SCIF Offset: 0x000) Interrupt Enable Register -------- */ +#define SCIF_IER_OSC0RDY (0x1u << 0) /**< \brief (SCIF_IER) */ +#define SCIF_IER_DFLL0LOCKC (0x1u << 1) /**< \brief (SCIF_IER) */ +#define SCIF_IER_DFLL0LOCKF (0x1u << 2) /**< \brief (SCIF_IER) */ +#define SCIF_IER_DFLL0RDY (0x1u << 3) /**< \brief (SCIF_IER) */ +#define SCIF_IER_DFLL0RCS (0x1u << 4) /**< \brief (SCIF_IER) */ +#define SCIF_IER_DFLL0OOB (0x1u << 5) /**< \brief (SCIF_IER) */ +#define SCIF_IER_PLL0LOCK (0x1u << 6) /**< \brief (SCIF_IER) */ +#define SCIF_IER_PLL0LOCKLOST (0x1u << 7) /**< \brief (SCIF_IER) */ +#define SCIF_IER_RCFASTLOCK (0x1u << 13) /**< \brief (SCIF_IER) */ +#define SCIF_IER_RCFASTLOCKLOST (0x1u << 14) /**< \brief (SCIF_IER) */ +#define SCIF_IER_AE (0x1u << 31) /**< \brief (SCIF_IER) */ +/* -------- SCIF_IDR : (SCIF Offset: 0x004) Interrupt Disable Register -------- */ +#define SCIF_IDR_OSC0RDY (0x1u << 0) /**< \brief (SCIF_IDR) */ +#define SCIF_IDR_DFLL0LOCKC (0x1u << 1) /**< \brief (SCIF_IDR) */ +#define SCIF_IDR_DFLL0LOCKF (0x1u << 2) /**< \brief (SCIF_IDR) */ +#define SCIF_IDR_DFLL0RDY (0x1u << 3) /**< \brief (SCIF_IDR) */ +#define SCIF_IDR_DFLL0RCS (0x1u << 4) /**< \brief (SCIF_IDR) */ +#define SCIF_IDR_DFLL0OOB (0x1u << 5) /**< \brief (SCIF_IDR) */ +#define SCIF_IDR_PLL0LOCK (0x1u << 6) /**< \brief (SCIF_IDR) */ +#define SCIF_IDR_PLL0LOCKLOST (0x1u << 7) /**< \brief (SCIF_IDR) */ +#define SCIF_IDR_RCFASTLOCK (0x1u << 13) /**< \brief (SCIF_IDR) */ +#define SCIF_IDR_RCFASTLOCKLOST (0x1u << 14) /**< \brief (SCIF_IDR) */ +#define SCIF_IDR_AE (0x1u << 31) /**< \brief (SCIF_IDR) */ +/* -------- SCIF_IMR : (SCIF Offset: 0x008) Interrupt Mask Register -------- */ +#define SCIF_IMR_OSC0RDY (0x1u << 0) /**< \brief (SCIF_IMR) */ +#define SCIF_IMR_DFLL0LOCKC (0x1u << 1) /**< \brief (SCIF_IMR) */ +#define SCIF_IMR_DFLL0LOCKF (0x1u << 2) /**< \brief (SCIF_IMR) */ +#define SCIF_IMR_DFLL0RDY (0x1u << 3) /**< \brief (SCIF_IMR) */ +#define SCIF_IMR_DFLL0RCS (0x1u << 4) /**< \brief (SCIF_IMR) */ +#define SCIF_IMR_DFLL0OOB (0x1u << 5) /**< \brief (SCIF_IMR) */ +#define SCIF_IMR_PLL0LOCK (0x1u << 6) /**< \brief (SCIF_IMR) */ +#define SCIF_IMR_PLL0LOCKLOST (0x1u << 7) /**< \brief (SCIF_IMR) */ +#define SCIF_IMR_RCFASTLOCK (0x1u << 13) /**< \brief (SCIF_IMR) */ +#define SCIF_IMR_RCFASTLOCKLOST (0x1u << 14) /**< \brief (SCIF_IMR) */ +#define SCIF_IMR_AE (0x1u << 31) /**< \brief (SCIF_IMR) */ +/* -------- SCIF_ISR : (SCIF Offset: 0x00C) Interrupt Status Register -------- */ +#define SCIF_ISR_OSC0RDY (0x1u << 0) /**< \brief (SCIF_ISR) */ +#define SCIF_ISR_DFLL0LOCKC (0x1u << 1) /**< \brief (SCIF_ISR) */ +#define SCIF_ISR_DFLL0LOCKF (0x1u << 2) /**< \brief (SCIF_ISR) */ +#define SCIF_ISR_DFLL0RDY (0x1u << 3) /**< \brief (SCIF_ISR) */ +#define SCIF_ISR_DFLL0RCS (0x1u << 4) /**< \brief (SCIF_ISR) */ +#define SCIF_ISR_DFLL0OOB (0x1u << 5) /**< \brief (SCIF_ISR) */ +#define SCIF_ISR_PLL0LOCK (0x1u << 6) /**< \brief (SCIF_ISR) */ +#define SCIF_ISR_PLL0LOCKLOST (0x1u << 7) /**< \brief (SCIF_ISR) */ +#define SCIF_ISR_RCFASTLOCK (0x1u << 13) /**< \brief (SCIF_ISR) */ +#define SCIF_ISR_RCFASTLOCKLOST (0x1u << 14) /**< \brief (SCIF_ISR) */ +#define SCIF_ISR_AE (0x1u << 31) /**< \brief (SCIF_ISR) */ +/* -------- SCIF_ICR : (SCIF Offset: 0x010) Interrupt Clear Register -------- */ +#define SCIF_ICR_OSC0RDY (0x1u << 0) /**< \brief (SCIF_ICR) */ +#define SCIF_ICR_DFLL0LOCKC (0x1u << 1) /**< \brief (SCIF_ICR) */ +#define SCIF_ICR_DFLL0LOCKF (0x1u << 2) /**< \brief (SCIF_ICR) */ +#define SCIF_ICR_DFLL0RDY (0x1u << 3) /**< \brief (SCIF_ICR) */ +#define SCIF_ICR_DFLL0RCS (0x1u << 4) /**< \brief (SCIF_ICR) */ +#define SCIF_ICR_DFLL0OOB (0x1u << 5) /**< \brief (SCIF_ICR) */ +#define SCIF_ICR_PLL0LOCK (0x1u << 6) /**< \brief (SCIF_ICR) */ +#define SCIF_ICR_PLL0LOCKLOST (0x1u << 7) /**< \brief (SCIF_ICR) */ +#define SCIF_ICR_RCFASTLOCK (0x1u << 13) /**< \brief (SCIF_ICR) */ +#define SCIF_ICR_RCFASTLOCKLOST (0x1u << 14) /**< \brief (SCIF_ICR) */ +#define SCIF_ICR_AE (0x1u << 31) /**< \brief (SCIF_ICR) */ +/* -------- SCIF_PCLKSR : (SCIF Offset: 0x014) Power and Clocks Status Register -------- */ +#define SCIF_PCLKSR_OSC0RDY (0x1u << 0) /**< \brief (SCIF_PCLKSR) OSC0 Ready */ +#define SCIF_PCLKSR_DFLL0LOCKC (0x1u << 1) /**< \brief (SCIF_PCLKSR) DFLL0 Locked on Coarse Value */ +#define SCIF_PCLKSR_DFLL0LOCKF (0x1u << 2) /**< \brief (SCIF_PCLKSR) DFLL0 Locked on Fine Value */ +#define SCIF_PCLKSR_DFLL0RDY (0x1u << 3) /**< \brief (SCIF_PCLKSR) DFLL0 Synchronization Ready */ +#define SCIF_PCLKSR_DFLL0RCS (0x1u << 4) /**< \brief (SCIF_PCLKSR) DFLL0 Reference Clock Stopped */ +#define SCIF_PCLKSR_DFLL0OOB (0x1u << 5) /**< \brief (SCIF_PCLKSR) DFLL0 Track Out Of Bounds */ +#define SCIF_PCLKSR_PLL0LOCK (0x1u << 6) /**< \brief (SCIF_PCLKSR) PLL0 Locked on Accurate value */ +#define SCIF_PCLKSR_PLL0LOCKLOST (0x1u << 7) /**< \brief (SCIF_PCLKSR) PLL0 lock lost value */ +#define SCIF_PCLKSR_RCFASTLOCK (0x1u << 13) /**< \brief (SCIF_PCLKSR) RCFAST Locked on Accurate value */ +#define SCIF_PCLKSR_RCFASTLOCKLOST (0x1u << 14) /**< \brief (SCIF_PCLKSR) RCFAST lock lost value */ +/* -------- SCIF_UNLOCK : (SCIF Offset: 0x018) Unlock Register -------- */ +#define SCIF_UNLOCK_ADDR_Pos 0 +#define SCIF_UNLOCK_ADDR_Msk (0x3FFu << SCIF_UNLOCK_ADDR_Pos) /**< \brief (SCIF_UNLOCK) Unlock Address */ +#define SCIF_UNLOCK_ADDR(value) ((SCIF_UNLOCK_ADDR_Msk & ((value) << SCIF_UNLOCK_ADDR_Pos))) +#define SCIF_UNLOCK_KEY_Pos 24 +#define SCIF_UNLOCK_KEY_Msk (0xFFu << SCIF_UNLOCK_KEY_Pos) /**< \brief (SCIF_UNLOCK) Unlock Key */ +#define SCIF_UNLOCK_KEY(value) ((SCIF_UNLOCK_KEY_Msk & ((value) << SCIF_UNLOCK_KEY_Pos))) +/* -------- SCIF_OSCCTRL0 : (SCIF Offset: 0x020) Oscillator Control Register -------- */ +#define SCIF_OSCCTRL0_MODE (0x1u << 0) /**< \brief (SCIF_OSCCTRL0) Oscillator Mode */ +#define SCIF_OSCCTRL0_GAIN_Pos 1 +#define SCIF_OSCCTRL0_GAIN_Msk (0x3u << SCIF_OSCCTRL0_GAIN_Pos) /**< \brief (SCIF_OSCCTRL0) Gain */ +#define SCIF_OSCCTRL0_GAIN(value) ((SCIF_OSCCTRL0_GAIN_Msk & ((value) << SCIF_OSCCTRL0_GAIN_Pos))) +#define SCIF_OSCCTRL0_AGC (0x1u << 3) /**< \brief (SCIF_OSCCTRL0) Automatic Gain Control */ +#define SCIF_OSCCTRL0_STARTUP_Pos 8 +#define SCIF_OSCCTRL0_STARTUP_Msk (0xFu << SCIF_OSCCTRL0_STARTUP_Pos) /**< \brief (SCIF_OSCCTRL0) Oscillator Start-up Time */ +#define SCIF_OSCCTRL0_STARTUP(value) ((SCIF_OSCCTRL0_STARTUP_Msk & ((value) << SCIF_OSCCTRL0_STARTUP_Pos))) +#define SCIF_OSCCTRL0_OSCEN (0x1u << 16) /**< \brief (SCIF_OSCCTRL0) Oscillator Enable */ +/* -------- SCIF_PLL : (SCIF Offset: 0x024) Pll PLL0 Control Register -------- */ +#define SCIF_PLL_PLLEN (0x1u << 0) /**< \brief (SCIF_PLL) PLL Enable */ +#define SCIF_PLL_PLLOSC_Pos 1 +#define SCIF_PLL_PLLOSC_Msk (0x3u << SCIF_PLL_PLLOSC_Pos) /**< \brief (SCIF_PLL) PLL Oscillator Select */ +#define SCIF_PLL_PLLOSC(value) ((SCIF_PLL_PLLOSC_Msk & ((value) << SCIF_PLL_PLLOSC_Pos))) +#define SCIF_PLL_PLLOPT_Pos 3 +#define SCIF_PLL_PLLOPT_Msk (0x7u << SCIF_PLL_PLLOPT_Pos) /**< \brief (SCIF_PLL) PLL Option */ +#define SCIF_PLL_PLLOPT(value) ((SCIF_PLL_PLLOPT_Msk & ((value) << SCIF_PLL_PLLOPT_Pos))) +#define SCIF_PLL_PLLDIV_Pos 8 +#define SCIF_PLL_PLLDIV_Msk (0xFu << SCIF_PLL_PLLDIV_Pos) /**< \brief (SCIF_PLL) PLL Division Factor */ +#define SCIF_PLL_PLLDIV(value) ((SCIF_PLL_PLLDIV_Msk & ((value) << SCIF_PLL_PLLDIV_Pos))) +#define SCIF_PLL_PLLMUL_Pos 16 +#define SCIF_PLL_PLLMUL_Msk (0xFu << SCIF_PLL_PLLMUL_Pos) /**< \brief (SCIF_PLL) PLL Multiply Factor */ +#define SCIF_PLL_PLLMUL(value) ((SCIF_PLL_PLLMUL_Msk & ((value) << SCIF_PLL_PLLMUL_Pos))) +#define SCIF_PLL_PLLCOUNT_Pos 24 +#define SCIF_PLL_PLLCOUNT_Msk (0x3Fu << SCIF_PLL_PLLCOUNT_Pos) /**< \brief (SCIF_PLL) PLL Count */ +#define SCIF_PLL_PLLCOUNT(value) ((SCIF_PLL_PLLCOUNT_Msk & ((value) << SCIF_PLL_PLLCOUNT_Pos))) +/* -------- SCIF_DFLL0CONF : (SCIF Offset: 0x028) DFLL0 Config Register -------- */ +#define SCIF_DFLL0CONF_EN (0x1u << 0) /**< \brief (SCIF_DFLL0CONF) Enable */ +#define SCIF_DFLL0CONF_MODE (0x1u << 1) /**< \brief (SCIF_DFLL0CONF) Mode Selection */ +#define SCIF_DFLL0CONF_STABLE (0x1u << 2) /**< \brief (SCIF_DFLL0CONF) Stable DFLL Frequency */ +#define SCIF_DFLL0CONF_LLAW (0x1u << 3) /**< \brief (SCIF_DFLL0CONF) Lose Lock After Wake */ +#define SCIF_DFLL0CONF_CCDIS (0x1u << 5) /**< \brief (SCIF_DFLL0CONF) Chill Cycle Disable */ +#define SCIF_DFLL0CONF_QLDIS (0x1u << 6) /**< \brief (SCIF_DFLL0CONF) Quick Lock Disable */ +#define SCIF_DFLL0CONF_RANGE_Pos 16 +#define SCIF_DFLL0CONF_RANGE_Msk (0x3u << SCIF_DFLL0CONF_RANGE_Pos) /**< \brief (SCIF_DFLL0CONF) Range Value */ +#define SCIF_DFLL0CONF_RANGE(value) ((SCIF_DFLL0CONF_RANGE_Msk & ((value) << SCIF_DFLL0CONF_RANGE_Pos))) +#define SCIF_DFLL0CONF_FCD (0x1u << 23) /**< \brief (SCIF_DFLL0CONF) Fuse Calibration Done */ +#define SCIF_DFLL0CONF_CALIB_Pos 24 +#define SCIF_DFLL0CONF_CALIB_Msk (0xFu << SCIF_DFLL0CONF_CALIB_Pos) /**< \brief (SCIF_DFLL0CONF) Calibration Value */ +#define SCIF_DFLL0CONF_CALIB(value) ((SCIF_DFLL0CONF_CALIB_Msk & ((value) << SCIF_DFLL0CONF_CALIB_Pos))) +/* -------- SCIF_DFLL0VAL : (SCIF Offset: 0x02C) DFLL Value Register -------- */ +#define SCIF_DFLL0VAL_FINE_Pos 0 +#define SCIF_DFLL0VAL_FINE_Msk (0xFFu << SCIF_DFLL0VAL_FINE_Pos) /**< \brief (SCIF_DFLL0VAL) Fine Value */ +#define SCIF_DFLL0VAL_FINE(value) ((SCIF_DFLL0VAL_FINE_Msk & ((value) << SCIF_DFLL0VAL_FINE_Pos))) +#define SCIF_DFLL0VAL_COARSE_Pos 16 +#define SCIF_DFLL0VAL_COARSE_Msk (0x1Fu << SCIF_DFLL0VAL_COARSE_Pos) /**< \brief (SCIF_DFLL0VAL) Coarse Value */ +#define SCIF_DFLL0VAL_COARSE(value) ((SCIF_DFLL0VAL_COARSE_Msk & ((value) << SCIF_DFLL0VAL_COARSE_Pos))) +/* -------- SCIF_DFLL0MUL : (SCIF Offset: 0x030) DFLL0 Multiplier Register -------- */ +#define SCIF_DFLL0MUL_MUL_Pos 0 +#define SCIF_DFLL0MUL_MUL_Msk (0xFFFFu << SCIF_DFLL0MUL_MUL_Pos) /**< \brief (SCIF_DFLL0MUL) DFLL Multiply Factor */ +#define SCIF_DFLL0MUL_MUL(value) ((SCIF_DFLL0MUL_MUL_Msk & ((value) << SCIF_DFLL0MUL_MUL_Pos))) +/* -------- SCIF_DFLL0STEP : (SCIF Offset: 0x034) DFLL0 Step Register -------- */ +#define SCIF_DFLL0STEP_FSTEP_Pos 0 +#define SCIF_DFLL0STEP_FSTEP_Msk (0xFFu << SCIF_DFLL0STEP_FSTEP_Pos) /**< \brief (SCIF_DFLL0STEP) Fine Maximum Step */ +#define SCIF_DFLL0STEP_FSTEP(value) ((SCIF_DFLL0STEP_FSTEP_Msk & ((value) << SCIF_DFLL0STEP_FSTEP_Pos))) +#define SCIF_DFLL0STEP_CSTEP_Pos 16 +#define SCIF_DFLL0STEP_CSTEP_Msk (0x1Fu << SCIF_DFLL0STEP_CSTEP_Pos) /**< \brief (SCIF_DFLL0STEP) Coarse Maximum Step */ +#define SCIF_DFLL0STEP_CSTEP(value) ((SCIF_DFLL0STEP_CSTEP_Msk & ((value) << SCIF_DFLL0STEP_CSTEP_Pos))) +/* -------- SCIF_DFLL0SSG : (SCIF Offset: 0x038) DFLL0 Spread Spectrum Generator Control Register -------- */ +#define SCIF_DFLL0SSG_EN (0x1u << 0) /**< \brief (SCIF_DFLL0SSG) Enable */ +#define SCIF_DFLL0SSG_PRBS (0x1u << 1) /**< \brief (SCIF_DFLL0SSG) Pseudo Random Bit Sequence */ +#define SCIF_DFLL0SSG_AMPLITUDE_Pos 8 +#define SCIF_DFLL0SSG_AMPLITUDE_Msk (0x1Fu << SCIF_DFLL0SSG_AMPLITUDE_Pos) /**< \brief (SCIF_DFLL0SSG) SSG Amplitude */ +#define SCIF_DFLL0SSG_AMPLITUDE(value) ((SCIF_DFLL0SSG_AMPLITUDE_Msk & ((value) << SCIF_DFLL0SSG_AMPLITUDE_Pos))) +#define SCIF_DFLL0SSG_STEPSIZE_Pos 16 +#define SCIF_DFLL0SSG_STEPSIZE_Msk (0x1Fu << SCIF_DFLL0SSG_STEPSIZE_Pos) /**< \brief (SCIF_DFLL0SSG) SSG Step Size */ +#define SCIF_DFLL0SSG_STEPSIZE(value) ((SCIF_DFLL0SSG_STEPSIZE_Msk & ((value) << SCIF_DFLL0SSG_STEPSIZE_Pos))) +/* -------- SCIF_DFLL0RATIO : (SCIF Offset: 0x03C) DFLL0 Ratio Registe -------- */ +#define SCIF_DFLL0RATIO_RATIODIFF_Pos 0 +#define SCIF_DFLL0RATIO_RATIODIFF_Msk (0xFFFFu << SCIF_DFLL0RATIO_RATIODIFF_Pos) /**< \brief (SCIF_DFLL0RATIO) Multiplication Ratio Difference */ +#define SCIF_DFLL0RATIO_RATIODIFF(value) ((SCIF_DFLL0RATIO_RATIODIFF_Msk & ((value) << SCIF_DFLL0RATIO_RATIODIFF_Pos))) +/* -------- SCIF_DFLL0SYNC : (SCIF Offset: 0x040) DFLL0 Synchronization Register -------- */ +#define SCIF_DFLL0SYNC_SYNC (0x1u << 0) /**< \brief (SCIF_DFLL0SYNC) Synchronization */ +/* -------- SCIF_RCCR : (SCIF Offset: 0x044) System RC Oscillator Calibration Register -------- */ +#define SCIF_RCCR_CALIB_Pos 0 +#define SCIF_RCCR_CALIB_Msk (0x3FFu << SCIF_RCCR_CALIB_Pos) /**< \brief (SCIF_RCCR) Calibration Value */ +#define SCIF_RCCR_CALIB(value) ((SCIF_RCCR_CALIB_Msk & ((value) << SCIF_RCCR_CALIB_Pos))) +#define SCIF_RCCR_FCD (0x1u << 16) /**< \brief (SCIF_RCCR) Flash Calibration Done */ +/* -------- SCIF_RCFASTCFG : (SCIF Offset: 0x048) 4/8/12 MHz RC Oscillator Configuration +Register -------- */ +#define SCIF_RCFASTCFG_EN (0x1u << 0) /**< \brief (SCIF_RCFASTCFG) Oscillator Enable */ +#define SCIF_RCFASTCFG_TUNEEN (0x1u << 1) /**< \brief (SCIF_RCFASTCFG) Tuner Enable */ +#define SCIF_RCFASTCFG_JITMODE (0x1u << 2) /**< \brief (SCIF_RCFASTCFG) Jitter Mode */ +#define SCIF_RCFASTCFG_NBPERIODS_Pos 4 +#define SCIF_RCFASTCFG_NBPERIODS_Msk (0x7u << SCIF_RCFASTCFG_NBPERIODS_Pos) /**< \brief (SCIF_RCFASTCFG) Number of 32kHz Periods */ +#define SCIF_RCFASTCFG_NBPERIODS(value) ((SCIF_RCFASTCFG_NBPERIODS_Msk & ((value) << SCIF_RCFASTCFG_NBPERIODS_Pos))) +#define SCIF_RCFASTCFG_FCD (0x1u << 7) /**< \brief (SCIF_RCFASTCFG) RCFAST Fuse Calibration Done */ +#define SCIF_RCFASTCFG_FRANGE_Pos 8 +#define SCIF_RCFASTCFG_FRANGE_Msk (0x3u << SCIF_RCFASTCFG_FRANGE_Pos) /**< \brief (SCIF_RCFASTCFG) Frequency Range */ +#define SCIF_RCFASTCFG_FRANGE(value) ((SCIF_RCFASTCFG_FRANGE_Msk & ((value) << SCIF_RCFASTCFG_FRANGE_Pos))) +#define SCIF_RCFASTCFG_LOCKMARGIN_Pos 12 +#define SCIF_RCFASTCFG_LOCKMARGIN_Msk (0xFu << SCIF_RCFASTCFG_LOCKMARGIN_Pos) /**< \brief (SCIF_RCFASTCFG) Accepted Count Error for Lock */ +#define SCIF_RCFASTCFG_LOCKMARGIN(value) ((SCIF_RCFASTCFG_LOCKMARGIN_Msk & ((value) << SCIF_RCFASTCFG_LOCKMARGIN_Pos))) +#define SCIF_RCFASTCFG_CALIB_Pos 16 +#define SCIF_RCFASTCFG_CALIB_Msk (0x7Fu << SCIF_RCFASTCFG_CALIB_Pos) /**< \brief (SCIF_RCFASTCFG) Oscillator Calibration Value */ +#define SCIF_RCFASTCFG_CALIB(value) ((SCIF_RCFASTCFG_CALIB_Msk & ((value) << SCIF_RCFASTCFG_CALIB_Pos))) +/* -------- SCIF_RCFASTSR : (SCIF Offset: 0x04C) 4/8/12 MHz RC Oscillator Status Register -------- */ +#define SCIF_RCFASTSR_CURTRIM_Pos 0 +#define SCIF_RCFASTSR_CURTRIM_Msk (0x7Fu << SCIF_RCFASTSR_CURTRIM_Pos) /**< \brief (SCIF_RCFASTSR) Current Trim Value */ +#define SCIF_RCFASTSR_CURTRIM(value) ((SCIF_RCFASTSR_CURTRIM_Msk & ((value) << SCIF_RCFASTSR_CURTRIM_Pos))) +#define SCIF_RCFASTSR_CNTERR_Pos 16 +#define SCIF_RCFASTSR_CNTERR_Msk (0x1Fu << SCIF_RCFASTSR_CNTERR_Pos) /**< \brief (SCIF_RCFASTSR) Current Count Error */ +#define SCIF_RCFASTSR_CNTERR(value) ((SCIF_RCFASTSR_CNTERR_Msk & ((value) << SCIF_RCFASTSR_CNTERR_Pos))) +#define SCIF_RCFASTSR_SIGN (0x1u << 21) /**< \brief (SCIF_RCFASTSR) Sign of Current Count Error */ +#define SCIF_RCFASTSR_LOCK (0x1u << 24) /**< \brief (SCIF_RCFASTSR) Lock */ +#define SCIF_RCFASTSR_LOCKLOST (0x1u << 25) /**< \brief (SCIF_RCFASTSR) Lock Lost */ +#define SCIF_RCFASTSR_UPDATED (0x1u << 31) /**< \brief (SCIF_RCFASTSR) Current Trim Value Updated */ +/* -------- SCIF_RC80MCR : (SCIF Offset: 0x050) 80 MHz RC Oscillator Register -------- */ +#define SCIF_RC80MCR_EN (0x1u << 0) /**< \brief (SCIF_RC80MCR) Enable */ +#define SCIF_RC80MCR_FCD (0x1u << 7) /**< \brief (SCIF_RC80MCR) Flash Calibration Done */ +#define SCIF_RC80MCR_CALIB_Pos 16 +#define SCIF_RC80MCR_CALIB_Msk (0x3u << SCIF_RC80MCR_CALIB_Pos) /**< \brief (SCIF_RC80MCR) Calibration Value */ +#define SCIF_RC80MCR_CALIB(value) ((SCIF_RC80MCR_CALIB_Msk & ((value) << SCIF_RC80MCR_CALIB_Pos))) +/* -------- SCIF_HRPCR : (SCIF Offset: 0x064) High Resolution Prescaler Control Register -------- */ +#define SCIF_HRPCR_HRPEN (0x1u << 0) /**< \brief (SCIF_HRPCR) High Resolution Prescaler Enable */ +#define SCIF_HRPCR_CKSEL_Pos 1 +#define SCIF_HRPCR_CKSEL_Msk (0x7u << SCIF_HRPCR_CKSEL_Pos) /**< \brief (SCIF_HRPCR) Clock Input Selection */ +#define SCIF_HRPCR_CKSEL(value) ((SCIF_HRPCR_CKSEL_Msk & ((value) << SCIF_HRPCR_CKSEL_Pos))) +#define SCIF_HRPCR_HRCOUNT_Pos 8 +#define SCIF_HRPCR_HRCOUNT_Msk (0xFFFFFFu << SCIF_HRPCR_HRCOUNT_Pos) /**< \brief (SCIF_HRPCR) High Resolution Counter */ +#define SCIF_HRPCR_HRCOUNT(value) ((SCIF_HRPCR_HRCOUNT_Msk & ((value) << SCIF_HRPCR_HRCOUNT_Pos))) +/* -------- SCIF_FPCR : (SCIF Offset: 0x068) Fractional Prescaler Control Register -------- */ +#define SCIF_FPCR_FPEN (0x1u << 0) /**< \brief (SCIF_FPCR) High Resolution Prescaler Enable */ +#define SCIF_FPCR_CKSEL_Pos 1 +#define SCIF_FPCR_CKSEL_Msk (0x7u << SCIF_FPCR_CKSEL_Pos) /**< \brief (SCIF_FPCR) Clock Input Selection */ +#define SCIF_FPCR_CKSEL(value) ((SCIF_FPCR_CKSEL_Msk & ((value) << SCIF_FPCR_CKSEL_Pos))) +/* -------- SCIF_FPMUL : (SCIF Offset: 0x06C) Fractional Prescaler Multiplier Register -------- */ +#define SCIF_FPMUL_FPMUL_Pos 0 +#define SCIF_FPMUL_FPMUL_Msk (0xFFFFu << SCIF_FPMUL_FPMUL_Pos) /**< \brief (SCIF_FPMUL) Fractional Prescaler Multiplication Factor */ +#define SCIF_FPMUL_FPMUL(value) ((SCIF_FPMUL_FPMUL_Msk & ((value) << SCIF_FPMUL_FPMUL_Pos))) +/* -------- SCIF_FPDIV : (SCIF Offset: 0x070) Fractional Prescaler DIVIDER Register -------- */ +#define SCIF_FPDIV_FPDIV_Pos 0 +#define SCIF_FPDIV_FPDIV_Msk (0xFFFFu << SCIF_FPDIV_FPDIV_Pos) /**< \brief (SCIF_FPDIV) Fractional Prescaler Division Factor */ +#define SCIF_FPDIV_FPDIV(value) ((SCIF_FPDIV_FPDIV_Msk & ((value) << SCIF_FPDIV_FPDIV_Pos))) +/* -------- SCIF_GCCTRL : (SCIF Offset: 0x074) Gcctrl Generic Clock Control -------- */ +#define SCIF_GCCTRL_CEN (0x1u << 0) /**< \brief (SCIF_GCCTRL) Clock Enable */ +#define SCIF_GCCTRL_DIVEN (0x1u << 1) /**< \brief (SCIF_GCCTRL) Divide Enable */ +#define SCIF_GCCTRL_OSCSEL_Pos 8 +#define SCIF_GCCTRL_OSCSEL_Msk (0x1Fu << SCIF_GCCTRL_OSCSEL_Pos) /**< \brief (SCIF_GCCTRL) Clock Select */ +#define SCIF_GCCTRL_OSCSEL(value) ((SCIF_GCCTRL_OSCSEL_Msk & ((value) << SCIF_GCCTRL_OSCSEL_Pos))) +#define SCIF_GCCTRL_DIV_Pos 16 +#define SCIF_GCCTRL_DIV_Msk (0xFFFFu << SCIF_GCCTRL_DIV_Pos) /**< \brief (SCIF_GCCTRL) Division Factor */ +#define SCIF_GCCTRL_DIV(value) ((SCIF_GCCTRL_DIV_Msk & ((value) << SCIF_GCCTRL_DIV_Pos))) +/* -------- SCIF_RCFASTVERSION : (SCIF Offset: 0x3D8) 4/8/12 MHz RC Oscillator Version Register -------- */ +#define SCIF_RCFASTVERSION_VERSION_Pos 0 +#define SCIF_RCFASTVERSION_VERSION_Msk (0xFFFu << SCIF_RCFASTVERSION_VERSION_Pos) /**< \brief (SCIF_RCFASTVERSION) Version number */ +#define SCIF_RCFASTVERSION_VERSION(value) ((SCIF_RCFASTVERSION_VERSION_Msk & ((value) << SCIF_RCFASTVERSION_VERSION_Pos))) +#define SCIF_RCFASTVERSION_VARIANT_Pos 16 +#define SCIF_RCFASTVERSION_VARIANT_Msk (0xFu << SCIF_RCFASTVERSION_VARIANT_Pos) /**< \brief (SCIF_RCFASTVERSION) Variant number */ +#define SCIF_RCFASTVERSION_VARIANT(value) ((SCIF_RCFASTVERSION_VARIANT_Msk & ((value) << SCIF_RCFASTVERSION_VARIANT_Pos))) +/* -------- SCIF_GCLKPRESCVERSION : (SCIF Offset: 0x3DC) Generic Clock Prescaler Version Register -------- */ +#define SCIF_GCLKPRESCVERSION_VERSION_Pos 0 +#define SCIF_GCLKPRESCVERSION_VERSION_Msk (0xFFFu << SCIF_GCLKPRESCVERSION_VERSION_Pos) /**< \brief (SCIF_GCLKPRESCVERSION) Version number */ +#define SCIF_GCLKPRESCVERSION_VERSION(value) ((SCIF_GCLKPRESCVERSION_VERSION_Msk & ((value) << SCIF_GCLKPRESCVERSION_VERSION_Pos))) +#define SCIF_GCLKPRESCVERSION_VARIANT_Pos 16 +#define SCIF_GCLKPRESCVERSION_VARIANT_Msk (0xFu << SCIF_GCLKPRESCVERSION_VARIANT_Pos) /**< \brief (SCIF_GCLKPRESCVERSION) Variant number */ +#define SCIF_GCLKPRESCVERSION_VARIANT(value) ((SCIF_GCLKPRESCVERSION_VARIANT_Msk & ((value) << SCIF_GCLKPRESCVERSION_VARIANT_Pos))) +/* -------- SCIF_PLLIFAVERSION : (SCIF Offset: 0x3E0) PLL Version Register -------- */ +#define SCIF_PLLIFAVERSION_VERSION_Pos 0 +#define SCIF_PLLIFAVERSION_VERSION_Msk (0xFFFu << SCIF_PLLIFAVERSION_VERSION_Pos) /**< \brief (SCIF_PLLIFAVERSION) Version number */ +#define SCIF_PLLIFAVERSION_VERSION(value) ((SCIF_PLLIFAVERSION_VERSION_Msk & ((value) << SCIF_PLLIFAVERSION_VERSION_Pos))) +#define SCIF_PLLIFAVERSION_VARIANT_Pos 16 +#define SCIF_PLLIFAVERSION_VARIANT_Msk (0xFu << SCIF_PLLIFAVERSION_VARIANT_Pos) /**< \brief (SCIF_PLLIFAVERSION) Variant nubmer */ +#define SCIF_PLLIFAVERSION_VARIANT(value) ((SCIF_PLLIFAVERSION_VARIANT_Msk & ((value) << SCIF_PLLIFAVERSION_VARIANT_Pos))) +/* -------- SCIF_OSCIFAVERSION : (SCIF Offset: 0x3E4) Oscillator 0 Version Register -------- */ +#define SCIF_OSCIFAVERSION_VERSION_Pos 0 +#define SCIF_OSCIFAVERSION_VERSION_Msk (0xFFFu << SCIF_OSCIFAVERSION_VERSION_Pos) /**< \brief (SCIF_OSCIFAVERSION) Version number */ +#define SCIF_OSCIFAVERSION_VERSION(value) ((SCIF_OSCIFAVERSION_VERSION_Msk & ((value) << SCIF_OSCIFAVERSION_VERSION_Pos))) +#define SCIF_OSCIFAVERSION_VARIANT_Pos 16 +#define SCIF_OSCIFAVERSION_VARIANT_Msk (0xFu << SCIF_OSCIFAVERSION_VARIANT_Pos) /**< \brief (SCIF_OSCIFAVERSION) Variant nubmer */ +#define SCIF_OSCIFAVERSION_VARIANT(value) ((SCIF_OSCIFAVERSION_VARIANT_Msk & ((value) << SCIF_OSCIFAVERSION_VARIANT_Pos))) +/* -------- SCIF_DFLLIFBVERSION : (SCIF Offset: 0x3E8) DFLL Version Register -------- */ +#define SCIF_DFLLIFBVERSION_VERSION_Pos 0 +#define SCIF_DFLLIFBVERSION_VERSION_Msk (0xFFFu << SCIF_DFLLIFBVERSION_VERSION_Pos) /**< \brief (SCIF_DFLLIFBVERSION) Version number */ +#define SCIF_DFLLIFBVERSION_VERSION(value) ((SCIF_DFLLIFBVERSION_VERSION_Msk & ((value) << SCIF_DFLLIFBVERSION_VERSION_Pos))) +#define SCIF_DFLLIFBVERSION_VARIANT_Pos 16 +#define SCIF_DFLLIFBVERSION_VARIANT_Msk (0xFu << SCIF_DFLLIFBVERSION_VARIANT_Pos) /**< \brief (SCIF_DFLLIFBVERSION) Variant number */ +#define SCIF_DFLLIFBVERSION_VARIANT(value) ((SCIF_DFLLIFBVERSION_VARIANT_Msk & ((value) << SCIF_DFLLIFBVERSION_VARIANT_Pos))) +/* -------- SCIF_RCOSCIFAVERSION : (SCIF Offset: 0x3EC) System RC Oscillator Version Register -------- */ +#define SCIF_RCOSCIFAVERSION_VERSION_Pos 0 +#define SCIF_RCOSCIFAVERSION_VERSION_Msk (0xFFFu << SCIF_RCOSCIFAVERSION_VERSION_Pos) /**< \brief (SCIF_RCOSCIFAVERSION) Version number */ +#define SCIF_RCOSCIFAVERSION_VERSION(value) ((SCIF_RCOSCIFAVERSION_VERSION_Msk & ((value) << SCIF_RCOSCIFAVERSION_VERSION_Pos))) +#define SCIF_RCOSCIFAVERSION_VARIANT_Pos 16 +#define SCIF_RCOSCIFAVERSION_VARIANT_Msk (0xFu << SCIF_RCOSCIFAVERSION_VARIANT_Pos) /**< \brief (SCIF_RCOSCIFAVERSION) Variant number */ +#define SCIF_RCOSCIFAVERSION_VARIANT(value) ((SCIF_RCOSCIFAVERSION_VARIANT_Msk & ((value) << SCIF_RCOSCIFAVERSION_VARIANT_Pos))) +/* -------- SCIF_FLOVERSION : (SCIF Offset: 0x3F0) Frequency Locked Oscillator Version Register -------- */ +#define SCIF_FLOVERSION_VERSION_Pos 0 +#define SCIF_FLOVERSION_VERSION_Msk (0xFFFu << SCIF_FLOVERSION_VERSION_Pos) /**< \brief (SCIF_FLOVERSION) Version number */ +#define SCIF_FLOVERSION_VERSION(value) ((SCIF_FLOVERSION_VERSION_Msk & ((value) << SCIF_FLOVERSION_VERSION_Pos))) +#define SCIF_FLOVERSION_VARIANT_Pos 16 +#define SCIF_FLOVERSION_VARIANT_Msk (0xFu << SCIF_FLOVERSION_VARIANT_Pos) /**< \brief (SCIF_FLOVERSION) Variant number */ +#define SCIF_FLOVERSION_VARIANT(value) ((SCIF_FLOVERSION_VARIANT_Msk & ((value) << SCIF_FLOVERSION_VARIANT_Pos))) +/* -------- SCIF_RC80MVERSION : (SCIF Offset: 0x3F4) 80MHz RC Oscillator Version Register -------- */ +#define SCIF_RC80MVERSION_VERSION_Pos 0 +#define SCIF_RC80MVERSION_VERSION_Msk (0xFFFu << SCIF_RC80MVERSION_VERSION_Pos) /**< \brief (SCIF_RC80MVERSION) Version number */ +#define SCIF_RC80MVERSION_VERSION(value) ((SCIF_RC80MVERSION_VERSION_Msk & ((value) << SCIF_RC80MVERSION_VERSION_Pos))) +#define SCIF_RC80MVERSION_VARIANT_Pos 16 +#define SCIF_RC80MVERSION_VARIANT_Msk (0xFu << SCIF_RC80MVERSION_VARIANT_Pos) /**< \brief (SCIF_RC80MVERSION) Variant number */ +#define SCIF_RC80MVERSION_VARIANT(value) ((SCIF_RC80MVERSION_VARIANT_Msk & ((value) << SCIF_RC80MVERSION_VARIANT_Pos))) +/* -------- SCIF_GCLKIFVERSION : (SCIF Offset: 0x3F8) Generic Clock Version Register -------- */ +#define SCIF_GCLKIFVERSION_VERSION_Pos 0 +#define SCIF_GCLKIFVERSION_VERSION_Msk (0xFFFu << SCIF_GCLKIFVERSION_VERSION_Pos) /**< \brief (SCIF_GCLKIFVERSION) Version number */ +#define SCIF_GCLKIFVERSION_VERSION(value) ((SCIF_GCLKIFVERSION_VERSION_Msk & ((value) << SCIF_GCLKIFVERSION_VERSION_Pos))) +#define SCIF_GCLKIFVERSION_VARIANT_Pos 16 +#define SCIF_GCLKIFVERSION_VARIANT_Msk (0xFu << SCIF_GCLKIFVERSION_VARIANT_Pos) /**< \brief (SCIF_GCLKIFVERSION) Variant number */ +#define SCIF_GCLKIFVERSION_VARIANT(value) ((SCIF_GCLKIFVERSION_VARIANT_Msk & ((value) << SCIF_GCLKIFVERSION_VARIANT_Pos))) +/* -------- SCIF_VERSION : (SCIF Offset: 0x3FC) SCIF Version Register -------- */ +#define SCIF_VERSION_VERSION_Pos 0 +#define SCIF_VERSION_VERSION_Msk (0xFFFu << SCIF_VERSION_VERSION_Pos) /**< \brief (SCIF_VERSION) Version number */ +#define SCIF_VERSION_VERSION(value) ((SCIF_VERSION_VERSION_Msk & ((value) << SCIF_VERSION_VERSION_Pos))) +#define SCIF_VERSION_VARIANT_Pos 16 +#define SCIF_VERSION_VARIANT_Msk (0xFu << SCIF_VERSION_VARIANT_Pos) /**< \brief (SCIF_VERSION) Variant number */ +#define SCIF_VERSION_VARIANT(value) ((SCIF_VERSION_VARIANT_Msk & ((value) << SCIF_VERSION_VARIANT_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR SMAP */ +/* ============================================================================= */ +/** \addtogroup SAM4L_SMAP System Manager Access Port */ +/*@{*/ + +#define REV_SMAP 0x100 + +#ifndef __ASSEMBLY__ +/** \brief SMAP hardware registers */ +typedef struct { + WoReg SMAP_CR; /**< \brief (SMAP Offset: 0x00) Control Register */ + RoReg SMAP_SR; /**< \brief (SMAP Offset: 0x04) Status Register */ + WoReg SMAP_SCR; /**< \brief (SMAP Offset: 0x08) Status Clear Register */ + RwReg SMAP_ADDR; /**< \brief (SMAP Offset: 0x0C) Address Register */ + RwReg SMAP_LENGTH; /**< \brief (SMAP Offset: 0x10) Length Register */ + RwReg SMAP_DATA; /**< \brief (SMAP Offset: 0x14) Data Register */ + RoReg Reserved1[4]; + RoReg SMAP_VERSION; /**< \brief (SMAP Offset: 0x28) VERSION register */ + RoReg Reserved2[49]; + RoReg SMAP_CIDR; /**< \brief (SMAP Offset: 0xF0) Chip ID Register */ + RoReg SMAP_EXID; /**< \brief (SMAP Offset: 0xF4) Chip ID Extension Register */ + RoReg Reserved3[1]; + RoReg SMAP_IDR; /**< \brief (SMAP Offset: 0xFC) AP Identification register */ +} Smap; +#endif /* __ASSEMBLY__ */ +/* -------- SMAP_CR : (SMAP Offset: 0x00) Control Register -------- */ +#define SMAP_CR_EN (0x1u << 0) /**< \brief (SMAP_CR) Enable */ +#define SMAP_CR_DIS (0x1u << 1) /**< \brief (SMAP_CR) Disable */ +#define SMAP_CR_CRC (0x1u << 2) /**< \brief (SMAP_CR) User Page Read */ +#define SMAP_CR_FSPR (0x1u << 3) /**< \brief (SMAP_CR) Flash Supplementary Page Read */ +#define SMAP_CR_CE (0x1u << 4) /**< \brief (SMAP_CR) Chip Erase */ +/* -------- SMAP_SR : (SMAP Offset: 0x04) Status Register -------- */ +#define SMAP_SR_DONE (0x1u << 0) /**< \brief (SMAP_SR) Operation done */ +#define SMAP_SR_HCR (0x1u << 1) /**< \brief (SMAP_SR) Hold Core reset */ +#define SMAP_SR_BERR (0x1u << 2) /**< \brief (SMAP_SR) Bus error */ +#define SMAP_SR_FAIL (0x1u << 3) /**< \brief (SMAP_SR) Failure */ +#define SMAP_SR_LCK (0x1u << 4) /**< \brief (SMAP_SR) Lock */ +#define SMAP_SR_EN (0x1u << 8) /**< \brief (SMAP_SR) Enabled */ +#define SMAP_SR_PROT (0x1u << 9) /**< \brief (SMAP_SR) Protected */ +#define SMAP_SR_DBGP (0x1u << 10) /**< \brief (SMAP_SR) Debugger Present */ +#define SMAP_SR_STATE_Pos 24 +#define SMAP_SR_STATE_Msk (0x7u << SMAP_SR_STATE_Pos) /**< \brief (SMAP_SR) State */ +#define SMAP_SR_STATE(value) ((SMAP_SR_STATE_Msk & ((value) << SMAP_SR_STATE_Pos))) +/* -------- SMAP_SCR : (SMAP Offset: 0x08) Status Clear Register -------- */ +#define SMAP_SCR_DONE (0x1u << 0) /**< \brief (SMAP_SCR) Done */ +#define SMAP_SCR_HCR (0x1u << 1) /**< \brief (SMAP_SCR) Hold Core Register */ +#define SMAP_SCR_BERR (0x1u << 2) /**< \brief (SMAP_SCR) Bus error */ +#define SMAP_SCR_FAIL (0x1u << 3) /**< \brief (SMAP_SCR) Failure */ +#define SMAP_SCR_LCK (0x1u << 4) /**< \brief (SMAP_SCR) Lock error */ +/* -------- SMAP_ADDR : (SMAP Offset: 0x0C) Address Register -------- */ +#define SMAP_ADDR_ADDR_Pos 2 +#define SMAP_ADDR_ADDR_Msk (0x3FFFFFFFu << SMAP_ADDR_ADDR_Pos) /**< \brief (SMAP_ADDR) Address Value */ +#define SMAP_ADDR_ADDR(value) ((SMAP_ADDR_ADDR_Msk & ((value) << SMAP_ADDR_ADDR_Pos))) +/* -------- SMAP_LENGTH : (SMAP Offset: 0x10) Length Register -------- */ +#define SMAP_LENGTH_LENGTH_Pos 2 +#define SMAP_LENGTH_LENGTH_Msk (0x3FFFFFFFu << SMAP_LENGTH_LENGTH_Pos) /**< \brief (SMAP_LENGTH) Length Register */ +#define SMAP_LENGTH_LENGTH(value) ((SMAP_LENGTH_LENGTH_Msk & ((value) << SMAP_LENGTH_LENGTH_Pos))) +/* -------- SMAP_DATA : (SMAP Offset: 0x14) Data Register -------- */ +#define SMAP_DATA_DATA_Pos 0 +#define SMAP_DATA_DATA_Msk (0xFFFFFFFFu << SMAP_DATA_DATA_Pos) /**< \brief (SMAP_DATA) Generic data register */ +#define SMAP_DATA_DATA(value) ((SMAP_DATA_DATA_Msk & ((value) << SMAP_DATA_DATA_Pos))) +/* -------- SMAP_VERSION : (SMAP Offset: 0x28) VERSION register -------- */ +#define SMAP_VERSION_VERSION_Pos 0 +#define SMAP_VERSION_VERSION_Msk (0xFFFu << SMAP_VERSION_VERSION_Pos) /**< \brief (SMAP_VERSION) Version number */ +#define SMAP_VERSION_VERSION(value) ((SMAP_VERSION_VERSION_Msk & ((value) << SMAP_VERSION_VERSION_Pos))) +#define SMAP_VERSION_VARIANT_Pos 16 +#define SMAP_VERSION_VARIANT_Msk (0xFu << SMAP_VERSION_VARIANT_Pos) /**< \brief (SMAP_VERSION) Variant number */ +#define SMAP_VERSION_VARIANT(value) ((SMAP_VERSION_VARIANT_Msk & ((value) << SMAP_VERSION_VARIANT_Pos))) +/* -------- SMAP_CIDR : (SMAP Offset: 0xF0) Chip ID Register -------- */ +#define SMAP_CIDR_VERSION_Pos 0 +#define SMAP_CIDR_VERSION_Msk (0x1Fu << SMAP_CIDR_VERSION_Pos) /**< \brief (SMAP_CIDR) Version of the Device */ +#define SMAP_CIDR_VERSION(value) ((SMAP_CIDR_VERSION_Msk & ((value) << SMAP_CIDR_VERSION_Pos))) +#define SMAP_CIDR_EPROC_Pos 5 +#define SMAP_CIDR_EPROC_Msk (0x7u << SMAP_CIDR_EPROC_Pos) /**< \brief (SMAP_CIDR) Embedded Processor */ +#define SMAP_CIDR_EPROC(value) ((SMAP_CIDR_EPROC_Msk & ((value) << SMAP_CIDR_EPROC_Pos))) +#define SMAP_CIDR_NVPSIZ_Pos 8 +#define SMAP_CIDR_NVPSIZ_Msk (0xFu << SMAP_CIDR_NVPSIZ_Pos) /**< \brief (SMAP_CIDR) Nonvolatile Program Memory Size */ +#define SMAP_CIDR_NVPSIZ(value) ((SMAP_CIDR_NVPSIZ_Msk & ((value) << SMAP_CIDR_NVPSIZ_Pos))) +#define SMAP_CIDR_NVPSIZ2_Pos 12 +#define SMAP_CIDR_NVPSIZ2_Msk (0xFu << SMAP_CIDR_NVPSIZ2_Pos) /**< \brief (SMAP_CIDR) Second Nonvolatile Program Memory Size */ +#define SMAP_CIDR_NVPSIZ2(value) ((SMAP_CIDR_NVPSIZ2_Msk & ((value) << SMAP_CIDR_NVPSIZ2_Pos))) +#define SMAP_CIDR_SRAMSIZ_Pos 16 +#define SMAP_CIDR_SRAMSIZ_Msk (0x1Fu << SMAP_CIDR_SRAMSIZ_Pos) /**< \brief (SMAP_CIDR) Internal SRAM Size */ +#define SMAP_CIDR_SRAMSIZ(value) ((SMAP_CIDR_SRAMSIZ_Msk & ((value) << SMAP_CIDR_SRAMSIZ_Pos))) +#define SMAP_CIDR_ARCH_Pos 21 +#define SMAP_CIDR_ARCH_Msk (0x7Fu << SMAP_CIDR_ARCH_Pos) /**< \brief (SMAP_CIDR) Architecture Identifier */ +#define SMAP_CIDR_ARCH(value) ((SMAP_CIDR_ARCH_Msk & ((value) << SMAP_CIDR_ARCH_Pos))) +#define SMAP_CIDR_NVPTYP_Pos 28 +#define SMAP_CIDR_NVPTYP_Msk (0x7u << SMAP_CIDR_NVPTYP_Pos) /**< \brief (SMAP_CIDR) Nonvolatile Program Memory Type */ +#define SMAP_CIDR_NVPTYP(value) ((SMAP_CIDR_NVPTYP_Msk & ((value) << SMAP_CIDR_NVPTYP_Pos))) +#define SMAP_CIDR_EXT (0x1u << 31) /**< \brief (SMAP_CIDR) Extension Flag */ +/* -------- SMAP_EXID : (SMAP Offset: 0xF4) Chip ID Extension Register -------- */ +#define SMAP_EXID_EXID_Pos 0 +#define SMAP_EXID_EXID_Msk (0xFFFFFFFFu << SMAP_EXID_EXID_Pos) /**< \brief (SMAP_EXID) Chip ID Extension */ +#define SMAP_EXID_EXID(value) ((SMAP_EXID_EXID_Msk & ((value) << SMAP_EXID_EXID_Pos))) +/* -------- SMAP_IDR : (SMAP Offset: 0xFC) AP Identification register -------- */ +#define SMAP_IDR_APIDV_Pos 0 +#define SMAP_IDR_APIDV_Msk (0xFu << SMAP_IDR_APIDV_Pos) /**< \brief (SMAP_IDR) AP Identification Variant */ +#define SMAP_IDR_APIDV(value) ((SMAP_IDR_APIDV_Msk & ((value) << SMAP_IDR_APIDV_Pos))) +#define SMAP_IDR_APID_Pos 4 +#define SMAP_IDR_APID_Msk (0xFu << SMAP_IDR_APID_Pos) /**< \brief (SMAP_IDR) AP Identification */ +#define SMAP_IDR_APID(value) ((SMAP_IDR_APID_Msk & ((value) << SMAP_IDR_APID_Pos))) +#define SMAP_IDR_CLSS (0x1u << 16) /**< \brief (SMAP_IDR) Class */ +#define SMAP_IDR_IC_Pos 17 +#define SMAP_IDR_IC_Msk (0x7Fu << SMAP_IDR_IC_Pos) /**< \brief (SMAP_IDR) JEP-106 Identity Code */ +#define SMAP_IDR_IC(value) ((SMAP_IDR_IC_Msk & ((value) << SMAP_IDR_IC_Pos))) +#define SMAP_IDR_CC_Pos 24 +#define SMAP_IDR_CC_Msk (0xFu << SMAP_IDR_CC_Pos) /**< \brief (SMAP_IDR) JEP-106 Continuation Code */ +#define SMAP_IDR_CC(value) ((SMAP_IDR_CC_Msk & ((value) << SMAP_IDR_CC_Pos))) +#define SMAP_IDR_REVISION_Pos 28 +#define SMAP_IDR_REVISION_Msk (0xFu << SMAP_IDR_REVISION_Pos) /**< \brief (SMAP_IDR) Revision */ +#define SMAP_IDR_REVISION(value) ((SMAP_IDR_REVISION_Msk & ((value) << SMAP_IDR_REVISION_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR SPI */ +/* ============================================================================= */ +/** \addtogroup SAM4L_SPI Serial Peripheral Interface */ +/*@{*/ + +#define REV_SPI 0x211 + +#ifndef __ASSEMBLY__ +/** \brief SPI hardware registers */ +typedef struct { + WoReg SPI_CR; /**< \brief (SPI Offset: 0x00) Control Register */ + RwReg SPI_MR; /**< \brief (SPI Offset: 0x04) Mode Register */ + RoReg SPI_RDR; /**< \brief (SPI Offset: 0x08) Receive Data Register */ + WoReg SPI_TDR; /**< \brief (SPI Offset: 0x0C) Transmit Data Register */ + RoReg SPI_SR; /**< \brief (SPI Offset: 0x10) Status Register */ + WoReg SPI_IER; /**< \brief (SPI Offset: 0x14) Interrupt Enable Register */ + WoReg SPI_IDR; /**< \brief (SPI Offset: 0x18) Interrupt Disable Register */ + RoReg SPI_IMR; /**< \brief (SPI Offset: 0x1C) Interrupt Mask Register */ + RoReg Reserved1[4]; + RwReg SPI_CSR[4]; /**< \brief (SPI Offset: 0x30) Chip Select Registers */ + RoReg Reserved2[41]; + RwReg SPI_WPCR; /**< \brief (SPI Offset: 0xE4) Write Protection control Register */ + RoReg SPI_WPSR; /**< \brief (SPI Offset: 0xE8) Write Protection status Register */ + RoReg Reserved3[3]; + RoReg SPI_FEATURES; /**< \brief (SPI Offset: 0xF8) Features Register */ + RoReg SPI_VERSION; /**< \brief (SPI Offset: 0xFC) Version Register */ +} Spi; +#endif /* __ASSEMBLY__ */ +/* -------- SPI_CR : (SPI Offset: 0x00) Control Register -------- */ +#define SPI_CR_SPIEN (0x1u << 0) /**< \brief (SPI_CR) SPI Enable */ +#define SPI_CR_SPIEN_0 (0x0u << 0) /**< \brief (SPI_CR) No effect. */ +#define SPI_CR_SPIEN_1 (0x1u << 0) /**< \brief (SPI_CR) Enables the SPI to transfer and receive data. */ +#define SPI_CR_SPIDIS (0x1u << 1) /**< \brief (SPI_CR) SPI Disable */ +#define SPI_CR_SPIDIS_0 (0x0u << 1) /**< \brief (SPI_CR) No effect. */ +#define SPI_CR_SPIDIS_1 (0x1u << 1) /**< \brief (SPI_CR) Disables the SPI.All pins are set in input mode and no data is received or transmitted.If a transfer is in progress, the transfer is finished before the SPI is disabled.If both SPIEN and SPIDIS are equal to one when the control register is written, the SPI is disabled. */ +#define SPI_CR_SWRST (0x1u << 7) /**< \brief (SPI_CR) SPI Software Reset */ +#define SPI_CR_SWRST_0 (0x0u << 7) /**< \brief (SPI_CR) No effect. */ +#define SPI_CR_SWRST_1 (0x1u << 7) /**< \brief (SPI_CR) Reset the SPI. A software-triggered hardware reset of the SPI interface is performed. */ +#define SPI_CR_FLUSHFIFO (0x1u << 8) /**< \brief (SPI_CR) Flush FIFO command */ +#define SPI_CR_LASTXFER (0x1u << 24) /**< \brief (SPI_CR) Last Transfer */ +#define SPI_CR_LASTXFER_0 (0x0u << 24) /**< \brief (SPI_CR) No effect. */ +#define SPI_CR_LASTXFER_1 (0x1u << 24) /**< \brief (SPI_CR) The current NPCS will be deasserted after the character written in TD has been transferred. When CSAAT is set, thisallows to close the communication with the current serial peripheral by raising the corresponding NPCS line as soon as TDtransfer has completed. */ +/* -------- SPI_MR : (SPI Offset: 0x04) Mode Register -------- */ +#define SPI_MR_MSTR (0x1u << 0) /**< \brief (SPI_MR) Master/Slave Mode */ +#define SPI_MR_MSTR_0 (0x0u << 0) /**< \brief (SPI_MR) SPI is in Slave mode. */ +#define SPI_MR_MSTR_1 (0x1u << 0) /**< \brief (SPI_MR) SPI is in Master mode. */ +#define SPI_MR_PS (0x1u << 1) /**< \brief (SPI_MR) Peripheral Select */ +#define SPI_MR_PS_0 (0x0u << 1) /**< \brief (SPI_MR) Fixed Peripheral Select. */ +#define SPI_MR_PS_1 (0x1u << 1) /**< \brief (SPI_MR) Variable Peripheral Select. */ +#define SPI_MR_PCSDEC (0x1u << 2) /**< \brief (SPI_MR) Chip Select Decode */ +#define SPI_MR_PCSDEC_0 (0x0u << 2) /**< \brief (SPI_MR) The chip selects are directly connected to a peripheral device. */ +#define SPI_MR_PCSDEC_1 (0x1u << 2) /**< \brief (SPI_MR) The four chip select lines are connected to a 4- to 16-bit decoder.When PCSDEC equals one, up to 15 Chip Select signals can be generated with the four lines using an external 4- to 16-bitdecoder. The Chip Select Registers define the characteristics of the 16 chip selects according to the following rules:CSR0 defines peripheral chip select signals 0 to 3.CSR1 defines peripheral chip select signals 4 to 7.CSR2 defines peripheral chip select signals 8 to 11.CSR3 defines peripheral chip select signals 12 to 15. */ +#define SPI_MR_MODFDIS (0x1u << 4) /**< \brief (SPI_MR) Mode Fault Detection */ +#define SPI_MR_MODFDIS_0 (0x0u << 4) /**< \brief (SPI_MR) Mode fault detection is enabled. */ +#define SPI_MR_MODFDIS_1 (0x1u << 4) /**< \brief (SPI_MR) Mode fault detection is disabled. */ +#define SPI_MR_WDRBT (0x1u << 5) /**< \brief (SPI_MR) wait data read before transfer */ +#define SPI_MR_RXFIFOEN (0x1u << 6) /**< \brief (SPI_MR) FIFO in Reception Enable */ +#define SPI_MR_LLB (0x1u << 7) /**< \brief (SPI_MR) Local Loopback Enable */ +#define SPI_MR_LLB_0 (0x0u << 7) /**< \brief (SPI_MR) Local loopback path disabled. */ +#define SPI_MR_LLB_1 (0x1u << 7) /**< \brief (SPI_MR) Local loopback path enabled.LLB controls the local loopback on the data serializer for testing in Master Mode only. */ +#define SPI_MR_PCS_Pos 16 +#define SPI_MR_PCS_Msk (0xFu << SPI_MR_PCS_Pos) /**< \brief (SPI_MR) Peripheral Chip Select */ +#define SPI_MR_PCS(value) ((SPI_MR_PCS_Msk & ((value) << SPI_MR_PCS_Pos))) +#define SPI_MR_DLYBCS_Pos 24 +#define SPI_MR_DLYBCS_Msk (0xFFu << SPI_MR_DLYBCS_Pos) /**< \brief (SPI_MR) Delay Between Chip Selects */ +#define SPI_MR_DLYBCS(value) ((SPI_MR_DLYBCS_Msk & ((value) << SPI_MR_DLYBCS_Pos))) +/* -------- SPI_RDR : (SPI Offset: 0x08) Receive Data Register -------- */ +#define SPI_RDR_RD_Pos 0 +#define SPI_RDR_RD_Msk (0xFFFFu << SPI_RDR_RD_Pos) /**< \brief (SPI_RDR) Receive Data */ +#define SPI_RDR_RD(value) ((SPI_RDR_RD_Msk & ((value) << SPI_RDR_RD_Pos))) +#define SPI_RDR_PCS_Pos 16 +#define SPI_RDR_PCS_Msk (0xFu << SPI_RDR_PCS_Pos) /**< \brief (SPI_RDR) Peripheral Chip Select */ +#define SPI_RDR_PCS(value) ((SPI_RDR_PCS_Msk & ((value) << SPI_RDR_PCS_Pos))) +/* -------- SPI_TDR : (SPI Offset: 0x0C) Transmit Data Register -------- */ +#define SPI_TDR_TD_Pos 0 +#define SPI_TDR_TD_Msk (0xFFFFu << SPI_TDR_TD_Pos) /**< \brief (SPI_TDR) Transmit Data */ +#define SPI_TDR_TD(value) ((SPI_TDR_TD_Msk & ((value) << SPI_TDR_TD_Pos))) +#define SPI_TDR_PCS_Pos 16 +#define SPI_TDR_PCS_Msk (0xFu << SPI_TDR_PCS_Pos) /**< \brief (SPI_TDR) Peripheral Chip Select */ +#define SPI_TDR_PCS(value) ((SPI_TDR_PCS_Msk & ((value) << SPI_TDR_PCS_Pos))) +#define SPI_TDR_LASTXFER (0x1u << 24) /**< \brief (SPI_TDR) Last Transfer */ +#define SPI_TDR_LASTXFER_0 (0x0u << 24) /**< \brief (SPI_TDR) No effect. */ +#define SPI_TDR_LASTXFER_1 (0x1u << 24) /**< \brief (SPI_TDR) The current NPCS will be deasserted after the character written in TD has been transferred. When CSAAT is set, thisallows to close the communication with the current serial peripheral by raising the corresponding NPCS line as soon as TDtransfer has completed. */ +/* -------- SPI_SR : (SPI Offset: 0x10) Status Register -------- */ +#define SPI_SR_RDRF (0x1u << 0) /**< \brief (SPI_SR) Receive Data Register Full */ +#define SPI_SR_RDRF_0 (0x0u << 0) /**< \brief (SPI_SR) No data has been received since the last read of RDR */ +#define SPI_SR_RDRF_1 (0x1u << 0) /**< \brief (SPI_SR) Data has been received and the received data has been transferred from the serializer to RDR since the last readof RDR. */ +#define SPI_SR_TDRE (0x1u << 1) /**< \brief (SPI_SR) Transmit Data Register Empty */ +#define SPI_SR_TDRE_0 (0x0u << 1) /**< \brief (SPI_SR) Data has been written to TDR and not yet transferred to the serializer. */ +#define SPI_SR_TDRE_1 (0x1u << 1) /**< \brief (SPI_SR) The last data written in the Transmit Data Register has been transferred to the serializer.TDRE equals zero when the SPI is disabled or at reset. The SPI enable command sets this bit to one. */ +#define SPI_SR_MODF (0x1u << 2) /**< \brief (SPI_SR) Mode Fault Error */ +#define SPI_SR_MODF_0 (0x0u << 2) /**< \brief (SPI_SR) No Mode Fault has been detected since the last read of SR. */ +#define SPI_SR_MODF_1 (0x1u << 2) /**< \brief (SPI_SR) A Mode Fault occurred since the last read of the SR. */ +#define SPI_SR_OVRES (0x1u << 3) /**< \brief (SPI_SR) Overrun Error Status */ +#define SPI_SR_OVRES_0 (0x0u << 3) /**< \brief (SPI_SR) No overrun has been detected since the last read of SR. */ +#define SPI_SR_OVRES_1 (0x1u << 3) /**< \brief (SPI_SR) An overrun has occurred since the last read of SR. */ +#define SPI_SR_ENDRX (0x1u << 4) /**< \brief (SPI_SR) End of RX buffer */ +#define SPI_SR_ENDRX_0 (0x0u << 4) /**< \brief (SPI_SR) The Receive Counter Register has not reached 0 since the last write in RCR or RNCR. */ +#define SPI_SR_ENDRX_1 (0x1u << 4) /**< \brief (SPI_SR) The Receive Counter Register has reached 0 since the last write in RCR or RNCR. */ +#define SPI_SR_ENDTX (0x1u << 5) /**< \brief (SPI_SR) End of TX buffer */ +#define SPI_SR_ENDTX_0 (0x0u << 5) /**< \brief (SPI_SR) The Transmit Counter Register has not reached 0 since the last write in TCR or TNCR. */ +#define SPI_SR_ENDTX_1 (0x1u << 5) /**< \brief (SPI_SR) The Transmit Counter Register has reached 0 since the last write in TCR or TNCR. */ +#define SPI_SR_RXBUFF (0x1u << 6) /**< \brief (SPI_SR) RX Buffer Full */ +#define SPI_SR_RXBUFF_0 (0x0u << 6) /**< \brief (SPI_SR) RCR or RNCR has a value other than 0. */ +#define SPI_SR_RXBUFF_1 (0x1u << 6) /**< \brief (SPI_SR) Both RCR and RNCR has a value of 0. */ +#define SPI_SR_TXBUFE (0x1u << 7) /**< \brief (SPI_SR) TX Buffer Empty */ +#define SPI_SR_TXBUFE_0 (0x0u << 7) /**< \brief (SPI_SR) TCR or TNCR has a value other than 0. */ +#define SPI_SR_TXBUFE_1 (0x1u << 7) /**< \brief (SPI_SR) Both TCR and TNCR has a value of 0. */ +#define SPI_SR_NSSR (0x1u << 8) /**< \brief (SPI_SR) NSS Rising */ +#define SPI_SR_NSSR_0 (0x0u << 8) /**< \brief (SPI_SR) No rising edge detected on NSS pin since last read. */ +#define SPI_SR_NSSR_1 (0x1u << 8) /**< \brief (SPI_SR) A rising edge occurred on NSS pin since last read. */ +#define SPI_SR_TXEMPTY (0x1u << 9) /**< \brief (SPI_SR) Transmission Registers Empty */ +#define SPI_SR_TXEMPTY_0 (0x0u << 9) /**< \brief (SPI_SR) As soon as data is written in TDR. */ +#define SPI_SR_TXEMPTY_1 (0x1u << 9) /**< \brief (SPI_SR) TDR and internal shifter are empty. If a transfer delay has been defined, TXEMPTY is set after the completion ofsuch delay. */ +#define SPI_SR_UNDES (0x1u << 10) /**< \brief (SPI_SR) Underrun Error Status (Slave Mode Only) */ +#define SPI_SR_SPIENS (0x1u << 16) /**< \brief (SPI_SR) SPI Enable Status */ +#define SPI_SR_SPIENS_0 (0x0u << 16) /**< \brief (SPI_SR) SPI is disabled. */ +#define SPI_SR_SPIENS_1 (0x1u << 16) /**< \brief (SPI_SR) SPI is enabled. */ +/* -------- SPI_IER : (SPI Offset: 0x14) Interrupt Enable Register -------- */ +#define SPI_IER_RDRF (0x1u << 0) /**< \brief (SPI_IER) Receive Data Register Full Interrupt Enable */ +#define SPI_IER_RDRF_0 (0x0u << 0) /**< \brief (SPI_IER) No effect. */ +#define SPI_IER_RDRF_1 (0x1u << 0) /**< \brief (SPI_IER) Enables the corresponding interrupt. */ +#define SPI_IER_TDRE (0x1u << 1) /**< \brief (SPI_IER) Transmit Data Register Empty Interrupt Enable */ +#define SPI_IER_TDRE_0 (0x0u << 1) /**< \brief (SPI_IER) No effect. */ +#define SPI_IER_TDRE_1 (0x1u << 1) /**< \brief (SPI_IER) Enables the corresponding interrupt. */ +#define SPI_IER_MODF (0x1u << 2) /**< \brief (SPI_IER) Mode Fault Error Interrupt Enable */ +#define SPI_IER_MODF_0 (0x0u << 2) /**< \brief (SPI_IER) No effect. */ +#define SPI_IER_MODF_1 (0x1u << 2) /**< \brief (SPI_IER) Enables the corresponding interrupt. */ +#define SPI_IER_OVRES (0x1u << 3) /**< \brief (SPI_IER) Overrun Error Interrupt Enable */ +#define SPI_IER_OVRES_0 (0x0u << 3) /**< \brief (SPI_IER) No effect. */ +#define SPI_IER_OVRES_1 (0x1u << 3) /**< \brief (SPI_IER) Enables the corresponding interrupt. */ +#define SPI_IER_ENDRX (0x1u << 4) /**< \brief (SPI_IER) End of Receive Buffer Interrupt Enable */ +#define SPI_IER_ENDRX_0 (0x0u << 4) /**< \brief (SPI_IER) No effect. */ +#define SPI_IER_ENDRX_1 (0x1u << 4) /**< \brief (SPI_IER) Enables the corresponding interrupt. */ +#define SPI_IER_ENDTX (0x1u << 5) /**< \brief (SPI_IER) End of Transmit Buffer Interrupt Enable */ +#define SPI_IER_ENDTX_0 (0x0u << 5) /**< \brief (SPI_IER) No effect. */ +#define SPI_IER_ENDTX_1 (0x1u << 5) /**< \brief (SPI_IER) Enables the corresponding interrupt. */ +#define SPI_IER_RXBUFF (0x1u << 6) /**< \brief (SPI_IER) Receive Buffer Full Interrupt Enable */ +#define SPI_IER_RXBUFF_0 (0x0u << 6) /**< \brief (SPI_IER) No effect. */ +#define SPI_IER_RXBUFF_1 (0x1u << 6) /**< \brief (SPI_IER) Enables the corresponding interrupt. */ +#define SPI_IER_TXBUFE (0x1u << 7) /**< \brief (SPI_IER) Transmit Buffer Empty Interrupt Enable */ +#define SPI_IER_TXBUFE_0 (0x0u << 7) /**< \brief (SPI_IER) No effect. */ +#define SPI_IER_TXBUFE_1 (0x1u << 7) /**< \brief (SPI_IER) Enables the corresponding interrupt. */ +#define SPI_IER_NSSR (0x1u << 8) /**< \brief (SPI_IER) NSS Rising Interrupt Enable */ +#define SPI_IER_NSSR_0 (0x0u << 8) /**< \brief (SPI_IER) No effect. */ +#define SPI_IER_NSSR_1 (0x1u << 8) /**< \brief (SPI_IER) Enables the corresponding interrupt. */ +#define SPI_IER_TXEMPTY (0x1u << 9) /**< \brief (SPI_IER) Transmission Registers Empty Enable */ +#define SPI_IER_TXEMPTY_0 (0x0u << 9) /**< \brief (SPI_IER) No effect. */ +#define SPI_IER_TXEMPTY_1 (0x1u << 9) /**< \brief (SPI_IER) Enables the corresponding interrupt. */ +#define SPI_IER_UNDES (0x1u << 10) /**< \brief (SPI_IER) Underrun Error Interrupt Enable */ +/* -------- SPI_IDR : (SPI Offset: 0x18) Interrupt Disable Register -------- */ +#define SPI_IDR_RDRF (0x1u << 0) /**< \brief (SPI_IDR) Receive Data Register Full Interrupt Disable */ +#define SPI_IDR_RDRF_0 (0x0u << 0) /**< \brief (SPI_IDR) No effect. */ +#define SPI_IDR_RDRF_1 (0x1u << 0) /**< \brief (SPI_IDR) Disables the corresponding interrupt. */ +#define SPI_IDR_TDRE (0x1u << 1) /**< \brief (SPI_IDR) Transmit Data Register Empty Interrupt Disable */ +#define SPI_IDR_TDRE_0 (0x0u << 1) /**< \brief (SPI_IDR) No effect. */ +#define SPI_IDR_TDRE_1 (0x1u << 1) /**< \brief (SPI_IDR) Disables the corresponding interrupt. */ +#define SPI_IDR_MODF (0x1u << 2) /**< \brief (SPI_IDR) Mode Fault Error Interrupt Disable */ +#define SPI_IDR_MODF_0 (0x0u << 2) /**< \brief (SPI_IDR) No effect. */ +#define SPI_IDR_MODF_1 (0x1u << 2) /**< \brief (SPI_IDR) Disables the corresponding interrupt. */ +#define SPI_IDR_OVRES (0x1u << 3) /**< \brief (SPI_IDR) Overrun Error Interrupt Disable */ +#define SPI_IDR_OVRES_0 (0x0u << 3) /**< \brief (SPI_IDR) No effect. */ +#define SPI_IDR_OVRES_1 (0x1u << 3) /**< \brief (SPI_IDR) Disables the corresponding interrupt. */ +#define SPI_IDR_ENDRX (0x1u << 4) /**< \brief (SPI_IDR) End of Receive Buffer Interrupt Disable */ +#define SPI_IDR_ENDRX_0 (0x0u << 4) /**< \brief (SPI_IDR) No effect. */ +#define SPI_IDR_ENDRX_1 (0x1u << 4) /**< \brief (SPI_IDR) Disables the corresponding interrupt. */ +#define SPI_IDR_ENDTX (0x1u << 5) /**< \brief (SPI_IDR) End of Transmit Buffer Interrupt Disable */ +#define SPI_IDR_ENDTX_0 (0x0u << 5) /**< \brief (SPI_IDR) No effect. */ +#define SPI_IDR_ENDTX_1 (0x1u << 5) /**< \brief (SPI_IDR) Disables the corresponding interrupt. */ +#define SPI_IDR_RXBUFF (0x1u << 6) /**< \brief (SPI_IDR) Receive Buffer Full Interrupt Disable */ +#define SPI_IDR_RXBUFF_0 (0x0u << 6) /**< \brief (SPI_IDR) No effect. */ +#define SPI_IDR_RXBUFF_1 (0x1u << 6) /**< \brief (SPI_IDR) Disables the corresponding interrupt. */ +#define SPI_IDR_TXBUFE (0x1u << 7) /**< \brief (SPI_IDR) Transmit Buffer Empty Interrupt Disable */ +#define SPI_IDR_TXBUFE_0 (0x0u << 7) /**< \brief (SPI_IDR) No effect. */ +#define SPI_IDR_TXBUFE_1 (0x1u << 7) /**< \brief (SPI_IDR) Disables the corresponding interrupt. */ +#define SPI_IDR_NSSR (0x1u << 8) /**< \brief (SPI_IDR) NSS Rising Interrupt Disable */ +#define SPI_IDR_NSSR_0 (0x0u << 8) /**< \brief (SPI_IDR) No effect. */ +#define SPI_IDR_NSSR_1 (0x1u << 8) /**< \brief (SPI_IDR) Disables the corresponding interrupt. */ +#define SPI_IDR_TXEMPTY (0x1u << 9) /**< \brief (SPI_IDR) Transmission Registers Empty Disable */ +#define SPI_IDR_TXEMPTY_0 (0x0u << 9) /**< \brief (SPI_IDR) No effect. */ +#define SPI_IDR_TXEMPTY_1 (0x1u << 9) /**< \brief (SPI_IDR) Disables the corresponding interrupt. */ +#define SPI_IDR_UNDES (0x1u << 10) /**< \brief (SPI_IDR) Underrun Error Interrupt Disable */ +/* -------- SPI_IMR : (SPI Offset: 0x1C) Interrupt Mask Register -------- */ +#define SPI_IMR_RDRF (0x1u << 0) /**< \brief (SPI_IMR) Receive Data Register Full Interrupt Mask */ +#define SPI_IMR_RDRF_0 (0x0u << 0) /**< \brief (SPI_IMR) The corresponding interrupt is not enabled. */ +#define SPI_IMR_RDRF_1 (0x1u << 0) /**< \brief (SPI_IMR) The corresponding interrupt is enabled. */ +#define SPI_IMR_TDRE (0x1u << 1) /**< \brief (SPI_IMR) Transmit Data Register Empty Interrupt Mask */ +#define SPI_IMR_TDRE_0 (0x0u << 1) /**< \brief (SPI_IMR) The corresponding interrupt is not enabled. */ +#define SPI_IMR_TDRE_1 (0x1u << 1) /**< \brief (SPI_IMR) The corresponding interrupt is enabled. */ +#define SPI_IMR_MODF (0x1u << 2) /**< \brief (SPI_IMR) Mode Fault Error Interrupt Mask */ +#define SPI_IMR_MODF_0 (0x0u << 2) /**< \brief (SPI_IMR) The corresponding interrupt is not enabled. */ +#define SPI_IMR_MODF_1 (0x1u << 2) /**< \brief (SPI_IMR) The corresponding interrupt is enabled. */ +#define SPI_IMR_OVRES (0x1u << 3) /**< \brief (SPI_IMR) Overrun Error Interrupt Mask */ +#define SPI_IMR_OVRES_0 (0x0u << 3) /**< \brief (SPI_IMR) The corresponding interrupt is not enabled. */ +#define SPI_IMR_OVRES_1 (0x1u << 3) /**< \brief (SPI_IMR) The corresponding interrupt is enabled. */ +#define SPI_IMR_ENDRX (0x1u << 4) /**< \brief (SPI_IMR) End of Receive Buffer Interrupt Mask */ +#define SPI_IMR_ENDRX_0 (0x0u << 4) /**< \brief (SPI_IMR) The corresponding interrupt is not enabled. */ +#define SPI_IMR_ENDRX_1 (0x1u << 4) /**< \brief (SPI_IMR) The corresponding interrupt is enabled. */ +#define SPI_IMR_ENDTX (0x1u << 5) /**< \brief (SPI_IMR) End of Transmit Buffer Interrupt Mask */ +#define SPI_IMR_ENDTX_0 (0x0u << 5) /**< \brief (SPI_IMR) The corresponding interrupt is not enabled. */ +#define SPI_IMR_ENDTX_1 (0x1u << 5) /**< \brief (SPI_IMR) The corresponding interrupt is enabled. */ +#define SPI_IMR_RXBUFF (0x1u << 6) /**< \brief (SPI_IMR) Receive Buffer Full Interrupt Mask */ +#define SPI_IMR_RXBUFF_0 (0x0u << 6) /**< \brief (SPI_IMR) The corresponding interrupt is not enabled. */ +#define SPI_IMR_RXBUFF_1 (0x1u << 6) /**< \brief (SPI_IMR) The corresponding interrupt is enabled. */ +#define SPI_IMR_TXBUFE (0x1u << 7) /**< \brief (SPI_IMR) Transmit Buffer Empty Interrupt Mask */ +#define SPI_IMR_TXBUFE_0 (0x0u << 7) /**< \brief (SPI_IMR) The corresponding interrupt is not enabled. */ +#define SPI_IMR_TXBUFE_1 (0x1u << 7) /**< \brief (SPI_IMR) The corresponding interrupt is enabled. */ +#define SPI_IMR_NSSR (0x1u << 8) /**< \brief (SPI_IMR) NSS Rising Interrupt Mask */ +#define SPI_IMR_NSSR_0 (0x0u << 8) /**< \brief (SPI_IMR) The corresponding interrupt is not enabled. */ +#define SPI_IMR_NSSR_1 (0x1u << 8) /**< \brief (SPI_IMR) The corresponding interrupt is enabled. */ +#define SPI_IMR_TXEMPTY (0x1u << 9) /**< \brief (SPI_IMR) Transmission Registers Empty Mask */ +#define SPI_IMR_TXEMPTY_0 (0x0u << 9) /**< \brief (SPI_IMR) The corresponding interrupt is not enabled. */ +#define SPI_IMR_TXEMPTY_1 (0x1u << 9) /**< \brief (SPI_IMR) The corresponding interrupt is enabled. */ +#define SPI_IMR_UNDES (0x1u << 10) /**< \brief (SPI_IMR) Underrun Error Interrupt Mask */ +/* -------- SPI_CSR0 : (SPI Offset: 0x30) Chip Select Register 0 -------- */ +#define SPI_CSR0_CPOL (0x1u << 0) /**< \brief (SPI_CSR0) Clock Polarity */ +#define SPI_CSR_CPOL (0x1u << 0) /**< \brief (Unified SPI_CSR) Clock Polarity */ +#define SPI_CSR0_CPOL_0 (0x0u << 0) /**< \brief (SPI_CSR0) The inactive state value of SPCK is logic level zero. */ +#define SPI_CSR_CPOL_0 (0x0u << 0) /**< \brief (Unified SPI_CSR) The inactive state value of SPCK is logic level zero. */ +#define SPI_CSR0_CPOL_1 (0x1u << 0) /**< \brief (SPI_CSR0) The inactive state value of SPCK is logic level one.CPOL is used to determine the inactive state value of the serial clock (SPCK). It is used with NCPHA to produce therequired clock/data relationship between master and slave devices. */ +#define SPI_CSR_CPOL_1 (0x1u << 0) /**< \brief (Unified SPI_CSR) The inactive state value of SPCK is logic level one.CPOL is used to determine the inactive state value of the serial clock (SPCK). It is used with NCPHA to produce therequired clock/data relationship between master and slave devices. */ +#define SPI_CSR0_NCPHA (0x1u << 1) /**< \brief (SPI_CSR0) Clock Phase */ +#define SPI_CSR_NCPHA (0x1u << 1) /**< \brief (Unified SPI_CSR) Clock Phase */ +#define SPI_CSR0_NCPHA_0 (0x0u << 1) /**< \brief (SPI_CSR0) Data is changed on the leading edge of SPCK and captured on the following edge of SPCK. */ +#define SPI_CSR_NCPHA_0 (0x0u << 1) /**< \brief (Unified SPI_CSR) Data is changed on the leading edge of SPCK and captured on the following edge of SPCK. */ +#define SPI_CSR0_NCPHA_1 (0x1u << 1) /**< \brief (SPI_CSR0) Data is captured on the leading edge of SPCK and changed on the following edge of SPCK.NCPHA determines which edge of SPCK causes data to change and which edge causes data to be captured. NCPHA isused with CPOL to produce the required clock/data relationship between master and slave devices. */ +#define SPI_CSR_NCPHA_1 (0x1u << 1) /**< \brief (Unified SPI_CSR) Data is captured on the leading edge of SPCK and changed on the following edge of SPCK.NCPHA determines which edge of SPCK causes data to change and which edge causes data to be captured. NCPHA isused with CPOL to produce the required clock/data relationship between master and slave devices. */ +#define SPI_CSR0_CSNAAT (0x1u << 2) /**< \brief (SPI_CSR0) Chip Select Not Active After Transfer */ +#define SPI_CSR_CSNAAT (0x1u << 2) /**< \brief (Unified SPI_CSR) Chip Select Not Active After Transfer */ +#define SPI_CSR0_CSAAT (0x1u << 3) /**< \brief (SPI_CSR0) Chip Select Active After Transfer */ +#define SPI_CSR_CSAAT (0x1u << 3) /**< \brief (Unified SPI_CSR) Chip Select Active After Transfer */ +#define SPI_CSR0_CSAAT_0 (0x0u << 3) /**< \brief (SPI_CSR0) The Peripheral Chip Select Line rises as soon as the last transfer is achieved. */ +#define SPI_CSR_CSAAT_0 (0x0u << 3) /**< \brief (Unified SPI_CSR) The Peripheral Chip Select Line rises as soon as the last transfer is achieved. */ +#define SPI_CSR0_CSAAT_1 (0x1u << 3) /**< \brief (SPI_CSR0) The Peripheral Chip Select does not rise after the last transfer is achieved. It remains active until a new transfer isrequested on a different chip select. */ +#define SPI_CSR_CSAAT_1 (0x1u << 3) /**< \brief (Unified SPI_CSR) The Peripheral Chip Select does not rise after the last transfer is achieved. It remains active until a new transfer isrequested on a different chip select. */ +#define SPI_CSR0_BITS_Pos 4 +#define SPI_CSR0_BITS_Msk (0xFu << SPI_CSR0_BITS_Pos) /**< \brief (SPI_CSR0) Bits Per Transfer */ +#define SPI_CSR0_BITS(value) ((SPI_CSR0_BITS_Msk & ((value) << SPI_CSR0_BITS_Pos))) +#define SPI_CSR_BITS_Pos 4 +#define SPI_CSR_BITS_Msk (0xFu << SPI_CSR0_BITS_Pos) /**< \brief (SPI_CSR0) Bits Per Transfer */ +#define SPI_CSR_BITS(value) ((SPI_CSR_BITS_Msk & ((value) << SPI_CSR_BITS_Pos))) +#define SPI_CSR0_BITS_8_BPT (0x0u << 4) /**< \brief (SPI_CSR0) 8 bits per transfer */ +#define SPI_CSR_BITS_8_BPT (0x0u << 4) /**< \brief (Unified SPI_CSR) 8 bits per transfer */ +#define SPI_CSR0_BITS_9_BPT (0x1u << 4) /**< \brief (SPI_CSR0) 9 bits per transfer */ +#define SPI_CSR_BITS_9_BPT (0x1u << 4) /**< \brief (Unified SPI_CSR) 9 bits per transfer */ +#define SPI_CSR0_BITS_10_BPT (0x2u << 4) /**< \brief (SPI_CSR0) 10 bits per transfer */ +#define SPI_CSR_BITS_10_BPT (0x2u << 4) /**< \brief (Unified SPI_CSR) 10 bits per transfer */ +#define SPI_CSR0_BITS_11_BPT (0x3u << 4) /**< \brief (SPI_CSR0) 11 bits per transfer */ +#define SPI_CSR_BITS_11_BPT (0x3u << 4) /**< \brief (Unified SPI_CSR) 11 bits per transfer */ +#define SPI_CSR0_BITS_12_BPT (0x4u << 4) /**< \brief (SPI_CSR0) 12 bits per transfer */ +#define SPI_CSR_BITS_12_BPT (0x4u << 4) /**< \brief (Unified SPI_CSR) 12 bits per transfer */ +#define SPI_CSR0_BITS_13_BPT (0x5u << 4) /**< \brief (SPI_CSR0) 13 bits per transfer */ +#define SPI_CSR_BITS_13_BPT (0x5u << 4) /**< \brief (Unified SPI_CSR) 13 bits per transfer */ +#define SPI_CSR0_BITS_14_BPT (0x6u << 4) /**< \brief (SPI_CSR0) 14 bits per transfer */ +#define SPI_CSR_BITS_14_BPT (0x6u << 4) /**< \brief (Unified SPI_CSR) 14 bits per transfer */ +#define SPI_CSR0_BITS_15_BPT (0x7u << 4) /**< \brief (SPI_CSR0) 15 bits per transfer */ +#define SPI_CSR_BITS_15_BPT (0x7u << 4) /**< \brief (Unified SPI_CSR) 15 bits per transfer */ +#define SPI_CSR0_BITS_16_BPT (0x8u << 4) /**< \brief (SPI_CSR0) 16 bits per transfer */ +#define SPI_CSR_BITS_16_BPT (0x8u << 4) /**< \brief (Unified SPI_CSR) 16 bits per transfer */ +#define SPI_CSR0_SCBR_Pos 8 +#define SPI_CSR0_SCBR_Msk (0xFFu << SPI_CSR0_SCBR_Pos) /**< \brief (SPI_CSR0) Serial Clock Baud Rate */ +#define SPI_CSR0_SCBR(value) ((SPI_CSR0_SCBR_Msk & ((value) << SPI_CSR0_SCBR_Pos))) +#define SPI_CSR_SCBR_Pos 8 +#define SPI_CSR_SCBR_Msk (0xFFu << SPI_CSR0_SCBR_Pos) /**< \brief (SPI_CSR0) Serial Clock Baud Rate */ +#define SPI_CSR_SCBR(value) ((SPI_CSR_SCBR_Msk & ((value) << SPI_CSR_SCBR_Pos))) +#define SPI_CSR0_DLYBS_Pos 16 +#define SPI_CSR0_DLYBS_Msk (0xFFu << SPI_CSR0_DLYBS_Pos) /**< \brief (SPI_CSR0) Delay Before SPCK */ +#define SPI_CSR0_DLYBS(value) ((SPI_CSR0_DLYBS_Msk & ((value) << SPI_CSR0_DLYBS_Pos))) +#define SPI_CSR_DLYBS_Pos 16 +#define SPI_CSR_DLYBS_Msk (0xFFu << SPI_CSR0_DLYBS_Pos) /**< \brief (SPI_CSR0) Delay Before SPCK */ +#define SPI_CSR_DLYBS(value) ((SPI_CSR_DLYBS_Msk & ((value) << SPI_CSR_DLYBS_Pos))) +#define SPI_CSR0_DLYBCT_Pos 24 +#define SPI_CSR0_DLYBCT_Msk (0xFFu << SPI_CSR0_DLYBCT_Pos) /**< \brief (SPI_CSR0) Delay Between Consecutive Transfers */ +#define SPI_CSR0_DLYBCT(value) ((SPI_CSR0_DLYBCT_Msk & ((value) << SPI_CSR0_DLYBCT_Pos))) +#define SPI_CSR_DLYBCT_Pos 24 +#define SPI_CSR_DLYBCT_Msk (0xFFu << SPI_CSR0_DLYBCT_Pos) /**< \brief (SPI_CSR0) Delay Between Consecutive Transfers */ +#define SPI_CSR_DLYBCT(value) ((SPI_CSR_DLYBCT_Msk & ((value) << SPI_CSR_DLYBCT_Pos))) +/* -------- SPI_CSR1 : (SPI Offset: 0x34) Chip Select Register 1 -------- */ +#define SPI_CSR1_CPOL (0x1u << 0) /**< \brief (SPI_CSR1) Clock Polarity */ +#define SPI_CSR1_CPOL_0 (0x0u << 0) /**< \brief (SPI_CSR1) The inactive state value of SPCK is logic level zero. */ +#define SPI_CSR1_CPOL_1 (0x1u << 0) /**< \brief (SPI_CSR1) The inactive state value of SPCK is logic level one.CPOL is used to determine the inactive state value of the serial clock (SPCK). It is used with NCPHA to produce therequired clock/data relationship between master and slave devices. */ +#define SPI_CSR1_NCPHA (0x1u << 1) /**< \brief (SPI_CSR1) Clock Phase */ +#define SPI_CSR1_NCPHA_0 (0x0u << 1) /**< \brief (SPI_CSR1) Data is changed on the leading edge of SPCK and captured on the following edge of SPCK. */ +#define SPI_CSR1_NCPHA_1 (0x1u << 1) /**< \brief (SPI_CSR1) Data is captured on the leading edge of SPCK and changed on the following edge of SPCK.NCPHA determines which edge of SPCK causes data to change and which edge causes data to be captured. NCPHA isused with CPOL to produce the required clock/data relationship between master and slave devices. */ +#define SPI_CSR1_CSNAAT (0x1u << 2) /**< \brief (SPI_CSR1) Chip Select Not Active After Transfer */ +#define SPI_CSR1_CSAAT (0x1u << 3) /**< \brief (SPI_CSR1) Chip Select Active After Transfer */ +#define SPI_CSR1_CSAAT_0 (0x0u << 3) /**< \brief (SPI_CSR1) The Peripheral Chip Select Line rises as soon as the last transfer is achieved. */ +#define SPI_CSR1_CSAAT_1 (0x1u << 3) /**< \brief (SPI_CSR1) The Peripheral Chip Select does not rise after the last transfer is achieved. It remains active until a new transfer isrequested on a different chip select. */ +#define SPI_CSR1_BITS_Pos 4 +#define SPI_CSR1_BITS_Msk (0xFu << SPI_CSR1_BITS_Pos) /**< \brief (SPI_CSR1) Bits Per Transfer */ +#define SPI_CSR1_BITS(value) ((SPI_CSR1_BITS_Msk & ((value) << SPI_CSR1_BITS_Pos))) +#define SPI_CSR1_BITS_8_BPT (0x0u << 4) /**< \brief (SPI_CSR1) 8 bits per transfer */ +#define SPI_CSR1_BITS_9_BPT (0x1u << 4) /**< \brief (SPI_CSR1) 9 bits per transfer */ +#define SPI_CSR1_BITS_10_BPT (0x2u << 4) /**< \brief (SPI_CSR1) 10 bits per transfer */ +#define SPI_CSR1_BITS_11_BPT (0x3u << 4) /**< \brief (SPI_CSR1) 11 bits per transfer */ +#define SPI_CSR1_BITS_12_BPT (0x4u << 4) /**< \brief (SPI_CSR1) 12 bits per transfer */ +#define SPI_CSR1_BITS_13_BPT (0x5u << 4) /**< \brief (SPI_CSR1) 13 bits per transfer */ +#define SPI_CSR1_BITS_14_BPT (0x6u << 4) /**< \brief (SPI_CSR1) 14 bits per transfer */ +#define SPI_CSR1_BITS_15_BPT (0x7u << 4) /**< \brief (SPI_CSR1) 15 bits per transfer */ +#define SPI_CSR1_BITS_16_BPT (0x8u << 4) /**< \brief (SPI_CSR1) 16 bits per transfer */ +#define SPI_CSR1_SCBR_Pos 8 +#define SPI_CSR1_SCBR_Msk (0xFFu << SPI_CSR1_SCBR_Pos) /**< \brief (SPI_CSR1) Serial Clock Baud Rate */ +#define SPI_CSR1_SCBR(value) ((SPI_CSR1_SCBR_Msk & ((value) << SPI_CSR1_SCBR_Pos))) +#define SPI_CSR1_DLYBS_Pos 16 +#define SPI_CSR1_DLYBS_Msk (0xFFu << SPI_CSR1_DLYBS_Pos) /**< \brief (SPI_CSR1) Delay Before SPCK */ +#define SPI_CSR1_DLYBS(value) ((SPI_CSR1_DLYBS_Msk & ((value) << SPI_CSR1_DLYBS_Pos))) +#define SPI_CSR1_DLYBCT_Pos 24 +#define SPI_CSR1_DLYBCT_Msk (0xFFu << SPI_CSR1_DLYBCT_Pos) /**< \brief (SPI_CSR1) Delay Between Consecutive Transfers */ +#define SPI_CSR1_DLYBCT(value) ((SPI_CSR1_DLYBCT_Msk & ((value) << SPI_CSR1_DLYBCT_Pos))) +/* -------- SPI_CSR2 : (SPI Offset: 0x38) Chip Select Register 2 -------- */ +#define SPI_CSR2_CPOL (0x1u << 0) /**< \brief (SPI_CSR2) Clock Polarity */ +#define SPI_CSR2_CPOL_0 (0x0u << 0) /**< \brief (SPI_CSR2) The inactive state value of SPCK is logic level zero. */ +#define SPI_CSR2_CPOL_1 (0x1u << 0) /**< \brief (SPI_CSR2) The inactive state value of SPCK is logic level one.CPOL is used to determine the inactive state value of the serial clock (SPCK). It is used with NCPHA to produce therequired clock/data relationship between master and slave devices. */ +#define SPI_CSR2_NCPHA (0x1u << 1) /**< \brief (SPI_CSR2) Clock Phase */ +#define SPI_CSR2_NCPHA_0 (0x0u << 1) /**< \brief (SPI_CSR2) Data is changed on the leading edge of SPCK and captured on the following edge of SPCK. */ +#define SPI_CSR2_NCPHA_1 (0x1u << 1) /**< \brief (SPI_CSR2) Data is captured on the leading edge of SPCK and changed on the following edge of SPCK.NCPHA determines which edge of SPCK causes data to change and which edge causes data to be captured. NCPHA isused with CPOL to produce the required clock/data relationship between master and slave devices. */ +#define SPI_CSR2_CSNAAT (0x1u << 2) /**< \brief (SPI_CSR2) Chip Select Not Active After Transfer */ +#define SPI_CSR2_CSAAT (0x1u << 3) /**< \brief (SPI_CSR2) Chip Select Active After Transfer */ +#define SPI_CSR2_CSAAT_0 (0x0u << 3) /**< \brief (SPI_CSR2) The Peripheral Chip Select Line rises as soon as the last transfer is achieved. */ +#define SPI_CSR2_CSAAT_1 (0x1u << 3) /**< \brief (SPI_CSR2) The Peripheral Chip Select does not rise after the last transfer is achieved. It remains active until a new transfer isrequested on a different chip select. */ +#define SPI_CSR2_BITS_Pos 4 +#define SPI_CSR2_BITS_Msk (0xFu << SPI_CSR2_BITS_Pos) /**< \brief (SPI_CSR2) Bits Per Transfer */ +#define SPI_CSR2_BITS(value) ((SPI_CSR2_BITS_Msk & ((value) << SPI_CSR2_BITS_Pos))) +#define SPI_CSR2_BITS_8_BPT (0x0u << 4) /**< \brief (SPI_CSR2) 8 bits per transfer */ +#define SPI_CSR2_BITS_9_BPT (0x1u << 4) /**< \brief (SPI_CSR2) 9 bits per transfer */ +#define SPI_CSR2_BITS_10_BPT (0x2u << 4) /**< \brief (SPI_CSR2) 10 bits per transfer */ +#define SPI_CSR2_BITS_11_BPT (0x3u << 4) /**< \brief (SPI_CSR2) 11 bits per transfer */ +#define SPI_CSR2_BITS_12_BPT (0x4u << 4) /**< \brief (SPI_CSR2) 12 bits per transfer */ +#define SPI_CSR2_BITS_13_BPT (0x5u << 4) /**< \brief (SPI_CSR2) 13 bits per transfer */ +#define SPI_CSR2_BITS_14_BPT (0x6u << 4) /**< \brief (SPI_CSR2) 14 bits per transfer */ +#define SPI_CSR2_BITS_15_BPT (0x7u << 4) /**< \brief (SPI_CSR2) 15 bits per transfer */ +#define SPI_CSR2_BITS_16_BPT (0x8u << 4) /**< \brief (SPI_CSR2) 16 bits per transfer */ +#define SPI_CSR2_SCBR_Pos 8 +#define SPI_CSR2_SCBR_Msk (0xFFu << SPI_CSR2_SCBR_Pos) /**< \brief (SPI_CSR2) Serial Clock Baud Rate */ +#define SPI_CSR2_SCBR(value) ((SPI_CSR2_SCBR_Msk & ((value) << SPI_CSR2_SCBR_Pos))) +#define SPI_CSR2_DLYBS_Pos 16 +#define SPI_CSR2_DLYBS_Msk (0xFFu << SPI_CSR2_DLYBS_Pos) /**< \brief (SPI_CSR2) Delay Before SPCK */ +#define SPI_CSR2_DLYBS(value) ((SPI_CSR2_DLYBS_Msk & ((value) << SPI_CSR2_DLYBS_Pos))) +#define SPI_CSR2_DLYBCT_Pos 24 +#define SPI_CSR2_DLYBCT_Msk (0xFFu << SPI_CSR2_DLYBCT_Pos) /**< \brief (SPI_CSR2) Delay Between Consecutive Transfers */ +#define SPI_CSR2_DLYBCT(value) ((SPI_CSR2_DLYBCT_Msk & ((value) << SPI_CSR2_DLYBCT_Pos))) +/* -------- SPI_CSR3 : (SPI Offset: 0x3C) Chip Select Register 3 -------- */ +#define SPI_CSR3_CPOL (0x1u << 0) /**< \brief (SPI_CSR3) Clock Polarity */ +#define SPI_CSR3_CPOL_0 (0x0u << 0) /**< \brief (SPI_CSR3) The inactive state value of SPCK is logic level zero. */ +#define SPI_CSR3_CPOL_1 (0x1u << 0) /**< \brief (SPI_CSR3) The inactive state value of SPCK is logic level one.CPOL is used to determine the inactive state value of the serial clock (SPCK). It is used with NCPHA to produce therequired clock/data relationship between master and slave devices. */ +#define SPI_CSR3_NCPHA (0x1u << 1) /**< \brief (SPI_CSR3) Clock Phase */ +#define SPI_CSR3_NCPHA_0 (0x0u << 1) /**< \brief (SPI_CSR3) Data is changed on the leading edge of SPCK and captured on the following edge of SPCK. */ +#define SPI_CSR3_NCPHA_1 (0x1u << 1) /**< \brief (SPI_CSR3) Data is captured on the leading edge of SPCK and changed on the following edge of SPCK.NCPHA determines which edge of SPCK causes data to change and which edge causes data to be captured. NCPHA isused with CPOL to produce the required clock/data relationship between master and slave devices. */ +#define SPI_CSR3_CSNAAT (0x1u << 2) /**< \brief (SPI_CSR3) Chip Select Not Active After Transfer */ +#define SPI_CSR3_CSAAT (0x1u << 3) /**< \brief (SPI_CSR3) Chip Select Active After Transfer */ +#define SPI_CSR3_CSAAT_0 (0x0u << 3) /**< \brief (SPI_CSR3) The Peripheral Chip Select Line rises as soon as the last transfer is achieved. */ +#define SPI_CSR3_CSAAT_1 (0x1u << 3) /**< \brief (SPI_CSR3) The Peripheral Chip Select does not rise after the last transfer is achieved. It remains active until a new transfer isrequested on a different chip select. */ +#define SPI_CSR3_BITS_Pos 4 +#define SPI_CSR3_BITS_Msk (0xFu << SPI_CSR3_BITS_Pos) /**< \brief (SPI_CSR3) Bits Per Transfer */ +#define SPI_CSR3_BITS(value) ((SPI_CSR3_BITS_Msk & ((value) << SPI_CSR3_BITS_Pos))) +#define SPI_CSR3_BITS_8_BPT (0x0u << 4) /**< \brief (SPI_CSR3) 8 bits per transfer */ +#define SPI_CSR3_BITS_9_BPT (0x1u << 4) /**< \brief (SPI_CSR3) 9 bits per transfer */ +#define SPI_CSR3_BITS_10_BPT (0x2u << 4) /**< \brief (SPI_CSR3) 10 bits per transfer */ +#define SPI_CSR3_BITS_11_BPT (0x3u << 4) /**< \brief (SPI_CSR3) 11 bits per transfer */ +#define SPI_CSR3_BITS_12_BPT (0x4u << 4) /**< \brief (SPI_CSR3) 12 bits per transfer */ +#define SPI_CSR3_BITS_13_BPT (0x5u << 4) /**< \brief (SPI_CSR3) 13 bits per transfer */ +#define SPI_CSR3_BITS_14_BPT (0x6u << 4) /**< \brief (SPI_CSR3) 14 bits per transfer */ +#define SPI_CSR3_BITS_15_BPT (0x7u << 4) /**< \brief (SPI_CSR3) 15 bits per transfer */ +#define SPI_CSR3_BITS_16_BPT (0x8u << 4) /**< \brief (SPI_CSR3) 16 bits per transfer */ +#define SPI_CSR3_SCBR_Pos 8 +#define SPI_CSR3_SCBR_Msk (0xFFu << SPI_CSR3_SCBR_Pos) /**< \brief (SPI_CSR3) Serial Clock Baud Rate */ +#define SPI_CSR3_SCBR(value) ((SPI_CSR3_SCBR_Msk & ((value) << SPI_CSR3_SCBR_Pos))) +#define SPI_CSR3_DLYBS_Pos 16 +#define SPI_CSR3_DLYBS_Msk (0xFFu << SPI_CSR3_DLYBS_Pos) /**< \brief (SPI_CSR3) Delay Before SPCK */ +#define SPI_CSR3_DLYBS(value) ((SPI_CSR3_DLYBS_Msk & ((value) << SPI_CSR3_DLYBS_Pos))) +#define SPI_CSR3_DLYBCT_Pos 24 +#define SPI_CSR3_DLYBCT_Msk (0xFFu << SPI_CSR3_DLYBCT_Pos) /**< \brief (SPI_CSR3) Delay Between Consecutive Transfers */ +#define SPI_CSR3_DLYBCT(value) ((SPI_CSR3_DLYBCT_Msk & ((value) << SPI_CSR3_DLYBCT_Pos))) +/* -------- SPI_WPCR : (SPI Offset: 0xE4) Write Protection control Register -------- */ +#define SPI_WPCR_SPIWPEN (0x1u << 0) /**< \brief (SPI_WPCR) SPI write Protection Enable */ +#define SPI_WPCR_SPIWPKEY_Pos 8 +#define SPI_WPCR_SPIWPKEY_Msk (0xFFFFFFu << SPI_WPCR_SPIWPKEY_Pos) /**< \brief (SPI_WPCR) SPI write Protection Key Password */ +#define SPI_WPCR_SPIWPKEY(value) ((SPI_WPCR_SPIWPKEY_Msk & ((value) << SPI_WPCR_SPIWPKEY_Pos))) +#define SPI_WPCR_SPIWPKEY_VALUE (0x535049u << 8) /**< \brief (SPI_WPCR) SPI Write Protection Key Password */ +/* -------- SPI_WPSR : (SPI Offset: 0xE8) Write Protection status Register -------- */ +#define SPI_WPSR_SPIWPVS_Pos 0 +#define SPI_WPSR_SPIWPVS_Msk (0x7u << SPI_WPSR_SPIWPVS_Pos) /**< \brief (SPI_WPSR) SPI write protection Violation Status */ +#define SPI_WPSR_SPIWPVS(value) ((SPI_WPSR_SPIWPVS_Msk & ((value) << SPI_WPSR_SPIWPVS_Pos))) +#define SPI_WPSR_SPIWPVS_WRITE_WITH_WP (0x1u << 0) /**< \brief (SPI_WPSR) The Write Protection has blocked a Write access to a protected register (since the last read). */ +#define SPI_WPSR_SPIWPVS_SWRST_WITH_WP (0x2u << 0) /**< \brief (SPI_WPSR) Software Reset has been performed while Write Protection was enabled (since the last read or since the last write access on MR, IER, IDR or CSRx). */ +#define SPI_WPSR_SPIWPVS_UNEXPECTED_WRITE (0x4u << 0) /**< \brief (SPI_WPSR) Write accesses have been detected on MR (while a chip select was active) or on CSRi (while the Chip Select “i” was active) since the last read. */ +#define SPI_WPSR_SPIWPVSRC_Pos 8 +#define SPI_WPSR_SPIWPVSRC_Msk (0xFFu << SPI_WPSR_SPIWPVSRC_Pos) /**< \brief (SPI_WPSR) SPI write Protection Violation source */ +#define SPI_WPSR_SPIWPVSRC(value) ((SPI_WPSR_SPIWPVSRC_Msk & ((value) << SPI_WPSR_SPIWPVSRC_Pos))) +/* -------- SPI_FEATURES : (SPI Offset: 0xF8) Features Register -------- */ +#define SPI_FEATURES_NCS_Pos 0 +#define SPI_FEATURES_NCS_Msk (0xFu << SPI_FEATURES_NCS_Pos) /**< \brief (SPI_FEATURES) Number of Chip Selects */ +#define SPI_FEATURES_NCS(value) ((SPI_FEATURES_NCS_Msk & ((value) << SPI_FEATURES_NCS_Pos))) +#define SPI_FEATURES_PCONF (0x1u << 4) /**< \brief (SPI_FEATURES) Polarity is Configurable */ +#define SPI_FEATURES_PPNCONF (0x1u << 5) /**< \brief (SPI_FEATURES) Polarity is Positive if Polarity is not Configurable */ +#define SPI_FEATURES_PHCONF (0x1u << 6) /**< \brief (SPI_FEATURES) Phase is Configurable */ +#define SPI_FEATURES_PHZNCONF (0x1u << 7) /**< \brief (SPI_FEATURES) Phase is Zero if Phase is not Configurable */ +#define SPI_FEATURES_LENCONF (0x1u << 8) /**< \brief (SPI_FEATURES) Character Length is Configurable */ +#define SPI_FEATURES_LENNCONF_Pos 9 +#define SPI_FEATURES_LENNCONF_Msk (0x7Fu << SPI_FEATURES_LENNCONF_Pos) /**< \brief (SPI_FEATURES) Character Length if not Configurable */ +#define SPI_FEATURES_LENNCONF(value) ((SPI_FEATURES_LENNCONF_Msk & ((value) << SPI_FEATURES_LENNCONF_Pos))) +#define SPI_FEATURES_EXTDEC (0x1u << 16) /**< \brief (SPI_FEATURES) External Decoder is True */ +#define SPI_FEATURES_CSNAATIMPL (0x1u << 17) /**< \brief (SPI_FEATURES) CSNAAT Features are Implemented */ +#define SPI_FEATURES_BRPBHSB (0x1u << 18) /**< \brief (SPI_FEATURES) Bridge Type is PB to HSB */ +#define SPI_FEATURES_FIFORIMPL (0x1u << 19) /**< \brief (SPI_FEATURES) FIFO in Reception is Implemented */ +#define SPI_FEATURES_SWPIMPL (0x1u << 20) /**< \brief (SPI_FEATURES) Spurious Write Protection is Implemented */ +/* -------- SPI_VERSION : (SPI Offset: 0xFC) Version Register -------- */ +#define SPI_VERSION_VERSION_Pos 0 +#define SPI_VERSION_VERSION_Msk (0xFFFu << SPI_VERSION_VERSION_Pos) /**< \brief (SPI_VERSION) Version */ +#define SPI_VERSION_VERSION(value) ((SPI_VERSION_VERSION_Msk & ((value) << SPI_VERSION_VERSION_Pos))) +#define SPI_VERSION_MFN_Pos 16 +#define SPI_VERSION_MFN_Msk (0x7u << SPI_VERSION_MFN_Pos) /**< \brief (SPI_VERSION) mfn */ +#define SPI_VERSION_MFN(value) ((SPI_VERSION_MFN_Msk & ((value) << SPI_VERSION_MFN_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR TC */ +/* ============================================================================= */ +/** \addtogroup SAM4L_TC Timer/Counter */ +/*@{*/ + +#define REV_TC 0x402 + +#ifndef __ASSEMBLY__ +/** \brief TcChannel hardware registers */ +typedef struct { + WoReg TC_CCR; /**< \brief (TcChannel Offset: 0x00) Channel Control Register Channel 0 */ + RwReg TC_CMR; /**< \brief (TcChannel Offset: 0x04) Channel Mode Register Channel 0 */ + RwReg TC_SMC; /**< \brief (TcChannel Offset: 0x08) Stepper Motor Mode Register */ + RoReg Reserved1[1]; + RoReg TC_CV; /**< \brief (TcChannel Offset: 0x10) Counter Value Channel 0 */ + RwReg TC_RA; /**< \brief (TcChannel Offset: 0x14) Register A Channel 0 */ + RwReg TC_RB; /**< \brief (TcChannel Offset: 0x18) Register B Channel 0 */ + RwReg TC_RC; /**< \brief (TcChannel Offset: 0x1C) Register C Channel 0 */ + RoReg TC_SR; /**< \brief (TcChannel Offset: 0x20) Status Register Channel 0 */ + WoReg TC_IER; /**< \brief (TcChannel Offset: 0x24) Interrupt Enable Register Channel 0 */ + WoReg TC_IDR; /**< \brief (TcChannel Offset: 0x28) Interrupt Disable Register Channel 0 */ + RoReg TC_IMR; /**< \brief (TcChannel Offset: 0x2C) Interrupt Mask Register Channel 0 */ + RoReg Reserved2[4]; +} TcChannel; +/** \brief TC hardware registers */ +typedef struct { + TcChannel TC_CHANNEL[3]; /**< \brief (TC Offset: 0x00) TcChannel groups */ + WoReg TC_BCR; /**< \brief (TC Offset: 0xC0) TC Block Control Register */ + RwReg TC_BMR; /**< \brief (TC Offset: 0xC4) TC Block Mode Register */ + RoReg Reserved1[7]; + RwReg TC_WPMR; /**< \brief (TC Offset: 0xE4) Write Protect Mode Register */ + RoReg Reserved2[4]; + RoReg TC_FEATURES; /**< \brief (TC Offset: 0xF8) Features Register */ + RoReg TC_VERSION; /**< \brief (TC Offset: 0xFC) Version Register */ +} Tc; +#endif /* __ASSEMBLY__ */ +/* -------- TC_CCR : (TC Offset: 0x00) Channel Channel Control Register Channel 0 -------- */ +#define TC_CCR_CLKEN (0x1u << 0) /**< \brief (TC_CCR) Counter Clock Enable Command */ +#define TC_CCR_CLKEN_0 (0x0u << 0) /**< \brief (TC_CCR) No effect. */ +#define TC_CCR_CLKEN_1 (0x1u << 0) /**< \brief (TC_CCR) Enables the clock if CLKDIS is not 1. */ +#define TC_CCR_CLKDIS (0x1u << 1) /**< \brief (TC_CCR) Counter Clock Disable Command */ +#define TC_CCR_CLKDIS_0 (0x0u << 1) /**< \brief (TC_CCR) No effect. */ +#define TC_CCR_CLKDIS_1 (0x1u << 1) /**< \brief (TC_CCR) Disables the clock. */ +#define TC_CCR_SWTRG (0x1u << 2) /**< \brief (TC_CCR) Software Trigger Command */ +#define TC_CCR_SWTRG_0 (0x0u << 2) /**< \brief (TC_CCR) No effect. */ +#define TC_CCR_SWTRG_1 (0x1u << 2) /**< \brief (TC_CCR) A software trigger is performed:the counter is reset and clock is started. */ +/* -------- TC_CAPTURE_CMR : (TC Offset: 0x04) Channel Channel Mode Register Channel 0 -------- */ +#define TC_CAPTURE_CMR_TCCLKS_Pos 0 +#define TC_CAPTURE_CMR_TCCLKS_Msk (0x7u << TC_CAPTURE_CMR_TCCLKS_Pos) /**< \brief (TC_CAPTURE_CMR) Clock Selection */ +#define TC_CAPTURE_CMR_TCCLKS(value) ((TC_CAPTURE_CMR_TCCLKS_Msk & ((value) << TC_CAPTURE_CMR_TCCLKS_Pos))) +#define TC_CAPTURE_CMR_TCCLKS_TIMER_CLOCK1 (0x0u << 0) /**< \brief (TC_CAPTURE_CMR) TIMER_CLOCK1 */ +#define TC_CAPTURE_CMR_TCCLKS_TIMER_CLOCK2 (0x1u << 0) /**< \brief (TC_CAPTURE_CMR) TIMER_CLOCK2 */ +#define TC_CAPTURE_CMR_TCCLKS_TIMER_CLOCK3 (0x2u << 0) /**< \brief (TC_CAPTURE_CMR) TIMER_CLOCK3 */ +#define TC_CAPTURE_CMR_TCCLKS_TIMER_CLOCK4 (0x3u << 0) /**< \brief (TC_CAPTURE_CMR) TIMER_CLOCK4 */ +#define TC_CAPTURE_CMR_TCCLKS_TIMER_CLOCK5 (0x4u << 0) /**< \brief (TC_CAPTURE_CMR) TIMER_CLOCK5 */ +#define TC_CAPTURE_CMR_TCCLKS_XC0 (0x5u << 0) /**< \brief (TC_CAPTURE_CMR) XC0 */ +#define TC_CAPTURE_CMR_TCCLKS_XC1 (0x6u << 0) /**< \brief (TC_CAPTURE_CMR) XC1 */ +#define TC_CAPTURE_CMR_TCCLKS_XC2 (0x7u << 0) /**< \brief (TC_CAPTURE_CMR) XC2 */ +#define TC_CAPTURE_CMR_CLKI (0x1u << 3) /**< \brief (TC_CAPTURE_CMR) Clock Invert */ +#define TC_CAPTURE_CMR_CLKI_0 (0x0u << 3) /**< \brief (TC_CAPTURE_CMR) Counter is incremented on rising edge of the clock. */ +#define TC_CAPTURE_CMR_CLKI_1 (0x1u << 3) /**< \brief (TC_CAPTURE_CMR) Counter is incremented on falling edge of the clock. */ +#define TC_CAPTURE_CMR_BURST_Pos 4 +#define TC_CAPTURE_CMR_BURST_Msk (0x3u << TC_CAPTURE_CMR_BURST_Pos) /**< \brief (TC_CAPTURE_CMR) Burst Signal Selection */ +#define TC_CAPTURE_CMR_BURST(value) ((TC_CAPTURE_CMR_BURST_Msk & ((value) << TC_CAPTURE_CMR_BURST_Pos))) +#define TC_CAPTURE_CMR_BURST_NOT_GATED (0x0u << 4) /**< \brief (TC_CAPTURE_CMR) The clock is not gated by an external signal. */ +#define TC_CAPTURE_CMR_BURST_CLK_AND_XC0 (0x1u << 4) /**< \brief (TC_CAPTURE_CMR) XC0 is ANDed with the selected clock. */ +#define TC_CAPTURE_CMR_BURST_CLK_AND_XC1 (0x2u << 4) /**< \brief (TC_CAPTURE_CMR) XC1 is ANDed with the selected clock. */ +#define TC_CAPTURE_CMR_BURST_CLK_AND_XC2 (0x3u << 4) /**< \brief (TC_CAPTURE_CMR) XC2 is ANDed with the selected clock. */ +#define TC_CAPTURE_CMR_LDBSTOP (0x1u << 6) /**< \brief (TC_CAPTURE_CMR) Counter Clock Stopped with RB Loading */ +#define TC_CAPTURE_CMR_LDBSTOP_0 (0x0u << 6) /**< \brief (TC_CAPTURE_CMR) Counter clock is not stopped when RB loading occurs. */ +#define TC_CAPTURE_CMR_LDBSTOP_1 (0x1u << 6) /**< \brief (TC_CAPTURE_CMR) Counter clock is stopped when RB loading occurs. */ +#define TC_CAPTURE_CMR_LDBDIS (0x1u << 7) /**< \brief (TC_CAPTURE_CMR) Counter Clock Disable with RB Loading */ +#define TC_CAPTURE_CMR_LDBDIS_0 (0x0u << 7) /**< \brief (TC_CAPTURE_CMR) Counter clock is not disabled when RB loading occurs. */ +#define TC_CAPTURE_CMR_LDBDIS_1 (0x1u << 7) /**< \brief (TC_CAPTURE_CMR) Counter clock is disabled when RB loading occurs. */ +#define TC_CAPTURE_CMR_ETRGEDG_Pos 8 +#define TC_CAPTURE_CMR_ETRGEDG_Msk (0x3u << TC_CAPTURE_CMR_ETRGEDG_Pos) /**< \brief (TC_CAPTURE_CMR) External Trigger Edge Selection */ +#define TC_CAPTURE_CMR_ETRGEDG(value) ((TC_CAPTURE_CMR_ETRGEDG_Msk & ((value) << TC_CAPTURE_CMR_ETRGEDG_Pos))) +#define TC_CAPTURE_CMR_ETRGEDG_NO_EDGE (0x0u << 8) /**< \brief (TC_CAPTURE_CMR) none */ +#define TC_CAPTURE_CMR_ETRGEDG_POS_EDGE (0x1u << 8) /**< \brief (TC_CAPTURE_CMR) rising edge */ +#define TC_CAPTURE_CMR_ETRGEDG_NEG_EDGE (0x2u << 8) /**< \brief (TC_CAPTURE_CMR) falling edge */ +#define TC_CAPTURE_CMR_ETRGEDG_BOTH_EDGES (0x3u << 8) /**< \brief (TC_CAPTURE_CMR) each edge */ +#define TC_CAPTURE_CMR_ABETRG (0x1u << 10) /**< \brief (TC_CAPTURE_CMR) TIOA or TIOB External Trigger Selection */ +#define TC_CAPTURE_CMR_ABETRG_0 (0x0u << 10) /**< \brief (TC_CAPTURE_CMR) TIOB is used as an external trigger. */ +#define TC_CAPTURE_CMR_ABETRG_1 (0x1u << 10) /**< \brief (TC_CAPTURE_CMR) TIOA is used as an external trigger. */ +#define TC_CAPTURE_CMR_CPCTRG (0x1u << 14) /**< \brief (TC_CAPTURE_CMR) RC Compare Trigger Enable */ +#define TC_CAPTURE_CMR_CPCTRG_0 (0x0u << 14) /**< \brief (TC_CAPTURE_CMR) RC Compare has no effect on the counter and its clock. */ +#define TC_CAPTURE_CMR_CPCTRG_1 (0x1u << 14) /**< \brief (TC_CAPTURE_CMR) RC Compare resets the counter and starts the counter clock. */ +#define TC_CAPTURE_CMR_WAVE (0x1u << 15) /**< \brief (TC_CAPTURE_CMR) Wave */ +#define TC_CAPTURE_CMR_WAVE_0 (0x0u << 15) /**< \brief (TC_CAPTURE_CMR) Capture Mode is enabled. */ +#define TC_CAPTURE_CMR_WAVE_1 (0x1u << 15) /**< \brief (TC_CAPTURE_CMR) Capture Mode is disabled (Waveform Mode is enabled). */ +#define TC_CAPTURE_CMR_LDRA_Pos 16 +#define TC_CAPTURE_CMR_LDRA_Msk (0x3u << TC_CAPTURE_CMR_LDRA_Pos) /**< \brief (TC_CAPTURE_CMR) RA Loading Selection */ +#define TC_CAPTURE_CMR_LDRA(value) ((TC_CAPTURE_CMR_LDRA_Msk & ((value) << TC_CAPTURE_CMR_LDRA_Pos))) +#define TC_CAPTURE_CMR_LDRA_NO_EDGE (0x0u << 16) /**< \brief (TC_CAPTURE_CMR) none */ +#define TC_CAPTURE_CMR_LDRA_POS_EDGE_TIOA (0x1u << 16) /**< \brief (TC_CAPTURE_CMR) rising edge of TIOA */ +#define TC_CAPTURE_CMR_LDRA_NEG_EDGE_TIOA (0x2u << 16) /**< \brief (TC_CAPTURE_CMR) falling edge of TIOA */ +#define TC_CAPTURE_CMR_LDRA_BIOTH_EDGES_TIOA (0x3u << 16) /**< \brief (TC_CAPTURE_CMR) each edge of TIOA */ +#define TC_CAPTURE_CMR_LDRB_Pos 18 +#define TC_CAPTURE_CMR_LDRB_Msk (0x3u << TC_CAPTURE_CMR_LDRB_Pos) /**< \brief (TC_CAPTURE_CMR) RB Loading Selection */ +#define TC_CAPTURE_CMR_LDRB(value) ((TC_CAPTURE_CMR_LDRB_Msk & ((value) << TC_CAPTURE_CMR_LDRB_Pos))) +#define TC_CAPTURE_CMR_LDRB_NO_EDGE (0x0u << 18) /**< \brief (TC_CAPTURE_CMR) none */ +#define TC_CAPTURE_CMR_LDRB_POS_EDGE_TIOA (0x1u << 18) /**< \brief (TC_CAPTURE_CMR) rising edge of TIOA */ +#define TC_CAPTURE_CMR_LDRB_NEG_EDGE_TIOA (0x2u << 18) /**< \brief (TC_CAPTURE_CMR) falling edge of TIOA */ +#define TC_CAPTURE_CMR_LDRB_BIOTH_EDGES_TIOA (0x3u << 18) /**< \brief (TC_CAPTURE_CMR) each edge of TIOA */ +/* -------- TC_WAVEFORM_CMR : (TC Offset: 0x04) Channel Channel Mode Register Channel 0 -------- */ +#define TC_WAVEFORM_CMR_TCCLKS_Pos 0 +#define TC_WAVEFORM_CMR_TCCLKS_Msk (0x7u << TC_WAVEFORM_CMR_TCCLKS_Pos) /**< \brief (TC_WAVEFORM_CMR) Clock Selection */ +#define TC_WAVEFORM_CMR_TCCLKS(value) ((TC_WAVEFORM_CMR_TCCLKS_Msk & ((value) << TC_WAVEFORM_CMR_TCCLKS_Pos))) +#define TC_WAVEFORM_CMR_TCCLKS_TIMER_DIV1_CLOCK (0x0u << 0) /**< \brief (TC_WAVEFORM_CMR) TIMER_DIV1_CLOCK */ +#define TC_WAVEFORM_CMR_TCCLKS_TIMER_DIV2_CLOCK (0x1u << 0) /**< \brief (TC_WAVEFORM_CMR) TIMER_DIV2_CLOCK */ +#define TC_WAVEFORM_CMR_TCCLKS_TIMER_DIV3_CLOCK (0x2u << 0) /**< \brief (TC_WAVEFORM_CMR) TIMER_DIV3_CLOCK */ +#define TC_WAVEFORM_CMR_TCCLKS_TIMER_DIV4_CLOCK (0x3u << 0) /**< \brief (TC_WAVEFORM_CMR) TIMER_DIV4_CLOCK */ +#define TC_WAVEFORM_CMR_TCCLKS_TIMER_DIV5_CLOCK (0x4u << 0) /**< \brief (TC_WAVEFORM_CMR) TIMER_DIV5_CLOCK */ +#define TC_WAVEFORM_CMR_TCCLKS_XC0 (0x5u << 0) /**< \brief (TC_WAVEFORM_CMR) XC0 */ +#define TC_WAVEFORM_CMR_TCCLKS_XC1 (0x6u << 0) /**< \brief (TC_WAVEFORM_CMR) XC1 */ +#define TC_WAVEFORM_CMR_TCCLKS_XC2 (0x7u << 0) /**< \brief (TC_WAVEFORM_CMR) XC2 */ +#define TC_WAVEFORM_CMR_CLKI (0x1u << 3) /**< \brief (TC_WAVEFORM_CMR) Clock Invert */ +#define TC_WAVEFORM_CMR_CLKI_0 (0x0u << 3) /**< \brief (TC_WAVEFORM_CMR) Counter is incremented on rising edge of the clock. */ +#define TC_WAVEFORM_CMR_CLKI_1 (0x1u << 3) /**< \brief (TC_WAVEFORM_CMR) Counter is incremented on falling edge of the clock. */ +#define TC_WAVEFORM_CMR_BURST_Pos 4 +#define TC_WAVEFORM_CMR_BURST_Msk (0x3u << TC_WAVEFORM_CMR_BURST_Pos) /**< \brief (TC_WAVEFORM_CMR) Burst Signal Selection */ +#define TC_WAVEFORM_CMR_BURST(value) ((TC_WAVEFORM_CMR_BURST_Msk & ((value) << TC_WAVEFORM_CMR_BURST_Pos))) +#define TC_WAVEFORM_CMR_BURST_NOT_GATED (0x0u << 4) /**< \brief (TC_WAVEFORM_CMR) The clock is not gated by an external signal. */ +#define TC_WAVEFORM_CMR_BURST_CLK_AND_XC0 (0x1u << 4) /**< \brief (TC_WAVEFORM_CMR) XC0 is ANDed with the selected clock. */ +#define TC_WAVEFORM_CMR_BURST_CLK_AND_XC1 (0x2u << 4) /**< \brief (TC_WAVEFORM_CMR) XC1 is ANDed with the selected clock. */ +#define TC_WAVEFORM_CMR_BURST_CLK_AND_XC2 (0x3u << 4) /**< \brief (TC_WAVEFORM_CMR) XC2 is ANDed with the selected clock. */ +#define TC_WAVEFORM_CMR_CPCSTOP (0x1u << 6) /**< \brief (TC_WAVEFORM_CMR) Counter Clock Stopped with RC Compare */ +#define TC_WAVEFORM_CMR_CPCSTOP_0 (0x0u << 6) /**< \brief (TC_WAVEFORM_CMR) Counter clock is not stopped when counter reaches RC. */ +#define TC_WAVEFORM_CMR_CPCSTOP_1 (0x1u << 6) /**< \brief (TC_WAVEFORM_CMR) Counter clock is stopped when counter reaches RC. */ +#define TC_WAVEFORM_CMR_CPCDIS (0x1u << 7) /**< \brief (TC_WAVEFORM_CMR) Counter Clock Disable with RC Compare */ +#define TC_WAVEFORM_CMR_CPCDIS_0 (0x0u << 7) /**< \brief (TC_WAVEFORM_CMR) Counter clock is not disabled when counter reaches RC. */ +#define TC_WAVEFORM_CMR_CPCDIS_1 (0x1u << 7) /**< \brief (TC_WAVEFORM_CMR) Counter clock is disabled when counter reaches RC. */ +#define TC_WAVEFORM_CMR_EEVTEDG_Pos 8 +#define TC_WAVEFORM_CMR_EEVTEDG_Msk (0x3u << TC_WAVEFORM_CMR_EEVTEDG_Pos) /**< \brief (TC_WAVEFORM_CMR) External Event Edge Selection */ +#define TC_WAVEFORM_CMR_EEVTEDG(value) ((TC_WAVEFORM_CMR_EEVTEDG_Msk & ((value) << TC_WAVEFORM_CMR_EEVTEDG_Pos))) +#define TC_WAVEFORM_CMR_EEVTEDG_NO_EDGE (0x0u << 8) /**< \brief (TC_WAVEFORM_CMR) none */ +#define TC_WAVEFORM_CMR_EEVTEDG_POS_EDGE (0x1u << 8) /**< \brief (TC_WAVEFORM_CMR) rising edge */ +#define TC_WAVEFORM_CMR_EEVTEDG_NEG_EDGE (0x2u << 8) /**< \brief (TC_WAVEFORM_CMR) falling edge */ +#define TC_WAVEFORM_CMR_EEVTEDG_BOTH_EDGES (0x3u << 8) /**< \brief (TC_WAVEFORM_CMR) each edge */ +#define TC_WAVEFORM_CMR_EEVT_Pos 10 +#define TC_WAVEFORM_CMR_EEVT_Msk (0x3u << TC_WAVEFORM_CMR_EEVT_Pos) /**< \brief (TC_WAVEFORM_CMR) External Event Selection */ +#define TC_WAVEFORM_CMR_EEVT(value) ((TC_WAVEFORM_CMR_EEVT_Msk & ((value) << TC_WAVEFORM_CMR_EEVT_Pos))) +#define TC_WAVEFORM_CMR_EEVT_TIOB_INPUT (0x0u << 10) /**< \brief (TC_WAVEFORM_CMR) TIOB input. If TIOB is chosen as the external event signal, it is configured as an input and no longer generates waveforms. */ +#define TC_WAVEFORM_CMR_EEVT_XC0_OUTPUT (0x1u << 10) /**< \brief (TC_WAVEFORM_CMR) XC0 output */ +#define TC_WAVEFORM_CMR_EEVT_XC1_OUTPUT (0x2u << 10) /**< \brief (TC_WAVEFORM_CMR) XC1 output */ +#define TC_WAVEFORM_CMR_EEVT_XC2_OUTPUT (0x3u << 10) /**< \brief (TC_WAVEFORM_CMR) XC2 output */ +#define TC_WAVEFORM_CMR_ENETRG (0x1u << 12) /**< \brief (TC_WAVEFORM_CMR) External Event Trigger Enable */ +#define TC_WAVEFORM_CMR_ENETRG_0 (0x0u << 12) /**< \brief (TC_WAVEFORM_CMR) The external event has no effect on the counter and its clock. In this case, the selected external event only controls the TIOA output. */ +#define TC_WAVEFORM_CMR_ENETRG_1 (0x1u << 12) /**< \brief (TC_WAVEFORM_CMR) The external event resets the counter and starts the counter clock. */ +#define TC_WAVEFORM_CMR_WAVSEL_Pos 13 +#define TC_WAVEFORM_CMR_WAVSEL_Msk (0x3u << TC_WAVEFORM_CMR_WAVSEL_Pos) /**< \brief (TC_WAVEFORM_CMR) Waveform Selection */ +#define TC_WAVEFORM_CMR_WAVSEL(value) ((TC_WAVEFORM_CMR_WAVSEL_Msk & ((value) << TC_WAVEFORM_CMR_WAVSEL_Pos))) +#define TC_WAVEFORM_CMR_WAVSEL_UP_NO_AUTO (0x0u << 13) /**< \brief (TC_WAVEFORM_CMR) UP mode without automatic trigger on RC Compare */ +#define TC_WAVEFORM_CMR_WAVSEL_UPDOWN_NO_AUTO (0x1u << 13) /**< \brief (TC_WAVEFORM_CMR) UPDOWN mode without automatic trigger on RC Compare */ +#define TC_WAVEFORM_CMR_WAVSEL_UP_AUTO (0x2u << 13) /**< \brief (TC_WAVEFORM_CMR) UP mode with automatic trigger on RC Compare */ +#define TC_WAVEFORM_CMR_WAVSEL_UPDOWN_AUTO (0x3u << 13) /**< \brief (TC_WAVEFORM_CMR) UPDOWN mode with automatic trigger on RC Compare */ +#define TC_WAVEFORM_CMR_WAVE (0x1u << 15) /**< \brief (TC_WAVEFORM_CMR) WAVE */ +#define TC_WAVEFORM_CMR_WAVE_0 (0x0u << 15) /**< \brief (TC_WAVEFORM_CMR) Waveform Mode is disabled (Capture Mode is enabled). */ +#define TC_WAVEFORM_CMR_WAVE_1 (0x1u << 15) /**< \brief (TC_WAVEFORM_CMR) Waveform Mode is enabled. */ +#define TC_WAVEFORM_CMR_ACPA_Pos 16 +#define TC_WAVEFORM_CMR_ACPA_Msk (0x3u << TC_WAVEFORM_CMR_ACPA_Pos) /**< \brief (TC_WAVEFORM_CMR) RA Compare Effect on TIOA */ +#define TC_WAVEFORM_CMR_ACPA(value) ((TC_WAVEFORM_CMR_ACPA_Msk & ((value) << TC_WAVEFORM_CMR_ACPA_Pos))) +#define TC_WAVEFORM_CMR_ACPA_NONE (0x0u << 16) /**< \brief (TC_WAVEFORM_CMR) none */ +#define TC_WAVEFORM_CMR_ACPA_SET (0x1u << 16) /**< \brief (TC_WAVEFORM_CMR) set */ +#define TC_WAVEFORM_CMR_ACPA_CLEAR (0x2u << 16) /**< \brief (TC_WAVEFORM_CMR) clear */ +#define TC_WAVEFORM_CMR_ACPA_TOGGLE (0x3u << 16) /**< \brief (TC_WAVEFORM_CMR) toggle */ +#define TC_WAVEFORM_CMR_ACPC_Pos 18 +#define TC_WAVEFORM_CMR_ACPC_Msk (0x3u << TC_WAVEFORM_CMR_ACPC_Pos) /**< \brief (TC_WAVEFORM_CMR) RC Compare Effect on TIOA */ +#define TC_WAVEFORM_CMR_ACPC(value) ((TC_WAVEFORM_CMR_ACPC_Msk & ((value) << TC_WAVEFORM_CMR_ACPC_Pos))) +#define TC_WAVEFORM_CMR_ACPC_NONE (0x0u << 18) /**< \brief (TC_WAVEFORM_CMR) none */ +#define TC_WAVEFORM_CMR_ACPC_SET (0x1u << 18) /**< \brief (TC_WAVEFORM_CMR) set */ +#define TC_WAVEFORM_CMR_ACPC_CLEAR (0x2u << 18) /**< \brief (TC_WAVEFORM_CMR) clear */ +#define TC_WAVEFORM_CMR_ACPC_TOGGLE (0x3u << 18) /**< \brief (TC_WAVEFORM_CMR) toggle */ +#define TC_WAVEFORM_CMR_AEEVT_Pos 20 +#define TC_WAVEFORM_CMR_AEEVT_Msk (0x3u << TC_WAVEFORM_CMR_AEEVT_Pos) /**< \brief (TC_WAVEFORM_CMR) External Event Effect on TIOA */ +#define TC_WAVEFORM_CMR_AEEVT(value) ((TC_WAVEFORM_CMR_AEEVT_Msk & ((value) << TC_WAVEFORM_CMR_AEEVT_Pos))) +#define TC_WAVEFORM_CMR_AEEVT_NONE (0x0u << 20) /**< \brief (TC_WAVEFORM_CMR) none */ +#define TC_WAVEFORM_CMR_AEEVT_SET (0x1u << 20) /**< \brief (TC_WAVEFORM_CMR) set */ +#define TC_WAVEFORM_CMR_AEEVT_CLEAR (0x2u << 20) /**< \brief (TC_WAVEFORM_CMR) clear */ +#define TC_WAVEFORM_CMR_AEEVT_TOGGLE (0x3u << 20) /**< \brief (TC_WAVEFORM_CMR) toggle */ +#define TC_WAVEFORM_CMR_ASWTRG_Pos 22 +#define TC_WAVEFORM_CMR_ASWTRG_Msk (0x3u << TC_WAVEFORM_CMR_ASWTRG_Pos) /**< \brief (TC_WAVEFORM_CMR) Software Trigger Effect on TIOA */ +#define TC_WAVEFORM_CMR_ASWTRG(value) ((TC_WAVEFORM_CMR_ASWTRG_Msk & ((value) << TC_WAVEFORM_CMR_ASWTRG_Pos))) +#define TC_WAVEFORM_CMR_ASWTRG_NONE (0x0u << 22) /**< \brief (TC_WAVEFORM_CMR) none */ +#define TC_WAVEFORM_CMR_ASWTRG_SET (0x1u << 22) /**< \brief (TC_WAVEFORM_CMR) set */ +#define TC_WAVEFORM_CMR_ASWTRG_CLEAR (0x2u << 22) /**< \brief (TC_WAVEFORM_CMR) clear */ +#define TC_WAVEFORM_CMR_ASWTRG_TOGGLE (0x3u << 22) /**< \brief (TC_WAVEFORM_CMR) toggle */ +#define TC_WAVEFORM_CMR_BCPB_Pos 24 +#define TC_WAVEFORM_CMR_BCPB_Msk (0x3u << TC_WAVEFORM_CMR_BCPB_Pos) /**< \brief (TC_WAVEFORM_CMR) RB Compare Effect on TIOB */ +#define TC_WAVEFORM_CMR_BCPB(value) ((TC_WAVEFORM_CMR_BCPB_Msk & ((value) << TC_WAVEFORM_CMR_BCPB_Pos))) +#define TC_WAVEFORM_CMR_BCPB_NONE (0x0u << 24) /**< \brief (TC_WAVEFORM_CMR) none */ +#define TC_WAVEFORM_CMR_BCPB_SET (0x1u << 24) /**< \brief (TC_WAVEFORM_CMR) set */ +#define TC_WAVEFORM_CMR_BCPB_CLEAR (0x2u << 24) /**< \brief (TC_WAVEFORM_CMR) clear */ +#define TC_WAVEFORM_CMR_BCPB_TOGGLE (0x3u << 24) /**< \brief (TC_WAVEFORM_CMR) toggle */ +#define TC_WAVEFORM_CMR_BCPC_Pos 26 +#define TC_WAVEFORM_CMR_BCPC_Msk (0x3u << TC_WAVEFORM_CMR_BCPC_Pos) /**< \brief (TC_WAVEFORM_CMR) RC Compare Effect on TIOB */ +#define TC_WAVEFORM_CMR_BCPC(value) ((TC_WAVEFORM_CMR_BCPC_Msk & ((value) << TC_WAVEFORM_CMR_BCPC_Pos))) +#define TC_WAVEFORM_CMR_BCPC_NONE (0x0u << 26) /**< \brief (TC_WAVEFORM_CMR) none */ +#define TC_WAVEFORM_CMR_BCPC_SET (0x1u << 26) /**< \brief (TC_WAVEFORM_CMR) set */ +#define TC_WAVEFORM_CMR_BCPC_CLEAR (0x2u << 26) /**< \brief (TC_WAVEFORM_CMR) clear */ +#define TC_WAVEFORM_CMR_BCPC_TOGGLE (0x3u << 26) /**< \brief (TC_WAVEFORM_CMR) toggle */ +#define TC_WAVEFORM_CMR_BEEVT_Pos 28 +#define TC_WAVEFORM_CMR_BEEVT_Msk (0x3u << TC_WAVEFORM_CMR_BEEVT_Pos) /**< \brief (TC_WAVEFORM_CMR) External Event Effect on TIOB */ +#define TC_WAVEFORM_CMR_BEEVT(value) ((TC_WAVEFORM_CMR_BEEVT_Msk & ((value) << TC_WAVEFORM_CMR_BEEVT_Pos))) +#define TC_WAVEFORM_CMR_BEEVT_NONE (0x0u << 28) /**< \brief (TC_WAVEFORM_CMR) none */ +#define TC_WAVEFORM_CMR_BEEVT_SET (0x1u << 28) /**< \brief (TC_WAVEFORM_CMR) set */ +#define TC_WAVEFORM_CMR_BEEVT_CLEAR (0x2u << 28) /**< \brief (TC_WAVEFORM_CMR) clear */ +#define TC_WAVEFORM_CMR_BEEVT_TOGGLE (0x3u << 28) /**< \brief (TC_WAVEFORM_CMR) toggle */ +#define TC_WAVEFORM_CMR_BSWTRG_Pos 30 +#define TC_WAVEFORM_CMR_BSWTRG_Msk (0x3u << TC_WAVEFORM_CMR_BSWTRG_Pos) /**< \brief (TC_WAVEFORM_CMR) Software Trigger Effect on TIOB */ +#define TC_WAVEFORM_CMR_BSWTRG(value) ((TC_WAVEFORM_CMR_BSWTRG_Msk & ((value) << TC_WAVEFORM_CMR_BSWTRG_Pos))) +#define TC_WAVEFORM_CMR_BSWTRG_NONE (0x0u << 30) /**< \brief (TC_WAVEFORM_CMR) none */ +#define TC_WAVEFORM_CMR_BSWTRG_SET (0x1u << 30) /**< \brief (TC_WAVEFORM_CMR) set */ +#define TC_WAVEFORM_CMR_BSWTRG_CLEAR (0x2u << 30) /**< \brief (TC_WAVEFORM_CMR) clear */ +#define TC_WAVEFORM_CMR_BSWTRG_TOGGLE (0x3u << 30) /**< \brief (TC_WAVEFORM_CMR) toggle */ +/* -------- TC_CMR : (TC Offset: 0x04) Channel Channel Mode Register Channel 0 -------- */ +#define TC_CMR_TCCLKS_Pos 0 +#define TC_CMR_TCCLKS_Msk (0x7u << TC_CMR_TCCLKS_Pos) /**< \brief (TC_CMR) Clock Selection */ +#define TC_CMR_TCCLKS(value) ((TC_CMR_TCCLKS_Msk & ((value) << TC_CMR_TCCLKS_Pos))) +#define TC_CMR_TCCLKS_TIMER_CLOCK1 (0x0u << 0) /**< \brief (TC_CMR) TIMER_CLOCK1 */ +#define TC_CMR_TCCLKS_TIMER_CLOCK2 (0x1u << 0) /**< \brief (TC_CMR) TIMER_CLOCK2 */ +#define TC_CMR_TCCLKS_TIMER_CLOCK3 (0x2u << 0) /**< \brief (TC_CMR) TIMER_CLOCK3 */ +#define TC_CMR_TCCLKS_TIMER_CLOCK4 (0x3u << 0) /**< \brief (TC_CMR) TIMER_CLOCK4 */ +#define TC_CMR_TCCLKS_TIMER_CLOCK5 (0x4u << 0) /**< \brief (TC_CMR) TIMER_CLOCK5 */ +#define TC_CMR_TCCLKS_XC0 (0x5u << 0) /**< \brief (TC_CMR) XC0 */ +#define TC_CMR_TCCLKS_XC1 (0x6u << 0) /**< \brief (TC_CMR) XC1 */ +#define TC_CMR_TCCLKS_XC2 (0x7u << 0) /**< \brief (TC_CMR) XC2 */ +#define TC_CMR_TCCLKS_TIMER_DIV1_CLOCK (0x0u << 0) /**< \brief (TC_CMR) TIMER_DIV1_CLOCK */ +#define TC_CMR_TCCLKS_TIMER_DIV2_CLOCK (0x1u << 0) /**< \brief (TC_CMR) TIMER_DIV2_CLOCK */ +#define TC_CMR_TCCLKS_TIMER_DIV3_CLOCK (0x2u << 0) /**< \brief (TC_CMR) TIMER_DIV3_CLOCK */ +#define TC_CMR_TCCLKS_TIMER_DIV4_CLOCK (0x3u << 0) /**< \brief (TC_CMR) TIMER_DIV4_CLOCK */ +#define TC_CMR_TCCLKS_TIMER_DIV5_CLOCK (0x4u << 0) /**< \brief (TC_CMR) TIMER_DIV5_CLOCK */ +#define TC_CMR_CLKI (0x1u << 3) /**< \brief (TC_CMR) Clock Invert */ +#define TC_CMR_BURST_Pos 4 +#define TC_CMR_BURST_Msk (0x3u << TC_CMR_BURST_Pos) /**< \brief (TC_CMR) Burst Signal Selection */ +#define TC_CMR_BURST(value) ((TC_CMR_BURST_Msk & ((value) << TC_CMR_BURST_Pos))) +#define TC_CMR_BURST_NOT_GATED (0x0u << 4) /**< \brief (TC_CMR) The clock is not gated by an external signal. */ +#define TC_CMR_BURST_CLK_AND_XC0 (0x1u << 4) /**< \brief (TC_CMR) XC0 is ANDed with the selected clock. */ +#define TC_CMR_BURST_CLK_AND_XC1 (0x2u << 4) /**< \brief (TC_CMR) XC1 is ANDed with the selected clock. */ +#define TC_CMR_BURST_CLK_AND_XC2 (0x3u << 4) /**< \brief (TC_CMR) XC2 is ANDed with the selected clock. */ +#define TC_CMR_LDBSTOP (0x1u << 6) /**< \brief (TC_CMR) Counter Clock Stopped with RB Loading */ +#define TC_CMR_CPCSTOP (0x1u << 6) /**< \brief (TC_CMR) Counter Clock Stopped with RC Compare */ +#define TC_CMR_LDBDIS (0x1u << 7) /**< \brief (TC_CMR) Counter Clock Disable with RB Loading */ +#define TC_CMR_CPCDIS (0x1u << 7) /**< \brief (TC_CMR) Counter Clock Disable with RC Compare */ +#define TC_CMR_ETRGEDG_Pos 8 +#define TC_CMR_ETRGEDG_Msk (0x3u << TC_CMR_ETRGEDG_Pos) /**< \brief (TC_CMR) External Trigger Edge Selection */ +#define TC_CMR_ETRGEDG(value) ((TC_CMR_ETRGEDG_Msk & ((value) << TC_CMR_ETRGEDG_Pos))) +#define TC_CMR_ETRGEDG_NO_EDGE (0x0u << 8) /**< \brief (TC_CMR) none */ +#define TC_CMR_ETRGEDG_POS_EDGE (0x1u << 8) /**< \brief (TC_CMR) rising edge */ +#define TC_CMR_ETRGEDG_NEG_EDGE (0x2u << 8) /**< \brief (TC_CMR) falling edge */ +#define TC_CMR_ETRGEDG_BOTH_EDGES (0x3u << 8) /**< \brief (TC_CMR) each edge */ +#define TC_CMR_EEVTEDG_Pos 8 +#define TC_CMR_EEVTEDG_Msk (0x3u << TC_CMR_EEVTEDG_Pos) /**< \brief (TC_CMR) External Event Edge Selection */ +#define TC_CMR_EEVTEDG(value) ((TC_CMR_EEVTEDG_Msk & ((value) << TC_CMR_EEVTEDG_Pos))) +#define TC_CMR_EEVTEDG_NO_EDGE (0x0u << 8) /**< \brief (TC_CMR) none */ +#define TC_CMR_EEVTEDG_POS_EDGE (0x1u << 8) /**< \brief (TC_CMR) rising edge */ +#define TC_CMR_EEVTEDG_NEG_EDGE (0x2u << 8) /**< \brief (TC_CMR) falling edge */ +#define TC_CMR_EEVTEDG_BOTH_EDGES (0x3u << 8) /**< \brief (TC_CMR) each edge */ +#define TC_CMR_ABETRG (0x1u << 10) /**< \brief (TC_CMR) TIOA or TIOB External Trigger Selection */ +#define TC_CMR_EEVT_TIOB_INPUT (0x0u << 10) /**< \brief (TC_CMR) TIOB input. If TIOB is chosen as the external event signal, it is configured as an input and no longer generates waveforms. */ +#define TC_CMR_EEVT_XC0_OUTPUT (0x1u << 10) /**< \brief (TC_CMR) XC0 output */ +#define TC_CMR_EEVT_XC1_OUTPUT (0x2u << 10) /**< \brief (TC_CMR) XC1 output */ +#define TC_CMR_EEVT_XC2_OUTPUT (0x3u << 10) /**< \brief (TC_CMR) XC2 output */ +#define TC_CMR_ENETRG (0x1u << 12) /**< \brief (TC_CMR) External Event Trigger Enable */ +#define TC_CMR_WAVSEL_Pos 13 +#define TC_CMR_WAVSEL_Msk (0x3u << TC_CMR_WAVSEL_Pos) /**< \brief (TC_CMR) Waveform Selection */ +#define TC_CMR_WAVSEL(value) ((TC_CMR_WAVSEL_Msk & ((value) << TC_CMR_WAVSEL_Pos))) +#define TC_CMR_WAVSEL_UP_NO_AUTO (0x0u << 13) /**< \brief (TC_CMR) UP mode without automatic trigger on RC Compare */ +#define TC_CMR_WAVSEL_UPDOWN_NO_AUTO (0x1u << 13) /**< \brief (TC_CMR) UPDOWN mode without automatic trigger on RC Compare */ +#define TC_CMR_WAVSEL_UP_AUTO (0x2u << 13) /**< \brief (TC_CMR) UP mode with automatic trigger on RC Compare */ +#define TC_CMR_WAVSEL_UPDOWN_AUTO (0x3u << 13) /**< \brief (TC_CMR) UPDOWN mode with automatic trigger on RC Compare */ +#define TC_CMR_CPCTRG (0x1u << 14) /**< \brief (TC_CMR) RC Compare Trigger Enable */ +#define TC_CMR_ACPA_Pos 16 +#define TC_CMR_ACPA_Msk (0x3u << TC_CMR_ACPA_Pos) /**< \brief (TC_CMR) RA Compare Effect on TIOA */ +#define TC_CMR_ACPA(value) ((TC_CMR_ACPA_Msk & ((value) << TC_CMR_ACPA_Pos))) +#define TC_CMR_ACPA_NONE (0x0u << 16) /**< \brief (TC_CMR) none */ +#define TC_CMR_ACPA_SET (0x1u << 16) /**< \brief (TC_CMR) set */ +#define TC_CMR_ACPA_CLEAR (0x2u << 16) /**< \brief (TC_CMR) clear */ +#define TC_CMR_ACPA_TOGGLE (0x3u << 16) /**< \brief (TC_CMR) toggle */ +#define TC_CMR_WAVE (0x1u << 15) /**< \brief (TC_CMR) Wave */ +#define TC_CMR_LDRA_Pos 16 +#define TC_CMR_LDRA_Msk (0x3u << TC_CMR_LDRA_Pos) /**< \brief (TC_CMR) RA Loading Selection */ +#define TC_CMR_LDRA(value) ((TC_CMR_LDRA_Msk & ((value) << TC_CMR_LDRA_Pos))) +#define TC_CMR_LDRA_NO_EDGE (0x0u << 16) /**< \brief (TC_CMR) none */ +#define TC_CMR_LDRA_POS_EDGE_TIOA (0x1u << 16) /**< \brief (TC_CMR) rising edge of TIOA */ +#define TC_CMR_LDRA_NEG_EDGE_TIOA (0x2u << 16) /**< \brief (TC_CMR) falling edge of TIOA */ +#define TC_CMR_LDRA_BIOTH_EDGES_TIOA (0x3u << 16) /**< \brief (TC_CMR) each edge of TIOA */ +#define TC_CMR_ACPC_Pos 18 +#define TC_CMR_ACPC_Msk (0x3u << TC_CMR_ACPC_Pos) /**< \brief (TC_CMR) RC Compare Effect on TIOA */ +#define TC_CMR_ACPC(value) ((TC_CMR_ACPC_Msk & ((value) << TC_CMR_ACPC_Pos))) +#define TC_CMR_ACPC_NONE (0x0u << 18) /**< \brief (TC_CMR) none */ +#define TC_CMR_ACPC_SET (0x1u << 18) /**< \brief (TC_CMR) set */ +#define TC_CMR_ACPC_CLEAR (0x2u << 18) /**< \brief (TC_CMR) clear */ +#define TC_CMR_ACPC_TOGGLE (0x3u << 18) /**< \brief (TC_CMR) toggle */ +#define TC_CMR_LDRB_Pos 18 +#define TC_CMR_LDRB_Msk (0x3u << TC_CMR_LDRB_Pos) /**< \brief (TC_CMR) RB Loading Selection */ +#define TC_CMR_LDRB(value) ((TC_CMR_LDRB_Msk & ((value) << TC_CMR_LDRB_Pos))) +#define TC_CMR_LDRB_NO_EDGE (0x0u << 18) /**< \brief (TC_CMR) none */ +#define TC_CMR_LDRB_POS_EDGE_TIOA (0x1u << 18) /**< \brief (TC_CMR) rising edge of TIOA */ +#define TC_CMR_LDRB_NEG_EDGE_TIOA (0x2u << 18) /**< \brief (TC_CMR) falling edge of TIOA */ +#define TC_CMR_LDRB_BIOTH_EDGES_TIOA (0x3u << 18) /**< \brief (TC_CMR) each edge of TIOA */ +#define TC_CMR_AEEVT_Pos 20 +#define TC_CMR_AEEVT_Msk (0x3u << TC_CMR_AEEVT_Pos) /**< \brief (TC_CMR) External Event Effect on TIOA */ +#define TC_CMR_AEEVT(value) ((TC_CMR_AEEVT_Msk & ((value) << TC_CMR_AEEVT_Pos))) +#define TC_CMR_AEEVT_NONE (0x0u << 20) /**< \brief (TC_CMR) none */ +#define TC_CMR_AEEVT_SET (0x1u << 20) /**< \brief (TC_CMR) set */ +#define TC_CMR_AEEVT_CLEAR (0x2u << 20) /**< \brief (TC_CMR) clear */ +#define TC_CMR_AEEVT_TOGGLE (0x3u << 20) /**< \brief (TC_CMR) toggle */ +#define TC_CMR_ASWTRG_Pos 22 +#define TC_CMR_ASWTRG_Msk (0x3u << TC_CMR_ASWTRG_Pos) /**< \brief (TC_CMR) Software Trigger Effect on TIOA */ +#define TC_CMR_ASWTRG(value) ((TC_CMR_ASWTRG_Msk & ((value) << TC_CMR_ASWTRG_Pos))) +#define TC_CMR_ASWTRG_NONE (0x0u << 22) /**< \brief (TC_CMR) none */ +#define TC_CMR_ASWTRG_SET (0x1u << 22) /**< \brief (TC_CMR) set */ +#define TC_CMR_ASWTRG_CLEAR (0x2u << 22) /**< \brief (TC_CMR) clear */ +#define TC_CMR_ASWTRG_TOGGLE (0x3u << 22) /**< \brief (TC_CMR) toggle */ +#define TC_CMR_BCPB_Pos 24 +#define TC_CMR_BCPB_Msk (0x3u << TC_CMR_BCPB_Pos) /**< \brief (TC_CMR) RB Compare Effect on TIOB */ +#define TC_CMR_BCPB(value) ((TC_CMR_BCPB_Msk & ((value) << TC_CMR_BCPB_Pos))) +#define TC_CMR_BCPB_NONE (0x0u << 24) /**< \brief (TC_CMR) none */ +#define TC_CMR_BCPB_SET (0x1u << 24) /**< \brief (TC_CMR) set */ +#define TC_CMR_BCPB_CLEAR (0x2u << 24) /**< \brief (TC_CMR) clear */ +#define TC_CMR_BCPB_TOGGLE (0x3u << 24) /**< \brief (TC_CMR) toggle */ +#define TC_CMR_BCPC_Pos 26 +#define TC_CMR_BCPC_Msk (0x3u << TC_CMR_BCPC_Pos) /**< \brief (TC_CMR) RC Compare Effect on TIOB */ +#define TC_CMR_BCPC(value) ((TC_CMR_BCPC_Msk & ((value) << TC_CMR_BCPC_Pos))) +#define TC_CMR_BCPC_NONE (0x0u << 26) /**< \brief (TC_CMR) none */ +#define TC_CMR_BCPC_SET (0x1u << 26) /**< \brief (TC_CMR) set */ +#define TC_CMR_BCPC_CLEAR (0x2u << 26) /**< \brief (TC_CMR) clear */ +#define TC_CMR_BCPC_TOGGLE (0x3u << 26) /**< \brief (TC_CMR) toggle */ +#define TC_CMR_BEEVT_Pos 28 +#define TC_CMR_BEEVT_Msk (0x3u << TC_CMR_BEEVT_Pos) /**< \brief (TC_CMR) External Event Effect on TIOB */ +#define TC_CMR_BEEVT(value) ((TC_CMR_BEEVT_Msk & ((value) << TC_CMR_BEEVT_Pos))) +#define TC_CMR_BEEVT_NONE (0x0u << 28) /**< \brief (TC_CMR) none */ +#define TC_CMR_BEEVT_SET (0x1u << 28) /**< \brief (TC_CMR) set */ +#define TC_CMR_BEEVT_CLEAR (0x2u << 28) /**< \brief (TC_CMR) clear */ +#define TC_CMR_BEEVT_TOGGLE (0x3u << 28) /**< \brief (TC_CMR) toggle */ +#define TC_CMR_BSWTRG_Pos 30 +#define TC_CMR_BSWTRG_Msk (0x3u << TC_CMR_BSWTRG_Pos) /**< \brief (TC_CMR) Software Trigger Effect on TIOB */ +#define TC_CMR_BSWTRG(value) ((TC_CMR_BSWTRG_Msk & ((value) << TC_CMR_BSWTRG_Pos))) +#define TC_CMR_BSWTRG_NONE (0x0u << 30) /**< \brief (TC_CMR) none */ +#define TC_CMR_BSWTRG_SET (0x1u << 30) /**< \brief (TC_CMR) set */ +#define TC_CMR_BSWTRG_CLEAR (0x2u << 30) /**< \brief (TC_CMR) clear */ +#define TC_CMR_BSWTRG_TOGGLE (0x3u << 30) /**< \brief (TC_CMR) toggle */ + +/* -------- TC_SMC : (TC Offset: 0x08) Channel Stepper Motor Mode Register -------- */ +#define TC_SMC_GCEN (0x1u << 0) /**< \brief (TC_SMC) Gray Count Enable */ +#define TC_SMC_DOWN (0x1u << 1) /**< \brief (TC_SMC) Down Count */ +/* -------- TC_CV : (TC Offset: 0x10) Channel Counter Value Channel 0 -------- */ +#define TC_CV_CV_Pos 0 +#define TC_CV_CV_Msk (0xFFFFu << TC_CV_CV_Pos) /**< \brief (TC_CV) Counter Value */ +#define TC_CV_CV(value) ((TC_CV_CV_Msk & ((value) << TC_CV_CV_Pos))) +/* -------- TC_RA : (TC Offset: 0x14) Channel Register A Channel 0 -------- */ +#define TC_RA_RA_Pos 0 +#define TC_RA_RA_Msk (0xFFFFu << TC_RA_RA_Pos) /**< \brief (TC_RA) Register A */ +#define TC_RA_RA(value) ((TC_RA_RA_Msk & ((value) << TC_RA_RA_Pos))) +/* -------- TC_RB : (TC Offset: 0x18) Channel Register B Channel 0 -------- */ +#define TC_RB_RB_Pos 0 +#define TC_RB_RB_Msk (0xFFFFu << TC_RB_RB_Pos) /**< \brief (TC_RB) Register B */ +#define TC_RB_RB(value) ((TC_RB_RB_Msk & ((value) << TC_RB_RB_Pos))) +/* -------- TC_RC : (TC Offset: 0x1C) Channel Register C Channel 0 -------- */ +#define TC_RC_RC_Pos 0 +#define TC_RC_RC_Msk (0xFFFFu << TC_RC_RC_Pos) /**< \brief (TC_RC) Register C */ +#define TC_RC_RC(value) ((TC_RC_RC_Msk & ((value) << TC_RC_RC_Pos))) +/* -------- TC_SR : (TC Offset: 0x20) Channel Status Register Channel 0 -------- */ +#define TC_SR_COVFS (0x1u << 0) /**< \brief (TC_SR) Counter Overflow Status */ +#define TC_SR_COVFS_0 (0x0u << 0) /**< \brief (TC_SR) No counter overflow has occurred since the last read of the Status Register. */ +#define TC_SR_COVFS_1 (0x1u << 0) /**< \brief (TC_SR) A counter overflow has occurred since the last read of the Status Register. */ +#define TC_SR_LOVRS (0x1u << 1) /**< \brief (TC_SR) Load Overrun Status */ +#define TC_SR_LOVRS_0 (0x0u << 1) /**< \brief (TC_SR) Load overrun has not occurred since the last read of the Status Register or WAVE:1. */ +#define TC_SR_LOVRS_1 (0x1u << 1) /**< \brief (TC_SR) RA or RB have been loaded at least twice without any read of the corresponding register since the last read of the StatusRegister, if WAVE:0. */ +#define TC_SR_CPAS (0x1u << 2) /**< \brief (TC_SR) RA Compare Status */ +#define TC_SR_CPAS_0 (0x0u << 2) /**< \brief (TC_SR) RA Compare has not occurred since the last read of the Status Register or WAVE:0. */ +#define TC_SR_CPAS_1 (0x1u << 2) /**< \brief (TC_SR) RA Compare has occurred since the last read of the Status Register, if WAVE:1. */ +#define TC_SR_CPBS (0x1u << 3) /**< \brief (TC_SR) RB Compare Status */ +#define TC_SR_CPBS_0 (0x0u << 3) /**< \brief (TC_SR) RB Compare has not occurred since the last read of the Status Register or WAVE:0. */ +#define TC_SR_CPBS_1 (0x1u << 3) /**< \brief (TC_SR) RB Compare has occurred since the last read of the Status Register, if WAVE:1. */ +#define TC_SR_CPCS (0x1u << 4) /**< \brief (TC_SR) RC Compare Status */ +#define TC_SR_CPCS_0 (0x0u << 4) /**< \brief (TC_SR) RC Compare has not occurred since the last read of the Status Register. */ +#define TC_SR_CPCS_1 (0x1u << 4) /**< \brief (TC_SR) RC Compare has occurred since the last read of the Status Register. */ +#define TC_SR_LDRAS (0x1u << 5) /**< \brief (TC_SR) RA Loading Status */ +#define TC_SR_LDRAS_0 (0x0u << 5) /**< \brief (TC_SR) RA Load has not occurred since the last read of the Status Register or WAVE:1. */ +#define TC_SR_LDRAS_1 (0x1u << 5) /**< \brief (TC_SR) RA Load has occurred since the last read of the Status Register, if WAVE:0. */ +#define TC_SR_LDRBS (0x1u << 6) /**< \brief (TC_SR) RB Loading Status */ +#define TC_SR_LDRBS_0 (0x0u << 6) /**< \brief (TC_SR) RB Load has not occurred since the last read of the Status Register or WAVE:1. */ +#define TC_SR_LDRBS_1 (0x1u << 6) /**< \brief (TC_SR) RB Load has occurred since the last read of the Status Register, if WAVE:0. */ +#define TC_SR_ETRGS (0x1u << 7) /**< \brief (TC_SR) External Trigger Status */ +#define TC_SR_ETRGS_0 (0x0u << 7) /**< \brief (TC_SR) External trigger has not occurred since the last read of the Status Register. */ +#define TC_SR_ETRGS_1 (0x1u << 7) /**< \brief (TC_SR) External trigger has occurred since the last read of the Status Register. */ +#define TC_SR_CLKSTA (0x1u << 16) /**< \brief (TC_SR) Clock Enabling Status */ +#define TC_SR_CLKSTA_0 (0x0u << 16) /**< \brief (TC_SR) Clock is disabled. */ +#define TC_SR_CLKSTA_1 (0x1u << 16) /**< \brief (TC_SR) Clock is enabled. */ +#define TC_SR_MTIOA (0x1u << 17) /**< \brief (TC_SR) TIOA Mirror */ +#define TC_SR_MTIOA_0 (0x0u << 17) /**< \brief (TC_SR) TIOA is low. If WAVE:0, this means that TIOA pin is low. If WAVE:1, this means that TIOA is driven low. */ +#define TC_SR_MTIOA_1 (0x1u << 17) /**< \brief (TC_SR) TIOA is high. If WAVE:0, this means that TIOA pin is high. If WAVE:1, this means that TIOA is driven high. */ +#define TC_SR_MTIOB (0x1u << 18) /**< \brief (TC_SR) TIOB Mirror */ +#define TC_SR_MTIOB_0 (0x0u << 18) /**< \brief (TC_SR) TIOB is low. If WAVE:0, this means that TIOB pin is low. If WAVE:1, this means that TIOB is driven low. */ +#define TC_SR_MTIOB_1 (0x1u << 18) /**< \brief (TC_SR) TIOB is high. If WAVE:0, this means that TIOB pin is high. If WAVE:1, this means that TIOB is driven high. */ +/* -------- TC_IER : (TC Offset: 0x24) Channel Interrupt Enable Register Channel 0 -------- */ +#define TC_IER_COVFS (0x1u << 0) /**< \brief (TC_IER) Counter Overflow */ +#define TC_IER_COVFS_0 (0x0u << 0) /**< \brief (TC_IER) No effect. */ +#define TC_IER_COVFS_1 (0x1u << 0) /**< \brief (TC_IER) Enables the Counter Overflow Interrupt. */ +#define TC_IER_LOVRS (0x1u << 1) /**< \brief (TC_IER) Load Overrun */ +#define TC_IER_LOVRS_0 (0x0u << 1) /**< \brief (TC_IER) No effect. */ +#define TC_IER_LOVRS_1 (0x1u << 1) /**< \brief (TC_IER) Enables the Load Overrun Interrupt. */ +#define TC_IER_CPAS (0x1u << 2) /**< \brief (TC_IER) RA Compare */ +#define TC_IER_CPAS_0 (0x0u << 2) /**< \brief (TC_IER) No effect. */ +#define TC_IER_CPAS_1 (0x1u << 2) /**< \brief (TC_IER) Enables the RA Compare Interrupt. */ +#define TC_IER_CPBS (0x1u << 3) /**< \brief (TC_IER) RB Compare */ +#define TC_IER_CPBS_0 (0x0u << 3) /**< \brief (TC_IER) No effect. */ +#define TC_IER_CPBS_1 (0x1u << 3) /**< \brief (TC_IER) Enables the RB Compare Interrupt. */ +#define TC_IER_CPCS (0x1u << 4) /**< \brief (TC_IER) RC Compare */ +#define TC_IER_CPCS_0 (0x0u << 4) /**< \brief (TC_IER) No effect. */ +#define TC_IER_CPCS_1 (0x1u << 4) /**< \brief (TC_IER) Enables the RC Compare Interrupt. */ +#define TC_IER_LDRAS (0x1u << 5) /**< \brief (TC_IER) RA Loading */ +#define TC_IER_LDRAS_0 (0x0u << 5) /**< \brief (TC_IER) No effect. */ +#define TC_IER_LDRAS_1 (0x1u << 5) /**< \brief (TC_IER) Enables the RA Load Interrupt. */ +#define TC_IER_LDRBS (0x1u << 6) /**< \brief (TC_IER) RB Loading */ +#define TC_IER_LDRBS_0 (0x0u << 6) /**< \brief (TC_IER) No effect. */ +#define TC_IER_LDRBS_1 (0x1u << 6) /**< \brief (TC_IER) Enables the RB Load Interrupt. */ +#define TC_IER_ETRGS (0x1u << 7) /**< \brief (TC_IER) External Trigger */ +#define TC_IER_ETRGS_0 (0x0u << 7) /**< \brief (TC_IER) No effect. */ +#define TC_IER_ETRGS_1 (0x1u << 7) /**< \brief (TC_IER) Enables the External Trigger Interrupt. */ +/* -------- TC_IDR : (TC Offset: 0x28) Channel Interrupt Disable Register Channel 0 -------- */ +#define TC_IDR_COVFS (0x1u << 0) /**< \brief (TC_IDR) Counter Overflow */ +#define TC_IDR_COVFS_0 (0x0u << 0) /**< \brief (TC_IDR) No effect. */ +#define TC_IDR_COVFS_1 (0x1u << 0) /**< \brief (TC_IDR) Disables the Counter Overflow Interrupt. */ +#define TC_IDR_LOVRS (0x1u << 1) /**< \brief (TC_IDR) Load Overrun */ +#define TC_IDR_LOVRS_0 (0x0u << 1) /**< \brief (TC_IDR) No effect. */ +#define TC_IDR_LOVRS_1 (0x1u << 1) /**< \brief (TC_IDR) Disables the Load Overrun Interrupt (if WAVE:0). */ +#define TC_IDR_CPAS (0x1u << 2) /**< \brief (TC_IDR) RA Compare */ +#define TC_IDR_CPAS_0 (0x0u << 2) /**< \brief (TC_IDR) No effect. */ +#define TC_IDR_CPAS_1 (0x1u << 2) /**< \brief (TC_IDR) Disables the RA Compare Interrupt (if WAVE:1). */ +#define TC_IDR_CPBS (0x1u << 3) /**< \brief (TC_IDR) RB Compare */ +#define TC_IDR_CPBS_0 (0x0u << 3) /**< \brief (TC_IDR) No effect. */ +#define TC_IDR_CPBS_1 (0x1u << 3) /**< \brief (TC_IDR) Disables the RB Compare Interrupt (if WAVE:1). */ +#define TC_IDR_CPCS (0x1u << 4) /**< \brief (TC_IDR) RC Compare */ +#define TC_IDR_CPCS_0 (0x0u << 4) /**< \brief (TC_IDR) No effect. */ +#define TC_IDR_CPCS_1 (0x1u << 4) /**< \brief (TC_IDR) Disables the RC Compare Interrupt. */ +#define TC_IDR_LDRAS (0x1u << 5) /**< \brief (TC_IDR) RA Loading */ +#define TC_IDR_LDRAS_0 (0x0u << 5) /**< \brief (TC_IDR) No effect. */ +#define TC_IDR_LDRAS_1 (0x1u << 5) /**< \brief (TC_IDR) Disables the RA Load Interrupt (if WAVE:0). */ +#define TC_IDR_LDRBS (0x1u << 6) /**< \brief (TC_IDR) RB Loading */ +#define TC_IDR_LDRBS_0 (0x0u << 6) /**< \brief (TC_IDR) No effect. */ +#define TC_IDR_LDRBS_1 (0x1u << 6) /**< \brief (TC_IDR) Disables the RB Load Interrupt (if WAVE:0). */ +#define TC_IDR_ETRGS (0x1u << 7) /**< \brief (TC_IDR) External Trigger */ +#define TC_IDR_ETRGS_0 (0x0u << 7) /**< \brief (TC_IDR) No effect. */ +#define TC_IDR_ETRGS_1 (0x1u << 7) /**< \brief (TC_IDR) Disables the External Trigger Interrupt. */ +/* -------- TC_IMR : (TC Offset: 0x2C) Channel Interrupt Mask Register Channel 0 -------- */ +#define TC_IMR_COVFS (0x1u << 0) /**< \brief (TC_IMR) Counter Overflow */ +#define TC_IMR_COVFS_0 (0x0u << 0) /**< \brief (TC_IMR) The Counter Overflow Interrupt is disabled. */ +#define TC_IMR_COVFS_1 (0x1u << 0) /**< \brief (TC_IMR) The Counter Overflow Interrupt is enabled. */ +#define TC_IMR_LOVRS (0x1u << 1) /**< \brief (TC_IMR) Load Overrun */ +#define TC_IMR_LOVRS_0 (0x0u << 1) /**< \brief (TC_IMR) The Load Overrun Interrupt is disabled. */ +#define TC_IMR_LOVRS_1 (0x1u << 1) /**< \brief (TC_IMR) The Load Overrun Interrupt is enabled. */ +#define TC_IMR_CPAS (0x1u << 2) /**< \brief (TC_IMR) RA Compare */ +#define TC_IMR_CPAS_0 (0x0u << 2) /**< \brief (TC_IMR) The RA Compare Interrupt is disabled. */ +#define TC_IMR_CPAS_1 (0x1u << 2) /**< \brief (TC_IMR) The RA Compare Interrupt is enabled. */ +#define TC_IMR_CPBS (0x1u << 3) /**< \brief (TC_IMR) RB Compare */ +#define TC_IMR_CPBS_0 (0x0u << 3) /**< \brief (TC_IMR) The RB Compare Interrupt is disabled. */ +#define TC_IMR_CPBS_1 (0x1u << 3) /**< \brief (TC_IMR) The RB Compare Interrupt is enabled. */ +#define TC_IMR_CPCS (0x1u << 4) /**< \brief (TC_IMR) RC Compare */ +#define TC_IMR_CPCS_0 (0x0u << 4) /**< \brief (TC_IMR) The RC Compare Interrupt is disabled. */ +#define TC_IMR_CPCS_1 (0x1u << 4) /**< \brief (TC_IMR) The RC Compare Interrupt is enabled. */ +#define TC_IMR_LDRAS (0x1u << 5) /**< \brief (TC_IMR) RA Loading */ +#define TC_IMR_LDRAS_0 (0x0u << 5) /**< \brief (TC_IMR) The Load RA Interrupt is disabled. */ +#define TC_IMR_LDRAS_1 (0x1u << 5) /**< \brief (TC_IMR) The Load RA Interrupt is enabled. */ +#define TC_IMR_LDRBS (0x1u << 6) /**< \brief (TC_IMR) RB Loading */ +#define TC_IMR_LDRBS_0 (0x0u << 6) /**< \brief (TC_IMR) The Load RB Interrupt is disabled. */ +#define TC_IMR_LDRBS_1 (0x1u << 6) /**< \brief (TC_IMR) The Load RB Interrupt is enabled. */ +#define TC_IMR_ETRGS (0x1u << 7) /**< \brief (TC_IMR) External Trigger */ +#define TC_IMR_ETRGS_0 (0x0u << 7) /**< \brief (TC_IMR) The External Trigger Interrupt is disabled. */ +#define TC_IMR_ETRGS_1 (0x1u << 7) /**< \brief (TC_IMR) The External Trigger Interrupt is enabled. */ +/* -------- TC_BCR : (TC Offset: 0xC0) TC Block Control Register -------- */ +#define TC_BCR_SYNC (0x1u << 0) /**< \brief (TC_BCR) Synchro Command */ +#define TC_BCR_SYNC_0 (0x0u << 0) /**< \brief (TC_BCR) No effect. */ +#define TC_BCR_SYNC_1 (0x1u << 0) /**< \brief (TC_BCR) Asserts the SYNC signal which generates a software trigger simultaneously for each of the channels. */ +/* -------- TC_BMR : (TC Offset: 0xC4) TC Block Mode Register -------- */ +#define TC_BMR_TC0XC0S_Pos 0 +#define TC_BMR_TC0XC0S_Msk (0x3u << TC_BMR_TC0XC0S_Pos) /**< \brief (TC_BMR) External Clock Signal 0 Selection */ +#define TC_BMR_TC0XC0S(value) ((TC_BMR_TC0XC0S_Msk & ((value) << TC_BMR_TC0XC0S_Pos))) +#define TC_BMR_TC0XC0S_TCLK0 (0x0u << 0) /**< \brief (TC_BMR) Select TCLK0 as clock signal 0. */ +#define TC_BMR_TC0XC0S_NO_CLK (0x1u << 0) /**< \brief (TC_BMR) Select no clock as clock signal 0. */ +#define TC_BMR_TC0XC0S_TIOA1 (0x2u << 0) /**< \brief (TC_BMR) Select TIOA1 as clock signal 0. */ +#define TC_BMR_TC0XC0S_TIOA2 (0x3u << 0) /**< \brief (TC_BMR) Select TIOA2 as clock signal 0. */ +#define TC_BMR_TC1XC1S_Pos 2 +#define TC_BMR_TC1XC1S_Msk (0x3u << TC_BMR_TC1XC1S_Pos) /**< \brief (TC_BMR) External Clock Signal 1 Selection */ +#define TC_BMR_TC1XC1S(value) ((TC_BMR_TC1XC1S_Msk & ((value) << TC_BMR_TC1XC1S_Pos))) +#define TC_BMR_TC1XC1S_TCLK1 (0x0u << 2) /**< \brief (TC_BMR) Select TCLK1 as clock signal 1. */ +#define TC_BMR_TC1XC1S_NO_CLK (0x1u << 2) /**< \brief (TC_BMR) Select no clock as clock signal 1. */ +#define TC_BMR_TC1XC1S_TIOA0 (0x2u << 2) /**< \brief (TC_BMR) Select TIOA0 as clock signal 1. */ +#define TC_BMR_TC1XC1S_TIOA2 (0x3u << 2) /**< \brief (TC_BMR) Select TIOA2 as clock signal 1. */ +#define TC_BMR_TC2XC2S_Pos 4 +#define TC_BMR_TC2XC2S_Msk (0x3u << TC_BMR_TC2XC2S_Pos) /**< \brief (TC_BMR) External Clock Signal 2 Selection */ +#define TC_BMR_TC2XC2S(value) ((TC_BMR_TC2XC2S_Msk & ((value) << TC_BMR_TC2XC2S_Pos))) +#define TC_BMR_TC2XC2S_TCLK2 (0x0u << 4) /**< \brief (TC_BMR) Select TCLK2 as clock signal 2. */ +#define TC_BMR_TC2XC2S_NO_CLK (0x1u << 4) /**< \brief (TC_BMR) Select no clock as clock signal 2. */ +#define TC_BMR_TC2XC2S_TIOA0 (0x2u << 4) /**< \brief (TC_BMR) Select TIOA0 as clock signal 2. */ +#define TC_BMR_TC2XC2S_TIOA1 (0x3u << 4) /**< \brief (TC_BMR) Select TIOA1 as clock signal 2. */ +/* -------- TC_WPMR : (TC Offset: 0xE4) Write Protect Mode Register -------- */ +#define TC_WPMR_WPEN (0x1u << 0) /**< \brief (TC_WPMR) Write Protect Enable */ +#define TC_WPMR_WPKEY_Pos 8 +#define TC_WPMR_WPKEY_Msk (0xFFFFFFu << TC_WPMR_WPKEY_Pos) /**< \brief (TC_WPMR) Write Protect Key */ +#define TC_WPMR_WPKEY(value) ((TC_WPMR_WPKEY_Msk & ((value) << TC_WPMR_WPKEY_Pos))) +/* -------- TC_FEATURES : (TC Offset: 0xF8) Features Register -------- */ +#define TC_FEATURES_CTRSIZE_Pos 0 +#define TC_FEATURES_CTRSIZE_Msk (0xFFu << TC_FEATURES_CTRSIZE_Pos) /**< \brief (TC_FEATURES) Counter Size */ +#define TC_FEATURES_CTRSIZE(value) ((TC_FEATURES_CTRSIZE_Msk & ((value) << TC_FEATURES_CTRSIZE_Pos))) +#define TC_FEATURES_UPDNIMPL (0x1u << 8) /**< \brief (TC_FEATURES) Up Down is Implemented */ +#define TC_FEATURES_BRPBHSB (0x1u << 9) /**< \brief (TC_FEATURES) Bridge Type is PB to HSB */ +/* -------- TC_VERSION : (TC Offset: 0xFC) Version Register -------- */ +#define TC_VERSION_VERSION_Pos 0 +#define TC_VERSION_VERSION_Msk (0xFFFu << TC_VERSION_VERSION_Pos) /**< \brief (TC_VERSION) Reserved. Value subject to change. No functionality associated. This is the Atmel internal version of the macrocell. */ +#define TC_VERSION_VERSION(value) ((TC_VERSION_VERSION_Msk & ((value) << TC_VERSION_VERSION_Pos))) +#define TC_VERSION_VARIANT_Pos 16 +#define TC_VERSION_VARIANT_Msk (0xFu << TC_VERSION_VARIANT_Pos) /**< \brief (TC_VERSION) Reserved. Value subject to change. No functionality associated. */ +#define TC_VERSION_VARIANT(value) ((TC_VERSION_VARIANT_Msk & ((value) << TC_VERSION_VARIANT_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR TRNG */ +/* ============================================================================= */ +/** \addtogroup SAM4L_TRNG True Random Number Generator */ +/*@{*/ + +#define REV_TRNG 0x103 + +#ifndef __ASSEMBLY__ +/** \brief TRNG hardware registers */ +typedef struct { + WoReg TRNG_CR; /**< \brief (TRNG Offset: 0x00) Control Register */ + RoReg Reserved1[3]; + WoReg TRNG_IER; /**< \brief (TRNG Offset: 0x10) Interrupt Enable Register */ + WoReg TRNG_IDR; /**< \brief (TRNG Offset: 0x14) Interrupt Disable Register */ + RoReg TRNG_IMR; /**< \brief (TRNG Offset: 0x18) Interrupt Mask Register */ + RoReg TRNG_ISR; /**< \brief (TRNG Offset: 0x1C) Interrupt Status Register */ + RoReg Reserved2[12]; + RoReg TRNG_ODATA; /**< \brief (TRNG Offset: 0x50) Output Data Register */ + RoReg Reserved3[42]; + RoReg TRNG_VERSION; /**< \brief (TRNG Offset: 0xFC) Version Register */ +} Trng; +#endif /* __ASSEMBLY__ */ +/* -------- TRNG_CR : (TRNG Offset: 0x00) Control Register -------- */ +#define TRNG_CR_ENABLE (0x1u << 0) /**< \brief (TRNG_CR) Enables the TRNG to provide random values */ +#define TRNG_CR_KEY_Pos 8 +#define TRNG_CR_KEY_Msk (0xFFFFFFu << TRNG_CR_KEY_Pos) /**< \brief (TRNG_CR) Security Key */ +#define TRNG_CR_KEY(value) ((TRNG_CR_KEY_Msk & ((value) << TRNG_CR_KEY_Pos))) +/* -------- TRNG_IER : (TRNG Offset: 0x10) Interrupt Enable Register -------- */ +#define TRNG_IER_DATRDY (0x1u << 0) /**< \brief (TRNG_IER) Data Ready Interrupt Enable */ +/* -------- TRNG_IDR : (TRNG Offset: 0x14) Interrupt Disable Register -------- */ +#define TRNG_IDR_DATRDY (0x1u << 0) /**< \brief (TRNG_IDR) Data Ready Interrupt Disable */ +/* -------- TRNG_IMR : (TRNG Offset: 0x18) Interrupt Mask Register -------- */ +#define TRNG_IMR_DATRDY (0x1u << 0) /**< \brief (TRNG_IMR) Data Ready Interrupt Mask */ +/* -------- TRNG_ISR : (TRNG Offset: 0x1C) Interrupt Status Register -------- */ +#define TRNG_ISR_DATRDY (0x1u << 0) /**< \brief (TRNG_ISR) Data Ready Interrupt Status */ +/* -------- TRNG_ODATA : (TRNG Offset: 0x50) Output Data Register -------- */ +#define TRNG_ODATA_ODATA (0x1u << 0) /**< \brief (TRNG_ODATA) Output Data */ +/* -------- TRNG_VERSION : (TRNG Offset: 0xFC) Version Register -------- */ +#define TRNG_VERSION_VERSION_Pos 0 +#define TRNG_VERSION_VERSION_Msk (0xFFFu << TRNG_VERSION_VERSION_Pos) /**< \brief (TRNG_VERSION) Version Number */ +#define TRNG_VERSION_VERSION(value) ((TRNG_VERSION_VERSION_Msk & ((value) << TRNG_VERSION_VERSION_Pos))) +#define TRNG_VERSION_VARIANT_Pos 16 +#define TRNG_VERSION_VARIANT_Msk (0x7u << TRNG_VERSION_VARIANT_Pos) /**< \brief (TRNG_VERSION) Variant Number */ +#define TRNG_VERSION_VARIANT(value) ((TRNG_VERSION_VARIANT_Msk & ((value) << TRNG_VERSION_VARIANT_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR TWIM */ +/* ============================================================================= */ +/** \addtogroup SAM4L_TWIM Two-wire Master Interface */ +/*@{*/ + +#define REV_TWIM 0x120 + +#ifndef __ASSEMBLY__ +/** \brief TWIM hardware registers */ +typedef struct { + WoReg TWIM_CR; /**< \brief (TWIM Offset: 0x00) Control Register */ + RwReg TWIM_CWGR; /**< \brief (TWIM Offset: 0x04) Clock Waveform Generator Register */ + RwReg TWIM_SMBTR; /**< \brief (TWIM Offset: 0x08) SMBus Timing Register */ + RwReg TWIM_CMDR; /**< \brief (TWIM Offset: 0x0C) Command Register */ + RwReg TWIM_NCMDR; /**< \brief (TWIM Offset: 0x10) Next Command Register */ + RoReg TWIM_RHR; /**< \brief (TWIM Offset: 0x14) Receive Holding Register */ + WoReg TWIM_THR; /**< \brief (TWIM Offset: 0x18) Transmit Holding Register */ + RoReg TWIM_SR; /**< \brief (TWIM Offset: 0x1C) Status Register */ + WoReg TWIM_IER; /**< \brief (TWIM Offset: 0x20) Interrupt Enable Register */ + WoReg TWIM_IDR; /**< \brief (TWIM Offset: 0x24) Interrupt Disable Register */ + RoReg TWIM_IMR; /**< \brief (TWIM Offset: 0x28) Interrupt Mask Register */ + WoReg TWIM_SCR; /**< \brief (TWIM Offset: 0x2C) Status Clear Register */ + RoReg TWIM_PR; /**< \brief (TWIM Offset: 0x30) Parameter Register */ + RoReg TWIM_VR; /**< \brief (TWIM Offset: 0x34) Version Register */ + RwReg TWIM_HSCWGR; /**< \brief (TWIM Offset: 0x38) HS-mode Clock Waveform Generator */ + RwReg TWIM_SRR; /**< \brief (TWIM Offset: 0x3C) Slew Rate Register */ + RwReg TWIM_HSSRR; /**< \brief (TWIM Offset: 0x40) HS-mode Slew Rate Register */ +} Twim; +#endif /* __ASSEMBLY__ */ +/* -------- TWIM_CR : (TWIM Offset: 0x00) Control Register -------- */ +#define TWIM_CR_MEN (0x1u << 0) /**< \brief (TWIM_CR) Master Enable */ +#define TWIM_CR_MDIS (0x1u << 1) /**< \brief (TWIM_CR) Master Disable */ +#define TWIM_CR_SMEN (0x1u << 4) /**< \brief (TWIM_CR) SMBus Enable */ +#define TWIM_CR_SMDIS (0x1u << 5) /**< \brief (TWIM_CR) SMBus Disable */ +#define TWIM_CR_SWRST (0x1u << 7) /**< \brief (TWIM_CR) Software Reset */ +#define TWIM_CR_STOP (0x1u << 8) /**< \brief (TWIM_CR) Stop the current transfer */ +/* -------- TWIM_CWGR : (TWIM Offset: 0x04) Clock Waveform Generator Register -------- */ +#define TWIM_CWGR_LOW_Pos 0 +#define TWIM_CWGR_LOW_Msk (0xFFu << TWIM_CWGR_LOW_Pos) /**< \brief (TWIM_CWGR) Clock Low Cycles */ +#define TWIM_CWGR_LOW(value) ((TWIM_CWGR_LOW_Msk & ((value) << TWIM_CWGR_LOW_Pos))) +#define TWIM_CWGR_HIGH_Pos 8 +#define TWIM_CWGR_HIGH_Msk (0xFFu << TWIM_CWGR_HIGH_Pos) /**< \brief (TWIM_CWGR) Clock High Cycles */ +#define TWIM_CWGR_HIGH(value) ((TWIM_CWGR_HIGH_Msk & ((value) << TWIM_CWGR_HIGH_Pos))) +#define TWIM_CWGR_STASTO_Pos 16 +#define TWIM_CWGR_STASTO_Msk (0xFFu << TWIM_CWGR_STASTO_Pos) /**< \brief (TWIM_CWGR) START and STOP Cycles */ +#define TWIM_CWGR_STASTO(value) ((TWIM_CWGR_STASTO_Msk & ((value) << TWIM_CWGR_STASTO_Pos))) +#define TWIM_CWGR_DATA_Pos 24 +#define TWIM_CWGR_DATA_Msk (0xFu << TWIM_CWGR_DATA_Pos) /**< \brief (TWIM_CWGR) Data Setup and Hold Cycles */ +#define TWIM_CWGR_DATA(value) ((TWIM_CWGR_DATA_Msk & ((value) << TWIM_CWGR_DATA_Pos))) +#define TWIM_CWGR_EXP_Pos 28 +#define TWIM_CWGR_EXP_Msk (0x7u << TWIM_CWGR_EXP_Pos) /**< \brief (TWIM_CWGR) Clock Prescaler */ +#define TWIM_CWGR_EXP(value) ((TWIM_CWGR_EXP_Msk & ((value) << TWIM_CWGR_EXP_Pos))) +/* -------- TWIM_SMBTR : (TWIM Offset: 0x08) SMBus Timing Register -------- */ +#define TWIM_SMBTR_TLOWS_Pos 0 +#define TWIM_SMBTR_TLOWS_Msk (0xFFu << TWIM_SMBTR_TLOWS_Pos) /**< \brief (TWIM_SMBTR) Slave Clock stretch maximum cycles */ +#define TWIM_SMBTR_TLOWS(value) ((TWIM_SMBTR_TLOWS_Msk & ((value) << TWIM_SMBTR_TLOWS_Pos))) +#define TWIM_SMBTR_TLOWM_Pos 8 +#define TWIM_SMBTR_TLOWM_Msk (0xFFu << TWIM_SMBTR_TLOWM_Pos) /**< \brief (TWIM_SMBTR) Master Clock stretch maximum cycles */ +#define TWIM_SMBTR_TLOWM(value) ((TWIM_SMBTR_TLOWM_Msk & ((value) << TWIM_SMBTR_TLOWM_Pos))) +#define TWIM_SMBTR_THMAX_Pos 16 +#define TWIM_SMBTR_THMAX_Msk (0xFFu << TWIM_SMBTR_THMAX_Pos) /**< \brief (TWIM_SMBTR) Clock High maximum cycles */ +#define TWIM_SMBTR_THMAX(value) ((TWIM_SMBTR_THMAX_Msk & ((value) << TWIM_SMBTR_THMAX_Pos))) +#define TWIM_SMBTR_EXP_Pos 28 +#define TWIM_SMBTR_EXP_Msk (0xFu << TWIM_SMBTR_EXP_Pos) /**< \brief (TWIM_SMBTR) SMBus Timeout Clock prescaler */ +#define TWIM_SMBTR_EXP(value) ((TWIM_SMBTR_EXP_Msk & ((value) << TWIM_SMBTR_EXP_Pos))) +/* -------- TWIM_CMDR : (TWIM Offset: 0x0C) Command Register -------- */ +#define TWIM_CMDR_READ (0x1u << 0) /**< \brief (TWIM_CMDR) Transfer Direction */ +#define TWIM_CMDR_SADR_Pos 1 +#define TWIM_CMDR_SADR_Msk (0x3FFu << TWIM_CMDR_SADR_Pos) /**< \brief (TWIM_CMDR) Slave Address */ +#define TWIM_CMDR_SADR(value) ((TWIM_CMDR_SADR_Msk & ((value) << TWIM_CMDR_SADR_Pos))) +#define TWIM_CMDR_TENBIT (0x1u << 11) /**< \brief (TWIM_CMDR) Ten Bit Addressing Mode */ +#define TWIM_CMDR_REPSAME (0x1u << 12) /**< \brief (TWIM_CMDR) Transfer is to same address as previous address */ +#define TWIM_CMDR_START (0x1u << 13) /**< \brief (TWIM_CMDR) Send START condition */ +#define TWIM_CMDR_STOP (0x1u << 14) /**< \brief (TWIM_CMDR) Send STOP condition */ +#define TWIM_CMDR_VALID (0x1u << 15) /**< \brief (TWIM_CMDR) CMDR Valid */ +#define TWIM_CMDR_NBYTES_Pos 16 +#define TWIM_CMDR_NBYTES_Msk (0xFFu << TWIM_CMDR_NBYTES_Pos) /**< \brief (TWIM_CMDR) Number of data bytes in transfer */ +#define TWIM_CMDR_NBYTES(value) ((TWIM_CMDR_NBYTES_Msk & ((value) << TWIM_CMDR_NBYTES_Pos))) +#define TWIM_CMDR_PECEN (0x1u << 24) /**< \brief (TWIM_CMDR) Packet Error Checking Enable */ +#define TWIM_CMDR_ACKLAST (0x1u << 25) /**< \brief (TWIM_CMDR) ACK Last Master RX Byte */ +#define TWIM_CMDR_HS (0x1u << 26) /**< \brief (TWIM_CMDR) HS-mode */ +#define TWIM_CMDR_HSMCODE_Pos 28 +#define TWIM_CMDR_HSMCODE_Msk (0x7u << TWIM_CMDR_HSMCODE_Pos) /**< \brief (TWIM_CMDR) HS-mode Master Code */ +#define TWIM_CMDR_HSMCODE(value) ((TWIM_CMDR_HSMCODE_Msk & ((value) << TWIM_CMDR_HSMCODE_Pos))) +/* -------- TWIM_NCMDR : (TWIM Offset: 0x10) Next Command Register -------- */ +#define TWIM_NCMDR_READ (0x1u << 0) /**< \brief (TWIM_NCMDR) Transfer Direction */ +#define TWIM_NCMDR_SADR_Pos 1 +#define TWIM_NCMDR_SADR_Msk (0x3FFu << TWIM_NCMDR_SADR_Pos) /**< \brief (TWIM_NCMDR) Slave Address */ +#define TWIM_NCMDR_SADR(value) ((TWIM_NCMDR_SADR_Msk & ((value) << TWIM_NCMDR_SADR_Pos))) +#define TWIM_NCMDR_TENBIT (0x1u << 11) /**< \brief (TWIM_NCMDR) Ten Bit Addressing Mode */ +#define TWIM_NCMDR_REPSAME (0x1u << 12) /**< \brief (TWIM_NCMDR) Transfer is to same address as previous address */ +#define TWIM_NCMDR_START (0x1u << 13) /**< \brief (TWIM_NCMDR) Send START condition */ +#define TWIM_NCMDR_STOP (0x1u << 14) /**< \brief (TWIM_NCMDR) Send STOP condition */ +#define TWIM_NCMDR_VALID (0x1u << 15) /**< \brief (TWIM_NCMDR) CMDR Valid */ +#define TWIM_NCMDR_NBYTES_Pos 16 +#define TWIM_NCMDR_NBYTES_Msk (0xFFu << TWIM_NCMDR_NBYTES_Pos) /**< \brief (TWIM_NCMDR) Number of data bytes in transfer */ +#define TWIM_NCMDR_NBYTES(value) ((TWIM_NCMDR_NBYTES_Msk & ((value) << TWIM_NCMDR_NBYTES_Pos))) +#define TWIM_NCMDR_PECEN (0x1u << 24) /**< \brief (TWIM_NCMDR) Packet Error Checking Enable */ +#define TWIM_NCMDR_ACKLAST (0x1u << 25) /**< \brief (TWIM_NCMDR) ACK Last Master RX Byte */ +#define TWIM_NCMDR_HS (0x1u << 26) /**< \brief (TWIM_NCMDR) HS-mode */ +#define TWIM_NCMDR_HSMCODE_Pos 28 +#define TWIM_NCMDR_HSMCODE_Msk (0x7u << TWIM_NCMDR_HSMCODE_Pos) /**< \brief (TWIM_NCMDR) HS-mode Master Code */ +#define TWIM_NCMDR_HSMCODE(value) ((TWIM_NCMDR_HSMCODE_Msk & ((value) << TWIM_NCMDR_HSMCODE_Pos))) +/* -------- TWIM_RHR : (TWIM Offset: 0x14) Receive Holding Register -------- */ +#define TWIM_RHR_RXDATA_Pos 0 +#define TWIM_RHR_RXDATA_Msk (0xFFu << TWIM_RHR_RXDATA_Pos) /**< \brief (TWIM_RHR) Received Data */ +#define TWIM_RHR_RXDATA(value) ((TWIM_RHR_RXDATA_Msk & ((value) << TWIM_RHR_RXDATA_Pos))) +/* -------- TWIM_THR : (TWIM Offset: 0x18) Transmit Holding Register -------- */ +#define TWIM_THR_TXDATA_Pos 0 +#define TWIM_THR_TXDATA_Msk (0xFFu << TWIM_THR_TXDATA_Pos) /**< \brief (TWIM_THR) Data to Transmit */ +#define TWIM_THR_TXDATA(value) ((TWIM_THR_TXDATA_Msk & ((value) << TWIM_THR_TXDATA_Pos))) +/* -------- TWIM_SR : (TWIM Offset: 0x1C) Status Register -------- */ +#define TWIM_SR_RXRDY (0x1u << 0) /**< \brief (TWIM_SR) RHR Data Ready */ +#define TWIM_SR_TXRDY (0x1u << 1) /**< \brief (TWIM_SR) THR Data Ready */ +#define TWIM_SR_CRDY (0x1u << 2) /**< \brief (TWIM_SR) Ready for More Commands */ +#define TWIM_SR_CCOMP (0x1u << 3) /**< \brief (TWIM_SR) Command Complete */ +#define TWIM_SR_IDLE (0x1u << 4) /**< \brief (TWIM_SR) Master Interface is Idle */ +#define TWIM_SR_BUSFREE (0x1u << 5) /**< \brief (TWIM_SR) Two-wire Bus is Free */ +#define TWIM_SR_ANAK (0x1u << 8) /**< \brief (TWIM_SR) NAK in Address Phase Received */ +#define TWIM_SR_DNAK (0x1u << 9) /**< \brief (TWIM_SR) NAK in Data Phase Received */ +#define TWIM_SR_ARBLST (0x1u << 10) /**< \brief (TWIM_SR) Arbitration Lost */ +#define TWIM_SR_SMBALERT (0x1u << 11) /**< \brief (TWIM_SR) SMBus Alert */ +#define TWIM_SR_TOUT (0x1u << 12) /**< \brief (TWIM_SR) Timeout */ +#define TWIM_SR_PECERR (0x1u << 13) /**< \brief (TWIM_SR) PEC Error */ +#define TWIM_SR_STOP (0x1u << 14) /**< \brief (TWIM_SR) Stop Request Accepted */ +#define TWIM_SR_MENB (0x1u << 16) /**< \brief (TWIM_SR) Master Interface Enable */ +#define TWIM_SR_HSMCACK (0x1u << 17) /**< \brief (TWIM_SR) ACK in HS-mode Master Code Phase Received */ +/* -------- TWIM_IER : (TWIM Offset: 0x20) Interrupt Enable Register -------- */ +#define TWIM_IER_RXRDY (0x1u << 0) /**< \brief (TWIM_IER) RHR Data Ready */ +#define TWIM_IER_TXRDY (0x1u << 1) /**< \brief (TWIM_IER) THR Data Ready */ +#define TWIM_IER_CRDY (0x1u << 2) /**< \brief (TWIM_IER) Ready for More Commands */ +#define TWIM_IER_CCOMP (0x1u << 3) /**< \brief (TWIM_IER) Command Complete */ +#define TWIM_IER_IDLE (0x1u << 4) /**< \brief (TWIM_IER) Master Interface is Idle */ +#define TWIM_IER_BUSFREE (0x1u << 5) /**< \brief (TWIM_IER) Two-wire Bus is Free */ +#define TWIM_IER_ANAK (0x1u << 8) /**< \brief (TWIM_IER) NAK in Address Phase Received */ +#define TWIM_IER_DNAK (0x1u << 9) /**< \brief (TWIM_IER) NAK in Data Phase Received */ +#define TWIM_IER_ARBLST (0x1u << 10) /**< \brief (TWIM_IER) Arbitration Lost */ +#define TWIM_IER_SMBALERT (0x1u << 11) /**< \brief (TWIM_IER) SMBus Alert */ +#define TWIM_IER_TOUT (0x1u << 12) /**< \brief (TWIM_IER) Timeout */ +#define TWIM_IER_PECERR (0x1u << 13) /**< \brief (TWIM_IER) PEC Error */ +#define TWIM_IER_STOP (0x1u << 14) /**< \brief (TWIM_IER) Stop Request Accepted */ +#define TWIM_IER_HSMCACK (0x1u << 17) /**< \brief (TWIM_IER) ACK in HS-mode Master Code Phase Received */ +/* -------- TWIM_IDR : (TWIM Offset: 0x24) Interrupt Disable Register -------- */ +#define TWIM_IDR_RXRDY (0x1u << 0) /**< \brief (TWIM_IDR) RHR Data Ready */ +#define TWIM_IDR_TXRDY (0x1u << 1) /**< \brief (TWIM_IDR) THR Data Ready */ +#define TWIM_IDR_CRDY (0x1u << 2) /**< \brief (TWIM_IDR) Ready for More Commands */ +#define TWIM_IDR_CCOMP (0x1u << 3) /**< \brief (TWIM_IDR) Command Complete */ +#define TWIM_IDR_IDLE (0x1u << 4) /**< \brief (TWIM_IDR) Master Interface is Idle */ +#define TWIM_IDR_BUSFREE (0x1u << 5) /**< \brief (TWIM_IDR) Two-wire Bus is Free */ +#define TWIM_IDR_ANAK (0x1u << 8) /**< \brief (TWIM_IDR) NAK in Address Phase Received */ +#define TWIM_IDR_DNAK (0x1u << 9) /**< \brief (TWIM_IDR) NAK in Data Phase Received */ +#define TWIM_IDR_ARBLST (0x1u << 10) /**< \brief (TWIM_IDR) Arbitration Lost */ +#define TWIM_IDR_SMBALERT (0x1u << 11) /**< \brief (TWIM_IDR) SMBus Alert */ +#define TWIM_IDR_TOUT (0x1u << 12) /**< \brief (TWIM_IDR) Timeout */ +#define TWIM_IDR_PECERR (0x1u << 13) /**< \brief (TWIM_IDR) PEC Error */ +#define TWIM_IDR_STOP (0x1u << 14) /**< \brief (TWIM_IDR) Stop Request Accepted */ +#define TWIM_IDR_HSMCACK (0x1u << 17) /**< \brief (TWIM_IDR) ACK in HS-mode Master Code Phase Received */ +/* -------- TWIM_IMR : (TWIM Offset: 0x28) Interrupt Mask Register -------- */ +#define TWIM_IMR_RXRDY (0x1u << 0) /**< \brief (TWIM_IMR) RHR Data Ready */ +#define TWIM_IMR_TXRDY (0x1u << 1) /**< \brief (TWIM_IMR) THR Data Ready */ +#define TWIM_IMR_CRDY (0x1u << 2) /**< \brief (TWIM_IMR) Ready for More Commands */ +#define TWIM_IMR_CCOMP (0x1u << 3) /**< \brief (TWIM_IMR) Command Complete */ +#define TWIM_IMR_IDLE (0x1u << 4) /**< \brief (TWIM_IMR) Master Interface is Idle */ +#define TWIM_IMR_BUSFREE (0x1u << 5) /**< \brief (TWIM_IMR) Two-wire Bus is Free */ +#define TWIM_IMR_ANAK (0x1u << 8) /**< \brief (TWIM_IMR) NAK in Address Phase Received */ +#define TWIM_IMR_DNAK (0x1u << 9) /**< \brief (TWIM_IMR) NAK in Data Phase Received */ +#define TWIM_IMR_ARBLST (0x1u << 10) /**< \brief (TWIM_IMR) Arbitration Lost */ +#define TWIM_IMR_SMBALERT (0x1u << 11) /**< \brief (TWIM_IMR) SMBus Alert */ +#define TWIM_IMR_TOUT (0x1u << 12) /**< \brief (TWIM_IMR) Timeout */ +#define TWIM_IMR_PECERR (0x1u << 13) /**< \brief (TWIM_IMR) PEC Error */ +#define TWIM_IMR_STOP (0x1u << 14) /**< \brief (TWIM_IMR) Stop Request Accepted */ +#define TWIM_IMR_HSMCACK (0x1u << 17) /**< \brief (TWIM_IMR) ACK in HS-mode Master Code Phase Received */ +/* -------- TWIM_SCR : (TWIM Offset: 0x2C) Status Clear Register -------- */ +#define TWIM_SCR_CCOMP (0x1u << 3) /**< \brief (TWIM_SCR) Command Complete */ +#define TWIM_SCR_ANAK (0x1u << 8) /**< \brief (TWIM_SCR) NAK in Address Phase Received */ +#define TWIM_SCR_DNAK (0x1u << 9) /**< \brief (TWIM_SCR) NAK in Data Phase Received */ +#define TWIM_SCR_ARBLST (0x1u << 10) /**< \brief (TWIM_SCR) Arbitration Lost */ +#define TWIM_SCR_SMBALERT (0x1u << 11) /**< \brief (TWIM_SCR) SMBus Alert */ +#define TWIM_SCR_TOUT (0x1u << 12) /**< \brief (TWIM_SCR) Timeout */ +#define TWIM_SCR_PECERR (0x1u << 13) /**< \brief (TWIM_SCR) PEC Error */ +#define TWIM_SCR_STOP (0x1u << 14) /**< \brief (TWIM_SCR) Stop Request Accepted */ +#define TWIM_SCR_HSMCACK (0x1u << 17) /**< \brief (TWIM_SCR) ACK in HS-mode Master Code Phase Received */ +/* -------- TWIM_PR : (TWIM Offset: 0x30) Parameter Register -------- */ +#define TWIM_PR_HS (0x1u << 0) /**< \brief (TWIM_PR) HS-mode */ +/* -------- TWIM_VR : (TWIM Offset: 0x34) Version Register -------- */ +#define TWIM_VR_VERSION_Pos 0 +#define TWIM_VR_VERSION_Msk (0xFFFu << TWIM_VR_VERSION_Pos) /**< \brief (TWIM_VR) Version number */ +#define TWIM_VR_VERSION(value) ((TWIM_VR_VERSION_Msk & ((value) << TWIM_VR_VERSION_Pos))) +#define TWIM_VR_VARIANT_Pos 16 +#define TWIM_VR_VARIANT_Msk (0xFu << TWIM_VR_VARIANT_Pos) /**< \brief (TWIM_VR) Variant number */ +#define TWIM_VR_VARIANT(value) ((TWIM_VR_VARIANT_Msk & ((value) << TWIM_VR_VARIANT_Pos))) +/* -------- TWIM_HSCWGR : (TWIM Offset: 0x38) HS-mode Clock Waveform Generator -------- */ +#define TWIM_HSCWGR_LOW_Pos 0 +#define TWIM_HSCWGR_LOW_Msk (0xFFu << TWIM_HSCWGR_LOW_Pos) /**< \brief (TWIM_HSCWGR) Clock Low Cycles */ +#define TWIM_HSCWGR_LOW(value) ((TWIM_HSCWGR_LOW_Msk & ((value) << TWIM_HSCWGR_LOW_Pos))) +#define TWIM_HSCWGR_HIGH_Pos 8 +#define TWIM_HSCWGR_HIGH_Msk (0xFFu << TWIM_HSCWGR_HIGH_Pos) /**< \brief (TWIM_HSCWGR) Clock High Cycles */ +#define TWIM_HSCWGR_HIGH(value) ((TWIM_HSCWGR_HIGH_Msk & ((value) << TWIM_HSCWGR_HIGH_Pos))) +#define TWIM_HSCWGR_STASTO_Pos 16 +#define TWIM_HSCWGR_STASTO_Msk (0xFFu << TWIM_HSCWGR_STASTO_Pos) /**< \brief (TWIM_HSCWGR) START and STOP Cycles */ +#define TWIM_HSCWGR_STASTO(value) ((TWIM_HSCWGR_STASTO_Msk & ((value) << TWIM_HSCWGR_STASTO_Pos))) +#define TWIM_HSCWGR_DATA_Pos 24 +#define TWIM_HSCWGR_DATA_Msk (0xFu << TWIM_HSCWGR_DATA_Pos) /**< \brief (TWIM_HSCWGR) Data Setup and Hold Cycles */ +#define TWIM_HSCWGR_DATA(value) ((TWIM_HSCWGR_DATA_Msk & ((value) << TWIM_HSCWGR_DATA_Pos))) +#define TWIM_HSCWGR_EXP_Pos 28 +#define TWIM_HSCWGR_EXP_Msk (0x7u << TWIM_HSCWGR_EXP_Pos) /**< \brief (TWIM_HSCWGR) Clock Prescaler */ +#define TWIM_HSCWGR_EXP(value) ((TWIM_HSCWGR_EXP_Msk & ((value) << TWIM_HSCWGR_EXP_Pos))) +/* -------- TWIM_SRR : (TWIM Offset: 0x3C) Slew Rate Register -------- */ +#define TWIM_SRR_DADRIVEL_Pos 0 +#define TWIM_SRR_DADRIVEL_Msk (0x7u << TWIM_SRR_DADRIVEL_Pos) /**< \brief (TWIM_SRR) Data Drive Strength LOW */ +#define TWIM_SRR_DADRIVEL(value) ((TWIM_SRR_DADRIVEL_Msk & ((value) << TWIM_SRR_DADRIVEL_Pos))) +#define TWIM_SRR_DASLEW_Pos 8 +#define TWIM_SRR_DASLEW_Msk (0x3u << TWIM_SRR_DASLEW_Pos) /**< \brief (TWIM_SRR) Data Slew Limit */ +#define TWIM_SRR_DASLEW(value) ((TWIM_SRR_DASLEW_Msk & ((value) << TWIM_SRR_DASLEW_Pos))) +#define TWIM_SRR_CLDRIVEL_Pos 16 +#define TWIM_SRR_CLDRIVEL_Msk (0x7u << TWIM_SRR_CLDRIVEL_Pos) /**< \brief (TWIM_SRR) Clock Drive Strength LOW */ +#define TWIM_SRR_CLDRIVEL(value) ((TWIM_SRR_CLDRIVEL_Msk & ((value) << TWIM_SRR_CLDRIVEL_Pos))) +#define TWIM_SRR_CLSLEW_Pos 24 +#define TWIM_SRR_CLSLEW_Msk (0x3u << TWIM_SRR_CLSLEW_Pos) /**< \brief (TWIM_SRR) Clock Slew Limit */ +#define TWIM_SRR_CLSLEW(value) ((TWIM_SRR_CLSLEW_Msk & ((value) << TWIM_SRR_CLSLEW_Pos))) +#define TWIM_SRR_FILTER_Pos 28 +#define TWIM_SRR_FILTER_Msk (0x3u << TWIM_SRR_FILTER_Pos) /**< \brief (TWIM_SRR) Input Spike Filter Control */ +#define TWIM_SRR_FILTER(value) ((TWIM_SRR_FILTER_Msk & ((value) << TWIM_SRR_FILTER_Pos))) +/* -------- TWIM_HSSRR : (TWIM Offset: 0x40) HS-mode Slew Rate Register -------- */ +#define TWIM_HSSRR_DADRIVEL_Pos 0 +#define TWIM_HSSRR_DADRIVEL_Msk (0x7u << TWIM_HSSRR_DADRIVEL_Pos) /**< \brief (TWIM_HSSRR) Data Drive Strength LOW */ +#define TWIM_HSSRR_DADRIVEL(value) ((TWIM_HSSRR_DADRIVEL_Msk & ((value) << TWIM_HSSRR_DADRIVEL_Pos))) +#define TWIM_HSSRR_DASLEW_Pos 8 +#define TWIM_HSSRR_DASLEW_Msk (0x3u << TWIM_HSSRR_DASLEW_Pos) /**< \brief (TWIM_HSSRR) Data Slew Limit */ +#define TWIM_HSSRR_DASLEW(value) ((TWIM_HSSRR_DASLEW_Msk & ((value) << TWIM_HSSRR_DASLEW_Pos))) +#define TWIM_HSSRR_CLDRIVEL_Pos 16 +#define TWIM_HSSRR_CLDRIVEL_Msk (0x7u << TWIM_HSSRR_CLDRIVEL_Pos) /**< \brief (TWIM_HSSRR) Clock Drive Strength LOW */ +#define TWIM_HSSRR_CLDRIVEL(value) ((TWIM_HSSRR_CLDRIVEL_Msk & ((value) << TWIM_HSSRR_CLDRIVEL_Pos))) +#define TWIM_HSSRR_CLDRIVEH_Pos 20 +#define TWIM_HSSRR_CLDRIVEH_Msk (0x3u << TWIM_HSSRR_CLDRIVEH_Pos) /**< \brief (TWIM_HSSRR) Clock Drive Strength HIGH */ +#define TWIM_HSSRR_CLDRIVEH(value) ((TWIM_HSSRR_CLDRIVEH_Msk & ((value) << TWIM_HSSRR_CLDRIVEH_Pos))) +#define TWIM_HSSRR_CLSLEW_Pos 24 +#define TWIM_HSSRR_CLSLEW_Msk (0x3u << TWIM_HSSRR_CLSLEW_Pos) /**< \brief (TWIM_HSSRR) Clock Slew Limit */ +#define TWIM_HSSRR_CLSLEW(value) ((TWIM_HSSRR_CLSLEW_Msk & ((value) << TWIM_HSSRR_CLSLEW_Pos))) +#define TWIM_HSSRR_FILTER_Pos 28 +#define TWIM_HSSRR_FILTER_Msk (0x3u << TWIM_HSSRR_FILTER_Pos) /**< \brief (TWIM_HSSRR) Input Spike Filter Control */ +#define TWIM_HSSRR_FILTER(value) ((TWIM_HSSRR_FILTER_Msk & ((value) << TWIM_HSSRR_FILTER_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR TWIS */ +/* ============================================================================= */ +/** \addtogroup SAM4L_TWIS Two-wire Slave Interface */ +/*@{*/ + +#define REV_TWIS 0x140 + +#ifndef __ASSEMBLY__ +/** \brief TWIS hardware registers */ +typedef struct { + RwReg TWIS_CR; /**< \brief (TWIS Offset: 0x00) Control Register */ + RwReg TWIS_NBYTES; /**< \brief (TWIS Offset: 0x04) NBYTES Register */ + RwReg TWIS_TR; /**< \brief (TWIS Offset: 0x08) Timing Register */ + RoReg TWIS_RHR; /**< \brief (TWIS Offset: 0x0C) Receive Holding Register */ + WoReg TWIS_THR; /**< \brief (TWIS Offset: 0x10) Transmit Holding Register */ + RoReg TWIS_PECR; /**< \brief (TWIS Offset: 0x14) Packet Error Check Register */ + RoReg TWIS_SR; /**< \brief (TWIS Offset: 0x18) Status Register */ + WoReg TWIS_IER; /**< \brief (TWIS Offset: 0x1C) Interrupt Enable Register */ + WoReg TWIS_IDR; /**< \brief (TWIS Offset: 0x20) Interrupt Disable Register */ + RoReg TWIS_IMR; /**< \brief (TWIS Offset: 0x24) Interrupt Mask Register */ + WoReg TWIS_SCR; /**< \brief (TWIS Offset: 0x28) Status Clear Register */ + RoReg TWIS_PR; /**< \brief (TWIS Offset: 0x2C) Parameter Register */ + RoReg TWIS_VR; /**< \brief (TWIS Offset: 0x30) Version Register */ + RwReg TWIS_HSTR; /**< \brief (TWIS Offset: 0x34) HS-mode Timing Register */ + RwReg TWIS_SRR; /**< \brief (TWIS Offset: 0x38) Slew Rate Register */ + RwReg TWIS_HSSRR; /**< \brief (TWIS Offset: 0x3C) HS-mode Slew Rate Register */ +} Twis; +#endif /* __ASSEMBLY__ */ +/* -------- TWIS_CR : (TWIS Offset: 0x00) Control Register -------- */ +#define TWIS_CR_SEN (0x1u << 0) /**< \brief (TWIS_CR) Slave Enable */ +#define TWIS_CR_SMEN (0x1u << 1) /**< \brief (TWIS_CR) SMBus Mode Enable */ +#define TWIS_CR_SMATCH (0x1u << 2) /**< \brief (TWIS_CR) Slave Address Match */ +#define TWIS_CR_GCMATCH (0x1u << 3) /**< \brief (TWIS_CR) General Call Address Match */ +#define TWIS_CR_STREN (0x1u << 4) /**< \brief (TWIS_CR) Clock Stretch Enable */ +#define TWIS_CR_SWRST (0x1u << 7) /**< \brief (TWIS_CR) Software Reset */ +#define TWIS_CR_SMBALERT (0x1u << 8) /**< \brief (TWIS_CR) SMBus Alert */ +#define TWIS_CR_SMDA (0x1u << 9) /**< \brief (TWIS_CR) SMBus Default Address */ +#define TWIS_CR_SMHH (0x1u << 10) /**< \brief (TWIS_CR) SMBus Host Header */ +#define TWIS_CR_PECEN (0x1u << 11) /**< \brief (TWIS_CR) Packet Error Checking Enable */ +#define TWIS_CR_ACK (0x1u << 12) /**< \brief (TWIS_CR) Slave Receiver Data Phase ACK Value */ +#define TWIS_CR_CUP (0x1u << 13) /**< \brief (TWIS_CR) NBYTES Count Up */ +#define TWIS_CR_SOAM (0x1u << 14) /**< \brief (TWIS_CR) Stretch Clock on Address Match */ +#define TWIS_CR_SODR (0x1u << 15) /**< \brief (TWIS_CR) Stretch Clock on Data Byte Reception */ +#define TWIS_CR_ADR_Pos 16 +#define TWIS_CR_ADR_Msk (0x3FFu << TWIS_CR_ADR_Pos) /**< \brief (TWIS_CR) Slave Address */ +#define TWIS_CR_ADR(value) ((TWIS_CR_ADR_Msk & ((value) << TWIS_CR_ADR_Pos))) +#define TWIS_CR_TENBIT (0x1u << 26) /**< \brief (TWIS_CR) Ten Bit Address Match */ +#define TWIS_CR_BRIDGE (0x1u << 27) /**< \brief (TWIS_CR) Bridge Control Enable */ +/* -------- TWIS_NBYTES : (TWIS Offset: 0x04) NBYTES Register -------- */ +#define TWIS_NBYTES_NBYTES_Pos 0 +#define TWIS_NBYTES_NBYTES_Msk (0xFFu << TWIS_NBYTES_NBYTES_Pos) /**< \brief (TWIS_NBYTES) Number of Bytes to Transfer */ +#define TWIS_NBYTES_NBYTES(value) ((TWIS_NBYTES_NBYTES_Msk & ((value) << TWIS_NBYTES_NBYTES_Pos))) +/* -------- TWIS_TR : (TWIS Offset: 0x08) Timing Register -------- */ +#define TWIS_TR_TLOWS_Pos 0 +#define TWIS_TR_TLOWS_Msk (0xFFu << TWIS_TR_TLOWS_Pos) /**< \brief (TWIS_TR) SMBus Tlow:sext Cycles */ +#define TWIS_TR_TLOWS(value) ((TWIS_TR_TLOWS_Msk & ((value) << TWIS_TR_TLOWS_Pos))) +#define TWIS_TR_TTOUT_Pos 8 +#define TWIS_TR_TTOUT_Msk (0xFFu << TWIS_TR_TTOUT_Pos) /**< \brief (TWIS_TR) SMBus Ttimeout Cycles */ +#define TWIS_TR_TTOUT(value) ((TWIS_TR_TTOUT_Msk & ((value) << TWIS_TR_TTOUT_Pos))) +#define TWIS_TR_SUDAT_Pos 16 +#define TWIS_TR_SUDAT_Msk (0xFFu << TWIS_TR_SUDAT_Pos) /**< \brief (TWIS_TR) Data Setup Cycles */ +#define TWIS_TR_SUDAT(value) ((TWIS_TR_SUDAT_Msk & ((value) << TWIS_TR_SUDAT_Pos))) +#define TWIS_TR_EXP_Pos 28 +#define TWIS_TR_EXP_Msk (0xFu << TWIS_TR_EXP_Pos) /**< \brief (TWIS_TR) Clock Prescaler */ +#define TWIS_TR_EXP(value) ((TWIS_TR_EXP_Msk & ((value) << TWIS_TR_EXP_Pos))) +/* -------- TWIS_RHR : (TWIS Offset: 0x0C) Receive Holding Register -------- */ +#define TWIS_RHR_RXDATA_Pos 0 +#define TWIS_RHR_RXDATA_Msk (0xFFu << TWIS_RHR_RXDATA_Pos) /**< \brief (TWIS_RHR) Received Data Byte */ +#define TWIS_RHR_RXDATA(value) ((TWIS_RHR_RXDATA_Msk & ((value) << TWIS_RHR_RXDATA_Pos))) +/* -------- TWIS_THR : (TWIS Offset: 0x10) Transmit Holding Register -------- */ +#define TWIS_THR_TXDATA_Pos 0 +#define TWIS_THR_TXDATA_Msk (0xFFu << TWIS_THR_TXDATA_Pos) /**< \brief (TWIS_THR) Data Byte to Transmit */ +#define TWIS_THR_TXDATA(value) ((TWIS_THR_TXDATA_Msk & ((value) << TWIS_THR_TXDATA_Pos))) +/* -------- TWIS_PECR : (TWIS Offset: 0x14) Packet Error Check Register -------- */ +#define TWIS_PECR_PEC_Pos 0 +#define TWIS_PECR_PEC_Msk (0xFFu << TWIS_PECR_PEC_Pos) /**< \brief (TWIS_PECR) Calculated PEC Value */ +#define TWIS_PECR_PEC(value) ((TWIS_PECR_PEC_Msk & ((value) << TWIS_PECR_PEC_Pos))) +/* -------- TWIS_SR : (TWIS Offset: 0x18) Status Register -------- */ +#define TWIS_SR_RXRDY (0x1u << 0) /**< \brief (TWIS_SR) RX Buffer Ready */ +#define TWIS_SR_TXRDY (0x1u << 1) /**< \brief (TWIS_SR) TX Buffer Ready */ +#define TWIS_SR_SEN (0x1u << 2) /**< \brief (TWIS_SR) Slave Enabled */ +#define TWIS_SR_TCOMP (0x1u << 3) /**< \brief (TWIS_SR) Transmission Complete */ +#define TWIS_SR_TRA (0x1u << 5) /**< \brief (TWIS_SR) Transmitter Mode */ +#define TWIS_SR_URUN (0x1u << 6) /**< \brief (TWIS_SR) Underrun */ +#define TWIS_SR_ORUN (0x1u << 7) /**< \brief (TWIS_SR) Overrun */ +#define TWIS_SR_NAK (0x1u << 8) /**< \brief (TWIS_SR) NAK Received */ +#define TWIS_SR_SMBTOUT (0x1u << 12) /**< \brief (TWIS_SR) SMBus Timeout */ +#define TWIS_SR_SMBPECERR (0x1u << 13) /**< \brief (TWIS_SR) SMBus PEC Error */ +#define TWIS_SR_BUSERR (0x1u << 14) /**< \brief (TWIS_SR) Bus Error */ +#define TWIS_SR_SAM (0x1u << 16) /**< \brief (TWIS_SR) Slave Address Match */ +#define TWIS_SR_GCM (0x1u << 17) /**< \brief (TWIS_SR) General Call Match */ +#define TWIS_SR_SMBALERTM (0x1u << 18) /**< \brief (TWIS_SR) SMBus Alert Response Address Match */ +#define TWIS_SR_SMBHHM (0x1u << 19) /**< \brief (TWIS_SR) SMBus Host Header Address Match */ +#define TWIS_SR_SMBDAM (0x1u << 20) /**< \brief (TWIS_SR) SMBus Default Address Match */ +#define TWIS_SR_STO (0x1u << 21) /**< \brief (TWIS_SR) Stop Received */ +#define TWIS_SR_REP (0x1u << 22) /**< \brief (TWIS_SR) Repeated Start Received */ +#define TWIS_SR_BTF (0x1u << 23) /**< \brief (TWIS_SR) Byte Transfer Finished */ +/* -------- TWIS_IER : (TWIS Offset: 0x1C) Interrupt Enable Register -------- */ +#define TWIS_IER_RXRDY (0x1u << 0) /**< \brief (TWIS_IER) RX Buffer Ready */ +#define TWIS_IER_TXRDY (0x1u << 1) /**< \brief (TWIS_IER) TX Buffer Ready */ +#define TWIS_IER_TCOMP (0x1u << 3) /**< \brief (TWIS_IER) Transmission Complete */ +#define TWIS_IER_URUN (0x1u << 6) /**< \brief (TWIS_IER) Underrun */ +#define TWIS_IER_ORUN (0x1u << 7) /**< \brief (TWIS_IER) Overrun */ +#define TWIS_IER_NAK (0x1u << 8) /**< \brief (TWIS_IER) NAK Received */ +#define TWIS_IER_SMBTOUT (0x1u << 12) /**< \brief (TWIS_IER) SMBus Timeout */ +#define TWIS_IER_SMBPECERR (0x1u << 13) /**< \brief (TWIS_IER) SMBus PEC Error */ +#define TWIS_IER_BUSERR (0x1u << 14) /**< \brief (TWIS_IER) Bus Error */ +#define TWIS_IER_SAM (0x1u << 16) /**< \brief (TWIS_IER) Slave Address Match */ +#define TWIS_IER_GCM (0x1u << 17) /**< \brief (TWIS_IER) General Call Match */ +#define TWIS_IER_SMBALERTM (0x1u << 18) /**< \brief (TWIS_IER) SMBus Alert Response Address Match */ +#define TWIS_IER_SMBHHM (0x1u << 19) /**< \brief (TWIS_IER) SMBus Host Header Address Match */ +#define TWIS_IER_SMBDAM (0x1u << 20) /**< \brief (TWIS_IER) SMBus Default Address Match */ +#define TWIS_IER_STO (0x1u << 21) /**< \brief (TWIS_IER) Stop Received */ +#define TWIS_IER_REP (0x1u << 22) /**< \brief (TWIS_IER) Repeated Start Received */ +#define TWIS_IER_BTF (0x1u << 23) /**< \brief (TWIS_IER) Byte Transfer Finished */ +/* -------- TWIS_IDR : (TWIS Offset: 0x20) Interrupt Disable Register -------- */ +#define TWIS_IDR_RXRDY (0x1u << 0) /**< \brief (TWIS_IDR) RX Buffer Ready */ +#define TWIS_IDR_TXRDY (0x1u << 1) /**< \brief (TWIS_IDR) TX Buffer Ready */ +#define TWIS_IDR_TCOMP (0x1u << 3) /**< \brief (TWIS_IDR) Transmission Complete */ +#define TWIS_IDR_URUN (0x1u << 6) /**< \brief (TWIS_IDR) Underrun */ +#define TWIS_IDR_ORUN (0x1u << 7) /**< \brief (TWIS_IDR) Overrun */ +#define TWIS_IDR_NAK (0x1u << 8) /**< \brief (TWIS_IDR) NAK Received */ +#define TWIS_IDR_SMBTOUT (0x1u << 12) /**< \brief (TWIS_IDR) SMBus Timeout */ +#define TWIS_IDR_SMBPECERR (0x1u << 13) /**< \brief (TWIS_IDR) SMBus PEC Error */ +#define TWIS_IDR_BUSERR (0x1u << 14) /**< \brief (TWIS_IDR) Bus Error */ +#define TWIS_IDR_SAM (0x1u << 16) /**< \brief (TWIS_IDR) Slave Address Match */ +#define TWIS_IDR_GCM (0x1u << 17) /**< \brief (TWIS_IDR) General Call Match */ +#define TWIS_IDR_SMBALERTM (0x1u << 18) /**< \brief (TWIS_IDR) SMBus Alert Response Address Match */ +#define TWIS_IDR_SMBHHM (0x1u << 19) /**< \brief (TWIS_IDR) SMBus Host Header Address Match */ +#define TWIS_IDR_SMBDAM (0x1u << 20) /**< \brief (TWIS_IDR) SMBus Default Address Match */ +#define TWIS_IDR_STO (0x1u << 21) /**< \brief (TWIS_IDR) Stop Received */ +#define TWIS_IDR_REP (0x1u << 22) /**< \brief (TWIS_IDR) Repeated Start Received */ +#define TWIS_IDR_BTF (0x1u << 23) /**< \brief (TWIS_IDR) Byte Transfer Finished */ +/* -------- TWIS_IMR : (TWIS Offset: 0x24) Interrupt Mask Register -------- */ +#define TWIS_IMR_RXRDY (0x1u << 0) /**< \brief (TWIS_IMR) RX Buffer Ready */ +#define TWIS_IMR_TXRDY (0x1u << 1) /**< \brief (TWIS_IMR) TX Buffer Ready */ +#define TWIS_IMR_TCOMP (0x1u << 3) /**< \brief (TWIS_IMR) Transmission Complete */ +#define TWIS_IMR_URUN (0x1u << 6) /**< \brief (TWIS_IMR) Underrun */ +#define TWIS_IMR_ORUN (0x1u << 7) /**< \brief (TWIS_IMR) Overrun */ +#define TWIS_IMR_NAK (0x1u << 8) /**< \brief (TWIS_IMR) NAK Received */ +#define TWIS_IMR_SMBTOUT (0x1u << 12) /**< \brief (TWIS_IMR) SMBus Timeout */ +#define TWIS_IMR_SMBPECERR (0x1u << 13) /**< \brief (TWIS_IMR) SMBus PEC Error */ +#define TWIS_IMR_BUSERR (0x1u << 14) /**< \brief (TWIS_IMR) Bus Error */ +#define TWIS_IMR_SAM (0x1u << 16) /**< \brief (TWIS_IMR) Slave Address Match */ +#define TWIS_IMR_GCM (0x1u << 17) /**< \brief (TWIS_IMR) General Call Match */ +#define TWIS_IMR_SMBALERTM (0x1u << 18) /**< \brief (TWIS_IMR) SMBus Alert Response Address Match */ +#define TWIS_IMR_SMBHHM (0x1u << 19) /**< \brief (TWIS_IMR) SMBus Host Header Address Match */ +#define TWIS_IMR_SMBDAM (0x1u << 20) /**< \brief (TWIS_IMR) SMBus Default Address Match */ +#define TWIS_IMR_STO (0x1u << 21) /**< \brief (TWIS_IMR) Stop Received */ +#define TWIS_IMR_REP (0x1u << 22) /**< \brief (TWIS_IMR) Repeated Start Received */ +#define TWIS_IMR_BTF (0x1u << 23) /**< \brief (TWIS_IMR) Byte Transfer Finished */ +/* -------- TWIS_SCR : (TWIS Offset: 0x28) Status Clear Register -------- */ +#define TWIS_SCR_TCOMP (0x1u << 3) /**< \brief (TWIS_SCR) Transmission Complete */ +#define TWIS_SCR_URUN (0x1u << 6) /**< \brief (TWIS_SCR) Underrun */ +#define TWIS_SCR_ORUN (0x1u << 7) /**< \brief (TWIS_SCR) Overrun */ +#define TWIS_SCR_NAK (0x1u << 8) /**< \brief (TWIS_SCR) NAK Received */ +#define TWIS_SCR_SMBTOUT (0x1u << 12) /**< \brief (TWIS_SCR) SMBus Timeout */ +#define TWIS_SCR_SMBPECERR (0x1u << 13) /**< \brief (TWIS_SCR) SMBus PEC Error */ +#define TWIS_SCR_BUSERR (0x1u << 14) /**< \brief (TWIS_SCR) Bus Error */ +#define TWIS_SCR_SAM (0x1u << 16) /**< \brief (TWIS_SCR) Slave Address Match */ +#define TWIS_SCR_GCM (0x1u << 17) /**< \brief (TWIS_SCR) General Call Match */ +#define TWIS_SCR_SMBALERTM (0x1u << 18) /**< \brief (TWIS_SCR) SMBus Alert Response Address Match */ +#define TWIS_SCR_SMBHHM (0x1u << 19) /**< \brief (TWIS_SCR) SMBus Host Header Address Match */ +#define TWIS_SCR_SMBDAM (0x1u << 20) /**< \brief (TWIS_SCR) SMBus Default Address Match */ +#define TWIS_SCR_STO (0x1u << 21) /**< \brief (TWIS_SCR) Stop Received */ +#define TWIS_SCR_REP (0x1u << 22) /**< \brief (TWIS_SCR) Repeated Start Received */ +#define TWIS_SCR_BTF (0x1u << 23) /**< \brief (TWIS_SCR) Byte Transfer Finished */ +/* -------- TWIS_PR : (TWIS Offset: 0x2C) Parameter Register -------- */ +#define TWIS_PR_HS (0x1u << 0) /**< \brief (TWIS_PR) HS-mode */ +/* -------- TWIS_VR : (TWIS Offset: 0x30) Version Register -------- */ +#define TWIS_VR_VERSION_Pos 0 +#define TWIS_VR_VERSION_Msk (0xFFFu << TWIS_VR_VERSION_Pos) /**< \brief (TWIS_VR) Version Number */ +#define TWIS_VR_VERSION(value) ((TWIS_VR_VERSION_Msk & ((value) << TWIS_VR_VERSION_Pos))) +#define TWIS_VR_VARIANT_Pos 16 +#define TWIS_VR_VARIANT_Msk (0xFu << TWIS_VR_VARIANT_Pos) /**< \brief (TWIS_VR) Variant Number */ +#define TWIS_VR_VARIANT(value) ((TWIS_VR_VARIANT_Msk & ((value) << TWIS_VR_VARIANT_Pos))) +/* -------- TWIS_HSTR : (TWIS Offset: 0x34) HS-mode Timing Register -------- */ +#define TWIS_HSTR_HDDAT_Pos 16 +#define TWIS_HSTR_HDDAT_Msk (0xFFu << TWIS_HSTR_HDDAT_Pos) /**< \brief (TWIS_HSTR) Data Hold Cycles */ +#define TWIS_HSTR_HDDAT(value) ((TWIS_HSTR_HDDAT_Msk & ((value) << TWIS_HSTR_HDDAT_Pos))) +/* -------- TWIS_SRR : (TWIS Offset: 0x38) Slew Rate Register -------- */ +#define TWIS_SRR_DADRIVEL_Pos 0 +#define TWIS_SRR_DADRIVEL_Msk (0x7u << TWIS_SRR_DADRIVEL_Pos) /**< \brief (TWIS_SRR) Data Drive Strength LOW */ +#define TWIS_SRR_DADRIVEL(value) ((TWIS_SRR_DADRIVEL_Msk & ((value) << TWIS_SRR_DADRIVEL_Pos))) +#define TWIS_SRR_DASLEW_Pos 8 +#define TWIS_SRR_DASLEW_Msk (0x3u << TWIS_SRR_DASLEW_Pos) /**< \brief (TWIS_SRR) Data Slew Limit */ +#define TWIS_SRR_DASLEW(value) ((TWIS_SRR_DASLEW_Msk & ((value) << TWIS_SRR_DASLEW_Pos))) +#define TWIS_SRR_FILTER_Pos 28 +#define TWIS_SRR_FILTER_Msk (0x3u << TWIS_SRR_FILTER_Pos) /**< \brief (TWIS_SRR) Input Spike Filter Control */ +#define TWIS_SRR_FILTER(value) ((TWIS_SRR_FILTER_Msk & ((value) << TWIS_SRR_FILTER_Pos))) +/* -------- TWIS_HSSRR : (TWIS Offset: 0x3C) HS-mode Slew Rate Register -------- */ +#define TWIS_HSSRR_DADRIVEL_Pos 0 +#define TWIS_HSSRR_DADRIVEL_Msk (0x7u << TWIS_HSSRR_DADRIVEL_Pos) /**< \brief (TWIS_HSSRR) Data Drive Strength LOW */ +#define TWIS_HSSRR_DADRIVEL(value) ((TWIS_HSSRR_DADRIVEL_Msk & ((value) << TWIS_HSSRR_DADRIVEL_Pos))) +#define TWIS_HSSRR_DASLEW_Pos 8 +#define TWIS_HSSRR_DASLEW_Msk (0x3u << TWIS_HSSRR_DASLEW_Pos) /**< \brief (TWIS_HSSRR) Data Slew Limit */ +#define TWIS_HSSRR_DASLEW(value) ((TWIS_HSSRR_DASLEW_Msk & ((value) << TWIS_HSSRR_DASLEW_Pos))) +#define TWIS_HSSRR_FILTER_Pos 28 +#define TWIS_HSSRR_FILTER_Msk (0x3u << TWIS_HSSRR_FILTER_Pos) /**< \brief (TWIS_HSSRR) Input Spike Filter Control */ +#define TWIS_HSSRR_FILTER(value) ((TWIS_HSSRR_FILTER_Msk & ((value) << TWIS_HSSRR_FILTER_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR USART */ +/* ============================================================================= */ +/** \addtogroup SAM4L_USART Universal Synchronous Asynchronous Receiver Transmitter */ +/*@{*/ + +#define REV_USART 0x6021 + +#ifndef __ASSEMBLY__ +/** \brief USART hardware registers */ +typedef struct { + WoReg US_CR; /**< \brief (USART Offset: 0x00) Control Register */ + RwReg US_MR; /**< \brief (USART Offset: 0x04) Mode Register */ + WoReg US_IER; /**< \brief (USART Offset: 0x08) Interrupt Enable Register */ + WoReg US_IDR; /**< \brief (USART Offset: 0x0C) Interrupt Disable Register */ + RoReg US_IMR; /**< \brief (USART Offset: 0x10) Interrupt Mask Register */ + RoReg US_CSR; /**< \brief (USART Offset: 0x14) Channel Status Register */ + RoReg US_RHR; /**< \brief (USART Offset: 0x18) Receiver Holding Register */ + WoReg US_THR; /**< \brief (USART Offset: 0x1C) Transmitter Holding Register */ + RwReg US_BRGR; /**< \brief (USART Offset: 0x20) Baud Rate Generator Register */ + RwReg US_RTOR; /**< \brief (USART Offset: 0x24) Receiver Time-out Register */ + RwReg US_TTGR; /**< \brief (USART Offset: 0x28) Transmitter Timeguard Register */ + RoReg Reserved1[5]; + RwReg US_FIDI; /**< \brief (USART Offset: 0x40) FI DI Ratio Register */ + RoReg US_NER; /**< \brief (USART Offset: 0x44) Number of Errors Register */ + RoReg Reserved2[1]; + RwReg US_IFR; /**< \brief (USART Offset: 0x4C) IrDA Filter Register */ + RwReg US_MAN; /**< \brief (USART Offset: 0x50) Manchester Configuration Register */ + RwReg US_LINMR; /**< \brief (USART Offset: 0x54) LIN Mode Register */ + RwReg US_LINIR; /**< \brief (USART Offset: 0x58) LIN Identifier Register */ + RoReg US_LINBRR; /**< \brief (USART Offset: 0x5C) LIN Baud Rate Register */ + RoReg Reserved3[33]; + RwReg US_WPMR; /**< \brief (USART Offset: 0xE4) Write Protect Mode Register */ + RoReg US_WPSR; /**< \brief (USART Offset: 0xE8) Write Protect Status Register */ + RoReg Reserved4[4]; + RoReg US_VERSION; /**< \brief (USART Offset: 0xFC) Version Register */ +} Usart; +#endif /* __ASSEMBLY__ */ +/* -------- US_LIN_CR : (USART Offset: 0x00) Control Register -------- */ +#define US_LIN_CR_RSTRX (0x1u << 2) /**< \brief (US_LIN_CR) Reset Receiver */ +#define US_LIN_CR_RSTRX_0 (0x0u << 2) /**< \brief (US_LIN_CR) No effect */ +#define US_LIN_CR_RSTRX_1 (0x1u << 2) /**< \brief (US_LIN_CR) Resets the receiver */ +#define US_LIN_CR_RSTTX (0x1u << 3) /**< \brief (US_LIN_CR) Reset Transmitter */ +#define US_LIN_CR_RSTTX_0 (0x0u << 3) /**< \brief (US_LIN_CR) No effect */ +#define US_LIN_CR_RSTTX_1 (0x1u << 3) /**< \brief (US_LIN_CR) Resets the transmitter */ +#define US_LIN_CR_RXEN (0x1u << 4) /**< \brief (US_LIN_CR) Receiver Enable */ +#define US_LIN_CR_RXEN_0 (0x0u << 4) /**< \brief (US_LIN_CR) No effect */ +#define US_LIN_CR_RXEN_1 (0x1u << 4) /**< \brief (US_LIN_CR) Enables the receiver, if RXDIS is 0 */ +#define US_LIN_CR_RXDIS (0x1u << 5) /**< \brief (US_LIN_CR) Receiver Disable */ +#define US_LIN_CR_RXDIS_0 (0x0u << 5) /**< \brief (US_LIN_CR) No effect */ +#define US_LIN_CR_RXDIS_1 (0x1u << 5) /**< \brief (US_LIN_CR) Disables the receiver */ +#define US_LIN_CR_TXEN (0x1u << 6) /**< \brief (US_LIN_CR) Transmitter Enable */ +#define US_LIN_CR_TXEN_0 (0x0u << 6) /**< \brief (US_LIN_CR) No effect */ +#define US_LIN_CR_TXEN_1 (0x1u << 6) /**< \brief (US_LIN_CR) Enables the transmitter if TXDIS is 0 */ +#define US_LIN_CR_TXDIS (0x1u << 7) /**< \brief (US_LIN_CR) Transmitter Disable */ +#define US_LIN_CR_TXDIS_0 (0x0u << 7) /**< \brief (US_LIN_CR) No effect */ +#define US_LIN_CR_TXDIS_1 (0x1u << 7) /**< \brief (US_LIN_CR) Disables the transmitter */ +#define US_LIN_CR_RSTSTA (0x1u << 8) /**< \brief (US_LIN_CR) Reset Status Bits */ +#define US_LIN_CR_RSTSTA_0 (0x0u << 8) /**< \brief (US_LIN_CR) No effect */ +#define US_LIN_CR_RSTSTA_1 (0x1u << 8) /**< \brief (US_LIN_CR) Resets the status bits PARE, FRAME, OVRE and RXBRK in the CSR */ +#define US_LIN_CR_STTBRK (0x1u << 9) /**< \brief (US_LIN_CR) Start Break */ +#define US_LIN_CR_STTBRK_0 (0x0u << 9) /**< \brief (US_LIN_CR) No effect */ +#define US_LIN_CR_STTBRK_1 (0x1u << 9) /**< \brief (US_LIN_CR) Starts transmission of a break after the characters present in THR and the Transmit Shift Register have been transmitted. No effect if a break is already being transmitted */ +#define US_LIN_CR_STPBRK (0x1u << 10) /**< \brief (US_LIN_CR) Stop Break */ +#define US_LIN_CR_STPBRK_0 (0x0u << 10) /**< \brief (US_LIN_CR) No effect */ +#define US_LIN_CR_STPBRK_1 (0x1u << 10) /**< \brief (US_LIN_CR) Stops transmission of the break after a minimum of one character length and transmits a high level during 12-bit periods.No effect if no break is being transmitted */ +#define US_LIN_CR_STTTO (0x1u << 11) /**< \brief (US_LIN_CR) Start Time-out */ +#define US_LIN_CR_STTTO_0 (0x0u << 11) /**< \brief (US_LIN_CR) No effect */ +#define US_LIN_CR_STTTO_1 (0x1u << 11) /**< \brief (US_LIN_CR) Starts waiting for a character before clocking the time-out counter */ +#define US_LIN_CR_SENDA (0x1u << 12) /**< \brief (US_LIN_CR) Send Address */ +#define US_LIN_CR_SENDA_0 (0x0u << 12) /**< \brief (US_LIN_CR) No effect */ +#define US_LIN_CR_SENDA_1 (0x1u << 12) /**< \brief (US_LIN_CR) In Multi-drop Mode only, the next character written to the THR is sent with the address bit set */ +#define US_LIN_CR_RSTIT (0x1u << 13) /**< \brief (US_LIN_CR) Reset Iterations */ +#define US_LIN_CR_RSTIT_0 (0x0u << 13) /**< \brief (US_LIN_CR) No effect */ +#define US_LIN_CR_RSTIT_1 (0x1u << 13) /**< \brief (US_LIN_CR) Resets ITERATION in CSR. No effect if the ISO7816 is not enabled */ +#define US_LIN_CR_RSTNACK (0x1u << 14) /**< \brief (US_LIN_CR) Reset Non Acknowledge */ +#define US_LIN_CR_RSTNACK_0 (0x0u << 14) /**< \brief (US_LIN_CR) No effect */ +#define US_LIN_CR_RSTNACK_1 (0x1u << 14) /**< \brief (US_LIN_CR) Resets NACK in CSR */ +#define US_LIN_CR_RETTO (0x1u << 15) /**< \brief (US_LIN_CR) Rearm Time-out */ +#define US_LIN_CR_RETTO_0 (0x0u << 15) /**< \brief (US_LIN_CR) No effect */ +#define US_LIN_CR_RETTO_1 (0x1u << 15) /**< \brief (US_LIN_CR) Restart Time-out */ +#define US_LIN_CR_DTREN (0x1u << 16) /**< \brief (US_LIN_CR) Data Terminal Ready Enable */ +#define US_LIN_CR_DTREN_0 (0x0u << 16) /**< \brief (US_LIN_CR) No effect */ +#define US_LIN_CR_DTREN_1 (0x1u << 16) /**< \brief (US_LIN_CR) Drives the pin DTR at 0 */ +#define US_LIN_CR_DTRDIS (0x1u << 17) /**< \brief (US_LIN_CR) Data Terminal Ready Disable */ +#define US_LIN_CR_DTRDIS_0 (0x0u << 17) /**< \brief (US_LIN_CR) No effect */ +#define US_LIN_CR_DTRDIS_1 (0x1u << 17) /**< \brief (US_LIN_CR) Drives the pin DTR to 1 */ +#define US_LIN_CR_RTSEN (0x1u << 18) /**< \brief (US_LIN_CR) Request to Send Enable */ +#define US_LIN_CR_RTSEN_0 (0x0u << 18) /**< \brief (US_LIN_CR) No effect */ +#define US_LIN_CR_RTSEN_1 (0x1u << 18) /**< \brief (US_LIN_CR) Drives the pin RTS to 0 */ +#define US_LIN_CR_RTSDIS (0x1u << 19) /**< \brief (US_LIN_CR) Request to Send Disable */ +#define US_LIN_CR_RTSDIS_0 (0x0u << 19) /**< \brief (US_LIN_CR) No effect */ +#define US_LIN_CR_RTSDIS_1 (0x1u << 19) /**< \brief (US_LIN_CR) Drives the pin RTS to 1 */ +#define US_LIN_CR_LINABT (0x1u << 20) /**< \brief (US_LIN_CR) Abort the current LIN transmission */ +#define US_LIN_CR_LINWKUP (0x1u << 21) /**< \brief (US_LIN_CR) Sends a wakeup signal on the LIN bus */ +/* -------- US_SPI_MASTER_CR : (USART Offset: 0x00) Control Register -------- */ +#define US_SPI_MASTER_CR_RSTRX (0x1u << 2) /**< \brief (US_SPI_MASTER_CR) Reset Receiver */ +#define US_SPI_MASTER_CR_RSTRX_0 (0x0u << 2) /**< \brief (US_SPI_MASTER_CR) No effect */ +#define US_SPI_MASTER_CR_RSTRX_1 (0x1u << 2) /**< \brief (US_SPI_MASTER_CR) Resets the receiver */ +#define US_SPI_MASTER_CR_RSTTX (0x1u << 3) /**< \brief (US_SPI_MASTER_CR) Reset Transmitter */ +#define US_SPI_MASTER_CR_RSTTX_0 (0x0u << 3) /**< \brief (US_SPI_MASTER_CR) No effect */ +#define US_SPI_MASTER_CR_RSTTX_1 (0x1u << 3) /**< \brief (US_SPI_MASTER_CR) Resets the transmitter */ +#define US_SPI_MASTER_CR_RXEN (0x1u << 4) /**< \brief (US_SPI_MASTER_CR) Receiver Enable */ +#define US_SPI_MASTER_CR_RXEN_0 (0x0u << 4) /**< \brief (US_SPI_MASTER_CR) No effect */ +#define US_SPI_MASTER_CR_RXEN_1 (0x1u << 4) /**< \brief (US_SPI_MASTER_CR) Enables the receiver, if RXDIS is 0 */ +#define US_SPI_MASTER_CR_RXDIS (0x1u << 5) /**< \brief (US_SPI_MASTER_CR) Receiver Disable */ +#define US_SPI_MASTER_CR_RXDIS_0 (0x0u << 5) /**< \brief (US_SPI_MASTER_CR) No effect */ +#define US_SPI_MASTER_CR_RXDIS_1 (0x1u << 5) /**< \brief (US_SPI_MASTER_CR) Disables the receiver */ +#define US_SPI_MASTER_CR_TXEN (0x1u << 6) /**< \brief (US_SPI_MASTER_CR) Transmitter Enable */ +#define US_SPI_MASTER_CR_TXEN_0 (0x0u << 6) /**< \brief (US_SPI_MASTER_CR) No effect */ +#define US_SPI_MASTER_CR_TXEN_1 (0x1u << 6) /**< \brief (US_SPI_MASTER_CR) Enables the transmitter if TXDIS is 0 */ +#define US_SPI_MASTER_CR_TXDIS (0x1u << 7) /**< \brief (US_SPI_MASTER_CR) Transmitter Disable */ +#define US_SPI_MASTER_CR_TXDIS_0 (0x0u << 7) /**< \brief (US_SPI_MASTER_CR) No effect */ +#define US_SPI_MASTER_CR_TXDIS_1 (0x1u << 7) /**< \brief (US_SPI_MASTER_CR) Disables the transmitter */ +#define US_SPI_MASTER_CR_RSTSTA (0x1u << 8) /**< \brief (US_SPI_MASTER_CR) Reset Status Bits */ +#define US_SPI_MASTER_CR_RSTSTA_0 (0x0u << 8) /**< \brief (US_SPI_MASTER_CR) No effect */ +#define US_SPI_MASTER_CR_RSTSTA_1 (0x1u << 8) /**< \brief (US_SPI_MASTER_CR) Resets the status bits PARE, FRAME, OVRE and RXBRK in the CSR */ +#define US_SPI_MASTER_CR_STTBRK (0x1u << 9) /**< \brief (US_SPI_MASTER_CR) Start Break */ +#define US_SPI_MASTER_CR_STTBRK_0 (0x0u << 9) /**< \brief (US_SPI_MASTER_CR) No effect */ +#define US_SPI_MASTER_CR_STTBRK_1 (0x1u << 9) /**< \brief (US_SPI_MASTER_CR) Starts transmission of a break after the characters present in THR and the Transmit Shift Register have been transmitted. No effect if a break is already being transmitted */ +#define US_SPI_MASTER_CR_STPBRK (0x1u << 10) /**< \brief (US_SPI_MASTER_CR) Stop Break */ +#define US_SPI_MASTER_CR_STPBRK_0 (0x0u << 10) /**< \brief (US_SPI_MASTER_CR) No effect */ +#define US_SPI_MASTER_CR_STPBRK_1 (0x1u << 10) /**< \brief (US_SPI_MASTER_CR) Stops transmission of the break after a minimum of one character length and transmits a high level during 12-bit periods.No effect if no break is being transmitted */ +#define US_SPI_MASTER_CR_STTTO (0x1u << 11) /**< \brief (US_SPI_MASTER_CR) Start Time-out */ +#define US_SPI_MASTER_CR_STTTO_0 (0x0u << 11) /**< \brief (US_SPI_MASTER_CR) No effect */ +#define US_SPI_MASTER_CR_STTTO_1 (0x1u << 11) /**< \brief (US_SPI_MASTER_CR) Starts waiting for a character before clocking the time-out counter */ +#define US_SPI_MASTER_CR_SENDA (0x1u << 12) /**< \brief (US_SPI_MASTER_CR) Send Address */ +#define US_SPI_MASTER_CR_SENDA_0 (0x0u << 12) /**< \brief (US_SPI_MASTER_CR) No effect */ +#define US_SPI_MASTER_CR_SENDA_1 (0x1u << 12) /**< \brief (US_SPI_MASTER_CR) In Multi-drop Mode only, the next character written to the THR is sent with the address bit set */ +#define US_SPI_MASTER_CR_RSTIT (0x1u << 13) /**< \brief (US_SPI_MASTER_CR) Reset Iterations */ +#define US_SPI_MASTER_CR_RSTIT_0 (0x0u << 13) /**< \brief (US_SPI_MASTER_CR) No effect */ +#define US_SPI_MASTER_CR_RSTIT_1 (0x1u << 13) /**< \brief (US_SPI_MASTER_CR) Resets ITERATION in CSR. No effect if the ISO7816 is not enabled */ +#define US_SPI_MASTER_CR_RSTNACK (0x1u << 14) /**< \brief (US_SPI_MASTER_CR) Reset Non Acknowledge */ +#define US_SPI_MASTER_CR_RSTNACK_0 (0x0u << 14) /**< \brief (US_SPI_MASTER_CR) No effect */ +#define US_SPI_MASTER_CR_RSTNACK_1 (0x1u << 14) /**< \brief (US_SPI_MASTER_CR) Resets NACK in CSR */ +#define US_SPI_MASTER_CR_RETTO (0x1u << 15) /**< \brief (US_SPI_MASTER_CR) Rearm Time-out */ +#define US_SPI_MASTER_CR_RETTO_0 (0x0u << 15) /**< \brief (US_SPI_MASTER_CR) No effect */ +#define US_SPI_MASTER_CR_RETTO_1 (0x1u << 15) /**< \brief (US_SPI_MASTER_CR) Restart Time-out */ +#define US_SPI_MASTER_CR_DTREN (0x1u << 16) /**< \brief (US_SPI_MASTER_CR) Data Terminal Ready Enable */ +#define US_SPI_MASTER_CR_DTREN_0 (0x0u << 16) /**< \brief (US_SPI_MASTER_CR) No effect */ +#define US_SPI_MASTER_CR_DTREN_1 (0x1u << 16) /**< \brief (US_SPI_MASTER_CR) Drives the pin DTR at 0 */ +#define US_SPI_MASTER_CR_DTRDIS (0x1u << 17) /**< \brief (US_SPI_MASTER_CR) Data Terminal Ready Disable */ +#define US_SPI_MASTER_CR_DTRDIS_0 (0x0u << 17) /**< \brief (US_SPI_MASTER_CR) No effect */ +#define US_SPI_MASTER_CR_DTRDIS_1 (0x1u << 17) /**< \brief (US_SPI_MASTER_CR) Drives the pin DTR to 1 */ +#define US_SPI_MASTER_CR_FCS (0x1u << 18) /**< \brief (US_SPI_MASTER_CR) Force SPI Chip Select */ +#define US_SPI_MASTER_CR_FCS_0 (0x0u << 18) /**< \brief (US_SPI_MASTER_CR) No effect */ +#define US_SPI_MASTER_CR_FCS_1 (0x1u << 18) /**< \brief (US_SPI_MASTER_CR) Forces the Slave Select Line NSS (RTS pin) to 0, even if USART is no transmitting, in order to address SPI slave devices supporting the CSAAT Mode (Chip Select Active After Transfer) */ +#define US_SPI_MASTER_CR_RCS (0x1u << 19) /**< \brief (US_SPI_MASTER_CR) Release SPI Chip Select */ +#define US_SPI_MASTER_CR_RCS_0 (0x0u << 19) /**< \brief (US_SPI_MASTER_CR) No effect */ +#define US_SPI_MASTER_CR_RCS_1 (0x1u << 19) /**< \brief (US_SPI_MASTER_CR) Releases the Slave Select Line NSS (RTS pin) */ +/* -------- US_USART_CR : (USART Offset: 0x00) Control Register -------- */ +#define US_USART_CR_RSTRX (0x1u << 2) /**< \brief (US_USART_CR) Reset Receiver */ +#define US_USART_CR_RSTRX_0 (0x0u << 2) /**< \brief (US_USART_CR) No effect */ +#define US_USART_CR_RSTRX_1 (0x1u << 2) /**< \brief (US_USART_CR) Resets the receiver */ +#define US_USART_CR_RSTTX (0x1u << 3) /**< \brief (US_USART_CR) Reset Transmitter */ +#define US_USART_CR_RSTTX_0 (0x0u << 3) /**< \brief (US_USART_CR) No effect */ +#define US_USART_CR_RSTTX_1 (0x1u << 3) /**< \brief (US_USART_CR) Resets the transmitter */ +#define US_USART_CR_RXEN (0x1u << 4) /**< \brief (US_USART_CR) Receiver Enable */ +#define US_USART_CR_RXEN_0 (0x0u << 4) /**< \brief (US_USART_CR) No effect */ +#define US_USART_CR_RXEN_1 (0x1u << 4) /**< \brief (US_USART_CR) Enables the receiver, if RXDIS is 0 */ +#define US_USART_CR_RXDIS (0x1u << 5) /**< \brief (US_USART_CR) Receiver Disable */ +#define US_USART_CR_RXDIS_0 (0x0u << 5) /**< \brief (US_USART_CR) No effect */ +#define US_USART_CR_RXDIS_1 (0x1u << 5) /**< \brief (US_USART_CR) Disables the receiver */ +#define US_USART_CR_TXEN (0x1u << 6) /**< \brief (US_USART_CR) Transmitter Enable */ +#define US_USART_CR_TXEN_0 (0x0u << 6) /**< \brief (US_USART_CR) No effect */ +#define US_USART_CR_TXEN_1 (0x1u << 6) /**< \brief (US_USART_CR) Enables the transmitter if TXDIS is 0 */ +#define US_USART_CR_TXDIS (0x1u << 7) /**< \brief (US_USART_CR) Transmitter Disable */ +#define US_USART_CR_TXDIS_0 (0x0u << 7) /**< \brief (US_USART_CR) No effect */ +#define US_USART_CR_TXDIS_1 (0x1u << 7) /**< \brief (US_USART_CR) Disables the transmitter */ +#define US_USART_CR_RSTSTA (0x1u << 8) /**< \brief (US_USART_CR) Reset Status Bits */ +#define US_USART_CR_RSTSTA_0 (0x0u << 8) /**< \brief (US_USART_CR) No effect */ +#define US_USART_CR_RSTSTA_1 (0x1u << 8) /**< \brief (US_USART_CR) Resets the status bits PARE, FRAME, OVRE and RXBRK in the CSR */ +#define US_USART_CR_STTBRK (0x1u << 9) /**< \brief (US_USART_CR) Start Break */ +#define US_USART_CR_STTBRK_0 (0x0u << 9) /**< \brief (US_USART_CR) No effect */ +#define US_USART_CR_STTBRK_1 (0x1u << 9) /**< \brief (US_USART_CR) Starts transmission of a break after the characters present in THR and the Transmit Shift Register have been transmitted. No effect if a break is already being transmitted */ +#define US_USART_CR_STPBRK (0x1u << 10) /**< \brief (US_USART_CR) Stop Break */ +#define US_USART_CR_STPBRK_0 (0x0u << 10) /**< \brief (US_USART_CR) No effect */ +#define US_USART_CR_STPBRK_1 (0x1u << 10) /**< \brief (US_USART_CR) Stops transmission of the break after a minimum of one character length and transmits a high level during 12-bit periods.No effect if no break is being transmitted */ +#define US_USART_CR_STTTO (0x1u << 11) /**< \brief (US_USART_CR) Start Time-out */ +#define US_USART_CR_STTTO_0 (0x0u << 11) /**< \brief (US_USART_CR) No effect */ +#define US_USART_CR_STTTO_1 (0x1u << 11) /**< \brief (US_USART_CR) Starts waiting for a character before clocking the time-out counter */ +#define US_USART_CR_SENDA (0x1u << 12) /**< \brief (US_USART_CR) Send Address */ +#define US_USART_CR_SENDA_0 (0x0u << 12) /**< \brief (US_USART_CR) No effect */ +#define US_USART_CR_SENDA_1 (0x1u << 12) /**< \brief (US_USART_CR) In Multi-drop Mode only, the next character written to the THR is sent with the address bit set */ +#define US_USART_CR_RSTIT (0x1u << 13) /**< \brief (US_USART_CR) Reset Iterations */ +#define US_USART_CR_RSTIT_0 (0x0u << 13) /**< \brief (US_USART_CR) No effect */ +#define US_USART_CR_RSTIT_1 (0x1u << 13) /**< \brief (US_USART_CR) Resets ITERATION in CSR. No effect if the ISO7816 is not enabled */ +#define US_USART_CR_RSTNACK (0x1u << 14) /**< \brief (US_USART_CR) Reset Non Acknowledge */ +#define US_USART_CR_RSTNACK_0 (0x0u << 14) /**< \brief (US_USART_CR) No effect */ +#define US_USART_CR_RSTNACK_1 (0x1u << 14) /**< \brief (US_USART_CR) Resets NACK in CSR */ +#define US_USART_CR_RETTO (0x1u << 15) /**< \brief (US_USART_CR) Rearm Time-out */ +#define US_USART_CR_RETTO_0 (0x0u << 15) /**< \brief (US_USART_CR) No effect */ +#define US_USART_CR_RETTO_1 (0x1u << 15) /**< \brief (US_USART_CR) Restart Time-out */ +#define US_USART_CR_DTREN (0x1u << 16) /**< \brief (US_USART_CR) Data Terminal Ready Enable */ +#define US_USART_CR_DTREN_0 (0x0u << 16) /**< \brief (US_USART_CR) No effect */ +#define US_USART_CR_DTREN_1 (0x1u << 16) /**< \brief (US_USART_CR) Drives the pin DTR at 0 */ +#define US_USART_CR_DTRDIS (0x1u << 17) /**< \brief (US_USART_CR) Data Terminal Ready Disable */ +#define US_USART_CR_DTRDIS_0 (0x0u << 17) /**< \brief (US_USART_CR) No effect */ +#define US_USART_CR_DTRDIS_1 (0x1u << 17) /**< \brief (US_USART_CR) Drives the pin DTR to 1 */ +#define US_USART_CR_RTSEN (0x1u << 18) /**< \brief (US_USART_CR) Request to Send Enable */ +#define US_USART_CR_RTSEN_0 (0x0u << 18) /**< \brief (US_USART_CR) No effect */ +#define US_USART_CR_RTSEN_1 (0x1u << 18) /**< \brief (US_USART_CR) Drives the pin RTS to 0 */ +#define US_USART_CR_RTSDIS (0x1u << 19) /**< \brief (US_USART_CR) Request to Send Disable */ +#define US_USART_CR_RTSDIS_0 (0x0u << 19) /**< \brief (US_USART_CR) No effect */ +#define US_USART_CR_RTSDIS_1 (0x1u << 19) /**< \brief (US_USART_CR) Drives the pin RTS to 1 */ +/* -------- US_CR : (USART Offset: 0x00) Control Register -------- */ +#define US_CR_RSTRX (0x1u << 2) /**< \brief (US_CR) Reset Receiver */ +#define US_CR_RSTTX (0x1u << 3) /**< \brief (US_CR) Reset Transmitter */ +#define US_CR_RXEN (0x1u << 4) /**< \brief (US_CR) Receiver Enable */ +#define US_CR_RXDIS (0x1u << 5) /**< \brief (US_CR) Receiver Disable */ +#define US_CR_TXEN (0x1u << 6) /**< \brief (US_CR) Transmitter Enable */ +#define US_CR_TXDIS (0x1u << 7) /**< \brief (US_CR) Transmitter Disable */ +#define US_CR_RSTSTA (0x1u << 8) /**< \brief (US_CR) Reset Status Bits */ +#define US_CR_STTBRK (0x1u << 9) /**< \brief (US_CR) Start Break */ +#define US_CR_STPBRK (0x1u << 10) /**< \brief (US_CR) Stop Break */ +#define US_CR_STTTO (0x1u << 11) /**< \brief (US_CR) Start Time-out */ +#define US_CR_SENDA (0x1u << 12) /**< \brief (US_CR) Send Address */ +#define US_CR_RSTIT (0x1u << 13) /**< \brief (US_CR) Reset Iterations */ +#define US_CR_RSTNACK (0x1u << 14) /**< \brief (US_CR) Reset Non Acknowledge */ +#define US_CR_RETTO (0x1u << 15) /**< \brief (US_CR) Rearm Time-out */ +#define US_CR_DTREN (0x1u << 16) /**< \brief (US_CR) Data Terminal Ready Enable */ +#define US_CR_DTRDIS (0x1u << 17) /**< \brief (US_CR) Data Terminal Ready Disable */ +#define US_CR_RTSEN (0x1u << 18) /**< \brief (US_CR) Request to Send Enable */ +#define US_CR_FCS (0x1u << 18) /**< \brief (US_CR) Force SPI Chip Select */ +#define US_CR_RTSDIS (0x1u << 19) /**< \brief (US_CR) Request to Send Disable */ +#define US_CR_RCS (0x1u << 19) /**< \brief (US_CR) Release SPI Chip Select */ +#define US_CR_LINABT (0x1u << 20) /**< \brief (US_CR) Abort the current LIN transmission */ +#define US_CR_LINWKUP (0x1u << 21) /**< \brief (US_CR) Sends a wakeup signal on the LIN bus */ + +/* -------- US_SPI_MR : (USART Offset: 0x04) Mode Register -------- */ +#define US_SPI_MR_MODE_Pos 0 +#define US_SPI_MR_MODE_Msk (0xFu << US_SPI_MR_MODE_Pos) /**< \brief (US_SPI_MR) Usart Mode */ +#define US_SPI_MR_MODE(value) ((US_SPI_MR_MODE_Msk & ((value) << US_SPI_MR_MODE_Pos))) +#define US_SPI_MR_MODE_NORMAL (0x0u << 0) /**< \brief (US_SPI_MR) Normal */ +#define US_SPI_MR_MODE_RS485 (0x1u << 0) /**< \brief (US_SPI_MR) RS485 */ +#define US_SPI_MR_MODE_HARDWARE (0x2u << 0) /**< \brief (US_SPI_MR) Hardware Handshaking */ +#define US_SPI_MR_MODE_MODEM (0x3u << 0) /**< \brief (US_SPI_MR) Modem */ +#define US_SPI_MR_MODE_ISO7816_T0 (0x4u << 0) /**< \brief (US_SPI_MR) IS07816 Protocol: T = 0 */ +#define US_SPI_MR_MODE_ISO7816_T1 (0x6u << 0) /**< \brief (US_SPI_MR) IS07816 Protocol: T = 1 */ +#define US_SPI_MR_MODE_IRDA (0x8u << 0) /**< \brief (US_SPI_MR) IrDA */ +#define US_SPI_MR_MODE_LIN_MASTER (0xAu << 0) /**< \brief (US_SPI_MR) LIN Master */ +#define US_SPI_MR_MODE_LIN_SLAVE (0xBu << 0) /**< \brief (US_SPI_MR) LIN Slave */ +#define US_SPI_MR_MODE_SPI_MASTER (0xEu << 0) /**< \brief (US_SPI_MR) SPI Master */ +#define US_SPI_MR_MODE_SPI_SLAVE (0xFu << 0) /**< \brief (US_SPI_MR) SPI Slave */ +#define US_SPI_MR_USCLKS_Pos 4 +#define US_SPI_MR_USCLKS_Msk (0x3u << US_SPI_MR_USCLKS_Pos) /**< \brief (US_SPI_MR) Clock Selection */ +#define US_SPI_MR_USCLKS(value) ((US_SPI_MR_USCLKS_Msk & ((value) << US_SPI_MR_USCLKS_Pos))) +#define US_SPI_MR_USCLKS_MCK (0x0u << 4) /**< \brief (US_SPI_MR) MCK */ +#define US_SPI_MR_USCLKS_MCK_DIV (0x1u << 4) /**< \brief (US_SPI_MR) MCK / DIV */ +#define US_SPI_MR_USCLKS_2 (0x2u << 4) /**< \brief (US_SPI_MR) Reserved */ +#define US_SPI_MR_USCLKS_SCK (0x3u << 4) /**< \brief (US_SPI_MR) SCK */ +#define US_SPI_MR_CHRL_Pos 6 +#define US_SPI_MR_CHRL_Msk (0x3u << US_SPI_MR_CHRL_Pos) /**< \brief (US_SPI_MR) Character Length. */ +#define US_SPI_MR_CHRL(value) ((US_SPI_MR_CHRL_Msk & ((value) << US_SPI_MR_CHRL_Pos))) +#define US_SPI_MR_CHRL_5 (0x0u << 6) /**< \brief (US_SPI_MR) 5 bits */ +#define US_SPI_MR_CHRL_6 (0x1u << 6) /**< \brief (US_SPI_MR) 6 bits */ +#define US_SPI_MR_CHRL_7 (0x2u << 6) /**< \brief (US_SPI_MR) 7 bits */ +#define US_SPI_MR_CHRL_8 (0x3u << 6) /**< \brief (US_SPI_MR) 8 bits */ +#define US_SPI_MR_CPHA (0x1u << 8) /**< \brief (US_SPI_MR) SPI CLock Phase */ +#define US_SPI_MR_CPHA_0 (0x0u << 8) /**< \brief (US_SPI_MR) Data is changed on the leading edge of SPCK and captured on the following edge of SPCK */ +#define US_SPI_MR_CPHA_1 (0x1u << 8) /**< \brief (US_SPI_MR) Data is captured on the leading edge of SPCK and changed on the following edge of SPCK */ +#define US_SPI_MR_PAR_Pos 9 +#define US_SPI_MR_PAR_Msk (0x7u << US_SPI_MR_PAR_Pos) /**< \brief (US_SPI_MR) Parity Type */ +#define US_SPI_MR_PAR(value) ((US_SPI_MR_PAR_Msk & ((value) << US_SPI_MR_PAR_Pos))) +#define US_SPI_MR_PAR_EVEN (0x0u << 9) /**< \brief (US_SPI_MR) Even parity */ +#define US_SPI_MR_PAR_ODD (0x1u << 9) /**< \brief (US_SPI_MR) Odd parity */ +#define US_SPI_MR_PAR_SPACE (0x2u << 9) /**< \brief (US_SPI_MR) Parity forced to 0 (Space) */ +#define US_SPI_MR_PAR_MARK (0x3u << 9) /**< \brief (US_SPI_MR) Parity forced to 1 (Mark) */ +#define US_SPI_MR_PAR_NONE (0x4u << 9) /**< \brief (US_SPI_MR) No Parity */ +#define US_SPI_MR_PAR_5 (0x5u << 9) /**< \brief (US_SPI_MR) No Parity */ +#define US_SPI_MR_PAR_MULTI (0x6u << 9) /**< \brief (US_SPI_MR) Multi-drop mode */ +#define US_SPI_MR_PAR_7 (0x7u << 9) /**< \brief (US_SPI_MR) Multi-drop mode */ +#define US_SPI_MR_NBSTOP_Pos 12 +#define US_SPI_MR_NBSTOP_Msk (0x3u << US_SPI_MR_NBSTOP_Pos) /**< \brief (US_SPI_MR) Number of Stop Bits */ +#define US_SPI_MR_NBSTOP(value) ((US_SPI_MR_NBSTOP_Msk & ((value) << US_SPI_MR_NBSTOP_Pos))) +#define US_SPI_MR_NBSTOP_1 (0x0u << 12) /**< \brief (US_SPI_MR) 1 stop bit */ +#define US_SPI_MR_NBSTOP_1_5 (0x1u << 12) /**< \brief (US_SPI_MR) 1.5 stop bits (Only valid if SYNC=0) */ +#define US_SPI_MR_NBSTOP_2 (0x2u << 12) /**< \brief (US_SPI_MR) 2 stop bits */ +#define US_SPI_MR_NBSTOP_3 (0x3u << 12) /**< \brief (US_SPI_MR) Reserved */ +#define US_SPI_MR_CHMODE_Pos 14 +#define US_SPI_MR_CHMODE_Msk (0x3u << US_SPI_MR_CHMODE_Pos) /**< \brief (US_SPI_MR) Channel Mode */ +#define US_SPI_MR_CHMODE(value) ((US_SPI_MR_CHMODE_Msk & ((value) << US_SPI_MR_CHMODE_Pos))) +#define US_SPI_MR_CHMODE_NORMAL (0x0u << 14) /**< \brief (US_SPI_MR) Normal Mode */ +#define US_SPI_MR_CHMODE_ECHO (0x1u << 14) /**< \brief (US_SPI_MR) Automatic Echo. Receiver input is connected to the TXD pin */ +#define US_SPI_MR_CHMODE_LOCAL_LOOP (0x2u << 14) /**< \brief (US_SPI_MR) Local Loopback. Transmitter output is connected to the Receiver Input */ +#define US_SPI_MR_CHMODE_REMOTE_LOOP (0x3u << 14) /**< \brief (US_SPI_MR) Remote Loopback. RXD pin is internally connected to the TXD pin */ +#define US_SPI_MR_CPOL (0x1u << 16) /**< \brief (US_SPI_MR) SPI Clock Polarity */ +#define US_SPI_MR_CPOL_ZERO (0x0u << 16) /**< \brief (US_SPI_MR) The inactive state value of SPCK is logic level zero */ +#define US_SPI_MR_CPOL_ONE (0x1u << 16) /**< \brief (US_SPI_MR) The inactive state value of SPCK is logic level one */ +#define US_SPI_MR_MODE9 (0x1u << 17) /**< \brief (US_SPI_MR) 9-bit Character Length */ +#define US_SPI_MR_MODE9_0 (0x0u << 17) /**< \brief (US_SPI_MR) CHRL defines character length */ +#define US_SPI_MR_MODE9_1 (0x1u << 17) /**< \brief (US_SPI_MR) 9-bit character length */ +#define US_SPI_MR_CLKO (0x1u << 18) /**< \brief (US_SPI_MR) Clock Output Select */ +#define US_SPI_MR_CLKO_0 (0x0u << 18) /**< \brief (US_SPI_MR) The USART does not drive the SCK pin */ +#define US_SPI_MR_CLKO_1 (0x1u << 18) /**< \brief (US_SPI_MR) The USART drives the SCK pin if USCLKS does not select the external clock SCK */ +#define US_SPI_MR_OVER (0x1u << 19) /**< \brief (US_SPI_MR) Oversampling Mode */ +#define US_SPI_MR_OVER_X16 (0x0u << 19) /**< \brief (US_SPI_MR) 16x Oversampling */ +#define US_SPI_MR_OVER_X8 (0x1u << 19) /**< \brief (US_SPI_MR) 8x Oversampling */ +#define US_SPI_MR_INACK (0x1u << 20) /**< \brief (US_SPI_MR) Inhibit Non Acknowledge */ +#define US_SPI_MR_INACK_0 (0x0u << 20) /**< \brief (US_SPI_MR) The NACK is generated */ +#define US_SPI_MR_INACK_1 (0x1u << 20) /**< \brief (US_SPI_MR) The NACK is not generated */ +#define US_SPI_MR_DSNACK (0x1u << 21) /**< \brief (US_SPI_MR) Disable Successive NACK */ +#define US_SPI_MR_DSNACK_0 (0x0u << 21) /**< \brief (US_SPI_MR) NACK is sent on the ISO line as soon as a parity error occurs in the received character (unless INACK is set) */ +#define US_SPI_MR_DSNACK_1 (0x1u << 21) /**< \brief (US_SPI_MR) Successive parity errors are counted up to the value specified in the MAX_ITERATION field. These parity errors generatea NACK on the ISO line. As soon as this value is reached, no additional NACK is sent on the ISO line. The flag ITERATION is asserted */ +#define US_SPI_MR_INVDATA (0x1u << 23) /**< \brief (US_SPI_MR) Inverted data */ +#define US_SPI_MR_MAX_ITERATION_Pos 24 +#define US_SPI_MR_MAX_ITERATION_Msk (0x7u << US_SPI_MR_MAX_ITERATION_Pos) /**< \brief (US_SPI_MR) Max interation */ +#define US_SPI_MR_MAX_ITERATION(value) ((US_SPI_MR_MAX_ITERATION_Msk & ((value) << US_SPI_MR_MAX_ITERATION_Pos))) +#define US_SPI_MR_FILTER (0x1u << 28) /**< \brief (US_SPI_MR) Infrared Receive Line Filter */ +#define US_SPI_MR_FILTER_0 (0x0u << 28) /**< \brief (US_SPI_MR) The USART does not filter the receive line */ +#define US_SPI_MR_FILTER_1 (0x1u << 28) /**< \brief (US_SPI_MR) The USART filters the receive line using a three-sample filter (1/16-bit clock) (2 over 3 majority) */ +/* -------- US_USART_MR : (USART Offset: 0x04) Mode Register -------- */ +#define US_USART_MR_MODE_Pos 0 +#define US_USART_MR_MODE_Msk (0xFu << US_USART_MR_MODE_Pos) /**< \brief (US_USART_MR) Usart Mode */ +#define US_USART_MR_MODE(value) ((US_USART_MR_MODE_Msk & ((value) << US_USART_MR_MODE_Pos))) +#define US_USART_MR_MODE_NORMAL (0x0u << 0) /**< \brief (US_USART_MR) Normal */ +#define US_USART_MR_MODE_RS485 (0x1u << 0) /**< \brief (US_USART_MR) RS485 */ +#define US_USART_MR_MODE_HARDWARE (0x2u << 0) /**< \brief (US_USART_MR) Hardware Handshaking */ +#define US_USART_MR_MODE_MODEM (0x3u << 0) /**< \brief (US_USART_MR) Modem */ +#define US_USART_MR_MODE_ISO7816_T0 (0x4u << 0) /**< \brief (US_USART_MR) IS07816 Protocol: T = 0 */ +#define US_USART_MR_MODE_ISO7816_T1 (0x6u << 0) /**< \brief (US_USART_MR) IS07816 Protocol: T = 1 */ +#define US_USART_MR_MODE_IRDA (0x8u << 0) /**< \brief (US_USART_MR) IrDA */ +#define US_USART_MR_MODE_LIN_MASTER (0xAu << 0) /**< \brief (US_USART_MR) LIN Master */ +#define US_USART_MR_MODE_LIN_SLAVE (0xBu << 0) /**< \brief (US_USART_MR) LIN Slave */ +#define US_USART_MR_MODE_SPI_MASTER (0xEu << 0) /**< \brief (US_USART_MR) SPI Master */ +#define US_USART_MR_MODE_SPI_SLAVE (0xFu << 0) /**< \brief (US_USART_MR) SPI Slave */ +#define US_USART_MR_USCLKS_Pos 4 +#define US_USART_MR_USCLKS_Msk (0x3u << US_USART_MR_USCLKS_Pos) /**< \brief (US_USART_MR) Clock Selection */ +#define US_USART_MR_USCLKS(value) ((US_USART_MR_USCLKS_Msk & ((value) << US_USART_MR_USCLKS_Pos))) +#define US_USART_MR_USCLKS_MCK (0x0u << 4) /**< \brief (US_USART_MR) MCK */ +#define US_USART_MR_USCLKS_MCK_DIV (0x1u << 4) /**< \brief (US_USART_MR) MCK / DIV */ +#define US_USART_MR_USCLKS_2 (0x2u << 4) /**< \brief (US_USART_MR) Reserved */ +#define US_USART_MR_USCLKS_SCK (0x3u << 4) /**< \brief (US_USART_MR) SCK */ +#define US_USART_MR_CHRL_Pos 6 +#define US_USART_MR_CHRL_Msk (0x3u << US_USART_MR_CHRL_Pos) /**< \brief (US_USART_MR) Character Length. */ +#define US_USART_MR_CHRL(value) ((US_USART_MR_CHRL_Msk & ((value) << US_USART_MR_CHRL_Pos))) +#define US_USART_MR_CHRL_5 (0x0u << 6) /**< \brief (US_USART_MR) 5 bits */ +#define US_USART_MR_CHRL_6 (0x1u << 6) /**< \brief (US_USART_MR) 6 bits */ +#define US_USART_MR_CHRL_7 (0x2u << 6) /**< \brief (US_USART_MR) 7 bits */ +#define US_USART_MR_CHRL_8 (0x3u << 6) /**< \brief (US_USART_MR) 8 bits */ +#define US_USART_MR_SYNC (0x1u << 8) /**< \brief (US_USART_MR) Synchronous Mode Select */ +#define US_USART_MR_SYNC_0 (0x0u << 8) /**< \brief (US_USART_MR) USART operates in Synchronous Mode */ +#define US_USART_MR_SYNC_1 (0x1u << 8) /**< \brief (US_USART_MR) USART operates in Asynchronous Mode */ +#define US_USART_MR_PAR_Pos 9 +#define US_USART_MR_PAR_Msk (0x7u << US_USART_MR_PAR_Pos) /**< \brief (US_USART_MR) Parity Type */ +#define US_USART_MR_PAR(value) ((US_USART_MR_PAR_Msk & ((value) << US_USART_MR_PAR_Pos))) +#define US_USART_MR_PAR_EVEN (0x0u << 9) /**< \brief (US_USART_MR) Even parity */ +#define US_USART_MR_PAR_ODD (0x1u << 9) /**< \brief (US_USART_MR) Odd parity */ +#define US_USART_MR_PAR_SPACE (0x2u << 9) /**< \brief (US_USART_MR) Parity forced to 0 (Space) */ +#define US_USART_MR_PAR_MARK (0x3u << 9) /**< \brief (US_USART_MR) Parity forced to 1 (Mark) */ +#define US_USART_MR_PAR_NONE (0x4u << 9) /**< \brief (US_USART_MR) No Parity */ +#define US_USART_MR_PAR_5 (0x5u << 9) /**< \brief (US_USART_MR) No Parity */ +#define US_USART_MR_PAR_MULTI (0x6u << 9) /**< \brief (US_USART_MR) Multi-drop mode */ +#define US_USART_MR_PAR_7 (0x7u << 9) /**< \brief (US_USART_MR) Multi-drop mode */ +#define US_USART_MR_NBSTOP_Pos 12 +#define US_USART_MR_NBSTOP_Msk (0x3u << US_USART_MR_NBSTOP_Pos) /**< \brief (US_USART_MR) Number of Stop Bits */ +#define US_USART_MR_NBSTOP(value) ((US_USART_MR_NBSTOP_Msk & ((value) << US_USART_MR_NBSTOP_Pos))) +#define US_USART_MR_NBSTOP_1 (0x0u << 12) /**< \brief (US_USART_MR) 1 stop bit */ +#define US_USART_MR_NBSTOP_1_5 (0x1u << 12) /**< \brief (US_USART_MR) 1.5 stop bits (Only valid if SYNC=0) */ +#define US_USART_MR_NBSTOP_2 (0x2u << 12) /**< \brief (US_USART_MR) 2 stop bits */ +#define US_USART_MR_NBSTOP_3 (0x3u << 12) /**< \brief (US_USART_MR) Reserved */ +#define US_USART_MR_CHMODE_Pos 14 +#define US_USART_MR_CHMODE_Msk (0x3u << US_USART_MR_CHMODE_Pos) /**< \brief (US_USART_MR) Channel Mode */ +#define US_USART_MR_CHMODE(value) ((US_USART_MR_CHMODE_Msk & ((value) << US_USART_MR_CHMODE_Pos))) +#define US_USART_MR_CHMODE_NORMAL (0x0u << 14) /**< \brief (US_USART_MR) Normal Mode */ +#define US_USART_MR_CHMODE_ECHO (0x1u << 14) /**< \brief (US_USART_MR) Automatic Echo. Receiver input is connected to the TXD pin */ +#define US_USART_MR_CHMODE_LOCAL_LOOP (0x2u << 14) /**< \brief (US_USART_MR) Local Loopback. Transmitter output is connected to the Receiver Input */ +#define US_USART_MR_CHMODE_REMOTE_LOOP (0x3u << 14) /**< \brief (US_USART_MR) Remote Loopback. RXD pin is internally connected to the TXD pin */ +#define US_USART_MR_MSBF (0x1u << 16) /**< \brief (US_USART_MR) Bit Order */ +#define US_USART_MR_MSBF_LSBF (0x0u << 16) /**< \brief (US_USART_MR) Least Significant Bit first */ +#define US_USART_MR_MSBF_MSBF (0x1u << 16) /**< \brief (US_USART_MR) Most Significant Bit first */ +#define US_USART_MR_MODE9 (0x1u << 17) /**< \brief (US_USART_MR) 9-bit Character Length */ +#define US_USART_MR_MODE9_0 (0x0u << 17) /**< \brief (US_USART_MR) CHRL defines character length */ +#define US_USART_MR_MODE9_1 (0x1u << 17) /**< \brief (US_USART_MR) 9-bit character length */ +#define US_USART_MR_CLKO (0x1u << 18) /**< \brief (US_USART_MR) Clock Output Select */ +#define US_USART_MR_CLKO_0 (0x0u << 18) /**< \brief (US_USART_MR) The USART does not drive the SCK pin */ +#define US_USART_MR_CLKO_1 (0x1u << 18) /**< \brief (US_USART_MR) The USART drives the SCK pin if USCLKS does not select the external clock SCK */ +#define US_USART_MR_OVER (0x1u << 19) /**< \brief (US_USART_MR) Oversampling Mode */ +#define US_USART_MR_OVER_X16 (0x0u << 19) /**< \brief (US_USART_MR) 16x Oversampling */ +#define US_USART_MR_OVER_X8 (0x1u << 19) /**< \brief (US_USART_MR) 8x Oversampling */ +#define US_USART_MR_INACK (0x1u << 20) /**< \brief (US_USART_MR) Inhibit Non Acknowledge */ +#define US_USART_MR_INACK_0 (0x0u << 20) /**< \brief (US_USART_MR) The NACK is generated */ +#define US_USART_MR_INACK_1 (0x1u << 20) /**< \brief (US_USART_MR) The NACK is not generated */ +#define US_USART_MR_DSNACK (0x1u << 21) /**< \brief (US_USART_MR) Disable Successive NACK */ +#define US_USART_MR_DSNACK_0 (0x0u << 21) /**< \brief (US_USART_MR) NACK is sent on the ISO line as soon as a parity error occurs in the received character (unless INACK is set) */ +#define US_USART_MR_DSNACK_1 (0x1u << 21) /**< \brief (US_USART_MR) Successive parity errors are counted up to the value specified in the MAX_ITERATION field. These parity errors generatea NACK on the ISO line. As soon as this value is reached, no additional NACK is sent on the ISO line. The flag ITERATION is asserted */ +#define US_USART_MR_VAR_SYNC (0x1u << 22) /**< \brief (US_USART_MR) Variable synchronization of command/data sync Start Frame Delimiter */ +#define US_USART_MR_VAR_SYNC_0 (0x0u << 22) /**< \brief (US_USART_MR) User defined configuration of command or data sync field depending on SYNC value */ +#define US_USART_MR_VAR_SYNC_1 (0x1u << 22) /**< \brief (US_USART_MR) The sync field is updated when a character is written into THR register */ +#define US_USART_MR_INVDATA (0x1u << 23) /**< \brief (US_USART_MR) Inverted data */ +#define US_USART_MR_MAX_ITERATION_Pos 24 +#define US_USART_MR_MAX_ITERATION_Msk (0x7u << US_USART_MR_MAX_ITERATION_Pos) /**< \brief (US_USART_MR) Max interation */ +#define US_USART_MR_MAX_ITERATION(value) ((US_USART_MR_MAX_ITERATION_Msk & ((value) << US_USART_MR_MAX_ITERATION_Pos))) +#define US_USART_MR_FILTER (0x1u << 28) /**< \brief (US_USART_MR) Infrared Receive Line Filter */ +#define US_USART_MR_FILTER_0 (0x0u << 28) /**< \brief (US_USART_MR) The USART does not filter the receive line */ +#define US_USART_MR_FILTER_1 (0x1u << 28) /**< \brief (US_USART_MR) The USART filters the receive line using a three-sample filter (1/16-bit clock) (2 over 3 majority) */ +#define US_USART_MR_MAN (0x1u << 29) /**< \brief (US_USART_MR) Manchester Encoder/Decoder Enable */ +#define US_USART_MR_MAN_0 (0x0u << 29) /**< \brief (US_USART_MR) Manchester Encoder/Decoder is disabled */ +#define US_USART_MR_MAN_1 (0x1u << 29) /**< \brief (US_USART_MR) Manchester Encoder/Decoder is enabled */ +#define US_USART_MR_MODSYNC (0x1u << 30) /**< \brief (US_USART_MR) Manchester Synchronization Mode */ +#define US_USART_MR_MODSYNC_0 (0x0u << 30) /**< \brief (US_USART_MR) The Manchester Start bit is a 0 to 1 transition */ +#define US_USART_MR_MODSYNC_1 (0x1u << 30) /**< \brief (US_USART_MR) The Manchester Start bit is a 1 to 0 transition */ +#define US_USART_MR_ONEBIT (0x1u << 31) /**< \brief (US_USART_MR) Start Frame Delimiter selector */ +#define US_USART_MR_ONEBIT_0 (0x0u << 31) /**< \brief (US_USART_MR) Start Frame delimiter is COMMAND or DATA SYNC */ +#define US_USART_MR_ONEBIT_1 (0x1u << 31) /**< \brief (US_USART_MR) Start Frame delimiter is One Bit */ +/* -------- US_MR : (USART Offset: 0x04) Mode Register -------- */ +#define US_MR_USART_MODE_Pos 0 +#define US_MR_USART_MODE_Msk (0xFu << US_MR_USART_MODE_Pos) /**< \brief (US_MR) Usart Mode */ +#define US_MR_USART_MODE(value) ((US_MR_USART_MODE_Msk & ((value) << US_MR_USART_MODE_Pos))) +#define US_MR_USART_MODE_NORMAL (0x0u << 0) /**< \brief (US_MR) Normal */ +#define US_MR_USART_MODE_RS485 (0x1u << 0) /**< \brief (US_MR) RS485 */ +#define US_MR_USART_MODE_HARDWARE (0x2u << 0) /**< \brief (US_MR) Hardware Handshaking */ +#define US_MR_USART_MODE_MODEM (0x3u << 0) /**< \brief (US_MR) Modem */ +#define US_MR_USART_MODE_ISO7816_T0 (0x4u << 0) /**< \brief (US_MR) IS07816 Protocol: T = 0 */ +#define US_MR_USART_MODE_ISO7816_T1 (0x6u << 0) /**< \brief (US_MR) IS07816 Protocol: T = 1 */ +#define US_MR_USART_MODE_IRDA (0x8u << 0) /**< \brief (US_MR) IrDA */ +#define US_MR_USART_MODE_LIN_MASTER (0xAu << 0) /**< \brief (US_MR) LIN Master */ +#define US_MR_USART_MODE_LIN_SLAVE (0xBu << 0) /**< \brief (US_MR) LIN Slave */ +#define US_MR_USART_MODE_SPI_MASTER (0xEu << 0) /**< \brief (US_MR) SPI Master */ +#define US_MR_USART_MODE_SPI_SLAVE (0xFu << 0) /**< \brief (US_MR) SPI Slave */ +#define US_MR_USCLKS_Pos 4 +#define US_MR_USCLKS_Msk (0x3u << US_MR_USCLKS_Pos) /**< \brief (US_MR) Clock Selection */ +#define US_MR_USCLKS(value) ((US_MR_USCLKS_Msk & ((value) << US_MR_USCLKS_Pos))) +#define US_MR_USCLKS_MCK (0x0u << 4) /**< \brief (US_MR) MCK */ +#define US_MR_USCLKS_MCK_DIV (0x1u << 4) /**< \brief (US_MR) MCK / DIV */ +#define US_MR_USCLKS_2 (0x2u << 4) /**< \brief (US_MR) Reserved */ +#define US_MR_USCLKS_SCK (0x3u << 4) /**< \brief (US_MR) SCK */ +#define US_MR_CHRL_Pos 6 +#define US_MR_CHRL_Msk (0x3u << US_MR_CHRL_Pos) /**< \brief (US_MR) Character Length. */ +#define US_MR_CHRL(value) ((US_MR_CHRL_Msk & ((value) << US_MR_CHRL_Pos))) +#define US_MR_CHRL_5 (0x0u << 6) /**< \brief (US_MR) 5 bits */ +#define US_MR_CHRL_6 (0x1u << 6) /**< \brief (US_MR) 6 bits */ +#define US_MR_CHRL_7 (0x2u << 6) /**< \brief (US_MR) 7 bits */ +#define US_MR_CHRL_8 (0x3u << 6) /**< \brief (US_MR) 8 bits */ +#define US_MR_CPHA (0x1u << 8) /**< \brief (US_MR) SPI CLock Phase */ +#define US_MR_SYNC (0x1u << 8) /**< \brief (US_MR) Synchronous Mode Select */ +#define US_MR_PAR_Pos 9 +#define US_MR_PAR_Msk (0x7u << US_MR_PAR_Pos) /**< \brief (US_MR) Parity Type */ +#define US_MR_PAR(value) ((US_MR_PAR_Msk & ((value) << US_MR_PAR_Pos))) +#define US_MR_PAR_EVEN (0x0u << 9) /**< \brief (US_MR) Even parity */ +#define US_MR_PAR_ODD (0x1u << 9) /**< \brief (US_MR) Odd parity */ +#define US_MR_PAR_SPACE (0x2u << 9) /**< \brief (US_MR) Parity forced to 0 (Space) */ +#define US_MR_PAR_MARK (0x3u << 9) /**< \brief (US_MR) Parity forced to 1 (Mark) */ +#define US_MR_PAR_NONE (0x4u << 9) /**< \brief (US_MR) No Parity */ +#define US_MR_PAR_5 (0x5u << 9) /**< \brief (US_MR) No Parity */ +#define US_MR_PAR_MULTI (0x6u << 9) /**< \brief (US_MR) Multi-drop mode */ +#define US_MR_PAR_7 (0x7u << 9) /**< \brief (US_MR) Multi-drop mode */ +#define US_MR_NBSTOP_Pos 12 +#define US_MR_NBSTOP_Msk (0x3u << US_MR_NBSTOP_Pos) /**< \brief (US_MR) Number of Stop Bits */ +#define US_MR_NBSTOP(value) ((US_MR_NBSTOP_Msk & ((value) << US_MR_NBSTOP_Pos))) +#define US_MR_NBSTOP_1 (0x0u << 12) /**< \brief (US_MR) 1 stop bit */ +#define US_MR_NBSTOP_1_5 (0x1u << 12) /**< \brief (US_MR) 1.5 stop bits (Only valid if SYNC=0) */ +#define US_MR_NBSTOP_2 (0x2u << 12) /**< \brief (US_MR) 2 stop bits */ +#define US_MR_NBSTOP_3 (0x3u << 12) /**< \brief (US_MR) Reserved */ +#define US_MR_CHMODE_Pos 14 +#define US_MR_CHMODE_Msk (0x3u << US_MR_CHMODE_Pos) /**< \brief (US_MR) Channel Mode */ +#define US_MR_CHMODE(value) ((US_MR_CHMODE_Msk & ((value) << US_MR_CHMODE_Pos))) +#define US_MR_CHMODE_NORMAL (0x0u << 14) /**< \brief (US_MR) Normal Mode */ +#define US_MR_CHMODE_ECHO (0x1u << 14) /**< \brief (US_MR) Automatic Echo. Receiver input is connected to the TXD pin */ +#define US_MR_CHMODE_LOCAL_LOOP (0x2u << 14) /**< \brief (US_MR) Local Loopback. Transmitter output is connected to the Receiver Input */ +#define US_MR_CHMODE_REMOTE_LOOP (0x3u << 14) /**< \brief (US_MR) Remote Loopback. RXD pin is internally connected to the TXD pin */ +#define US_MR_CPOL (0x1u << 16) /**< \brief (US_MR) SPI Clock Polarity */ +#define US_MR_MSBF (0x1u << 16) /**< \brief (US_MR) Bit Order */ +#define US_MR_USART_MODE9 (0x1u << 17) /**< \brief (US_MR) 9-bit Character Length */ +#define US_MR_CLKO (0x1u << 18) /**< \brief (US_MR) Clock Output Select */ +#define US_MR_OVER (0x1u << 19) /**< \brief (US_MR) Oversampling Mode */ +#define US_MR_INACK (0x1u << 20) /**< \brief (US_MR) Inhibit Non Acknowledge */ +#define US_MR_DSNACK (0x1u << 21) /**< \brief (US_MR) Disable Successive NACK */ +#define US_MR_VAR_SYNC (0x1u << 22) /**< \brief (US_MR) Variable synchronization of command/data sync Start Frame Delimiter */ +#define US_MR_INVDATA (0x1u << 23) /**< \brief (US_MR) Inverted data */ +#define US_MR_MAX_ITERATION_Pos 24 +#define US_MR_MAX_ITERATION_Msk (0x7u << US_MR_MAX_ITERATION_Pos) /**< \brief (US_MR) Max interation */ +#define US_MR_MAX_ITERATION(value) ((US_MR_MAX_ITERATION_Msk & ((value) << US_MR_MAX_ITERATION_Pos))) +#define US_MR_FILTER (0x1u << 28) /**< \brief (US_MR) Infrared Receive Line Filter */ +#define US_MR_MAN (0x1u << 29) /**< \brief (US_MR) Manchester Encoder/Decoder Enable */ +#define US_MR_MODSYNC (0x1u << 30) /**< \brief (US_MR) Manchester Synchronization Mode */ +#define US_MR_ONEBIT (0x1u << 31) /**< \brief (US_MR) Start Frame Delimiter selector */ + +/* -------- US_LIN_IER : (USART Offset: 0x08) Interrupt Enable Register -------- */ +#define US_LIN_IER_RXRDY (0x1u << 0) /**< \brief (US_LIN_IER) Receiver Ready Interrupt Enable */ +#define US_LIN_IER_RXRDY_0 (0x0u << 0) /**< \brief (US_LIN_IER) No Effect */ +#define US_LIN_IER_RXRDY_1 (0x1u << 0) /**< \brief (US_LIN_IER) Enables the interrupt */ +#define US_LIN_IER_TXRDY (0x1u << 1) /**< \brief (US_LIN_IER) Transmitter Ready Interrupt Enable */ +#define US_LIN_IER_TXRDY_0 (0x0u << 1) /**< \brief (US_LIN_IER) No Effect */ +#define US_LIN_IER_TXRDY_1 (0x1u << 1) /**< \brief (US_LIN_IER) Enables the interrupt */ +#define US_LIN_IER_RXBRK (0x1u << 2) /**< \brief (US_LIN_IER) Receiver Break Interrupt Enable */ +#define US_LIN_IER_RXBRK_0 (0x0u << 2) /**< \brief (US_LIN_IER) No Effect */ +#define US_LIN_IER_RXBRK_1 (0x1u << 2) /**< \brief (US_LIN_IER) Enables the interrupt */ +#define US_LIN_IER_ENDRX (0x1u << 3) /**< \brief (US_LIN_IER) End of Receive Transfer Interrupt Enable */ +#define US_LIN_IER_ENDRX_0 (0x0u << 3) /**< \brief (US_LIN_IER) No Effect */ +#define US_LIN_IER_ENDRX_1 (0x1u << 3) /**< \brief (US_LIN_IER) Enables the interrupt */ +#define US_LIN_IER_ENDTX (0x1u << 4) /**< \brief (US_LIN_IER) End of Transmit Interrupt Enable */ +#define US_LIN_IER_ENDTX_0 (0x0u << 4) /**< \brief (US_LIN_IER) No Effect */ +#define US_LIN_IER_ENDTX_1 (0x1u << 4) /**< \brief (US_LIN_IER) Enables the interrupt */ +#define US_LIN_IER_OVRE (0x1u << 5) /**< \brief (US_LIN_IER) Overrun Error Interrupt Enable */ +#define US_LIN_IER_OVRE_0 (0x0u << 5) /**< \brief (US_LIN_IER) No Effect */ +#define US_LIN_IER_OVRE_1 (0x1u << 5) /**< \brief (US_LIN_IER) Enables the interrupt */ +#define US_LIN_IER_FRAME (0x1u << 6) /**< \brief (US_LIN_IER) Framing Error Interrupt Enable */ +#define US_LIN_IER_FRAME_0 (0x0u << 6) /**< \brief (US_LIN_IER) No Effect */ +#define US_LIN_IER_FRAME_1 (0x1u << 6) /**< \brief (US_LIN_IER) Enables the interrupt */ +#define US_LIN_IER_PARE (0x1u << 7) /**< \brief (US_LIN_IER) Parity Error Interrupt Enable */ +#define US_LIN_IER_PARE_0 (0x0u << 7) /**< \brief (US_LIN_IER) No Effect */ +#define US_LIN_IER_PARE_1 (0x1u << 7) /**< \brief (US_LIN_IER) Enables the interrupt */ +#define US_LIN_IER_TIMEOUT (0x1u << 8) /**< \brief (US_LIN_IER) Time-out Interrupt Enable */ +#define US_LIN_IER_TIMEOUT_0 (0x0u << 8) /**< \brief (US_LIN_IER) No Effect */ +#define US_LIN_IER_TIMEOUT_1 (0x1u << 8) /**< \brief (US_LIN_IER) Enables the interrupt */ +#define US_LIN_IER_TXEMPTY (0x1u << 9) /**< \brief (US_LIN_IER) Transmitter Empty Interrupt Enable */ +#define US_LIN_IER_TXEMPTY_0 (0x0u << 9) /**< \brief (US_LIN_IER) No Effect */ +#define US_LIN_IER_TXEMPTY_1 (0x1u << 9) /**< \brief (US_LIN_IER) Enables the interrupt */ +#define US_LIN_IER_ITER (0x1u << 10) /**< \brief (US_LIN_IER) Iteration Interrupt Enable */ +#define US_LIN_IER_ITER_0 (0x0u << 10) /**< \brief (US_LIN_IER) No Effect */ +#define US_LIN_IER_ITER_1 (0x1u << 10) /**< \brief (US_LIN_IER) Enables the interrupt */ +#define US_LIN_IER_TXBUFE (0x1u << 11) /**< \brief (US_LIN_IER) Buffer Empty Interrupt Enable */ +#define US_LIN_IER_TXBUFE_0 (0x0u << 11) /**< \brief (US_LIN_IER) No Effect */ +#define US_LIN_IER_TXBUFE_1 (0x1u << 11) /**< \brief (US_LIN_IER) Enables the interrupt */ +#define US_LIN_IER_RXBUFF (0x1u << 12) /**< \brief (US_LIN_IER) Buffer Full Interrupt Enable */ +#define US_LIN_IER_RXBUFF_0 (0x0u << 12) /**< \brief (US_LIN_IER) No Effect */ +#define US_LIN_IER_RXBUFF_1 (0x1u << 12) /**< \brief (US_LIN_IER) Enables the interrupt */ +#define US_LIN_IER_NACK (0x1u << 13) /**< \brief (US_LIN_IER) Non Acknowledge or LIN Break Sent or LIN Break Received Interrupt Enable */ +#define US_LIN_IER_NACK_0 (0x0u << 13) /**< \brief (US_LIN_IER) No Effect */ +#define US_LIN_IER_NACK_1 (0x1u << 13) /**< \brief (US_LIN_IER) Enables the interrupt */ +#define US_LIN_IER_LINID (0x1u << 14) /**< \brief (US_LIN_IER) LIN Identifier Sent or LIN Identifier Received Interrupt Enable */ +#define US_LIN_IER_LINTC (0x1u << 15) /**< \brief (US_LIN_IER) LIN Transfer Conpleted Interrupt Enable */ +#define US_LIN_IER_RIIC (0x1u << 16) /**< \brief (US_LIN_IER) Ring Indicator Input Change Enable */ +#define US_LIN_IER_RIIC_0 (0x0u << 16) /**< \brief (US_LIN_IER) No Effect */ +#define US_LIN_IER_RIIC_1 (0x1u << 16) /**< \brief (US_LIN_IER) Enables the interrupt */ +#define US_LIN_IER_DSRIC (0x1u << 17) /**< \brief (US_LIN_IER) Data Set Ready Input Change Enable */ +#define US_LIN_IER_DSRIC_0 (0x0u << 17) /**< \brief (US_LIN_IER) No Effect */ +#define US_LIN_IER_DSRIC_1 (0x1u << 17) /**< \brief (US_LIN_IER) Enables the interrupt */ +#define US_LIN_IER_DCDIC (0x1u << 18) /**< \brief (US_LIN_IER) Data Carrier Detect Input Change Interrupt Enable */ +#define US_LIN_IER_DCDIC_0 (0x0u << 18) /**< \brief (US_LIN_IER) No Effect */ +#define US_LIN_IER_DCDIC_1 (0x1u << 18) /**< \brief (US_LIN_IER) Enables the interrupt */ +#define US_LIN_IER_CTSIC (0x1u << 19) /**< \brief (US_LIN_IER) Clear to Send Input Change Interrupt Enable */ +#define US_LIN_IER_CTSIC_0 (0x0u << 19) /**< \brief (US_LIN_IER) No Effect */ +#define US_LIN_IER_CTSIC_1 (0x1u << 19) /**< \brief (US_LIN_IER) Enables the interrupt */ +#define US_LIN_IER_LINBE (0x1u << 25) /**< \brief (US_LIN_IER) LIN Bus Error Interrupt Enable */ +#define US_LIN_IER_LINISFE (0x1u << 26) /**< \brief (US_LIN_IER) LIN Inconsistent Synch Field Error Interrupt Enable */ +#define US_LIN_IER_LINIPE (0x1u << 27) /**< \brief (US_LIN_IER) LIN Identifier Parity Interrupt Enable */ +#define US_LIN_IER_LINCE (0x1u << 28) /**< \brief (US_LIN_IER) LIN Checksum Error Interrupt Enable */ +#define US_LIN_IER_LINSNRE (0x1u << 29) /**< \brief (US_LIN_IER) LIN Slave Not Responding Error Interrupt Enable */ +#define US_LIN_IER_LINSTE (0x1u << 30) /**< \brief (US_LIN_IER) LIN Synch Tolerance Error Interrupt Enable */ +#define US_LIN_IER_LINSTE_0 (0x0u << 30) /**< \brief (US_LIN_IER) No Effect */ +#define US_LIN_IER_LINSTE_1 (0x1u << 30) /**< \brief (US_LIN_IER) Enables the interrupt */ +#define US_LIN_IER_LINHTE (0x1u << 31) /**< \brief (US_LIN_IER) LIN Header Timeout Error Interrupt Enable */ +#define US_LIN_IER_LINHTE_0 (0x0u << 31) /**< \brief (US_LIN_IER) No Effect */ +#define US_LIN_IER_LINHTE_1 (0x1u << 31) /**< \brief (US_LIN_IER) Enables the interrupt */ +/* -------- US_SPI_SLAVE_IER : (USART Offset: 0x08) Interrupt Enable Register -------- */ +#define US_SPI_SLAVE_IER_RXRDY (0x1u << 0) /**< \brief (US_SPI_SLAVE_IER) Receiver Ready Interrupt Enable */ +#define US_SPI_SLAVE_IER_RXRDY_0 (0x0u << 0) /**< \brief (US_SPI_SLAVE_IER) No Effect */ +#define US_SPI_SLAVE_IER_RXRDY_1 (0x1u << 0) /**< \brief (US_SPI_SLAVE_IER) Enables the interrupt */ +#define US_SPI_SLAVE_IER_TXRDY (0x1u << 1) /**< \brief (US_SPI_SLAVE_IER) Transmitter Ready Interrupt Enable */ +#define US_SPI_SLAVE_IER_TXRDY_0 (0x0u << 1) /**< \brief (US_SPI_SLAVE_IER) No Effect */ +#define US_SPI_SLAVE_IER_TXRDY_1 (0x1u << 1) /**< \brief (US_SPI_SLAVE_IER) Enables the interrupt */ +#define US_SPI_SLAVE_IER_RXBRK (0x1u << 2) /**< \brief (US_SPI_SLAVE_IER) Receiver Break Interrupt Enable */ +#define US_SPI_SLAVE_IER_RXBRK_0 (0x0u << 2) /**< \brief (US_SPI_SLAVE_IER) No Effect */ +#define US_SPI_SLAVE_IER_RXBRK_1 (0x1u << 2) /**< \brief (US_SPI_SLAVE_IER) Enables the interrupt */ +#define US_SPI_SLAVE_IER_ENDRX (0x1u << 3) /**< \brief (US_SPI_SLAVE_IER) End of Receive Transfer Interrupt Enable */ +#define US_SPI_SLAVE_IER_ENDRX_0 (0x0u << 3) /**< \brief (US_SPI_SLAVE_IER) No Effect */ +#define US_SPI_SLAVE_IER_ENDRX_1 (0x1u << 3) /**< \brief (US_SPI_SLAVE_IER) Enables the interrupt */ +#define US_SPI_SLAVE_IER_ENDTX (0x1u << 4) /**< \brief (US_SPI_SLAVE_IER) End of Transmit Interrupt Enable */ +#define US_SPI_SLAVE_IER_ENDTX_0 (0x0u << 4) /**< \brief (US_SPI_SLAVE_IER) No Effect */ +#define US_SPI_SLAVE_IER_ENDTX_1 (0x1u << 4) /**< \brief (US_SPI_SLAVE_IER) Enables the interrupt */ +#define US_SPI_SLAVE_IER_OVRE (0x1u << 5) /**< \brief (US_SPI_SLAVE_IER) Overrun Error Interrupt Enable */ +#define US_SPI_SLAVE_IER_OVRE_0 (0x0u << 5) /**< \brief (US_SPI_SLAVE_IER) No Effect */ +#define US_SPI_SLAVE_IER_OVRE_1 (0x1u << 5) /**< \brief (US_SPI_SLAVE_IER) Enables the interrupt */ +#define US_SPI_SLAVE_IER_FRAME (0x1u << 6) /**< \brief (US_SPI_SLAVE_IER) Framing Error Interrupt Enable */ +#define US_SPI_SLAVE_IER_FRAME_0 (0x0u << 6) /**< \brief (US_SPI_SLAVE_IER) No Effect */ +#define US_SPI_SLAVE_IER_FRAME_1 (0x1u << 6) /**< \brief (US_SPI_SLAVE_IER) Enables the interrupt */ +#define US_SPI_SLAVE_IER_PARE (0x1u << 7) /**< \brief (US_SPI_SLAVE_IER) Parity Error Interrupt Enable */ +#define US_SPI_SLAVE_IER_PARE_0 (0x0u << 7) /**< \brief (US_SPI_SLAVE_IER) No Effect */ +#define US_SPI_SLAVE_IER_PARE_1 (0x1u << 7) /**< \brief (US_SPI_SLAVE_IER) Enables the interrupt */ +#define US_SPI_SLAVE_IER_TIMEOUT (0x1u << 8) /**< \brief (US_SPI_SLAVE_IER) Time-out Interrupt Enable */ +#define US_SPI_SLAVE_IER_TIMEOUT_0 (0x0u << 8) /**< \brief (US_SPI_SLAVE_IER) No Effect */ +#define US_SPI_SLAVE_IER_TIMEOUT_1 (0x1u << 8) /**< \brief (US_SPI_SLAVE_IER) Enables the interrupt */ +#define US_SPI_SLAVE_IER_TXEMPTY (0x1u << 9) /**< \brief (US_SPI_SLAVE_IER) Transmitter Empty Interrupt Enable */ +#define US_SPI_SLAVE_IER_TXEMPTY_0 (0x0u << 9) /**< \brief (US_SPI_SLAVE_IER) No Effect */ +#define US_SPI_SLAVE_IER_TXEMPTY_1 (0x1u << 9) /**< \brief (US_SPI_SLAVE_IER) Enables the interrupt */ +#define US_SPI_SLAVE_IER_UNRE (0x1u << 10) /**< \brief (US_SPI_SLAVE_IER) SPI Underrun Error Interrupt Enable */ +#define US_SPI_SLAVE_IER_UNRE_0 (0x0u << 10) /**< \brief (US_SPI_SLAVE_IER) No Effect */ +#define US_SPI_SLAVE_IER_UNRE_1 (0x1u << 10) /**< \brief (US_SPI_SLAVE_IER) Enables the interrupt */ +#define US_SPI_SLAVE_IER_TXBUFE (0x1u << 11) /**< \brief (US_SPI_SLAVE_IER) Buffer Empty Interrupt Enable */ +#define US_SPI_SLAVE_IER_TXBUFE_0 (0x0u << 11) /**< \brief (US_SPI_SLAVE_IER) No Effect */ +#define US_SPI_SLAVE_IER_TXBUFE_1 (0x1u << 11) /**< \brief (US_SPI_SLAVE_IER) Enables the interrupt */ +#define US_SPI_SLAVE_IER_RXBUFF (0x1u << 12) /**< \brief (US_SPI_SLAVE_IER) Buffer Full Interrupt Enable */ +#define US_SPI_SLAVE_IER_RXBUFF_0 (0x0u << 12) /**< \brief (US_SPI_SLAVE_IER) No Effect */ +#define US_SPI_SLAVE_IER_RXBUFF_1 (0x1u << 12) /**< \brief (US_SPI_SLAVE_IER) Enables the interrupt */ +#define US_SPI_SLAVE_IER_NACK (0x1u << 13) /**< \brief (US_SPI_SLAVE_IER) Non Acknowledge Interrupt Enable */ +#define US_SPI_SLAVE_IER_NACK_0 (0x0u << 13) /**< \brief (US_SPI_SLAVE_IER) No Effect */ +#define US_SPI_SLAVE_IER_NACK_1 (0x1u << 13) /**< \brief (US_SPI_SLAVE_IER) Enables the interrupt */ +#define US_SPI_SLAVE_IER_RIIC (0x1u << 16) /**< \brief (US_SPI_SLAVE_IER) Ring Indicator Input Change Enable */ +#define US_SPI_SLAVE_IER_RIIC_0 (0x0u << 16) /**< \brief (US_SPI_SLAVE_IER) No Effect */ +#define US_SPI_SLAVE_IER_RIIC_1 (0x1u << 16) /**< \brief (US_SPI_SLAVE_IER) Enables the interrupt */ +#define US_SPI_SLAVE_IER_DSRIC (0x1u << 17) /**< \brief (US_SPI_SLAVE_IER) Data Set Ready Input Change Enable */ +#define US_SPI_SLAVE_IER_DSRIC_0 (0x0u << 17) /**< \brief (US_SPI_SLAVE_IER) No Effect */ +#define US_SPI_SLAVE_IER_DSRIC_1 (0x1u << 17) /**< \brief (US_SPI_SLAVE_IER) Enables the interrupt */ +#define US_SPI_SLAVE_IER_DCDIC (0x1u << 18) /**< \brief (US_SPI_SLAVE_IER) Data Carrier Detect Input Change Interrupt Enable */ +#define US_SPI_SLAVE_IER_DCDIC_0 (0x0u << 18) /**< \brief (US_SPI_SLAVE_IER) No Effect */ +#define US_SPI_SLAVE_IER_DCDIC_1 (0x1u << 18) /**< \brief (US_SPI_SLAVE_IER) Enables the interrupt */ +#define US_SPI_SLAVE_IER_CTSIC (0x1u << 19) /**< \brief (US_SPI_SLAVE_IER) Clear to Send Input Change Interrupt Enable */ +#define US_SPI_SLAVE_IER_CTSIC_0 (0x0u << 19) /**< \brief (US_SPI_SLAVE_IER) No Effect */ +#define US_SPI_SLAVE_IER_CTSIC_1 (0x1u << 19) /**< \brief (US_SPI_SLAVE_IER) Enables the interrupt */ +/* -------- US_USART_IER : (USART Offset: 0x08) Interrupt Enable Register -------- */ +#define US_USART_IER_RXRDY (0x1u << 0) /**< \brief (US_USART_IER) Receiver Ready Interrupt Enable */ +#define US_USART_IER_RXRDY_0 (0x0u << 0) /**< \brief (US_USART_IER) No Effect */ +#define US_USART_IER_RXRDY_1 (0x1u << 0) /**< \brief (US_USART_IER) Enables the interrupt */ +#define US_USART_IER_TXRDY (0x1u << 1) /**< \brief (US_USART_IER) Transmitter Ready Interrupt Enable */ +#define US_USART_IER_TXRDY_0 (0x0u << 1) /**< \brief (US_USART_IER) No Effect */ +#define US_USART_IER_TXRDY_1 (0x1u << 1) /**< \brief (US_USART_IER) Enables the interrupt */ +#define US_USART_IER_RXBRK (0x1u << 2) /**< \brief (US_USART_IER) Receiver Break Interrupt Enable */ +#define US_USART_IER_RXBRK_0 (0x0u << 2) /**< \brief (US_USART_IER) No Effect */ +#define US_USART_IER_RXBRK_1 (0x1u << 2) /**< \brief (US_USART_IER) Enables the interrupt */ +#define US_USART_IER_ENDRX (0x1u << 3) /**< \brief (US_USART_IER) End of Receive Transfer Interrupt Enable */ +#define US_USART_IER_ENDRX_0 (0x0u << 3) /**< \brief (US_USART_IER) No Effect */ +#define US_USART_IER_ENDRX_1 (0x1u << 3) /**< \brief (US_USART_IER) Enables the interrupt */ +#define US_USART_IER_ENDTX (0x1u << 4) /**< \brief (US_USART_IER) End of Transmit Interrupt Enable */ +#define US_USART_IER_ENDTX_0 (0x0u << 4) /**< \brief (US_USART_IER) No Effect */ +#define US_USART_IER_ENDTX_1 (0x1u << 4) /**< \brief (US_USART_IER) Enables the interrupt */ +#define US_USART_IER_OVRE (0x1u << 5) /**< \brief (US_USART_IER) Overrun Error Interrupt Enable */ +#define US_USART_IER_OVRE_0 (0x0u << 5) /**< \brief (US_USART_IER) No Effect */ +#define US_USART_IER_OVRE_1 (0x1u << 5) /**< \brief (US_USART_IER) Enables the interrupt */ +#define US_USART_IER_FRAME (0x1u << 6) /**< \brief (US_USART_IER) Framing Error Interrupt Enable */ +#define US_USART_IER_FRAME_0 (0x0u << 6) /**< \brief (US_USART_IER) No Effect */ +#define US_USART_IER_FRAME_1 (0x1u << 6) /**< \brief (US_USART_IER) Enables the interrupt */ +#define US_USART_IER_PARE (0x1u << 7) /**< \brief (US_USART_IER) Parity Error Interrupt Enable */ +#define US_USART_IER_PARE_0 (0x0u << 7) /**< \brief (US_USART_IER) No Effect */ +#define US_USART_IER_PARE_1 (0x1u << 7) /**< \brief (US_USART_IER) Enables the interrupt */ +#define US_USART_IER_TIMEOUT (0x1u << 8) /**< \brief (US_USART_IER) Time-out Interrupt Enable */ +#define US_USART_IER_TIMEOUT_0 (0x0u << 8) /**< \brief (US_USART_IER) No Effect */ +#define US_USART_IER_TIMEOUT_1 (0x1u << 8) /**< \brief (US_USART_IER) Enables the interrupt */ +#define US_USART_IER_TXEMPTY (0x1u << 9) /**< \brief (US_USART_IER) Transmitter Empty Interrupt Enable */ +#define US_USART_IER_TXEMPTY_0 (0x0u << 9) /**< \brief (US_USART_IER) No Effect */ +#define US_USART_IER_TXEMPTY_1 (0x1u << 9) /**< \brief (US_USART_IER) Enables the interrupt */ +#define US_USART_IER_ITER (0x1u << 10) /**< \brief (US_USART_IER) Iteration Interrupt Enable */ +#define US_USART_IER_ITER_0 (0x0u << 10) /**< \brief (US_USART_IER) No Effect */ +#define US_USART_IER_ITER_1 (0x1u << 10) /**< \brief (US_USART_IER) Enables the interrupt */ +#define US_USART_IER_TXBUFE (0x1u << 11) /**< \brief (US_USART_IER) Buffer Empty Interrupt Enable */ +#define US_USART_IER_TXBUFE_0 (0x0u << 11) /**< \brief (US_USART_IER) No Effect */ +#define US_USART_IER_TXBUFE_1 (0x1u << 11) /**< \brief (US_USART_IER) Enables the interrupt */ +#define US_USART_IER_RXBUFF (0x1u << 12) /**< \brief (US_USART_IER) Buffer Full Interrupt Enable */ +#define US_USART_IER_RXBUFF_0 (0x0u << 12) /**< \brief (US_USART_IER) No Effect */ +#define US_USART_IER_RXBUFF_1 (0x1u << 12) /**< \brief (US_USART_IER) Enables the interrupt */ +#define US_USART_IER_NACK (0x1u << 13) /**< \brief (US_USART_IER) Non Acknowledge Interrupt Enable */ +#define US_USART_IER_NACK_0 (0x0u << 13) /**< \brief (US_USART_IER) No Effect */ +#define US_USART_IER_NACK_1 (0x1u << 13) /**< \brief (US_USART_IER) Enables the interrupt */ +#define US_USART_IER_RIIC (0x1u << 16) /**< \brief (US_USART_IER) Ring Indicator Input Change Enable */ +#define US_USART_IER_RIIC_0 (0x0u << 16) /**< \brief (US_USART_IER) No Effect */ +#define US_USART_IER_RIIC_1 (0x1u << 16) /**< \brief (US_USART_IER) Enables the interrupt */ +#define US_USART_IER_DSRIC (0x1u << 17) /**< \brief (US_USART_IER) Data Set Ready Input Change Enable */ +#define US_USART_IER_DSRIC_0 (0x0u << 17) /**< \brief (US_USART_IER) No Effect */ +#define US_USART_IER_DSRIC_1 (0x1u << 17) /**< \brief (US_USART_IER) Enables the interrupt */ +#define US_USART_IER_DCDIC (0x1u << 18) /**< \brief (US_USART_IER) Data Carrier Detect Input Change Interrupt Enable */ +#define US_USART_IER_DCDIC_0 (0x0u << 18) /**< \brief (US_USART_IER) No Effect */ +#define US_USART_IER_DCDIC_1 (0x1u << 18) /**< \brief (US_USART_IER) Enables the interrupt */ +#define US_USART_IER_CTSIC (0x1u << 19) /**< \brief (US_USART_IER) Clear to Send Input Change Interrupt Enable */ +#define US_USART_IER_CTSIC_0 (0x0u << 19) /**< \brief (US_USART_IER) No Effect */ +#define US_USART_IER_CTSIC_1 (0x1u << 19) /**< \brief (US_USART_IER) Enables the interrupt */ +#define US_USART_IER_MANE (0x1u << 20) /**< \brief (US_USART_IER) Manchester Error Interrupt Enable */ +#define US_USART_IER_MANEA (0x1u << 24) /**< \brief (US_USART_IER) Manchester Error Interrupt Enable */ +#define US_USART_IER_MANEA_0 (0x0u << 24) /**< \brief (US_USART_IER) No effect */ +#define US_USART_IER_MANEA_1 (0x1u << 24) /**< \brief (US_USART_IER) Enables the interrupt */ +/* -------- US_IER : (USART Offset: 0x08) Interrupt Enable Register -------- */ +#define US_IER_RXRDY (0x1u << 0) /**< \brief (US_IER) Receiver Ready Interrupt Enable */ +#define US_IER_TXRDY (0x1u << 1) /**< \brief (US_IER) Transmitter Ready Interrupt Enable */ +#define US_IER_RXBRK (0x1u << 2) /**< \brief (US_IER) Receiver Break Interrupt Enable */ +#define US_IER_ENDRX (0x1u << 3) /**< \brief (US_IER) End of Receive Transfer Interrupt Enable */ +#define US_IER_ENDTX (0x1u << 4) /**< \brief (US_IER) End of Transmit Interrupt Enable */ +#define US_IER_OVRE (0x1u << 5) /**< \brief (US_IER) Overrun Error Interrupt Enable */ +#define US_IER_FRAME (0x1u << 6) /**< \brief (US_IER) Framing Error Interrupt Enable */ +#define US_IER_PARE (0x1u << 7) /**< \brief (US_IER) Parity Error Interrupt Enable */ +#define US_IER_TIMEOUT (0x1u << 8) /**< \brief (US_IER) Time-out Interrupt Enable */ +#define US_IER_TXEMPTY (0x1u << 9) /**< \brief (US_IER) Transmitter Empty Interrupt Enable */ +#define US_IER_ITER (0x1u << 10) /**< \brief (US_IER) Iteration Interrupt Enable */ +#define US_IER_UNRE (0x1u << 10) /**< \brief (US_IER) SPI Underrun Error Interrupt Enable */ +#define US_IER_TXBUFE (0x1u << 11) /**< \brief (US_IER) Buffer Empty Interrupt Enable */ +#define US_IER_RXBUFF (0x1u << 12) /**< \brief (US_IER) Buffer Full Interrupt Enable */ +#define US_IER_NACK (0x1u << 13) /**< \brief (US_IER) Non Acknowledge or LIN Break Sent or LIN Break Received Interrupt Enable */ +#define US_IER_LINID (0x1u << 14) /**< \brief (US_IER) LIN Identifier Sent or LIN Identifier Received Interrupt Enable */ +#define US_IER_LINTC (0x1u << 15) /**< \brief (US_IER) LIN Transfer Conpleted Interrupt Enable */ +#define US_IER_RIIC (0x1u << 16) /**< \brief (US_IER) Ring Indicator Input Change Enable */ +#define US_IER_DSRIC (0x1u << 17) /**< \brief (US_IER) Data Set Ready Input Change Enable */ +#define US_IER_DCDIC (0x1u << 18) /**< \brief (US_IER) Data Carrier Detect Input Change Interrupt Enable */ +#define US_IER_CTSIC (0x1u << 19) /**< \brief (US_IER) Clear to Send Input Change Interrupt Enable */ +#define US_IER_MANE (0x1u << 20) /**< \brief (US_IER) Manchester Error Interrupt Enable */ +#define US_IER_MANEA (0x1u << 24) /**< \brief (US_IER) Manchester Error Interrupt Enable */ +#define US_IER_LINBE (0x1u << 25) /**< \brief (US_IER) LIN Bus Error Interrupt Enable */ +#define US_IER_LINISFE (0x1u << 26) /**< \brief (US_IER) LIN Inconsistent Synch Field Error Interrupt Enable */ +#define US_IER_LINIPE (0x1u << 27) /**< \brief (US_IER) LIN Identifier Parity Interrupt Enable */ +#define US_IER_LINCE (0x1u << 28) /**< \brief (US_IER) LIN Checksum Error Interrupt Enable */ +#define US_IER_LINSNRE (0x1u << 29) /**< \brief (US_IER) LIN Slave Not Responding Error Interrupt Enable */ +#define US_IER_LINSTE (0x1u << 30) /**< \brief (US_IER) LIN Synch Tolerance Error Interrupt Enable */ +#define US_IER_LINHTE (0x1u << 31) /**< \brief (US_IER) LIN Header Timeout Error Interrupt Enable */ + +/* -------- US_LIN_IDR : (USART Offset: 0x0C) Interrupt Disable Register -------- */ +#define US_LIN_IDR_RXRDY (0x1u << 0) /**< \brief (US_LIN_IDR) Receiver Ready Interrupt Disable */ +#define US_LIN_IDR_RXRDY_0 (0x0u << 0) /**< \brief (US_LIN_IDR) No Effect */ +#define US_LIN_IDR_RXRDY_1 (0x1u << 0) /**< \brief (US_LIN_IDR) Disables the interrupt */ +#define US_LIN_IDR_TXRDY (0x1u << 1) /**< \brief (US_LIN_IDR) Transmitter Ready Interrupt Disable */ +#define US_LIN_IDR_TXRDY_0 (0x0u << 1) /**< \brief (US_LIN_IDR) No Effect */ +#define US_LIN_IDR_TXRDY_1 (0x1u << 1) /**< \brief (US_LIN_IDR) Disables the interrupt */ +#define US_LIN_IDR_RXBRK (0x1u << 2) /**< \brief (US_LIN_IDR) Receiver Break Interrupt Disable */ +#define US_LIN_IDR_RXBRK_0 (0x0u << 2) /**< \brief (US_LIN_IDR) No Effect */ +#define US_LIN_IDR_RXBRK_1 (0x1u << 2) /**< \brief (US_LIN_IDR) Disables the interrupt */ +#define US_LIN_IDR_ENDRX (0x1u << 3) /**< \brief (US_LIN_IDR) End of Receive Transfer Interrupt Disable */ +#define US_LIN_IDR_ENDRX_0 (0x0u << 3) /**< \brief (US_LIN_IDR) No Effect */ +#define US_LIN_IDR_ENDRX_1 (0x1u << 3) /**< \brief (US_LIN_IDR) Disables the interrupt */ +#define US_LIN_IDR_ENDTX (0x1u << 4) /**< \brief (US_LIN_IDR) End of Transmit Interrupt Disable */ +#define US_LIN_IDR_ENDTX_0 (0x0u << 4) /**< \brief (US_LIN_IDR) No Effect */ +#define US_LIN_IDR_ENDTX_1 (0x1u << 4) /**< \brief (US_LIN_IDR) Disables the interrupt */ +#define US_LIN_IDR_OVRE (0x1u << 5) /**< \brief (US_LIN_IDR) Overrun Error Interrupt Disable */ +#define US_LIN_IDR_OVRE_0 (0x0u << 5) /**< \brief (US_LIN_IDR) No Effect */ +#define US_LIN_IDR_OVRE_1 (0x1u << 5) /**< \brief (US_LIN_IDR) Disables the interrupt */ +#define US_LIN_IDR_FRAME (0x1u << 6) /**< \brief (US_LIN_IDR) Framing Error Interrupt Disable */ +#define US_LIN_IDR_FRAME_0 (0x0u << 6) /**< \brief (US_LIN_IDR) No Effect */ +#define US_LIN_IDR_FRAME_1 (0x1u << 6) /**< \brief (US_LIN_IDR) Disables the interrupt */ +#define US_LIN_IDR_PARE (0x1u << 7) /**< \brief (US_LIN_IDR) Parity Error Interrupt Disable */ +#define US_LIN_IDR_PARE_0 (0x0u << 7) /**< \brief (US_LIN_IDR) No Effect */ +#define US_LIN_IDR_PARE_1 (0x1u << 7) /**< \brief (US_LIN_IDR) Disables the interrupt */ +#define US_LIN_IDR_TIMEOUT (0x1u << 8) /**< \brief (US_LIN_IDR) Time-out Interrupt Disable */ +#define US_LIN_IDR_TIMEOUT_0 (0x0u << 8) /**< \brief (US_LIN_IDR) No Effect */ +#define US_LIN_IDR_TIMEOUT_1 (0x1u << 8) /**< \brief (US_LIN_IDR) Disables the interrupt */ +#define US_LIN_IDR_TXEMPTY (0x1u << 9) /**< \brief (US_LIN_IDR) Transmitter Empty Interrupt Disable */ +#define US_LIN_IDR_TXEMPTY_0 (0x0u << 9) /**< \brief (US_LIN_IDR) No Effect */ +#define US_LIN_IDR_TXEMPTY_1 (0x1u << 9) /**< \brief (US_LIN_IDR) Disables the interrupt */ +#define US_LIN_IDR_ITER (0x1u << 10) /**< \brief (US_LIN_IDR) Iteration Interrupt Disable */ +#define US_LIN_IDR_ITER_0 (0x0u << 10) /**< \brief (US_LIN_IDR) No Effect */ +#define US_LIN_IDR_ITER_1 (0x1u << 10) /**< \brief (US_LIN_IDR) Disables the interrupt */ +#define US_LIN_IDR_TXBUFE (0x1u << 11) /**< \brief (US_LIN_IDR) Buffer Empty Interrupt Disable */ +#define US_LIN_IDR_TXBUFE_0 (0x0u << 11) /**< \brief (US_LIN_IDR) No Effect */ +#define US_LIN_IDR_TXBUFE_1 (0x1u << 11) /**< \brief (US_LIN_IDR) Disables the interrupt */ +#define US_LIN_IDR_RXBUFF (0x1u << 12) /**< \brief (US_LIN_IDR) Buffer Full Interrupt Disable */ +#define US_LIN_IDR_RXBUFF_0 (0x0u << 12) /**< \brief (US_LIN_IDR) No Effect */ +#define US_LIN_IDR_RXBUFF_1 (0x1u << 12) /**< \brief (US_LIN_IDR) Disables the interrupt */ +#define US_LIN_IDR_NACK (0x1u << 13) /**< \brief (US_LIN_IDR) Non Acknowledge or LIN Break Sent or LIN Break Received Interrupt Disable */ +#define US_LIN_IDR_NACK_0 (0x0u << 13) /**< \brief (US_LIN_IDR) No Effect */ +#define US_LIN_IDR_NACK_1 (0x1u << 13) /**< \brief (US_LIN_IDR) Disables the interrupt */ +#define US_LIN_IDR_LINID (0x1u << 14) /**< \brief (US_LIN_IDR) LIN Identifier Sent or LIN Identifier Received Interrupt Disable */ +#define US_LIN_IDR_LINTC (0x1u << 15) /**< \brief (US_LIN_IDR) LIN Transfer Conpleted Interrupt Disable */ +#define US_LIN_IDR_RIIC (0x1u << 16) /**< \brief (US_LIN_IDR) Ring Indicator Input Change Disable */ +#define US_LIN_IDR_RIIC_0 (0x0u << 16) /**< \brief (US_LIN_IDR) No Effect */ +#define US_LIN_IDR_RIIC_1 (0x1u << 16) /**< \brief (US_LIN_IDR) Disables the interrupt */ +#define US_LIN_IDR_DSRIC (0x1u << 17) /**< \brief (US_LIN_IDR) Data Set Ready Input Change Disable */ +#define US_LIN_IDR_DSRIC_0 (0x0u << 17) /**< \brief (US_LIN_IDR) No Effect */ +#define US_LIN_IDR_DSRIC_1 (0x1u << 17) /**< \brief (US_LIN_IDR) Disables the interrupt */ +#define US_LIN_IDR_DCDIC (0x1u << 18) /**< \brief (US_LIN_IDR) Data Carrier Detect Input Change Interrupt Disable */ +#define US_LIN_IDR_DCDIC_0 (0x0u << 18) /**< \brief (US_LIN_IDR) No Effect */ +#define US_LIN_IDR_DCDIC_1 (0x1u << 18) /**< \brief (US_LIN_IDR) Disables the interrupt */ +#define US_LIN_IDR_CTSIC (0x1u << 19) /**< \brief (US_LIN_IDR) Clear to Send Input Change Interrupt Disable */ +#define US_LIN_IDR_CTSIC_0 (0x0u << 19) /**< \brief (US_LIN_IDR) No Effect */ +#define US_LIN_IDR_CTSIC_1 (0x1u << 19) /**< \brief (US_LIN_IDR) Disables the interrupt */ +#define US_LIN_IDR_LINBE (0x1u << 25) /**< \brief (US_LIN_IDR) LIN Bus Error Interrupt Disable */ +#define US_LIN_IDR_LINISFE (0x1u << 26) /**< \brief (US_LIN_IDR) LIN Inconsistent Synch Field Error Interrupt Disable */ +#define US_LIN_IDR_LINIPE (0x1u << 27) /**< \brief (US_LIN_IDR) LIN Identifier Parity Interrupt Disable */ +#define US_LIN_IDR_LINCE (0x1u << 28) /**< \brief (US_LIN_IDR) LIN Checksum Error Interrupt Disable */ +#define US_LIN_IDR_LINSNRE (0x1u << 29) /**< \brief (US_LIN_IDR) LIN Slave Not Responding Error Interrupt Disable */ +#define US_LIN_IDR_LINSTE (0x1u << 30) /**< \brief (US_LIN_IDR) LIN Synch Tolerance Error Interrupt Disable */ +#define US_LIN_IDR_LINSTE_0 (0x0u << 30) /**< \brief (US_LIN_IDR) No Effect */ +#define US_LIN_IDR_LINSTE_1 (0x1u << 30) /**< \brief (US_LIN_IDR) Disables the interrupt */ +#define US_LIN_IDR_LINHTE (0x1u << 31) /**< \brief (US_LIN_IDR) LIN Header Timeout Error Interrupt Disable */ +#define US_LIN_IDR_LINHTE_0 (0x0u << 31) /**< \brief (US_LIN_IDR) No Effect */ +#define US_LIN_IDR_LINHTE_1 (0x1u << 31) /**< \brief (US_LIN_IDR) Disables the interrupt */ +/* -------- US_SPI_SLAVE_IDR : (USART Offset: 0x0C) Interrupt Disable Register -------- */ +#define US_SPI_SLAVE_IDR_RXRDY (0x1u << 0) /**< \brief (US_SPI_SLAVE_IDR) Receiver Ready Interrupt Disable */ +#define US_SPI_SLAVE_IDR_RXRDY_0 (0x0u << 0) /**< \brief (US_SPI_SLAVE_IDR) No Effect */ +#define US_SPI_SLAVE_IDR_RXRDY_1 (0x1u << 0) /**< \brief (US_SPI_SLAVE_IDR) Disables the interrupt */ +#define US_SPI_SLAVE_IDR_TXRDY (0x1u << 1) /**< \brief (US_SPI_SLAVE_IDR) Transmitter Ready Interrupt Disable */ +#define US_SPI_SLAVE_IDR_TXRDY_0 (0x0u << 1) /**< \brief (US_SPI_SLAVE_IDR) No Effect */ +#define US_SPI_SLAVE_IDR_TXRDY_1 (0x1u << 1) /**< \brief (US_SPI_SLAVE_IDR) Disables the interrupt */ +#define US_SPI_SLAVE_IDR_RXBRK (0x1u << 2) /**< \brief (US_SPI_SLAVE_IDR) Receiver Break Interrupt Disable */ +#define US_SPI_SLAVE_IDR_RXBRK_0 (0x0u << 2) /**< \brief (US_SPI_SLAVE_IDR) No Effect */ +#define US_SPI_SLAVE_IDR_RXBRK_1 (0x1u << 2) /**< \brief (US_SPI_SLAVE_IDR) Disables the interrupt */ +#define US_SPI_SLAVE_IDR_ENDRX (0x1u << 3) /**< \brief (US_SPI_SLAVE_IDR) End of Receive Transfer Interrupt Disable */ +#define US_SPI_SLAVE_IDR_ENDRX_0 (0x0u << 3) /**< \brief (US_SPI_SLAVE_IDR) No Effect */ +#define US_SPI_SLAVE_IDR_ENDRX_1 (0x1u << 3) /**< \brief (US_SPI_SLAVE_IDR) Disables the interrupt */ +#define US_SPI_SLAVE_IDR_ENDTX (0x1u << 4) /**< \brief (US_SPI_SLAVE_IDR) End of Transmit Interrupt Disable */ +#define US_SPI_SLAVE_IDR_ENDTX_0 (0x0u << 4) /**< \brief (US_SPI_SLAVE_IDR) No Effect */ +#define US_SPI_SLAVE_IDR_ENDTX_1 (0x1u << 4) /**< \brief (US_SPI_SLAVE_IDR) Disables the interrupt */ +#define US_SPI_SLAVE_IDR_OVRE (0x1u << 5) /**< \brief (US_SPI_SLAVE_IDR) Overrun Error Interrupt Disable */ +#define US_SPI_SLAVE_IDR_OVRE_0 (0x0u << 5) /**< \brief (US_SPI_SLAVE_IDR) No Effect */ +#define US_SPI_SLAVE_IDR_OVRE_1 (0x1u << 5) /**< \brief (US_SPI_SLAVE_IDR) Disables the interrupt */ +#define US_SPI_SLAVE_IDR_FRAME (0x1u << 6) /**< \brief (US_SPI_SLAVE_IDR) Framing Error Interrupt Disable */ +#define US_SPI_SLAVE_IDR_FRAME_0 (0x0u << 6) /**< \brief (US_SPI_SLAVE_IDR) No Effect */ +#define US_SPI_SLAVE_IDR_FRAME_1 (0x1u << 6) /**< \brief (US_SPI_SLAVE_IDR) Disables the interrupt */ +#define US_SPI_SLAVE_IDR_PARE (0x1u << 7) /**< \brief (US_SPI_SLAVE_IDR) Parity Error Interrupt Disable */ +#define US_SPI_SLAVE_IDR_PARE_0 (0x0u << 7) /**< \brief (US_SPI_SLAVE_IDR) No Effect */ +#define US_SPI_SLAVE_IDR_PARE_1 (0x1u << 7) /**< \brief (US_SPI_SLAVE_IDR) Disables the interrupt */ +#define US_SPI_SLAVE_IDR_TIMEOUT (0x1u << 8) /**< \brief (US_SPI_SLAVE_IDR) Time-out Interrupt Disable */ +#define US_SPI_SLAVE_IDR_TIMEOUT_0 (0x0u << 8) /**< \brief (US_SPI_SLAVE_IDR) No Effect */ +#define US_SPI_SLAVE_IDR_TIMEOUT_1 (0x1u << 8) /**< \brief (US_SPI_SLAVE_IDR) Disables the interrupt */ +#define US_SPI_SLAVE_IDR_TXEMPTY (0x1u << 9) /**< \brief (US_SPI_SLAVE_IDR) Transmitter Empty Interrupt Disable */ +#define US_SPI_SLAVE_IDR_TXEMPTY_0 (0x0u << 9) /**< \brief (US_SPI_SLAVE_IDR) No Effect */ +#define US_SPI_SLAVE_IDR_TXEMPTY_1 (0x1u << 9) /**< \brief (US_SPI_SLAVE_IDR) Disables the interrupt */ +#define US_SPI_SLAVE_IDR_UNRE (0x1u << 10) /**< \brief (US_SPI_SLAVE_IDR) SPI Underrun Error Interrupt Disable */ +#define US_SPI_SLAVE_IDR_UNRE_0 (0x0u << 10) /**< \brief (US_SPI_SLAVE_IDR) No Effect */ +#define US_SPI_SLAVE_IDR_UNRE_1 (0x1u << 10) /**< \brief (US_SPI_SLAVE_IDR) Disables the interrupt */ +#define US_SPI_SLAVE_IDR_TXBUFE (0x1u << 11) /**< \brief (US_SPI_SLAVE_IDR) Buffer Empty Interrupt Disable */ +#define US_SPI_SLAVE_IDR_TXBUFE_0 (0x0u << 11) /**< \brief (US_SPI_SLAVE_IDR) No Effect */ +#define US_SPI_SLAVE_IDR_TXBUFE_1 (0x1u << 11) /**< \brief (US_SPI_SLAVE_IDR) Disables the interrupt */ +#define US_SPI_SLAVE_IDR_RXBUFF (0x1u << 12) /**< \brief (US_SPI_SLAVE_IDR) Buffer Full Interrupt Disable */ +#define US_SPI_SLAVE_IDR_RXBUFF_0 (0x0u << 12) /**< \brief (US_SPI_SLAVE_IDR) No Effect */ +#define US_SPI_SLAVE_IDR_RXBUFF_1 (0x1u << 12) /**< \brief (US_SPI_SLAVE_IDR) Disables the interrupt */ +#define US_SPI_SLAVE_IDR_NACK (0x1u << 13) /**< \brief (US_SPI_SLAVE_IDR) Non Acknowledge Interrupt Disable */ +#define US_SPI_SLAVE_IDR_NACK_0 (0x0u << 13) /**< \brief (US_SPI_SLAVE_IDR) No Effect */ +#define US_SPI_SLAVE_IDR_NACK_1 (0x1u << 13) /**< \brief (US_SPI_SLAVE_IDR) Disables the interrupt */ +#define US_SPI_SLAVE_IDR_RIIC (0x1u << 16) /**< \brief (US_SPI_SLAVE_IDR) Ring Indicator Input Change Disable */ +#define US_SPI_SLAVE_IDR_RIIC_0 (0x0u << 16) /**< \brief (US_SPI_SLAVE_IDR) No Effect */ +#define US_SPI_SLAVE_IDR_RIIC_1 (0x1u << 16) /**< \brief (US_SPI_SLAVE_IDR) Disables the interrupt */ +#define US_SPI_SLAVE_IDR_DSRIC (0x1u << 17) /**< \brief (US_SPI_SLAVE_IDR) Data Set Ready Input Change Disable */ +#define US_SPI_SLAVE_IDR_DSRIC_0 (0x0u << 17) /**< \brief (US_SPI_SLAVE_IDR) No Effect */ +#define US_SPI_SLAVE_IDR_DSRIC_1 (0x1u << 17) /**< \brief (US_SPI_SLAVE_IDR) Disables the interrupt */ +#define US_SPI_SLAVE_IDR_DCDIC (0x1u << 18) /**< \brief (US_SPI_SLAVE_IDR) Data Carrier Detect Input Change Interrupt Disable */ +#define US_SPI_SLAVE_IDR_DCDIC_0 (0x0u << 18) /**< \brief (US_SPI_SLAVE_IDR) No Effect */ +#define US_SPI_SLAVE_IDR_DCDIC_1 (0x1u << 18) /**< \brief (US_SPI_SLAVE_IDR) Disables the interrupt */ +#define US_SPI_SLAVE_IDR_CTSIC (0x1u << 19) /**< \brief (US_SPI_SLAVE_IDR) Clear to Send Input Change Interrupt Disable */ +#define US_SPI_SLAVE_IDR_CTSIC_0 (0x0u << 19) /**< \brief (US_SPI_SLAVE_IDR) No Effect */ +#define US_SPI_SLAVE_IDR_CTSIC_1 (0x1u << 19) /**< \brief (US_SPI_SLAVE_IDR) Disables the interrupt */ +/* -------- US_USART_IDR : (USART Offset: 0x0C) Interrupt Disable Register -------- */ +#define US_USART_IDR_RXRDY (0x1u << 0) /**< \brief (US_USART_IDR) Receiver Ready Interrupt Disable */ +#define US_USART_IDR_RXRDY_0 (0x0u << 0) /**< \brief (US_USART_IDR) No Effect */ +#define US_USART_IDR_RXRDY_1 (0x1u << 0) /**< \brief (US_USART_IDR) Disables the interrupt */ +#define US_USART_IDR_TXRDY (0x1u << 1) /**< \brief (US_USART_IDR) Transmitter Ready Interrupt Disable */ +#define US_USART_IDR_TXRDY_0 (0x0u << 1) /**< \brief (US_USART_IDR) No Effect */ +#define US_USART_IDR_TXRDY_1 (0x1u << 1) /**< \brief (US_USART_IDR) Disables the interrupt */ +#define US_USART_IDR_RXBRK (0x1u << 2) /**< \brief (US_USART_IDR) Receiver Break Interrupt Disable */ +#define US_USART_IDR_RXBRK_0 (0x0u << 2) /**< \brief (US_USART_IDR) No Effect */ +#define US_USART_IDR_RXBRK_1 (0x1u << 2) /**< \brief (US_USART_IDR) Disables the interrupt */ +#define US_USART_IDR_ENDRX (0x1u << 3) /**< \brief (US_USART_IDR) End of Receive Transfer Interrupt Disable */ +#define US_USART_IDR_ENDRX_0 (0x0u << 3) /**< \brief (US_USART_IDR) No Effect */ +#define US_USART_IDR_ENDRX_1 (0x1u << 3) /**< \brief (US_USART_IDR) Disables the interrupt */ +#define US_USART_IDR_ENDTX (0x1u << 4) /**< \brief (US_USART_IDR) End of Transmit Interrupt Disable */ +#define US_USART_IDR_ENDTX_0 (0x0u << 4) /**< \brief (US_USART_IDR) No Effect */ +#define US_USART_IDR_ENDTX_1 (0x1u << 4) /**< \brief (US_USART_IDR) Disables the interrupt */ +#define US_USART_IDR_OVRE (0x1u << 5) /**< \brief (US_USART_IDR) Overrun Error Interrupt Disable */ +#define US_USART_IDR_OVRE_0 (0x0u << 5) /**< \brief (US_USART_IDR) No Effect */ +#define US_USART_IDR_OVRE_1 (0x1u << 5) /**< \brief (US_USART_IDR) Disables the interrupt */ +#define US_USART_IDR_FRAME (0x1u << 6) /**< \brief (US_USART_IDR) Framing Error Interrupt Disable */ +#define US_USART_IDR_FRAME_0 (0x0u << 6) /**< \brief (US_USART_IDR) No Effect */ +#define US_USART_IDR_FRAME_1 (0x1u << 6) /**< \brief (US_USART_IDR) Disables the interrupt */ +#define US_USART_IDR_PARE (0x1u << 7) /**< \brief (US_USART_IDR) Parity Error Interrupt Disable */ +#define US_USART_IDR_PARE_0 (0x0u << 7) /**< \brief (US_USART_IDR) No Effect */ +#define US_USART_IDR_PARE_1 (0x1u << 7) /**< \brief (US_USART_IDR) Disables the interrupt */ +#define US_USART_IDR_TIMEOUT (0x1u << 8) /**< \brief (US_USART_IDR) Time-out Interrupt Disable */ +#define US_USART_IDR_TIMEOUT_0 (0x0u << 8) /**< \brief (US_USART_IDR) No Effect */ +#define US_USART_IDR_TIMEOUT_1 (0x1u << 8) /**< \brief (US_USART_IDR) Disables the interrupt */ +#define US_USART_IDR_TXEMPTY (0x1u << 9) /**< \brief (US_USART_IDR) Transmitter Empty Interrupt Disable */ +#define US_USART_IDR_TXEMPTY_0 (0x0u << 9) /**< \brief (US_USART_IDR) No Effect */ +#define US_USART_IDR_TXEMPTY_1 (0x1u << 9) /**< \brief (US_USART_IDR) Disables the interrupt */ +#define US_USART_IDR_ITER (0x1u << 10) /**< \brief (US_USART_IDR) Iteration Interrupt Disable */ +#define US_USART_IDR_ITER_0 (0x0u << 10) /**< \brief (US_USART_IDR) No Effect */ +#define US_USART_IDR_ITER_1 (0x1u << 10) /**< \brief (US_USART_IDR) Disables the interrupt */ +#define US_USART_IDR_TXBUFE (0x1u << 11) /**< \brief (US_USART_IDR) Buffer Empty Interrupt Disable */ +#define US_USART_IDR_TXBUFE_0 (0x0u << 11) /**< \brief (US_USART_IDR) No Effect */ +#define US_USART_IDR_TXBUFE_1 (0x1u << 11) /**< \brief (US_USART_IDR) Disables the interrupt */ +#define US_USART_IDR_RXBUFF (0x1u << 12) /**< \brief (US_USART_IDR) Buffer Full Interrupt Disable */ +#define US_USART_IDR_RXBUFF_0 (0x0u << 12) /**< \brief (US_USART_IDR) No Effect */ +#define US_USART_IDR_RXBUFF_1 (0x1u << 12) /**< \brief (US_USART_IDR) Disables the interrupt */ +#define US_USART_IDR_NACK (0x1u << 13) /**< \brief (US_USART_IDR) Non Acknowledge Interrupt Disable */ +#define US_USART_IDR_NACK_0 (0x0u << 13) /**< \brief (US_USART_IDR) No Effect */ +#define US_USART_IDR_NACK_1 (0x1u << 13) /**< \brief (US_USART_IDR) Disables the interrupt */ +#define US_USART_IDR_RIIC (0x1u << 16) /**< \brief (US_USART_IDR) Ring Indicator Input Change Disable */ +#define US_USART_IDR_RIIC_0 (0x0u << 16) /**< \brief (US_USART_IDR) No Effect */ +#define US_USART_IDR_RIIC_1 (0x1u << 16) /**< \brief (US_USART_IDR) Disables the interrupt */ +#define US_USART_IDR_DSRIC (0x1u << 17) /**< \brief (US_USART_IDR) Data Set Ready Input Change Disable */ +#define US_USART_IDR_DSRIC_0 (0x0u << 17) /**< \brief (US_USART_IDR) No Effect */ +#define US_USART_IDR_DSRIC_1 (0x1u << 17) /**< \brief (US_USART_IDR) Disables the interrupt */ +#define US_USART_IDR_DCDIC (0x1u << 18) /**< \brief (US_USART_IDR) Data Carrier Detect Input Change Interrupt Disable */ +#define US_USART_IDR_DCDIC_0 (0x0u << 18) /**< \brief (US_USART_IDR) No Effect */ +#define US_USART_IDR_DCDIC_1 (0x1u << 18) /**< \brief (US_USART_IDR) Disables the interrupt */ +#define US_USART_IDR_CTSIC (0x1u << 19) /**< \brief (US_USART_IDR) Clear to Send Input Change Interrupt Disable */ +#define US_USART_IDR_CTSIC_0 (0x0u << 19) /**< \brief (US_USART_IDR) No Effect */ +#define US_USART_IDR_CTSIC_1 (0x1u << 19) /**< \brief (US_USART_IDR) Disables the interrupt */ +#define US_USART_IDR_MANE (0x1u << 20) /**< \brief (US_USART_IDR) Manchester Error Interrupt Disable */ +#define US_USART_IDR_MANEA (0x1u << 24) /**< \brief (US_USART_IDR) Manchester Error Interrupt Disable */ +#define US_USART_IDR_MANEA_0 (0x0u << 24) /**< \brief (US_USART_IDR) No effect */ +#define US_USART_IDR_MANEA_1 (0x1u << 24) /**< \brief (US_USART_IDR) Disables the corresponding interrupt */ +/* -------- US_IDR : (USART Offset: 0x0C) Interrupt Disable Register -------- */ +#define US_IDR_RXRDY (0x1u << 0) /**< \brief (US_IDR) Receiver Ready Interrupt Disable */ +#define US_IDR_TXRDY (0x1u << 1) /**< \brief (US_IDR) Transmitter Ready Interrupt Disable */ +#define US_IDR_RXBRK (0x1u << 2) /**< \brief (US_IDR) Receiver Break Interrupt Disable */ +#define US_IDR_ENDRX (0x1u << 3) /**< \brief (US_IDR) End of Receive Transfer Interrupt Disable */ +#define US_IDR_ENDTX (0x1u << 4) /**< \brief (US_IDR) End of Transmit Interrupt Disable */ +#define US_IDR_OVRE (0x1u << 5) /**< \brief (US_IDR) Overrun Error Interrupt Disable */ +#define US_IDR_FRAME (0x1u << 6) /**< \brief (US_IDR) Framing Error Interrupt Disable */ +#define US_IDR_PARE (0x1u << 7) /**< \brief (US_IDR) Parity Error Interrupt Disable */ +#define US_IDR_TIMEOUT (0x1u << 8) /**< \brief (US_IDR) Time-out Interrupt Disable */ +#define US_IDR_TXEMPTY (0x1u << 9) /**< \brief (US_IDR) Transmitter Empty Interrupt Disable */ +#define US_IDR_ITER (0x1u << 10) /**< \brief (US_IDR) Iteration Interrupt Disable */ +#define US_IDR_UNRE (0x1u << 10) /**< \brief (US_IDR) SPI Underrun Error Interrupt Disable */ +#define US_IDR_TXBUFE (0x1u << 11) /**< \brief (US_IDR) Buffer Empty Interrupt Disable */ +#define US_IDR_RXBUFF (0x1u << 12) /**< \brief (US_IDR) Buffer Full Interrupt Disable */ +#define US_IDR_NACK (0x1u << 13) /**< \brief (US_IDR) Non Acknowledge or LIN Break Sent or LIN Break Received Interrupt Disable */ +#define US_IDR_LINID (0x1u << 14) /**< \brief (US_IDR) LIN Identifier Sent or LIN Identifier Received Interrupt Disable */ +#define US_IDR_LINTC (0x1u << 15) /**< \brief (US_IDR) LIN Transfer Conpleted Interrupt Disable */ +#define US_IDR_RIIC (0x1u << 16) /**< \brief (US_IDR) Ring Indicator Input Change Disable */ +#define US_IDR_DSRIC (0x1u << 17) /**< \brief (US_IDR) Data Set Ready Input Change Disable */ +#define US_IDR_DCDIC (0x1u << 18) /**< \brief (US_IDR) Data Carrier Detect Input Change Interrupt Disable */ +#define US_IDR_CTSIC (0x1u << 19) /**< \brief (US_IDR) Clear to Send Input Change Interrupt Disable */ +#define US_IDR_MANE (0x1u << 20) /**< \brief (US_IDR) Manchester Error Interrupt Disable */ +#define US_IDR_MANEA (0x1u << 24) /**< \brief (US_IDR) Manchester Error Interrupt Disable */ +#define US_IDR_LINBE (0x1u << 25) /**< \brief (US_IDR) LIN Bus Error Interrupt Disable */ +#define US_IDR_LINISFE (0x1u << 26) /**< \brief (US_IDR) LIN Inconsistent Synch Field Error Interrupt Disable */ +#define US_IDR_LINIPE (0x1u << 27) /**< \brief (US_IDR) LIN Identifier Parity Interrupt Disable */ +#define US_IDR_LINCE (0x1u << 28) /**< \brief (US_IDR) LIN Checksum Error Interrupt Disable */ +#define US_IDR_LINSNRE (0x1u << 29) /**< \brief (US_IDR) LIN Slave Not Responding Error Interrupt Disable */ +#define US_IDR_LINSTE (0x1u << 30) /**< \brief (US_IDR) LIN Synch Tolerance Error Interrupt Disable */ +#define US_IDR_LINHTE (0x1u << 31) /**< \brief (US_IDR) LIN Header Timeout Error Interrupt Disable */ + +/* -------- US_LIN_IMR : (USART Offset: 0x10) Interrupt Mask Register -------- */ +#define US_LIN_IMR_RXRDY (0x1u << 0) /**< \brief (US_LIN_IMR) RXRDY Interrupt Mask */ +#define US_LIN_IMR_RXRDY_0 (0x0u << 0) /**< \brief (US_LIN_IMR) The interrupt is disabled */ +#define US_LIN_IMR_RXRDY_1 (0x1u << 0) /**< \brief (US_LIN_IMR) The interrupt is enabled */ +#define US_LIN_IMR_TXRDY (0x1u << 1) /**< \brief (US_LIN_IMR) TXRDY Interrupt Mask */ +#define US_LIN_IMR_TXRDY_0 (0x0u << 1) /**< \brief (US_LIN_IMR) The interrupt is disabled */ +#define US_LIN_IMR_TXRDY_1 (0x1u << 1) /**< \brief (US_LIN_IMR) The interrupt is enabled */ +#define US_LIN_IMR_RXBRK (0x1u << 2) /**< \brief (US_LIN_IMR) Receiver Break Interrupt Mask */ +#define US_LIN_IMR_RXBRK_0 (0x0u << 2) /**< \brief (US_LIN_IMR) The interrupt is disabled */ +#define US_LIN_IMR_RXBRK_1 (0x1u << 2) /**< \brief (US_LIN_IMR) The interrupt is enabled */ +#define US_LIN_IMR_ENDRX (0x1u << 3) /**< \brief (US_LIN_IMR) End of Receive Transfer Interrupt Mask */ +#define US_LIN_IMR_ENDRX_0 (0x0u << 3) /**< \brief (US_LIN_IMR) The interrupt is disabled */ +#define US_LIN_IMR_ENDRX_1 (0x1u << 3) /**< \brief (US_LIN_IMR) The interrupt is enabled */ +#define US_LIN_IMR_ENDTX (0x1u << 4) /**< \brief (US_LIN_IMR) End of Transmit Interrupt Mask */ +#define US_LIN_IMR_ENDTX_0 (0x0u << 4) /**< \brief (US_LIN_IMR) The interrupt is disabled */ +#define US_LIN_IMR_ENDTX_1 (0x1u << 4) /**< \brief (US_LIN_IMR) The interrupt is enabled */ +#define US_LIN_IMR_OVRE (0x1u << 5) /**< \brief (US_LIN_IMR) Overrun Error Interrupt Mask */ +#define US_LIN_IMR_OVRE_0 (0x0u << 5) /**< \brief (US_LIN_IMR) The interrupt is disabled */ +#define US_LIN_IMR_OVRE_1 (0x1u << 5) /**< \brief (US_LIN_IMR) The interrupt is enabled */ +#define US_LIN_IMR_FRAME (0x1u << 6) /**< \brief (US_LIN_IMR) Framing Error Interrupt Mask */ +#define US_LIN_IMR_FRAME_0 (0x0u << 6) /**< \brief (US_LIN_IMR) The interrupt is disabled */ +#define US_LIN_IMR_FRAME_1 (0x1u << 6) /**< \brief (US_LIN_IMR) The interrupt is enabled */ +#define US_LIN_IMR_PARE (0x1u << 7) /**< \brief (US_LIN_IMR) Parity Error Interrupt Mask */ +#define US_LIN_IMR_PARE_0 (0x0u << 7) /**< \brief (US_LIN_IMR) The interrupt is disabled */ +#define US_LIN_IMR_PARE_1 (0x1u << 7) /**< \brief (US_LIN_IMR) The interrupt is enabled */ +#define US_LIN_IMR_TIMEOUT (0x1u << 8) /**< \brief (US_LIN_IMR) Time-out Interrupt Mask */ +#define US_LIN_IMR_TIMEOUT_0 (0x0u << 8) /**< \brief (US_LIN_IMR) The interrupt is disabled */ +#define US_LIN_IMR_TIMEOUT_1 (0x1u << 8) /**< \brief (US_LIN_IMR) The interrupt is enabled */ +#define US_LIN_IMR_TXEMPTY (0x1u << 9) /**< \brief (US_LIN_IMR) TXEMPTY Interrupt Mask */ +#define US_LIN_IMR_TXEMPTY_0 (0x0u << 9) /**< \brief (US_LIN_IMR) The interrupt is disabled */ +#define US_LIN_IMR_TXEMPTY_1 (0x1u << 9) /**< \brief (US_LIN_IMR) The interrupt is enabled */ +#define US_LIN_IMR_ITER (0x1u << 10) /**< \brief (US_LIN_IMR) Iteration Interrupt Mask */ +#define US_LIN_IMR_ITER_0 (0x0u << 10) /**< \brief (US_LIN_IMR) The interrupt is disabled */ +#define US_LIN_IMR_ITER_1 (0x1u << 10) /**< \brief (US_LIN_IMR) The interrupt is enabled */ +#define US_LIN_IMR_TXBUFE (0x1u << 11) /**< \brief (US_LIN_IMR) Buffer Empty Interrupt Mask */ +#define US_LIN_IMR_TXBUFE_0 (0x0u << 11) /**< \brief (US_LIN_IMR) The interrupt is disabled */ +#define US_LIN_IMR_TXBUFE_1 (0x1u << 11) /**< \brief (US_LIN_IMR) The interrupt is enabled */ +#define US_LIN_IMR_RXBUFF (0x1u << 12) /**< \brief (US_LIN_IMR) Buffer Full Interrupt Mask */ +#define US_LIN_IMR_RXBUFF_0 (0x0u << 12) /**< \brief (US_LIN_IMR) The interrupt is disabled */ +#define US_LIN_IMR_RXBUFF_1 (0x1u << 12) /**< \brief (US_LIN_IMR) The interrupt is enabled */ +#define US_LIN_IMR_NACK (0x1u << 13) /**< \brief (US_LIN_IMR) Non Acknowledge or LIN Break Sent or LIN Break Received Interrupt Mask */ +#define US_LIN_IMR_NACK_0 (0x0u << 13) /**< \brief (US_LIN_IMR) The interrupt is disabled */ +#define US_LIN_IMR_NACK_1 (0x1u << 13) /**< \brief (US_LIN_IMR) The interrupt is enabled */ +#define US_LIN_IMR_LINID (0x1u << 14) /**< \brief (US_LIN_IMR) LIN Identifier Sent or LIN Received Interrupt Mask */ +#define US_LIN_IMR_LINTC (0x1u << 15) /**< \brief (US_LIN_IMR) LIN Transfer Conpleted Interrupt Mask */ +#define US_LIN_IMR_RIIC (0x1u << 16) /**< \brief (US_LIN_IMR) Ring Indicator Input Change Mask */ +#define US_LIN_IMR_RIIC_0 (0x0u << 16) /**< \brief (US_LIN_IMR) The interrupt is disabled */ +#define US_LIN_IMR_RIIC_1 (0x1u << 16) /**< \brief (US_LIN_IMR) The interrupt is enabled */ +#define US_LIN_IMR_DSRIC (0x1u << 17) /**< \brief (US_LIN_IMR) Data Set Ready Input Change Mask */ +#define US_LIN_IMR_DSRIC_0 (0x0u << 17) /**< \brief (US_LIN_IMR) The interrupt is disabled */ +#define US_LIN_IMR_DSRIC_1 (0x1u << 17) /**< \brief (US_LIN_IMR) The interrupt is enabled */ +#define US_LIN_IMR_DCDIC (0x1u << 18) /**< \brief (US_LIN_IMR) Data Carrier Detect Input Change Interrupt Mask */ +#define US_LIN_IMR_DCDIC_0 (0x0u << 18) /**< \brief (US_LIN_IMR) The interrupt is disabled */ +#define US_LIN_IMR_DCDIC_1 (0x1u << 18) /**< \brief (US_LIN_IMR) The interrupt is enabled */ +#define US_LIN_IMR_CTSIC (0x1u << 19) /**< \brief (US_LIN_IMR) Clear to Send Input Change Interrupt Mask */ +#define US_LIN_IMR_CTSIC_0 (0x0u << 19) /**< \brief (US_LIN_IMR) The interrupt is disabled */ +#define US_LIN_IMR_CTSIC_1 (0x1u << 19) /**< \brief (US_LIN_IMR) The interrupt is enabled */ +#define US_LIN_IMR_LINBE (0x1u << 25) /**< \brief (US_LIN_IMR) LIN Bus Error Interrupt Mask */ +#define US_LIN_IMR_LINISFE (0x1u << 26) /**< \brief (US_LIN_IMR) LIN Inconsistent Synch Field Error Interrupt Mask */ +#define US_LIN_IMR_LINIPE (0x1u << 27) /**< \brief (US_LIN_IMR) LIN Identifier Parity Interrupt Mask */ +#define US_LIN_IMR_LINCE (0x1u << 28) /**< \brief (US_LIN_IMR) LIN Checksum Error Interrupt Mask */ +#define US_LIN_IMR_LINSNRE (0x1u << 29) /**< \brief (US_LIN_IMR) LIN Slave Not Responding Error Interrupt Mask */ +#define US_LIN_IMR_LINSTE (0x1u << 30) /**< \brief (US_LIN_IMR) LIN Synch Tolerance Error Interrupt Mask */ +#define US_LIN_IMR_LINSTE_0 (0x0u << 30) /**< \brief (US_LIN_IMR) The interrupt is disabled */ +#define US_LIN_IMR_LINSTE_1 (0x1u << 30) /**< \brief (US_LIN_IMR) The interrupt is enabled */ +#define US_LIN_IMR_LINHTE (0x1u << 31) /**< \brief (US_LIN_IMR) LIN Header Timeout Error Interrupt Mask */ +#define US_LIN_IMR_LINHTE_0 (0x0u << 31) /**< \brief (US_LIN_IMR) The interrupt is disabled */ +#define US_LIN_IMR_LINHTE_1 (0x1u << 31) /**< \brief (US_LIN_IMR) The interrupt is enabled */ +/* -------- US_SPI_SLAVE_IMR : (USART Offset: 0x10) Interrupt Mask Register -------- */ +#define US_SPI_SLAVE_IMR_RXRDY (0x1u << 0) /**< \brief (US_SPI_SLAVE_IMR) RXRDY Interrupt Mask */ +#define US_SPI_SLAVE_IMR_RXRDY_0 (0x0u << 0) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is disabled */ +#define US_SPI_SLAVE_IMR_RXRDY_1 (0x1u << 0) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is enabled */ +#define US_SPI_SLAVE_IMR_TXRDY (0x1u << 1) /**< \brief (US_SPI_SLAVE_IMR) TXRDY Interrupt Mask */ +#define US_SPI_SLAVE_IMR_TXRDY_0 (0x0u << 1) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is disabled */ +#define US_SPI_SLAVE_IMR_TXRDY_1 (0x1u << 1) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is enabled */ +#define US_SPI_SLAVE_IMR_RXBRK (0x1u << 2) /**< \brief (US_SPI_SLAVE_IMR) Receiver Break Interrupt Mask */ +#define US_SPI_SLAVE_IMR_RXBRK_0 (0x0u << 2) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is disabled */ +#define US_SPI_SLAVE_IMR_RXBRK_1 (0x1u << 2) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is enabled */ +#define US_SPI_SLAVE_IMR_ENDRX (0x1u << 3) /**< \brief (US_SPI_SLAVE_IMR) End of Receive Transfer Interrupt Mask */ +#define US_SPI_SLAVE_IMR_ENDRX_0 (0x0u << 3) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is disabled */ +#define US_SPI_SLAVE_IMR_ENDRX_1 (0x1u << 3) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is enabled */ +#define US_SPI_SLAVE_IMR_ENDTX (0x1u << 4) /**< \brief (US_SPI_SLAVE_IMR) End of Transmit Interrupt Mask */ +#define US_SPI_SLAVE_IMR_ENDTX_0 (0x0u << 4) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is disabled */ +#define US_SPI_SLAVE_IMR_ENDTX_1 (0x1u << 4) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is enabled */ +#define US_SPI_SLAVE_IMR_OVRE (0x1u << 5) /**< \brief (US_SPI_SLAVE_IMR) Overrun Error Interrupt Mask */ +#define US_SPI_SLAVE_IMR_OVRE_0 (0x0u << 5) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is disabled */ +#define US_SPI_SLAVE_IMR_OVRE_1 (0x1u << 5) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is enabled */ +#define US_SPI_SLAVE_IMR_FRAME (0x1u << 6) /**< \brief (US_SPI_SLAVE_IMR) Framing Error Interrupt Mask */ +#define US_SPI_SLAVE_IMR_FRAME_0 (0x0u << 6) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is disabled */ +#define US_SPI_SLAVE_IMR_FRAME_1 (0x1u << 6) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is enabled */ +#define US_SPI_SLAVE_IMR_PARE (0x1u << 7) /**< \brief (US_SPI_SLAVE_IMR) Parity Error Interrupt Mask */ +#define US_SPI_SLAVE_IMR_PARE_0 (0x0u << 7) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is disabled */ +#define US_SPI_SLAVE_IMR_PARE_1 (0x1u << 7) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is enabled */ +#define US_SPI_SLAVE_IMR_TIMEOUT (0x1u << 8) /**< \brief (US_SPI_SLAVE_IMR) Time-out Interrupt Mask */ +#define US_SPI_SLAVE_IMR_TIMEOUT_0 (0x0u << 8) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is disabled */ +#define US_SPI_SLAVE_IMR_TIMEOUT_1 (0x1u << 8) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is enabled */ +#define US_SPI_SLAVE_IMR_TXEMPTY (0x1u << 9) /**< \brief (US_SPI_SLAVE_IMR) TXEMPTY Interrupt Mask */ +#define US_SPI_SLAVE_IMR_TXEMPTY_0 (0x0u << 9) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is disabled */ +#define US_SPI_SLAVE_IMR_TXEMPTY_1 (0x1u << 9) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is enabled */ +#define US_SPI_SLAVE_IMR_UNRE (0x1u << 10) /**< \brief (US_SPI_SLAVE_IMR) SPI Underrun Error Interrupt Mask */ +#define US_SPI_SLAVE_IMR_UNRE_0 (0x0u << 10) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is disabled */ +#define US_SPI_SLAVE_IMR_UNRE_1 (0x1u << 10) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is enabled */ +#define US_SPI_SLAVE_IMR_TXBUFE (0x1u << 11) /**< \brief (US_SPI_SLAVE_IMR) Buffer Empty Interrupt Mask */ +#define US_SPI_SLAVE_IMR_TXBUFE_0 (0x0u << 11) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is disabled */ +#define US_SPI_SLAVE_IMR_TXBUFE_1 (0x1u << 11) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is enabled */ +#define US_SPI_SLAVE_IMR_RXBUFF (0x1u << 12) /**< \brief (US_SPI_SLAVE_IMR) Buffer Full Interrupt Mask */ +#define US_SPI_SLAVE_IMR_RXBUFF_0 (0x0u << 12) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is disabled */ +#define US_SPI_SLAVE_IMR_RXBUFF_1 (0x1u << 12) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is enabled */ +#define US_SPI_SLAVE_IMR_NACK (0x1u << 13) /**< \brief (US_SPI_SLAVE_IMR) Non Acknowledge Interrupt Mask */ +#define US_SPI_SLAVE_IMR_NACK_0 (0x0u << 13) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is disabled */ +#define US_SPI_SLAVE_IMR_NACK_1 (0x1u << 13) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is enabled */ +#define US_SPI_SLAVE_IMR_RIIC (0x1u << 16) /**< \brief (US_SPI_SLAVE_IMR) Ring Indicator Input Change Mask */ +#define US_SPI_SLAVE_IMR_RIIC_0 (0x0u << 16) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is disabled */ +#define US_SPI_SLAVE_IMR_RIIC_1 (0x1u << 16) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is enabled */ +#define US_SPI_SLAVE_IMR_DSRIC (0x1u << 17) /**< \brief (US_SPI_SLAVE_IMR) Data Set Ready Input Change Mask */ +#define US_SPI_SLAVE_IMR_DSRIC_0 (0x0u << 17) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is disabled */ +#define US_SPI_SLAVE_IMR_DSRIC_1 (0x1u << 17) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is enabled */ +#define US_SPI_SLAVE_IMR_DCDIC (0x1u << 18) /**< \brief (US_SPI_SLAVE_IMR) Data Carrier Detect Input Change Interrupt Mask */ +#define US_SPI_SLAVE_IMR_DCDIC_0 (0x0u << 18) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is disabled */ +#define US_SPI_SLAVE_IMR_DCDIC_1 (0x1u << 18) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is enabled */ +#define US_SPI_SLAVE_IMR_CTSIC (0x1u << 19) /**< \brief (US_SPI_SLAVE_IMR) Clear to Send Input Change Interrupt Mask */ +#define US_SPI_SLAVE_IMR_CTSIC_0 (0x0u << 19) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is disabled */ +#define US_SPI_SLAVE_IMR_CTSIC_1 (0x1u << 19) /**< \brief (US_SPI_SLAVE_IMR) The interrupt is enabled */ +/* -------- US_USART_IMR : (USART Offset: 0x10) Interrupt Mask Register -------- */ +#define US_USART_IMR_RXRDY (0x1u << 0) /**< \brief (US_USART_IMR) RXRDY Interrupt Mask */ +#define US_USART_IMR_RXRDY_0 (0x0u << 0) /**< \brief (US_USART_IMR) The interrupt is disabled */ +#define US_USART_IMR_RXRDY_1 (0x1u << 0) /**< \brief (US_USART_IMR) The interrupt is enabled */ +#define US_USART_IMR_TXRDY (0x1u << 1) /**< \brief (US_USART_IMR) TXRDY Interrupt Mask */ +#define US_USART_IMR_TXRDY_0 (0x0u << 1) /**< \brief (US_USART_IMR) The interrupt is disabled */ +#define US_USART_IMR_TXRDY_1 (0x1u << 1) /**< \brief (US_USART_IMR) The interrupt is enabled */ +#define US_USART_IMR_RXBRK (0x1u << 2) /**< \brief (US_USART_IMR) Receiver Break Interrupt Mask */ +#define US_USART_IMR_RXBRK_0 (0x0u << 2) /**< \brief (US_USART_IMR) The interrupt is disabled */ +#define US_USART_IMR_RXBRK_1 (0x1u << 2) /**< \brief (US_USART_IMR) The interrupt is enabled */ +#define US_USART_IMR_ENDRX (0x1u << 3) /**< \brief (US_USART_IMR) End of Receive Transfer Interrupt Mask */ +#define US_USART_IMR_ENDRX_0 (0x0u << 3) /**< \brief (US_USART_IMR) The interrupt is disabled */ +#define US_USART_IMR_ENDRX_1 (0x1u << 3) /**< \brief (US_USART_IMR) The interrupt is enabled */ +#define US_USART_IMR_ENDTX (0x1u << 4) /**< \brief (US_USART_IMR) End of Transmit Interrupt Mask */ +#define US_USART_IMR_ENDTX_0 (0x0u << 4) /**< \brief (US_USART_IMR) The interrupt is disabled */ +#define US_USART_IMR_ENDTX_1 (0x1u << 4) /**< \brief (US_USART_IMR) The interrupt is enabled */ +#define US_USART_IMR_OVRE (0x1u << 5) /**< \brief (US_USART_IMR) Overrun Error Interrupt Mask */ +#define US_USART_IMR_OVRE_0 (0x0u << 5) /**< \brief (US_USART_IMR) The interrupt is disabled */ +#define US_USART_IMR_OVRE_1 (0x1u << 5) /**< \brief (US_USART_IMR) The interrupt is enabled */ +#define US_USART_IMR_FRAME (0x1u << 6) /**< \brief (US_USART_IMR) Framing Error Interrupt Mask */ +#define US_USART_IMR_FRAME_0 (0x0u << 6) /**< \brief (US_USART_IMR) The interrupt is disabled */ +#define US_USART_IMR_FRAME_1 (0x1u << 6) /**< \brief (US_USART_IMR) The interrupt is enabled */ +#define US_USART_IMR_PARE (0x1u << 7) /**< \brief (US_USART_IMR) Parity Error Interrupt Mask */ +#define US_USART_IMR_PARE_0 (0x0u << 7) /**< \brief (US_USART_IMR) The interrupt is disabled */ +#define US_USART_IMR_PARE_1 (0x1u << 7) /**< \brief (US_USART_IMR) The interrupt is enabled */ +#define US_USART_IMR_TIMEOUT (0x1u << 8) /**< \brief (US_USART_IMR) Time-out Interrupt Mask */ +#define US_USART_IMR_TIMEOUT_0 (0x0u << 8) /**< \brief (US_USART_IMR) The interrupt is disabled */ +#define US_USART_IMR_TIMEOUT_1 (0x1u << 8) /**< \brief (US_USART_IMR) The interrupt is enabled */ +#define US_USART_IMR_TXEMPTY (0x1u << 9) /**< \brief (US_USART_IMR) TXEMPTY Interrupt Mask */ +#define US_USART_IMR_TXEMPTY_0 (0x0u << 9) /**< \brief (US_USART_IMR) The interrupt is disabled */ +#define US_USART_IMR_TXEMPTY_1 (0x1u << 9) /**< \brief (US_USART_IMR) The interrupt is enabled */ +#define US_USART_IMR_ITER (0x1u << 10) /**< \brief (US_USART_IMR) Iteration Interrupt Mask */ +#define US_USART_IMR_ITER_0 (0x0u << 10) /**< \brief (US_USART_IMR) The interrupt is disabled */ +#define US_USART_IMR_ITER_1 (0x1u << 10) /**< \brief (US_USART_IMR) The interrupt is enabled */ +#define US_USART_IMR_TXBUFE (0x1u << 11) /**< \brief (US_USART_IMR) Buffer Empty Interrupt Mask */ +#define US_USART_IMR_TXBUFE_0 (0x0u << 11) /**< \brief (US_USART_IMR) The interrupt is disabled */ +#define US_USART_IMR_TXBUFE_1 (0x1u << 11) /**< \brief (US_USART_IMR) The interrupt is enabled */ +#define US_USART_IMR_RXBUFF (0x1u << 12) /**< \brief (US_USART_IMR) Buffer Full Interrupt Mask */ +#define US_USART_IMR_RXBUFF_0 (0x0u << 12) /**< \brief (US_USART_IMR) The interrupt is disabled */ +#define US_USART_IMR_RXBUFF_1 (0x1u << 12) /**< \brief (US_USART_IMR) The interrupt is enabled */ +#define US_USART_IMR_NACK (0x1u << 13) /**< \brief (US_USART_IMR) Non Acknowledge Interrupt Mask */ +#define US_USART_IMR_NACK_0 (0x0u << 13) /**< \brief (US_USART_IMR) The interrupt is disabled */ +#define US_USART_IMR_NACK_1 (0x1u << 13) /**< \brief (US_USART_IMR) The interrupt is enabled */ +#define US_USART_IMR_RIIC (0x1u << 16) /**< \brief (US_USART_IMR) Ring Indicator Input Change Mask */ +#define US_USART_IMR_RIIC_0 (0x0u << 16) /**< \brief (US_USART_IMR) The interrupt is disabled */ +#define US_USART_IMR_RIIC_1 (0x1u << 16) /**< \brief (US_USART_IMR) The interrupt is enabled */ +#define US_USART_IMR_DSRIC (0x1u << 17) /**< \brief (US_USART_IMR) Data Set Ready Input Change Mask */ +#define US_USART_IMR_DSRIC_0 (0x0u << 17) /**< \brief (US_USART_IMR) The interrupt is disabled */ +#define US_USART_IMR_DSRIC_1 (0x1u << 17) /**< \brief (US_USART_IMR) The interrupt is enabled */ +#define US_USART_IMR_DCDIC (0x1u << 18) /**< \brief (US_USART_IMR) Data Carrier Detect Input Change Interrupt Mask */ +#define US_USART_IMR_DCDIC_0 (0x0u << 18) /**< \brief (US_USART_IMR) The interrupt is disabled */ +#define US_USART_IMR_DCDIC_1 (0x1u << 18) /**< \brief (US_USART_IMR) The interrupt is enabled */ +#define US_USART_IMR_CTSIC (0x1u << 19) /**< \brief (US_USART_IMR) Clear to Send Input Change Interrupt Mask */ +#define US_USART_IMR_CTSIC_0 (0x0u << 19) /**< \brief (US_USART_IMR) The interrupt is disabled */ +#define US_USART_IMR_CTSIC_1 (0x1u << 19) /**< \brief (US_USART_IMR) The interrupt is enabled */ +#define US_USART_IMR_MANE (0x1u << 20) /**< \brief (US_USART_IMR) */ +#define US_USART_IMR_MANEA (0x1u << 24) /**< \brief (US_USART_IMR) Manchester Error Interrupt Mask */ +#define US_USART_IMR_MANEA_0 (0x0u << 24) /**< \brief (US_USART_IMR) The interrupt is disabled */ +#define US_USART_IMR_MANEA_1 (0x1u << 24) /**< \brief (US_USART_IMR) The interrupt is enabled */ +/* -------- US_IMR : (USART Offset: 0x10) Interrupt Mask Register -------- */ +#define US_IMR_RXRDY (0x1u << 0) /**< \brief (US_IMR) RXRDY Interrupt Mask */ +#define US_IMR_TXRDY (0x1u << 1) /**< \brief (US_IMR) TXRDY Interrupt Mask */ +#define US_IMR_RXBRK (0x1u << 2) /**< \brief (US_IMR) Receiver Break Interrupt Mask */ +#define US_IMR_ENDRX (0x1u << 3) /**< \brief (US_IMR) End of Receive Transfer Interrupt Mask */ +#define US_IMR_ENDTX (0x1u << 4) /**< \brief (US_IMR) End of Transmit Interrupt Mask */ +#define US_IMR_OVRE (0x1u << 5) /**< \brief (US_IMR) Overrun Error Interrupt Mask */ +#define US_IMR_FRAME (0x1u << 6) /**< \brief (US_IMR) Framing Error Interrupt Mask */ +#define US_IMR_PARE (0x1u << 7) /**< \brief (US_IMR) Parity Error Interrupt Mask */ +#define US_IMR_TIMEOUT (0x1u << 8) /**< \brief (US_IMR) Time-out Interrupt Mask */ +#define US_IMR_TXEMPTY (0x1u << 9) /**< \brief (US_IMR) TXEMPTY Interrupt Mask */ +#define US_IMR_ITER (0x1u << 10) /**< \brief (US_IMR) Iteration Interrupt Mask */ +#define US_IMR_UNRE (0x1u << 10) /**< \brief (US_IMR) SPI Underrun Error Interrupt Mask */ +#define US_IMR_TXBUFE (0x1u << 11) /**< \brief (US_IMR) Buffer Empty Interrupt Mask */ +#define US_IMR_RXBUFF (0x1u << 12) /**< \brief (US_IMR) Buffer Full Interrupt Mask */ +#define US_IMR_NACK (0x1u << 13) /**< \brief (US_IMR) Non Acknowledge or LIN Break Sent or LIN Break Received Interrupt Mask */ +#define US_IMR_LINID (0x1u << 14) /**< \brief (US_IMR) LIN Identifier Sent or LIN Received Interrupt Mask */ +#define US_IMR_LINTC (0x1u << 15) /**< \brief (US_IMR) LIN Transfer Conpleted Interrupt Mask */ +#define US_IMR_RIIC (0x1u << 16) /**< \brief (US_IMR) Ring Indicator Input Change Mask */ +#define US_IMR_DSRIC (0x1u << 17) /**< \brief (US_IMR) Data Set Ready Input Change Mask */ +#define US_IMR_DCDIC (0x1u << 18) /**< \brief (US_IMR) Data Carrier Detect Input Change Interrupt Mask */ +#define US_IMR_CTSIC (0x1u << 19) /**< \brief (US_IMR) Clear to Send Input Change Interrupt Mask */ +#define US_IMR_MANE (0x1u << 20) /**< \brief (US_IMR) */ +#define US_IMR_MANEA (0x1u << 24) /**< \brief (US_IMR) Manchester Error Interrupt Mask */ +#define US_IMR_LINBE (0x1u << 25) /**< \brief (US_IMR) LIN Bus Error Interrupt Mask */ +#define US_IMR_LINISFE (0x1u << 26) /**< \brief (US_IMR) LIN Inconsistent Synch Field Error Interrupt Mask */ +#define US_IMR_LINIPE (0x1u << 27) /**< \brief (US_IMR) LIN Identifier Parity Interrupt Mask */ +#define US_IMR_LINCE (0x1u << 28) /**< \brief (US_IMR) LIN Checksum Error Interrupt Mask */ +#define US_IMR_LINSNRE (0x1u << 29) /**< \brief (US_IMR) LIN Slave Not Responding Error Interrupt Mask */ +#define US_IMR_LINSTE (0x1u << 30) /**< \brief (US_IMR) LIN Synch Tolerance Error Interrupt Mask */ +#define US_IMR_LINHTE (0x1u << 31) /**< \brief (US_IMR) LIN Header Timeout Error Interrupt Mask */ + +/* -------- US_LIN_CSR : (USART Offset: 0x14) Channel Status Register -------- */ +#define US_LIN_CSR_RXRDY (0x1u << 0) /**< \brief (US_LIN_CSR) Receiver Ready */ +#define US_LIN_CSR_RXRDY_0 (0x0u << 0) /**< \brief (US_LIN_CSR) No complete character has been received since the last read of RHR or the receiver is disabled. If characters werebeing received when the receiver was disabled, RXRDY changes to 1 when the receiver is enabled */ +#define US_LIN_CSR_RXRDY_1 (0x1u << 0) /**< \brief (US_LIN_CSR) At least one complete character has been received and RHR has not yet been read */ +#define US_LIN_CSR_TXRDY (0x1u << 1) /**< \brief (US_LIN_CSR) Transmitter Ready */ +#define US_LIN_CSR_TXRDY_0 (0x0u << 1) /**< \brief (US_LIN_CSR) A character is in the THR waiting to be transferred to the Transmit Shift Register, or an STTBRK command has been requested, or the transmitter is disabled. As soon as the transmitter is enabled, TXRDY becomes 1 */ +#define US_LIN_CSR_TXRDY_1 (0x1u << 1) /**< \brief (US_LIN_CSR) There is no character in the THR */ +#define US_LIN_CSR_RXBRK (0x1u << 2) /**< \brief (US_LIN_CSR) Break Received/End of Break */ +#define US_LIN_CSR_RXBRK_0 (0x0u << 2) /**< \brief (US_LIN_CSR) No Break received or End of Break detected since the last RSTSTA */ +#define US_LIN_CSR_RXBRK_1 (0x1u << 2) /**< \brief (US_LIN_CSR) Break Received or End of Break detected since the last RSTSTA */ +#define US_LIN_CSR_ENDRX (0x1u << 3) /**< \brief (US_LIN_CSR) End of Receiver Transfer */ +#define US_LIN_CSR_ENDRX_0 (0x0u << 3) /**< \brief (US_LIN_CSR) The End of Transfer signal from the Receive PDC channel is inactive */ +#define US_LIN_CSR_ENDRX_1 (0x1u << 3) /**< \brief (US_LIN_CSR) The End of Transfer signal from the Receive PDC channel is active */ +#define US_LIN_CSR_ENDTX (0x1u << 4) /**< \brief (US_LIN_CSR) End of Transmitter Transfer */ +#define US_LIN_CSR_ENDTX_0 (0x0u << 4) /**< \brief (US_LIN_CSR) The End of Transfer signal from the Transmit PDC channel is inactive */ +#define US_LIN_CSR_ENDTX_1 (0x1u << 4) /**< \brief (US_LIN_CSR) The End of Transfer signal from the Transmit PDC channel is active */ +#define US_LIN_CSR_OVRE (0x1u << 5) /**< \brief (US_LIN_CSR) Overrun Error */ +#define US_LIN_CSR_OVRE_0 (0x0u << 5) /**< \brief (US_LIN_CSR) No overrun error has occurred since since the last RSTSTA */ +#define US_LIN_CSR_OVRE_1 (0x1u << 5) /**< \brief (US_LIN_CSR) At least one overrun error has occurred since the last RSTSTA */ +#define US_LIN_CSR_FRAME (0x1u << 6) /**< \brief (US_LIN_CSR) Framing Error */ +#define US_LIN_CSR_FRAME_0 (0x0u << 6) /**< \brief (US_LIN_CSR) No stop bit has been detected low since the last RSTSTA */ +#define US_LIN_CSR_FRAME_1 (0x1u << 6) /**< \brief (US_LIN_CSR) At least one stop bit has been detected low since the last RSTSTA */ +#define US_LIN_CSR_PARE (0x1u << 7) /**< \brief (US_LIN_CSR) Parity Error */ +#define US_LIN_CSR_PARE_0 (0x0u << 7) /**< \brief (US_LIN_CSR) No parity error has been detected since the last RSTSTA */ +#define US_LIN_CSR_PARE_1 (0x1u << 7) /**< \brief (US_LIN_CSR) At least one parity error has been detected since the last RSTSTA */ +#define US_LIN_CSR_TIMEOUT (0x1u << 8) /**< \brief (US_LIN_CSR) Receiver Time-out */ +#define US_LIN_CSR_TIMEOUT_0 (0x0u << 8) /**< \brief (US_LIN_CSR) There has not been a time-out since the last Start Time-out command or the Time-out Register is 0 */ +#define US_LIN_CSR_TIMEOUT_1 (0x1u << 8) /**< \brief (US_LIN_CSR) There has been a time-out since the last Start Time-out command */ +#define US_LIN_CSR_TXEMPTY (0x1u << 9) /**< \brief (US_LIN_CSR) Transmitter Empty */ +#define US_LIN_CSR_TXEMPTY_0 (0x0u << 9) /**< \brief (US_LIN_CSR) There are characters in either THR or the Transmit Shift Register, or the transmitter is disabled */ +#define US_LIN_CSR_TXEMPTY_1 (0x1u << 9) /**< \brief (US_LIN_CSR) There is at least one character in either THR or the Transmit Shift Register */ +#define US_LIN_CSR_ITER (0x1u << 10) /**< \brief (US_LIN_CSR) Max number of Repetitions Reached */ +#define US_LIN_CSR_ITER_0 (0x0u << 10) /**< \brief (US_LIN_CSR) Maximum number of repetitions has not been reached since the last RSIT */ +#define US_LIN_CSR_ITER_1 (0x1u << 10) /**< \brief (US_LIN_CSR) Maximum number of repetitions has been reached since the last RSIT */ +#define US_LIN_CSR_TXBUFE (0x1u << 11) /**< \brief (US_LIN_CSR) Transmission Buffer Empty */ +#define US_LIN_CSR_TXBUFE_0 (0x0u << 11) /**< \brief (US_LIN_CSR) The signal Buffer Empty from the Transmit PDC channel is inactive */ +#define US_LIN_CSR_TXBUFE_1 (0x1u << 11) /**< \brief (US_LIN_CSR) The signal Buffer Empty from the Transmit PDC channel is active */ +#define US_LIN_CSR_RXBUFF (0x1u << 12) /**< \brief (US_LIN_CSR) Reception Buffer Full */ +#define US_LIN_CSR_RXBUFF_0 (0x0u << 12) /**< \brief (US_LIN_CSR) The signal Buffer Full from the Receive PDC channel is inactive */ +#define US_LIN_CSR_RXBUFF_1 (0x1u << 12) /**< \brief (US_LIN_CSR) The signal Buffer Full from the Receive PDC channel is active */ +#define US_LIN_CSR_NACK (0x1u << 13) /**< \brief (US_LIN_CSR) Non Acknowledge or LIN Break Sent or LIN Break Received */ +#define US_LIN_CSR_NACK_0 (0x0u << 13) /**< \brief (US_LIN_CSR) No Non Acknowledge has not been detected since the last RSTNACK */ +#define US_LIN_CSR_NACK_1 (0x1u << 13) /**< \brief (US_LIN_CSR) At least one Non Acknowledge has been detected since the last RSTNACK */ +#define US_LIN_CSR_LINID (0x1u << 14) /**< \brief (US_LIN_CSR) LIN Identifier Sent or LIN Identifier Received */ +#define US_LIN_CSR_LINTC (0x1u << 15) /**< \brief (US_LIN_CSR) LIN Transfer Conpleted */ +#define US_LIN_CSR_RIIC (0x1u << 16) /**< \brief (US_LIN_CSR) Ring Indicator Input Change Flag */ +#define US_LIN_CSR_RIIC_0 (0x0u << 16) /**< \brief (US_LIN_CSR) No input change has been detected on the RI pin since the last read of CSR */ +#define US_LIN_CSR_RIIC_1 (0x1u << 16) /**< \brief (US_LIN_CSR) At least one input change has been detected on the RI pin since the last read of CSR */ +#define US_LIN_CSR_DSRIC (0x1u << 17) /**< \brief (US_LIN_CSR) Data Set Ready Input Change Flag */ +#define US_LIN_CSR_DSRIC_0 (0x0u << 17) /**< \brief (US_LIN_CSR) No input change has been detected on the DSR pin since the last read of CSR */ +#define US_LIN_CSR_DSRIC_1 (0x1u << 17) /**< \brief (US_LIN_CSR) At least one input change has been detected on the DSR pin since the last read of CSR */ +#define US_LIN_CSR_DCDIC (0x1u << 18) /**< \brief (US_LIN_CSR) Data Carrier Detect Input Change Flag */ +#define US_LIN_CSR_DCDIC_0 (0x0u << 18) /**< \brief (US_LIN_CSR) No input change has been detected on the DCD pin since the last read of CSR */ +#define US_LIN_CSR_DCDIC_1 (0x1u << 18) /**< \brief (US_LIN_CSR) At least one input change has been detected on the DCD pin since the last read of CSR */ +#define US_LIN_CSR_CTSIC (0x1u << 19) /**< \brief (US_LIN_CSR) Clear to Send Input Change Flag */ +#define US_LIN_CSR_CTSIC_0 (0x0u << 19) /**< \brief (US_LIN_CSR) No input change has been detected on the CTS pin since the last read of CSR */ +#define US_LIN_CSR_CTSIC_1 (0x1u << 19) /**< \brief (US_LIN_CSR) At least one input change has been detected on the CTS pin since the last read of CSR */ +#define US_LIN_CSR_RI (0x1u << 20) /**< \brief (US_LIN_CSR) Image of RI Input */ +#define US_LIN_CSR_RI_0 (0x0u << 20) /**< \brief (US_LIN_CSR) RI is at 0 */ +#define US_LIN_CSR_RI_1 (0x1u << 20) /**< \brief (US_LIN_CSR) RI is at 1 */ +#define US_LIN_CSR_DSR (0x1u << 21) /**< \brief (US_LIN_CSR) Image of DSR Input */ +#define US_LIN_CSR_DSR_0 (0x0u << 21) /**< \brief (US_LIN_CSR) DSR is at 0 */ +#define US_LIN_CSR_DSR_1 (0x1u << 21) /**< \brief (US_LIN_CSR) DSR is at 1 */ +#define US_LIN_CSR_DCD (0x1u << 22) /**< \brief (US_LIN_CSR) Image of DCD Input */ +#define US_LIN_CSR_DCD_0 (0x0u << 22) /**< \brief (US_LIN_CSR) DCD is at 0 */ +#define US_LIN_CSR_DCD_1 (0x1u << 22) /**< \brief (US_LIN_CSR) DCD is at 1 */ +#define US_LIN_CSR_LINBLS (0x1u << 23) /**< \brief (US_LIN_CSR) LIN Bus Line Status */ +#define US_LIN_CSR_LINBLS_0 (0x0u << 23) /**< \brief (US_LIN_CSR) CTS is at 0 */ +#define US_LIN_CSR_LINBLS_1 (0x1u << 23) /**< \brief (US_LIN_CSR) CTS is at 1 */ +#define US_LIN_CSR_LINBE (0x1u << 25) /**< \brief (US_LIN_CSR) LIN Bit Error */ +#define US_LIN_CSR_LINISFE (0x1u << 26) /**< \brief (US_LIN_CSR) LIN Inconsistent Synch Field Error */ +#define US_LIN_CSR_LINIPE (0x1u << 27) /**< \brief (US_LIN_CSR) LIN Identifier Parity Error */ +#define US_LIN_CSR_LINCE (0x1u << 28) /**< \brief (US_LIN_CSR) LIN Checksum Error */ +#define US_LIN_CSR_LINSNRE (0x1u << 29) /**< \brief (US_LIN_CSR) LIN Slave Not Responding Error */ +#define US_LIN_CSR_LINSTE (0x1u << 30) /**< \brief (US_LIN_CSR) LIN Synch Tolerance Error */ +#define US_LIN_CSR_LINSTE_0 (0x0u << 30) /**< \brief (US_LIN_CSR) COMM_TX is at 0 */ +#define US_LIN_CSR_LINSTE_1 (0x1u << 30) /**< \brief (US_LIN_CSR) COMM_TX is at 1 */ +#define US_LIN_CSR_LINHTE (0x1u << 31) /**< \brief (US_LIN_CSR) LIN Header Timeout Error */ +#define US_LIN_CSR_LINHTE_0 (0x0u << 31) /**< \brief (US_LIN_CSR) COMM_RX is at 0 */ +#define US_LIN_CSR_LINHTE_1 (0x1u << 31) /**< \brief (US_LIN_CSR) COMM_RX is at 1 */ +/* -------- US_SPI_SLAVE_CSR : (USART Offset: 0x14) Channel Status Register -------- */ +#define US_SPI_SLAVE_CSR_RXRDY (0x1u << 0) /**< \brief (US_SPI_SLAVE_CSR) Receiver Ready */ +#define US_SPI_SLAVE_CSR_RXRDY_0 (0x0u << 0) /**< \brief (US_SPI_SLAVE_CSR) No complete character has been received since the last read of RHR or the receiver is disabled. If characters werebeing received when the receiver was disabled, RXRDY changes to 1 when the receiver is enabled */ +#define US_SPI_SLAVE_CSR_RXRDY_1 (0x1u << 0) /**< \brief (US_SPI_SLAVE_CSR) At least one complete character has been received and RHR has not yet been read */ +#define US_SPI_SLAVE_CSR_TXRDY (0x1u << 1) /**< \brief (US_SPI_SLAVE_CSR) Transmitter Ready */ +#define US_SPI_SLAVE_CSR_TXRDY_0 (0x0u << 1) /**< \brief (US_SPI_SLAVE_CSR) A character is in the THR waiting to be transferred to the Transmit Shift Register, or an STTBRK command has been requested, or the transmitter is disabled. As soon as the transmitter is enabled, TXRDY becomes 1 */ +#define US_SPI_SLAVE_CSR_TXRDY_1 (0x1u << 1) /**< \brief (US_SPI_SLAVE_CSR) There is no character in the THR */ +#define US_SPI_SLAVE_CSR_RXBRK (0x1u << 2) /**< \brief (US_SPI_SLAVE_CSR) Break Received/End of Break */ +#define US_SPI_SLAVE_CSR_RXBRK_0 (0x0u << 2) /**< \brief (US_SPI_SLAVE_CSR) No Break received or End of Break detected since the last RSTSTA */ +#define US_SPI_SLAVE_CSR_RXBRK_1 (0x1u << 2) /**< \brief (US_SPI_SLAVE_CSR) Break Received or End of Break detected since the last RSTSTA */ +#define US_SPI_SLAVE_CSR_ENDRX (0x1u << 3) /**< \brief (US_SPI_SLAVE_CSR) End of Receiver Transfer */ +#define US_SPI_SLAVE_CSR_ENDRX_0 (0x0u << 3) /**< \brief (US_SPI_SLAVE_CSR) The End of Transfer signal from the Receive PDC channel is inactive */ +#define US_SPI_SLAVE_CSR_ENDRX_1 (0x1u << 3) /**< \brief (US_SPI_SLAVE_CSR) The End of Transfer signal from the Receive PDC channel is active */ +#define US_SPI_SLAVE_CSR_ENDTX (0x1u << 4) /**< \brief (US_SPI_SLAVE_CSR) End of Transmitter Transfer */ +#define US_SPI_SLAVE_CSR_ENDTX_0 (0x0u << 4) /**< \brief (US_SPI_SLAVE_CSR) The End of Transfer signal from the Transmit PDC channel is inactive */ +#define US_SPI_SLAVE_CSR_ENDTX_1 (0x1u << 4) /**< \brief (US_SPI_SLAVE_CSR) The End of Transfer signal from the Transmit PDC channel is active */ +#define US_SPI_SLAVE_CSR_OVRE (0x1u << 5) /**< \brief (US_SPI_SLAVE_CSR) Overrun Error */ +#define US_SPI_SLAVE_CSR_OVRE_0 (0x0u << 5) /**< \brief (US_SPI_SLAVE_CSR) No overrun error has occurred since since the last RSTSTA */ +#define US_SPI_SLAVE_CSR_OVRE_1 (0x1u << 5) /**< \brief (US_SPI_SLAVE_CSR) At least one overrun error has occurred since the last RSTSTA */ +#define US_SPI_SLAVE_CSR_FRAME (0x1u << 6) /**< \brief (US_SPI_SLAVE_CSR) Framing Error */ +#define US_SPI_SLAVE_CSR_FRAME_0 (0x0u << 6) /**< \brief (US_SPI_SLAVE_CSR) No stop bit has been detected low since the last RSTSTA */ +#define US_SPI_SLAVE_CSR_FRAME_1 (0x1u << 6) /**< \brief (US_SPI_SLAVE_CSR) At least one stop bit has been detected low since the last RSTSTA */ +#define US_SPI_SLAVE_CSR_PARE (0x1u << 7) /**< \brief (US_SPI_SLAVE_CSR) Parity Error */ +#define US_SPI_SLAVE_CSR_PARE_0 (0x0u << 7) /**< \brief (US_SPI_SLAVE_CSR) No parity error has been detected since the last RSTSTA */ +#define US_SPI_SLAVE_CSR_PARE_1 (0x1u << 7) /**< \brief (US_SPI_SLAVE_CSR) At least one parity error has been detected since the last RSTSTA */ +#define US_SPI_SLAVE_CSR_TIMEOUT (0x1u << 8) /**< \brief (US_SPI_SLAVE_CSR) Receiver Time-out */ +#define US_SPI_SLAVE_CSR_TIMEOUT_0 (0x0u << 8) /**< \brief (US_SPI_SLAVE_CSR) There has not been a time-out since the last Start Time-out command or the Time-out Register is 0 */ +#define US_SPI_SLAVE_CSR_TIMEOUT_1 (0x1u << 8) /**< \brief (US_SPI_SLAVE_CSR) There has been a time-out since the last Start Time-out command */ +#define US_SPI_SLAVE_CSR_TXEMPTY (0x1u << 9) /**< \brief (US_SPI_SLAVE_CSR) Transmitter Empty */ +#define US_SPI_SLAVE_CSR_TXEMPTY_0 (0x0u << 9) /**< \brief (US_SPI_SLAVE_CSR) There are characters in either THR or the Transmit Shift Register, or the transmitter is disabled */ +#define US_SPI_SLAVE_CSR_TXEMPTY_1 (0x1u << 9) /**< \brief (US_SPI_SLAVE_CSR) There is at least one character in either THR or the Transmit Shift Register */ +#define US_SPI_SLAVE_CSR_UNRE (0x1u << 10) /**< \brief (US_SPI_SLAVE_CSR) SPI Underrun Error */ +#define US_SPI_SLAVE_CSR_UNRE_0 (0x0u << 10) /**< \brief (US_SPI_SLAVE_CSR) No SPI underrun error has occurred since the last RSTSTA */ +#define US_SPI_SLAVE_CSR_UNRE_1 (0x1u << 10) /**< \brief (US_SPI_SLAVE_CSR) At least one SPI underrun error has occurred since the last RSTSTA */ +#define US_SPI_SLAVE_CSR_TXBUFE (0x1u << 11) /**< \brief (US_SPI_SLAVE_CSR) Transmission Buffer Empty */ +#define US_SPI_SLAVE_CSR_TXBUFE_0 (0x0u << 11) /**< \brief (US_SPI_SLAVE_CSR) The signal Buffer Empty from the Transmit PDC channel is inactive */ +#define US_SPI_SLAVE_CSR_TXBUFE_1 (0x1u << 11) /**< \brief (US_SPI_SLAVE_CSR) The signal Buffer Empty from the Transmit PDC channel is active */ +#define US_SPI_SLAVE_CSR_RXBUFF (0x1u << 12) /**< \brief (US_SPI_SLAVE_CSR) Reception Buffer Full */ +#define US_SPI_SLAVE_CSR_RXBUFF_0 (0x0u << 12) /**< \brief (US_SPI_SLAVE_CSR) The signal Buffer Full from the Receive PDC channel is inactive */ +#define US_SPI_SLAVE_CSR_RXBUFF_1 (0x1u << 12) /**< \brief (US_SPI_SLAVE_CSR) The signal Buffer Full from the Receive PDC channel is active */ +#define US_SPI_SLAVE_CSR_NACK (0x1u << 13) /**< \brief (US_SPI_SLAVE_CSR) Non Acknowledge */ +#define US_SPI_SLAVE_CSR_NACK_0 (0x0u << 13) /**< \brief (US_SPI_SLAVE_CSR) No Non Acknowledge has not been detected since the last RSTNACK */ +#define US_SPI_SLAVE_CSR_NACK_1 (0x1u << 13) /**< \brief (US_SPI_SLAVE_CSR) At least one Non Acknowledge has been detected since the last RSTNACK */ +#define US_SPI_SLAVE_CSR_RIIC (0x1u << 16) /**< \brief (US_SPI_SLAVE_CSR) Ring Indicator Input Change Flag */ +#define US_SPI_SLAVE_CSR_RIIC_0 (0x0u << 16) /**< \brief (US_SPI_SLAVE_CSR) No input change has been detected on the RI pin since the last read of CSR */ +#define US_SPI_SLAVE_CSR_RIIC_1 (0x1u << 16) /**< \brief (US_SPI_SLAVE_CSR) At least one input change has been detected on the RI pin since the last read of CSR */ +#define US_SPI_SLAVE_CSR_DSRIC (0x1u << 17) /**< \brief (US_SPI_SLAVE_CSR) Data Set Ready Input Change Flag */ +#define US_SPI_SLAVE_CSR_DSRIC_0 (0x0u << 17) /**< \brief (US_SPI_SLAVE_CSR) No input change has been detected on the DSR pin since the last read of CSR */ +#define US_SPI_SLAVE_CSR_DSRIC_1 (0x1u << 17) /**< \brief (US_SPI_SLAVE_CSR) At least one input change has been detected on the DSR pin since the last read of CSR */ +#define US_SPI_SLAVE_CSR_DCDIC (0x1u << 18) /**< \brief (US_SPI_SLAVE_CSR) Data Carrier Detect Input Change Flag */ +#define US_SPI_SLAVE_CSR_DCDIC_0 (0x0u << 18) /**< \brief (US_SPI_SLAVE_CSR) No input change has been detected on the DCD pin since the last read of CSR */ +#define US_SPI_SLAVE_CSR_DCDIC_1 (0x1u << 18) /**< \brief (US_SPI_SLAVE_CSR) At least one input change has been detected on the DCD pin since the last read of CSR */ +#define US_SPI_SLAVE_CSR_CTSIC (0x1u << 19) /**< \brief (US_SPI_SLAVE_CSR) Clear to Send Input Change Flag */ +#define US_SPI_SLAVE_CSR_CTSIC_0 (0x0u << 19) /**< \brief (US_SPI_SLAVE_CSR) No input change has been detected on the CTS pin since the last read of CSR */ +#define US_SPI_SLAVE_CSR_CTSIC_1 (0x1u << 19) /**< \brief (US_SPI_SLAVE_CSR) At least one input change has been detected on the CTS pin since the last read of CSR */ +#define US_SPI_SLAVE_CSR_RI (0x1u << 20) /**< \brief (US_SPI_SLAVE_CSR) Image of RI Input */ +#define US_SPI_SLAVE_CSR_RI_0 (0x0u << 20) /**< \brief (US_SPI_SLAVE_CSR) RI is at 0 */ +#define US_SPI_SLAVE_CSR_RI_1 (0x1u << 20) /**< \brief (US_SPI_SLAVE_CSR) RI is at 1 */ +#define US_SPI_SLAVE_CSR_DSR (0x1u << 21) /**< \brief (US_SPI_SLAVE_CSR) Image of DSR Input */ +#define US_SPI_SLAVE_CSR_DSR_0 (0x0u << 21) /**< \brief (US_SPI_SLAVE_CSR) DSR is at 0 */ +#define US_SPI_SLAVE_CSR_DSR_1 (0x1u << 21) /**< \brief (US_SPI_SLAVE_CSR) DSR is at 1 */ +#define US_SPI_SLAVE_CSR_DCD (0x1u << 22) /**< \brief (US_SPI_SLAVE_CSR) Image of DCD Input */ +#define US_SPI_SLAVE_CSR_DCD_0 (0x0u << 22) /**< \brief (US_SPI_SLAVE_CSR) DCD is at 0 */ +#define US_SPI_SLAVE_CSR_DCD_1 (0x1u << 22) /**< \brief (US_SPI_SLAVE_CSR) DCD is at 1 */ +#define US_SPI_SLAVE_CSR_CTS (0x1u << 23) /**< \brief (US_SPI_SLAVE_CSR) Image of CTS Input */ +#define US_SPI_SLAVE_CSR_CTS_0 (0x0u << 23) /**< \brief (US_SPI_SLAVE_CSR) CTS is at 0 */ +#define US_SPI_SLAVE_CSR_CTS_1 (0x1u << 23) /**< \brief (US_SPI_SLAVE_CSR) CTS is at 1 */ +/* -------- US_USART_CSR : (USART Offset: 0x14) Channel Status Register -------- */ +#define US_USART_CSR_RXRDY (0x1u << 0) /**< \brief (US_USART_CSR) Receiver Ready */ +#define US_USART_CSR_RXRDY_0 (0x0u << 0) /**< \brief (US_USART_CSR) No complete character has been received since the last read of RHR or the receiver is disabled. If characters werebeing received when the receiver was disabled, RXRDY changes to 1 when the receiver is enabled */ +#define US_USART_CSR_RXRDY_1 (0x1u << 0) /**< \brief (US_USART_CSR) At least one complete character has been received and RHR has not yet been read */ +#define US_USART_CSR_TXRDY (0x1u << 1) /**< \brief (US_USART_CSR) Transmitter Ready */ +#define US_USART_CSR_TXRDY_0 (0x0u << 1) /**< \brief (US_USART_CSR) A character is in the THR waiting to be transferred to the Transmit Shift Register, or an STTBRK command has been requested, or the transmitter is disabled. As soon as the transmitter is enabled, TXRDY becomes 1 */ +#define US_USART_CSR_TXRDY_1 (0x1u << 1) /**< \brief (US_USART_CSR) There is no character in the THR */ +#define US_USART_CSR_RXBRK (0x1u << 2) /**< \brief (US_USART_CSR) Break Received/End of Break */ +#define US_USART_CSR_RXBRK_0 (0x0u << 2) /**< \brief (US_USART_CSR) No Break received or End of Break detected since the last RSTSTA */ +#define US_USART_CSR_RXBRK_1 (0x1u << 2) /**< \brief (US_USART_CSR) Break Received or End of Break detected since the last RSTSTA */ +#define US_USART_CSR_ENDRX (0x1u << 3) /**< \brief (US_USART_CSR) End of Receiver Transfer */ +#define US_USART_CSR_ENDRX_0 (0x0u << 3) /**< \brief (US_USART_CSR) The End of Transfer signal from the Receive PDC channel is inactive */ +#define US_USART_CSR_ENDRX_1 (0x1u << 3) /**< \brief (US_USART_CSR) The End of Transfer signal from the Receive PDC channel is active */ +#define US_USART_CSR_ENDTX (0x1u << 4) /**< \brief (US_USART_CSR) End of Transmitter Transfer */ +#define US_USART_CSR_ENDTX_0 (0x0u << 4) /**< \brief (US_USART_CSR) The End of Transfer signal from the Transmit PDC channel is inactive */ +#define US_USART_CSR_ENDTX_1 (0x1u << 4) /**< \brief (US_USART_CSR) The End of Transfer signal from the Transmit PDC channel is active */ +#define US_USART_CSR_OVRE (0x1u << 5) /**< \brief (US_USART_CSR) Overrun Error */ +#define US_USART_CSR_OVRE_0 (0x0u << 5) /**< \brief (US_USART_CSR) No overrun error has occurred since since the last RSTSTA */ +#define US_USART_CSR_OVRE_1 (0x1u << 5) /**< \brief (US_USART_CSR) At least one overrun error has occurred since the last RSTSTA */ +#define US_USART_CSR_FRAME (0x1u << 6) /**< \brief (US_USART_CSR) Framing Error */ +#define US_USART_CSR_FRAME_0 (0x0u << 6) /**< \brief (US_USART_CSR) No stop bit has been detected low since the last RSTSTA */ +#define US_USART_CSR_FRAME_1 (0x1u << 6) /**< \brief (US_USART_CSR) At least one stop bit has been detected low since the last RSTSTA */ +#define US_USART_CSR_PARE (0x1u << 7) /**< \brief (US_USART_CSR) Parity Error */ +#define US_USART_CSR_PARE_0 (0x0u << 7) /**< \brief (US_USART_CSR) No parity error has been detected since the last RSTSTA */ +#define US_USART_CSR_PARE_1 (0x1u << 7) /**< \brief (US_USART_CSR) At least one parity error has been detected since the last RSTSTA */ +#define US_USART_CSR_TIMEOUT (0x1u << 8) /**< \brief (US_USART_CSR) Receiver Time-out */ +#define US_USART_CSR_TIMEOUT_0 (0x0u << 8) /**< \brief (US_USART_CSR) There has not been a time-out since the last Start Time-out command or the Time-out Register is 0 */ +#define US_USART_CSR_TIMEOUT_1 (0x1u << 8) /**< \brief (US_USART_CSR) There has been a time-out since the last Start Time-out command */ +#define US_USART_CSR_TXEMPTY (0x1u << 9) /**< \brief (US_USART_CSR) Transmitter Empty */ +#define US_USART_CSR_TXEMPTY_0 (0x0u << 9) /**< \brief (US_USART_CSR) There are characters in either THR or the Transmit Shift Register, or the transmitter is disabled */ +#define US_USART_CSR_TXEMPTY_1 (0x1u << 9) /**< \brief (US_USART_CSR) There is at least one character in either THR or the Transmit Shift Register */ +#define US_USART_CSR_ITER (0x1u << 10) /**< \brief (US_USART_CSR) Max number of Repetitions Reached */ +#define US_USART_CSR_ITER_0 (0x0u << 10) /**< \brief (US_USART_CSR) Maximum number of repetitions has not been reached since the last RSIT */ +#define US_USART_CSR_ITER_1 (0x1u << 10) /**< \brief (US_USART_CSR) Maximum number of repetitions has been reached since the last RSIT */ +#define US_USART_CSR_TXBUFE (0x1u << 11) /**< \brief (US_USART_CSR) Transmission Buffer Empty */ +#define US_USART_CSR_TXBUFE_0 (0x0u << 11) /**< \brief (US_USART_CSR) The signal Buffer Empty from the Transmit PDC channel is inactive */ +#define US_USART_CSR_TXBUFE_1 (0x1u << 11) /**< \brief (US_USART_CSR) The signal Buffer Empty from the Transmit PDC channel is active */ +#define US_USART_CSR_RXBUFF (0x1u << 12) /**< \brief (US_USART_CSR) Reception Buffer Full */ +#define US_USART_CSR_RXBUFF_0 (0x0u << 12) /**< \brief (US_USART_CSR) The signal Buffer Full from the Receive PDC channel is inactive */ +#define US_USART_CSR_RXBUFF_1 (0x1u << 12) /**< \brief (US_USART_CSR) The signal Buffer Full from the Receive PDC channel is active */ +#define US_USART_CSR_NACK (0x1u << 13) /**< \brief (US_USART_CSR) Non Acknowledge */ +#define US_USART_CSR_NACK_0 (0x0u << 13) /**< \brief (US_USART_CSR) No Non Acknowledge has not been detected since the last RSTNACK */ +#define US_USART_CSR_NACK_1 (0x1u << 13) /**< \brief (US_USART_CSR) At least one Non Acknowledge has been detected since the last RSTNACK */ +#define US_USART_CSR_RIIC (0x1u << 16) /**< \brief (US_USART_CSR) Ring Indicator Input Change Flag */ +#define US_USART_CSR_RIIC_0 (0x0u << 16) /**< \brief (US_USART_CSR) No input change has been detected on the RI pin since the last read of CSR */ +#define US_USART_CSR_RIIC_1 (0x1u << 16) /**< \brief (US_USART_CSR) At least one input change has been detected on the RI pin since the last read of CSR */ +#define US_USART_CSR_DSRIC (0x1u << 17) /**< \brief (US_USART_CSR) Data Set Ready Input Change Flag */ +#define US_USART_CSR_DSRIC_0 (0x0u << 17) /**< \brief (US_USART_CSR) No input change has been detected on the DSR pin since the last read of CSR */ +#define US_USART_CSR_DSRIC_1 (0x1u << 17) /**< \brief (US_USART_CSR) At least one input change has been detected on the DSR pin since the last read of CSR */ +#define US_USART_CSR_DCDIC (0x1u << 18) /**< \brief (US_USART_CSR) Data Carrier Detect Input Change Flag */ +#define US_USART_CSR_DCDIC_0 (0x0u << 18) /**< \brief (US_USART_CSR) No input change has been detected on the DCD pin since the last read of CSR */ +#define US_USART_CSR_DCDIC_1 (0x1u << 18) /**< \brief (US_USART_CSR) At least one input change has been detected on the DCD pin since the last read of CSR */ +#define US_USART_CSR_CTSIC (0x1u << 19) /**< \brief (US_USART_CSR) Clear to Send Input Change Flag */ +#define US_USART_CSR_CTSIC_0 (0x0u << 19) /**< \brief (US_USART_CSR) No input change has been detected on the CTS pin since the last read of CSR */ +#define US_USART_CSR_CTSIC_1 (0x1u << 19) /**< \brief (US_USART_CSR) At least one input change has been detected on the CTS pin since the last read of CSR */ +#define US_USART_CSR_RI (0x1u << 20) /**< \brief (US_USART_CSR) Image of RI Input */ +#define US_USART_CSR_RI_0 (0x0u << 20) /**< \brief (US_USART_CSR) RI is at 0 */ +#define US_USART_CSR_RI_1 (0x1u << 20) /**< \brief (US_USART_CSR) RI is at 1 */ +#define US_USART_CSR_DSR (0x1u << 21) /**< \brief (US_USART_CSR) Image of DSR Input */ +#define US_USART_CSR_DSR_0 (0x0u << 21) /**< \brief (US_USART_CSR) DSR is at 0 */ +#define US_USART_CSR_DSR_1 (0x1u << 21) /**< \brief (US_USART_CSR) DSR is at 1 */ +#define US_USART_CSR_DCD (0x1u << 22) /**< \brief (US_USART_CSR) Image of DCD Input */ +#define US_USART_CSR_DCD_0 (0x0u << 22) /**< \brief (US_USART_CSR) DCD is at 0 */ +#define US_USART_CSR_DCD_1 (0x1u << 22) /**< \brief (US_USART_CSR) DCD is at 1 */ +#define US_USART_CSR_CTS (0x1u << 23) /**< \brief (US_USART_CSR) Image of CTS Input */ +#define US_USART_CSR_CTS_0 (0x0u << 23) /**< \brief (US_USART_CSR) CTS is at 0 */ +#define US_USART_CSR_CTS_1 (0x1u << 23) /**< \brief (US_USART_CSR) CTS is at 1 */ +#define US_USART_CSR_MANERR (0x1u << 24) /**< \brief (US_USART_CSR) Manchester Error */ +#define US_USART_CSR_MANERR_0 (0x0u << 24) /**< \brief (US_USART_CSR) No Manchester error has been detected since the last RSTSTA */ +#define US_USART_CSR_MANERR_1 (0x1u << 24) /**< \brief (US_USART_CSR) At least one Manchester error has been detected since the last RSTSTA */ +/* -------- US_CSR : (USART Offset: 0x14) Channel Status Register -------- */ +#define US_CSR_RXRDY (0x1u << 0) /**< \brief (US_CSR) Receiver Ready */ +#define US_CSR_TXRDY (0x1u << 1) /**< \brief (US_CSR) Transmitter Ready */ +#define US_CSR_RXBRK (0x1u << 2) /**< \brief (US_CSR) Break Received/End of Break */ +#define US_CSR_ENDRX (0x1u << 3) /**< \brief (US_CSR) End of Receiver Transfer */ +#define US_CSR_ENDTX (0x1u << 4) /**< \brief (US_CSR) End of Transmitter Transfer */ +#define US_CSR_OVRE (0x1u << 5) /**< \brief (US_CSR) Overrun Error */ +#define US_CSR_FRAME (0x1u << 6) /**< \brief (US_CSR) Framing Error */ +#define US_CSR_PARE (0x1u << 7) /**< \brief (US_CSR) Parity Error */ +#define US_CSR_TIMEOUT (0x1u << 8) /**< \brief (US_CSR) Receiver Time-out */ +#define US_CSR_TXEMPTY (0x1u << 9) /**< \brief (US_CSR) Transmitter Empty */ +#define US_CSR_ITER (0x1u << 10) /**< \brief (US_CSR) Max number of Repetitions Reached */ +#define US_CSR_UNRE (0x1u << 10) /**< \brief (US_CSR) SPI Underrun Error */ +#define US_CSR_TXBUFE (0x1u << 11) /**< \brief (US_CSR) Transmission Buffer Empty */ +#define US_CSR_RXBUFF (0x1u << 12) /**< \brief (US_CSR) Reception Buffer Full */ +#define US_CSR_NACK (0x1u << 13) /**< \brief (US_CSR) Non Acknowledge or LIN Break Sent or LIN Break Received */ +#define US_CSR_LINID (0x1u << 14) /**< \brief (US_CSR) LIN Identifier Sent or LIN Identifier Received */ +#define US_CSR_LINTC (0x1u << 15) /**< \brief (US_CSR) LIN Transfer Conpleted */ +#define US_CSR_RIIC (0x1u << 16) /**< \brief (US_CSR) Ring Indicator Input Change Flag */ +#define US_CSR_DSRIC (0x1u << 17) /**< \brief (US_CSR) Data Set Ready Input Change Flag */ +#define US_CSR_DCDIC (0x1u << 18) /**< \brief (US_CSR) Data Carrier Detect Input Change Flag */ +#define US_CSR_CTSIC (0x1u << 19) /**< \brief (US_CSR) Clear to Send Input Change Flag */ +#define US_CSR_LINBLS (0x1u << 23) /**< \brief (US_CSR) LIN Bus Line Status */ +#define US_CSR_MANERR (0x1u << 24) /**< \brief (US_CSR) Manchester Error */ +#define US_CSR_LINBE (0x1u << 25) /**< \brief (US_CSR) LIN Bit Error */ +#define US_CSR_LINISFE (0x1u << 26) /**< \brief (US_CSR) LIN Inconsistent Synch Field Error */ +#define US_CSR_LINIPE (0x1u << 27) /**< \brief (US_CSR) LIN Identifier Parity Error */ +#define US_CSR_LINCE (0x1u << 28) /**< \brief (US_CSR) LIN Checksum Error */ +#define US_CSR_LINSNRE (0x1u << 29) /**< \brief (US_CSR) LIN Slave Not Responding Error */ +#define US_CSR_LINSTE (0x1u << 30) /**< \brief (US_CSR) LIN Synch Tolerance Error */ +#define US_CSR_LINHTE (0x1u << 31) /**< \brief (US_CSR) LIN Header Timeout Error */ + +/* -------- US_RHR : (USART Offset: 0x18) Receiver Holding Register -------- */ +#define US_RHR_RXCHR_Pos 0 +#define US_RHR_RXCHR_Msk (0x1FFu << US_RHR_RXCHR_Pos) /**< \brief (US_RHR) Received Character */ +#define US_RHR_RXCHR(value) ((US_RHR_RXCHR_Msk & ((value) << US_RHR_RXCHR_Pos))) +#define US_RHR_RXSYNH (0x1u << 15) /**< \brief (US_RHR) Received Sync */ +#define US_RHR_RXSYNH_0 (0x0u << 15) /**< \brief (US_RHR) Last character received is a Data */ +#define US_RHR_RXSYNH_1 (0x1u << 15) /**< \brief (US_RHR) Last character received is a Command */ +/* -------- US_THR : (USART Offset: 0x1C) Transmitter Holding Register -------- */ +#define US_THR_TXCHR_Pos 0 +#define US_THR_TXCHR_Msk (0x1FFu << US_THR_TXCHR_Pos) /**< \brief (US_THR) Character to be Transmitted */ +#define US_THR_TXCHR(value) ((US_THR_TXCHR_Msk & ((value) << US_THR_TXCHR_Pos))) +#define US_THR_TXSYNH (0x1u << 15) /**< \brief (US_THR) Sync Field to be transmitted */ +#define US_THR_TXSYNH_0 (0x0u << 15) /**< \brief (US_THR) The next character sent is encoded as a data. Start Frame Delimiter is DATA SYNC */ +#define US_THR_TXSYNH_1 (0x1u << 15) /**< \brief (US_THR) The next character sent is encoded as a command. Start Frame Delimiter is COMMAND SYNC */ +/* -------- US_BRGR : (USART Offset: 0x20) Baud Rate Generator Register -------- */ +#define US_BRGR_CD_Pos 0 +#define US_BRGR_CD_Msk (0xFFFFu << US_BRGR_CD_Pos) /**< \brief (US_BRGR) Clock Divisor */ +#define US_BRGR_CD(value) ((US_BRGR_CD_Msk & ((value) << US_BRGR_CD_Pos))) +#define US_BRGR_CD_DISABLE (0x0u << 0) /**< \brief (US_BRGR) Disables the clock */ +#define US_BRGR_CD_BYPASS (0x1u << 0) /**< \brief (US_BRGR) Clock Divisor Bypass */ +#define US_BRGR_CD_2 (0x2u << 0) /**< \brief (US_BRGR) Baud Rate (Asynchronous Mode) = Selected Clock/(16 x CD) or (8 x CD); Baud Rate (Synchronous Mode) = Selected Clock/CD; */ +#define US_BRGR_FP_Pos 16 +#define US_BRGR_FP_Msk (0x7u << US_BRGR_FP_Pos) /**< \brief (US_BRGR) Fractional Part */ +#define US_BRGR_FP(value) ((US_BRGR_FP_Msk & ((value) << US_BRGR_FP_Pos))) +#define US_BRGR_FP_0 (0x0u << 16) /**< \brief (US_BRGR) Fractional divider is disabled */ +/* -------- US_RTOR : (USART Offset: 0x24) Receiver Time-out Register -------- */ +#define US_RTOR_TO_Pos 0 +#define US_RTOR_TO_Msk (0x1FFFFu << US_RTOR_TO_Pos) /**< \brief (US_RTOR) Time-out Value */ +#define US_RTOR_TO(value) ((US_RTOR_TO_Msk & ((value) << US_RTOR_TO_Pos))) +#define US_RTOR_TO_DISABLE (0x0u << 0) /**< \brief (US_RTOR) Disables the RX Time-out function */ +/* -------- US_TTGR : (USART Offset: 0x28) Transmitter Timeguard Register -------- */ +#define US_TTGR_TG_Pos 0 +#define US_TTGR_TG_Msk (0xFFu << US_TTGR_TG_Pos) /**< \brief (US_TTGR) Timeguard Value */ +#define US_TTGR_TG(value) ((US_TTGR_TG_Msk & ((value) << US_TTGR_TG_Pos))) +#define US_TTGR_TG_DISABLE (0x0u << 0) /**< \brief (US_TTGR) Disables the TX Timeguard function. */ +/* -------- US_FIDI : (USART Offset: 0x40) FI DI Ratio Register -------- */ +#define US_FIDI_FI_DI_RATIO_Pos 0 +#define US_FIDI_FI_DI_RATIO_Msk (0x7FFu << US_FIDI_FI_DI_RATIO_Pos) /**< \brief (US_FIDI) FI Over DI Ratio Value */ +#define US_FIDI_FI_DI_RATIO(value) ((US_FIDI_FI_DI_RATIO_Msk & ((value) << US_FIDI_FI_DI_RATIO_Pos))) +#define US_FIDI_FI_DI_RATIO_DISABLE (0x0u << 0) /**< \brief (US_FIDI) Baud Rate = 0 */ +/* -------- US_NER : (USART Offset: 0x44) Number of Errors Register -------- */ +#define US_NER_NB_ERRORS_Pos 0 +#define US_NER_NB_ERRORS_Msk (0xFFu << US_NER_NB_ERRORS_Pos) /**< \brief (US_NER) Error number during ISO7816 transfers */ +#define US_NER_NB_ERRORS(value) ((US_NER_NB_ERRORS_Msk & ((value) << US_NER_NB_ERRORS_Pos))) +/* -------- US_IFR : (USART Offset: 0x4C) IrDA Filter Register -------- */ +#define US_IFR_IRDA_FILTER_Pos 0 +#define US_IFR_IRDA_FILTER_Msk (0xFFu << US_IFR_IRDA_FILTER_Pos) /**< \brief (US_IFR) Irda filter */ +#define US_IFR_IRDA_FILTER(value) ((US_IFR_IRDA_FILTER_Msk & ((value) << US_IFR_IRDA_FILTER_Pos))) +/* -------- US_MAN : (USART Offset: 0x50) Manchester Configuration Register -------- */ +#define US_MAN_TX_PL_Pos 0 +#define US_MAN_TX_PL_Msk (0xFu << US_MAN_TX_PL_Pos) /**< \brief (US_MAN) Transmitter Preamble Length */ +#define US_MAN_TX_PL(value) ((US_MAN_TX_PL_Msk & ((value) << US_MAN_TX_PL_Pos))) +#define US_MAN_TX_PL_0 (0x0u << 0) /**< \brief (US_MAN) The Transmitter Preamble pattern generation is disabled */ +#define US_MAN_TX_PP_Pos 8 +#define US_MAN_TX_PP_Msk (0x3u << US_MAN_TX_PP_Pos) /**< \brief (US_MAN) Transmitter Preamble Pattern */ +#define US_MAN_TX_PP(value) ((US_MAN_TX_PP_Msk & ((value) << US_MAN_TX_PP_Pos))) +#define US_MAN_TX_PP_0 (0x0u << 8) /**< \brief (US_MAN) ALL_ONE */ +#define US_MAN_TX_PP_1 (0x1u << 8) /**< \brief (US_MAN) ALL_ZERO */ +#define US_MAN_TX_PP_2 (0x2u << 8) /**< \brief (US_MAN) ZERO_ONE */ +#define US_MAN_TX_PP_3 (0x3u << 8) /**< \brief (US_MAN) ONE_ZERO */ +#define US_MAN_TX_MPOL (0x1u << 12) /**< \brief (US_MAN) Transmitter Manchester Polarity */ +#define US_MAN_TX_MPOL_0 (0x0u << 12) /**< \brief (US_MAN) Logic Zero is coded as a zero-to-one transition, Logic One is coded as a one-to-zero transition */ +#define US_MAN_TX_MPOL_1 (0x1u << 12) /**< \brief (US_MAN) Logic Zero is coded as a one-to-zero transition, Logic One is coded as a zero-to-one transition */ +#define US_MAN_RX_PL_Pos 16 +#define US_MAN_RX_PL_Msk (0xFu << US_MAN_RX_PL_Pos) /**< \brief (US_MAN) Receiver Preamble Length */ +#define US_MAN_RX_PL(value) ((US_MAN_RX_PL_Msk & ((value) << US_MAN_RX_PL_Pos))) +#define US_MAN_RX_PL_0 (0x0u << 16) /**< \brief (US_MAN) The receiver preamble pattern detection is disabled */ +#define US_MAN_RX_PP_Pos 24 +#define US_MAN_RX_PP_Msk (0x3u << US_MAN_RX_PP_Pos) /**< \brief (US_MAN) Receiver Preamble Pattern detected */ +#define US_MAN_RX_PP(value) ((US_MAN_RX_PP_Msk & ((value) << US_MAN_RX_PP_Pos))) +#define US_MAN_RX_PP_0 (0x0u << 24) /**< \brief (US_MAN) ALL_ONE */ +#define US_MAN_RX_PP_1 (0x1u << 24) /**< \brief (US_MAN) ALL_ZERO */ +#define US_MAN_RX_PP_2 (0x2u << 24) /**< \brief (US_MAN) ZERO_ONE */ +#define US_MAN_RX_PP_3 (0x3u << 24) /**< \brief (US_MAN) ONE_ZERO */ +#define US_MAN_RX_MPOL (0x1u << 28) /**< \brief (US_MAN) Receiver Manchester Polarity */ +#define US_MAN_RX_MPOL_0 (0x0u << 28) /**< \brief (US_MAN) Logic Zero is coded as a zero-to-one transition, Logic One is coded as a one-to-zero transition */ +#define US_MAN_RX_MPOL_1 (0x1u << 28) /**< \brief (US_MAN) Logic Zero is coded as a one-to-zero transition, Logic One is coded as a zero-to-one transition */ +#define US_MAN_DRIFT (0x1u << 30) /**< \brief (US_MAN) Drift compensation */ +#define US_MAN_DRIFT_0 (0x0u << 30) /**< \brief (US_MAN) The USART can not recover from an important clock drift */ +#define US_MAN_DRIFT_1 (0x1u << 30) /**< \brief (US_MAN) The USART can recover from clock drift. The 16X clock mode must be enabled */ +/* -------- US_LINMR : (USART Offset: 0x54) LIN Mode Register -------- */ +#define US_LINMR_NACT_Pos 0 +#define US_LINMR_NACT_Msk (0x3u << US_LINMR_NACT_Pos) /**< \brief (US_LINMR) LIN Node Action */ +#define US_LINMR_NACT(value) ((US_LINMR_NACT_Msk & ((value) << US_LINMR_NACT_Pos))) +#define US_LINMR_NACT_PUBLISH (0x0u << 0) /**< \brief (US_LINMR) The LIN Controller transmits the response */ +#define US_LINMR_NACT_SUBSCRIBE (0x1u << 0) /**< \brief (US_LINMR) The LIN Controller receives the response */ +#define US_LINMR_NACT_IGNORE (0x2u << 0) /**< \brief (US_LINMR) The LIN Controller doesn't transmit and doesn't receive the response */ +#define US_LINMR_PARDIS (0x1u << 2) /**< \brief (US_LINMR) Parity Disable */ +#define US_LINMR_CHKDIS (0x1u << 3) /**< \brief (US_LINMR) Checksum Disable */ +#define US_LINMR_CHKTYP (0x1u << 4) /**< \brief (US_LINMR) Checksum Type */ +#define US_LINMR_DLM (0x1u << 5) /**< \brief (US_LINMR) Data Length Mode */ +#define US_LINMR_FSDIS (0x1u << 6) /**< \brief (US_LINMR) Frame Slot Mode Disable */ +#define US_LINMR_WKUPTYP (0x1u << 7) /**< \brief (US_LINMR) Wakeup Signal Type */ +#define US_LINMR_DLC_Pos 8 +#define US_LINMR_DLC_Msk (0xFFu << US_LINMR_DLC_Pos) /**< \brief (US_LINMR) Data Length Control */ +#define US_LINMR_DLC(value) ((US_LINMR_DLC_Msk & ((value) << US_LINMR_DLC_Pos))) +#define US_LINMR_PDCM (0x1u << 16) /**< \brief (US_LINMR) PDC Mode */ +#define US_LINMR_SYNCDIS (0x1u << 17) /**< \brief (US_LINMR) Synchronization Disable */ +/* -------- US_LINIR : (USART Offset: 0x58) LIN Identifier Register -------- */ +#define US_LINIR_IDCHR_Pos 0 +#define US_LINIR_IDCHR_Msk (0xFFu << US_LINIR_IDCHR_Pos) /**< \brief (US_LINIR) Identifier Character */ +#define US_LINIR_IDCHR(value) ((US_LINIR_IDCHR_Msk & ((value) << US_LINIR_IDCHR_Pos))) +/* -------- US_LINBRR : (USART Offset: 0x5C) LIN Baud Rate Register -------- */ +#define US_LINBRR_LINCD_Pos 0 +#define US_LINBRR_LINCD_Msk (0xFFFFu << US_LINBRR_LINCD_Pos) /**< \brief (US_LINBRR) Clock Divider after Synchronization */ +#define US_LINBRR_LINCD(value) ((US_LINBRR_LINCD_Msk & ((value) << US_LINBRR_LINCD_Pos))) +#define US_LINBRR_LINFP_Pos 16 +#define US_LINBRR_LINFP_Msk (0x7u << US_LINBRR_LINFP_Pos) /**< \brief (US_LINBRR) Fractional Part after Synchronization */ +#define US_LINBRR_LINFP(value) ((US_LINBRR_LINFP_Msk & ((value) << US_LINBRR_LINFP_Pos))) +/* -------- US_WPMR : (USART Offset: 0xE4) Write Protect Mode Register -------- */ +#define US_WPMR_WPEN (0x1u << 0) /**< \brief (US_WPMR) Write Protect Enable */ +#define US_WPMR_WPEN_0 (0x0u << 0) /**< \brief (US_WPMR) Disables the Write Protect if WPKEY corresponds to 0x858365 ("USA" in ACII) */ +#define US_WPMR_WPEN_1 (0x1u << 0) /**< \brief (US_WPMR) Enables the Write Protect if WPKEY corresponds to 0x858365 ("USA" in ACII) */ +#define US_WPMR_WPKEY_Pos 8 +#define US_WPMR_WPKEY_Msk (0xFFFFFFu << US_WPMR_WPKEY_Pos) /**< \brief (US_WPMR) Write Protect Key */ +#define US_WPMR_WPKEY(value) ((US_WPMR_WPKEY_Msk & ((value) << US_WPMR_WPKEY_Pos))) +/* -------- US_WPSR : (USART Offset: 0xE8) Write Protect Status Register -------- */ +#define US_WPSR_WPV (0x1u << 0) /**< \brief (US_WPSR) Write Protect Violation Status */ +#define US_WPSR_WPV_0 (0x0u << 0) /**< \brief (US_WPSR) No Write Protect Violation has occurred since the last read of the WPSR register */ +#define US_WPSR_WPV_1 (0x1u << 0) /**< \brief (US_WPSR) A Write Protect Violation has occurred since the last read of the WPSR register. If this violation is an unauthorized attempt to write a protected register, the associated violation is reported into field WPVSRC */ +#define US_WPSR_WPVSRC_Pos 8 +#define US_WPSR_WPVSRC_Msk (0xFFFFu << US_WPSR_WPVSRC_Pos) /**< \brief (US_WPSR) Write Protect Violation Source */ +#define US_WPSR_WPVSRC(value) ((US_WPSR_WPVSRC_Msk & ((value) << US_WPSR_WPVSRC_Pos))) +/* -------- US_VERSION : (USART Offset: 0xFC) Version Register -------- */ +#define US_VERSION_VERSION_Pos 0 +#define US_VERSION_VERSION_Msk (0xFFFu << US_VERSION_VERSION_Pos) /**< \brief (US_VERSION) */ +#define US_VERSION_VERSION(value) ((US_VERSION_VERSION_Msk & ((value) << US_VERSION_VERSION_Pos))) +#define US_VERSION_MFN_Pos 16 +#define US_VERSION_MFN_Msk (0xFu << US_VERSION_MFN_Pos) /**< \brief (US_VERSION) */ +#define US_VERSION_MFN(value) ((US_VERSION_MFN_Msk & ((value) << US_VERSION_MFN_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR USBC */ +/* ============================================================================= */ +/** \addtogroup SAM4L_USBC USB 2.0 Interface */ +/*@{*/ + +#define REV_USBC 0x310 + +#ifndef __ASSEMBLY__ +/** \brief USBC hardware registers */ +typedef struct { + RwReg USBC_UDCON; /**< \brief (USBC Offset: 0x000) Device General Control Register */ + RoReg USBC_UDINT; /**< \brief (USBC Offset: 0x004) Device Global Interupt Register */ + WoReg USBC_UDINTCLR; /**< \brief (USBC Offset: 0x008) Device Global Interrupt Clear Register */ + WoReg USBC_UDINTSET; /**< \brief (USBC Offset: 0x00C) Device Global Interrupt Set Regsiter */ + RoReg USBC_UDINTE; /**< \brief (USBC Offset: 0x010) Device Global Interrupt Enable Register */ + WoReg USBC_UDINTECLR; /**< \brief (USBC Offset: 0x014) Device Global Interrupt Enable Clear Register */ + WoReg USBC_UDINTESET; /**< \brief (USBC Offset: 0x018) Device Global Interrupt Enable Set Register */ + RwReg USBC_UERST; /**< \brief (USBC Offset: 0x01C) Endpoint Enable/Reset Register */ + RoReg USBC_UDFNUM; /**< \brief (USBC Offset: 0x020) Device Frame Number Register */ + RoReg Reserved1[55]; + RwReg USBC_UECFG0; /**< \brief (USBC Offset: 0x100) Endpoint Configuration Register */ + RwReg USBC_UECFG1; /**< \brief (USBC Offset: 0x104) Endpoint Configuration Register */ + RwReg USBC_UECFG2; /**< \brief (USBC Offset: 0x108) Endpoint Configuration Register */ + RwReg USBC_UECFG3; /**< \brief (USBC Offset: 0x10C) Endpoint Configuration Register */ + RwReg USBC_UECFG4; /**< \brief (USBC Offset: 0x110) Endpoint Configuration Register */ + RwReg USBC_UECFG5; /**< \brief (USBC Offset: 0x114) Endpoint Configuration Register */ + RwReg USBC_UECFG6; /**< \brief (USBC Offset: 0x118) Endpoint Configuration Register */ + RwReg USBC_UECFG7; /**< \brief (USBC Offset: 0x11C) Endpoint Configuration Register */ + RoReg Reserved2[4]; + RoReg USBC_UESTA0; /**< \brief (USBC Offset: 0x130) Endpoint Status Register */ + RoReg USBC_UESTA1; /**< \brief (USBC Offset: 0x134) Endpoint Status Register */ + RoReg USBC_UESTA2; /**< \brief (USBC Offset: 0x138) Endpoint Status Register */ + RoReg USBC_UESTA3; /**< \brief (USBC Offset: 0x13C) Endpoint Status Register */ + RoReg USBC_UESTA4; /**< \brief (USBC Offset: 0x140) Endpoint Status Register */ + RoReg USBC_UESTA5; /**< \brief (USBC Offset: 0x144) Endpoint Status Register */ + RoReg USBC_UESTA6; /**< \brief (USBC Offset: 0x148) Endpoint Status Register */ + RoReg USBC_UESTA7; /**< \brief (USBC Offset: 0x14C) Endpoint Status Register */ + RoReg Reserved3[4]; + WoReg USBC_UESTA0CLR; /**< \brief (USBC Offset: 0x160) Endpoint Status Clear Register */ + WoReg USBC_UESTA1CLR; /**< \brief (USBC Offset: 0x164) Endpoint Status Clear Register */ + WoReg USBC_UESTA2CLR; /**< \brief (USBC Offset: 0x168) Endpoint Status Clear Register */ + WoReg USBC_UESTA3CLR; /**< \brief (USBC Offset: 0x16C) Endpoint Status Clear Register */ + WoReg USBC_UESTA4CLR; /**< \brief (USBC Offset: 0x170) Endpoint Status Clear Register */ + WoReg USBC_UESTA5CLR; /**< \brief (USBC Offset: 0x174) Endpoint Status Clear Register */ + WoReg USBC_UESTA6CLR; /**< \brief (USBC Offset: 0x178) Endpoint Status Clear Register */ + WoReg USBC_UESTA7CLR; /**< \brief (USBC Offset: 0x17C) Endpoint Status Clear Register */ + RoReg Reserved4[4]; + WoReg USBC_UESTA0SET; /**< \brief (USBC Offset: 0x190) Endpoint Status Set Register */ + WoReg USBC_UESTA1SET; /**< \brief (USBC Offset: 0x194) Endpoint Status Set Register */ + WoReg USBC_UESTA2SET; /**< \brief (USBC Offset: 0x198) Endpoint Status Set Register */ + WoReg USBC_UESTA3SET; /**< \brief (USBC Offset: 0x19C) Endpoint Status Set Register */ + WoReg USBC_UESTA4SET; /**< \brief (USBC Offset: 0x1A0) Endpoint Status Set Register */ + WoReg USBC_UESTA5SET; /**< \brief (USBC Offset: 0x1A4) Endpoint Status Set Register */ + WoReg USBC_UESTA6SET; /**< \brief (USBC Offset: 0x1A8) Endpoint Status Set Register */ + WoReg USBC_UESTA7SET; /**< \brief (USBC Offset: 0x1AC) Endpoint Status Set Register */ + RoReg Reserved5[4]; + RoReg USBC_UECON0; /**< \brief (USBC Offset: 0x1C0) Endpoint Control Register */ + RoReg USBC_UECON1; /**< \brief (USBC Offset: 0x1C4) Endpoint Control Register */ + RoReg USBC_UECON2; /**< \brief (USBC Offset: 0x1C8) Endpoint Control Register */ + RoReg USBC_UECON3; /**< \brief (USBC Offset: 0x1CC) Endpoint Control Register */ + RoReg USBC_UECON4; /**< \brief (USBC Offset: 0x1D0) Endpoint Control Register */ + RoReg USBC_UECON5; /**< \brief (USBC Offset: 0x1D4) Endpoint Control Register */ + RoReg USBC_UECON6; /**< \brief (USBC Offset: 0x1D8) Endpoint Control Register */ + RoReg USBC_UECON7; /**< \brief (USBC Offset: 0x1DC) Endpoint Control Register */ + RoReg Reserved6[4]; + WoReg USBC_UECON0SET; /**< \brief (USBC Offset: 0x1F0) Endpoint Control Set Register */ + WoReg USBC_UECON1SET; /**< \brief (USBC Offset: 0x1F4) Endpoint Control Set Register */ + WoReg USBC_UECON2SET; /**< \brief (USBC Offset: 0x1F8) Endpoint Control Set Register */ + WoReg USBC_UECON3SET; /**< \brief (USBC Offset: 0x1FC) Endpoint Control Set Register */ + WoReg USBC_UECON4SET; /**< \brief (USBC Offset: 0x200) Endpoint Control Set Register */ + WoReg USBC_UECON5SET; /**< \brief (USBC Offset: 0x204) Endpoint Control Set Register */ + WoReg USBC_UECON6SET; /**< \brief (USBC Offset: 0x208) Endpoint Control Set Register */ + WoReg USBC_UECON7SET; /**< \brief (USBC Offset: 0x20C) Endpoint Control Set Register */ + RoReg Reserved7[4]; + WoReg USBC_UECON0CLR; /**< \brief (USBC Offset: 0x220) Endpoint Control Clear Register */ + WoReg USBC_UECON1CLR; /**< \brief (USBC Offset: 0x224) TXINE Clear */ + WoReg USBC_UECON2CLR; /**< \brief (USBC Offset: 0x228) TXINE Clear */ + WoReg USBC_UECON3CLR; /**< \brief (USBC Offset: 0x22C) TXINE Clear */ + WoReg USBC_UECON4CLR; /**< \brief (USBC Offset: 0x230) TXINE Clear */ + WoReg USBC_UECON5CLR; /**< \brief (USBC Offset: 0x234) TXINE Clear */ + WoReg USBC_UECON6CLR; /**< \brief (USBC Offset: 0x238) TXINE Clear */ + WoReg USBC_UECON7CLR; /**< \brief (USBC Offset: 0x23C) TXINE Clear */ + RoReg Reserved8[112]; + RwReg USBC_UHCON; /**< \brief (USBC Offset: 0x400) Host General Control Register */ + RoReg USBC_UHINT; /**< \brief (USBC Offset: 0x404) Host Global Interrupt Register */ + WoReg USBC_UHINTCLR; /**< \brief (USBC Offset: 0x408) Host Global Interrrupt Clear Register */ + WoReg USBC_UHINTSET; /**< \brief (USBC Offset: 0x40C) Host Global Interrupt Set Register */ + RoReg USBC_UHINTE; /**< \brief (USBC Offset: 0x410) Host Global Interrupt Enable Register */ + WoReg USBC_UHINTECLR; /**< \brief (USBC Offset: 0x414) Host Global Interrupt Enable Clear Register */ + WoReg USBC_UHINTESET; /**< \brief (USBC Offset: 0x418) Host Global Interrupt Enable Set Register */ + RwReg USBC_UPRST; /**< \brief (USBC Offset: 0x41C) Pipe Reset Register */ + RwReg USBC_UHFNUM; /**< \brief (USBC Offset: 0x420) Host Frame Number Register */ + RwReg USBC_UHSOFC; /**< \brief (USBC Offset: 0x424) Host Start of Frame Control Register */ + RoReg Reserved9[54]; + RwReg USBC_UPCFG0; /**< \brief (USBC Offset: 0x500) Pipe Configuration Register */ + RwReg USBC_UPCFG1; /**< \brief (USBC Offset: 0x504) Pipe Configuration Register */ + RwReg USBC_UPCFG2; /**< \brief (USBC Offset: 0x508) Pipe Configuration Register */ + RwReg USBC_UPCFG3; /**< \brief (USBC Offset: 0x50C) Pipe Configuration Register */ + RwReg USBC_UPCFG4; /**< \brief (USBC Offset: 0x510) Pipe Configuration Register */ + RwReg USBC_UPCFG5; /**< \brief (USBC Offset: 0x514) Pipe Configuration Register */ + RwReg USBC_UPCFG6; /**< \brief (USBC Offset: 0x518) Pipe Configuration Register */ + RwReg USBC_UPCFG7; /**< \brief (USBC Offset: 0x51C) Pipe Configuration Register */ + RoReg Reserved10[4]; + RoReg USBC_UPSTA0; /**< \brief (USBC Offset: 0x530) Pipe Status Register */ + RoReg USBC_UPSTA1; /**< \brief (USBC Offset: 0x534) Pipe Status Register */ + RoReg USBC_UPSTA2; /**< \brief (USBC Offset: 0x538) Pipe Status Register */ + RoReg USBC_UPSTA3; /**< \brief (USBC Offset: 0x53C) Pipe Status Register */ + RoReg USBC_UPSTA4; /**< \brief (USBC Offset: 0x540) Pipe Status Register */ + RoReg USBC_UPSTA5; /**< \brief (USBC Offset: 0x544) Pipe Status Register */ + RoReg USBC_UPSTA6; /**< \brief (USBC Offset: 0x548) Pipe Status Register */ + RoReg USBC_UPSTA7; /**< \brief (USBC Offset: 0x54C) Pipe Status Register */ + RoReg Reserved11[4]; + WoReg USBC_UPSTA0CLR; /**< \brief (USBC Offset: 0x560) Pipe Status Clear Register */ + WoReg USBC_UPSTA1CLR; /**< \brief (USBC Offset: 0x564) Pipe Status Clear Register */ + WoReg USBC_UPSTA2CLR; /**< \brief (USBC Offset: 0x568) Pipe Status Clear Register */ + WoReg USBC_UPSTA3CLR; /**< \brief (USBC Offset: 0x56C) Pipe Status Clear Register */ + WoReg USBC_UPSTA4CLR; /**< \brief (USBC Offset: 0x570) Pipe Status Clear Register */ + WoReg USBC_UPSTA5CLR; /**< \brief (USBC Offset: 0x574) Pipe Status Clear Register */ + WoReg USBC_UPSTA6CLR; /**< \brief (USBC Offset: 0x578) Pipe Status Clear Register */ + WoReg USBC_UPSTA7CLR; /**< \brief (USBC Offset: 0x57C) Pipe Status Clear Register */ + RoReg Reserved12[4]; + WoReg USBC_UPSTA0SET; /**< \brief (USBC Offset: 0x590) Pipe Status Set Register */ + WoReg USBC_UPSTA1SET; /**< \brief (USBC Offset: 0x594) Pipe Status Set Register */ + WoReg USBC_UPSTA2SET; /**< \brief (USBC Offset: 0x598) Pipe Status Set Register */ + WoReg USBC_UPSTA3SET; /**< \brief (USBC Offset: 0x59C) Pipe Status Set Register */ + WoReg USBC_UPSTA4SET; /**< \brief (USBC Offset: 0x5A0) Pipe Status Set Register */ + WoReg USBC_UPSTA5SET; /**< \brief (USBC Offset: 0x5A4) Pipe Status Set Register */ + WoReg USBC_UPSTA6SET; /**< \brief (USBC Offset: 0x5A8) Pipe Status Set Register */ + WoReg USBC_UPSTA7SET; /**< \brief (USBC Offset: 0x5AC) Pipe Status Set Register */ + RoReg Reserved13[4]; + RoReg USBC_UPCON0; /**< \brief (USBC Offset: 0x5C0) Pipe Control Register */ + RoReg USBC_UPCON1; /**< \brief (USBC Offset: 0x5C4) Pipe Control Register */ + RoReg USBC_UPCON2; /**< \brief (USBC Offset: 0x5C8) Pipe Control Register */ + RoReg USBC_UPCON3; /**< \brief (USBC Offset: 0x5CC) Pipe Control Register */ + RoReg USBC_UPCON4; /**< \brief (USBC Offset: 0x5D0) Pipe Control Register */ + RoReg USBC_UPCON5; /**< \brief (USBC Offset: 0x5D4) Pipe Control Register */ + RoReg USBC_UPCON6; /**< \brief (USBC Offset: 0x5D8) Pipe Control Register */ + RoReg USBC_UPCON7; /**< \brief (USBC Offset: 0x5DC) Pipe Control Register */ + RoReg Reserved14[4]; + WoReg USBC_UPCON0SET; /**< \brief (USBC Offset: 0x5F0) Pipe Control Set Register */ + WoReg USBC_UPCON1SET; /**< \brief (USBC Offset: 0x5F4) Pipe Control Set Register */ + WoReg USBC_UPCON2SET; /**< \brief (USBC Offset: 0x5F8) Pipe Control Set Register */ + WoReg USBC_UPCON3SET; /**< \brief (USBC Offset: 0x5FC) Pipe Control Set Register */ + WoReg USBC_UPCON4SET; /**< \brief (USBC Offset: 0x600) Pipe Control Set Register */ + WoReg USBC_UPCON5SET; /**< \brief (USBC Offset: 0x604) Pipe Control Set Register */ + WoReg USBC_UPCON6SET; /**< \brief (USBC Offset: 0x608) Pipe Control Set Register */ + WoReg USBC_UPCON7SET; /**< \brief (USBC Offset: 0x60C) Pipe Control Set Register */ + RoReg Reserved15[4]; + WoReg USBC_UPCON0CLR; /**< \brief (USBC Offset: 0x620) Pipe Control Clear Register */ + WoReg USBC_UPCON1CLR; /**< \brief (USBC Offset: 0x624) Pipe Control Clear Register */ + WoReg USBC_UPCON2CLR; /**< \brief (USBC Offset: 0x628) Pipe Control Clear Register */ + WoReg USBC_UPCON3CLR; /**< \brief (USBC Offset: 0x62C) Pipe Control Clear Register */ + WoReg USBC_UPCON4CLR; /**< \brief (USBC Offset: 0x630) Pipe Control Clear Register */ + WoReg USBC_UPCON5CLR; /**< \brief (USBC Offset: 0x634) Pipe Control Clear Register */ + WoReg USBC_UPCON6CLR; /**< \brief (USBC Offset: 0x638) Pipe Control Clear Register */ + WoReg USBC_UPCON7CLR; /**< \brief (USBC Offset: 0x63C) Pipe Control Clear Register */ + RoReg Reserved16[4]; + RwReg USBC_UPINRQ0; /**< \brief (USBC Offset: 0x650) Pipe In Request */ + RwReg USBC_UPINRQ1; /**< \brief (USBC Offset: 0x654) Pipe In Request */ + RwReg USBC_UPINRQ2; /**< \brief (USBC Offset: 0x658) Pipe In Request */ + RwReg USBC_UPINRQ3; /**< \brief (USBC Offset: 0x65C) Pipe In Request */ + RwReg USBC_UPINRQ4; /**< \brief (USBC Offset: 0x660) Pipe In Request */ + RwReg USBC_UPINRQ5; /**< \brief (USBC Offset: 0x664) Pipe In Request */ + RwReg USBC_UPINRQ6; /**< \brief (USBC Offset: 0x668) Pipe In Request */ + RwReg USBC_UPINRQ7; /**< \brief (USBC Offset: 0x66C) Pipe In Request */ + RoReg Reserved17[100]; + RwReg USBC_USBCON; /**< \brief (USBC Offset: 0x800) General Control Register */ + RoReg USBC_USBSTA; /**< \brief (USBC Offset: 0x804) General Status Register */ + WoReg USBC_USBSTACLR; /**< \brief (USBC Offset: 0x808) General Status Clear Register */ + WoReg USBC_USBSTASET; /**< \brief (USBC Offset: 0x80C) General Status Set Register */ + RoReg Reserved18[2]; + RoReg USBC_UVERS; /**< \brief (USBC Offset: 0x818) IP Version Register */ + RoReg USBC_UFEATURES; /**< \brief (USBC Offset: 0x81C) IP Features Register */ + RoReg USBC_UADDRSIZE; /**< \brief (USBC Offset: 0x820) IP PB address size Register */ + RoReg USBC_UNAME1; /**< \brief (USBC Offset: 0x824) IP Name Part One: HUSB */ + RoReg USBC_UNAME2; /**< \brief (USBC Offset: 0x828) IP Name Part Two: HOST */ + RoReg USBC_USBFSM; /**< \brief (USBC Offset: 0x82C) USB internal finite state machine */ + RwReg USBC_UDESC; /**< \brief (USBC Offset: 0x830) Endpoint descriptor table */ +} Usbc; +#endif /* __ASSEMBLY__ */ +/* -------- USBC_UDCON : (USBC Offset: 0x000) Device General Control Register -------- */ +#define USBC_UDCON_UADD_Pos 0 +#define USBC_UDCON_UADD_Msk (0x7Fu << USBC_UDCON_UADD_Pos) /**< \brief (USBC_UDCON) USB Address */ +#define USBC_UDCON_UADD(value) ((USBC_UDCON_UADD_Msk & ((value) << USBC_UDCON_UADD_Pos))) +#define USBC_UDCON_ADDEN (0x1u << 7) /**< \brief (USBC_UDCON) Address Enable */ +#define USBC_UDCON_DETACH (0x1u << 8) /**< \brief (USBC_UDCON) Detach */ +#define USBC_UDCON_RMWKUP (0x1u << 9) /**< \brief (USBC_UDCON) Remote Wake-Up */ +#define USBC_UDCON_SPDCONF_Pos 10 +#define USBC_UDCON_SPDCONF_Msk (0x3u << USBC_UDCON_SPDCONF_Pos) /**< \brief (USBC_UDCON) Speed configuration */ +#define USBC_UDCON_SPDCONF(value) ((USBC_UDCON_SPDCONF_Msk & ((value) << USBC_UDCON_SPDCONF_Pos))) +#define USBC_UDCON_LS (0x1u << 12) /**< \brief (USBC_UDCON) Low Speed Mode Force */ +#define USBC_UDCON_TSTJ (0x1u << 13) /**< \brief (USBC_UDCON) Test mode J */ +#define USBC_UDCON_TSTK (0x1u << 14) /**< \brief (USBC_UDCON) Test mode K */ +#define USBC_UDCON_TSTPCKT (0x1u << 15) /**< \brief (USBC_UDCON) Test Packet mode */ +#define USBC_UDCON_OPMODE2 (0x1u << 16) /**< \brief (USBC_UDCON) Specific Operational mode */ +#define USBC_UDCON_GNAK (0x1u << 17) /**< \brief (USBC_UDCON) Global NAK */ +/* -------- USBC_UDINT : (USBC Offset: 0x004) Device Global Interupt Register -------- */ +#define USBC_UDINT_SUSP (0x1u << 0) /**< \brief (USBC_UDINT) Suspend Interrupt */ +#define USBC_UDINT_MSOF (0x1u << 1) /**< \brief (USBC_UDINT) Micro Start of Frame Interrupt */ +#define USBC_UDINT_SOF (0x1u << 2) /**< \brief (USBC_UDINT) Start of Frame Interrupt */ +#define USBC_UDINT_EORST (0x1u << 3) /**< \brief (USBC_UDINT) End of Reset Interrupt */ +#define USBC_UDINT_WAKEUP (0x1u << 4) /**< \brief (USBC_UDINT) Wake-Up Interrupt */ +#define USBC_UDINT_EORSM (0x1u << 5) /**< \brief (USBC_UDINT) End Of Resume Interrupt */ +#define USBC_UDINT_UPRSM (0x1u << 6) /**< \brief (USBC_UDINT) Upstream Resume Interrupt */ +#define USBC_UDINT_EP0INT (0x1u << 12) /**< \brief (USBC_UDINT) Endpoint 0 Interrupt */ +#define USBC_UDINT_EP1INT (0x1u << 13) /**< \brief (USBC_UDINT) Endpoint 1 Interrupt */ +#define USBC_UDINT_EP2INT (0x1u << 14) /**< \brief (USBC_UDINT) Endpoint 2 Interrupt */ +#define USBC_UDINT_EP3INT (0x1u << 15) /**< \brief (USBC_UDINT) Endpoint 3 Interrupt */ +#define USBC_UDINT_EP4INT (0x1u << 16) /**< \brief (USBC_UDINT) Endpoint 4 Interrupt */ +#define USBC_UDINT_EP5INT (0x1u << 17) /**< \brief (USBC_UDINT) Endpoint 5 Interrupt */ +#define USBC_UDINT_EP6INT (0x1u << 18) /**< \brief (USBC_UDINT) Endpoint 6 Interrupt */ +#define USBC_UDINT_EP7INT (0x1u << 19) /**< \brief (USBC_UDINT) Endpoint 7 Interrupt */ +/* -------- USBC_UDINTCLR : (USBC Offset: 0x008) Device Global Interrupt Clear Register -------- */ +#define USBC_UDINTCLR_SUSPC (0x1u << 0) /**< \brief (USBC_UDINTCLR) SUSP Interrupt Clear */ +#define USBC_UDINTCLR_MSOFC (0x1u << 1) /**< \brief (USBC_UDINTCLR) MSOF Interrupt Clear */ +#define USBC_UDINTCLR_SOFC (0x1u << 2) /**< \brief (USBC_UDINTCLR) SOF Interrupt Clear */ +#define USBC_UDINTCLR_EORSTC (0x1u << 3) /**< \brief (USBC_UDINTCLR) EORST Interrupt Clear */ +#define USBC_UDINTCLR_WAKEUPC (0x1u << 4) /**< \brief (USBC_UDINTCLR) WAKEUP Interrupt Clear */ +#define USBC_UDINTCLR_EORSMC (0x1u << 5) /**< \brief (USBC_UDINTCLR) EORSM Interrupt Clear */ +#define USBC_UDINTCLR_UPRSMC (0x1u << 6) /**< \brief (USBC_UDINTCLR) UPRSM Interrupt Clear */ +/* -------- USBC_UDINTSET : (USBC Offset: 0x00C) Device Global Interrupt Set Regsiter -------- */ +#define USBC_UDINTSET_SUSPS (0x1u << 0) /**< \brief (USBC_UDINTSET) SUSP Interrupt Set */ +#define USBC_UDINTSET_MSOFS (0x1u << 1) /**< \brief (USBC_UDINTSET) MSOF Interrupt Set */ +#define USBC_UDINTSET_SOFS (0x1u << 2) /**< \brief (USBC_UDINTSET) SOF Interrupt Set */ +#define USBC_UDINTSET_EORSTS (0x1u << 3) /**< \brief (USBC_UDINTSET) EORST Interrupt Set */ +#define USBC_UDINTSET_WAKEUPS (0x1u << 4) /**< \brief (USBC_UDINTSET) WAKEUP Interrupt Set */ +#define USBC_UDINTSET_EORSMS (0x1u << 5) /**< \brief (USBC_UDINTSET) EORSM Interrupt Set */ +#define USBC_UDINTSET_UPRSMS (0x1u << 6) /**< \brief (USBC_UDINTSET) UPRSM Interrupt Set */ +/* -------- USBC_UDINTE : (USBC Offset: 0x010) Device Global Interrupt Enable Register -------- */ +#define USBC_UDINTE_SUSPE (0x1u << 0) /**< \brief (USBC_UDINTE) SUSP Interrupt Enable */ +#define USBC_UDINTE_MSOFE (0x1u << 1) /**< \brief (USBC_UDINTE) MSOF Interrupt Enable */ +#define USBC_UDINTE_SOFE (0x1u << 2) /**< \brief (USBC_UDINTE) SOF Interrupt Enable */ +#define USBC_UDINTE_EORSTE (0x1u << 3) /**< \brief (USBC_UDINTE) EORST Interrupt Enable */ +#define USBC_UDINTE_WAKEUPE (0x1u << 4) /**< \brief (USBC_UDINTE) WAKEUP Interrupt Enable */ +#define USBC_UDINTE_EORSME (0x1u << 5) /**< \brief (USBC_UDINTE) EORSM Interrupt Enable */ +#define USBC_UDINTE_UPRSME (0x1u << 6) /**< \brief (USBC_UDINTE) UPRSM Interrupt Enable */ +#define USBC_UDINTE_EP0INTE (0x1u << 12) /**< \brief (USBC_UDINTE) EP0INT Interrupt Enable */ +#define USBC_UDINTE_EP1INTE (0x1u << 13) /**< \brief (USBC_UDINTE) EP1INT Interrupt Enable */ +#define USBC_UDINTE_EP2INTE (0x1u << 14) /**< \brief (USBC_UDINTE) EP2INT Interrupt Enable */ +#define USBC_UDINTE_EP3INTE (0x1u << 15) /**< \brief (USBC_UDINTE) EP3INT Interrupt Enable */ +#define USBC_UDINTE_EP4INTE (0x1u << 16) /**< \brief (USBC_UDINTE) EP4INT Interrupt Enable */ +#define USBC_UDINTE_EP5INTE (0x1u << 17) /**< \brief (USBC_UDINTE) EP5INT Interrupt Enable */ +#define USBC_UDINTE_EP6INTE (0x1u << 18) /**< \brief (USBC_UDINTE) EP6INT Interrupt Enable */ +#define USBC_UDINTE_EP7INTE (0x1u << 19) /**< \brief (USBC_UDINTE) EP7INT Interrupt Enable */ +/* -------- USBC_UDINTECLR : (USBC Offset: 0x014) Device Global Interrupt Enable Clear Register -------- */ +#define USBC_UDINTECLR_SUSPEC (0x1u << 0) /**< \brief (USBC_UDINTECLR) SUSP Interrupt Enable Clear */ +#define USBC_UDINTECLR_MSOFEC (0x1u << 1) /**< \brief (USBC_UDINTECLR) MSOF Interrupt Enable Clear */ +#define USBC_UDINTECLR_SOFEC (0x1u << 2) /**< \brief (USBC_UDINTECLR) SOF Interrupt Enable Clear */ +#define USBC_UDINTECLR_EORSTEC (0x1u << 3) /**< \brief (USBC_UDINTECLR) EORST Interrupt Enable Clear */ +#define USBC_UDINTECLR_WAKEUPEC (0x1u << 4) /**< \brief (USBC_UDINTECLR) WAKEUP Interrupt Enable Clear */ +#define USBC_UDINTECLR_EORSMEC (0x1u << 5) /**< \brief (USBC_UDINTECLR) EORSM Interrupt Enable Clear */ +#define USBC_UDINTECLR_UPRSMEC (0x1u << 6) /**< \brief (USBC_UDINTECLR) UPRSM Interrupt Enable Clear */ +#define USBC_UDINTECLR_EP0INTEC (0x1u << 12) /**< \brief (USBC_UDINTECLR) EP0INT Interrupt Enable Clear */ +#define USBC_UDINTECLR_EP1INTEC (0x1u << 13) /**< \brief (USBC_UDINTECLR) EP1INT Interrupt Enable Clear */ +#define USBC_UDINTECLR_EP2INTEC (0x1u << 14) /**< \brief (USBC_UDINTECLR) EP2INT Interrupt Enable Clear */ +#define USBC_UDINTECLR_EP3INTEC (0x1u << 15) /**< \brief (USBC_UDINTECLR) EP3INT Interrupt Enable Clear */ +#define USBC_UDINTECLR_EP4INTEC (0x1u << 16) /**< \brief (USBC_UDINTECLR) EP4INT Interrupt Enable Clear */ +#define USBC_UDINTECLR_EP5INTEC (0x1u << 17) /**< \brief (USBC_UDINTECLR) EP5INT Interrupt Enable Clear */ +#define USBC_UDINTECLR_EP6INTEC (0x1u << 18) /**< \brief (USBC_UDINTECLR) EP6INT Interrupt Enable Clear */ +#define USBC_UDINTECLR_EP7INTEC (0x1u << 19) /**< \brief (USBC_UDINTECLR) EP7INT Interrupt Enable Clear */ +/* -------- USBC_UDINTESET : (USBC Offset: 0x018) Device Global Interrupt Enable Set Register -------- */ +#define USBC_UDINTESET_SUSPES (0x1u << 0) /**< \brief (USBC_UDINTESET) SUSP Interrupt Enable Set */ +#define USBC_UDINTESET_MSOFES (0x1u << 1) /**< \brief (USBC_UDINTESET) MSOF Interrupt Enable Set */ +#define USBC_UDINTESET_SOFES (0x1u << 2) /**< \brief (USBC_UDINTESET) SOF Interrupt Enable Set */ +#define USBC_UDINTESET_EORSTES (0x1u << 3) /**< \brief (USBC_UDINTESET) EORST Interrupt Enable Set */ +#define USBC_UDINTESET_WAKEUPES (0x1u << 4) /**< \brief (USBC_UDINTESET) WAKEUP Interrupt Enable Set */ +#define USBC_UDINTESET_EORSMES (0x1u << 5) /**< \brief (USBC_UDINTESET) EORSM Interrupt Enable Set */ +#define USBC_UDINTESET_UPRSMES (0x1u << 6) /**< \brief (USBC_UDINTESET) UPRSM Interrupt Enable Set */ +#define USBC_UDINTESET_EP0INTES (0x1u << 12) /**< \brief (USBC_UDINTESET) EP0INT Interrupt Enable Set */ +#define USBC_UDINTESET_EP1INTES (0x1u << 13) /**< \brief (USBC_UDINTESET) EP1INT Interrupt Enable Set */ +#define USBC_UDINTESET_EP2INTES (0x1u << 14) /**< \brief (USBC_UDINTESET) EP2INT Interrupt Enable Set */ +#define USBC_UDINTESET_EP3INTES (0x1u << 15) /**< \brief (USBC_UDINTESET) EP3INT Interrupt Enable Set */ +#define USBC_UDINTESET_EP4INTES (0x1u << 16) /**< \brief (USBC_UDINTESET) EP4INT Interrupt Enable Set */ +#define USBC_UDINTESET_EP5INTES (0x1u << 17) /**< \brief (USBC_UDINTESET) EP5INT Interrupt Enable Set */ +#define USBC_UDINTESET_EP6INTES (0x1u << 18) /**< \brief (USBC_UDINTESET) EP6INT Interrupt Enable Set */ +#define USBC_UDINTESET_EP7INTES (0x1u << 19) /**< \brief (USBC_UDINTESET) EP7INT Interrupt Enable Set */ +/* -------- USBC_UERST : (USBC Offset: 0x01C) Endpoint Enable/Reset Register -------- */ +#define USBC_UERST_EPEN0 (0x1u << 0) /**< \brief (USBC_UERST) Endpoint0 Enable */ +#define USBC_UERST_EPEN1 (0x1u << 1) /**< \brief (USBC_UERST) Endpoint1 Enable */ +#define USBC_UERST_EPEN2 (0x1u << 2) /**< \brief (USBC_UERST) Endpoint2 Enable */ +#define USBC_UERST_EPEN3 (0x1u << 3) /**< \brief (USBC_UERST) Endpoint3 Enable */ +#define USBC_UERST_EPEN4 (0x1u << 4) /**< \brief (USBC_UERST) Endpoint4 Enable */ +#define USBC_UERST_EPEN5 (0x1u << 5) /**< \brief (USBC_UERST) Endpoint5 Enable */ +#define USBC_UERST_EPEN6 (0x1u << 6) /**< \brief (USBC_UERST) Endpoint6 Enable */ +#define USBC_UERST_EPEN7 (0x1u << 7) /**< \brief (USBC_UERST) Endpoint7 Enable */ +/* -------- USBC_UDFNUM : (USBC Offset: 0x020) Device Frame Number Register -------- */ +#define USBC_UDFNUM_MFNUM_Pos 0 +#define USBC_UDFNUM_MFNUM_Msk (0x7u << USBC_UDFNUM_MFNUM_Pos) /**< \brief (USBC_UDFNUM) Micro Frame Number */ +#define USBC_UDFNUM_MFNUM(value) ((USBC_UDFNUM_MFNUM_Msk & ((value) << USBC_UDFNUM_MFNUM_Pos))) +#define USBC_UDFNUM_FNUM_Pos 3 +#define USBC_UDFNUM_FNUM_Msk (0x7FFu << USBC_UDFNUM_FNUM_Pos) /**< \brief (USBC_UDFNUM) Frame Number */ +#define USBC_UDFNUM_FNUM(value) ((USBC_UDFNUM_FNUM_Msk & ((value) << USBC_UDFNUM_FNUM_Pos))) +#define USBC_UDFNUM_FNCERR (0x1u << 15) /**< \brief (USBC_UDFNUM) Frame Number CRC Error */ +/* -------- USBC_UECFG0 : (USBC Offset: 0x100) Endpoint Configuration Register -------- */ +#define USBC_UECFG0_EPBK (0x1u << 2) /**< \brief (USBC_UECFG0) Endpoint Bank */ +#define USBC_UECFG0_EPBK_SINGLE (0x0u << 2) /**< \brief (USBC_UECFG0) */ +#define USBC_UECFG0_EPBK_DOUBLE (0x1u << 2) /**< \brief (USBC_UECFG0) */ +#define USBC_UECFG0_EPSIZE_Pos 4 +#define USBC_UECFG0_EPSIZE_Msk (0x7u << USBC_UECFG0_EPSIZE_Pos) /**< \brief (USBC_UECFG0) Endpoint Size */ +#define USBC_UECFG0_EPSIZE(value) ((USBC_UECFG0_EPSIZE_Msk & ((value) << USBC_UECFG0_EPSIZE_Pos))) +#define USBC_UECFG0_EPSIZE_8 (0x0u << 4) /**< \brief (USBC_UECFG0) */ +#define USBC_UECFG0_EPSIZE_16 (0x1u << 4) /**< \brief (USBC_UECFG0) */ +#define USBC_UECFG0_EPSIZE_32 (0x2u << 4) /**< \brief (USBC_UECFG0) */ +#define USBC_UECFG0_EPSIZE_64 (0x3u << 4) /**< \brief (USBC_UECFG0) */ +#define USBC_UECFG0_EPSIZE_128 (0x4u << 4) /**< \brief (USBC_UECFG0) */ +#define USBC_UECFG0_EPSIZE_256 (0x5u << 4) /**< \brief (USBC_UECFG0) */ +#define USBC_UECFG0_EPSIZE_512 (0x6u << 4) /**< \brief (USBC_UECFG0) */ +#define USBC_UECFG0_EPSIZE_1024 (0x7u << 4) /**< \brief (USBC_UECFG0) */ +#define USBC_UECFG0_EPDIR (0x1u << 8) /**< \brief (USBC_UECFG0) Endpoint Direction */ +#define USBC_UECFG0_EPDIR_OUT (0x0u << 8) /**< \brief (USBC_UECFG0) */ +#define USBC_UECFG0_EPDIR_IN (0x1u << 8) /**< \brief (USBC_UECFG0) */ +#define USBC_UECFG0_EPTYPE_Pos 11 +#define USBC_UECFG0_EPTYPE_Msk (0x3u << USBC_UECFG0_EPTYPE_Pos) /**< \brief (USBC_UECFG0) Endpoint Type */ +#define USBC_UECFG0_EPTYPE(value) ((USBC_UECFG0_EPTYPE_Msk & ((value) << USBC_UECFG0_EPTYPE_Pos))) +#define USBC_UECFG0_EPTYPE_CONTROL (0x0u << 11) /**< \brief (USBC_UECFG0) */ +#define USBC_UECFG0_EPTYPE_ISOCHRONOUS (0x1u << 11) /**< \brief (USBC_UECFG0) */ +#define USBC_UECFG0_EPTYPE_BULK (0x2u << 11) /**< \brief (USBC_UECFG0) */ +#define USBC_UECFG0_EPTYPE_INTERRUPT (0x3u << 11) /**< \brief (USBC_UECFG0) */ +#define USBC_UECFG0_REPNB_Pos 16 +#define USBC_UECFG0_REPNB_Msk (0xFu << USBC_UECFG0_REPNB_Pos) /**< \brief (USBC_UECFG0) Redirected Endpoint Number */ +#define USBC_UECFG0_REPNB(value) ((USBC_UECFG0_REPNB_Msk & ((value) << USBC_UECFG0_REPNB_Pos))) +/* -------- USBC_UECFG1 : (USBC Offset: 0x104) Endpoint Configuration Register -------- */ +#define USBC_UECFG1_EPBK (0x1u << 2) /**< \brief (USBC_UECFG1) Endpoint Bank */ +#define USBC_UECFG1_EPBK_SINGLE (0x0u << 2) /**< \brief (USBC_UECFG1) */ +#define USBC_UECFG1_EPBK_DOUBLE (0x1u << 2) /**< \brief (USBC_UECFG1) */ +#define USBC_UECFG1_EPSIZE_Pos 4 +#define USBC_UECFG1_EPSIZE_Msk (0x7u << USBC_UECFG1_EPSIZE_Pos) /**< \brief (USBC_UECFG1) Endpoint Size */ +#define USBC_UECFG1_EPSIZE(value) ((USBC_UECFG1_EPSIZE_Msk & ((value) << USBC_UECFG1_EPSIZE_Pos))) +#define USBC_UECFG1_EPSIZE_8 (0x0u << 4) /**< \brief (USBC_UECFG1) */ +#define USBC_UECFG1_EPSIZE_16 (0x1u << 4) /**< \brief (USBC_UECFG1) */ +#define USBC_UECFG1_EPSIZE_32 (0x2u << 4) /**< \brief (USBC_UECFG1) */ +#define USBC_UECFG1_EPSIZE_64 (0x3u << 4) /**< \brief (USBC_UECFG1) */ +#define USBC_UECFG1_EPSIZE_128 (0x4u << 4) /**< \brief (USBC_UECFG1) */ +#define USBC_UECFG1_EPSIZE_256 (0x5u << 4) /**< \brief (USBC_UECFG1) */ +#define USBC_UECFG1_EPSIZE_512 (0x6u << 4) /**< \brief (USBC_UECFG1) */ +#define USBC_UECFG1_EPSIZE_1024 (0x7u << 4) /**< \brief (USBC_UECFG1) */ +#define USBC_UECFG1_EPDIR (0x1u << 8) /**< \brief (USBC_UECFG1) Endpoint Direction */ +#define USBC_UECFG1_EPDIR_OUT (0x0u << 8) /**< \brief (USBC_UECFG1) */ +#define USBC_UECFG1_EPDIR_IN (0x1u << 8) /**< \brief (USBC_UECFG1) */ +#define USBC_UECFG1_EPTYPE_Pos 11 +#define USBC_UECFG1_EPTYPE_Msk (0x3u << USBC_UECFG1_EPTYPE_Pos) /**< \brief (USBC_UECFG1) Endpoint Type */ +#define USBC_UECFG1_EPTYPE(value) ((USBC_UECFG1_EPTYPE_Msk & ((value) << USBC_UECFG1_EPTYPE_Pos))) +#define USBC_UECFG1_EPTYPE_CONTROL (0x0u << 11) /**< \brief (USBC_UECFG1) */ +#define USBC_UECFG1_EPTYPE_ISOCHRONOUS (0x1u << 11) /**< \brief (USBC_UECFG1) */ +#define USBC_UECFG1_EPTYPE_BULK (0x2u << 11) /**< \brief (USBC_UECFG1) */ +#define USBC_UECFG1_EPTYPE_INTERRUPT (0x3u << 11) /**< \brief (USBC_UECFG1) */ +#define USBC_UECFG1_REPNB_Pos 16 +#define USBC_UECFG1_REPNB_Msk (0xFu << USBC_UECFG1_REPNB_Pos) /**< \brief (USBC_UECFG1) Redirected Endpoint Number */ +#define USBC_UECFG1_REPNB(value) ((USBC_UECFG1_REPNB_Msk & ((value) << USBC_UECFG1_REPNB_Pos))) +/* -------- USBC_UECFG2 : (USBC Offset: 0x108) Endpoint Configuration Register -------- */ +#define USBC_UECFG2_EPBK (0x1u << 2) /**< \brief (USBC_UECFG2) Endpoint Bank */ +#define USBC_UECFG2_EPBK_SINGLE (0x0u << 2) /**< \brief (USBC_UECFG2) */ +#define USBC_UECFG2_EPBK_DOUBLE (0x1u << 2) /**< \brief (USBC_UECFG2) */ +#define USBC_UECFG2_EPSIZE_Pos 4 +#define USBC_UECFG2_EPSIZE_Msk (0x7u << USBC_UECFG2_EPSIZE_Pos) /**< \brief (USBC_UECFG2) Endpoint Size */ +#define USBC_UECFG2_EPSIZE(value) ((USBC_UECFG2_EPSIZE_Msk & ((value) << USBC_UECFG2_EPSIZE_Pos))) +#define USBC_UECFG2_EPSIZE_8 (0x0u << 4) /**< \brief (USBC_UECFG2) */ +#define USBC_UECFG2_EPSIZE_16 (0x1u << 4) /**< \brief (USBC_UECFG2) */ +#define USBC_UECFG2_EPSIZE_32 (0x2u << 4) /**< \brief (USBC_UECFG2) */ +#define USBC_UECFG2_EPSIZE_64 (0x3u << 4) /**< \brief (USBC_UECFG2) */ +#define USBC_UECFG2_EPSIZE_128 (0x4u << 4) /**< \brief (USBC_UECFG2) */ +#define USBC_UECFG2_EPSIZE_256 (0x5u << 4) /**< \brief (USBC_UECFG2) */ +#define USBC_UECFG2_EPSIZE_512 (0x6u << 4) /**< \brief (USBC_UECFG2) */ +#define USBC_UECFG2_EPSIZE_1024 (0x7u << 4) /**< \brief (USBC_UECFG2) */ +#define USBC_UECFG2_EPDIR (0x1u << 8) /**< \brief (USBC_UECFG2) Endpoint Direction */ +#define USBC_UECFG2_EPDIR_OUT (0x0u << 8) /**< \brief (USBC_UECFG2) */ +#define USBC_UECFG2_EPDIR_IN (0x1u << 8) /**< \brief (USBC_UECFG2) */ +#define USBC_UECFG2_EPTYPE_Pos 11 +#define USBC_UECFG2_EPTYPE_Msk (0x3u << USBC_UECFG2_EPTYPE_Pos) /**< \brief (USBC_UECFG2) Endpoint Type */ +#define USBC_UECFG2_EPTYPE(value) ((USBC_UECFG2_EPTYPE_Msk & ((value) << USBC_UECFG2_EPTYPE_Pos))) +#define USBC_UECFG2_EPTYPE_CONTROL (0x0u << 11) /**< \brief (USBC_UECFG2) */ +#define USBC_UECFG2_EPTYPE_ISOCHRONOUS (0x1u << 11) /**< \brief (USBC_UECFG2) */ +#define USBC_UECFG2_EPTYPE_BULK (0x2u << 11) /**< \brief (USBC_UECFG2) */ +#define USBC_UECFG2_EPTYPE_INTERRUPT (0x3u << 11) /**< \brief (USBC_UECFG2) */ +#define USBC_UECFG2_REPNB_Pos 16 +#define USBC_UECFG2_REPNB_Msk (0xFu << USBC_UECFG2_REPNB_Pos) /**< \brief (USBC_UECFG2) Redirected Endpoint Number */ +#define USBC_UECFG2_REPNB(value) ((USBC_UECFG2_REPNB_Msk & ((value) << USBC_UECFG2_REPNB_Pos))) +/* -------- USBC_UECFG3 : (USBC Offset: 0x10C) Endpoint Configuration Register -------- */ +#define USBC_UECFG3_EPBK (0x1u << 2) /**< \brief (USBC_UECFG3) Endpoint Bank */ +#define USBC_UECFG3_EPBK_SINGLE (0x0u << 2) /**< \brief (USBC_UECFG3) */ +#define USBC_UECFG3_EPBK_DOUBLE (0x1u << 2) /**< \brief (USBC_UECFG3) */ +#define USBC_UECFG3_EPSIZE_Pos 4 +#define USBC_UECFG3_EPSIZE_Msk (0x7u << USBC_UECFG3_EPSIZE_Pos) /**< \brief (USBC_UECFG3) Endpoint Size */ +#define USBC_UECFG3_EPSIZE(value) ((USBC_UECFG3_EPSIZE_Msk & ((value) << USBC_UECFG3_EPSIZE_Pos))) +#define USBC_UECFG3_EPSIZE_8 (0x0u << 4) /**< \brief (USBC_UECFG3) */ +#define USBC_UECFG3_EPSIZE_16 (0x1u << 4) /**< \brief (USBC_UECFG3) */ +#define USBC_UECFG3_EPSIZE_32 (0x2u << 4) /**< \brief (USBC_UECFG3) */ +#define USBC_UECFG3_EPSIZE_64 (0x3u << 4) /**< \brief (USBC_UECFG3) */ +#define USBC_UECFG3_EPSIZE_128 (0x4u << 4) /**< \brief (USBC_UECFG3) */ +#define USBC_UECFG3_EPSIZE_256 (0x5u << 4) /**< \brief (USBC_UECFG3) */ +#define USBC_UECFG3_EPSIZE_512 (0x6u << 4) /**< \brief (USBC_UECFG3) */ +#define USBC_UECFG3_EPSIZE_1024 (0x7u << 4) /**< \brief (USBC_UECFG3) */ +#define USBC_UECFG3_EPDIR (0x1u << 8) /**< \brief (USBC_UECFG3) Endpoint Direction */ +#define USBC_UECFG3_EPDIR_OUT (0x0u << 8) /**< \brief (USBC_UECFG3) */ +#define USBC_UECFG3_EPDIR_IN (0x1u << 8) /**< \brief (USBC_UECFG3) */ +#define USBC_UECFG3_EPTYPE_Pos 11 +#define USBC_UECFG3_EPTYPE_Msk (0x3u << USBC_UECFG3_EPTYPE_Pos) /**< \brief (USBC_UECFG3) Endpoint Type */ +#define USBC_UECFG3_EPTYPE(value) ((USBC_UECFG3_EPTYPE_Msk & ((value) << USBC_UECFG3_EPTYPE_Pos))) +#define USBC_UECFG3_EPTYPE_CONTROL (0x0u << 11) /**< \brief (USBC_UECFG3) */ +#define USBC_UECFG3_EPTYPE_ISOCHRONOUS (0x1u << 11) /**< \brief (USBC_UECFG3) */ +#define USBC_UECFG3_EPTYPE_BULK (0x2u << 11) /**< \brief (USBC_UECFG3) */ +#define USBC_UECFG3_EPTYPE_INTERRUPT (0x3u << 11) /**< \brief (USBC_UECFG3) */ +#define USBC_UECFG3_REPNB_Pos 16 +#define USBC_UECFG3_REPNB_Msk (0xFu << USBC_UECFG3_REPNB_Pos) /**< \brief (USBC_UECFG3) Redirected Endpoint Number */ +#define USBC_UECFG3_REPNB(value) ((USBC_UECFG3_REPNB_Msk & ((value) << USBC_UECFG3_REPNB_Pos))) +/* -------- USBC_UECFG4 : (USBC Offset: 0x110) Endpoint Configuration Register -------- */ +#define USBC_UECFG4_EPBK (0x1u << 2) /**< \brief (USBC_UECFG4) Endpoint Bank */ +#define USBC_UECFG4_EPBK_SINGLE (0x0u << 2) /**< \brief (USBC_UECFG4) */ +#define USBC_UECFG4_EPBK_DOUBLE (0x1u << 2) /**< \brief (USBC_UECFG4) */ +#define USBC_UECFG4_EPSIZE_Pos 4 +#define USBC_UECFG4_EPSIZE_Msk (0x7u << USBC_UECFG4_EPSIZE_Pos) /**< \brief (USBC_UECFG4) Endpoint Size */ +#define USBC_UECFG4_EPSIZE(value) ((USBC_UECFG4_EPSIZE_Msk & ((value) << USBC_UECFG4_EPSIZE_Pos))) +#define USBC_UECFG4_EPSIZE_8 (0x0u << 4) /**< \brief (USBC_UECFG4) */ +#define USBC_UECFG4_EPSIZE_16 (0x1u << 4) /**< \brief (USBC_UECFG4) */ +#define USBC_UECFG4_EPSIZE_32 (0x2u << 4) /**< \brief (USBC_UECFG4) */ +#define USBC_UECFG4_EPSIZE_64 (0x3u << 4) /**< \brief (USBC_UECFG4) */ +#define USBC_UECFG4_EPSIZE_128 (0x4u << 4) /**< \brief (USBC_UECFG4) */ +#define USBC_UECFG4_EPSIZE_256 (0x5u << 4) /**< \brief (USBC_UECFG4) */ +#define USBC_UECFG4_EPSIZE_512 (0x6u << 4) /**< \brief (USBC_UECFG4) */ +#define USBC_UECFG4_EPSIZE_1024 (0x7u << 4) /**< \brief (USBC_UECFG4) */ +#define USBC_UECFG4_EPDIR (0x1u << 8) /**< \brief (USBC_UECFG4) Endpoint Direction */ +#define USBC_UECFG4_EPDIR_OUT (0x0u << 8) /**< \brief (USBC_UECFG4) */ +#define USBC_UECFG4_EPDIR_IN (0x1u << 8) /**< \brief (USBC_UECFG4) */ +#define USBC_UECFG4_EPTYPE_Pos 11 +#define USBC_UECFG4_EPTYPE_Msk (0x3u << USBC_UECFG4_EPTYPE_Pos) /**< \brief (USBC_UECFG4) Endpoint Type */ +#define USBC_UECFG4_EPTYPE(value) ((USBC_UECFG4_EPTYPE_Msk & ((value) << USBC_UECFG4_EPTYPE_Pos))) +#define USBC_UECFG4_EPTYPE_CONTROL (0x0u << 11) /**< \brief (USBC_UECFG4) */ +#define USBC_UECFG4_EPTYPE_ISOCHRONOUS (0x1u << 11) /**< \brief (USBC_UECFG4) */ +#define USBC_UECFG4_EPTYPE_BULK (0x2u << 11) /**< \brief (USBC_UECFG4) */ +#define USBC_UECFG4_EPTYPE_INTERRUPT (0x3u << 11) /**< \brief (USBC_UECFG4) */ +#define USBC_UECFG4_REPNB_Pos 16 +#define USBC_UECFG4_REPNB_Msk (0xFu << USBC_UECFG4_REPNB_Pos) /**< \brief (USBC_UECFG4) Redirected Endpoint Number */ +#define USBC_UECFG4_REPNB(value) ((USBC_UECFG4_REPNB_Msk & ((value) << USBC_UECFG4_REPNB_Pos))) +/* -------- USBC_UECFG5 : (USBC Offset: 0x114) Endpoint Configuration Register -------- */ +#define USBC_UECFG5_EPBK (0x1u << 2) /**< \brief (USBC_UECFG5) Endpoint Bank */ +#define USBC_UECFG5_EPBK_SINGLE (0x0u << 2) /**< \brief (USBC_UECFG5) */ +#define USBC_UECFG5_EPBK_DOUBLE (0x1u << 2) /**< \brief (USBC_UECFG5) */ +#define USBC_UECFG5_EPSIZE_Pos 4 +#define USBC_UECFG5_EPSIZE_Msk (0x7u << USBC_UECFG5_EPSIZE_Pos) /**< \brief (USBC_UECFG5) Endpoint Size */ +#define USBC_UECFG5_EPSIZE(value) ((USBC_UECFG5_EPSIZE_Msk & ((value) << USBC_UECFG5_EPSIZE_Pos))) +#define USBC_UECFG5_EPSIZE_8 (0x0u << 4) /**< \brief (USBC_UECFG5) */ +#define USBC_UECFG5_EPSIZE_16 (0x1u << 4) /**< \brief (USBC_UECFG5) */ +#define USBC_UECFG5_EPSIZE_32 (0x2u << 4) /**< \brief (USBC_UECFG5) */ +#define USBC_UECFG5_EPSIZE_64 (0x3u << 4) /**< \brief (USBC_UECFG5) */ +#define USBC_UECFG5_EPSIZE_128 (0x4u << 4) /**< \brief (USBC_UECFG5) */ +#define USBC_UECFG5_EPSIZE_256 (0x5u << 4) /**< \brief (USBC_UECFG5) */ +#define USBC_UECFG5_EPSIZE_512 (0x6u << 4) /**< \brief (USBC_UECFG5) */ +#define USBC_UECFG5_EPSIZE_1024 (0x7u << 4) /**< \brief (USBC_UECFG5) */ +#define USBC_UECFG5_EPDIR (0x1u << 8) /**< \brief (USBC_UECFG5) Endpoint Direction */ +#define USBC_UECFG5_EPDIR_OUT (0x0u << 8) /**< \brief (USBC_UECFG5) */ +#define USBC_UECFG5_EPDIR_IN (0x1u << 8) /**< \brief (USBC_UECFG5) */ +#define USBC_UECFG5_EPTYPE_Pos 11 +#define USBC_UECFG5_EPTYPE_Msk (0x3u << USBC_UECFG5_EPTYPE_Pos) /**< \brief (USBC_UECFG5) Endpoint Type */ +#define USBC_UECFG5_EPTYPE(value) ((USBC_UECFG5_EPTYPE_Msk & ((value) << USBC_UECFG5_EPTYPE_Pos))) +#define USBC_UECFG5_EPTYPE_CONTROL (0x0u << 11) /**< \brief (USBC_UECFG5) */ +#define USBC_UECFG5_EPTYPE_ISOCHRONOUS (0x1u << 11) /**< \brief (USBC_UECFG5) */ +#define USBC_UECFG5_EPTYPE_BULK (0x2u << 11) /**< \brief (USBC_UECFG5) */ +#define USBC_UECFG5_EPTYPE_INTERRUPT (0x3u << 11) /**< \brief (USBC_UECFG5) */ +#define USBC_UECFG5_REPNB_Pos 16 +#define USBC_UECFG5_REPNB_Msk (0xFu << USBC_UECFG5_REPNB_Pos) /**< \brief (USBC_UECFG5) Redirected Endpoint Number */ +#define USBC_UECFG5_REPNB(value) ((USBC_UECFG5_REPNB_Msk & ((value) << USBC_UECFG5_REPNB_Pos))) +/* -------- USBC_UECFG6 : (USBC Offset: 0x118) Endpoint Configuration Register -------- */ +#define USBC_UECFG6_EPBK (0x1u << 2) /**< \brief (USBC_UECFG6) Endpoint Bank */ +#define USBC_UECFG6_EPBK_SINGLE (0x0u << 2) /**< \brief (USBC_UECFG6) */ +#define USBC_UECFG6_EPBK_DOUBLE (0x1u << 2) /**< \brief (USBC_UECFG6) */ +#define USBC_UECFG6_EPSIZE_Pos 4 +#define USBC_UECFG6_EPSIZE_Msk (0x7u << USBC_UECFG6_EPSIZE_Pos) /**< \brief (USBC_UECFG6) Endpoint Size */ +#define USBC_UECFG6_EPSIZE(value) ((USBC_UECFG6_EPSIZE_Msk & ((value) << USBC_UECFG6_EPSIZE_Pos))) +#define USBC_UECFG6_EPSIZE_8 (0x0u << 4) /**< \brief (USBC_UECFG6) */ +#define USBC_UECFG6_EPSIZE_16 (0x1u << 4) /**< \brief (USBC_UECFG6) */ +#define USBC_UECFG6_EPSIZE_32 (0x2u << 4) /**< \brief (USBC_UECFG6) */ +#define USBC_UECFG6_EPSIZE_64 (0x3u << 4) /**< \brief (USBC_UECFG6) */ +#define USBC_UECFG6_EPSIZE_128 (0x4u << 4) /**< \brief (USBC_UECFG6) */ +#define USBC_UECFG6_EPSIZE_256 (0x5u << 4) /**< \brief (USBC_UECFG6) */ +#define USBC_UECFG6_EPSIZE_512 (0x6u << 4) /**< \brief (USBC_UECFG6) */ +#define USBC_UECFG6_EPSIZE_1024 (0x7u << 4) /**< \brief (USBC_UECFG6) */ +#define USBC_UECFG6_EPDIR (0x1u << 8) /**< \brief (USBC_UECFG6) Endpoint Direction */ +#define USBC_UECFG6_EPDIR_OUT (0x0u << 8) /**< \brief (USBC_UECFG6) */ +#define USBC_UECFG6_EPDIR_IN (0x1u << 8) /**< \brief (USBC_UECFG6) */ +#define USBC_UECFG6_EPTYPE_Pos 11 +#define USBC_UECFG6_EPTYPE_Msk (0x3u << USBC_UECFG6_EPTYPE_Pos) /**< \brief (USBC_UECFG6) Endpoint Type */ +#define USBC_UECFG6_EPTYPE(value) ((USBC_UECFG6_EPTYPE_Msk & ((value) << USBC_UECFG6_EPTYPE_Pos))) +#define USBC_UECFG6_EPTYPE_CONTROL (0x0u << 11) /**< \brief (USBC_UECFG6) */ +#define USBC_UECFG6_EPTYPE_ISOCHRONOUS (0x1u << 11) /**< \brief (USBC_UECFG6) */ +#define USBC_UECFG6_EPTYPE_BULK (0x2u << 11) /**< \brief (USBC_UECFG6) */ +#define USBC_UECFG6_EPTYPE_INTERRUPT (0x3u << 11) /**< \brief (USBC_UECFG6) */ +#define USBC_UECFG6_REPNB_Pos 16 +#define USBC_UECFG6_REPNB_Msk (0xFu << USBC_UECFG6_REPNB_Pos) /**< \brief (USBC_UECFG6) Redirected Endpoint Number */ +#define USBC_UECFG6_REPNB(value) ((USBC_UECFG6_REPNB_Msk & ((value) << USBC_UECFG6_REPNB_Pos))) +/* -------- USBC_UECFG7 : (USBC Offset: 0x11C) Endpoint Configuration Register -------- */ +#define USBC_UECFG7_EPBK (0x1u << 2) /**< \brief (USBC_UECFG7) Endpoint Bank */ +#define USBC_UECFG7_EPBK_SINGLE (0x0u << 2) /**< \brief (USBC_UECFG7) */ +#define USBC_UECFG7_EPBK_DOUBLE (0x1u << 2) /**< \brief (USBC_UECFG7) */ +#define USBC_UECFG7_EPSIZE_Pos 4 +#define USBC_UECFG7_EPSIZE_Msk (0x7u << USBC_UECFG7_EPSIZE_Pos) /**< \brief (USBC_UECFG7) Endpoint Size */ +#define USBC_UECFG7_EPSIZE(value) ((USBC_UECFG7_EPSIZE_Msk & ((value) << USBC_UECFG7_EPSIZE_Pos))) +#define USBC_UECFG7_EPSIZE_8 (0x0u << 4) /**< \brief (USBC_UECFG7) */ +#define USBC_UECFG7_EPSIZE_16 (0x1u << 4) /**< \brief (USBC_UECFG7) */ +#define USBC_UECFG7_EPSIZE_32 (0x2u << 4) /**< \brief (USBC_UECFG7) */ +#define USBC_UECFG7_EPSIZE_64 (0x3u << 4) /**< \brief (USBC_UECFG7) */ +#define USBC_UECFG7_EPSIZE_128 (0x4u << 4) /**< \brief (USBC_UECFG7) */ +#define USBC_UECFG7_EPSIZE_256 (0x5u << 4) /**< \brief (USBC_UECFG7) */ +#define USBC_UECFG7_EPSIZE_512 (0x6u << 4) /**< \brief (USBC_UECFG7) */ +#define USBC_UECFG7_EPSIZE_1024 (0x7u << 4) /**< \brief (USBC_UECFG7) */ +#define USBC_UECFG7_EPDIR (0x1u << 8) /**< \brief (USBC_UECFG7) Endpoint Direction */ +#define USBC_UECFG7_EPDIR_OUT (0x0u << 8) /**< \brief (USBC_UECFG7) */ +#define USBC_UECFG7_EPDIR_IN (0x1u << 8) /**< \brief (USBC_UECFG7) */ +#define USBC_UECFG7_EPTYPE_Pos 11 +#define USBC_UECFG7_EPTYPE_Msk (0x3u << USBC_UECFG7_EPTYPE_Pos) /**< \brief (USBC_UECFG7) Endpoint Type */ +#define USBC_UECFG7_EPTYPE(value) ((USBC_UECFG7_EPTYPE_Msk & ((value) << USBC_UECFG7_EPTYPE_Pos))) +#define USBC_UECFG7_EPTYPE_CONTROL (0x0u << 11) /**< \brief (USBC_UECFG7) */ +#define USBC_UECFG7_EPTYPE_ISOCHRONOUS (0x1u << 11) /**< \brief (USBC_UECFG7) */ +#define USBC_UECFG7_EPTYPE_BULK (0x2u << 11) /**< \brief (USBC_UECFG7) */ +#define USBC_UECFG7_EPTYPE_INTERRUPT (0x3u << 11) /**< \brief (USBC_UECFG7) */ +#define USBC_UECFG7_REPNB_Pos 16 +#define USBC_UECFG7_REPNB_Msk (0xFu << USBC_UECFG7_REPNB_Pos) /**< \brief (USBC_UECFG7) Redirected Endpoint Number */ +#define USBC_UECFG7_REPNB(value) ((USBC_UECFG7_REPNB_Msk & ((value) << USBC_UECFG7_REPNB_Pos))) +/* -------- USBC_UESTA0 : (USBC Offset: 0x130) Endpoint Status Register -------- */ +#define USBC_UESTA0_TXINI (0x1u << 0) /**< \brief (USBC_UESTA0) Transmitted IN Data Interrupt */ +#define USBC_UESTA0_RXOUTI (0x1u << 1) /**< \brief (USBC_UESTA0) Received OUT Data Interrupt */ +#define USBC_UESTA0_RXSTPI (0x1u << 2) /**< \brief (USBC_UESTA0) Received SETUP Interrupt */ +#define USBC_UESTA0_NAKOUTI (0x1u << 3) /**< \brief (USBC_UESTA0) NAKed OUT Interrupt */ +#define USBC_UESTA0_NAKINI (0x1u << 4) /**< \brief (USBC_UESTA0) NAKed IN Interrupt */ +#define USBC_UESTA0_STALLEDI (0x1u << 6) /**< \brief (USBC_UESTA0) STALLed Interrupt */ +#define USBC_UESTA0_DTSEQ_Pos 8 +#define USBC_UESTA0_DTSEQ_Msk (0x3u << USBC_UESTA0_DTSEQ_Pos) /**< \brief (USBC_UESTA0) Data Toggle Sequence */ +#define USBC_UESTA0_DTSEQ(value) ((USBC_UESTA0_DTSEQ_Msk & ((value) << USBC_UESTA0_DTSEQ_Pos))) +#define USBC_UESTA0_RAMACERI (0x1u << 11) /**< \brief (USBC_UESTA0) Ram Access Error Interrupt */ +#define USBC_UESTA0_NBUSYBK_Pos 12 +#define USBC_UESTA0_NBUSYBK_Msk (0x3u << USBC_UESTA0_NBUSYBK_Pos) /**< \brief (USBC_UESTA0) Number Of Busy Banks */ +#define USBC_UESTA0_NBUSYBK(value) ((USBC_UESTA0_NBUSYBK_Msk & ((value) << USBC_UESTA0_NBUSYBK_Pos))) +#define USBC_UESTA0_CURRBK_Pos 14 +#define USBC_UESTA0_CURRBK_Msk (0x3u << USBC_UESTA0_CURRBK_Pos) /**< \brief (USBC_UESTA0) Current Bank */ +#define USBC_UESTA0_CURRBK(value) ((USBC_UESTA0_CURRBK_Msk & ((value) << USBC_UESTA0_CURRBK_Pos))) +#define USBC_UESTA0_CTRLDIR (0x1u << 17) /**< \brief (USBC_UESTA0) Control Direction */ +#define USBC_UESTA0_CTRLDIR_OUT (0x0u << 17) /**< \brief (USBC_UESTA0) */ +#define USBC_UESTA0_CTRLDIR_IN (0x1u << 17) /**< \brief (USBC_UESTA0) */ +/* -------- USBC_UESTA1 : (USBC Offset: 0x134) Endpoint Status Register -------- */ +#define USBC_UESTA1_TXINI (0x1u << 0) /**< \brief (USBC_UESTA1) Transmitted IN Data Interrupt */ +#define USBC_UESTA1_RXOUTI (0x1u << 1) /**< \brief (USBC_UESTA1) Received OUT Data Interrupt */ +#define USBC_UESTA1_RXSTPI (0x1u << 2) /**< \brief (USBC_UESTA1) Received SETUP Interrupt */ +#define USBC_UESTA1_NAKOUTI (0x1u << 3) /**< \brief (USBC_UESTA1) NAKed OUT Interrupt */ +#define USBC_UESTA1_NAKINI (0x1u << 4) /**< \brief (USBC_UESTA1) NAKed IN Interrupt */ +#define USBC_UESTA1_STALLEDI (0x1u << 6) /**< \brief (USBC_UESTA1) STALLed Interrupt */ +#define USBC_UESTA1_DTSEQ_Pos 8 +#define USBC_UESTA1_DTSEQ_Msk (0x3u << USBC_UESTA1_DTSEQ_Pos) /**< \brief (USBC_UESTA1) Data Toggle Sequence */ +#define USBC_UESTA1_DTSEQ(value) ((USBC_UESTA1_DTSEQ_Msk & ((value) << USBC_UESTA1_DTSEQ_Pos))) +#define USBC_UESTA1_RAMACERI (0x1u << 11) /**< \brief (USBC_UESTA1) Ram Access Error Interrupt */ +#define USBC_UESTA1_NBUSYBK_Pos 12 +#define USBC_UESTA1_NBUSYBK_Msk (0x3u << USBC_UESTA1_NBUSYBK_Pos) /**< \brief (USBC_UESTA1) Number Of Busy Banks */ +#define USBC_UESTA1_NBUSYBK(value) ((USBC_UESTA1_NBUSYBK_Msk & ((value) << USBC_UESTA1_NBUSYBK_Pos))) +#define USBC_UESTA1_CURRBK_Pos 14 +#define USBC_UESTA1_CURRBK_Msk (0x3u << USBC_UESTA1_CURRBK_Pos) /**< \brief (USBC_UESTA1) Current Bank */ +#define USBC_UESTA1_CURRBK(value) ((USBC_UESTA1_CURRBK_Msk & ((value) << USBC_UESTA1_CURRBK_Pos))) +#define USBC_UESTA1_CTRLDIR (0x1u << 17) /**< \brief (USBC_UESTA1) Control Direction */ +#define USBC_UESTA1_CTRLDIR_OUT (0x0u << 17) /**< \brief (USBC_UESTA1) */ +#define USBC_UESTA1_CTRLDIR_IN (0x1u << 17) /**< \brief (USBC_UESTA1) */ +/* -------- USBC_UESTA2 : (USBC Offset: 0x138) Endpoint Status Register -------- */ +#define USBC_UESTA2_TXINI (0x1u << 0) /**< \brief (USBC_UESTA2) Transmitted IN Data Interrupt */ +#define USBC_UESTA2_RXOUTI (0x1u << 1) /**< \brief (USBC_UESTA2) Received OUT Data Interrupt */ +#define USBC_UESTA2_RXSTPI (0x1u << 2) /**< \brief (USBC_UESTA2) Received SETUP Interrupt */ +#define USBC_UESTA2_NAKOUTI (0x1u << 3) /**< \brief (USBC_UESTA2) NAKed OUT Interrupt */ +#define USBC_UESTA2_NAKINI (0x1u << 4) /**< \brief (USBC_UESTA2) NAKed IN Interrupt */ +#define USBC_UESTA2_STALLEDI (0x1u << 6) /**< \brief (USBC_UESTA2) STALLed Interrupt */ +#define USBC_UESTA2_DTSEQ_Pos 8 +#define USBC_UESTA2_DTSEQ_Msk (0x3u << USBC_UESTA2_DTSEQ_Pos) /**< \brief (USBC_UESTA2) Data Toggle Sequence */ +#define USBC_UESTA2_DTSEQ(value) ((USBC_UESTA2_DTSEQ_Msk & ((value) << USBC_UESTA2_DTSEQ_Pos))) +#define USBC_UESTA2_RAMACERI (0x1u << 11) /**< \brief (USBC_UESTA2) Ram Access Error Interrupt */ +#define USBC_UESTA2_NBUSYBK_Pos 12 +#define USBC_UESTA2_NBUSYBK_Msk (0x3u << USBC_UESTA2_NBUSYBK_Pos) /**< \brief (USBC_UESTA2) Number Of Busy Banks */ +#define USBC_UESTA2_NBUSYBK(value) ((USBC_UESTA2_NBUSYBK_Msk & ((value) << USBC_UESTA2_NBUSYBK_Pos))) +#define USBC_UESTA2_CURRBK_Pos 14 +#define USBC_UESTA2_CURRBK_Msk (0x3u << USBC_UESTA2_CURRBK_Pos) /**< \brief (USBC_UESTA2) Current Bank */ +#define USBC_UESTA2_CURRBK(value) ((USBC_UESTA2_CURRBK_Msk & ((value) << USBC_UESTA2_CURRBK_Pos))) +#define USBC_UESTA2_CTRLDIR (0x1u << 17) /**< \brief (USBC_UESTA2) Control Direction */ +#define USBC_UESTA2_CTRLDIR_OUT (0x0u << 17) /**< \brief (USBC_UESTA2) */ +#define USBC_UESTA2_CTRLDIR_IN (0x1u << 17) /**< \brief (USBC_UESTA2) */ +/* -------- USBC_UESTA3 : (USBC Offset: 0x13C) Endpoint Status Register -------- */ +#define USBC_UESTA3_TXINI (0x1u << 0) /**< \brief (USBC_UESTA3) Transmitted IN Data Interrupt */ +#define USBC_UESTA3_RXOUTI (0x1u << 1) /**< \brief (USBC_UESTA3) Received OUT Data Interrupt */ +#define USBC_UESTA3_RXSTPI (0x1u << 2) /**< \brief (USBC_UESTA3) Received SETUP Interrupt */ +#define USBC_UESTA3_NAKOUTI (0x1u << 3) /**< \brief (USBC_UESTA3) NAKed OUT Interrupt */ +#define USBC_UESTA3_NAKINI (0x1u << 4) /**< \brief (USBC_UESTA3) NAKed IN Interrupt */ +#define USBC_UESTA3_STALLEDI (0x1u << 6) /**< \brief (USBC_UESTA3) STALLed Interrupt */ +#define USBC_UESTA3_DTSEQ_Pos 8 +#define USBC_UESTA3_DTSEQ_Msk (0x3u << USBC_UESTA3_DTSEQ_Pos) /**< \brief (USBC_UESTA3) Data Toggle Sequence */ +#define USBC_UESTA3_DTSEQ(value) ((USBC_UESTA3_DTSEQ_Msk & ((value) << USBC_UESTA3_DTSEQ_Pos))) +#define USBC_UESTA3_RAMACERI (0x1u << 11) /**< \brief (USBC_UESTA3) Ram Access Error Interrupt */ +#define USBC_UESTA3_NBUSYBK_Pos 12 +#define USBC_UESTA3_NBUSYBK_Msk (0x3u << USBC_UESTA3_NBUSYBK_Pos) /**< \brief (USBC_UESTA3) Number Of Busy Banks */ +#define USBC_UESTA3_NBUSYBK(value) ((USBC_UESTA3_NBUSYBK_Msk & ((value) << USBC_UESTA3_NBUSYBK_Pos))) +#define USBC_UESTA3_CURRBK_Pos 14 +#define USBC_UESTA3_CURRBK_Msk (0x3u << USBC_UESTA3_CURRBK_Pos) /**< \brief (USBC_UESTA3) Current Bank */ +#define USBC_UESTA3_CURRBK(value) ((USBC_UESTA3_CURRBK_Msk & ((value) << USBC_UESTA3_CURRBK_Pos))) +#define USBC_UESTA3_CTRLDIR (0x1u << 17) /**< \brief (USBC_UESTA3) Control Direction */ +#define USBC_UESTA3_CTRLDIR_OUT (0x0u << 17) /**< \brief (USBC_UESTA3) */ +#define USBC_UESTA3_CTRLDIR_IN (0x1u << 17) /**< \brief (USBC_UESTA3) */ +/* -------- USBC_UESTA4 : (USBC Offset: 0x140) Endpoint Status Register -------- */ +#define USBC_UESTA4_TXINI (0x1u << 0) /**< \brief (USBC_UESTA4) Transmitted IN Data Interrupt */ +#define USBC_UESTA4_RXOUTI (0x1u << 1) /**< \brief (USBC_UESTA4) Received OUT Data Interrupt */ +#define USBC_UESTA4_RXSTPI (0x1u << 2) /**< \brief (USBC_UESTA4) Received SETUP Interrupt */ +#define USBC_UESTA4_NAKOUTI (0x1u << 3) /**< \brief (USBC_UESTA4) NAKed OUT Interrupt */ +#define USBC_UESTA4_NAKINI (0x1u << 4) /**< \brief (USBC_UESTA4) NAKed IN Interrupt */ +#define USBC_UESTA4_STALLEDI (0x1u << 6) /**< \brief (USBC_UESTA4) STALLed Interrupt */ +#define USBC_UESTA4_DTSEQ_Pos 8 +#define USBC_UESTA4_DTSEQ_Msk (0x3u << USBC_UESTA4_DTSEQ_Pos) /**< \brief (USBC_UESTA4) Data Toggle Sequence */ +#define USBC_UESTA4_DTSEQ(value) ((USBC_UESTA4_DTSEQ_Msk & ((value) << USBC_UESTA4_DTSEQ_Pos))) +#define USBC_UESTA4_RAMACERI (0x1u << 11) /**< \brief (USBC_UESTA4) Ram Access Error Interrupt */ +#define USBC_UESTA4_NBUSYBK_Pos 12 +#define USBC_UESTA4_NBUSYBK_Msk (0x3u << USBC_UESTA4_NBUSYBK_Pos) /**< \brief (USBC_UESTA4) Number Of Busy Banks */ +#define USBC_UESTA4_NBUSYBK(value) ((USBC_UESTA4_NBUSYBK_Msk & ((value) << USBC_UESTA4_NBUSYBK_Pos))) +#define USBC_UESTA4_CURRBK_Pos 14 +#define USBC_UESTA4_CURRBK_Msk (0x3u << USBC_UESTA4_CURRBK_Pos) /**< \brief (USBC_UESTA4) Current Bank */ +#define USBC_UESTA4_CURRBK(value) ((USBC_UESTA4_CURRBK_Msk & ((value) << USBC_UESTA4_CURRBK_Pos))) +#define USBC_UESTA4_CTRLDIR (0x1u << 17) /**< \brief (USBC_UESTA4) Control Direction */ +#define USBC_UESTA4_CTRLDIR_OUT (0x0u << 17) /**< \brief (USBC_UESTA4) */ +#define USBC_UESTA4_CTRLDIR_IN (0x1u << 17) /**< \brief (USBC_UESTA4) */ +/* -------- USBC_UESTA5 : (USBC Offset: 0x144) Endpoint Status Register -------- */ +#define USBC_UESTA5_TXINI (0x1u << 0) /**< \brief (USBC_UESTA5) Transmitted IN Data Interrupt */ +#define USBC_UESTA5_RXOUTI (0x1u << 1) /**< \brief (USBC_UESTA5) Received OUT Data Interrupt */ +#define USBC_UESTA5_RXSTPI (0x1u << 2) /**< \brief (USBC_UESTA5) Received SETUP Interrupt */ +#define USBC_UESTA5_NAKOUTI (0x1u << 3) /**< \brief (USBC_UESTA5) NAKed OUT Interrupt */ +#define USBC_UESTA5_NAKINI (0x1u << 4) /**< \brief (USBC_UESTA5) NAKed IN Interrupt */ +#define USBC_UESTA5_STALLEDI (0x1u << 6) /**< \brief (USBC_UESTA5) STALLed Interrupt */ +#define USBC_UESTA5_DTSEQ_Pos 8 +#define USBC_UESTA5_DTSEQ_Msk (0x3u << USBC_UESTA5_DTSEQ_Pos) /**< \brief (USBC_UESTA5) Data Toggle Sequence */ +#define USBC_UESTA5_DTSEQ(value) ((USBC_UESTA5_DTSEQ_Msk & ((value) << USBC_UESTA5_DTSEQ_Pos))) +#define USBC_UESTA5_RAMACERI (0x1u << 11) /**< \brief (USBC_UESTA5) Ram Access Error Interrupt */ +#define USBC_UESTA5_NBUSYBK_Pos 12 +#define USBC_UESTA5_NBUSYBK_Msk (0x3u << USBC_UESTA5_NBUSYBK_Pos) /**< \brief (USBC_UESTA5) Number Of Busy Banks */ +#define USBC_UESTA5_NBUSYBK(value) ((USBC_UESTA5_NBUSYBK_Msk & ((value) << USBC_UESTA5_NBUSYBK_Pos))) +#define USBC_UESTA5_CURRBK_Pos 14 +#define USBC_UESTA5_CURRBK_Msk (0x3u << USBC_UESTA5_CURRBK_Pos) /**< \brief (USBC_UESTA5) Current Bank */ +#define USBC_UESTA5_CURRBK(value) ((USBC_UESTA5_CURRBK_Msk & ((value) << USBC_UESTA5_CURRBK_Pos))) +#define USBC_UESTA5_CTRLDIR (0x1u << 17) /**< \brief (USBC_UESTA5) Control Direction */ +#define USBC_UESTA5_CTRLDIR_OUT (0x0u << 17) /**< \brief (USBC_UESTA5) */ +#define USBC_UESTA5_CTRLDIR_IN (0x1u << 17) /**< \brief (USBC_UESTA5) */ +/* -------- USBC_UESTA6 : (USBC Offset: 0x148) Endpoint Status Register -------- */ +#define USBC_UESTA6_TXINI (0x1u << 0) /**< \brief (USBC_UESTA6) Transmitted IN Data Interrupt */ +#define USBC_UESTA6_RXOUTI (0x1u << 1) /**< \brief (USBC_UESTA6) Received OUT Data Interrupt */ +#define USBC_UESTA6_RXSTPI (0x1u << 2) /**< \brief (USBC_UESTA6) Received SETUP Interrupt */ +#define USBC_UESTA6_NAKOUTI (0x1u << 3) /**< \brief (USBC_UESTA6) NAKed OUT Interrupt */ +#define USBC_UESTA6_NAKINI (0x1u << 4) /**< \brief (USBC_UESTA6) NAKed IN Interrupt */ +#define USBC_UESTA6_STALLEDI (0x1u << 6) /**< \brief (USBC_UESTA6) STALLed Interrupt */ +#define USBC_UESTA6_DTSEQ_Pos 8 +#define USBC_UESTA6_DTSEQ_Msk (0x3u << USBC_UESTA6_DTSEQ_Pos) /**< \brief (USBC_UESTA6) Data Toggle Sequence */ +#define USBC_UESTA6_DTSEQ(value) ((USBC_UESTA6_DTSEQ_Msk & ((value) << USBC_UESTA6_DTSEQ_Pos))) +#define USBC_UESTA6_RAMACERI (0x1u << 11) /**< \brief (USBC_UESTA6) Ram Access Error Interrupt */ +#define USBC_UESTA6_NBUSYBK_Pos 12 +#define USBC_UESTA6_NBUSYBK_Msk (0x3u << USBC_UESTA6_NBUSYBK_Pos) /**< \brief (USBC_UESTA6) Number Of Busy Banks */ +#define USBC_UESTA6_NBUSYBK(value) ((USBC_UESTA6_NBUSYBK_Msk & ((value) << USBC_UESTA6_NBUSYBK_Pos))) +#define USBC_UESTA6_CURRBK_Pos 14 +#define USBC_UESTA6_CURRBK_Msk (0x3u << USBC_UESTA6_CURRBK_Pos) /**< \brief (USBC_UESTA6) Current Bank */ +#define USBC_UESTA6_CURRBK(value) ((USBC_UESTA6_CURRBK_Msk & ((value) << USBC_UESTA6_CURRBK_Pos))) +#define USBC_UESTA6_CTRLDIR (0x1u << 17) /**< \brief (USBC_UESTA6) Control Direction */ +#define USBC_UESTA6_CTRLDIR_OUT (0x0u << 17) /**< \brief (USBC_UESTA6) */ +#define USBC_UESTA6_CTRLDIR_IN (0x1u << 17) /**< \brief (USBC_UESTA6) */ +/* -------- USBC_UESTA7 : (USBC Offset: 0x14C) Endpoint Status Register -------- */ +#define USBC_UESTA7_TXINI (0x1u << 0) /**< \brief (USBC_UESTA7) Transmitted IN Data Interrupt */ +#define USBC_UESTA7_RXOUTI (0x1u << 1) /**< \brief (USBC_UESTA7) Received OUT Data Interrupt */ +#define USBC_UESTA7_RXSTPI (0x1u << 2) /**< \brief (USBC_UESTA7) Received SETUP Interrupt */ +#define USBC_UESTA7_NAKOUTI (0x1u << 3) /**< \brief (USBC_UESTA7) NAKed OUT Interrupt */ +#define USBC_UESTA7_NAKINI (0x1u << 4) /**< \brief (USBC_UESTA7) NAKed IN Interrupt */ +#define USBC_UESTA7_STALLEDI (0x1u << 6) /**< \brief (USBC_UESTA7) STALLed Interrupt */ +#define USBC_UESTA7_DTSEQ_Pos 8 +#define USBC_UESTA7_DTSEQ_Msk (0x3u << USBC_UESTA7_DTSEQ_Pos) /**< \brief (USBC_UESTA7) Data Toggle Sequence */ +#define USBC_UESTA7_DTSEQ(value) ((USBC_UESTA7_DTSEQ_Msk & ((value) << USBC_UESTA7_DTSEQ_Pos))) +#define USBC_UESTA7_RAMACERI (0x1u << 11) /**< \brief (USBC_UESTA7) Ram Access Error Interrupt */ +#define USBC_UESTA7_NBUSYBK_Pos 12 +#define USBC_UESTA7_NBUSYBK_Msk (0x3u << USBC_UESTA7_NBUSYBK_Pos) /**< \brief (USBC_UESTA7) Number Of Busy Banks */ +#define USBC_UESTA7_NBUSYBK(value) ((USBC_UESTA7_NBUSYBK_Msk & ((value) << USBC_UESTA7_NBUSYBK_Pos))) +#define USBC_UESTA7_CURRBK_Pos 14 +#define USBC_UESTA7_CURRBK_Msk (0x3u << USBC_UESTA7_CURRBK_Pos) /**< \brief (USBC_UESTA7) Current Bank */ +#define USBC_UESTA7_CURRBK(value) ((USBC_UESTA7_CURRBK_Msk & ((value) << USBC_UESTA7_CURRBK_Pos))) +#define USBC_UESTA7_CTRLDIR (0x1u << 17) /**< \brief (USBC_UESTA7) Control Direction */ +#define USBC_UESTA7_CTRLDIR_OUT (0x0u << 17) /**< \brief (USBC_UESTA7) */ +#define USBC_UESTA7_CTRLDIR_IN (0x1u << 17) /**< \brief (USBC_UESTA7) */ +/* -------- USBC_UESTA0CLR : (USBC Offset: 0x160) Endpoint Status Clear Register -------- */ +#define USBC_UESTA0CLR_TXINIC (0x1u << 0) /**< \brief (USBC_UESTA0CLR) TXINI Clear */ +#define USBC_UESTA0CLR_RXOUTIC (0x1u << 1) /**< \brief (USBC_UESTA0CLR) RXOUTI Clear */ +#define USBC_UESTA0CLR_RXSTPIC (0x1u << 2) /**< \brief (USBC_UESTA0CLR) RXSTPI Clear */ +#define USBC_UESTA0CLR_NAKOUTIC (0x1u << 3) /**< \brief (USBC_UESTA0CLR) NAKOUTI Clear */ +#define USBC_UESTA0CLR_NAKINIC (0x1u << 4) /**< \brief (USBC_UESTA0CLR) NAKINI Clear */ +#define USBC_UESTA0CLR_STALLEDIC (0x1u << 6) /**< \brief (USBC_UESTA0CLR) STALLEDI Clear */ +#define USBC_UESTA0CLR_RAMACERIC (0x1u << 11) /**< \brief (USBC_UESTA0CLR) RAMACERI Clear */ +/* -------- USBC_UESTA1CLR : (USBC Offset: 0x164) Endpoint Status Clear Register -------- */ +#define USBC_UESTA1CLR_TXINIC (0x1u << 0) /**< \brief (USBC_UESTA1CLR) TXINI Clear */ +#define USBC_UESTA1CLR_RXOUTIC (0x1u << 1) /**< \brief (USBC_UESTA1CLR) RXOUTI Clear */ +#define USBC_UESTA1CLR_RXSTPIC (0x1u << 2) /**< \brief (USBC_UESTA1CLR) RXSTPI Clear */ +#define USBC_UESTA1CLR_NAKOUTIC (0x1u << 3) /**< \brief (USBC_UESTA1CLR) NAKOUTI Clear */ +#define USBC_UESTA1CLR_NAKINIC (0x1u << 4) /**< \brief (USBC_UESTA1CLR) NAKINI Clear */ +#define USBC_UESTA1CLR_STALLEDIC (0x1u << 6) /**< \brief (USBC_UESTA1CLR) STALLEDI Clear */ +#define USBC_UESTA1CLR_RAMACERIC (0x1u << 11) /**< \brief (USBC_UESTA1CLR) RAMACERI Clear */ +/* -------- USBC_UESTA2CLR : (USBC Offset: 0x168) Endpoint Status Clear Register -------- */ +#define USBC_UESTA2CLR_TXINIC (0x1u << 0) /**< \brief (USBC_UESTA2CLR) TXINI Clear */ +#define USBC_UESTA2CLR_RXOUTIC (0x1u << 1) /**< \brief (USBC_UESTA2CLR) RXOUTI Clear */ +#define USBC_UESTA2CLR_RXSTPIC (0x1u << 2) /**< \brief (USBC_UESTA2CLR) RXSTPI Clear */ +#define USBC_UESTA2CLR_NAKOUTIC (0x1u << 3) /**< \brief (USBC_UESTA2CLR) NAKOUTI Clear */ +#define USBC_UESTA2CLR_NAKINIC (0x1u << 4) /**< \brief (USBC_UESTA2CLR) NAKINI Clear */ +#define USBC_UESTA2CLR_STALLEDIC (0x1u << 6) /**< \brief (USBC_UESTA2CLR) STALLEDI Clear */ +#define USBC_UESTA2CLR_RAMACERIC (0x1u << 11) /**< \brief (USBC_UESTA2CLR) RAMACERI Clear */ +/* -------- USBC_UESTA3CLR : (USBC Offset: 0x16C) Endpoint Status Clear Register -------- */ +#define USBC_UESTA3CLR_TXINIC (0x1u << 0) /**< \brief (USBC_UESTA3CLR) TXINI Clear */ +#define USBC_UESTA3CLR_RXOUTIC (0x1u << 1) /**< \brief (USBC_UESTA3CLR) RXOUTI Clear */ +#define USBC_UESTA3CLR_RXSTPIC (0x1u << 2) /**< \brief (USBC_UESTA3CLR) RXSTPI Clear */ +#define USBC_UESTA3CLR_NAKOUTIC (0x1u << 3) /**< \brief (USBC_UESTA3CLR) NAKOUTI Clear */ +#define USBC_UESTA3CLR_NAKINIC (0x1u << 4) /**< \brief (USBC_UESTA3CLR) NAKINI Clear */ +#define USBC_UESTA3CLR_STALLEDIC (0x1u << 6) /**< \brief (USBC_UESTA3CLR) STALLEDI Clear */ +#define USBC_UESTA3CLR_RAMACERIC (0x1u << 11) /**< \brief (USBC_UESTA3CLR) RAMACERI Clear */ +/* -------- USBC_UESTA4CLR : (USBC Offset: 0x170) Endpoint Status Clear Register -------- */ +#define USBC_UESTA4CLR_TXINIC (0x1u << 0) /**< \brief (USBC_UESTA4CLR) TXINI Clear */ +#define USBC_UESTA4CLR_RXOUTIC (0x1u << 1) /**< \brief (USBC_UESTA4CLR) RXOUTI Clear */ +#define USBC_UESTA4CLR_RXSTPIC (0x1u << 2) /**< \brief (USBC_UESTA4CLR) RXSTPI Clear */ +#define USBC_UESTA4CLR_NAKOUTIC (0x1u << 3) /**< \brief (USBC_UESTA4CLR) NAKOUTI Clear */ +#define USBC_UESTA4CLR_NAKINIC (0x1u << 4) /**< \brief (USBC_UESTA4CLR) NAKINI Clear */ +#define USBC_UESTA4CLR_STALLEDIC (0x1u << 6) /**< \brief (USBC_UESTA4CLR) STALLEDI Clear */ +#define USBC_UESTA4CLR_RAMACERIC (0x1u << 11) /**< \brief (USBC_UESTA4CLR) RAMACERI Clear */ +/* -------- USBC_UESTA5CLR : (USBC Offset: 0x174) Endpoint Status Clear Register -------- */ +#define USBC_UESTA5CLR_TXINIC (0x1u << 0) /**< \brief (USBC_UESTA5CLR) TXINI Clear */ +#define USBC_UESTA5CLR_RXOUTIC (0x1u << 1) /**< \brief (USBC_UESTA5CLR) RXOUTI Clear */ +#define USBC_UESTA5CLR_RXSTPIC (0x1u << 2) /**< \brief (USBC_UESTA5CLR) RXSTPI Clear */ +#define USBC_UESTA5CLR_NAKOUTIC (0x1u << 3) /**< \brief (USBC_UESTA5CLR) NAKOUTI Clear */ +#define USBC_UESTA5CLR_NAKINIC (0x1u << 4) /**< \brief (USBC_UESTA5CLR) NAKINI Clear */ +#define USBC_UESTA5CLR_STALLEDIC (0x1u << 6) /**< \brief (USBC_UESTA5CLR) STALLEDI Clear */ +#define USBC_UESTA5CLR_RAMACERIC (0x1u << 11) /**< \brief (USBC_UESTA5CLR) RAMACERI Clear */ +/* -------- USBC_UESTA6CLR : (USBC Offset: 0x178) Endpoint Status Clear Register -------- */ +#define USBC_UESTA6CLR_TXINIC (0x1u << 0) /**< \brief (USBC_UESTA6CLR) TXINI Clear */ +#define USBC_UESTA6CLR_RXOUTIC (0x1u << 1) /**< \brief (USBC_UESTA6CLR) RXOUTI Clear */ +#define USBC_UESTA6CLR_RXSTPIC (0x1u << 2) /**< \brief (USBC_UESTA6CLR) RXSTPI Clear */ +#define USBC_UESTA6CLR_NAKOUTIC (0x1u << 3) /**< \brief (USBC_UESTA6CLR) NAKOUTI Clear */ +#define USBC_UESTA6CLR_NAKINIC (0x1u << 4) /**< \brief (USBC_UESTA6CLR) NAKINI Clear */ +#define USBC_UESTA6CLR_STALLEDIC (0x1u << 6) /**< \brief (USBC_UESTA6CLR) STALLEDI Clear */ +#define USBC_UESTA6CLR_RAMACERIC (0x1u << 11) /**< \brief (USBC_UESTA6CLR) RAMACERI Clear */ +/* -------- USBC_UESTA7CLR : (USBC Offset: 0x17C) Endpoint Status Clear Register -------- */ +#define USBC_UESTA7CLR_TXINIC (0x1u << 0) /**< \brief (USBC_UESTA7CLR) TXINI Clear */ +#define USBC_UESTA7CLR_RXOUTIC (0x1u << 1) /**< \brief (USBC_UESTA7CLR) RXOUTI Clear */ +#define USBC_UESTA7CLR_RXSTPIC (0x1u << 2) /**< \brief (USBC_UESTA7CLR) RXSTPI Clear */ +#define USBC_UESTA7CLR_NAKOUTIC (0x1u << 3) /**< \brief (USBC_UESTA7CLR) NAKOUTI Clear */ +#define USBC_UESTA7CLR_NAKINIC (0x1u << 4) /**< \brief (USBC_UESTA7CLR) NAKINI Clear */ +#define USBC_UESTA7CLR_STALLEDIC (0x1u << 6) /**< \brief (USBC_UESTA7CLR) STALLEDI Clear */ +#define USBC_UESTA7CLR_RAMACERIC (0x1u << 11) /**< \brief (USBC_UESTA7CLR) RAMACERI Clear */ +/* -------- USBC_UESTA0SET : (USBC Offset: 0x190) Endpoint Status Set Register -------- */ +#define USBC_UESTA0SET_TXINIS (0x1u << 0) /**< \brief (USBC_UESTA0SET) TXINI Set */ +#define USBC_UESTA0SET_RXOUTIS (0x1u << 1) /**< \brief (USBC_UESTA0SET) RXOUTI Set */ +#define USBC_UESTA0SET_RXSTPIS (0x1u << 2) /**< \brief (USBC_UESTA0SET) RXSTPI Set */ +#define USBC_UESTA0SET_NAKOUTIS (0x1u << 3) /**< \brief (USBC_UESTA0SET) NAKOUTI Set */ +#define USBC_UESTA0SET_NAKINIS (0x1u << 4) /**< \brief (USBC_UESTA0SET) NAKINI Set */ +#define USBC_UESTA0SET_STALLEDIS (0x1u << 6) /**< \brief (USBC_UESTA0SET) STALLEDI Set */ +#define USBC_UESTA0SET_RAMACERIS (0x1u << 11) /**< \brief (USBC_UESTA0SET) RAMACERI Set */ +#define USBC_UESTA0SET_NBUSYBKS (0x1u << 12) /**< \brief (USBC_UESTA0SET) NBUSYBK Set */ +/* -------- USBC_UESTA1SET : (USBC Offset: 0x194) Endpoint Status Set Register -------- */ +#define USBC_UESTA1SET_TXINIS (0x1u << 0) /**< \brief (USBC_UESTA1SET) TXINI Set */ +#define USBC_UESTA1SET_RXOUTIS (0x1u << 1) /**< \brief (USBC_UESTA1SET) RXOUTI Set */ +#define USBC_UESTA1SET_RXSTPIS (0x1u << 2) /**< \brief (USBC_UESTA1SET) RXSTPI Set */ +#define USBC_UESTA1SET_NAKOUTIS (0x1u << 3) /**< \brief (USBC_UESTA1SET) NAKOUTI Set */ +#define USBC_UESTA1SET_NAKINIS (0x1u << 4) /**< \brief (USBC_UESTA1SET) NAKINI Set */ +#define USBC_UESTA1SET_STALLEDIS (0x1u << 6) /**< \brief (USBC_UESTA1SET) STALLEDI Set */ +#define USBC_UESTA1SET_RAMACERIS (0x1u << 11) /**< \brief (USBC_UESTA1SET) RAMACERI Set */ +#define USBC_UESTA1SET_NBUSYBKS (0x1u << 12) /**< \brief (USBC_UESTA1SET) NBUSYBK Set */ +/* -------- USBC_UESTA2SET : (USBC Offset: 0x198) Endpoint Status Set Register -------- */ +#define USBC_UESTA2SET_TXINIS (0x1u << 0) /**< \brief (USBC_UESTA2SET) TXINI Set */ +#define USBC_UESTA2SET_RXOUTIS (0x1u << 1) /**< \brief (USBC_UESTA2SET) RXOUTI Set */ +#define USBC_UESTA2SET_RXSTPIS (0x1u << 2) /**< \brief (USBC_UESTA2SET) RXSTPI Set */ +#define USBC_UESTA2SET_NAKOUTIS (0x1u << 3) /**< \brief (USBC_UESTA2SET) NAKOUTI Set */ +#define USBC_UESTA2SET_NAKINIS (0x1u << 4) /**< \brief (USBC_UESTA2SET) NAKINI Set */ +#define USBC_UESTA2SET_STALLEDIS (0x1u << 6) /**< \brief (USBC_UESTA2SET) STALLEDI Set */ +#define USBC_UESTA2SET_RAMACERIS (0x1u << 11) /**< \brief (USBC_UESTA2SET) RAMACERI Set */ +#define USBC_UESTA2SET_NBUSYBKS (0x1u << 12) /**< \brief (USBC_UESTA2SET) NBUSYBK Set */ +/* -------- USBC_UESTA3SET : (USBC Offset: 0x19C) Endpoint Status Set Register -------- */ +#define USBC_UESTA3SET_TXINIS (0x1u << 0) /**< \brief (USBC_UESTA3SET) TXINI Set */ +#define USBC_UESTA3SET_RXOUTIS (0x1u << 1) /**< \brief (USBC_UESTA3SET) RXOUTI Set */ +#define USBC_UESTA3SET_RXSTPIS (0x1u << 2) /**< \brief (USBC_UESTA3SET) RXSTPI Set */ +#define USBC_UESTA3SET_NAKOUTIS (0x1u << 3) /**< \brief (USBC_UESTA3SET) NAKOUTI Set */ +#define USBC_UESTA3SET_NAKINIS (0x1u << 4) /**< \brief (USBC_UESTA3SET) NAKINI Set */ +#define USBC_UESTA3SET_STALLEDIS (0x1u << 6) /**< \brief (USBC_UESTA3SET) STALLEDI Set */ +#define USBC_UESTA3SET_RAMACERIS (0x1u << 11) /**< \brief (USBC_UESTA3SET) RAMACERI Set */ +#define USBC_UESTA3SET_NBUSYBKS (0x1u << 12) /**< \brief (USBC_UESTA3SET) NBUSYBK Set */ +/* -------- USBC_UESTA4SET : (USBC Offset: 0x1A0) Endpoint Status Set Register -------- */ +#define USBC_UESTA4SET_TXINIS (0x1u << 0) /**< \brief (USBC_UESTA4SET) TXINI Set */ +#define USBC_UESTA4SET_RXOUTIS (0x1u << 1) /**< \brief (USBC_UESTA4SET) RXOUTI Set */ +#define USBC_UESTA4SET_RXSTPIS (0x1u << 2) /**< \brief (USBC_UESTA4SET) RXSTPI Set */ +#define USBC_UESTA4SET_NAKOUTIS (0x1u << 3) /**< \brief (USBC_UESTA4SET) NAKOUTI Set */ +#define USBC_UESTA4SET_NAKINIS (0x1u << 4) /**< \brief (USBC_UESTA4SET) NAKINI Set */ +#define USBC_UESTA4SET_STALLEDIS (0x1u << 6) /**< \brief (USBC_UESTA4SET) STALLEDI Set */ +#define USBC_UESTA4SET_RAMACERIS (0x1u << 11) /**< \brief (USBC_UESTA4SET) RAMACERI Set */ +#define USBC_UESTA4SET_NBUSYBKS (0x1u << 12) /**< \brief (USBC_UESTA4SET) NBUSYBK Set */ +/* -------- USBC_UESTA5SET : (USBC Offset: 0x1A4) Endpoint Status Set Register -------- */ +#define USBC_UESTA5SET_TXINIS (0x1u << 0) /**< \brief (USBC_UESTA5SET) TXINI Set */ +#define USBC_UESTA5SET_RXOUTIS (0x1u << 1) /**< \brief (USBC_UESTA5SET) RXOUTI Set */ +#define USBC_UESTA5SET_RXSTPIS (0x1u << 2) /**< \brief (USBC_UESTA5SET) RXSTPI Set */ +#define USBC_UESTA5SET_NAKOUTIS (0x1u << 3) /**< \brief (USBC_UESTA5SET) NAKOUTI Set */ +#define USBC_UESTA5SET_NAKINIS (0x1u << 4) /**< \brief (USBC_UESTA5SET) NAKINI Set */ +#define USBC_UESTA5SET_STALLEDIS (0x1u << 6) /**< \brief (USBC_UESTA5SET) STALLEDI Set */ +#define USBC_UESTA5SET_RAMACERIS (0x1u << 11) /**< \brief (USBC_UESTA5SET) RAMACERI Set */ +#define USBC_UESTA5SET_NBUSYBKS (0x1u << 12) /**< \brief (USBC_UESTA5SET) NBUSYBK Set */ +/* -------- USBC_UESTA6SET : (USBC Offset: 0x1A8) Endpoint Status Set Register -------- */ +#define USBC_UESTA6SET_TXINIS (0x1u << 0) /**< \brief (USBC_UESTA6SET) TXINI Set */ +#define USBC_UESTA6SET_RXOUTIS (0x1u << 1) /**< \brief (USBC_UESTA6SET) RXOUTI Set */ +#define USBC_UESTA6SET_RXSTPIS (0x1u << 2) /**< \brief (USBC_UESTA6SET) RXSTPI Set */ +#define USBC_UESTA6SET_NAKOUTIS (0x1u << 3) /**< \brief (USBC_UESTA6SET) NAKOUTI Set */ +#define USBC_UESTA6SET_NAKINIS (0x1u << 4) /**< \brief (USBC_UESTA6SET) NAKINI Set */ +#define USBC_UESTA6SET_STALLEDIS (0x1u << 6) /**< \brief (USBC_UESTA6SET) STALLEDI Set */ +#define USBC_UESTA6SET_RAMACERIS (0x1u << 11) /**< \brief (USBC_UESTA6SET) RAMACERI Set */ +#define USBC_UESTA6SET_NBUSYBKS (0x1u << 12) /**< \brief (USBC_UESTA6SET) NBUSYBK Set */ +/* -------- USBC_UESTA7SET : (USBC Offset: 0x1AC) Endpoint Status Set Register -------- */ +#define USBC_UESTA7SET_TXINIS (0x1u << 0) /**< \brief (USBC_UESTA7SET) TXINI Set */ +#define USBC_UESTA7SET_RXOUTIS (0x1u << 1) /**< \brief (USBC_UESTA7SET) RXOUTI Set */ +#define USBC_UESTA7SET_RXSTPIS (0x1u << 2) /**< \brief (USBC_UESTA7SET) RXSTPI Set */ +#define USBC_UESTA7SET_NAKOUTIS (0x1u << 3) /**< \brief (USBC_UESTA7SET) NAKOUTI Set */ +#define USBC_UESTA7SET_NAKINIS (0x1u << 4) /**< \brief (USBC_UESTA7SET) NAKINI Set */ +#define USBC_UESTA7SET_STALLEDIS (0x1u << 6) /**< \brief (USBC_UESTA7SET) STALLEDI Set */ +#define USBC_UESTA7SET_RAMACERIS (0x1u << 11) /**< \brief (USBC_UESTA7SET) RAMACERI Set */ +#define USBC_UESTA7SET_NBUSYBKS (0x1u << 12) /**< \brief (USBC_UESTA7SET) NBUSYBK Set */ +/* -------- USBC_UECON0 : (USBC Offset: 0x1C0) Endpoint Control Register -------- */ +#define USBC_UECON0_TXINE (0x1u << 0) /**< \brief (USBC_UECON0) TXIN Interrupt Enable */ +#define USBC_UECON0_RXOUTE (0x1u << 1) /**< \brief (USBC_UECON0) RXOUT Interrupt Enable */ +#define USBC_UECON0_RXSTPE (0x1u << 2) /**< \brief (USBC_UECON0) RXSTP Interrupt Enable */ +#define USBC_UECON0_NAKOUTE (0x1u << 3) /**< \brief (USBC_UECON0) NAKOUT Interrupt Enable */ +#define USBC_UECON0_NAKINE (0x1u << 4) /**< \brief (USBC_UECON0) NAKIN Interrupt Enable */ +#define USBC_UECON0_STALLEDE (0x1u << 6) /**< \brief (USBC_UECON0) STALLED Interrupt Enable */ +#define USBC_UECON0_NREPLY (0x1u << 8) /**< \brief (USBC_UECON0) No Reply */ +#define USBC_UECON0_RAMACERE (0x1u << 11) /**< \brief (USBC_UECON0) RAMACER Interrupt Enable */ +#define USBC_UECON0_NBUSYBKE (0x1u << 12) /**< \brief (USBC_UECON0) Number of Busy Banks Interrupt Enable */ +#define USBC_UECON0_KILLBK (0x1u << 13) /**< \brief (USBC_UECON0) Kill IN Bank */ +#define USBC_UECON0_FIFOCON (0x1u << 14) /**< \brief (USBC_UECON0) FIFO Control */ +#define USBC_UECON0_NYETDIS (0x1u << 17) /**< \brief (USBC_UECON0) NYET token disable */ +#define USBC_UECON0_RSTDT (0x1u << 18) /**< \brief (USBC_UECON0) Reset Data Toggle */ +#define USBC_UECON0_STALLRQ (0x1u << 19) /**< \brief (USBC_UECON0) STALL Request */ +#define USBC_UECON0_BUSY0 (0x1u << 24) /**< \brief (USBC_UECON0) Busy Bank1 Enable */ +#define USBC_UECON0_BUSY1 (0x1u << 25) /**< \brief (USBC_UECON0) Busy Bank0 Enable */ +/* -------- USBC_UECON1 : (USBC Offset: 0x1C4) Endpoint Control Register -------- */ +#define USBC_UECON1_TXINE (0x1u << 0) /**< \brief (USBC_UECON1) TXIN Interrupt Enable */ +#define USBC_UECON1_RXOUTE (0x1u << 1) /**< \brief (USBC_UECON1) RXOUT Interrupt Enable */ +#define USBC_UECON1_RXSTPE (0x1u << 2) /**< \brief (USBC_UECON1) RXSTP Interrupt Enable */ +#define USBC_UECON1_NAKOUTE (0x1u << 3) /**< \brief (USBC_UECON1) NAKOUT Interrupt Enable */ +#define USBC_UECON1_NAKINE (0x1u << 4) /**< \brief (USBC_UECON1) NAKIN Interrupt Enable */ +#define USBC_UECON1_STALLEDE (0x1u << 6) /**< \brief (USBC_UECON1) STALLED Interrupt Enable */ +#define USBC_UECON1_NREPLY (0x1u << 8) /**< \brief (USBC_UECON1) No Reply */ +#define USBC_UECON1_RAMACERE (0x1u << 11) /**< \brief (USBC_UECON1) RAMACER Interrupt Enable */ +#define USBC_UECON1_NBUSYBKE (0x1u << 12) /**< \brief (USBC_UECON1) Number of Busy Banks Interrupt Enable */ +#define USBC_UECON1_KILLBK (0x1u << 13) /**< \brief (USBC_UECON1) Kill IN Bank */ +#define USBC_UECON1_FIFOCON (0x1u << 14) /**< \brief (USBC_UECON1) FIFO Control */ +#define USBC_UECON1_NYETDIS (0x1u << 17) /**< \brief (USBC_UECON1) NYET Token Enable */ +#define USBC_UECON1_RSTDT (0x1u << 18) /**< \brief (USBC_UECON1) Reset Data Toggle */ +#define USBC_UECON1_STALLRQ (0x1u << 19) /**< \brief (USBC_UECON1) STALL Request */ +#define USBC_UECON1_BUSY0 (0x1u << 24) /**< \brief (USBC_UECON1) Busy Bank1 Enable */ +#define USBC_UECON1_BUSY1 (0x1u << 25) /**< \brief (USBC_UECON1) Busy Bank0 Enable */ +/* -------- USBC_UECON2 : (USBC Offset: 0x1C8) Endpoint Control Register -------- */ +#define USBC_UECON2_TXINE (0x1u << 0) /**< \brief (USBC_UECON2) TXIN Interrupt Enable */ +#define USBC_UECON2_RXOUTE (0x1u << 1) /**< \brief (USBC_UECON2) RXOUT Interrupt Enable */ +#define USBC_UECON2_RXSTPE (0x1u << 2) /**< \brief (USBC_UECON2) RXSTP Interrupt Enable */ +#define USBC_UECON2_NAKOUTE (0x1u << 3) /**< \brief (USBC_UECON2) NAKOUT Interrupt Enable */ +#define USBC_UECON2_NAKINE (0x1u << 4) /**< \brief (USBC_UECON2) NAKIN Interrupt Enable */ +#define USBC_UECON2_STALLEDE (0x1u << 6) /**< \brief (USBC_UECON2) STALLED Interrupt Enable */ +#define USBC_UECON2_NREPLY (0x1u << 8) /**< \brief (USBC_UECON2) No Reply */ +#define USBC_UECON2_RAMACERE (0x1u << 11) /**< \brief (USBC_UECON2) RAMACER Interrupt Enable */ +#define USBC_UECON2_NBUSYBKE (0x1u << 12) /**< \brief (USBC_UECON2) Number of Busy Banks Interrupt Enable */ +#define USBC_UECON2_KILLBK (0x1u << 13) /**< \brief (USBC_UECON2) Kill IN Bank */ +#define USBC_UECON2_FIFOCON (0x1u << 14) /**< \brief (USBC_UECON2) FIFO Control */ +#define USBC_UECON2_NYETDIS (0x1u << 17) /**< \brief (USBC_UECON2) NYET Token Enable */ +#define USBC_UECON2_RSTDT (0x1u << 18) /**< \brief (USBC_UECON2) Reset Data Toggle */ +#define USBC_UECON2_STALLRQ (0x1u << 19) /**< \brief (USBC_UECON2) STALL Request */ +#define USBC_UECON2_BUSY0 (0x1u << 24) /**< \brief (USBC_UECON2) Busy Bank1 Enable */ +#define USBC_UECON2_BUSY1 (0x1u << 25) /**< \brief (USBC_UECON2) Busy Bank0 Enable */ +/* -------- USBC_UECON3 : (USBC Offset: 0x1CC) Endpoint Control Register -------- */ +#define USBC_UECON3_TXINE (0x1u << 0) /**< \brief (USBC_UECON3) TXIN Interrupt Enable */ +#define USBC_UECON3_RXOUTE (0x1u << 1) /**< \brief (USBC_UECON3) RXOUT Interrupt Enable */ +#define USBC_UECON3_RXSTPE (0x1u << 2) /**< \brief (USBC_UECON3) RXSTP Interrupt Enable */ +#define USBC_UECON3_NAKOUTE (0x1u << 3) /**< \brief (USBC_UECON3) NAKOUT Interrupt Enable */ +#define USBC_UECON3_NAKINE (0x1u << 4) /**< \brief (USBC_UECON3) NAKIN Interrupt Enable */ +#define USBC_UECON3_STALLEDE (0x1u << 6) /**< \brief (USBC_UECON3) STALLED Interrupt Enable */ +#define USBC_UECON3_NREPLY (0x1u << 8) /**< \brief (USBC_UECON3) No Reply */ +#define USBC_UECON3_RAMACERE (0x1u << 11) /**< \brief (USBC_UECON3) RAMACER Interrupt Enable */ +#define USBC_UECON3_NBUSYBKE (0x1u << 12) /**< \brief (USBC_UECON3) Number of Busy Banks Interrupt Enable */ +#define USBC_UECON3_KILLBK (0x1u << 13) /**< \brief (USBC_UECON3) Kill IN Bank */ +#define USBC_UECON3_FIFOCON (0x1u << 14) /**< \brief (USBC_UECON3) FIFO Control */ +#define USBC_UECON3_NYETDIS (0x1u << 17) /**< \brief (USBC_UECON3) NYET Token Enable */ +#define USBC_UECON3_RSTDT (0x1u << 18) /**< \brief (USBC_UECON3) Reset Data Toggle */ +#define USBC_UECON3_STALLRQ (0x1u << 19) /**< \brief (USBC_UECON3) STALL Request */ +#define USBC_UECON3_BUSY0 (0x1u << 24) /**< \brief (USBC_UECON3) Busy Bank1 Enable */ +#define USBC_UECON3_BUSY1 (0x1u << 25) /**< \brief (USBC_UECON3) Busy Bank0 Enable */ +/* -------- USBC_UECON4 : (USBC Offset: 0x1D0) Endpoint Control Register -------- */ +#define USBC_UECON4_TXINE (0x1u << 0) /**< \brief (USBC_UECON4) TXIN Interrupt Enable */ +#define USBC_UECON4_RXOUTE (0x1u << 1) /**< \brief (USBC_UECON4) RXOUT Interrupt Enable */ +#define USBC_UECON4_RXSTPE (0x1u << 2) /**< \brief (USBC_UECON4) RXSTP Interrupt Enable */ +#define USBC_UECON4_NAKOUTE (0x1u << 3) /**< \brief (USBC_UECON4) NAKOUT Interrupt Enable */ +#define USBC_UECON4_NAKINE (0x1u << 4) /**< \brief (USBC_UECON4) NAKIN Interrupt Enable */ +#define USBC_UECON4_STALLEDE (0x1u << 6) /**< \brief (USBC_UECON4) STALLED Interrupt Enable */ +#define USBC_UECON4_NREPLY (0x1u << 8) /**< \brief (USBC_UECON4) No Reply */ +#define USBC_UECON4_RAMACERE (0x1u << 11) /**< \brief (USBC_UECON4) RAMACER Interrupt Enable */ +#define USBC_UECON4_NBUSYBKE (0x1u << 12) /**< \brief (USBC_UECON4) Number of Busy Banks Interrupt Enable */ +#define USBC_UECON4_KILLBK (0x1u << 13) /**< \brief (USBC_UECON4) Kill IN Bank */ +#define USBC_UECON4_FIFOCON (0x1u << 14) /**< \brief (USBC_UECON4) FIFO Control */ +#define USBC_UECON4_NYETDIS (0x1u << 17) /**< \brief (USBC_UECON4) NYET Token Enable */ +#define USBC_UECON4_RSTDT (0x1u << 18) /**< \brief (USBC_UECON4) Reset Data Toggle */ +#define USBC_UECON4_STALLRQ (0x1u << 19) /**< \brief (USBC_UECON4) STALL Request */ +#define USBC_UECON4_BUSY0 (0x1u << 24) /**< \brief (USBC_UECON4) Busy Bank1 Enable */ +#define USBC_UECON4_BUSY1 (0x1u << 25) /**< \brief (USBC_UECON4) Busy Bank0 Enable */ +/* -------- USBC_UECON5 : (USBC Offset: 0x1D4) Endpoint Control Register -------- */ +#define USBC_UECON5_TXINE (0x1u << 0) /**< \brief (USBC_UECON5) TXIN Interrupt Enable */ +#define USBC_UECON5_RXOUTE (0x1u << 1) /**< \brief (USBC_UECON5) RXOUT Interrupt Enable */ +#define USBC_UECON5_RXSTPE (0x1u << 2) /**< \brief (USBC_UECON5) RXSTP Interrupt Enable */ +#define USBC_UECON5_NAKOUTE (0x1u << 3) /**< \brief (USBC_UECON5) NAKOUT Interrupt Enable */ +#define USBC_UECON5_NAKINE (0x1u << 4) /**< \brief (USBC_UECON5) NAKIN Interrupt Enable */ +#define USBC_UECON5_STALLEDE (0x1u << 6) /**< \brief (USBC_UECON5) STALLED Interrupt Enable */ +#define USBC_UECON5_NREPLY (0x1u << 8) /**< \brief (USBC_UECON5) No Reply */ +#define USBC_UECON5_RAMACERE (0x1u << 11) /**< \brief (USBC_UECON5) RAMACER Interrupt Enable */ +#define USBC_UECON5_NBUSYBKE (0x1u << 12) /**< \brief (USBC_UECON5) Number of Busy Banks Interrupt Enable */ +#define USBC_UECON5_KILLBK (0x1u << 13) /**< \brief (USBC_UECON5) Kill IN Bank */ +#define USBC_UECON5_FIFOCON (0x1u << 14) /**< \brief (USBC_UECON5) FIFO Control */ +#define USBC_UECON5_NYETDIS (0x1u << 17) /**< \brief (USBC_UECON5) NYET Token Enable */ +#define USBC_UECON5_RSTDT (0x1u << 18) /**< \brief (USBC_UECON5) Reset Data Toggle */ +#define USBC_UECON5_STALLRQ (0x1u << 19) /**< \brief (USBC_UECON5) STALL Request */ +#define USBC_UECON5_BUSY0 (0x1u << 24) /**< \brief (USBC_UECON5) Busy Bank1 Enable */ +#define USBC_UECON5_BUSY1 (0x1u << 25) /**< \brief (USBC_UECON5) Busy Bank0 Enable */ +/* -------- USBC_UECON6 : (USBC Offset: 0x1D8) Endpoint Control Register -------- */ +#define USBC_UECON6_TXINE (0x1u << 0) /**< \brief (USBC_UECON6) TXIN Interrupt Enable */ +#define USBC_UECON6_RXOUTE (0x1u << 1) /**< \brief (USBC_UECON6) RXOUT Interrupt Enable */ +#define USBC_UECON6_RXSTPE (0x1u << 2) /**< \brief (USBC_UECON6) RXSTP Interrupt Enable */ +#define USBC_UECON6_NAKOUTE (0x1u << 3) /**< \brief (USBC_UECON6) NAKOUT Interrupt Enable */ +#define USBC_UECON6_NAKINE (0x1u << 4) /**< \brief (USBC_UECON6) NAKIN Interrupt Enable */ +#define USBC_UECON6_STALLEDE (0x1u << 6) /**< \brief (USBC_UECON6) STALLED Interrupt Enable */ +#define USBC_UECON6_NREPLY (0x1u << 8) /**< \brief (USBC_UECON6) No Reply */ +#define USBC_UECON6_RAMACERE (0x1u << 11) /**< \brief (USBC_UECON6) RAMACER Interrupt Enable */ +#define USBC_UECON6_NBUSYBKE (0x1u << 12) /**< \brief (USBC_UECON6) Number of Busy Banks Interrupt Enable */ +#define USBC_UECON6_KILLBK (0x1u << 13) /**< \brief (USBC_UECON6) Kill IN Bank */ +#define USBC_UECON6_FIFOCON (0x1u << 14) /**< \brief (USBC_UECON6) FIFO Control */ +#define USBC_UECON6_NYETDIS (0x1u << 17) /**< \brief (USBC_UECON6) NYET Token Enable */ +#define USBC_UECON6_RSTDT (0x1u << 18) /**< \brief (USBC_UECON6) Reset Data Toggle */ +#define USBC_UECON6_STALLRQ (0x1u << 19) /**< \brief (USBC_UECON6) STALL Request */ +#define USBC_UECON6_BUSY0 (0x1u << 24) /**< \brief (USBC_UECON6) Busy Bank1 Enable */ +#define USBC_UECON6_BUSY1 (0x1u << 25) /**< \brief (USBC_UECON6) Busy Bank0 Enable */ +/* -------- USBC_UECON7 : (USBC Offset: 0x1DC) Endpoint Control Register -------- */ +#define USBC_UECON7_TXINE (0x1u << 0) /**< \brief (USBC_UECON7) TXIN Interrupt Enable */ +#define USBC_UECON7_RXOUTE (0x1u << 1) /**< \brief (USBC_UECON7) RXOUT Interrupt Enable */ +#define USBC_UECON7_RXSTPE (0x1u << 2) /**< \brief (USBC_UECON7) RXSTP Interrupt Enable */ +#define USBC_UECON7_NAKOUTE (0x1u << 3) /**< \brief (USBC_UECON7) NAKOUT Interrupt Enable */ +#define USBC_UECON7_NAKINE (0x1u << 4) /**< \brief (USBC_UECON7) NAKIN Interrupt Enable */ +#define USBC_UECON7_STALLEDE (0x1u << 6) /**< \brief (USBC_UECON7) STALLED Interrupt Enable */ +#define USBC_UECON7_NREPLY (0x1u << 8) /**< \brief (USBC_UECON7) No Reply */ +#define USBC_UECON7_RAMACERE (0x1u << 11) /**< \brief (USBC_UECON7) RAMACER Interrupt Enable */ +#define USBC_UECON7_NBUSYBKE (0x1u << 12) /**< \brief (USBC_UECON7) Number of Busy Banks Interrupt Enable */ +#define USBC_UECON7_KILLBK (0x1u << 13) /**< \brief (USBC_UECON7) Kill IN Bank */ +#define USBC_UECON7_FIFOCON (0x1u << 14) /**< \brief (USBC_UECON7) FIFO Control */ +#define USBC_UECON7_NYETDIS (0x1u << 17) /**< \brief (USBC_UECON7) NYET Token Enable */ +#define USBC_UECON7_RSTDT (0x1u << 18) /**< \brief (USBC_UECON7) Reset Data Toggle */ +#define USBC_UECON7_STALLRQ (0x1u << 19) /**< \brief (USBC_UECON7) STALL Request */ +#define USBC_UECON7_BUSY0 (0x1u << 24) /**< \brief (USBC_UECON7) Busy Bank1 Enable */ +#define USBC_UECON7_BUSY1 (0x1u << 25) /**< \brief (USBC_UECON7) Busy Bank0 Enable */ +/* -------- USBC_UECON0SET : (USBC Offset: 0x1F0) Endpoint Control Set Register -------- */ +#define USBC_UECON0SET_TXINES (0x1u << 0) /**< \brief (USBC_UECON0SET) TXINE Set */ +#define USBC_UECON0SET_RXOUTES (0x1u << 1) /**< \brief (USBC_UECON0SET) RXOUTE Set */ +#define USBC_UECON0SET_RXSTPES (0x1u << 2) /**< \brief (USBC_UECON0SET) RXSTPE Set */ +#define USBC_UECON0SET_NAKOUTES (0x1u << 3) /**< \brief (USBC_UECON0SET) NAKOUTE Set */ +#define USBC_UECON0SET_NAKINES (0x1u << 4) /**< \brief (USBC_UECON0SET) NAKINE Set */ +#define USBC_UECON0SET_STALLEDES (0x1u << 6) /**< \brief (USBC_UECON0SET) STALLEDE Set */ +#define USBC_UECON0SET_NREPLYS (0x1u << 8) /**< \brief (USBC_UECON0SET) NREPLY Set */ +#define USBC_UECON0SET_RAMACERES (0x1u << 11) /**< \brief (USBC_UECON0SET) RAMACERE Set */ +#define USBC_UECON0SET_NBUSYBKES (0x1u << 12) /**< \brief (USBC_UECON0SET) NBUSYBKE Set */ +#define USBC_UECON0SET_KILLBKS (0x1u << 13) /**< \brief (USBC_UECON0SET) KILLBK Set */ +#define USBC_UECON0SET_NYETDISS (0x1u << 17) /**< \brief (USBC_UECON0SET) NYETDIS Set */ +#define USBC_UECON0SET_RSTDTS (0x1u << 18) /**< \brief (USBC_UECON0SET) RSTDT Set */ +#define USBC_UECON0SET_STALLRQS (0x1u << 19) /**< \brief (USBC_UECON0SET) STALLRQ Set */ +#define USBC_UECON0SET_BUSY0S (0x1u << 24) /**< \brief (USBC_UECON0SET) BUSY0 Set */ +#define USBC_UECON0SET_BUSY1S (0x1u << 25) /**< \brief (USBC_UECON0SET) BUSY1 Set */ +/* -------- USBC_UECON1SET : (USBC Offset: 0x1F4) Endpoint Control Set Register -------- */ +#define USBC_UECON1SET_TXINES (0x1u << 0) /**< \brief (USBC_UECON1SET) TXINE Set */ +#define USBC_UECON1SET_RXOUTES (0x1u << 1) /**< \brief (USBC_UECON1SET) RXOUTE Set */ +#define USBC_UECON1SET_RXSTPES (0x1u << 2) /**< \brief (USBC_UECON1SET) RXSTPE Set */ +#define USBC_UECON1SET_NAKOUTES (0x1u << 3) /**< \brief (USBC_UECON1SET) NAKOUTE Set */ +#define USBC_UECON1SET_NAKINES (0x1u << 4) /**< \brief (USBC_UECON1SET) NAKINE Set */ +#define USBC_UECON1SET_STALLEDES (0x1u << 6) /**< \brief (USBC_UECON1SET) STALLEDE Set */ +#define USBC_UECON1SET_NREPLYS (0x1u << 8) /**< \brief (USBC_UECON1SET) NREPLY Set */ +#define USBC_UECON1SET_RAMACERES (0x1u << 11) /**< \brief (USBC_UECON1SET) RAMACERE Set */ +#define USBC_UECON1SET_NBUSYBKES (0x1u << 12) /**< \brief (USBC_UECON1SET) NBUSYBKE Set */ +#define USBC_UECON1SET_KILLBKS (0x1u << 13) /**< \brief (USBC_UECON1SET) KILLBK Set */ +#define USBC_UECON1SET_NYETDISS (0x1u << 17) /**< \brief (USBC_UECON1SET) NYETDIS Set */ +#define USBC_UECON1SET_RSTDTS (0x1u << 18) /**< \brief (USBC_UECON1SET) RSTDT Set */ +#define USBC_UECON1SET_STALLRQS (0x1u << 19) /**< \brief (USBC_UECON1SET) STALLRQ Set */ +#define USBC_UECON1SET_BUSY0S (0x1u << 24) /**< \brief (USBC_UECON1SET) BUSY0 Set */ +#define USBC_UECON1SET_BUSY1S (0x1u << 25) /**< \brief (USBC_UECON1SET) BUSY1 Set */ +/* -------- USBC_UECON2SET : (USBC Offset: 0x1F8) Endpoint Control Set Register -------- */ +#define USBC_UECON2SET_TXINES (0x1u << 0) /**< \brief (USBC_UECON2SET) TXINE Set */ +#define USBC_UECON2SET_RXOUTES (0x1u << 1) /**< \brief (USBC_UECON2SET) RXOUTE Set */ +#define USBC_UECON2SET_RXSTPES (0x1u << 2) /**< \brief (USBC_UECON2SET) RXSTPE Set */ +#define USBC_UECON2SET_NAKOUTES (0x1u << 3) /**< \brief (USBC_UECON2SET) NAKOUTE Set */ +#define USBC_UECON2SET_NAKINES (0x1u << 4) /**< \brief (USBC_UECON2SET) NAKINE Set */ +#define USBC_UECON2SET_STALLEDES (0x1u << 6) /**< \brief (USBC_UECON2SET) STALLEDE Set */ +#define USBC_UECON2SET_NREPLYS (0x1u << 8) /**< \brief (USBC_UECON2SET) NREPLY Set */ +#define USBC_UECON2SET_RAMACERES (0x1u << 11) /**< \brief (USBC_UECON2SET) RAMACERE Set */ +#define USBC_UECON2SET_NBUSYBKES (0x1u << 12) /**< \brief (USBC_UECON2SET) NBUSYBKE Set */ +#define USBC_UECON2SET_KILLBKS (0x1u << 13) /**< \brief (USBC_UECON2SET) KILLBK Set */ +#define USBC_UECON2SET_NYETDISS (0x1u << 17) /**< \brief (USBC_UECON2SET) NYETDIS Set */ +#define USBC_UECON2SET_RSTDTS (0x1u << 18) /**< \brief (USBC_UECON2SET) RSTDT Set */ +#define USBC_UECON2SET_STALLRQS (0x1u << 19) /**< \brief (USBC_UECON2SET) STALLRQ Set */ +#define USBC_UECON2SET_BUSY0S (0x1u << 24) /**< \brief (USBC_UECON2SET) BUSY0 Set */ +#define USBC_UECON2SET_BUSY1S (0x1u << 25) /**< \brief (USBC_UECON2SET) BUSY1 Set */ +/* -------- USBC_UECON3SET : (USBC Offset: 0x1FC) Endpoint Control Set Register -------- */ +#define USBC_UECON3SET_TXINES (0x1u << 0) /**< \brief (USBC_UECON3SET) TXINE Set */ +#define USBC_UECON3SET_RXOUTES (0x1u << 1) /**< \brief (USBC_UECON3SET) RXOUTE Set */ +#define USBC_UECON3SET_RXSTPES (0x1u << 2) /**< \brief (USBC_UECON3SET) RXSTPE Set */ +#define USBC_UECON3SET_NAKOUTES (0x1u << 3) /**< \brief (USBC_UECON3SET) NAKOUTE Set */ +#define USBC_UECON3SET_NAKINES (0x1u << 4) /**< \brief (USBC_UECON3SET) NAKINE Set */ +#define USBC_UECON3SET_STALLEDES (0x1u << 6) /**< \brief (USBC_UECON3SET) STALLEDE Set */ +#define USBC_UECON3SET_NREPLYS (0x1u << 8) /**< \brief (USBC_UECON3SET) NREPLY Set */ +#define USBC_UECON3SET_RAMACERES (0x1u << 11) /**< \brief (USBC_UECON3SET) RAMACERE Set */ +#define USBC_UECON3SET_NBUSYBKES (0x1u << 12) /**< \brief (USBC_UECON3SET) NBUSYBKE Set */ +#define USBC_UECON3SET_KILLBKS (0x1u << 13) /**< \brief (USBC_UECON3SET) KILLBK Set */ +#define USBC_UECON3SET_NYETDISS (0x1u << 17) /**< \brief (USBC_UECON3SET) NYETDIS Set */ +#define USBC_UECON3SET_RSTDTS (0x1u << 18) /**< \brief (USBC_UECON3SET) RSTDT Set */ +#define USBC_UECON3SET_STALLRQS (0x1u << 19) /**< \brief (USBC_UECON3SET) STALLRQ Set */ +#define USBC_UECON3SET_BUSY0S (0x1u << 24) /**< \brief (USBC_UECON3SET) BUSY0 Set */ +#define USBC_UECON3SET_BUSY1S (0x1u << 25) /**< \brief (USBC_UECON3SET) BUSY1 Set */ +/* -------- USBC_UECON4SET : (USBC Offset: 0x200) Endpoint Control Set Register -------- */ +#define USBC_UECON4SET_TXINES (0x1u << 0) /**< \brief (USBC_UECON4SET) TXINE Set */ +#define USBC_UECON4SET_RXOUTES (0x1u << 1) /**< \brief (USBC_UECON4SET) RXOUTE Set */ +#define USBC_UECON4SET_RXSTPES (0x1u << 2) /**< \brief (USBC_UECON4SET) RXSTPE Set */ +#define USBC_UECON4SET_NAKOUTES (0x1u << 3) /**< \brief (USBC_UECON4SET) NAKOUTE Set */ +#define USBC_UECON4SET_NAKINES (0x1u << 4) /**< \brief (USBC_UECON4SET) NAKINE Set */ +#define USBC_UECON4SET_STALLEDES (0x1u << 6) /**< \brief (USBC_UECON4SET) STALLEDE Set */ +#define USBC_UECON4SET_NREPLYS (0x1u << 8) /**< \brief (USBC_UECON4SET) NREPLY Set */ +#define USBC_UECON4SET_RAMACERES (0x1u << 11) /**< \brief (USBC_UECON4SET) RAMACERE Set */ +#define USBC_UECON4SET_NBUSYBKES (0x1u << 12) /**< \brief (USBC_UECON4SET) NBUSYBKE Set */ +#define USBC_UECON4SET_KILLBKS (0x1u << 13) /**< \brief (USBC_UECON4SET) KILLBK Set */ +#define USBC_UECON4SET_NYETDISS (0x1u << 17) /**< \brief (USBC_UECON4SET) NYETDIS Set */ +#define USBC_UECON4SET_RSTDTS (0x1u << 18) /**< \brief (USBC_UECON4SET) RSTDT Set */ +#define USBC_UECON4SET_STALLRQS (0x1u << 19) /**< \brief (USBC_UECON4SET) STALLRQ Set */ +#define USBC_UECON4SET_BUSY0S (0x1u << 24) /**< \brief (USBC_UECON4SET) BUSY0 Set */ +#define USBC_UECON4SET_BUSY1S (0x1u << 25) /**< \brief (USBC_UECON4SET) BUSY1 Set */ +/* -------- USBC_UECON5SET : (USBC Offset: 0x204) Endpoint Control Set Register -------- */ +#define USBC_UECON5SET_TXINES (0x1u << 0) /**< \brief (USBC_UECON5SET) TXINE Set */ +#define USBC_UECON5SET_RXOUTES (0x1u << 1) /**< \brief (USBC_UECON5SET) RXOUTE Set */ +#define USBC_UECON5SET_RXSTPES (0x1u << 2) /**< \brief (USBC_UECON5SET) RXSTPE Set */ +#define USBC_UECON5SET_NAKOUTES (0x1u << 3) /**< \brief (USBC_UECON5SET) NAKOUTE Set */ +#define USBC_UECON5SET_NAKINES (0x1u << 4) /**< \brief (USBC_UECON5SET) NAKINE Set */ +#define USBC_UECON5SET_STALLEDES (0x1u << 6) /**< \brief (USBC_UECON5SET) STALLEDE Set */ +#define USBC_UECON5SET_NREPLYS (0x1u << 8) /**< \brief (USBC_UECON5SET) NREPLY Set */ +#define USBC_UECON5SET_RAMACERES (0x1u << 11) /**< \brief (USBC_UECON5SET) RAMACERE Set */ +#define USBC_UECON5SET_NBUSYBKES (0x1u << 12) /**< \brief (USBC_UECON5SET) NBUSYBKE Set */ +#define USBC_UECON5SET_KILLBKS (0x1u << 13) /**< \brief (USBC_UECON5SET) KILLBK Set */ +#define USBC_UECON5SET_NYETDISS (0x1u << 17) /**< \brief (USBC_UECON5SET) NYETDIS Set */ +#define USBC_UECON5SET_RSTDTS (0x1u << 18) /**< \brief (USBC_UECON5SET) RSTDT Set */ +#define USBC_UECON5SET_STALLRQS (0x1u << 19) /**< \brief (USBC_UECON5SET) STALLRQ Set */ +#define USBC_UECON5SET_BUSY0S (0x1u << 24) /**< \brief (USBC_UECON5SET) BUSY0 Set */ +#define USBC_UECON5SET_BUSY1S (0x1u << 25) /**< \brief (USBC_UECON5SET) BUSY1 Set */ +/* -------- USBC_UECON6SET : (USBC Offset: 0x208) Endpoint Control Set Register -------- */ +#define USBC_UECON6SET_TXINES (0x1u << 0) /**< \brief (USBC_UECON6SET) TXINE Set */ +#define USBC_UECON6SET_RXOUTES (0x1u << 1) /**< \brief (USBC_UECON6SET) RXOUTE Set */ +#define USBC_UECON6SET_RXSTPES (0x1u << 2) /**< \brief (USBC_UECON6SET) RXSTPE Set */ +#define USBC_UECON6SET_NAKOUTES (0x1u << 3) /**< \brief (USBC_UECON6SET) NAKOUTE Set */ +#define USBC_UECON6SET_NAKINES (0x1u << 4) /**< \brief (USBC_UECON6SET) NAKINE Set */ +#define USBC_UECON6SET_STALLEDES (0x1u << 6) /**< \brief (USBC_UECON6SET) STALLEDE Set */ +#define USBC_UECON6SET_NREPLYS (0x1u << 8) /**< \brief (USBC_UECON6SET) NREPLY Set */ +#define USBC_UECON6SET_RAMACERES (0x1u << 11) /**< \brief (USBC_UECON6SET) RAMACERE Set */ +#define USBC_UECON6SET_NBUSYBKES (0x1u << 12) /**< \brief (USBC_UECON6SET) NBUSYBKE Set */ +#define USBC_UECON6SET_KILLBKS (0x1u << 13) /**< \brief (USBC_UECON6SET) KILLBK Set */ +#define USBC_UECON6SET_NYETDISS (0x1u << 17) /**< \brief (USBC_UECON6SET) NYETDIS Set */ +#define USBC_UECON6SET_RSTDTS (0x1u << 18) /**< \brief (USBC_UECON6SET) RSTDT Set */ +#define USBC_UECON6SET_STALLRQS (0x1u << 19) /**< \brief (USBC_UECON6SET) STALLRQ Set */ +#define USBC_UECON6SET_BUSY0S (0x1u << 24) /**< \brief (USBC_UECON6SET) BUSY0 Set */ +#define USBC_UECON6SET_BUSY1S (0x1u << 25) /**< \brief (USBC_UECON6SET) BUSY1 Set */ +/* -------- USBC_UECON7SET : (USBC Offset: 0x20C) Endpoint Control Set Register -------- */ +#define USBC_UECON7SET_TXINES (0x1u << 0) /**< \brief (USBC_UECON7SET) TXINE Set */ +#define USBC_UECON7SET_RXOUTES (0x1u << 1) /**< \brief (USBC_UECON7SET) RXOUTE Set */ +#define USBC_UECON7SET_RXSTPES (0x1u << 2) /**< \brief (USBC_UECON7SET) RXSTPE Set */ +#define USBC_UECON7SET_NAKOUTES (0x1u << 3) /**< \brief (USBC_UECON7SET) NAKOUTE Set */ +#define USBC_UECON7SET_NAKINES (0x1u << 4) /**< \brief (USBC_UECON7SET) NAKINE Set */ +#define USBC_UECON7SET_STALLEDES (0x1u << 6) /**< \brief (USBC_UECON7SET) STALLEDE Set */ +#define USBC_UECON7SET_NREPLYS (0x1u << 8) /**< \brief (USBC_UECON7SET) NREPLY Set */ +#define USBC_UECON7SET_RAMACERES (0x1u << 11) /**< \brief (USBC_UECON7SET) RAMACERE Set */ +#define USBC_UECON7SET_NBUSYBKES (0x1u << 12) /**< \brief (USBC_UECON7SET) NBUSYBKE Set */ +#define USBC_UECON7SET_KILLBKS (0x1u << 13) /**< \brief (USBC_UECON7SET) KILLBK Set */ +#define USBC_UECON7SET_NYETDISS (0x1u << 17) /**< \brief (USBC_UECON7SET) NYETDIS Set */ +#define USBC_UECON7SET_RSTDTS (0x1u << 18) /**< \brief (USBC_UECON7SET) RSTDT Set */ +#define USBC_UECON7SET_STALLRQS (0x1u << 19) /**< \brief (USBC_UECON7SET) STALLRQ Set */ +#define USBC_UECON7SET_BUSY0S (0x1u << 24) /**< \brief (USBC_UECON7SET) BUSY0 Set */ +#define USBC_UECON7SET_BUSY1S (0x1u << 25) /**< \brief (USBC_UECON7SET) BUSY1 Set */ +/* -------- USBC_UECON0CLR : (USBC Offset: 0x220) Endpoint Control Clear Register -------- */ +#define USBC_UECON0CLR_TXINEC (0x1u << 0) /**< \brief (USBC_UECON0CLR) TXINE Clear */ +#define USBC_UECON0CLR_RXOUTEC (0x1u << 1) /**< \brief (USBC_UECON0CLR) RXOUTE Clear */ +#define USBC_UECON0CLR_RXSTPEC (0x1u << 2) /**< \brief (USBC_UECON0CLR) RXSTPE Clear */ +#define USBC_UECON0CLR_NAKOUTEC (0x1u << 3) /**< \brief (USBC_UECON0CLR) NAKOUTE Clear */ +#define USBC_UECON0CLR_NAKINEC (0x1u << 4) /**< \brief (USBC_UECON0CLR) NAKINE Clear */ +#define USBC_UECON0CLR_STALLEDEC (0x1u << 6) /**< \brief (USBC_UECON0CLR) STALLEDE Clear */ +#define USBC_UECON0CLR_NREPLYC (0x1u << 8) /**< \brief (USBC_UECON0CLR) NREPLY Clear */ +#define USBC_UECON0CLR_RAMACEREC (0x1u << 11) /**< \brief (USBC_UECON0CLR) RAMACERE Clear */ +#define USBC_UECON0CLR_NBUSYBKEC (0x1u << 12) /**< \brief (USBC_UECON0CLR) NBUSYBKE Clear */ +#define USBC_UECON0CLR_FIFOCONC (0x1u << 14) /**< \brief (USBC_UECON0CLR) FIFOCON Clear */ +#define USBC_UECON0CLR_NYETDISC (0x1u << 17) /**< \brief (USBC_UECON0CLR) NYETDIS Clear */ +#define USBC_UECON0CLR_STALLRQC (0x1u << 19) /**< \brief (USBC_UECON0CLR) STALLRQ Clear */ +#define USBC_UECON0CLR_BUSY0C (0x1u << 24) /**< \brief (USBC_UECON0CLR) BUSY0 Clear */ +#define USBC_UECON0CLR_BUSY1C (0x1u << 25) /**< \brief (USBC_UECON0CLR) BUSY1 Clear */ +/* -------- USBC_UECON1CLR : (USBC Offset: 0x224) TXINE Clear -------- */ +#define USBC_UECON1CLR_TXINEC (0x1u << 0) /**< \brief (USBC_UECON1CLR) TXINE Clear */ +#define USBC_UECON1CLR_RXOUTEC (0x1u << 1) /**< \brief (USBC_UECON1CLR) RXOUTE Clear */ +#define USBC_UECON1CLR_RXSTPEC (0x1u << 2) /**< \brief (USBC_UECON1CLR) RXOUTE Clear */ +#define USBC_UECON1CLR_NAKOUTEC (0x1u << 3) /**< \brief (USBC_UECON1CLR) NAKOUTE Clear */ +#define USBC_UECON1CLR_NAKINEC (0x1u << 4) /**< \brief (USBC_UECON1CLR) NAKINE Clear */ +#define USBC_UECON1CLR_STALLEDEC (0x1u << 6) /**< \brief (USBC_UECON1CLR) RXSTPE Clear */ +#define USBC_UECON1CLR_NREPLYC (0x1u << 8) /**< \brief (USBC_UECON1CLR) NREPLY Clear */ +#define USBC_UECON1CLR_RAMACEREC (0x1u << 11) /**< \brief (USBC_UECON1CLR) RAMACERE Clear */ +#define USBC_UECON1CLR_NBUSYBKEC (0x1u << 12) /**< \brief (USBC_UECON1CLR) NBUSYBKE Clear */ +#define USBC_UECON1CLR_FIFOCONC (0x1u << 14) /**< \brief (USBC_UECON1CLR) FIFOCON Clear */ +#define USBC_UECON1CLR_NYETDISC (0x1u << 17) /**< \brief (USBC_UECON1CLR) NYETDIS Clear */ +#define USBC_UECON1CLR_STALLRQC (0x1u << 19) /**< \brief (USBC_UECON1CLR) STALLEDE Clear */ +#define USBC_UECON1CLR_BUSY0C (0x1u << 24) /**< \brief (USBC_UECON1CLR) BUSY0 Clear */ +#define USBC_UECON1CLR_BUSY1C (0x1u << 25) /**< \brief (USBC_UECON1CLR) BUSY1 Clear */ +/* -------- USBC_UECON2CLR : (USBC Offset: 0x228) TXINE Clear -------- */ +#define USBC_UECON2CLR_TXINEC (0x1u << 0) /**< \brief (USBC_UECON2CLR) TXINE Clear */ +#define USBC_UECON2CLR_RXOUTEC (0x1u << 1) /**< \brief (USBC_UECON2CLR) RXOUTE Clear */ +#define USBC_UECON2CLR_RXSTPEC (0x1u << 2) /**< \brief (USBC_UECON2CLR) RXOUTE Clear */ +#define USBC_UECON2CLR_NAKOUTEC (0x1u << 3) /**< \brief (USBC_UECON2CLR) NAKOUTE Clear */ +#define USBC_UECON2CLR_NAKINEC (0x1u << 4) /**< \brief (USBC_UECON2CLR) NAKINE Clear */ +#define USBC_UECON2CLR_STALLEDEC (0x1u << 6) /**< \brief (USBC_UECON2CLR) RXSTPE Clear */ +#define USBC_UECON2CLR_NREPLYC (0x1u << 8) /**< \brief (USBC_UECON2CLR) NREPLY Clear */ +#define USBC_UECON2CLR_RAMACEREC (0x1u << 11) /**< \brief (USBC_UECON2CLR) RAMACERE Clear */ +#define USBC_UECON2CLR_NBUSYBKEC (0x1u << 12) /**< \brief (USBC_UECON2CLR) NBUSYBKE Clear */ +#define USBC_UECON2CLR_FIFOCONC (0x1u << 14) /**< \brief (USBC_UECON2CLR) FIFOCON Clear */ +#define USBC_UECON2CLR_NYETDISC (0x1u << 17) /**< \brief (USBC_UECON2CLR) NYETDIS Clear */ +#define USBC_UECON2CLR_STALLRQC (0x1u << 19) /**< \brief (USBC_UECON2CLR) STALLEDE Clear */ +#define USBC_UECON2CLR_BUSY0C (0x1u << 24) /**< \brief (USBC_UECON2CLR) BUSY0 Clear */ +#define USBC_UECON2CLR_BUSY1C (0x1u << 25) /**< \brief (USBC_UECON2CLR) BUSY1 Clear */ +/* -------- USBC_UECON3CLR : (USBC Offset: 0x22C) TXINE Clear -------- */ +#define USBC_UECON3CLR_TXINEC (0x1u << 0) /**< \brief (USBC_UECON3CLR) TXINE Clear */ +#define USBC_UECON3CLR_RXOUTEC (0x1u << 1) /**< \brief (USBC_UECON3CLR) RXOUTE Clear */ +#define USBC_UECON3CLR_RXSTPEC (0x1u << 2) /**< \brief (USBC_UECON3CLR) RXOUTE Clear */ +#define USBC_UECON3CLR_NAKOUTEC (0x1u << 3) /**< \brief (USBC_UECON3CLR) NAKOUTE Clear */ +#define USBC_UECON3CLR_NAKINEC (0x1u << 4) /**< \brief (USBC_UECON3CLR) NAKINE Clear */ +#define USBC_UECON3CLR_STALLEDEC (0x1u << 6) /**< \brief (USBC_UECON3CLR) RXSTPE Clear */ +#define USBC_UECON3CLR_NREPLYC (0x1u << 8) /**< \brief (USBC_UECON3CLR) NREPLY Clear */ +#define USBC_UECON3CLR_RAMACEREC (0x1u << 11) /**< \brief (USBC_UECON3CLR) RAMACERE Clear */ +#define USBC_UECON3CLR_NBUSYBKEC (0x1u << 12) /**< \brief (USBC_UECON3CLR) NBUSYBKE Clear */ +#define USBC_UECON3CLR_FIFOCONC (0x1u << 14) /**< \brief (USBC_UECON3CLR) FIFOCON Clear */ +#define USBC_UECON3CLR_NYETDISC (0x1u << 17) /**< \brief (USBC_UECON3CLR) NYETDIS Clear */ +#define USBC_UECON3CLR_STALLRQC (0x1u << 19) /**< \brief (USBC_UECON3CLR) STALLEDE Clear */ +#define USBC_UECON3CLR_BUSY0C (0x1u << 24) /**< \brief (USBC_UECON3CLR) BUSY0 Clear */ +#define USBC_UECON3CLR_BUSY1C (0x1u << 25) /**< \brief (USBC_UECON3CLR) BUSY1 Clear */ +/* -------- USBC_UECON4CLR : (USBC Offset: 0x230) TXINE Clear -------- */ +#define USBC_UECON4CLR_TXINEC (0x1u << 0) /**< \brief (USBC_UECON4CLR) TXINE Clear */ +#define USBC_UECON4CLR_RXOUTEC (0x1u << 1) /**< \brief (USBC_UECON4CLR) RXOUTE Clear */ +#define USBC_UECON4CLR_RXSTPEC (0x1u << 2) /**< \brief (USBC_UECON4CLR) RXOUTE Clear */ +#define USBC_UECON4CLR_NAKOUTEC (0x1u << 3) /**< \brief (USBC_UECON4CLR) NAKOUTE Clear */ +#define USBC_UECON4CLR_NAKINEC (0x1u << 4) /**< \brief (USBC_UECON4CLR) NAKINE Clear */ +#define USBC_UECON4CLR_STALLEDEC (0x1u << 6) /**< \brief (USBC_UECON4CLR) RXSTPE Clear */ +#define USBC_UECON4CLR_NREPLYC (0x1u << 8) /**< \brief (USBC_UECON4CLR) NREPLY Clear */ +#define USBC_UECON4CLR_RAMACEREC (0x1u << 11) /**< \brief (USBC_UECON4CLR) RAMACERE Clear */ +#define USBC_UECON4CLR_NBUSYBKEC (0x1u << 12) /**< \brief (USBC_UECON4CLR) NBUSYBKE Clear */ +#define USBC_UECON4CLR_FIFOCONC (0x1u << 14) /**< \brief (USBC_UECON4CLR) FIFOCON Clear */ +#define USBC_UECON4CLR_NYETDISC (0x1u << 17) /**< \brief (USBC_UECON4CLR) NYETDIS Clear */ +#define USBC_UECON4CLR_STALLRQC (0x1u << 19) /**< \brief (USBC_UECON4CLR) STALLEDE Clear */ +#define USBC_UECON4CLR_BUSY0C (0x1u << 24) /**< \brief (USBC_UECON4CLR) BUSY0 Clear */ +#define USBC_UECON4CLR_BUSY1C (0x1u << 25) /**< \brief (USBC_UECON4CLR) BUSY1 Clear */ +/* -------- USBC_UECON5CLR : (USBC Offset: 0x234) TXINE Clear -------- */ +#define USBC_UECON5CLR_TXINEC (0x1u << 0) /**< \brief (USBC_UECON5CLR) TXINE Clear */ +#define USBC_UECON5CLR_RXOUTEC (0x1u << 1) /**< \brief (USBC_UECON5CLR) RXOUTE Clear */ +#define USBC_UECON5CLR_RXSTPEC (0x1u << 2) /**< \brief (USBC_UECON5CLR) RXOUTE Clear */ +#define USBC_UECON5CLR_NAKOUTEC (0x1u << 3) /**< \brief (USBC_UECON5CLR) NAKOUTE Clear */ +#define USBC_UECON5CLR_NAKINEC (0x1u << 4) /**< \brief (USBC_UECON5CLR) NAKINE Clear */ +#define USBC_UECON5CLR_STALLEDEC (0x1u << 6) /**< \brief (USBC_UECON5CLR) RXSTPE Clear */ +#define USBC_UECON5CLR_NREPLYC (0x1u << 8) /**< \brief (USBC_UECON5CLR) NREPLY Clear */ +#define USBC_UECON5CLR_RAMACEREC (0x1u << 11) /**< \brief (USBC_UECON5CLR) RAMACERE Clear */ +#define USBC_UECON5CLR_NBUSYBKEC (0x1u << 12) /**< \brief (USBC_UECON5CLR) NBUSYBKE Clear */ +#define USBC_UECON5CLR_FIFOCONC (0x1u << 14) /**< \brief (USBC_UECON5CLR) FIFOCON Clear */ +#define USBC_UECON5CLR_NYETDISC (0x1u << 17) /**< \brief (USBC_UECON5CLR) NYETDIS Clear */ +#define USBC_UECON5CLR_STALLRQC (0x1u << 19) /**< \brief (USBC_UECON5CLR) STALLEDE Clear */ +#define USBC_UECON5CLR_BUSY0C (0x1u << 24) /**< \brief (USBC_UECON5CLR) BUSY0 Clear */ +#define USBC_UECON5CLR_BUSY1C (0x1u << 25) /**< \brief (USBC_UECON5CLR) BUSY1 Clear */ +/* -------- USBC_UECON6CLR : (USBC Offset: 0x238) TXINE Clear -------- */ +#define USBC_UECON6CLR_TXINEC (0x1u << 0) /**< \brief (USBC_UECON6CLR) TXINE Clear */ +#define USBC_UECON6CLR_RXOUTEC (0x1u << 1) /**< \brief (USBC_UECON6CLR) RXOUTE Clear */ +#define USBC_UECON6CLR_RXSTPEC (0x1u << 2) /**< \brief (USBC_UECON6CLR) RXOUTE Clear */ +#define USBC_UECON6CLR_NAKOUTEC (0x1u << 3) /**< \brief (USBC_UECON6CLR) NAKOUTE Clear */ +#define USBC_UECON6CLR_NAKINEC (0x1u << 4) /**< \brief (USBC_UECON6CLR) NAKINE Clear */ +#define USBC_UECON6CLR_STALLEDEC (0x1u << 6) /**< \brief (USBC_UECON6CLR) RXSTPE Clear */ +#define USBC_UECON6CLR_NREPLYC (0x1u << 8) /**< \brief (USBC_UECON6CLR) NREPLY Clear */ +#define USBC_UECON6CLR_RAMACEREC (0x1u << 11) /**< \brief (USBC_UECON6CLR) RAMACERE Clear */ +#define USBC_UECON6CLR_NBUSYBKEC (0x1u << 12) /**< \brief (USBC_UECON6CLR) NBUSYBKE Clear */ +#define USBC_UECON6CLR_FIFOCONC (0x1u << 14) /**< \brief (USBC_UECON6CLR) FIFOCON Clear */ +#define USBC_UECON6CLR_NYETDISC (0x1u << 17) /**< \brief (USBC_UECON6CLR) NYETDIS Clear */ +#define USBC_UECON6CLR_STALLRQC (0x1u << 19) /**< \brief (USBC_UECON6CLR) STALLEDE Clear */ +#define USBC_UECON6CLR_BUSY0C (0x1u << 24) /**< \brief (USBC_UECON6CLR) BUSY0 Clear */ +#define USBC_UECON6CLR_BUSY1C (0x1u << 25) /**< \brief (USBC_UECON6CLR) BUSY1 Clear */ +/* -------- USBC_UECON7CLR : (USBC Offset: 0x23C) TXINE Clear -------- */ +#define USBC_UECON7CLR_TXINEC (0x1u << 0) /**< \brief (USBC_UECON7CLR) TXINE Clear */ +#define USBC_UECON7CLR_RXOUTEC (0x1u << 1) /**< \brief (USBC_UECON7CLR) RXOUTE Clear */ +#define USBC_UECON7CLR_RXSTPEC (0x1u << 2) /**< \brief (USBC_UECON7CLR) RXOUTE Clear */ +#define USBC_UECON7CLR_NAKOUTEC (0x1u << 3) /**< \brief (USBC_UECON7CLR) NAKOUTE Clear */ +#define USBC_UECON7CLR_NAKINEC (0x1u << 4) /**< \brief (USBC_UECON7CLR) NAKINE Clear */ +#define USBC_UECON7CLR_STALLEDEC (0x1u << 6) /**< \brief (USBC_UECON7CLR) RXSTPE Clear */ +#define USBC_UECON7CLR_NREPLYC (0x1u << 8) /**< \brief (USBC_UECON7CLR) NREPLY Clear */ +#define USBC_UECON7CLR_RAMACEREC (0x1u << 11) /**< \brief (USBC_UECON7CLR) RAMACERE Clear */ +#define USBC_UECON7CLR_NBUSYBKEC (0x1u << 12) /**< \brief (USBC_UECON7CLR) NBUSYBKE Clear */ +#define USBC_UECON7CLR_FIFOCONC (0x1u << 14) /**< \brief (USBC_UECON7CLR) FIFOCON Clear */ +#define USBC_UECON7CLR_NYETDISC (0x1u << 17) /**< \brief (USBC_UECON7CLR) NYETDIS Clear */ +#define USBC_UECON7CLR_STALLRQC (0x1u << 19) /**< \brief (USBC_UECON7CLR) STALLEDE Clear */ +#define USBC_UECON7CLR_BUSY0C (0x1u << 24) /**< \brief (USBC_UECON7CLR) BUSY0 Clear */ +#define USBC_UECON7CLR_BUSY1C (0x1u << 25) /**< \brief (USBC_UECON7CLR) BUSY1 Clear */ +/* -------- USBC_UHCON : (USBC Offset: 0x400) Host General Control Register -------- */ +#define USBC_UHCON_SOFE (0x1u << 8) /**< \brief (USBC_UHCON) SOF Enable */ +#define USBC_UHCON_RESET (0x1u << 9) /**< \brief (USBC_UHCON) Send USB Reset */ +#define USBC_UHCON_RESUME (0x1u << 10) /**< \brief (USBC_UHCON) Send USB Resume */ +#define USBC_UHCON_SPDCONF_Pos 12 +#define USBC_UHCON_SPDCONF_Msk (0x3u << USBC_UHCON_SPDCONF_Pos) /**< \brief (USBC_UHCON) Speed Configuration */ +#define USBC_UHCON_SPDCONF(value) ((USBC_UHCON_SPDCONF_Msk & ((value) << USBC_UHCON_SPDCONF_Pos))) +#define USBC_UHCON_TSTJ (0x1u << 16) /**< \brief (USBC_UHCON) Test J */ +#define USBC_UHCON_TSTK (0x1u << 17) /**< \brief (USBC_UHCON) Test K */ +/* -------- USBC_UHINT : (USBC Offset: 0x404) Host Global Interrupt Register -------- */ +#define USBC_UHINT_DCONNI (0x1u << 0) /**< \brief (USBC_UHINT) Device Connection Interrupt */ +#define USBC_UHINT_DDISCI (0x1u << 1) /**< \brief (USBC_UHINT) Device Disconnection Interrupt */ +#define USBC_UHINT_RSTI (0x1u << 2) /**< \brief (USBC_UHINT) USB Reset Sent Interrupt */ +#define USBC_UHINT_RSMEDI (0x1u << 3) /**< \brief (USBC_UHINT) Downstream Resume Sent Interrupt */ +#define USBC_UHINT_RXRSMI (0x1u << 4) /**< \brief (USBC_UHINT) Upstream Resume Received Interrupt */ +#define USBC_UHINT_HSOFI (0x1u << 5) /**< \brief (USBC_UHINT) Host SOF Interrupt */ +#define USBC_UHINT_HWUPI (0x1u << 6) /**< \brief (USBC_UHINT) Host Wake-Up Interrupt */ +#define USBC_UHINT_P0INT (0x1u << 8) /**< \brief (USBC_UHINT) Pipe 0 Interrupt */ +#define USBC_UHINT_P1INT (0x1u << 9) /**< \brief (USBC_UHINT) Pipe 1 Interrupt */ +#define USBC_UHINT_P2INT (0x1u << 10) /**< \brief (USBC_UHINT) Pipe 2 Interrupt */ +#define USBC_UHINT_P3INT (0x1u << 11) /**< \brief (USBC_UHINT) Pipe 3 Interrupt */ +#define USBC_UHINT_P4INT (0x1u << 12) /**< \brief (USBC_UHINT) Pipe 4 Interrupt */ +#define USBC_UHINT_P5INT (0x1u << 13) /**< \brief (USBC_UHINT) Pipe 5 Interrupt */ +#define USBC_UHINT_P6INT (0x1u << 14) /**< \brief (USBC_UHINT) Pipe 6 Interrupt */ +/* -------- USBC_UHINTCLR : (USBC Offset: 0x408) Host Global Interrrupt Clear Register -------- */ +#define USBC_UHINTCLR_DCONNIC (0x1u << 0) /**< \brief (USBC_UHINTCLR) DCONNI Clear */ +#define USBC_UHINTCLR_DDISCIC (0x1u << 1) /**< \brief (USBC_UHINTCLR) DDISCI Clear */ +#define USBC_UHINTCLR_RSTIC (0x1u << 2) /**< \brief (USBC_UHINTCLR) RSTI Clear */ +#define USBC_UHINTCLR_RSMEDIC (0x1u << 3) /**< \brief (USBC_UHINTCLR) RSMEDI Clear */ +#define USBC_UHINTCLR_RXRSMIC (0x1u << 4) /**< \brief (USBC_UHINTCLR) RXRSMI Clear */ +#define USBC_UHINTCLR_HSOFIC (0x1u << 5) /**< \brief (USBC_UHINTCLR) HSOFI Clear */ +#define USBC_UHINTCLR_HWUPIC (0x1u << 6) /**< \brief (USBC_UHINTCLR) HWUPI Clear */ +/* -------- USBC_UHINTSET : (USBC Offset: 0x40C) Host Global Interrupt Set Register -------- */ +#define USBC_UHINTSET_DCONNIS (0x1u << 0) /**< \brief (USBC_UHINTSET) DCONNI Set */ +#define USBC_UHINTSET_DDISCIS (0x1u << 1) /**< \brief (USBC_UHINTSET) DDISCI Set */ +#define USBC_UHINTSET_RSTIS (0x1u << 2) /**< \brief (USBC_UHINTSET) RSTI Set */ +#define USBC_UHINTSET_RSMEDIS (0x1u << 3) /**< \brief (USBC_UHINTSET) RSMEDI Set */ +#define USBC_UHINTSET_RXRSMIS (0x1u << 4) /**< \brief (USBC_UHINTSET) RXRSMI Set */ +#define USBC_UHINTSET_HSOFIS (0x1u << 5) /**< \brief (USBC_UHINTSET) HSOFI Set */ +#define USBC_UHINTSET_HWUPIS (0x1u << 6) /**< \brief (USBC_UHINTSET) HWUPI Set */ +/* -------- USBC_UHINTE : (USBC Offset: 0x410) Host Global Interrupt Enable Register -------- */ +#define USBC_UHINTE_DCONNIE (0x1u << 0) /**< \brief (USBC_UHINTE) DCONNI Enable */ +#define USBC_UHINTE_DDISCIE (0x1u << 1) /**< \brief (USBC_UHINTE) DDISCI Enable */ +#define USBC_UHINTE_RSTIE (0x1u << 2) /**< \brief (USBC_UHINTE) RSTI Enable */ +#define USBC_UHINTE_RSMEDIE (0x1u << 3) /**< \brief (USBC_UHINTE) RSMEDI Enable */ +#define USBC_UHINTE_RXRSMIE (0x1u << 4) /**< \brief (USBC_UHINTE) RXRSMI Enable */ +#define USBC_UHINTE_HSOFIE (0x1u << 5) /**< \brief (USBC_UHINTE) HSOFI Enable */ +#define USBC_UHINTE_HWUPIE (0x1u << 6) /**< \brief (USBC_UHINTE) HWUPI Enable */ +#define USBC_UHINTE_P0INTE (0x1u << 8) /**< \brief (USBC_UHINTE) P0INT Enable */ +#define USBC_UHINTE_P1INTE (0x1u << 9) /**< \brief (USBC_UHINTE) P1INT Enable */ +#define USBC_UHINTE_P2INTE (0x1u << 10) /**< \brief (USBC_UHINTE) P2INT Enable */ +#define USBC_UHINTE_P3INTE (0x1u << 11) /**< \brief (USBC_UHINTE) P3INT Enable */ +#define USBC_UHINTE_P4INTE (0x1u << 12) /**< \brief (USBC_UHINTE) P4INT Enable */ +#define USBC_UHINTE_P5INTE (0x1u << 13) /**< \brief (USBC_UHINTE) P5INT Enable */ +#define USBC_UHINTE_P6INTE (0x1u << 14) /**< \brief (USBC_UHINTE) P6INT Enable */ +#define USBC_UHINTE_P7INTE (0x1u << 15) /**< \brief (USBC_UHINTE) P7INT Enable */ +/* -------- USBC_UHINTECLR : (USBC Offset: 0x414) Host Global Interrupt Enable Clear Register -------- */ +#define USBC_UHINTECLR_DCONNIEC (0x1u << 0) /**< \brief (USBC_UHINTECLR) DCONNIE Clear */ +#define USBC_UHINTECLR_DDISCIEC (0x1u << 1) /**< \brief (USBC_UHINTECLR) DDISCIE Clear */ +#define USBC_UHINTECLR_RSTIEC (0x1u << 2) /**< \brief (USBC_UHINTECLR) RSTIE Clear */ +#define USBC_UHINTECLR_RSMEDIEC (0x1u << 3) /**< \brief (USBC_UHINTECLR) RSMEDIE Clear */ +#define USBC_UHINTECLR_RXRSMIEC (0x1u << 4) /**< \brief (USBC_UHINTECLR) RXRSMIE Clear */ +#define USBC_UHINTECLR_HSOFIEC (0x1u << 5) /**< \brief (USBC_UHINTECLR) HSOFIE Clear */ +#define USBC_UHINTECLR_HWUPIEC (0x1u << 6) /**< \brief (USBC_UHINTECLR) HWUPIE Clear */ +#define USBC_UHINTECLR_P0INTEC (0x1u << 8) /**< \brief (USBC_UHINTECLR) P0INTE Clear */ +#define USBC_UHINTECLR_P1INTEC (0x1u << 9) /**< \brief (USBC_UHINTECLR) P1INTE Clear */ +#define USBC_UHINTECLR_P2INTEC (0x1u << 10) /**< \brief (USBC_UHINTECLR) P2INTE Clear */ +#define USBC_UHINTECLR_P3INTEC (0x1u << 11) /**< \brief (USBC_UHINTECLR) P3INTE Clear */ +#define USBC_UHINTECLR_P4INTEC (0x1u << 12) /**< \brief (USBC_UHINTECLR) P4INTE Clear */ +#define USBC_UHINTECLR_P5INTEC (0x1u << 13) /**< \brief (USBC_UHINTECLR) P5INTE Clear */ +#define USBC_UHINTECLR_P6INTEC (0x1u << 14) /**< \brief (USBC_UHINTECLR) P6INTE Clear */ +#define USBC_UHINTECLR_P7INTEC (0x1u << 15) /**< \brief (USBC_UHINTECLR) P7INTE Clear */ +/* -------- USBC_UHINTESET : (USBC Offset: 0x418) Host Global Interrupt Enable Set Register -------- */ +#define USBC_UHINTESET_DCONNIES (0x1u << 0) /**< \brief (USBC_UHINTESET) DCONNIE Set */ +#define USBC_UHINTESET_DDISCIES (0x1u << 1) /**< \brief (USBC_UHINTESET) DDISCIE Set */ +#define USBC_UHINTESET_RSTIES (0x1u << 2) /**< \brief (USBC_UHINTESET) RSTIE Set */ +#define USBC_UHINTESET_RSMEDIES (0x1u << 3) /**< \brief (USBC_UHINTESET) RSMEDIE Set */ +#define USBC_UHINTESET_RXRSMIES (0x1u << 4) /**< \brief (USBC_UHINTESET) RXRSMIE Set */ +#define USBC_UHINTESET_HSOFIES (0x1u << 5) /**< \brief (USBC_UHINTESET) HSOFIE Set */ +#define USBC_UHINTESET_HWUPIES (0x1u << 6) /**< \brief (USBC_UHINTESET) HWUPIE Set */ +#define USBC_UHINTESET_P0INTES (0x1u << 8) /**< \brief (USBC_UHINTESET) P0INTE Set */ +#define USBC_UHINTESET_P1INTES (0x1u << 9) /**< \brief (USBC_UHINTESET) P1INTE Set */ +#define USBC_UHINTESET_P2INTES (0x1u << 10) /**< \brief (USBC_UHINTESET) P2INTE Set */ +#define USBC_UHINTESET_P3INTES (0x1u << 11) /**< \brief (USBC_UHINTESET) P3INTE Set */ +#define USBC_UHINTESET_P4INTES (0x1u << 12) /**< \brief (USBC_UHINTESET) P4INTE Set */ +#define USBC_UHINTESET_P5INTES (0x1u << 13) /**< \brief (USBC_UHINTESET) P5INTE Set */ +#define USBC_UHINTESET_P6INTES (0x1u << 14) /**< \brief (USBC_UHINTESET) P6INTE Set */ +#define USBC_UHINTESET_P7INTES (0x1u << 15) /**< \brief (USBC_UHINTESET) P7INTE Set */ +/* -------- USBC_UPRST : (USBC Offset: 0x41C) Pipe Reset Register -------- */ +#define USBC_UPRST_PEN0 (0x1u << 0) /**< \brief (USBC_UPRST) Pipe0 Enable */ +#define USBC_UPRST_PEN1 (0x1u << 1) /**< \brief (USBC_UPRST) Pipe1 Enable */ +#define USBC_UPRST_PEN2 (0x1u << 2) /**< \brief (USBC_UPRST) Pipe2 Enable */ +#define USBC_UPRST_PEN3 (0x1u << 3) /**< \brief (USBC_UPRST) Pipe3 Enable */ +#define USBC_UPRST_PEN4 (0x1u << 4) /**< \brief (USBC_UPRST) Pipe4 Enable */ +#define USBC_UPRST_PEN5 (0x1u << 5) /**< \brief (USBC_UPRST) Pipe5 Enable */ +#define USBC_UPRST_PEN6 (0x1u << 6) /**< \brief (USBC_UPRST) Pipe6 Enable */ +#define USBC_UPRST_PEN7 (0x1u << 7) /**< \brief (USBC_UPRST) Pipe7 Enable */ +/* -------- USBC_UHFNUM : (USBC Offset: 0x420) Host Frame Number Register -------- */ +#define USBC_UHFNUM_MFNUM_Pos 0 +#define USBC_UHFNUM_MFNUM_Msk (0x7u << USBC_UHFNUM_MFNUM_Pos) /**< \brief (USBC_UHFNUM) Micro Frame Number */ +#define USBC_UHFNUM_MFNUM(value) ((USBC_UHFNUM_MFNUM_Msk & ((value) << USBC_UHFNUM_MFNUM_Pos))) +#define USBC_UHFNUM_FNUM_Pos 3 +#define USBC_UHFNUM_FNUM_Msk (0x7FFu << USBC_UHFNUM_FNUM_Pos) /**< \brief (USBC_UHFNUM) Frame Number */ +#define USBC_UHFNUM_FNUM(value) ((USBC_UHFNUM_FNUM_Msk & ((value) << USBC_UHFNUM_FNUM_Pos))) +#define USBC_UHFNUM_FLENHIGH_Pos 16 +#define USBC_UHFNUM_FLENHIGH_Msk (0xFFu << USBC_UHFNUM_FLENHIGH_Pos) /**< \brief (USBC_UHFNUM) Frame Length */ +#define USBC_UHFNUM_FLENHIGH(value) ((USBC_UHFNUM_FLENHIGH_Msk & ((value) << USBC_UHFNUM_FLENHIGH_Pos))) +/* -------- USBC_UHSOFC : (USBC Offset: 0x424) Host Start of Frame Control Register -------- */ +#define USBC_UHSOFC_FLENC_Pos 0 +#define USBC_UHSOFC_FLENC_Msk (0x3FFFu << USBC_UHSOFC_FLENC_Pos) /**< \brief (USBC_UHSOFC) Frame Length Control */ +#define USBC_UHSOFC_FLENC(value) ((USBC_UHSOFC_FLENC_Msk & ((value) << USBC_UHSOFC_FLENC_Pos))) +#define USBC_UHSOFC_FLENCE (0x1u << 16) /**< \brief (USBC_UHSOFC) Frame Length Control Enable */ +/* -------- USBC_UPCFG0 : (USBC Offset: 0x500) Pipe Configuration Register -------- */ +#define USBC_UPCFG0_PBK (0x1u << 2) /**< \brief (USBC_UPCFG0) Pipe Banks */ +#define USBC_UPCFG0_PBK_SINGLE (0x0u << 2) /**< \brief (USBC_UPCFG0) */ +#define USBC_UPCFG0_PBK_DOUBLE (0x1u << 2) /**< \brief (USBC_UPCFG0) */ +#define USBC_UPCFG0_PSIZE_Pos 4 +#define USBC_UPCFG0_PSIZE_Msk (0x7u << USBC_UPCFG0_PSIZE_Pos) /**< \brief (USBC_UPCFG0) Pipe Size */ +#define USBC_UPCFG0_PSIZE(value) ((USBC_UPCFG0_PSIZE_Msk & ((value) << USBC_UPCFG0_PSIZE_Pos))) +#define USBC_UPCFG0_PSIZE_8 (0x0u << 4) /**< \brief (USBC_UPCFG0) */ +#define USBC_UPCFG0_PSIZE_16 (0x1u << 4) /**< \brief (USBC_UPCFG0) */ +#define USBC_UPCFG0_PSIZE_32 (0x2u << 4) /**< \brief (USBC_UPCFG0) */ +#define USBC_UPCFG0_PSIZE_64 (0x3u << 4) /**< \brief (USBC_UPCFG0) */ +#define USBC_UPCFG0_PSIZE_128 (0x4u << 4) /**< \brief (USBC_UPCFG0) */ +#define USBC_UPCFG0_PSIZE_256 (0x5u << 4) /**< \brief (USBC_UPCFG0) */ +#define USBC_UPCFG0_PSIZE_512 (0x6u << 4) /**< \brief (USBC_UPCFG0) */ +#define USBC_UPCFG0_PSIZE_1024 (0x7u << 4) /**< \brief (USBC_UPCFG0) */ +#define USBC_UPCFG0_PTOKEN_Pos 8 +#define USBC_UPCFG0_PTOKEN_Msk (0x3u << USBC_UPCFG0_PTOKEN_Pos) /**< \brief (USBC_UPCFG0) Pipe Token */ +#define USBC_UPCFG0_PTOKEN(value) ((USBC_UPCFG0_PTOKEN_Msk & ((value) << USBC_UPCFG0_PTOKEN_Pos))) +#define USBC_UPCFG0_PTOKEN_SETUP (0x0u << 8) /**< \brief (USBC_UPCFG0) */ +#define USBC_UPCFG0_PTOKEN_IN (0x1u << 8) /**< \brief (USBC_UPCFG0) */ +#define USBC_UPCFG0_PTOKEN_OUT (0x2u << 8) /**< \brief (USBC_UPCFG0) */ +#define USBC_UPCFG0_PTYPE_Pos 12 +#define USBC_UPCFG0_PTYPE_Msk (0x3u << USBC_UPCFG0_PTYPE_Pos) /**< \brief (USBC_UPCFG0) Pipe Type */ +#define USBC_UPCFG0_PTYPE(value) ((USBC_UPCFG0_PTYPE_Msk & ((value) << USBC_UPCFG0_PTYPE_Pos))) +#define USBC_UPCFG0_PTYPE_CONTROL (0x0u << 12) /**< \brief (USBC_UPCFG0) */ +#define USBC_UPCFG0_PTYPE_ISOCHRONOUS (0x1u << 12) /**< \brief (USBC_UPCFG0) */ +#define USBC_UPCFG0_PTYPE_BULK (0x2u << 12) /**< \brief (USBC_UPCFG0) */ +#define USBC_UPCFG0_PTYPE_INTERRUPT (0x3u << 12) /**< \brief (USBC_UPCFG0) */ +#define USBC_UPCFG0_PINGEN (0x1u << 20) /**< \brief (USBC_UPCFG0) Ping Enable */ +#define USBC_UPCFG0_BINTERVAL_Pos 24 +#define USBC_UPCFG0_BINTERVAL_Msk (0xFFu << USBC_UPCFG0_BINTERVAL_Pos) /**< \brief (USBC_UPCFG0) binterval parameter */ +#define USBC_UPCFG0_BINTERVAL(value) ((USBC_UPCFG0_BINTERVAL_Msk & ((value) << USBC_UPCFG0_BINTERVAL_Pos))) +/* -------- USBC_UPCFG1 : (USBC Offset: 0x504) Pipe Configuration Register -------- */ +#define USBC_UPCFG1_PBK (0x1u << 2) /**< \brief (USBC_UPCFG1) Pipe Banks */ +#define USBC_UPCFG1_PBK_SINGLE (0x0u << 2) /**< \brief (USBC_UPCFG1) */ +#define USBC_UPCFG1_PBK_DOUBLE (0x1u << 2) /**< \brief (USBC_UPCFG1) */ +#define USBC_UPCFG1_PSIZE_Pos 4 +#define USBC_UPCFG1_PSIZE_Msk (0x7u << USBC_UPCFG1_PSIZE_Pos) /**< \brief (USBC_UPCFG1) Pipe Size */ +#define USBC_UPCFG1_PSIZE(value) ((USBC_UPCFG1_PSIZE_Msk & ((value) << USBC_UPCFG1_PSIZE_Pos))) +#define USBC_UPCFG1_PSIZE_8 (0x0u << 4) /**< \brief (USBC_UPCFG1) */ +#define USBC_UPCFG1_PSIZE_16 (0x1u << 4) /**< \brief (USBC_UPCFG1) */ +#define USBC_UPCFG1_PSIZE_32 (0x2u << 4) /**< \brief (USBC_UPCFG1) */ +#define USBC_UPCFG1_PSIZE_64 (0x3u << 4) /**< \brief (USBC_UPCFG1) */ +#define USBC_UPCFG1_PSIZE_128 (0x4u << 4) /**< \brief (USBC_UPCFG1) */ +#define USBC_UPCFG1_PSIZE_256 (0x5u << 4) /**< \brief (USBC_UPCFG1) */ +#define USBC_UPCFG1_PSIZE_512 (0x6u << 4) /**< \brief (USBC_UPCFG1) */ +#define USBC_UPCFG1_PSIZE_1024 (0x7u << 4) /**< \brief (USBC_UPCFG1) */ +#define USBC_UPCFG1_PTOKEN_Pos 8 +#define USBC_UPCFG1_PTOKEN_Msk (0x3u << USBC_UPCFG1_PTOKEN_Pos) /**< \brief (USBC_UPCFG1) Pipe Token */ +#define USBC_UPCFG1_PTOKEN(value) ((USBC_UPCFG1_PTOKEN_Msk & ((value) << USBC_UPCFG1_PTOKEN_Pos))) +#define USBC_UPCFG1_PTOKEN_SETUP (0x0u << 8) /**< \brief (USBC_UPCFG1) */ +#define USBC_UPCFG1_PTOKEN_IN (0x1u << 8) /**< \brief (USBC_UPCFG1) */ +#define USBC_UPCFG1_PTOKEN_OUT (0x2u << 8) /**< \brief (USBC_UPCFG1) */ +#define USBC_UPCFG1_PTYPE_Pos 12 +#define USBC_UPCFG1_PTYPE_Msk (0x3u << USBC_UPCFG1_PTYPE_Pos) /**< \brief (USBC_UPCFG1) Pipe Type */ +#define USBC_UPCFG1_PTYPE(value) ((USBC_UPCFG1_PTYPE_Msk & ((value) << USBC_UPCFG1_PTYPE_Pos))) +#define USBC_UPCFG1_PTYPE_CONTROL (0x0u << 12) /**< \brief (USBC_UPCFG1) */ +#define USBC_UPCFG1_PTYPE_ISOCHRONOUS (0x1u << 12) /**< \brief (USBC_UPCFG1) */ +#define USBC_UPCFG1_PTYPE_BULK (0x2u << 12) /**< \brief (USBC_UPCFG1) */ +#define USBC_UPCFG1_PTYPE_INTERRUPT (0x3u << 12) /**< \brief (USBC_UPCFG1) */ +#define USBC_UPCFG1_PINGEN (0x1u << 20) /**< \brief (USBC_UPCFG1) Ping Enable */ +#define USBC_UPCFG1_BINTERVAL_Pos 24 +#define USBC_UPCFG1_BINTERVAL_Msk (0xFFu << USBC_UPCFG1_BINTERVAL_Pos) /**< \brief (USBC_UPCFG1) binterval parameter */ +#define USBC_UPCFG1_BINTERVAL(value) ((USBC_UPCFG1_BINTERVAL_Msk & ((value) << USBC_UPCFG1_BINTERVAL_Pos))) +/* -------- USBC_UPCFG2 : (USBC Offset: 0x508) Pipe Configuration Register -------- */ +#define USBC_UPCFG2_PBK (0x1u << 2) /**< \brief (USBC_UPCFG2) Pipe Banks */ +#define USBC_UPCFG2_PBK_SINGLE (0x0u << 2) /**< \brief (USBC_UPCFG2) */ +#define USBC_UPCFG2_PBK_DOUBLE (0x1u << 2) /**< \brief (USBC_UPCFG2) */ +#define USBC_UPCFG2_PSIZE_Pos 4 +#define USBC_UPCFG2_PSIZE_Msk (0x7u << USBC_UPCFG2_PSIZE_Pos) /**< \brief (USBC_UPCFG2) Pipe Size */ +#define USBC_UPCFG2_PSIZE(value) ((USBC_UPCFG2_PSIZE_Msk & ((value) << USBC_UPCFG2_PSIZE_Pos))) +#define USBC_UPCFG2_PSIZE_8 (0x0u << 4) /**< \brief (USBC_UPCFG2) */ +#define USBC_UPCFG2_PSIZE_16 (0x1u << 4) /**< \brief (USBC_UPCFG2) */ +#define USBC_UPCFG2_PSIZE_32 (0x2u << 4) /**< \brief (USBC_UPCFG2) */ +#define USBC_UPCFG2_PSIZE_64 (0x3u << 4) /**< \brief (USBC_UPCFG2) */ +#define USBC_UPCFG2_PSIZE_128 (0x4u << 4) /**< \brief (USBC_UPCFG2) */ +#define USBC_UPCFG2_PSIZE_256 (0x5u << 4) /**< \brief (USBC_UPCFG2) */ +#define USBC_UPCFG2_PSIZE_512 (0x6u << 4) /**< \brief (USBC_UPCFG2) */ +#define USBC_UPCFG2_PSIZE_1024 (0x7u << 4) /**< \brief (USBC_UPCFG2) */ +#define USBC_UPCFG2_PTOKEN_Pos 8 +#define USBC_UPCFG2_PTOKEN_Msk (0x3u << USBC_UPCFG2_PTOKEN_Pos) /**< \brief (USBC_UPCFG2) Pipe Token */ +#define USBC_UPCFG2_PTOKEN(value) ((USBC_UPCFG2_PTOKEN_Msk & ((value) << USBC_UPCFG2_PTOKEN_Pos))) +#define USBC_UPCFG2_PTOKEN_SETUP (0x0u << 8) /**< \brief (USBC_UPCFG2) */ +#define USBC_UPCFG2_PTOKEN_IN (0x1u << 8) /**< \brief (USBC_UPCFG2) */ +#define USBC_UPCFG2_PTOKEN_OUT (0x2u << 8) /**< \brief (USBC_UPCFG2) */ +#define USBC_UPCFG2_PTYPE_Pos 12 +#define USBC_UPCFG2_PTYPE_Msk (0x3u << USBC_UPCFG2_PTYPE_Pos) /**< \brief (USBC_UPCFG2) Pipe Type */ +#define USBC_UPCFG2_PTYPE(value) ((USBC_UPCFG2_PTYPE_Msk & ((value) << USBC_UPCFG2_PTYPE_Pos))) +#define USBC_UPCFG2_PTYPE_CONTROL (0x0u << 12) /**< \brief (USBC_UPCFG2) */ +#define USBC_UPCFG2_PTYPE_ISOCHRONOUS (0x1u << 12) /**< \brief (USBC_UPCFG2) */ +#define USBC_UPCFG2_PTYPE_BULK (0x2u << 12) /**< \brief (USBC_UPCFG2) */ +#define USBC_UPCFG2_PTYPE_INTERRUPT (0x3u << 12) /**< \brief (USBC_UPCFG2) */ +#define USBC_UPCFG2_PINGEN (0x1u << 20) /**< \brief (USBC_UPCFG2) Ping Enable */ +#define USBC_UPCFG2_BINTERVAL_Pos 24 +#define USBC_UPCFG2_BINTERVAL_Msk (0xFFu << USBC_UPCFG2_BINTERVAL_Pos) /**< \brief (USBC_UPCFG2) binterval parameter */ +#define USBC_UPCFG2_BINTERVAL(value) ((USBC_UPCFG2_BINTERVAL_Msk & ((value) << USBC_UPCFG2_BINTERVAL_Pos))) +/* -------- USBC_UPCFG3 : (USBC Offset: 0x50C) Pipe Configuration Register -------- */ +#define USBC_UPCFG3_PBK (0x1u << 2) /**< \brief (USBC_UPCFG3) Pipe Banks */ +#define USBC_UPCFG3_PBK_SINGLE (0x0u << 2) /**< \brief (USBC_UPCFG3) */ +#define USBC_UPCFG3_PBK_DOUBLE (0x1u << 2) /**< \brief (USBC_UPCFG3) */ +#define USBC_UPCFG3_PSIZE_Pos 4 +#define USBC_UPCFG3_PSIZE_Msk (0x7u << USBC_UPCFG3_PSIZE_Pos) /**< \brief (USBC_UPCFG3) Pipe Size */ +#define USBC_UPCFG3_PSIZE(value) ((USBC_UPCFG3_PSIZE_Msk & ((value) << USBC_UPCFG3_PSIZE_Pos))) +#define USBC_UPCFG3_PSIZE_8 (0x0u << 4) /**< \brief (USBC_UPCFG3) */ +#define USBC_UPCFG3_PSIZE_16 (0x1u << 4) /**< \brief (USBC_UPCFG3) */ +#define USBC_UPCFG3_PSIZE_32 (0x2u << 4) /**< \brief (USBC_UPCFG3) */ +#define USBC_UPCFG3_PSIZE_64 (0x3u << 4) /**< \brief (USBC_UPCFG3) */ +#define USBC_UPCFG3_PSIZE_128 (0x4u << 4) /**< \brief (USBC_UPCFG3) */ +#define USBC_UPCFG3_PSIZE_256 (0x5u << 4) /**< \brief (USBC_UPCFG3) */ +#define USBC_UPCFG3_PSIZE_512 (0x6u << 4) /**< \brief (USBC_UPCFG3) */ +#define USBC_UPCFG3_PSIZE_1024 (0x7u << 4) /**< \brief (USBC_UPCFG3) */ +#define USBC_UPCFG3_PTOKEN_Pos 8 +#define USBC_UPCFG3_PTOKEN_Msk (0x3u << USBC_UPCFG3_PTOKEN_Pos) /**< \brief (USBC_UPCFG3) Pipe Token */ +#define USBC_UPCFG3_PTOKEN(value) ((USBC_UPCFG3_PTOKEN_Msk & ((value) << USBC_UPCFG3_PTOKEN_Pos))) +#define USBC_UPCFG3_PTOKEN_SETUP (0x0u << 8) /**< \brief (USBC_UPCFG3) */ +#define USBC_UPCFG3_PTOKEN_IN (0x1u << 8) /**< \brief (USBC_UPCFG3) */ +#define USBC_UPCFG3_PTOKEN_OUT (0x2u << 8) /**< \brief (USBC_UPCFG3) */ +#define USBC_UPCFG3_PTYPE_Pos 12 +#define USBC_UPCFG3_PTYPE_Msk (0x3u << USBC_UPCFG3_PTYPE_Pos) /**< \brief (USBC_UPCFG3) Pipe Type */ +#define USBC_UPCFG3_PTYPE(value) ((USBC_UPCFG3_PTYPE_Msk & ((value) << USBC_UPCFG3_PTYPE_Pos))) +#define USBC_UPCFG3_PTYPE_CONTROL (0x0u << 12) /**< \brief (USBC_UPCFG3) */ +#define USBC_UPCFG3_PTYPE_ISOCHRONOUS (0x1u << 12) /**< \brief (USBC_UPCFG3) */ +#define USBC_UPCFG3_PTYPE_BULK (0x2u << 12) /**< \brief (USBC_UPCFG3) */ +#define USBC_UPCFG3_PTYPE_INTERRUPT (0x3u << 12) /**< \brief (USBC_UPCFG3) */ +#define USBC_UPCFG3_PINGEN (0x1u << 20) /**< \brief (USBC_UPCFG3) Ping Enable */ +#define USBC_UPCFG3_BINTERVAL_Pos 24 +#define USBC_UPCFG3_BINTERVAL_Msk (0xFFu << USBC_UPCFG3_BINTERVAL_Pos) /**< \brief (USBC_UPCFG3) binterval parameter */ +#define USBC_UPCFG3_BINTERVAL(value) ((USBC_UPCFG3_BINTERVAL_Msk & ((value) << USBC_UPCFG3_BINTERVAL_Pos))) +/* -------- USBC_UPCFG4 : (USBC Offset: 0x510) Pipe Configuration Register -------- */ +#define USBC_UPCFG4_PBK (0x1u << 2) /**< \brief (USBC_UPCFG4) Pipe Banks */ +#define USBC_UPCFG4_PBK_SINGLE (0x0u << 2) /**< \brief (USBC_UPCFG4) */ +#define USBC_UPCFG4_PBK_DOUBLE (0x1u << 2) /**< \brief (USBC_UPCFG4) */ +#define USBC_UPCFG4_PSIZE_Pos 4 +#define USBC_UPCFG4_PSIZE_Msk (0x7u << USBC_UPCFG4_PSIZE_Pos) /**< \brief (USBC_UPCFG4) Pipe Size */ +#define USBC_UPCFG4_PSIZE(value) ((USBC_UPCFG4_PSIZE_Msk & ((value) << USBC_UPCFG4_PSIZE_Pos))) +#define USBC_UPCFG4_PSIZE_8 (0x0u << 4) /**< \brief (USBC_UPCFG4) */ +#define USBC_UPCFG4_PSIZE_16 (0x1u << 4) /**< \brief (USBC_UPCFG4) */ +#define USBC_UPCFG4_PSIZE_32 (0x2u << 4) /**< \brief (USBC_UPCFG4) */ +#define USBC_UPCFG4_PSIZE_64 (0x3u << 4) /**< \brief (USBC_UPCFG4) */ +#define USBC_UPCFG4_PSIZE_128 (0x4u << 4) /**< \brief (USBC_UPCFG4) */ +#define USBC_UPCFG4_PSIZE_256 (0x5u << 4) /**< \brief (USBC_UPCFG4) */ +#define USBC_UPCFG4_PSIZE_512 (0x6u << 4) /**< \brief (USBC_UPCFG4) */ +#define USBC_UPCFG4_PSIZE_1024 (0x7u << 4) /**< \brief (USBC_UPCFG4) */ +#define USBC_UPCFG4_PTOKEN_Pos 8 +#define USBC_UPCFG4_PTOKEN_Msk (0x3u << USBC_UPCFG4_PTOKEN_Pos) /**< \brief (USBC_UPCFG4) Pipe Token */ +#define USBC_UPCFG4_PTOKEN(value) ((USBC_UPCFG4_PTOKEN_Msk & ((value) << USBC_UPCFG4_PTOKEN_Pos))) +#define USBC_UPCFG4_PTOKEN_SETUP (0x0u << 8) /**< \brief (USBC_UPCFG4) */ +#define USBC_UPCFG4_PTOKEN_IN (0x1u << 8) /**< \brief (USBC_UPCFG4) */ +#define USBC_UPCFG4_PTOKEN_OUT (0x2u << 8) /**< \brief (USBC_UPCFG4) */ +#define USBC_UPCFG4_PTYPE_Pos 12 +#define USBC_UPCFG4_PTYPE_Msk (0x3u << USBC_UPCFG4_PTYPE_Pos) /**< \brief (USBC_UPCFG4) Pipe Type */ +#define USBC_UPCFG4_PTYPE(value) ((USBC_UPCFG4_PTYPE_Msk & ((value) << USBC_UPCFG4_PTYPE_Pos))) +#define USBC_UPCFG4_PTYPE_CONTROL (0x0u << 12) /**< \brief (USBC_UPCFG4) */ +#define USBC_UPCFG4_PTYPE_ISOCHRONOUS (0x1u << 12) /**< \brief (USBC_UPCFG4) */ +#define USBC_UPCFG4_PTYPE_BULK (0x2u << 12) /**< \brief (USBC_UPCFG4) */ +#define USBC_UPCFG4_PTYPE_INTERRUPT (0x3u << 12) /**< \brief (USBC_UPCFG4) */ +#define USBC_UPCFG4_PINGEN (0x1u << 20) /**< \brief (USBC_UPCFG4) Ping Enable */ +#define USBC_UPCFG4_BINTERVAL_Pos 24 +#define USBC_UPCFG4_BINTERVAL_Msk (0xFFu << USBC_UPCFG4_BINTERVAL_Pos) /**< \brief (USBC_UPCFG4) binterval parameter */ +#define USBC_UPCFG4_BINTERVAL(value) ((USBC_UPCFG4_BINTERVAL_Msk & ((value) << USBC_UPCFG4_BINTERVAL_Pos))) +/* -------- USBC_UPCFG5 : (USBC Offset: 0x514) Pipe Configuration Register -------- */ +#define USBC_UPCFG5_PBK (0x1u << 2) /**< \brief (USBC_UPCFG5) Pipe Banks */ +#define USBC_UPCFG5_PBK_SINGLE (0x0u << 2) /**< \brief (USBC_UPCFG5) */ +#define USBC_UPCFG5_PBK_DOUBLE (0x1u << 2) /**< \brief (USBC_UPCFG5) */ +#define USBC_UPCFG5_PSIZE_Pos 4 +#define USBC_UPCFG5_PSIZE_Msk (0x7u << USBC_UPCFG5_PSIZE_Pos) /**< \brief (USBC_UPCFG5) Pipe Size */ +#define USBC_UPCFG5_PSIZE(value) ((USBC_UPCFG5_PSIZE_Msk & ((value) << USBC_UPCFG5_PSIZE_Pos))) +#define USBC_UPCFG5_PSIZE_8 (0x0u << 4) /**< \brief (USBC_UPCFG5) */ +#define USBC_UPCFG5_PSIZE_16 (0x1u << 4) /**< \brief (USBC_UPCFG5) */ +#define USBC_UPCFG5_PSIZE_32 (0x2u << 4) /**< \brief (USBC_UPCFG5) */ +#define USBC_UPCFG5_PSIZE_64 (0x3u << 4) /**< \brief (USBC_UPCFG5) */ +#define USBC_UPCFG5_PSIZE_128 (0x4u << 4) /**< \brief (USBC_UPCFG5) */ +#define USBC_UPCFG5_PSIZE_256 (0x5u << 4) /**< \brief (USBC_UPCFG5) */ +#define USBC_UPCFG5_PSIZE_512 (0x6u << 4) /**< \brief (USBC_UPCFG5) */ +#define USBC_UPCFG5_PSIZE_1024 (0x7u << 4) /**< \brief (USBC_UPCFG5) */ +#define USBC_UPCFG5_PTOKEN_Pos 8 +#define USBC_UPCFG5_PTOKEN_Msk (0x3u << USBC_UPCFG5_PTOKEN_Pos) /**< \brief (USBC_UPCFG5) Pipe Token */ +#define USBC_UPCFG5_PTOKEN(value) ((USBC_UPCFG5_PTOKEN_Msk & ((value) << USBC_UPCFG5_PTOKEN_Pos))) +#define USBC_UPCFG5_PTOKEN_SETUP (0x0u << 8) /**< \brief (USBC_UPCFG5) */ +#define USBC_UPCFG5_PTOKEN_IN (0x1u << 8) /**< \brief (USBC_UPCFG5) */ +#define USBC_UPCFG5_PTOKEN_OUT (0x2u << 8) /**< \brief (USBC_UPCFG5) */ +#define USBC_UPCFG5_PTYPE_Pos 12 +#define USBC_UPCFG5_PTYPE_Msk (0x3u << USBC_UPCFG5_PTYPE_Pos) /**< \brief (USBC_UPCFG5) Pipe Type */ +#define USBC_UPCFG5_PTYPE(value) ((USBC_UPCFG5_PTYPE_Msk & ((value) << USBC_UPCFG5_PTYPE_Pos))) +#define USBC_UPCFG5_PTYPE_CONTROL (0x0u << 12) /**< \brief (USBC_UPCFG5) */ +#define USBC_UPCFG5_PTYPE_ISOCHRONOUS (0x1u << 12) /**< \brief (USBC_UPCFG5) */ +#define USBC_UPCFG5_PTYPE_BULK (0x2u << 12) /**< \brief (USBC_UPCFG5) */ +#define USBC_UPCFG5_PTYPE_INTERRUPT (0x3u << 12) /**< \brief (USBC_UPCFG5) */ +#define USBC_UPCFG5_PINGEN (0x1u << 20) /**< \brief (USBC_UPCFG5) Ping Enable */ +#define USBC_UPCFG5_BINTERVAL_Pos 24 +#define USBC_UPCFG5_BINTERVAL_Msk (0xFFu << USBC_UPCFG5_BINTERVAL_Pos) /**< \brief (USBC_UPCFG5) binterval parameter */ +#define USBC_UPCFG5_BINTERVAL(value) ((USBC_UPCFG5_BINTERVAL_Msk & ((value) << USBC_UPCFG5_BINTERVAL_Pos))) +/* -------- USBC_UPCFG6 : (USBC Offset: 0x518) Pipe Configuration Register -------- */ +#define USBC_UPCFG6_PBK (0x1u << 2) /**< \brief (USBC_UPCFG6) Pipe Banks */ +#define USBC_UPCFG6_PBK_SINGLE (0x0u << 2) /**< \brief (USBC_UPCFG6) */ +#define USBC_UPCFG6_PBK_DOUBLE (0x1u << 2) /**< \brief (USBC_UPCFG6) */ +#define USBC_UPCFG6_PSIZE_Pos 4 +#define USBC_UPCFG6_PSIZE_Msk (0x7u << USBC_UPCFG6_PSIZE_Pos) /**< \brief (USBC_UPCFG6) Pipe Size */ +#define USBC_UPCFG6_PSIZE(value) ((USBC_UPCFG6_PSIZE_Msk & ((value) << USBC_UPCFG6_PSIZE_Pos))) +#define USBC_UPCFG6_PSIZE_8 (0x0u << 4) /**< \brief (USBC_UPCFG6) */ +#define USBC_UPCFG6_PSIZE_16 (0x1u << 4) /**< \brief (USBC_UPCFG6) */ +#define USBC_UPCFG6_PSIZE_32 (0x2u << 4) /**< \brief (USBC_UPCFG6) */ +#define USBC_UPCFG6_PSIZE_64 (0x3u << 4) /**< \brief (USBC_UPCFG6) */ +#define USBC_UPCFG6_PSIZE_128 (0x4u << 4) /**< \brief (USBC_UPCFG6) */ +#define USBC_UPCFG6_PSIZE_256 (0x5u << 4) /**< \brief (USBC_UPCFG6) */ +#define USBC_UPCFG6_PSIZE_512 (0x6u << 4) /**< \brief (USBC_UPCFG6) */ +#define USBC_UPCFG6_PSIZE_1024 (0x7u << 4) /**< \brief (USBC_UPCFG6) */ +#define USBC_UPCFG6_PTOKEN_Pos 8 +#define USBC_UPCFG6_PTOKEN_Msk (0x3u << USBC_UPCFG6_PTOKEN_Pos) /**< \brief (USBC_UPCFG6) Pipe Token */ +#define USBC_UPCFG6_PTOKEN(value) ((USBC_UPCFG6_PTOKEN_Msk & ((value) << USBC_UPCFG6_PTOKEN_Pos))) +#define USBC_UPCFG6_PTOKEN_SETUP (0x0u << 8) /**< \brief (USBC_UPCFG6) */ +#define USBC_UPCFG6_PTOKEN_IN (0x1u << 8) /**< \brief (USBC_UPCFG6) */ +#define USBC_UPCFG6_PTOKEN_OUT (0x2u << 8) /**< \brief (USBC_UPCFG6) */ +#define USBC_UPCFG6_PTYPE_Pos 12 +#define USBC_UPCFG6_PTYPE_Msk (0x3u << USBC_UPCFG6_PTYPE_Pos) /**< \brief (USBC_UPCFG6) Pipe Type */ +#define USBC_UPCFG6_PTYPE(value) ((USBC_UPCFG6_PTYPE_Msk & ((value) << USBC_UPCFG6_PTYPE_Pos))) +#define USBC_UPCFG6_PTYPE_CONTROL (0x0u << 12) /**< \brief (USBC_UPCFG6) */ +#define USBC_UPCFG6_PTYPE_ISOCHRONOUS (0x1u << 12) /**< \brief (USBC_UPCFG6) */ +#define USBC_UPCFG6_PTYPE_BULK (0x2u << 12) /**< \brief (USBC_UPCFG6) */ +#define USBC_UPCFG6_PTYPE_INTERRUPT (0x3u << 12) /**< \brief (USBC_UPCFG6) */ +#define USBC_UPCFG6_PINGEN (0x1u << 20) /**< \brief (USBC_UPCFG6) Ping Enable */ +#define USBC_UPCFG6_BINTERVAL_Pos 24 +#define USBC_UPCFG6_BINTERVAL_Msk (0xFFu << USBC_UPCFG6_BINTERVAL_Pos) /**< \brief (USBC_UPCFG6) binterval parameter */ +#define USBC_UPCFG6_BINTERVAL(value) ((USBC_UPCFG6_BINTERVAL_Msk & ((value) << USBC_UPCFG6_BINTERVAL_Pos))) +/* -------- USBC_UPCFG7 : (USBC Offset: 0x51C) Pipe Configuration Register -------- */ +#define USBC_UPCFG7_PBK (0x1u << 2) /**< \brief (USBC_UPCFG7) Pipe Banks */ +#define USBC_UPCFG7_PBK_SINGLE (0x0u << 2) /**< \brief (USBC_UPCFG7) */ +#define USBC_UPCFG7_PBK_DOUBLE (0x1u << 2) /**< \brief (USBC_UPCFG7) */ +#define USBC_UPCFG7_PSIZE_Pos 4 +#define USBC_UPCFG7_PSIZE_Msk (0x7u << USBC_UPCFG7_PSIZE_Pos) /**< \brief (USBC_UPCFG7) Pipe Size */ +#define USBC_UPCFG7_PSIZE(value) ((USBC_UPCFG7_PSIZE_Msk & ((value) << USBC_UPCFG7_PSIZE_Pos))) +#define USBC_UPCFG7_PSIZE_8 (0x0u << 4) /**< \brief (USBC_UPCFG7) */ +#define USBC_UPCFG7_PSIZE_16 (0x1u << 4) /**< \brief (USBC_UPCFG7) */ +#define USBC_UPCFG7_PSIZE_32 (0x2u << 4) /**< \brief (USBC_UPCFG7) */ +#define USBC_UPCFG7_PSIZE_64 (0x3u << 4) /**< \brief (USBC_UPCFG7) */ +#define USBC_UPCFG7_PSIZE_128 (0x4u << 4) /**< \brief (USBC_UPCFG7) */ +#define USBC_UPCFG7_PSIZE_256 (0x5u << 4) /**< \brief (USBC_UPCFG7) */ +#define USBC_UPCFG7_PSIZE_512 (0x6u << 4) /**< \brief (USBC_UPCFG7) */ +#define USBC_UPCFG7_PSIZE_1024 (0x7u << 4) /**< \brief (USBC_UPCFG7) */ +#define USBC_UPCFG7_PTOKEN_Pos 8 +#define USBC_UPCFG7_PTOKEN_Msk (0x3u << USBC_UPCFG7_PTOKEN_Pos) /**< \brief (USBC_UPCFG7) Pipe Token */ +#define USBC_UPCFG7_PTOKEN(value) ((USBC_UPCFG7_PTOKEN_Msk & ((value) << USBC_UPCFG7_PTOKEN_Pos))) +#define USBC_UPCFG7_PTOKEN_SETUP (0x0u << 8) /**< \brief (USBC_UPCFG7) */ +#define USBC_UPCFG7_PTOKEN_IN (0x1u << 8) /**< \brief (USBC_UPCFG7) */ +#define USBC_UPCFG7_PTOKEN_OUT (0x2u << 8) /**< \brief (USBC_UPCFG7) */ +#define USBC_UPCFG7_PTYPE_Pos 12 +#define USBC_UPCFG7_PTYPE_Msk (0x3u << USBC_UPCFG7_PTYPE_Pos) /**< \brief (USBC_UPCFG7) Pipe Type */ +#define USBC_UPCFG7_PTYPE(value) ((USBC_UPCFG7_PTYPE_Msk & ((value) << USBC_UPCFG7_PTYPE_Pos))) +#define USBC_UPCFG7_PTYPE_CONTROL (0x0u << 12) /**< \brief (USBC_UPCFG7) */ +#define USBC_UPCFG7_PTYPE_ISOCHRONOUS (0x1u << 12) /**< \brief (USBC_UPCFG7) */ +#define USBC_UPCFG7_PTYPE_BULK (0x2u << 12) /**< \brief (USBC_UPCFG7) */ +#define USBC_UPCFG7_PTYPE_INTERRUPT (0x3u << 12) /**< \brief (USBC_UPCFG7) */ +#define USBC_UPCFG7_PINGEN (0x1u << 20) /**< \brief (USBC_UPCFG7) Ping Enable */ +#define USBC_UPCFG7_BINTERVAL_Pos 24 +#define USBC_UPCFG7_BINTERVAL_Msk (0xFFu << USBC_UPCFG7_BINTERVAL_Pos) /**< \brief (USBC_UPCFG7) binterval parameter */ +#define USBC_UPCFG7_BINTERVAL(value) ((USBC_UPCFG7_BINTERVAL_Msk & ((value) << USBC_UPCFG7_BINTERVAL_Pos))) +/* -------- USBC_UPSTA0 : (USBC Offset: 0x530) Pipe Status Register -------- */ +#define USBC_UPSTA0_RXINI (0x1u << 0) /**< \brief (USBC_UPSTA0) Received IN Data Interrupt */ +#define USBC_UPSTA0_TXOUTI (0x1u << 1) /**< \brief (USBC_UPSTA0) Transmitted OUT Data Interrupt */ +#define USBC_UPSTA0_TXSTPI (0x1u << 2) /**< \brief (USBC_UPSTA0) Transmitted SETUP Interrupt */ +#define USBC_UPSTA0_PERRI (0x1u << 3) /**< \brief (USBC_UPSTA0) Pipe Error Interrupt */ +#define USBC_UPSTA0_NAKEDI (0x1u << 4) /**< \brief (USBC_UPSTA0) NAKed Interrupt */ +#define USBC_UPSTA0_ERRORFI (0x1u << 5) /**< \brief (USBC_UPSTA0) Errorflow Interrupt */ +#define USBC_UPSTA0_RXSTALLDI (0x1u << 6) /**< \brief (USBC_UPSTA0) Received STALLed Interrupt */ +#define USBC_UPSTA0_DTSEQ_Pos 8 +#define USBC_UPSTA0_DTSEQ_Msk (0x3u << USBC_UPSTA0_DTSEQ_Pos) /**< \brief (USBC_UPSTA0) Data Toggle Sequence */ +#define USBC_UPSTA0_DTSEQ(value) ((USBC_UPSTA0_DTSEQ_Msk & ((value) << USBC_UPSTA0_DTSEQ_Pos))) +#define USBC_UPSTA0_RAMACERI (0x1u << 10) /**< \brief (USBC_UPSTA0) Ram Access Error Interrupt */ +#define USBC_UPSTA0_NBUSYBK_Pos 12 +#define USBC_UPSTA0_NBUSYBK_Msk (0x3u << USBC_UPSTA0_NBUSYBK_Pos) /**< \brief (USBC_UPSTA0) Number of Busy Bank */ +#define USBC_UPSTA0_NBUSYBK(value) ((USBC_UPSTA0_NBUSYBK_Msk & ((value) << USBC_UPSTA0_NBUSYBK_Pos))) +#define USBC_UPSTA0_CURRBK_Pos 14 +#define USBC_UPSTA0_CURRBK_Msk (0x3u << USBC_UPSTA0_CURRBK_Pos) /**< \brief (USBC_UPSTA0) Current Bank */ +#define USBC_UPSTA0_CURRBK(value) ((USBC_UPSTA0_CURRBK_Msk & ((value) << USBC_UPSTA0_CURRBK_Pos))) +/* -------- USBC_UPSTA1 : (USBC Offset: 0x534) Pipe Status Register -------- */ +#define USBC_UPSTA1_RXINI (0x1u << 0) /**< \brief (USBC_UPSTA1) Received IN Data Interrupt */ +#define USBC_UPSTA1_TXOUTI (0x1u << 1) /**< \brief (USBC_UPSTA1) Transmitted OUT Data Interrupt */ +#define USBC_UPSTA1_TXSTPI (0x1u << 2) /**< \brief (USBC_UPSTA1) Transmitted SETUP Interrupt */ +#define USBC_UPSTA1_PERRI (0x1u << 3) /**< \brief (USBC_UPSTA1) Pipe Error Interrupt */ +#define USBC_UPSTA1_NAKEDI (0x1u << 4) /**< \brief (USBC_UPSTA1) NAKed Interrupt */ +#define USBC_UPSTA1_ERRORFI (0x1u << 5) /**< \brief (USBC_UPSTA1) Errorflow Interrupt */ +#define USBC_UPSTA1_RXSTALLDI (0x1u << 6) /**< \brief (USBC_UPSTA1) Received STALLed Interrupt */ +#define USBC_UPSTA1_DTSEQ_Pos 8 +#define USBC_UPSTA1_DTSEQ_Msk (0x3u << USBC_UPSTA1_DTSEQ_Pos) /**< \brief (USBC_UPSTA1) Data Toggle Sequence */ +#define USBC_UPSTA1_DTSEQ(value) ((USBC_UPSTA1_DTSEQ_Msk & ((value) << USBC_UPSTA1_DTSEQ_Pos))) +#define USBC_UPSTA1_RAMACERI (0x1u << 10) /**< \brief (USBC_UPSTA1) Ram Access Error Interrupt */ +#define USBC_UPSTA1_NBUSYBK_Pos 12 +#define USBC_UPSTA1_NBUSYBK_Msk (0x3u << USBC_UPSTA1_NBUSYBK_Pos) /**< \brief (USBC_UPSTA1) Number of Busy Bank */ +#define USBC_UPSTA1_NBUSYBK(value) ((USBC_UPSTA1_NBUSYBK_Msk & ((value) << USBC_UPSTA1_NBUSYBK_Pos))) +#define USBC_UPSTA1_CURRBK_Pos 14 +#define USBC_UPSTA1_CURRBK_Msk (0x3u << USBC_UPSTA1_CURRBK_Pos) /**< \brief (USBC_UPSTA1) Current Bank */ +#define USBC_UPSTA1_CURRBK(value) ((USBC_UPSTA1_CURRBK_Msk & ((value) << USBC_UPSTA1_CURRBK_Pos))) +/* -------- USBC_UPSTA2 : (USBC Offset: 0x538) Pipe Status Register -------- */ +#define USBC_UPSTA2_RXINI (0x1u << 0) /**< \brief (USBC_UPSTA2) Received IN Data Interrupt */ +#define USBC_UPSTA2_TXOUTI (0x1u << 1) /**< \brief (USBC_UPSTA2) Transmitted OUT Data Interrupt */ +#define USBC_UPSTA2_TXSTPI (0x1u << 2) /**< \brief (USBC_UPSTA2) Transmitted SETUP Interrupt */ +#define USBC_UPSTA2_PERRI (0x1u << 3) /**< \brief (USBC_UPSTA2) Pipe Error Interrupt */ +#define USBC_UPSTA2_NAKEDI (0x1u << 4) /**< \brief (USBC_UPSTA2) NAKed Interrupt */ +#define USBC_UPSTA2_ERRORFI (0x1u << 5) /**< \brief (USBC_UPSTA2) Errorflow Interrupt */ +#define USBC_UPSTA2_RXSTALLDI (0x1u << 6) /**< \brief (USBC_UPSTA2) Received STALLed Interrupt */ +#define USBC_UPSTA2_DTSEQ_Pos 8 +#define USBC_UPSTA2_DTSEQ_Msk (0x3u << USBC_UPSTA2_DTSEQ_Pos) /**< \brief (USBC_UPSTA2) Data Toggle Sequence */ +#define USBC_UPSTA2_DTSEQ(value) ((USBC_UPSTA2_DTSEQ_Msk & ((value) << USBC_UPSTA2_DTSEQ_Pos))) +#define USBC_UPSTA2_RAMACERI (0x1u << 10) /**< \brief (USBC_UPSTA2) Ram Access Error Interrupt */ +#define USBC_UPSTA2_NBUSYBK_Pos 12 +#define USBC_UPSTA2_NBUSYBK_Msk (0x3u << USBC_UPSTA2_NBUSYBK_Pos) /**< \brief (USBC_UPSTA2) Number of Busy Bank */ +#define USBC_UPSTA2_NBUSYBK(value) ((USBC_UPSTA2_NBUSYBK_Msk & ((value) << USBC_UPSTA2_NBUSYBK_Pos))) +#define USBC_UPSTA2_CURRBK_Pos 14 +#define USBC_UPSTA2_CURRBK_Msk (0x3u << USBC_UPSTA2_CURRBK_Pos) /**< \brief (USBC_UPSTA2) Current Bank */ +#define USBC_UPSTA2_CURRBK(value) ((USBC_UPSTA2_CURRBK_Msk & ((value) << USBC_UPSTA2_CURRBK_Pos))) +/* -------- USBC_UPSTA3 : (USBC Offset: 0x53C) Pipe Status Register -------- */ +#define USBC_UPSTA3_RXINI (0x1u << 0) /**< \brief (USBC_UPSTA3) Received IN Data Interrupt */ +#define USBC_UPSTA3_TXOUTI (0x1u << 1) /**< \brief (USBC_UPSTA3) Transmitted OUT Data Interrupt */ +#define USBC_UPSTA3_TXSTPI (0x1u << 2) /**< \brief (USBC_UPSTA3) Transmitted SETUP Interrupt */ +#define USBC_UPSTA3_PERRI (0x1u << 3) /**< \brief (USBC_UPSTA3) Pipe Error Interrupt */ +#define USBC_UPSTA3_NAKEDI (0x1u << 4) /**< \brief (USBC_UPSTA3) NAKed Interrupt */ +#define USBC_UPSTA3_ERRORFI (0x1u << 5) /**< \brief (USBC_UPSTA3) Errorflow Interrupt */ +#define USBC_UPSTA3_RXSTALLDI (0x1u << 6) /**< \brief (USBC_UPSTA3) Received STALLed Interrupt */ +#define USBC_UPSTA3_DTSEQ_Pos 8 +#define USBC_UPSTA3_DTSEQ_Msk (0x3u << USBC_UPSTA3_DTSEQ_Pos) /**< \brief (USBC_UPSTA3) Data Toggle Sequence */ +#define USBC_UPSTA3_DTSEQ(value) ((USBC_UPSTA3_DTSEQ_Msk & ((value) << USBC_UPSTA3_DTSEQ_Pos))) +#define USBC_UPSTA3_RAMACERI (0x1u << 10) /**< \brief (USBC_UPSTA3) Ram Access Error Interrupt */ +#define USBC_UPSTA3_NBUSYBK_Pos 12 +#define USBC_UPSTA3_NBUSYBK_Msk (0x3u << USBC_UPSTA3_NBUSYBK_Pos) /**< \brief (USBC_UPSTA3) Number of Busy Bank */ +#define USBC_UPSTA3_NBUSYBK(value) ((USBC_UPSTA3_NBUSYBK_Msk & ((value) << USBC_UPSTA3_NBUSYBK_Pos))) +#define USBC_UPSTA3_CURRBK_Pos 14 +#define USBC_UPSTA3_CURRBK_Msk (0x3u << USBC_UPSTA3_CURRBK_Pos) /**< \brief (USBC_UPSTA3) Current Bank */ +#define USBC_UPSTA3_CURRBK(value) ((USBC_UPSTA3_CURRBK_Msk & ((value) << USBC_UPSTA3_CURRBK_Pos))) +/* -------- USBC_UPSTA4 : (USBC Offset: 0x540) Pipe Status Register -------- */ +#define USBC_UPSTA4_RXINI (0x1u << 0) /**< \brief (USBC_UPSTA4) Received IN Data Interrupt */ +#define USBC_UPSTA4_TXOUTI (0x1u << 1) /**< \brief (USBC_UPSTA4) Transmitted OUT Data Interrupt */ +#define USBC_UPSTA4_TXSTPI (0x1u << 2) /**< \brief (USBC_UPSTA4) Transmitted SETUP Interrupt */ +#define USBC_UPSTA4_PERRI (0x1u << 3) /**< \brief (USBC_UPSTA4) Pipe Error Interrupt */ +#define USBC_UPSTA4_NAKEDI (0x1u << 4) /**< \brief (USBC_UPSTA4) NAKed Interrupt */ +#define USBC_UPSTA4_ERRORFI (0x1u << 5) /**< \brief (USBC_UPSTA4) Errorflow Interrupt */ +#define USBC_UPSTA4_RXSTALLDI (0x1u << 6) /**< \brief (USBC_UPSTA4) Received STALLed Interrupt */ +#define USBC_UPSTA4_DTSEQ_Pos 8 +#define USBC_UPSTA4_DTSEQ_Msk (0x3u << USBC_UPSTA4_DTSEQ_Pos) /**< \brief (USBC_UPSTA4) Data Toggle Sequence */ +#define USBC_UPSTA4_DTSEQ(value) ((USBC_UPSTA4_DTSEQ_Msk & ((value) << USBC_UPSTA4_DTSEQ_Pos))) +#define USBC_UPSTA4_RAMACERI (0x1u << 10) /**< \brief (USBC_UPSTA4) Ram Access Error Interrupt */ +#define USBC_UPSTA4_NBUSYBK_Pos 12 +#define USBC_UPSTA4_NBUSYBK_Msk (0x3u << USBC_UPSTA4_NBUSYBK_Pos) /**< \brief (USBC_UPSTA4) Number of Busy Bank */ +#define USBC_UPSTA4_NBUSYBK(value) ((USBC_UPSTA4_NBUSYBK_Msk & ((value) << USBC_UPSTA4_NBUSYBK_Pos))) +#define USBC_UPSTA4_CURRBK_Pos 14 +#define USBC_UPSTA4_CURRBK_Msk (0x3u << USBC_UPSTA4_CURRBK_Pos) /**< \brief (USBC_UPSTA4) Current Bank */ +#define USBC_UPSTA4_CURRBK(value) ((USBC_UPSTA4_CURRBK_Msk & ((value) << USBC_UPSTA4_CURRBK_Pos))) +/* -------- USBC_UPSTA5 : (USBC Offset: 0x544) Pipe Status Register -------- */ +#define USBC_UPSTA5_RXINI (0x1u << 0) /**< \brief (USBC_UPSTA5) Received IN Data Interrupt */ +#define USBC_UPSTA5_TXOUTI (0x1u << 1) /**< \brief (USBC_UPSTA5) Transmitted OUT Data Interrupt */ +#define USBC_UPSTA5_TXSTPI (0x1u << 2) /**< \brief (USBC_UPSTA5) Transmitted SETUP Interrupt */ +#define USBC_UPSTA5_PERRI (0x1u << 3) /**< \brief (USBC_UPSTA5) Pipe Error Interrupt */ +#define USBC_UPSTA5_NAKEDI (0x1u << 4) /**< \brief (USBC_UPSTA5) NAKed Interrupt */ +#define USBC_UPSTA5_ERRORFI (0x1u << 5) /**< \brief (USBC_UPSTA5) Errorflow Interrupt */ +#define USBC_UPSTA5_RXSTALLDI (0x1u << 6) /**< \brief (USBC_UPSTA5) Received STALLed Interrupt */ +#define USBC_UPSTA5_DTSEQ_Pos 8 +#define USBC_UPSTA5_DTSEQ_Msk (0x3u << USBC_UPSTA5_DTSEQ_Pos) /**< \brief (USBC_UPSTA5) Data Toggle Sequence */ +#define USBC_UPSTA5_DTSEQ(value) ((USBC_UPSTA5_DTSEQ_Msk & ((value) << USBC_UPSTA5_DTSEQ_Pos))) +#define USBC_UPSTA5_RAMACERI (0x1u << 10) /**< \brief (USBC_UPSTA5) Ram Access Error Interrupt */ +#define USBC_UPSTA5_NBUSYBK_Pos 12 +#define USBC_UPSTA5_NBUSYBK_Msk (0x3u << USBC_UPSTA5_NBUSYBK_Pos) /**< \brief (USBC_UPSTA5) Number of Busy Bank */ +#define USBC_UPSTA5_NBUSYBK(value) ((USBC_UPSTA5_NBUSYBK_Msk & ((value) << USBC_UPSTA5_NBUSYBK_Pos))) +#define USBC_UPSTA5_CURRBK_Pos 14 +#define USBC_UPSTA5_CURRBK_Msk (0x3u << USBC_UPSTA5_CURRBK_Pos) /**< \brief (USBC_UPSTA5) Current Bank */ +#define USBC_UPSTA5_CURRBK(value) ((USBC_UPSTA5_CURRBK_Msk & ((value) << USBC_UPSTA5_CURRBK_Pos))) +/* -------- USBC_UPSTA6 : (USBC Offset: 0x548) Pipe Status Register -------- */ +#define USBC_UPSTA6_RXINI (0x1u << 0) /**< \brief (USBC_UPSTA6) Received IN Data Interrupt */ +#define USBC_UPSTA6_TXOUTI (0x1u << 1) /**< \brief (USBC_UPSTA6) Transmitted OUT Data Interrupt */ +#define USBC_UPSTA6_TXSTPI (0x1u << 2) /**< \brief (USBC_UPSTA6) Transmitted SETUP Interrupt */ +#define USBC_UPSTA6_PERRI (0x1u << 3) /**< \brief (USBC_UPSTA6) Pipe Error Interrupt */ +#define USBC_UPSTA6_NAKEDI (0x1u << 4) /**< \brief (USBC_UPSTA6) NAKed Interrupt */ +#define USBC_UPSTA6_ERRORFI (0x1u << 5) /**< \brief (USBC_UPSTA6) Errorflow Interrupt */ +#define USBC_UPSTA6_RXSTALLDI (0x1u << 6) /**< \brief (USBC_UPSTA6) Received STALLed Interrupt */ +#define USBC_UPSTA6_DTSEQ_Pos 8 +#define USBC_UPSTA6_DTSEQ_Msk (0x3u << USBC_UPSTA6_DTSEQ_Pos) /**< \brief (USBC_UPSTA6) Data Toggle Sequence */ +#define USBC_UPSTA6_DTSEQ(value) ((USBC_UPSTA6_DTSEQ_Msk & ((value) << USBC_UPSTA6_DTSEQ_Pos))) +#define USBC_UPSTA6_RAMACERI (0x1u << 10) /**< \brief (USBC_UPSTA6) Ram Access Error Interrupt */ +#define USBC_UPSTA6_NBUSYBK_Pos 12 +#define USBC_UPSTA6_NBUSYBK_Msk (0x3u << USBC_UPSTA6_NBUSYBK_Pos) /**< \brief (USBC_UPSTA6) Number of Busy Bank */ +#define USBC_UPSTA6_NBUSYBK(value) ((USBC_UPSTA6_NBUSYBK_Msk & ((value) << USBC_UPSTA6_NBUSYBK_Pos))) +#define USBC_UPSTA6_CURRBK_Pos 14 +#define USBC_UPSTA6_CURRBK_Msk (0x3u << USBC_UPSTA6_CURRBK_Pos) /**< \brief (USBC_UPSTA6) Current Bank */ +#define USBC_UPSTA6_CURRBK(value) ((USBC_UPSTA6_CURRBK_Msk & ((value) << USBC_UPSTA6_CURRBK_Pos))) +/* -------- USBC_UPSTA7 : (USBC Offset: 0x54C) Pipe Status Register -------- */ +#define USBC_UPSTA7_RXINI (0x1u << 0) /**< \brief (USBC_UPSTA7) Received IN Data Interrupt */ +#define USBC_UPSTA7_TXOUTI (0x1u << 1) /**< \brief (USBC_UPSTA7) Transmitted OUT Data Interrupt */ +#define USBC_UPSTA7_TXSTPI (0x1u << 2) /**< \brief (USBC_UPSTA7) Transmitted SETUP Interrupt */ +#define USBC_UPSTA7_PERRI (0x1u << 3) /**< \brief (USBC_UPSTA7) Pipe Error Interrupt */ +#define USBC_UPSTA7_NAKEDI (0x1u << 4) /**< \brief (USBC_UPSTA7) NAKed Interrupt */ +#define USBC_UPSTA7_ERRORFI (0x1u << 5) /**< \brief (USBC_UPSTA7) Errorflow Interrupt */ +#define USBC_UPSTA7_RXSTALLDI (0x1u << 6) /**< \brief (USBC_UPSTA7) Received STALLed Interrupt */ +#define USBC_UPSTA7_DTSEQ_Pos 8 +#define USBC_UPSTA7_DTSEQ_Msk (0x3u << USBC_UPSTA7_DTSEQ_Pos) /**< \brief (USBC_UPSTA7) Data Toggle Sequence */ +#define USBC_UPSTA7_DTSEQ(value) ((USBC_UPSTA7_DTSEQ_Msk & ((value) << USBC_UPSTA7_DTSEQ_Pos))) +#define USBC_UPSTA7_RAMACERI (0x1u << 10) /**< \brief (USBC_UPSTA7) Ram Access Error Interrupt */ +#define USBC_UPSTA7_NBUSYBK_Pos 12 +#define USBC_UPSTA7_NBUSYBK_Msk (0x3u << USBC_UPSTA7_NBUSYBK_Pos) /**< \brief (USBC_UPSTA7) Number of Busy Bank */ +#define USBC_UPSTA7_NBUSYBK(value) ((USBC_UPSTA7_NBUSYBK_Msk & ((value) << USBC_UPSTA7_NBUSYBK_Pos))) +#define USBC_UPSTA7_CURRBK_Pos 14 +#define USBC_UPSTA7_CURRBK_Msk (0x3u << USBC_UPSTA7_CURRBK_Pos) /**< \brief (USBC_UPSTA7) Current Bank */ +#define USBC_UPSTA7_CURRBK(value) ((USBC_UPSTA7_CURRBK_Msk & ((value) << USBC_UPSTA7_CURRBK_Pos))) +/* -------- USBC_UPSTA0CLR : (USBC Offset: 0x560) Pipe Status Clear Register -------- */ +#define USBC_UPSTA0CLR_RXINIC (0x1u << 0) /**< \brief (USBC_UPSTA0CLR) RXINI Clear */ +#define USBC_UPSTA0CLR_TXOUTIC (0x1u << 1) /**< \brief (USBC_UPSTA0CLR) TXOUTI Clear */ +#define USBC_UPSTA0CLR_TXSTPIC (0x1u << 2) /**< \brief (USBC_UPSTA0CLR) TXSTPI Clear */ +#define USBC_UPSTA0CLR_PERRIC (0x1u << 3) /**< \brief (USBC_UPSTA0CLR) PERRI Clear */ +#define USBC_UPSTA0CLR_NAKEDIC (0x1u << 4) /**< \brief (USBC_UPSTA0CLR) NAKEDI Clear */ +#define USBC_UPSTA0CLR_ERRORFIC (0x1u << 5) /**< \brief (USBC_UPSTA0CLR) ERRORFI Clear */ +#define USBC_UPSTA0CLR_RXSTALLDIC (0x1u << 6) /**< \brief (USBC_UPSTA0CLR) RXSTALLDI Clear */ +#define USBC_UPSTA0CLR_RAMACERIC (0x1u << 10) /**< \brief (USBC_UPSTA0CLR) RAMACERI Clear */ +/* -------- USBC_UPSTA1CLR : (USBC Offset: 0x564) Pipe Status Clear Register -------- */ +#define USBC_UPSTA1CLR_RXINIC (0x1u << 0) /**< \brief (USBC_UPSTA1CLR) RXINI Clear */ +#define USBC_UPSTA1CLR_TXOUTIC (0x1u << 1) /**< \brief (USBC_UPSTA1CLR) TXOUTI Clear */ +#define USBC_UPSTA1CLR_TXSTPIC (0x1u << 2) /**< \brief (USBC_UPSTA1CLR) TXSTPI Clear */ +#define USBC_UPSTA1CLR_PERRIC (0x1u << 3) /**< \brief (USBC_UPSTA1CLR) PERRI Clear */ +#define USBC_UPSTA1CLR_NAKEDIC (0x1u << 4) /**< \brief (USBC_UPSTA1CLR) NAKEDI Clear */ +#define USBC_UPSTA1CLR_ERRORFIC (0x1u << 5) /**< \brief (USBC_UPSTA1CLR) ERRORFI Clear */ +#define USBC_UPSTA1CLR_RXSTALLDIC (0x1u << 6) /**< \brief (USBC_UPSTA1CLR) RXSTALLDI Clear */ +#define USBC_UPSTA1CLR_RAMACERIC (0x1u << 10) /**< \brief (USBC_UPSTA1CLR) RAMACERI Clear */ +/* -------- USBC_UPSTA2CLR : (USBC Offset: 0x568) Pipe Status Clear Register -------- */ +#define USBC_UPSTA2CLR_RXINIC (0x1u << 0) /**< \brief (USBC_UPSTA2CLR) RXINI Clear */ +#define USBC_UPSTA2CLR_TXOUTIC (0x1u << 1) /**< \brief (USBC_UPSTA2CLR) TXOUTI Clear */ +#define USBC_UPSTA2CLR_TXSTPIC (0x1u << 2) /**< \brief (USBC_UPSTA2CLR) TXSTPI Clear */ +#define USBC_UPSTA2CLR_PERRIC (0x1u << 3) /**< \brief (USBC_UPSTA2CLR) PERRI Clear */ +#define USBC_UPSTA2CLR_NAKEDIC (0x1u << 4) /**< \brief (USBC_UPSTA2CLR) NAKEDI Clear */ +#define USBC_UPSTA2CLR_ERRORFIC (0x1u << 5) /**< \brief (USBC_UPSTA2CLR) ERRORFI Clear */ +#define USBC_UPSTA2CLR_RXSTALLDIC (0x1u << 6) /**< \brief (USBC_UPSTA2CLR) RXSTALLDI Clear */ +#define USBC_UPSTA2CLR_RAMACERIC (0x1u << 10) /**< \brief (USBC_UPSTA2CLR) RAMACERI Clear */ +/* -------- USBC_UPSTA3CLR : (USBC Offset: 0x56C) Pipe Status Clear Register -------- */ +#define USBC_UPSTA3CLR_RXINIC (0x1u << 0) /**< \brief (USBC_UPSTA3CLR) RXINI Clear */ +#define USBC_UPSTA3CLR_TXOUTIC (0x1u << 1) /**< \brief (USBC_UPSTA3CLR) TXOUTI Clear */ +#define USBC_UPSTA3CLR_TXSTPIC (0x1u << 2) /**< \brief (USBC_UPSTA3CLR) TXSTPI Clear */ +#define USBC_UPSTA3CLR_PERRIC (0x1u << 3) /**< \brief (USBC_UPSTA3CLR) PERRI Clear */ +#define USBC_UPSTA3CLR_NAKEDIC (0x1u << 4) /**< \brief (USBC_UPSTA3CLR) NAKEDI Clear */ +#define USBC_UPSTA3CLR_ERRORFIC (0x1u << 5) /**< \brief (USBC_UPSTA3CLR) ERRORFI Clear */ +#define USBC_UPSTA3CLR_RXSTALLDIC (0x1u << 6) /**< \brief (USBC_UPSTA3CLR) RXSTALLDI Clear */ +#define USBC_UPSTA3CLR_RAMACERIC (0x1u << 10) /**< \brief (USBC_UPSTA3CLR) RAMACERI Clear */ +/* -------- USBC_UPSTA4CLR : (USBC Offset: 0x570) Pipe Status Clear Register -------- */ +#define USBC_UPSTA4CLR_RXINIC (0x1u << 0) /**< \brief (USBC_UPSTA4CLR) RXINI Clear */ +#define USBC_UPSTA4CLR_TXOUTIC (0x1u << 1) /**< \brief (USBC_UPSTA4CLR) TXOUTI Clear */ +#define USBC_UPSTA4CLR_TXSTPIC (0x1u << 2) /**< \brief (USBC_UPSTA4CLR) TXSTPI Clear */ +#define USBC_UPSTA4CLR_PERRIC (0x1u << 3) /**< \brief (USBC_UPSTA4CLR) PERRI Clear */ +#define USBC_UPSTA4CLR_NAKEDIC (0x1u << 4) /**< \brief (USBC_UPSTA4CLR) NAKEDI Clear */ +#define USBC_UPSTA4CLR_ERRORFIC (0x1u << 5) /**< \brief (USBC_UPSTA4CLR) ERRORFI Clear */ +#define USBC_UPSTA4CLR_RXSTALLDIC (0x1u << 6) /**< \brief (USBC_UPSTA4CLR) RXSTALLDI Clear */ +#define USBC_UPSTA4CLR_RAMACERIC (0x1u << 10) /**< \brief (USBC_UPSTA4CLR) RAMACERI Clear */ +/* -------- USBC_UPSTA5CLR : (USBC Offset: 0x574) Pipe Status Clear Register -------- */ +#define USBC_UPSTA5CLR_RXINIC (0x1u << 0) /**< \brief (USBC_UPSTA5CLR) RXINI Clear */ +#define USBC_UPSTA5CLR_TXOUTIC (0x1u << 1) /**< \brief (USBC_UPSTA5CLR) TXOUTI Clear */ +#define USBC_UPSTA5CLR_TXSTPIC (0x1u << 2) /**< \brief (USBC_UPSTA5CLR) TXSTPI Clear */ +#define USBC_UPSTA5CLR_PERRIC (0x1u << 3) /**< \brief (USBC_UPSTA5CLR) PERRI Clear */ +#define USBC_UPSTA5CLR_NAKEDIC (0x1u << 4) /**< \brief (USBC_UPSTA5CLR) NAKEDI Clear */ +#define USBC_UPSTA5CLR_ERRORFIC (0x1u << 5) /**< \brief (USBC_UPSTA5CLR) ERRORFI Clear */ +#define USBC_UPSTA5CLR_RXSTALLDIC (0x1u << 6) /**< \brief (USBC_UPSTA5CLR) RXSTALLDI Clear */ +#define USBC_UPSTA5CLR_RAMACERIC (0x1u << 10) /**< \brief (USBC_UPSTA5CLR) RAMACERI Clear */ +/* -------- USBC_UPSTA6CLR : (USBC Offset: 0x578) Pipe Status Clear Register -------- */ +#define USBC_UPSTA6CLR_RXINIC (0x1u << 0) /**< \brief (USBC_UPSTA6CLR) RXINI Clear */ +#define USBC_UPSTA6CLR_TXOUTIC (0x1u << 1) /**< \brief (USBC_UPSTA6CLR) TXOUTI Clear */ +#define USBC_UPSTA6CLR_TXSTPIC (0x1u << 2) /**< \brief (USBC_UPSTA6CLR) TXSTPI Clear */ +#define USBC_UPSTA6CLR_PERRIC (0x1u << 3) /**< \brief (USBC_UPSTA6CLR) PERRI Clear */ +#define USBC_UPSTA6CLR_NAKEDIC (0x1u << 4) /**< \brief (USBC_UPSTA6CLR) NAKEDI Clear */ +#define USBC_UPSTA6CLR_ERRORFIC (0x1u << 5) /**< \brief (USBC_UPSTA6CLR) ERRORFI Clear */ +#define USBC_UPSTA6CLR_RXSTALLDIC (0x1u << 6) /**< \brief (USBC_UPSTA6CLR) RXSTALLDI Clear */ +#define USBC_UPSTA6CLR_RAMACERIC (0x1u << 10) /**< \brief (USBC_UPSTA6CLR) RAMACERI Clear */ +/* -------- USBC_UPSTA7CLR : (USBC Offset: 0x57C) Pipe Status Clear Register -------- */ +#define USBC_UPSTA7CLR_RXINIC (0x1u << 0) /**< \brief (USBC_UPSTA7CLR) RXINI Clear */ +#define USBC_UPSTA7CLR_TXOUTIC (0x1u << 1) /**< \brief (USBC_UPSTA7CLR) TXOUTI Clear */ +#define USBC_UPSTA7CLR_TXSTPIC (0x1u << 2) /**< \brief (USBC_UPSTA7CLR) TXSTPI Clear */ +#define USBC_UPSTA7CLR_PERRIC (0x1u << 3) /**< \brief (USBC_UPSTA7CLR) PERRI Clear */ +#define USBC_UPSTA7CLR_NAKEDIC (0x1u << 4) /**< \brief (USBC_UPSTA7CLR) NAKEDI Clear */ +#define USBC_UPSTA7CLR_ERRORFIC (0x1u << 5) /**< \brief (USBC_UPSTA7CLR) ERRORFI Clear */ +#define USBC_UPSTA7CLR_RXSTALLDIC (0x1u << 6) /**< \brief (USBC_UPSTA7CLR) RXSTALLDI Clear */ +#define USBC_UPSTA7CLR_RAMACERIC (0x1u << 10) /**< \brief (USBC_UPSTA7CLR) RAMACERI Clear */ +/* -------- USBC_UPSTA0SET : (USBC Offset: 0x590) Pipe Status Set Register -------- */ +#define USBC_UPSTA0SET_RXINIS (0x1u << 0) /**< \brief (USBC_UPSTA0SET) RXINI Set */ +#define USBC_UPSTA0SET_TXOUTIS (0x1u << 1) /**< \brief (USBC_UPSTA0SET) TXOUTI Set */ +#define USBC_UPSTA0SET_TXSTPIS (0x1u << 2) /**< \brief (USBC_UPSTA0SET) TXSTPI Set */ +#define USBC_UPSTA0SET_PERRIS (0x1u << 3) /**< \brief (USBC_UPSTA0SET) PERRI Set */ +#define USBC_UPSTA0SET_NAKEDIS (0x1u << 4) /**< \brief (USBC_UPSTA0SET) NAKEDI Set */ +#define USBC_UPSTA0SET_ERRORFIS (0x1u << 5) /**< \brief (USBC_UPSTA0SET) ERRORFI Set */ +#define USBC_UPSTA0SET_RXSTALLDIS (0x1u << 6) /**< \brief (USBC_UPSTA0SET) RXSTALLDI Set */ +#define USBC_UPSTA0SET_RAMACERIS (0x1u << 10) /**< \brief (USBC_UPSTA0SET) RAMACERI Set */ +/* -------- USBC_UPSTA1SET : (USBC Offset: 0x594) Pipe Status Set Register -------- */ +#define USBC_UPSTA1SET_RXINIS (0x1u << 0) /**< \brief (USBC_UPSTA1SET) RXINI Set */ +#define USBC_UPSTA1SET_TXOUTIS (0x1u << 1) /**< \brief (USBC_UPSTA1SET) TXOUTI Set */ +#define USBC_UPSTA1SET_TXSTPIS (0x1u << 2) /**< \brief (USBC_UPSTA1SET) TXSTPI Set */ +#define USBC_UPSTA1SET_PERRIS (0x1u << 3) /**< \brief (USBC_UPSTA1SET) PERRI Set */ +#define USBC_UPSTA1SET_NAKEDIS (0x1u << 4) /**< \brief (USBC_UPSTA1SET) NAKEDI Set */ +#define USBC_UPSTA1SET_ERRORFIS (0x1u << 5) /**< \brief (USBC_UPSTA1SET) ERRORFI Set */ +#define USBC_UPSTA1SET_RXSTALLDIS (0x1u << 6) /**< \brief (USBC_UPSTA1SET) RXSTALLDI Set */ +#define USBC_UPSTA1SET_RAMACERIS (0x1u << 10) /**< \brief (USBC_UPSTA1SET) RAMACERI Set */ +/* -------- USBC_UPSTA2SET : (USBC Offset: 0x598) Pipe Status Set Register -------- */ +#define USBC_UPSTA2SET_RXINIS (0x1u << 0) /**< \brief (USBC_UPSTA2SET) RXINI Set */ +#define USBC_UPSTA2SET_TXOUTIS (0x1u << 1) /**< \brief (USBC_UPSTA2SET) TXOUTI Set */ +#define USBC_UPSTA2SET_TXSTPIS (0x1u << 2) /**< \brief (USBC_UPSTA2SET) TXSTPI Set */ +#define USBC_UPSTA2SET_PERRIS (0x1u << 3) /**< \brief (USBC_UPSTA2SET) PERRI Set */ +#define USBC_UPSTA2SET_NAKEDIS (0x1u << 4) /**< \brief (USBC_UPSTA2SET) NAKEDI Set */ +#define USBC_UPSTA2SET_ERRORFIS (0x1u << 5) /**< \brief (USBC_UPSTA2SET) ERRORFI Set */ +#define USBC_UPSTA2SET_RXSTALLDIS (0x1u << 6) /**< \brief (USBC_UPSTA2SET) RXSTALLDI Set */ +#define USBC_UPSTA2SET_RAMACERIS (0x1u << 10) /**< \brief (USBC_UPSTA2SET) RAMACERI Set */ +/* -------- USBC_UPSTA3SET : (USBC Offset: 0x59C) Pipe Status Set Register -------- */ +#define USBC_UPSTA3SET_RXINIS (0x1u << 0) /**< \brief (USBC_UPSTA3SET) RXINI Set */ +#define USBC_UPSTA3SET_TXOUTIS (0x1u << 1) /**< \brief (USBC_UPSTA3SET) TXOUTI Set */ +#define USBC_UPSTA3SET_TXSTPIS (0x1u << 2) /**< \brief (USBC_UPSTA3SET) TXSTPI Set */ +#define USBC_UPSTA3SET_PERRIS (0x1u << 3) /**< \brief (USBC_UPSTA3SET) PERRI Set */ +#define USBC_UPSTA3SET_NAKEDIS (0x1u << 4) /**< \brief (USBC_UPSTA3SET) NAKEDI Set */ +#define USBC_UPSTA3SET_ERRORFIS (0x1u << 5) /**< \brief (USBC_UPSTA3SET) ERRORFI Set */ +#define USBC_UPSTA3SET_RXSTALLDIS (0x1u << 6) /**< \brief (USBC_UPSTA3SET) RXSTALLDI Set */ +#define USBC_UPSTA3SET_RAMACERIS (0x1u << 10) /**< \brief (USBC_UPSTA3SET) RAMACERI Set */ +/* -------- USBC_UPSTA4SET : (USBC Offset: 0x5A0) Pipe Status Set Register -------- */ +#define USBC_UPSTA4SET_RXINIS (0x1u << 0) /**< \brief (USBC_UPSTA4SET) RXINI Set */ +#define USBC_UPSTA4SET_TXOUTIS (0x1u << 1) /**< \brief (USBC_UPSTA4SET) TXOUTI Set */ +#define USBC_UPSTA4SET_TXSTPIS (0x1u << 2) /**< \brief (USBC_UPSTA4SET) TXSTPI Set */ +#define USBC_UPSTA4SET_PERRIS (0x1u << 3) /**< \brief (USBC_UPSTA4SET) PERRI Set */ +#define USBC_UPSTA4SET_NAKEDIS (0x1u << 4) /**< \brief (USBC_UPSTA4SET) NAKEDI Set */ +#define USBC_UPSTA4SET_ERRORFIS (0x1u << 5) /**< \brief (USBC_UPSTA4SET) ERRORFI Set */ +#define USBC_UPSTA4SET_RXSTALLDIS (0x1u << 6) /**< \brief (USBC_UPSTA4SET) RXSTALLDI Set */ +#define USBC_UPSTA4SET_RAMACERIS (0x1u << 10) /**< \brief (USBC_UPSTA4SET) RAMACERI Set */ +/* -------- USBC_UPSTA5SET : (USBC Offset: 0x5A4) Pipe Status Set Register -------- */ +#define USBC_UPSTA5SET_RXINIS (0x1u << 0) /**< \brief (USBC_UPSTA5SET) RXINI Set */ +#define USBC_UPSTA5SET_TXOUTIS (0x1u << 1) /**< \brief (USBC_UPSTA5SET) TXOUTI Set */ +#define USBC_UPSTA5SET_TXSTPIS (0x1u << 2) /**< \brief (USBC_UPSTA5SET) TXSTPI Set */ +#define USBC_UPSTA5SET_PERRIS (0x1u << 3) /**< \brief (USBC_UPSTA5SET) PERRI Set */ +#define USBC_UPSTA5SET_NAKEDIS (0x1u << 4) /**< \brief (USBC_UPSTA5SET) NAKEDI Set */ +#define USBC_UPSTA5SET_ERRORFIS (0x1u << 5) /**< \brief (USBC_UPSTA5SET) ERRORFI Set */ +#define USBC_UPSTA5SET_RXSTALLDIS (0x1u << 6) /**< \brief (USBC_UPSTA5SET) RXSTALLDI Set */ +#define USBC_UPSTA5SET_RAMACERIS (0x1u << 10) /**< \brief (USBC_UPSTA5SET) RAMACERI Set */ +/* -------- USBC_UPSTA6SET : (USBC Offset: 0x5A8) Pipe Status Set Register -------- */ +#define USBC_UPSTA6SET_RXINIS (0x1u << 0) /**< \brief (USBC_UPSTA6SET) RXINI Set */ +#define USBC_UPSTA6SET_TXOUTIS (0x1u << 1) /**< \brief (USBC_UPSTA6SET) TXOUTI Set */ +#define USBC_UPSTA6SET_TXSTPIS (0x1u << 2) /**< \brief (USBC_UPSTA6SET) TXSTPI Set */ +#define USBC_UPSTA6SET_PERRIS (0x1u << 3) /**< \brief (USBC_UPSTA6SET) PERRI Set */ +#define USBC_UPSTA6SET_NAKEDIS (0x1u << 4) /**< \brief (USBC_UPSTA6SET) NAKEDI Set */ +#define USBC_UPSTA6SET_ERRORFIS (0x1u << 5) /**< \brief (USBC_UPSTA6SET) ERRORFI Set */ +#define USBC_UPSTA6SET_RXSTALLDIS (0x1u << 6) /**< \brief (USBC_UPSTA6SET) RXSTALLDI Set */ +#define USBC_UPSTA6SET_RAMACERIS (0x1u << 10) /**< \brief (USBC_UPSTA6SET) RAMACERI Set */ +/* -------- USBC_UPSTA7SET : (USBC Offset: 0x5AC) Pipe Status Set Register -------- */ +#define USBC_UPSTA7SET_RXINIS (0x1u << 0) /**< \brief (USBC_UPSTA7SET) RXINI Set */ +#define USBC_UPSTA7SET_TXOUTIS (0x1u << 1) /**< \brief (USBC_UPSTA7SET) TXOUTI Set */ +#define USBC_UPSTA7SET_TXSTPIS (0x1u << 2) /**< \brief (USBC_UPSTA7SET) TXSTPI Set */ +#define USBC_UPSTA7SET_PERRIS (0x1u << 3) /**< \brief (USBC_UPSTA7SET) PERRI Set */ +#define USBC_UPSTA7SET_NAKEDIS (0x1u << 4) /**< \brief (USBC_UPSTA7SET) NAKEDI Set */ +#define USBC_UPSTA7SET_ERRORFIS (0x1u << 5) /**< \brief (USBC_UPSTA7SET) ERRORFI Set */ +#define USBC_UPSTA7SET_RXSTALLDIS (0x1u << 6) /**< \brief (USBC_UPSTA7SET) RXSTALLDI Set */ +#define USBC_UPSTA7SET_RAMACERIS (0x1u << 10) /**< \brief (USBC_UPSTA7SET) RAMACERI Set */ +/* -------- USBC_UPCON0 : (USBC Offset: 0x5C0) Pipe Control Register -------- */ +#define USBC_UPCON0_RXINE (0x1u << 0) /**< \brief (USBC_UPCON0) RXIN Interrupt Enable */ +#define USBC_UPCON0_TXOUTE (0x1u << 1) /**< \brief (USBC_UPCON0) TXOUT Interrupt Enable */ +#define USBC_UPCON0_TXSTPE (0x1u << 2) /**< \brief (USBC_UPCON0) TXSTP Interrupt Enable */ +#define USBC_UPCON0_PERRE (0x1u << 3) /**< \brief (USBC_UPCON0) PERR Interrupt Enable */ +#define USBC_UPCON0_NAKEDE (0x1u << 4) /**< \brief (USBC_UPCON0) NAKED Interrupt Enable */ +#define USBC_UPCON0_ERRORFIE (0x1u << 5) /**< \brief (USBC_UPCON0) ERRORFI Interrupt Enable */ +#define USBC_UPCON0_RXSTALLDE (0x1u << 6) /**< \brief (USBC_UPCON0) RXTALLD Interrupt Enable */ +#define USBC_UPCON0_RAMACERE (0x1u << 10) /**< \brief (USBC_UPCON0) RAMACER Interrupt Enable */ +#define USBC_UPCON0_NBUSYBKE (0x1u << 12) /**< \brief (USBC_UPCON0) NBUSYBKInterrupt Enable */ +#define USBC_UPCON0_FIFOCON (0x1u << 14) /**< \brief (USBC_UPCON0) FIFO Control */ +#define USBC_UPCON0_PFREEZE (0x1u << 17) /**< \brief (USBC_UPCON0) Pipe Freeze */ +#define USBC_UPCON0_INITDTGL (0x1u << 18) /**< \brief (USBC_UPCON0) Data Toggle Initialization */ +#define USBC_UPCON0_INITBK (0x1u << 19) /**< \brief (USBC_UPCON0) Bank Initialization */ +/* -------- USBC_UPCON1 : (USBC Offset: 0x5C4) Pipe Control Register -------- */ +#define USBC_UPCON1_RXINE (0x1u << 0) /**< \brief (USBC_UPCON1) RXIN Interrupt Enable */ +#define USBC_UPCON1_TXOUTE (0x1u << 1) /**< \brief (USBC_UPCON1) TXOUT Interrupt Enable */ +#define USBC_UPCON1_TXSTPE (0x1u << 2) /**< \brief (USBC_UPCON1) TXSTP Interrupt Enable */ +#define USBC_UPCON1_PERRE (0x1u << 3) /**< \brief (USBC_UPCON1) PERR Interrupt Enable */ +#define USBC_UPCON1_NAKEDE (0x1u << 4) /**< \brief (USBC_UPCON1) NAKED Interrupt Enable */ +#define USBC_UPCON1_ERRORFIE (0x1u << 5) /**< \brief (USBC_UPCON1) ERRORFI Interrupt Enable */ +#define USBC_UPCON1_RXSTALLDE (0x1u << 6) /**< \brief (USBC_UPCON1) RXTALLD Interrupt Enable */ +#define USBC_UPCON1_RAMACERE (0x1u << 10) /**< \brief (USBC_UPCON1) RAMACER Interrupt Enable */ +#define USBC_UPCON1_NBUSYBKE (0x1u << 12) /**< \brief (USBC_UPCON1) NBUSYBKInterrupt Enable */ +#define USBC_UPCON1_FIFOCON (0x1u << 14) /**< \brief (USBC_UPCON1) FIFO Control */ +#define USBC_UPCON1_PFREEZE (0x1u << 17) /**< \brief (USBC_UPCON1) Pipe Freeze */ +#define USBC_UPCON1_INITDTGL (0x1u << 18) /**< \brief (USBC_UPCON1) Data Toggle Initialization */ +#define USBC_UPCON1_INITBK (0x1u << 19) /**< \brief (USBC_UPCON1) Bank Initialization */ +/* -------- USBC_UPCON2 : (USBC Offset: 0x5C8) Pipe Control Register -------- */ +#define USBC_UPCON2_RXINE (0x1u << 0) /**< \brief (USBC_UPCON2) RXIN Interrupt Enable */ +#define USBC_UPCON2_TXOUTE (0x1u << 1) /**< \brief (USBC_UPCON2) TXOUT Interrupt Enable */ +#define USBC_UPCON2_TXSTPE (0x1u << 2) /**< \brief (USBC_UPCON2) TXSTP Interrupt Enable */ +#define USBC_UPCON2_PERRE (0x1u << 3) /**< \brief (USBC_UPCON2) PERR Interrupt Enable */ +#define USBC_UPCON2_NAKEDE (0x1u << 4) /**< \brief (USBC_UPCON2) NAKED Interrupt Enable */ +#define USBC_UPCON2_ERRORFIE (0x1u << 5) /**< \brief (USBC_UPCON2) ERRORFI Interrupt Enable */ +#define USBC_UPCON2_RXSTALLDE (0x1u << 6) /**< \brief (USBC_UPCON2) RXTALLD Interrupt Enable */ +#define USBC_UPCON2_RAMACERE (0x1u << 10) /**< \brief (USBC_UPCON2) RAMACER Interrupt Enable */ +#define USBC_UPCON2_NBUSYBKE (0x1u << 12) /**< \brief (USBC_UPCON2) NBUSYBKInterrupt Enable */ +#define USBC_UPCON2_FIFOCON (0x1u << 14) /**< \brief (USBC_UPCON2) FIFO Control */ +#define USBC_UPCON2_PFREEZE (0x1u << 17) /**< \brief (USBC_UPCON2) Pipe Freeze */ +#define USBC_UPCON2_INITDTGL (0x1u << 18) /**< \brief (USBC_UPCON2) Data Toggle Initialization */ +#define USBC_UPCON2_INITBK (0x1u << 19) /**< \brief (USBC_UPCON2) Bank Initialization */ +/* -------- USBC_UPCON3 : (USBC Offset: 0x5CC) Pipe Control Register -------- */ +#define USBC_UPCON3_RXINE (0x1u << 0) /**< \brief (USBC_UPCON3) RXIN Interrupt Enable */ +#define USBC_UPCON3_TXOUTE (0x1u << 1) /**< \brief (USBC_UPCON3) TXOUT Interrupt Enable */ +#define USBC_UPCON3_TXSTPE (0x1u << 2) /**< \brief (USBC_UPCON3) TXSTP Interrupt Enable */ +#define USBC_UPCON3_PERRE (0x1u << 3) /**< \brief (USBC_UPCON3) PERR Interrupt Enable */ +#define USBC_UPCON3_NAKEDE (0x1u << 4) /**< \brief (USBC_UPCON3) NAKED Interrupt Enable */ +#define USBC_UPCON3_ERRORFIE (0x1u << 5) /**< \brief (USBC_UPCON3) ERRORFI Interrupt Enable */ +#define USBC_UPCON3_RXSTALLDE (0x1u << 6) /**< \brief (USBC_UPCON3) RXTALLD Interrupt Enable */ +#define USBC_UPCON3_RAMACERE (0x1u << 10) /**< \brief (USBC_UPCON3) RAMACER Interrupt Enable */ +#define USBC_UPCON3_NBUSYBKE (0x1u << 12) /**< \brief (USBC_UPCON3) NBUSYBKInterrupt Enable */ +#define USBC_UPCON3_FIFOCON (0x1u << 14) /**< \brief (USBC_UPCON3) FIFO Control */ +#define USBC_UPCON3_PFREEZE (0x1u << 17) /**< \brief (USBC_UPCON3) Pipe Freeze */ +#define USBC_UPCON3_INITDTGL (0x1u << 18) /**< \brief (USBC_UPCON3) Data Toggle Initialization */ +#define USBC_UPCON3_INITBK (0x1u << 19) /**< \brief (USBC_UPCON3) Bank Initialization */ +/* -------- USBC_UPCON4 : (USBC Offset: 0x5D0) Pipe Control Register -------- */ +#define USBC_UPCON4_RXINE (0x1u << 0) /**< \brief (USBC_UPCON4) RXIN Interrupt Enable */ +#define USBC_UPCON4_TXOUTE (0x1u << 1) /**< \brief (USBC_UPCON4) TXOUT Interrupt Enable */ +#define USBC_UPCON4_TXSTPE (0x1u << 2) /**< \brief (USBC_UPCON4) TXSTP Interrupt Enable */ +#define USBC_UPCON4_PERRE (0x1u << 3) /**< \brief (USBC_UPCON4) PERR Interrupt Enable */ +#define USBC_UPCON4_NAKEDE (0x1u << 4) /**< \brief (USBC_UPCON4) NAKED Interrupt Enable */ +#define USBC_UPCON4_ERRORFIE (0x1u << 5) /**< \brief (USBC_UPCON4) ERRORFI Interrupt Enable */ +#define USBC_UPCON4_RXSTALLDE (0x1u << 6) /**< \brief (USBC_UPCON4) RXTALLD Interrupt Enable */ +#define USBC_UPCON4_RAMACERE (0x1u << 10) /**< \brief (USBC_UPCON4) RAMACER Interrupt Enable */ +#define USBC_UPCON4_NBUSYBKE (0x1u << 12) /**< \brief (USBC_UPCON4) NBUSYBKInterrupt Enable */ +#define USBC_UPCON4_FIFOCON (0x1u << 14) /**< \brief (USBC_UPCON4) FIFO Control */ +#define USBC_UPCON4_PFREEZE (0x1u << 17) /**< \brief (USBC_UPCON4) Pipe Freeze */ +#define USBC_UPCON4_INITDTGL (0x1u << 18) /**< \brief (USBC_UPCON4) Data Toggle Initialization */ +#define USBC_UPCON4_INITBK (0x1u << 19) /**< \brief (USBC_UPCON4) Bank Initialization */ +/* -------- USBC_UPCON5 : (USBC Offset: 0x5D4) Pipe Control Register -------- */ +#define USBC_UPCON5_RXINE (0x1u << 0) /**< \brief (USBC_UPCON5) RXIN Interrupt Enable */ +#define USBC_UPCON5_TXOUTE (0x1u << 1) /**< \brief (USBC_UPCON5) TXOUT Interrupt Enable */ +#define USBC_UPCON5_TXSTPE (0x1u << 2) /**< \brief (USBC_UPCON5) TXSTP Interrupt Enable */ +#define USBC_UPCON5_PERRE (0x1u << 3) /**< \brief (USBC_UPCON5) PERR Interrupt Enable */ +#define USBC_UPCON5_NAKEDE (0x1u << 4) /**< \brief (USBC_UPCON5) NAKED Interrupt Enable */ +#define USBC_UPCON5_ERRORFIE (0x1u << 5) /**< \brief (USBC_UPCON5) ERRORFI Interrupt Enable */ +#define USBC_UPCON5_RXSTALLDE (0x1u << 6) /**< \brief (USBC_UPCON5) RXTALLD Interrupt Enable */ +#define USBC_UPCON5_RAMACERE (0x1u << 10) /**< \brief (USBC_UPCON5) RAMACER Interrupt Enable */ +#define USBC_UPCON5_NBUSYBKE (0x1u << 12) /**< \brief (USBC_UPCON5) NBUSYBKInterrupt Enable */ +#define USBC_UPCON5_FIFOCON (0x1u << 14) /**< \brief (USBC_UPCON5) FIFO Control */ +#define USBC_UPCON5_PFREEZE (0x1u << 17) /**< \brief (USBC_UPCON5) Pipe Freeze */ +#define USBC_UPCON5_INITDTGL (0x1u << 18) /**< \brief (USBC_UPCON5) Data Toggle Initialization */ +#define USBC_UPCON5_INITBK (0x1u << 19) /**< \brief (USBC_UPCON5) Bank Initialization */ +/* -------- USBC_UPCON6 : (USBC Offset: 0x5D8) Pipe Control Register -------- */ +#define USBC_UPCON6_RXINE (0x1u << 0) /**< \brief (USBC_UPCON6) RXIN Interrupt Enable */ +#define USBC_UPCON6_TXOUTE (0x1u << 1) /**< \brief (USBC_UPCON6) TXOUT Interrupt Enable */ +#define USBC_UPCON6_TXSTPE (0x1u << 2) /**< \brief (USBC_UPCON6) TXSTP Interrupt Enable */ +#define USBC_UPCON6_PERRE (0x1u << 3) /**< \brief (USBC_UPCON6) PERR Interrupt Enable */ +#define USBC_UPCON6_NAKEDE (0x1u << 4) /**< \brief (USBC_UPCON6) NAKED Interrupt Enable */ +#define USBC_UPCON6_ERRORFIE (0x1u << 5) /**< \brief (USBC_UPCON6) ERRORFI Interrupt Enable */ +#define USBC_UPCON6_RXSTALLDE (0x1u << 6) /**< \brief (USBC_UPCON6) RXTALLD Interrupt Enable */ +#define USBC_UPCON6_RAMACERE (0x1u << 10) /**< \brief (USBC_UPCON6) RAMACER Interrupt Enable */ +#define USBC_UPCON6_NBUSYBKE (0x1u << 12) /**< \brief (USBC_UPCON6) NBUSYBKInterrupt Enable */ +#define USBC_UPCON6_FIFOCON (0x1u << 14) /**< \brief (USBC_UPCON6) FIFO Control */ +#define USBC_UPCON6_PFREEZE (0x1u << 17) /**< \brief (USBC_UPCON6) Pipe Freeze */ +#define USBC_UPCON6_INITDTGL (0x1u << 18) /**< \brief (USBC_UPCON6) Data Toggle Initialization */ +#define USBC_UPCON6_INITBK (0x1u << 19) /**< \brief (USBC_UPCON6) Bank Initialization */ +/* -------- USBC_UPCON7 : (USBC Offset: 0x5DC) Pipe Control Register -------- */ +#define USBC_UPCON7_RXINE (0x1u << 0) /**< \brief (USBC_UPCON7) RXIN Interrupt Enable */ +#define USBC_UPCON7_TXOUTE (0x1u << 1) /**< \brief (USBC_UPCON7) TXOUT Interrupt Enable */ +#define USBC_UPCON7_TXSTPE (0x1u << 2) /**< \brief (USBC_UPCON7) TXSTP Interrupt Enable */ +#define USBC_UPCON7_PERRE (0x1u << 3) /**< \brief (USBC_UPCON7) PERR Interrupt Enable */ +#define USBC_UPCON7_NAKEDE (0x1u << 4) /**< \brief (USBC_UPCON7) NAKED Interrupt Enable */ +#define USBC_UPCON7_ERRORFIE (0x1u << 5) /**< \brief (USBC_UPCON7) ERRORFI Interrupt Enable */ +#define USBC_UPCON7_RXSTALLDE (0x1u << 6) /**< \brief (USBC_UPCON7) RXTALLD Interrupt Enable */ +#define USBC_UPCON7_RAMACERE (0x1u << 10) /**< \brief (USBC_UPCON7) RAMACER Interrupt Enable */ +#define USBC_UPCON7_NBUSYBKE (0x1u << 12) /**< \brief (USBC_UPCON7) NBUSYBKInterrupt Enable */ +#define USBC_UPCON7_FIFOCON (0x1u << 14) /**< \brief (USBC_UPCON7) FIFO Control */ +#define USBC_UPCON7_PFREEZE (0x1u << 17) /**< \brief (USBC_UPCON7) Pipe Freeze */ +#define USBC_UPCON7_INITDTGL (0x1u << 18) /**< \brief (USBC_UPCON7) Data Toggle Initialization */ +#define USBC_UPCON7_INITBK (0x1u << 19) /**< \brief (USBC_UPCON7) Bank Initialization */ +/* -------- USBC_UPCON0SET : (USBC Offset: 0x5F0) Pipe Control Set Register -------- */ +#define USBC_UPCON0SET_RXINES (0x1u << 0) /**< \brief (USBC_UPCON0SET) RXINE Set */ +#define USBC_UPCON0SET_TXOUTES (0x1u << 1) /**< \brief (USBC_UPCON0SET) TXOUTE Set */ +#define USBC_UPCON0SET_TXSTPES (0x1u << 2) /**< \brief (USBC_UPCON0SET) TXSTPE Set */ +#define USBC_UPCON0SET_PERRES (0x1u << 3) /**< \brief (USBC_UPCON0SET) PERRE Set */ +#define USBC_UPCON0SET_NAKEDES (0x1u << 4) /**< \brief (USBC_UPCON0SET) NAKEDE Set */ +#define USBC_UPCON0SET_ERRORFIES (0x1u << 5) /**< \brief (USBC_UPCON0SET) ERRORFIE Set */ +#define USBC_UPCON0SET_RXSTALLDES (0x1u << 6) /**< \brief (USBC_UPCON0SET) RXSTALLDE Set */ +#define USBC_UPCON0SET_RAMACERES (0x1u << 10) /**< \brief (USBC_UPCON0SET) RAMACERE Set */ +#define USBC_UPCON0SET_NBUSYBKES (0x1u << 12) /**< \brief (USBC_UPCON0SET) NBUSYBKE Set */ +#define USBC_UPCON0SET_FIFOCONS (0x1u << 14) /**< \brief (USBC_UPCON0SET) FIFOCON Set */ +#define USBC_UPCON0SET_PFREEZES (0x1u << 17) /**< \brief (USBC_UPCON0SET) PFREEZE Set */ +#define USBC_UPCON0SET_INITDTGLS (0x1u << 18) /**< \brief (USBC_UPCON0SET) INITDTGL Set */ +#define USBC_UPCON0SET_INITBKS (0x1u << 19) /**< \brief (USBC_UPCON0SET) INITBK Set */ +/* -------- USBC_UPCON1SET : (USBC Offset: 0x5F4) Pipe Control Set Register -------- */ +#define USBC_UPCON1SET_RXINES (0x1u << 0) /**< \brief (USBC_UPCON1SET) RXINE Set */ +#define USBC_UPCON1SET_TXOUTES (0x1u << 1) /**< \brief (USBC_UPCON1SET) TXOUTE Set */ +#define USBC_UPCON1SET_TXSTPES (0x1u << 2) /**< \brief (USBC_UPCON1SET) TXSTPE Set */ +#define USBC_UPCON1SET_PERRES (0x1u << 3) /**< \brief (USBC_UPCON1SET) PERRE Set */ +#define USBC_UPCON1SET_NAKEDES (0x1u << 4) /**< \brief (USBC_UPCON1SET) NAKEDE Set */ +#define USBC_UPCON1SET_ERRORFIES (0x1u << 5) /**< \brief (USBC_UPCON1SET) ERRORFIE Set */ +#define USBC_UPCON1SET_RXSTALLDES (0x1u << 6) /**< \brief (USBC_UPCON1SET) RXSTALLDE Set */ +#define USBC_UPCON1SET_RAMACERES (0x1u << 10) /**< \brief (USBC_UPCON1SET) RAMACERE Set */ +#define USBC_UPCON1SET_NBUSYBKES (0x1u << 12) /**< \brief (USBC_UPCON1SET) NBUSYBKE Set */ +#define USBC_UPCON1SET_FIFOCONS (0x1u << 14) /**< \brief (USBC_UPCON1SET) FIFOCON Set */ +#define USBC_UPCON1SET_PFREEZES (0x1u << 17) /**< \brief (USBC_UPCON1SET) PFREEZE Set */ +#define USBC_UPCON1SET_INITDTGLS (0x1u << 18) /**< \brief (USBC_UPCON1SET) INITDTGL Set */ +#define USBC_UPCON1SET_INITBKS (0x1u << 19) /**< \brief (USBC_UPCON1SET) INITBK Set */ +/* -------- USBC_UPCON2SET : (USBC Offset: 0x5F8) Pipe Control Set Register -------- */ +#define USBC_UPCON2SET_RXINES (0x1u << 0) /**< \brief (USBC_UPCON2SET) RXINE Set */ +#define USBC_UPCON2SET_TXOUTES (0x1u << 1) /**< \brief (USBC_UPCON2SET) TXOUTE Set */ +#define USBC_UPCON2SET_TXSTPES (0x1u << 2) /**< \brief (USBC_UPCON2SET) TXSTPE Set */ +#define USBC_UPCON2SET_PERRES (0x1u << 3) /**< \brief (USBC_UPCON2SET) PERRE Set */ +#define USBC_UPCON2SET_NAKEDES (0x1u << 4) /**< \brief (USBC_UPCON2SET) NAKEDE Set */ +#define USBC_UPCON2SET_ERRORFIES (0x1u << 5) /**< \brief (USBC_UPCON2SET) ERRORFIE Set */ +#define USBC_UPCON2SET_RXSTALLDES (0x1u << 6) /**< \brief (USBC_UPCON2SET) RXSTALLDE Set */ +#define USBC_UPCON2SET_RAMACERES (0x1u << 10) /**< \brief (USBC_UPCON2SET) RAMACERE Set */ +#define USBC_UPCON2SET_NBUSYBKES (0x1u << 12) /**< \brief (USBC_UPCON2SET) NBUSYBKE Set */ +#define USBC_UPCON2SET_FIFOCONS (0x1u << 14) /**< \brief (USBC_UPCON2SET) FIFOCON Set */ +#define USBC_UPCON2SET_PFREEZES (0x1u << 17) /**< \brief (USBC_UPCON2SET) PFREEZE Set */ +#define USBC_UPCON2SET_INITDTGLS (0x1u << 18) /**< \brief (USBC_UPCON2SET) INITDTGL Set */ +#define USBC_UPCON2SET_INITBKS (0x1u << 19) /**< \brief (USBC_UPCON2SET) INITBK Set */ +/* -------- USBC_UPCON3SET : (USBC Offset: 0x5FC) Pipe Control Set Register -------- */ +#define USBC_UPCON3SET_RXINES (0x1u << 0) /**< \brief (USBC_UPCON3SET) RXINE Set */ +#define USBC_UPCON3SET_TXOUTES (0x1u << 1) /**< \brief (USBC_UPCON3SET) TXOUTE Set */ +#define USBC_UPCON3SET_TXSTPES (0x1u << 2) /**< \brief (USBC_UPCON3SET) TXSTPE Set */ +#define USBC_UPCON3SET_PERRES (0x1u << 3) /**< \brief (USBC_UPCON3SET) PERRE Set */ +#define USBC_UPCON3SET_NAKEDES (0x1u << 4) /**< \brief (USBC_UPCON3SET) NAKEDE Set */ +#define USBC_UPCON3SET_ERRORFIES (0x1u << 5) /**< \brief (USBC_UPCON3SET) ERRORFIE Set */ +#define USBC_UPCON3SET_RXSTALLDES (0x1u << 6) /**< \brief (USBC_UPCON3SET) RXSTALLDE Set */ +#define USBC_UPCON3SET_RAMACERES (0x1u << 10) /**< \brief (USBC_UPCON3SET) RAMACERE Set */ +#define USBC_UPCON3SET_NBUSYBKES (0x1u << 12) /**< \brief (USBC_UPCON3SET) NBUSYBKE Set */ +#define USBC_UPCON3SET_FIFOCONS (0x1u << 14) /**< \brief (USBC_UPCON3SET) FIFOCON Set */ +#define USBC_UPCON3SET_PFREEZES (0x1u << 17) /**< \brief (USBC_UPCON3SET) PFREEZE Set */ +#define USBC_UPCON3SET_INITDTGLS (0x1u << 18) /**< \brief (USBC_UPCON3SET) INITDTGL Set */ +#define USBC_UPCON3SET_INITBKS (0x1u << 19) /**< \brief (USBC_UPCON3SET) INITBK Set */ +/* -------- USBC_UPCON4SET : (USBC Offset: 0x600) Pipe Control Set Register -------- */ +#define USBC_UPCON4SET_RXINES (0x1u << 0) /**< \brief (USBC_UPCON4SET) RXINE Set */ +#define USBC_UPCON4SET_TXOUTES (0x1u << 1) /**< \brief (USBC_UPCON4SET) TXOUTE Set */ +#define USBC_UPCON4SET_TXSTPES (0x1u << 2) /**< \brief (USBC_UPCON4SET) TXSTPE Set */ +#define USBC_UPCON4SET_PERRES (0x1u << 3) /**< \brief (USBC_UPCON4SET) PERRE Set */ +#define USBC_UPCON4SET_NAKEDES (0x1u << 4) /**< \brief (USBC_UPCON4SET) NAKEDE Set */ +#define USBC_UPCON4SET_ERRORFIES (0x1u << 5) /**< \brief (USBC_UPCON4SET) ERRORFIE Set */ +#define USBC_UPCON4SET_RXSTALLDES (0x1u << 6) /**< \brief (USBC_UPCON4SET) RXSTALLDE Set */ +#define USBC_UPCON4SET_RAMACERES (0x1u << 10) /**< \brief (USBC_UPCON4SET) RAMACERE Set */ +#define USBC_UPCON4SET_NBUSYBKES (0x1u << 12) /**< \brief (USBC_UPCON4SET) NBUSYBKE Set */ +#define USBC_UPCON4SET_FIFOCONS (0x1u << 14) /**< \brief (USBC_UPCON4SET) FIFOCON Set */ +#define USBC_UPCON4SET_PFREEZES (0x1u << 17) /**< \brief (USBC_UPCON4SET) PFREEZE Set */ +#define USBC_UPCON4SET_INITDTGLS (0x1u << 18) /**< \brief (USBC_UPCON4SET) INITDTGL Set */ +#define USBC_UPCON4SET_INITBKS (0x1u << 19) /**< \brief (USBC_UPCON4SET) INITBK Set */ +/* -------- USBC_UPCON5SET : (USBC Offset: 0x604) Pipe Control Set Register -------- */ +#define USBC_UPCON5SET_RXINES (0x1u << 0) /**< \brief (USBC_UPCON5SET) RXINE Set */ +#define USBC_UPCON5SET_TXOUTES (0x1u << 1) /**< \brief (USBC_UPCON5SET) TXOUTE Set */ +#define USBC_UPCON5SET_TXSTPES (0x1u << 2) /**< \brief (USBC_UPCON5SET) TXSTPE Set */ +#define USBC_UPCON5SET_PERRES (0x1u << 3) /**< \brief (USBC_UPCON5SET) PERRE Set */ +#define USBC_UPCON5SET_NAKEDES (0x1u << 4) /**< \brief (USBC_UPCON5SET) NAKEDE Set */ +#define USBC_UPCON5SET_ERRORFIES (0x1u << 5) /**< \brief (USBC_UPCON5SET) ERRORFIE Set */ +#define USBC_UPCON5SET_RXSTALLDES (0x1u << 6) /**< \brief (USBC_UPCON5SET) RXSTALLDE Set */ +#define USBC_UPCON5SET_RAMACERES (0x1u << 10) /**< \brief (USBC_UPCON5SET) RAMACERE Set */ +#define USBC_UPCON5SET_NBUSYBKES (0x1u << 12) /**< \brief (USBC_UPCON5SET) NBUSYBKE Set */ +#define USBC_UPCON5SET_FIFOCONS (0x1u << 14) /**< \brief (USBC_UPCON5SET) FIFOCON Set */ +#define USBC_UPCON5SET_PFREEZES (0x1u << 17) /**< \brief (USBC_UPCON5SET) PFREEZE Set */ +#define USBC_UPCON5SET_INITDTGLS (0x1u << 18) /**< \brief (USBC_UPCON5SET) INITDTGL Set */ +#define USBC_UPCON5SET_INITBKS (0x1u << 19) /**< \brief (USBC_UPCON5SET) INITBK Set */ +/* -------- USBC_UPCON6SET : (USBC Offset: 0x608) Pipe Control Set Register -------- */ +#define USBC_UPCON6SET_RXINES (0x1u << 0) /**< \brief (USBC_UPCON6SET) RXINE Set */ +#define USBC_UPCON6SET_TXOUTES (0x1u << 1) /**< \brief (USBC_UPCON6SET) TXOUTE Set */ +#define USBC_UPCON6SET_TXSTPES (0x1u << 2) /**< \brief (USBC_UPCON6SET) TXSTPE Set */ +#define USBC_UPCON6SET_PERRES (0x1u << 3) /**< \brief (USBC_UPCON6SET) PERRE Set */ +#define USBC_UPCON6SET_NAKEDES (0x1u << 4) /**< \brief (USBC_UPCON6SET) NAKEDE Set */ +#define USBC_UPCON6SET_ERRORFIES (0x1u << 5) /**< \brief (USBC_UPCON6SET) ERRORFIE Set */ +#define USBC_UPCON6SET_RXSTALLDES (0x1u << 6) /**< \brief (USBC_UPCON6SET) RXSTALLDE Set */ +#define USBC_UPCON6SET_RAMACERES (0x1u << 10) /**< \brief (USBC_UPCON6SET) RAMACERE Set */ +#define USBC_UPCON6SET_NBUSYBKES (0x1u << 12) /**< \brief (USBC_UPCON6SET) NBUSYBKE Set */ +#define USBC_UPCON6SET_FIFOCONS (0x1u << 14) /**< \brief (USBC_UPCON6SET) FIFOCON Set */ +#define USBC_UPCON6SET_PFREEZES (0x1u << 17) /**< \brief (USBC_UPCON6SET) PFREEZE Set */ +#define USBC_UPCON6SET_INITDTGLS (0x1u << 18) /**< \brief (USBC_UPCON6SET) INITDTGL Set */ +#define USBC_UPCON6SET_INITBKS (0x1u << 19) /**< \brief (USBC_UPCON6SET) INITBK Set */ +/* -------- USBC_UPCON7SET : (USBC Offset: 0x60C) Pipe Control Set Register -------- */ +#define USBC_UPCON7SET_RXINES (0x1u << 0) /**< \brief (USBC_UPCON7SET) RXINE Set */ +#define USBC_UPCON7SET_TXOUTES (0x1u << 1) /**< \brief (USBC_UPCON7SET) TXOUTE Set */ +#define USBC_UPCON7SET_TXSTPES (0x1u << 2) /**< \brief (USBC_UPCON7SET) TXSTPE Set */ +#define USBC_UPCON7SET_PERRES (0x1u << 3) /**< \brief (USBC_UPCON7SET) PERRE Set */ +#define USBC_UPCON7SET_NAKEDES (0x1u << 4) /**< \brief (USBC_UPCON7SET) NAKEDE Set */ +#define USBC_UPCON7SET_ERRORFIES (0x1u << 5) /**< \brief (USBC_UPCON7SET) ERRORFIE Set */ +#define USBC_UPCON7SET_RXSTALLDES (0x1u << 6) /**< \brief (USBC_UPCON7SET) RXSTALLDE Set */ +#define USBC_UPCON7SET_RAMACERES (0x1u << 10) /**< \brief (USBC_UPCON7SET) RAMACERE Set */ +#define USBC_UPCON7SET_NBUSYBKES (0x1u << 12) /**< \brief (USBC_UPCON7SET) NBUSYBKE Set */ +#define USBC_UPCON7SET_FIFOCONS (0x1u << 14) /**< \brief (USBC_UPCON7SET) FIFOCON Set */ +#define USBC_UPCON7SET_PFREEZES (0x1u << 17) /**< \brief (USBC_UPCON7SET) PFREEZE Set */ +#define USBC_UPCON7SET_INITDTGLS (0x1u << 18) /**< \brief (USBC_UPCON7SET) INITDTGL Set */ +#define USBC_UPCON7SET_INITBKS (0x1u << 19) /**< \brief (USBC_UPCON7SET) INITBK Set */ +/* -------- USBC_UPCON0CLR : (USBC Offset: 0x620) Pipe Control Clear Register -------- */ +#define USBC_UPCON0CLR_RXINEC (0x1u << 0) /**< \brief (USBC_UPCON0CLR) RXINE Clear */ +#define USBC_UPCON0CLR_TXOUTEC (0x1u << 1) /**< \brief (USBC_UPCON0CLR) TXOUTE Clear */ +#define USBC_UPCON0CLR_TXSTPEC (0x1u << 2) /**< \brief (USBC_UPCON0CLR) TXSTPE Clear */ +#define USBC_UPCON0CLR_PERREC (0x1u << 3) /**< \brief (USBC_UPCON0CLR) PERRE Clear */ +#define USBC_UPCON0CLR_NAKEDEC (0x1u << 4) /**< \brief (USBC_UPCON0CLR) NAKEDE Clear */ +#define USBC_UPCON0CLR_ERRORFIEC (0x1u << 5) /**< \brief (USBC_UPCON0CLR) ERRORFIE Clear */ +#define USBC_UPCON0CLR_RXSTALLDEC (0x1u << 6) /**< \brief (USBC_UPCON0CLR) RXTALLDE Clear */ +#define USBC_UPCON0CLR_RAMACEREC (0x1u << 10) /**< \brief (USBC_UPCON0CLR) RAMACERE Clear */ +#define USBC_UPCON0CLR_NBUSYBKEC (0x1u << 12) /**< \brief (USBC_UPCON0CLR) NBUSYBKE Clear */ +#define USBC_UPCON0CLR_FIFOCONC (0x1u << 14) /**< \brief (USBC_UPCON0CLR) FIFOCON Clear */ +#define USBC_UPCON0CLR_PFREEZEC (0x1u << 17) /**< \brief (USBC_UPCON0CLR) PFREEZE Clear */ +#define USBC_UPCON0CLR_INITDTGLC (0x1u << 18) /**< \brief (USBC_UPCON0CLR) INITDTGL Clear */ +#define USBC_UPCON0CLR_INITBKC (0x1u << 19) /**< \brief (USBC_UPCON0CLR) INITBK Clear */ +/* -------- USBC_UPCON1CLR : (USBC Offset: 0x624) Pipe Control Clear Register -------- */ +#define USBC_UPCON1CLR_RXINEC (0x1u << 0) /**< \brief (USBC_UPCON1CLR) RXINE Clear */ +#define USBC_UPCON1CLR_TXOUTEC (0x1u << 1) /**< \brief (USBC_UPCON1CLR) TXOUTE Clear */ +#define USBC_UPCON1CLR_TXSTPEC (0x1u << 2) /**< \brief (USBC_UPCON1CLR) TXSTPE Clear */ +#define USBC_UPCON1CLR_PERREC (0x1u << 3) /**< \brief (USBC_UPCON1CLR) PERRE Clear */ +#define USBC_UPCON1CLR_NAKEDEC (0x1u << 4) /**< \brief (USBC_UPCON1CLR) NAKEDE Clear */ +#define USBC_UPCON1CLR_ERRORFIEC (0x1u << 5) /**< \brief (USBC_UPCON1CLR) ERRORFIE Clear */ +#define USBC_UPCON1CLR_RXSTALLDEC (0x1u << 6) /**< \brief (USBC_UPCON1CLR) RXTALLDE Clear */ +#define USBC_UPCON1CLR_RAMACEREC (0x1u << 10) /**< \brief (USBC_UPCON1CLR) RAMACERE Clear */ +#define USBC_UPCON1CLR_NBUSYBKEC (0x1u << 12) /**< \brief (USBC_UPCON1CLR) NBUSYBKE Clear */ +#define USBC_UPCON1CLR_FIFOCONC (0x1u << 14) /**< \brief (USBC_UPCON1CLR) FIFOCON Clear */ +#define USBC_UPCON1CLR_PFREEZEC (0x1u << 17) /**< \brief (USBC_UPCON1CLR) PFREEZE Clear */ +#define USBC_UPCON1CLR_INITDTGLC (0x1u << 18) /**< \brief (USBC_UPCON1CLR) INITDTGL Clear */ +#define USBC_UPCON1CLR_INITBKC (0x1u << 19) /**< \brief (USBC_UPCON1CLR) INITBK Clear */ +/* -------- USBC_UPCON2CLR : (USBC Offset: 0x628) Pipe Control Clear Register -------- */ +#define USBC_UPCON2CLR_RXINEC (0x1u << 0) /**< \brief (USBC_UPCON2CLR) RXINE Clear */ +#define USBC_UPCON2CLR_TXOUTEC (0x1u << 1) /**< \brief (USBC_UPCON2CLR) TXOUTE Clear */ +#define USBC_UPCON2CLR_TXSTPEC (0x1u << 2) /**< \brief (USBC_UPCON2CLR) TXSTPE Clear */ +#define USBC_UPCON2CLR_PERREC (0x1u << 3) /**< \brief (USBC_UPCON2CLR) PERRE Clear */ +#define USBC_UPCON2CLR_NAKEDEC (0x1u << 4) /**< \brief (USBC_UPCON2CLR) NAKEDE Clear */ +#define USBC_UPCON2CLR_ERRORFIEC (0x1u << 5) /**< \brief (USBC_UPCON2CLR) ERRORFIE Clear */ +#define USBC_UPCON2CLR_RXSTALLDEC (0x1u << 6) /**< \brief (USBC_UPCON2CLR) RXTALLDE Clear */ +#define USBC_UPCON2CLR_RAMACEREC (0x1u << 10) /**< \brief (USBC_UPCON2CLR) RAMACERE Clear */ +#define USBC_UPCON2CLR_NBUSYBKEC (0x1u << 12) /**< \brief (USBC_UPCON2CLR) NBUSYBKE Clear */ +#define USBC_UPCON2CLR_FIFOCONC (0x1u << 14) /**< \brief (USBC_UPCON2CLR) FIFOCON Clear */ +#define USBC_UPCON2CLR_PFREEZEC (0x1u << 17) /**< \brief (USBC_UPCON2CLR) PFREEZE Clear */ +#define USBC_UPCON2CLR_INITDTGLC (0x1u << 18) /**< \brief (USBC_UPCON2CLR) INITDTGL Clear */ +#define USBC_UPCON2CLR_INITBKC (0x1u << 19) /**< \brief (USBC_UPCON2CLR) INITBK Clear */ +/* -------- USBC_UPCON3CLR : (USBC Offset: 0x62C) Pipe Control Clear Register -------- */ +#define USBC_UPCON3CLR_RXINEC (0x1u << 0) /**< \brief (USBC_UPCON3CLR) RXINE Clear */ +#define USBC_UPCON3CLR_TXOUTEC (0x1u << 1) /**< \brief (USBC_UPCON3CLR) TXOUTE Clear */ +#define USBC_UPCON3CLR_TXSTPEC (0x1u << 2) /**< \brief (USBC_UPCON3CLR) TXSTPE Clear */ +#define USBC_UPCON3CLR_PERREC (0x1u << 3) /**< \brief (USBC_UPCON3CLR) PERRE Clear */ +#define USBC_UPCON3CLR_NAKEDEC (0x1u << 4) /**< \brief (USBC_UPCON3CLR) NAKEDE Clear */ +#define USBC_UPCON3CLR_ERRORFIEC (0x1u << 5) /**< \brief (USBC_UPCON3CLR) ERRORFIE Clear */ +#define USBC_UPCON3CLR_RXSTALLDEC (0x1u << 6) /**< \brief (USBC_UPCON3CLR) RXTALLDE Clear */ +#define USBC_UPCON3CLR_RAMACEREC (0x1u << 10) /**< \brief (USBC_UPCON3CLR) RAMACERE Clear */ +#define USBC_UPCON3CLR_NBUSYBKEC (0x1u << 12) /**< \brief (USBC_UPCON3CLR) NBUSYBKE Clear */ +#define USBC_UPCON3CLR_FIFOCONC (0x1u << 14) /**< \brief (USBC_UPCON3CLR) FIFOCON Clear */ +#define USBC_UPCON3CLR_PFREEZEC (0x1u << 17) /**< \brief (USBC_UPCON3CLR) PFREEZE Clear */ +#define USBC_UPCON3CLR_INITDTGLC (0x1u << 18) /**< \brief (USBC_UPCON3CLR) INITDTGL Clear */ +#define USBC_UPCON3CLR_INITBKC (0x1u << 19) /**< \brief (USBC_UPCON3CLR) INITBK Clear */ +/* -------- USBC_UPCON4CLR : (USBC Offset: 0x630) Pipe Control Clear Register -------- */ +#define USBC_UPCON4CLR_RXINEC (0x1u << 0) /**< \brief (USBC_UPCON4CLR) RXINE Clear */ +#define USBC_UPCON4CLR_TXOUTEC (0x1u << 1) /**< \brief (USBC_UPCON4CLR) TXOUTE Clear */ +#define USBC_UPCON4CLR_TXSTPEC (0x1u << 2) /**< \brief (USBC_UPCON4CLR) TXSTPE Clear */ +#define USBC_UPCON4CLR_PERREC (0x1u << 3) /**< \brief (USBC_UPCON4CLR) PERRE Clear */ +#define USBC_UPCON4CLR_NAKEDEC (0x1u << 4) /**< \brief (USBC_UPCON4CLR) NAKEDE Clear */ +#define USBC_UPCON4CLR_ERRORFIEC (0x1u << 5) /**< \brief (USBC_UPCON4CLR) ERRORFIE Clear */ +#define USBC_UPCON4CLR_RXSTALLDEC (0x1u << 6) /**< \brief (USBC_UPCON4CLR) RXTALLDE Clear */ +#define USBC_UPCON4CLR_RAMACEREC (0x1u << 10) /**< \brief (USBC_UPCON4CLR) RAMACERE Clear */ +#define USBC_UPCON4CLR_NBUSYBKEC (0x1u << 12) /**< \brief (USBC_UPCON4CLR) NBUSYBKE Clear */ +#define USBC_UPCON4CLR_FIFOCONC (0x1u << 14) /**< \brief (USBC_UPCON4CLR) FIFOCON Clear */ +#define USBC_UPCON4CLR_PFREEZEC (0x1u << 17) /**< \brief (USBC_UPCON4CLR) PFREEZE Clear */ +#define USBC_UPCON4CLR_INITDTGLC (0x1u << 18) /**< \brief (USBC_UPCON4CLR) INITDTGL Clear */ +#define USBC_UPCON4CLR_INITBKC (0x1u << 19) /**< \brief (USBC_UPCON4CLR) INITBK Clear */ +/* -------- USBC_UPCON5CLR : (USBC Offset: 0x634) Pipe Control Clear Register -------- */ +#define USBC_UPCON5CLR_RXINEC (0x1u << 0) /**< \brief (USBC_UPCON5CLR) RXINE Clear */ +#define USBC_UPCON5CLR_TXOUTEC (0x1u << 1) /**< \brief (USBC_UPCON5CLR) TXOUTE Clear */ +#define USBC_UPCON5CLR_TXSTPEC (0x1u << 2) /**< \brief (USBC_UPCON5CLR) TXSTPE Clear */ +#define USBC_UPCON5CLR_PERREC (0x1u << 3) /**< \brief (USBC_UPCON5CLR) PERRE Clear */ +#define USBC_UPCON5CLR_NAKEDEC (0x1u << 4) /**< \brief (USBC_UPCON5CLR) NAKEDE Clear */ +#define USBC_UPCON5CLR_ERRORFIEC (0x1u << 5) /**< \brief (USBC_UPCON5CLR) ERRORFIE Clear */ +#define USBC_UPCON5CLR_RXSTALLDEC (0x1u << 6) /**< \brief (USBC_UPCON5CLR) RXTALLDE Clear */ +#define USBC_UPCON5CLR_RAMACEREC (0x1u << 10) /**< \brief (USBC_UPCON5CLR) RAMACERE Clear */ +#define USBC_UPCON5CLR_NBUSYBKEC (0x1u << 12) /**< \brief (USBC_UPCON5CLR) NBUSYBKE Clear */ +#define USBC_UPCON5CLR_FIFOCONC (0x1u << 14) /**< \brief (USBC_UPCON5CLR) FIFOCON Clear */ +#define USBC_UPCON5CLR_PFREEZEC (0x1u << 17) /**< \brief (USBC_UPCON5CLR) PFREEZE Clear */ +#define USBC_UPCON5CLR_INITDTGLC (0x1u << 18) /**< \brief (USBC_UPCON5CLR) INITDTGL Clear */ +#define USBC_UPCON5CLR_INITBKC (0x1u << 19) /**< \brief (USBC_UPCON5CLR) INITBK Clear */ +/* -------- USBC_UPCON6CLR : (USBC Offset: 0x638) Pipe Control Clear Register -------- */ +#define USBC_UPCON6CLR_RXINEC (0x1u << 0) /**< \brief (USBC_UPCON6CLR) RXINE Clear */ +#define USBC_UPCON6CLR_TXOUTEC (0x1u << 1) /**< \brief (USBC_UPCON6CLR) TXOUTE Clear */ +#define USBC_UPCON6CLR_TXSTPEC (0x1u << 2) /**< \brief (USBC_UPCON6CLR) TXSTPE Clear */ +#define USBC_UPCON6CLR_PERREC (0x1u << 3) /**< \brief (USBC_UPCON6CLR) PERRE Clear */ +#define USBC_UPCON6CLR_NAKEDEC (0x1u << 4) /**< \brief (USBC_UPCON6CLR) NAKEDE Clear */ +#define USBC_UPCON6CLR_ERRORFIEC (0x1u << 5) /**< \brief (USBC_UPCON6CLR) ERRORFIE Clear */ +#define USBC_UPCON6CLR_RXSTALLDEC (0x1u << 6) /**< \brief (USBC_UPCON6CLR) RXTALLDE Clear */ +#define USBC_UPCON6CLR_RAMACEREC (0x1u << 10) /**< \brief (USBC_UPCON6CLR) RAMACERE Clear */ +#define USBC_UPCON6CLR_NBUSYBKEC (0x1u << 12) /**< \brief (USBC_UPCON6CLR) NBUSYBKE Clear */ +#define USBC_UPCON6CLR_FIFOCONC (0x1u << 14) /**< \brief (USBC_UPCON6CLR) FIFOCON Clear */ +#define USBC_UPCON6CLR_PFREEZEC (0x1u << 17) /**< \brief (USBC_UPCON6CLR) PFREEZE Clear */ +#define USBC_UPCON6CLR_INITDTGLC (0x1u << 18) /**< \brief (USBC_UPCON6CLR) INITDTGL Clear */ +#define USBC_UPCON6CLR_INITBKC (0x1u << 19) /**< \brief (USBC_UPCON6CLR) INITBK Clear */ +/* -------- USBC_UPCON7CLR : (USBC Offset: 0x63C) Pipe Control Clear Register -------- */ +#define USBC_UPCON7CLR_RXINEC (0x1u << 0) /**< \brief (USBC_UPCON7CLR) RXINE Clear */ +#define USBC_UPCON7CLR_TXOUTEC (0x1u << 1) /**< \brief (USBC_UPCON7CLR) TXOUTE Clear */ +#define USBC_UPCON7CLR_TXSTPEC (0x1u << 2) /**< \brief (USBC_UPCON7CLR) TXSTPE Clear */ +#define USBC_UPCON7CLR_PERREC (0x1u << 3) /**< \brief (USBC_UPCON7CLR) PERRE Clear */ +#define USBC_UPCON7CLR_NAKEDEC (0x1u << 4) /**< \brief (USBC_UPCON7CLR) NAKEDE Clear */ +#define USBC_UPCON7CLR_ERRORFIEC (0x1u << 5) /**< \brief (USBC_UPCON7CLR) ERRORFIE Clear */ +#define USBC_UPCON7CLR_RXSTALLDEC (0x1u << 6) /**< \brief (USBC_UPCON7CLR) RXTALLDE Clear */ +#define USBC_UPCON7CLR_RAMACEREC (0x1u << 10) /**< \brief (USBC_UPCON7CLR) RAMACERE Clear */ +#define USBC_UPCON7CLR_NBUSYBKEC (0x1u << 12) /**< \brief (USBC_UPCON7CLR) NBUSYBKE Clear */ +#define USBC_UPCON7CLR_FIFOCONC (0x1u << 14) /**< \brief (USBC_UPCON7CLR) FIFOCON Clear */ +#define USBC_UPCON7CLR_PFREEZEC (0x1u << 17) /**< \brief (USBC_UPCON7CLR) PFREEZE Clear */ +#define USBC_UPCON7CLR_INITDTGLC (0x1u << 18) /**< \brief (USBC_UPCON7CLR) INITDTGL Clear */ +#define USBC_UPCON7CLR_INITBKC (0x1u << 19) /**< \brief (USBC_UPCON7CLR) INITBK Clear */ +/* -------- USBC_UPINRQ0 : (USBC Offset: 0x650) Pipe In Request -------- */ +#define USBC_UPINRQ0_INRQ_Pos 0 +#define USBC_UPINRQ0_INRQ_Msk (0xFFu << USBC_UPINRQ0_INRQ_Pos) /**< \brief (USBC_UPINRQ0) IN Request Number before Freeze */ +#define USBC_UPINRQ0_INRQ(value) ((USBC_UPINRQ0_INRQ_Msk & ((value) << USBC_UPINRQ0_INRQ_Pos))) +#define USBC_UPINRQ0_INMODE (0x1u << 8) /**< \brief (USBC_UPINRQ0) IN Request Mode */ +/* -------- USBC_UPINRQ1 : (USBC Offset: 0x654) Pipe In Request -------- */ +#define USBC_UPINRQ1_INRQ_Pos 0 +#define USBC_UPINRQ1_INRQ_Msk (0xFFu << USBC_UPINRQ1_INRQ_Pos) /**< \brief (USBC_UPINRQ1) IN Request Number before Freeze */ +#define USBC_UPINRQ1_INRQ(value) ((USBC_UPINRQ1_INRQ_Msk & ((value) << USBC_UPINRQ1_INRQ_Pos))) +#define USBC_UPINRQ1_INMODE (0x1u << 8) /**< \brief (USBC_UPINRQ1) IN Request Mode */ +/* -------- USBC_UPINRQ2 : (USBC Offset: 0x658) Pipe In Request -------- */ +#define USBC_UPINRQ2_INRQ_Pos 0 +#define USBC_UPINRQ2_INRQ_Msk (0xFFu << USBC_UPINRQ2_INRQ_Pos) /**< \brief (USBC_UPINRQ2) IN Request Number before Freeze */ +#define USBC_UPINRQ2_INRQ(value) ((USBC_UPINRQ2_INRQ_Msk & ((value) << USBC_UPINRQ2_INRQ_Pos))) +#define USBC_UPINRQ2_INMODE (0x1u << 8) /**< \brief (USBC_UPINRQ2) IN Request Mode */ +/* -------- USBC_UPINRQ3 : (USBC Offset: 0x65C) Pipe In Request -------- */ +#define USBC_UPINRQ3_INRQ_Pos 0 +#define USBC_UPINRQ3_INRQ_Msk (0xFFu << USBC_UPINRQ3_INRQ_Pos) /**< \brief (USBC_UPINRQ3) IN Request Number before Freeze */ +#define USBC_UPINRQ3_INRQ(value) ((USBC_UPINRQ3_INRQ_Msk & ((value) << USBC_UPINRQ3_INRQ_Pos))) +#define USBC_UPINRQ3_INMODE (0x1u << 8) /**< \brief (USBC_UPINRQ3) IN Request Mode */ +/* -------- USBC_UPINRQ4 : (USBC Offset: 0x660) Pipe In Request -------- */ +#define USBC_UPINRQ4_INRQ_Pos 0 +#define USBC_UPINRQ4_INRQ_Msk (0xFFu << USBC_UPINRQ4_INRQ_Pos) /**< \brief (USBC_UPINRQ4) IN Request Number before Freeze */ +#define USBC_UPINRQ4_INRQ(value) ((USBC_UPINRQ4_INRQ_Msk & ((value) << USBC_UPINRQ4_INRQ_Pos))) +#define USBC_UPINRQ4_INMODE (0x1u << 8) /**< \brief (USBC_UPINRQ4) IN Request Mode */ +/* -------- USBC_UPINRQ5 : (USBC Offset: 0x664) Pipe In Request -------- */ +#define USBC_UPINRQ5_INRQ_Pos 0 +#define USBC_UPINRQ5_INRQ_Msk (0xFFu << USBC_UPINRQ5_INRQ_Pos) /**< \brief (USBC_UPINRQ5) IN Request Number before Freeze */ +#define USBC_UPINRQ5_INRQ(value) ((USBC_UPINRQ5_INRQ_Msk & ((value) << USBC_UPINRQ5_INRQ_Pos))) +#define USBC_UPINRQ5_INMODE (0x1u << 8) /**< \brief (USBC_UPINRQ5) IN Request Mode */ +/* -------- USBC_UPINRQ6 : (USBC Offset: 0x668) Pipe In Request -------- */ +#define USBC_UPINRQ6_INRQ_Pos 0 +#define USBC_UPINRQ6_INRQ_Msk (0xFFu << USBC_UPINRQ6_INRQ_Pos) /**< \brief (USBC_UPINRQ6) IN Request Number before Freeze */ +#define USBC_UPINRQ6_INRQ(value) ((USBC_UPINRQ6_INRQ_Msk & ((value) << USBC_UPINRQ6_INRQ_Pos))) +#define USBC_UPINRQ6_INMODE (0x1u << 8) /**< \brief (USBC_UPINRQ6) IN Request Mode */ +/* -------- USBC_UPINRQ7 : (USBC Offset: 0x66C) Pipe In Request -------- */ +#define USBC_UPINRQ7_INRQ_Pos 0 +#define USBC_UPINRQ7_INRQ_Msk (0xFFu << USBC_UPINRQ7_INRQ_Pos) /**< \brief (USBC_UPINRQ7) IN Request Number before Freeze */ +#define USBC_UPINRQ7_INRQ(value) ((USBC_UPINRQ7_INRQ_Msk & ((value) << USBC_UPINRQ7_INRQ_Pos))) +#define USBC_UPINRQ7_INMODE (0x1u << 8) /**< \brief (USBC_UPINRQ7) IN Request Mode */ +/* -------- USBC_USBCON : (USBC Offset: 0x800) General Control Register -------- */ +#define USBC_USBCON_FRZCLK (0x1u << 14) /**< \brief (USBC_USBCON) Freeze USB Clock */ +#define USBC_USBCON_USBE (0x1u << 15) /**< \brief (USBC_USBCON) USBC Enable */ +#define USBC_USBCON_UIMOD (0x1u << 24) /**< \brief (USBC_USBCON) USBC Mode */ +/* -------- USBC_USBSTA : (USBC Offset: 0x804) General Status Register -------- */ +#define USBC_USBSTA_VBUSRQ (0x1u << 9) /**< \brief (USBC_USBSTA) VBus Request */ +#define USBC_USBSTA_SPEED_Pos 12 +#define USBC_USBSTA_SPEED_Msk (0x3u << USBC_USBSTA_SPEED_Pos) /**< \brief (USBC_USBSTA) Speed Status */ +#define USBC_USBSTA_SPEED(value) ((USBC_USBSTA_SPEED_Msk & ((value) << USBC_USBSTA_SPEED_Pos))) +#define USBC_USBSTA_SPEED_FULL (0x0u << 12) /**< \brief (USBC_USBSTA) */ +#define USBC_USBSTA_SPEED_HIGH (0x1u << 12) /**< \brief (USBC_USBSTA) */ +#define USBC_USBSTA_SPEED_LOW (0x2u << 12) /**< \brief (USBC_USBSTA) */ +#define USBC_USBSTA_CLKUSABLE (0x1u << 14) /**< \brief (USBC_USBSTA) USB Clock Usable */ +#define USBC_USBSTA_SUSPEND (0x1u << 16) /**< \brief (USBC_USBSTA) Suspend module state */ +/* -------- USBC_USBSTACLR : (USBC Offset: 0x808) General Status Clear Register -------- */ +#define USBC_USBSTACLR_RAMACERIC (0x1u << 8) /**< \brief (USBC_USBSTACLR) RAMACERI Clear */ +#define USBC_USBSTACLR_VBUSRQC (0x1u << 9) /**< \brief (USBC_USBSTACLR) VBUSRQ Clear */ +/* -------- USBC_USBSTASET : (USBC Offset: 0x80C) General Status Set Register -------- */ +#define USBC_USBSTASET_RAMACERIS (0x1u << 8) /**< \brief (USBC_USBSTASET) RAMACERI Set */ +#define USBC_USBSTASET_VBUSRQS (0x1u << 9) /**< \brief (USBC_USBSTASET) VBUSRQ Set */ +/* -------- USBC_UVERS : (USBC Offset: 0x818) IP Version Register -------- */ +#define USBC_UVERS_VERSION_Pos 0 +#define USBC_UVERS_VERSION_Msk (0xFFFu << USBC_UVERS_VERSION_Pos) /**< \brief (USBC_UVERS) Version Number */ +#define USBC_UVERS_VERSION(value) ((USBC_UVERS_VERSION_Msk & ((value) << USBC_UVERS_VERSION_Pos))) +#define USBC_UVERS_VARIANT_Pos 16 +#define USBC_UVERS_VARIANT_Msk (0x7u << USBC_UVERS_VARIANT_Pos) /**< \brief (USBC_UVERS) Variant Number */ +#define USBC_UVERS_VARIANT(value) ((USBC_UVERS_VARIANT_Msk & ((value) << USBC_UVERS_VARIANT_Pos))) +/* -------- USBC_UFEATURES : (USBC Offset: 0x81C) IP Features Register -------- */ +#define USBC_UFEATURES_EPTNBRMAX_Pos 0 +#define USBC_UFEATURES_EPTNBRMAX_Msk (0xFu << USBC_UFEATURES_EPTNBRMAX_Pos) /**< \brief (USBC_UFEATURES) Maximum Number of Pipes/Endpints */ +#define USBC_UFEATURES_EPTNBRMAX(value) ((USBC_UFEATURES_EPTNBRMAX_Msk & ((value) << USBC_UFEATURES_EPTNBRMAX_Pos))) +#define USBC_UFEATURES_UTMIMODE (0x1u << 8) /**< \brief (USBC_UFEATURES) UTMI Mode */ +/* -------- USBC_UADDRSIZE : (USBC Offset: 0x820) IP PB address size Register -------- */ +#define USBC_UADDRSIZE_UADDRSIZE_Pos 0 +#define USBC_UADDRSIZE_UADDRSIZE_Msk (0xFFFFFFFFu << USBC_UADDRSIZE_UADDRSIZE_Pos) /**< \brief (USBC_UADDRSIZE) IP PB Address Size */ +#define USBC_UADDRSIZE_UADDRSIZE(value) ((USBC_UADDRSIZE_UADDRSIZE_Msk & ((value) << USBC_UADDRSIZE_UADDRSIZE_Pos))) +/* -------- USBC_UNAME1 : (USBC Offset: 0x824) IP Name Part One: HUSB -------- */ +#define USBC_UNAME1_UNAME1_Pos 0 +#define USBC_UNAME1_UNAME1_Msk (0xFFFFFFFFu << USBC_UNAME1_UNAME1_Pos) /**< \brief (USBC_UNAME1) IP Name Part One */ +#define USBC_UNAME1_UNAME1(value) ((USBC_UNAME1_UNAME1_Msk & ((value) << USBC_UNAME1_UNAME1_Pos))) +/* -------- USBC_UNAME2 : (USBC Offset: 0x828) IP Name Part Two: HOST -------- */ +#define USBC_UNAME2_UNAME2_Pos 0 +#define USBC_UNAME2_UNAME2_Msk (0xFFFFFFFFu << USBC_UNAME2_UNAME2_Pos) /**< \brief (USBC_UNAME2) IP Name Part Two */ +#define USBC_UNAME2_UNAME2(value) ((USBC_UNAME2_UNAME2_Msk & ((value) << USBC_UNAME2_UNAME2_Pos))) +/* -------- USBC_USBFSM : (USBC Offset: 0x82C) USB internal finite state machine -------- */ +#define USBC_USBFSM_DRDSTATE_Pos 0 +#define USBC_USBFSM_DRDSTATE_Msk (0xFu << USBC_USBFSM_DRDSTATE_Pos) /**< \brief (USBC_USBFSM) DualRoleDevice state */ +#define USBC_USBFSM_DRDSTATE(value) ((USBC_USBFSM_DRDSTATE_Msk & ((value) << USBC_USBFSM_DRDSTATE_Pos))) +#define USBC_USBFSM_DRDSTATE_A_IDLE (0x0u << 0) /**< \brief (USBC_USBFSM) */ +#define USBC_USBFSM_DRDSTATE_A_WAIT_VRISE (0x1u << 0) /**< \brief (USBC_USBFSM) */ +#define USBC_USBFSM_DRDSTATE_A_WAIT_BCON (0x2u << 0) /**< \brief (USBC_USBFSM) */ +#define USBC_USBFSM_DRDSTATE_A_HOST (0x3u << 0) /**< \brief (USBC_USBFSM) */ +#define USBC_USBFSM_DRDSTATE_A_SUSPEND (0x4u << 0) /**< \brief (USBC_USBFSM) */ +#define USBC_USBFSM_DRDSTATE_A_PERIPHERAL (0x5u << 0) /**< \brief (USBC_USBFSM) */ +#define USBC_USBFSM_DRDSTATE_A_WAIT_VFALL (0x6u << 0) /**< \brief (USBC_USBFSM) */ +#define USBC_USBFSM_DRDSTATE_A_VBUS_ERR (0x7u << 0) /**< \brief (USBC_USBFSM) */ +#define USBC_USBFSM_DRDSTATE_A_WAIT_DISCHARGE (0x8u << 0) /**< \brief (USBC_USBFSM) */ +#define USBC_USBFSM_DRDSTATE_B_IDLE (0x9u << 0) /**< \brief (USBC_USBFSM) */ +#define USBC_USBFSM_DRDSTATE_B_PERIPHERAL (0xAu << 0) /**< \brief (USBC_USBFSM) */ +#define USBC_USBFSM_DRDSTATE_B_WAIT_BEGIN_HNP (0xBu << 0) /**< \brief (USBC_USBFSM) */ +#define USBC_USBFSM_DRDSTATE_B_WAIT_DISCHARGE (0xCu << 0) /**< \brief (USBC_USBFSM) */ +#define USBC_USBFSM_DRDSTATE_B_WAIT_ACON (0xDu << 0) /**< \brief (USBC_USBFSM) */ +#define USBC_USBFSM_DRDSTATE_B_HOST (0xEu << 0) /**< \brief (USBC_USBFSM) */ +#define USBC_USBFSM_DRDSTATE_B_SRP_INIT (0xFu << 0) /**< \brief (USBC_USBFSM) */ +/* -------- USBC_UDESC : (USBC Offset: 0x830) Endpoint descriptor table -------- */ +#define USBC_UDESC_UDESCA_Pos 0 +#define USBC_UDESC_UDESCA_Msk (0xFFFFFFFFu << USBC_UDESC_UDESCA_Pos) /**< \brief (USBC_UDESC) USB Descriptor Address */ +#define USBC_UDESC_UDESCA(value) ((USBC_UDESC_UDESCA_Msk & ((value) << USBC_UDESC_UDESCA_Pos))) + +/*@}*/ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR WDT */ +/* ============================================================================= */ +/** \addtogroup SAM4L_WDT Watchdog Timer */ +/*@{*/ + +#define REV_WDT 0x501 + +#ifndef __ASSEMBLY__ +/** \brief WDT hardware registers */ +typedef struct { + RwReg WDT_CTRL; /**< \brief (WDT Offset: 0x000) Control Register */ + WoReg WDT_CLR; /**< \brief (WDT Offset: 0x004) Clear Register */ + RoReg WDT_SR; /**< \brief (WDT Offset: 0x008) Status Register */ + WoReg WDT_IER; /**< \brief (WDT Offset: 0x00C) Interrupt Enable Register */ + WoReg WDT_IDR; /**< \brief (WDT Offset: 0x010) Interrupt Disable Register */ + RoReg WDT_IMR; /**< \brief (WDT Offset: 0x014) Interrupt Mask Register */ + RoReg WDT_ISR; /**< \brief (WDT Offset: 0x018) Interrupt Status Register */ + WoReg WDT_ICR; /**< \brief (WDT Offset: 0x01C) Interrupt Clear Register */ + RoReg Reserved1[247]; + RoReg WDT_VERSION; /**< \brief (WDT Offset: 0x3FC) Version Register */ +} Wdt; +#endif /* __ASSEMBLY__ */ +/* -------- WDT_CTRL : (WDT Offset: 0x000) Control Register -------- */ +#define WDT_CTRL_EN (0x1u << 0) /**< \brief (WDT_CTRL) WDT Enable */ +#define WDT_CTRL_EN_0 (0x0u << 0) /**< \brief (WDT_CTRL) WDT is disabled. */ +#define WDT_CTRL_EN_1 (0x1u << 0) /**< \brief (WDT_CTRL) WDT is enabled */ +#define WDT_CTRL_DAR (0x1u << 1) /**< \brief (WDT_CTRL) WDT Disable After Reset */ +#define WDT_CTRL_MODE (0x1u << 2) /**< \brief (WDT_CTRL) WDT Mode */ +#define WDT_CTRL_SFV (0x1u << 3) /**< \brief (WDT_CTRL) WDT Store Final Value */ +#define WDT_CTRL_IM (0x1u << 4) /**< \brief (WDT_CTRL) WDT Interruput Mode */ +#define WDT_CTRL_FCD (0x1u << 7) /**< \brief (WDT_CTRL) WDT Fuse Calibration Done */ +#define WDT_CTRL_PSEL_Pos 8 +#define WDT_CTRL_PSEL_Msk (0x1Fu << WDT_CTRL_PSEL_Pos) /**< \brief (WDT_CTRL) Timeout Prescale Select */ +#define WDT_CTRL_PSEL(value) ((WDT_CTRL_PSEL_Msk & ((value) << WDT_CTRL_PSEL_Pos))) +#define WDT_CTRL_CSSEL1 (0x1u << 14) /**< \brief (WDT_CTRL) Clock Source Selection1 */ +#define WDT_CTRL_CEN (0x1u << 16) /**< \brief (WDT_CTRL) Clock Enable */ +#define WDT_CTRL_CSSEL (0x1u << 17) /**< \brief (WDT_CTRL) Clock Source Selection0 */ +#define WDT_CTRL_TBAN_Pos 18 +#define WDT_CTRL_TBAN_Msk (0x1Fu << WDT_CTRL_TBAN_Pos) /**< \brief (WDT_CTRL) TBAN Prescale Select */ +#define WDT_CTRL_TBAN(value) ((WDT_CTRL_TBAN_Msk & ((value) << WDT_CTRL_TBAN_Pos))) +#define WDT_CTRL_KEY_Pos 24 +#define WDT_CTRL_KEY_Msk (0xFFu << WDT_CTRL_KEY_Pos) /**< \brief (WDT_CTRL) Key */ +#define WDT_CTRL_KEY(value) ((WDT_CTRL_KEY_Msk & ((value) << WDT_CTRL_KEY_Pos))) +/* -------- WDT_CLR : (WDT Offset: 0x004) Clear Register -------- */ +#define WDT_CLR_WDTCLR (0x1u << 0) /**< \brief (WDT_CLR) Clear WDT counter */ +#define WDT_CLR_KEY_Pos 24 +#define WDT_CLR_KEY_Msk (0xFFu << WDT_CLR_KEY_Pos) /**< \brief (WDT_CLR) Key */ +#define WDT_CLR_KEY(value) ((WDT_CLR_KEY_Msk & ((value) << WDT_CLR_KEY_Pos))) +/* -------- WDT_SR : (WDT Offset: 0x008) Status Register -------- */ +#define WDT_SR_WINDOW (0x1u << 0) /**< \brief (WDT_SR) WDT in window */ +#define WDT_SR_CLEARED (0x1u << 1) /**< \brief (WDT_SR) WDT cleared */ +/* -------- WDT_IER : (WDT Offset: 0x00C) Interrupt Enable Register -------- */ +#define WDT_IER_WINT (0x1u << 2) /**< \brief (WDT_IER) */ +/* -------- WDT_IDR : (WDT Offset: 0x010) Interrupt Disable Register -------- */ +#define WDT_IDR_WINT (0x1u << 2) /**< \brief (WDT_IDR) */ +/* -------- WDT_IMR : (WDT Offset: 0x014) Interrupt Mask Register -------- */ +#define WDT_IMR_WINT (0x1u << 2) /**< \brief (WDT_IMR) */ +/* -------- WDT_ISR : (WDT Offset: 0x018) Interrupt Status Register -------- */ +#define WDT_ISR_WINT (0x1u << 2) /**< \brief (WDT_ISR) */ +/* -------- WDT_ICR : (WDT Offset: 0x01C) Interrupt Clear Register -------- */ +#define WDT_ICR_WINT (0x1u << 2) /**< \brief (WDT_ICR) */ +/* -------- WDT_VERSION : (WDT Offset: 0x3FC) Version Register -------- */ +#define WDT_VERSION_VERSION_Pos 0 +#define WDT_VERSION_VERSION_Msk (0xFFFu << WDT_VERSION_VERSION_Pos) /**< \brief (WDT_VERSION) Version number */ +#define WDT_VERSION_VERSION(value) ((WDT_VERSION_VERSION_Msk & ((value) << WDT_VERSION_VERSION_Pos))) +#define WDT_VERSION_VARIANT_Pos 16 +#define WDT_VERSION_VARIANT_Msk (0xFu << WDT_VERSION_VARIANT_Pos) /**< \brief (WDT_VERSION) Variant number */ +#define WDT_VERSION_VARIANT(value) ((WDT_VERSION_VARIANT_Msk & ((value) << WDT_VERSION_VARIANT_Pos))) + +/*@}*/ + +/*@}*/ + +/* ************************************************************************** */ +/** REGISTER ACCESS DEFINITIONS FOR SAM4L */ +/* ************************************************************************** */ +/** \addtogroup SAM4L_reg Registers Access Definitions */ +/*@{*/ + +/* ========== Register definition for IISC peripheral ========== */ +#define REG_IISC_CR REG_ACCESS(WoReg , 0x40004000U) /**< \brief (IISC) Control Register */ +#define REG_IISC_MR REG_ACCESS(RwReg , 0x40004004U) /**< \brief (IISC) Mode Register */ +#define REG_IISC_SR REG_ACCESS(RoReg , 0x40004008U) /**< \brief (IISC) Status Register */ +#define REG_IISC_SCR REG_ACCESS(WoReg , 0x4000400CU) /**< \brief (IISC) Status Clear Register */ +#define REG_IISC_SSR REG_ACCESS(WoReg , 0x40004010U) /**< \brief (IISC) Status Set Register */ +#define REG_IISC_IER REG_ACCESS(WoReg , 0x40004014U) /**< \brief (IISC) Interrupt Enable Register */ +#define REG_IISC_IDR REG_ACCESS(WoReg , 0x40004018U) /**< \brief (IISC) Interrupt Disable Register */ +#define REG_IISC_IMR REG_ACCESS(RoReg , 0x4000401CU) /**< \brief (IISC) Interrupt Mask Register */ +#define REG_IISC_RHR REG_ACCESS(RoReg , 0x40004020U) /**< \brief (IISC) Receive Holding Register */ +#define REG_IISC_THR REG_ACCESS(WoReg , 0x40004024U) /**< \brief (IISC) Transmit Holding Register */ +#define REG_IISC_VERSION REG_ACCESS(RoReg , 0x40004028U) /**< \brief (IISC) Version Register */ +#define REG_IISC_PARAMETER REG_ACCESS(RoReg , 0x4000402CU) /**< \brief (IISC) Parameter Register */ +/* ========== Register definition for SPI peripheral ========== */ +#define REG_SPI_CR REG_ACCESS(WoReg , 0x40008000U) /**< \brief (SPI) Control Register */ +#define REG_SPI_MR REG_ACCESS(RwReg , 0x40008004U) /**< \brief (SPI) Mode Register */ +#define REG_SPI_RDR REG_ACCESS(RoReg , 0x40008008U) /**< \brief (SPI) Receive Data Register */ +#define REG_SPI_TDR REG_ACCESS(WoReg , 0x4000800CU) /**< \brief (SPI) Transmit Data Register */ +#define REG_SPI_SR REG_ACCESS(RoReg , 0x40008010U) /**< \brief (SPI) Status Register */ +#define REG_SPI_IER REG_ACCESS(WoReg , 0x40008014U) /**< \brief (SPI) Interrupt Enable Register */ +#define REG_SPI_IDR REG_ACCESS(WoReg , 0x40008018U) /**< \brief (SPI) Interrupt Disable Register */ +#define REG_SPI_IMR REG_ACCESS(RoReg , 0x4000801CU) /**< \brief (SPI) Interrupt Mask Register */ +#define REG_SPI_CSR0 REG_ACCESS(RwReg , 0x40008030U) /**< \brief (SPI) Chip Select Register 0 */ +#define REG_SPI_CSR1 REG_ACCESS(RwReg , 0x40008034U) /**< \brief (SPI) Chip Select Register 1 */ +#define REG_SPI_CSR2 REG_ACCESS(RwReg , 0x40008038U) /**< \brief (SPI) Chip Select Register 2 */ +#define REG_SPI_CSR3 REG_ACCESS(RwReg , 0x4000803CU) /**< \brief (SPI) Chip Select Register 3 */ +#define REG_SPI_WPCR REG_ACCESS(RwReg , 0x400080E4U) /**< \brief (SPI) Write Protection control Register */ +#define REG_SPI_WPSR REG_ACCESS(RoReg , 0x400080E8U) /**< \brief (SPI) Write Protection status Register */ +#define REG_SPI_FEATURES REG_ACCESS(RoReg , 0x400080F8U) /**< \brief (SPI) Features Register */ +#define REG_SPI_VERSION REG_ACCESS(RoReg , 0x400080FCU) /**< \brief (SPI) Version Register */ +/* ========== Register definition for TC0 peripheral ========== */ +#define REG_TC0_CCR0 REG_ACCESS(WoReg , 0x40010000U) /**< \brief (TC0) Channel Control Register Channel 0 0 */ +#define REG_TC0_CMR0 REG_ACCESS(RwReg , 0x40010004U) /**< \brief (TC0) Channel Mode Register Channel 0 0 */ +#define REG_TC0_SMC0 REG_ACCESS(RwReg , 0x40010008U) /**< \brief (TC0) Stepper Motor Mode Register 0 */ +#define REG_TC0_CV0 REG_ACCESS(RoReg , 0x40010010U) /**< \brief (TC0) Counter Value Channel 0 0 */ +#define REG_TC0_RA0 REG_ACCESS(RwReg , 0x40010014U) /**< \brief (TC0) Register A Channel 0 0 */ +#define REG_TC0_RB0 REG_ACCESS(RwReg , 0x40010018U) /**< \brief (TC0) Register B Channel 0 0 */ +#define REG_TC0_RC0 REG_ACCESS(RwReg , 0x4001001CU) /**< \brief (TC0) Register C Channel 0 0 */ +#define REG_TC0_SR0 REG_ACCESS(RoReg , 0x40010020U) /**< \brief (TC0) Status Register Channel 0 0 */ +#define REG_TC0_IER0 REG_ACCESS(WoReg , 0x40010024U) /**< \brief (TC0) Interrupt Enable Register Channel 0 0 */ +#define REG_TC0_IDR0 REG_ACCESS(WoReg , 0x40010028U) /**< \brief (TC0) Interrupt Disable Register Channel 0 0 */ +#define REG_TC0_IMR0 REG_ACCESS(RoReg , 0x4001002CU) /**< \brief (TC0) Interrupt Mask Register Channel 0 0 */ +#define REG_TC0_CCR1 REG_ACCESS(WoReg , 0x40010040U) /**< \brief (TC0) Channel Control Register Channel 0 1 */ +#define REG_TC0_CMR1 REG_ACCESS(RwReg , 0x40010044U) /**< \brief (TC0) Channel Mode Register Channel 0 1 */ +#define REG_TC0_SMC1 REG_ACCESS(RwReg , 0x40010048U) /**< \brief (TC0) Stepper Motor Mode Register 1 */ +#define REG_TC0_CV1 REG_ACCESS(RoReg , 0x40010050U) /**< \brief (TC0) Counter Value Channel 0 1 */ +#define REG_TC0_RA1 REG_ACCESS(RwReg , 0x40010054U) /**< \brief (TC0) Register A Channel 0 1 */ +#define REG_TC0_RB1 REG_ACCESS(RwReg , 0x40010058U) /**< \brief (TC0) Register B Channel 0 1 */ +#define REG_TC0_RC1 REG_ACCESS(RwReg , 0x4001005CU) /**< \brief (TC0) Register C Channel 0 1 */ +#define REG_TC0_SR1 REG_ACCESS(RoReg , 0x40010060U) /**< \brief (TC0) Status Register Channel 0 1 */ +#define REG_TC0_IER1 REG_ACCESS(WoReg , 0x40010064U) /**< \brief (TC0) Interrupt Enable Register Channel 0 1 */ +#define REG_TC0_IDR1 REG_ACCESS(WoReg , 0x40010068U) /**< \brief (TC0) Interrupt Disable Register Channel 0 1 */ +#define REG_TC0_IMR1 REG_ACCESS(RoReg , 0x4001006CU) /**< \brief (TC0) Interrupt Mask Register Channel 0 1 */ +#define REG_TC0_CCR2 REG_ACCESS(WoReg , 0x40010080U) /**< \brief (TC0) Channel Control Register Channel 0 2 */ +#define REG_TC0_CMR2 REG_ACCESS(RwReg , 0x40010084U) /**< \brief (TC0) Channel Mode Register Channel 0 2 */ +#define REG_TC0_SMC2 REG_ACCESS(RwReg , 0x40010088U) /**< \brief (TC0) Stepper Motor Mode Register 2 */ +#define REG_TC0_CV2 REG_ACCESS(RoReg , 0x40010090U) /**< \brief (TC0) Counter Value Channel 0 2 */ +#define REG_TC0_RA2 REG_ACCESS(RwReg , 0x40010094U) /**< \brief (TC0) Register A Channel 0 2 */ +#define REG_TC0_RB2 REG_ACCESS(RwReg , 0x40010098U) /**< \brief (TC0) Register B Channel 0 2 */ +#define REG_TC0_RC2 REG_ACCESS(RwReg , 0x4001009CU) /**< \brief (TC0) Register C Channel 0 2 */ +#define REG_TC0_SR2 REG_ACCESS(RoReg , 0x400100A0U) /**< \brief (TC0) Status Register Channel 0 2 */ +#define REG_TC0_IER2 REG_ACCESS(WoReg , 0x400100A4U) /**< \brief (TC0) Interrupt Enable Register Channel 0 2 */ +#define REG_TC0_IDR2 REG_ACCESS(WoReg , 0x400100A8U) /**< \brief (TC0) Interrupt Disable Register Channel 0 2 */ +#define REG_TC0_IMR2 REG_ACCESS(RoReg , 0x400100ACU) /**< \brief (TC0) Interrupt Mask Register Channel 0 2 */ +#define REG_TC0_BCR REG_ACCESS(WoReg , 0x400100C0U) /**< \brief (TC0) TC Block Control Register */ +#define REG_TC0_BMR REG_ACCESS(RwReg , 0x400100C4U) /**< \brief (TC0) TC Block Mode Register */ +#define REG_TC0_WPMR REG_ACCESS(RwReg , 0x400100E4U) /**< \brief (TC0) Write Protect Mode Register */ +#define REG_TC0_FEATURES REG_ACCESS(RoReg , 0x400100F8U) /**< \brief (TC0) Features Register */ +#define REG_TC0_VERSION REG_ACCESS(RoReg , 0x400100FCU) /**< \brief (TC0) Version Register */ +/* ========== Register definition for TC1 peripheral ========== */ +#define REG_TC1_CCR0 REG_ACCESS(WoReg , 0x40014000U) /**< \brief (TC1) Channel Control Register Channel 0 0 */ +#define REG_TC1_CMR0 REG_ACCESS(RwReg , 0x40014004U) /**< \brief (TC1) Channel Mode Register Channel 0 0 */ +#define REG_TC1_SMC0 REG_ACCESS(RwReg , 0x40014008U) /**< \brief (TC1) Stepper Motor Mode Register 0 */ +#define REG_TC1_CV0 REG_ACCESS(RoReg , 0x40014010U) /**< \brief (TC1) Counter Value Channel 0 0 */ +#define REG_TC1_RA0 REG_ACCESS(RwReg , 0x40014014U) /**< \brief (TC1) Register A Channel 0 0 */ +#define REG_TC1_RB0 REG_ACCESS(RwReg , 0x40014018U) /**< \brief (TC1) Register B Channel 0 0 */ +#define REG_TC1_RC0 REG_ACCESS(RwReg , 0x4001401CU) /**< \brief (TC1) Register C Channel 0 0 */ +#define REG_TC1_SR0 REG_ACCESS(RoReg , 0x40014020U) /**< \brief (TC1) Status Register Channel 0 0 */ +#define REG_TC1_IER0 REG_ACCESS(WoReg , 0x40014024U) /**< \brief (TC1) Interrupt Enable Register Channel 0 0 */ +#define REG_TC1_IDR0 REG_ACCESS(WoReg , 0x40014028U) /**< \brief (TC1) Interrupt Disable Register Channel 0 0 */ +#define REG_TC1_IMR0 REG_ACCESS(RoReg , 0x4001402CU) /**< \brief (TC1) Interrupt Mask Register Channel 0 0 */ +#define REG_TC1_CCR1 REG_ACCESS(WoReg , 0x40014040U) /**< \brief (TC1) Channel Control Register Channel 0 1 */ +#define REG_TC1_CMR1 REG_ACCESS(RwReg , 0x40014044U) /**< \brief (TC1) Channel Mode Register Channel 0 1 */ +#define REG_TC1_SMC1 REG_ACCESS(RwReg , 0x40014048U) /**< \brief (TC1) Stepper Motor Mode Register 1 */ +#define REG_TC1_CV1 REG_ACCESS(RoReg , 0x40014050U) /**< \brief (TC1) Counter Value Channel 0 1 */ +#define REG_TC1_RA1 REG_ACCESS(RwReg , 0x40014054U) /**< \brief (TC1) Register A Channel 0 1 */ +#define REG_TC1_RB1 REG_ACCESS(RwReg , 0x40014058U) /**< \brief (TC1) Register B Channel 0 1 */ +#define REG_TC1_RC1 REG_ACCESS(RwReg , 0x4001405CU) /**< \brief (TC1) Register C Channel 0 1 */ +#define REG_TC1_SR1 REG_ACCESS(RoReg , 0x40014060U) /**< \brief (TC1) Status Register Channel 0 1 */ +#define REG_TC1_IER1 REG_ACCESS(WoReg , 0x40014064U) /**< \brief (TC1) Interrupt Enable Register Channel 0 1 */ +#define REG_TC1_IDR1 REG_ACCESS(WoReg , 0x40014068U) /**< \brief (TC1) Interrupt Disable Register Channel 0 1 */ +#define REG_TC1_IMR1 REG_ACCESS(RoReg , 0x4001406CU) /**< \brief (TC1) Interrupt Mask Register Channel 0 1 */ +#define REG_TC1_CCR2 REG_ACCESS(WoReg , 0x40014080U) /**< \brief (TC1) Channel Control Register Channel 0 2 */ +#define REG_TC1_CMR2 REG_ACCESS(RwReg , 0x40014084U) /**< \brief (TC1) Channel Mode Register Channel 0 2 */ +#define REG_TC1_SMC2 REG_ACCESS(RwReg , 0x40014088U) /**< \brief (TC1) Stepper Motor Mode Register 2 */ +#define REG_TC1_CV2 REG_ACCESS(RoReg , 0x40014090U) /**< \brief (TC1) Counter Value Channel 0 2 */ +#define REG_TC1_RA2 REG_ACCESS(RwReg , 0x40014094U) /**< \brief (TC1) Register A Channel 0 2 */ +#define REG_TC1_RB2 REG_ACCESS(RwReg , 0x40014098U) /**< \brief (TC1) Register B Channel 0 2 */ +#define REG_TC1_RC2 REG_ACCESS(RwReg , 0x4001409CU) /**< \brief (TC1) Register C Channel 0 2 */ +#define REG_TC1_SR2 REG_ACCESS(RoReg , 0x400140A0U) /**< \brief (TC1) Status Register Channel 0 2 */ +#define REG_TC1_IER2 REG_ACCESS(WoReg , 0x400140A4U) /**< \brief (TC1) Interrupt Enable Register Channel 0 2 */ +#define REG_TC1_IDR2 REG_ACCESS(WoReg , 0x400140A8U) /**< \brief (TC1) Interrupt Disable Register Channel 0 2 */ +#define REG_TC1_IMR2 REG_ACCESS(RoReg , 0x400140ACU) /**< \brief (TC1) Interrupt Mask Register Channel 0 2 */ +#define REG_TC1_BCR REG_ACCESS(WoReg , 0x400140C0U) /**< \brief (TC1) TC Block Control Register */ +#define REG_TC1_BMR REG_ACCESS(RwReg , 0x400140C4U) /**< \brief (TC1) TC Block Mode Register */ +#define REG_TC1_WPMR REG_ACCESS(RwReg , 0x400140E4U) /**< \brief (TC1) Write Protect Mode Register */ +#define REG_TC1_FEATURES REG_ACCESS(RoReg , 0x400140F8U) /**< \brief (TC1) Features Register */ +#define REG_TC1_VERSION REG_ACCESS(RoReg , 0x400140FCU) /**< \brief (TC1) Version Register */ +/* ========== Register definition for TWIM0 peripheral ========== */ +#define REG_TWIM0_CR REG_ACCESS(WoReg , 0x40018000U) /**< \brief (TWIM0) Control Register */ +#define REG_TWIM0_CWGR REG_ACCESS(RwReg , 0x40018004U) /**< \brief (TWIM0) Clock Waveform Generator Register */ +#define REG_TWIM0_SMBTR REG_ACCESS(RwReg , 0x40018008U) /**< \brief (TWIM0) SMBus Timing Register */ +#define REG_TWIM0_CMDR REG_ACCESS(RwReg , 0x4001800CU) /**< \brief (TWIM0) Command Register */ +#define REG_TWIM0_NCMDR REG_ACCESS(RwReg , 0x40018010U) /**< \brief (TWIM0) Next Command Register */ +#define REG_TWIM0_RHR REG_ACCESS(RoReg , 0x40018014U) /**< \brief (TWIM0) Receive Holding Register */ +#define REG_TWIM0_THR REG_ACCESS(WoReg , 0x40018018U) /**< \brief (TWIM0) Transmit Holding Register */ +#define REG_TWIM0_SR REG_ACCESS(RoReg , 0x4001801CU) /**< \brief (TWIM0) Status Register */ +#define REG_TWIM0_IER REG_ACCESS(WoReg , 0x40018020U) /**< \brief (TWIM0) Interrupt Enable Register */ +#define REG_TWIM0_IDR REG_ACCESS(WoReg , 0x40018024U) /**< \brief (TWIM0) Interrupt Disable Register */ +#define REG_TWIM0_IMR REG_ACCESS(RoReg , 0x40018028U) /**< \brief (TWIM0) Interrupt Mask Register */ +#define REG_TWIM0_SCR REG_ACCESS(WoReg , 0x4001802CU) /**< \brief (TWIM0) Status Clear Register */ +#define REG_TWIM0_PR REG_ACCESS(RoReg , 0x40018030U) /**< \brief (TWIM0) Parameter Register */ +#define REG_TWIM0_VR REG_ACCESS(RoReg , 0x40018034U) /**< \brief (TWIM0) Version Register */ +#define REG_TWIM0_HSCWGR REG_ACCESS(RwReg , 0x40018038U) /**< \brief (TWIM0) HS-mode Clock Waveform Generator */ +#define REG_TWIM0_SRR REG_ACCESS(RwReg , 0x4001803CU) /**< \brief (TWIM0) Slew Rate Register */ +#define REG_TWIM0_HSSRR REG_ACCESS(RwReg , 0x40018040U) /**< \brief (TWIM0) HS-mode Slew Rate Register */ +/* ========== Register definition for TWIS0 peripheral ========== */ +#define REG_TWIS0_CR REG_ACCESS(RwReg , 0x40018400U) /**< \brief (TWIS0) Control Register */ +#define REG_TWIS0_NBYTES REG_ACCESS(RwReg , 0x40018404U) /**< \brief (TWIS0) NBYTES Register */ +#define REG_TWIS0_TR REG_ACCESS(RwReg , 0x40018408U) /**< \brief (TWIS0) Timing Register */ +#define REG_TWIS0_RHR REG_ACCESS(RoReg , 0x4001840CU) /**< \brief (TWIS0) Receive Holding Register */ +#define REG_TWIS0_THR REG_ACCESS(WoReg , 0x40018410U) /**< \brief (TWIS0) Transmit Holding Register */ +#define REG_TWIS0_PECR REG_ACCESS(RoReg , 0x40018414U) /**< \brief (TWIS0) Packet Error Check Register */ +#define REG_TWIS0_SR REG_ACCESS(RoReg , 0x40018418U) /**< \brief (TWIS0) Status Register */ +#define REG_TWIS0_IER REG_ACCESS(WoReg , 0x4001841CU) /**< \brief (TWIS0) Interrupt Enable Register */ +#define REG_TWIS0_IDR REG_ACCESS(WoReg , 0x40018420U) /**< \brief (TWIS0) Interrupt Disable Register */ +#define REG_TWIS0_IMR REG_ACCESS(RoReg , 0x40018424U) /**< \brief (TWIS0) Interrupt Mask Register */ +#define REG_TWIS0_SCR REG_ACCESS(WoReg , 0x40018428U) /**< \brief (TWIS0) Status Clear Register */ +#define REG_TWIS0_PR REG_ACCESS(RoReg , 0x4001842CU) /**< \brief (TWIS0) Parameter Register */ +#define REG_TWIS0_VR REG_ACCESS(RoReg , 0x40018430U) /**< \brief (TWIS0) Version Register */ +#define REG_TWIS0_HSTR REG_ACCESS(RwReg , 0x40018434U) /**< \brief (TWIS0) HS-mode Timing Register */ +#define REG_TWIS0_SRR REG_ACCESS(RwReg , 0x40018438U) /**< \brief (TWIS0) Slew Rate Register */ +#define REG_TWIS0_HSSRR REG_ACCESS(RwReg , 0x4001843CU) /**< \brief (TWIS0) HS-mode Slew Rate Register */ +/* ========== Register definition for TWIM1 peripheral ========== */ +#define REG_TWIM1_CR REG_ACCESS(WoReg , 0x4001C000U) /**< \brief (TWIM1) Control Register */ +#define REG_TWIM1_CWGR REG_ACCESS(RwReg , 0x4001C004U) /**< \brief (TWIM1) Clock Waveform Generator Register */ +#define REG_TWIM1_SMBTR REG_ACCESS(RwReg , 0x4001C008U) /**< \brief (TWIM1) SMBus Timing Register */ +#define REG_TWIM1_CMDR REG_ACCESS(RwReg , 0x4001C00CU) /**< \brief (TWIM1) Command Register */ +#define REG_TWIM1_NCMDR REG_ACCESS(RwReg , 0x4001C010U) /**< \brief (TWIM1) Next Command Register */ +#define REG_TWIM1_RHR REG_ACCESS(RoReg , 0x4001C014U) /**< \brief (TWIM1) Receive Holding Register */ +#define REG_TWIM1_THR REG_ACCESS(WoReg , 0x4001C018U) /**< \brief (TWIM1) Transmit Holding Register */ +#define REG_TWIM1_SR REG_ACCESS(RoReg , 0x4001C01CU) /**< \brief (TWIM1) Status Register */ +#define REG_TWIM1_IER REG_ACCESS(WoReg , 0x4001C020U) /**< \brief (TWIM1) Interrupt Enable Register */ +#define REG_TWIM1_IDR REG_ACCESS(WoReg , 0x4001C024U) /**< \brief (TWIM1) Interrupt Disable Register */ +#define REG_TWIM1_IMR REG_ACCESS(RoReg , 0x4001C028U) /**< \brief (TWIM1) Interrupt Mask Register */ +#define REG_TWIM1_SCR REG_ACCESS(WoReg , 0x4001C02CU) /**< \brief (TWIM1) Status Clear Register */ +#define REG_TWIM1_PR REG_ACCESS(RoReg , 0x4001C030U) /**< \brief (TWIM1) Parameter Register */ +#define REG_TWIM1_VR REG_ACCESS(RoReg , 0x4001C034U) /**< \brief (TWIM1) Version Register */ +#define REG_TWIM1_HSCWGR REG_ACCESS(RwReg , 0x4001C038U) /**< \brief (TWIM1) HS-mode Clock Waveform Generator */ +#define REG_TWIM1_SRR REG_ACCESS(RwReg , 0x4001C03CU) /**< \brief (TWIM1) Slew Rate Register */ +#define REG_TWIM1_HSSRR REG_ACCESS(RwReg , 0x4001C040U) /**< \brief (TWIM1) HS-mode Slew Rate Register */ +/* ========== Register definition for TWIS1 peripheral ========== */ +#define REG_TWIS1_CR REG_ACCESS(RwReg , 0x4001C400U) /**< \brief (TWIS1) Control Register */ +#define REG_TWIS1_NBYTES REG_ACCESS(RwReg , 0x4001C404U) /**< \brief (TWIS1) NBYTES Register */ +#define REG_TWIS1_TR REG_ACCESS(RwReg , 0x4001C408U) /**< \brief (TWIS1) Timing Register */ +#define REG_TWIS1_RHR REG_ACCESS(RoReg , 0x4001C40CU) /**< \brief (TWIS1) Receive Holding Register */ +#define REG_TWIS1_THR REG_ACCESS(WoReg , 0x4001C410U) /**< \brief (TWIS1) Transmit Holding Register */ +#define REG_TWIS1_PECR REG_ACCESS(RoReg , 0x4001C414U) /**< \brief (TWIS1) Packet Error Check Register */ +#define REG_TWIS1_SR REG_ACCESS(RoReg , 0x4001C418U) /**< \brief (TWIS1) Status Register */ +#define REG_TWIS1_IER REG_ACCESS(WoReg , 0x4001C41CU) /**< \brief (TWIS1) Interrupt Enable Register */ +#define REG_TWIS1_IDR REG_ACCESS(WoReg , 0x4001C420U) /**< \brief (TWIS1) Interrupt Disable Register */ +#define REG_TWIS1_IMR REG_ACCESS(RoReg , 0x4001C424U) /**< \brief (TWIS1) Interrupt Mask Register */ +#define REG_TWIS1_SCR REG_ACCESS(WoReg , 0x4001C428U) /**< \brief (TWIS1) Status Clear Register */ +#define REG_TWIS1_PR REG_ACCESS(RoReg , 0x4001C42CU) /**< \brief (TWIS1) Parameter Register */ +#define REG_TWIS1_VR REG_ACCESS(RoReg , 0x4001C430U) /**< \brief (TWIS1) Version Register */ +#define REG_TWIS1_HSTR REG_ACCESS(RwReg , 0x4001C434U) /**< \brief (TWIS1) HS-mode Timing Register */ +#define REG_TWIS1_SRR REG_ACCESS(RwReg , 0x4001C438U) /**< \brief (TWIS1) Slew Rate Register */ +#define REG_TWIS1_HSSRR REG_ACCESS(RwReg , 0x4001C43CU) /**< \brief (TWIS1) HS-mode Slew Rate Register */ +/* ========== Register definition for USART0 peripheral ========== */ +#define REG_USART0_CR REG_ACCESS(WoReg , 0x40024000U) /**< \brief (USART0) Control Register */ +#define REG_USART0_MR REG_ACCESS(RwReg , 0x40024004U) /**< \brief (USART0) Mode Register */ +#define REG_USART0_IER REG_ACCESS(WoReg , 0x40024008U) /**< \brief (USART0) Interrupt Enable Register */ +#define REG_USART0_IDR REG_ACCESS(WoReg , 0x4002400CU) /**< \brief (USART0) Interrupt Disable Register */ +#define REG_USART0_IMR REG_ACCESS(RoReg , 0x40024010U) /**< \brief (USART0) Interrupt Mask Register */ +#define REG_USART0_CSR REG_ACCESS(RoReg , 0x40024014U) /**< \brief (USART0) Channel Status Register */ +#define REG_USART0_RHR REG_ACCESS(RoReg , 0x40024018U) /**< \brief (USART0) Receiver Holding Register */ +#define REG_USART0_THR REG_ACCESS(WoReg , 0x4002401CU) /**< \brief (USART0) Transmitter Holding Register */ +#define REG_USART0_BRGR REG_ACCESS(RwReg , 0x40024020U) /**< \brief (USART0) Baud Rate Generator Register */ +#define REG_USART0_RTOR REG_ACCESS(RwReg , 0x40024024U) /**< \brief (USART0) Receiver Time-out Register */ +#define REG_USART0_TTGR REG_ACCESS(RwReg , 0x40024028U) /**< \brief (USART0) Transmitter Timeguard Register */ +#define REG_USART0_FIDI REG_ACCESS(RwReg , 0x40024040U) /**< \brief (USART0) FI DI Ratio Register */ +#define REG_USART0_NER REG_ACCESS(RoReg , 0x40024044U) /**< \brief (USART0) Number of Errors Register */ +#define REG_USART0_IFR REG_ACCESS(RwReg , 0x4002404CU) /**< \brief (USART0) IrDA Filter Register */ +#define REG_USART0_MAN REG_ACCESS(RwReg , 0x40024050U) /**< \brief (USART0) Manchester Configuration Register */ +#define REG_USART0_LINMR REG_ACCESS(RwReg , 0x40024054U) /**< \brief (USART0) LIN Mode Register */ +#define REG_USART0_LINIR REG_ACCESS(RwReg , 0x40024058U) /**< \brief (USART0) LIN Identifier Register */ +#define REG_USART0_LINBRR REG_ACCESS(RoReg , 0x4002405CU) /**< \brief (USART0) LIN Baud Rate Register */ +#define REG_USART0_WPMR REG_ACCESS(RwReg , 0x400240E4U) /**< \brief (USART0) Write Protect Mode Register */ +#define REG_USART0_WPSR REG_ACCESS(RoReg , 0x400240E8U) /**< \brief (USART0) Write Protect Status Register */ +#define REG_USART0_VERSION REG_ACCESS(RoReg , 0x400240FCU) /**< \brief (USART0) Version Register */ +/* ========== Register definition for USART1 peripheral ========== */ +#define REG_USART1_CR REG_ACCESS(WoReg , 0x40028000U) /**< \brief (USART1) Control Register */ +#define REG_USART1_MR REG_ACCESS(RwReg , 0x40028004U) /**< \brief (USART1) Mode Register */ +#define REG_USART1_IER REG_ACCESS(WoReg , 0x40028008U) /**< \brief (USART1) Interrupt Enable Register */ +#define REG_USART1_IDR REG_ACCESS(WoReg , 0x4002800CU) /**< \brief (USART1) Interrupt Disable Register */ +#define REG_USART1_IMR REG_ACCESS(RoReg , 0x40028010U) /**< \brief (USART1) Interrupt Mask Register */ +#define REG_USART1_CSR REG_ACCESS(RoReg , 0x40028014U) /**< \brief (USART1) Channel Status Register */ +#define REG_USART1_RHR REG_ACCESS(RoReg , 0x40028018U) /**< \brief (USART1) Receiver Holding Register */ +#define REG_USART1_THR REG_ACCESS(WoReg , 0x4002801CU) /**< \brief (USART1) Transmitter Holding Register */ +#define REG_USART1_BRGR REG_ACCESS(RwReg , 0x40028020U) /**< \brief (USART1) Baud Rate Generator Register */ +#define REG_USART1_RTOR REG_ACCESS(RwReg , 0x40028024U) /**< \brief (USART1) Receiver Time-out Register */ +#define REG_USART1_TTGR REG_ACCESS(RwReg , 0x40028028U) /**< \brief (USART1) Transmitter Timeguard Register */ +#define REG_USART1_FIDI REG_ACCESS(RwReg , 0x40028040U) /**< \brief (USART1) FI DI Ratio Register */ +#define REG_USART1_NER REG_ACCESS(RoReg , 0x40028044U) /**< \brief (USART1) Number of Errors Register */ +#define REG_USART1_IFR REG_ACCESS(RwReg , 0x4002804CU) /**< \brief (USART1) IrDA Filter Register */ +#define REG_USART1_MAN REG_ACCESS(RwReg , 0x40028050U) /**< \brief (USART1) Manchester Configuration Register */ +#define REG_USART1_LINMR REG_ACCESS(RwReg , 0x40028054U) /**< \brief (USART1) LIN Mode Register */ +#define REG_USART1_LINIR REG_ACCESS(RwReg , 0x40028058U) /**< \brief (USART1) LIN Identifier Register */ +#define REG_USART1_LINBRR REG_ACCESS(RoReg , 0x4002805CU) /**< \brief (USART1) LIN Baud Rate Register */ +#define REG_USART1_WPMR REG_ACCESS(RwReg , 0x400280E4U) /**< \brief (USART1) Write Protect Mode Register */ +#define REG_USART1_WPSR REG_ACCESS(RoReg , 0x400280E8U) /**< \brief (USART1) Write Protect Status Register */ +#define REG_USART1_VERSION REG_ACCESS(RoReg , 0x400280FCU) /**< \brief (USART1) Version Register */ +/* ========== Register definition for USART2 peripheral ========== */ +#define REG_USART2_CR REG_ACCESS(WoReg , 0x4002C000U) /**< \brief (USART2) Control Register */ +#define REG_USART2_MR REG_ACCESS(RwReg , 0x4002C004U) /**< \brief (USART2) Mode Register */ +#define REG_USART2_IER REG_ACCESS(WoReg , 0x4002C008U) /**< \brief (USART2) Interrupt Enable Register */ +#define REG_USART2_IDR REG_ACCESS(WoReg , 0x4002C00CU) /**< \brief (USART2) Interrupt Disable Register */ +#define REG_USART2_IMR REG_ACCESS(RoReg , 0x4002C010U) /**< \brief (USART2) Interrupt Mask Register */ +#define REG_USART2_CSR REG_ACCESS(RoReg , 0x4002C014U) /**< \brief (USART2) Channel Status Register */ +#define REG_USART2_RHR REG_ACCESS(RoReg , 0x4002C018U) /**< \brief (USART2) Receiver Holding Register */ +#define REG_USART2_THR REG_ACCESS(WoReg , 0x4002C01CU) /**< \brief (USART2) Transmitter Holding Register */ +#define REG_USART2_BRGR REG_ACCESS(RwReg , 0x4002C020U) /**< \brief (USART2) Baud Rate Generator Register */ +#define REG_USART2_RTOR REG_ACCESS(RwReg , 0x4002C024U) /**< \brief (USART2) Receiver Time-out Register */ +#define REG_USART2_TTGR REG_ACCESS(RwReg , 0x4002C028U) /**< \brief (USART2) Transmitter Timeguard Register */ +#define REG_USART2_FIDI REG_ACCESS(RwReg , 0x4002C040U) /**< \brief (USART2) FI DI Ratio Register */ +#define REG_USART2_NER REG_ACCESS(RoReg , 0x4002C044U) /**< \brief (USART2) Number of Errors Register */ +#define REG_USART2_IFR REG_ACCESS(RwReg , 0x4002C04CU) /**< \brief (USART2) IrDA Filter Register */ +#define REG_USART2_MAN REG_ACCESS(RwReg , 0x4002C050U) /**< \brief (USART2) Manchester Configuration Register */ +#define REG_USART2_LINMR REG_ACCESS(RwReg , 0x4002C054U) /**< \brief (USART2) LIN Mode Register */ +#define REG_USART2_LINIR REG_ACCESS(RwReg , 0x4002C058U) /**< \brief (USART2) LIN Identifier Register */ +#define REG_USART2_LINBRR REG_ACCESS(RoReg , 0x4002C05CU) /**< \brief (USART2) LIN Baud Rate Register */ +#define REG_USART2_WPMR REG_ACCESS(RwReg , 0x4002C0E4U) /**< \brief (USART2) Write Protect Mode Register */ +#define REG_USART2_WPSR REG_ACCESS(RoReg , 0x4002C0E8U) /**< \brief (USART2) Write Protect Status Register */ +#define REG_USART2_VERSION REG_ACCESS(RoReg , 0x4002C0FCU) /**< \brief (USART2) Version Register */ +/* ========== Register definition for USART3 peripheral ========== */ +#define REG_USART3_CR REG_ACCESS(WoReg , 0x40030000U) /**< \brief (USART3) Control Register */ +#define REG_USART3_MR REG_ACCESS(RwReg , 0x40030004U) /**< \brief (USART3) Mode Register */ +#define REG_USART3_IER REG_ACCESS(WoReg , 0x40030008U) /**< \brief (USART3) Interrupt Enable Register */ +#define REG_USART3_IDR REG_ACCESS(WoReg , 0x4003000CU) /**< \brief (USART3) Interrupt Disable Register */ +#define REG_USART3_IMR REG_ACCESS(RoReg , 0x40030010U) /**< \brief (USART3) Interrupt Mask Register */ +#define REG_USART3_CSR REG_ACCESS(RoReg , 0x40030014U) /**< \brief (USART3) Channel Status Register */ +#define REG_USART3_RHR REG_ACCESS(RoReg , 0x40030018U) /**< \brief (USART3) Receiver Holding Register */ +#define REG_USART3_THR REG_ACCESS(WoReg , 0x4003001CU) /**< \brief (USART3) Transmitter Holding Register */ +#define REG_USART3_BRGR REG_ACCESS(RwReg , 0x40030020U) /**< \brief (USART3) Baud Rate Generator Register */ +#define REG_USART3_RTOR REG_ACCESS(RwReg , 0x40030024U) /**< \brief (USART3) Receiver Time-out Register */ +#define REG_USART3_TTGR REG_ACCESS(RwReg , 0x40030028U) /**< \brief (USART3) Transmitter Timeguard Register */ +#define REG_USART3_FIDI REG_ACCESS(RwReg , 0x40030040U) /**< \brief (USART3) FI DI Ratio Register */ +#define REG_USART3_NER REG_ACCESS(RoReg , 0x40030044U) /**< \brief (USART3) Number of Errors Register */ +#define REG_USART3_IFR REG_ACCESS(RwReg , 0x4003004CU) /**< \brief (USART3) IrDA Filter Register */ +#define REG_USART3_MAN REG_ACCESS(RwReg , 0x40030050U) /**< \brief (USART3) Manchester Configuration Register */ +#define REG_USART3_LINMR REG_ACCESS(RwReg , 0x40030054U) /**< \brief (USART3) LIN Mode Register */ +#define REG_USART3_LINIR REG_ACCESS(RwReg , 0x40030058U) /**< \brief (USART3) LIN Identifier Register */ +#define REG_USART3_LINBRR REG_ACCESS(RoReg , 0x4003005CU) /**< \brief (USART3) LIN Baud Rate Register */ +#define REG_USART3_WPMR REG_ACCESS(RwReg , 0x400300E4U) /**< \brief (USART3) Write Protect Mode Register */ +#define REG_USART3_WPSR REG_ACCESS(RoReg , 0x400300E8U) /**< \brief (USART3) Write Protect Status Register */ +#define REG_USART3_VERSION REG_ACCESS(RoReg , 0x400300FCU) /**< \brief (USART3) Version Register */ +/* ========== Register definition for ADCIFE peripheral ========== */ +#define REG_ADCIFE_CR REG_ACCESS(WoReg , 0x40038000U) /**< \brief (ADCIFE) Control Register */ +#define REG_ADCIFE_CFG REG_ACCESS(RwReg , 0x40038004U) /**< \brief (ADCIFE) Configuration Register */ +#define REG_ADCIFE_SR REG_ACCESS(RoReg , 0x40038008U) /**< \brief (ADCIFE) Status Register */ +#define REG_ADCIFE_SCR REG_ACCESS(WoReg , 0x4003800CU) /**< \brief (ADCIFE) Status Clear Register */ +#define REG_ADCIFE_RTS REG_ACCESS(RwReg , 0x40038010U) /**< \brief (ADCIFE) Resistive Touch Screen Register */ +#define REG_ADCIFE_SEQCFG REG_ACCESS(RwReg , 0x40038014U) /**< \brief (ADCIFE) Sequencer Configuration Register */ +#define REG_ADCIFE_CDMA REG_ACCESS(WoReg , 0x40038018U) /**< \brief (ADCIFE) Configuration Direct Memory Access Register */ +#define REG_ADCIFE_TIM REG_ACCESS(RwReg , 0x4003801CU) /**< \brief (ADCIFE) Timing Configuration Register */ +#define REG_ADCIFE_ITIMER REG_ACCESS(RwReg , 0x40038020U) /**< \brief (ADCIFE) Internal Timer Register */ +#define REG_ADCIFE_WCFG REG_ACCESS(RwReg , 0x40038024U) /**< \brief (ADCIFE) Window Monitor Configuration Register */ +#define REG_ADCIFE_WTH REG_ACCESS(RwReg , 0x40038028U) /**< \brief (ADCIFE) Window Monitor Threshold Configuration Register */ +#define REG_ADCIFE_LCV REG_ACCESS(RoReg , 0x4003802CU) /**< \brief (ADCIFE) Sequencer Last Converted Value Register */ +#define REG_ADCIFE_IER REG_ACCESS(WoReg , 0x40038030U) /**< \brief (ADCIFE) Interrupt Enable Register */ +#define REG_ADCIFE_IDR REG_ACCESS(WoReg , 0x40038034U) /**< \brief (ADCIFE) Interrupt Disable Register */ +#define REG_ADCIFE_IMR REG_ACCESS(RoReg , 0x40038038U) /**< \brief (ADCIFE) Interrupt Mask Register */ +#define REG_ADCIFE_CALIB REG_ACCESS(RwReg , 0x4003803CU) /**< \brief (ADCIFE) Calibration Register */ +#define REG_ADCIFE_VERSION REG_ACCESS(RoReg , 0x40038040U) /**< \brief (ADCIFE) Version Register */ +#define REG_ADCIFE_PARAMETER REG_ACCESS(RoReg , 0x40038044U) /**< \brief (ADCIFE) Parameter Register */ +/* ========== Register definition for DACC peripheral ========== */ +#define REG_DACC_CR REG_ACCESS(WoReg , 0x4003C000U) /**< \brief (DACC) Control Register */ +#define REG_DACC_MR REG_ACCESS(RwReg , 0x4003C004U) /**< \brief (DACC) Mode Register */ +#define REG_DACC_CDR REG_ACCESS(WoReg , 0x4003C008U) /**< \brief (DACC) Conversion Data Register */ +#define REG_DACC_IER REG_ACCESS(WoReg , 0x4003C00CU) /**< \brief (DACC) Interrupt Enable Register */ +#define REG_DACC_IDR REG_ACCESS(WoReg , 0x4003C010U) /**< \brief (DACC) Interrupt Disable Register */ +#define REG_DACC_IMR REG_ACCESS(RoReg , 0x4003C014U) /**< \brief (DACC) Interrupt Mask Register */ +#define REG_DACC_ISR REG_ACCESS(RoReg , 0x4003C018U) /**< \brief (DACC) Interrupt Status Register */ +#define REG_DACC_WPMR REG_ACCESS(RwReg , 0x4003C0E4U) /**< \brief (DACC) Write Protect Mode Register */ +#define REG_DACC_WPSR REG_ACCESS(RoReg , 0x4003C0E8U) /**< \brief (DACC) Write Protect Status Register */ +#define REG_DACC_VERSION REG_ACCESS(RoReg , 0x4003C0FCU) /**< \brief (DACC) Version Register */ +/* ========== Register definition for ACIFC peripheral ========== */ +#define REG_ACIFC_CTRL REG_ACCESS(RwReg , 0x40040000U) /**< \brief (ACIFC) Control Register */ +#define REG_ACIFC_SR REG_ACCESS(RoReg , 0x40040004U) /**< \brief (ACIFC) Status Register */ +#define REG_ACIFC_IER REG_ACCESS(WoReg , 0x40040010U) /**< \brief (ACIFC) Interrupt Enable Register */ +#define REG_ACIFC_IDR REG_ACCESS(WoReg , 0x40040014U) /**< \brief (ACIFC) Interrupt Disable Register */ +#define REG_ACIFC_IMR REG_ACCESS(RoReg , 0x40040018U) /**< \brief (ACIFC) Interrupt Mask Register */ +#define REG_ACIFC_ISR REG_ACCESS(RoReg , 0x4004001CU) /**< \brief (ACIFC) Interrupt Status Register */ +#define REG_ACIFC_ICR REG_ACCESS(WoReg , 0x40040020U) /**< \brief (ACIFC) Interrupt Status Clear Register */ +#define REG_ACIFC_TR REG_ACCESS(RwReg , 0x40040024U) /**< \brief (ACIFC) Test Register */ +#define REG_ACIFC_PARAMETER REG_ACCESS(RoReg , 0x40040030U) /**< \brief (ACIFC) Parameter Register */ +#define REG_ACIFC_VERSION REG_ACCESS(RoReg , 0x40040034U) /**< \brief (ACIFC) Version Register */ +#define REG_ACIFC_CONFW0 REG_ACCESS(RwReg , 0x40040080U) /**< \brief (ACIFC) Window configuration Register 0 */ +#define REG_ACIFC_CONFW1 REG_ACCESS(RwReg , 0x40040084U) /**< \brief (ACIFC) Window configuration Register 1 */ +#define REG_ACIFC_CONFW2 REG_ACCESS(RwReg , 0x40040088U) /**< \brief (ACIFC) Window configuration Register 2 */ +#define REG_ACIFC_CONFW3 REG_ACCESS(RwReg , 0x4004008CU) /**< \brief (ACIFC) Window configuration Register 3 */ +#define REG_ACIFC_CONF0 REG_ACCESS(RwReg , 0x400400D0U) /**< \brief (ACIFC) AC Configuration Register 0 */ +#define REG_ACIFC_CONF1 REG_ACCESS(RwReg , 0x400400D4U) /**< \brief (ACIFC) AC Configuration Register 1 */ +#define REG_ACIFC_CONF2 REG_ACCESS(RwReg , 0x400400D8U) /**< \brief (ACIFC) AC Configuration Register 2 */ +#define REG_ACIFC_CONF3 REG_ACCESS(RwReg , 0x400400DCU) /**< \brief (ACIFC) AC Configuration Register 3 */ +#define REG_ACIFC_CONF4 REG_ACCESS(RwReg , 0x400400E0U) /**< \brief (ACIFC) AC Configuration Register 4 */ +#define REG_ACIFC_CONF5 REG_ACCESS(RwReg , 0x400400E4U) /**< \brief (ACIFC) AC Configuration Register 5 */ +#define REG_ACIFC_CONF6 REG_ACCESS(RwReg , 0x400400E8U) /**< \brief (ACIFC) AC Configuration Register 6 */ +#define REG_ACIFC_CONF7 REG_ACCESS(RwReg , 0x400400ECU) /**< \brief (ACIFC) AC Configuration Register 7 */ +/* ========== Register definition for GLOC peripheral ========== */ +#define REG_GLOC_CR0 REG_ACCESS(RwReg , 0x40060000U) /**< \brief (GLOC) Control Register 0 */ +#define REG_GLOC_TRUTH0 REG_ACCESS(RwReg , 0x40060004U) /**< \brief (GLOC) Truth Register 0 */ +#define REG_GLOC_CR1 REG_ACCESS(RwReg , 0x40060008U) /**< \brief (GLOC) Control Register 1 */ +#define REG_GLOC_TRUTH1 REG_ACCESS(RwReg , 0x4006000CU) /**< \brief (GLOC) Truth Register 1 */ +#define REG_GLOC_PARAMETER REG_ACCESS(RoReg , 0x40060038U) /**< \brief (GLOC) Parameter Register */ +#define REG_GLOC_VERSION REG_ACCESS(RoReg , 0x4006003CU) /**< \brief (GLOC) Version Register */ +/* ========== Register definition for ABDACB peripheral ========== */ +#define REG_ABDACB_CR REG_ACCESS(RwReg , 0x40064000U) /**< \brief (ABDACB) Control Register */ +#define REG_ABDACB_SDR0 REG_ACCESS(RwReg , 0x40064004U) /**< \brief (ABDACB) Sample Data Register 0 */ +#define REG_ABDACB_SDR1 REG_ACCESS(RwReg , 0x40064008U) /**< \brief (ABDACB) Sample Data Register 1 */ +#define REG_ABDACB_VCR0 REG_ACCESS(RwReg , 0x4006400CU) /**< \brief (ABDACB) Volume Control Register 0 */ +#define REG_ABDACB_VCR1 REG_ACCESS(RwReg , 0x40064010U) /**< \brief (ABDACB) Volume Control Register 1 */ +#define REG_ABDACB_IER REG_ACCESS(WoReg , 0x40064014U) /**< \brief (ABDACB) Interrupt Enable Register */ +#define REG_ABDACB_IDR REG_ACCESS(WoReg , 0x40064018U) /**< \brief (ABDACB) Interupt Disable Register */ +#define REG_ABDACB_IMR REG_ACCESS(RoReg , 0x4006401CU) /**< \brief (ABDACB) Interrupt Mask Register */ +#define REG_ABDACB_SR REG_ACCESS(RoReg , 0x40064020U) /**< \brief (ABDACB) Status Register */ +#define REG_ABDACB_SCR REG_ACCESS(WoReg , 0x40064024U) /**< \brief (ABDACB) Status Clear Register */ +#define REG_ABDACB_PARAMETER REG_ACCESS(RoReg , 0x40064028U) /**< \brief (ABDACB) Parameter Register */ +#define REG_ABDACB_VERSION REG_ACCESS(RoReg , 0x4006402CU) /**< \brief (ABDACB) Version Register */ +/* ========== Register definition for TRNG peripheral ========== */ +#define REG_TRNG_CR REG_ACCESS(WoReg , 0x40068000U) /**< \brief (TRNG) Control Register */ +#define REG_TRNG_IER REG_ACCESS(WoReg , 0x40068010U) /**< \brief (TRNG) Interrupt Enable Register */ +#define REG_TRNG_IDR REG_ACCESS(WoReg , 0x40068014U) /**< \brief (TRNG) Interrupt Disable Register */ +#define REG_TRNG_IMR REG_ACCESS(RoReg , 0x40068018U) /**< \brief (TRNG) Interrupt Mask Register */ +#define REG_TRNG_ISR REG_ACCESS(RoReg , 0x4006801CU) /**< \brief (TRNG) Interrupt Status Register */ +#define REG_TRNG_ODATA REG_ACCESS(RoReg , 0x40068050U) /**< \brief (TRNG) Output Data Register */ +#define REG_TRNG_VERSION REG_ACCESS(RoReg , 0x400680FCU) /**< \brief (TRNG) Version Register */ +/* ========== Register definition for PARC peripheral ========== */ +#define REG_PARC_CFG REG_ACCESS(RwReg , 0x4006C000U) /**< \brief (PARC) Configuration Register */ +#define REG_PARC_CR REG_ACCESS(RwReg , 0x4006C004U) /**< \brief (PARC) Control Register */ +#define REG_PARC_IER REG_ACCESS(WoReg , 0x4006C008U) /**< \brief (PARC) Interrupt Enable Register */ +#define REG_PARC_IDR REG_ACCESS(WoReg , 0x4006C00CU) /**< \brief (PARC) Interrupt Disable Register */ +#define REG_PARC_IMR REG_ACCESS(RoReg , 0x4006C010U) /**< \brief (PARC) Interrupt Mask Register */ +#define REG_PARC_SR REG_ACCESS(RoReg , 0x4006C014U) /**< \brief (PARC) Status Register */ +#define REG_PARC_ICR REG_ACCESS(WoReg , 0x4006C018U) /**< \brief (PARC) Interrupt Status Clear Register */ +#define REG_PARC_RHR REG_ACCESS(RoReg , 0x4006C01CU) /**< \brief (PARC) Receive Holding Register */ +#define REG_PARC_VERSION REG_ACCESS(RoReg , 0x4006C020U) /**< \brief (PARC) Version Register */ +/* ========== Register definition for CATB peripheral ========== */ +#define REG_CATB_CR REG_ACCESS(RwReg , 0x40070000U) /**< \brief (CATB) Control Register */ +#define REG_CATB_CNTCR REG_ACCESS(RwReg , 0x40070004U) /**< \brief (CATB) Counter Control Register */ +#define REG_CATB_IDLE REG_ACCESS(RwReg , 0x40070008U) /**< \brief (CATB) Sensor Idle Level */ +#define REG_CATB_LEVEL REG_ACCESS(RoReg , 0x4007000CU) /**< \brief (CATB) Sensor Relative Level */ +#define REG_CATB_RAW REG_ACCESS(RoReg , 0x40070010U) /**< \brief (CATB) Sensor Raw Value */ +#define REG_CATB_TIMING REG_ACCESS(RwReg , 0x40070014U) /**< \brief (CATB) Filter Timing Register */ +#define REG_CATB_THRESH REG_ACCESS(RwReg , 0x40070018U) /**< \brief (CATB) Threshold Register */ +#define REG_CATB_PINSEL REG_ACCESS(RwReg , 0x4007001CU) /**< \brief (CATB) Pin Selection Register */ +#define REG_CATB_DMA REG_ACCESS(RwReg , 0x40070020U) /**< \brief (CATB) Direct Memory Access Register */ +#define REG_CATB_ISR REG_ACCESS(RoReg , 0x40070024U) /**< \brief (CATB) Interrupt Status Register */ +#define REG_CATB_IER REG_ACCESS(WoReg , 0x40070028U) /**< \brief (CATB) Interrupt Enable Register */ +#define REG_CATB_IDR REG_ACCESS(WoReg , 0x4007002CU) /**< \brief (CATB) Interrupt Disable Register */ +#define REG_CATB_IMR REG_ACCESS(RoReg , 0x40070030U) /**< \brief (CATB) Interrupt Mask Register */ +#define REG_CATB_SCR REG_ACCESS(WoReg , 0x40070034U) /**< \brief (CATB) Status Clear Register */ +#define REG_CATB_INTCH0 REG_ACCESS(RoReg , 0x40070040U) /**< \brief (CATB) In-Touch Status Register 0 0 */ +#define REG_CATB_INTCHCLR0 REG_ACCESS(WoReg , 0x40070050U) /**< \brief (CATB) In-Touch Status Clear Register 0 0 */ +#define REG_CATB_OUTTCH0 REG_ACCESS(RoReg , 0x40070060U) /**< \brief (CATB) Out-of-Touch Status Register 0 0 */ +#define REG_CATB_OUTTCHCLR0 REG_ACCESS(WoReg , 0x40070070U) /**< \brief (CATB) Out-of-Touch Status Clear Register 0 0 */ +#define REG_CATB_PARAMETER REG_ACCESS(RoReg , 0x400700F8U) /**< \brief (CATB) Parameter Register */ +#define REG_CATB_VERSION REG_ACCESS(RoReg , 0x400700FCU) /**< \brief (CATB) Version Register */ +/* ========== Register definition for TWIM2 peripheral ========== */ +#define REG_TWIM2_CR REG_ACCESS(WoReg , 0x40078000U) /**< \brief (TWIM2) Control Register */ +#define REG_TWIM2_CWGR REG_ACCESS(RwReg , 0x40078004U) /**< \brief (TWIM2) Clock Waveform Generator Register */ +#define REG_TWIM2_SMBTR REG_ACCESS(RwReg , 0x40078008U) /**< \brief (TWIM2) SMBus Timing Register */ +#define REG_TWIM2_CMDR REG_ACCESS(RwReg , 0x4007800CU) /**< \brief (TWIM2) Command Register */ +#define REG_TWIM2_NCMDR REG_ACCESS(RwReg , 0x40078010U) /**< \brief (TWIM2) Next Command Register */ +#define REG_TWIM2_RHR REG_ACCESS(RoReg , 0x40078014U) /**< \brief (TWIM2) Receive Holding Register */ +#define REG_TWIM2_THR REG_ACCESS(WoReg , 0x40078018U) /**< \brief (TWIM2) Transmit Holding Register */ +#define REG_TWIM2_SR REG_ACCESS(RoReg , 0x4007801CU) /**< \brief (TWIM2) Status Register */ +#define REG_TWIM2_IER REG_ACCESS(WoReg , 0x40078020U) /**< \brief (TWIM2) Interrupt Enable Register */ +#define REG_TWIM2_IDR REG_ACCESS(WoReg , 0x40078024U) /**< \brief (TWIM2) Interrupt Disable Register */ +#define REG_TWIM2_IMR REG_ACCESS(RoReg , 0x40078028U) /**< \brief (TWIM2) Interrupt Mask Register */ +#define REG_TWIM2_SCR REG_ACCESS(WoReg , 0x4007802CU) /**< \brief (TWIM2) Status Clear Register */ +#define REG_TWIM2_PR REG_ACCESS(RoReg , 0x40078030U) /**< \brief (TWIM2) Parameter Register */ +#define REG_TWIM2_VR REG_ACCESS(RoReg , 0x40078034U) /**< \brief (TWIM2) Version Register */ +#define REG_TWIM2_HSCWGR REG_ACCESS(RwReg , 0x40078038U) /**< \brief (TWIM2) HS-mode Clock Waveform Generator */ +#define REG_TWIM2_SRR REG_ACCESS(RwReg , 0x4007803CU) /**< \brief (TWIM2) Slew Rate Register */ +#define REG_TWIM2_HSSRR REG_ACCESS(RwReg , 0x40078040U) /**< \brief (TWIM2) HS-mode Slew Rate Register */ +/* ========== Register definition for TWIM3 peripheral ========== */ +#define REG_TWIM3_CR REG_ACCESS(WoReg , 0x4007C000U) /**< \brief (TWIM3) Control Register */ +#define REG_TWIM3_CWGR REG_ACCESS(RwReg , 0x4007C004U) /**< \brief (TWIM3) Clock Waveform Generator Register */ +#define REG_TWIM3_SMBTR REG_ACCESS(RwReg , 0x4007C008U) /**< \brief (TWIM3) SMBus Timing Register */ +#define REG_TWIM3_CMDR REG_ACCESS(RwReg , 0x4007C00CU) /**< \brief (TWIM3) Command Register */ +#define REG_TWIM3_NCMDR REG_ACCESS(RwReg , 0x4007C010U) /**< \brief (TWIM3) Next Command Register */ +#define REG_TWIM3_RHR REG_ACCESS(RoReg , 0x4007C014U) /**< \brief (TWIM3) Receive Holding Register */ +#define REG_TWIM3_THR REG_ACCESS(WoReg , 0x4007C018U) /**< \brief (TWIM3) Transmit Holding Register */ +#define REG_TWIM3_SR REG_ACCESS(RoReg , 0x4007C01CU) /**< \brief (TWIM3) Status Register */ +#define REG_TWIM3_IER REG_ACCESS(WoReg , 0x4007C020U) /**< \brief (TWIM3) Interrupt Enable Register */ +#define REG_TWIM3_IDR REG_ACCESS(WoReg , 0x4007C024U) /**< \brief (TWIM3) Interrupt Disable Register */ +#define REG_TWIM3_IMR REG_ACCESS(RoReg , 0x4007C028U) /**< \brief (TWIM3) Interrupt Mask Register */ +#define REG_TWIM3_SCR REG_ACCESS(WoReg , 0x4007C02CU) /**< \brief (TWIM3) Status Clear Register */ +#define REG_TWIM3_PR REG_ACCESS(RoReg , 0x4007C030U) /**< \brief (TWIM3) Parameter Register */ +#define REG_TWIM3_VR REG_ACCESS(RoReg , 0x4007C034U) /**< \brief (TWIM3) Version Register */ +#define REG_TWIM3_HSCWGR REG_ACCESS(RwReg , 0x4007C038U) /**< \brief (TWIM3) HS-mode Clock Waveform Generator */ +#define REG_TWIM3_SRR REG_ACCESS(RwReg , 0x4007C03CU) /**< \brief (TWIM3) Slew Rate Register */ +#define REG_TWIM3_HSSRR REG_ACCESS(RwReg , 0x4007C040U) /**< \brief (TWIM3) HS-mode Slew Rate Register */ +/* ========== Register definition for LCDCA peripheral ========== */ +#define REG_LCDCA_CR REG_ACCESS(WoReg , 0x40080000U) /**< \brief (LCDCA) Control Register */ +#define REG_LCDCA_CFG REG_ACCESS(RwReg , 0x40080004U) /**< \brief (LCDCA) Configuration Register */ +#define REG_LCDCA_TIM REG_ACCESS(RwReg , 0x40080008U) /**< \brief (LCDCA) Timing Register */ +#define REG_LCDCA_SR REG_ACCESS(RoReg , 0x4008000CU) /**< \brief (LCDCA) Status Register */ +#define REG_LCDCA_SCR REG_ACCESS(WoReg , 0x40080010U) /**< \brief (LCDCA) Status Clear Register */ +#define REG_LCDCA_DRL0 REG_ACCESS(RwReg , 0x40080014U) /**< \brief (LCDCA) Data Register Low 0 */ +#define REG_LCDCA_DRH0 REG_ACCESS(RwReg , 0x40080018U) /**< \brief (LCDCA) Data Register High 0 */ +#define REG_LCDCA_DRL1 REG_ACCESS(RwReg , 0x4008001CU) /**< \brief (LCDCA) Data Register Low 1 */ +#define REG_LCDCA_DRH1 REG_ACCESS(RwReg , 0x40080020U) /**< \brief (LCDCA) Data Register High 1 */ +#define REG_LCDCA_DRL2 REG_ACCESS(RwReg , 0x40080024U) /**< \brief (LCDCA) Data Register Low 2 */ +#define REG_LCDCA_DRH2 REG_ACCESS(RwReg , 0x40080028U) /**< \brief (LCDCA) Data Register High 2 */ +#define REG_LCDCA_DRL3 REG_ACCESS(RwReg , 0x4008002CU) /**< \brief (LCDCA) Data Register Low 3 */ +#define REG_LCDCA_DRH3 REG_ACCESS(RwReg , 0x40080030U) /**< \brief (LCDCA) Data Register High 3 */ +#define REG_LCDCA_IADR REG_ACCESS(WoReg , 0x40080034U) /**< \brief (LCDCA) Indirect Access Data Register */ +#define REG_LCDCA_BCFG REG_ACCESS(RwReg , 0x40080038U) /**< \brief (LCDCA) Blink Configuration Register */ +#define REG_LCDCA_CSRCFG REG_ACCESS(RwReg , 0x4008003CU) /**< \brief (LCDCA) Circular Shift Register Configuration */ +#define REG_LCDCA_CMCFG REG_ACCESS(RwReg , 0x40080040U) /**< \brief (LCDCA) Character Mapping Configuration Register */ +#define REG_LCDCA_CMDR REG_ACCESS(WoReg , 0x40080044U) /**< \brief (LCDCA) Character Mapping Data Register */ +#define REG_LCDCA_ACMCFG REG_ACCESS(RwReg , 0x40080048U) /**< \brief (LCDCA) Automated Character Mapping Configuration Register */ +#define REG_LCDCA_ACMDR REG_ACCESS(WoReg , 0x4008004CU) /**< \brief (LCDCA) Automated Character Mapping Data Register */ +#define REG_LCDCA_ABMCFG REG_ACCESS(RwReg , 0x40080050U) /**< \brief (LCDCA) Automated Bit Mapping Configuration Register */ +#define REG_LCDCA_ABMDR REG_ACCESS(WoReg , 0x40080054U) /**< \brief (LCDCA) Automated Bit Mapping Data Register */ +#define REG_LCDCA_IER REG_ACCESS(WoReg , 0x40080058U) /**< \brief (LCDCA) Interrupt Enable Register */ +#define REG_LCDCA_IDR REG_ACCESS(WoReg , 0x4008005CU) /**< \brief (LCDCA) Interrupt Disable Register */ +#define REG_LCDCA_IMR REG_ACCESS(RoReg , 0x40080060U) /**< \brief (LCDCA) Interrupt Mask Register */ +#define REG_LCDCA_VERSION REG_ACCESS(RoReg , 0x40080064U) /**< \brief (LCDCA) Version Register */ +/* ========== Register definition for HFLASHC peripheral ========== */ +#define REG_HFLASHC_FCR REG_ACCESS(RwReg , 0x400A0000U) /**< \brief (HFLASHC) Flash Controller Control Register */ +#define REG_HFLASHC_FCMD REG_ACCESS(RwReg , 0x400A0004U) /**< \brief (HFLASHC) Flash Controller Command Register */ +#define REG_HFLASHC_FSR REG_ACCESS(RwReg , 0x400A0008U) /**< \brief (HFLASHC) Flash Controller Status Register */ +#define REG_HFLASHC_FPR REG_ACCESS(RoReg , 0x400A000CU) /**< \brief (HFLASHC) Flash Controller Parameter Register */ +#define REG_HFLASHC_VERSION REG_ACCESS(RoReg , 0x400A0010U) /**< \brief (HFLASHC) Flash Controller Version Register */ +#define REG_HFLASHC_FGPFRHI REG_ACCESS(RwReg , 0x400A0014U) /**< \brief (HFLASHC) Flash Controller General Purpose Fuse Register High */ +#define REG_HFLASHC_FGPFRLO REG_ACCESS(RwReg , 0x400A0018U) /**< \brief (HFLASHC) Flash Controller General Purpose Fuse Register Low */ +/* ========== Register definition for HCACHE peripheral ========== */ +#define REG_HCACHE_CTRL REG_ACCESS(WoReg , 0x400A0408U) /**< \brief (HCACHE) Control Register */ +#define REG_HCACHE_SR REG_ACCESS(RwReg , 0x400A040CU) /**< \brief (HCACHE) Status Register */ +#define REG_HCACHE_MAINT0 REG_ACCESS(WoReg , 0x400A0420U) /**< \brief (HCACHE) Maintenance Register 0 */ +#define REG_HCACHE_MAINT1 REG_ACCESS(WoReg , 0x400A0424U) /**< \brief (HCACHE) Maintenance Register 1 */ +#define REG_HCACHE_MCFG REG_ACCESS(RwReg , 0x400A0428U) /**< \brief (HCACHE) Monitor Configuration Register */ +#define REG_HCACHE_MEN REG_ACCESS(RwReg , 0x400A042CU) /**< \brief (HCACHE) Monitor Enable Register */ +#define REG_HCACHE_MCTRL REG_ACCESS(WoReg , 0x400A0430U) /**< \brief (HCACHE) Monitor Control Register */ +#define REG_HCACHE_MSR REG_ACCESS(RoReg , 0x400A0434U) /**< \brief (HCACHE) Monitor Status Register */ +#define REG_HCACHE_VERSION REG_ACCESS(RoReg , 0x400A04FCU) /**< \brief (HCACHE) Version Register */ +/* ========== Register definition for HMATRIX peripheral ========== */ +#define REG_HMATRIX_MCFG0 REG_ACCESS(RwReg , 0x400A1000U) /**< \brief (HMATRIX) Master Configuration Register 0 0 */ +#define REG_HMATRIX_MCFG1 REG_ACCESS(RwReg , 0x400A1004U) /**< \brief (HMATRIX) Master Configuration Register 0 1 */ +#define REG_HMATRIX_MCFG2 REG_ACCESS(RwReg , 0x400A1008U) /**< \brief (HMATRIX) Master Configuration Register 0 2 */ +#define REG_HMATRIX_MCFG3 REG_ACCESS(RwReg , 0x400A100CU) /**< \brief (HMATRIX) Master Configuration Register 0 3 */ +#define REG_HMATRIX_MCFG4 REG_ACCESS(RwReg , 0x400A1010U) /**< \brief (HMATRIX) Master Configuration Register 0 4 */ +#define REG_HMATRIX_MCFG5 REG_ACCESS(RwReg , 0x400A1014U) /**< \brief (HMATRIX) Master Configuration Register 0 5 */ +#define REG_HMATRIX_MCFG6 REG_ACCESS(RwReg , 0x400A1018U) /**< \brief (HMATRIX) Master Configuration Register 0 6 */ +#define REG_HMATRIX_MCFG7 REG_ACCESS(RwReg , 0x400A101CU) /**< \brief (HMATRIX) Master Configuration Register 0 7 */ +#define REG_HMATRIX_MCFG8 REG_ACCESS(RwReg , 0x400A1020U) /**< \brief (HMATRIX) Master Configuration Register 0 8 */ +#define REG_HMATRIX_MCFG9 REG_ACCESS(RwReg , 0x400A1024U) /**< \brief (HMATRIX) Master Configuration Register 0 9 */ +#define REG_HMATRIX_MCFG10 REG_ACCESS(RwReg , 0x400A1028U) /**< \brief (HMATRIX) Master Configuration Register 0 10 */ +#define REG_HMATRIX_MCFG11 REG_ACCESS(RwReg , 0x400A102CU) /**< \brief (HMATRIX) Master Configuration Register 0 11 */ +#define REG_HMATRIX_MCFG12 REG_ACCESS(RwReg , 0x400A1030U) /**< \brief (HMATRIX) Master Configuration Register 0 12 */ +#define REG_HMATRIX_MCFG13 REG_ACCESS(RwReg , 0x400A1034U) /**< \brief (HMATRIX) Master Configuration Register 0 13 */ +#define REG_HMATRIX_MCFG14 REG_ACCESS(RwReg , 0x400A1038U) /**< \brief (HMATRIX) Master Configuration Register 0 14 */ +#define REG_HMATRIX_MCFG15 REG_ACCESS(RwReg , 0x400A103CU) /**< \brief (HMATRIX) Master Configuration Register 0 15 */ +#define REG_HMATRIX_SCFG0 REG_ACCESS(RwReg , 0x400A1040U) /**< \brief (HMATRIX) Slave Configuration Register 0 0 */ +#define REG_HMATRIX_SCFG1 REG_ACCESS(RwReg , 0x400A1044U) /**< \brief (HMATRIX) Slave Configuration Register 0 1 */ +#define REG_HMATRIX_SCFG2 REG_ACCESS(RwReg , 0x400A1048U) /**< \brief (HMATRIX) Slave Configuration Register 0 2 */ +#define REG_HMATRIX_SCFG3 REG_ACCESS(RwReg , 0x400A104CU) /**< \brief (HMATRIX) Slave Configuration Register 0 3 */ +#define REG_HMATRIX_SCFG4 REG_ACCESS(RwReg , 0x400A1050U) /**< \brief (HMATRIX) Slave Configuration Register 0 4 */ +#define REG_HMATRIX_SCFG5 REG_ACCESS(RwReg , 0x400A1054U) /**< \brief (HMATRIX) Slave Configuration Register 0 5 */ +#define REG_HMATRIX_SCFG6 REG_ACCESS(RwReg , 0x400A1058U) /**< \brief (HMATRIX) Slave Configuration Register 0 6 */ +#define REG_HMATRIX_SCFG7 REG_ACCESS(RwReg , 0x400A105CU) /**< \brief (HMATRIX) Slave Configuration Register 0 7 */ +#define REG_HMATRIX_SCFG8 REG_ACCESS(RwReg , 0x400A1060U) /**< \brief (HMATRIX) Slave Configuration Register 0 8 */ +#define REG_HMATRIX_SCFG9 REG_ACCESS(RwReg , 0x400A1064U) /**< \brief (HMATRIX) Slave Configuration Register 0 9 */ +#define REG_HMATRIX_SCFG10 REG_ACCESS(RwReg , 0x400A1068U) /**< \brief (HMATRIX) Slave Configuration Register 0 10 */ +#define REG_HMATRIX_SCFG11 REG_ACCESS(RwReg , 0x400A106CU) /**< \brief (HMATRIX) Slave Configuration Register 0 11 */ +#define REG_HMATRIX_SCFG12 REG_ACCESS(RwReg , 0x400A1070U) /**< \brief (HMATRIX) Slave Configuration Register 0 12 */ +#define REG_HMATRIX_SCFG13 REG_ACCESS(RwReg , 0x400A1074U) /**< \brief (HMATRIX) Slave Configuration Register 0 13 */ +#define REG_HMATRIX_SCFG14 REG_ACCESS(RwReg , 0x400A1078U) /**< \brief (HMATRIX) Slave Configuration Register 0 14 */ +#define REG_HMATRIX_SCFG15 REG_ACCESS(RwReg , 0x400A107CU) /**< \brief (HMATRIX) Slave Configuration Register 0 15 */ +#define REG_HMATRIX_PRAS0 REG_ACCESS(RwReg , 0x400A1080U) /**< \brief (HMATRIX) Priority Register A for Slave 0 0 */ +#define REG_HMATRIX_PRBS0 REG_ACCESS(RwReg , 0x400A1084U) /**< \brief (HMATRIX) Priority Register B for Slave 0 0 */ +#define REG_HMATRIX_PRAS1 REG_ACCESS(RwReg , 0x400A1088U) /**< \brief (HMATRIX) Priority Register A for Slave 0 1 */ +#define REG_HMATRIX_PRBS1 REG_ACCESS(RwReg , 0x400A108CU) /**< \brief (HMATRIX) Priority Register B for Slave 0 1 */ +#define REG_HMATRIX_PRAS2 REG_ACCESS(RwReg , 0x400A1090U) /**< \brief (HMATRIX) Priority Register A for Slave 0 2 */ +#define REG_HMATRIX_PRBS2 REG_ACCESS(RwReg , 0x400A1094U) /**< \brief (HMATRIX) Priority Register B for Slave 0 2 */ +#define REG_HMATRIX_PRAS3 REG_ACCESS(RwReg , 0x400A1098U) /**< \brief (HMATRIX) Priority Register A for Slave 0 3 */ +#define REG_HMATRIX_PRBS3 REG_ACCESS(RwReg , 0x400A109CU) /**< \brief (HMATRIX) Priority Register B for Slave 0 3 */ +#define REG_HMATRIX_PRAS4 REG_ACCESS(RwReg , 0x400A10A0U) /**< \brief (HMATRIX) Priority Register A for Slave 0 4 */ +#define REG_HMATRIX_PRBS4 REG_ACCESS(RwReg , 0x400A10A4U) /**< \brief (HMATRIX) Priority Register B for Slave 0 4 */ +#define REG_HMATRIX_PRAS5 REG_ACCESS(RwReg , 0x400A10A8U) /**< \brief (HMATRIX) Priority Register A for Slave 0 5 */ +#define REG_HMATRIX_PRBS5 REG_ACCESS(RwReg , 0x400A10ACU) /**< \brief (HMATRIX) Priority Register B for Slave 0 5 */ +#define REG_HMATRIX_PRAS6 REG_ACCESS(RwReg , 0x400A10B0U) /**< \brief (HMATRIX) Priority Register A for Slave 0 6 */ +#define REG_HMATRIX_PRBS6 REG_ACCESS(RwReg , 0x400A10B4U) /**< \brief (HMATRIX) Priority Register B for Slave 0 6 */ +#define REG_HMATRIX_PRAS7 REG_ACCESS(RwReg , 0x400A10B8U) /**< \brief (HMATRIX) Priority Register A for Slave 0 7 */ +#define REG_HMATRIX_PRBS7 REG_ACCESS(RwReg , 0x400A10BCU) /**< \brief (HMATRIX) Priority Register B for Slave 0 7 */ +#define REG_HMATRIX_PRAS8 REG_ACCESS(RwReg , 0x400A10C0U) /**< \brief (HMATRIX) Priority Register A for Slave 0 8 */ +#define REG_HMATRIX_PRBS8 REG_ACCESS(RwReg , 0x400A10C4U) /**< \brief (HMATRIX) Priority Register B for Slave 0 8 */ +#define REG_HMATRIX_PRAS9 REG_ACCESS(RwReg , 0x400A10C8U) /**< \brief (HMATRIX) Priority Register A for Slave 0 9 */ +#define REG_HMATRIX_PRBS9 REG_ACCESS(RwReg , 0x400A10CCU) /**< \brief (HMATRIX) Priority Register B for Slave 0 9 */ +#define REG_HMATRIX_PRAS10 REG_ACCESS(RwReg , 0x400A10D0U) /**< \brief (HMATRIX) Priority Register A for Slave 0 10 */ +#define REG_HMATRIX_PRBS10 REG_ACCESS(RwReg , 0x400A10D4U) /**< \brief (HMATRIX) Priority Register B for Slave 0 10 */ +#define REG_HMATRIX_PRAS11 REG_ACCESS(RwReg , 0x400A10D8U) /**< \brief (HMATRIX) Priority Register A for Slave 0 11 */ +#define REG_HMATRIX_PRBS11 REG_ACCESS(RwReg , 0x400A10DCU) /**< \brief (HMATRIX) Priority Register B for Slave 0 11 */ +#define REG_HMATRIX_PRAS12 REG_ACCESS(RwReg , 0x400A10E0U) /**< \brief (HMATRIX) Priority Register A for Slave 0 12 */ +#define REG_HMATRIX_PRBS12 REG_ACCESS(RwReg , 0x400A10E4U) /**< \brief (HMATRIX) Priority Register B for Slave 0 12 */ +#define REG_HMATRIX_PRAS13 REG_ACCESS(RwReg , 0x400A10E8U) /**< \brief (HMATRIX) Priority Register A for Slave 0 13 */ +#define REG_HMATRIX_PRBS13 REG_ACCESS(RwReg , 0x400A10ECU) /**< \brief (HMATRIX) Priority Register B for Slave 0 13 */ +#define REG_HMATRIX_PRAS14 REG_ACCESS(RwReg , 0x400A10F0U) /**< \brief (HMATRIX) Priority Register A for Slave 0 14 */ +#define REG_HMATRIX_PRBS14 REG_ACCESS(RwReg , 0x400A10F4U) /**< \brief (HMATRIX) Priority Register B for Slave 0 14 */ +#define REG_HMATRIX_PRAS15 REG_ACCESS(RwReg , 0x400A10F8U) /**< \brief (HMATRIX) Priority Register A for Slave 0 15 */ +#define REG_HMATRIX_PRBS15 REG_ACCESS(RwReg , 0x400A10FCU) /**< \brief (HMATRIX) Priority Register B for Slave 0 15 */ +#define REG_HMATRIX_MRCR REG_ACCESS(RwReg , 0x400A1100U) /**< \brief (HMATRIX) Master Remap Control Register */ +#define REG_HMATRIX_SFR0 REG_ACCESS(RwReg , 0x400A1110U) /**< \brief (HMATRIX) Special Function Register 0 0 */ +#define REG_HMATRIX_SFR1 REG_ACCESS(RwReg , 0x400A1114U) /**< \brief (HMATRIX) Special Function Register 0 1 */ +#define REG_HMATRIX_SFR2 REG_ACCESS(RwReg , 0x400A1118U) /**< \brief (HMATRIX) Special Function Register 0 2 */ +#define REG_HMATRIX_SFR3 REG_ACCESS(RwReg , 0x400A111CU) /**< \brief (HMATRIX) Special Function Register 0 3 */ +#define REG_HMATRIX_SFR4 REG_ACCESS(RwReg , 0x400A1120U) /**< \brief (HMATRIX) Special Function Register 0 4 */ +#define REG_HMATRIX_SFR5 REG_ACCESS(RwReg , 0x400A1124U) /**< \brief (HMATRIX) Special Function Register 0 5 */ +#define REG_HMATRIX_SFR6 REG_ACCESS(RwReg , 0x400A1128U) /**< \brief (HMATRIX) Special Function Register 0 6 */ +#define REG_HMATRIX_SFR7 REG_ACCESS(RwReg , 0x400A112CU) /**< \brief (HMATRIX) Special Function Register 0 7 */ +#define REG_HMATRIX_SFR8 REG_ACCESS(RwReg , 0x400A1130U) /**< \brief (HMATRIX) Special Function Register 0 8 */ +#define REG_HMATRIX_SFR9 REG_ACCESS(RwReg , 0x400A1134U) /**< \brief (HMATRIX) Special Function Register 0 9 */ +#define REG_HMATRIX_SFR10 REG_ACCESS(RwReg , 0x400A1138U) /**< \brief (HMATRIX) Special Function Register 0 10 */ +#define REG_HMATRIX_SFR11 REG_ACCESS(RwReg , 0x400A113CU) /**< \brief (HMATRIX) Special Function Register 0 11 */ +#define REG_HMATRIX_SFR12 REG_ACCESS(RwReg , 0x400A1140U) /**< \brief (HMATRIX) Special Function Register 0 12 */ +#define REG_HMATRIX_SFR13 REG_ACCESS(RwReg , 0x400A1144U) /**< \brief (HMATRIX) Special Function Register 0 13 */ +#define REG_HMATRIX_SFR14 REG_ACCESS(RwReg , 0x400A1148U) /**< \brief (HMATRIX) Special Function Register 0 14 */ +#define REG_HMATRIX_SFR15 REG_ACCESS(RwReg , 0x400A114CU) /**< \brief (HMATRIX) Special Function Register 0 15 */ +/* ========== Register definition for PDCA peripheral ========== */ +#define REG_PDCA_MAR0 REG_ACCESS(RwReg , 0x400A2000U) /**< \brief (PDCA) Memory Address Register 0 */ +#define REG_PDCA_PSR0 REG_ACCESS(RwReg , 0x400A2004U) /**< \brief (PDCA) Peripheral Select Register 0 */ +#define REG_PDCA_TCR0 REG_ACCESS(RwReg , 0x400A2008U) /**< \brief (PDCA) Transfer Counter Register 0 */ +#define REG_PDCA_MARR0 REG_ACCESS(RwReg , 0x400A200CU) /**< \brief (PDCA) Memory Address Reload Register 0 */ +#define REG_PDCA_TCRR0 REG_ACCESS(RwReg , 0x400A2010U) /**< \brief (PDCA) Transfer Counter Reload Register 0 */ +#define REG_PDCA_CR0 REG_ACCESS(WoReg , 0x400A2014U) /**< \brief (PDCA) Control Register 0 */ +#define REG_PDCA_MR0 REG_ACCESS(RwReg , 0x400A2018U) /**< \brief (PDCA) Mode Register 0 */ +#define REG_PDCA_SR0 REG_ACCESS(RoReg , 0x400A201CU) /**< \brief (PDCA) Status Register 0 */ +#define REG_PDCA_IER0 REG_ACCESS(WoReg , 0x400A2020U) /**< \brief (PDCA) Interrupt Enable Register 0 */ +#define REG_PDCA_IDR0 REG_ACCESS(WoReg , 0x400A2024U) /**< \brief (PDCA) Interrupt Disable Register 0 */ +#define REG_PDCA_IMR0 REG_ACCESS(RoReg , 0x400A2028U) /**< \brief (PDCA) Interrupt Mask Register 0 */ +#define REG_PDCA_ISR0 REG_ACCESS(RoReg , 0x400A202CU) /**< \brief (PDCA) Interrupt Status Register 0 */ +#define REG_PDCA_MAR1 REG_ACCESS(RwReg , 0x400A2040U) /**< \brief (PDCA) Memory Address Register 1 */ +#define REG_PDCA_PSR1 REG_ACCESS(RwReg , 0x400A2044U) /**< \brief (PDCA) Peripheral Select Register 1 */ +#define REG_PDCA_TCR1 REG_ACCESS(RwReg , 0x400A2048U) /**< \brief (PDCA) Transfer Counter Register 1 */ +#define REG_PDCA_MARR1 REG_ACCESS(RwReg , 0x400A204CU) /**< \brief (PDCA) Memory Address Reload Register 1 */ +#define REG_PDCA_TCRR1 REG_ACCESS(RwReg , 0x400A2050U) /**< \brief (PDCA) Transfer Counter Reload Register 1 */ +#define REG_PDCA_CR1 REG_ACCESS(WoReg , 0x400A2054U) /**< \brief (PDCA) Control Register 1 */ +#define REG_PDCA_MR1 REG_ACCESS(RwReg , 0x400A2058U) /**< \brief (PDCA) Mode Register 1 */ +#define REG_PDCA_SR1 REG_ACCESS(RoReg , 0x400A205CU) /**< \brief (PDCA) Status Register 1 */ +#define REG_PDCA_IER1 REG_ACCESS(WoReg , 0x400A2060U) /**< \brief (PDCA) Interrupt Enable Register 1 */ +#define REG_PDCA_IDR1 REG_ACCESS(WoReg , 0x400A2064U) /**< \brief (PDCA) Interrupt Disable Register 1 */ +#define REG_PDCA_IMR1 REG_ACCESS(RoReg , 0x400A2068U) /**< \brief (PDCA) Interrupt Mask Register 1 */ +#define REG_PDCA_ISR1 REG_ACCESS(RoReg , 0x400A206CU) /**< \brief (PDCA) Interrupt Status Register 1 */ +#define REG_PDCA_MAR2 REG_ACCESS(RwReg , 0x400A2080U) /**< \brief (PDCA) Memory Address Register 2 */ +#define REG_PDCA_PSR2 REG_ACCESS(RwReg , 0x400A2084U) /**< \brief (PDCA) Peripheral Select Register 2 */ +#define REG_PDCA_TCR2 REG_ACCESS(RwReg , 0x400A2088U) /**< \brief (PDCA) Transfer Counter Register 2 */ +#define REG_PDCA_MARR2 REG_ACCESS(RwReg , 0x400A208CU) /**< \brief (PDCA) Memory Address Reload Register 2 */ +#define REG_PDCA_TCRR2 REG_ACCESS(RwReg , 0x400A2090U) /**< \brief (PDCA) Transfer Counter Reload Register 2 */ +#define REG_PDCA_CR2 REG_ACCESS(WoReg , 0x400A2094U) /**< \brief (PDCA) Control Register 2 */ +#define REG_PDCA_MR2 REG_ACCESS(RwReg , 0x400A2098U) /**< \brief (PDCA) Mode Register 2 */ +#define REG_PDCA_SR2 REG_ACCESS(RoReg , 0x400A209CU) /**< \brief (PDCA) Status Register 2 */ +#define REG_PDCA_IER2 REG_ACCESS(WoReg , 0x400A20A0U) /**< \brief (PDCA) Interrupt Enable Register 2 */ +#define REG_PDCA_IDR2 REG_ACCESS(WoReg , 0x400A20A4U) /**< \brief (PDCA) Interrupt Disable Register 2 */ +#define REG_PDCA_IMR2 REG_ACCESS(RoReg , 0x400A20A8U) /**< \brief (PDCA) Interrupt Mask Register 2 */ +#define REG_PDCA_ISR2 REG_ACCESS(RoReg , 0x400A20ACU) /**< \brief (PDCA) Interrupt Status Register 2 */ +#define REG_PDCA_MAR3 REG_ACCESS(RwReg , 0x400A20C0U) /**< \brief (PDCA) Memory Address Register 3 */ +#define REG_PDCA_PSR3 REG_ACCESS(RwReg , 0x400A20C4U) /**< \brief (PDCA) Peripheral Select Register 3 */ +#define REG_PDCA_TCR3 REG_ACCESS(RwReg , 0x400A20C8U) /**< \brief (PDCA) Transfer Counter Register 3 */ +#define REG_PDCA_MARR3 REG_ACCESS(RwReg , 0x400A20CCU) /**< \brief (PDCA) Memory Address Reload Register 3 */ +#define REG_PDCA_TCRR3 REG_ACCESS(RwReg , 0x400A20D0U) /**< \brief (PDCA) Transfer Counter Reload Register 3 */ +#define REG_PDCA_CR3 REG_ACCESS(WoReg , 0x400A20D4U) /**< \brief (PDCA) Control Register 3 */ +#define REG_PDCA_MR3 REG_ACCESS(RwReg , 0x400A20D8U) /**< \brief (PDCA) Mode Register 3 */ +#define REG_PDCA_SR3 REG_ACCESS(RoReg , 0x400A20DCU) /**< \brief (PDCA) Status Register 3 */ +#define REG_PDCA_IER3 REG_ACCESS(WoReg , 0x400A20E0U) /**< \brief (PDCA) Interrupt Enable Register 3 */ +#define REG_PDCA_IDR3 REG_ACCESS(WoReg , 0x400A20E4U) /**< \brief (PDCA) Interrupt Disable Register 3 */ +#define REG_PDCA_IMR3 REG_ACCESS(RoReg , 0x400A20E8U) /**< \brief (PDCA) Interrupt Mask Register 3 */ +#define REG_PDCA_ISR3 REG_ACCESS(RoReg , 0x400A20ECU) /**< \brief (PDCA) Interrupt Status Register 3 */ +#define REG_PDCA_MAR4 REG_ACCESS(RwReg , 0x400A2100U) /**< \brief (PDCA) Memory Address Register 4 */ +#define REG_PDCA_PSR4 REG_ACCESS(RwReg , 0x400A2104U) /**< \brief (PDCA) Peripheral Select Register 4 */ +#define REG_PDCA_TCR4 REG_ACCESS(RwReg , 0x400A2108U) /**< \brief (PDCA) Transfer Counter Register 4 */ +#define REG_PDCA_MARR4 REG_ACCESS(RwReg , 0x400A210CU) /**< \brief (PDCA) Memory Address Reload Register 4 */ +#define REG_PDCA_TCRR4 REG_ACCESS(RwReg , 0x400A2110U) /**< \brief (PDCA) Transfer Counter Reload Register 4 */ +#define REG_PDCA_CR4 REG_ACCESS(WoReg , 0x400A2114U) /**< \brief (PDCA) Control Register 4 */ +#define REG_PDCA_MR4 REG_ACCESS(RwReg , 0x400A2118U) /**< \brief (PDCA) Mode Register 4 */ +#define REG_PDCA_SR4 REG_ACCESS(RoReg , 0x400A211CU) /**< \brief (PDCA) Status Register 4 */ +#define REG_PDCA_IER4 REG_ACCESS(WoReg , 0x400A2120U) /**< \brief (PDCA) Interrupt Enable Register 4 */ +#define REG_PDCA_IDR4 REG_ACCESS(WoReg , 0x400A2124U) /**< \brief (PDCA) Interrupt Disable Register 4 */ +#define REG_PDCA_IMR4 REG_ACCESS(RoReg , 0x400A2128U) /**< \brief (PDCA) Interrupt Mask Register 4 */ +#define REG_PDCA_ISR4 REG_ACCESS(RoReg , 0x400A212CU) /**< \brief (PDCA) Interrupt Status Register 4 */ +#define REG_PDCA_MAR5 REG_ACCESS(RwReg , 0x400A2140U) /**< \brief (PDCA) Memory Address Register 5 */ +#define REG_PDCA_PSR5 REG_ACCESS(RwReg , 0x400A2144U) /**< \brief (PDCA) Peripheral Select Register 5 */ +#define REG_PDCA_TCR5 REG_ACCESS(RwReg , 0x400A2148U) /**< \brief (PDCA) Transfer Counter Register 5 */ +#define REG_PDCA_MARR5 REG_ACCESS(RwReg , 0x400A214CU) /**< \brief (PDCA) Memory Address Reload Register 5 */ +#define REG_PDCA_TCRR5 REG_ACCESS(RwReg , 0x400A2150U) /**< \brief (PDCA) Transfer Counter Reload Register 5 */ +#define REG_PDCA_CR5 REG_ACCESS(WoReg , 0x400A2154U) /**< \brief (PDCA) Control Register 5 */ +#define REG_PDCA_MR5 REG_ACCESS(RwReg , 0x400A2158U) /**< \brief (PDCA) Mode Register 5 */ +#define REG_PDCA_SR5 REG_ACCESS(RoReg , 0x400A215CU) /**< \brief (PDCA) Status Register 5 */ +#define REG_PDCA_IER5 REG_ACCESS(WoReg , 0x400A2160U) /**< \brief (PDCA) Interrupt Enable Register 5 */ +#define REG_PDCA_IDR5 REG_ACCESS(WoReg , 0x400A2164U) /**< \brief (PDCA) Interrupt Disable Register 5 */ +#define REG_PDCA_IMR5 REG_ACCESS(RoReg , 0x400A2168U) /**< \brief (PDCA) Interrupt Mask Register 5 */ +#define REG_PDCA_ISR5 REG_ACCESS(RoReg , 0x400A216CU) /**< \brief (PDCA) Interrupt Status Register 5 */ +#define REG_PDCA_MAR6 REG_ACCESS(RwReg , 0x400A2180U) /**< \brief (PDCA) Memory Address Register 6 */ +#define REG_PDCA_PSR6 REG_ACCESS(RwReg , 0x400A2184U) /**< \brief (PDCA) Peripheral Select Register 6 */ +#define REG_PDCA_TCR6 REG_ACCESS(RwReg , 0x400A2188U) /**< \brief (PDCA) Transfer Counter Register 6 */ +#define REG_PDCA_MARR6 REG_ACCESS(RwReg , 0x400A218CU) /**< \brief (PDCA) Memory Address Reload Register 6 */ +#define REG_PDCA_TCRR6 REG_ACCESS(RwReg , 0x400A2190U) /**< \brief (PDCA) Transfer Counter Reload Register 6 */ +#define REG_PDCA_CR6 REG_ACCESS(WoReg , 0x400A2194U) /**< \brief (PDCA) Control Register 6 */ +#define REG_PDCA_MR6 REG_ACCESS(RwReg , 0x400A2198U) /**< \brief (PDCA) Mode Register 6 */ +#define REG_PDCA_SR6 REG_ACCESS(RoReg , 0x400A219CU) /**< \brief (PDCA) Status Register 6 */ +#define REG_PDCA_IER6 REG_ACCESS(WoReg , 0x400A21A0U) /**< \brief (PDCA) Interrupt Enable Register 6 */ +#define REG_PDCA_IDR6 REG_ACCESS(WoReg , 0x400A21A4U) /**< \brief (PDCA) Interrupt Disable Register 6 */ +#define REG_PDCA_IMR6 REG_ACCESS(RoReg , 0x400A21A8U) /**< \brief (PDCA) Interrupt Mask Register 6 */ +#define REG_PDCA_ISR6 REG_ACCESS(RoReg , 0x400A21ACU) /**< \brief (PDCA) Interrupt Status Register 6 */ +#define REG_PDCA_MAR7 REG_ACCESS(RwReg , 0x400A21C0U) /**< \brief (PDCA) Memory Address Register 7 */ +#define REG_PDCA_PSR7 REG_ACCESS(RwReg , 0x400A21C4U) /**< \brief (PDCA) Peripheral Select Register 7 */ +#define REG_PDCA_TCR7 REG_ACCESS(RwReg , 0x400A21C8U) /**< \brief (PDCA) Transfer Counter Register 7 */ +#define REG_PDCA_MARR7 REG_ACCESS(RwReg , 0x400A21CCU) /**< \brief (PDCA) Memory Address Reload Register 7 */ +#define REG_PDCA_TCRR7 REG_ACCESS(RwReg , 0x400A21D0U) /**< \brief (PDCA) Transfer Counter Reload Register 7 */ +#define REG_PDCA_CR7 REG_ACCESS(WoReg , 0x400A21D4U) /**< \brief (PDCA) Control Register 7 */ +#define REG_PDCA_MR7 REG_ACCESS(RwReg , 0x400A21D8U) /**< \brief (PDCA) Mode Register 7 */ +#define REG_PDCA_SR7 REG_ACCESS(RoReg , 0x400A21DCU) /**< \brief (PDCA) Status Register 7 */ +#define REG_PDCA_IER7 REG_ACCESS(WoReg , 0x400A21E0U) /**< \brief (PDCA) Interrupt Enable Register 7 */ +#define REG_PDCA_IDR7 REG_ACCESS(WoReg , 0x400A21E4U) /**< \brief (PDCA) Interrupt Disable Register 7 */ +#define REG_PDCA_IMR7 REG_ACCESS(RoReg , 0x400A21E8U) /**< \brief (PDCA) Interrupt Mask Register 7 */ +#define REG_PDCA_ISR7 REG_ACCESS(RoReg , 0x400A21ECU) /**< \brief (PDCA) Interrupt Status Register 7 */ +#define REG_PDCA_MAR8 REG_ACCESS(RwReg , 0x400A2200U) /**< \brief (PDCA) Memory Address Register 8 */ +#define REG_PDCA_PSR8 REG_ACCESS(RwReg , 0x400A2204U) /**< \brief (PDCA) Peripheral Select Register 8 */ +#define REG_PDCA_TCR8 REG_ACCESS(RwReg , 0x400A2208U) /**< \brief (PDCA) Transfer Counter Register 8 */ +#define REG_PDCA_MARR8 REG_ACCESS(RwReg , 0x400A220CU) /**< \brief (PDCA) Memory Address Reload Register 8 */ +#define REG_PDCA_TCRR8 REG_ACCESS(RwReg , 0x400A2210U) /**< \brief (PDCA) Transfer Counter Reload Register 8 */ +#define REG_PDCA_CR8 REG_ACCESS(WoReg , 0x400A2214U) /**< \brief (PDCA) Control Register 8 */ +#define REG_PDCA_MR8 REG_ACCESS(RwReg , 0x400A2218U) /**< \brief (PDCA) Mode Register 8 */ +#define REG_PDCA_SR8 REG_ACCESS(RoReg , 0x400A221CU) /**< \brief (PDCA) Status Register 8 */ +#define REG_PDCA_IER8 REG_ACCESS(WoReg , 0x400A2220U) /**< \brief (PDCA) Interrupt Enable Register 8 */ +#define REG_PDCA_IDR8 REG_ACCESS(WoReg , 0x400A2224U) /**< \brief (PDCA) Interrupt Disable Register 8 */ +#define REG_PDCA_IMR8 REG_ACCESS(RoReg , 0x400A2228U) /**< \brief (PDCA) Interrupt Mask Register 8 */ +#define REG_PDCA_ISR8 REG_ACCESS(RoReg , 0x400A222CU) /**< \brief (PDCA) Interrupt Status Register 8 */ +#define REG_PDCA_MAR9 REG_ACCESS(RwReg , 0x400A2240U) /**< \brief (PDCA) Memory Address Register 9 */ +#define REG_PDCA_PSR9 REG_ACCESS(RwReg , 0x400A2244U) /**< \brief (PDCA) Peripheral Select Register 9 */ +#define REG_PDCA_TCR9 REG_ACCESS(RwReg , 0x400A2248U) /**< \brief (PDCA) Transfer Counter Register 9 */ +#define REG_PDCA_MARR9 REG_ACCESS(RwReg , 0x400A224CU) /**< \brief (PDCA) Memory Address Reload Register 9 */ +#define REG_PDCA_TCRR9 REG_ACCESS(RwReg , 0x400A2250U) /**< \brief (PDCA) Transfer Counter Reload Register 9 */ +#define REG_PDCA_CR9 REG_ACCESS(WoReg , 0x400A2254U) /**< \brief (PDCA) Control Register 9 */ +#define REG_PDCA_MR9 REG_ACCESS(RwReg , 0x400A2258U) /**< \brief (PDCA) Mode Register 9 */ +#define REG_PDCA_SR9 REG_ACCESS(RoReg , 0x400A225CU) /**< \brief (PDCA) Status Register 9 */ +#define REG_PDCA_IER9 REG_ACCESS(WoReg , 0x400A2260U) /**< \brief (PDCA) Interrupt Enable Register 9 */ +#define REG_PDCA_IDR9 REG_ACCESS(WoReg , 0x400A2264U) /**< \brief (PDCA) Interrupt Disable Register 9 */ +#define REG_PDCA_IMR9 REG_ACCESS(RoReg , 0x400A2268U) /**< \brief (PDCA) Interrupt Mask Register 9 */ +#define REG_PDCA_ISR9 REG_ACCESS(RoReg , 0x400A226CU) /**< \brief (PDCA) Interrupt Status Register 9 */ +#define REG_PDCA_MAR10 REG_ACCESS(RwReg , 0x400A2280U) /**< \brief (PDCA) Memory Address Register 10 */ +#define REG_PDCA_PSR10 REG_ACCESS(RwReg , 0x400A2284U) /**< \brief (PDCA) Peripheral Select Register 10 */ +#define REG_PDCA_TCR10 REG_ACCESS(RwReg , 0x400A2288U) /**< \brief (PDCA) Transfer Counter Register 10 */ +#define REG_PDCA_MARR10 REG_ACCESS(RwReg , 0x400A228CU) /**< \brief (PDCA) Memory Address Reload Register 10 */ +#define REG_PDCA_TCRR10 REG_ACCESS(RwReg , 0x400A2290U) /**< \brief (PDCA) Transfer Counter Reload Register 10 */ +#define REG_PDCA_CR10 REG_ACCESS(WoReg , 0x400A2294U) /**< \brief (PDCA) Control Register 10 */ +#define REG_PDCA_MR10 REG_ACCESS(RwReg , 0x400A2298U) /**< \brief (PDCA) Mode Register 10 */ +#define REG_PDCA_SR10 REG_ACCESS(RoReg , 0x400A229CU) /**< \brief (PDCA) Status Register 10 */ +#define REG_PDCA_IER10 REG_ACCESS(WoReg , 0x400A22A0U) /**< \brief (PDCA) Interrupt Enable Register 10 */ +#define REG_PDCA_IDR10 REG_ACCESS(WoReg , 0x400A22A4U) /**< \brief (PDCA) Interrupt Disable Register 10 */ +#define REG_PDCA_IMR10 REG_ACCESS(RoReg , 0x400A22A8U) /**< \brief (PDCA) Interrupt Mask Register 10 */ +#define REG_PDCA_ISR10 REG_ACCESS(RoReg , 0x400A22ACU) /**< \brief (PDCA) Interrupt Status Register 10 */ +#define REG_PDCA_MAR11 REG_ACCESS(RwReg , 0x400A22C0U) /**< \brief (PDCA) Memory Address Register 11 */ +#define REG_PDCA_PSR11 REG_ACCESS(RwReg , 0x400A22C4U) /**< \brief (PDCA) Peripheral Select Register 11 */ +#define REG_PDCA_TCR11 REG_ACCESS(RwReg , 0x400A22C8U) /**< \brief (PDCA) Transfer Counter Register 11 */ +#define REG_PDCA_MARR11 REG_ACCESS(RwReg , 0x400A22CCU) /**< \brief (PDCA) Memory Address Reload Register 11 */ +#define REG_PDCA_TCRR11 REG_ACCESS(RwReg , 0x400A22D0U) /**< \brief (PDCA) Transfer Counter Reload Register 11 */ +#define REG_PDCA_CR11 REG_ACCESS(WoReg , 0x400A22D4U) /**< \brief (PDCA) Control Register 11 */ +#define REG_PDCA_MR11 REG_ACCESS(RwReg , 0x400A22D8U) /**< \brief (PDCA) Mode Register 11 */ +#define REG_PDCA_SR11 REG_ACCESS(RoReg , 0x400A22DCU) /**< \brief (PDCA) Status Register 11 */ +#define REG_PDCA_IER11 REG_ACCESS(WoReg , 0x400A22E0U) /**< \brief (PDCA) Interrupt Enable Register 11 */ +#define REG_PDCA_IDR11 REG_ACCESS(WoReg , 0x400A22E4U) /**< \brief (PDCA) Interrupt Disable Register 11 */ +#define REG_PDCA_IMR11 REG_ACCESS(RoReg , 0x400A22E8U) /**< \brief (PDCA) Interrupt Mask Register 11 */ +#define REG_PDCA_ISR11 REG_ACCESS(RoReg , 0x400A22ECU) /**< \brief (PDCA) Interrupt Status Register 11 */ +#define REG_PDCA_MAR12 REG_ACCESS(RwReg , 0x400A2300U) /**< \brief (PDCA) Memory Address Register 12 */ +#define REG_PDCA_PSR12 REG_ACCESS(RwReg , 0x400A2304U) /**< \brief (PDCA) Peripheral Select Register 12 */ +#define REG_PDCA_TCR12 REG_ACCESS(RwReg , 0x400A2308U) /**< \brief (PDCA) Transfer Counter Register 12 */ +#define REG_PDCA_MARR12 REG_ACCESS(RwReg , 0x400A230CU) /**< \brief (PDCA) Memory Address Reload Register 12 */ +#define REG_PDCA_TCRR12 REG_ACCESS(RwReg , 0x400A2310U) /**< \brief (PDCA) Transfer Counter Reload Register 12 */ +#define REG_PDCA_CR12 REG_ACCESS(WoReg , 0x400A2314U) /**< \brief (PDCA) Control Register 12 */ +#define REG_PDCA_MR12 REG_ACCESS(RwReg , 0x400A2318U) /**< \brief (PDCA) Mode Register 12 */ +#define REG_PDCA_SR12 REG_ACCESS(RoReg , 0x400A231CU) /**< \brief (PDCA) Status Register 12 */ +#define REG_PDCA_IER12 REG_ACCESS(WoReg , 0x400A2320U) /**< \brief (PDCA) Interrupt Enable Register 12 */ +#define REG_PDCA_IDR12 REG_ACCESS(WoReg , 0x400A2324U) /**< \brief (PDCA) Interrupt Disable Register 12 */ +#define REG_PDCA_IMR12 REG_ACCESS(RoReg , 0x400A2328U) /**< \brief (PDCA) Interrupt Mask Register 12 */ +#define REG_PDCA_ISR12 REG_ACCESS(RoReg , 0x400A232CU) /**< \brief (PDCA) Interrupt Status Register 12 */ +#define REG_PDCA_MAR13 REG_ACCESS(RwReg , 0x400A2340U) /**< \brief (PDCA) Memory Address Register 13 */ +#define REG_PDCA_PSR13 REG_ACCESS(RwReg , 0x400A2344U) /**< \brief (PDCA) Peripheral Select Register 13 */ +#define REG_PDCA_TCR13 REG_ACCESS(RwReg , 0x400A2348U) /**< \brief (PDCA) Transfer Counter Register 13 */ +#define REG_PDCA_MARR13 REG_ACCESS(RwReg , 0x400A234CU) /**< \brief (PDCA) Memory Address Reload Register 13 */ +#define REG_PDCA_TCRR13 REG_ACCESS(RwReg , 0x400A2350U) /**< \brief (PDCA) Transfer Counter Reload Register 13 */ +#define REG_PDCA_CR13 REG_ACCESS(WoReg , 0x400A2354U) /**< \brief (PDCA) Control Register 13 */ +#define REG_PDCA_MR13 REG_ACCESS(RwReg , 0x400A2358U) /**< \brief (PDCA) Mode Register 13 */ +#define REG_PDCA_SR13 REG_ACCESS(RoReg , 0x400A235CU) /**< \brief (PDCA) Status Register 13 */ +#define REG_PDCA_IER13 REG_ACCESS(WoReg , 0x400A2360U) /**< \brief (PDCA) Interrupt Enable Register 13 */ +#define REG_PDCA_IDR13 REG_ACCESS(WoReg , 0x400A2364U) /**< \brief (PDCA) Interrupt Disable Register 13 */ +#define REG_PDCA_IMR13 REG_ACCESS(RoReg , 0x400A2368U) /**< \brief (PDCA) Interrupt Mask Register 13 */ +#define REG_PDCA_ISR13 REG_ACCESS(RoReg , 0x400A236CU) /**< \brief (PDCA) Interrupt Status Register 13 */ +#define REG_PDCA_MAR14 REG_ACCESS(RwReg , 0x400A2380U) /**< \brief (PDCA) Memory Address Register 14 */ +#define REG_PDCA_PSR14 REG_ACCESS(RwReg , 0x400A2384U) /**< \brief (PDCA) Peripheral Select Register 14 */ +#define REG_PDCA_TCR14 REG_ACCESS(RwReg , 0x400A2388U) /**< \brief (PDCA) Transfer Counter Register 14 */ +#define REG_PDCA_MARR14 REG_ACCESS(RwReg , 0x400A238CU) /**< \brief (PDCA) Memory Address Reload Register 14 */ +#define REG_PDCA_TCRR14 REG_ACCESS(RwReg , 0x400A2390U) /**< \brief (PDCA) Transfer Counter Reload Register 14 */ +#define REG_PDCA_CR14 REG_ACCESS(WoReg , 0x400A2394U) /**< \brief (PDCA) Control Register 14 */ +#define REG_PDCA_MR14 REG_ACCESS(RwReg , 0x400A2398U) /**< \brief (PDCA) Mode Register 14 */ +#define REG_PDCA_SR14 REG_ACCESS(RoReg , 0x400A239CU) /**< \brief (PDCA) Status Register 14 */ +#define REG_PDCA_IER14 REG_ACCESS(WoReg , 0x400A23A0U) /**< \brief (PDCA) Interrupt Enable Register 14 */ +#define REG_PDCA_IDR14 REG_ACCESS(WoReg , 0x400A23A4U) /**< \brief (PDCA) Interrupt Disable Register 14 */ +#define REG_PDCA_IMR14 REG_ACCESS(RoReg , 0x400A23A8U) /**< \brief (PDCA) Interrupt Mask Register 14 */ +#define REG_PDCA_ISR14 REG_ACCESS(RoReg , 0x400A23ACU) /**< \brief (PDCA) Interrupt Status Register 14 */ +#define REG_PDCA_MAR15 REG_ACCESS(RwReg , 0x400A23C0U) /**< \brief (PDCA) Memory Address Register 15 */ +#define REG_PDCA_PSR15 REG_ACCESS(RwReg , 0x400A23C4U) /**< \brief (PDCA) Peripheral Select Register 15 */ +#define REG_PDCA_TCR15 REG_ACCESS(RwReg , 0x400A23C8U) /**< \brief (PDCA) Transfer Counter Register 15 */ +#define REG_PDCA_MARR15 REG_ACCESS(RwReg , 0x400A23CCU) /**< \brief (PDCA) Memory Address Reload Register 15 */ +#define REG_PDCA_TCRR15 REG_ACCESS(RwReg , 0x400A23D0U) /**< \brief (PDCA) Transfer Counter Reload Register 15 */ +#define REG_PDCA_CR15 REG_ACCESS(WoReg , 0x400A23D4U) /**< \brief (PDCA) Control Register 15 */ +#define REG_PDCA_MR15 REG_ACCESS(RwReg , 0x400A23D8U) /**< \brief (PDCA) Mode Register 15 */ +#define REG_PDCA_SR15 REG_ACCESS(RoReg , 0x400A23DCU) /**< \brief (PDCA) Status Register 15 */ +#define REG_PDCA_IER15 REG_ACCESS(WoReg , 0x400A23E0U) /**< \brief (PDCA) Interrupt Enable Register 15 */ +#define REG_PDCA_IDR15 REG_ACCESS(WoReg , 0x400A23E4U) /**< \brief (PDCA) Interrupt Disable Register 15 */ +#define REG_PDCA_IMR15 REG_ACCESS(RoReg , 0x400A23E8U) /**< \brief (PDCA) Interrupt Mask Register 15 */ +#define REG_PDCA_ISR15 REG_ACCESS(RoReg , 0x400A23ECU) /**< \brief (PDCA) Interrupt Status Register 15 */ +#define REG_PDCA_PCONTROL REG_ACCESS(RwReg , 0x400A2800U) /**< \brief (PDCA) Performance Control Register */ +#define REG_PDCA_PRDATA0 REG_ACCESS(RoReg , 0x400A2804U) /**< \brief (PDCA) Channel 0 Read Data Cycles */ +#define REG_PDCA_PRSTALL0 REG_ACCESS(RoReg , 0x400A2808U) /**< \brief (PDCA) Channel 0 Read Stall Cycles */ +#define REG_PDCA_PRLAT0 REG_ACCESS(RoReg , 0x400A280CU) /**< \brief (PDCA) Channel 0 Read Max Latency */ +#define REG_PDCA_PWDATA0 REG_ACCESS(RoReg , 0x400A2810U) /**< \brief (PDCA) Channel 0 Write Data Cycles */ +#define REG_PDCA_PWSTALL0 REG_ACCESS(RoReg , 0x400A2814U) /**< \brief (PDCA) Channel 0 Write Stall Cycles */ +#define REG_PDCA_PWLAT0 REG_ACCESS(RoReg , 0x400A2818U) /**< \brief (PDCA) Channel0 Write Max Latency */ +#define REG_PDCA_PRDATA1 REG_ACCESS(RoReg , 0x400A281CU) /**< \brief (PDCA) Channel 1 Read Data Cycles */ +#define REG_PDCA_PRSTALL1 REG_ACCESS(RoReg , 0x400A2820U) /**< \brief (PDCA) Channel Read Stall Cycles */ +#define REG_PDCA_PRLAT1 REG_ACCESS(RoReg , 0x400A2824U) /**< \brief (PDCA) Channel 1 Read Max Latency */ +#define REG_PDCA_PWDATA1 REG_ACCESS(RoReg , 0x400A2828U) /**< \brief (PDCA) Channel 1 Write Data Cycles */ +#define REG_PDCA_PWSTALL1 REG_ACCESS(RoReg , 0x400A282CU) /**< \brief (PDCA) Channel 1 Write stall Cycles */ +#define REG_PDCA_PWLAT1 REG_ACCESS(RoReg , 0x400A2830U) /**< \brief (PDCA) Channel 1 Read Max Latency */ +#define REG_PDCA_VERSION REG_ACCESS(RoReg , 0x400A2834U) /**< \brief (PDCA) Version Register */ +/* ========== Register definition for SMAP peripheral ========== */ +#define REG_SMAP_CR REG_ACCESS(WoReg , 0x400A3000U) /**< \brief (SMAP) Control Register */ +#define REG_SMAP_SR REG_ACCESS(RoReg , 0x400A3004U) /**< \brief (SMAP) Status Register */ +#define REG_SMAP_SCR REG_ACCESS(WoReg , 0x400A3008U) /**< \brief (SMAP) Status Clear Register */ +#define REG_SMAP_ADDR REG_ACCESS(RwReg , 0x400A300CU) /**< \brief (SMAP) Address Register */ +#define REG_SMAP_LENGTH REG_ACCESS(RwReg , 0x400A3010U) /**< \brief (SMAP) Length Register */ +#define REG_SMAP_DATA REG_ACCESS(RwReg , 0x400A3014U) /**< \brief (SMAP) Data Register */ +#define REG_SMAP_VERSION REG_ACCESS(RoReg , 0x400A3028U) /**< \brief (SMAP) VERSION register */ +#define REG_SMAP_CIDR REG_ACCESS(RoReg , 0x400A30F0U) /**< \brief (SMAP) Chip ID Register */ +#define REG_SMAP_EXID REG_ACCESS(RoReg , 0x400A30F4U) /**< \brief (SMAP) Chip ID Extension Register */ +#define REG_SMAP_IDR REG_ACCESS(RoReg , 0x400A30FCU) /**< \brief (SMAP) AP Identification register */ +/* ========== Register definition for CRCCU peripheral ========== */ +#define REG_CRCCU_DSCR REG_ACCESS(RwReg , 0x400A4000U) /**< \brief (CRCCU) Descriptor Base Register */ +#define REG_CRCCU_DMAEN REG_ACCESS(WoReg , 0x400A4008U) /**< \brief (CRCCU) DMA Enable Register */ +#define REG_CRCCU_DMADIS REG_ACCESS(WoReg , 0x400A400CU) /**< \brief (CRCCU) DMA Disable Register */ +#define REG_CRCCU_DMASR REG_ACCESS(RoReg , 0x400A4010U) /**< \brief (CRCCU) DMA Status Register */ +#define REG_CRCCU_DMAIER REG_ACCESS(WoReg , 0x400A4014U) /**< \brief (CRCCU) DMA Interrupt Enable Register */ +#define REG_CRCCU_DMAIDR REG_ACCESS(WoReg , 0x400A4018U) /**< \brief (CRCCU) DMA Interrupt Disable Register */ +#define REG_CRCCU_DMAIMR REG_ACCESS(RoReg , 0x400A401CU) /**< \brief (CRCCU) DMA Interrupt Mask Register */ +#define REG_CRCCU_DMAISR REG_ACCESS(RoReg , 0x400A4020U) /**< \brief (CRCCU) DMA Interrupt Status Register */ +#define REG_CRCCU_CR REG_ACCESS(WoReg , 0x400A4034U) /**< \brief (CRCCU) Control Register */ +#define REG_CRCCU_MR REG_ACCESS(RwReg , 0x400A4038U) /**< \brief (CRCCU) Mode Register */ +#define REG_CRCCU_SR REG_ACCESS(RoReg , 0x400A403CU) /**< \brief (CRCCU) Status Register */ +#define REG_CRCCU_IER REG_ACCESS(WoReg , 0x400A4040U) /**< \brief (CRCCU) Interrupt Enable Register */ +#define REG_CRCCU_IDR REG_ACCESS(WoReg , 0x400A4044U) /**< \brief (CRCCU) Interrupt Disable Register */ +#define REG_CRCCU_IMR REG_ACCESS(RoReg , 0x400A4048U) /**< \brief (CRCCU) Interrupt Mask Register */ +#define REG_CRCCU_ISR REG_ACCESS(RoReg , 0x400A404CU) /**< \brief (CRCCU) Interrupt Status Register */ +#define REG_CRCCU_VERSION REG_ACCESS(RoReg , 0x400A40FCU) /**< \brief (CRCCU) Version Register */ +/* ========== Register definition for USBC peripheral ========== */ +#define REG_USBC_UDCON REG_ACCESS(RwReg , 0x400A5000U) /**< \brief (USBC) Device General Control Register */ +#define REG_USBC_UDINT REG_ACCESS(RoReg , 0x400A5004U) /**< \brief (USBC) Device Global Interupt Register */ +#define REG_USBC_UDINTCLR REG_ACCESS(WoReg , 0x400A5008U) /**< \brief (USBC) Device Global Interrupt Clear Register */ +#define REG_USBC_UDINTSET REG_ACCESS(WoReg , 0x400A500CU) /**< \brief (USBC) Device Global Interrupt Set Regsiter */ +#define REG_USBC_UDINTE REG_ACCESS(RoReg , 0x400A5010U) /**< \brief (USBC) Device Global Interrupt Enable Register */ +#define REG_USBC_UDINTECLR REG_ACCESS(WoReg , 0x400A5014U) /**< \brief (USBC) Device Global Interrupt Enable Clear Register */ +#define REG_USBC_UDINTESET REG_ACCESS(WoReg , 0x400A5018U) /**< \brief (USBC) Device Global Interrupt Enable Set Register */ +#define REG_USBC_UERST REG_ACCESS(RwReg , 0x400A501CU) /**< \brief (USBC) Endpoint Enable/Reset Register */ +#define REG_USBC_UDFNUM REG_ACCESS(RoReg , 0x400A5020U) /**< \brief (USBC) Device Frame Number Register */ +#define REG_USBC_UECFG0 REG_ACCESS(RwReg , 0x400A5100U) /**< \brief (USBC) Endpoint Configuration Register */ +#define REG_USBC_UECFG1 REG_ACCESS(RwReg , 0x400A5104U) /**< \brief (USBC) Endpoint Configuration Register */ +#define REG_USBC_UECFG2 REG_ACCESS(RwReg , 0x400A5108U) /**< \brief (USBC) Endpoint Configuration Register */ +#define REG_USBC_UECFG3 REG_ACCESS(RwReg , 0x400A510CU) /**< \brief (USBC) Endpoint Configuration Register */ +#define REG_USBC_UECFG4 REG_ACCESS(RwReg , 0x400A5110U) /**< \brief (USBC) Endpoint Configuration Register */ +#define REG_USBC_UECFG5 REG_ACCESS(RwReg , 0x400A5114U) /**< \brief (USBC) Endpoint Configuration Register */ +#define REG_USBC_UECFG6 REG_ACCESS(RwReg , 0x400A5118U) /**< \brief (USBC) Endpoint Configuration Register */ +#define REG_USBC_UECFG7 REG_ACCESS(RwReg , 0x400A511CU) /**< \brief (USBC) Endpoint Configuration Register */ +#define REG_USBC_UESTA0 REG_ACCESS(RoReg , 0x400A5130U) /**< \brief (USBC) Endpoint Status Register */ +#define REG_USBC_UESTA1 REG_ACCESS(RoReg , 0x400A5134U) /**< \brief (USBC) Endpoint Status Register */ +#define REG_USBC_UESTA2 REG_ACCESS(RoReg , 0x400A5138U) /**< \brief (USBC) Endpoint Status Register */ +#define REG_USBC_UESTA3 REG_ACCESS(RoReg , 0x400A513CU) /**< \brief (USBC) Endpoint Status Register */ +#define REG_USBC_UESTA4 REG_ACCESS(RoReg , 0x400A5140U) /**< \brief (USBC) Endpoint Status Register */ +#define REG_USBC_UESTA5 REG_ACCESS(RoReg , 0x400A5144U) /**< \brief (USBC) Endpoint Status Register */ +#define REG_USBC_UESTA6 REG_ACCESS(RoReg , 0x400A5148U) /**< \brief (USBC) Endpoint Status Register */ +#define REG_USBC_UESTA7 REG_ACCESS(RoReg , 0x400A514CU) /**< \brief (USBC) Endpoint Status Register */ +#define REG_USBC_UESTA0CLR REG_ACCESS(WoReg , 0x400A5160U) /**< \brief (USBC) Endpoint Status Clear Register */ +#define REG_USBC_UESTA1CLR REG_ACCESS(WoReg , 0x400A5164U) /**< \brief (USBC) Endpoint Status Clear Register */ +#define REG_USBC_UESTA2CLR REG_ACCESS(WoReg , 0x400A5168U) /**< \brief (USBC) Endpoint Status Clear Register */ +#define REG_USBC_UESTA3CLR REG_ACCESS(WoReg , 0x400A516CU) /**< \brief (USBC) Endpoint Status Clear Register */ +#define REG_USBC_UESTA4CLR REG_ACCESS(WoReg , 0x400A5170U) /**< \brief (USBC) Endpoint Status Clear Register */ +#define REG_USBC_UESTA5CLR REG_ACCESS(WoReg , 0x400A5174U) /**< \brief (USBC) Endpoint Status Clear Register */ +#define REG_USBC_UESTA6CLR REG_ACCESS(WoReg , 0x400A5178U) /**< \brief (USBC) Endpoint Status Clear Register */ +#define REG_USBC_UESTA7CLR REG_ACCESS(WoReg , 0x400A517CU) /**< \brief (USBC) Endpoint Status Clear Register */ +#define REG_USBC_UESTA0SET REG_ACCESS(WoReg , 0x400A5190U) /**< \brief (USBC) Endpoint Status Set Register */ +#define REG_USBC_UESTA1SET REG_ACCESS(WoReg , 0x400A5194U) /**< \brief (USBC) Endpoint Status Set Register */ +#define REG_USBC_UESTA2SET REG_ACCESS(WoReg , 0x400A5198U) /**< \brief (USBC) Endpoint Status Set Register */ +#define REG_USBC_UESTA3SET REG_ACCESS(WoReg , 0x400A519CU) /**< \brief (USBC) Endpoint Status Set Register */ +#define REG_USBC_UESTA4SET REG_ACCESS(WoReg , 0x400A51A0U) /**< \brief (USBC) Endpoint Status Set Register */ +#define REG_USBC_UESTA5SET REG_ACCESS(WoReg , 0x400A51A4U) /**< \brief (USBC) Endpoint Status Set Register */ +#define REG_USBC_UESTA6SET REG_ACCESS(WoReg , 0x400A51A8U) /**< \brief (USBC) Endpoint Status Set Register */ +#define REG_USBC_UESTA7SET REG_ACCESS(WoReg , 0x400A51ACU) /**< \brief (USBC) Endpoint Status Set Register */ +#define REG_USBC_UECON0 REG_ACCESS(RoReg , 0x400A51C0U) /**< \brief (USBC) Endpoint Control Register */ +#define REG_USBC_UECON1 REG_ACCESS(RoReg , 0x400A51C4U) /**< \brief (USBC) Endpoint Control Register */ +#define REG_USBC_UECON2 REG_ACCESS(RoReg , 0x400A51C8U) /**< \brief (USBC) Endpoint Control Register */ +#define REG_USBC_UECON3 REG_ACCESS(RoReg , 0x400A51CCU) /**< \brief (USBC) Endpoint Control Register */ +#define REG_USBC_UECON4 REG_ACCESS(RoReg , 0x400A51D0U) /**< \brief (USBC) Endpoint Control Register */ +#define REG_USBC_UECON5 REG_ACCESS(RoReg , 0x400A51D4U) /**< \brief (USBC) Endpoint Control Register */ +#define REG_USBC_UECON6 REG_ACCESS(RoReg , 0x400A51D8U) /**< \brief (USBC) Endpoint Control Register */ +#define REG_USBC_UECON7 REG_ACCESS(RoReg , 0x400A51DCU) /**< \brief (USBC) Endpoint Control Register */ +#define REG_USBC_UECON0SET REG_ACCESS(WoReg , 0x400A51F0U) /**< \brief (USBC) Endpoint Control Set Register */ +#define REG_USBC_UECON1SET REG_ACCESS(WoReg , 0x400A51F4U) /**< \brief (USBC) Endpoint Control Set Register */ +#define REG_USBC_UECON2SET REG_ACCESS(WoReg , 0x400A51F8U) /**< \brief (USBC) Endpoint Control Set Register */ +#define REG_USBC_UECON3SET REG_ACCESS(WoReg , 0x400A51FCU) /**< \brief (USBC) Endpoint Control Set Register */ +#define REG_USBC_UECON4SET REG_ACCESS(WoReg , 0x400A5200U) /**< \brief (USBC) Endpoint Control Set Register */ +#define REG_USBC_UECON5SET REG_ACCESS(WoReg , 0x400A5204U) /**< \brief (USBC) Endpoint Control Set Register */ +#define REG_USBC_UECON6SET REG_ACCESS(WoReg , 0x400A5208U) /**< \brief (USBC) Endpoint Control Set Register */ +#define REG_USBC_UECON7SET REG_ACCESS(WoReg , 0x400A520CU) /**< \brief (USBC) Endpoint Control Set Register */ +#define REG_USBC_UECON0CLR REG_ACCESS(WoReg , 0x400A5220U) /**< \brief (USBC) Endpoint Control Clear Register */ +#define REG_USBC_UECON1CLR REG_ACCESS(WoReg , 0x400A5224U) /**< \brief (USBC) TXINE Clear */ +#define REG_USBC_UECON2CLR REG_ACCESS(WoReg , 0x400A5228U) /**< \brief (USBC) TXINE Clear */ +#define REG_USBC_UECON3CLR REG_ACCESS(WoReg , 0x400A522CU) /**< \brief (USBC) TXINE Clear */ +#define REG_USBC_UECON4CLR REG_ACCESS(WoReg , 0x400A5230U) /**< \brief (USBC) TXINE Clear */ +#define REG_USBC_UECON5CLR REG_ACCESS(WoReg , 0x400A5234U) /**< \brief (USBC) TXINE Clear */ +#define REG_USBC_UECON6CLR REG_ACCESS(WoReg , 0x400A5238U) /**< \brief (USBC) TXINE Clear */ +#define REG_USBC_UECON7CLR REG_ACCESS(WoReg , 0x400A523CU) /**< \brief (USBC) TXINE Clear */ +#define REG_USBC_UHCON REG_ACCESS(RwReg , 0x400A5400U) /**< \brief (USBC) Host General Control Register */ +#define REG_USBC_UHINT REG_ACCESS(RoReg , 0x400A5404U) /**< \brief (USBC) Host Global Interrupt Register */ +#define REG_USBC_UHINTCLR REG_ACCESS(WoReg , 0x400A5408U) /**< \brief (USBC) Host Global Interrrupt Clear Register */ +#define REG_USBC_UHINTSET REG_ACCESS(WoReg , 0x400A540CU) /**< \brief (USBC) Host Global Interrupt Set Register */ +#define REG_USBC_UHINTE REG_ACCESS(RoReg , 0x400A5410U) /**< \brief (USBC) Host Global Interrupt Enable Register */ +#define REG_USBC_UHINTECLR REG_ACCESS(WoReg , 0x400A5414U) /**< \brief (USBC) Host Global Interrupt Enable Clear Register */ +#define REG_USBC_UHINTESET REG_ACCESS(WoReg , 0x400A5418U) /**< \brief (USBC) Host Global Interrupt Enable Set Register */ +#define REG_USBC_UPRST REG_ACCESS(RwReg , 0x400A541CU) /**< \brief (USBC) Pipe Reset Register */ +#define REG_USBC_UHFNUM REG_ACCESS(RwReg , 0x400A5420U) /**< \brief (USBC) Host Frame Number Register */ +#define REG_USBC_UHSOFC REG_ACCESS(RwReg , 0x400A5424U) /**< \brief (USBC) Host Start of Frame Control Register */ +#define REG_USBC_UPCFG0 REG_ACCESS(RwReg , 0x400A5500U) /**< \brief (USBC) Pipe Configuration Register */ +#define REG_USBC_UPCFG1 REG_ACCESS(RwReg , 0x400A5504U) /**< \brief (USBC) Pipe Configuration Register */ +#define REG_USBC_UPCFG2 REG_ACCESS(RwReg , 0x400A5508U) /**< \brief (USBC) Pipe Configuration Register */ +#define REG_USBC_UPCFG3 REG_ACCESS(RwReg , 0x400A550CU) /**< \brief (USBC) Pipe Configuration Register */ +#define REG_USBC_UPCFG4 REG_ACCESS(RwReg , 0x400A5510U) /**< \brief (USBC) Pipe Configuration Register */ +#define REG_USBC_UPCFG5 REG_ACCESS(RwReg , 0x400A5514U) /**< \brief (USBC) Pipe Configuration Register */ +#define REG_USBC_UPCFG6 REG_ACCESS(RwReg , 0x400A5518U) /**< \brief (USBC) Pipe Configuration Register */ +#define REG_USBC_UPCFG7 REG_ACCESS(RwReg , 0x400A551CU) /**< \brief (USBC) Pipe Configuration Register */ +#define REG_USBC_UPSTA0 REG_ACCESS(RoReg , 0x400A5530U) /**< \brief (USBC) Pipe Status Register */ +#define REG_USBC_UPSTA1 REG_ACCESS(RoReg , 0x400A5534U) /**< \brief (USBC) Pipe Status Register */ +#define REG_USBC_UPSTA2 REG_ACCESS(RoReg , 0x400A5538U) /**< \brief (USBC) Pipe Status Register */ +#define REG_USBC_UPSTA3 REG_ACCESS(RoReg , 0x400A553CU) /**< \brief (USBC) Pipe Status Register */ +#define REG_USBC_UPSTA4 REG_ACCESS(RoReg , 0x400A5540U) /**< \brief (USBC) Pipe Status Register */ +#define REG_USBC_UPSTA5 REG_ACCESS(RoReg , 0x400A5544U) /**< \brief (USBC) Pipe Status Register */ +#define REG_USBC_UPSTA6 REG_ACCESS(RoReg , 0x400A5548U) /**< \brief (USBC) Pipe Status Register */ +#define REG_USBC_UPSTA7 REG_ACCESS(RoReg , 0x400A554CU) /**< \brief (USBC) Pipe Status Register */ +#define REG_USBC_UPSTA0CLR REG_ACCESS(WoReg , 0x400A5560U) /**< \brief (USBC) Pipe Status Clear Register */ +#define REG_USBC_UPSTA1CLR REG_ACCESS(WoReg , 0x400A5564U) /**< \brief (USBC) Pipe Status Clear Register */ +#define REG_USBC_UPSTA2CLR REG_ACCESS(WoReg , 0x400A5568U) /**< \brief (USBC) Pipe Status Clear Register */ +#define REG_USBC_UPSTA3CLR REG_ACCESS(WoReg , 0x400A556CU) /**< \brief (USBC) Pipe Status Clear Register */ +#define REG_USBC_UPSTA4CLR REG_ACCESS(WoReg , 0x400A5570U) /**< \brief (USBC) Pipe Status Clear Register */ +#define REG_USBC_UPSTA5CLR REG_ACCESS(WoReg , 0x400A5574U) /**< \brief (USBC) Pipe Status Clear Register */ +#define REG_USBC_UPSTA6CLR REG_ACCESS(WoReg , 0x400A5578U) /**< \brief (USBC) Pipe Status Clear Register */ +#define REG_USBC_UPSTA7CLR REG_ACCESS(WoReg , 0x400A557CU) /**< \brief (USBC) Pipe Status Clear Register */ +#define REG_USBC_UPSTA0SET REG_ACCESS(WoReg , 0x400A5590U) /**< \brief (USBC) Pipe Status Set Register */ +#define REG_USBC_UPSTA1SET REG_ACCESS(WoReg , 0x400A5594U) /**< \brief (USBC) Pipe Status Set Register */ +#define REG_USBC_UPSTA2SET REG_ACCESS(WoReg , 0x400A5598U) /**< \brief (USBC) Pipe Status Set Register */ +#define REG_USBC_UPSTA3SET REG_ACCESS(WoReg , 0x400A559CU) /**< \brief (USBC) Pipe Status Set Register */ +#define REG_USBC_UPSTA4SET REG_ACCESS(WoReg , 0x400A55A0U) /**< \brief (USBC) Pipe Status Set Register */ +#define REG_USBC_UPSTA5SET REG_ACCESS(WoReg , 0x400A55A4U) /**< \brief (USBC) Pipe Status Set Register */ +#define REG_USBC_UPSTA6SET REG_ACCESS(WoReg , 0x400A55A8U) /**< \brief (USBC) Pipe Status Set Register */ +#define REG_USBC_UPSTA7SET REG_ACCESS(WoReg , 0x400A55ACU) /**< \brief (USBC) Pipe Status Set Register */ +#define REG_USBC_UPCON0 REG_ACCESS(RoReg , 0x400A55C0U) /**< \brief (USBC) Pipe Control Register */ +#define REG_USBC_UPCON1 REG_ACCESS(RoReg , 0x400A55C4U) /**< \brief (USBC) Pipe Control Register */ +#define REG_USBC_UPCON2 REG_ACCESS(RoReg , 0x400A55C8U) /**< \brief (USBC) Pipe Control Register */ +#define REG_USBC_UPCON3 REG_ACCESS(RoReg , 0x400A55CCU) /**< \brief (USBC) Pipe Control Register */ +#define REG_USBC_UPCON4 REG_ACCESS(RoReg , 0x400A55D0U) /**< \brief (USBC) Pipe Control Register */ +#define REG_USBC_UPCON5 REG_ACCESS(RoReg , 0x400A55D4U) /**< \brief (USBC) Pipe Control Register */ +#define REG_USBC_UPCON6 REG_ACCESS(RoReg , 0x400A55D8U) /**< \brief (USBC) Pipe Control Register */ +#define REG_USBC_UPCON7 REG_ACCESS(RoReg , 0x400A55DCU) /**< \brief (USBC) Pipe Control Register */ +#define REG_USBC_UPCON0SET REG_ACCESS(WoReg , 0x400A55F0U) /**< \brief (USBC) Pipe Control Set Register */ +#define REG_USBC_UPCON1SET REG_ACCESS(WoReg , 0x400A55F4U) /**< \brief (USBC) Pipe Control Set Register */ +#define REG_USBC_UPCON2SET REG_ACCESS(WoReg , 0x400A55F8U) /**< \brief (USBC) Pipe Control Set Register */ +#define REG_USBC_UPCON3SET REG_ACCESS(WoReg , 0x400A55FCU) /**< \brief (USBC) Pipe Control Set Register */ +#define REG_USBC_UPCON4SET REG_ACCESS(WoReg , 0x400A5600U) /**< \brief (USBC) Pipe Control Set Register */ +#define REG_USBC_UPCON5SET REG_ACCESS(WoReg , 0x400A5604U) /**< \brief (USBC) Pipe Control Set Register */ +#define REG_USBC_UPCON6SET REG_ACCESS(WoReg , 0x400A5608U) /**< \brief (USBC) Pipe Control Set Register */ +#define REG_USBC_UPCON7SET REG_ACCESS(WoReg , 0x400A560CU) /**< \brief (USBC) Pipe Control Set Register */ +#define REG_USBC_UPCON0CLR REG_ACCESS(WoReg , 0x400A5620U) /**< \brief (USBC) Pipe Control Clear Register */ +#define REG_USBC_UPCON1CLR REG_ACCESS(WoReg , 0x400A5624U) /**< \brief (USBC) Pipe Control Clear Register */ +#define REG_USBC_UPCON2CLR REG_ACCESS(WoReg , 0x400A5628U) /**< \brief (USBC) Pipe Control Clear Register */ +#define REG_USBC_UPCON3CLR REG_ACCESS(WoReg , 0x400A562CU) /**< \brief (USBC) Pipe Control Clear Register */ +#define REG_USBC_UPCON4CLR REG_ACCESS(WoReg , 0x400A5630U) /**< \brief (USBC) Pipe Control Clear Register */ +#define REG_USBC_UPCON5CLR REG_ACCESS(WoReg , 0x400A5634U) /**< \brief (USBC) Pipe Control Clear Register */ +#define REG_USBC_UPCON6CLR REG_ACCESS(WoReg , 0x400A5638U) /**< \brief (USBC) Pipe Control Clear Register */ +#define REG_USBC_UPCON7CLR REG_ACCESS(WoReg , 0x400A563CU) /**< \brief (USBC) Pipe Control Clear Register */ +#define REG_USBC_UPINRQ0 REG_ACCESS(RwReg , 0x400A5650U) /**< \brief (USBC) Pipe In Request */ +#define REG_USBC_UPINRQ1 REG_ACCESS(RwReg , 0x400A5654U) /**< \brief (USBC) Pipe In Request */ +#define REG_USBC_UPINRQ2 REG_ACCESS(RwReg , 0x400A5658U) /**< \brief (USBC) Pipe In Request */ +#define REG_USBC_UPINRQ3 REG_ACCESS(RwReg , 0x400A565CU) /**< \brief (USBC) Pipe In Request */ +#define REG_USBC_UPINRQ4 REG_ACCESS(RwReg , 0x400A5660U) /**< \brief (USBC) Pipe In Request */ +#define REG_USBC_UPINRQ5 REG_ACCESS(RwReg , 0x400A5664U) /**< \brief (USBC) Pipe In Request */ +#define REG_USBC_UPINRQ6 REG_ACCESS(RwReg , 0x400A5668U) /**< \brief (USBC) Pipe In Request */ +#define REG_USBC_UPINRQ7 REG_ACCESS(RwReg , 0x400A566CU) /**< \brief (USBC) Pipe In Request */ +#define REG_USBC_USBCON REG_ACCESS(RwReg , 0x400A5800U) /**< \brief (USBC) General Control Register */ +#define REG_USBC_USBSTA REG_ACCESS(RoReg , 0x400A5804U) /**< \brief (USBC) General Status Register */ +#define REG_USBC_USBSTACLR REG_ACCESS(WoReg , 0x400A5808U) /**< \brief (USBC) General Status Clear Register */ +#define REG_USBC_USBSTASET REG_ACCESS(WoReg , 0x400A580CU) /**< \brief (USBC) General Status Set Register */ +#define REG_USBC_UVERS REG_ACCESS(RoReg , 0x400A5818U) /**< \brief (USBC) IP Version Register */ +#define REG_USBC_UFEATURES REG_ACCESS(RoReg , 0x400A581CU) /**< \brief (USBC) IP Features Register */ +#define REG_USBC_UADDRSIZE REG_ACCESS(RoReg , 0x400A5820U) /**< \brief (USBC) IP PB address size Register */ +#define REG_USBC_UNAME1 REG_ACCESS(RoReg , 0x400A5824U) /**< \brief (USBC) IP Name Part One: HUSB */ +#define REG_USBC_UNAME2 REG_ACCESS(RoReg , 0x400A5828U) /**< \brief (USBC) IP Name Part Two: HOST */ +#define REG_USBC_USBFSM REG_ACCESS(RoReg , 0x400A582CU) /**< \brief (USBC) USB internal finite state machine */ +#define REG_USBC_UDESC REG_ACCESS(RwReg , 0x400A5830U) /**< \brief (USBC) Endpoint descriptor table */ +/* ========== Register definition for PEVC peripheral ========== */ +#define REG_PEVC_CHSR REG_ACCESS(RoReg , 0x400A6000U) /**< \brief (PEVC) Channel Status Register */ +#define REG_PEVC_CHER REG_ACCESS(WoReg , 0x400A6004U) /**< \brief (PEVC) Channel Enable Register */ +#define REG_PEVC_CHDR REG_ACCESS(WoReg , 0x400A6008U) /**< \brief (PEVC) Channel Disable Register */ +#define REG_PEVC_SEV REG_ACCESS(WoReg , 0x400A6010U) /**< \brief (PEVC) Software Event */ +#define REG_PEVC_BUSY REG_ACCESS(RoReg , 0x400A6014U) /**< \brief (PEVC) Channel / User Busy */ +#define REG_PEVC_TRIER REG_ACCESS(WoReg , 0x400A6020U) /**< \brief (PEVC) Trigger Interrupt Mask Enable Register */ +#define REG_PEVC_TRIDR REG_ACCESS(WoReg , 0x400A6024U) /**< \brief (PEVC) Trigger Interrupt Mask Disable Register */ +#define REG_PEVC_TRIMR REG_ACCESS(RoReg , 0x400A6028U) /**< \brief (PEVC) Trigger Interrupt Mask Register */ +#define REG_PEVC_TRSR REG_ACCESS(RoReg , 0x400A6030U) /**< \brief (PEVC) Trigger Status Register */ +#define REG_PEVC_TRSCR REG_ACCESS(WoReg , 0x400A6034U) /**< \brief (PEVC) Trigger Status Clear Register */ +#define REG_PEVC_OVIER REG_ACCESS(WoReg , 0x400A6040U) /**< \brief (PEVC) Overrun Interrupt Mask Enable Register */ +#define REG_PEVC_OVIDR REG_ACCESS(WoReg , 0x400A6044U) /**< \brief (PEVC) Overrun Interrupt Mask Disable Register */ +#define REG_PEVC_OVIMR REG_ACCESS(RoReg , 0x400A6048U) /**< \brief (PEVC) Overrun Interrupt Mask Register */ +#define REG_PEVC_OVSR REG_ACCESS(RoReg , 0x400A6050U) /**< \brief (PEVC) Overrun Status Register */ +#define REG_PEVC_OVSCR REG_ACCESS(WoReg , 0x400A6054U) /**< \brief (PEVC) Overrun Status Clear Register */ +#define REG_PEVC_CHMX0 REG_ACCESS(RwReg , 0x400A6100U) /**< \brief (PEVC) Channel Multiplexer 0 0 */ +#define REG_PEVC_CHMX1 REG_ACCESS(RwReg , 0x400A6104U) /**< \brief (PEVC) Channel Multiplexer 0 1 */ +#define REG_PEVC_CHMX2 REG_ACCESS(RwReg , 0x400A6108U) /**< \brief (PEVC) Channel Multiplexer 0 2 */ +#define REG_PEVC_CHMX3 REG_ACCESS(RwReg , 0x400A610CU) /**< \brief (PEVC) Channel Multiplexer 0 3 */ +#define REG_PEVC_CHMX4 REG_ACCESS(RwReg , 0x400A6110U) /**< \brief (PEVC) Channel Multiplexer 0 4 */ +#define REG_PEVC_CHMX5 REG_ACCESS(RwReg , 0x400A6114U) /**< \brief (PEVC) Channel Multiplexer 0 5 */ +#define REG_PEVC_CHMX6 REG_ACCESS(RwReg , 0x400A6118U) /**< \brief (PEVC) Channel Multiplexer 0 6 */ +#define REG_PEVC_CHMX7 REG_ACCESS(RwReg , 0x400A611CU) /**< \brief (PEVC) Channel Multiplexer 0 7 */ +#define REG_PEVC_CHMX8 REG_ACCESS(RwReg , 0x400A6120U) /**< \brief (PEVC) Channel Multiplexer 0 8 */ +#define REG_PEVC_CHMX9 REG_ACCESS(RwReg , 0x400A6124U) /**< \brief (PEVC) Channel Multiplexer 0 9 */ +#define REG_PEVC_CHMX10 REG_ACCESS(RwReg , 0x400A6128U) /**< \brief (PEVC) Channel Multiplexer 0 10 */ +#define REG_PEVC_CHMX11 REG_ACCESS(RwReg , 0x400A612CU) /**< \brief (PEVC) Channel Multiplexer 0 11 */ +#define REG_PEVC_CHMX12 REG_ACCESS(RwReg , 0x400A6130U) /**< \brief (PEVC) Channel Multiplexer 0 12 */ +#define REG_PEVC_CHMX13 REG_ACCESS(RwReg , 0x400A6134U) /**< \brief (PEVC) Channel Multiplexer 0 13 */ +#define REG_PEVC_CHMX14 REG_ACCESS(RwReg , 0x400A6138U) /**< \brief (PEVC) Channel Multiplexer 0 14 */ +#define REG_PEVC_CHMX15 REG_ACCESS(RwReg , 0x400A613CU) /**< \brief (PEVC) Channel Multiplexer 0 15 */ +#define REG_PEVC_CHMX16 REG_ACCESS(RwReg , 0x400A6140U) /**< \brief (PEVC) Channel Multiplexer 0 16 */ +#define REG_PEVC_CHMX17 REG_ACCESS(RwReg , 0x400A6144U) /**< \brief (PEVC) Channel Multiplexer 0 17 */ +#define REG_PEVC_CHMX18 REG_ACCESS(RwReg , 0x400A6148U) /**< \brief (PEVC) Channel Multiplexer 0 18 */ +#define REG_PEVC_EVS0 REG_ACCESS(RwReg , 0x400A6200U) /**< \brief (PEVC) Event Shaper 0 0 */ +#define REG_PEVC_EVS1 REG_ACCESS(RwReg , 0x400A6204U) /**< \brief (PEVC) Event Shaper 0 1 */ +#define REG_PEVC_EVS2 REG_ACCESS(RwReg , 0x400A6208U) /**< \brief (PEVC) Event Shaper 0 2 */ +#define REG_PEVC_EVS3 REG_ACCESS(RwReg , 0x400A620CU) /**< \brief (PEVC) Event Shaper 0 3 */ +#define REG_PEVC_EVS4 REG_ACCESS(RwReg , 0x400A6210U) /**< \brief (PEVC) Event Shaper 0 4 */ +#define REG_PEVC_EVS5 REG_ACCESS(RwReg , 0x400A6214U) /**< \brief (PEVC) Event Shaper 0 5 */ +#define REG_PEVC_EVS6 REG_ACCESS(RwReg , 0x400A6218U) /**< \brief (PEVC) Event Shaper 0 6 */ +#define REG_PEVC_EVS7 REG_ACCESS(RwReg , 0x400A621CU) /**< \brief (PEVC) Event Shaper 0 7 */ +#define REG_PEVC_EVS8 REG_ACCESS(RwReg , 0x400A6220U) /**< \brief (PEVC) Event Shaper 0 8 */ +#define REG_PEVC_EVS9 REG_ACCESS(RwReg , 0x400A6224U) /**< \brief (PEVC) Event Shaper 0 9 */ +#define REG_PEVC_EVS10 REG_ACCESS(RwReg , 0x400A6228U) /**< \brief (PEVC) Event Shaper 0 10 */ +#define REG_PEVC_EVS11 REG_ACCESS(RwReg , 0x400A622CU) /**< \brief (PEVC) Event Shaper 0 11 */ +#define REG_PEVC_EVS12 REG_ACCESS(RwReg , 0x400A6230U) /**< \brief (PEVC) Event Shaper 0 12 */ +#define REG_PEVC_EVS13 REG_ACCESS(RwReg , 0x400A6234U) /**< \brief (PEVC) Event Shaper 0 13 */ +#define REG_PEVC_EVS14 REG_ACCESS(RwReg , 0x400A6238U) /**< \brief (PEVC) Event Shaper 0 14 */ +#define REG_PEVC_EVS15 REG_ACCESS(RwReg , 0x400A623CU) /**< \brief (PEVC) Event Shaper 0 15 */ +#define REG_PEVC_EVS16 REG_ACCESS(RwReg , 0x400A6240U) /**< \brief (PEVC) Event Shaper 0 16 */ +#define REG_PEVC_EVS17 REG_ACCESS(RwReg , 0x400A6244U) /**< \brief (PEVC) Event Shaper 0 17 */ +#define REG_PEVC_EVS18 REG_ACCESS(RwReg , 0x400A6248U) /**< \brief (PEVC) Event Shaper 0 18 */ +#define REG_PEVC_EVS19 REG_ACCESS(RwReg , 0x400A624CU) /**< \brief (PEVC) Event Shaper 0 19 */ +#define REG_PEVC_EVS20 REG_ACCESS(RwReg , 0x400A6250U) /**< \brief (PEVC) Event Shaper 0 20 */ +#define REG_PEVC_EVS21 REG_ACCESS(RwReg , 0x400A6254U) /**< \brief (PEVC) Event Shaper 0 21 */ +#define REG_PEVC_EVS22 REG_ACCESS(RwReg , 0x400A6258U) /**< \brief (PEVC) Event Shaper 0 22 */ +#define REG_PEVC_EVS23 REG_ACCESS(RwReg , 0x400A625CU) /**< \brief (PEVC) Event Shaper 0 23 */ +#define REG_PEVC_EVS24 REG_ACCESS(RwReg , 0x400A6260U) /**< \brief (PEVC) Event Shaper 0 24 */ +#define REG_PEVC_EVS25 REG_ACCESS(RwReg , 0x400A6264U) /**< \brief (PEVC) Event Shaper 0 25 */ +#define REG_PEVC_EVS26 REG_ACCESS(RwReg , 0x400A6268U) /**< \brief (PEVC) Event Shaper 0 26 */ +#define REG_PEVC_EVS27 REG_ACCESS(RwReg , 0x400A626CU) /**< \brief (PEVC) Event Shaper 0 27 */ +#define REG_PEVC_EVS28 REG_ACCESS(RwReg , 0x400A6270U) /**< \brief (PEVC) Event Shaper 0 28 */ +#define REG_PEVC_EVS29 REG_ACCESS(RwReg , 0x400A6274U) /**< \brief (PEVC) Event Shaper 0 29 */ +#define REG_PEVC_EVS30 REG_ACCESS(RwReg , 0x400A6278U) /**< \brief (PEVC) Event Shaper 0 30 */ +#define REG_PEVC_IGFDR REG_ACCESS(RwReg , 0x400A6300U) /**< \brief (PEVC) Input Glitch Filter Divider Register */ +#define REG_PEVC_PARAMETER REG_ACCESS(RoReg , 0x400A63F8U) /**< \brief (PEVC) Parameter */ +#define REG_PEVC_VERSION REG_ACCESS(RoReg , 0x400A63FCU) /**< \brief (PEVC) Version */ +/* ========== Register definition for AESA peripheral ========== */ +#define REG_AESA_CTRL REG_ACCESS(RwReg , 0x400B0000U) /**< \brief (AESA) Control Register */ +#define REG_AESA_MODE REG_ACCESS(RwReg , 0x400B0004U) /**< \brief (AESA) Mode Register */ +#define REG_AESA_DATABUFPTR REG_ACCESS(RwReg , 0x400B0008U) /**< \brief (AESA) Data Buffer Pointer Register */ +#define REG_AESA_SR REG_ACCESS(RoReg , 0x400B000CU) /**< \brief (AESA) Status Register */ +#define REG_AESA_IER REG_ACCESS(WoReg , 0x400B0010U) /**< \brief (AESA) Interrupt Enable Register */ +#define REG_AESA_IDR REG_ACCESS(WoReg , 0x400B0014U) /**< \brief (AESA) Interrupt Disable Register */ +#define REG_AESA_IMR REG_ACCESS(RoReg , 0x400B0018U) /**< \brief (AESA) Interrupt Mask Register */ +#define REG_AESA_KEY0 REG_ACCESS(WoReg , 0x400B0020U) /**< \brief (AESA) Key Register 0 0 */ +#define REG_AESA_KEY1 REG_ACCESS(WoReg , 0x400B0024U) /**< \brief (AESA) Key Register 0 1 */ +#define REG_AESA_KEY2 REG_ACCESS(WoReg , 0x400B0028U) /**< \brief (AESA) Key Register 0 2 */ +#define REG_AESA_KEY3 REG_ACCESS(WoReg , 0x400B002CU) /**< \brief (AESA) Key Register 0 3 */ +#define REG_AESA_KEY4 REG_ACCESS(WoReg , 0x400B0030U) /**< \brief (AESA) Key Register 0 4 */ +#define REG_AESA_KEY5 REG_ACCESS(WoReg , 0x400B0034U) /**< \brief (AESA) Key Register 0 5 */ +#define REG_AESA_KEY6 REG_ACCESS(WoReg , 0x400B0038U) /**< \brief (AESA) Key Register 0 6 */ +#define REG_AESA_KEY7 REG_ACCESS(WoReg , 0x400B003CU) /**< \brief (AESA) Key Register 0 7 */ +#define REG_AESA_INITVECT0 REG_ACCESS(WoReg , 0x400B0040U) /**< \brief (AESA) Initialization Vector Register 0 0 */ +#define REG_AESA_INITVECT1 REG_ACCESS(WoReg , 0x400B0044U) /**< \brief (AESA) Initialization Vector Register 0 1 */ +#define REG_AESA_INITVECT2 REG_ACCESS(WoReg , 0x400B0048U) /**< \brief (AESA) Initialization Vector Register 0 2 */ +#define REG_AESA_INITVECT3 REG_ACCESS(WoReg , 0x400B004CU) /**< \brief (AESA) Initialization Vector Register 0 3 */ +#define REG_AESA_IDATA REG_ACCESS(WoReg , 0x400B0050U) /**< \brief (AESA) Input Data Register */ +#define REG_AESA_ODATA REG_ACCESS(RoReg , 0x400B0060U) /**< \brief (AESA) Output Data Register */ +#define REG_AESA_DRNGSEED REG_ACCESS(WoReg , 0x400B0070U) /**< \brief (AESA) DRNG Seed Register */ +#define REG_AESA_PARAMETER REG_ACCESS(RoReg , 0x400B00F8U) /**< \brief (AESA) Parameter Register */ +#define REG_AESA_VERSION REG_ACCESS(RoReg , 0x400B00FCU) /**< \brief (AESA) Version Register */ +/* ========== Register definition for PM peripheral ========== */ +#define REG_PM_MCCTRL REG_ACCESS(RwReg , 0x400E0000U) /**< \brief (PM) Main Clock Control */ +#define REG_PM_CPUSEL REG_ACCESS(RwReg , 0x400E0004U) /**< \brief (PM) CPU Clock Select */ +#define REG_PM_PBASEL REG_ACCESS(RwReg , 0x400E000CU) /**< \brief (PM) PBA Clock Select */ +#define REG_PM_PBBSEL REG_ACCESS(RwReg , 0x400E0010U) /**< \brief (PM) PBB Clock Select */ +#define REG_PM_PBCSEL REG_ACCESS(RwReg , 0x400E0014U) /**< \brief (PM) PBC Clock Select */ +#define REG_PM_PBDSEL REG_ACCESS(RwReg , 0x400E0018U) /**< \brief (PM) PBD Clock Select */ +#define REG_PM_CPUMASK REG_ACCESS(RwReg , 0x400E0020U) /**< \brief (PM) CPU Mask */ +#define REG_PM_HSBMASK REG_ACCESS(RwReg , 0x400E0024U) /**< \brief (PM) HSB Mask */ +#define REG_PM_PBAMASK REG_ACCESS(RwReg , 0x400E0028U) /**< \brief (PM) PBA Mask */ +#define REG_PM_PBBMASK REG_ACCESS(RwReg , 0x400E002CU) /**< \brief (PM) PBB Mask */ +#define REG_PM_PBCMASK REG_ACCESS(RwReg , 0x400E0030U) /**< \brief (PM) PBC Mask */ +#define REG_PM_PBDMASK REG_ACCESS(RwReg , 0x400E0034U) /**< \brief (PM) PBD Mask */ +#define REG_PM_PBADIVMASK REG_ACCESS(RwReg , 0x400E0040U) /**< \brief (PM) PBA Divided Clock Mask */ +#define REG_PM_CFDCTRL REG_ACCESS(RwReg , 0x400E0054U) /**< \brief (PM) Clock Failure Detector Control */ +#define REG_PM_UNLOCK REG_ACCESS(WoReg , 0x400E0058U) /**< \brief (PM) Unlock Register */ +#define REG_PM_IER REG_ACCESS(WoReg , 0x400E00C0U) /**< \brief (PM) Interrupt Enable Register */ +#define REG_PM_IDR REG_ACCESS(WoReg , 0x400E00C4U) /**< \brief (PM) Interrupt Disable Register */ +#define REG_PM_IMR REG_ACCESS(RoReg , 0x400E00C8U) /**< \brief (PM) Interrupt Mask Register */ +#define REG_PM_ISR REG_ACCESS(RoReg , 0x400E00CCU) /**< \brief (PM) Interrupt Status Register */ +#define REG_PM_ICR REG_ACCESS(WoReg , 0x400E00D0U) /**< \brief (PM) Interrupt Clear Register */ +#define REG_PM_SR REG_ACCESS(RoReg , 0x400E00D4U) /**< \brief (PM) Status Register */ +#define REG_PM_PPCR REG_ACCESS(RwReg , 0x400E0160U) /**< \brief (PM) Peripheral Power Control Register */ +#define REG_PM_RCAUSE REG_ACCESS(RoReg , 0x400E0180U) /**< \brief (PM) Reset Cause Register */ +#define REG_PM_WCAUSE REG_ACCESS(RoReg , 0x400E0184U) /**< \brief (PM) Wake Cause Register */ +#define REG_PM_AWEN REG_ACCESS(RwReg , 0x400E0188U) /**< \brief (PM) Asynchronous Wake Enable */ +#define REG_PM_OBS REG_ACCESS(RwReg , 0x400E0190U) /**< \brief (PM) Obsvervability */ +#define REG_PM_FASTSLEEP REG_ACCESS(RwReg , 0x400E0194U) /**< \brief (PM) Fast Sleep Register */ +#define REG_PM_CONFIG REG_ACCESS(RoReg , 0x400E03F8U) /**< \brief (PM) Configuration Register */ +#define REG_PM_VERSION REG_ACCESS(RoReg , 0x400E03FCU) /**< \brief (PM) Version Register */ +/* ========== Register definition for CHIPID peripheral ========== */ +#define REG_CHIPID_CIDR REG_ACCESS(RoReg , 0x400E0740U) /**< \brief (CHIPID) Chip ID Register */ +#define REG_CHIPID_EXID REG_ACCESS(RoReg , 0x400E0744U) /**< \brief (CHIPID) Chip ID Extension Register */ +/* ========== Register definition for SCIF peripheral ========== */ +#define REG_SCIF_IER REG_ACCESS(WoReg , 0x400E0800U) /**< \brief (SCIF) Interrupt Enable Register */ +#define REG_SCIF_IDR REG_ACCESS(WoReg , 0x400E0804U) /**< \brief (SCIF) Interrupt Disable Register */ +#define REG_SCIF_IMR REG_ACCESS(RoReg , 0x400E0808U) /**< \brief (SCIF) Interrupt Mask Register */ +#define REG_SCIF_ISR REG_ACCESS(RoReg , 0x400E080CU) /**< \brief (SCIF) Interrupt Status Register */ +#define REG_SCIF_ICR REG_ACCESS(WoReg , 0x400E0810U) /**< \brief (SCIF) Interrupt Clear Register */ +#define REG_SCIF_PCLKSR REG_ACCESS(RoReg , 0x400E0814U) /**< \brief (SCIF) Power and Clocks Status Register */ +#define REG_SCIF_UNLOCK REG_ACCESS(WoReg , 0x400E0818U) /**< \brief (SCIF) Unlock Register */ +#define REG_SCIF_CSCR REG_ACCESS(RwReg , 0x400E081CU) /**< \brief (SCIF) Chip Specific Configuration Register */ +#define REG_SCIF_OSCCTRL0 REG_ACCESS(RwReg , 0x400E0820U) /**< \brief (SCIF) Oscillator Control Register */ +#define REG_SCIF_PLL0 REG_ACCESS(RwReg , 0x400E0824U) /**< \brief (SCIF) PLL0 Control Register 0 */ +#define REG_SCIF_DFLL0CONF REG_ACCESS(RwReg , 0x400E0828U) /**< \brief (SCIF) DFLL0 Config Register */ +#define REG_SCIF_DFLL0VAL REG_ACCESS(RwReg , 0x400E082CU) /**< \brief (SCIF) DFLL Value Register */ +#define REG_SCIF_DFLL0MUL REG_ACCESS(RwReg , 0x400E0830U) /**< \brief (SCIF) DFLL0 Multiplier Register */ +#define REG_SCIF_DFLL0STEP REG_ACCESS(RwReg , 0x400E0834U) /**< \brief (SCIF) DFLL0 Step Register */ +#define REG_SCIF_DFLL0SSG REG_ACCESS(RwReg , 0x400E0838U) /**< \brief (SCIF) DFLL0 Spread Spectrum Generator Control Register */ +#define REG_SCIF_DFLL0RATIO REG_ACCESS(RoReg , 0x400E083CU) /**< \brief (SCIF) DFLL0 Ratio Registe */ +#define REG_SCIF_DFLL0SYNC REG_ACCESS(WoReg , 0x400E0840U) /**< \brief (SCIF) DFLL0 Synchronization Register */ +#define REG_SCIF_RCCR REG_ACCESS(RwReg , 0x400E0844U) /**< \brief (SCIF) System RC Oscillator Calibration Register */ +#define REG_SCIF_RCFASTCFG REG_ACCESS(RwReg , 0x400E0848U) /**< \brief (SCIF) 4/8/12 MHz RC Oscillator Configuration +Register */ +#define REG_SCIF_RCFASTSR REG_ACCESS(RwReg , 0x400E084CU) /**< \brief (SCIF) 4/8/12 MHz RC Oscillator Status Register */ +#define REG_SCIF_RC80MCR REG_ACCESS(RwReg , 0x400E0850U) /**< \brief (SCIF) 80 MHz RC Oscillator Register */ +#define REG_SCIF_HRPCR REG_ACCESS(RwReg , 0x400E0864U) /**< \brief (SCIF) High Resolution Prescaler Control Register */ +#define REG_SCIF_FPCR REG_ACCESS(RwReg , 0x400E0868U) /**< \brief (SCIF) Fractional Prescaler Control Register */ +#define REG_SCIF_FPMUL REG_ACCESS(RwReg , 0x400E086CU) /**< \brief (SCIF) Fractional Prescaler Multiplier Register */ +#define REG_SCIF_FPDIV REG_ACCESS(RwReg , 0x400E0870U) /**< \brief (SCIF) Fractional Prescaler DIVIDER Register */ +#define REG_SCIF_GCCTRL0 REG_ACCESS(RwReg , 0x400E0874U) /**< \brief (SCIF) Generic Clock Control 0 */ +#define REG_SCIF_GCCTRL1 REG_ACCESS(RwReg , 0x400E0878U) /**< \brief (SCIF) Generic Clock Control 1 */ +#define REG_SCIF_GCCTRL2 REG_ACCESS(RwReg , 0x400E087CU) /**< \brief (SCIF) Generic Clock Control 2 */ +#define REG_SCIF_GCCTRL3 REG_ACCESS(RwReg , 0x400E0880U) /**< \brief (SCIF) Generic Clock Control 3 */ +#define REG_SCIF_GCCTRL4 REG_ACCESS(RwReg , 0x400E0884U) /**< \brief (SCIF) Generic Clock Control 4 */ +#define REG_SCIF_GCCTRL5 REG_ACCESS(RwReg , 0x400E0888U) /**< \brief (SCIF) Generic Clock Control 5 */ +#define REG_SCIF_GCCTRL6 REG_ACCESS(RwReg , 0x400E088CU) /**< \brief (SCIF) Generic Clock Control 6 */ +#define REG_SCIF_GCCTRL7 REG_ACCESS(RwReg , 0x400E0890U) /**< \brief (SCIF) Generic Clock Control 7 */ +#define REG_SCIF_GCCTRL8 REG_ACCESS(RwReg , 0x400E0894U) /**< \brief (SCIF) Generic Clock Control 8 */ +#define REG_SCIF_GCCTRL9 REG_ACCESS(RwReg , 0x400E0898U) /**< \brief (SCIF) Generic Clock Control 9 */ +#define REG_SCIF_GCCTRL10 REG_ACCESS(RwReg , 0x400E089CU) /**< \brief (SCIF) Generic Clock Control 10 */ +#define REG_SCIF_GCCTRL11 REG_ACCESS(RwReg , 0x400E08A0U) /**< \brief (SCIF) Generic Clock Control 11 */ +#define REG_SCIF_RCFASTVERSION REG_ACCESS(RoReg , 0x400E0BD8U) /**< \brief (SCIF) 4/8/12 MHz RC Oscillator Version Register */ +#define REG_SCIF_GCLKPRESCVERSION REG_ACCESS(RoReg , 0x400E0BDCU) /**< \brief (SCIF) Generic Clock Prescaler Version Register */ +#define REG_SCIF_PLLIFAVERSION REG_ACCESS(RoReg , 0x400E0BE0U) /**< \brief (SCIF) PLL Version Register */ +#define REG_SCIF_OSCIFAVERSION REG_ACCESS(RoReg , 0x400E0BE4U) /**< \brief (SCIF) Oscillator 0 Version Register */ +#define REG_SCIF_DFLLIFBVERSION REG_ACCESS(RoReg , 0x400E0BE8U) /**< \brief (SCIF) DFLL Version Register */ +#define REG_SCIF_RCOSCIFAVERSION REG_ACCESS(RoReg , 0x400E0BECU) /**< \brief (SCIF) System RC Oscillator Version Register */ +#define REG_SCIF_FLOVERSION REG_ACCESS(RoReg , 0x400E0BF0U) /**< \brief (SCIF) Frequency Locked Oscillator Version Register */ +#define REG_SCIF_RC80MVERSION REG_ACCESS(RoReg , 0x400E0BF4U) /**< \brief (SCIF) 80MHz RC Oscillator Version Register */ +#define REG_SCIF_GCLKIFVERSION REG_ACCESS(RoReg , 0x400E0BF8U) /**< \brief (SCIF) Generic Clock Version Register */ +#define REG_SCIF_VERSION REG_ACCESS(RoReg , 0x400E0BFCU) /**< \brief (SCIF) SCIF Version Register */ +/* ========== Register definition for FREQM peripheral ========== */ +#define REG_FREQM_CTRL REG_ACCESS(WoReg , 0x400E0C00U) /**< \brief (FREQM) Control register */ +#define REG_FREQM_MODE REG_ACCESS(RwReg , 0x400E0C04U) /**< \brief (FREQM) Mode register */ +#define REG_FREQM_STATUS REG_ACCESS(RoReg , 0x400E0C08U) /**< \brief (FREQM) Status register */ +#define REG_FREQM_VALUE REG_ACCESS(RoReg , 0x400E0C0CU) /**< \brief (FREQM) Value register */ +#define REG_FREQM_IER REG_ACCESS(WoReg , 0x400E0C10U) /**< \brief (FREQM) Interrupt Enable Register */ +#define REG_FREQM_IDR REG_ACCESS(WoReg , 0x400E0C14U) /**< \brief (FREQM) Interrupt Diable Register */ +#define REG_FREQM_IMR REG_ACCESS(RoReg , 0x400E0C18U) /**< \brief (FREQM) Interrupt Mask Register */ +#define REG_FREQM_ISR REG_ACCESS(RoReg , 0x400E0C1CU) /**< \brief (FREQM) Interrupt Status Register */ +#define REG_FREQM_ICR REG_ACCESS(WoReg , 0x400E0C20U) /**< \brief (FREQM) Interrupt Clear Register */ +#define REG_FREQM_VERSION REG_ACCESS(RoReg , 0x400E0FFCU) /**< \brief (FREQM) Version Register */ +/* ========== Register definition for GPIO peripheral ========== */ +#define REG_GPIO_GPER0 REG_ACCESS(RwReg , 0x400E1000U) /**< \brief (GPIO) GPIO Enable Register 0 */ +#define REG_GPIO_GPERS0 REG_ACCESS(WoReg , 0x400E1004U) /**< \brief (GPIO) GPIO Enable Register - Set 0 */ +#define REG_GPIO_GPERC0 REG_ACCESS(WoReg , 0x400E1008U) /**< \brief (GPIO) GPIO Enable Register - Clear 0 */ +#define REG_GPIO_GPERT0 REG_ACCESS(WoReg , 0x400E100CU) /**< \brief (GPIO) GPIO Enable Register - Toggle 0 */ +#define REG_GPIO_PMR00 REG_ACCESS(RwReg , 0x400E1010U) /**< \brief (GPIO) Peripheral Mux Register 0 0 */ +#define REG_GPIO_PMR0S0 REG_ACCESS(WoReg , 0x400E1014U) /**< \brief (GPIO) Peripheral Mux Register 0 - Set 0 */ +#define REG_GPIO_PMR0C0 REG_ACCESS(WoReg , 0x400E1018U) /**< \brief (GPIO) Peripheral Mux Register 0 - Clear 0 */ +#define REG_GPIO_PMR0T0 REG_ACCESS(WoReg , 0x400E101CU) /**< \brief (GPIO) Peripheral Mux Register 0 - Toggle 0 */ +#define REG_GPIO_PMR10 REG_ACCESS(RwReg , 0x400E1020U) /**< \brief (GPIO) Peripheral Mux Register 1 0 */ +#define REG_GPIO_PMR1S0 REG_ACCESS(WoReg , 0x400E1024U) /**< \brief (GPIO) Peripheral Mux Register 1 - Set 0 */ +#define REG_GPIO_PMR1C0 REG_ACCESS(WoReg , 0x400E1028U) /**< \brief (GPIO) Peripheral Mux Register 1 - Clear 0 */ +#define REG_GPIO_PMR1T0 REG_ACCESS(WoReg , 0x400E102CU) /**< \brief (GPIO) Peripheral Mux Register 1 - Toggle 0 */ +#define REG_GPIO_PMR20 REG_ACCESS(RwReg , 0x400E1030U) /**< \brief (GPIO) Peripheral Mux Register 2 0 */ +#define REG_GPIO_PMR2S0 REG_ACCESS(WoReg , 0x400E1034U) /**< \brief (GPIO) Peripheral Mux Register 2 - Set 0 */ +#define REG_GPIO_PMR2C0 REG_ACCESS(WoReg , 0x400E1038U) /**< \brief (GPIO) Peripheral Mux Register 2 - Clear 0 */ +#define REG_GPIO_PMR2T0 REG_ACCESS(WoReg , 0x400E103CU) /**< \brief (GPIO) Peripheral Mux Register 2 - Toggle 0 */ +#define REG_GPIO_ODER0 REG_ACCESS(RwReg , 0x400E1040U) /**< \brief (GPIO) Output Driver Enable Register 0 */ +#define REG_GPIO_ODERS0 REG_ACCESS(WoReg , 0x400E1044U) /**< \brief (GPIO) Output Driver Enable Register - Set 0 */ +#define REG_GPIO_ODERC0 REG_ACCESS(WoReg , 0x400E1048U) /**< \brief (GPIO) Output Driver Enable Register - Clear 0 */ +#define REG_GPIO_ODERT0 REG_ACCESS(WoReg , 0x400E104CU) /**< \brief (GPIO) Output Driver Enable Register - Toggle 0 */ +#define REG_GPIO_OVR0 REG_ACCESS(RwReg , 0x400E1050U) /**< \brief (GPIO) Output Value Register 0 */ +#define REG_GPIO_OVRS0 REG_ACCESS(WoReg , 0x400E1054U) /**< \brief (GPIO) Output Value Register - Set 0 */ +#define REG_GPIO_OVRC0 REG_ACCESS(WoReg , 0x400E1058U) /**< \brief (GPIO) Output Value Register - Clear 0 */ +#define REG_GPIO_OVRT0 REG_ACCESS(WoReg , 0x400E105CU) /**< \brief (GPIO) Output Value Register - Toggle 0 */ +#define REG_GPIO_PVR0 REG_ACCESS(RoReg , 0x400E1060U) /**< \brief (GPIO) Pin Value Register 0 */ +#define REG_GPIO_PUER0 REG_ACCESS(RwReg , 0x400E1070U) /**< \brief (GPIO) Pull-up Enable Register 0 */ +#define REG_GPIO_PUERS0 REG_ACCESS(WoReg , 0x400E1074U) /**< \brief (GPIO) Pull-up Enable Register - Set 0 */ +#define REG_GPIO_PUERC0 REG_ACCESS(WoReg , 0x400E1078U) /**< \brief (GPIO) Pull-up Enable Register - Clear 0 */ +#define REG_GPIO_PUERT0 REG_ACCESS(WoReg , 0x400E107CU) /**< \brief (GPIO) Pull-up Enable Register - Toggle 0 */ +#define REG_GPIO_PDER0 REG_ACCESS(RwReg , 0x400E1080U) /**< \brief (GPIO) Pull-down Enable Register 0 */ +#define REG_GPIO_PDERS0 REG_ACCESS(WoReg , 0x400E1084U) /**< \brief (GPIO) Pull-down Enable Register - Set 0 */ +#define REG_GPIO_PDERC0 REG_ACCESS(WoReg , 0x400E1088U) /**< \brief (GPIO) Pull-down Enable Register - Clear 0 */ +#define REG_GPIO_PDERT0 REG_ACCESS(WoReg , 0x400E108CU) /**< \brief (GPIO) Pull-down Enable Register - Toggle 0 */ +#define REG_GPIO_IER0 REG_ACCESS(RwReg , 0x400E1090U) /**< \brief (GPIO) Interrupt Enable Register 0 */ +#define REG_GPIO_IERS0 REG_ACCESS(WoReg , 0x400E1094U) /**< \brief (GPIO) Interrupt Enable Register - Set 0 */ +#define REG_GPIO_IERC0 REG_ACCESS(WoReg , 0x400E1098U) /**< \brief (GPIO) Interrupt Enable Register - Clear 0 */ +#define REG_GPIO_IERT0 REG_ACCESS(WoReg , 0x400E109CU) /**< \brief (GPIO) Interrupt Enable Register - Toggle 0 */ +#define REG_GPIO_IMR00 REG_ACCESS(RwReg , 0x400E10A0U) /**< \brief (GPIO) Interrupt Mode Register 0 0 */ +#define REG_GPIO_IMR0S0 REG_ACCESS(WoReg , 0x400E10A4U) /**< \brief (GPIO) Interrupt Mode Register 0 - Set 0 */ +#define REG_GPIO_IMR0C0 REG_ACCESS(WoReg , 0x400E10A8U) /**< \brief (GPIO) Interrupt Mode Register 0 - Clear 0 */ +#define REG_GPIO_IMR0T0 REG_ACCESS(WoReg , 0x400E10ACU) /**< \brief (GPIO) Interrupt Mode Register 0 - Toggle 0 */ +#define REG_GPIO_IMR10 REG_ACCESS(RwReg , 0x400E10B0U) /**< \brief (GPIO) Interrupt Mode Register 1 0 */ +#define REG_GPIO_IMR1S0 REG_ACCESS(WoReg , 0x400E10B4U) /**< \brief (GPIO) Interrupt Mode Register 1 - Set 0 */ +#define REG_GPIO_IMR1C0 REG_ACCESS(WoReg , 0x400E10B8U) /**< \brief (GPIO) Interrupt Mode Register 1 - Clear 0 */ +#define REG_GPIO_IMR1T0 REG_ACCESS(WoReg , 0x400E10BCU) /**< \brief (GPIO) Interrupt Mode Register 1 - Toggle 0 */ +#define REG_GPIO_GFER0 REG_ACCESS(RwReg , 0x400E10C0U) /**< \brief (GPIO) Glitch Filter Enable Register 0 */ +#define REG_GPIO_GFERS0 REG_ACCESS(WoReg , 0x400E10C4U) /**< \brief (GPIO) Glitch Filter Enable Register - Set 0 */ +#define REG_GPIO_GFERC0 REG_ACCESS(WoReg , 0x400E10C8U) /**< \brief (GPIO) Glitch Filter Enable Register - Clear 0 */ +#define REG_GPIO_GFERT0 REG_ACCESS(WoReg , 0x400E10CCU) /**< \brief (GPIO) Glitch Filter Enable Register - Toggle 0 */ +#define REG_GPIO_IFR0 REG_ACCESS(RoReg , 0x400E10D0U) /**< \brief (GPIO) Interrupt Flag Register 0 */ +#define REG_GPIO_IFRC0 REG_ACCESS(WoReg , 0x400E10D8U) /**< \brief (GPIO) Interrupt Flag Register - Clear 0 */ +#define REG_GPIO_ODMER0 REG_ACCESS(RwReg , 0x400E10E0U) /**< \brief (GPIO) Open Drain Mode Register 0 */ +#define REG_GPIO_ODMERS0 REG_ACCESS(WoReg , 0x400E10E4U) /**< \brief (GPIO) Open Drain Mode Register - Set 0 */ +#define REG_GPIO_ODMERC0 REG_ACCESS(WoReg , 0x400E10E8U) /**< \brief (GPIO) Open Drain Mode Register - Clear 0 */ +#define REG_GPIO_ODMERT0 REG_ACCESS(WoReg , 0x400E10ECU) /**< \brief (GPIO) Open Drain Mode Register - Toggle 0 */ +#define REG_GPIO_ODCR00 REG_ACCESS(RwReg , 0x400E1100U) /**< \brief (GPIO) Output Driving Capability Register 0 0 */ +#define REG_GPIO_ODCR0S0 REG_ACCESS(RwReg , 0x400E1104U) /**< \brief (GPIO) Output Driving Capability Register 0 - Set 0 */ +#define REG_GPIO_ODCR0C0 REG_ACCESS(RwReg , 0x400E1108U) /**< \brief (GPIO) Output Driving Capability Register 0 - Clear 0 */ +#define REG_GPIO_ODCR0T0 REG_ACCESS(RwReg , 0x400E110CU) /**< \brief (GPIO) Output Driving Capability Register 0 - Toggle 0 */ +#define REG_GPIO_ODCR10 REG_ACCESS(RwReg , 0x400E1110U) /**< \brief (GPIO) Output Driving Capability Register 1 0 */ +#define REG_GPIO_ODCR1S0 REG_ACCESS(RwReg , 0x400E1114U) /**< \brief (GPIO) Output Driving Capability Register 1 - Set 0 */ +#define REG_GPIO_ODCR1C0 REG_ACCESS(RwReg , 0x400E1118U) /**< \brief (GPIO) Output Driving Capability Register 1 - Clear 0 */ +#define REG_GPIO_ODCR1T0 REG_ACCESS(RwReg , 0x400E111CU) /**< \brief (GPIO) Output Driving Capability Register 1 - Toggle 0 */ +#define REG_GPIO_OSRR00 REG_ACCESS(RwReg , 0x400E1130U) /**< \brief (GPIO) Output Slew Rate Register 0 0 */ +#define REG_GPIO_OSRR0S0 REG_ACCESS(RwReg , 0x400E1134U) /**< \brief (GPIO) Output Slew Rate Register 0 - Set 0 */ +#define REG_GPIO_OSRR0C0 REG_ACCESS(RwReg , 0x400E1138U) /**< \brief (GPIO) Output Slew Rate Register 0 - Clear 0 */ +#define REG_GPIO_OSRR0T0 REG_ACCESS(RwReg , 0x400E113CU) /**< \brief (GPIO) Output Slew Rate Register 0 - Toggle 0 */ +#define REG_GPIO_STER0 REG_ACCESS(RwReg , 0x400E1160U) /**< \brief (GPIO) Schmitt Trigger Enable Register 0 */ +#define REG_GPIO_STERS0 REG_ACCESS(RwReg , 0x400E1164U) /**< \brief (GPIO) Schmitt Trigger Enable Register - Set 0 */ +#define REG_GPIO_STERC0 REG_ACCESS(RwReg , 0x400E1168U) /**< \brief (GPIO) Schmitt Trigger Enable Register - Clear 0 */ +#define REG_GPIO_STERT0 REG_ACCESS(RwReg , 0x400E116CU) /**< \brief (GPIO) Schmitt Trigger Enable Register - Toggle 0 */ +#define REG_GPIO_EVER0 REG_ACCESS(RwReg , 0x400E1180U) /**< \brief (GPIO) Event Enable Register 0 */ +#define REG_GPIO_EVERS0 REG_ACCESS(WoReg , 0x400E1184U) /**< \brief (GPIO) Event Enable Register - Set 0 */ +#define REG_GPIO_EVERC0 REG_ACCESS(WoReg , 0x400E1188U) /**< \brief (GPIO) Event Enable Register - Clear 0 */ +#define REG_GPIO_EVERT0 REG_ACCESS(WoReg , 0x400E118CU) /**< \brief (GPIO) Event Enable Register - Toggle 0 */ +#define REG_GPIO_LOCK0 REG_ACCESS(RwReg , 0x400E11A0U) /**< \brief (GPIO) Lock Register 0 */ +#define REG_GPIO_LOCKS0 REG_ACCESS(WoReg , 0x400E11A4U) /**< \brief (GPIO) Lock Register - Set 0 */ +#define REG_GPIO_LOCKC0 REG_ACCESS(WoReg , 0x400E11A8U) /**< \brief (GPIO) Lock Register - Clear 0 */ +#define REG_GPIO_LOCKT0 REG_ACCESS(WoReg , 0x400E11ACU) /**< \brief (GPIO) Lock Register - Toggle 0 */ +#define REG_GPIO_UNLOCK0 REG_ACCESS(WoReg , 0x400E11E0U) /**< \brief (GPIO) Unlock Register 0 */ +#define REG_GPIO_ASR0 REG_ACCESS(RwReg , 0x400E11E4U) /**< \brief (GPIO) Access Status Register 0 */ +#define REG_GPIO_PARAMETER0 REG_ACCESS(RoReg , 0x400E11F8U) /**< \brief (GPIO) Parameter Register 0 */ +#define REG_GPIO_VERSION0 REG_ACCESS(RoReg , 0x400E11FCU) /**< \brief (GPIO) Version Register 0 */ +#define REG_GPIO_GPER1 REG_ACCESS(RwReg , 0x400E1200U) /**< \brief (GPIO) GPIO Enable Register 1 */ +#define REG_GPIO_GPERS1 REG_ACCESS(WoReg , 0x400E1204U) /**< \brief (GPIO) GPIO Enable Register - Set 1 */ +#define REG_GPIO_GPERC1 REG_ACCESS(WoReg , 0x400E1208U) /**< \brief (GPIO) GPIO Enable Register - Clear 1 */ +#define REG_GPIO_GPERT1 REG_ACCESS(WoReg , 0x400E120CU) /**< \brief (GPIO) GPIO Enable Register - Toggle 1 */ +#define REG_GPIO_PMR01 REG_ACCESS(RwReg , 0x400E1210U) /**< \brief (GPIO) Peripheral Mux Register 0 1 */ +#define REG_GPIO_PMR0S1 REG_ACCESS(WoReg , 0x400E1214U) /**< \brief (GPIO) Peripheral Mux Register 0 - Set 1 */ +#define REG_GPIO_PMR0C1 REG_ACCESS(WoReg , 0x400E1218U) /**< \brief (GPIO) Peripheral Mux Register 0 - Clear 1 */ +#define REG_GPIO_PMR0T1 REG_ACCESS(WoReg , 0x400E121CU) /**< \brief (GPIO) Peripheral Mux Register 0 - Toggle 1 */ +#define REG_GPIO_PMR11 REG_ACCESS(RwReg , 0x400E1220U) /**< \brief (GPIO) Peripheral Mux Register 1 1 */ +#define REG_GPIO_PMR1S1 REG_ACCESS(WoReg , 0x400E1224U) /**< \brief (GPIO) Peripheral Mux Register 1 - Set 1 */ +#define REG_GPIO_PMR1C1 REG_ACCESS(WoReg , 0x400E1228U) /**< \brief (GPIO) Peripheral Mux Register 1 - Clear 1 */ +#define REG_GPIO_PMR1T1 REG_ACCESS(WoReg , 0x400E122CU) /**< \brief (GPIO) Peripheral Mux Register 1 - Toggle 1 */ +#define REG_GPIO_PMR21 REG_ACCESS(RwReg , 0x400E1230U) /**< \brief (GPIO) Peripheral Mux Register 2 1 */ +#define REG_GPIO_PMR2S1 REG_ACCESS(WoReg , 0x400E1234U) /**< \brief (GPIO) Peripheral Mux Register 2 - Set 1 */ +#define REG_GPIO_PMR2C1 REG_ACCESS(WoReg , 0x400E1238U) /**< \brief (GPIO) Peripheral Mux Register 2 - Clear 1 */ +#define REG_GPIO_PMR2T1 REG_ACCESS(WoReg , 0x400E123CU) /**< \brief (GPIO) Peripheral Mux Register 2 - Toggle 1 */ +#define REG_GPIO_ODER1 REG_ACCESS(RwReg , 0x400E1240U) /**< \brief (GPIO) Output Driver Enable Register 1 */ +#define REG_GPIO_ODERS1 REG_ACCESS(WoReg , 0x400E1244U) /**< \brief (GPIO) Output Driver Enable Register - Set 1 */ +#define REG_GPIO_ODERC1 REG_ACCESS(WoReg , 0x400E1248U) /**< \brief (GPIO) Output Driver Enable Register - Clear 1 */ +#define REG_GPIO_ODERT1 REG_ACCESS(WoReg , 0x400E124CU) /**< \brief (GPIO) Output Driver Enable Register - Toggle 1 */ +#define REG_GPIO_OVR1 REG_ACCESS(RwReg , 0x400E1250U) /**< \brief (GPIO) Output Value Register 1 */ +#define REG_GPIO_OVRS1 REG_ACCESS(WoReg , 0x400E1254U) /**< \brief (GPIO) Output Value Register - Set 1 */ +#define REG_GPIO_OVRC1 REG_ACCESS(WoReg , 0x400E1258U) /**< \brief (GPIO) Output Value Register - Clear 1 */ +#define REG_GPIO_OVRT1 REG_ACCESS(WoReg , 0x400E125CU) /**< \brief (GPIO) Output Value Register - Toggle 1 */ +#define REG_GPIO_PVR1 REG_ACCESS(RoReg , 0x400E1260U) /**< \brief (GPIO) Pin Value Register 1 */ +#define REG_GPIO_PUER1 REG_ACCESS(RwReg , 0x400E1270U) /**< \brief (GPIO) Pull-up Enable Register 1 */ +#define REG_GPIO_PUERS1 REG_ACCESS(WoReg , 0x400E1274U) /**< \brief (GPIO) Pull-up Enable Register - Set 1 */ +#define REG_GPIO_PUERC1 REG_ACCESS(WoReg , 0x400E1278U) /**< \brief (GPIO) Pull-up Enable Register - Clear 1 */ +#define REG_GPIO_PUERT1 REG_ACCESS(WoReg , 0x400E127CU) /**< \brief (GPIO) Pull-up Enable Register - Toggle 1 */ +#define REG_GPIO_PDER1 REG_ACCESS(RwReg , 0x400E1280U) /**< \brief (GPIO) Pull-down Enable Register 1 */ +#define REG_GPIO_PDERS1 REG_ACCESS(WoReg , 0x400E1284U) /**< \brief (GPIO) Pull-down Enable Register - Set 1 */ +#define REG_GPIO_PDERC1 REG_ACCESS(WoReg , 0x400E1288U) /**< \brief (GPIO) Pull-down Enable Register - Clear 1 */ +#define REG_GPIO_PDERT1 REG_ACCESS(WoReg , 0x400E128CU) /**< \brief (GPIO) Pull-down Enable Register - Toggle 1 */ +#define REG_GPIO_IER1 REG_ACCESS(RwReg , 0x400E1290U) /**< \brief (GPIO) Interrupt Enable Register 1 */ +#define REG_GPIO_IERS1 REG_ACCESS(WoReg , 0x400E1294U) /**< \brief (GPIO) Interrupt Enable Register - Set 1 */ +#define REG_GPIO_IERC1 REG_ACCESS(WoReg , 0x400E1298U) /**< \brief (GPIO) Interrupt Enable Register - Clear 1 */ +#define REG_GPIO_IERT1 REG_ACCESS(WoReg , 0x400E129CU) /**< \brief (GPIO) Interrupt Enable Register - Toggle 1 */ +#define REG_GPIO_IMR01 REG_ACCESS(RwReg , 0x400E12A0U) /**< \brief (GPIO) Interrupt Mode Register 0 1 */ +#define REG_GPIO_IMR0S1 REG_ACCESS(WoReg , 0x400E12A4U) /**< \brief (GPIO) Interrupt Mode Register 0 - Set 1 */ +#define REG_GPIO_IMR0C1 REG_ACCESS(WoReg , 0x400E12A8U) /**< \brief (GPIO) Interrupt Mode Register 0 - Clear 1 */ +#define REG_GPIO_IMR0T1 REG_ACCESS(WoReg , 0x400E12ACU) /**< \brief (GPIO) Interrupt Mode Register 0 - Toggle 1 */ +#define REG_GPIO_IMR11 REG_ACCESS(RwReg , 0x400E12B0U) /**< \brief (GPIO) Interrupt Mode Register 1 1 */ +#define REG_GPIO_IMR1S1 REG_ACCESS(WoReg , 0x400E12B4U) /**< \brief (GPIO) Interrupt Mode Register 1 - Set 1 */ +#define REG_GPIO_IMR1C1 REG_ACCESS(WoReg , 0x400E12B8U) /**< \brief (GPIO) Interrupt Mode Register 1 - Clear 1 */ +#define REG_GPIO_IMR1T1 REG_ACCESS(WoReg , 0x400E12BCU) /**< \brief (GPIO) Interrupt Mode Register 1 - Toggle 1 */ +#define REG_GPIO_GFER1 REG_ACCESS(RwReg , 0x400E12C0U) /**< \brief (GPIO) Glitch Filter Enable Register 1 */ +#define REG_GPIO_GFERS1 REG_ACCESS(WoReg , 0x400E12C4U) /**< \brief (GPIO) Glitch Filter Enable Register - Set 1 */ +#define REG_GPIO_GFERC1 REG_ACCESS(WoReg , 0x400E12C8U) /**< \brief (GPIO) Glitch Filter Enable Register - Clear 1 */ +#define REG_GPIO_GFERT1 REG_ACCESS(WoReg , 0x400E12CCU) /**< \brief (GPIO) Glitch Filter Enable Register - Toggle 1 */ +#define REG_GPIO_IFR1 REG_ACCESS(RoReg , 0x400E12D0U) /**< \brief (GPIO) Interrupt Flag Register 1 */ +#define REG_GPIO_IFRC1 REG_ACCESS(WoReg , 0x400E12D8U) /**< \brief (GPIO) Interrupt Flag Register - Clear 1 */ +#define REG_GPIO_ODMER1 REG_ACCESS(RwReg , 0x400E12E0U) /**< \brief (GPIO) Open Drain Mode Register 1 */ +#define REG_GPIO_ODMERS1 REG_ACCESS(WoReg , 0x400E12E4U) /**< \brief (GPIO) Open Drain Mode Register - Set 1 */ +#define REG_GPIO_ODMERC1 REG_ACCESS(WoReg , 0x400E12E8U) /**< \brief (GPIO) Open Drain Mode Register - Clear 1 */ +#define REG_GPIO_ODMERT1 REG_ACCESS(WoReg , 0x400E12ECU) /**< \brief (GPIO) Open Drain Mode Register - Toggle 1 */ +#define REG_GPIO_ODCR01 REG_ACCESS(RwReg , 0x400E1300U) /**< \brief (GPIO) Output Driving Capability Register 0 1 */ +#define REG_GPIO_ODCR0S1 REG_ACCESS(RwReg , 0x400E1304U) /**< \brief (GPIO) Output Driving Capability Register 0 - Set 1 */ +#define REG_GPIO_ODCR0C1 REG_ACCESS(RwReg , 0x400E1308U) /**< \brief (GPIO) Output Driving Capability Register 0 - Clear 1 */ +#define REG_GPIO_ODCR0T1 REG_ACCESS(RwReg , 0x400E130CU) /**< \brief (GPIO) Output Driving Capability Register 0 - Toggle 1 */ +#define REG_GPIO_ODCR11 REG_ACCESS(RwReg , 0x400E1310U) /**< \brief (GPIO) Output Driving Capability Register 1 1 */ +#define REG_GPIO_ODCR1S1 REG_ACCESS(RwReg , 0x400E1314U) /**< \brief (GPIO) Output Driving Capability Register 1 - Set 1 */ +#define REG_GPIO_ODCR1C1 REG_ACCESS(RwReg , 0x400E1318U) /**< \brief (GPIO) Output Driving Capability Register 1 - Clear 1 */ +#define REG_GPIO_ODCR1T1 REG_ACCESS(RwReg , 0x400E131CU) /**< \brief (GPIO) Output Driving Capability Register 1 - Toggle 1 */ +#define REG_GPIO_OSRR01 REG_ACCESS(RwReg , 0x400E1330U) /**< \brief (GPIO) Output Slew Rate Register 0 1 */ +#define REG_GPIO_OSRR0S1 REG_ACCESS(RwReg , 0x400E1334U) /**< \brief (GPIO) Output Slew Rate Register 0 - Set 1 */ +#define REG_GPIO_OSRR0C1 REG_ACCESS(RwReg , 0x400E1338U) /**< \brief (GPIO) Output Slew Rate Register 0 - Clear 1 */ +#define REG_GPIO_OSRR0T1 REG_ACCESS(RwReg , 0x400E133CU) /**< \brief (GPIO) Output Slew Rate Register 0 - Toggle 1 */ +#define REG_GPIO_STER1 REG_ACCESS(RwReg , 0x400E1360U) /**< \brief (GPIO) Schmitt Trigger Enable Register 1 */ +#define REG_GPIO_STERS1 REG_ACCESS(RwReg , 0x400E1364U) /**< \brief (GPIO) Schmitt Trigger Enable Register - Set 1 */ +#define REG_GPIO_STERC1 REG_ACCESS(RwReg , 0x400E1368U) /**< \brief (GPIO) Schmitt Trigger Enable Register - Clear 1 */ +#define REG_GPIO_STERT1 REG_ACCESS(RwReg , 0x400E136CU) /**< \brief (GPIO) Schmitt Trigger Enable Register - Toggle 1 */ +#define REG_GPIO_EVER1 REG_ACCESS(RwReg , 0x400E1380U) /**< \brief (GPIO) Event Enable Register 1 */ +#define REG_GPIO_EVERS1 REG_ACCESS(WoReg , 0x400E1384U) /**< \brief (GPIO) Event Enable Register - Set 1 */ +#define REG_GPIO_EVERC1 REG_ACCESS(WoReg , 0x400E1388U) /**< \brief (GPIO) Event Enable Register - Clear 1 */ +#define REG_GPIO_EVERT1 REG_ACCESS(WoReg , 0x400E138CU) /**< \brief (GPIO) Event Enable Register - Toggle 1 */ +#define REG_GPIO_LOCK1 REG_ACCESS(RwReg , 0x400E13A0U) /**< \brief (GPIO) Lock Register 1 */ +#define REG_GPIO_LOCKS1 REG_ACCESS(WoReg , 0x400E13A4U) /**< \brief (GPIO) Lock Register - Set 1 */ +#define REG_GPIO_LOCKC1 REG_ACCESS(WoReg , 0x400E13A8U) /**< \brief (GPIO) Lock Register - Clear 1 */ +#define REG_GPIO_LOCKT1 REG_ACCESS(WoReg , 0x400E13ACU) /**< \brief (GPIO) Lock Register - Toggle 1 */ +#define REG_GPIO_UNLOCK1 REG_ACCESS(WoReg , 0x400E13E0U) /**< \brief (GPIO) Unlock Register 1 */ +#define REG_GPIO_ASR1 REG_ACCESS(RwReg , 0x400E13E4U) /**< \brief (GPIO) Access Status Register 1 */ +#define REG_GPIO_PARAMETER1 REG_ACCESS(RoReg , 0x400E13F8U) /**< \brief (GPIO) Parameter Register 1 */ +#define REG_GPIO_VERSION1 REG_ACCESS(RoReg , 0x400E13FCU) /**< \brief (GPIO) Version Register 1 */ +#define REG_GPIO_GPER2 REG_ACCESS(RwReg , 0x400E1400U) /**< \brief (GPIO) GPIO Enable Register 2 */ +#define REG_GPIO_GPERS2 REG_ACCESS(WoReg , 0x400E1404U) /**< \brief (GPIO) GPIO Enable Register - Set 2 */ +#define REG_GPIO_GPERC2 REG_ACCESS(WoReg , 0x400E1408U) /**< \brief (GPIO) GPIO Enable Register - Clear 2 */ +#define REG_GPIO_GPERT2 REG_ACCESS(WoReg , 0x400E140CU) /**< \brief (GPIO) GPIO Enable Register - Toggle 2 */ +#define REG_GPIO_PMR02 REG_ACCESS(RwReg , 0x400E1410U) /**< \brief (GPIO) Peripheral Mux Register 0 2 */ +#define REG_GPIO_PMR0S2 REG_ACCESS(WoReg , 0x400E1414U) /**< \brief (GPIO) Peripheral Mux Register 0 - Set 2 */ +#define REG_GPIO_PMR0C2 REG_ACCESS(WoReg , 0x400E1418U) /**< \brief (GPIO) Peripheral Mux Register 0 - Clear 2 */ +#define REG_GPIO_PMR0T2 REG_ACCESS(WoReg , 0x400E141CU) /**< \brief (GPIO) Peripheral Mux Register 0 - Toggle 2 */ +#define REG_GPIO_PMR12 REG_ACCESS(RwReg , 0x400E1420U) /**< \brief (GPIO) Peripheral Mux Register 1 2 */ +#define REG_GPIO_PMR1S2 REG_ACCESS(WoReg , 0x400E1424U) /**< \brief (GPIO) Peripheral Mux Register 1 - Set 2 */ +#define REG_GPIO_PMR1C2 REG_ACCESS(WoReg , 0x400E1428U) /**< \brief (GPIO) Peripheral Mux Register 1 - Clear 2 */ +#define REG_GPIO_PMR1T2 REG_ACCESS(WoReg , 0x400E142CU) /**< \brief (GPIO) Peripheral Mux Register 1 - Toggle 2 */ +#define REG_GPIO_PMR22 REG_ACCESS(RwReg , 0x400E1430U) /**< \brief (GPIO) Peripheral Mux Register 2 2 */ +#define REG_GPIO_PMR2S2 REG_ACCESS(WoReg , 0x400E1434U) /**< \brief (GPIO) Peripheral Mux Register 2 - Set 2 */ +#define REG_GPIO_PMR2C2 REG_ACCESS(WoReg , 0x400E1438U) /**< \brief (GPIO) Peripheral Mux Register 2 - Clear 2 */ +#define REG_GPIO_PMR2T2 REG_ACCESS(WoReg , 0x400E143CU) /**< \brief (GPIO) Peripheral Mux Register 2 - Toggle 2 */ +#define REG_GPIO_ODER2 REG_ACCESS(RwReg , 0x400E1440U) /**< \brief (GPIO) Output Driver Enable Register 2 */ +#define REG_GPIO_ODERS2 REG_ACCESS(WoReg , 0x400E1444U) /**< \brief (GPIO) Output Driver Enable Register - Set 2 */ +#define REG_GPIO_ODERC2 REG_ACCESS(WoReg , 0x400E1448U) /**< \brief (GPIO) Output Driver Enable Register - Clear 2 */ +#define REG_GPIO_ODERT2 REG_ACCESS(WoReg , 0x400E144CU) /**< \brief (GPIO) Output Driver Enable Register - Toggle 2 */ +#define REG_GPIO_OVR2 REG_ACCESS(RwReg , 0x400E1450U) /**< \brief (GPIO) Output Value Register 2 */ +#define REG_GPIO_OVRS2 REG_ACCESS(WoReg , 0x400E1454U) /**< \brief (GPIO) Output Value Register - Set 2 */ +#define REG_GPIO_OVRC2 REG_ACCESS(WoReg , 0x400E1458U) /**< \brief (GPIO) Output Value Register - Clear 2 */ +#define REG_GPIO_OVRT2 REG_ACCESS(WoReg , 0x400E145CU) /**< \brief (GPIO) Output Value Register - Toggle 2 */ +#define REG_GPIO_PVR2 REG_ACCESS(RoReg , 0x400E1460U) /**< \brief (GPIO) Pin Value Register 2 */ +#define REG_GPIO_PUER2 REG_ACCESS(RwReg , 0x400E1470U) /**< \brief (GPIO) Pull-up Enable Register 2 */ +#define REG_GPIO_PUERS2 REG_ACCESS(WoReg , 0x400E1474U) /**< \brief (GPIO) Pull-up Enable Register - Set 2 */ +#define REG_GPIO_PUERC2 REG_ACCESS(WoReg , 0x400E1478U) /**< \brief (GPIO) Pull-up Enable Register - Clear 2 */ +#define REG_GPIO_PUERT2 REG_ACCESS(WoReg , 0x400E147CU) /**< \brief (GPIO) Pull-up Enable Register - Toggle 2 */ +#define REG_GPIO_PDER2 REG_ACCESS(RwReg , 0x400E1480U) /**< \brief (GPIO) Pull-down Enable Register 2 */ +#define REG_GPIO_PDERS2 REG_ACCESS(WoReg , 0x400E1484U) /**< \brief (GPIO) Pull-down Enable Register - Set 2 */ +#define REG_GPIO_PDERC2 REG_ACCESS(WoReg , 0x400E1488U) /**< \brief (GPIO) Pull-down Enable Register - Clear 2 */ +#define REG_GPIO_PDERT2 REG_ACCESS(WoReg , 0x400E148CU) /**< \brief (GPIO) Pull-down Enable Register - Toggle 2 */ +#define REG_GPIO_IER2 REG_ACCESS(RwReg , 0x400E1490U) /**< \brief (GPIO) Interrupt Enable Register 2 */ +#define REG_GPIO_IERS2 REG_ACCESS(WoReg , 0x400E1494U) /**< \brief (GPIO) Interrupt Enable Register - Set 2 */ +#define REG_GPIO_IERC2 REG_ACCESS(WoReg , 0x400E1498U) /**< \brief (GPIO) Interrupt Enable Register - Clear 2 */ +#define REG_GPIO_IERT2 REG_ACCESS(WoReg , 0x400E149CU) /**< \brief (GPIO) Interrupt Enable Register - Toggle 2 */ +#define REG_GPIO_IMR02 REG_ACCESS(RwReg , 0x400E14A0U) /**< \brief (GPIO) Interrupt Mode Register 0 2 */ +#define REG_GPIO_IMR0S2 REG_ACCESS(WoReg , 0x400E14A4U) /**< \brief (GPIO) Interrupt Mode Register 0 - Set 2 */ +#define REG_GPIO_IMR0C2 REG_ACCESS(WoReg , 0x400E14A8U) /**< \brief (GPIO) Interrupt Mode Register 0 - Clear 2 */ +#define REG_GPIO_IMR0T2 REG_ACCESS(WoReg , 0x400E14ACU) /**< \brief (GPIO) Interrupt Mode Register 0 - Toggle 2 */ +#define REG_GPIO_IMR12 REG_ACCESS(RwReg , 0x400E14B0U) /**< \brief (GPIO) Interrupt Mode Register 1 2 */ +#define REG_GPIO_IMR1S2 REG_ACCESS(WoReg , 0x400E14B4U) /**< \brief (GPIO) Interrupt Mode Register 1 - Set 2 */ +#define REG_GPIO_IMR1C2 REG_ACCESS(WoReg , 0x400E14B8U) /**< \brief (GPIO) Interrupt Mode Register 1 - Clear 2 */ +#define REG_GPIO_IMR1T2 REG_ACCESS(WoReg , 0x400E14BCU) /**< \brief (GPIO) Interrupt Mode Register 1 - Toggle 2 */ +#define REG_GPIO_GFER2 REG_ACCESS(RwReg , 0x400E14C0U) /**< \brief (GPIO) Glitch Filter Enable Register 2 */ +#define REG_GPIO_GFERS2 REG_ACCESS(WoReg , 0x400E14C4U) /**< \brief (GPIO) Glitch Filter Enable Register - Set 2 */ +#define REG_GPIO_GFERC2 REG_ACCESS(WoReg , 0x400E14C8U) /**< \brief (GPIO) Glitch Filter Enable Register - Clear 2 */ +#define REG_GPIO_GFERT2 REG_ACCESS(WoReg , 0x400E14CCU) /**< \brief (GPIO) Glitch Filter Enable Register - Toggle 2 */ +#define REG_GPIO_IFR2 REG_ACCESS(RoReg , 0x400E14D0U) /**< \brief (GPIO) Interrupt Flag Register 2 */ +#define REG_GPIO_IFRC2 REG_ACCESS(WoReg , 0x400E14D8U) /**< \brief (GPIO) Interrupt Flag Register - Clear 2 */ +#define REG_GPIO_ODMER2 REG_ACCESS(RwReg , 0x400E14E0U) /**< \brief (GPIO) Open Drain Mode Register 2 */ +#define REG_GPIO_ODMERS2 REG_ACCESS(WoReg , 0x400E14E4U) /**< \brief (GPIO) Open Drain Mode Register - Set 2 */ +#define REG_GPIO_ODMERC2 REG_ACCESS(WoReg , 0x400E14E8U) /**< \brief (GPIO) Open Drain Mode Register - Clear 2 */ +#define REG_GPIO_ODMERT2 REG_ACCESS(WoReg , 0x400E14ECU) /**< \brief (GPIO) Open Drain Mode Register - Toggle 2 */ +#define REG_GPIO_ODCR02 REG_ACCESS(RwReg , 0x400E1500U) /**< \brief (GPIO) Output Driving Capability Register 0 2 */ +#define REG_GPIO_ODCR0S2 REG_ACCESS(RwReg , 0x400E1504U) /**< \brief (GPIO) Output Driving Capability Register 0 - Set 2 */ +#define REG_GPIO_ODCR0C2 REG_ACCESS(RwReg , 0x400E1508U) /**< \brief (GPIO) Output Driving Capability Register 0 - Clear 2 */ +#define REG_GPIO_ODCR0T2 REG_ACCESS(RwReg , 0x400E150CU) /**< \brief (GPIO) Output Driving Capability Register 0 - Toggle 2 */ +#define REG_GPIO_ODCR12 REG_ACCESS(RwReg , 0x400E1510U) /**< \brief (GPIO) Output Driving Capability Register 1 2 */ +#define REG_GPIO_ODCR1S2 REG_ACCESS(RwReg , 0x400E1514U) /**< \brief (GPIO) Output Driving Capability Register 1 - Set 2 */ +#define REG_GPIO_ODCR1C2 REG_ACCESS(RwReg , 0x400E1518U) /**< \brief (GPIO) Output Driving Capability Register 1 - Clear 2 */ +#define REG_GPIO_ODCR1T2 REG_ACCESS(RwReg , 0x400E151CU) /**< \brief (GPIO) Output Driving Capability Register 1 - Toggle 2 */ +#define REG_GPIO_OSRR02 REG_ACCESS(RwReg , 0x400E1530U) /**< \brief (GPIO) Output Slew Rate Register 0 2 */ +#define REG_GPIO_OSRR0S2 REG_ACCESS(RwReg , 0x400E1534U) /**< \brief (GPIO) Output Slew Rate Register 0 - Set 2 */ +#define REG_GPIO_OSRR0C2 REG_ACCESS(RwReg , 0x400E1538U) /**< \brief (GPIO) Output Slew Rate Register 0 - Clear 2 */ +#define REG_GPIO_OSRR0T2 REG_ACCESS(RwReg , 0x400E153CU) /**< \brief (GPIO) Output Slew Rate Register 0 - Toggle 2 */ +#define REG_GPIO_STER2 REG_ACCESS(RwReg , 0x400E1560U) /**< \brief (GPIO) Schmitt Trigger Enable Register 2 */ +#define REG_GPIO_STERS2 REG_ACCESS(RwReg , 0x400E1564U) /**< \brief (GPIO) Schmitt Trigger Enable Register - Set 2 */ +#define REG_GPIO_STERC2 REG_ACCESS(RwReg , 0x400E1568U) /**< \brief (GPIO) Schmitt Trigger Enable Register - Clear 2 */ +#define REG_GPIO_STERT2 REG_ACCESS(RwReg , 0x400E156CU) /**< \brief (GPIO) Schmitt Trigger Enable Register - Toggle 2 */ +#define REG_GPIO_EVER2 REG_ACCESS(RwReg , 0x400E1580U) /**< \brief (GPIO) Event Enable Register 2 */ +#define REG_GPIO_EVERS2 REG_ACCESS(WoReg , 0x400E1584U) /**< \brief (GPIO) Event Enable Register - Set 2 */ +#define REG_GPIO_EVERC2 REG_ACCESS(WoReg , 0x400E1588U) /**< \brief (GPIO) Event Enable Register - Clear 2 */ +#define REG_GPIO_EVERT2 REG_ACCESS(WoReg , 0x400E158CU) /**< \brief (GPIO) Event Enable Register - Toggle 2 */ +#define REG_GPIO_LOCK2 REG_ACCESS(RwReg , 0x400E15A0U) /**< \brief (GPIO) Lock Register 2 */ +#define REG_GPIO_LOCKS2 REG_ACCESS(WoReg , 0x400E15A4U) /**< \brief (GPIO) Lock Register - Set 2 */ +#define REG_GPIO_LOCKC2 REG_ACCESS(WoReg , 0x400E15A8U) /**< \brief (GPIO) Lock Register - Clear 2 */ +#define REG_GPIO_LOCKT2 REG_ACCESS(WoReg , 0x400E15ACU) /**< \brief (GPIO) Lock Register - Toggle 2 */ +#define REG_GPIO_UNLOCK2 REG_ACCESS(WoReg , 0x400E15E0U) /**< \brief (GPIO) Unlock Register 2 */ +#define REG_GPIO_ASR2 REG_ACCESS(RwReg , 0x400E15E4U) /**< \brief (GPIO) Access Status Register 2 */ +#define REG_GPIO_PARAMETER2 REG_ACCESS(RoReg , 0x400E15F8U) /**< \brief (GPIO) Parameter Register 2 */ +#define REG_GPIO_VERSION2 REG_ACCESS(RoReg , 0x400E15FCU) /**< \brief (GPIO) Version Register 2 */ +/* ========== Register definition for BPM peripheral ========== */ +#define REG_BPM_IER REG_ACCESS(WoReg , 0x400F0000U) /**< \brief (BPM) Interrupt Enable Register */ +#define REG_BPM_IDR REG_ACCESS(WoReg , 0x400F0004U) /**< \brief (BPM) Interrupt Disable Register */ +#define REG_BPM_IMR REG_ACCESS(RoReg , 0x400F0008U) /**< \brief (BPM) Interrupt Mask Register */ +#define REG_BPM_ISR REG_ACCESS(RoReg , 0x400F000CU) /**< \brief (BPM) Interrupt Status Register */ +#define REG_BPM_ICR REG_ACCESS(WoReg , 0x400F0010U) /**< \brief (BPM) Interrupt Clear Register */ +#define REG_BPM_SR REG_ACCESS(RoReg , 0x400F0014U) /**< \brief (BPM) Status Register */ +#define REG_BPM_UNLOCK REG_ACCESS(WoReg , 0x400F0018U) /**< \brief (BPM) Unlock Register */ +#define REG_BPM_PMCON REG_ACCESS(RwReg , 0x400F001CU) /**< \brief (BPM) Power Mode Control Register */ +#define REG_BPM_BKUPWCAUSE REG_ACCESS(RoReg , 0x400F0028U) /**< \brief (BPM) Backup Wake up Cause Register */ +#define REG_BPM_BKUPWEN REG_ACCESS(RwReg , 0x400F002CU) /**< \brief (BPM) Backup Wake up Enable Register */ +#define REG_BPM_BKUPPMUX REG_ACCESS(RwReg , 0x400F0030U) /**< \brief (BPM) Backup Pin Muxing Register */ +#define REG_BPM_IORET REG_ACCESS(RwReg , 0x400F0034U) /**< \brief (BPM) Input Output Retention Register */ +#define REG_BPM_BPR REG_ACCESS(RwReg , 0x400F0040U) /**< \brief (BPM) Bypass Register */ +#define REG_BPM_FWRUNPS REG_ACCESS(RoReg , 0x400F0044U) /**< \brief (BPM) Factory Word Run PS Register */ +#define REG_BPM_FWPSAVEPS REG_ACCESS(RoReg , 0x400F0048U) /**< \brief (BPM) Factory Word Power Save PS Register */ +#define REG_BPM_VERSION REG_ACCESS(RoReg , 0x400F00FCU) /**< \brief (BPM) Version Register */ +/* ========== Register definition for BSCIF peripheral ========== */ +#define REG_BSCIF_IER REG_ACCESS(WoReg , 0x400F0400U) /**< \brief (BSCIF) Interrupt Enable Register */ +#define REG_BSCIF_IDR REG_ACCESS(WoReg , 0x400F0404U) /**< \brief (BSCIF) Interrupt Disable Register */ +#define REG_BSCIF_IMR REG_ACCESS(RoReg , 0x400F0408U) /**< \brief (BSCIF) Interrupt Mask Register */ +#define REG_BSCIF_ISR REG_ACCESS(RoReg , 0x400F040CU) /**< \brief (BSCIF) Interrupt Status Register */ +#define REG_BSCIF_ICR REG_ACCESS(WoReg , 0x400F0410U) /**< \brief (BSCIF) Interrupt Clear Register */ +#define REG_BSCIF_PCLKSR REG_ACCESS(RoReg , 0x400F0414U) /**< \brief (BSCIF) Power and Clocks Status Register */ +#define REG_BSCIF_UNLOCK REG_ACCESS(WoReg , 0x400F0418U) /**< \brief (BSCIF) Unlock Register */ +#define REG_BSCIF_CSCR REG_ACCESS(RwReg , 0x400F041CU) /**< \brief (BSCIF) Chip Specific Configuration Register */ +#define REG_BSCIF_OSCCTRL32 REG_ACCESS(RwReg , 0x400F0420U) /**< \brief (BSCIF) Oscillator 32 Control Register */ +#define REG_BSCIF_RC32KCR REG_ACCESS(RwReg , 0x400F0424U) /**< \brief (BSCIF) 32 kHz RC Oscillator Control Register */ +#define REG_BSCIF_RC32KTUNE REG_ACCESS(RwReg , 0x400F0428U) /**< \brief (BSCIF) 32kHz RC Oscillator Tuning Register */ +#define REG_BSCIF_BOD33CTRL REG_ACCESS(RwReg , 0x400F042CU) /**< \brief (BSCIF) BOD33 Control Register */ +#define REG_BSCIF_BOD33LEVEL REG_ACCESS(RwReg , 0x400F0430U) /**< \brief (BSCIF) BOD33 Level Register */ +#define REG_BSCIF_BOD33SAMPLING REG_ACCESS(RwReg , 0x400F0434U) /**< \brief (BSCIF) BOD33 Sampling Control Register */ +#define REG_BSCIF_BOD18CTRL REG_ACCESS(RwReg , 0x400F0438U) /**< \brief (BSCIF) BOD18 Control Register */ +#define REG_BSCIF_BOD18LEVEL REG_ACCESS(RwReg , 0x400F043CU) /**< \brief (BSCIF) BOD18 Level Register */ +#define REG_BSCIF_VREGCR REG_ACCESS(RwReg , 0x400F0444U) /**< \brief (BSCIF) Voltage Regulator Configuration Register */ +#define REG_BSCIF_VREGNCSR REG_ACCESS(RwReg , 0x400F044CU) /**< \brief (BSCIF) Normal Mode Control and Status Register */ +#define REG_BSCIF_VREGLPCSR REG_ACCESS(RwReg , 0x400F0450U) /**< \brief (BSCIF) LP Mode Control and Status Register */ +#define REG_BSCIF_RC1MCR REG_ACCESS(RwReg , 0x400F0458U) /**< \brief (BSCIF) 1MHz RC Clock Configuration Register */ +#define REG_BSCIF_BGCR REG_ACCESS(RwReg , 0x400F045CU) /**< \brief (BSCIF) Bandgap Calibration Register */ +#define REG_BSCIF_BGCTRL REG_ACCESS(RwReg , 0x400F0460U) /**< \brief (BSCIF) Bandgap Control Register */ +#define REG_BSCIF_BGSR REG_ACCESS(RoReg , 0x400F0464U) /**< \brief (BSCIF) Bandgap Status Register */ +#define REG_BSCIF_BR0 REG_ACCESS(RwReg , 0x400F0478U) /**< \brief (BSCIF) Backup Register 0 */ +#define REG_BSCIF_BR1 REG_ACCESS(RwReg , 0x400F047CU) /**< \brief (BSCIF) Backup Register 1 */ +#define REG_BSCIF_BR2 REG_ACCESS(RwReg , 0x400F0480U) /**< \brief (BSCIF) Backup Register 2 */ +#define REG_BSCIF_BR3 REG_ACCESS(RwReg , 0x400F0484U) /**< \brief (BSCIF) Backup Register 3 */ +#define REG_BSCIF_BRIFBVERSION REG_ACCESS(RoReg , 0x400F07E4U) /**< \brief (BSCIF) Backup Register Interface Version Register */ +#define REG_BSCIF_BGREFIFBVERSION REG_ACCESS(RoReg , 0x400F07E8U) /**< \brief (BSCIF) BGREFIFB Version Register */ +#define REG_BSCIF_VREGIFGVERSION REG_ACCESS(RoReg , 0x400F07ECU) /**< \brief (BSCIF) VREGIFA Version Register */ +#define REG_BSCIF_BODIFCVERSION REG_ACCESS(RoReg , 0x400F07F0U) /**< \brief (BSCIF) BODIFC Version Register */ +#define REG_BSCIF_RC32KIFBVERSION REG_ACCESS(RoReg , 0x400F07F4U) /**< \brief (BSCIF) 32 kHz RC Oscillator Version Register */ +#define REG_BSCIF_OSC32IFAVERSION REG_ACCESS(RoReg , 0x400F07F8U) /**< \brief (BSCIF) 32 KHz Oscillator Version Register */ +#define REG_BSCIF_VERSION REG_ACCESS(RoReg , 0x400F07FCU) /**< \brief (BSCIF) BSCIF Version Register */ +/* ========== Register definition for AST peripheral ========== */ +#define REG_AST_CR REG_ACCESS(RwReg , 0x400F0800U) /**< \brief (AST) Control Register */ +#define REG_AST_CV REG_ACCESS(RwReg , 0x400F0804U) /**< \brief (AST) Counter Value */ +#define REG_AST_SR REG_ACCESS(RoReg , 0x400F0808U) /**< \brief (AST) Status Register */ +#define REG_AST_SCR REG_ACCESS(WoReg , 0x400F080CU) /**< \brief (AST) Status Clear Register */ +#define REG_AST_IER REG_ACCESS(WoReg , 0x400F0810U) /**< \brief (AST) Interrupt Enable Register */ +#define REG_AST_IDR REG_ACCESS(WoReg , 0x400F0814U) /**< \brief (AST) Interrupt Disable Register */ +#define REG_AST_IMR REG_ACCESS(RoReg , 0x400F0818U) /**< \brief (AST) Interrupt Mask Register */ +#define REG_AST_WER REG_ACCESS(RwReg , 0x400F081CU) /**< \brief (AST) Wake Enable Register */ +#define REG_AST_AR0 REG_ACCESS(RwReg , 0x400F0820U) /**< \brief (AST) Alarm Register 0 */ +#define REG_AST_AR1 REG_ACCESS(RwReg , 0x400F0824U) /**< \brief (AST) Alarm Register 1 */ +#define REG_AST_PIR0 REG_ACCESS(RwReg , 0x400F0830U) /**< \brief (AST) Periodic Interval Register 0 */ +#define REG_AST_PIR1 REG_ACCESS(RwReg , 0x400F0834U) /**< \brief (AST) Periodic Interval Register 1 */ +#define REG_AST_CLOCK REG_ACCESS(RwReg , 0x400F0840U) /**< \brief (AST) Clock Control Register */ +#define REG_AST_DTR REG_ACCESS(RwReg , 0x400F0844U) /**< \brief (AST) Digital Tuner Register */ +#define REG_AST_EVE REG_ACCESS(WoReg , 0x400F0848U) /**< \brief (AST) Event Enable Register */ +#define REG_AST_EVD REG_ACCESS(WoReg , 0x400F084CU) /**< \brief (AST) Event Disable Register */ +#define REG_AST_EVM REG_ACCESS(RoReg , 0x400F0850U) /**< \brief (AST) Event Mask Register */ +#define REG_AST_CALV REG_ACCESS(RwReg , 0x400F0854U) /**< \brief (AST) Calendar Value */ +#define REG_AST_PARAMETER REG_ACCESS(RoReg , 0x400F08F0U) /**< \brief (AST) Parameter Register */ +#define REG_AST_VERSION REG_ACCESS(RoReg , 0x400F08FCU) /**< \brief (AST) Version Register */ +/* ========== Register definition for WDT peripheral ========== */ +#define REG_WDT_CTRL REG_ACCESS(RwReg , 0x400F0C00U) /**< \brief (WDT) Control Register */ +#define REG_WDT_CLR REG_ACCESS(WoReg , 0x400F0C04U) /**< \brief (WDT) Clear Register */ +#define REG_WDT_SR REG_ACCESS(RoReg , 0x400F0C08U) /**< \brief (WDT) Status Register */ +#define REG_WDT_IER REG_ACCESS(WoReg , 0x400F0C0CU) /**< \brief (WDT) Interrupt Enable Register */ +#define REG_WDT_IDR REG_ACCESS(WoReg , 0x400F0C10U) /**< \brief (WDT) Interrupt Disable Register */ +#define REG_WDT_IMR REG_ACCESS(RoReg , 0x400F0C14U) /**< \brief (WDT) Interrupt Mask Register */ +#define REG_WDT_ISR REG_ACCESS(RoReg , 0x400F0C18U) /**< \brief (WDT) Interrupt Status Register */ +#define REG_WDT_ICR REG_ACCESS(WoReg , 0x400F0C1CU) /**< \brief (WDT) Interrupt Clear Register */ +#define REG_WDT_VERSION REG_ACCESS(RoReg , 0x400F0FFCU) /**< \brief (WDT) Version Register */ +/* ========== Register definition for EIC peripheral ========== */ +#define REG_EIC_IER REG_ACCESS(WoReg , 0x400F1000U) /**< \brief (EIC) Interrupt Enable Register */ +#define REG_EIC_IDR REG_ACCESS(WoReg , 0x400F1004U) /**< \brief (EIC) Interrupt Disable Register */ +#define REG_EIC_IMR REG_ACCESS(RoReg , 0x400F1008U) /**< \brief (EIC) Interrupt Mask Register */ +#define REG_EIC_ISR REG_ACCESS(RoReg , 0x400F100CU) /**< \brief (EIC) Interrupt Status Register */ +#define REG_EIC_ICR REG_ACCESS(WoReg , 0x400F1010U) /**< \brief (EIC) Interrupt Clear Register */ +#define REG_EIC_MODE REG_ACCESS(RwReg , 0x400F1014U) /**< \brief (EIC) Mode Register */ +#define REG_EIC_EDGE REG_ACCESS(RwReg , 0x400F1018U) /**< \brief (EIC) Edge Register */ +#define REG_EIC_LEVEL REG_ACCESS(RwReg , 0x400F101CU) /**< \brief (EIC) Level Register */ +#define REG_EIC_FILTER REG_ACCESS(RwReg , 0x400F1020U) /**< \brief (EIC) Filter Register */ +#define REG_EIC_ASYNC REG_ACCESS(RwReg , 0x400F1028U) /**< \brief (EIC) Asynchronous Register */ +#define REG_EIC_EN REG_ACCESS(WoReg , 0x400F1030U) /**< \brief (EIC) Enable Register */ +#define REG_EIC_DIS REG_ACCESS(WoReg , 0x400F1034U) /**< \brief (EIC) Disable Register */ +#define REG_EIC_CTRL REG_ACCESS(RoReg , 0x400F1038U) /**< \brief (EIC) Control Register */ +#define REG_EIC_VERSION REG_ACCESS(RoReg , 0x400F13FCU) /**< \brief (EIC) Version Register */ +/* ========== Register definition for PICOUART peripheral ========== */ +#define REG_PICOUART_CR REG_ACCESS(WoReg , 0x400F1400U) /**< \brief (PICOUART) Control Register */ +#define REG_PICOUART_CFG REG_ACCESS(RwReg , 0x400F1404U) /**< \brief (PICOUART) Configuration Register */ +#define REG_PICOUART_SR REG_ACCESS(RoReg , 0x400F1408U) /**< \brief (PICOUART) Status Register */ +#define REG_PICOUART_RHR REG_ACCESS(RoReg , 0x400F140CU) /**< \brief (PICOUART) Receive Holding Register */ +#define REG_PICOUART_VERSION REG_ACCESS(RoReg , 0x400F1420U) /**< \brief (PICOUART) Version Register */ +/*@}*/ + +/* ************************************************************************** */ +/** NUMBER OF PERIPHERAL INSTANCES FOR SAM4L */ +/* ************************************************************************** */ +/** \addtogroup SAM4L_inst_num Number of Peripheral Instances */ +/*@{*/ + +#define ABDACB_INST_NUM 1 /**< \brief Audio Bitstream DAC instances */ +#define ACIFC_INST_NUM 1 /**< \brief Analog Comparator Interface instances */ +#define ADCIFE_INST_NUM 1 /**< \brief ADC controller interface instances */ +#define AESA_INST_NUM 1 /**< \brief Advanced Encryption Standard instances */ +#define AST_INST_NUM 1 /**< \brief Asynchronous Timer instances */ +#define BPM_INST_NUM 1 /**< \brief Backup Power Manager instances */ +#define BSCIF_INST_NUM 1 /**< \brief Backup System Control Interface instances */ +#define CATB_INST_NUM 1 /**< \brief Capacitive Touch Module B instances */ +#define CHIPID_INST_NUM 1 /**< \brief Chip ID Registers instances */ +#define CRCCU_INST_NUM 1 /**< \brief CRC Calculation Unit instances */ +#define DACC_INST_NUM 1 /**< \brief DAC Controller instances */ +#define EIC_INST_NUM 1 /**< \brief External Interrupt Controller instances */ +#define FLASHCALW_INST_NUM 1 /**< \brief Flash Controller instances */ +#define FREQM_INST_NUM 1 /**< \brief Frequency Meter instances */ +#define GLOC_INST_NUM 1 /**< \brief Glue Logic Controller instances */ +#define GPIO_INST_NUM 1 /**< \brief General-Purpose Input/Output Controller instances */ +#define HCACHE_INST_NUM 1 /**< \brief Cortex M I&D Cache Controller instances */ +#define HMATRIXB_INST_NUM 1 /**< \brief HSB Matrix instances */ +#define IISC_INST_NUM 1 /**< \brief Inter-IC Sound (I2S) Controller instances */ +#define LCDCA_INST_NUM 1 /**< \brief LCD Controller instances */ +#define PARC_INST_NUM 1 /**< \brief Parallel Capture instances */ +#define PDCA_INST_NUM 1 /**< \brief Peripheral DMA Controller instances */ +#define PEVC_INST_NUM 1 /**< \brief Peripheral Event Controller instances */ +#define PICOUART_INST_NUM 1 /**< \brief Pico UART instances */ +#define PM_INST_NUM 1 /**< \brief Power Manager instances */ +#define SCIF_INST_NUM 1 /**< \brief System Control Interface instances */ +#define SMAP_INST_NUM 1 /**< \brief System Manager Access Port instances */ +#define SPI_INST_NUM 1 /**< \brief Serial Peripheral Interface instances */ +#define TC_INST_NUM 2 /**< \brief Timer/Counter instances */ +#define TRNG_INST_NUM 1 /**< \brief True Random Number Generator instances */ +#define TWIM_INST_NUM 4 /**< \brief Two-wire Master Interface instances */ +#define TWIS_INST_NUM 2 /**< \brief Two-wire Slave Interface instances */ +#define USART_INST_NUM 4 /**< \brief Universal Synchronous Asynchronous Receiver Transmitter instances */ +#define USBC_INST_NUM 1 /**< \brief USB 2.0 Interface instances */ +#define WDT_INST_NUM 1 /**< \brief Watchdog Timer instances */ +/*@}*/ + +/* ************************************************************************** */ +/** PERIPHERAL ID DEFINITIONS FOR SAM4L */ +/* ************************************************************************** */ +/** \addtogroup SAM4L_id Peripheral Ids Definitions */ +/*@{*/ + +#define ID_IISC ( 0) /**< \brief Inter-IC Sound (I2S) Controller (IISC) */ +#define ID_SPI ( 1) /**< \brief Serial Peripheral Interface (SPI) */ +#define ID_TC0 ( 2) /**< \brief Timer/Counter TC (TC0) */ +#define ID_TC1 ( 3) /**< \brief Timer/Counter TC (TC1) */ +#define ID_TWIM0 ( 4) /**< \brief Two-wire Master Interface TWIM (TWIM0) */ +#define ID_TWIS0 ( 5) /**< \brief Two-wire Slave Interface TWIS (TWIS0) */ +#define ID_TWIM1 ( 6) /**< \brief Two-wire Master Interface TWIM (TWIM1) */ +#define ID_TWIS1 ( 7) /**< \brief Two-wire Slave Interface TWIS (TWIS1) */ +#define ID_USART0 ( 8) /**< \brief Universal Synchronous Asynchronous Receiver Transmitter USART (USART0) */ +#define ID_USART1 ( 9) /**< \brief Universal Synchronous Asynchronous Receiver Transmitter USART (USART1) */ +#define ID_USART2 (10) /**< \brief Universal Synchronous Asynchronous Receiver Transmitter USART (USART2) */ +#define ID_USART3 (11) /**< \brief Universal Synchronous Asynchronous Receiver Transmitter USART (USART3) */ +#define ID_ADCIFE (12) /**< \brief ADC controller interface (ADCIFE) */ +#define ID_DACC (13) /**< \brief DAC Controller (DACC) */ +#define ID_ACIFC (14) /**< \brief Analog Comparator Interface (ACIFC) */ +#define ID_GLOC (15) /**< \brief Glue Logic Controller (GLOC) */ +#define ID_ABDACB (16) /**< \brief Audio Bitstream DAC (ABDACB) */ +#define ID_TRNG (17) /**< \brief True Random Number Generator (TRNG) */ +#define ID_PARC (18) /**< \brief Parallel Capture (PARC) */ +#define ID_CATB (19) /**< \brief Capacitive Touch Module B (CATB) */ +#define ID_TWIM2 (20) /**< \brief Two-wire Master Interface TWIM (TWIM2) */ +#define ID_TWIM3 (21) /**< \brief Two-wire Master Interface TWIM (TWIM3) */ +#define ID_LCDCA (22) /**< \brief LCD Controller (LCDCA) */ +#define ID_HFLASHC (23) /**< \brief Flash Controller (HFLASHC) */ +#define ID_HCACHE (24) /**< \brief Cortex M I&D Cache Controller (HCACHE) */ +#define ID_HMATRIX (25) /**< \brief HSB Matrix (HMATRIX) */ +#define ID_PDCA (26) /**< \brief Peripheral DMA Controller (PDCA) */ +#define ID_SMAP (27) /**< \brief System Manager Access Port (SMAP) */ +#define ID_CRCCU (28) /**< \brief CRC Calculation Unit (CRCCU) */ +#define ID_USBC (29) /**< \brief USB 2.0 Interface (USBC) */ +#define ID_PEVC (30) /**< \brief Peripheral Event Controller (PEVC) */ +#define ID_AESA (31) /**< \brief Advanced Encryption Standard (AESA) */ +#define ID_PM (32) /**< \brief Power Manager (PM) */ +#define ID_CHIPID (33) /**< \brief Chip ID Registers (CHIPID) */ +#define ID_SCIF (34) /**< \brief System Control Interface (SCIF) */ +#define ID_FREQM (35) /**< \brief Frequency Meter (FREQM) */ +#define ID_GPIO (36) /**< \brief General-Purpose Input/Output Controller (GPIO) */ +#define ID_BPM (37) /**< \brief Backup Power Manager (BPM) */ +#define ID_BSCIF (38) /**< \brief Backup System Control Interface (BSCIF) */ +#define ID_AST (39) /**< \brief Asynchronous Timer (AST) */ +#define ID_WDT (40) /**< \brief Watchdog Timer (WDT) */ +#define ID_EIC (41) /**< \brief External Interrupt Controller (EIC) */ +#define ID_PICOUART (42) /**< \brief Pico UART (PICOUART) */ +/*@}*/ + +/* ************************************************************************** */ +/** BASE ADDRESS DEFINITIONS FOR SAM4L */ +/* ************************************************************************** */ +/** \addtogroup SAM4L_base Peripheral Base Address Definitions */ +/*@{*/ + +#define ABDACB_ADDR (0x40064000U) /**< \brief (ABDACB) Base Address */ +#define ABDACB CAST(Abdacb, ABDACB_ADDR) +#define ACIFC_ADDR (0x40040000U) /**< \brief (ACIFC) Base Address */ +#define ACIFC CAST(Acifc, ACIFC_ADDR) +#define ADCIFE_ADDR (0x40038000U) /**< \brief (ADCIFE) Base Address */ +#define ADCIFE CAST(Adcife, ADCIFE_ADDR) +#define AESA_ADDR (0x400B0000U) /**< \brief (AESA) Base Address */ +#define AESA CAST(Aesa, AESA_ADDR) +#define AST_ADDR (0x400F0800U) /**< \brief (AST) Base Address */ +#define AST CAST(Ast, AST_ADDR) +#define BPM_ADDR (0x400F0000U) /**< \brief (BPM) Base Address */ +#define BPM CAST(Bpm, BPM_ADDR) +#define BSCIF_ADDR (0x400F0400U) /**< \brief (BSCIF) Base Address */ +#define BSCIF CAST(Bscif, BSCIF_ADDR) +#define CATB_ADDR (0x40070000U) /**< \brief (CATB) Base Address */ +#define CATB CAST(Catb, CATB_ADDR) +#define CHIPID_ADDR (0x400E0400U) /**< \brief (CHIPID) Base Address */ +#define CHIPID CAST(Chipid, CHIPID_ADDR) +#define CRCCU_ADDR (0x400A4000U) /**< \brief (CRCCU) Base Address */ +#define CRCCU CAST(Crccu, CRCCU_ADDR) +#define DACC_ADDR (0x4003C000U) /**< \brief (DACC) Base Address */ +#define DACC CAST(Dacc, DACC_ADDR) +#define EIC_ADDR (0x400F1000U) /**< \brief (EIC) Base Address */ +#define EIC CAST(Eic, EIC_ADDR) +#define HFLASHC_ADDR (0x400A0000U) /**< \brief (HFLASHC) Base Address */ +#define HFLASHC CAST(Flashcalw, HFLASHC_ADDR) +#define FREQM_ADDR (0x400E0C00U) /**< \brief (FREQM) Base Address */ +#define FREQM CAST(Freqm, FREQM_ADDR) +#define GLOC_ADDR (0x40060000U) /**< \brief (GLOC) Base Address */ +#define GLOC CAST(Gloc, GLOC_ADDR) +#define GPIO_ADDR (0x400E1000U) /**< \brief (GPIO) Base Address */ +#define GPIO CAST(Gpio, GPIO_ADDR) +#define HCACHE_ADDR (0x400A0400U) /**< \brief (HCACHE) Base Address */ +#define HCACHE CAST(Hcache, HCACHE_ADDR) +#define HMATRIX_ADDR (0x400A1000U) /**< \brief (HMATRIX) Base Address */ +#define HMATRIX CAST(Hmatrixb, HMATRIX_ADDR) +#define IISC_ADDR (0x40004000U) /**< \brief (IISC) Base Address */ +#define IISC CAST(Iisc, IISC_ADDR) +#define LCDCA_ADDR (0x40080000U) /**< \brief (LCDCA) Base Address */ +#define LCDCA CAST(Lcdca, LCDCA_ADDR) +#define PARC_ADDR (0x4006C000U) /**< \brief (PARC) Base Address */ +#define PARC CAST(Parc, PARC_ADDR) +#define PDCA_ADDR (0x400A2000U) /**< \brief (PDCA) Base Address */ +#define PDCA CAST(Pdca, PDCA_ADDR) +#define PEVC_ADDR (0x400A6000U) /**< \brief (PEVC) Base Address */ +#define PEVC CAST(Pevc, PEVC_ADDR) +#define PICOUART_ADDR (0x400F1400U) /**< \brief (PICOUART) Base Address */ +#define PICOUART CAST(Picouart, PICOUART_ADDR) +#define PM_ADDR (0x400E0000U) /**< \brief (PM) Base Address */ +#define PM CAST(Pm, PM_ADDR) +#define SCIF_ADDR (0x400E0800U) /**< \brief (SCIF) Base Address */ +#define SCIF CAST(Scif, SCIF_ADDR) +#define SMAP_ADDR (0x400A3000U) /**< \brief (SMAP) Base Address */ +#define SMAP CAST(Smap, SMAP_ADDR) +#define SPI_ADDR (0x40008000U) /**< \brief (SPI) Base Address */ +#define SPI CAST(Spi, SPI_ADDR) +#define TC0_ADDR (0x40010000U) /**< \brief (TC0) Base Address */ +#define TC0 CAST(Tc, TC0_ADDR) +#define TC1_ADDR (0x40014000U) /**< \brief (TC1) Base Address */ +#define TC1 CAST(Tc, TC1_ADDR) +#define TRNG_ADDR (0x40068000U) /**< \brief (TRNG) Base Address */ +#define TRNG CAST(Trng, TRNG_ADDR) +#define TWIM0_ADDR (0x40018000U) /**< \brief (TWIM0) Base Address */ +#define TWIM0 CAST(Twim, TWIM0_ADDR) +#define TWIM1_ADDR (0x4001C000U) /**< \brief (TWIM1) Base Address */ +#define TWIM1 CAST(Twim, TWIM1_ADDR) +#define TWIM2_ADDR (0x40078000U) /**< \brief (TWIM2) Base Address */ +#define TWIM2 CAST(Twim, TWIM2_ADDR) +#define TWIM3_ADDR (0x4007C000U) /**< \brief (TWIM3) Base Address */ +#define TWIM3 CAST(Twim, TWIM3_ADDR) +#define TWIS0_ADDR (0x40018400U) /**< \brief (TWIS0) Base Address */ +#define TWIS0 CAST(Twis, TWIS0_ADDR) +#define TWIS1_ADDR (0x4001C400U) /**< \brief (TWIS1) Base Address */ +#define TWIS1 CAST(Twis, TWIS1_ADDR) +#define USART0_ADDR (0x40024000U) /**< \brief (USART0) Base Address */ +#define USART0 CAST(Usart, USART0_ADDR) +#define USART1_ADDR (0x40028000U) /**< \brief (USART1) Base Address */ +#define USART1 CAST(Usart, USART1_ADDR) +#define USART2_ADDR (0x4002C000U) /**< \brief (USART2) Base Address */ +#define USART2 CAST(Usart, USART2_ADDR) +#define USART3_ADDR (0x40030000U) /**< \brief (USART3) Base Address */ +#define USART3 CAST(Usart, USART3_ADDR) +#define USBC_ADDR (0x400A5000U) /**< \brief (USBC) Base Address */ +#define USBC CAST(Usbc, USBC_ADDR) +#define WDT_ADDR (0x400F0C00U) /**< \brief (WDT) Base Address */ +#define WDT CAST(Wdt, WDT_ADDR) +/*@}*/ + +/* ************************************************************************** */ +/** INSTANCE PARAMETERS DEFINITIONS FOR SAM4L */ +/* ************************************************************************** */ +/** \addtogroup SAM4L_parameters Instance Parameters Definitions */ +/*@{*/ + +/* ========== Instance parameters for ABDACB peripheral ========== */ +#define ABDACB_GCLK_NUM 6 +#define ABDACB_PDCA_ID_TX_CH0 31 +#define ABDACB_PDCA_ID_TX_CH1 32 +/* ========== Instance parameters for ADCIFE peripheral ========== */ +#define ADCIFE_CHANNELS 16 +#define ADCIFE_CHANNEL_MSB 15 +#define ADCIFE_EXT_TRIGGERS_MSB 0 +#define ADCIFE_GCLK_NUM 10 +#define ADCIFE_PDCA_ID_RX 11 +#define ADCIFE_PDCA_ID_TX 29 +#define ADCIFE_REG_RX LCV +#define ADCIFE_REG_TX CDMA +/* ========== Instance parameters for AESA peripheral ========== */ +#define AESA_DMAC_ID_RX +#define AESA_DMAC_ID_TX +#define AESA_GCLK_NUM 4 +#define AESA_PDCA_ID_RX 17 +#define AESA_PDCA_ID_TX 36 +/* ========== Instance parameters for AST peripheral ========== */ +#define AST_CLK1K 4 +#define AST_CLK32 1 +#define AST_GCLK_NUM 2 +#define AST_GENCLK 3 +#define AST_PB 2 +#define AST_RCOSC 0 +/* ========== Instance parameters for BPM peripheral ========== */ +#define BPM_BKUPPMUX_MSB 9 +#define BPM_BKUPWEN_AST 1 +#define BPM_BKUPWEN_BOD18 4 +#define BPM_BKUPWEN_BOD33 3 +#define BPM_BKUPWEN_EIC 0 +#define BPM_BKUPWEN_MSB 5 +#define BPM_BKUPWEN_PICOUART 5 +#define BPM_BKUPWEN_WDT 2 +/* ========== Instance parameters for BSCIF peripheral ========== */ +#define BSCIF_BGBUF_NUM 6 +#define BSCIF_BOD18_IMPLEMENTED 0 +#define BSCIF_BOD33_IMPLEMENTED 0 +#define BSCIF_BOD50_IMPLEMENTED 0 +#define BSCIF_BR_NUM 4 +/* ========== Instance parameters for CATB peripheral ========== */ +#define CATB_GCLK_NUM 3 +#define CATB_PDCA_ID_RX 12 +#define CATB_PDCA_ID_TX 30 +#define CATB_SENSORS_MSB 31 +#define CATB_STATUS_REG_NUMBER 1 +/* ========== Instance parameters for DACC peripheral ========== */ +#define DACC_DACC_EXT_TRIG_MSB 0 +#define DACC_DAC_RES_MSB 9 +#define DACC_PDCA_ID_TX 35 +/* ========== Instance parameters for EIC peripheral ========== */ +#define EIC_STD_NUM 8 +/* ========== Instance parameters for FREQM peripheral ========== */ +#define FREQM_CPU 0 +#define FREQM_CRIPOSC 10 +#define FREQM_DFLL0 9 +#define FREQM_FLO_JITTER 27 +#define FREQM_GENCLK0 11 +#define FREQM_GENCLK1 12 +#define FREQM_GENCLK2 13 +#define FREQM_GENCLK3 14 +#define FREQM_GENCLK4 15 +#define FREQM_GENCLK5 16 +#define FREQM_GENCLK6 17 +#define FREQM_GENCLK7 18 +#define FREQM_GENCLK8 19 +#define FREQM_GENCLK9 20 +#define FREQM_GENCLK10 21 +#define FREQM_HSB 1 +#define FREQM_NUM_CLK 28 +#define FREQM_NUM_REF_CLK 4 +#define FREQM_OSC0 6 +#define FREQM_OSC32 7 +#define FREQM_PBA 2 +#define FREQM_PBB 3 +#define FREQM_PBC 4 +#define FREQM_PLL0 26 +#define FREQM_RCFAST 24 +#define FREQM_RCOSC 8 +#define FREQM_RC1M 25 +#define FREQM_RC32K 7 +#define FREQM_RC80M 23 +#define FREQM_REFSEL_BITS 2 +#define FREQM_REF_OSC32 1 +#define FREQM_REF_RCOSC 0 +/* ========== Instance parameters for GLOC peripheral ========== */ +#define GLOC_GCLK_NUM 5 +#define GLOC_LUTS 2 +/* ========== Instance parameters for GPIO peripheral ========== */ +#define GPIO_GPIO_IRQ_MSB 11 +#define GPIO_GPIO_MAX_IRQ_MSB 11 +#define GPIO_GPIO_PADDR_BITS 11 +#define GPIO_GPIO_PINS_MSB 95 +#define GPIO_IRQS_PER_GROUP 8 +#define GPIO_NUMBER_OF_PINS 96 +#define GPIO_PADDR_MSB 10 +#define GPIO_PDATA_MSB 31 +#define GPIO_PORT_LENGTH 3 +/* ========== Instance parameters for HMATRIX ========== */ +#define HMATRIX_SLAVE_FLASH 0 +#define HMATRIX_SLAVE_HTOP0 1 +#define HMATRIX_SLAVE_HTOP1 2 +#define HMATRIX_SLAVE_HTOP2 3 +#define HMATRIX_SLAVE_HTOP3 4 +#define HMATRIX_SLAVE_HRAMC0 5 +#define HMATRIX_SLAVE_HRAMC1 6 +#define HMATRIX_SLAVE_AESA 7 +#define HMATRIX_SLAVE_NUM 8 + +#define HMATRIX_MASTER_CPU_IDCODE 0 +#define HMATRIX_MASTER_CPU_SYS 1 +#define HMATRIX_MASTER_SMAP 2 +#define HMATRIX_MASTER_PDCA 3 +#define HMATRIX_MASTER_USBC_MASTER 4 +#define HMATRIX_MASTER_CRCCU 5 +#define HMATRIX_MASTER_NUM 6 +/* ========== Instance parameters for IISC peripheral ========== */ +#define IISC_GCLK_NUM 6 +#define IISC_PDCA_ID_RX 14 +#define IISC_PDCA_ID_RX_1 15 +#define IISC_PDCA_ID_TX 33 +#define IISC_PDCA_ID_TX_1 34 +/* ========== Instance parameters for LCDCA peripheral ========== */ +#define LCDCA_PDCA_ID_TX_ABM 38 +#define LCDCA_PDCA_ID_TX_ACM 37 +/* ========== Instance parameters for PARC peripheral ========== */ +#define PARC_PDCA_ID_RX 16 +/* ========== Instance parameters for PDCA peripheral ========== */ +#define PDCA_CHANNEL_LENGTH 16 +#define PDCA_CLK_AHB_ID 0 +#define PDCA_MON_CH0_IMPL 0 +#define PDCA_MON_CH1_IMPL 0 +/* ========== Instance parameters for PEVC peripheral ========== */ +#define PEVC_EVIN_BITS 31 +#define PEVC_GCLK_NUM_0 8 +#define PEVC_GCLK_NUM_1 9 +#define PEVC_GCLK_NUM_LSB 8 +#define PEVC_GCLK_NUM_MSB 9 +#define PEVC_GCLK_NUM_SIZE 2 +#define PEVC_PADS_BITS 4 +#define PEVC_TRIGOUT_BITS 19 + +// GENERATORS +#define PEVC_ID_GEN_PAD_0 0 /* EVS IGF */ +#define PEVC_ID_GEN_PAD_1 1 /* EVS IGF */ +#define PEVC_ID_GEN_PAD_2 2 /* EVS IGF */ +#define PEVC_ID_GEN_PAD_3 3 /* EVS IGF */ +#define PEVC_ID_GEN_GCLK_0 4 /* EVS */ +#define PEVC_ID_GEN_GCLK_1 5 /* EVS */ +#define PEVC_ID_GEN_AST_0 6 /* EVS */ +#define PEVC_ID_GEN_AST_1 7 /* EVS */ +#define PEVC_ID_GEN_AST_2 8 /* EVS */ +#define PEVC_ID_GEN_AST_3 9 /* EVS */ +#define PEVC_ID_GEN_AST_4 10 /* EVS */ +#define PEVC_ID_GEN_ACIFC_CHANNEL_POSITIVE_0 11 +#define PEVC_ID_GEN_ACIFC_CHANNEL_POSITIVE_1 12 +#define PEVC_ID_GEN_ACIFC_CHANNEL_POSITIVE_2 13 +#define PEVC_ID_GEN_ACIFC_CHANNEL_POSITIVE_3 14 +#define PEVC_ID_GEN_ACIFC_CHANNEL_NEGATIVE_0 15 +#define PEVC_ID_GEN_ACIFC_CHANNEL_NEGATIVE_1 16 +#define PEVC_ID_GEN_ACIFC_CHANNEL_NEGATIVE_2 17 +#define PEVC_ID_GEN_ACIFC_CHANNEL_NEGATIVE_3 18 +#define PEVC_ID_GEN_ACIFC_WINDOW_0 19 +#define PEVC_ID_GEN_ACIFC_WINDOW_1 20 +#define PEVC_ID_GEN_TC0_A0 21 /* EVS */ +#define PEVC_ID_GEN_TC0_A1 22 /* EVS */ +#define PEVC_ID_GEN_TC0_A2 23 /* EVS */ +#define PEVC_ID_GEN_TC0_B0 24 /* EVS */ +#define PEVC_ID_GEN_TC0_B1 25 /* EVS */ +#define PEVC_ID_GEN_TC0_B2 26 /* EVS */ +#define PEVC_ID_GEN_ADCIFE_WM 27 +#define PEVC_ID_GEN_ADCIFE_EOC 28 +#define PEVC_ID_GEN_VREGIFG_SSWRDY 29 +#define PEVC_ID_GEN_PICOUART 30 /* EVS */ + +#define PEVC_CHMX0_EVMX_SIZE_IMPL 5 +#define PEVC_CHMX0_EVMX_MASK_IMPL 0x0000001F + +#define PEVC_EVS_IMPL 0b1000111111000000000011111111111 +#define PEVC_IGF_IMPL 0b0000000000000000000000000001111 + +// USERS / CHANNELS +#define PEVC_ID_USER_PDCA_0 0 +#define PEVC_ID_USER_PDCA_1 1 +#define PEVC_ID_USER_PDCA_2 2 +#define PEVC_ID_USER_PDCA_3 3 +#define PEVC_ID_USER_ADCIFE_SOC 4 +#define PEVC_ID_USER_DACC_CONV 5 +#define PEVC_ID_USER_CATB 6 +#define PEVC_ID_USER_TC1_A0 8 +#define PEVC_ID_USER_TC1_A1 9 +#define PEVC_ID_USER_TC1_A2 10 +#define PEVC_ID_USER_TC1_B0 11 +#define PEVC_ID_USER_TC1_B1 12 +#define PEVC_ID_USER_TC1_B2 13 +#define PEVC_ID_USER_ACIFC 14 +#define PEVC_ID_USER_PARC_START 15 +#define PEVC_ID_USER_PARC_STOP 16 +#define PEVC_ID_USER_VREGIFG_SSWREQ 17 +#define PEVC_ID_USER_VREGIFG_SSWDIS 18 +/* ========== Instance parameters for PM peripheral ========== */ +#define PM_AWEN_LCDCA 7 +#define PM_AWEN_PICOUART 6 +#define PM_AWEN_TWIS0 0 +#define PM_AWEN_TWIS1 1 +#define PM_AWEN_USBC 2 +#define PM_MCCTRL_MCSEL_DFLL0 3 +#define PM_MCCTRL_MCSEL_FLO 7 +#define PM_MCCTRL_MCSEL_OSC0 1 +#define PM_MCCTRL_MCSEL_PLL0 2 +#define PM_MCCTRL_MCSEL_RCFAST 5 +#define PM_MCCTRL_MCSEL_RC1M 6 +#define PM_MCCTRL_MCSEL_RC80M 4 +#define PM_MCCTRL_MCSEL_SLOW 0 +#define PM_PM_CLK_APB_NUM 4 +#define PM_PPCR_FLASH_WAIT_BGREF_MASK 512 +#define PM_PPCR_FLASH_WAIT_BOD18_MASK 1024 +/* ========== Instance parameters for SCIF peripheral ========== */ +#define SCIF_BOD33_IMPLEMENTED 0 +#define SCIF_BOD50_IMPLEMENTED 0 +#define SCIF_BR_NUM 0 +#define SCIF_DFLL_CALIB_MSB 3 +#define SCIF_DFLL_COARSE_MSB 4 +#define SCIF_DFLL_FINE_MSB 7 +#define SCIF_DFLL_RANGE_MSB 1 +#define SCIF_GCLK_EXTCLK_MSB 3 +#define SCIF_GCLK_IN_MSB 1 +#define SCIF_GCLK_IN_NUM 2 +#define SCIF_GCLK_MSB 10 +#define SCIF_GCLK_NUM 12 +#define SCIF_GCLK_NUM_DFLL_REF 0 +#define SCIF_GCLK_NUM_DFLL_SSG 1 +#define SCIF_GCLK_NUM_EXTCLK_0 0 +#define SCIF_GCLK_NUM_EXTCLK_1 1 +#define SCIF_GCLK_NUM_EXTCLK_2 2 +#define SCIF_GCLK_NUM_EXTCLK_3 3 +#define SCIF_GCLK_NUM_EXTCLK_LSB 0 +#define SCIF_GCLK_NUM_EXTCLK_MSB 3 +#define SCIF_GCLK_NUM_EXTCLK_SIZE 4 +#define SCIF_GCLK_NUM_FLO 4 +#define SCIF_GCLK_NUM_MASTER 11 +#define SCIF_GCLK_NUM_PLL 9 +#define SCIF_GCLK_NUM_RC32KIFB_REF 5 +#define SCIF_GC_USES_CLK_CPU 7 +#define SCIF_GC_USES_CLK_HSB 8 +#define SCIF_GC_USES_CLK_PBA 9 +#define SCIF_GC_USES_CLK_PBB 10 +#define SCIF_GC_USES_CLK_PBC 11 +#define SCIF_GC_USES_CLK_PBD 12 +#define SCIF_GC_USES_CLK_SLOW 0 +#define SCIF_GC_USES_CLK_1K 15 +#define SCIF_GC_USES_CLK_32 1 +#define SCIF_GC_USES_DFLL0 2 +#define SCIF_GC_USES_FLO 14 +#define SCIF_GC_USES_GCLKPRESC_FP 18 +#define SCIF_GC_USES_GCLKPRESC_HRP 17 +#define SCIF_GC_USES_GCLK_IN0 19 +#define SCIF_GC_USES_GCLK_IN1 20 +#define SCIF_GC_USES_MASTER 21 +#define SCIF_GC_USES_OSC0 3 +#define SCIF_GC_USES_PLL0 16 +#define SCIF_GC_USES_RCFAST 5 +#define SCIF_GC_USES_RC1M 6 +#define SCIF_GC_USES_RC32K 13 +#define SCIF_GC_USES_RC80M 4 +#define SCIF_OSC_NUM 1 +#define SCIF_PLL_NUM 1 +#define SCIF_RCFAST_CALIBRATION_MSB 6 +#define SCIF_RCFAST_FRANGE_MSB 1 +#define SCIF_RC80M_CALIBRATION_MSB 1 +/* ========== Instance parameters for SPI peripheral ========== */ +#define SPI_CS_MSB 3 +#define SPI_PDCA_ID_RX 4 +#define SPI_PDCA_ID_TX 22 +/* ========== Instance parameters for TC0 peripheral ========== */ +#define TC0_CLK_DIV1 gen_clk_tc0 +#define TC0_CLK_DIV2 2 +#define TC0_CLK_DIV3 8 +#define TC0_CLK_DIV4 32 +#define TC0_CLK_DIV5 128 +#define TC0_GCLK_NUM 5 +/* ========== Instance parameters for TC1 peripheral ========== */ +#define TC1_CLK_DIV1 gen_clk_tc1 +#define TC1_CLK_DIV2 2 +#define TC1_CLK_DIV3 8 +#define TC1_CLK_DIV4 32 +#define TC1_CLK_DIV5 128 +#define TC1_GCLK_NUM 8 +/* ========== Instance parameters for TWIM0 peripheral ========== */ +#define TWIM0_PDCA_ID_RX 5 +#define TWIM0_PDCA_ID_TX 23 +/* ========== Instance parameters for TWIM1 peripheral ========== */ +#define TWIM1_PDCA_ID_RX 6 +#define TWIM1_PDCA_ID_TX 24 +/* ========== Instance parameters for TWIM2 peripheral ========== */ +#define TWIM2_PDCA_ID_RX 7 +#define TWIM2_PDCA_ID_TX 25 +/* ========== Instance parameters for TWIM3 peripheral ========== */ +#define TWIM3_PDCA_ID_RX 8 +#define TWIM3_PDCA_ID_TX 26 +/* ========== Instance parameters for TWIS0 peripheral ========== */ +#define TWIS0_PDCA_ID_RX 9 +#define TWIS0_PDCA_ID_TX 27 +/* ========== Instance parameters for TWIS1 peripheral ========== */ +#define TWIS1_PDCA_ID_RX 10 +#define TWIS1_PDCA_ID_TX 28 +/* ========== Instance parameters for USART0 peripheral ========== */ +#define USART0_CLK_DIV 8 +#define USART0_PDCA_ID_RX 0 +#define USART0_PDCA_ID_TX 18 +/* ========== Instance parameters for USART1 peripheral ========== */ +#define USART1_CLK_DIV 8 +#define USART1_PDCA_ID_RX 1 +#define USART1_PDCA_ID_TX 19 +/* ========== Instance parameters for USART2 peripheral ========== */ +#define USART2_CLK_DIV 8 +#define USART2_PDCA_ID_RX 2 +#define USART2_PDCA_ID_TX 20 +/* ========== Instance parameters for USART3 peripheral ========== */ +#define USART3_CLK_DIV 8 +#define USART3_PDCA_ID_RX 3 +#define USART3_PDCA_ID_TX 21 +/* ========== Instance parameters for USBC peripheral ========== */ +#define USBC_EPT_NBR 7 +#define USBC_GCLK_NUM 7 +#define USBC_HOST_IMPLEMENTED 1 +#define USBC_OTG_IMPLEMENTED +#define USBC_USB_UTMI_IMPLEMENTED +/*@}*/ + +/* ************************************************************************** */ +/** GPIO DEFINITIONS FOR SAM4L */ +/* ************************************************************************** */ +/** \addtogroup SAM4L_gpio GPIO Definitions */ +/*@{*/ + +#define PIN_PA00 0 /**< \brief Pin Number for PA00 */ +#define GPIO_PA00 (1u << 0) /**< \brief GPIO Mask for PA00 */ +#define PIN_PA01 1 /**< \brief Pin Number for PA01 */ +#define GPIO_PA01 (1u << 1) /**< \brief GPIO Mask for PA01 */ +#define PIN_PA02 2 /**< \brief Pin Number for PA02 */ +#define GPIO_PA02 (1u << 2) /**< \brief GPIO Mask for PA02 */ +#define PIN_PA03 3 /**< \brief Pin Number for PA03 */ +#define GPIO_PA03 (1u << 3) /**< \brief GPIO Mask for PA03 */ +#define PIN_PA04 4 /**< \brief Pin Number for PA04 */ +#define GPIO_PA04 (1u << 4) /**< \brief GPIO Mask for PA04 */ +#define PIN_PA05 5 /**< \brief Pin Number for PA05 */ +#define GPIO_PA05 (1u << 5) /**< \brief GPIO Mask for PA05 */ +#define PIN_PA06 6 /**< \brief Pin Number for PA06 */ +#define GPIO_PA06 (1u << 6) /**< \brief GPIO Mask for PA06 */ +#define PIN_PA07 7 /**< \brief Pin Number for PA07 */ +#define GPIO_PA07 (1u << 7) /**< \brief GPIO Mask for PA07 */ +#define PIN_PA08 8 /**< \brief Pin Number for PA08 */ +#define GPIO_PA08 (1u << 8) /**< \brief GPIO Mask for PA08 */ +#define PIN_PA09 9 /**< \brief Pin Number for PA09 */ +#define GPIO_PA09 (1u << 9) /**< \brief GPIO Mask for PA09 */ +#define PIN_PA10 10 /**< \brief Pin Number for PA10 */ +#define GPIO_PA10 (1u << 10) /**< \brief GPIO Mask for PA10 */ +#define PIN_PA11 11 /**< \brief Pin Number for PA11 */ +#define GPIO_PA11 (1u << 11) /**< \brief GPIO Mask for PA11 */ +#define PIN_PA12 12 /**< \brief Pin Number for PA12 */ +#define GPIO_PA12 (1u << 12) /**< \brief GPIO Mask for PA12 */ +#define PIN_PA13 13 /**< \brief Pin Number for PA13 */ +#define GPIO_PA13 (1u << 13) /**< \brief GPIO Mask for PA13 */ +#define PIN_PA14 14 /**< \brief Pin Number for PA14 */ +#define GPIO_PA14 (1u << 14) /**< \brief GPIO Mask for PA14 */ +#define PIN_PA15 15 /**< \brief Pin Number for PA15 */ +#define GPIO_PA15 (1u << 15) /**< \brief GPIO Mask for PA15 */ +#define PIN_PA16 16 /**< \brief Pin Number for PA16 */ +#define GPIO_PA16 (1u << 16) /**< \brief GPIO Mask for PA16 */ +#define PIN_PA17 17 /**< \brief Pin Number for PA17 */ +#define GPIO_PA17 (1u << 17) /**< \brief GPIO Mask for PA17 */ +#define PIN_PA18 18 /**< \brief Pin Number for PA18 */ +#define GPIO_PA18 (1u << 18) /**< \brief GPIO Mask for PA18 */ +#define PIN_PA19 19 /**< \brief Pin Number for PA19 */ +#define GPIO_PA19 (1u << 19) /**< \brief GPIO Mask for PA19 */ +#define PIN_PA20 20 /**< \brief Pin Number for PA20 */ +#define GPIO_PA20 (1u << 20) /**< \brief GPIO Mask for PA20 */ +#define PIN_PA21 21 /**< \brief Pin Number for PA21 */ +#define GPIO_PA21 (1u << 21) /**< \brief GPIO Mask for PA21 */ +#define PIN_PA22 22 /**< \brief Pin Number for PA22 */ +#define GPIO_PA22 (1u << 22) /**< \brief GPIO Mask for PA22 */ +#define PIN_PA23 23 /**< \brief Pin Number for PA23 */ +#define GPIO_PA23 (1u << 23) /**< \brief GPIO Mask for PA23 */ +#define PIN_PA24 24 /**< \brief Pin Number for PA24 */ +#define GPIO_PA24 (1u << 24) /**< \brief GPIO Mask for PA24 */ +#define PIN_PA25 25 /**< \brief Pin Number for PA25 */ +#define GPIO_PA25 (1u << 25) /**< \brief GPIO Mask for PA25 */ +#define PIN_PA26 26 /**< \brief Pin Number for PA26 */ +#define GPIO_PA26 (1u << 26) /**< \brief GPIO Mask for PA26 */ +#define PIN_PA27 27 /**< \brief Pin Number for PA27 */ +#define GPIO_PA27 (1u << 27) /**< \brief GPIO Mask for PA27 */ +#define PIN_PA28 28 /**< \brief Pin Number for PA28 */ +#define GPIO_PA28 (1u << 28) /**< \brief GPIO Mask for PA28 */ +#define PIN_PA29 29 /**< \brief Pin Number for PA29 */ +#define GPIO_PA29 (1u << 29) /**< \brief GPIO Mask for PA29 */ +#define PIN_PA30 30 /**< \brief Pin Number for PA30 */ +#define GPIO_PA30 (1u << 30) /**< \brief GPIO Mask for PA30 */ +#define PIN_PA31 31 /**< \brief Pin Number for PA31 */ +#define GPIO_PA31 (1u << 31) /**< \brief GPIO Mask for PA31 */ +#define PIN_PB00 32 /**< \brief Pin Number for PB00 */ +#define GPIO_PB00 (1u << 0) /**< \brief GPIO Mask for PB00 */ +#define PIN_PB01 33 /**< \brief Pin Number for PB01 */ +#define GPIO_PB01 (1u << 1) /**< \brief GPIO Mask for PB01 */ +#define PIN_PB02 34 /**< \brief Pin Number for PB02 */ +#define GPIO_PB02 (1u << 2) /**< \brief GPIO Mask for PB02 */ +#define PIN_PB03 35 /**< \brief Pin Number for PB03 */ +#define GPIO_PB03 (1u << 3) /**< \brief GPIO Mask for PB03 */ +#define PIN_PB04 36 /**< \brief Pin Number for PB04 */ +#define GPIO_PB04 (1u << 4) /**< \brief GPIO Mask for PB04 */ +#define PIN_PB05 37 /**< \brief Pin Number for PB05 */ +#define GPIO_PB05 (1u << 5) /**< \brief GPIO Mask for PB05 */ +#define PIN_PB06 38 /**< \brief Pin Number for PB06 */ +#define GPIO_PB06 (1u << 6) /**< \brief GPIO Mask for PB06 */ +#define PIN_PB07 39 /**< \brief Pin Number for PB07 */ +#define GPIO_PB07 (1u << 7) /**< \brief GPIO Mask for PB07 */ +#define PIN_PB08 40 /**< \brief Pin Number for PB08 */ +#define GPIO_PB08 (1u << 8) /**< \brief GPIO Mask for PB08 */ +#define PIN_PB09 41 /**< \brief Pin Number for PB09 */ +#define GPIO_PB09 (1u << 9) /**< \brief GPIO Mask for PB09 */ +#define PIN_PB10 42 /**< \brief Pin Number for PB10 */ +#define GPIO_PB10 (1u << 10) /**< \brief GPIO Mask for PB10 */ +#define PIN_PB11 43 /**< \brief Pin Number for PB11 */ +#define GPIO_PB11 (1u << 11) /**< \brief GPIO Mask for PB11 */ +#define PIN_PB12 44 /**< \brief Pin Number for PB12 */ +#define GPIO_PB12 (1u << 12) /**< \brief GPIO Mask for PB12 */ +#define PIN_PB13 45 /**< \brief Pin Number for PB13 */ +#define GPIO_PB13 (1u << 13) /**< \brief GPIO Mask for PB13 */ +#define PIN_PB14 46 /**< \brief Pin Number for PB14 */ +#define GPIO_PB14 (1u << 14) /**< \brief GPIO Mask for PB14 */ +#define PIN_PB15 47 /**< \brief Pin Number for PB15 */ +#define GPIO_PB15 (1u << 15) /**< \brief GPIO Mask for PB15 */ +#define PIN_PC00 64 /**< \brief Pin Number for PC00 */ +#define GPIO_PC00 (1u << 0) /**< \brief GPIO Mask for PC00 */ +#define PIN_PC01 65 /**< \brief Pin Number for PC01 */ +#define GPIO_PC01 (1u << 1) /**< \brief GPIO Mask for PC01 */ +#define PIN_PC02 66 /**< \brief Pin Number for PC02 */ +#define GPIO_PC02 (1u << 2) /**< \brief GPIO Mask for PC02 */ +#define PIN_PC03 67 /**< \brief Pin Number for PC03 */ +#define GPIO_PC03 (1u << 3) /**< \brief GPIO Mask for PC03 */ +#define PIN_PC04 68 /**< \brief Pin Number for PC04 */ +#define GPIO_PC04 (1u << 4) /**< \brief GPIO Mask for PC04 */ +#define PIN_PC05 69 /**< \brief Pin Number for PC05 */ +#define GPIO_PC05 (1u << 5) /**< \brief GPIO Mask for PC05 */ +#define PIN_PC06 70 /**< \brief Pin Number for PC06 */ +#define GPIO_PC06 (1u << 6) /**< \brief GPIO Mask for PC06 */ +#define PIN_PC07 71 /**< \brief Pin Number for PC07 */ +#define GPIO_PC07 (1u << 7) /**< \brief GPIO Mask for PC07 */ +#define PIN_PC08 72 /**< \brief Pin Number for PC08 */ +#define GPIO_PC08 (1u << 8) /**< \brief GPIO Mask for PC08 */ +#define PIN_PC09 73 /**< \brief Pin Number for PC09 */ +#define GPIO_PC09 (1u << 9) /**< \brief GPIO Mask for PC09 */ +#define PIN_PC10 74 /**< \brief Pin Number for PC10 */ +#define GPIO_PC10 (1u << 10) /**< \brief GPIO Mask for PC10 */ +#define PIN_PC11 75 /**< \brief Pin Number for PC11 */ +#define GPIO_PC11 (1u << 11) /**< \brief GPIO Mask for PC11 */ +#define PIN_PC12 76 /**< \brief Pin Number for PC12 */ +#define GPIO_PC12 (1u << 12) /**< \brief GPIO Mask for PC12 */ +#define PIN_PC13 77 /**< \brief Pin Number for PC13 */ +#define GPIO_PC13 (1u << 13) /**< \brief GPIO Mask for PC13 */ +#define PIN_PC14 78 /**< \brief Pin Number for PC14 */ +#define GPIO_PC14 (1u << 14) /**< \brief GPIO Mask for PC14 */ +#define PIN_PC15 79 /**< \brief Pin Number for PC15 */ +#define GPIO_PC15 (1u << 15) /**< \brief GPIO Mask for PC15 */ +#define PIN_PC16 80 /**< \brief Pin Number for PC16 */ +#define GPIO_PC16 (1u << 16) /**< \brief GPIO Mask for PC16 */ +#define PIN_PC17 81 /**< \brief Pin Number for PC17 */ +#define GPIO_PC17 (1u << 17) /**< \brief GPIO Mask for PC17 */ +#define PIN_PC18 82 /**< \brief Pin Number for PC18 */ +#define GPIO_PC18 (1u << 18) /**< \brief GPIO Mask for PC18 */ +#define PIN_PC19 83 /**< \brief Pin Number for PC19 */ +#define GPIO_PC19 (1u << 19) /**< \brief GPIO Mask for PC19 */ +#define PIN_PC20 84 /**< \brief Pin Number for PC20 */ +#define GPIO_PC20 (1u << 20) /**< \brief GPIO Mask for PC20 */ +#define PIN_PC21 85 /**< \brief Pin Number for PC21 */ +#define GPIO_PC21 (1u << 21) /**< \brief GPIO Mask for PC21 */ +#define PIN_PC22 86 /**< \brief Pin Number for PC22 */ +#define GPIO_PC22 (1u << 22) /**< \brief GPIO Mask for PC22 */ +#define PIN_PC23 87 /**< \brief Pin Number for PC23 */ +#define GPIO_PC23 (1u << 23) /**< \brief GPIO Mask for PC23 */ +#define PIN_PC24 88 /**< \brief Pin Number for PC24 */ +#define GPIO_PC24 (1u << 24) /**< \brief GPIO Mask for PC24 */ +#define PIN_PC25 89 /**< \brief Pin Number for PC25 */ +#define GPIO_PC25 (1u << 25) /**< \brief GPIO Mask for PC25 */ +#define PIN_PC26 90 /**< \brief Pin Number for PC26 */ +#define GPIO_PC26 (1u << 26) /**< \brief GPIO Mask for PC26 */ +#define PIN_PC27 91 /**< \brief Pin Number for PC27 */ +#define GPIO_PC27 (1u << 27) /**< \brief GPIO Mask for PC27 */ +#define PIN_PC28 92 /**< \brief Pin Number for PC28 */ +#define GPIO_PC28 (1u << 28) /**< \brief GPIO Mask for PC28 */ +#define PIN_PC29 93 /**< \brief Pin Number for PC29 */ +#define GPIO_PC29 (1u << 29) /**< \brief GPIO Mask for PC29 */ +#define PIN_PC30 94 /**< \brief Pin Number for PC30 */ +#define GPIO_PC30 (1u << 30) /**< \brief GPIO Mask for PC30 */ +#define PIN_PC31 95 /**< \brief Pin Number for PC31 */ +#define GPIO_PC31 (1u << 31) /**< \brief GPIO Mask for PC31 */ +/* ========== GPIO definition for ABDACB peripheral ========== */ +#define PIN_PA31C_ABDACB_CLK 31 /**< \brief ABDACB signal: CLK on PA31 mux C */ +#define MUX_PA31C_ABDACB_CLK 2 +#define GPIO_PA31C_ABDACB_CLK (1u << 31) +#define PIN_PC12C_ABDACB_CLK 76 /**< \brief ABDACB signal: CLK on PC12 mux C */ +#define MUX_PC12C_ABDACB_CLK 2 +#define GPIO_PC12C_ABDACB_CLK (1u << 12) +#define PIN_PA27C_ABDACB_DAC0 27 /**< \brief ABDACB signal: DAC0 on PA27 mux C */ +#define MUX_PA27C_ABDACB_DAC0 2 +#define GPIO_PA27C_ABDACB_DAC0 (1u << 27) +#define PIN_PB02C_ABDACB_DAC0 34 /**< \brief ABDACB signal: DAC0 on PB02 mux C */ +#define MUX_PB02C_ABDACB_DAC0 2 +#define GPIO_PB02C_ABDACB_DAC0 (1u << 2) +#define PIN_PC09C_ABDACB_DAC0 73 /**< \brief ABDACB signal: DAC0 on PC09 mux C */ +#define MUX_PC09C_ABDACB_DAC0 2 +#define GPIO_PC09C_ABDACB_DAC0 (1u << 9) +#define PIN_PA17B_ABDACB_DAC0 17 /**< \brief ABDACB signal: DAC0 on PA17 mux B */ +#define MUX_PA17B_ABDACB_DAC0 1 +#define GPIO_PA17B_ABDACB_DAC0 (1u << 17) +#define PIN_PA29C_ABDACB_DAC1 29 /**< \brief ABDACB signal: DAC1 on PA29 mux C */ +#define MUX_PA29C_ABDACB_DAC1 2 +#define GPIO_PA29C_ABDACB_DAC1 (1u << 29) +#define PIN_PB04C_ABDACB_DAC1 36 /**< \brief ABDACB signal: DAC1 on PB04 mux C */ +#define MUX_PB04C_ABDACB_DAC1 2 +#define GPIO_PB04C_ABDACB_DAC1 (1u << 4) +#define PIN_PC13C_ABDACB_DAC1 77 /**< \brief ABDACB signal: DAC1 on PC13 mux C */ +#define MUX_PC13C_ABDACB_DAC1 2 +#define GPIO_PC13C_ABDACB_DAC1 (1u << 13) +#define PIN_PA19B_ABDACB_DAC1 19 /**< \brief ABDACB signal: DAC1 on PA19 mux B */ +#define MUX_PA19B_ABDACB_DAC1 1 +#define GPIO_PA19B_ABDACB_DAC1 (1u << 19) +#define PIN_PA28C_ABDACB_DACN0 28 /**< \brief ABDACB signal: DACN0 on PA28 mux C */ +#define MUX_PA28C_ABDACB_DACN0 2 +#define GPIO_PA28C_ABDACB_DACN0 (1u << 28) +#define PIN_PB03C_ABDACB_DACN0 35 /**< \brief ABDACB signal: DACN0 on PB03 mux C */ +#define MUX_PB03C_ABDACB_DACN0 2 +#define GPIO_PB03C_ABDACB_DACN0 (1u << 3) +#define PIN_PC10C_ABDACB_DACN0 74 /**< \brief ABDACB signal: DACN0 on PC10 mux C */ +#define MUX_PC10C_ABDACB_DACN0 2 +#define GPIO_PC10C_ABDACB_DACN0 (1u << 10) +#define PIN_PA18B_ABDACB_DACN0 18 /**< \brief ABDACB signal: DACN0 on PA18 mux B */ +#define MUX_PA18B_ABDACB_DACN0 1 +#define GPIO_PA18B_ABDACB_DACN0 (1u << 18) +#define PIN_PA30C_ABDACB_DACN1 30 /**< \brief ABDACB signal: DACN1 on PA30 mux C */ +#define MUX_PA30C_ABDACB_DACN1 2 +#define GPIO_PA30C_ABDACB_DACN1 (1u << 30) +#define PIN_PB05C_ABDACB_DACN1 37 /**< \brief ABDACB signal: DACN1 on PB05 mux C */ +#define MUX_PB05C_ABDACB_DACN1 2 +#define GPIO_PB05C_ABDACB_DACN1 (1u << 5) +#define PIN_PC14C_ABDACB_DACN1 78 /**< \brief ABDACB signal: DACN1 on PC14 mux C */ +#define MUX_PC14C_ABDACB_DACN1 2 +#define GPIO_PC14C_ABDACB_DACN1 (1u << 14) +#define PIN_PA20B_ABDACB_DACN1 20 /**< \brief ABDACB signal: DACN1 on PA20 mux B */ +#define MUX_PA20B_ABDACB_DACN1 1 +#define GPIO_PA20B_ABDACB_DACN1 (1u << 20) +/* ========== GPIO definition for ACIFC peripheral ========== */ +#define PIN_PA06E_ACIFC_ACAN0 6 /**< \brief ACIFC signal: ACAN0 on PA06 mux E */ +#define MUX_PA06E_ACIFC_ACAN0 4 +#define GPIO_PA06E_ACIFC_ACAN0 (1u << 6) +#define PIN_PC09E_ACIFC_ACAN1 73 /**< \brief ACIFC signal: ACAN1 on PC09 mux E */ +#define MUX_PC09E_ACIFC_ACAN1 4 +#define GPIO_PC09E_ACIFC_ACAN1 (1u << 9) +#define PIN_PA07E_ACIFC_ACAP0 7 /**< \brief ACIFC signal: ACAP0 on PA07 mux E */ +#define MUX_PA07E_ACIFC_ACAP0 4 +#define GPIO_PA07E_ACIFC_ACAP0 (1u << 7) +#define PIN_PC10E_ACIFC_ACAP1 74 /**< \brief ACIFC signal: ACAP1 on PC10 mux E */ +#define MUX_PC10E_ACIFC_ACAP1 4 +#define GPIO_PC10E_ACIFC_ACAP1 (1u << 10) +#define PIN_PB02E_ACIFC_ACBN0 34 /**< \brief ACIFC signal: ACBN0 on PB02 mux E */ +#define MUX_PB02E_ACIFC_ACBN0 4 +#define GPIO_PB02E_ACIFC_ACBN0 (1u << 2) +#define PIN_PC13E_ACIFC_ACBN1 77 /**< \brief ACIFC signal: ACBN1 on PC13 mux E */ +#define MUX_PC13E_ACIFC_ACBN1 4 +#define GPIO_PC13E_ACIFC_ACBN1 (1u << 13) +#define PIN_PB03E_ACIFC_ACBP0 35 /**< \brief ACIFC signal: ACBP0 on PB03 mux E */ +#define MUX_PB03E_ACIFC_ACBP0 4 +#define GPIO_PB03E_ACIFC_ACBP0 (1u << 3) +#define PIN_PC14E_ACIFC_ACBP1 78 /**< \brief ACIFC signal: ACBP1 on PC14 mux E */ +#define MUX_PC14E_ACIFC_ACBP1 4 +#define GPIO_PC14E_ACIFC_ACBP1 (1u << 14) +/* ========== GPIO definition for ADCIFE peripheral ========== */ +#define PIN_PA04A_ADCIFE_AD0 4 /**< \brief ADCIFE signal: AD0 on PA04 mux A */ +#define MUX_PA04A_ADCIFE_AD0 0 +#define GPIO_PA04A_ADCIFE_AD0 (1u << 4) +#define PIN_PA05A_ADCIFE_AD1 5 /**< \brief ADCIFE signal: AD1 on PA05 mux A */ +#define MUX_PA05A_ADCIFE_AD1 0 +#define GPIO_PA05A_ADCIFE_AD1 (1u << 5) +#define PIN_PA07A_ADCIFE_AD2 7 /**< \brief ADCIFE signal: AD2 on PA07 mux A */ +#define MUX_PA07A_ADCIFE_AD2 0 +#define GPIO_PA07A_ADCIFE_AD2 (1u << 7) +#define PIN_PB02A_ADCIFE_AD3 34 /**< \brief ADCIFE signal: AD3 on PB02 mux A */ +#define MUX_PB02A_ADCIFE_AD3 0 +#define GPIO_PB02A_ADCIFE_AD3 (1u << 2) +#define PIN_PB03A_ADCIFE_AD4 35 /**< \brief ADCIFE signal: AD4 on PB03 mux A */ +#define MUX_PB03A_ADCIFE_AD4 0 +#define GPIO_PB03A_ADCIFE_AD4 (1u << 3) +#define PIN_PB04A_ADCIFE_AD5 36 /**< \brief ADCIFE signal: AD5 on PB04 mux A */ +#define MUX_PB04A_ADCIFE_AD5 0 +#define GPIO_PB04A_ADCIFE_AD5 (1u << 4) +#define PIN_PB05A_ADCIFE_AD6 37 /**< \brief ADCIFE signal: AD6 on PB05 mux A */ +#define MUX_PB05A_ADCIFE_AD6 0 +#define GPIO_PB05A_ADCIFE_AD6 (1u << 5) +#define PIN_PC07A_ADCIFE_AD7 71 /**< \brief ADCIFE signal: AD7 on PC07 mux A */ +#define MUX_PC07A_ADCIFE_AD7 0 +#define GPIO_PC07A_ADCIFE_AD7 (1u << 7) +#define PIN_PC08A_ADCIFE_AD8 72 /**< \brief ADCIFE signal: AD8 on PC08 mux A */ +#define MUX_PC08A_ADCIFE_AD8 0 +#define GPIO_PC08A_ADCIFE_AD8 (1u << 8) +#define PIN_PC09A_ADCIFE_AD9 73 /**< \brief ADCIFE signal: AD9 on PC09 mux A */ +#define MUX_PC09A_ADCIFE_AD9 0 +#define GPIO_PC09A_ADCIFE_AD9 (1u << 9) +#define PIN_PC10A_ADCIFE_AD10 74 /**< \brief ADCIFE signal: AD10 on PC10 mux A */ +#define MUX_PC10A_ADCIFE_AD10 0 +#define GPIO_PC10A_ADCIFE_AD10 (1u << 10) +#define PIN_PC11A_ADCIFE_AD11 75 /**< \brief ADCIFE signal: AD11 on PC11 mux A */ +#define MUX_PC11A_ADCIFE_AD11 0 +#define GPIO_PC11A_ADCIFE_AD11 (1u << 11) +#define PIN_PC12A_ADCIFE_AD12 76 /**< \brief ADCIFE signal: AD12 on PC12 mux A */ +#define MUX_PC12A_ADCIFE_AD12 0 +#define GPIO_PC12A_ADCIFE_AD12 (1u << 12) +#define PIN_PC13A_ADCIFE_AD13 77 /**< \brief ADCIFE signal: AD13 on PC13 mux A */ +#define MUX_PC13A_ADCIFE_AD13 0 +#define GPIO_PC13A_ADCIFE_AD13 (1u << 13) +#define PIN_PC14A_ADCIFE_AD14 78 /**< \brief ADCIFE signal: AD14 on PC14 mux A */ +#define MUX_PC14A_ADCIFE_AD14 0 +#define GPIO_PC14A_ADCIFE_AD14 (1u << 14) +#define PIN_PA05E_ADCIFE_TRIGGER 5 /**< \brief ADCIFE signal: TRIGGER on PA05 mux E */ +#define MUX_PA05E_ADCIFE_TRIGGER 4 +#define GPIO_PA05E_ADCIFE_TRIGGER (1u << 5) +/* ========== GPIO definition for CATB peripheral ========== */ +#define PIN_PA02G_CATB_DIS 2 /**< \brief CATB signal: DIS on PA02 mux G */ +#define MUX_PA02G_CATB_DIS 6 +#define GPIO_PA02G_CATB_DIS (1u << 2) +#define PIN_PA12G_CATB_DIS 12 /**< \brief CATB signal: DIS on PA12 mux G */ +#define MUX_PA12G_CATB_DIS 6 +#define GPIO_PA12G_CATB_DIS (1u << 12) +#define PIN_PA23G_CATB_DIS 23 /**< \brief CATB signal: DIS on PA23 mux G */ +#define MUX_PA23G_CATB_DIS 6 +#define GPIO_PA23G_CATB_DIS (1u << 23) +#define PIN_PA31G_CATB_DIS 31 /**< \brief CATB signal: DIS on PA31 mux G */ +#define MUX_PA31G_CATB_DIS 6 +#define GPIO_PA31G_CATB_DIS (1u << 31) +#define PIN_PB03G_CATB_DIS 35 /**< \brief CATB signal: DIS on PB03 mux G */ +#define MUX_PB03G_CATB_DIS 6 +#define GPIO_PB03G_CATB_DIS (1u << 3) +#define PIN_PB12G_CATB_DIS 44 /**< \brief CATB signal: DIS on PB12 mux G */ +#define MUX_PB12G_CATB_DIS 6 +#define GPIO_PB12G_CATB_DIS (1u << 12) +#define PIN_PC05G_CATB_DIS 69 /**< \brief CATB signal: DIS on PC05 mux G */ +#define MUX_PC05G_CATB_DIS 6 +#define GPIO_PC05G_CATB_DIS (1u << 5) +#define PIN_PC14G_CATB_DIS 78 /**< \brief CATB signal: DIS on PC14 mux G */ +#define MUX_PC14G_CATB_DIS 6 +#define GPIO_PC14G_CATB_DIS (1u << 14) +#define PIN_PC23G_CATB_DIS 87 /**< \brief CATB signal: DIS on PC23 mux G */ +#define MUX_PC23G_CATB_DIS 6 +#define GPIO_PC23G_CATB_DIS (1u << 23) +#define PIN_PA04G_CATB_SENSE0 4 /**< \brief CATB signal: SENSE0 on PA04 mux G */ +#define MUX_PA04G_CATB_SENSE0 6 +#define GPIO_PA04G_CATB_SENSE0 (1u << 4) +#define PIN_PA27G_CATB_SENSE0 27 /**< \brief CATB signal: SENSE0 on PA27 mux G */ +#define MUX_PA27G_CATB_SENSE0 6 +#define GPIO_PA27G_CATB_SENSE0 (1u << 27) +#define PIN_PB13G_CATB_SENSE0 45 /**< \brief CATB signal: SENSE0 on PB13 mux G */ +#define MUX_PB13G_CATB_SENSE0 6 +#define GPIO_PB13G_CATB_SENSE0 (1u << 13) +#define PIN_PA05G_CATB_SENSE1 5 /**< \brief CATB signal: SENSE1 on PA05 mux G */ +#define MUX_PA05G_CATB_SENSE1 6 +#define GPIO_PA05G_CATB_SENSE1 (1u << 5) +#define PIN_PA28G_CATB_SENSE1 28 /**< \brief CATB signal: SENSE1 on PA28 mux G */ +#define MUX_PA28G_CATB_SENSE1 6 +#define GPIO_PA28G_CATB_SENSE1 (1u << 28) +#define PIN_PB14G_CATB_SENSE1 46 /**< \brief CATB signal: SENSE1 on PB14 mux G */ +#define MUX_PB14G_CATB_SENSE1 6 +#define GPIO_PB14G_CATB_SENSE1 (1u << 14) +#define PIN_PA06G_CATB_SENSE2 6 /**< \brief CATB signal: SENSE2 on PA06 mux G */ +#define MUX_PA06G_CATB_SENSE2 6 +#define GPIO_PA06G_CATB_SENSE2 (1u << 6) +#define PIN_PA29G_CATB_SENSE2 29 /**< \brief CATB signal: SENSE2 on PA29 mux G */ +#define MUX_PA29G_CATB_SENSE2 6 +#define GPIO_PA29G_CATB_SENSE2 (1u << 29) +#define PIN_PB15G_CATB_SENSE2 47 /**< \brief CATB signal: SENSE2 on PB15 mux G */ +#define MUX_PB15G_CATB_SENSE2 6 +#define GPIO_PB15G_CATB_SENSE2 (1u << 15) +#define PIN_PA07G_CATB_SENSE3 7 /**< \brief CATB signal: SENSE3 on PA07 mux G */ +#define MUX_PA07G_CATB_SENSE3 6 +#define GPIO_PA07G_CATB_SENSE3 (1u << 7) +#define PIN_PA30G_CATB_SENSE3 30 /**< \brief CATB signal: SENSE3 on PA30 mux G */ +#define MUX_PA30G_CATB_SENSE3 6 +#define GPIO_PA30G_CATB_SENSE3 (1u << 30) +#define PIN_PC00G_CATB_SENSE3 64 /**< \brief CATB signal: SENSE3 on PC00 mux G */ +#define MUX_PC00G_CATB_SENSE3 6 +#define GPIO_PC00G_CATB_SENSE3 (1u << 0) +#define PIN_PA08G_CATB_SENSE4 8 /**< \brief CATB signal: SENSE4 on PA08 mux G */ +#define MUX_PA08G_CATB_SENSE4 6 +#define GPIO_PA08G_CATB_SENSE4 (1u << 8) +#define PIN_PC01G_CATB_SENSE4 65 /**< \brief CATB signal: SENSE4 on PC01 mux G */ +#define MUX_PC01G_CATB_SENSE4 6 +#define GPIO_PC01G_CATB_SENSE4 (1u << 1) +#define PIN_PA09G_CATB_SENSE5 9 /**< \brief CATB signal: SENSE5 on PA09 mux G */ +#define MUX_PA09G_CATB_SENSE5 6 +#define GPIO_PA09G_CATB_SENSE5 (1u << 9) +#define PIN_PC02G_CATB_SENSE5 66 /**< \brief CATB signal: SENSE5 on PC02 mux G */ +#define MUX_PC02G_CATB_SENSE5 6 +#define GPIO_PC02G_CATB_SENSE5 (1u << 2) +#define PIN_PA10G_CATB_SENSE6 10 /**< \brief CATB signal: SENSE6 on PA10 mux G */ +#define MUX_PA10G_CATB_SENSE6 6 +#define GPIO_PA10G_CATB_SENSE6 (1u << 10) +#define PIN_PC03G_CATB_SENSE6 67 /**< \brief CATB signal: SENSE6 on PC03 mux G */ +#define MUX_PC03G_CATB_SENSE6 6 +#define GPIO_PC03G_CATB_SENSE6 (1u << 3) +#define PIN_PA11G_CATB_SENSE7 11 /**< \brief CATB signal: SENSE7 on PA11 mux G */ +#define MUX_PA11G_CATB_SENSE7 6 +#define GPIO_PA11G_CATB_SENSE7 (1u << 11) +#define PIN_PC04G_CATB_SENSE7 68 /**< \brief CATB signal: SENSE7 on PC04 mux G */ +#define MUX_PC04G_CATB_SENSE7 6 +#define GPIO_PC04G_CATB_SENSE7 (1u << 4) +#define PIN_PA13G_CATB_SENSE8 13 /**< \brief CATB signal: SENSE8 on PA13 mux G */ +#define MUX_PA13G_CATB_SENSE8 6 +#define GPIO_PA13G_CATB_SENSE8 (1u << 13) +#define PIN_PC06G_CATB_SENSE8 70 /**< \brief CATB signal: SENSE8 on PC06 mux G */ +#define MUX_PC06G_CATB_SENSE8 6 +#define GPIO_PC06G_CATB_SENSE8 (1u << 6) +#define PIN_PA14G_CATB_SENSE9 14 /**< \brief CATB signal: SENSE9 on PA14 mux G */ +#define MUX_PA14G_CATB_SENSE9 6 +#define GPIO_PA14G_CATB_SENSE9 (1u << 14) +#define PIN_PC07G_CATB_SENSE9 71 /**< \brief CATB signal: SENSE9 on PC07 mux G */ +#define MUX_PC07G_CATB_SENSE9 6 +#define GPIO_PC07G_CATB_SENSE9 (1u << 7) +#define PIN_PA15G_CATB_SENSE10 15 /**< \brief CATB signal: SENSE10 on PA15 mux G */ +#define MUX_PA15G_CATB_SENSE10 6 +#define GPIO_PA15G_CATB_SENSE10 (1u << 15) +#define PIN_PC08G_CATB_SENSE10 72 /**< \brief CATB signal: SENSE10 on PC08 mux G */ +#define MUX_PC08G_CATB_SENSE10 6 +#define GPIO_PC08G_CATB_SENSE10 (1u << 8) +#define PIN_PA16G_CATB_SENSE11 16 /**< \brief CATB signal: SENSE11 on PA16 mux G */ +#define MUX_PA16G_CATB_SENSE11 6 +#define GPIO_PA16G_CATB_SENSE11 (1u << 16) +#define PIN_PC09G_CATB_SENSE11 73 /**< \brief CATB signal: SENSE11 on PC09 mux G */ +#define MUX_PC09G_CATB_SENSE11 6 +#define GPIO_PC09G_CATB_SENSE11 (1u << 9) +#define PIN_PA17G_CATB_SENSE12 17 /**< \brief CATB signal: SENSE12 on PA17 mux G */ +#define MUX_PA17G_CATB_SENSE12 6 +#define GPIO_PA17G_CATB_SENSE12 (1u << 17) +#define PIN_PC10G_CATB_SENSE12 74 /**< \brief CATB signal: SENSE12 on PC10 mux G */ +#define MUX_PC10G_CATB_SENSE12 6 +#define GPIO_PC10G_CATB_SENSE12 (1u << 10) +#define PIN_PA18G_CATB_SENSE13 18 /**< \brief CATB signal: SENSE13 on PA18 mux G */ +#define MUX_PA18G_CATB_SENSE13 6 +#define GPIO_PA18G_CATB_SENSE13 (1u << 18) +#define PIN_PC11G_CATB_SENSE13 75 /**< \brief CATB signal: SENSE13 on PC11 mux G */ +#define MUX_PC11G_CATB_SENSE13 6 +#define GPIO_PC11G_CATB_SENSE13 (1u << 11) +#define PIN_PA19G_CATB_SENSE14 19 /**< \brief CATB signal: SENSE14 on PA19 mux G */ +#define MUX_PA19G_CATB_SENSE14 6 +#define GPIO_PA19G_CATB_SENSE14 (1u << 19) +#define PIN_PC12G_CATB_SENSE14 76 /**< \brief CATB signal: SENSE14 on PC12 mux G */ +#define MUX_PC12G_CATB_SENSE14 6 +#define GPIO_PC12G_CATB_SENSE14 (1u << 12) +#define PIN_PA20G_CATB_SENSE15 20 /**< \brief CATB signal: SENSE15 on PA20 mux G */ +#define MUX_PA20G_CATB_SENSE15 6 +#define GPIO_PA20G_CATB_SENSE15 (1u << 20) +#define PIN_PC13G_CATB_SENSE15 77 /**< \brief CATB signal: SENSE15 on PC13 mux G */ +#define MUX_PC13G_CATB_SENSE15 6 +#define GPIO_PC13G_CATB_SENSE15 (1u << 13) +#define PIN_PA21G_CATB_SENSE16 21 /**< \brief CATB signal: SENSE16 on PA21 mux G */ +#define MUX_PA21G_CATB_SENSE16 6 +#define GPIO_PA21G_CATB_SENSE16 (1u << 21) +#define PIN_PC15G_CATB_SENSE16 79 /**< \brief CATB signal: SENSE16 on PC15 mux G */ +#define MUX_PC15G_CATB_SENSE16 6 +#define GPIO_PC15G_CATB_SENSE16 (1u << 15) +#define PIN_PA22G_CATB_SENSE17 22 /**< \brief CATB signal: SENSE17 on PA22 mux G */ +#define MUX_PA22G_CATB_SENSE17 6 +#define GPIO_PA22G_CATB_SENSE17 (1u << 22) +#define PIN_PC16G_CATB_SENSE17 80 /**< \brief CATB signal: SENSE17 on PC16 mux G */ +#define MUX_PC16G_CATB_SENSE17 6 +#define GPIO_PC16G_CATB_SENSE17 (1u << 16) +#define PIN_PA24G_CATB_SENSE18 24 /**< \brief CATB signal: SENSE18 on PA24 mux G */ +#define MUX_PA24G_CATB_SENSE18 6 +#define GPIO_PA24G_CATB_SENSE18 (1u << 24) +#define PIN_PC17G_CATB_SENSE18 81 /**< \brief CATB signal: SENSE18 on PC17 mux G */ +#define MUX_PC17G_CATB_SENSE18 6 +#define GPIO_PC17G_CATB_SENSE18 (1u << 17) +#define PIN_PA25G_CATB_SENSE19 25 /**< \brief CATB signal: SENSE19 on PA25 mux G */ +#define MUX_PA25G_CATB_SENSE19 6 +#define GPIO_PA25G_CATB_SENSE19 (1u << 25) +#define PIN_PC18G_CATB_SENSE19 82 /**< \brief CATB signal: SENSE19 on PC18 mux G */ +#define MUX_PC18G_CATB_SENSE19 6 +#define GPIO_PC18G_CATB_SENSE19 (1u << 18) +#define PIN_PA26G_CATB_SENSE20 26 /**< \brief CATB signal: SENSE20 on PA26 mux G */ +#define MUX_PA26G_CATB_SENSE20 6 +#define GPIO_PA26G_CATB_SENSE20 (1u << 26) +#define PIN_PC19G_CATB_SENSE20 83 /**< \brief CATB signal: SENSE20 on PC19 mux G */ +#define MUX_PC19G_CATB_SENSE20 6 +#define GPIO_PC19G_CATB_SENSE20 (1u << 19) +#define PIN_PB00G_CATB_SENSE21 32 /**< \brief CATB signal: SENSE21 on PB00 mux G */ +#define MUX_PB00G_CATB_SENSE21 6 +#define GPIO_PB00G_CATB_SENSE21 (1u << 0) +#define PIN_PC20G_CATB_SENSE21 84 /**< \brief CATB signal: SENSE21 on PC20 mux G */ +#define MUX_PC20G_CATB_SENSE21 6 +#define GPIO_PC20G_CATB_SENSE21 (1u << 20) +#define PIN_PB01G_CATB_SENSE22 33 /**< \brief CATB signal: SENSE22 on PB01 mux G */ +#define MUX_PB01G_CATB_SENSE22 6 +#define GPIO_PB01G_CATB_SENSE22 (1u << 1) +#define PIN_PC21G_CATB_SENSE22 85 /**< \brief CATB signal: SENSE22 on PC21 mux G */ +#define MUX_PC21G_CATB_SENSE22 6 +#define GPIO_PC21G_CATB_SENSE22 (1u << 21) +#define PIN_PB02G_CATB_SENSE23 34 /**< \brief CATB signal: SENSE23 on PB02 mux G */ +#define MUX_PB02G_CATB_SENSE23 6 +#define GPIO_PB02G_CATB_SENSE23 (1u << 2) +#define PIN_PC22G_CATB_SENSE23 86 /**< \brief CATB signal: SENSE23 on PC22 mux G */ +#define MUX_PC22G_CATB_SENSE23 6 +#define GPIO_PC22G_CATB_SENSE23 (1u << 22) +#define PIN_PB04G_CATB_SENSE24 36 /**< \brief CATB signal: SENSE24 on PB04 mux G */ +#define MUX_PB04G_CATB_SENSE24 6 +#define GPIO_PB04G_CATB_SENSE24 (1u << 4) +#define PIN_PC24G_CATB_SENSE24 88 /**< \brief CATB signal: SENSE24 on PC24 mux G */ +#define MUX_PC24G_CATB_SENSE24 6 +#define GPIO_PC24G_CATB_SENSE24 (1u << 24) +#define PIN_PB05G_CATB_SENSE25 37 /**< \brief CATB signal: SENSE25 on PB05 mux G */ +#define MUX_PB05G_CATB_SENSE25 6 +#define GPIO_PB05G_CATB_SENSE25 (1u << 5) +#define PIN_PC25G_CATB_SENSE25 89 /**< \brief CATB signal: SENSE25 on PC25 mux G */ +#define MUX_PC25G_CATB_SENSE25 6 +#define GPIO_PC25G_CATB_SENSE25 (1u << 25) +#define PIN_PB06G_CATB_SENSE26 38 /**< \brief CATB signal: SENSE26 on PB06 mux G */ +#define MUX_PB06G_CATB_SENSE26 6 +#define GPIO_PB06G_CATB_SENSE26 (1u << 6) +#define PIN_PC26G_CATB_SENSE26 90 /**< \brief CATB signal: SENSE26 on PC26 mux G */ +#define MUX_PC26G_CATB_SENSE26 6 +#define GPIO_PC26G_CATB_SENSE26 (1u << 26) +#define PIN_PB07G_CATB_SENSE27 39 /**< \brief CATB signal: SENSE27 on PB07 mux G */ +#define MUX_PB07G_CATB_SENSE27 6 +#define GPIO_PB07G_CATB_SENSE27 (1u << 7) +#define PIN_PC27G_CATB_SENSE27 91 /**< \brief CATB signal: SENSE27 on PC27 mux G */ +#define MUX_PC27G_CATB_SENSE27 6 +#define GPIO_PC27G_CATB_SENSE27 (1u << 27) +#define PIN_PB08G_CATB_SENSE28 40 /**< \brief CATB signal: SENSE28 on PB08 mux G */ +#define MUX_PB08G_CATB_SENSE28 6 +#define GPIO_PB08G_CATB_SENSE28 (1u << 8) +#define PIN_PC28G_CATB_SENSE28 92 /**< \brief CATB signal: SENSE28 on PC28 mux G */ +#define MUX_PC28G_CATB_SENSE28 6 +#define GPIO_PC28G_CATB_SENSE28 (1u << 28) +#define PIN_PB09G_CATB_SENSE29 41 /**< \brief CATB signal: SENSE29 on PB09 mux G */ +#define MUX_PB09G_CATB_SENSE29 6 +#define GPIO_PB09G_CATB_SENSE29 (1u << 9) +#define PIN_PC29G_CATB_SENSE29 93 /**< \brief CATB signal: SENSE29 on PC29 mux G */ +#define MUX_PC29G_CATB_SENSE29 6 +#define GPIO_PC29G_CATB_SENSE29 (1u << 29) +#define PIN_PB10G_CATB_SENSE30 42 /**< \brief CATB signal: SENSE30 on PB10 mux G */ +#define MUX_PB10G_CATB_SENSE30 6 +#define GPIO_PB10G_CATB_SENSE30 (1u << 10) +#define PIN_PC30G_CATB_SENSE30 94 /**< \brief CATB signal: SENSE30 on PC30 mux G */ +#define MUX_PC30G_CATB_SENSE30 6 +#define GPIO_PC30G_CATB_SENSE30 (1u << 30) +#define PIN_PB11G_CATB_SENSE31 43 /**< \brief CATB signal: SENSE31 on PB11 mux G */ +#define MUX_PB11G_CATB_SENSE31 6 +#define GPIO_PB11G_CATB_SENSE31 (1u << 11) +#define PIN_PC31G_CATB_SENSE31 95 /**< \brief CATB signal: SENSE31 on PC31 mux G */ +#define MUX_PC31G_CATB_SENSE31 6 +#define GPIO_PC31G_CATB_SENSE31 (1u << 31) +/* ========== GPIO definition for DACC peripheral ========== */ +#define PIN_PB04E_DACC_EXT_TRIG0 36 /**< \brief DACC signal: EXT_TRIG0 on PB04 mux E */ +#define MUX_PB04E_DACC_EXT_TRIG0 4 +#define GPIO_PB04E_DACC_EXT_TRIG0 (1u << 4) +#define PIN_PA06A_DACC_VOUT 6 /**< \brief DACC signal: VOUT on PA06 mux A */ +#define MUX_PA06A_DACC_VOUT 0 +#define GPIO_PA06A_DACC_VOUT (1u << 6) +/* ========== GPIO definition for EIC peripheral ========== */ +#define PIN_PB01C_EIC_EXTINT0 33 /**< \brief EIC signal: EXTINT0 on PB01 mux C */ +#define MUX_PB01C_EIC_EXTINT0 2 +#define GPIO_PB01C_EIC_EXTINT0 (1u << 1) +#define PIN_PA06C_EIC_EXTINT1 6 /**< \brief EIC signal: EXTINT1 on PA06 mux C */ +#define MUX_PA06C_EIC_EXTINT1 2 +#define GPIO_PA06C_EIC_EXTINT1 (1u << 6) +#define PIN_PA16C_EIC_EXTINT1 16 /**< \brief EIC signal: EXTINT1 on PA16 mux C */ +#define MUX_PA16C_EIC_EXTINT1 2 +#define GPIO_PA16C_EIC_EXTINT1 (1u << 16) +#define PIN_PC24B_EIC_EXTINT1 88 /**< \brief EIC signal: EXTINT1 on PC24 mux B */ +#define MUX_PC24B_EIC_EXTINT1 1 +#define GPIO_PC24B_EIC_EXTINT1 (1u << 24) +#define PIN_PA04C_EIC_EXTINT2 4 /**< \brief EIC signal: EXTINT2 on PA04 mux C */ +#define MUX_PA04C_EIC_EXTINT2 2 +#define GPIO_PA04C_EIC_EXTINT2 (1u << 4) +#define PIN_PA17C_EIC_EXTINT2 17 /**< \brief EIC signal: EXTINT2 on PA17 mux C */ +#define MUX_PA17C_EIC_EXTINT2 2 +#define GPIO_PA17C_EIC_EXTINT2 (1u << 17) +#define PIN_PC25B_EIC_EXTINT2 89 /**< \brief EIC signal: EXTINT2 on PC25 mux B */ +#define MUX_PC25B_EIC_EXTINT2 1 +#define GPIO_PC25B_EIC_EXTINT2 (1u << 25) +#define PIN_PA05C_EIC_EXTINT3 5 /**< \brief EIC signal: EXTINT3 on PA05 mux C */ +#define MUX_PA05C_EIC_EXTINT3 2 +#define GPIO_PA05C_EIC_EXTINT3 (1u << 5) +#define PIN_PA18C_EIC_EXTINT3 18 /**< \brief EIC signal: EXTINT3 on PA18 mux C */ +#define MUX_PA18C_EIC_EXTINT3 2 +#define GPIO_PA18C_EIC_EXTINT3 (1u << 18) +#define PIN_PC26B_EIC_EXTINT3 90 /**< \brief EIC signal: EXTINT3 on PC26 mux B */ +#define MUX_PC26B_EIC_EXTINT3 1 +#define GPIO_PC26B_EIC_EXTINT3 (1u << 26) +#define PIN_PA07C_EIC_EXTINT4 7 /**< \brief EIC signal: EXTINT4 on PA07 mux C */ +#define MUX_PA07C_EIC_EXTINT4 2 +#define GPIO_PA07C_EIC_EXTINT4 (1u << 7) +#define PIN_PA19C_EIC_EXTINT4 19 /**< \brief EIC signal: EXTINT4 on PA19 mux C */ +#define MUX_PA19C_EIC_EXTINT4 2 +#define GPIO_PA19C_EIC_EXTINT4 (1u << 19) +#define PIN_PC27B_EIC_EXTINT4 91 /**< \brief EIC signal: EXTINT4 on PC27 mux B */ +#define MUX_PC27B_EIC_EXTINT4 1 +#define GPIO_PC27B_EIC_EXTINT4 (1u << 27) +#define PIN_PA20C_EIC_EXTINT5 20 /**< \brief EIC signal: EXTINT5 on PA20 mux C */ +#define MUX_PA20C_EIC_EXTINT5 2 +#define GPIO_PA20C_EIC_EXTINT5 (1u << 20) +#define PIN_PC03B_EIC_EXTINT5 67 /**< \brief EIC signal: EXTINT5 on PC03 mux B */ +#define MUX_PC03B_EIC_EXTINT5 1 +#define GPIO_PC03B_EIC_EXTINT5 (1u << 3) +#define PIN_PA21C_EIC_EXTINT6 21 /**< \brief EIC signal: EXTINT6 on PA21 mux C */ +#define MUX_PA21C_EIC_EXTINT6 2 +#define GPIO_PA21C_EIC_EXTINT6 (1u << 21) +#define PIN_PC04B_EIC_EXTINT6 68 /**< \brief EIC signal: EXTINT6 on PC04 mux B */ +#define MUX_PC04B_EIC_EXTINT6 1 +#define GPIO_PC04B_EIC_EXTINT6 (1u << 4) +#define PIN_PA22C_EIC_EXTINT7 22 /**< \brief EIC signal: EXTINT7 on PA22 mux C */ +#define MUX_PA22C_EIC_EXTINT7 2 +#define GPIO_PA22C_EIC_EXTINT7 (1u << 22) +#define PIN_PC05B_EIC_EXTINT7 69 /**< \brief EIC signal: EXTINT7 on PC05 mux B */ +#define MUX_PC05B_EIC_EXTINT7 1 +#define GPIO_PC05B_EIC_EXTINT7 (1u << 5) +#define PIN_PA23C_EIC_EXTINT8 23 /**< \brief EIC signal: EXTINT8 on PA23 mux C */ +#define MUX_PA23C_EIC_EXTINT8 2 +#define GPIO_PA23C_EIC_EXTINT8 (1u << 23) +#define PIN_PC06B_EIC_EXTINT8 70 /**< \brief EIC signal: EXTINT8 on PC06 mux B */ +#define MUX_PC06B_EIC_EXTINT8 1 +#define GPIO_PC06B_EIC_EXTINT8 (1u << 6) +/* ========== GPIO definition for GLOC peripheral ========== */ +#define PIN_PA06D_GLOC_IN0 6 /**< \brief GLOC signal: IN0 on PA06 mux D */ +#define MUX_PA06D_GLOC_IN0 3 +#define GPIO_PA06D_GLOC_IN0 (1u << 6) +#define PIN_PA20D_GLOC_IN0 20 /**< \brief GLOC signal: IN0 on PA20 mux D */ +#define MUX_PA20D_GLOC_IN0 3 +#define GPIO_PA20D_GLOC_IN0 (1u << 20) +#define PIN_PA04D_GLOC_IN1 4 /**< \brief GLOC signal: IN1 on PA04 mux D */ +#define MUX_PA04D_GLOC_IN1 3 +#define GPIO_PA04D_GLOC_IN1 (1u << 4) +#define PIN_PA21D_GLOC_IN1 21 /**< \brief GLOC signal: IN1 on PA21 mux D */ +#define MUX_PA21D_GLOC_IN1 3 +#define GPIO_PA21D_GLOC_IN1 (1u << 21) +#define PIN_PA05D_GLOC_IN2 5 /**< \brief GLOC signal: IN2 on PA05 mux D */ +#define MUX_PA05D_GLOC_IN2 3 +#define GPIO_PA05D_GLOC_IN2 (1u << 5) +#define PIN_PA22D_GLOC_IN2 22 /**< \brief GLOC signal: IN2 on PA22 mux D */ +#define MUX_PA22D_GLOC_IN2 3 +#define GPIO_PA22D_GLOC_IN2 (1u << 22) +#define PIN_PA07D_GLOC_IN3 7 /**< \brief GLOC signal: IN3 on PA07 mux D */ +#define MUX_PA07D_GLOC_IN3 3 +#define GPIO_PA07D_GLOC_IN3 (1u << 7) +#define PIN_PA23D_GLOC_IN3 23 /**< \brief GLOC signal: IN3 on PA23 mux D */ +#define MUX_PA23D_GLOC_IN3 3 +#define GPIO_PA23D_GLOC_IN3 (1u << 23) +#define PIN_PA27D_GLOC_IN4 27 /**< \brief GLOC signal: IN4 on PA27 mux D */ +#define MUX_PA27D_GLOC_IN4 3 +#define GPIO_PA27D_GLOC_IN4 (1u << 27) +#define PIN_PC15D_GLOC_IN4 79 /**< \brief GLOC signal: IN4 on PC15 mux D */ +#define MUX_PC15D_GLOC_IN4 3 +#define GPIO_PC15D_GLOC_IN4 (1u << 15) +#define PIN_PB06C_GLOC_IN4 38 /**< \brief GLOC signal: IN4 on PB06 mux C */ +#define MUX_PB06C_GLOC_IN4 2 +#define GPIO_PB06C_GLOC_IN4 (1u << 6) +#define PIN_PC28C_GLOC_IN4 92 /**< \brief GLOC signal: IN4 on PC28 mux C */ +#define MUX_PC28C_GLOC_IN4 2 +#define GPIO_PC28C_GLOC_IN4 (1u << 28) +#define PIN_PA28D_GLOC_IN5 28 /**< \brief GLOC signal: IN5 on PA28 mux D */ +#define MUX_PA28D_GLOC_IN5 3 +#define GPIO_PA28D_GLOC_IN5 (1u << 28) +#define PIN_PC16D_GLOC_IN5 80 /**< \brief GLOC signal: IN5 on PC16 mux D */ +#define MUX_PC16D_GLOC_IN5 3 +#define GPIO_PC16D_GLOC_IN5 (1u << 16) +#define PIN_PB07C_GLOC_IN5 39 /**< \brief GLOC signal: IN5 on PB07 mux C */ +#define MUX_PB07C_GLOC_IN5 2 +#define GPIO_PB07C_GLOC_IN5 (1u << 7) +#define PIN_PC29C_GLOC_IN5 93 /**< \brief GLOC signal: IN5 on PC29 mux C */ +#define MUX_PC29C_GLOC_IN5 2 +#define GPIO_PC29C_GLOC_IN5 (1u << 29) +#define PIN_PA29D_GLOC_IN6 29 /**< \brief GLOC signal: IN6 on PA29 mux D */ +#define MUX_PA29D_GLOC_IN6 3 +#define GPIO_PA29D_GLOC_IN6 (1u << 29) +#define PIN_PC17D_GLOC_IN6 81 /**< \brief GLOC signal: IN6 on PC17 mux D */ +#define MUX_PC17D_GLOC_IN6 3 +#define GPIO_PC17D_GLOC_IN6 (1u << 17) +#define PIN_PB08C_GLOC_IN6 40 /**< \brief GLOC signal: IN6 on PB08 mux C */ +#define MUX_PB08C_GLOC_IN6 2 +#define GPIO_PB08C_GLOC_IN6 (1u << 8) +#define PIN_PC30C_GLOC_IN6 94 /**< \brief GLOC signal: IN6 on PC30 mux C */ +#define MUX_PC30C_GLOC_IN6 2 +#define GPIO_PC30C_GLOC_IN6 (1u << 30) +#define PIN_PA30D_GLOC_IN7 30 /**< \brief GLOC signal: IN7 on PA30 mux D */ +#define MUX_PA30D_GLOC_IN7 3 +#define GPIO_PA30D_GLOC_IN7 (1u << 30) +#define PIN_PC18D_GLOC_IN7 82 /**< \brief GLOC signal: IN7 on PC18 mux D */ +#define MUX_PC18D_GLOC_IN7 3 +#define GPIO_PC18D_GLOC_IN7 (1u << 18) +#define PIN_PB09C_GLOC_IN7 41 /**< \brief GLOC signal: IN7 on PB09 mux C */ +#define MUX_PB09C_GLOC_IN7 2 +#define GPIO_PB09C_GLOC_IN7 (1u << 9) +#define PIN_PA08D_GLOC_OUT0 8 /**< \brief GLOC signal: OUT0 on PA08 mux D */ +#define MUX_PA08D_GLOC_OUT0 3 +#define GPIO_PA08D_GLOC_OUT0 (1u << 8) +#define PIN_PA24D_GLOC_OUT0 24 /**< \brief GLOC signal: OUT0 on PA24 mux D */ +#define MUX_PA24D_GLOC_OUT0 3 +#define GPIO_PA24D_GLOC_OUT0 (1u << 24) +#define PIN_PA31D_GLOC_OUT1 31 /**< \brief GLOC signal: OUT1 on PA31 mux D */ +#define MUX_PA31D_GLOC_OUT1 3 +#define GPIO_PA31D_GLOC_OUT1 (1u << 31) +#define PIN_PC19D_GLOC_OUT1 83 /**< \brief GLOC signal: OUT1 on PC19 mux D */ +#define MUX_PC19D_GLOC_OUT1 3 +#define GPIO_PC19D_GLOC_OUT1 (1u << 19) +#define PIN_PB10C_GLOC_OUT1 42 /**< \brief GLOC signal: OUT1 on PB10 mux C */ +#define MUX_PB10C_GLOC_OUT1 2 +#define GPIO_PB10C_GLOC_OUT1 (1u << 10) +#define PIN_PC31C_GLOC_OUT1 95 /**< \brief GLOC signal: OUT1 on PC31 mux C */ +#define MUX_PC31C_GLOC_OUT1 2 +#define GPIO_PC31C_GLOC_OUT1 (1u << 31) +/* ========== GPIO definition for IISC peripheral ========== */ +#define PIN_PB05D_IISC_IMCK 37 /**< \brief IISC signal: IMCK on PB05 mux D */ +#define MUX_PB05D_IISC_IMCK 3 +#define GPIO_PB05D_IISC_IMCK (1u << 5) +#define PIN_PC14D_IISC_IMCK 78 /**< \brief IISC signal: IMCK on PC14 mux D */ +#define MUX_PC14D_IISC_IMCK 3 +#define GPIO_PC14D_IISC_IMCK (1u << 14) +#define PIN_PA31B_IISC_IMCK 31 /**< \brief IISC signal: IMCK on PA31 mux B */ +#define MUX_PA31B_IISC_IMCK 1 +#define GPIO_PA31B_IISC_IMCK (1u << 31) +#define PIN_PB02D_IISC_ISCK 34 /**< \brief IISC signal: ISCK on PB02 mux D */ +#define MUX_PB02D_IISC_ISCK 3 +#define GPIO_PB02D_IISC_ISCK (1u << 2) +#define PIN_PC09D_IISC_ISCK 73 /**< \brief IISC signal: ISCK on PC09 mux D */ +#define MUX_PC09D_IISC_ISCK 3 +#define GPIO_PC09D_IISC_ISCK (1u << 9) +#define PIN_PA27B_IISC_ISCK 27 /**< \brief IISC signal: ISCK on PA27 mux B */ +#define MUX_PA27B_IISC_ISCK 1 +#define GPIO_PA27B_IISC_ISCK (1u << 27) +#define PIN_PB03D_IISC_ISDI 35 /**< \brief IISC signal: ISDI on PB03 mux D */ +#define MUX_PB03D_IISC_ISDI 3 +#define GPIO_PB03D_IISC_ISDI (1u << 3) +#define PIN_PC10D_IISC_ISDI 74 /**< \brief IISC signal: ISDI on PC10 mux D */ +#define MUX_PC10D_IISC_ISDI 3 +#define GPIO_PC10D_IISC_ISDI (1u << 10) +#define PIN_PA28B_IISC_ISDI 28 /**< \brief IISC signal: ISDI on PA28 mux B */ +#define MUX_PA28B_IISC_ISDI 1 +#define GPIO_PA28B_IISC_ISDI (1u << 28) +#define PIN_PB04D_IISC_ISDO 36 /**< \brief IISC signal: ISDO on PB04 mux D */ +#define MUX_PB04D_IISC_ISDO 3 +#define GPIO_PB04D_IISC_ISDO (1u << 4) +#define PIN_PC13D_IISC_ISDO 77 /**< \brief IISC signal: ISDO on PC13 mux D */ +#define MUX_PC13D_IISC_ISDO 3 +#define GPIO_PC13D_IISC_ISDO (1u << 13) +#define PIN_PA30B_IISC_ISDO 30 /**< \brief IISC signal: ISDO on PA30 mux B */ +#define MUX_PA30B_IISC_ISDO 1 +#define GPIO_PA30B_IISC_ISDO (1u << 30) +#define PIN_PB06D_IISC_IWS 38 /**< \brief IISC signal: IWS on PB06 mux D */ +#define MUX_PB06D_IISC_IWS 3 +#define GPIO_PB06D_IISC_IWS (1u << 6) +#define PIN_PC12D_IISC_IWS 76 /**< \brief IISC signal: IWS on PC12 mux D */ +#define MUX_PC12D_IISC_IWS 3 +#define GPIO_PC12D_IISC_IWS (1u << 12) +#define PIN_PA29B_IISC_IWS 29 /**< \brief IISC signal: IWS on PA29 mux B */ +#define MUX_PA29B_IISC_IWS 1 +#define GPIO_PA29B_IISC_IWS (1u << 29) +/* ========== GPIO definition for LCDCA peripheral ========== */ +#define PIN_PA12F_LCDCA_COM0 12 /**< \brief LCDCA signal: COM0 on PA12 mux F */ +#define MUX_PA12F_LCDCA_COM0 5 +#define GPIO_PA12F_LCDCA_COM0 (1u << 12) +#define PIN_PA11F_LCDCA_COM1 11 /**< \brief LCDCA signal: COM1 on PA11 mux F */ +#define MUX_PA11F_LCDCA_COM1 5 +#define GPIO_PA11F_LCDCA_COM1 (1u << 11) +#define PIN_PA10F_LCDCA_COM2 10 /**< \brief LCDCA signal: COM2 on PA10 mux F */ +#define MUX_PA10F_LCDCA_COM2 5 +#define GPIO_PA10F_LCDCA_COM2 (1u << 10) +#define PIN_PA09F_LCDCA_COM3 9 /**< \brief LCDCA signal: COM3 on PA09 mux F */ +#define MUX_PA09F_LCDCA_COM3 5 +#define GPIO_PA09F_LCDCA_COM3 (1u << 9) +#define PIN_PC15F_LCDCA_SEG0 79 /**< \brief LCDCA signal: SEG0 on PC15 mux F */ +#define MUX_PC15F_LCDCA_SEG0 5 +#define GPIO_PC15F_LCDCA_SEG0 (1u << 15) +#define PIN_PC16F_LCDCA_SEG1 80 /**< \brief LCDCA signal: SEG1 on PC16 mux F */ +#define MUX_PC16F_LCDCA_SEG1 5 +#define GPIO_PC16F_LCDCA_SEG1 (1u << 16) +#define PIN_PC17F_LCDCA_SEG2 81 /**< \brief LCDCA signal: SEG2 on PC17 mux F */ +#define MUX_PC17F_LCDCA_SEG2 5 +#define GPIO_PC17F_LCDCA_SEG2 (1u << 17) +#define PIN_PC18F_LCDCA_SEG3 82 /**< \brief LCDCA signal: SEG3 on PC18 mux F */ +#define MUX_PC18F_LCDCA_SEG3 5 +#define GPIO_PC18F_LCDCA_SEG3 (1u << 18) +#define PIN_PC19F_LCDCA_SEG4 83 /**< \brief LCDCA signal: SEG4 on PC19 mux F */ +#define MUX_PC19F_LCDCA_SEG4 5 +#define GPIO_PC19F_LCDCA_SEG4 (1u << 19) +#define PIN_PA13F_LCDCA_SEG5 13 /**< \brief LCDCA signal: SEG5 on PA13 mux F */ +#define MUX_PA13F_LCDCA_SEG5 5 +#define GPIO_PA13F_LCDCA_SEG5 (1u << 13) +#define PIN_PA14F_LCDCA_SEG6 14 /**< \brief LCDCA signal: SEG6 on PA14 mux F */ +#define MUX_PA14F_LCDCA_SEG6 5 +#define GPIO_PA14F_LCDCA_SEG6 (1u << 14) +#define PIN_PA15F_LCDCA_SEG7 15 /**< \brief LCDCA signal: SEG7 on PA15 mux F */ +#define MUX_PA15F_LCDCA_SEG7 5 +#define GPIO_PA15F_LCDCA_SEG7 (1u << 15) +#define PIN_PA16F_LCDCA_SEG8 16 /**< \brief LCDCA signal: SEG8 on PA16 mux F */ +#define MUX_PA16F_LCDCA_SEG8 5 +#define GPIO_PA16F_LCDCA_SEG8 (1u << 16) +#define PIN_PA17F_LCDCA_SEG9 17 /**< \brief LCDCA signal: SEG9 on PA17 mux F */ +#define MUX_PA17F_LCDCA_SEG9 5 +#define GPIO_PA17F_LCDCA_SEG9 (1u << 17) +#define PIN_PC20F_LCDCA_SEG10 84 /**< \brief LCDCA signal: SEG10 on PC20 mux F */ +#define MUX_PC20F_LCDCA_SEG10 5 +#define GPIO_PC20F_LCDCA_SEG10 (1u << 20) +#define PIN_PC21F_LCDCA_SEG11 85 /**< \brief LCDCA signal: SEG11 on PC21 mux F */ +#define MUX_PC21F_LCDCA_SEG11 5 +#define GPIO_PC21F_LCDCA_SEG11 (1u << 21) +#define PIN_PC22F_LCDCA_SEG12 86 /**< \brief LCDCA signal: SEG12 on PC22 mux F */ +#define MUX_PC22F_LCDCA_SEG12 5 +#define GPIO_PC22F_LCDCA_SEG12 (1u << 22) +#define PIN_PC23F_LCDCA_SEG13 87 /**< \brief LCDCA signal: SEG13 on PC23 mux F */ +#define MUX_PC23F_LCDCA_SEG13 5 +#define GPIO_PC23F_LCDCA_SEG13 (1u << 23) +#define PIN_PB08F_LCDCA_SEG14 40 /**< \brief LCDCA signal: SEG14 on PB08 mux F */ +#define MUX_PB08F_LCDCA_SEG14 5 +#define GPIO_PB08F_LCDCA_SEG14 (1u << 8) +#define PIN_PB09F_LCDCA_SEG15 41 /**< \brief LCDCA signal: SEG15 on PB09 mux F */ +#define MUX_PB09F_LCDCA_SEG15 5 +#define GPIO_PB09F_LCDCA_SEG15 (1u << 9) +#define PIN_PB10F_LCDCA_SEG16 42 /**< \brief LCDCA signal: SEG16 on PB10 mux F */ +#define MUX_PB10F_LCDCA_SEG16 5 +#define GPIO_PB10F_LCDCA_SEG16 (1u << 10) +#define PIN_PB11F_LCDCA_SEG17 43 /**< \brief LCDCA signal: SEG17 on PB11 mux F */ +#define MUX_PB11F_LCDCA_SEG17 5 +#define GPIO_PB11F_LCDCA_SEG17 (1u << 11) +#define PIN_PA18F_LCDCA_SEG18 18 /**< \brief LCDCA signal: SEG18 on PA18 mux F */ +#define MUX_PA18F_LCDCA_SEG18 5 +#define GPIO_PA18F_LCDCA_SEG18 (1u << 18) +#define PIN_PA19F_LCDCA_SEG19 19 /**< \brief LCDCA signal: SEG19 on PA19 mux F */ +#define MUX_PA19F_LCDCA_SEG19 5 +#define GPIO_PA19F_LCDCA_SEG19 (1u << 19) +#define PIN_PA20F_LCDCA_SEG20 20 /**< \brief LCDCA signal: SEG20 on PA20 mux F */ +#define MUX_PA20F_LCDCA_SEG20 5 +#define GPIO_PA20F_LCDCA_SEG20 (1u << 20) +#define PIN_PB07F_LCDCA_SEG21 39 /**< \brief LCDCA signal: SEG21 on PB07 mux F */ +#define MUX_PB07F_LCDCA_SEG21 5 +#define GPIO_PB07F_LCDCA_SEG21 (1u << 7) +#define PIN_PB06F_LCDCA_SEG22 38 /**< \brief LCDCA signal: SEG22 on PB06 mux F */ +#define MUX_PB06F_LCDCA_SEG22 5 +#define GPIO_PB06F_LCDCA_SEG22 (1u << 6) +#define PIN_PA08F_LCDCA_SEG23 8 /**< \brief LCDCA signal: SEG23 on PA08 mux F */ +#define MUX_PA08F_LCDCA_SEG23 5 +#define GPIO_PA08F_LCDCA_SEG23 (1u << 8) +#define PIN_PC24F_LCDCA_SEG24 88 /**< \brief LCDCA signal: SEG24 on PC24 mux F */ +#define MUX_PC24F_LCDCA_SEG24 5 +#define GPIO_PC24F_LCDCA_SEG24 (1u << 24) +#define PIN_PC25F_LCDCA_SEG25 89 /**< \brief LCDCA signal: SEG25 on PC25 mux F */ +#define MUX_PC25F_LCDCA_SEG25 5 +#define GPIO_PC25F_LCDCA_SEG25 (1u << 25) +#define PIN_PC26F_LCDCA_SEG26 90 /**< \brief LCDCA signal: SEG26 on PC26 mux F */ +#define MUX_PC26F_LCDCA_SEG26 5 +#define GPIO_PC26F_LCDCA_SEG26 (1u << 26) +#define PIN_PC27F_LCDCA_SEG27 91 /**< \brief LCDCA signal: SEG27 on PC27 mux F */ +#define MUX_PC27F_LCDCA_SEG27 5 +#define GPIO_PC27F_LCDCA_SEG27 (1u << 27) +#define PIN_PC28F_LCDCA_SEG28 92 /**< \brief LCDCA signal: SEG28 on PC28 mux F */ +#define MUX_PC28F_LCDCA_SEG28 5 +#define GPIO_PC28F_LCDCA_SEG28 (1u << 28) +#define PIN_PC29F_LCDCA_SEG29 93 /**< \brief LCDCA signal: SEG29 on PC29 mux F */ +#define MUX_PC29F_LCDCA_SEG29 5 +#define GPIO_PC29F_LCDCA_SEG29 (1u << 29) +#define PIN_PC30F_LCDCA_SEG30 94 /**< \brief LCDCA signal: SEG30 on PC30 mux F */ +#define MUX_PC30F_LCDCA_SEG30 5 +#define GPIO_PC30F_LCDCA_SEG30 (1u << 30) +#define PIN_PC31F_LCDCA_SEG31 95 /**< \brief LCDCA signal: SEG31 on PC31 mux F */ +#define MUX_PC31F_LCDCA_SEG31 5 +#define GPIO_PC31F_LCDCA_SEG31 (1u << 31) +#define PIN_PB12F_LCDCA_SEG32 44 /**< \brief LCDCA signal: SEG32 on PB12 mux F */ +#define MUX_PB12F_LCDCA_SEG32 5 +#define GPIO_PB12F_LCDCA_SEG32 (1u << 12) +#define PIN_PB13F_LCDCA_SEG33 45 /**< \brief LCDCA signal: SEG33 on PB13 mux F */ +#define MUX_PB13F_LCDCA_SEG33 5 +#define GPIO_PB13F_LCDCA_SEG33 (1u << 13) +#define PIN_PA21F_LCDCA_SEG34 21 /**< \brief LCDCA signal: SEG34 on PA21 mux F */ +#define MUX_PA21F_LCDCA_SEG34 5 +#define GPIO_PA21F_LCDCA_SEG34 (1u << 21) +#define PIN_PA22F_LCDCA_SEG35 22 /**< \brief LCDCA signal: SEG35 on PA22 mux F */ +#define MUX_PA22F_LCDCA_SEG35 5 +#define GPIO_PA22F_LCDCA_SEG35 (1u << 22) +#define PIN_PB14F_LCDCA_SEG36 46 /**< \brief LCDCA signal: SEG36 on PB14 mux F */ +#define MUX_PB14F_LCDCA_SEG36 5 +#define GPIO_PB14F_LCDCA_SEG36 (1u << 14) +#define PIN_PB15F_LCDCA_SEG37 47 /**< \brief LCDCA signal: SEG37 on PB15 mux F */ +#define MUX_PB15F_LCDCA_SEG37 5 +#define GPIO_PB15F_LCDCA_SEG37 (1u << 15) +#define PIN_PA23F_LCDCA_SEG38 23 /**< \brief LCDCA signal: SEG38 on PA23 mux F */ +#define MUX_PA23F_LCDCA_SEG38 5 +#define GPIO_PA23F_LCDCA_SEG38 (1u << 23) +#define PIN_PA24F_LCDCA_SEG39 24 /**< \brief LCDCA signal: SEG39 on PA24 mux F */ +#define MUX_PA24F_LCDCA_SEG39 5 +#define GPIO_PA24F_LCDCA_SEG39 (1u << 24) +/* ========== GPIO definition for PARC peripheral ========== */ +#define PIN_PA17D_PARC_PCCK 17 /**< \brief PARC signal: PCCK on PA17 mux D */ +#define MUX_PA17D_PARC_PCCK 3 +#define GPIO_PA17D_PARC_PCCK (1u << 17) +#define PIN_PC21D_PARC_PCCK 85 /**< \brief PARC signal: PCCK on PC21 mux D */ +#define MUX_PC21D_PARC_PCCK 3 +#define GPIO_PC21D_PARC_PCCK (1u << 21) +#define PIN_PA09D_PARC_PCDATA0 9 /**< \brief PARC signal: PCDATA0 on PA09 mux D */ +#define MUX_PA09D_PARC_PCDATA0 3 +#define GPIO_PA09D_PARC_PCDATA0 (1u << 9) +#define PIN_PC24D_PARC_PCDATA0 88 /**< \brief PARC signal: PCDATA0 on PC24 mux D */ +#define MUX_PC24D_PARC_PCDATA0 3 +#define GPIO_PC24D_PARC_PCDATA0 (1u << 24) +#define PIN_PA10D_PARC_PCDATA1 10 /**< \brief PARC signal: PCDATA1 on PA10 mux D */ +#define MUX_PA10D_PARC_PCDATA1 3 +#define GPIO_PA10D_PARC_PCDATA1 (1u << 10) +#define PIN_PC25D_PARC_PCDATA1 89 /**< \brief PARC signal: PCDATA1 on PC25 mux D */ +#define MUX_PC25D_PARC_PCDATA1 3 +#define GPIO_PC25D_PARC_PCDATA1 (1u << 25) +#define PIN_PA11D_PARC_PCDATA2 11 /**< \brief PARC signal: PCDATA2 on PA11 mux D */ +#define MUX_PA11D_PARC_PCDATA2 3 +#define GPIO_PA11D_PARC_PCDATA2 (1u << 11) +#define PIN_PC26D_PARC_PCDATA2 90 /**< \brief PARC signal: PCDATA2 on PC26 mux D */ +#define MUX_PC26D_PARC_PCDATA2 3 +#define GPIO_PC26D_PARC_PCDATA2 (1u << 26) +#define PIN_PA12D_PARC_PCDATA3 12 /**< \brief PARC signal: PCDATA3 on PA12 mux D */ +#define MUX_PA12D_PARC_PCDATA3 3 +#define GPIO_PA12D_PARC_PCDATA3 (1u << 12) +#define PIN_PC27D_PARC_PCDATA3 91 /**< \brief PARC signal: PCDATA3 on PC27 mux D */ +#define MUX_PC27D_PARC_PCDATA3 3 +#define GPIO_PC27D_PARC_PCDATA3 (1u << 27) +#define PIN_PA13D_PARC_PCDATA4 13 /**< \brief PARC signal: PCDATA4 on PA13 mux D */ +#define MUX_PA13D_PARC_PCDATA4 3 +#define GPIO_PA13D_PARC_PCDATA4 (1u << 13) +#define PIN_PC28D_PARC_PCDATA4 92 /**< \brief PARC signal: PCDATA4 on PC28 mux D */ +#define MUX_PC28D_PARC_PCDATA4 3 +#define GPIO_PC28D_PARC_PCDATA4 (1u << 28) +#define PIN_PA14D_PARC_PCDATA5 14 /**< \brief PARC signal: PCDATA5 on PA14 mux D */ +#define MUX_PA14D_PARC_PCDATA5 3 +#define GPIO_PA14D_PARC_PCDATA5 (1u << 14) +#define PIN_PC29D_PARC_PCDATA5 93 /**< \brief PARC signal: PCDATA5 on PC29 mux D */ +#define MUX_PC29D_PARC_PCDATA5 3 +#define GPIO_PC29D_PARC_PCDATA5 (1u << 29) +#define PIN_PA15D_PARC_PCDATA6 15 /**< \brief PARC signal: PCDATA6 on PA15 mux D */ +#define MUX_PA15D_PARC_PCDATA6 3 +#define GPIO_PA15D_PARC_PCDATA6 (1u << 15) +#define PIN_PC30D_PARC_PCDATA6 94 /**< \brief PARC signal: PCDATA6 on PC30 mux D */ +#define MUX_PC30D_PARC_PCDATA6 3 +#define GPIO_PC30D_PARC_PCDATA6 (1u << 30) +#define PIN_PA16D_PARC_PCDATA7 16 /**< \brief PARC signal: PCDATA7 on PA16 mux D */ +#define MUX_PA16D_PARC_PCDATA7 3 +#define GPIO_PA16D_PARC_PCDATA7 (1u << 16) +#define PIN_PC31D_PARC_PCDATA7 95 /**< \brief PARC signal: PCDATA7 on PC31 mux D */ +#define MUX_PC31D_PARC_PCDATA7 3 +#define GPIO_PC31D_PARC_PCDATA7 (1u << 31) +#define PIN_PA18D_PARC_PCEN1 18 /**< \brief PARC signal: PCEN1 on PA18 mux D */ +#define MUX_PA18D_PARC_PCEN1 3 +#define GPIO_PA18D_PARC_PCEN1 (1u << 18) +#define PIN_PC22D_PARC_PCEN1 86 /**< \brief PARC signal: PCEN1 on PC22 mux D */ +#define MUX_PC22D_PARC_PCEN1 3 +#define GPIO_PC22D_PARC_PCEN1 (1u << 22) +#define PIN_PA19D_PARC_PCEN2 19 /**< \brief PARC signal: PCEN2 on PA19 mux D */ +#define MUX_PA19D_PARC_PCEN2 3 +#define GPIO_PA19D_PARC_PCEN2 (1u << 19) +#define PIN_PC23D_PARC_PCEN2 87 /**< \brief PARC signal: PCEN2 on PC23 mux D */ +#define MUX_PC23D_PARC_PCEN2 3 +#define GPIO_PC23D_PARC_PCEN2 (1u << 23) +/* ========== GPIO definition for PEVC peripheral ========== */ +#define PIN_PA08C_PEVC_PAD_EVT0 8 /**< \brief PEVC signal: PAD_EVT0 on PA08 mux C */ +#define MUX_PA08C_PEVC_PAD_EVT0 2 +#define GPIO_PA08C_PEVC_PAD_EVT0 (1u << 8) +#define PIN_PB12C_PEVC_PAD_EVT0 44 /**< \brief PEVC signal: PAD_EVT0 on PB12 mux C */ +#define MUX_PB12C_PEVC_PAD_EVT0 2 +#define GPIO_PB12C_PEVC_PAD_EVT0 (1u << 12) +#define PIN_PC07C_PEVC_PAD_EVT0 71 /**< \brief PEVC signal: PAD_EVT0 on PC07 mux C */ +#define MUX_PC07C_PEVC_PAD_EVT0 2 +#define GPIO_PC07C_PEVC_PAD_EVT0 (1u << 7) +#define PIN_PC24C_PEVC_PAD_EVT0 88 /**< \brief PEVC signal: PAD_EVT0 on PC24 mux C */ +#define MUX_PC24C_PEVC_PAD_EVT0 2 +#define GPIO_PC24C_PEVC_PAD_EVT0 (1u << 24) +#define PIN_PA09C_PEVC_PAD_EVT1 9 /**< \brief PEVC signal: PAD_EVT1 on PA09 mux C */ +#define MUX_PA09C_PEVC_PAD_EVT1 2 +#define GPIO_PA09C_PEVC_PAD_EVT1 (1u << 9) +#define PIN_PB13C_PEVC_PAD_EVT1 45 /**< \brief PEVC signal: PAD_EVT1 on PB13 mux C */ +#define MUX_PB13C_PEVC_PAD_EVT1 2 +#define GPIO_PB13C_PEVC_PAD_EVT1 (1u << 13) +#define PIN_PC08C_PEVC_PAD_EVT1 72 /**< \brief PEVC signal: PAD_EVT1 on PC08 mux C */ +#define MUX_PC08C_PEVC_PAD_EVT1 2 +#define GPIO_PC08C_PEVC_PAD_EVT1 (1u << 8) +#define PIN_PC25C_PEVC_PAD_EVT1 89 /**< \brief PEVC signal: PAD_EVT1 on PC25 mux C */ +#define MUX_PC25C_PEVC_PAD_EVT1 2 +#define GPIO_PC25C_PEVC_PAD_EVT1 (1u << 25) +#define PIN_PA10C_PEVC_PAD_EVT2 10 /**< \brief PEVC signal: PAD_EVT2 on PA10 mux C */ +#define MUX_PA10C_PEVC_PAD_EVT2 2 +#define GPIO_PA10C_PEVC_PAD_EVT2 (1u << 10) +#define PIN_PC11C_PEVC_PAD_EVT2 75 /**< \brief PEVC signal: PAD_EVT2 on PC11 mux C */ +#define MUX_PC11C_PEVC_PAD_EVT2 2 +#define GPIO_PC11C_PEVC_PAD_EVT2 (1u << 11) +#define PIN_PC26C_PEVC_PAD_EVT2 90 /**< \brief PEVC signal: PAD_EVT2 on PC26 mux C */ +#define MUX_PC26C_PEVC_PAD_EVT2 2 +#define GPIO_PC26C_PEVC_PAD_EVT2 (1u << 26) +#define PIN_PB09B_PEVC_PAD_EVT2 41 /**< \brief PEVC signal: PAD_EVT2 on PB09 mux B */ +#define MUX_PB09B_PEVC_PAD_EVT2 1 +#define GPIO_PB09B_PEVC_PAD_EVT2 (1u << 9) +#define PIN_PA11C_PEVC_PAD_EVT3 11 /**< \brief PEVC signal: PAD_EVT3 on PA11 mux C */ +#define MUX_PA11C_PEVC_PAD_EVT3 2 +#define GPIO_PA11C_PEVC_PAD_EVT3 (1u << 11) +#define PIN_PC27C_PEVC_PAD_EVT3 91 /**< \brief PEVC signal: PAD_EVT3 on PC27 mux C */ +#define MUX_PC27C_PEVC_PAD_EVT3 2 +#define GPIO_PC27C_PEVC_PAD_EVT3 (1u << 27) +#define PIN_PB10B_PEVC_PAD_EVT3 42 /**< \brief PEVC signal: PAD_EVT3 on PB10 mux B */ +#define MUX_PB10B_PEVC_PAD_EVT3 1 +#define GPIO_PB10B_PEVC_PAD_EVT3 (1u << 10) +/* ========== GPIO definition for SCIF peripheral ========== */ +#define PIN_PA19E_SCIF_GCLK0 19 /**< \brief SCIF signal: GCLK0 on PA19 mux E */ +#define MUX_PA19E_SCIF_GCLK0 4 +#define GPIO_PA19E_SCIF_GCLK0 (1u << 19) +#define PIN_PB10E_SCIF_GCLK0 42 /**< \brief SCIF signal: GCLK0 on PB10 mux E */ +#define MUX_PB10E_SCIF_GCLK0 4 +#define GPIO_PB10E_SCIF_GCLK0 (1u << 10) +#define PIN_PC26E_SCIF_GCLK0 90 /**< \brief SCIF signal: GCLK0 on PC26 mux E */ +#define MUX_PC26E_SCIF_GCLK0 4 +#define GPIO_PC26E_SCIF_GCLK0 (1u << 26) +#define PIN_PA02A_SCIF_GCLK0 2 /**< \brief SCIF signal: GCLK0 on PA02 mux A */ +#define MUX_PA02A_SCIF_GCLK0 0 +#define GPIO_PA02A_SCIF_GCLK0 (1u << 2) +#define PIN_PA20E_SCIF_GCLK1 20 /**< \brief SCIF signal: GCLK1 on PA20 mux E */ +#define MUX_PA20E_SCIF_GCLK1 4 +#define GPIO_PA20E_SCIF_GCLK1 (1u << 20) +#define PIN_PB11E_SCIF_GCLK1 43 /**< \brief SCIF signal: GCLK1 on PB11 mux E */ +#define MUX_PB11E_SCIF_GCLK1 4 +#define GPIO_PB11E_SCIF_GCLK1 (1u << 11) +#define PIN_PC27E_SCIF_GCLK1 91 /**< \brief SCIF signal: GCLK1 on PC27 mux E */ +#define MUX_PC27E_SCIF_GCLK1 4 +#define GPIO_PC27E_SCIF_GCLK1 (1u << 27) +#define PIN_PB12E_SCIF_GCLK2 44 /**< \brief SCIF signal: GCLK2 on PB12 mux E */ +#define MUX_PB12E_SCIF_GCLK2 4 +#define GPIO_PB12E_SCIF_GCLK2 (1u << 12) +#define PIN_PC28E_SCIF_GCLK2 92 /**< \brief SCIF signal: GCLK2 on PC28 mux E */ +#define MUX_PC28E_SCIF_GCLK2 4 +#define GPIO_PC28E_SCIF_GCLK2 (1u << 28) +#define PIN_PB13E_SCIF_GCLK3 45 /**< \brief SCIF signal: GCLK3 on PB13 mux E */ +#define MUX_PB13E_SCIF_GCLK3 4 +#define GPIO_PB13E_SCIF_GCLK3 (1u << 13) +#define PIN_PC29E_SCIF_GCLK3 93 /**< \brief SCIF signal: GCLK3 on PC29 mux E */ +#define MUX_PC29E_SCIF_GCLK3 4 +#define GPIO_PC29E_SCIF_GCLK3 (1u << 29) +#define PIN_PA23E_SCIF_GCLK_IN0 23 /**< \brief SCIF signal: GCLK_IN0 on PA23 mux E */ +#define MUX_PA23E_SCIF_GCLK_IN0 4 +#define GPIO_PA23E_SCIF_GCLK_IN0 (1u << 23) +#define PIN_PB14E_SCIF_GCLK_IN0 46 /**< \brief SCIF signal: GCLK_IN0 on PB14 mux E */ +#define MUX_PB14E_SCIF_GCLK_IN0 4 +#define GPIO_PB14E_SCIF_GCLK_IN0 (1u << 14) +#define PIN_PC30E_SCIF_GCLK_IN0 94 /**< \brief SCIF signal: GCLK_IN0 on PC30 mux E */ +#define MUX_PC30E_SCIF_GCLK_IN0 4 +#define GPIO_PC30E_SCIF_GCLK_IN0 (1u << 30) +#define PIN_PA24E_SCIF_GCLK_IN1 24 /**< \brief SCIF signal: GCLK_IN1 on PA24 mux E */ +#define MUX_PA24E_SCIF_GCLK_IN1 4 +#define GPIO_PA24E_SCIF_GCLK_IN1 (1u << 24) +#define PIN_PB15E_SCIF_GCLK_IN1 47 /**< \brief SCIF signal: GCLK_IN1 on PB15 mux E */ +#define MUX_PB15E_SCIF_GCLK_IN1 4 +#define GPIO_PB15E_SCIF_GCLK_IN1 (1u << 15) +#define PIN_PC31E_SCIF_GCLK_IN1 95 /**< \brief SCIF signal: GCLK_IN1 on PC31 mux E */ +#define MUX_PC31E_SCIF_GCLK_IN1 4 +#define GPIO_PC31E_SCIF_GCLK_IN1 (1u << 31) +/* ========== GPIO definition for SPI peripheral ========== */ +#define PIN_PA03B_SPI_MISO 3 /**< \brief SPI signal: MISO on PA03 mux B */ +#define MUX_PA03B_SPI_MISO 1 +#define GPIO_PA03B_SPI_MISO (1u << 3) +#define PIN_PB14B_SPI_MISO 46 /**< \brief SPI signal: MISO on PB14 mux B */ +#define MUX_PB14B_SPI_MISO 1 +#define GPIO_PB14B_SPI_MISO (1u << 14) +#define PIN_PC28B_SPI_MISO 92 /**< \brief SPI signal: MISO on PC28 mux B */ +#define MUX_PC28B_SPI_MISO 1 +#define GPIO_PC28B_SPI_MISO (1u << 28) +#define PIN_PA21A_SPI_MISO 21 /**< \brief SPI signal: MISO on PA21 mux A */ +#define MUX_PA21A_SPI_MISO 0 +#define GPIO_PA21A_SPI_MISO (1u << 21) +#define PIN_PA27A_SPI_MISO 27 /**< \brief SPI signal: MISO on PA27 mux A */ +#define MUX_PA27A_SPI_MISO 0 +#define GPIO_PA27A_SPI_MISO (1u << 27) +#define PIN_PC04A_SPI_MISO 68 /**< \brief SPI signal: MISO on PC04 mux A */ +#define MUX_PC04A_SPI_MISO 0 +#define GPIO_PC04A_SPI_MISO (1u << 4) +#define PIN_PB15B_SPI_MOSI 47 /**< \brief SPI signal: MOSI on PB15 mux B */ +#define MUX_PB15B_SPI_MOSI 1 +#define GPIO_PB15B_SPI_MOSI (1u << 15) +#define PIN_PC29B_SPI_MOSI 93 /**< \brief SPI signal: MOSI on PC29 mux B */ +#define MUX_PC29B_SPI_MOSI 1 +#define GPIO_PC29B_SPI_MOSI (1u << 29) +#define PIN_PA22A_SPI_MOSI 22 /**< \brief SPI signal: MOSI on PA22 mux A */ +#define MUX_PA22A_SPI_MOSI 0 +#define GPIO_PA22A_SPI_MOSI (1u << 22) +#define PIN_PA28A_SPI_MOSI 28 /**< \brief SPI signal: MOSI on PA28 mux A */ +#define MUX_PA28A_SPI_MOSI 0 +#define GPIO_PA28A_SPI_MOSI (1u << 28) +#define PIN_PC05A_SPI_MOSI 69 /**< \brief SPI signal: MOSI on PC05 mux A */ +#define MUX_PC05A_SPI_MOSI 0 +#define GPIO_PC05A_SPI_MOSI (1u << 5) +#define PIN_PA02B_SPI_NPCS0 2 /**< \brief SPI signal: NPCS0 on PA02 mux B */ +#define MUX_PA02B_SPI_NPCS0 1 +#define GPIO_PA02B_SPI_NPCS0 (1u << 2) +#define PIN_PC31B_SPI_NPCS0 95 /**< \brief SPI signal: NPCS0 on PC31 mux B */ +#define MUX_PC31B_SPI_NPCS0 1 +#define GPIO_PC31B_SPI_NPCS0 (1u << 31) +#define PIN_PA24A_SPI_NPCS0 24 /**< \brief SPI signal: NPCS0 on PA24 mux A */ +#define MUX_PA24A_SPI_NPCS0 0 +#define GPIO_PA24A_SPI_NPCS0 (1u << 24) +#define PIN_PA30A_SPI_NPCS0 30 /**< \brief SPI signal: NPCS0 on PA30 mux A */ +#define MUX_PA30A_SPI_NPCS0 0 +#define GPIO_PA30A_SPI_NPCS0 (1u << 30) +#define PIN_PC03A_SPI_NPCS0 67 /**< \brief SPI signal: NPCS0 on PC03 mux A */ +#define MUX_PC03A_SPI_NPCS0 0 +#define GPIO_PC03A_SPI_NPCS0 (1u << 3) +#define PIN_PA13C_SPI_NPCS1 13 /**< \brief SPI signal: NPCS1 on PA13 mux C */ +#define MUX_PA13C_SPI_NPCS1 2 +#define GPIO_PA13C_SPI_NPCS1 (1u << 13) +#define PIN_PB13B_SPI_NPCS1 45 /**< \brief SPI signal: NPCS1 on PB13 mux B */ +#define MUX_PB13B_SPI_NPCS1 1 +#define GPIO_PB13B_SPI_NPCS1 (1u << 13) +#define PIN_PA31A_SPI_NPCS1 31 /**< \brief SPI signal: NPCS1 on PA31 mux A */ +#define MUX_PA31A_SPI_NPCS1 0 +#define GPIO_PA31A_SPI_NPCS1 (1u << 31) +#define PIN_PC02A_SPI_NPCS1 66 /**< \brief SPI signal: NPCS1 on PC02 mux A */ +#define MUX_PC02A_SPI_NPCS1 0 +#define GPIO_PC02A_SPI_NPCS1 (1u << 2) +#define PIN_PA14C_SPI_NPCS2 14 /**< \brief SPI signal: NPCS2 on PA14 mux C */ +#define MUX_PA14C_SPI_NPCS2 2 +#define GPIO_PA14C_SPI_NPCS2 (1u << 14) +#define PIN_PB11B_SPI_NPCS2 43 /**< \brief SPI signal: NPCS2 on PB11 mux B */ +#define MUX_PB11B_SPI_NPCS2 1 +#define GPIO_PB11B_SPI_NPCS2 (1u << 11) +#define PIN_PC00A_SPI_NPCS2 64 /**< \brief SPI signal: NPCS2 on PC00 mux A */ +#define MUX_PC00A_SPI_NPCS2 0 +#define GPIO_PC00A_SPI_NPCS2 (1u << 0) +#define PIN_PA15C_SPI_NPCS3 15 /**< \brief SPI signal: NPCS3 on PA15 mux C */ +#define MUX_PA15C_SPI_NPCS3 2 +#define GPIO_PA15C_SPI_NPCS3 (1u << 15) +#define PIN_PB12B_SPI_NPCS3 44 /**< \brief SPI signal: NPCS3 on PB12 mux B */ +#define MUX_PB12B_SPI_NPCS3 1 +#define GPIO_PB12B_SPI_NPCS3 (1u << 12) +#define PIN_PC01A_SPI_NPCS3 65 /**< \brief SPI signal: NPCS3 on PC01 mux A */ +#define MUX_PC01A_SPI_NPCS3 0 +#define GPIO_PC01A_SPI_NPCS3 (1u << 1) +#define PIN_PC30B_SPI_SCK 94 /**< \brief SPI signal: SCK on PC30 mux B */ +#define MUX_PC30B_SPI_SCK 1 +#define GPIO_PC30B_SPI_SCK (1u << 30) +#define PIN_PA23A_SPI_SCK 23 /**< \brief SPI signal: SCK on PA23 mux A */ +#define MUX_PA23A_SPI_SCK 0 +#define GPIO_PA23A_SPI_SCK (1u << 23) +#define PIN_PA29A_SPI_SCK 29 /**< \brief SPI signal: SCK on PA29 mux A */ +#define MUX_PA29A_SPI_SCK 0 +#define GPIO_PA29A_SPI_SCK (1u << 29) +#define PIN_PC06A_SPI_SCK 70 /**< \brief SPI signal: SCK on PC06 mux A */ +#define MUX_PC06A_SPI_SCK 0 +#define GPIO_PC06A_SPI_SCK (1u << 6) +/* ========== GPIO definition for TC0 peripheral ========== */ +#define PIN_PB07D_TC0_A0 39 /**< \brief TC0 signal: A0 on PB07 mux D */ +#define MUX_PB07D_TC0_A0 3 +#define GPIO_PB07D_TC0_A0 (1u << 7) +#define PIN_PA08B_TC0_A0 8 /**< \brief TC0 signal: A0 on PA08 mux B */ +#define MUX_PA08B_TC0_A0 1 +#define GPIO_PA08B_TC0_A0 (1u << 8) +#define PIN_PB09D_TC0_A1 41 /**< \brief TC0 signal: A1 on PB09 mux D */ +#define MUX_PB09D_TC0_A1 3 +#define GPIO_PB09D_TC0_A1 (1u << 9) +#define PIN_PA10B_TC0_A1 10 /**< \brief TC0 signal: A1 on PA10 mux B */ +#define MUX_PA10B_TC0_A1 1 +#define GPIO_PA10B_TC0_A1 (1u << 10) +#define PIN_PB11D_TC0_A2 43 /**< \brief TC0 signal: A2 on PB11 mux D */ +#define MUX_PB11D_TC0_A2 3 +#define GPIO_PB11D_TC0_A2 (1u << 11) +#define PIN_PA12B_TC0_A2 12 /**< \brief TC0 signal: A2 on PA12 mux B */ +#define MUX_PA12B_TC0_A2 1 +#define GPIO_PA12B_TC0_A2 (1u << 12) +#define PIN_PB08D_TC0_B0 40 /**< \brief TC0 signal: B0 on PB08 mux D */ +#define MUX_PB08D_TC0_B0 3 +#define GPIO_PB08D_TC0_B0 (1u << 8) +#define PIN_PA09B_TC0_B0 9 /**< \brief TC0 signal: B0 on PA09 mux B */ +#define MUX_PA09B_TC0_B0 1 +#define GPIO_PA09B_TC0_B0 (1u << 9) +#define PIN_PB10D_TC0_B1 42 /**< \brief TC0 signal: B1 on PB10 mux D */ +#define MUX_PB10D_TC0_B1 3 +#define GPIO_PB10D_TC0_B1 (1u << 10) +#define PIN_PA11B_TC0_B1 11 /**< \brief TC0 signal: B1 on PA11 mux B */ +#define MUX_PA11B_TC0_B1 1 +#define GPIO_PA11B_TC0_B1 (1u << 11) +#define PIN_PB12D_TC0_B2 44 /**< \brief TC0 signal: B2 on PB12 mux D */ +#define MUX_PB12D_TC0_B2 3 +#define GPIO_PB12D_TC0_B2 (1u << 12) +#define PIN_PA13B_TC0_B2 13 /**< \brief TC0 signal: B2 on PA13 mux B */ +#define MUX_PA13B_TC0_B2 1 +#define GPIO_PA13B_TC0_B2 (1u << 13) +#define PIN_PB13D_TC0_CLK0 45 /**< \brief TC0 signal: CLK0 on PB13 mux D */ +#define MUX_PB13D_TC0_CLK0 3 +#define GPIO_PB13D_TC0_CLK0 (1u << 13) +#define PIN_PA14B_TC0_CLK0 14 /**< \brief TC0 signal: CLK0 on PA14 mux B */ +#define MUX_PA14B_TC0_CLK0 1 +#define GPIO_PA14B_TC0_CLK0 (1u << 14) +#define PIN_PB14D_TC0_CLK1 46 /**< \brief TC0 signal: CLK1 on PB14 mux D */ +#define MUX_PB14D_TC0_CLK1 3 +#define GPIO_PB14D_TC0_CLK1 (1u << 14) +#define PIN_PA15B_TC0_CLK1 15 /**< \brief TC0 signal: CLK1 on PA15 mux B */ +#define MUX_PA15B_TC0_CLK1 1 +#define GPIO_PA15B_TC0_CLK1 (1u << 15) +#define PIN_PB15D_TC0_CLK2 47 /**< \brief TC0 signal: CLK2 on PB15 mux D */ +#define MUX_PB15D_TC0_CLK2 3 +#define GPIO_PB15D_TC0_CLK2 (1u << 15) +#define PIN_PA16B_TC0_CLK2 16 /**< \brief TC0 signal: CLK2 on PA16 mux B */ +#define MUX_PA16B_TC0_CLK2 1 +#define GPIO_PA16B_TC0_CLK2 (1u << 16) +/* ========== GPIO definition for TC1 peripheral ========== */ +#define PIN_PC00D_TC1_A0 64 /**< \brief TC1 signal: A0 on PC00 mux D */ +#define MUX_PC00D_TC1_A0 3 +#define GPIO_PC00D_TC1_A0 (1u << 0) +#define PIN_PC15A_TC1_A0 79 /**< \brief TC1 signal: A0 on PC15 mux A */ +#define MUX_PC15A_TC1_A0 0 +#define GPIO_PC15A_TC1_A0 (1u << 15) +#define PIN_PC02D_TC1_A1 66 /**< \brief TC1 signal: A1 on PC02 mux D */ +#define MUX_PC02D_TC1_A1 3 +#define GPIO_PC02D_TC1_A1 (1u << 2) +#define PIN_PC17A_TC1_A1 81 /**< \brief TC1 signal: A1 on PC17 mux A */ +#define MUX_PC17A_TC1_A1 0 +#define GPIO_PC17A_TC1_A1 (1u << 17) +#define PIN_PC04D_TC1_A2 68 /**< \brief TC1 signal: A2 on PC04 mux D */ +#define MUX_PC04D_TC1_A2 3 +#define GPIO_PC04D_TC1_A2 (1u << 4) +#define PIN_PC19A_TC1_A2 83 /**< \brief TC1 signal: A2 on PC19 mux A */ +#define MUX_PC19A_TC1_A2 0 +#define GPIO_PC19A_TC1_A2 (1u << 19) +#define PIN_PC01D_TC1_B0 65 /**< \brief TC1 signal: B0 on PC01 mux D */ +#define MUX_PC01D_TC1_B0 3 +#define GPIO_PC01D_TC1_B0 (1u << 1) +#define PIN_PC16A_TC1_B0 80 /**< \brief TC1 signal: B0 on PC16 mux A */ +#define MUX_PC16A_TC1_B0 0 +#define GPIO_PC16A_TC1_B0 (1u << 16) +#define PIN_PC03D_TC1_B1 67 /**< \brief TC1 signal: B1 on PC03 mux D */ +#define MUX_PC03D_TC1_B1 3 +#define GPIO_PC03D_TC1_B1 (1u << 3) +#define PIN_PC18A_TC1_B1 82 /**< \brief TC1 signal: B1 on PC18 mux A */ +#define MUX_PC18A_TC1_B1 0 +#define GPIO_PC18A_TC1_B1 (1u << 18) +#define PIN_PC05D_TC1_B2 69 /**< \brief TC1 signal: B2 on PC05 mux D */ +#define MUX_PC05D_TC1_B2 3 +#define GPIO_PC05D_TC1_B2 (1u << 5) +#define PIN_PC20A_TC1_B2 84 /**< \brief TC1 signal: B2 on PC20 mux A */ +#define MUX_PC20A_TC1_B2 0 +#define GPIO_PC20A_TC1_B2 (1u << 20) +#define PIN_PC06D_TC1_CLK0 70 /**< \brief TC1 signal: CLK0 on PC06 mux D */ +#define MUX_PC06D_TC1_CLK0 3 +#define GPIO_PC06D_TC1_CLK0 (1u << 6) +#define PIN_PC21A_TC1_CLK0 85 /**< \brief TC1 signal: CLK0 on PC21 mux A */ +#define MUX_PC21A_TC1_CLK0 0 +#define GPIO_PC21A_TC1_CLK0 (1u << 21) +#define PIN_PC07D_TC1_CLK1 71 /**< \brief TC1 signal: CLK1 on PC07 mux D */ +#define MUX_PC07D_TC1_CLK1 3 +#define GPIO_PC07D_TC1_CLK1 (1u << 7) +#define PIN_PC22A_TC1_CLK1 86 /**< \brief TC1 signal: CLK1 on PC22 mux A */ +#define MUX_PC22A_TC1_CLK1 0 +#define GPIO_PC22A_TC1_CLK1 (1u << 22) +#define PIN_PC08D_TC1_CLK2 72 /**< \brief TC1 signal: CLK2 on PC08 mux D */ +#define MUX_PC08D_TC1_CLK2 3 +#define GPIO_PC08D_TC1_CLK2 (1u << 8) +#define PIN_PC23A_TC1_CLK2 87 /**< \brief TC1 signal: CLK2 on PC23 mux A */ +#define MUX_PC23A_TC1_CLK2 0 +#define GPIO_PC23A_TC1_CLK2 (1u << 23) +/* ========== GPIO definition for TWIMS0 peripheral ========== */ +#define PIN_PA24B_TWIMS0_TWCK 24 /**< \brief TWIMS0 signal: TWCK on PA24 mux B */ +#define MUX_PA24B_TWIMS0_TWCK 1 +#define GPIO_PA24B_TWIMS0_TWCK (1u << 24) +#define PIN_PA23B_TWIMS0_TWD 23 /**< \brief TWIMS0 signal: TWD on PA23 mux B */ +#define MUX_PA23B_TWIMS0_TWD 1 +#define GPIO_PA23B_TWIMS0_TWD (1u << 23) +/* ========== GPIO definition for TWIMS1 peripheral ========== */ +#define PIN_PB01A_TWIMS1_TWCK 33 /**< \brief TWIMS1 signal: TWCK on PB01 mux A */ +#define MUX_PB01A_TWIMS1_TWCK 0 +#define GPIO_PB01A_TWIMS1_TWCK (1u << 1) +#define PIN_PB00A_TWIMS1_TWD 32 /**< \brief TWIMS1 signal: TWD on PB00 mux A */ +#define MUX_PB00A_TWIMS1_TWD 0 +#define GPIO_PB00A_TWIMS1_TWD (1u << 0) +/* ========== GPIO definition for TWIMS2 peripheral ========== */ +#define PIN_PA22E_TWIMS2_TWCK 22 /**< \brief TWIMS2 signal: TWCK on PA22 mux E */ +#define MUX_PA22E_TWIMS2_TWCK 4 +#define GPIO_PA22E_TWIMS2_TWCK (1u << 22) +#define PIN_PA21E_TWIMS2_TWD 21 /**< \brief TWIMS2 signal: TWD on PA21 mux E */ +#define MUX_PA21E_TWIMS2_TWD 4 +#define GPIO_PA21E_TWIMS2_TWD (1u << 21) +/* ========== GPIO definition for TWIMS3 peripheral ========== */ +#define PIN_PB15C_TWIMS3_TWCK 47 /**< \brief TWIMS3 signal: TWCK on PB15 mux C */ +#define MUX_PB15C_TWIMS3_TWCK 2 +#define GPIO_PB15C_TWIMS3_TWCK (1u << 15) +#define PIN_PB14C_TWIMS3_TWD 46 /**< \brief TWIMS3 signal: TWD on PB14 mux C */ +#define MUX_PB14C_TWIMS3_TWD 2 +#define GPIO_PB14C_TWIMS3_TWD (1u << 14) +/* ========== GPIO definition for USART0 peripheral ========== */ +#define PIN_PA04B_USART0_CLK 4 /**< \brief USART0 signal: CLK on PA04 mux B */ +#define MUX_PA04B_USART0_CLK 1 +#define GPIO_PA04B_USART0_CLK (1u << 4) +#define PIN_PC00B_USART0_CLK 64 /**< \brief USART0 signal: CLK on PC00 mux B */ +#define MUX_PC00B_USART0_CLK 1 +#define GPIO_PC00B_USART0_CLK (1u << 0) +#define PIN_PA10A_USART0_CLK 10 /**< \brief USART0 signal: CLK on PA10 mux A */ +#define MUX_PA10A_USART0_CLK 0 +#define GPIO_PA10A_USART0_CLK (1u << 10) +#define PIN_PB13A_USART0_CLK 45 /**< \brief USART0 signal: CLK on PB13 mux A */ +#define MUX_PB13A_USART0_CLK 0 +#define GPIO_PB13A_USART0_CLK (1u << 13) +#define PIN_PC02B_USART0_CTS 66 /**< \brief USART0 signal: CTS on PC02 mux B */ +#define MUX_PC02B_USART0_CTS 1 +#define GPIO_PC02B_USART0_CTS (1u << 2) +#define PIN_PA09A_USART0_CTS 9 /**< \brief USART0 signal: CTS on PA09 mux A */ +#define MUX_PA09A_USART0_CTS 0 +#define GPIO_PA09A_USART0_CTS (1u << 9) +#define PIN_PB11A_USART0_CTS 43 /**< \brief USART0 signal: CTS on PB11 mux A */ +#define MUX_PB11A_USART0_CTS 0 +#define GPIO_PB11A_USART0_CTS (1u << 11) +#define PIN_PA06B_USART0_RTS 6 /**< \brief USART0 signal: RTS on PA06 mux B */ +#define MUX_PA06B_USART0_RTS 1 +#define GPIO_PA06B_USART0_RTS (1u << 6) +#define PIN_PC01B_USART0_RTS 65 /**< \brief USART0 signal: RTS on PC01 mux B */ +#define MUX_PC01B_USART0_RTS 1 +#define GPIO_PC01B_USART0_RTS (1u << 1) +#define PIN_PA08A_USART0_RTS 8 /**< \brief USART0 signal: RTS on PA08 mux A */ +#define MUX_PA08A_USART0_RTS 0 +#define GPIO_PA08A_USART0_RTS (1u << 8) +#define PIN_PB12A_USART0_RTS 44 /**< \brief USART0 signal: RTS on PB12 mux A */ +#define MUX_PB12A_USART0_RTS 0 +#define GPIO_PB12A_USART0_RTS (1u << 12) +#define PIN_PC02C_USART0_RXD 66 /**< \brief USART0 signal: RXD on PC02 mux C */ +#define MUX_PC02C_USART0_RXD 2 +#define GPIO_PC02C_USART0_RXD (1u << 2) +#define PIN_PA05B_USART0_RXD 5 /**< \brief USART0 signal: RXD on PA05 mux B */ +#define MUX_PA05B_USART0_RXD 1 +#define GPIO_PA05B_USART0_RXD (1u << 5) +#define PIN_PB00B_USART0_RXD 32 /**< \brief USART0 signal: RXD on PB00 mux B */ +#define MUX_PB00B_USART0_RXD 1 +#define GPIO_PB00B_USART0_RXD (1u << 0) +#define PIN_PA11A_USART0_RXD 11 /**< \brief USART0 signal: RXD on PA11 mux A */ +#define MUX_PA11A_USART0_RXD 0 +#define GPIO_PA11A_USART0_RXD (1u << 11) +#define PIN_PB14A_USART0_RXD 46 /**< \brief USART0 signal: RXD on PB14 mux A */ +#define MUX_PB14A_USART0_RXD 0 +#define GPIO_PB14A_USART0_RXD (1u << 14) +#define PIN_PC03C_USART0_TXD 67 /**< \brief USART0 signal: TXD on PC03 mux C */ +#define MUX_PC03C_USART0_TXD 2 +#define GPIO_PC03C_USART0_TXD (1u << 3) +#define PIN_PA07B_USART0_TXD 7 /**< \brief USART0 signal: TXD on PA07 mux B */ +#define MUX_PA07B_USART0_TXD 1 +#define GPIO_PA07B_USART0_TXD (1u << 7) +#define PIN_PB01B_USART0_TXD 33 /**< \brief USART0 signal: TXD on PB01 mux B */ +#define MUX_PB01B_USART0_TXD 1 +#define GPIO_PB01B_USART0_TXD (1u << 1) +#define PIN_PA12A_USART0_TXD 12 /**< \brief USART0 signal: TXD on PA12 mux A */ +#define MUX_PA12A_USART0_TXD 0 +#define GPIO_PA12A_USART0_TXD (1u << 12) +#define PIN_PB15A_USART0_TXD 47 /**< \brief USART0 signal: TXD on PB15 mux A */ +#define MUX_PB15A_USART0_TXD 0 +#define GPIO_PB15A_USART0_TXD (1u << 15) +/* ========== GPIO definition for USART1 peripheral ========== */ +#define PIN_PB03B_USART1_CLK 35 /**< \brief USART1 signal: CLK on PB03 mux B */ +#define MUX_PB03B_USART1_CLK 1 +#define GPIO_PB03B_USART1_CLK (1u << 3) +#define PIN_PA14A_USART1_CLK 14 /**< \brief USART1 signal: CLK on PA14 mux A */ +#define MUX_PA14A_USART1_CLK 0 +#define GPIO_PA14A_USART1_CLK (1u << 14) +#define PIN_PC25A_USART1_CLK 89 /**< \brief USART1 signal: CLK on PC25 mux A */ +#define MUX_PC25A_USART1_CLK 0 +#define GPIO_PC25A_USART1_CLK (1u << 25) +#define PIN_PA21B_USART1_CTS 21 /**< \brief USART1 signal: CTS on PA21 mux B */ +#define MUX_PA21B_USART1_CTS 1 +#define GPIO_PA21B_USART1_CTS (1u << 21) +#define PIN_PB02B_USART1_RTS 34 /**< \brief USART1 signal: RTS on PB02 mux B */ +#define MUX_PB02B_USART1_RTS 1 +#define GPIO_PB02B_USART1_RTS (1u << 2) +#define PIN_PA13A_USART1_RTS 13 /**< \brief USART1 signal: RTS on PA13 mux A */ +#define MUX_PA13A_USART1_RTS 0 +#define GPIO_PA13A_USART1_RTS (1u << 13) +#define PIN_PC24A_USART1_RTS 88 /**< \brief USART1 signal: RTS on PC24 mux A */ +#define MUX_PC24A_USART1_RTS 0 +#define GPIO_PC24A_USART1_RTS (1u << 24) +#define PIN_PB04B_USART1_RXD 36 /**< \brief USART1 signal: RXD on PB04 mux B */ +#define MUX_PB04B_USART1_RXD 1 +#define GPIO_PB04B_USART1_RXD (1u << 4) +#define PIN_PA15A_USART1_RXD 15 /**< \brief USART1 signal: RXD on PA15 mux A */ +#define MUX_PA15A_USART1_RXD 0 +#define GPIO_PA15A_USART1_RXD (1u << 15) +#define PIN_PC26A_USART1_RXD 90 /**< \brief USART1 signal: RXD on PC26 mux A */ +#define MUX_PC26A_USART1_RXD 0 +#define GPIO_PC26A_USART1_RXD (1u << 26) +#define PIN_PB05B_USART1_TXD 37 /**< \brief USART1 signal: TXD on PB05 mux B */ +#define MUX_PB05B_USART1_TXD 1 +#define GPIO_PB05B_USART1_TXD (1u << 5) +#define PIN_PA16A_USART1_TXD 16 /**< \brief USART1 signal: TXD on PA16 mux A */ +#define MUX_PA16A_USART1_TXD 0 +#define GPIO_PA16A_USART1_TXD (1u << 16) +#define PIN_PC27A_USART1_TXD 91 /**< \brief USART1 signal: TXD on PC27 mux A */ +#define MUX_PC27A_USART1_TXD 0 +#define GPIO_PC27A_USART1_TXD (1u << 27) +/* ========== GPIO definition for USART2 peripheral ========== */ +#define PIN_PC08B_USART2_CLK 72 /**< \brief USART2 signal: CLK on PC08 mux B */ +#define MUX_PC08B_USART2_CLK 1 +#define GPIO_PC08B_USART2_CLK (1u << 8) +#define PIN_PA18A_USART2_CLK 18 /**< \brief USART2 signal: CLK on PA18 mux A */ +#define MUX_PA18A_USART2_CLK 0 +#define GPIO_PA18A_USART2_CLK (1u << 18) +#define PIN_PC08E_USART2_CTS 72 /**< \brief USART2 signal: CTS on PC08 mux E */ +#define MUX_PC08E_USART2_CTS 4 +#define GPIO_PC08E_USART2_CTS (1u << 8) +#define PIN_PA22B_USART2_CTS 22 /**< \brief USART2 signal: CTS on PA22 mux B */ +#define MUX_PA22B_USART2_CTS 1 +#define GPIO_PA22B_USART2_CTS (1u << 22) +#define PIN_PC07B_USART2_RTS 71 /**< \brief USART2 signal: RTS on PC07 mux B */ +#define MUX_PC07B_USART2_RTS 1 +#define GPIO_PC07B_USART2_RTS (1u << 7) +#define PIN_PA17A_USART2_RTS 17 /**< \brief USART2 signal: RTS on PA17 mux A */ +#define MUX_PA17A_USART2_RTS 0 +#define GPIO_PA17A_USART2_RTS (1u << 17) +#define PIN_PA25B_USART2_RXD 25 /**< \brief USART2 signal: RXD on PA25 mux B */ +#define MUX_PA25B_USART2_RXD 1 +#define GPIO_PA25B_USART2_RXD (1u << 25) +#define PIN_PC11B_USART2_RXD 75 /**< \brief USART2 signal: RXD on PC11 mux B */ +#define MUX_PC11B_USART2_RXD 1 +#define GPIO_PC11B_USART2_RXD (1u << 11) +#define PIN_PA19A_USART2_RXD 19 /**< \brief USART2 signal: RXD on PA19 mux A */ +#define MUX_PA19A_USART2_RXD 0 +#define GPIO_PA19A_USART2_RXD (1u << 19) +#define PIN_PA26B_USART2_TXD 26 /**< \brief USART2 signal: TXD on PA26 mux B */ +#define MUX_PA26B_USART2_TXD 1 +#define GPIO_PA26B_USART2_TXD (1u << 26) +#define PIN_PC12B_USART2_TXD 76 /**< \brief USART2 signal: TXD on PC12 mux B */ +#define MUX_PC12B_USART2_TXD 1 +#define GPIO_PC12B_USART2_TXD (1u << 12) +#define PIN_PA20A_USART2_TXD 20 /**< \brief USART2 signal: TXD on PA20 mux A */ +#define MUX_PA20A_USART2_TXD 0 +#define GPIO_PA20A_USART2_TXD (1u << 20) +/* ========== GPIO definition for USART3 peripheral ========== */ +#define PIN_PA29E_USART3_CLK 29 /**< \brief USART3 signal: CLK on PA29 mux E */ +#define MUX_PA29E_USART3_CLK 4 +#define GPIO_PA29E_USART3_CLK (1u << 29) +#define PIN_PC14B_USART3_CLK 78 /**< \brief USART3 signal: CLK on PC14 mux B */ +#define MUX_PC14B_USART3_CLK 1 +#define GPIO_PC14B_USART3_CLK (1u << 14) +#define PIN_PB08A_USART3_CLK 40 /**< \brief USART3 signal: CLK on PB08 mux A */ +#define MUX_PB08A_USART3_CLK 0 +#define GPIO_PB08A_USART3_CLK (1u << 8) +#define PIN_PC31A_USART3_CLK 95 /**< \brief USART3 signal: CLK on PC31 mux A */ +#define MUX_PC31A_USART3_CLK 0 +#define GPIO_PC31A_USART3_CLK (1u << 31) +#define PIN_PA28E_USART3_CTS 28 /**< \brief USART3 signal: CTS on PA28 mux E */ +#define MUX_PA28E_USART3_CTS 4 +#define GPIO_PA28E_USART3_CTS (1u << 28) +#define PIN_PB07A_USART3_CTS 39 /**< \brief USART3 signal: CTS on PB07 mux A */ +#define MUX_PB07A_USART3_CTS 0 +#define GPIO_PB07A_USART3_CTS (1u << 7) +#define PIN_PA27E_USART3_RTS 27 /**< \brief USART3 signal: RTS on PA27 mux E */ +#define MUX_PA27E_USART3_RTS 4 +#define GPIO_PA27E_USART3_RTS (1u << 27) +#define PIN_PC13B_USART3_RTS 77 /**< \brief USART3 signal: RTS on PC13 mux B */ +#define MUX_PC13B_USART3_RTS 1 +#define GPIO_PC13B_USART3_RTS (1u << 13) +#define PIN_PB06A_USART3_RTS 38 /**< \brief USART3 signal: RTS on PB06 mux A */ +#define MUX_PB06A_USART3_RTS 0 +#define GPIO_PB06A_USART3_RTS (1u << 6) +#define PIN_PC30A_USART3_RTS 94 /**< \brief USART3 signal: RTS on PC30 mux A */ +#define MUX_PC30A_USART3_RTS 0 +#define GPIO_PC30A_USART3_RTS (1u << 30) +#define PIN_PA30E_USART3_RXD 30 /**< \brief USART3 signal: RXD on PA30 mux E */ +#define MUX_PA30E_USART3_RXD 4 +#define GPIO_PA30E_USART3_RXD (1u << 30) +#define PIN_PC09B_USART3_RXD 73 /**< \brief USART3 signal: RXD on PC09 mux B */ +#define MUX_PC09B_USART3_RXD 1 +#define GPIO_PC09B_USART3_RXD (1u << 9) +#define PIN_PB09A_USART3_RXD 41 /**< \brief USART3 signal: RXD on PB09 mux A */ +#define MUX_PB09A_USART3_RXD 0 +#define GPIO_PB09A_USART3_RXD (1u << 9) +#define PIN_PC28A_USART3_RXD 92 /**< \brief USART3 signal: RXD on PC28 mux A */ +#define MUX_PC28A_USART3_RXD 0 +#define GPIO_PC28A_USART3_RXD (1u << 28) +#define PIN_PA31E_USART3_TXD 31 /**< \brief USART3 signal: TXD on PA31 mux E */ +#define MUX_PA31E_USART3_TXD 4 +#define GPIO_PA31E_USART3_TXD (1u << 31) +#define PIN_PC10B_USART3_TXD 74 /**< \brief USART3 signal: TXD on PC10 mux B */ +#define MUX_PC10B_USART3_TXD 1 +#define GPIO_PC10B_USART3_TXD (1u << 10) +#define PIN_PB10A_USART3_TXD 42 /**< \brief USART3 signal: TXD on PB10 mux A */ +#define MUX_PB10A_USART3_TXD 0 +#define GPIO_PB10A_USART3_TXD (1u << 10) +#define PIN_PC29A_USART3_TXD 93 /**< \brief USART3 signal: TXD on PC29 mux A */ +#define MUX_PC29A_USART3_TXD 0 +#define GPIO_PC29A_USART3_TXD (1u << 29) +/* ========== GPIO definition for USBC peripheral ========== */ +#define PIN_PA25A_USBC_DM 25 /**< \brief USBC signal: DM on PA25 mux A */ +#define MUX_PA25A_USBC_DM 0 +#define GPIO_PA25A_USBC_DM (1u << 25) +#define PIN_PA26A_USBC_DP 26 /**< \brief USBC signal: DP on PA26 mux A */ +#define MUX_PA26A_USBC_DP 0 +#define GPIO_PA26A_USBC_DP (1u << 26) +/*@}*/ + +/* ************************************************************************** */ +/** MEMORY MAPPING DEFINITIONS FOR SAM4L */ +/* ************************************************************************** */ + +#if defined __SAM4LC2A__ + #define FLASH_SIZE 0x20000 /* 128 kB */ + #define FLASH_PAGE_SIZE 512 + #define FLASH_NB_OF_PAGES 256 + #define FLASH_USER_PAGE_SIZE 512 + #define HRAMC0_SIZE 0x8000 /* 32 kB */ + #define HRAMC1_SIZE 0xc00 /* 3 kB */ + +#elif defined __SAM4LC2B__ + #define FLASH_SIZE 0x20000 /* 128 kB */ + #define FLASH_PAGE_SIZE 512 + #define FLASH_NB_OF_PAGES 256 + #define FLASH_USER_PAGE_SIZE 512 + #define HRAMC0_SIZE 0x8000 /* 32 kB */ + #define HRAMC1_SIZE 0xc00 /* 3 kB */ + +#elif defined __SAM4LC2C__ + #define FLASH_SIZE 0x20000 /* 128 kB */ + #define FLASH_PAGE_SIZE 512 + #define FLASH_NB_OF_PAGES 256 + #define FLASH_USER_PAGE_SIZE 512 + #define HRAMC0_SIZE 0x8000 /* 32 kB */ + #define HRAMC1_SIZE 0xc00 /* 3 kB */ + +#elif defined __SAM4LC4A__ + #define FLASH_SIZE 0x40000 /* 256 kB */ + #define FLASH_PAGE_SIZE 512 + #define FLASH_NB_OF_PAGES 512 + #define FLASH_USER_PAGE_SIZE 512 + #define HRAMC0_SIZE 0x8000 /* 32 kB */ + #define HRAMC1_SIZE 0xc00 /* 3 kB */ + +#elif defined __SAM4LC4B__ + #define FLASH_SIZE 0x40000 /* 256 kB */ + #define FLASH_PAGE_SIZE 512 + #define FLASH_NB_OF_PAGES 512 + #define FLASH_USER_PAGE_SIZE 512 + #define HRAMC0_SIZE 0x8000 /* 32 kB */ + #define HRAMC1_SIZE 0xc00 /* 3 kB */ + +#elif defined __SAM4LC4C__ + #define FLASH_SIZE 0x40000 /* 256 kB */ + #define FLASH_PAGE_SIZE 512 + #define FLASH_NB_OF_PAGES 512 + #define FLASH_USER_PAGE_SIZE 512 + #define HRAMC0_SIZE 0x8000 /* 32 kB */ + #define HRAMC1_SIZE 0xc00 /* 3 kB */ + +#elif defined __SAM4LS2A__ + #define FLASH_SIZE 0x20000 /* 128 kB */ + #define FLASH_PAGE_SIZE 512 + #define FLASH_NB_OF_PAGES 256 + #define FLASH_USER_PAGE_SIZE 512 + #define HRAMC0_SIZE 0x8000 /* 32 kB */ + #define HRAMC1_SIZE 0xc00 /* 3 kB */ + +#elif defined __SAM4LS2B__ + #define FLASH_SIZE 0x20000 /* 128 kB */ + #define FLASH_PAGE_SIZE 512 + #define FLASH_NB_OF_PAGES 256 + #define FLASH_USER_PAGE_SIZE 512 + #define HRAMC0_SIZE 0x8000 /* 32 kB */ + #define HRAMC1_SIZE 0xc00 /* 3 kB */ + +#elif defined __SAM4LS2C__ + #define FLASH_SIZE 0x20000 /* 128 kB */ + #define FLASH_PAGE_SIZE 512 + #define FLASH_NB_OF_PAGES 256 + #define FLASH_USER_PAGE_SIZE 512 + #define HRAMC0_SIZE 0x8000 /* 32 kB */ + #define HRAMC1_SIZE 0xc00 /* 3 kB */ + +#elif defined __SAM4LS4A__ + #define FLASH_SIZE 0x40000 /* 256 kB */ + #define FLASH_PAGE_SIZE 512 + #define FLASH_NB_OF_PAGES 512 + #define FLASH_USER_PAGE_SIZE 512 + #define HRAMC0_SIZE 0x8000 /* 32 kB */ + #define HRAMC1_SIZE 0xc00 /* 3 kB */ + +#elif defined __SAM4LS4B__ + #define FLASH_SIZE 0x40000 /* 256 kB */ + #define FLASH_PAGE_SIZE 512 + #define FLASH_NB_OF_PAGES 512 + #define FLASH_USER_PAGE_SIZE 512 + #define HRAMC0_SIZE 0x8000 /* 32 kB */ + #define HRAMC1_SIZE 0xc00 /* 3 kB */ + +#elif defined __SAM4LS4C__ + #define FLASH_SIZE 0x40000 /* 256 kB */ + #define FLASH_PAGE_SIZE 512 + #define FLASH_NB_OF_PAGES 512 + #define FLASH_USER_PAGE_SIZE 512 + #define HRAMC0_SIZE 0x8000 /* 32 kB */ + #define HRAMC1_SIZE 0xc00 /* 3 kB */ +#else + #error Library does not support the specified device. +#endif + +#define FLASH_ADDR (0x00000000u) /**< FLASH base address */ +#define FLASH_USER_PAGE_ADDR (0x00800000u) /**< FLASH_USER_PAGE base address */ +#define HRAMC0_ADDR (0x20000000u) /**< HRAMC0 base address */ +#define HRAMC1_ADDR (0x21000000u) /**< HRAMC1 base address */ + +#include "sam4l_patch_asf.h" + +#ifdef __cplusplus +} +#endif + +/*@}*/ + +#endif /* SAM4L_H */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/include/sam4l_patch_asf.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/include/sam4l_patch_asf.h new file mode 100644 index 000000000..59ebe0ab9 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/include/sam4l_patch_asf.h @@ -0,0 +1,122 @@ +/** + * \file + * + * \brief ASF Patch Header file definitions for SAM4L. + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#ifndef SAM4L_PATCH_ASF_H_INCLUDED +#define SAM4L_PATCH_ASF_H_INCLUDED + +// These defines are used for sam/drivers/flashcalw implementation. +#define FLASHCALW_FCMD_CMD_HSEN (0x10u << 0) +#define FLASHCALW_FCMD_CMD_HSDIS (0x11u << 0) + +// These defines are used to keep compatibility with existing +// sam/drivers/usart implementation from SAM3/4 products with SAM4L product. +#define US_MR_USART_MODE_HW_HANDSHAKING US_MR_USART_MODE_HARDWARE +#define US_MR_USART_MODE_IS07816_T_0 US_MR_USART_MODE_ISO7816_T0 +#define US_MR_USART_MODE_IS07816_T_1 US_MR_USART_MODE_ISO7816_T1 +#define US_MR_NBSTOP_2_BIT US_MR_NBSTOP_2 +#define US_MR_NBSTOP_1_5_BIT US_MR_NBSTOP_1_5 +#define US_MR_NBSTOP_1_BIT US_MR_NBSTOP_1 +#define US_MR_CHRL_8_BIT US_MR_CHRL_8 +#define US_MR_PAR_NO US_MR_PAR_NONE +#define US_MR_PAR_MULTIDROP US_MR_PAR_MULTI +#define US_IF US_IFR +#define US_WPSR_WPVS US_WPSR_WPV_1 + +#if (!defined SCIF_RCOSC_FREQUENCY) +# define SCIF_RCOSC_FREQUENCY 115200 +#endif + +// These defines for homogeneity with other SAM header files. +#define CHIP_FREQ_FWS_0 (18000000UL) /**< \brief Maximum operating frequency when FWS is 0 */ +#define CHIP_FREQ_FWS_1 (36000000UL) /**< \brief Maximum operating frequency when FWS is 1 */ +// WARNING NOTE: these are preliminary values. +#define CHIP_FREQ_FLASH_HSEN_FWS_0 (18000000UL) /**< \brief Maximum operating frequency when FWS is 0 and the FLASH HS mode is enabled */ +#define CHIP_FREQ_FLASH_HSEN_FWS_1 (36000000UL) /**< \brief Maximum operating frequency when FWS is 1 and the FLASH HS mode is enabled */ + +// Size of HRAMC1 with 32-bit access +#undef HRAMC1_SIZE +#define HRAMC1_SIZE (0x800UL) + +// USBC related offsets +#define USBC_UHINT_P0INT_Pos 8 +#define USBC_UHINTE_P0INTE_Pos 8 +#define USBC_UPCFG0_PBK_Pos 2 +#define USBC_UPCFG0_PBK_Msk (0x1u << USBC_UPCFG0_PBK_Pos) + +// These defines are used to keep compatibility with existing +// sam/drivers/tc implementation from SAM3/4 products with SAM4L product. +#define TC_SMMR TC_SMC +#define TC_CMR_LDRA_RISING TC_CMR_LDRA_POS_EDGE_TIOA +#define TC_CMR_LDRB_FALLING TC_CMR_LDRB_NEG_EDGE_TIOA +#define TC_CMR_ETRGEDG_FALLING TC_CMR_ETRGEDG_NEG_EDGE + +// These defines are used to keep compatibility with existing +// sam/drivers/spi implementation from SAM3/4 products with SAM4L product. +#define SPI_CSR_BITS_8_BIT SPI_CSR_BITS_8_BPT + +#define SPI_WPSR_WPVS_Pos SPI_WPSR_SPIWPVS_Pos +#define SPI_WPSR_WPVS_Msk SPI_WPSR_SPIWPVS_Msk +#define SPI_WPSR_WPVSRC_Pos SPI_WPSR_SPIWPVSRC_Pos +#define SPI_WPSR_WPVSRC_Msk SPI_WPSR_SPIWPVSRC_Msk + +// These defines are used to keep compatibility with existing +// sam/drivers/crccu implementation from SAM3/4 products with SAM4L product. +#define CRCCU_DMA_EN CRCCU_DMAEN +#define CRCCU_DMA_DIS CRCCU_DMADIS +#define CRCCU_DMA_SR CRCCU_DMASR +#define CRCCU_DMA_IER CRCCU_DMAIER +#define CRCCU_DMA_IDR CRCCU_DMAIDR +#define CRCCU_DMA_IMR CRCCU_DMAIMR +#define CRCCU_DMA_ISR CRCCU_DMAISR +#define CRCCU_DMA_EN_DMAEN CRCCU_DMAEN_DMAEN +#define CRCCU_DMA_DIS_DMADIS CRCCU_DMADIS_DMADIS +#define CRCCU_DMA_SR_DMASR CRCCU_DMASR_DMASR +#define CRCCU_DMA_IER_DMAIER CRCCU_DMAIER_DMAIER +#define CRCCU_DMA_IDR_DMAIDR CRCCU_DMAIDR_DMAIDR +#define CRCCU_DMA_IMR_DMAIMR CRCCU_DMAIMR_DMAIMR +#define CRCCU_DMA_ISR_DMAISR CRCCU_DMAISR_DMAISR +#define CRCCU_MR_PTYPE_CCITT8023 CRCCU_MR_PTYPE(0) +#define CRCCU_MR_PTYPE_CASTAGNOLI CRCCU_MR_PTYPE(1) +#define CRCCU_MR_PTYPE_CCITT16 CRCCU_MR_PTYPE(2) + +#endif // SAM4L_PATCH_ASF_H_INCLUDED diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/source/templates/exceptions.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/source/templates/exceptions.c new file mode 100644 index 000000000..385c9971f --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/source/templates/exceptions.c @@ -0,0 +1,269 @@ +/** + * \file + * + * \brief This file contains the default exception handlers. + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + * \par Purpose + * + * This file provides basic support for Cortex-M processor based + * microcontrollers. + * + * \note + * The exception handler has weak aliases. + * As they are weak aliases, any function with the same name will override + * this definition. + * + */ + +#include "exceptions.h" + +/* @cond 0 */ +/**INDENT-OFF**/ +#ifdef __cplusplus +extern "C" { +#endif +/**INDENT-ON**/ +/* @endcond */ + +#ifdef __GNUC__ +/* Cortex-M3 core handlers */ +void Reset_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void NMI_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void HardFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void MemManage_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void BusFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void UsageFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SVC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void DebugMon_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void PendSV_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SysTick_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); + +/* Peripherals handlers */ +void ABDACB_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void ACIFC_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void ADCIFE_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void AESA_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void AST_ALARM_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void AST_CLKREADY_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void AST_OVF_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void AST_PER_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void AST_READY_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void BPM_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void BSCIF_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void CATB_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void CRCCU_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void DACC_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_1_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_2_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_3_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_4_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_5_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_6_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_7_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_8_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void FREQM_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void GPIO_0_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void GPIO_1_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void GPIO_10_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void GPIO_11_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void GPIO_2_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void GPIO_3_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void GPIO_4_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void GPIO_5_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void GPIO_6_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void GPIO_7_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void GPIO_8_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void GPIO_9_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void HFLASHC_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void IISC_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void LCDCA_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void PARC_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void PDCA_0_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void PDCA_1_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void PDCA_10_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void PDCA_11_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void PDCA_12_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void PDCA_13_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void PDCA_14_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void PDCA_15_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void PDCA_2_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void PDCA_3_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void PDCA_4_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void PDCA_5_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void PDCA_6_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void PDCA_7_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void PDCA_8_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void PDCA_9_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void PEVC_OV_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void PEVC_TR_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void PM_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void SCIF_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void SPI_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC00_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC01_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC02_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC10_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC11_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC12_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void TRNG_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void TWIM0_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void TWIM1_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void TWIM2_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void TWIM3_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void TWIS0_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void TWIS1_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void USART0_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void USART1_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void USART2_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void USART3_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void USBC_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void WDT_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +#endif /* __GNUC__ */ + +#ifdef __ICCARM__ +/* Cortex-M3 core handlers */ +#pragma weak Reset_Handler=Dummy_Handler +#pragma weak NMI_Handler=Dummy_Handler +#pragma weak HardFault_Handler=Dummy_Handler +#pragma weak MemManage_Handler=Dummy_Handler +#pragma weak BusFault_Handler=Dummy_Handler +#pragma weak UsageFault_Handler=Dummy_Handler +#pragma weak SVC_Handler=Dummy_Handler +#pragma weak DebugMon_Handler=Dummy_Handler +#pragma weak PendSV_Handler=Dummy_Handler +#pragma weak SysTick_Handler=Dummy_Handler + +/* Peripherals handlers */ +#pragma weak ABDACB_Handler = Dummy_Handler +#pragma weak ACIFC_Handler = Dummy_Handler +#pragma weak ADCIFE_Handler = Dummy_Handler +#pragma weak AESA_Handler = Dummy_Handler +#pragma weak AST_ALARM_Handler = Dummy_Handler +#pragma weak AST_CLKREADY_Handler = Dummy_Handler +#pragma weak AST_OVF_Handler = Dummy_Handler +#pragma weak AST_PER_Handler = Dummy_Handler +#pragma weak AST_READY_Handler = Dummy_Handler +#pragma weak BPM_Handler = Dummy_Handler +#pragma weak BSCIF_Handler = Dummy_Handler +#pragma weak CATB_Handler = Dummy_Handler +#pragma weak CRCCU_Handler = Dummy_Handler +#pragma weak DACC_Handler = Dummy_Handler +#pragma weak EIC_1_Handler = Dummy_Handler +#pragma weak EIC_2_Handler = Dummy_Handler +#pragma weak EIC_3_Handler = Dummy_Handler +#pragma weak EIC_4_Handler = Dummy_Handler +#pragma weak EIC_5_Handler = Dummy_Handler +#pragma weak EIC_6_Handler = Dummy_Handler +#pragma weak EIC_7_Handler = Dummy_Handler +#pragma weak EIC_8_Handler = Dummy_Handler +#pragma weak FREQM_Handler = Dummy_Handler +#pragma weak GPIO_0_Handler = Dummy_Handler +#pragma weak GPIO_1_Handler = Dummy_Handler +#pragma weak GPIO_10_Handler = Dummy_Handler +#pragma weak GPIO_11_Handler = Dummy_Handler +#pragma weak GPIO_2_Handler = Dummy_Handler +#pragma weak GPIO_3_Handler = Dummy_Handler +#pragma weak GPIO_4_Handler = Dummy_Handler +#pragma weak GPIO_5_Handler = Dummy_Handler +#pragma weak GPIO_6_Handler = Dummy_Handler +#pragma weak GPIO_7_Handler = Dummy_Handler +#pragma weak GPIO_8_Handler = Dummy_Handler +#pragma weak GPIO_9_Handler = Dummy_Handler +#pragma weak HFLASHC_Handler = Dummy_Handler +#pragma weak IISC_Handler = Dummy_Handler +#pragma weak LCDCA_Handler = Dummy_Handler +#pragma weak PARC_Handler = Dummy_Handler +#pragma weak PDCA_0_Handler = Dummy_Handler +#pragma weak PDCA_1_Handler = Dummy_Handler +#pragma weak PDCA_10_Handler = Dummy_Handler +#pragma weak PDCA_11_Handler = Dummy_Handler +#pragma weak PDCA_12_Handler = Dummy_Handler +#pragma weak PDCA_13_Handler = Dummy_Handler +#pragma weak PDCA_14_Handler = Dummy_Handler +#pragma weak PDCA_15_Handler = Dummy_Handler +#pragma weak PDCA_2_Handler = Dummy_Handler +#pragma weak PDCA_3_Handler = Dummy_Handler +#pragma weak PDCA_4_Handler = Dummy_Handler +#pragma weak PDCA_5_Handler = Dummy_Handler +#pragma weak PDCA_6_Handler = Dummy_Handler +#pragma weak PDCA_7_Handler = Dummy_Handler +#pragma weak PDCA_8_Handler = Dummy_Handler +#pragma weak PDCA_9_Handler = Dummy_Handler +#pragma weak PEVC_OV_Handler = Dummy_Handler +#pragma weak PEVC_TR_Handler = Dummy_Handler +#pragma weak PM_Handler = Dummy_Handler +#pragma weak SCIF_Handler = Dummy_Handler +#pragma weak SPI_Handler = Dummy_Handler +#pragma weak TC00_Handler = Dummy_Handler +#pragma weak TC01_Handler = Dummy_Handler +#pragma weak TC02_Handler = Dummy_Handler +#pragma weak TC10_Handler = Dummy_Handler +#pragma weak TC11_Handler = Dummy_Handler +#pragma weak TC12_Handler = Dummy_Handler +#pragma weak TRNG_Handler = Dummy_Handler +#pragma weak TWIM0_Handler = Dummy_Handler +#pragma weak TWIM1_Handler = Dummy_Handler +#pragma weak TWIM2_Handler = Dummy_Handler +#pragma weak TWIM3_Handler = Dummy_Handler +#pragma weak TWIS0_Handler = Dummy_Handler +#pragma weak TWIS1_Handler = Dummy_Handler +#pragma weak USART0_Handler = Dummy_Handler +#pragma weak USART1_Handler = Dummy_Handler +#pragma weak USART2_Handler = Dummy_Handler +#pragma weak USART3_Handler = Dummy_Handler +#pragma weak USBC_Handler = Dummy_Handler +#pragma weak WDT_Handler = Dummy_Handler +#endif /* __ICCARM__ */ + +/** + * \brief Default interrupt handler for unused IRQs. + */ +void Dummy_Handler(void) +{ + while (1) { + } +} + +/* @cond 0 */ +/**INDENT-OFF**/ +#ifdef __cplusplus +} +#endif +/**INDENT-ON**/ +/* @endcond */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/source/templates/exceptions.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/source/templates/exceptions.h new file mode 100644 index 000000000..2ca135307 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/source/templates/exceptions.h @@ -0,0 +1,71 @@ +/** + * \file + * + * \brief This file contains the interface for default exception handlers. + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#ifndef EXCEPTIONS_H_INCLUDED +#define EXCEPTIONS_H_INCLUDED + +#include "sam4l.h" + +/* @cond 0 */ +/**INDENT-OFF**/ +#ifdef __cplusplus +extern "C" { +#endif +/**INDENT-ON**/ +/* @endcond */ + +/* Function prototype for exception table items (interrupt handler). */ +typedef void (*IntFunc) (void); + +/* Default empty handler */ +void Dummy_Handler(void); + +/* @cond 0 */ +/**INDENT-OFF**/ +#ifdef __cplusplus +} +#endif +/**INDENT-ON**/ +/* @endcond */ + +#endif /* EXCEPTIONS_H_INCLUDED */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/source/templates/gcc/startup_sam4l.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/source/templates/gcc/startup_sam4l.c new file mode 100644 index 000000000..8a40e9ec0 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/source/templates/gcc/startup_sam4l.c @@ -0,0 +1,205 @@ +/** + * \file + * + * \brief GCC Startup file for SAM4L. + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#include "exceptions.h" +#include "sam4l.h" +#include "system_sam4l.h" + +/* Initialize segments */ +extern uint32_t _sfixed; +extern uint32_t _efixed; +extern uint32_t _etext; +extern uint32_t _srelocate; +extern uint32_t _erelocate; +extern uint32_t _szero; +extern uint32_t _ezero; +extern uint32_t _sstack; +extern uint32_t _estack; + +/** \cond DOXYGEN_SHOULD_SKIP_THIS */ +int main(void); +/** \endcond */ + +void __libc_init_array(void); + +/* Exception Table */ +__attribute__ ((section(".vectors"))) +IntFunc exception_table[] = { + + /* Configure Initial Stack Pointer, using linker-generated symbols */ + (IntFunc) (&_estack), + Reset_Handler, + + NMI_Handler, + HardFault_Handler, + MemManage_Handler, + BusFault_Handler, + UsageFault_Handler, + 0, 0, 0, 0, /* Reserved */ + SVC_Handler, + DebugMon_Handler, + 0, /* Reserved */ + PendSV_Handler, + SysTick_Handler, + + // Configurable interrupts + HFLASHC_Handler, // 0 + PDCA_0_Handler, // 1 + PDCA_1_Handler, // 2 + PDCA_2_Handler, // 3 + PDCA_3_Handler, // 4 + PDCA_4_Handler, // 5 + PDCA_5_Handler, // 6 + PDCA_6_Handler, // 7 + PDCA_7_Handler, // 8 + PDCA_8_Handler, // 9 + PDCA_9_Handler, // 10 + PDCA_10_Handler, // 11 + PDCA_11_Handler, // 12 + PDCA_12_Handler, // 13 + PDCA_13_Handler, // 14 + PDCA_14_Handler, // 15 + PDCA_15_Handler, // 16 + CRCCU_Handler, // 17 + USBC_Handler, // 18 + PEVC_TR_Handler, // 19 + PEVC_OV_Handler, // 20 + AESA_Handler, // 21 + PM_Handler, // 22 + SCIF_Handler, // 23 + FREQM_Handler, // 24 + GPIO_0_Handler, // 25 + GPIO_1_Handler, // 26 + GPIO_2_Handler, // 27 + GPIO_3_Handler, // 28 + GPIO_4_Handler, // 29 + GPIO_5_Handler, // 30 + GPIO_6_Handler, // 31 + GPIO_7_Handler, // 32 + GPIO_8_Handler, // 33 + GPIO_9_Handler, // 34 + GPIO_10_Handler, // 35 + GPIO_11_Handler, // 36 + BPM_Handler, // 37 + BSCIF_Handler, // 38 + AST_ALARM_Handler, // 39 + AST_PER_Handler, // 40 + AST_OVF_Handler, // 41 + AST_READY_Handler, // 42 + AST_CLKREADY_Handler, // 43 + WDT_Handler, // 44 + EIC_1_Handler, // 45 + EIC_2_Handler, // 46 + EIC_3_Handler, // 47 + EIC_4_Handler, // 48 + EIC_5_Handler, // 49 + EIC_6_Handler, // 50 + EIC_7_Handler, // 51 + EIC_8_Handler, // 52 + IISC_Handler, // 53 + SPI_Handler, // 54 + TC00_Handler, // 55 + TC01_Handler, // 56 + TC02_Handler, // 57 + TC10_Handler, // 58 + TC11_Handler, // 59 + TC12_Handler, // 60 + TWIM0_Handler, // 61 + TWIS0_Handler, // 62 + TWIM1_Handler, // 63 + TWIS1_Handler, // 64 + USART0_Handler, // 65 + USART1_Handler, // 66 + USART2_Handler, // 67 + USART3_Handler, // 68 + ADCIFE_Handler, // 69 + DACC_Handler, // 70 + ACIFC_Handler, // 71 + ABDACB_Handler, // 72 + TRNG_Handler, // 73 + PARC_Handler, // 74 + CATB_Handler, // 75 + Dummy_Handler, // one not used + TWIM2_Handler, // 77 + TWIM3_Handler, // 78 + LCDCA_Handler // 79 + +}; + + +/** + * \brief This is the code that gets called on processor reset. + * To initialize the device, and call the main() routine. + */ +void Reset_Handler(void) +{ + uint32_t *pSrc, *pDest; + + /* Initialize the relocate segment */ + pSrc = &_etext; + pDest = &_srelocate; + + if (pSrc != pDest) { + for (; pDest < &_erelocate;) { + *pDest++ = *pSrc++; + } + } + + /* Clear the zero segment */ + for (pDest = &_szero; pDest < &_ezero;) { + *pDest++ = 0; + } + + /* Set the vector table base address */ + pSrc = (uint32_t *) &_sfixed; + SCB->VTOR = ((uint32_t) pSrc & SCB_VTOR_TBLOFF_Msk); + + /* Initialize the C library */ + __libc_init_array(); + + /* Branch to main function */ + main(); + + /* Infinite loop */ + while (1); +} diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/source/templates/system_sam4l.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/source/templates/system_sam4l.h new file mode 100644 index 000000000..519cf6c03 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/cmsis/sam4l/source/templates/system_sam4l.h @@ -0,0 +1,62 @@ +/** + * \file + * + * \brief Low-level initialization functions called upon chip startup. + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#ifndef SYSTEM_SAM4L_H_INCLUDED +#define SYSTEM_SAM4L_H_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ + +void SystemInit(void); +void SystemCoreClockUpdate(void); + +#ifdef __cplusplus +} +#endif + +#endif /* SYSTEM_SAM4L_H_INCLUDED */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/compiler.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/compiler.h new file mode 100644 index 000000000..5f1e1d239 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/compiler.h @@ -0,0 +1,1063 @@ +/** + * \file + * + * \brief Commonly used includes, types and macros. + * + * Copyright (c) 2010-2013 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#ifndef UTILS_COMPILER_H +#define UTILS_COMPILER_H + +/** + * \defgroup group_sam_utils Compiler abstraction layer and code utilities + * + * Compiler abstraction layer and code utilities for AT91SAM. + * This module provides various abstraction layers and utilities to make code compatible between different compilers. + * + * \{ + */ +#include + +#if (defined __ICCARM__) +# include +#endif + +#include +#include "preprocessor.h" + +#include + +//_____ D E C L A R A T I O N S ____________________________________________ + +#ifndef __ASSEMBLY__ // Not defined for assembling. + +#include +#include +#include +#include + +#ifdef __ICCARM__ +/*! \name Compiler Keywords + * + * Port of some keywords from GCC to IAR Embedded Workbench. + */ +//! @{ +#define __asm__ asm +#define __inline__ inline +#define __volatile__ +//! @} + +#endif + +#define FUNC_PTR void * +/** + * \def UNUSED + * \brief Marking \a v as a unused parameter or value. + */ +#define UNUSED(v) (void)(v) + +/** + * \def unused + * \brief Marking \a v as a unused parameter or value. + */ +#define unused(v) do { (void)(v); } while(0) + +/** + * \def barrier + * \brief Memory barrier + */ +#define barrier() __DMB() + +/** + * \brief Emit the compiler pragma \a arg. + * + * \param arg The pragma directive as it would appear after \e \#pragma + * (i.e. not stringified). + */ +#define COMPILER_PRAGMA(arg) _Pragma(#arg) + +/** + * \def COMPILER_PACK_SET(alignment) + * \brief Set maximum alignment for subsequent struct and union + * definitions to \a alignment. + */ +#define COMPILER_PACK_SET(alignment) COMPILER_PRAGMA(pack(alignment)) + +/** + * \def COMPILER_PACK_RESET() + * \brief Set default alignment for subsequent struct and union + * definitions. + */ +#define COMPILER_PACK_RESET() COMPILER_PRAGMA(pack()) + + +/** + * \brief Set aligned boundary. + */ +#if (defined __GNUC__) || (defined __CC_ARM) +# define COMPILER_ALIGNED(a) __attribute__((__aligned__(a))) +#elif (defined __ICCARM__) +# define COMPILER_ALIGNED(a) COMPILER_PRAGMA(data_alignment = a) +#endif + +/** + * \brief Set word-aligned boundary. + */ +#if (defined __GNUC__) || defined(__CC_ARM) +#define COMPILER_WORD_ALIGNED __attribute__((__aligned__(4))) +#elif (defined __ICCARM__) +#define COMPILER_WORD_ALIGNED COMPILER_PRAGMA(data_alignment = 4) +#endif + +/** + * \def __always_inline + * \brief The function should always be inlined. + * + * This annotation instructs the compiler to ignore its inlining + * heuristics and inline the function no matter how big it thinks it + * becomes. + */ +#if defined(__CC_ARM) +# define __always_inline __forceinline +#elif (defined __GNUC__) +# define __always_inline inline __attribute__((__always_inline__)) +#elif (defined __ICCARM__) +# define __always_inline _Pragma("inline=forced") +#endif + +/*! \brief This macro is used to test fatal errors. + * + * The macro tests if the expression is false. If it is, a fatal error is + * detected and the application hangs up. If TEST_SUITE_DEFINE_ASSERT_MACRO + * is defined, a unit test version of the macro is used, to allow execution + * of further tests after a false expression. + * + * \param expr Expression to evaluate and supposed to be nonzero. + */ +#if defined(_ASSERT_ENABLE_) +# if defined(TEST_SUITE_DEFINE_ASSERT_MACRO) + // Assert() is defined in unit_test/suite.h +# include "unit_test/suite.h" +# else +#undef TEST_SUITE_DEFINE_ASSERT_MACRO +# define Assert(expr) \ + {\ + if (!(expr)) while (true);\ + } +# endif +#else +# define Assert(expr) ((void) 0) +#endif + +/* Define WEAK attribute */ +#if defined ( __CC_ARM ) /* Keil µVision 4 */ +# define WEAK __attribute__ ((weak)) +#elif defined ( __ICCARM__ ) /* IAR Ewarm 5.41+ */ +# define WEAK __weak +#elif defined ( __GNUC__ ) /* GCC CS3 2009q3-68 */ +# define WEAK __attribute__ ((weak)) +#endif + +/* Define NO_INIT attribute */ +#if defined ( __CC_ARM ) +# define NO_INIT __attribute__((zero_init)) +#elif defined ( __ICCARM__ ) +# define NO_INIT __no_init +#elif defined ( __GNUC__ ) +# define NO_INIT __attribute__((section(".no_init"))) +#endif + +/* Define RAMFUNC attribute */ +#if defined ( __CC_ARM ) /* Keil µVision 4 */ +# define RAMFUNC __attribute__ ((section(".ramfunc"))) +#elif defined ( __ICCARM__ ) /* IAR Ewarm 5.41+ */ +# define RAMFUNC __ramfunc +#elif defined ( __GNUC__ ) /* GCC CS3 2009q3-68 */ +# define RAMFUNC __attribute__ ((section(".ramfunc"))) +#endif + +/* Define OPTIMIZE_HIGH attribute */ +#if defined ( __CC_ARM ) /* Keil µVision 4 */ +# define OPTIMIZE_HIGH _Pragma("O3") +#elif defined ( __ICCARM__ ) /* IAR Ewarm 5.41+ */ +# define OPTIMIZE_HIGH _Pragma("optimize=high") +#elif defined ( __GNUC__ ) /* GCC CS3 2009q3-68 */ +# define OPTIMIZE_HIGH __attribute__((optimize(s))) +#endif + +#include "interrupt.h" + +/*! \name Usual Types + */ +//! @{ +typedef unsigned char Bool; //!< Boolean. +#ifndef __cplusplus +#if !defined(__bool_true_false_are_defined) +typedef unsigned char bool; //!< Boolean. +#endif +#endif +typedef int8_t S8 ; //!< 8-bit signed integer. +typedef uint8_t U8 ; //!< 8-bit unsigned integer. +typedef int16_t S16; //!< 16-bit signed integer. +typedef uint16_t U16; //!< 16-bit unsigned integer. +typedef uint16_t le16_t; +typedef uint16_t be16_t; +typedef int32_t S32; //!< 32-bit signed integer. +typedef uint32_t U32; //!< 32-bit unsigned integer. +typedef uint32_t le32_t; +typedef uint32_t be32_t; +typedef int64_t S64; //!< 64-bit signed integer. +typedef uint64_t U64; //!< 64-bit unsigned integer. +typedef float F32; //!< 32-bit floating-point number. +typedef double F64; //!< 64-bit floating-point number. +typedef uint32_t iram_size_t; +//! @} + + +/*! \name Status Types + */ +//! @{ +typedef bool Status_bool_t; //!< Boolean status. +typedef U8 Status_t; //!< 8-bit-coded status. +//! @} + + +/*! \name Aliasing Aggregate Types + */ +//! @{ + +//! 16-bit union. +typedef union +{ + S16 s16 ; + U16 u16 ; + S8 s8 [2]; + U8 u8 [2]; +} Union16; + +//! 32-bit union. +typedef union +{ + S32 s32 ; + U32 u32 ; + S16 s16[2]; + U16 u16[2]; + S8 s8 [4]; + U8 u8 [4]; +} Union32; + +//! 64-bit union. +typedef union +{ + S64 s64 ; + U64 u64 ; + S32 s32[2]; + U32 u32[2]; + S16 s16[4]; + U16 u16[4]; + S8 s8 [8]; + U8 u8 [8]; +} Union64; + +//! Union of pointers to 64-, 32-, 16- and 8-bit unsigned integers. +typedef union +{ + S64 *s64ptr; + U64 *u64ptr; + S32 *s32ptr; + U32 *u32ptr; + S16 *s16ptr; + U16 *u16ptr; + S8 *s8ptr ; + U8 *u8ptr ; +} UnionPtr; + +//! Union of pointers to volatile 64-, 32-, 16- and 8-bit unsigned integers. +typedef union +{ + volatile S64 *s64ptr; + volatile U64 *u64ptr; + volatile S32 *s32ptr; + volatile U32 *u32ptr; + volatile S16 *s16ptr; + volatile U16 *u16ptr; + volatile S8 *s8ptr ; + volatile U8 *u8ptr ; +} UnionVPtr; + +//! Union of pointers to constant 64-, 32-, 16- and 8-bit unsigned integers. +typedef union +{ + const S64 *s64ptr; + const U64 *u64ptr; + const S32 *s32ptr; + const U32 *u32ptr; + const S16 *s16ptr; + const U16 *u16ptr; + const S8 *s8ptr ; + const U8 *u8ptr ; +} UnionCPtr; + +//! Union of pointers to constant volatile 64-, 32-, 16- and 8-bit unsigned integers. +typedef union +{ + const volatile S64 *s64ptr; + const volatile U64 *u64ptr; + const volatile S32 *s32ptr; + const volatile U32 *u32ptr; + const volatile S16 *s16ptr; + const volatile U16 *u16ptr; + const volatile S8 *s8ptr ; + const volatile U8 *u8ptr ; +} UnionCVPtr; + +//! Structure of pointers to 64-, 32-, 16- and 8-bit unsigned integers. +typedef struct +{ + S64 *s64ptr; + U64 *u64ptr; + S32 *s32ptr; + U32 *u32ptr; + S16 *s16ptr; + U16 *u16ptr; + S8 *s8ptr ; + U8 *u8ptr ; +} StructPtr; + +//! Structure of pointers to volatile 64-, 32-, 16- and 8-bit unsigned integers. +typedef struct +{ + volatile S64 *s64ptr; + volatile U64 *u64ptr; + volatile S32 *s32ptr; + volatile U32 *u32ptr; + volatile S16 *s16ptr; + volatile U16 *u16ptr; + volatile S8 *s8ptr ; + volatile U8 *u8ptr ; +} StructVPtr; + +//! Structure of pointers to constant 64-, 32-, 16- and 8-bit unsigned integers. +typedef struct +{ + const S64 *s64ptr; + const U64 *u64ptr; + const S32 *s32ptr; + const U32 *u32ptr; + const S16 *s16ptr; + const U16 *u16ptr; + const S8 *s8ptr ; + const U8 *u8ptr ; +} StructCPtr; + +//! Structure of pointers to constant volatile 64-, 32-, 16- and 8-bit unsigned integers. +typedef struct +{ + const volatile S64 *s64ptr; + const volatile U64 *u64ptr; + const volatile S32 *s32ptr; + const volatile U32 *u32ptr; + const volatile S16 *s16ptr; + const volatile U16 *u16ptr; + const volatile S8 *s8ptr ; + const volatile U8 *u8ptr ; +} StructCVPtr; + +//! @} + +#endif // #ifndef __ASSEMBLY__ + +/*! \name Usual Constants + */ +//! @{ +#define DISABLE 0 +#define ENABLE 1 +#ifndef __cplusplus +#if !defined(__bool_true_false_are_defined) +#define false 0 +#define true 1 +#endif +#endif +#define PASS 0 +#define FAIL 1 +#define LOW 0 +#define HIGH 1 +//! @} + + +#ifndef __ASSEMBLY__ // not for assembling. + +//! \name Optimization Control +//@{ + +/** + * \def likely(exp) + * \brief The expression \a exp is likely to be true + */ +#ifndef likely +# define likely(exp) (exp) +#endif + +/** + * \def unlikely(exp) + * \brief The expression \a exp is unlikely to be true + */ +#ifndef unlikely +# define unlikely(exp) (exp) +#endif + +/** + * \def is_constant(exp) + * \brief Determine if an expression evaluates to a constant value. + * + * \param exp Any expression + * + * \return true if \a exp is constant, false otherwise. + */ +#if (defined __GNUC__) || (defined __CC_ARM) +# define is_constant(exp) __builtin_constant_p(exp) +#else +# define is_constant(exp) (0) +#endif + +//! @} + +/*! \name Bit-Field Handling + */ +//! @{ + +/*! \brief Reads the bits of a value specified by a given bit-mask. + * + * \param value Value to read bits from. + * \param mask Bit-mask indicating bits to read. + * + * \return Read bits. + */ +#define Rd_bits( value, mask) ((value) & (mask)) + +/*! \brief Writes the bits of a C lvalue specified by a given bit-mask. + * + * \param lvalue C lvalue to write bits to. + * \param mask Bit-mask indicating bits to write. + * \param bits Bits to write. + * + * \return Resulting value with written bits. + */ +#define Wr_bits(lvalue, mask, bits) ((lvalue) = ((lvalue) & ~(mask)) |\ + ((bits ) & (mask))) + +/*! \brief Tests the bits of a value specified by a given bit-mask. + * + * \param value Value of which to test bits. + * \param mask Bit-mask indicating bits to test. + * + * \return \c 1 if at least one of the tested bits is set, else \c 0. + */ +#define Tst_bits( value, mask) (Rd_bits(value, mask) != 0) + +/*! \brief Clears the bits of a C lvalue specified by a given bit-mask. + * + * \param lvalue C lvalue of which to clear bits. + * \param mask Bit-mask indicating bits to clear. + * + * \return Resulting value with cleared bits. + */ +#define Clr_bits(lvalue, mask) ((lvalue) &= ~(mask)) + +/*! \brief Sets the bits of a C lvalue specified by a given bit-mask. + * + * \param lvalue C lvalue of which to set bits. + * \param mask Bit-mask indicating bits to set. + * + * \return Resulting value with set bits. + */ +#define Set_bits(lvalue, mask) ((lvalue) |= (mask)) + +/*! \brief Toggles the bits of a C lvalue specified by a given bit-mask. + * + * \param lvalue C lvalue of which to toggle bits. + * \param mask Bit-mask indicating bits to toggle. + * + * \return Resulting value with toggled bits. + */ +#define Tgl_bits(lvalue, mask) ((lvalue) ^= (mask)) + +/*! \brief Reads the bit-field of a value specified by a given bit-mask. + * + * \param value Value to read a bit-field from. + * \param mask Bit-mask indicating the bit-field to read. + * + * \return Read bit-field. + */ +#define Rd_bitfield( value, mask) (Rd_bits( value, mask) >> ctz(mask)) + +/*! \brief Writes the bit-field of a C lvalue specified by a given bit-mask. + * + * \param lvalue C lvalue to write a bit-field to. + * \param mask Bit-mask indicating the bit-field to write. + * \param bitfield Bit-field to write. + * + * \return Resulting value with written bit-field. + */ +#define Wr_bitfield(lvalue, mask, bitfield) (Wr_bits(lvalue, mask, (U32)(bitfield) << ctz(mask))) + +//! @} + + +/*! \name Zero-Bit Counting + * + * Under GCC, __builtin_clz and __builtin_ctz behave like macros when + * applied to constant expressions (values known at compile time), so they are + * more optimized than the use of the corresponding assembly instructions and + * they can be used as constant expressions e.g. to initialize objects having + * static storage duration, and like the corresponding assembly instructions + * when applied to non-constant expressions (values unknown at compile time), so + * they are more optimized than an assembly periphrasis. Hence, clz and ctz + * ensure a possible and optimized behavior for both constant and non-constant + * expressions. + */ +//! @{ + +/*! \brief Counts the leading zero bits of the given value considered as a 32-bit integer. + * + * \param u Value of which to count the leading zero bits. + * + * \return The count of leading zero bits in \a u. + */ +#if (defined __GNUC__) || (defined __CC_ARM) +# define clz(u) __builtin_clz(u) +#elif (defined __ICCARM__) +# define clz(u) __CLZ(u) +#else +# define clz(u) (((u) == 0) ? 32 : \ + ((u) & (1ul << 31)) ? 0 : \ + ((u) & (1ul << 30)) ? 1 : \ + ((u) & (1ul << 29)) ? 2 : \ + ((u) & (1ul << 28)) ? 3 : \ + ((u) & (1ul << 27)) ? 4 : \ + ((u) & (1ul << 26)) ? 5 : \ + ((u) & (1ul << 25)) ? 6 : \ + ((u) & (1ul << 24)) ? 7 : \ + ((u) & (1ul << 23)) ? 8 : \ + ((u) & (1ul << 22)) ? 9 : \ + ((u) & (1ul << 21)) ? 10 : \ + ((u) & (1ul << 20)) ? 11 : \ + ((u) & (1ul << 19)) ? 12 : \ + ((u) & (1ul << 18)) ? 13 : \ + ((u) & (1ul << 17)) ? 14 : \ + ((u) & (1ul << 16)) ? 15 : \ + ((u) & (1ul << 15)) ? 16 : \ + ((u) & (1ul << 14)) ? 17 : \ + ((u) & (1ul << 13)) ? 18 : \ + ((u) & (1ul << 12)) ? 19 : \ + ((u) & (1ul << 11)) ? 20 : \ + ((u) & (1ul << 10)) ? 21 : \ + ((u) & (1ul << 9)) ? 22 : \ + ((u) & (1ul << 8)) ? 23 : \ + ((u) & (1ul << 7)) ? 24 : \ + ((u) & (1ul << 6)) ? 25 : \ + ((u) & (1ul << 5)) ? 26 : \ + ((u) & (1ul << 4)) ? 27 : \ + ((u) & (1ul << 3)) ? 28 : \ + ((u) & (1ul << 2)) ? 29 : \ + ((u) & (1ul << 1)) ? 30 : \ + 31) +#endif + +/*! \brief Counts the trailing zero bits of the given value considered as a 32-bit integer. + * + * \param u Value of which to count the trailing zero bits. + * + * \return The count of trailing zero bits in \a u. + */ +#if (defined __GNUC__) || (defined __CC_ARM) +# define ctz(u) __builtin_ctz(u) +#else +# define ctz(u) ((u) & (1ul << 0) ? 0 : \ + (u) & (1ul << 1) ? 1 : \ + (u) & (1ul << 2) ? 2 : \ + (u) & (1ul << 3) ? 3 : \ + (u) & (1ul << 4) ? 4 : \ + (u) & (1ul << 5) ? 5 : \ + (u) & (1ul << 6) ? 6 : \ + (u) & (1ul << 7) ? 7 : \ + (u) & (1ul << 8) ? 8 : \ + (u) & (1ul << 9) ? 9 : \ + (u) & (1ul << 10) ? 10 : \ + (u) & (1ul << 11) ? 11 : \ + (u) & (1ul << 12) ? 12 : \ + (u) & (1ul << 13) ? 13 : \ + (u) & (1ul << 14) ? 14 : \ + (u) & (1ul << 15) ? 15 : \ + (u) & (1ul << 16) ? 16 : \ + (u) & (1ul << 17) ? 17 : \ + (u) & (1ul << 18) ? 18 : \ + (u) & (1ul << 19) ? 19 : \ + (u) & (1ul << 20) ? 20 : \ + (u) & (1ul << 21) ? 21 : \ + (u) & (1ul << 22) ? 22 : \ + (u) & (1ul << 23) ? 23 : \ + (u) & (1ul << 24) ? 24 : \ + (u) & (1ul << 25) ? 25 : \ + (u) & (1ul << 26) ? 26 : \ + (u) & (1ul << 27) ? 27 : \ + (u) & (1ul << 28) ? 28 : \ + (u) & (1ul << 29) ? 29 : \ + (u) & (1ul << 30) ? 30 : \ + (u) & (1ul << 31) ? 31 : \ + 32) +#endif + +//! @} + + +/*! \name Bit Reversing + */ +//! @{ + +/*! \brief Reverses the bits of \a u8. + * + * \param u8 U8 of which to reverse the bits. + * + * \return Value resulting from \a u8 with reversed bits. + */ +#define bit_reverse8(u8) ((U8)(bit_reverse32((U8)(u8)) >> 24)) + +/*! \brief Reverses the bits of \a u16. + * + * \param u16 U16 of which to reverse the bits. + * + * \return Value resulting from \a u16 with reversed bits. + */ +#define bit_reverse16(u16) ((U16)(bit_reverse32((U16)(u16)) >> 16)) + +/*! \brief Reverses the bits of \a u32. + * + * \param u32 U32 of which to reverse the bits. + * + * \return Value resulting from \a u32 with reversed bits. + */ +#define bit_reverse32(u32) __RBIT(u32) + +/*! \brief Reverses the bits of \a u64. + * + * \param u64 U64 of which to reverse the bits. + * + * \return Value resulting from \a u64 with reversed bits. + */ +#define bit_reverse64(u64) ((U64)(((U64)bit_reverse32((U64)(u64) >> 32)) |\ + ((U64)bit_reverse32((U64)(u64)) << 32))) + +//! @} + + +/*! \name Alignment + */ +//! @{ + +/*! \brief Tests alignment of the number \a val with the \a n boundary. + * + * \param val Input value. + * \param n Boundary. + * + * \return \c 1 if the number \a val is aligned with the \a n boundary, else \c 0. + */ +#define Test_align(val, n ) (!Tst_bits( val, (n) - 1 ) ) + +/*! \brief Gets alignment of the number \a val with respect to the \a n boundary. + * + * \param val Input value. + * \param n Boundary. + * + * \return Alignment of the number \a val with respect to the \a n boundary. + */ +#define Get_align( val, n ) ( Rd_bits( val, (n) - 1 ) ) + +/*! \brief Sets alignment of the lvalue number \a lval to \a alg with respect to the \a n boundary. + * + * \param lval Input/output lvalue. + * \param n Boundary. + * \param alg Alignment. + * + * \return New value of \a lval resulting from its alignment set to \a alg with respect to the \a n boundary. + */ +#define Set_align(lval, n, alg) ( Wr_bits(lval, (n) - 1, alg) ) + +/*! \brief Aligns the number \a val with the upper \a n boundary. + * + * \param val Input value. + * \param n Boundary. + * + * \return Value resulting from the number \a val aligned with the upper \a n boundary. + */ +#define Align_up( val, n ) (((val) + ((n) - 1)) & ~((n) - 1)) + +/*! \brief Aligns the number \a val with the lower \a n boundary. + * + * \param val Input value. + * \param n Boundary. + * + * \return Value resulting from the number \a val aligned with the lower \a n boundary. + */ +#define Align_down(val, n ) ( (val) & ~((n) - 1)) + +//! @} + + +/*! \name Mathematics + * + * The same considerations as for clz and ctz apply here but GCC does not + * provide built-in functions to access the assembly instructions abs, min and + * max and it does not produce them by itself in most cases, so two sets of + * macros are defined here: + * - Abs, Min and Max to apply to constant expressions (values known at + * compile time); + * - abs, min and max to apply to non-constant expressions (values unknown at + * compile time), abs is found in stdlib.h. + */ +//! @{ + +/*! \brief Takes the absolute value of \a a. + * + * \param a Input value. + * + * \return Absolute value of \a a. + * + * \note More optimized if only used with values known at compile time. + */ +#define Abs(a) (((a) < 0 ) ? -(a) : (a)) + +/*! \brief Takes the minimal value of \a a and \a b. + * + * \param a Input value. + * \param b Input value. + * + * \return Minimal value of \a a and \a b. + * + * \note More optimized if only used with values known at compile time. + */ +#define Min(a, b) (((a) < (b)) ? (a) : (b)) + +/*! \brief Takes the maximal value of \a a and \a b. + * + * \param a Input value. + * \param b Input value. + * + * \return Maximal value of \a a and \a b. + * + * \note More optimized if only used with values known at compile time. + */ +#define Max(a, b) (((a) > (b)) ? (a) : (b)) + +// abs() is already defined by stdlib.h + +/*! \brief Takes the minimal value of \a a and \a b. + * + * \param a Input value. + * \param b Input value. + * + * \return Minimal value of \a a and \a b. + * + * \note More optimized if only used with values unknown at compile time. + */ +#define min(a, b) Min(a, b) + +/*! \brief Takes the maximal value of \a a and \a b. + * + * \param a Input value. + * \param b Input value. + * + * \return Maximal value of \a a and \a b. + * + * \note More optimized if only used with values unknown at compile time. + */ +#define max(a, b) Max(a, b) + +//! @} + + +/*! \brief Calls the routine at address \a addr. + * + * It generates a long call opcode. + * + * For example, `Long_call(0x80000000)' generates a software reset on a UC3 if + * it is invoked from the CPU supervisor mode. + * + * \param addr Address of the routine to call. + * + * \note It may be used as a long jump opcode in some special cases. + */ +#define Long_call(addr) ((*(void (*)(void))(addr))()) + + +/*! \name MCU Endianism Handling + * ARM is MCU little endianism. + */ +//! @{ +#define MSB(u16) (((U8 *)&(u16))[1]) //!< Most significant byte of \a u16. +#define LSB(u16) (((U8 *)&(u16))[0]) //!< Least significant byte of \a u16. + +#define MSH(u32) (((U16 *)&(u32))[1]) //!< Most significant half-word of \a u32. +#define LSH(u32) (((U16 *)&(u32))[0]) //!< Least significant half-word of \a u32. +#define MSB0W(u32) (((U8 *)&(u32))[3]) //!< Most significant byte of 1st rank of \a u32. +#define MSB1W(u32) (((U8 *)&(u32))[2]) //!< Most significant byte of 2nd rank of \a u32. +#define MSB2W(u32) (((U8 *)&(u32))[1]) //!< Most significant byte of 3rd rank of \a u32. +#define MSB3W(u32) (((U8 *)&(u32))[0]) //!< Most significant byte of 4th rank of \a u32. +#define LSB3W(u32) MSB0W(u32) //!< Least significant byte of 4th rank of \a u32. +#define LSB2W(u32) MSB1W(u32) //!< Least significant byte of 3rd rank of \a u32. +#define LSB1W(u32) MSB2W(u32) //!< Least significant byte of 2nd rank of \a u32. +#define LSB0W(u32) MSB3W(u32) //!< Least significant byte of 1st rank of \a u32. + +#define MSW(u64) (((U32 *)&(u64))[1]) //!< Most significant word of \a u64. +#define LSW(u64) (((U32 *)&(u64))[0]) //!< Least significant word of \a u64. +#define MSH0(u64) (((U16 *)&(u64))[3]) //!< Most significant half-word of 1st rank of \a u64. +#define MSH1(u64) (((U16 *)&(u64))[2]) //!< Most significant half-word of 2nd rank of \a u64. +#define MSH2(u64) (((U16 *)&(u64))[1]) //!< Most significant half-word of 3rd rank of \a u64. +#define MSH3(u64) (((U16 *)&(u64))[0]) //!< Most significant half-word of 4th rank of \a u64. +#define LSH3(u64) MSH0(u64) //!< Least significant half-word of 4th rank of \a u64. +#define LSH2(u64) MSH1(u64) //!< Least significant half-word of 3rd rank of \a u64. +#define LSH1(u64) MSH2(u64) //!< Least significant half-word of 2nd rank of \a u64. +#define LSH0(u64) MSH3(u64) //!< Least significant half-word of 1st rank of \a u64. +#define MSB0D(u64) (((U8 *)&(u64))[7]) //!< Most significant byte of 1st rank of \a u64. +#define MSB1D(u64) (((U8 *)&(u64))[6]) //!< Most significant byte of 2nd rank of \a u64. +#define MSB2D(u64) (((U8 *)&(u64))[5]) //!< Most significant byte of 3rd rank of \a u64. +#define MSB3D(u64) (((U8 *)&(u64))[4]) //!< Most significant byte of 4th rank of \a u64. +#define MSB4D(u64) (((U8 *)&(u64))[3]) //!< Most significant byte of 5th rank of \a u64. +#define MSB5D(u64) (((U8 *)&(u64))[2]) //!< Most significant byte of 6th rank of \a u64. +#define MSB6D(u64) (((U8 *)&(u64))[1]) //!< Most significant byte of 7th rank of \a u64. +#define MSB7D(u64) (((U8 *)&(u64))[0]) //!< Most significant byte of 8th rank of \a u64. +#define LSB7D(u64) MSB0D(u64) //!< Least significant byte of 8th rank of \a u64. +#define LSB6D(u64) MSB1D(u64) //!< Least significant byte of 7th rank of \a u64. +#define LSB5D(u64) MSB2D(u64) //!< Least significant byte of 6th rank of \a u64. +#define LSB4D(u64) MSB3D(u64) //!< Least significant byte of 5th rank of \a u64. +#define LSB3D(u64) MSB4D(u64) //!< Least significant byte of 4th rank of \a u64. +#define LSB2D(u64) MSB5D(u64) //!< Least significant byte of 3rd rank of \a u64. +#define LSB1D(u64) MSB6D(u64) //!< Least significant byte of 2nd rank of \a u64. +#define LSB0D(u64) MSB7D(u64) //!< Least significant byte of 1st rank of \a u64. + +#define BE16(x) Swap16(x) +#define LE16(x) (x) + +#define le16_to_cpu(x) (x) +#define cpu_to_le16(x) (x) +#define LE16_TO_CPU(x) (x) +#define CPU_TO_LE16(x) (x) + +#define be16_to_cpu(x) Swap16(x) +#define cpu_to_be16(x) Swap16(x) +#define BE16_TO_CPU(x) Swap16(x) +#define CPU_TO_BE16(x) Swap16(x) + +#define le32_to_cpu(x) (x) +#define cpu_to_le32(x) (x) +#define LE32_TO_CPU(x) (x) +#define CPU_TO_LE32(x) (x) + +#define be32_to_cpu(x) swap32(x) +#define cpu_to_be32(x) swap32(x) +#define BE32_TO_CPU(x) swap32(x) +#define CPU_TO_BE32(x) swap32(x) +//! @} + + +/*! \name Endianism Conversion + * + * The same considerations as for clz and ctz apply here but GCC's + * __builtin_bswap_32 and __builtin_bswap_64 do not behave like macros when + * applied to constant expressions, so two sets of macros are defined here: + * - Swap16, Swap32 and Swap64 to apply to constant expressions (values known + * at compile time); + * - swap16, swap32 and swap64 to apply to non-constant expressions (values + * unknown at compile time). + */ +//! @{ + +/*! \brief Toggles the endianism of \a u16 (by swapping its bytes). + * + * \param u16 U16 of which to toggle the endianism. + * + * \return Value resulting from \a u16 with toggled endianism. + * + * \note More optimized if only used with values known at compile time. + */ +#define Swap16(u16) ((U16)(((U16)(u16) >> 8) |\ + ((U16)(u16) << 8))) + +/*! \brief Toggles the endianism of \a u32 (by swapping its bytes). + * + * \param u32 U32 of which to toggle the endianism. + * + * \return Value resulting from \a u32 with toggled endianism. + * + * \note More optimized if only used with values known at compile time. + */ +#define Swap32(u32) ((U32)(((U32)Swap16((U32)(u32) >> 16)) |\ + ((U32)Swap16((U32)(u32)) << 16))) + +/*! \brief Toggles the endianism of \a u64 (by swapping its bytes). + * + * \param u64 U64 of which to toggle the endianism. + * + * \return Value resulting from \a u64 with toggled endianism. + * + * \note More optimized if only used with values known at compile time. + */ +#define Swap64(u64) ((U64)(((U64)Swap32((U64)(u64) >> 32)) |\ + ((U64)Swap32((U64)(u64)) << 32))) + +/*! \brief Toggles the endianism of \a u16 (by swapping its bytes). + * + * \param u16 U16 of which to toggle the endianism. + * + * \return Value resulting from \a u16 with toggled endianism. + * + * \note More optimized if only used with values unknown at compile time. + */ +#define swap16(u16) Swap16(u16) + +/*! \brief Toggles the endianism of \a u32 (by swapping its bytes). + * + * \param u32 U32 of which to toggle the endianism. + * + * \return Value resulting from \a u32 with toggled endianism. + * + * \note More optimized if only used with values unknown at compile time. + */ +#if (defined __GNUC__) +# define swap32(u32) ((U32)__builtin_bswap32((U32)(u32))) +#else +# define swap32(u32) Swap32(u32) +#endif + +/*! \brief Toggles the endianism of \a u64 (by swapping its bytes). + * + * \param u64 U64 of which to toggle the endianism. + * + * \return Value resulting from \a u64 with toggled endianism. + * + * \note More optimized if only used with values unknown at compile time. + */ +#if (defined __GNUC__) +# define swap64(u64) ((U64)__builtin_bswap64((U64)(u64))) +#else +# define swap64(u64) ((U64)(((U64)swap32((U64)(u64) >> 32)) |\ + ((U64)swap32((U64)(u64)) << 32))) +#endif + +//! @} + + +/*! \name Target Abstraction + */ +//! @{ + +#define _GLOBEXT_ extern //!< extern storage-class specifier. +#define _CONST_TYPE_ const //!< const type qualifier. +#define _MEM_TYPE_SLOW_ //!< Slow memory type. +#define _MEM_TYPE_MEDFAST_ //!< Fairly fast memory type. +#define _MEM_TYPE_FAST_ //!< Fast memory type. + +typedef U8 Byte; //!< 8-bit unsigned integer. + +#define memcmp_ram2ram memcmp //!< Target-specific memcmp of RAM to RAM. +#define memcmp_code2ram memcmp //!< Target-specific memcmp of RAM to NVRAM. +#define memcpy_ram2ram memcpy //!< Target-specific memcpy from RAM to RAM. +#define memcpy_code2ram memcpy //!< Target-specific memcpy from NVRAM to RAM. + +#define LSB0(u32) LSB0W(u32) //!< Least significant byte of 1st rank of \a u32. +#define LSB1(u32) LSB1W(u32) //!< Least significant byte of 2nd rank of \a u32. +#define LSB2(u32) LSB2W(u32) //!< Least significant byte of 3rd rank of \a u32. +#define LSB3(u32) LSB3W(u32) //!< Least significant byte of 4th rank of \a u32. +#define MSB3(u32) MSB3W(u32) //!< Most significant byte of 4th rank of \a u32. +#define MSB2(u32) MSB2W(u32) //!< Most significant byte of 3rd rank of \a u32. +#define MSB1(u32) MSB1W(u32) //!< Most significant byte of 2nd rank of \a u32. +#define MSB0(u32) MSB0W(u32) //!< Most significant byte of 1st rank of \a u32. + +//! @} + +/** + * \brief Calculate \f$ \left\lceil \frac{a}{b} \right\rceil \f$ using + * integer arithmetic. + * + * \param a An integer + * \param b Another integer + * + * \return (\a a / \a b) rounded up to the nearest integer. + */ +#define div_ceil(a, b) (((a) + (b) - 1) / (b)) + +#endif // #ifndef __ASSEMBLY__ + + +#if defined(__ICCARM__) +#define SHORTENUM __packed +#elif defined(__GNUC__) +#define SHORTENUM __attribute__((packed)) +#endif + +#define FLASH_DECLARE(x) const x +#define FLASH_EXTERN(x) extern const x +#define PGM_READ_BYTE(x) *(x) +#define PGM_READ_WORD(x) *(x) +#define MEMCPY_ENDIAN memcpy +#define PGM_READ_BLOCK(dst, src, len) memcpy((dst), (src), (len)) + +/* Converting of values from CPU endian to little endian. */ +#define CPU_ENDIAN_TO_LE16(x) (x) +#define CPU_ENDIAN_TO_LE32(x) (x) +#define CPU_ENDIAN_TO_LE64(x) (x) + +/* Converting of values from little endian to CPU endian. */ +#define LE16_TO_CPU_ENDIAN(x) (x) +#define LE32_TO_CPU_ENDIAN(x) (x) +#define LE64_TO_CPU_ENDIAN(x) (x) + +/* Converting of constants from CPU endian to little endian. */ +#define CCPU_ENDIAN_TO_LE16(x) (x) +#define CCPU_ENDIAN_TO_LE32(x) (x) +#define CCPU_ENDIAN_TO_LE64(x) (x) + +#define ADDR_COPY_DST_SRC_16(dst, src) ((dst) = (src)) +#define ADDR_COPY_DST_SRC_64(dst, src) ((dst) = (src)) + +/** + * \} + */ + +#endif /* UTILS_COMPILER_H */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/header_files/io.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/header_files/io.h new file mode 100644 index 000000000..4e91b8cc8 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/header_files/io.h @@ -0,0 +1,90 @@ +/** + * \file + * + * \brief Arch file for SAM. + * + * This file defines common SAM series. + * + * Copyright (c) 2011-2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#ifndef _SAM_IO_ +#define _SAM_IO_ + +/* SAM3 family */ + +/* SAM3S series */ +#if (SAM3S) +# if (SAM3S8 || SAM3SD8) +# include "sam3s8.h" +# else +# include "sam3s.h" +# endif +#endif + +/* SAM3U series */ +#if (SAM3U) +# include "sam3u.h" +#endif + +/* SAM3N series */ +#if (SAM3N) +# include "sam3n.h" +#endif + +/* SAM3XA series */ +#if (SAM3XA) +# include "sam3xa.h" +#endif + +/* SAM4S series */ +#if (SAM4S) +# include "sam4s.h" +#endif + +/* SAM4L series */ +#if (SAM4L) +# include "sam4l.h" +#endif + +/* SAM4E series */ +#if (SAM4E) +# include "sam4e.h" +#endif + +#endif /* _SAM_IO_ */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/linker_scripts/sam4l/sam4l4/gcc/flash.ld b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/linker_scripts/sam4l/sam4l4/gcc/flash.ld new file mode 100644 index 000000000..a2d119787 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/linker_scripts/sam4l/sam4l4/gcc/flash.ld @@ -0,0 +1,154 @@ +/** + * \file + * + * \brief Flash Linker script for SAM. + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") +OUTPUT_ARCH(arm) +SEARCH_DIR(.) + +/* Memory Spaces Definitions */ +MEMORY +{ + rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000 /* flash, 256K */ + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 /* sram, 32K */ +} + +/* The stack size used by the application. NOTE: you need to adjust according to your application. */ +__stack_size__ = DEFINED(__stack_size__) ? __stack_size__ : 0x1000; + +/* Section Definitions */ +SECTIONS +{ + .text : + { + . = ALIGN(4); + _sfixed = .; + KEEP(*(.vectors .vectors.*)) + *(.text .text.* .gnu.linkonce.t.*) + *(.glue_7t) *(.glue_7) + *(.rodata .rodata* .gnu.linkonce.r.*) + *(.ARM.extab* .gnu.linkonce.armextab.*) + + /* Support C constructors, and C destructors in both user code + and the C library. This also provides support for C++ code. */ + . = ALIGN(4); + KEEP(*(.init)) + . = ALIGN(4); + __preinit_array_start = .; + KEEP (*(.preinit_array)) + __preinit_array_end = .; + + . = ALIGN(4); + __init_array_start = .; + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array)) + __init_array_end = .; + + . = ALIGN(0x4); + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*crtend.o(.ctors)) + + . = ALIGN(4); + KEEP(*(.fini)) + + . = ALIGN(4); + __fini_array_start = .; + KEEP (*(.fini_array)) + KEEP (*(SORT(.fini_array.*))) + __fini_array_end = .; + + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*crtend.o(.dtors)) + + . = ALIGN(4); + _efixed = .; /* End of text section */ + } > rom + + /* .ARM.exidx is sorted, so has to go in its own output section. */ + PROVIDE_HIDDEN (__exidx_start = .); + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > rom + PROVIDE_HIDDEN (__exidx_end = .); + + . = ALIGN(4); + _etext = .; + + .relocate : AT (_etext) + { + . = ALIGN(4); + _srelocate = .; + *(.ramfunc .ramfunc.*); + *(.data .data.*); + . = ALIGN(4); + _erelocate = .; + } > ram + + /* .bss section which is used for uninitialized data */ + .bss (NOLOAD) : + { + . = ALIGN(4); + _sbss = . ; + _szero = .; + *(.bss .bss.*) + *(COMMON) + . = ALIGN(4); + _ebss = . ; + _ezero = .; + } > ram + + /* stack section */ + .stack (NOLOAD): + { + . = ALIGN(8); + _sstack = .; + . = . + __stack_size__; + . = ALIGN(8); + _estack = .; + } > ram + + . = ALIGN(4); + _end = . ; +} diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/make/Makefile.in b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/make/Makefile.in new file mode 100644 index 000000000..85fbe9b09 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/make/Makefile.in @@ -0,0 +1,496 @@ +# List of available make goals: +# +# all Default target, builds the project +# clean Clean up the project +# rebuild Rebuild the project +# debug_flash Builds the project and debug in flash +# debug_sram Builds the project and debug in sram +# +# doc Build the documentation +# cleandoc Clean up the documentation +# rebuilddoc Rebuild the documentation +# +# \file +# +# Copyright (c) 2011 - 2012 Atmel Corporation. All rights reserved. +# +# \asf_license_start +# +# \page License +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# 3. The name of Atmel may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# 4. This software may only be redistributed and used in connection with an +# Atmel microcontroller product. +# +# THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +# EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# \asf_license_stop +# + +# Include the config.mk file from the current working path, e.g., where the +# user called make. +include config.mk + +# Tool to use to generate documentation from the source code +DOCGEN ?= doxygen + +# Look for source files relative to the top-level source directory +VPATH := $(PRJ_PATH) + +# Output target file +project_type := $(PROJECT_TYPE) + +# Output target file +ifeq ($(project_type),flash) +target := $(TARGET_FLASH) +linker_script := $(PRJ_PATH)/$(LINKER_SCRIPT_FLASH) +debug_script := $(PRJ_PATH)/$(DEBUG_SCRIPT_FLASH) +else +target := $(TARGET_SRAM) +linker_script := $(PRJ_PATH)/$(LINKER_SCRIPT_SRAM) +debug_script := $(PRJ_PATH)/$(DEBUG_SCRIPT_SRAM) +endif + +# Output project name (target name minus suffix) +project := $(basename $(target)) + +# Output target file (typically ELF or static library) +ifeq ($(suffix $(target)),.a) +target_type := lib +else +ifeq ($(suffix $(target)),.elf) +target_type := elf +else +$(error "Target type $(target_type) is not supported") +endif +endif + +# Allow override of operating system detection. The user can add OS=Linux or +# OS=Windows on the command line to explicit set the host OS. +# +# This allows to work around broken uname utility on certain systems. +ifdef OS + ifeq ($(strip $(OS)), Linux) + os_type := Linux + endif + ifeq (Windows,$(findstring Windows,$(OS))) + os_type := windows32_64 + endif +endif + +#os_type ?= $(strip $(shell uname)) + +#ifeq ($(os_type),windows32) +#os := Windows +#else +#ifeq ($(os_type),windows64) +#os := Windows +#else +#ifeq ($(os_type),) +#os := Windows +#else +## Default to Linux style operating system. Both Cygwin and mingw are fully +## compatible (for this Makefile) with Linux. +#os := Linux +#endif +#endif +#endif + +ifeq ($(os_type),windows32_64) +os := Windows +else +ifeq ($(os_type),Linux) +os := Linux +else +os := Linux +endif +endif + +# Output documentation directory and configuration file. +docdir := ../doxygen/html +doccfg := ../doxygen/doxyfile.doxygen + +CROSS ?= arm-none-eabi- +AR := $(CROSS)ar +AS := $(CROSS)as +CC := $(CROSS)gcc +CPP := $(CROSS)gcc -E +CXX := $(CROSS)g++ +LD := $(CROSS)g++ +NM := $(CROSS)nm +OBJCOPY := $(CROSS)objcopy +OBJDUMP := $(CROSS)objdump +SIZE := $(CROSS)size +GDB := $(CROSS)gdb + +RM := rm -f +ifeq ($(os),Windows) +#RMDIR := rmdir /S /Q +RMDIR := rm -rf +else +RMDIR := rmdir -p --ignore-fail-on-non-empty +endif + +# Strings for beautifying output +MSG_CLEAN_FILES = "RM *.o *.d" +MSG_CLEAN_DIRS = "RMDIR $(strip $(clean-dirs))" +MSG_CLEAN_DOC = "RMDIR $(docdir)" +MSG_MKDIR = "MKDIR $(dir $@)" + +MSG_INFO = "INFO " + +MSG_ARCHIVING = "AR $@" +MSG_ASSEMBLING = "AS $@" +MSG_BINARY_IMAGE = "OBJCOPY $@" +MSG_COMPILING = "CC $@" +MSG_COMPILING_CXX = "CXX $@" +MSG_EXTENDED_LISTING = "OBJDUMP $@" +MSG_IHEX_IMAGE = "OBJCOPY $@" +MSG_LINKING = "LN $@" +MSG_PREPROCESSING = "CPP $@" +MSG_SIZE = "SIZE $@" +MSG_SYMBOL_TABLE = "NM $@" + +MSG_GENERATING_DOC = "DOXYGEN $(docdir)" + +# Don't use make's built-in rules and variables +MAKEFLAGS += -rR + +# Don't print 'Entering directory ...' +MAKEFLAGS += --no-print-directory + +# Function for reversing the order of a list +reverse = $(if $(1),$(call reverse,$(wordlist 2,$(words $(1)),$(1)))) $(firstword $(1)) + +# Hide command output by default, but allow the user to override this +# by adding V=1 on the command line. +# +# This is inspired by the Kbuild system used by the Linux kernel. +ifdef V + ifeq ("$(origin V)", "command line") + VERBOSE = $(V) + endif +endif +ifndef VERBOSE + VERBOSE = 0 +endif + +ifeq ($(VERBOSE), 1) + Q = +else +# Q = @ + Q = +endif + +arflags-gnu-y := $(ARFLAGS) +asflags-gnu-y := $(ASFLAGS) +cflags-gnu-y := $(CFLAGS) +cxxflags-gnu-y := $(CXXFLAGS) +cppflags-gnu-y := $(CPPFLAGS) +cpuflags-gnu-y := +dbgflags-gnu-y := $(DBGFLAGS) +libflags-gnu-y := $(foreach LIB,$(LIBS),-l$(LIB)) +ldflags-gnu-y := $(LDFLAGS) +flashflags-gnu-y := +clean-files := +clean-dirs := + +clean-files += $(wildcard $(target) $(project).map) +clean-files += $(wildcard $(project).hex $(project).bin) +clean-files += $(wildcard $(project).lss $(project).sym) +clean-files += $(wildcard $(build)) + +# Use pipes instead of temporary files for communication between processes +cflags-gnu-y += -pipe +asflags-gnu-y += -pipe +ldflags-gnu-y += -pipe + +# Archiver flags. +arflags-gnu-y += rcs + +# Always enable warnings. And be very careful about implicit +# declarations. +cflags-gnu-y += -Wall -Wstrict-prototypes -Wmissing-prototypes +cflags-gnu-y += -Werror-implicit-function-declaration +cxxflags-gnu-y += -Wall +# IAR doesn't allow arithmetic on void pointers, so warn about that. +cflags-gnu-y += -Wpointer-arith +cxxflags-gnu-y += -Wpointer-arith + +# Preprocessor flags. +cppflags-gnu-y += $(foreach INC,$(addprefix $(PRJ_PATH)/,$(INC_PATH)),-I$(INC)) +asflags-gnu-y += $(foreach INC,$(addprefix $(PRJ_PATH)/,$(INC_PATH)),'-Wa,-I$(INC)') + +# CPU specific flags. +cpuflags-gnu-y += -mcpu=$(ARCH) -mthumb -D=__$(PART)__ + +# Dependency file flags. +depflags = -MD -MP -MQ $@ + +# Debug specific flags. +ifdef BUILD_DEBUG_LEVEL +dbgflags-gnu-y += -g$(BUILD_DEBUG_LEVEL) +else +dbgflags-gnu-y += -g3 +endif + +# Optimization specific flags. +ifdef BUILD_OPTIMIZATION +optflags-gnu-y = -O$(BUILD_OPTIMIZATION) +else +optflags-gnu-y = $(OPTIMIZATION) +endif + +# Always preprocess assembler files. +asflags-gnu-y += -x assembler-with-cpp +# Compile C files using the GNU99 standard. +cflags-gnu-y += -std=gnu99 +# Compile C++ files using the GNU++98 standard. +cxxflags-gnu-y += -std=gnu++98 + + +# Separate each function and data into its own separate section to allow +# garbage collection of unused sections. +cflags-gnu-y += -ffunction-sections -fdata-sections +cxxflags-gnu-y += -ffunction-sections -fdata-sections + +# Various cflags. +cflags-gnu-y += -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int +cflags-gnu-y += -Wmain -Wparentheses +cflags-gnu-y += -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused +cflags-gnu-y += -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef +cflags-gnu-y += -Wshadow -Wbad-function-cast -Wwrite-strings +cflags-gnu-y += -Wsign-compare -Waggregate-return +cflags-gnu-y += -Wmissing-declarations +cflags-gnu-y += -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations +cflags-gnu-y += -Wpacked -Wredundant-decls -Wnested-externs -Winline -Wlong-long +cflags-gnu-y += -Wunreachable-code +cflags-gnu-y += -Wcast-align +cflags-gnu-y += --param max-inline-insns-single=500 + +# To reduce application size use only integer printf function. +cflags-gnu-y += -Dprintf=iprintf + +# Garbage collect unreferred sections when linking. +ldflags-gnu-y += -Wl,--gc-sections + +# Use the linker script if provided by the project. +ifneq ($(strip $(linker_script)),) +ldflags-gnu-y += -Wl,-T $(linker_script) +endif + +# Output a link map file and a cross reference table +ldflags-gnu-y += -Wl,-Map=$(project).map,--cref + +# Add library search paths relative to the top level directory. +ldflags-gnu-y += $(foreach _LIB_PATH,$(addprefix $(PRJ_PATH)/,$(LIB_PATH)),-L$(_LIB_PATH)) + +a_flags = $(cpuflags-gnu-y) $(depflags) $(cppflags-gnu-y) $(asflags-gnu-y) -D__ASSEMBLY__ +c_flags = $(cpuflags-gnu-y) $(dbgflags-gnu-y) $(depflags) $(optflags-gnu-y) $(cppflags-gnu-y) $(cflags-gnu-y) +cxx_flags= $(cpuflags-gnu-y) $(dbgflags-gnu-y) $(depflags) $(optflags-gnu-y) $(cppflags-gnu-y) $(cxxflags-gnu-y) +l_flags = -Wl,--entry=Reset_Handler -Wl,--cref $(cpuflags-gnu-y) $(optflags-gnu-y) $(ldflags-gnu-y) +ar_flags = $(arflags-gnu-y) + +# Source files list and part informations must already be included before +# running this makefile + +# If a custom build directory is specified, use it -- force trailing / in directory name. +ifdef BUILD_DIR + build-dir := $(dir $(BUILD_DIR))$(if $(notdir $(BUILD_DIR)),$(notdir $(BUILD_DIR))/) +else + build-dir = +endif + +# Create object files list from source files list. +obj-y := $(addprefix $(build-dir), $(addsuffix .o,$(basename $(CSRCS) $(ASSRCS)))) +# Create dependency files list from source files list. +dep-files := $(wildcard $(foreach f,$(obj-y),$(basename $(f)).d)) + +clean-files += $(wildcard $(obj-y)) +clean-files += $(dep-files) + +clean-dirs += $(call reverse,$(sort $(wildcard $(dir $(obj-y))))) + +.PHONY: all + +# Default target. +.PHONY: all +ifeq ($(project_type),all) +all: + $(MAKE) all PROJECT_TYPE=flash + $(MAKE) all PROJECT_TYPE=sram +else +ifeq ($(target_type),lib) +all: $(target) $(project).lss $(project).sym +else +ifeq ($(target_type),elf) +all: $(target) $(project).lss $(project).sym $(project).hex $(project).bin +endif +endif +endif + +# Default target. +.PHONY: os +os: + @echo OS '$(OS)' + @echo os type '$(os_type)' + @echo os '$(os)' + @echo '$(findstring Windows,$(OS))' + +# Clean up the project. +.PHONY: clean +clean: + @$(if $(strip $(clean-files)),echo $(MSG_CLEAN_FILES)) + $(if $(strip $(clean-files)),$(Q)$(RM) $(clean-files),) + @$(if $(strip $(clean-dirs)),echo $(MSG_CLEAN_DIRS)) +# Remove created directories, and make sure we only remove existing +# directories, since recursive rmdir might help us a bit on the way. +ifeq ($(os),Windows) + $(Q)$(if $(strip $(clean-dirs)), \ + $(RMDIR) $(strip $(subst /,\,$(clean-dirs)))) +else + $(Q)$(if $(strip $(clean-dirs)), \ + for directory in $(strip $(clean-dirs)); do \ + if [ -d "$$directory" ]; then \ + $(RMDIR) $$directory; \ + fi \ + done \ + ) +endif + +# Rebuild the project. +.PHONY: rebuild +rebuild: clean all + +# Debug the project in flash. +.PHONY: debug_flash +debug_flash: all + $(GDB) -x "$(PRJ_PATH)/$(DEBUG_SCRIPT_FLASH)" -ex "reset" -readnow -se $(TARGET_FLASH) + +# Debug the project in sram. +.PHONY: debug_sram +debug_sram: all + $(GDB) -x "$(PRJ_PATH)/$(DEBUG_SCRIPT_SRAM)" -ex "reset" -readnow -se $(TARGET_SRAM) + +.PHONY: objfiles +objfiles: $(obj-y) + +# Create object files from C source files. +$(build-dir)%.o: %.c $(PRJ_PATH)/sam/utils/make/Makefile.in config.mk + @echo $(MSG_MKDIR) +ifeq ($(os),Windows) + -mkdir $(subst /,\,$(dir $@)) +else + -mkdir -p $(dir $@) +endif + @echo $(MSG_COMPILING) + $(Q)$(CC) $(c_flags) -c $< -o $@ + +# Create object files from C++ source files. +$(build-dir)%.o: %.cpp $(PRJ_PATH)/sam/utils/make/Makefile.in config.mk + @echo $(MSG_MKDIR) +ifeq ($(os),Windows) + -mkdir $(subst /,\,$(dir $@)) +else + -mkdir -p $(dir $@) +endif + @echo $(MSG_COMPILING_CXX) + $(Q)$(CXX) $(cxx_flags) -c $< -o $@ + +# Preprocess and assemble: create object files from assembler source files. +$(build-dir)%.o: %.S $(PRJ_PATH)/sam/utils/make/Makefile.in config.mk + @echo $(MSG_MKDIR) +ifeq ($(os),Windows) + -mkdir $(subst /,\,$(dir $@)) +else + -mkdir -p $(dir $@) +endif + @echo $(MSG_ASSEMBLING) + $(Q)$(CC) $(a_flags) -c $< -o $@ + +# Include all dependency files to add depedency to all header files in use. +include $(dep-files) + +ifeq ($(target_type),lib) +# Archive object files into an archive +$(target): $(PRJ_PATH)/sam/utils/make/Makefile.in config.mk $(obj-y) + @echo $(MSG_ARCHIVING) + $(Q)$(AR) $(ar_flags) $@ $(obj-y) + @echo $(MSG_SIZE) + $(Q)$(SIZE) -Bxt $@ +else +ifeq ($(target_type),elf) +# Link the object files into an ELF file. Also make sure the target is rebuilt +# if the common Makefile.in or project config.mk is changed. +$(target): $(linker_script) $(PRJ_PATH)/sam/utils/make/Makefile.in config.mk $(obj-y) + @echo $(MSG_LINKING) + @echo $(Q)$(LD) $(l_flags) $(obj-y) $(libflags-gnu-y) -o $@ + $(Q)$(LD) $(l_flags) $(obj-y) $(libflags-gnu-y) -o $@ + @echo $(MSG_SIZE) + $(Q)$(SIZE) -Ax $@ + $(Q)$(SIZE) -Bx $@ +endif +endif + +# Create extended function listing from target output file. +%.lss: $(target) + @echo $(MSG_EXTENDED_LISTING) + $(Q)$(OBJDUMP) -h -S $< > $@ + +# Create symbol table from target output file. +%.sym: $(target) + @echo $(MSG_SYMBOL_TABLE) + $(Q)$(NM) -n $< > $@ + +# Create Intel HEX image from ELF output file. +%.hex: $(target) + @echo $(MSG_IHEX_IMAGE) + $(Q)$(OBJCOPY) -O ihex $(flashflags-gnu-y) $< $@ + +# Create binary image from ELF output file. +%.bin: $(target) + @echo $(MSG_BINARY_IMAGE) + $(Q)$(OBJCOPY) -O binary $< $@ + +# Provide information about the detected host operating system. +.SECONDARY: info-os +info-os: + @echo $(MSG_INFO)$(os) build host detected + +# Build Doxygen generated documentation. +.PHONY: doc +doc: + @echo $(MSG_GENERATING_DOC) + $(Q)cd $(dir $(doccfg)) && $(DOCGEN) $(notdir $(doccfg)) + +# Clean Doxygen generated documentation. +.PHONY: cleandoc +cleandoc: + @$(if $(wildcard $(docdir)),echo $(MSG_CLEAN_DOC)) + $(Q)$(if $(wildcard $(docdir)),$(RM) --recursive $(docdir)) + +# Rebuild the Doxygen generated documentation. +.PHONY: rebuilddoc +rebuilddoc: cleandoc doc diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/preprocessor/mrepeat.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/preprocessor/mrepeat.h new file mode 100644 index 000000000..954dd5f02 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/preprocessor/mrepeat.h @@ -0,0 +1,336 @@ +/** + * \file + * + * \brief Preprocessor macro repeating utils. + * + * Copyright (c) 2010-2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#ifndef _MREPEAT_H_ +#define _MREPEAT_H_ + +/** + * \defgroup group_sam_utils_mrepeat Preprocessor - Macro Repeat + * + * \ingroup group_sam_utils + * + * \{ + */ + +#include "preprocessor.h" + + +//! Maximal number of repetitions supported by MREPEAT. +#define MREPEAT_LIMIT 256 + +/*! \brief Macro repeat. + * + * This macro represents a horizontal repetition construct. + * + * \param count The number of repetitious calls to macro. Valid values range from 0 to MREPEAT_LIMIT. + * \param macro A binary operation of the form macro(n, data). This macro is expanded by MREPEAT with + * the current repetition number and the auxiliary data argument. + * \param data Auxiliary data passed to macro. + * + * \return macro(0, data) macro(1, data) ... macro(count - 1, data) + */ +#define MREPEAT(count, macro, data) TPASTE2(MREPEAT, count)(macro, data) + +#define MREPEAT0( macro, data) +#define MREPEAT1( macro, data) MREPEAT0( macro, data) macro( 0, data) +#define MREPEAT2( macro, data) MREPEAT1( macro, data) macro( 1, data) +#define MREPEAT3( macro, data) MREPEAT2( macro, data) macro( 2, data) +#define MREPEAT4( macro, data) MREPEAT3( macro, data) macro( 3, data) +#define MREPEAT5( macro, data) MREPEAT4( macro, data) macro( 4, data) +#define MREPEAT6( macro, data) MREPEAT5( macro, data) macro( 5, data) +#define MREPEAT7( macro, data) MREPEAT6( macro, data) macro( 6, data) +#define MREPEAT8( macro, data) MREPEAT7( macro, data) macro( 7, data) +#define MREPEAT9( macro, data) MREPEAT8( macro, data) macro( 8, data) +#define MREPEAT10( macro, data) MREPEAT9( macro, data) macro( 9, data) +#define MREPEAT11( macro, data) MREPEAT10( macro, data) macro( 10, data) +#define MREPEAT12( macro, data) MREPEAT11( macro, data) macro( 11, data) +#define MREPEAT13( macro, data) MREPEAT12( macro, data) macro( 12, data) +#define MREPEAT14( macro, data) MREPEAT13( macro, data) macro( 13, data) +#define MREPEAT15( macro, data) MREPEAT14( macro, data) macro( 14, data) +#define MREPEAT16( macro, data) MREPEAT15( macro, data) macro( 15, data) +#define MREPEAT17( macro, data) MREPEAT16( macro, data) macro( 16, data) +#define MREPEAT18( macro, data) MREPEAT17( macro, data) macro( 17, data) +#define MREPEAT19( macro, data) MREPEAT18( macro, data) macro( 18, data) +#define MREPEAT20( macro, data) MREPEAT19( macro, data) macro( 19, data) +#define MREPEAT21( macro, data) MREPEAT20( macro, data) macro( 20, data) +#define MREPEAT22( macro, data) MREPEAT21( macro, data) macro( 21, data) +#define MREPEAT23( macro, data) MREPEAT22( macro, data) macro( 22, data) +#define MREPEAT24( macro, data) MREPEAT23( macro, data) macro( 23, data) +#define MREPEAT25( macro, data) MREPEAT24( macro, data) macro( 24, data) +#define MREPEAT26( macro, data) MREPEAT25( macro, data) macro( 25, data) +#define MREPEAT27( macro, data) MREPEAT26( macro, data) macro( 26, data) +#define MREPEAT28( macro, data) MREPEAT27( macro, data) macro( 27, data) +#define MREPEAT29( macro, data) MREPEAT28( macro, data) macro( 28, data) +#define MREPEAT30( macro, data) MREPEAT29( macro, data) macro( 29, data) +#define MREPEAT31( macro, data) MREPEAT30( macro, data) macro( 30, data) +#define MREPEAT32( macro, data) MREPEAT31( macro, data) macro( 31, data) +#define MREPEAT33( macro, data) MREPEAT32( macro, data) macro( 32, data) +#define MREPEAT34( macro, data) MREPEAT33( macro, data) macro( 33, data) +#define MREPEAT35( macro, data) MREPEAT34( macro, data) macro( 34, data) +#define MREPEAT36( macro, data) MREPEAT35( macro, data) macro( 35, data) +#define MREPEAT37( macro, data) MREPEAT36( macro, data) macro( 36, data) +#define MREPEAT38( macro, data) MREPEAT37( macro, data) macro( 37, data) +#define MREPEAT39( macro, data) MREPEAT38( macro, data) macro( 38, data) +#define MREPEAT40( macro, data) MREPEAT39( macro, data) macro( 39, data) +#define MREPEAT41( macro, data) MREPEAT40( macro, data) macro( 40, data) +#define MREPEAT42( macro, data) MREPEAT41( macro, data) macro( 41, data) +#define MREPEAT43( macro, data) MREPEAT42( macro, data) macro( 42, data) +#define MREPEAT44( macro, data) MREPEAT43( macro, data) macro( 43, data) +#define MREPEAT45( macro, data) MREPEAT44( macro, data) macro( 44, data) +#define MREPEAT46( macro, data) MREPEAT45( macro, data) macro( 45, data) +#define MREPEAT47( macro, data) MREPEAT46( macro, data) macro( 46, data) +#define MREPEAT48( macro, data) MREPEAT47( macro, data) macro( 47, data) +#define MREPEAT49( macro, data) MREPEAT48( macro, data) macro( 48, data) +#define MREPEAT50( macro, data) MREPEAT49( macro, data) macro( 49, data) +#define MREPEAT51( macro, data) MREPEAT50( macro, data) macro( 50, data) +#define MREPEAT52( macro, data) MREPEAT51( macro, data) macro( 51, data) +#define MREPEAT53( macro, data) MREPEAT52( macro, data) macro( 52, data) +#define MREPEAT54( macro, data) MREPEAT53( macro, data) macro( 53, data) +#define MREPEAT55( macro, data) MREPEAT54( macro, data) macro( 54, data) +#define MREPEAT56( macro, data) MREPEAT55( macro, data) macro( 55, data) +#define MREPEAT57( macro, data) MREPEAT56( macro, data) macro( 56, data) +#define MREPEAT58( macro, data) MREPEAT57( macro, data) macro( 57, data) +#define MREPEAT59( macro, data) MREPEAT58( macro, data) macro( 58, data) +#define MREPEAT60( macro, data) MREPEAT59( macro, data) macro( 59, data) +#define MREPEAT61( macro, data) MREPEAT60( macro, data) macro( 60, data) +#define MREPEAT62( macro, data) MREPEAT61( macro, data) macro( 61, data) +#define MREPEAT63( macro, data) MREPEAT62( macro, data) macro( 62, data) +#define MREPEAT64( macro, data) MREPEAT63( macro, data) macro( 63, data) +#define MREPEAT65( macro, data) MREPEAT64( macro, data) macro( 64, data) +#define MREPEAT66( macro, data) MREPEAT65( macro, data) macro( 65, data) +#define MREPEAT67( macro, data) MREPEAT66( macro, data) macro( 66, data) +#define MREPEAT68( macro, data) MREPEAT67( macro, data) macro( 67, data) +#define MREPEAT69( macro, data) MREPEAT68( macro, data) macro( 68, data) +#define MREPEAT70( macro, data) MREPEAT69( macro, data) macro( 69, data) +#define MREPEAT71( macro, data) MREPEAT70( macro, data) macro( 70, data) +#define MREPEAT72( macro, data) MREPEAT71( macro, data) macro( 71, data) +#define MREPEAT73( macro, data) MREPEAT72( macro, data) macro( 72, data) +#define MREPEAT74( macro, data) MREPEAT73( macro, data) macro( 73, data) +#define MREPEAT75( macro, data) MREPEAT74( macro, data) macro( 74, data) +#define MREPEAT76( macro, data) MREPEAT75( macro, data) macro( 75, data) +#define MREPEAT77( macro, data) MREPEAT76( macro, data) macro( 76, data) +#define MREPEAT78( macro, data) MREPEAT77( macro, data) macro( 77, data) +#define MREPEAT79( macro, data) MREPEAT78( macro, data) macro( 78, data) +#define MREPEAT80( macro, data) MREPEAT79( macro, data) macro( 79, data) +#define MREPEAT81( macro, data) MREPEAT80( macro, data) macro( 80, data) +#define MREPEAT82( macro, data) MREPEAT81( macro, data) macro( 81, data) +#define MREPEAT83( macro, data) MREPEAT82( macro, data) macro( 82, data) +#define MREPEAT84( macro, data) MREPEAT83( macro, data) macro( 83, data) +#define MREPEAT85( macro, data) MREPEAT84( macro, data) macro( 84, data) +#define MREPEAT86( macro, data) MREPEAT85( macro, data) macro( 85, data) +#define MREPEAT87( macro, data) MREPEAT86( macro, data) macro( 86, data) +#define MREPEAT88( macro, data) MREPEAT87( macro, data) macro( 87, data) +#define MREPEAT89( macro, data) MREPEAT88( macro, data) macro( 88, data) +#define MREPEAT90( macro, data) MREPEAT89( macro, data) macro( 89, data) +#define MREPEAT91( macro, data) MREPEAT90( macro, data) macro( 90, data) +#define MREPEAT92( macro, data) MREPEAT91( macro, data) macro( 91, data) +#define MREPEAT93( macro, data) MREPEAT92( macro, data) macro( 92, data) +#define MREPEAT94( macro, data) MREPEAT93( macro, data) macro( 93, data) +#define MREPEAT95( macro, data) MREPEAT94( macro, data) macro( 94, data) +#define MREPEAT96( macro, data) MREPEAT95( macro, data) macro( 95, data) +#define MREPEAT97( macro, data) MREPEAT96( macro, data) macro( 96, data) +#define MREPEAT98( macro, data) MREPEAT97( macro, data) macro( 97, data) +#define MREPEAT99( macro, data) MREPEAT98( macro, data) macro( 98, data) +#define MREPEAT100(macro, data) MREPEAT99( macro, data) macro( 99, data) +#define MREPEAT101(macro, data) MREPEAT100(macro, data) macro(100, data) +#define MREPEAT102(macro, data) MREPEAT101(macro, data) macro(101, data) +#define MREPEAT103(macro, data) MREPEAT102(macro, data) macro(102, data) +#define MREPEAT104(macro, data) MREPEAT103(macro, data) macro(103, data) +#define MREPEAT105(macro, data) MREPEAT104(macro, data) macro(104, data) +#define MREPEAT106(macro, data) MREPEAT105(macro, data) macro(105, data) +#define MREPEAT107(macro, data) MREPEAT106(macro, data) macro(106, data) +#define MREPEAT108(macro, data) MREPEAT107(macro, data) macro(107, data) +#define MREPEAT109(macro, data) MREPEAT108(macro, data) macro(108, data) +#define MREPEAT110(macro, data) MREPEAT109(macro, data) macro(109, data) +#define MREPEAT111(macro, data) MREPEAT110(macro, data) macro(110, data) +#define MREPEAT112(macro, data) MREPEAT111(macro, data) macro(111, data) +#define MREPEAT113(macro, data) MREPEAT112(macro, data) macro(112, data) +#define MREPEAT114(macro, data) MREPEAT113(macro, data) macro(113, data) +#define MREPEAT115(macro, data) MREPEAT114(macro, data) macro(114, data) +#define MREPEAT116(macro, data) MREPEAT115(macro, data) macro(115, data) +#define MREPEAT117(macro, data) MREPEAT116(macro, data) macro(116, data) +#define MREPEAT118(macro, data) MREPEAT117(macro, data) macro(117, data) +#define MREPEAT119(macro, data) MREPEAT118(macro, data) macro(118, data) +#define MREPEAT120(macro, data) MREPEAT119(macro, data) macro(119, data) +#define MREPEAT121(macro, data) MREPEAT120(macro, data) macro(120, data) +#define MREPEAT122(macro, data) MREPEAT121(macro, data) macro(121, data) +#define MREPEAT123(macro, data) MREPEAT122(macro, data) macro(122, data) +#define MREPEAT124(macro, data) MREPEAT123(macro, data) macro(123, data) +#define MREPEAT125(macro, data) MREPEAT124(macro, data) macro(124, data) +#define MREPEAT126(macro, data) MREPEAT125(macro, data) macro(125, data) +#define MREPEAT127(macro, data) MREPEAT126(macro, data) macro(126, data) +#define MREPEAT128(macro, data) MREPEAT127(macro, data) macro(127, data) +#define MREPEAT129(macro, data) MREPEAT128(macro, data) macro(128, data) +#define MREPEAT130(macro, data) MREPEAT129(macro, data) macro(129, data) +#define MREPEAT131(macro, data) MREPEAT130(macro, data) macro(130, data) +#define MREPEAT132(macro, data) MREPEAT131(macro, data) macro(131, data) +#define MREPEAT133(macro, data) MREPEAT132(macro, data) macro(132, data) +#define MREPEAT134(macro, data) MREPEAT133(macro, data) macro(133, data) +#define MREPEAT135(macro, data) MREPEAT134(macro, data) macro(134, data) +#define MREPEAT136(macro, data) MREPEAT135(macro, data) macro(135, data) +#define MREPEAT137(macro, data) MREPEAT136(macro, data) macro(136, data) +#define MREPEAT138(macro, data) MREPEAT137(macro, data) macro(137, data) +#define MREPEAT139(macro, data) MREPEAT138(macro, data) macro(138, data) +#define MREPEAT140(macro, data) MREPEAT139(macro, data) macro(139, data) +#define MREPEAT141(macro, data) MREPEAT140(macro, data) macro(140, data) +#define MREPEAT142(macro, data) MREPEAT141(macro, data) macro(141, data) +#define MREPEAT143(macro, data) MREPEAT142(macro, data) macro(142, data) +#define MREPEAT144(macro, data) MREPEAT143(macro, data) macro(143, data) +#define MREPEAT145(macro, data) MREPEAT144(macro, data) macro(144, data) +#define MREPEAT146(macro, data) MREPEAT145(macro, data) macro(145, data) +#define MREPEAT147(macro, data) MREPEAT146(macro, data) macro(146, data) +#define MREPEAT148(macro, data) MREPEAT147(macro, data) macro(147, data) +#define MREPEAT149(macro, data) MREPEAT148(macro, data) macro(148, data) +#define MREPEAT150(macro, data) MREPEAT149(macro, data) macro(149, data) +#define MREPEAT151(macro, data) MREPEAT150(macro, data) macro(150, data) +#define MREPEAT152(macro, data) MREPEAT151(macro, data) macro(151, data) +#define MREPEAT153(macro, data) MREPEAT152(macro, data) macro(152, data) +#define MREPEAT154(macro, data) MREPEAT153(macro, data) macro(153, data) +#define MREPEAT155(macro, data) MREPEAT154(macro, data) macro(154, data) +#define MREPEAT156(macro, data) MREPEAT155(macro, data) macro(155, data) +#define MREPEAT157(macro, data) MREPEAT156(macro, data) macro(156, data) +#define MREPEAT158(macro, data) MREPEAT157(macro, data) macro(157, data) +#define MREPEAT159(macro, data) MREPEAT158(macro, data) macro(158, data) +#define MREPEAT160(macro, data) MREPEAT159(macro, data) macro(159, data) +#define MREPEAT161(macro, data) MREPEAT160(macro, data) macro(160, data) +#define MREPEAT162(macro, data) MREPEAT161(macro, data) macro(161, data) +#define MREPEAT163(macro, data) MREPEAT162(macro, data) macro(162, data) +#define MREPEAT164(macro, data) MREPEAT163(macro, data) macro(163, data) +#define MREPEAT165(macro, data) MREPEAT164(macro, data) macro(164, data) +#define MREPEAT166(macro, data) MREPEAT165(macro, data) macro(165, data) +#define MREPEAT167(macro, data) MREPEAT166(macro, data) macro(166, data) +#define MREPEAT168(macro, data) MREPEAT167(macro, data) macro(167, data) +#define MREPEAT169(macro, data) MREPEAT168(macro, data) macro(168, data) +#define MREPEAT170(macro, data) MREPEAT169(macro, data) macro(169, data) +#define MREPEAT171(macro, data) MREPEAT170(macro, data) macro(170, data) +#define MREPEAT172(macro, data) MREPEAT171(macro, data) macro(171, data) +#define MREPEAT173(macro, data) MREPEAT172(macro, data) macro(172, data) +#define MREPEAT174(macro, data) MREPEAT173(macro, data) macro(173, data) +#define MREPEAT175(macro, data) MREPEAT174(macro, data) macro(174, data) +#define MREPEAT176(macro, data) MREPEAT175(macro, data) macro(175, data) +#define MREPEAT177(macro, data) MREPEAT176(macro, data) macro(176, data) +#define MREPEAT178(macro, data) MREPEAT177(macro, data) macro(177, data) +#define MREPEAT179(macro, data) MREPEAT178(macro, data) macro(178, data) +#define MREPEAT180(macro, data) MREPEAT179(macro, data) macro(179, data) +#define MREPEAT181(macro, data) MREPEAT180(macro, data) macro(180, data) +#define MREPEAT182(macro, data) MREPEAT181(macro, data) macro(181, data) +#define MREPEAT183(macro, data) MREPEAT182(macro, data) macro(182, data) +#define MREPEAT184(macro, data) MREPEAT183(macro, data) macro(183, data) +#define MREPEAT185(macro, data) MREPEAT184(macro, data) macro(184, data) +#define MREPEAT186(macro, data) MREPEAT185(macro, data) macro(185, data) +#define MREPEAT187(macro, data) MREPEAT186(macro, data) macro(186, data) +#define MREPEAT188(macro, data) MREPEAT187(macro, data) macro(187, data) +#define MREPEAT189(macro, data) MREPEAT188(macro, data) macro(188, data) +#define MREPEAT190(macro, data) MREPEAT189(macro, data) macro(189, data) +#define MREPEAT191(macro, data) MREPEAT190(macro, data) macro(190, data) +#define MREPEAT192(macro, data) MREPEAT191(macro, data) macro(191, data) +#define MREPEAT193(macro, data) MREPEAT192(macro, data) macro(192, data) +#define MREPEAT194(macro, data) MREPEAT193(macro, data) macro(193, data) +#define MREPEAT195(macro, data) MREPEAT194(macro, data) macro(194, data) +#define MREPEAT196(macro, data) MREPEAT195(macro, data) macro(195, data) +#define MREPEAT197(macro, data) MREPEAT196(macro, data) macro(196, data) +#define MREPEAT198(macro, data) MREPEAT197(macro, data) macro(197, data) +#define MREPEAT199(macro, data) MREPEAT198(macro, data) macro(198, data) +#define MREPEAT200(macro, data) MREPEAT199(macro, data) macro(199, data) +#define MREPEAT201(macro, data) MREPEAT200(macro, data) macro(200, data) +#define MREPEAT202(macro, data) MREPEAT201(macro, data) macro(201, data) +#define MREPEAT203(macro, data) MREPEAT202(macro, data) macro(202, data) +#define MREPEAT204(macro, data) MREPEAT203(macro, data) macro(203, data) +#define MREPEAT205(macro, data) MREPEAT204(macro, data) macro(204, data) +#define MREPEAT206(macro, data) MREPEAT205(macro, data) macro(205, data) +#define MREPEAT207(macro, data) MREPEAT206(macro, data) macro(206, data) +#define MREPEAT208(macro, data) MREPEAT207(macro, data) macro(207, data) +#define MREPEAT209(macro, data) MREPEAT208(macro, data) macro(208, data) +#define MREPEAT210(macro, data) MREPEAT209(macro, data) macro(209, data) +#define MREPEAT211(macro, data) MREPEAT210(macro, data) macro(210, data) +#define MREPEAT212(macro, data) MREPEAT211(macro, data) macro(211, data) +#define MREPEAT213(macro, data) MREPEAT212(macro, data) macro(212, data) +#define MREPEAT214(macro, data) MREPEAT213(macro, data) macro(213, data) +#define MREPEAT215(macro, data) MREPEAT214(macro, data) macro(214, data) +#define MREPEAT216(macro, data) MREPEAT215(macro, data) macro(215, data) +#define MREPEAT217(macro, data) MREPEAT216(macro, data) macro(216, data) +#define MREPEAT218(macro, data) MREPEAT217(macro, data) macro(217, data) +#define MREPEAT219(macro, data) MREPEAT218(macro, data) macro(218, data) +#define MREPEAT220(macro, data) MREPEAT219(macro, data) macro(219, data) +#define MREPEAT221(macro, data) MREPEAT220(macro, data) macro(220, data) +#define MREPEAT222(macro, data) MREPEAT221(macro, data) macro(221, data) +#define MREPEAT223(macro, data) MREPEAT222(macro, data) macro(222, data) +#define MREPEAT224(macro, data) MREPEAT223(macro, data) macro(223, data) +#define MREPEAT225(macro, data) MREPEAT224(macro, data) macro(224, data) +#define MREPEAT226(macro, data) MREPEAT225(macro, data) macro(225, data) +#define MREPEAT227(macro, data) MREPEAT226(macro, data) macro(226, data) +#define MREPEAT228(macro, data) MREPEAT227(macro, data) macro(227, data) +#define MREPEAT229(macro, data) MREPEAT228(macro, data) macro(228, data) +#define MREPEAT230(macro, data) MREPEAT229(macro, data) macro(229, data) +#define MREPEAT231(macro, data) MREPEAT230(macro, data) macro(230, data) +#define MREPEAT232(macro, data) MREPEAT231(macro, data) macro(231, data) +#define MREPEAT233(macro, data) MREPEAT232(macro, data) macro(232, data) +#define MREPEAT234(macro, data) MREPEAT233(macro, data) macro(233, data) +#define MREPEAT235(macro, data) MREPEAT234(macro, data) macro(234, data) +#define MREPEAT236(macro, data) MREPEAT235(macro, data) macro(235, data) +#define MREPEAT237(macro, data) MREPEAT236(macro, data) macro(236, data) +#define MREPEAT238(macro, data) MREPEAT237(macro, data) macro(237, data) +#define MREPEAT239(macro, data) MREPEAT238(macro, data) macro(238, data) +#define MREPEAT240(macro, data) MREPEAT239(macro, data) macro(239, data) +#define MREPEAT241(macro, data) MREPEAT240(macro, data) macro(240, data) +#define MREPEAT242(macro, data) MREPEAT241(macro, data) macro(241, data) +#define MREPEAT243(macro, data) MREPEAT242(macro, data) macro(242, data) +#define MREPEAT244(macro, data) MREPEAT243(macro, data) macro(243, data) +#define MREPEAT245(macro, data) MREPEAT244(macro, data) macro(244, data) +#define MREPEAT246(macro, data) MREPEAT245(macro, data) macro(245, data) +#define MREPEAT247(macro, data) MREPEAT246(macro, data) macro(246, data) +#define MREPEAT248(macro, data) MREPEAT247(macro, data) macro(247, data) +#define MREPEAT249(macro, data) MREPEAT248(macro, data) macro(248, data) +#define MREPEAT250(macro, data) MREPEAT249(macro, data) macro(249, data) +#define MREPEAT251(macro, data) MREPEAT250(macro, data) macro(250, data) +#define MREPEAT252(macro, data) MREPEAT251(macro, data) macro(251, data) +#define MREPEAT253(macro, data) MREPEAT252(macro, data) macro(252, data) +#define MREPEAT254(macro, data) MREPEAT253(macro, data) macro(253, data) +#define MREPEAT255(macro, data) MREPEAT254(macro, data) macro(254, data) +#define MREPEAT256(macro, data) MREPEAT255(macro, data) macro(255, data) + +/** + * \} + */ + +#endif // _MREPEAT_H_ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/preprocessor/preprocessor.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/preprocessor/preprocessor.h new file mode 100644 index 000000000..fd544e3e6 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/preprocessor/preprocessor.h @@ -0,0 +1,52 @@ +/** + * \file + * + * \brief Preprocessor utils. + * + * Copyright (c) 2010-2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#ifndef _PREPROCESSOR_H_ +#define _PREPROCESSOR_H_ + +#include "tpaste.h" +#include "stringz.h" +#include "mrepeat.h" + + +#endif // _PREPROCESSOR_H_ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/preprocessor/stringz.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/preprocessor/stringz.h new file mode 100644 index 000000000..063b94447 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/preprocessor/stringz.h @@ -0,0 +1,82 @@ +/** + * \file + * + * \brief Preprocessor stringizing utils. + * + * Copyright (c) 2010-2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#ifndef _STRINGZ_H_ +#define _STRINGZ_H_ + +/** + * \defgroup group_sam_utils_stringz Preprocessor - Stringize + * + * \ingroup group_sam_utils + * + * \{ + */ + +/*! \brief Stringize. + * + * Stringize a preprocessing token, this token being allowed to be \#defined. + * + * May be used only within macros with the token passed as an argument if the token is \#defined. + * + * For example, writing STRINGZ(PIN) within a macro \#defined by PIN_NAME(PIN) + * and invoked as PIN_NAME(PIN0) with PIN0 \#defined as A0 is equivalent to + * writing "A0". + */ +#define STRINGZ(x) #x + +/*! \brief Absolute stringize. + * + * Stringize a preprocessing token, this token being allowed to be \#defined. + * + * No restriction of use if the token is \#defined. + * + * For example, writing ASTRINGZ(PIN0) anywhere with PIN0 \#defined as A0 is + * equivalent to writing "A0". + */ +#define ASTRINGZ(x) STRINGZ(x) + +/** + * \} + */ + +#endif // _STRINGZ_H_ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/preprocessor/tpaste.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/preprocessor/tpaste.h new file mode 100644 index 000000000..8894ba659 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/preprocessor/tpaste.h @@ -0,0 +1,102 @@ +/** + * \file + * + * \brief Preprocessor token pasting utils. + * + * Copyright (c) 2010-2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#ifndef _TPASTE_H_ +#define _TPASTE_H_ + +/** + * \defgroup group_sam_utils_tpaste Preprocessor - Token Paste + * + * \ingroup group_sam_utils + * + * \{ + */ + +/*! \name Token Paste + * + * Paste N preprocessing tokens together, these tokens being allowed to be \#defined. + * + * May be used only within macros with the tokens passed as arguments if the tokens are \#defined. + * + * For example, writing TPASTE2(U, WIDTH) within a macro \#defined by + * UTYPE(WIDTH) and invoked as UTYPE(UL_WIDTH) with UL_WIDTH \#defined as 32 is + * equivalent to writing U32. + */ +//! @{ +#define TPASTE2( a, b) a##b +#define TPASTE3( a, b, c) a##b##c +#define TPASTE4( a, b, c, d) a##b##c##d +#define TPASTE5( a, b, c, d, e) a##b##c##d##e +#define TPASTE6( a, b, c, d, e, f) a##b##c##d##e##f +#define TPASTE7( a, b, c, d, e, f, g) a##b##c##d##e##f##g +#define TPASTE8( a, b, c, d, e, f, g, h) a##b##c##d##e##f##g##h +#define TPASTE9( a, b, c, d, e, f, g, h, i) a##b##c##d##e##f##g##h##i +#define TPASTE10(a, b, c, d, e, f, g, h, i, j) a##b##c##d##e##f##g##h##i##j +//! @} + +/*! \name Absolute Token Paste + * + * Paste N preprocessing tokens together, these tokens being allowed to be \#defined. + * + * No restriction of use if the tokens are \#defined. + * + * For example, writing ATPASTE2(U, UL_WIDTH) anywhere with UL_WIDTH \#defined + * as 32 is equivalent to writing U32. + */ +//! @{ +#define ATPASTE2( a, b) TPASTE2( a, b) +#define ATPASTE3( a, b, c) TPASTE3( a, b, c) +#define ATPASTE4( a, b, c, d) TPASTE4( a, b, c, d) +#define ATPASTE5( a, b, c, d, e) TPASTE5( a, b, c, d, e) +#define ATPASTE6( a, b, c, d, e, f) TPASTE6( a, b, c, d, e, f) +#define ATPASTE7( a, b, c, d, e, f, g) TPASTE7( a, b, c, d, e, f, g) +#define ATPASTE8( a, b, c, d, e, f, g, h) TPASTE8( a, b, c, d, e, f, g, h) +#define ATPASTE9( a, b, c, d, e, f, g, h, i) TPASTE9( a, b, c, d, e, f, g, h, i) +#define ATPASTE10(a, b, c, d, e, f, g, h, i, j) TPASTE10(a, b, c, d, e, f, g, h, i, j) +//! @} + +/** + * \} + */ + +#endif // _TPASTE_H_ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/status_codes.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/status_codes.h new file mode 100644 index 000000000..3b99dfcad --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/status_codes.h @@ -0,0 +1,110 @@ +/** + * \file + * + * \brief Status code definitions. + * + * This file defines various status codes returned by functions, + * indicating success or failure as well as what kind of failure. + * + * Copyright (c) 2011-2013 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#ifndef STATUS_CODES_H_INCLUDED +#define STATUS_CODES_H_INCLUDED + +/* Note: this is a local workaround to avoid a pre-processor clash due to the + * lwIP macro ERR_TIMEOUT. */ +#if defined(__LWIP_ERR_H__) && defined(ERR_TIMEOUT) +#if (ERR_TIMEOUT != -3) + +/* Internal check to make sure that the later restore of lwIP's ERR_TIMEOUT + * macro is set to the correct value. Note that it is highly improbable that + * this value ever changes in lwIP. */ +#error ASF developers: check lwip err.h new value for ERR_TIMEOUT +#endif +#undef ERR_TIMEOUT +#endif + +/** + * Status code that may be returned by shell commands and protocol + * implementations. + * + * \note Any change to these status codes and the corresponding + * message strings is strictly forbidden. New codes can be added, + * however, but make sure that any message string tables are updated + * at the same time. + */ +enum status_code { + STATUS_OK = 0, //!< Success + STATUS_ERR_BUSY = 0x19, + STATUS_ERR_DENIED = 0x1C, + STATUS_ERR_TIMEOUT = 0x12, + ERR_IO_ERROR = -1, //!< I/O error + ERR_FLUSHED = -2, //!< Request flushed from queue + ERR_TIMEOUT = -3, //!< Operation timed out + ERR_BAD_DATA = -4, //!< Data integrity check failed + ERR_PROTOCOL = -5, //!< Protocol error + ERR_UNSUPPORTED_DEV = -6, //!< Unsupported device + ERR_NO_MEMORY = -7, //!< Insufficient memory + ERR_INVALID_ARG = -8, //!< Invalid argument + ERR_BAD_ADDRESS = -9, //!< Bad address + ERR_BUSY = -10, //!< Resource is busy + ERR_BAD_FORMAT = -11, //!< Data format not recognized + ERR_NO_TIMER = -12, //!< No timer available + ERR_TIMER_ALREADY_RUNNING = -13, //!< Timer already running + ERR_TIMER_NOT_RUNNING = -14, //!< Timer not running + + /** + * \brief Operation in progress + * + * This status code is for driver-internal use when an operation + * is currently being performed. + * + * \note Drivers should never return this status code to any + * callers. It is strictly for internal use. + */ + OPERATION_IN_PROGRESS = -128, +}; + +typedef enum status_code status_code_t; + +#if defined(__LWIP_ERR_H__) +#define ERR_TIMEOUT -3 +#endif + +#endif /* STATUS_CODES_H_INCLUDED */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/syscalls/gcc/syscalls.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/syscalls/gcc/syscalls.c new file mode 100644 index 000000000..60920141f --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/utils/syscalls/gcc/syscalls.c @@ -0,0 +1,136 @@ +/** + * \file + * + * \brief Syscalls for SAM (GCC). + * + * Copyright (c) 2011-2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#include +#include +#include +#include + +/// @cond 0 +/**INDENT-OFF**/ +#ifdef __cplusplus +extern "C" { +#endif +/**INDENT-ON**/ +/// @endcond + +#undef errno +extern int errno; +extern int _end; + +extern caddr_t _sbrk(int incr); +extern int link(char *old, char *new); +extern int _close(int file); +extern int _fstat(int file, struct stat *st); +extern int _isatty(int file); +extern int _lseek(int file, int ptr, int dir); +extern void _exit(int status); +extern void _kill(int pid, int sig); +extern int _getpid(void); + +extern caddr_t _sbrk(int incr) +{ + static unsigned char *heap = NULL; + unsigned char *prev_heap; + + if (heap == NULL) { + heap = (unsigned char *)&_end; + } + prev_heap = heap; + + heap += incr; + + return (caddr_t) prev_heap; +} + +extern int link(char *old, char *new) +{ + return -1; +} + +extern int _close(int file) +{ + return -1; +} + +extern int _fstat(int file, struct stat *st) +{ + st->st_mode = S_IFCHR; + + return 0; +} + +extern int _isatty(int file) +{ + return 1; +} + +extern int _lseek(int file, int ptr, int dir) +{ + return 0; +} + +extern void _exit(int status) +{ + printf("Exiting with status %d.\n", status); + + for (;;); +} + +extern void _kill(int pid, int sig) +{ + return; +} + +extern int _getpid(void) +{ + return -1; +} + +/// @cond 0 +/**INDENT-OFF**/ +#ifdef __cplusplus +} +#endif +/**INDENT-ON**/ +/// @endcond diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/CMSIS END USER LICENCE AGREEMENT.pdf b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/CMSIS END USER LICENCE AGREEMENT.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c8feab483c7aee07b235b93666803151e052e8c7 GIT binary patch literal 46999 zcmaHyV{j%w@aALNwv&x*+jcg1W81cECmY+gZQI${PHz9WySlron@>|c-8J1`W}fQ# z4Y{JI_%9}UHhA)q^VuPI7-k|yB0D2XcwSxxRS$argNUKCp|zbEgQB4sz=??E->UL| z&gJY(01RqQ00kFkYYSU|6N4PU+0f*lGZ8b>e>y4H18jwioh|HaiI~~`SD37!hn^1&+p{y2r#sPhjGtd=G#ovZH>99SrCvt29#Ry2wZ#L zzt2!Qxv@`u81h?nHn!}>Ev`>D^5lI!(S1I?74b}Cf4V&!%uxDy&*e5>^_gHE$tm+n7i z*ax$&dvtm|zE~$V2MJlQU4_X78J~&i-Oz(foX$?FJx$l$n5Z2>&LK)DR{o7ri!q!_ z(O8!II001`Gfvidy1m#I>)ZQ`TR#}U+84k=gAV8KOY(Ug-DYsZlzHX$Z(&^ex|P`sA@12}wt7X) z|BZd|Rs=NP4}|E7d3(CKjpQ4O4f#4+gpc(2sle(vzV(2YI&nde>chi@F{5aC^#Y}o zA>dnh4(y@1yzB1K1Vc1L73GKZ69>As-%~$$4jEDW2q^_WtLqyDM%KW)@#N(GUK;@L zk8~pxFNAHkkm!j3Wm$NIgSUSn5W+KKC!=7|S<5yoW7ZM4&a!`nAZm?Uf6plM!FGVt zWEutDaU(=g0E4(ZA@_cG?b^Cy&mLsNoZk86zkRn3ZaMRu<$BMo%=lR?i-oY;_wbb4 z4h2-o?bk(nB+U~7fC1N7&4(i)`@H@}XulC$qSJp(apwm&zt*+P5 zjJ@JFrygB5q7q6*K%Ald+=Aa%=${>JXSqG(<`yNE%;M)={aA0r{|zy;0Yy-_MLri@ zj0r7Wyl)VmQCJ4HztAa4j^LVh_CPL``+5lMur6oCi{l5heU@>Cm~Te0HyCAWfkLWF z19wYE7t*s8(}!&UEQpA>hpE5Ce@aQPZyKg|z0%fgqW~mWeEtdf3Bq;AaK5xl2?s!x zjNmot>qHPYgy0;Zk`qK;W9Pj-LS@8*II%^+qw?%sV&+pc)Pz0%3^^&gfyU_-_3`2e zR5;B8c`Z|0s1v7fn$omAs+);m3a=49Zj))k?xSEF14|S-x?6)oZwSK2n7JbpwFU_! zpkYoXITAr0!yMeg91$;Z&>Hm#P*pk=YJw6Hy*5~G7@C86S4&`PWDSqE2I)VQ*L(s- zGLfrjvCUmdM>#LfXsBj7Mk6yBD&WX@Nc9E4X{Ih1vC$F#C0R!(B6PD^s$L znI(S83J#7~)@(>hIZMGL3D1^&de1XNEdA&zfAoRpLRvmXh@~R1pYpD7P%L~;40R5^ zx;#y9NQGpnwfQ{6IP<$o%oP?PGRzvJkfJPJW;{Z)I?CMe)BaNtL|9^Zs3}+k&AJ%^ z0i1 z6DQ|N5UqSHD}SBm(1QFNp0z!?_vH+4iEaqXGrl=&-TQmj5>uY?3-}rZ6%U=REIpib zjm_ckH*KNc=V~Okt|A06|Ki_6i~wmWJ_IyNv3(Q$gYHO-pWK8=u3Y&Y8s06TwjsA? z_305IqvO~qMu`vw&>+S~xG6!4W|P41`#*AiTP|PQCRlg^)DS9Vm;ItQ3vaJD z*0-543MUBntanOt#@)Wqht!~#I^W)X@a-2#$Z9s(dd)HF`^oN|ziRsZOaVQ7%!aX9zV;4qyy&drw3OGL` zn1_!1B^lVG2M}W0`yy9daaUJz=fQzdYs`|LBgF;qgrZ-9w?ibetJpK;rD0F}`p$IoyZ`d2u zi^io8^WOriYL^{HoN>=TXs*tmgc`5o;2$1QL}%80ydXIt@qNR`SK`iqd_le(EQlFF zKUiw!_n=jTDK(xb$vObXuuD+*3lpCyS()X#uFfF}75PZG#O+ge(m~90+K{J5lh%*s zD&UP9$2m3t7~|**|Ef4e~w%0gHI_l-_EOn1IViTim(g>vS1fH{S%T%p(1mBO*Z&JJhYzz@Nih482%>_>p zDy@^`g`L`7mC?r<$~*=)6-(as>-0FmTw`!(PD8=lU(4u4m5Zg|j$^bh9m zM;ub4^aF54M=gH?=_?{z;R1(#ZY=KZ^2fKjH2e8c|5y~D!^Ctf2<%bkU(*9|34E?< zTZlf%XOesQf<7Se`K&SU`=PsM@Q?HIL{+KFrA*ipzsb{-C0hpUb5i=+Xt|Ti(sGs$ zKj8`l;s69CxcxqN?e2GAO?xd_ed|IZ*Nc((AQm{x9;=?wNFei#GLOC4M6c2ofrj=t z++crBkwn7u$}aPVl5h8AkGN>0%TR!mzInT#{q(j;{h$xrP%_AJnW#V)S||)_mr54mt$E$_Vq}>+ga7t+iitgg zeSZZL_(tKg76u-rgwwy36dl8yxKlk!tjB{kh z%^l^`7|Au>u?Q^QX)Y++{tj*&Lk5V{{k; z5Q)bl>%w=Oct$n!thtc0+PNy#4yG|_g)?|Lx&TYT`kkcGuZW8r`z?)DDF6lQ#nuaN(}He;SIekP0+nmzrlPOw@f5vOd6 z@$>e5`@)>JKK>(5D5GJrI1GN;G2rcmJB#|gEB~!r2{ft2JhnTxQG)*&+1rw=go`w+ zqAMqc1fn32*xOBeK@waGkHt8X0sBFjp>%#|1AoHUrG=vcj;jfXWPp4;apn(*H( zj~Kah=)t8|w-6X2%@P=PEYn3s#dg>`GjqAg2vfAh)`(~ps!X+;S#(c^X@3~}0g0Q2 z1^+T@dmVR2hI+&^tvbLMhYZ#@IC7SRR)~@(N>U(nH?l_-<{_=TKtoK*;n*KMNSPB& zTQ4yd8I#q~g|*`DUb^g4$`@-x@_}o-z<*3mAE9SroILLd4t*v)(>*T$)A}oOeN4Gb zt1x3s9GD3qzh7`R2*)!vnz}gLb4htS-74_+0sJRjarF+SAT|t&^CNaQT(Tq%5>=$h zo(2IY6v}CRte|J@mZM3;K13#x;$!ZI#gp;-!r5hS&s?D<@hYc zn*!xxR*ySpJ~lJv*1_pifyIM;%4wTb(|D_DQhiedJjXwLc^1=cjPo}bU!~rem7`b_ zyeEx4R-ZHKz0w5JR;1KZQu(N!l?pp@f)#PDlbgldn-tRA1Nedlcbt!;v}?Depc!xS z3PcL%oscX~?L6TqZ#hDoM2j3UfI<%KOUOJjh&0%fzjMOjfh4Fo<|t$qo1z7ss3OJ)4)?#G7D^ImAw0e`zZy@QrHYWpqizGjR$1{=dw z)b@)k3Su=9mGD6GAHuRJ<+-7dx$KGsW3cj-_N>|E9>JE;grOGN*Xuu^Be|{5ms1P0M8sy@zT$~( z6F|E6=Ni0v&b$`fF$>xr2_LbkrYNz;ZYTtF2InlIroG@)Cl;XvB% zYUg%|wbKm>EVlqpKSj3dLYz?b<>vfM$f48`sNS}eiUkK=rZtf`N!)JF%`6-1VDmu1gp9cniY>z@l9OQCu+6rdcQ zeO0l2!4B4pjJ!pQWc6AakD6QI#%*%TVEIgAnhrdxdk79;(1T(pnOJa=q_1KNRcm=T zg}|u@54PqlbG4r5<8<3-|EQ@i4jPZOzoiIENu5WL1=e^k^)C-WalN4iD=Sh)LCn#ZJbqv<&8o(|H}svx!XxC4!L=8NkVmx1m114F z>5mIyR`MM>d`sd&X;u;2?Kb{w`k+&xfW>DG=R}s4-+1a{Ha=3f6`Hc~pGW^E&a_Sg z>z=Rhu>^L+vNiC>J<8h~Q@s)SI94DyPtXDo*a8QBt<;Mo#>a_vjwgGBC`c3abfJYS z85MFS9CpKqt{#x1oTODsfxA|JQIq7#*5c)9aZ$3ze@~6A%I=>S+F8}iJxfmMQ|Gku zo~F!eo2D={%ps0D2CMY^Hep|P;B`Fz-Yc*TBno)N`?L>^A!zt~Be_z>Tlg#FbPtGn z<;7HYzq-B_Y?_l^u;!@bB`C2QC3@#ENQV~uts47!R8=5CIfc`SI*~2>`<4;0sa)cbVtPzbvoa#)T zQ-R^7*W6}^)>He`oo*b4FKTS*lXeL5N0AtiILe%i|J46topRrgPC-%CIlP=E?vJ)` zx3XVID41hQR;cmUWdny`s{ryp-r+cWLvSnrCh};;7&g5wYD| z7u7=usr?QZ3@R}}B}g5i22^`Ys1UDpr!p%I!L$+hpBwLk_eq^A@XHVIZMw zSLZ*6Ea90iD4GUh6MmEU&VQzLYV9w*tKq;T4WZSVlN^Ow-Le+$EGF2^1=1=hev8y^ zV-db1e65-q7foeEYxE`2e3zfLEp>q$mlCvJ$6=_s{;_WIbQcwaTT;_V#SaRewzH7l z=a6t14aUz_V*@Gih_z@(hUJSl=uQx3WB&lPI3EG4En#RR?!xa_k55*U0{TNrdbTy5 zVGH!fClS+8b(g;03V3>ffggWN(6W$sUjb63;bVM5=)%ZYQP>zOdzl&T&uw2$4|sKv zE^yXLWfwv9&}~aO30TLNbNJ?^wb{7fvA!yO$>ttwiQXAS-Z`bBUam(lJ)!~Fq>GaU zFkAh5w%cyT&5$7T)tlIGdQ1d@Y}5Msb6CMrWHDAmY(z}?gdWz_3vS~)yG&c6X;KYk zCAzF|rhiI_{b`Kc%gA=X}TYJ%_9H>st-?X0a^D`#xWzRyjWHHhA(-AJ-y%Sm3yhNPEj5Z>_$!C+u8gBjA_4qMarE=mdn`^^8eJTe)q~C48d-O=#(d zO6Rk5sSNxc>2Ne05oBnI($yis$Vh5QfoH{__mmyAu)IYMreg7M&doKbcwtfNJLz1$ zTwiUgivtW`Wfku!x@VM0>d;~+88e?6Am~(da7eXFq11bab1wso41a2v&)8*}6Rc!% zaJ^>jkeN(rcWNWDkMu)PkHuw6^hj{VV}&T9B}5T5U2v}EA*jICV+>A>2fIk3;0$wZ zbFza9MK*S_36)6@j7$3K-#r_I$$8Q+B)v=u})W%8(@fjN-@pwE;k2U8_O~Q}nGXITHrL4jRu%Tuvt=RJ>lQFs1M9 zu#0u2g1LXdsd5xZiTxXX?6uicecbHyatMuhzmr}nOEk^;#tvZFT?;#;h#98Q5{+-I znSgxOQ&mD^Z8_IRX|1iN5C{A&%@WN>2^H@JJw93sSnAgXC2;pVT6}W7E8_%&X{yH) zz!5h2AcZ-VbEQ&w1hqmr^qA<`-ZfBaWyU62;oE0R4bF za*A)2`D(F&&2a!l3Wc4MiIec?mn8^<3MX}@Ya>}3_RB{Kvf+Jkuj_E8LrIw?>QSTK zW&7J^ltx`vnYLDCN2TObWP_7FW3<#Fk9PIk<_0>MjCyC{`}Wf4+Ka_DWiWG`ne;=( zqSo89Cy9(bL)BA(+82BS2(nH856COWySMtReAINcJQd%W&hq+S$@XzHujlkhO0(v1 zG^bjd=5f979T0M=U%72lgKaOeHfrmce zHIzJ}qxYI-J7DoEQ8JtxDXA5+G0>9*RLKfshi5g_R?ILnZ`iEDsj=OVN(>&`YwztA zjsG4Vbc)6jRq(9*WHkiN?&+^R6ZNH?^6`&8tCwGb_0CSpGyeJ&#$Q-HJ(7m*a&VpFTf;(h}q~|zZEU4Z)Z6=sQp?>21#sRYLj)^WdXSWtQ2BO9)#j2 z@;9r}ELDGsKqiG}$*>t9ApU15O5P~*3@2%zYXExydsU09i>=FQI-}p|(;L6uF9tsl!&8kaOA*wq?&1MIAQ4%RC;>=u=@C1~kcCCBn zW-`6<)v3jeCS8)ILI;%bU!A!Q^YR|9%CrzL$97RDk@Mjtk;0Vc@h|-oTyc%lBdCH? z=Jqq^>Ra(gRPC5z?Yj^LO^KbQeBZ<>OdnjCjkcf$0^2B3HvA+evK{G4<6C$e$u zuPIkzEAPBpq7Odqpdm09sBX(f)(netZU#oqG<0;6y!IPRI*<-fp=_fTD?%~=qv$~nwE)Imx_2<@WXzhW3FGYVKUhsD)) zG|^#s&1-rbdQyY)A9Zn8mz!}y2Q4`6a)ui|dz|R=@>!)vc)K=iSk)?NG8|&fnyS)$>sYnV&PW@8%KxnB>((RO@}Sncse7>e zQ-Ga1<+Mrq&#*ZA?Nbh++AiPLY$z)A^ZlZKpp7Zn<3eH?Ejtip2WqU+ni7H-1cd#; ziXszWd_T!ZMI;>Z*omo{HILol#2yL^CJBfg=Y2dqWsh?V>z^3y(jR<|K>nyZNQ*Ws zz#w-J-a9x=I74VR%P#KkUV=mGXGC49jq8MOho!3q%?@CcxyT4q*d_bYUN2-Pax>aP&7m-O$0mD|sV({H>!N-Ld>DT3>FlK&sJG zm@y|a*vMBPKtyd2l!D=1vgl?-++SidOQRh$a7@F~*@?o+B14ev`Z98|$tTYW;t5Lz zCA(PmiOn9DreuPGq=@pP{(LhQ1J9a5Xi_@c~|AbHDpadJ(0P6 zYcw?oa4#B>#6c%ROWdFSBiq(8qpTRZ@JaxWEM#tn-T?Npf$2j=#h21LYu_pV5kd)< zxut;@E$G=ZXjnQSCTEQ`!Ri8m15GuJYf6R7_F^ft!;wW4uRjOb?4JKT$@>wZmo@#V zHO=+lRv-_#jTbU_VCPx^>*I=%{2kR%ad5LPE4L`wJjEt4&NAdIbD@HD%9KK`7UVuVM?mMnZvY&u1fZxn!;r0~e8dhNs8;Mg>61aO{6Tc=e z*I~~kDNFG)ht__}MXU-mkr3jT($b{l!pGDA{wtT(%i(177k*; zjAeD3jR~0o8;{)QeveFWh@)9(Xj5G>84}j)tZBDvC$O9m!})E_-1p{c*3_oi~#ZgR)KqG z;Bb0R0;j=dNuK1$Ue-!A!CAdD4HnFcF$Kc?q|s4i!U$n;-}lyS#oo-b)N~4wF(LZs zo5Hw$=|^kjLa0MeTVwY^Dc7G&3pAkmKM{ZL`6{i zgOw(S84g|8WRe&r=cGrGBN(p)tVygd6NZ%>c?UNf{+h_3f*=5#e~7}%ZES(RUu}u8%G6O8yj^pyIAOsB48^o{7>p9qYFdwR4+Bq zf?LUlLPe(0;QiGCropws-}rP@e{o6rCWY~WbS_y+v84C4thUrTYq5-IrE=%iMO5>b zf}3S#w1-d8bdK(WD_ake`j?_LIyfJUyG?u%-SCk@?0&DnjC@C8r%{sRsuQ28U*4WlBVhrpv%ToZ-h&9yA5`upsnp@rmzGr1nUajbJa zh!@E2qCN)_F~aL{>(|<3@5L6ND$26v=Khqk8WI=oxI1I03oq5jb+sG$=jM=hl!Mg3 z_*YJ8rU9OM^dzD8unL@tSEoOVlvj~4Wg(M%DeL8u`KQ&A;o@L)@WtLk9#+}2Eeic2 z-m=_97(twN$0e8>I&5#%0H6$IirP;3Jm?AKQaszt@ma=*h)qdMjCYeHw!10H^R%4b z>rDoxbt8&+fzlOovm_R8CI~)>LH@E~UUshqS}H-OQb}9!o!upiVSe$F9{EL|K!tvn>KMMmD3yX$6iYIrHrHE8*)s zb-a-KM$4@zF~E>Kfax*#Qfs!@z;!9P`}W*PqT?=QeMokdbTw+(H>-4MMKE%pZZ4HB zrqRKE3Tz42v5h0gWV*tbMxb!xm#UWqkc?Y~G=lHs6wik`5;5BMu#Y%7O_e)GdR2{9 zYM|4xwsSS!(K~*G@bM229Id=AJj_3C=f63e|0a0;gV*^Fl81&3h1q5Xfpq;gpAkG90mQ|Hv-33pFmS#1Sz1F$Zg`=+Rupg3tq~Z97}@8>#V%d#J{JySHI7a{kz~v@wdm5=KL! zE%Z4*a1xw8TVsV8cjj(eWf|`hBQU@<1Q47U@;+Z^@$`jOF;>G8@D7L~s^1s)hZc;F-hP2$2+KYwK1TlB*MlmRQ$8Yy7{{pwq9M<3KEFOS zCjD8g?Na9rJ3o3R?97qh3$DiT93Saa$^A!v<5(j;% zAtel8(Rb%Me7WaTIYqympG5a`ay;|C-u%G?=hu8VFS=iv`_HjY_7z{E&IK3T|xkgvG27>W;eHy;JrZC zEIz?dmZ0|mKdA2v&2Vo^Uu(m-(j75K0S+pD_zNkvIwJw~?h^&x2lKm4lzhyjM!M~2 zjA%BfJpaN4n-T^M)4NsEezVnF_jc@}-l@JrFoT?hc00U}y(9NY+{O@gLb4u*JR(Vl?jJ=Uhhwq|clLhV_LpX4dDs=kMBU-7H>@TiGp6-1 zW-kVdR{Le%q-{L9AacqQzP1Uqj6ZJ5lEoIe-o@Chp51^4)CWckocjf-QaIzyyO;}MLhyCbFuplb+R7*^Q_;Bx840cFq_CIY&YTi}{-q37;wpR+C? z?Ez}6f@cq%qTh4WED`6KyJ}|)$VN}q(k8oE!H&s|g*J9b@V*vyZPr+sLj%zeZBlEC^3&)9n3e0q-l-5skasHC^7(0J7a=v+>#SaPWS~UHJV$}8vZz&byi@49f$kef11xDnxXcLWU)|2cnD^EbSYdza zna2Wx1yXeG7`7vbvuRlF&K^k71};Tvd>rf4*7Buu!o}Q?qi!^GVlvuCb&MJ ztJqT|31XF@SOAux*4dU@fJn~E5dJU#@Gi)@{quT0jPiPHQoyXV@p!>9wK%ZoHH!_`H~A604`^4-!y0mrQ-@Vw3nMCL+Ut!VMtE}&xJyd!nQCey zc6Bja2MruE%Il3;<3egrlPi*IX@SkSPWHN4Z^8auM`}diNQtIH+h4NUZTz*Z=m;Lz zV9gc|;^ANuiHO#5K@P9cERy zpd05~MKf5zIY%B%&C7O&u1EM#054u4nRiz8i8UG7fvNgW75a5!nRD!s|0+6*3ZRKL zI)e(57rJ*w@bkn;J>2k|h6TdHMS^64(;g8p!-|F^@cx@@c(B$VTQ(#BT1!39b0HNd zWzVmA&2M%jPq5)JI3Vb1jZT-U_(D>FCp1wMOzwh+I>9lpfR6y6iaHq$5ebUemS^_4 zxetdL$o|`U3P|Qy+jQ7+?Ni9@U$wsN#aRKnQ|WC`$x(yO!^v4*y4J)lbN!{-c>j+` z#3hv>tlE$j6La8@I_ta90x2DlIre`44f{MXx46f00X|`SDBk61%#llR^hq(?e)682 z4w>ev{A`uAZo$HoF2?szwqRcwewh}bUZ7{1y5|>}PmPeI9qjFBv>V29y=0=6)v9@c zg5~NZbEX`l0UDqO+-lSX1!EGTfId*4}2fogudr_-?upa%BEkD~>dMx3}o2 zY};z=??&#Li*VIV(wT+tox-I?#K0aPldj24pPD6E&q@}Jn$2&s;72wIu2EqhCOJpc zh7`5KJBP0Axs;5^U@>4jxF_;*V6NTUIiLXwBhVszGid?0p$I-dR^;j3JUg1N`^p-jpDH?xy@iMnZ;Uxv>^Y`8c&#nr0P)ad zCB^J!nGAmMv!*z}T-@Hmb4@BQ|2)f>k6E=BlZA$+7nJ&sFwa2*iZZ{7-fy((E#*-x zPH6{%)$?H3c&(e(fDT&VXK;m7h?~`M2_z8HFafZTmghU|qY?c?CPT;H!$+e5{fnYm zeY!U$?ESvJsY6kJUn+xj4DH=6%KZ_))Ka?Oxh;?uwOOpCPKc| zZ(eGaeQa46vJi)`T8`BHB%d{3mbIy70dIsb57+5iS$lYFu=G-*uk@Ra`WQEBaR}vo zTLgaw<~07LY%HvB@$iZS;(}6o$j{xkcJW3Sv}b8(v776+>GGxa>+07hepB_-8h5P; z*pzJND5WtX@HA`>zvO@?wH|+Ual;86NH44vPB>IApEt~5+~_%PFGzsaM;-92WEW^$ zT#gbe$Fu8Y%1&hLw#hnGdj*`|CCTXF0yipVdrJYk_zytXKYZU73bVx{ygktlR^wXu~t;X;b zBBS8|3o^(yvGGY%7fdh?Lrl*w@G&6!pe<%r9EnJTJr1$#%EKaL&42q9UJo}wmL?68 z{ht=>dbxxFAdMew(d)!qK&f177auYYAoA+O_2v?YK=p2BHU6|Fe!6TLQD|$H&zAQz;C5;C4 zTA#;B;P?wHYr-_JcI>A@76_Ii6otTMh>5$Ne9k)97OPQ&|h^!Ci2&grdBtq~Ab!C@2 z=(|xV>h?W20{1h==q$!o&w8mbHU{z{#yp0d6kt;xbeBBATOh;YdOq6B1e&n6vqW3O zlVpk*tiCadlZO=1&hO}RSlw=9u^FtI|2@P2ujC zD=UPl;$>~fPjFHVWz%dR6!+m*vs|(|rYyhCoXHB5D|ty^=K?7VPJ%(kJ!ft-E|U6d z3If7rxEch9bCgw#tJ@u$&fryw9FcckK*_?OwPy|>fES)pOT>3;<1HsZUuJM9LYV15 z{s<;Xv3RDY-%BAim#BSsFyrpBlgjS(iT06DP~b&%e$wq%vT8ukLwYtD-Dm%bXxmhL zcDwV<9|`H3o_>2iK0=~n1qhe!lQMb+18f$Ng73;C*5rB;HGv~PQn|MyfL3`z?@qkr*l%Oz%@t;u#JHO) zC$1F^_Kx>wK63QW-|HRPTAM=jaHJP#$}q)a>RpY#1K#EY?Jn#gie*QtiAXx+Sghg{ zmN^>!ASNgE{a2AU0WZ1(;PN6u1yig~2h%xF1!UQ&(xzB_teD6LWWFI4iCJhFD=OFu zb0pBx$5|ZZ*FFl?s!VR80&^tldDQuWrtqt_)hH!6cv7*XpFjgXJrCkgQv};}c@{4_ z141t;@?;lSYSK@s&`F`#<+uH5Hx!Bx^>lIV+2x~X=(*Hmsv6c}1yiyfBOF(KZtVU0 zq9L4raG`MIozx2CbHT(n6h;eZE07xMuyZ_s3GT~;L73O9x1=7%Pmd0y>X5>M5(_z) z>E`zP6V=z}S2XrY6;0v48+N1zh?8%jv3Wj_q2h%MIZ%rT8OdpxqwOdHq{m)|_<$>T z;A+G}9TGx?Q$F57H!-yY?INT}5zo||F)Bc{_%8DlESS=T{;G2n2{vbyCn>z8<{4wk z)@4cIXbq;RaN&Fi8w9`2q?}>R`03Af>}Z{Z6OrN_{p?13U)+e&La>+IK2XEQu;^*! zPYH3|Xwe#hPr_mcty7Aij}h5BBiZB+tfSsvYM+UpcH3XRAG#Xx=@Ks3x3<|uliKQY zETn&rutOCMs()mgbrwVrouM z8rnf4mX{yQykabQjFNJktu% zmwJHzuAMQizLvnvG6u}a;sZWbHG=Jm_pZHm$7)zmDQt^Z!1dZ;P8~0_m_q9jNn|Mm z&JOCiJ?iSJF9n<2KiBl<+*B2AnZP}1hK;L87fw~a`Qoo|y-#W9?sLrI1TrHF`Q!C@ z>Y?fxW#LBYL64SjuX$?i}ys7Q&&YxpEDKuIXWBqQ4jE0mxw34=Q3eJZq zw2909>ZmI5zgS&%FKqD7K>FKPP@@nR_4hcHJ%|RoxiXuv1NOlqM{rbB$wJ4wTCL4= zRGHWoc@3&WK@W&Jtw2{DW4AU$GP_?Ni3s`%ZA=?<)V08<)urB^lQeeY^uK)0hfq9i z+;A`RW+aE*?%ScxP9Wyhi^E>las7W2HKJ>Tt!!;v?>HG+wj|yk6de&v+@r16yX;8* zEBrYy6Mpx-kd|vhx{MH%Sy+w!LtYThv2*zVRM+)_cP4cbqzDxpUwung;b`Fwgd(p@ zk*X1*76ms|tppZibQKa>Nd7X7Szb)X`PttSbCotegZXg8N3Wmzw}J+oRSt#)n;yiO8Y4I9N%dg7k7Dy@0{X`)4ZjPhq<^AY98E=71dvx61*z^`x+(?o{WSCiHs=9 zfOwqhv&aLdndUHZ0z3AuE|BWw58XdGEg_=efdgBRqW)uBy6ys6(##}$E1FpAgDa#J z9Jv}#7HT^8fgNv4B4B5)%?2K!o`q}8PLtV)Bi7*7;Yg9t)264jwjtWz%w=XYE**ms zc=dQvoN|<~T*yKBWnH^{k7aHg0lC(p&43)v*B$ebl_?0rA{Tpq1&njhw4+R763PDD z)a%p4kPfJx`5XJpl$`VKCaQ`XCq%a2W8mw@VyIqrnNmv(J1Ckx8`s&53hC}hGtF4e zu0i;YeetEMjN;cjWZI8k{XoSR`4;*H12{_Fp;+{3X_tnG9j~dbe-zNyaeF}N@e}sz z4$jV!|M}#aE`QlGSXg?(ElF9y-Xb>0%=S*z_I~mxxikB$Y9|{;n45FL7?)N zgK+*Blyd+hF4?o&;LcW0h(M@uD9_g5w}=?y+E4Jq7T2N>IL$$qOTNWEG>dbh3YGG? zmYDJq>vdcHl?ax|Ov2=EmAdfzPBI^o^Qu>v7T5kvQeRGz^Q5GvyP2eFeaeehEtLJ- za+uQD;SVd?C&PWgg&i4)bg>uJ65q7PO@*D+aBP&v#Ul=jXNhW_ldy^Ft(4%CB)xD} z50>`peHV(-Pv(fpF2^%P?oXd0esjySa-KF9bC%)M-Zz(I7n!D0icU4~j2cctQXsxQ z-FMY|I1I7Baqw?{ppnPfUSrr`YEj<}E!VA`2&7Vki(JrXxRze&E34MA1O6QzC#Z-* z&WB2^%SkAdK-}+d-O{}QPt z_A|_xzL{=-6r~15KaMf7s*p-uv1tkp>hPUwomLd8u|3EX`b#dUC&=IzU;}!Spk78o zB-n=O;@?<2 z+8Rty`A3Ug?4?oXRzTkyaV~~{$>nc>_i|X&vB&9QUCZpuEY{z*2hM|RV_RkPA(g~h z*=57?VvSYtmp1(>A7}Yh`QU&Xz^roYqL0faePfNkwOZzl8VK35DZ*HHi#H4B$C;x9GMIewp-c9E*mCYOJA8u!<@w_25)}6gx5BPbjNRbZag=ta{eQCMGmczv-$)OCS3HIKVhR z;W_Wkr{PrznySF|)>9Z;q;A_YS<^Pnz`uGmUK@&Z>XF(=RZ5&as7&(X#^~~FhD;5q z?d4>7>WWlOw2Vg#d5%|evkAibHEjh(G=Cz@x>q4qraIZY z7$m?eDmlik?_95*acE-RZMa~T4g-{ICCoOp0+^{zPvrhw0*g^9u)*)xlE48<7E;s4 z@Wdu9CrH?sSexpnQ`PVN%>I3{fB*_embBQ{!6{u5z2WUGPxZ7-BHM)q-fGFAuQIz6 z#U!$;a_OxLMADl-ZcWv$-=h`h<#%pzIJXF3c2eaDsFY>UdB#=lTf!EB8T>xxD;=+z zM_9&WbDEtCO|9StH>JB7L0wWo?PQfcaBWQtT&bW4RT67%*x7@3jgDlAiT6r4PhJa)uM?HS>+Z z1*zh`b)-4?jeqqSp53Y&eDzuHlGQWP>JFNNfN*ny%RSX_3NE%s#v%m1`%C|b1yRIp zDi_f`Wh?I36oG>Lx0kfO$c+!bX8#oP(eSD>xE=GO5gQ^OQ69uyBxQKaJVA^I6_o?; zT|&#B0G~mP>q;Ndq%3jCF>I?pmrZw4ieH2g#2L@|9rSUL{JnAq1RlA>buESQ2FC^6 z=pG@d#XEFtqdQ0i9wRcD--#)T-{H}KskD{XabmN+5ZP$@6?@H z8-`m}QmNRsZQH5Xwr$(CZ5wZFRBYR}{l@+E-ingWmjO4=y z1m$^)0k{>@#CkcE<~KwYkU1CNIm8$$`!+l(7S3uUT=&kk-b>c|V$9|bpV71mf-qE9 z*tlQprSvx6MTvStUrsdZPP6}Gedf$Q&hjk`nD(mK7X z=l@(ZTpGjU35nA%$0+%{ia2!Nhd|uS?548b=EMt^+N#UW`dg&%)R`s%*EYj!zbP|= z&k2i05w8>nI_YJsK5@vpZ(qEw<9C_>R<%oN6lDASnl#isS(Cs&PuFN+zH1FG+4`YB zSX-{m<=)??s-t}?4GxRiFumcSx~VPih<|2(EjyRBkeNiS)Z^h%mqo-ii_Wd!l(XJ{xK|o$rwH*Ym^FusK#D6I zL44OqAq>liBwLEqxL-*ZzXQ*ApB98!#D5rr(KL;gRbl@g;uHvL9QGs4Sx2A8A9)fD zfKQ>-KcC($ekicil`9q;G6tIIzy4_|!+W)F>ooXB%U2fWAZ1M-_U zP)o)jCz=7?xVy45M7*@TqQ0X0P`C^2VY9${m>}U*0BWFm(T)%^x^e0w0?_${wGs~i z34AGwwkvHz&j~Rb(o`OGkUI4QRmCAy?*TK1qG^Cd z(I1Y_IMV|JOw`jU--2;^@`-M*2MxSqTD{)h;}rM12$t~-fI9fCh1x&qdpO~9FgOR6 ziVNVzD4i6ny){@SG3+mP9tQSOfSbc8PXdNJZMrn54>sez8JMzSfqxiH&|%WLmt;F@ zFSL0co5adC>|i}GLWmjn&3g@Z>5yQ$OY&~Se04lzx=rVQ|Dy}|VZ|v9j;@F-3_nb2 zFvCsdx>Y?+0wQHexG7EL>>y<3r7EID=Y=wKOUGv|L=sm@s*KJB-QF7AD$8}Y8)-2d zM~2j{2?$IbDjeQA;QuMC1XvvsROtRDm9#-|rmlpcl}zGt<C{S+f%^Mchr;`!HUw9VrPIsUXlmgMZfNHblKnXcLK-o3Nwa zp_?o{*s#bZ&V%OuRX&9$5+QvGGkSUm1@Y-l`Qo2OngU=#z;FD3LlJgQ*M*#|Mld2I zkp`-FOr83PCY0VOl?8RXKh4RR%f^NhbWc=MX?V!jHTQD?jLO?JcH>VdBp#gis z>(#3J_=dX;!UGWbtiJ19*%PoS;(i;VM*4&Y?pMk{(Sm{{xoJ>#W>C$#=wl|Dz7Xcb zHfmNd1dP_s@a;VxGwpv@*fn%*b&3gQl9q(LtFE<>*Jz*uA zEMWwvAZxEjgMq$J{lr#6G`J|DHHQac`xE$3nXPYy*cq#b%+fgZ4wwB3a5=5nP(=)G zg7#c7s!FUz@C}TDM4_MQB>lsLvXh#Jhh8+{O`Q}9iSV4}-C-#k5?syMH7|JZcw_;Fbv&wNdoq~O0az2@pRtVU3& ze)&nW`6|)ln(^YFO(dQqo@ekN*gKX)*Gfw!7v-nlraYXO2@7%UlMXH2FO|s`YZ2aG zog-`JYttZ;o`*eCb5oIExC+8nV=27pzm~~`1Nfc6o?)yvBF>0Fim)LC-=l&Deh+gl z1t_)*Eix3VH~QZFGJqQ@#N*~T08dltmMsA9Cqvl@cQE1qr`>MmT^xi-T$ zJXFR6^0m@m5Bs`m(CCI%b}5Og>h?BDhbh8R0~mhy1-F))dVXv%C1`3bYlmqi)kW70 z7jHyIlzck+QS!dD)R|KT|B_D>4HOEmA%7>X^CP74A_(|2#z_Dhth!AeRzQ+ILVeEx z{yJz|lt`C^6f!OROq#H471reSq1QWOBkzs>xq5Yo$AF_fj}FD!R2~uKO?oHxf=k3W zg$*4g{b-pLlo9g&L^<+);z#^M zPq0M4z|<=gt(hwX0upsuX`R3j!{eJ7S{1+v0c&?wnRxeu?)GOz$@i*FQ?L!CQ+EwA zKXpg}eU~(3(EDpG%D(~JVDzJG=#M{#s|ldra)rf zQB-ZpM<-5X`J=y&-uQq0p#M!_`X6r6|8$sGm^lA$hl%NbX)yg?Z6c=s8D9GTmzY}k zHl1)e>i*9-QH74St65cz9LM_VbTTrHcjeH1LvD|X4?d}MW0SSC-ugt{&o?5NASkJK z*rDqL!r{4Pz))yAQpvaL)85Hhze(Ij<$3wx46b`C*2rO3buolLpPPX1<3R;qn7=z9 z9^dC#*L}-X);eBahrspQ(fukQy!HI_@DSrR&Tl8jPL{SYc-8q2F1y9T)%k z#t61RxHXezIfAkPtDB?qU5t)_4%Z@}mt|DCNI02fhNw7_&yl4myU%_*XLNe9HhYhg z?fRta8jAPF(VMyJbav~|(k))!CU9e#08gRoZSkeVI&IoH0Bd`4*IpiX{}ZVFGlO+d z&d{OI$Wx)EFri_fFwW{_pr_zry>{WvHmgLc3D1!7iMJl~sG?Z`?|J)-|30@gtZiRs zFpRU9qDF@ix#zW{zWH6#o&3I7uARZj_roI}a`uL_lYRJFpl$~8mTaNn`W+S)f_52B zH+D|(3fFQo6jQ5`hfxt1hhlJm&JpHq94P4Vxr3s2Xp=R6p2NV5@;4^60^aG=B!{9AXA~`Yof|k~z$whC& zuLlMAh@IC;m(a4h9vl7fC#T4^Y~q-!6LRqB@3*{7z2-bdKZqv zlG~%5H*+W8=?PqbAC#B!l_mbhs;m9SKY&9V2*>Hw_I&XLV}Qj00CLQVdwEQ9{&~9H zZeofG&s#W)_gItu^t&b6Jxp(lcuK#<9pyPaM-PYN{0eYamtZU`ep{Th`llW>7l7s` ztTn)kMKKNc_BVM#@^O*SkAxdLEv#M5L?yAp45c0<+ybbscVdsW2Jv&12mFQdalaSeyz)7NcNXz2~B-!3m-@Oc3R9F937rCV*Kwr zkNw1R6yd|U=)q4%`5j$nI#UHI;*OZ^0|8|~yiMv%=@I?9K(2HTjI-8(i3J#4h`crv z*$^;`N$(xd#v6{30#wqtlSWmXV^jLntR?@8+dMfH@K~2KG)0N-kbn9s$ zx+aloHHQAT9zR?%jT~n1$JeD*&TH3;qXW7j_rI3-;K!V^^>VaXIZmEar=;~x4Ap08;LtKQ8hD^E-b9fnUwn`>&_4|PPae)(b2^9Eu4(Q1OQ zC}l}njl3l8o!wwaF2)ctwGug4GLS@MA39!@Xpik8kk%(i{?k*%UNv~MP!wk(%}MBE zWwfWYPkpbF1*!LNMHY($?R%heb)u^XET0q6MU^5lj7W}p#OJwKIHw}zQ-VlMR0et3 z7QQ<4Ys+9VAW~-ukf?M+-jNo6NqgwC`ZcTG6z0JSbc?WZ#Abw9RgbHGHA}OLK!j47 z8R-5SXGF4BN}%IH<_Ky)liR4>8>VxH2|eeQHxe@-jJhYLpS0kXZ2g%bYXt_e#%fYA zh9MQNa4yXJ!~AeQUXgU?8cO6oWy|1;Lrn~-<|dSgj0h%S`y+m_HGnIoF;aDa{yP$> zJuMiXLPHbjeiveN$@}*-)g)Nk3IYH2HSvr+9&i0QD^%KO>EzC}40NxABvdYR_F zH}MM_)*#@NzOtikHCs}5gbK=PrUxp|ljnOy#95(5LPjPKmb+9dH$+&OQKB3*rUDFIH5rNt06D7s2jhLWPoQn zwGb0T^sAI^+Tt;BVs@cR(~L}O!8@G>iI_!STc=K8A1f}s)Twd?J&3u4t%bDa*{so# zqn6w|#k8=Sc9d46St`?IpElMwVxS+YkDC`XV4kNWmk5fec1a)z$;0_8TR{{dn|1)Q z+tWIb#XAvdq*Yd3lX@-(2xs+&;>4Qxc>KJyR@$-^5XEUD~tiw7`h-`v}Rg$wc zPskSTAEMXrB|Xh5?jRe z@vy`z{h0|&a0GW4ha)@yCzG)$XOrkkklNXMNuap&5rezYHtnIA>BgW6H~ zwOvx{9Yaggw{g6`CNvmZN-j zYVS+O!f90kE1T%20Y8PR6}VoI znV(Y&xl;zo(4MNd#wsb@$>#dUQdm-u{Et^OFkW||5^60~Mtnjc{p<`J!?pntZS>K` zh(g2g(qK?(xCT|#Pv8}^drSZI*Wx%$X=DjRB0)>Z|T1 zgE>EBouztwwB-JU_sByH7TtV_eWF-`rAjLqLUhS%)HX(gLsvL6EW)m@7QTnCa5p+= zja$uL=B`jo4^dtQomAm#hedV2tA$f--Mx1&G4clKEhNxqFsh=dg++<*zg}UY(2sKJ zh6n&i+a`0hJh}HjtyK!`>Ztoz6mm)(K%FnM;d~~ym9M^ABvliu{~h5J8!aJeTe&H# zuAympW1NE}PKoF`jS42Nge}K)65DCSu1+w0#nq)c1>NNNP8WA?8AQ)+T)3m7x0+Ym zB>C@-#1(~~#sBa$Js}n!D?&h8+Hc*ci2P~Pay{1`yH}yf2y5?BtqrF(id$9zdJI9; zZS2g}(>WrjXBH!-=##ocu&#t-zbgGpXT}ax_wkmiY=MKJH&P3Rg=oD41^ zB$^1$6I8_4*+9!yuzBiLZ-(IZaE!q!?)Z;O({-!e!;h5cHx&#(lO~ZM5O@I)8#9=U zIRGc&!^2BFPuqsF&ppL;$H-}F3}kZ($>^22wEMlOdB@a>+X@k=xCct$+ymLyex~Md z!~B&IQ-}0%xYDBU${T&v2Ns1|f1*<}AmpvN z?YF~gjbj$l%+4~++OEkwi9nLHkO*0-Xy}1|leM>N`a#Myt+@RGdaACx?B=4=d14l5 z7kiYZrpKsqTyB!SQKs&dW=Qbp^^@IqKFfY-LPD8ke=~h@s+)P%F+1)d-No)J2jZ&6 zYyR2l>iqX^#Ouj~QXhv2g;OD|Ixu7ql&R0srzAptoq0MgZG4q%OHu4!ST*r)I0SiV z2;?QkL>`hmm>v)&hEgMDCtFw;1W$e+$2;seS^ox#8HzAB9nkI1oz$O`3_e@A_7((r zsq`XOWnD>R)q{eR7NSgTan3U&&^{g-HkSK0yme)GL__sd7LalnW@KjV1_jt>F12{H zf*B4(At<{K*-_4&O=lhd)inGm8cM=+Dg-9Qbb~87Z(VsH?)PhQ6tc)*{R9We2(^Vo zYbQ_$worPWF(FTCVfT70 z|3Iqy_?8-S#;1?dx74?9L)A-#@`%nsk5zaG;u<>?y+jbQ zXq!g>?TPlKvVrdnhKoZAp?={Nd_Ni$;ijzq2SHHg{e;vWido~^8MehWb{u~I%PZ}{8cTL%#;W_5l=n)?UJlITjJm;9d$W41+fgZg2JMb z9ry1OEZjM)m8zc7U#3=Ym;DfNFe7FbMHfpu^8*TH2AXiH%RSrymTa!3u7jq}rGmFx zK9P7KJCaMHzJF_VFSe`$lA=X(A3n?TqqRP`TPr!)K(hM}{`(i@o%d!VbhUtRcZKtr z^FUQ9XI8}tfJQ|ORz~)ESP@Tk26y*WmCyYi2e}&veBI~`%eZKIe_l{QOT3164?bcd z;4JuqH~Wr(qA}`Xrl4&~2`TnKu}vsuG*M35QMMd4V9rYwG!9Or5GbtXu30q&V2dV1 zqHnFZ_ktyhM6DGxy1hwQL4PC1sDNTgVi7IW?MC?C`S$tq}Qndw;x^hZg^EX7L zmX<;H-Im&k)%d)GKpRTNX{M-+GZJCE;FP(A(cqUg%yfAvuZ(2Nt9)!B20t>;Z`Hki z=a+3hyQXr4B`L>2F?pak$>Ta&fOO0}dTh(=0 zd_hZA?RF5g4ZIe_*Mb-A7`rV@eNSBY-A@A=qU5q?SxP{fF*Y}y&>?(@%S)?|yrQvc zJF1|hW?1f^GaFdIw2CYB2Ly`QDIT6oO`|oYL#hW$LOF5P%j$R|^D>7^MDoZo+J_(Y ziVBa`3=|nQ%Nd-m7@&`cM1NCdj1(wIy+FrfTiH-h2e^DwH7S{ok_}z-uaZm0zoy!` z3$o~)dgdF#^TgA=mr2ky8-1QArn`Gb=14+-&7%&o;6a#UY=#m+1HIJKJFHR8F|ft~LyQBoGm$2k~3UR{=2OY#K)JkXMiToQTA~ z#T2#C17lVTanW?;l>DMLgOWL$aI%DF>=MkqcC}J_MT*B?ts)h_(Q^*h{aedy7iP*| z4fzhVhmD-Ni)i8o8EdZ%nAe=Y-&rqD6?S9IYf4T9LL`CuiU zLRA!sBA>3MpaixaTrsN`ojF}RRh+W*nN~4MMb;rav$r8z7xG}fXyXir1}h)X(|(a@ zP|9V?_ZhY>cDZ7nTy6;;*D^tpmUR(Fw|7LQ7n+)t^M=owfBLt&9&o!iPLD%tZhAKswRW(5U0i-T2Z@@B zkZeC95NVfan?r+VjQo8}^Nm$rjY5jRdQJ>QR2k0AfrPicu(aFLrGx-cee#Hq)L}&{ zRj+1Q`+tZKW}s-#NHc!2ZGPeweag;EwjAy88AN!6TkT2kf~sMMk8-lrH)SH!htYdq^S1CZ|^0R*zWlVo8*$ zy2+|ESV?iw*InNueJMN2(dsWg5-B3Y+;^x$2MoxBd}lSaJmCEb!e~l`N2kjrHN@4W zmN9IkN1yq^`rjK^oFv$Xs_Cv3-zmer{(p$XkD#gbIIZy(Pk$%lmpd<3IDZ#WJ`WzH zST7j$8fh{*a*?`Yhg8Bq2DwGStt=P+Dje0ju6VpCvCvaP7fXH}%NOh>M3AX$Sct50 zMkwr2)sG374yryy1q<|A)yjsR?rEup4O@@{PfXAg;TqAbx{%o^Wk8^JFchH5O~VGX zvv{gJd-H?qDP@0E2e zi-|Ave3lE7-FCyZL#19mr9#&+DcN{k)TqT}_J<;mKo*GWF2meQrH3wk7dFcmy5gEG z*Ne|NbGyl!mUFY~WA)ontCO{~6<_4563)68CzBE#t;Os|x7AIHSAk_Xqy-K%!*lNo z1eQ$=svJJxgoU$2ri$9u#>Yj)!_7Rt_vVKCjjMKCXCAnpuF-KUnA?8JQn(D7jRP{S z2XR+?icC$o$L$}~I89Tf8OWuo+}LGpf+9-itED%{>65zKY^}jg4tUoktOS*i*6_6N zKQ>gazw8Otg;M$weeL#3eG>8aVmsM6f4Q!IX1hR<$BEntT&{_xMVRH3`iRI@*E#EO zUGI6mytx%9PY-%yz|;h^68{eRCgzm6m8fu0P)No0FOD7){-sbuFt5B2QZTLrSf59w zC%r6#YR!r;NYLDd!+|BQkfV8aPPCZUXh9w)=A#CK7R~eNxwI~q27~k}c z>Bo5F!{(?fQ*=~W_(r!J*k@PLt`jmHAG&Lfp_HY#iIlOWDzUU=2y3}NTAwJE_u?3cYZ{@_42Ug5$=Be$3Qqqq zDZ4X4iAdJ*`KndqxApQQ)vLEiB8Ox=X@09O=g>r1SkrSDM&x!g>Qc;QaUUBJjz`_4 zpL~kP6R`Nvmcr1Ajin+Gg%i3Z8)F2z)!0;!5eB|7aGmUM6rh}J2v~^=CMhmmDQXOZ zyVZDvOk|HjiOKZPZHZVJB4j@I)LPdVR|F-DK5X+O^7*QJhE69uo;CoDRW@3R1m>SF z502S;ubI|jJ3n-wBp4qQ{n&U>=YsbcZI69lz{nz5ty)3^wka*%{6!Jy{rOs(e||9$vNCe8v;D6}39fq}1XaX0*?FC3 z)`c|<&g)Zt!$20*qyE9EVQmPIP^@qKr<6iY`x3O)@M>WcKSFObxQ1f9WMPy=MQ&BZ zM6PHY$;1x4aXx`9BA-ou{n@$o|2h2u)$`VMmgjq&+G2s}B#uFB6kd)HU3awH?vm9m zUJg7a7tWg6vFtB|kR1UH**f@_maA<P$6mXpgEIqHNo^MXiZplmIye@>M z$zWs4QZra!#thdun>uO~q)Bs3CCU}D!>1g@t&22ZY$KOl6<;k29k$ICZ^5~s^?McL zsz6RHG&1>1E|_vx`)DC{7sr>;P(F0fR3FUy)vPtA!2R7)|On3fi0F5Lv+I(YfxX`L;=pf zqG3oq!7#y=5j7zt!s~h?%x-;3X>y;sT zgco0ai-<7IFHVn)(QJfOz}lHt)SI0VV5wSdo#WXK1-^n_w6E{<;b~B01Qrg;C|$mB zb1C+Ru|#PZaNVJ}Zzye(zKP$ig4uoizU*#g-sb0?w)*rrn9TB#s)~2rJ#7D8z`_on zt1kb>_0{fq9y#*r<>M__sCUA5W290Y&nLF6gXi>q<7%HCP2uJqt-H@{5qvbp>EI(E=Xxt+VyIYfM>ZPTwVUcJnve63TZK+UJh7r}twd*0kcjIHq)*Ki|eKmDg<4Ph|C@R^apgNjUN?>-***o zK9=`N&I=rKTFy0%4a|3wTDBn8=8L%j@otw?AN-`eHeQwwbm#wIHVAXBn6kNxLSoU| z8T}D=8>!w@#8`LYdHKlB1;5-#lKcABEf>yfIM}rte@FcpvKOGkWf|t8@3Wcthc>SdC{vpmdJd{b4eE;1j700!n~31}5t`qC5w()Xp~qgUZW;kvLSypDMQ>$w zcg`k~@F@fz+B}S( z$9R-e4^N86`V{3xe*aSE%dK4~^6(rqy*xm?Uhg`bDg2w>8_yLN8tQR#-+Lg)r_Es) z;5>udHreREB_=w?1=M(C{i>IXK)XUH%(3+@C-QuIW`C{ML}pLiSSzve3%y32pn41N zdW<-Z(@8Hj3?%A*HS(Ij-%q^xPqD_%+v)ynteJM<&%j{jp{kThUcEo(_E7VG4UDl( zS~*4MW%{akmtPdDU+VKInFDJXL-4T%mtu3>Ot!n4x;JCq+qWY`U}zxtxgC1agF9ZX zTIBg*5H9N6&unt}Moy2yKK0Z6RKBH`;`=JeeID=IpGm?n@cfJ2Idpjdx|eR9Cob@x zRyS!YQ4RXsxA>edAE`JK*gUgab=CVeL}0w+ME|hy#GAO?^9sK?FJ8B@)1T@1Mufm9 z%e^-TW_Vg_d|X5og$g5IXW{llxLqRllB1kxCa5PLWPNNjMLiWF!e?Sp-8`7eYl3o? z^|g#hn=H|E3$#(?+veWUnuMRW1=iAz1Idi|C zd-QiQPT1|AQ$DwE;c$|Rd-itTlGyY-jL##BZ6DQZD4(?bdX2M-)4W-};wU~X@X7324p?&}J z{ki;^%|4Qk7&1k%H9=Fh!4>D5C-$mG!_5Hbv zr*M&fLu|sjkp|UC=65$|->U5$xWT&Hth1MY?y|l5_Op8L<*VtlUHpV`PkAI~rS-PA z{+n%WTxW~z={kh%;%D)6FTb&>cW%{Hxvelg7k%CPF%{d@N|nd6EI`}HIxd^qwCl5d zB`+W!FUNVB*3j@-WIK8uU8UCdJdPa!eLHY$Q0~HnY1PpE%5>DL`t=NDX6skocAgFP z`cs)uV2$t^dY2G!cbDL>4~js<-^>RGmCWAjVOqafIlc+^=odC2+zy>lK!9@(8OVVX zrDCinscDIim-(h2dj-H}LFM*6W@_PPc)+ZqbAE_9I2LJ-Es3y)2C9=pN=1-LF(q|- zr{z1JIVr15Tr=JJoE(09L?HBJ&9vNP`<%pnu{~dlwTV)&QwhxS_4p6o3g8L&8LnQH zUZTd=zAl&40ZUJg46|R^@w)hICbn3o`%^|eJx&})XRV+U{ZzJoZ;l;Nbokcs-Z<@r zN9d+Iqix6yKJRb);k1(M3sp-Y+#(q1@V;M3>)xNgKe|!q7KKkr-_YGh;UGI-uALuy z`V8LRm0upz#n-wc*sXb-x3#3}zc$)U!JcO!aT%JQ#IM?!#lCF6*Spqpb33W1ObxX` z17z>$T{?G+_ahY@E4No(@|d0HFGrzAzHMGiuz9{;j|X`mdQ*Qk)+cTI5KMGx2T@`X zxHoUQdA6sw8CtGrYxvxJ;q2hP?>?HmIY07|^lXmJ7H}LOA{byNiRFBvFYJc7oL+kU z!Cr7(s)&6*5c&X?*GIr3U~#h~clrtS3#|FMVcdcOTDNYzsIDve!LYc`Zel@`U9Z8o z3#~%5FI8B>R<-)gB=&`0Ydz#oJ2|P9ncU~;L>oR zH15WYD7Svd)$w>cjnzDSnA6+UQmOhFyKvQ?zgpgA40pS&+H22e=#Kv0t(tt@s(0>m zT4U}C>wKByGr7DbUM1Kpi}u>QgxMZp;cB(x`Ivs&zrlRo4Cc`m+tPLM*^e=)>$BPW zAkba=Ty{Uih_QM$kv|Xfe5jw&4c4x%b!BU0gfzuQ9+`rJs^%BO6&?dl$WwkR3y(am ztrGFlcK6)bQGwowCD>4qx|aQr%n}_p`6vF^1OA?p)5UHvIc)bFrZeR3cACtD&d~6g z_wZO~%@y!;QRCZevm2l70Ng#}TR2^-P)IuxP5wkOwZirbEdH| zdR^X3F!sfACBqi4o_wlt8;`#&*zf9pjc5BVk-*xguVSy#yXL&D6iA*PKKQqHT0Hn{cd-4#ln7pK} zzNVXS5amPFW?h^yK*6`?sMuq8jwCyDJ{%PRo1NMKex$@EIdT_wjhqLqZTnDrKgV$! zk3h@ivGp6}aJrATQKEZufDS?3J0}JmHqOI_PBfoexO;w|?`z}g_4In!CQ^g$4w-rp zb~hp~^K0rW{cLdmH6YBkPKsysqm_JJ^rqoEww8d-?*${#zR6(ODS73Byte9lk+N~+ z>E!3{r}uN?Typn)^y2W@lXcOGOWsPuFis!xMjUVk;G>af07nm?oUEQ;Qw4{?5!Cpp ze-Rnx21O z60z_lhjJpD-cf^^?B-Via?W1Fz5E|c@9C0D?*9%0E)#@PYGeYHJ@zwF%XVVm8f@N@ zoiX1ZQ$!rCr{iA>@%qmeb70537CScZNYkzR!g%uDN3g=q0;H=etSwUbmxJa^2nI<@x=4WQNshGhK7NPty0` zp(84%kHN({c{Vbe@z&Yb9X%Zn=B@MAQ3UzPu6CCVzk{Qe3lS=TnU900!UXr)dLk8r|xRigwF>ee&7Qm6rRk%W+Kzc-{z3|DXF@ zs`<2sU~Q*sF>te?s@>04X09AKeU0zoG?8!prq$O@0)Zo7z4VeL!s!OX>{+~?_u;j7 z9MZiv!bkcJ7A8{ibIYrG)Ac-$ySw{lUn@AhC>wD6@hvHQX)oKLlZf^v=!ZmL;WL?_ zL~A0|21>k=;dFOEx|O|CqtObE>?19CX>bPB)XUjYO#1Quy1B zo2^f^7Mzi7`Q3|G&;B9MOYz;WnH3D< zwL0k!&Y!TgSAkZK;zRNMR~K9H&MvYX;Mk>(A4RV9R8$9#orQm=LZMkQi&YHnPafTADw>sM#8KL_;{jEfz4< zJEPj`_#~f!*5g6kAlYC4R-fks?Z`j*XEG`Gl*A`*880k$#tE92U_3#oRR=u`@r7_I zPka%xFX>d+G`j3Nh@jo3%HA?p4RNsI2N;losI!2W(n zVIZQf1;tN)6gui&&}jrWQUA#B=>Q{aA*KTJ3D74Yn|9q#Z~WSn-41_ceWm0E%9EHo z>1xQb2F;#KXJ+5nwzhc%xWap(_m1zG{T|^r_-OF$;H;y;m?duji2PL{(LRdVN+7Tb z-6$|vLUI*Tq=X+X&Z{7p5dNAsNC}4~ddZlxUosa|(-L+;AJ3$`}|*EYtvisGvm zkn8`tC)5dvcEqY1Ai4A4MVTFFy7%b@y&WFCbM!&(i=S;|v!UY2)CE1{5J?+@@+|n9 z5+p^4->3l&qZ>Ef@cX2J;$=XK7Yt!!of9H{1mzw~C)WCow42~|5DsYThW}r2aKO$O zquzKu6v*ZV*A=B3eai$*53X74QiqZL&-D;_Jy(Z1eW=vga*CE7D}R*0*|#2A-Z*(Z zPshEEqboQ1SZPhTHDWqQGiW)$tGL$#+}cRIK6stT#^3E%`6=@qgazp7tewfD1_}JY z_S)MOCwutxF*os_hrdoop<6`E;YAJ+(~=UvFM9@7R5%e)P6C0D&=MmXEP|0p%V`g0 z+dJi<@p!>Z$ND&vy=SPq5Ew_4V#6JCIhNf<+-eg#P3@JyXY<1~>WpnIH}8QJS6Nwg-14a562ct>{b1NF?8 zzAH~e2VT8@`nBSv9inIRex@5|HoC_>!HYw(hll+&?}SbNLihT5Vapr;DQ;*7sh9|+ ziz<%(p8Rzr`z~u4b*V(OqGA7-&Vj95GgOzQ58Gq;=Axx~5%K-|{?%2TB+$AyA5x8@ zaOjn<@AkfD?cr5u*SgR9Vf%Ggw}(}FOZ<>A#njIjTT>1aq6Y19tTQTmGPQYz`*-*H zUpF+41e~d3$2T1=VI3~>12M-#t+)sl$?m%K2kTXm7(ck;pwy&)-~Idpuk9*sL_Bep)BHmOO`B&uR$pF4WVGbq#S2$7;zwk+x7d#U(#WMo3}X{kQ%}}7Xk`*_n@G|s z4!;K9VF2eeY&VAUK}h!^%D;y2cAyq9x-&-bDg?rb)-qyAiCA9T>hTMD;I|?sdx0A# zM$4!tB{Gg8*o-)y1IR^4cp-f|SbC9#PF&{!bjj$TA}xC%rcNaCox~DeywLU?B`^B( zze5EAUaZmsDoQwcv?4_8fYSmY4}9#1(;^}dkckl(MR>g!SP!I$QF}rXKRmR()Cx=j z!BQY0^_hG8E)dk!DXa>f~XOrU#i|WjM)WF6LfLk}}MT+2;dKCe)ep zQ=Da4nnNm#r*;r@GS9}v$SSu%##_b z8In`NW&fRrqcv}3+RU8Il%1lO;+e8DLug9p`iE;o&-jt)b;5T7`$*mtxIWfBY-8BU z%#)ETgVz+jKFZ2y&jOJ-IHh=k>73)4&IQu&iaOMXkkK^7bs};?a>Dz_^houH_16f^ zdU~V&1(85ULtSmKvq7&W?Ku>9Hrr~pS#P^;z#al;zS(fSF46jXGx2)J&8(|lu_o_& zg1ceH2DaL)c%5)1_}RpBCERv+MA*d9Tx1>c1cp71YXF>)Vx7^9#X7p`j>iJb4t|--59-LjTaR^_+ z3wXib^MomIx93hnKxrd&roR9sCRJ$9KX+LOl|%~E7*bI0o|Vih@D%~=x}jqK+&h5q z2_+%j`$nD6u_3pLMm7X6iH_Y*+)B+c!8uGuUZ@73S&%F&P|Fcf%ndSP%5y3iE$0^C z|LvfaS+Z5>vO>)Ud1pl*zm@*GBFaY4i%}3-kB?qVWof)HBj92(8iQ&B-*M|{4&%r4g3FRl&=4A!U!)<@v zs+0on&r23Mo0x81X8sRh~9zm_{{4^@RrL6jD)CA#bCtjRj0#mo6@i{Dej+C@b&v^YY2q3r!T zJ3*~Qws&7TZ7Lz|1=j~t%Z0iX_}60I2IQ}WUll^lKh@m=O}A-R&(mqY&um=~)y9xq zV2P)B?quo0``uI;^AK%Gzu>(v7KEvixFdJMAzi_J17?ci=e!f%6@2*qR6d@eJW;)a zRtx&Z_yw(+pZzEL?j-aFgTtTYr)DPRrEO4@x;rTW^7uL_+@vGoqhrsj;^QtBI+RD@ z6Opbr|3I|Z9^Rf_7C*nZw5o4vRMSpPr$Bee0Bhl_Pyn)HCzqd%mz)B&Mn>91wQK?X za{~#wqrp`B!_2Netr{`@4JG(eCw(eP@=_Ps(ndJFEEij?a0Gzk%b8)zH}I`KdGa$Z z#|_%vo3x7LzteA#P-vvx-38zTw>p@ktNS+mz4V5E4Q+kgaGTpE2YA(RtXb_h!LOOy zep!N4&FE|Q!hDDuDl&fGiFmupkrTVZft?nCBJQ0ylp^0f&+S7A4Q{u8pnKX@d<^Xs?Du?LMo$X)4pRUUFxc5 z_BUHWZlnEu_7RRAU2F8++=`km88uy8!z&M`9 zYhYH=R@beKB|sSO25?bJO`}vxtXy9jTq$|ft5h*?2`FNs;{nrgB)?HN7GB1A0|v6{ zuAooZx(4@F^2lO}XPD5*hZ%a=Ss40eShSNNE?M$tmpqowoBsJ~Zpav?F-mJ?cLvbR z<)*I{Yry1Pmo7Bd-yK2gljVR~P*682&x5>i9g@FK2pog(e zG)V7Ug$#DV(nfxKGLjFGD=b^efD8Eo?Fxn){Til)7%NoM+0<$wD!;Pzl9{C;+_^Gy zs5y!c-HiP#tL-fR7t8Q^nwsQ03{?_=q>}3xOrvE`WGGt(VnyL1by-*B`H9Ja^!m0X zyMFc3i%c~d_No*dF}@ojZ}S$Q%TTSvmeXb$EW&OBEI6%gAH@m|PIj5ArR(W^;{kXz z5GRbYapT#t(L6PS?O0QpdB|oQQfH$mzs15=W{VTS$JEvAA(pS}#YnDc ze13Jp=B1#lIJ{~xV=2UJsA(`W*O-XT(j z&>_^&dkMX_(2JpjCcQT`^dca=2-1-tAiWA25EKys0qG(l0#c+S2*SgAzk9#?{{MSr zz4g{QNoLQUnKLtI@5#=|J~J5Wk*{ho`J-M~tyaDovWi9g_*qX(Dv(LjGyFYwWFMyt zUG#mn#aD-6{YNQpp>^*@sU_+BV{2lSI>~QW7~QN$osVPaLOtr5rZ;shOQqU=AFc3k z_G`2qkOWuG(Kn4U%cG@@vKpy^VkhI)%>X}KWqSBrJBmkF& zce){7%`V8?&b)No-NiV!v&d`HsJxv+PtM(RjVF+{$n1748TbdcCn(_4H=KgLStD!i zCN~JtBNP=6pMb+^m-W!_yS2Ur=3)JqDg(!wu6WB7N@^LU3c`TY?4;P&j&}qRYe6n5 zEL;ZF4{dt#U zg}0>Nq!lHbsPvA(m$1ec>aTWlf2o(;&u_RrnM3+UJMh6|2DJloZO0n@hr1RtZabI3 z2Qqct5xCyZc&uRw4n{{Ux?_r@cZ0v>dL=B|NS`k33f*xH_@Nqcl(+?jSr9P5|4nK5L^OAxU+dk2`not*3u~V@Z)cnT+HZX&K>>IRhOYX>4it~qEnV(k=@F`sLrXTfm|7dG(`7E&Q zIhCdpS3f_Y z@O5H1#%IT4Fm*6*U(SwM!koFbQT*j2M#I9I5$S@QR~fY(jV8@?6Z4LvElvG~J{=MY zxdi>2nQj;;kYY}pKPW+{&%q&j4F7CGy?WZQ&u|%5XC}q;GVYjI=%qvSA>KC# z1!6v;TRLoxui%x)bbsH+rM{O-(eB&vIVU~$#eAyWD)?4|6h~b`D@hGoe2_t2z;j#-e^(^85Z_Eq9!5Ul)+R_ipm;w#I{Lp&Ks2-^m*{u`S!@ z%T`jfXpNnN4BgS}e;y>GfhNyLiUaB7zj-^=^!F}?4F&ih;aeH=9l*lf+_!>lWV4PP zs;s(wK@-83dVx2B7zBj+xP)b2@lVB=#u5;@I2g9Fa&6 zb273kzAw!0-px#qCh6*ZkWib~3zC{B^FoAI>ulBmcs%JQKD4=_{Q12`u;h`UHuoa3 za+>$8Y?E~ZXQTD~x?shPk=e|yE>20R{paepOYVHw9=KUAkE(+<`&fC-L|;EzRF5Oa zlOS$??B`m20`)f;Vu}b0(uumcxp0(Uz|91b6K`00k1ru^H^;Hfmb%Ir^}|xtc0z0E z_aVNldE7lsSv$JrX~MS)2A3n33!@_nz9UU7s!w&PxL=etc#Q zyl?^nzb!1^c>gWR>;WTIZct=e!K*jf{&6vy=vPuj9kTVUB3X0RCFb+{qmA|1G+v(4 zdwptNj@lGnDG#bLbF3C*tlo?Wj1;~688~8$vD=9}t$x8Ph&9~nm)%nge(Et;+BbQQ zkEs*f5$~Vh{1kYpeMm0%(=Wcf$L4P-M89k5>TQJX#F=@Fsj5WS@S=nTOwK#vK8Z`+T<}TF9Cm=( zGKxIy_zpZzo8!`jzwf~NL6&*LY7f#+`Dlag?l(8ujz`ND5fmDW5qYxa-VMA9M)S{A zzqacvC*FLBDeHYkHyGw#o^WEo%=r2Xs}6SbyuiT&u zTaM_*>$AFF=$gdLZ68?NGez9BXlVO|>iNJOa*zG;7HjXPCh|;}#@6(=?+`kk$Cj3_ z>lXV-JJtle9(g?qvpE~n;TN+idQ_VVclhGry7ffT>4mN1XpMZ))Tm_cK}EkXopfB> z#T$9Cwpw2t3v|b)^sqACR?7xrw+FZizG%6VLu`0oy+O3i@vO0Bd72|>5bfgXEVlI{ z-5SX!Ow8&QxsMo42FQ=x*7@m%U>zt#BY63YoRTE^Bu-{HX2Mfe9C>e(E%AQG@)`l2 zF(7we=5std3rqO}{LguhXdLJU+p}&owKjg`R3q$A7w*&c85*g3SKQX(-)P>rHl1tu z6CBhSbUTlFX>eR&z{H_!nZDrq=hAeeLCiWSvH!MY{WdcV{tT5Bg^iS)SX^pCMQ=h@ z7I7hktu&NJM5LyoqvJ)##PrL)`S-7e`!u%}y_fS(F-?cT=C&d&9|$k`(L;@t7kNo2 z0*D^-v%h{9;772-WNvJMvOki6l3wf%~xOn6iK6Co+ll8LF?tl5LPGPR3 zaJ!1i!z1<~W7Fe!x|e)b&5U~&_MAnxwK|pHw}y1AADT~ibWn4Tl0WWylEsqw=m^fy z_o%Tmu!^friZ12R)T61iozIk$g&~Hw14`CWA19gFx^$;45{3E;miq7?6F%lL>f|P# zq&>BQC`=b&g)Em9wbLRU<||7%5}3M0BvzM%n12LDN!eU_Qs0!f40gzNf7|%*a4;__)Ym~SPdoRY_kTKX^sqGhb zzHLJ`pQE~aNS}fyRBTupmU%Zh`^;89rN8?W=ZT#Bfg?>`k5W?Rx`#iSIE@qU&tZ%K zv@;HyzqBMgq@D-h0AQJS1PgJFJ&gAG=|LyPZjv3;-}d!eZ+!9`#tQ}-;I-m715AJ~ z`<~)U2QaqgCPnij5R;xK;;m%Jr-}Kaws}W4=@-`B>TSt)gxy~GV|k6&aobBT?%nSo zDt#1rqOd`N-NCs-BCgUi)N33P{g?p#sc_P2DD|C(2Pf&4AGtMIsOky|4b^^ubHZ?t zsacko*H^5*GxtWsRk(t1P}?Z^LWc2_TK;l?8_uGKjjQ!LBQ%;FVL^j3$8z37%h?h zO!Rtxvbr9&D2P*V^T6zsZ8taLzO`g z8Y4ik1X3n~RR62|IO#>e$~+-}P}C;1uz5njVn zURE7?@GPyT^T`W>y|%n^p1R$JOP1@bWWWHfVtg%}k?f_zO z7L@2_PF}S%HE z42m!H!BD|0f~zQQgl0eGeP&DDz7tz}WbXtoW9iXt^cE-B!>_o)F>RxzoVjtms!nj&!Mf*r zLQDzhP$@k~MIbL~O_!d+H@i)fq1k{Jw|K$4ok1{HP%R86zhK4oVN648m-pDvc(cnX zw%Z3@g)?xb2VWRG6UY<6S;K%GZ5D5m9l$rfkZ$tPe7B&kJVz$`&fI?PW2ats0b3^V z_dzs{?fNZph>rCuspX*u(krcRidxtSC-tND_}OdrUnjBnlIIZ-S-% zmX^h~cx%~eh8W#7xDw95^-)_AH(uwqdS}S{hyfkT7XHtpH%Z4F45mq>=r(Cpx?W?{ zp2nRU$X6ync;=iNKLTu3U(U+;-Xj8i#9Ke7Tz&Hu2T9P+kfttIbY&}Ws%~jhqH3$e z1{AML`tCaxKs}n2dmV*YK_St_wv2VX;+>{deFYk$SmMvNPCr!a0PASxucXac;4(H_ zDe2c2RV`4w@t)8U5L*-X6pp}O+1=Hse^w3V(GIX7X zUD&(n`9bjfE>hQi1KYQXgK`ir;J0=?t|B(T3Ev_QFqyZtk_&s1cqchcYPXA894rzK z>k}(5y5~Z?NrG`aqO>?h?nZ3_K=;hZ=dD5XMD!r~z7J&%wsf5o^6IKUyFDWD`(6ny zZD zaM3L32Dn1NTX@mruDdU-dKpi4sY0(h8HelRBOcOiJ|&H@+^1bRH?#cWu{tWKp_)$t z5&EPigH~)*?3oirFH{hDDlE>;tIE4k++HB&!U+aI0U!Vi5|0#j6~{zt(eg0ipj!}Y zoPLxLGG9in`@G5@ozH<=fORAOxlmdPS(ee@&x&~%J&hzJ6Gocs@R)Y=xEezTVWK3Y z7x*Rs*k;S;&ny9M@YlJ{8DhwIRCiWO%GvWHa05ub-!sfG>GUD|0r)(U&BS)2x&m0l zu?dXu1|j*DTM7AFO&#LoOe768_*XObmIPVPbd~NTg;9+xUp?!Sy!Zh$7cq_dXM?qtTvtF%!pG&)tt=L#+zR2q3sqQ?^@mB-wdFr;@FfHrB9&X+2Rxs4u z*8MU>+76?neEC^YeAXqYUFElT=o6EBfDDj#BCkh0+CBpuH2_{&G3n3*S92@ z_)0eRS>mU22gQ|rV^AOMm=ZJD-)~9RJ+(h|7%x0?*xmP9KG0ty>&>+oFY3PYUbn-a zUz2ZkaFN|@H&idAdH{Er4#Fs4IQKv0T9k_JzfgUn$=x`Ze8pXI@ir3Ia)_rHq+(!! zApIn-1F``^vlY7p!RE-S({ElJ%Muhi&rfB1;CF#faP9*q8ct@7w_8xDY44mof0&Hk ziqu)ut+Kx?>SFgR(m>LrSi40fP|G)pG_&u2>Sh{5uvqG^1gxt(QDfd0Y0QzBIXhgu zxXKg`+n=Ngbr+W(Mk6w$@yo8njqqV+d?!}K(@1wblwdK0&ctkGeVxdVFPr?Qa7r27 z)I0S{WQ`io2x`czE!FgN{B6m((VjBV>UxqBWpSAavqKdo#nGyd?hGjiv`f)Y^{8A8 zv%e5eU>+ZI^Z`%MtR`LZQrhrkSxY3b-2Dzb=z*6wg9x{po}EUXAz_In=0r~)q zQXnzm&1_upFc!DxRE8W>PM17j=uN3e^>WHla9lw>QX~BH;C1csG4*MyG|PjtL>tA7 z#2tr0dq3!fU4{m3Y{AbTfQrS;HjqC#XwzSVf? zLfkn8WWwO^A}zyOs?Ri?f$_b(F1}yt^$vs8xb<>=X*vx@%JZ?DpA^&zsAv|s{w2a2 zN^H)Ymb&&S2!b25axKdi#|`YV=toXw6ZF5UE4-u-^@~5Sg9l3 z(7aA*ikR|?Cy{(!Qy5vV?2`!#>&tV+@Fm$)#-7$)ZRU|X4p+TDx5qek?|<2x>c{QR zN_S;5PJA_*yq1{D^ZlENpAXaJfp$^}negcp@8Eu3Mc1;K!&kE;iNk?kZ1Sm1T{p{| zn>t@#ejxo7vU7hug58oiwUI!}nUs3{33KYaK%}i##HFFqXUW7}Yuk}(VpdO^H`R>% zsbG$jFqNkGmGYwGa)gtLSyNegm!qcr@CI+|tbxvvggFAP8>y8pgb>vppffvo#co>G z6fLy}eihCBS;<6fZT~T`YH`zm5iCWR#^0Lr@G3Gp(wL9p-5x`gIya`oMKnJpr>9I@ zn4XcBMs7&37Aj#z%fKIV*&1hW)^!;_3{V^!3aRDg7i*(0ixTF0OLH01p`+@~MZv;5 zynaZ=r9N13mLU@Qyczl$;kn9R8q-rg5v{}W3YWr!ogDD9o)<)bxBpQ;^7(t@lPBm5 zGkUVY$PA*NL-n37Epq9xue;*?$Kg4dPaI8+WyGzl%^d5{nK>F+v&vkz?2Yj`Zs3#F z)6wOnu97%-oR(+$t3K5}iWV^y5ykY=(dEEzEw>bv<1{%;WW13c#>=@M&k(Z_+4f{r zm$a(lY!RAoFY4X*sOnWlWSmNVHhZWi#*O!L?QooT=^#!c;znxJ%45;cQmTFqhSQAr zWa^2$<>f`VDu{H%lIloG@mxxJCi|AT$CK=2V%blC7$)xQx6s;XwzRccXsU>KKA5dg z3ayy}=2GW&m=4gmACoq=@d515KM;Gwu-KojdE>^{8|@epTf{>f+Z-N&PEo}MOmh#t zEafYEdt*G1e_3|Z6z#y|^S3&EO_%Dxo+eIB%u!E`iS?Q=&>S?4}Zx!2R&I{7hEXwk~dSd?|Cv8pJg3dq&ikySLJng@ntbKKQ0OaTSZ*>5k@DD)7R*sY zuc8hHb3>su^akoOU=$+T#2Bs)1HZ)3>!?$K;}En)8HRBg$?{PDnxV3OWpzog>U9n5 zK?oGz1cpw&L^vB~Xsathf0|^dsLO)g5tSzI6Ow76;iegS>eS#~%!al)1+?2VLrYx> zN{vaZW=~7DggRn2bmEGW-Js=|4Y;~1RMz-?Mlv}<&4fxtJpwv!Ol6=>4=zK*8kJSB z=O;s;^Cs`(la-;?rc}ytO5l3TUPXT%F)Oqc5o-Eb9b_2C17<;Vnts-Zizl{#+G2bk z_a_l+LYXm*)%|J2Hqa@=tdWC$92g9R3e+@~_7@S0L9-FOm~>ONis*{ys^~Ht(KwM}H-hqBM_RC9_LtN+#dO^L7{j!p8VNMH@ zOE8@(gAWk4)hh(hr^bFc$-6bDY03Nu+s7-^;7=y|WMI0Q(}&3onA6N;VN9p;;5s5w zW3U<#2_JloD5_rJfGSq5FoRudPSMv{V2U2E(1LeO{W6n(V5C(BpCNiw2mPRF#(vq! z90=yeE0kb@n$W^zT!gq$Q%Uk2#CDY<1^8JFrrMDX9E8}ebR+;T)XZuOnnT--nhKKj z5k2aI8c<22eQxkpjiu(GHFVmj>0z=NqONj<3~FEP2m-&Y2~AB#Aq1)%iNN=3EY$|# z&>KdulH@SNNR=ZwxTPjvU0o0?R+FzX7zllA49g)7-|0J=kNMU{FnOEe@eGSzgF?Q2 zgh=lR^8e7mk174Zs<*3@zjRNe_X-())pv9m^X(VGwBW7~2}#qdjRK8)`C^l}^AG0{4y;kG0*h%Zjokl$m*U zg7441s+B?>yPfntEnSdJ;!O*ivwn(sEFxAwyBNe40C(Xu)Yekbvfs_b;j9h$hC4vz zn3TbGeXk-ZwvbRFS$$6|GhAnbsO&Z8E|vB#l?}GCPecls5Cejr^-D5j8;aT=IRf*> zZ)X1B*Z#;Icz;|!^9M;;Nzy(KT#E3Q)`l$K0j{=Jh%+6b4gtEBRTYF^ik zqU_^w+I!{W<1}1!Fx3-|)~s=I_yUm^M{CY_Zn$RROsJSUil(eXYe@snMA)nCrcf3X zJ56n^>L%gt33f+ul}TwWZN-{XS{rOgm^d(K3v#u_jyq;{B(^rEkK<%Ym5j^71Bl+S zi5F%UshhOLx==qaeAME7kUhectvaO4TR2V$k9ng?!Op>SJx0SeE-SwYOc-;Q-F5D~ zqpitMnG*UAb2)qc}EvYT;!sAcUtz z4gN6^R%IQJMQ*q>uf}J?2vDR2mKnYi9E;kqyWCaWdYp9J->rh7fE9iz)A-0NC-g4hC+Wsy zsbNig`11znfqV`0DALeuISgm>Imu2ht~B|$)XkWg3N#1$W$sG_3M=zame#tX$c2g3 zFu*uq_Bta0x;MRp;2=1ro~4n*h+x(oHXo2MNI$l7qZAo-9)NEng|$u?yJ z*m);qcv9rLv=Hz#ENY$kkgT}n-KT@1;h*6K4jc+RU$n*^rfjBY+tiA2yQGZeHwHz< z4~BZe?8Tn1pEiBzNP8h|U&1NHng`={+Mb3nRETM~q|D2TIt@%eA$>ahd>Ao!X&%>M z{<#xcSKCkeq`79L)>7A0LtW$RbTTO-!^GIm*rG4!No}V|Un#MtP~?Pb+$#>1)57NPms|o z?9e3xZu`mDQ1Zyg2Eo^JjmNIep88{2_qVe$y4wsjc869|oEv%6PewM{+FUgr3=O1w zx1ka1R_Asec*(&b#U!02jf#vS>2HC zXWJQY)%TzJ$z>^ryiH(8z`ZmH3@~PsW;cQ?~sKz6ohkH+UCtnySR*<8P zSkt>mzI0hV6QL=zcNM;<=5q|+ERq>gcf1D8ps%nj;B|>Gw8wQNSUhYfRvK%GrN_Eqd9hkpLS--(4}(Wa zkc~SGs6taK!;thy-cmv%LSDcsZVFmnSqMUaq*S`#d%%E0PfCwRPe>2gpcuk&#`y{S zi6aX5h89rq7PULl|ZYeAY7FQm~ z0ti7fDdYNrIsrvM1ArzP7t4YqXar$^l7QQ2urjC-&k`^KbOCTF1JiMx0Z(t!^fUwT z(Llnl4vn8RuwqzKEDhEP%YkJ@C!jw8DF82k-*LYKzvFxd+yyP-FXAlXUErKD?9nXa zFKc3huoURq=vwqH@DuPUK;~scf7fXjGL5~4TfQq07Aj>=pfqQv9z6 z|94>L^`C+ORZ=V^uE+p@^#3b(&ieB5b>kIm`wnRY>&vCrjX(Y?cy&*f{3_ud>X#wK zveL!du%YEEkcO09#eYh~^gEf-ABmV?(o!(VzcMk2!v2Mpm;XEMk{C=%7!l@+64plr zIygH7ItZHvIR^elSnBKjI{}ltQmC(k(`{5B#1ZA{?ybPS`|Jff#NAne-9kcNMBi5x z<>syx?vFAJH$XUr-*%F5W>-=qBbE=94fXQ%x)u!y_44!%kPTH}cX0M`M9E&mztO_% zkUvNQZ!55i3Bd%VL}2W{`TU(-WKGmG{>63OQebxr4D^*17QTK8P$)!9$j9GR7$zel zBP=2+EGjB^O(7T%<{jt|D(D@+@wW&yRDhGeyKkVok2mDENC!uspg;xo>y!SWjjywd z!*3h@A=<&+-RlqGzx#x}1BBh3h5r!uC#|fngMXkROkVh(&1-%C)pYXlcJcA|a`1LS zDZ>9I`X~09R`|Cj|Iq9&d;fv@Unu*xrrrTUf4EV|$;a!rD#9=!vA@-nHS+gy4st^I zE1Ehvc$@mT1VW6iU8(AiatK7RK_vdr>)%9wYA>sc3JdY^cMebtGItO7?JqMuckkN} zU6i{gL|;u;P{l<5PsYCq|KCjsb@2Vqrd)Sin!|AJTMpS=H|{C{_zv(w+c^9}O%{9~{>I|-vaQC=wTz<_K2!T$80vy*I~d!Q%k zukoeg8Tc3I>Hd2L$a*?>yDG4U3Ob`)9D+Op*%klitNnYNdb1|1Z&|D8IkJYhE262PZf8>k7vHC?~f+#r#9!zi59;{D+k5mh->o?O($FFSP%2 z+y_F`e4K)Q`@-S(y#H?}{f8O<zVXYS>*AW3-%`bBY} z=p4zz1rbT-KJ0E|NamjH2K|C8c$Txb5$n!P+10t=-B>JXypwZ zOXD+0G^UNlctaM=R%g;SZf&{Kij9_dPrMTs1SL#82Bh@$JZY6y%&mSlMf&mk>7DQ^ zd%g~1=oAE#gwGNBehr2fDOZIxSIm{jiGG_bb;nciezKTyORjUE&1m9RgyR7+jLH49F@I0qbQjM4b~e6$4?g) z>nG_Mt+`JLj}!V$5M7N@Nvf-2X{#Fxv~+d1R`FUtp42f+GzGLby@J-Bxhm%pWdO}w z)NgC?u{*E8i$e;lmp5N`WLfD*A+FT>$d+`vkXj0Ng%m%tbCZg|fo9#Js`wdCtA*^3CQ0k`Gu=Z~aghazSCc!E zcjlsz2s_UH5AsR5tvSPvie`fzyQfmp?UwSo3;G>D_ej?_4-Tt2Z%NJ6=yci%YV*`fOtwd>+MH7$L~JxGzHwxdcM)^0# zmOvX?Vi)+SmA`^&3#?Bby1`5OeP<^QHR8vS;af0a*`wu9U)Rp<`Xdm(#EVgNdmN+ zMJ$aQ^@$94Wtq2}i{n^^3K;!cHO-P^w^f^q-kbuu(AfBmE`anI0q^y0&Iid38kGSC zecSgx!!qpHq=gb?GCm=svz2u&*^+so&_n`|F6iZ8V|5e2A12S4R#oFF>f|@;7x|j! zQs8*Y?wsfc%x-Rj^wTu`$a7fH_Wat()lm!~oyv{2@B5CBC(xonWnnTXTOpDBtuBH4 zXNgR(EA=e-Ks~(Y=2MZ44905jDEFBkiQy;*;6n!^B`NV6J?liD4(WFu*j2nq=}uB& zR9S_;>mDk2W3&yE3jN8=geh(^aFTdU>!{GGxUzSX#D!B)nC$^AdgJh}c=KgBfkkR~ zX+Fd1pg0@hv&|29JP!}d5G{N5t_4QO(8KcJkxe=)5|3s!Yfskub~%NiEC~}C-kXVE zzE|?YN52P&fo@T6aI*_P=2R%(-prq4cqitrbMiVlRFC;v*GSK>4l1(V^BeC-?TVj_ z(l>gD2*D5fW9Tu;0z)1G3U^!f$=fJXVLy=fnqLbGxmP7}>~@eNw!2z56%z6+XcIVa z9(*Swp8xEpC!g@-uk?_Y!_*nBT)JwUKAl)q@cr>mBtLG>8r>t1T)uJcaerw&rFyZ1 zRbe`}<6V&9uROfstRzix*DqRM9)HmIA|7rT4y%0d;!At(3sP*oVf##nHgDK`WO&B> zR$Dc-QbEA!4+*JAx2A)ht}&XMPppeO z?oc!_By8KZcf3LV^eSFo*g(GwtInm^KSUgejx+y&K_3)VdbayD}9@~Sqw1@|f zCL=fi9k%QDP4RZzt`&5pqh=mw4WVbz)U931^t3gtQ~f z$-zlR0wpf0C@*pi!CXXS#9SQ2oJ1u=#GIVPVWLhbDQ77dN(?2XX!pYWM^pvsCJY%Y`UWQIru@!tQIYcc-`|V zMoIB^-wQHsTfe^y7cRXaK9R97Guz`kN{HS|KO^C!0SbGs6Wbuj96S! QQc9AHn2Sr@P=oA$0ObL?h5!Hn literal 0 HcmV?d00001 diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/Include/arm_math.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/Include/arm_math.h new file mode 100644 index 000000000..b01681c63 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/Include/arm_math.h @@ -0,0 +1,7057 @@ +/* ---------------------------------------------------------------------- + * Copyright (C) 2010-2011 ARM Limited. All rights reserved. + * + * $Date: 15. July 2011 + * $Revision: V1.0.10 + * + * Project: CMSIS DSP Library + * Title: arm_math.h + * + * Description: Public header file for CMSIS DSP Library + * + * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 + * + * Version 1.0.10 2011/7/15 + * Big Endian support added and Merged M0 and M3/M4 Source code. + * + * Version 1.0.3 2010/11/29 + * Re-organized the CMSIS folders and updated documentation. + * + * Version 1.0.2 2010/11/11 + * Documentation updated. + * + * Version 1.0.1 2010/10/05 + * Production release and review comments incorporated. + * + * Version 1.0.0 2010/09/20 + * Production release and review comments incorporated. + * -------------------------------------------------------------------- */ + +/** + \mainpage CMSIS DSP Software Library + * + * Introduction + * + * This user manual describes the CMSIS DSP software library, + * a suite of common signal processing functions for use on Cortex-M processor based devices. + * + * The library is divided into a number of modules each covering a specific category: + * - Basic math functions + * - Fast math functions + * - Complex math functions + * - Filters + * - Matrix functions + * - Transforms + * - Motor control functions + * - Statistical functions + * - Support functions + * - Interpolation functions + * + * The library has separate functions for operating on 8-bit integers, 16-bit integers, + * 32-bit integer and 32-bit floating-point values. + * + * Processor Support + * + * The library is completely written in C and is fully CMSIS compliant. + * High performance is achieved through maximum use of Cortex-M4 intrinsics. + * + * The supplied library source code also builds and runs on the Cortex-M3 and Cortex-M0 processor, + * with the DSP intrinsics being emulated through software. + * + * + * Toolchain Support + * + * The library has been developed and tested with MDK-ARM version 4.21. + * The library is being tested in GCC and IAR toolchains and updates on this activity will be made available shortly. + * + * Using the Library + * + * The library installer contains prebuilt versions of the libraries in the Lib folder. + * - arm_cortexM4lf_math.lib (Little endian and Floating Point Unit on Cortex-M4) + * - arm_cortexM4bf_math.lib (Big endian and Floating Point Unit on Cortex-M4) + * - arm_cortexM4l_math.lib (Little endian on Cortex-M4) + * - arm_cortexM4b_math.lib (Big endian on Cortex-M4) + * - arm_cortexM3l_math.lib (Little endian on Cortex-M3) + * - arm_cortexM3b_math.lib (Big endian on Cortex-M3) + * - arm_cortexM0l_math.lib (Little endian on Cortex-M0) + * - arm_cortexM0b_math.lib (Big endian on Cortex-M3) + * + * The library functions are declared in the public file arm_math.h which is placed in the Include folder. + * Simply include this file and link the appropriate library in the application and begin calling the library functions. The Library supports single + * public header file arm_math.h for Cortex-M4/M3/M0 with little endian and big endian. Same header file will be used for floating point unit(FPU) variants. + * Define the appropriate pre processor MACRO ARM_MATH_CM4 or ARM_MATH_CM3 or + * ARM_MATH_CM0 depending on the target processor in the application. + * + * Examples + * + * The library ships with a number of examples which demonstrate how to use the library functions. + * + * Building the Library + * + * The library installer contains project files to re build libraries on MDK Tool chain in the CMSIS\\DSP_Lib\\Source\\ARM folder. + * - arm_cortexM0b_math.uvproj + * - arm_cortexM0l_math.uvproj + * - arm_cortexM3b_math.uvproj + * - arm_cortexM3l_math.uvproj + * - arm_cortexM4b_math.uvproj + * - arm_cortexM4l_math.uvproj + * - arm_cortexM4bf_math.uvproj + * - arm_cortexM4lf_math.uvproj + * + * Each library project have differant pre-processor macros. + * + * ARM_MATH_CMx: + * Define macro ARM_MATH_CM4 for building the library on Cortex-M4 target, ARM_MATH_CM3 for building library on Cortex-M3 target + * and ARM_MATH_CM0 for building library on cortex-M0 target. + * + * ARM_MATH_BIG_ENDIAN: + * Define macro ARM_MATH_BIG_ENDIAN to build the library for big endian targets. By default library builds for little endian targets. + * + * ARM_MATH_MATRIX_CHECK: + * Define macro for checking on the input and output sizes of matrices + * + * ARM_MATH_ROUNDING: + * Define macro for rounding on support functions + * + * __FPU_PRESENT: + * Initialize macro __FPU_PRESENT = 1 when building on FPU supported Targets. Enable this macro for M4bf and M4lf libraries + * + * + * The project can be built by opening the appropriate project in MDK-ARM 4.21 chain and defining the optional pre processor MACROs detailed above. + * + * Copyright Notice + * + * Copyright (C) 2010 ARM Limited. All rights reserved. + */ + + +/** + * @defgroup groupMath Basic Math Functions + */ + +/** + * @defgroup groupFastMath Fast Math Functions + * This set of functions provides a fast approximation to sine, cosine, and square root. + * As compared to most of the other functions in the CMSIS math library, the fast math functions + * operate on individual values and not arrays. + * There are separate functions for Q15, Q31, and floating-point data. + * + */ + +/** + * @defgroup groupCmplxMath Complex Math Functions + * This set of functions operates on complex data vectors. + * The data in the complex arrays is stored in an interleaved fashion + * (real, imag, real, imag, ...). + * In the API functions, the number of samples in a complex array refers + * to the number of complex values; the array contains twice this number of + * real values. + */ + +/** + * @defgroup groupFilters Filtering Functions + */ + +/** + * @defgroup groupMatrix Matrix Functions + * + * This set of functions provides basic matrix math operations. + * The functions operate on matrix data structures. For example, + * the type + * definition for the floating-point matrix structure is shown + * below: + *
+ *     typedef struct
+ *     {
+ *       uint16_t numRows;     // number of rows of the matrix.
+ *       uint16_t numCols;     // number of columns of the matrix.
+ *       float32_t *pData;     // points to the data of the matrix.
+ *     } arm_matrix_instance_f32;
+ * 
+ * There are similar definitions for Q15 and Q31 data types. + * + * The structure specifies the size of the matrix and then points to + * an array of data. The array is of size numRows X numCols + * and the values are arranged in row order. That is, the + * matrix element (i, j) is stored at: + *
+ *     pData[i*numCols + j]
+ * 
+ * + * \par Init Functions + * There is an associated initialization function for each type of matrix + * data structure. + * The initialization function sets the values of the internal structure fields. + * Refer to the function arm_mat_init_f32(), arm_mat_init_q31() + * and arm_mat_init_q15() for floating-point, Q31 and Q15 types, respectively. + * + * \par + * Use of the initialization function is optional. However, if initialization function is used + * then the instance structure cannot be placed into a const data section. + * To place the instance structure in a const data + * section, manually initialize the data structure. For example: + *
+ * arm_matrix_instance_f32 S = {nRows, nColumns, pData};
+ * arm_matrix_instance_q31 S = {nRows, nColumns, pData};
+ * arm_matrix_instance_q15 S = {nRows, nColumns, pData};
+ * 
+ * where nRows specifies the number of rows, nColumns + * specifies the number of columns, and pData points to the + * data array. + * + * \par Size Checking + * By default all of the matrix functions perform size checking on the input and + * output matrices. For example, the matrix addition function verifies that the + * two input matrices and the output matrix all have the same number of rows and + * columns. If the size check fails the functions return: + *
+ *     ARM_MATH_SIZE_MISMATCH
+ * 
+ * Otherwise the functions return + *
+ *     ARM_MATH_SUCCESS
+ * 
+ * There is some overhead associated with this matrix size checking. + * The matrix size checking is enabled via the \#define + *
+ *     ARM_MATH_MATRIX_CHECK
+ * 
+ * within the library project settings. By default this macro is defined + * and size checking is enabled. By changing the project settings and + * undefining this macro size checking is eliminated and the functions + * run a bit faster. With size checking disabled the functions always + * return ARM_MATH_SUCCESS. + */ + +/** + * @defgroup groupTransforms Transform Functions + */ + +/** + * @defgroup groupController Controller Functions + */ + +/** + * @defgroup groupStats Statistics Functions + */ +/** + * @defgroup groupSupport Support Functions + */ + +/** + * @defgroup groupInterpolation Interpolation Functions + * These functions perform 1- and 2-dimensional interpolation of data. + * Linear interpolation is used for 1-dimensional data and + * bilinear interpolation is used for 2-dimensional data. + */ + +/** + * @defgroup groupExamples Examples + */ +#ifndef _ARM_MATH_H +#define _ARM_MATH_H + +#define __CMSIS_GENERIC /* disable NVIC and Systick functions */ + +#if defined (ARM_MATH_CM4) + #include "core_cm4.h" +#elif defined (ARM_MATH_CM3) + #include "core_cm3.h" +#elif defined (ARM_MATH_CM0) + #include "core_cm0.h" +#else +#include "ARMCM4.h" +#warning "Define either ARM_MATH_CM4 OR ARM_MATH_CM3...By Default building on ARM_MATH_CM4....." +#endif + +#undef __CMSIS_GENERIC /* enable NVIC and Systick functions */ +#include "string.h" + #include "math.h" +#ifdef __cplusplus +extern "C" +{ +#endif + + + /** + * @brief Macros required for reciprocal calculation in Normalized LMS + */ + +#define DELTA_Q31 (0x100) +#define DELTA_Q15 0x5 +#define INDEX_MASK 0x0000003F +#define PI 3.14159265358979f + + /** + * @brief Macros required for SINE and COSINE Fast math approximations + */ + +#define TABLE_SIZE 256 +#define TABLE_SPACING_Q31 0x800000 +#define TABLE_SPACING_Q15 0x80 + + /** + * @brief Macros required for SINE and COSINE Controller functions + */ + /* 1.31(q31) Fixed value of 2/360 */ + /* -1 to +1 is divided into 360 values so total spacing is (2/360) */ +#define INPUT_SPACING 0xB60B61 + + + /** + * @brief Error status returned by some functions in the library. + */ + + typedef enum + { + ARM_MATH_SUCCESS = 0, /**< No error */ + ARM_MATH_ARGUMENT_ERROR = -1, /**< One or more arguments are incorrect */ + ARM_MATH_LENGTH_ERROR = -2, /**< Length of data buffer is incorrect */ + ARM_MATH_SIZE_MISMATCH = -3, /**< Size of matrices is not compatible with the operation. */ + ARM_MATH_NANINF = -4, /**< Not-a-number (NaN) or infinity is generated */ + ARM_MATH_SINGULAR = -5, /**< Generated by matrix inversion if the input matrix is singular and cannot be inverted. */ + ARM_MATH_TEST_FAILURE = -6 /**< Test Failed */ + } arm_status; + + /** + * @brief 8-bit fractional data type in 1.7 format. + */ + typedef int8_t q7_t; + + /** + * @brief 16-bit fractional data type in 1.15 format. + */ + typedef int16_t q15_t; + + /** + * @brief 32-bit fractional data type in 1.31 format. + */ + typedef int32_t q31_t; + + /** + * @brief 64-bit fractional data type in 1.63 format. + */ + typedef int64_t q63_t; + + /** + * @brief 32-bit floating-point type definition. + */ + typedef float float32_t; + + /** + * @brief 64-bit floating-point type definition. + */ + typedef double float64_t; + + /** + * @brief definition to read/write two 16 bit values. + */ +#define __SIMD32(addr) (*(int32_t **) & (addr)) + +#if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0) + /** + * @brief definition to pack two 16 bit values. + */ +#define __PKHBT(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0x0000FFFF) | \ + (((int32_t)(ARG2) << ARG3) & (int32_t)0xFFFF0000) ) + +#endif + + + /** + * @brief definition to pack four 8 bit values. + */ +#ifndef ARM_MATH_BIG_ENDIAN + +#define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v0) << 0) & (int32_t)0x000000FF) | \ + (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \ + (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | \ + (((int32_t)(v3) << 24) & (int32_t)0xFF000000) ) +#else + +#define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v3) << 0) & (int32_t)0x000000FF) | \ + (((int32_t)(v2) << 8) & (int32_t)0x0000FF00) | \ + (((int32_t)(v1) << 16) & (int32_t)0x00FF0000) | \ + (((int32_t)(v0) << 24) & (int32_t)0xFF000000) ) + +#endif + + + /** + * @brief Clips Q63 to Q31 values. + */ + __STATIC_INLINE q31_t clip_q63_to_q31( + q63_t x) + { + return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ? + ((0x7FFFFFFF ^ ((q31_t) (x >> 63)))) : (q31_t) x; + } + + /** + * @brief Clips Q63 to Q15 values. + */ + __STATIC_INLINE q15_t clip_q63_to_q15( + q63_t x) + { + return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ? + ((0x7FFF ^ ((q15_t) (x >> 63)))) : (q15_t) (x >> 15); + } + + /** + * @brief Clips Q31 to Q7 values. + */ + __STATIC_INLINE q7_t clip_q31_to_q7( + q31_t x) + { + return ((q31_t) (x >> 24) != ((q31_t) x >> 23)) ? + ((0x7F ^ ((q7_t) (x >> 31)))) : (q7_t) x; + } + + /** + * @brief Clips Q31 to Q15 values. + */ + __STATIC_INLINE q15_t clip_q31_to_q15( + q31_t x) + { + return ((q31_t) (x >> 16) != ((q31_t) x >> 15)) ? + ((0x7FFF ^ ((q15_t) (x >> 31)))) : (q15_t) x; + } + + /** + * @brief Multiplies 32 X 64 and returns 32 bit result in 2.30 format. + */ + + __STATIC_INLINE q63_t mult32x64( + q63_t x, + q31_t y) + { + return ((((q63_t) (x & 0x00000000FFFFFFFF) * y) >> 32) + + (((q63_t) (x >> 32) * y))); + } + + +#if defined (ARM_MATH_CM0) && defined ( __CC_ARM ) +#define __CLZ __clz +#endif + +#if defined (ARM_MATH_CM0) && defined ( __TASKING__ ) +/* No need to redefine __CLZ */ +#endif + +#if defined (ARM_MATH_CM0) && ((defined (__ICCARM__)) ||(defined (__GNUC__)) ) + + __STATIC_INLINE uint32_t __CLZ(q31_t data); + + + __STATIC_INLINE uint32_t __CLZ(q31_t data) + { + uint32_t count = 0; + uint32_t mask = 0x80000000; + + while((data & mask) == 0) + { + count += 1u; + mask = mask >> 1u; + } + + return(count); + + } + +#endif + + /** + * @brief Function to Calculates 1/in(reciprocal) value of Q31 Data type. + */ + + __STATIC_INLINE uint32_t arm_recip_q31( + q31_t in, + q31_t * dst, + q31_t * pRecipTable) + { + + uint32_t out, tempVal; + uint32_t index, i; + uint32_t signBits; + + if(in > 0) + { + signBits = __CLZ(in) - 1; + } + else + { + signBits = __CLZ(-in) - 1; + } + + /* Convert input sample to 1.31 format */ + in = in << signBits; + + /* calculation of index for initial approximated Val */ + index = (uint32_t) (in >> 24u); + index = (index & INDEX_MASK); + + /* 1.31 with exp 1 */ + out = pRecipTable[index]; + + /* calculation of reciprocal value */ + /* running approximation for two iterations */ + for (i = 0u; i < 2u; i++) + { + tempVal = (q31_t) (((q63_t) in * out) >> 31u); + tempVal = 0x7FFFFFFF - tempVal; + /* 1.31 with exp 1 */ + //out = (q31_t) (((q63_t) out * tempVal) >> 30u); + out = (q31_t) clip_q63_to_q31(((q63_t) out * tempVal) >> 30u); + } + + /* write output */ + *dst = out; + + /* return num of signbits of out = 1/in value */ + return (signBits + 1u); + + } + + /** + * @brief Function to Calculates 1/in(reciprocal) value of Q15 Data type. + */ + __STATIC_INLINE uint32_t arm_recip_q15( + q15_t in, + q15_t * dst, + q15_t * pRecipTable) + { + + uint32_t out = 0, tempVal = 0; + uint32_t index = 0, i = 0; + uint32_t signBits = 0; + + if(in > 0) + { + signBits = __CLZ(in) - 17; + } + else + { + signBits = __CLZ(-in) - 17; + } + + /* Convert input sample to 1.15 format */ + in = in << signBits; + + /* calculation of index for initial approximated Val */ + index = in >> 8; + index = (index & INDEX_MASK); + + /* 1.15 with exp 1 */ + out = pRecipTable[index]; + + /* calculation of reciprocal value */ + /* running approximation for two iterations */ + for (i = 0; i < 2; i++) + { + tempVal = (q15_t) (((q31_t) in * out) >> 15); + tempVal = 0x7FFF - tempVal; + /* 1.15 with exp 1 */ + out = (q15_t) (((q31_t) out * tempVal) >> 14); + } + + /* write output */ + *dst = out; + + /* return num of signbits of out = 1/in value */ + return (signBits + 1); + + } + + + /* + * @brief C custom defined intrinisic function for only M0 processors + */ +#if defined(ARM_MATH_CM0) + + __STATIC_INLINE q31_t __SSAT( + q31_t x, + uint32_t y) + { + int32_t posMax, negMin; + uint32_t i; + + posMax = 1; + for (i = 0; i < (y - 1); i++) + { + posMax = posMax * 2; + } + + if(x > 0) + { + posMax = (posMax - 1); + + if(x > posMax) + { + x = posMax; + } + } + else + { + negMin = -posMax; + + if(x < negMin) + { + x = negMin; + } + } + return (x); + + + } + +#endif /* end of ARM_MATH_CM0 */ + + + + /* + * @brief C custom defined intrinsic function for M3 and M0 processors + */ +#if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0) + + /* + * @brief C custom defined QADD8 for M3 and M0 processors + */ + __STATIC_INLINE q31_t __QADD8( + q31_t x, + q31_t y) + { + + q31_t sum; + q7_t r, s, t, u; + + r = (char) x; + s = (char) y; + + r = __SSAT((q31_t) (r + s), 8); + s = __SSAT(((q31_t) (((x << 16) >> 24) + ((y << 16) >> 24))), 8); + t = __SSAT(((q31_t) (((x << 8) >> 24) + ((y << 8) >> 24))), 8); + u = __SSAT(((q31_t) ((x >> 24) + (y >> 24))), 8); + + sum = (((q31_t) u << 24) & 0xFF000000) | (((q31_t) t << 16) & 0x00FF0000) | + (((q31_t) s << 8) & 0x0000FF00) | (r & 0x000000FF); + + return sum; + + } + + /* + * @brief C custom defined QSUB8 for M3 and M0 processors + */ + __STATIC_INLINE q31_t __QSUB8( + q31_t x, + q31_t y) + { + + q31_t sum; + q31_t r, s, t, u; + + r = (char) x; + s = (char) y; + + r = __SSAT((r - s), 8); + s = __SSAT(((q31_t) (((x << 16) >> 24) - ((y << 16) >> 24))), 8) << 8; + t = __SSAT(((q31_t) (((x << 8) >> 24) - ((y << 8) >> 24))), 8) << 16; + u = __SSAT(((q31_t) ((x >> 24) - (y >> 24))), 8) << 24; + + sum = + (u & 0xFF000000) | (t & 0x00FF0000) | (s & 0x0000FF00) | (r & 0x000000FF); + + return sum; + } + + /* + * @brief C custom defined QADD16 for M3 and M0 processors + */ + + /* + * @brief C custom defined QADD16 for M3 and M0 processors + */ + __STATIC_INLINE q31_t __QADD16( + q31_t x, + q31_t y) + { + + q31_t sum; + q31_t r, s; + + r = (short) x; + s = (short) y; + + r = __SSAT(r + s, 16); + s = __SSAT(((q31_t) ((x >> 16) + (y >> 16))), 16) << 16; + + sum = (s & 0xFFFF0000) | (r & 0x0000FFFF); + + return sum; + + } + + /* + * @brief C custom defined SHADD16 for M3 and M0 processors + */ + __STATIC_INLINE q31_t __SHADD16( + q31_t x, + q31_t y) + { + + q31_t sum; + q31_t r, s; + + r = (short) x; + s = (short) y; + + r = ((r >> 1) + (s >> 1)); + s = ((q31_t) ((x >> 17) + (y >> 17))) << 16; + + sum = (s & 0xFFFF0000) | (r & 0x0000FFFF); + + return sum; + + } + + /* + * @brief C custom defined QSUB16 for M3 and M0 processors + */ + __STATIC_INLINE q31_t __QSUB16( + q31_t x, + q31_t y) + { + + q31_t sum; + q31_t r, s; + + r = (short) x; + s = (short) y; + + r = __SSAT(r - s, 16); + s = __SSAT(((q31_t) ((x >> 16) - (y >> 16))), 16) << 16; + + sum = (s & 0xFFFF0000) | (r & 0x0000FFFF); + + return sum; + } + + /* + * @brief C custom defined SHSUB16 for M3 and M0 processors + */ + __STATIC_INLINE q31_t __SHSUB16( + q31_t x, + q31_t y) + { + + q31_t diff; + q31_t r, s; + + r = (short) x; + s = (short) y; + + r = ((r >> 1) - (s >> 1)); + s = (((x >> 17) - (y >> 17)) << 16); + + diff = (s & 0xFFFF0000) | (r & 0x0000FFFF); + + return diff; + } + + /* + * @brief C custom defined QASX for M3 and M0 processors + */ + __STATIC_INLINE q31_t __QASX( + q31_t x, + q31_t y) + { + + q31_t sum = 0; + + sum = ((sum + clip_q31_to_q15((q31_t) ((short) (x >> 16) + (short) y))) << 16) + + clip_q31_to_q15((q31_t) ((short) x - (short) (y >> 16))); + + return sum; + } + + /* + * @brief C custom defined SHASX for M3 and M0 processors + */ + __STATIC_INLINE q31_t __SHASX( + q31_t x, + q31_t y) + { + + q31_t sum; + q31_t r, s; + + r = (short) x; + s = (short) y; + + r = ((r >> 1) - (y >> 17)); + s = (((x >> 17) + (s >> 1)) << 16); + + sum = (s & 0xFFFF0000) | (r & 0x0000FFFF); + + return sum; + } + + + /* + * @brief C custom defined QSAX for M3 and M0 processors + */ + __STATIC_INLINE q31_t __QSAX( + q31_t x, + q31_t y) + { + + q31_t sum = 0; + + sum = ((sum + clip_q31_to_q15((q31_t) ((short) (x >> 16) - (short) y))) << 16) + + clip_q31_to_q15((q31_t) ((short) x + (short) (y >> 16))); + + return sum; + } + + /* + * @brief C custom defined SHSAX for M3 and M0 processors + */ + __STATIC_INLINE q31_t __SHSAX( + q31_t x, + q31_t y) + { + + q31_t sum; + q31_t r, s; + + r = (short) x; + s = (short) y; + + r = ((r >> 1) + (y >> 17)); + s = (((x >> 17) - (s >> 1)) << 16); + + sum = (s & 0xFFFF0000) | (r & 0x0000FFFF); + + return sum; + } + + /* + * @brief C custom defined SMUSDX for M3 and M0 processors + */ + __STATIC_INLINE q31_t __SMUSDX( + q31_t x, + q31_t y) + { + + return ((q31_t)(((short) x * (short) (y >> 16)) - + ((short) (x >> 16) * (short) y))); + } + + /* + * @brief C custom defined SMUADX for M3 and M0 processors + */ + __STATIC_INLINE q31_t __SMUADX( + q31_t x, + q31_t y) + { + + return ((q31_t)(((short) x * (short) (y >> 16)) + + ((short) (x >> 16) * (short) y))); + } + + /* + * @brief C custom defined QADD for M3 and M0 processors + */ + __STATIC_INLINE q31_t __QADD( + q31_t x, + q31_t y) + { + return clip_q63_to_q31((q63_t) x + y); + } + + /* + * @brief C custom defined QSUB for M3 and M0 processors + */ + __STATIC_INLINE q31_t __QSUB( + q31_t x, + q31_t y) + { + return clip_q63_to_q31((q63_t) x - y); + } + + /* + * @brief C custom defined SMLAD for M3 and M0 processors + */ + __STATIC_INLINE q31_t __SMLAD( + q31_t x, + q31_t y, + q31_t sum) + { + + return (sum + ((short) (x >> 16) * (short) (y >> 16)) + + ((short) x * (short) y)); + } + + /* + * @brief C custom defined SMLADX for M3 and M0 processors + */ + __STATIC_INLINE q31_t __SMLADX( + q31_t x, + q31_t y, + q31_t sum) + { + + return (sum + ((short) (x >> 16) * (short) (y)) + + ((short) x * (short) (y >> 16))); + } + + /* + * @brief C custom defined SMLSDX for M3 and M0 processors + */ + __STATIC_INLINE q31_t __SMLSDX( + q31_t x, + q31_t y, + q31_t sum) + { + + return (sum - ((short) (x >> 16) * (short) (y)) + + ((short) x * (short) (y >> 16))); + } + + /* + * @brief C custom defined SMLALD for M3 and M0 processors + */ + __STATIC_INLINE q63_t __SMLALD( + q31_t x, + q31_t y, + q63_t sum) + { + + return (sum + ((short) (x >> 16) * (short) (y >> 16)) + + ((short) x * (short) y)); + } + + /* + * @brief C custom defined SMLALDX for M3 and M0 processors + */ + __STATIC_INLINE q63_t __SMLALDX( + q31_t x, + q31_t y, + q63_t sum) + { + + return (sum + ((short) (x >> 16) * (short) y)) + + ((short) x * (short) (y >> 16)); + } + + /* + * @brief C custom defined SMUAD for M3 and M0 processors + */ + __STATIC_INLINE q31_t __SMUAD( + q31_t x, + q31_t y) + { + + return (((x >> 16) * (y >> 16)) + + (((x << 16) >> 16) * ((y << 16) >> 16))); + } + + /* + * @brief C custom defined SMUSD for M3 and M0 processors + */ + __STATIC_INLINE q31_t __SMUSD( + q31_t x, + q31_t y) + { + + return (-((x >> 16) * (y >> 16)) + + (((x << 16) >> 16) * ((y << 16) >> 16))); + } + + + + +#endif /* (ARM_MATH_CM3) || defined (ARM_MATH_CM0) */ + + + /** + * @brief Instance structure for the Q7 FIR filter. + */ + typedef struct + { + uint16_t numTaps; /**< number of filter coefficients in the filter. */ + q7_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ + } arm_fir_instance_q7; + + /** + * @brief Instance structure for the Q15 FIR filter. + */ + typedef struct + { + uint16_t numTaps; /**< number of filter coefficients in the filter. */ + q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ + } arm_fir_instance_q15; + + /** + * @brief Instance structure for the Q31 FIR filter. + */ + typedef struct + { + uint16_t numTaps; /**< number of filter coefficients in the filter. */ + q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ + } arm_fir_instance_q31; + + /** + * @brief Instance structure for the floating-point FIR filter. + */ + typedef struct + { + uint16_t numTaps; /**< number of filter coefficients in the filter. */ + float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ + } arm_fir_instance_f32; + + + /** + * @brief Processing function for the Q7 FIR filter. + * @param[in] *S points to an instance of the Q7 FIR filter structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + * @return none. + */ + void arm_fir_q7( + const arm_fir_instance_q7 * S, + q7_t * pSrc, + q7_t * pDst, + uint32_t blockSize); + + + /** + * @brief Initialization function for the Q7 FIR filter. + * @param[in,out] *S points to an instance of the Q7 FIR structure. + * @param[in] numTaps Number of filter coefficients in the filter. + * @param[in] *pCoeffs points to the filter coefficients. + * @param[in] *pState points to the state buffer. + * @param[in] blockSize number of samples that are processed. + * @return none + */ + void arm_fir_init_q7( + arm_fir_instance_q7 * S, + uint16_t numTaps, + q7_t * pCoeffs, + q7_t * pState, + uint32_t blockSize); + + + /** + * @brief Processing function for the Q15 FIR filter. + * @param[in] *S points to an instance of the Q15 FIR structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + * @return none. + */ + void arm_fir_q15( + const arm_fir_instance_q15 * S, + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + /** + * @brief Processing function for the fast Q15 FIR filter for Cortex-M3 and Cortex-M4. + * @param[in] *S points to an instance of the Q15 FIR filter structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + * @return none. + */ + void arm_fir_fast_q15( + const arm_fir_instance_q15 * S, + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + /** + * @brief Initialization function for the Q15 FIR filter. + * @param[in,out] *S points to an instance of the Q15 FIR filter structure. + * @param[in] numTaps Number of filter coefficients in the filter. Must be even and greater than or equal to 4. + * @param[in] *pCoeffs points to the filter coefficients. + * @param[in] *pState points to the state buffer. + * @param[in] blockSize number of samples that are processed at a time. + * @return The function returns ARM_MATH_SUCCESS if initialization was successful or ARM_MATH_ARGUMENT_ERROR if + * numTaps is not a supported value. + */ + + arm_status arm_fir_init_q15( + arm_fir_instance_q15 * S, + uint16_t numTaps, + q15_t * pCoeffs, + q15_t * pState, + uint32_t blockSize); + + /** + * @brief Processing function for the Q31 FIR filter. + * @param[in] *S points to an instance of the Q31 FIR filter structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + * @return none. + */ + void arm_fir_q31( + const arm_fir_instance_q31 * S, + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + /** + * @brief Processing function for the fast Q31 FIR filter for Cortex-M3 and Cortex-M4. + * @param[in] *S points to an instance of the Q31 FIR structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + * @return none. + */ + void arm_fir_fast_q31( + const arm_fir_instance_q31 * S, + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + /** + * @brief Initialization function for the Q31 FIR filter. + * @param[in,out] *S points to an instance of the Q31 FIR structure. + * @param[in] numTaps Number of filter coefficients in the filter. + * @param[in] *pCoeffs points to the filter coefficients. + * @param[in] *pState points to the state buffer. + * @param[in] blockSize number of samples that are processed at a time. + * @return none. + */ + void arm_fir_init_q31( + arm_fir_instance_q31 * S, + uint16_t numTaps, + q31_t * pCoeffs, + q31_t * pState, + uint32_t blockSize); + + /** + * @brief Processing function for the floating-point FIR filter. + * @param[in] *S points to an instance of the floating-point FIR structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + * @return none. + */ + void arm_fir_f32( + const arm_fir_instance_f32 * S, + float32_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + /** + * @brief Initialization function for the floating-point FIR filter. + * @param[in,out] *S points to an instance of the floating-point FIR filter structure. + * @param[in] numTaps Number of filter coefficients in the filter. + * @param[in] *pCoeffs points to the filter coefficients. + * @param[in] *pState points to the state buffer. + * @param[in] blockSize number of samples that are processed at a time. + * @return none. + */ + void arm_fir_init_f32( + arm_fir_instance_f32 * S, + uint16_t numTaps, + float32_t * pCoeffs, + float32_t * pState, + uint32_t blockSize); + + + /** + * @brief Instance structure for the Q15 Biquad cascade filter. + */ + typedef struct + { + int8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ + q15_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ + q15_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ + int8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ + + } arm_biquad_casd_df1_inst_q15; + + + /** + * @brief Instance structure for the Q31 Biquad cascade filter. + */ + typedef struct + { + uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ + q31_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ + q31_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ + uint8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ + + } arm_biquad_casd_df1_inst_q31; + + /** + * @brief Instance structure for the floating-point Biquad cascade filter. + */ + typedef struct + { + uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ + float32_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ + float32_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ + + + } arm_biquad_casd_df1_inst_f32; + + + + /** + * @brief Processing function for the Q15 Biquad cascade filter. + * @param[in] *S points to an instance of the Q15 Biquad cascade structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + * @return none. + */ + + void arm_biquad_cascade_df1_q15( + const arm_biquad_casd_df1_inst_q15 * S, + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + /** + * @brief Initialization function for the Q15 Biquad cascade filter. + * @param[in,out] *S points to an instance of the Q15 Biquad cascade structure. + * @param[in] numStages number of 2nd order stages in the filter. + * @param[in] *pCoeffs points to the filter coefficients. + * @param[in] *pState points to the state buffer. + * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format + * @return none + */ + + void arm_biquad_cascade_df1_init_q15( + arm_biquad_casd_df1_inst_q15 * S, + uint8_t numStages, + q15_t * pCoeffs, + q15_t * pState, + int8_t postShift); + + + /** + * @brief Fast but less precise processing function for the Q15 Biquad cascade filter for Cortex-M3 and Cortex-M4. + * @param[in] *S points to an instance of the Q15 Biquad cascade structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + * @return none. + */ + + void arm_biquad_cascade_df1_fast_q15( + const arm_biquad_casd_df1_inst_q15 * S, + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + + /** + * @brief Processing function for the Q31 Biquad cascade filter + * @param[in] *S points to an instance of the Q31 Biquad cascade structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + * @return none. + */ + + void arm_biquad_cascade_df1_q31( + const arm_biquad_casd_df1_inst_q31 * S, + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + /** + * @brief Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-M4. + * @param[in] *S points to an instance of the Q31 Biquad cascade structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + * @return none. + */ + + void arm_biquad_cascade_df1_fast_q31( + const arm_biquad_casd_df1_inst_q31 * S, + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + /** + * @brief Initialization function for the Q31 Biquad cascade filter. + * @param[in,out] *S points to an instance of the Q31 Biquad cascade structure. + * @param[in] numStages number of 2nd order stages in the filter. + * @param[in] *pCoeffs points to the filter coefficients. + * @param[in] *pState points to the state buffer. + * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format + * @return none + */ + + void arm_biquad_cascade_df1_init_q31( + arm_biquad_casd_df1_inst_q31 * S, + uint8_t numStages, + q31_t * pCoeffs, + q31_t * pState, + int8_t postShift); + + /** + * @brief Processing function for the floating-point Biquad cascade filter. + * @param[in] *S points to an instance of the floating-point Biquad cascade structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + * @return none. + */ + + void arm_biquad_cascade_df1_f32( + const arm_biquad_casd_df1_inst_f32 * S, + float32_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + /** + * @brief Initialization function for the floating-point Biquad cascade filter. + * @param[in,out] *S points to an instance of the floating-point Biquad cascade structure. + * @param[in] numStages number of 2nd order stages in the filter. + * @param[in] *pCoeffs points to the filter coefficients. + * @param[in] *pState points to the state buffer. + * @return none + */ + + void arm_biquad_cascade_df1_init_f32( + arm_biquad_casd_df1_inst_f32 * S, + uint8_t numStages, + float32_t * pCoeffs, + float32_t * pState); + + + /** + * @brief Instance structure for the floating-point matrix structure. + */ + + typedef struct + { + uint16_t numRows; /**< number of rows of the matrix. */ + uint16_t numCols; /**< number of columns of the matrix. */ + float32_t *pData; /**< points to the data of the matrix. */ + } arm_matrix_instance_f32; + + /** + * @brief Instance structure for the Q15 matrix structure. + */ + + typedef struct + { + uint16_t numRows; /**< number of rows of the matrix. */ + uint16_t numCols; /**< number of columns of the matrix. */ + q15_t *pData; /**< points to the data of the matrix. */ + + } arm_matrix_instance_q15; + + /** + * @brief Instance structure for the Q31 matrix structure. + */ + + typedef struct + { + uint16_t numRows; /**< number of rows of the matrix. */ + uint16_t numCols; /**< number of columns of the matrix. */ + q31_t *pData; /**< points to the data of the matrix. */ + + } arm_matrix_instance_q31; + + + + /** + * @brief Floating-point matrix addition. + * @param[in] *pSrcA points to the first input matrix structure + * @param[in] *pSrcB points to the second input matrix structure + * @param[out] *pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + + arm_status arm_mat_add_f32( + const arm_matrix_instance_f32 * pSrcA, + const arm_matrix_instance_f32 * pSrcB, + arm_matrix_instance_f32 * pDst); + + /** + * @brief Q15 matrix addition. + * @param[in] *pSrcA points to the first input matrix structure + * @param[in] *pSrcB points to the second input matrix structure + * @param[out] *pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + + arm_status arm_mat_add_q15( + const arm_matrix_instance_q15 * pSrcA, + const arm_matrix_instance_q15 * pSrcB, + arm_matrix_instance_q15 * pDst); + + /** + * @brief Q31 matrix addition. + * @param[in] *pSrcA points to the first input matrix structure + * @param[in] *pSrcB points to the second input matrix structure + * @param[out] *pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + + arm_status arm_mat_add_q31( + const arm_matrix_instance_q31 * pSrcA, + const arm_matrix_instance_q31 * pSrcB, + arm_matrix_instance_q31 * pDst); + + + /** + * @brief Floating-point matrix transpose. + * @param[in] *pSrc points to the input matrix + * @param[out] *pDst points to the output matrix + * @return The function returns either ARM_MATH_SIZE_MISMATCH + * or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + + arm_status arm_mat_trans_f32( + const arm_matrix_instance_f32 * pSrc, + arm_matrix_instance_f32 * pDst); + + + /** + * @brief Q15 matrix transpose. + * @param[in] *pSrc points to the input matrix + * @param[out] *pDst points to the output matrix + * @return The function returns either ARM_MATH_SIZE_MISMATCH + * or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + + arm_status arm_mat_trans_q15( + const arm_matrix_instance_q15 * pSrc, + arm_matrix_instance_q15 * pDst); + + /** + * @brief Q31 matrix transpose. + * @param[in] *pSrc points to the input matrix + * @param[out] *pDst points to the output matrix + * @return The function returns either ARM_MATH_SIZE_MISMATCH + * or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + + arm_status arm_mat_trans_q31( + const arm_matrix_instance_q31 * pSrc, + arm_matrix_instance_q31 * pDst); + + + /** + * @brief Floating-point matrix multiplication + * @param[in] *pSrcA points to the first input matrix structure + * @param[in] *pSrcB points to the second input matrix structure + * @param[out] *pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + + arm_status arm_mat_mult_f32( + const arm_matrix_instance_f32 * pSrcA, + const arm_matrix_instance_f32 * pSrcB, + arm_matrix_instance_f32 * pDst); + + /** + * @brief Q15 matrix multiplication + * @param[in] *pSrcA points to the first input matrix structure + * @param[in] *pSrcB points to the second input matrix structure + * @param[out] *pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + + arm_status arm_mat_mult_q15( + const arm_matrix_instance_q15 * pSrcA, + const arm_matrix_instance_q15 * pSrcB, + arm_matrix_instance_q15 * pDst, + q15_t * pState); + + /** + * @brief Q15 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 + * @param[in] *pSrcA points to the first input matrix structure + * @param[in] *pSrcB points to the second input matrix structure + * @param[out] *pDst points to output matrix structure + * @param[in] *pState points to the array for storing intermediate results + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + + arm_status arm_mat_mult_fast_q15( + const arm_matrix_instance_q15 * pSrcA, + const arm_matrix_instance_q15 * pSrcB, + arm_matrix_instance_q15 * pDst, + q15_t * pState); + + /** + * @brief Q31 matrix multiplication + * @param[in] *pSrcA points to the first input matrix structure + * @param[in] *pSrcB points to the second input matrix structure + * @param[out] *pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + + arm_status arm_mat_mult_q31( + const arm_matrix_instance_q31 * pSrcA, + const arm_matrix_instance_q31 * pSrcB, + arm_matrix_instance_q31 * pDst); + + /** + * @brief Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 + * @param[in] *pSrcA points to the first input matrix structure + * @param[in] *pSrcB points to the second input matrix structure + * @param[out] *pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + + arm_status arm_mat_mult_fast_q31( + const arm_matrix_instance_q31 * pSrcA, + const arm_matrix_instance_q31 * pSrcB, + arm_matrix_instance_q31 * pDst); + + + /** + * @brief Floating-point matrix subtraction + * @param[in] *pSrcA points to the first input matrix structure + * @param[in] *pSrcB points to the second input matrix structure + * @param[out] *pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + + arm_status arm_mat_sub_f32( + const arm_matrix_instance_f32 * pSrcA, + const arm_matrix_instance_f32 * pSrcB, + arm_matrix_instance_f32 * pDst); + + /** + * @brief Q15 matrix subtraction + * @param[in] *pSrcA points to the first input matrix structure + * @param[in] *pSrcB points to the second input matrix structure + * @param[out] *pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + + arm_status arm_mat_sub_q15( + const arm_matrix_instance_q15 * pSrcA, + const arm_matrix_instance_q15 * pSrcB, + arm_matrix_instance_q15 * pDst); + + /** + * @brief Q31 matrix subtraction + * @param[in] *pSrcA points to the first input matrix structure + * @param[in] *pSrcB points to the second input matrix structure + * @param[out] *pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + + arm_status arm_mat_sub_q31( + const arm_matrix_instance_q31 * pSrcA, + const arm_matrix_instance_q31 * pSrcB, + arm_matrix_instance_q31 * pDst); + + /** + * @brief Floating-point matrix scaling. + * @param[in] *pSrc points to the input matrix + * @param[in] scale scale factor + * @param[out] *pDst points to the output matrix + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + + arm_status arm_mat_scale_f32( + const arm_matrix_instance_f32 * pSrc, + float32_t scale, + arm_matrix_instance_f32 * pDst); + + /** + * @brief Q15 matrix scaling. + * @param[in] *pSrc points to input matrix + * @param[in] scaleFract fractional portion of the scale factor + * @param[in] shift number of bits to shift the result by + * @param[out] *pDst points to output matrix + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + + arm_status arm_mat_scale_q15( + const arm_matrix_instance_q15 * pSrc, + q15_t scaleFract, + int32_t shift, + arm_matrix_instance_q15 * pDst); + + /** + * @brief Q31 matrix scaling. + * @param[in] *pSrc points to input matrix + * @param[in] scaleFract fractional portion of the scale factor + * @param[in] shift number of bits to shift the result by + * @param[out] *pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + + arm_status arm_mat_scale_q31( + const arm_matrix_instance_q31 * pSrc, + q31_t scaleFract, + int32_t shift, + arm_matrix_instance_q31 * pDst); + + + /** + * @brief Q31 matrix initialization. + * @param[in,out] *S points to an instance of the floating-point matrix structure. + * @param[in] nRows number of rows in the matrix. + * @param[in] nColumns number of columns in the matrix. + * @param[in] *pData points to the matrix data array. + * @return none + */ + + void arm_mat_init_q31( + arm_matrix_instance_q31 * S, + uint16_t nRows, + uint16_t nColumns, + q31_t *pData); + + /** + * @brief Q15 matrix initialization. + * @param[in,out] *S points to an instance of the floating-point matrix structure. + * @param[in] nRows number of rows in the matrix. + * @param[in] nColumns number of columns in the matrix. + * @param[in] *pData points to the matrix data array. + * @return none + */ + + void arm_mat_init_q15( + arm_matrix_instance_q15 * S, + uint16_t nRows, + uint16_t nColumns, + q15_t *pData); + + /** + * @brief Floating-point matrix initialization. + * @param[in,out] *S points to an instance of the floating-point matrix structure. + * @param[in] nRows number of rows in the matrix. + * @param[in] nColumns number of columns in the matrix. + * @param[in] *pData points to the matrix data array. + * @return none + */ + + void arm_mat_init_f32( + arm_matrix_instance_f32 * S, + uint16_t nRows, + uint16_t nColumns, + float32_t *pData); + + + + /** + * @brief Instance structure for the Q15 PID Control. + */ + typedef struct + { + q15_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ + #ifdef ARM_MATH_CM0 + q15_t A1; + q15_t A2; + #else + q31_t A1; /**< The derived gain A1 = -Kp - 2Kd | Kd.*/ + #endif + q15_t state[3]; /**< The state array of length 3. */ + q15_t Kp; /**< The proportional gain. */ + q15_t Ki; /**< The integral gain. */ + q15_t Kd; /**< The derivative gain. */ + } arm_pid_instance_q15; + + /** + * @brief Instance structure for the Q31 PID Control. + */ + typedef struct + { + q31_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ + q31_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ + q31_t A2; /**< The derived gain, A2 = Kd . */ + q31_t state[3]; /**< The state array of length 3. */ + q31_t Kp; /**< The proportional gain. */ + q31_t Ki; /**< The integral gain. */ + q31_t Kd; /**< The derivative gain. */ + + } arm_pid_instance_q31; + + /** + * @brief Instance structure for the floating-point PID Control. + */ + typedef struct + { + float32_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ + float32_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ + float32_t A2; /**< The derived gain, A2 = Kd . */ + float32_t state[3]; /**< The state array of length 3. */ + float32_t Kp; /**< The proportional gain. */ + float32_t Ki; /**< The integral gain. */ + float32_t Kd; /**< The derivative gain. */ + } arm_pid_instance_f32; + + + + /** + * @brief Initialization function for the floating-point PID Control. + * @param[in,out] *S points to an instance of the PID structure. + * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. + * @return none. + */ + void arm_pid_init_f32( + arm_pid_instance_f32 * S, + int32_t resetStateFlag); + + /** + * @brief Reset function for the floating-point PID Control. + * @param[in,out] *S is an instance of the floating-point PID Control structure + * @return none + */ + void arm_pid_reset_f32( + arm_pid_instance_f32 * S); + + + /** + * @brief Initialization function for the Q31 PID Control. + * @param[in,out] *S points to an instance of the Q15 PID structure. + * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. + * @return none. + */ + void arm_pid_init_q31( + arm_pid_instance_q31 * S, + int32_t resetStateFlag); + + + /** + * @brief Reset function for the Q31 PID Control. + * @param[in,out] *S points to an instance of the Q31 PID Control structure + * @return none + */ + + void arm_pid_reset_q31( + arm_pid_instance_q31 * S); + + /** + * @brief Initialization function for the Q15 PID Control. + * @param[in,out] *S points to an instance of the Q15 PID structure. + * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. + * @return none. + */ + void arm_pid_init_q15( + arm_pid_instance_q15 * S, + int32_t resetStateFlag); + + /** + * @brief Reset function for the Q15 PID Control. + * @param[in,out] *S points to an instance of the q15 PID Control structure + * @return none + */ + void arm_pid_reset_q15( + arm_pid_instance_q15 * S); + + + /** + * @brief Instance structure for the floating-point Linear Interpolate function. + */ + typedef struct + { + uint32_t nValues; /**< nValues */ + float32_t x1; /**< x1 */ + float32_t xSpacing; /**< xSpacing */ + float32_t *pYData; /**< pointer to the table of Y values */ + } arm_linear_interp_instance_f32; + + /** + * @brief Instance structure for the floating-point bilinear interpolation function. + */ + + typedef struct + { + uint16_t numRows; /**< number of rows in the data table. */ + uint16_t numCols; /**< number of columns in the data table. */ + float32_t *pData; /**< points to the data table. */ + } arm_bilinear_interp_instance_f32; + + /** + * @brief Instance structure for the Q31 bilinear interpolation function. + */ + + typedef struct + { + uint16_t numRows; /**< number of rows in the data table. */ + uint16_t numCols; /**< number of columns in the data table. */ + q31_t *pData; /**< points to the data table. */ + } arm_bilinear_interp_instance_q31; + + /** + * @brief Instance structure for the Q15 bilinear interpolation function. + */ + + typedef struct + { + uint16_t numRows; /**< number of rows in the data table. */ + uint16_t numCols; /**< number of columns in the data table. */ + q15_t *pData; /**< points to the data table. */ + } arm_bilinear_interp_instance_q15; + + /** + * @brief Instance structure for the Q15 bilinear interpolation function. + */ + + typedef struct + { + uint16_t numRows; /**< number of rows in the data table. */ + uint16_t numCols; /**< number of columns in the data table. */ + q7_t *pData; /**< points to the data table. */ + } arm_bilinear_interp_instance_q7; + + + /** + * @brief Q7 vector multiplication. + * @param[in] *pSrcA points to the first input vector + * @param[in] *pSrcB points to the second input vector + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in each vector + * @return none. + */ + + void arm_mult_q7( + q7_t * pSrcA, + q7_t * pSrcB, + q7_t * pDst, + uint32_t blockSize); + + /** + * @brief Q15 vector multiplication. + * @param[in] *pSrcA points to the first input vector + * @param[in] *pSrcB points to the second input vector + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in each vector + * @return none. + */ + + void arm_mult_q15( + q15_t * pSrcA, + q15_t * pSrcB, + q15_t * pDst, + uint32_t blockSize); + + /** + * @brief Q31 vector multiplication. + * @param[in] *pSrcA points to the first input vector + * @param[in] *pSrcB points to the second input vector + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in each vector + * @return none. + */ + + void arm_mult_q31( + q31_t * pSrcA, + q31_t * pSrcB, + q31_t * pDst, + uint32_t blockSize); + + /** + * @brief Floating-point vector multiplication. + * @param[in] *pSrcA points to the first input vector + * @param[in] *pSrcB points to the second input vector + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in each vector + * @return none. + */ + + void arm_mult_f32( + float32_t * pSrcA, + float32_t * pSrcB, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @brief Instance structure for the Q15 CFFT/CIFFT function. + */ + + typedef struct + { + uint16_t fftLen; /**< length of the FFT. */ + uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ + uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ + q15_t *pTwiddle; /**< points to the twiddle factor table. */ + uint16_t *pBitRevTable; /**< points to the bit reversal table. */ + uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ + uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ + } arm_cfft_radix4_instance_q15; + + /** + * @brief Instance structure for the Q31 CFFT/CIFFT function. + */ + + typedef struct + { + uint16_t fftLen; /**< length of the FFT. */ + uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ + uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ + q31_t *pTwiddle; /**< points to the twiddle factor table. */ + uint16_t *pBitRevTable; /**< points to the bit reversal table. */ + uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ + uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ + } arm_cfft_radix4_instance_q31; + + /** + * @brief Instance structure for the floating-point CFFT/CIFFT function. + */ + + typedef struct + { + uint16_t fftLen; /**< length of the FFT. */ + uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ + uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ + float32_t *pTwiddle; /**< points to the twiddle factor table. */ + uint16_t *pBitRevTable; /**< points to the bit reversal table. */ + uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ + uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ + float32_t onebyfftLen; /**< value of 1/fftLen. */ + } arm_cfft_radix4_instance_f32; + + /** + * @brief Processing function for the Q15 CFFT/CIFFT. + * @param[in] *S points to an instance of the Q15 CFFT/CIFFT structure. + * @param[in, out] *pSrc points to the complex data buffer. Processing occurs in-place. + * @return none. + */ + + void arm_cfft_radix4_q15( + const arm_cfft_radix4_instance_q15 * S, + q15_t * pSrc); + + /** + * @brief Initialization function for the Q15 CFFT/CIFFT. + * @param[in,out] *S points to an instance of the Q15 CFFT/CIFFT structure. + * @param[in] fftLen length of the FFT. + * @param[in] ifftFlag flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. + * @param[in] bitReverseFlag flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. + * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if fftLen is not a supported value. + */ + + arm_status arm_cfft_radix4_init_q15( + arm_cfft_radix4_instance_q15 * S, + uint16_t fftLen, + uint8_t ifftFlag, + uint8_t bitReverseFlag); + + /** + * @brief Processing function for the Q31 CFFT/CIFFT. + * @param[in] *S points to an instance of the Q31 CFFT/CIFFT structure. + * @param[in, out] *pSrc points to the complex data buffer. Processing occurs in-place. + * @return none. + */ + + void arm_cfft_radix4_q31( + const arm_cfft_radix4_instance_q31 * S, + q31_t * pSrc); + + /** + * @brief Initialization function for the Q31 CFFT/CIFFT. + * @param[in,out] *S points to an instance of the Q31 CFFT/CIFFT structure. + * @param[in] fftLen length of the FFT. + * @param[in] ifftFlag flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. + * @param[in] bitReverseFlag flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. + * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if fftLen is not a supported value. + */ + + arm_status arm_cfft_radix4_init_q31( + arm_cfft_radix4_instance_q31 * S, + uint16_t fftLen, + uint8_t ifftFlag, + uint8_t bitReverseFlag); + + /** + * @brief Processing function for the floating-point CFFT/CIFFT. + * @param[in] *S points to an instance of the floating-point CFFT/CIFFT structure. + * @param[in, out] *pSrc points to the complex data buffer. Processing occurs in-place. + * @return none. + */ + + void arm_cfft_radix4_f32( + const arm_cfft_radix4_instance_f32 * S, + float32_t * pSrc); + + /** + * @brief Initialization function for the floating-point CFFT/CIFFT. + * @param[in,out] *S points to an instance of the floating-point CFFT/CIFFT structure. + * @param[in] fftLen length of the FFT. + * @param[in] ifftFlag flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. + * @param[in] bitReverseFlag flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. + * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if fftLen is not a supported value. + */ + + arm_status arm_cfft_radix4_init_f32( + arm_cfft_radix4_instance_f32 * S, + uint16_t fftLen, + uint8_t ifftFlag, + uint8_t bitReverseFlag); + + + + /*---------------------------------------------------------------------- + * Internal functions prototypes FFT function + ----------------------------------------------------------------------*/ + + /** + * @brief Core function for the floating-point CFFT butterfly process. + * @param[in, out] *pSrc points to the in-place buffer of floating-point data type. + * @param[in] fftLen length of the FFT. + * @param[in] *pCoef points to the twiddle coefficient buffer. + * @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. + * @return none. + */ + + void arm_radix4_butterfly_f32( + float32_t * pSrc, + uint16_t fftLen, + float32_t * pCoef, + uint16_t twidCoefModifier); + + /** + * @brief Core function for the floating-point CIFFT butterfly process. + * @param[in, out] *pSrc points to the in-place buffer of floating-point data type. + * @param[in] fftLen length of the FFT. + * @param[in] *pCoef points to twiddle coefficient buffer. + * @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. + * @param[in] onebyfftLen value of 1/fftLen. + * @return none. + */ + + void arm_radix4_butterfly_inverse_f32( + float32_t * pSrc, + uint16_t fftLen, + float32_t * pCoef, + uint16_t twidCoefModifier, + float32_t onebyfftLen); + + /** + * @brief In-place bit reversal function. + * @param[in, out] *pSrc points to the in-place buffer of floating-point data type. + * @param[in] fftSize length of the FFT. + * @param[in] bitRevFactor bit reversal modifier that supports different size FFTs with the same bit reversal table. + * @param[in] *pBitRevTab points to the bit reversal table. + * @return none. + */ + + void arm_bitreversal_f32( + float32_t *pSrc, + uint16_t fftSize, + uint16_t bitRevFactor, + uint16_t *pBitRevTab); + + /** + * @brief Core function for the Q31 CFFT butterfly process. + * @param[in, out] *pSrc points to the in-place buffer of Q31 data type. + * @param[in] fftLen length of the FFT. + * @param[in] *pCoef points to twiddle coefficient buffer. + * @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. + * @return none. + */ + + void arm_radix4_butterfly_q31( + q31_t *pSrc, + uint32_t fftLen, + q31_t *pCoef, + uint32_t twidCoefModifier); + + /** + * @brief Core function for the Q31 CIFFT butterfly process. + * @param[in, out] *pSrc points to the in-place buffer of Q31 data type. + * @param[in] fftLen length of the FFT. + * @param[in] *pCoef points to twiddle coefficient buffer. + * @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. + * @return none. + */ + + void arm_radix4_butterfly_inverse_q31( + q31_t * pSrc, + uint32_t fftLen, + q31_t * pCoef, + uint32_t twidCoefModifier); + + /** + * @brief In-place bit reversal function. + * @param[in, out] *pSrc points to the in-place buffer of Q31 data type. + * @param[in] fftLen length of the FFT. + * @param[in] bitRevFactor bit reversal modifier that supports different size FFTs with the same bit reversal table + * @param[in] *pBitRevTab points to bit reversal table. + * @return none. + */ + + void arm_bitreversal_q31( + q31_t * pSrc, + uint32_t fftLen, + uint16_t bitRevFactor, + uint16_t *pBitRevTab); + + /** + * @brief Core function for the Q15 CFFT butterfly process. + * @param[in, out] *pSrc16 points to the in-place buffer of Q15 data type. + * @param[in] fftLen length of the FFT. + * @param[in] *pCoef16 points to twiddle coefficient buffer. + * @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. + * @return none. + */ + + void arm_radix4_butterfly_q15( + q15_t *pSrc16, + uint32_t fftLen, + q15_t *pCoef16, + uint32_t twidCoefModifier); + + /** + * @brief Core function for the Q15 CIFFT butterfly process. + * @param[in, out] *pSrc16 points to the in-place buffer of Q15 data type. + * @param[in] fftLen length of the FFT. + * @param[in] *pCoef16 points to twiddle coefficient buffer. + * @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. + * @return none. + */ + + void arm_radix4_butterfly_inverse_q15( + q15_t *pSrc16, + uint32_t fftLen, + q15_t *pCoef16, + uint32_t twidCoefModifier); + + /** + * @brief In-place bit reversal function. + * @param[in, out] *pSrc points to the in-place buffer of Q15 data type. + * @param[in] fftLen length of the FFT. + * @param[in] bitRevFactor bit reversal modifier that supports different size FFTs with the same bit reversal table + * @param[in] *pBitRevTab points to bit reversal table. + * @return none. + */ + + void arm_bitreversal_q15( + q15_t * pSrc, + uint32_t fftLen, + uint16_t bitRevFactor, + uint16_t *pBitRevTab); + + /** + * @brief Instance structure for the Q15 RFFT/RIFFT function. + */ + + typedef struct + { + uint32_t fftLenReal; /**< length of the real FFT. */ + uint32_t fftLenBy2; /**< length of the complex FFT. */ + uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ + uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ + uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ + q15_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ + q15_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ + arm_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */ + } arm_rfft_instance_q15; + + /** + * @brief Instance structure for the Q31 RFFT/RIFFT function. + */ + + typedef struct + { + uint32_t fftLenReal; /**< length of the real FFT. */ + uint32_t fftLenBy2; /**< length of the complex FFT. */ + uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ + uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ + uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ + q31_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ + q31_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ + arm_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */ + } arm_rfft_instance_q31; + + /** + * @brief Instance structure for the floating-point RFFT/RIFFT function. + */ + + typedef struct + { + uint32_t fftLenReal; /**< length of the real FFT. */ + uint16_t fftLenBy2; /**< length of the complex FFT. */ + uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ + uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ + uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ + float32_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ + float32_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ + arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ + } arm_rfft_instance_f32; + + /** + * @brief Processing function for the Q15 RFFT/RIFFT. + * @param[in] *S points to an instance of the Q15 RFFT/RIFFT structure. + * @param[in] *pSrc points to the input buffer. + * @param[out] *pDst points to the output buffer. + * @return none. + */ + + void arm_rfft_q15( + const arm_rfft_instance_q15 * S, + q15_t * pSrc, + q15_t * pDst); + + /** + * @brief Initialization function for the Q15 RFFT/RIFFT. + * @param[in, out] *S points to an instance of the Q15 RFFT/RIFFT structure. + * @param[in] *S_CFFT points to an instance of the Q15 CFFT/CIFFT structure. + * @param[in] fftLenReal length of the FFT. + * @param[in] ifftFlagR flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. + * @param[in] bitReverseFlag flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. + * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if fftLenReal is not a supported value. + */ + + arm_status arm_rfft_init_q15( + arm_rfft_instance_q15 * S, + arm_cfft_radix4_instance_q15 * S_CFFT, + uint32_t fftLenReal, + uint32_t ifftFlagR, + uint32_t bitReverseFlag); + + /** + * @brief Processing function for the Q31 RFFT/RIFFT. + * @param[in] *S points to an instance of the Q31 RFFT/RIFFT structure. + * @param[in] *pSrc points to the input buffer. + * @param[out] *pDst points to the output buffer. + * @return none. + */ + + void arm_rfft_q31( + const arm_rfft_instance_q31 * S, + q31_t * pSrc, + q31_t * pDst); + + /** + * @brief Initialization function for the Q31 RFFT/RIFFT. + * @param[in, out] *S points to an instance of the Q31 RFFT/RIFFT structure. + * @param[in, out] *S_CFFT points to an instance of the Q31 CFFT/CIFFT structure. + * @param[in] fftLenReal length of the FFT. + * @param[in] ifftFlagR flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. + * @param[in] bitReverseFlag flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. + * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if fftLenReal is not a supported value. + */ + + arm_status arm_rfft_init_q31( + arm_rfft_instance_q31 * S, + arm_cfft_radix4_instance_q31 * S_CFFT, + uint32_t fftLenReal, + uint32_t ifftFlagR, + uint32_t bitReverseFlag); + + /** + * @brief Initialization function for the floating-point RFFT/RIFFT. + * @param[in,out] *S points to an instance of the floating-point RFFT/RIFFT structure. + * @param[in,out] *S_CFFT points to an instance of the floating-point CFFT/CIFFT structure. + * @param[in] fftLenReal length of the FFT. + * @param[in] ifftFlagR flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. + * @param[in] bitReverseFlag flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. + * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if fftLenReal is not a supported value. + */ + + arm_status arm_rfft_init_f32( + arm_rfft_instance_f32 * S, + arm_cfft_radix4_instance_f32 * S_CFFT, + uint32_t fftLenReal, + uint32_t ifftFlagR, + uint32_t bitReverseFlag); + + /** + * @brief Processing function for the floating-point RFFT/RIFFT. + * @param[in] *S points to an instance of the floating-point RFFT/RIFFT structure. + * @param[in] *pSrc points to the input buffer. + * @param[out] *pDst points to the output buffer. + * @return none. + */ + + void arm_rfft_f32( + const arm_rfft_instance_f32 * S, + float32_t * pSrc, + float32_t * pDst); + + /** + * @brief Instance structure for the floating-point DCT4/IDCT4 function. + */ + + typedef struct + { + uint16_t N; /**< length of the DCT4. */ + uint16_t Nby2; /**< half of the length of the DCT4. */ + float32_t normalize; /**< normalizing factor. */ + float32_t *pTwiddle; /**< points to the twiddle factor table. */ + float32_t *pCosFactor; /**< points to the cosFactor table. */ + arm_rfft_instance_f32 *pRfft; /**< points to the real FFT instance. */ + arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ + } arm_dct4_instance_f32; + + /** + * @brief Initialization function for the floating-point DCT4/IDCT4. + * @param[in,out] *S points to an instance of floating-point DCT4/IDCT4 structure. + * @param[in] *S_RFFT points to an instance of floating-point RFFT/RIFFT structure. + * @param[in] *S_CFFT points to an instance of floating-point CFFT/CIFFT structure. + * @param[in] N length of the DCT4. + * @param[in] Nby2 half of the length of the DCT4. + * @param[in] normalize normalizing factor. + * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if fftLenReal is not a supported transform length. + */ + + arm_status arm_dct4_init_f32( + arm_dct4_instance_f32 * S, + arm_rfft_instance_f32 * S_RFFT, + arm_cfft_radix4_instance_f32 * S_CFFT, + uint16_t N, + uint16_t Nby2, + float32_t normalize); + + /** + * @brief Processing function for the floating-point DCT4/IDCT4. + * @param[in] *S points to an instance of the floating-point DCT4/IDCT4 structure. + * @param[in] *pState points to state buffer. + * @param[in,out] *pInlineBuffer points to the in-place input and output buffer. + * @return none. + */ + + void arm_dct4_f32( + const arm_dct4_instance_f32 * S, + float32_t * pState, + float32_t * pInlineBuffer); + + /** + * @brief Instance structure for the Q31 DCT4/IDCT4 function. + */ + + typedef struct + { + uint16_t N; /**< length of the DCT4. */ + uint16_t Nby2; /**< half of the length of the DCT4. */ + q31_t normalize; /**< normalizing factor. */ + q31_t *pTwiddle; /**< points to the twiddle factor table. */ + q31_t *pCosFactor; /**< points to the cosFactor table. */ + arm_rfft_instance_q31 *pRfft; /**< points to the real FFT instance. */ + arm_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */ + } arm_dct4_instance_q31; + + /** + * @brief Initialization function for the Q31 DCT4/IDCT4. + * @param[in,out] *S points to an instance of Q31 DCT4/IDCT4 structure. + * @param[in] *S_RFFT points to an instance of Q31 RFFT/RIFFT structure + * @param[in] *S_CFFT points to an instance of Q31 CFFT/CIFFT structure + * @param[in] N length of the DCT4. + * @param[in] Nby2 half of the length of the DCT4. + * @param[in] normalize normalizing factor. + * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if N is not a supported transform length. + */ + + arm_status arm_dct4_init_q31( + arm_dct4_instance_q31 * S, + arm_rfft_instance_q31 * S_RFFT, + arm_cfft_radix4_instance_q31 * S_CFFT, + uint16_t N, + uint16_t Nby2, + q31_t normalize); + + /** + * @brief Processing function for the Q31 DCT4/IDCT4. + * @param[in] *S points to an instance of the Q31 DCT4 structure. + * @param[in] *pState points to state buffer. + * @param[in,out] *pInlineBuffer points to the in-place input and output buffer. + * @return none. + */ + + void arm_dct4_q31( + const arm_dct4_instance_q31 * S, + q31_t * pState, + q31_t * pInlineBuffer); + + /** + * @brief Instance structure for the Q15 DCT4/IDCT4 function. + */ + + typedef struct + { + uint16_t N; /**< length of the DCT4. */ + uint16_t Nby2; /**< half of the length of the DCT4. */ + q15_t normalize; /**< normalizing factor. */ + q15_t *pTwiddle; /**< points to the twiddle factor table. */ + q15_t *pCosFactor; /**< points to the cosFactor table. */ + arm_rfft_instance_q15 *pRfft; /**< points to the real FFT instance. */ + arm_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */ + } arm_dct4_instance_q15; + + /** + * @brief Initialization function for the Q15 DCT4/IDCT4. + * @param[in,out] *S points to an instance of Q15 DCT4/IDCT4 structure. + * @param[in] *S_RFFT points to an instance of Q15 RFFT/RIFFT structure. + * @param[in] *S_CFFT points to an instance of Q15 CFFT/CIFFT structure. + * @param[in] N length of the DCT4. + * @param[in] Nby2 half of the length of the DCT4. + * @param[in] normalize normalizing factor. + * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if N is not a supported transform length. + */ + + arm_status arm_dct4_init_q15( + arm_dct4_instance_q15 * S, + arm_rfft_instance_q15 * S_RFFT, + arm_cfft_radix4_instance_q15 * S_CFFT, + uint16_t N, + uint16_t Nby2, + q15_t normalize); + + /** + * @brief Processing function for the Q15 DCT4/IDCT4. + * @param[in] *S points to an instance of the Q15 DCT4 structure. + * @param[in] *pState points to state buffer. + * @param[in,out] *pInlineBuffer points to the in-place input and output buffer. + * @return none. + */ + + void arm_dct4_q15( + const arm_dct4_instance_q15 * S, + q15_t * pState, + q15_t * pInlineBuffer); + + /** + * @brief Floating-point vector addition. + * @param[in] *pSrcA points to the first input vector + * @param[in] *pSrcB points to the second input vector + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in each vector + * @return none. + */ + + void arm_add_f32( + float32_t * pSrcA, + float32_t * pSrcB, + float32_t * pDst, + uint32_t blockSize); + + /** + * @brief Q7 vector addition. + * @param[in] *pSrcA points to the first input vector + * @param[in] *pSrcB points to the second input vector + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in each vector + * @return none. + */ + + void arm_add_q7( + q7_t * pSrcA, + q7_t * pSrcB, + q7_t * pDst, + uint32_t blockSize); + + /** + * @brief Q15 vector addition. + * @param[in] *pSrcA points to the first input vector + * @param[in] *pSrcB points to the second input vector + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in each vector + * @return none. + */ + + void arm_add_q15( + q15_t * pSrcA, + q15_t * pSrcB, + q15_t * pDst, + uint32_t blockSize); + + /** + * @brief Q31 vector addition. + * @param[in] *pSrcA points to the first input vector + * @param[in] *pSrcB points to the second input vector + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in each vector + * @return none. + */ + + void arm_add_q31( + q31_t * pSrcA, + q31_t * pSrcB, + q31_t * pDst, + uint32_t blockSize); + + /** + * @brief Floating-point vector subtraction. + * @param[in] *pSrcA points to the first input vector + * @param[in] *pSrcB points to the second input vector + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in each vector + * @return none. + */ + + void arm_sub_f32( + float32_t * pSrcA, + float32_t * pSrcB, + float32_t * pDst, + uint32_t blockSize); + + /** + * @brief Q7 vector subtraction. + * @param[in] *pSrcA points to the first input vector + * @param[in] *pSrcB points to the second input vector + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in each vector + * @return none. + */ + + void arm_sub_q7( + q7_t * pSrcA, + q7_t * pSrcB, + q7_t * pDst, + uint32_t blockSize); + + /** + * @brief Q15 vector subtraction. + * @param[in] *pSrcA points to the first input vector + * @param[in] *pSrcB points to the second input vector + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in each vector + * @return none. + */ + + void arm_sub_q15( + q15_t * pSrcA, + q15_t * pSrcB, + q15_t * pDst, + uint32_t blockSize); + + /** + * @brief Q31 vector subtraction. + * @param[in] *pSrcA points to the first input vector + * @param[in] *pSrcB points to the second input vector + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in each vector + * @return none. + */ + + void arm_sub_q31( + q31_t * pSrcA, + q31_t * pSrcB, + q31_t * pDst, + uint32_t blockSize); + + /** + * @brief Multiplies a floating-point vector by a scalar. + * @param[in] *pSrc points to the input vector + * @param[in] scale scale factor to be applied + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in the vector + * @return none. + */ + + void arm_scale_f32( + float32_t * pSrc, + float32_t scale, + float32_t * pDst, + uint32_t blockSize); + + /** + * @brief Multiplies a Q7 vector by a scalar. + * @param[in] *pSrc points to the input vector + * @param[in] scaleFract fractional portion of the scale value + * @param[in] shift number of bits to shift the result by + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in the vector + * @return none. + */ + + void arm_scale_q7( + q7_t * pSrc, + q7_t scaleFract, + int8_t shift, + q7_t * pDst, + uint32_t blockSize); + + /** + * @brief Multiplies a Q15 vector by a scalar. + * @param[in] *pSrc points to the input vector + * @param[in] scaleFract fractional portion of the scale value + * @param[in] shift number of bits to shift the result by + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in the vector + * @return none. + */ + + void arm_scale_q15( + q15_t * pSrc, + q15_t scaleFract, + int8_t shift, + q15_t * pDst, + uint32_t blockSize); + + /** + * @brief Multiplies a Q31 vector by a scalar. + * @param[in] *pSrc points to the input vector + * @param[in] scaleFract fractional portion of the scale value + * @param[in] shift number of bits to shift the result by + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in the vector + * @return none. + */ + + void arm_scale_q31( + q31_t * pSrc, + q31_t scaleFract, + int8_t shift, + q31_t * pDst, + uint32_t blockSize); + + /** + * @brief Q7 vector absolute value. + * @param[in] *pSrc points to the input buffer + * @param[out] *pDst points to the output buffer + * @param[in] blockSize number of samples in each vector + * @return none. + */ + + void arm_abs_q7( + q7_t * pSrc, + q7_t * pDst, + uint32_t blockSize); + + /** + * @brief Floating-point vector absolute value. + * @param[in] *pSrc points to the input buffer + * @param[out] *pDst points to the output buffer + * @param[in] blockSize number of samples in each vector + * @return none. + */ + + void arm_abs_f32( + float32_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + /** + * @brief Q15 vector absolute value. + * @param[in] *pSrc points to the input buffer + * @param[out] *pDst points to the output buffer + * @param[in] blockSize number of samples in each vector + * @return none. + */ + + void arm_abs_q15( + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + /** + * @brief Q31 vector absolute value. + * @param[in] *pSrc points to the input buffer + * @param[out] *pDst points to the output buffer + * @param[in] blockSize number of samples in each vector + * @return none. + */ + + void arm_abs_q31( + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + /** + * @brief Dot product of floating-point vectors. + * @param[in] *pSrcA points to the first input vector + * @param[in] *pSrcB points to the second input vector + * @param[in] blockSize number of samples in each vector + * @param[out] *result output result returned here + * @return none. + */ + + void arm_dot_prod_f32( + float32_t * pSrcA, + float32_t * pSrcB, + uint32_t blockSize, + float32_t * result); + + /** + * @brief Dot product of Q7 vectors. + * @param[in] *pSrcA points to the first input vector + * @param[in] *pSrcB points to the second input vector + * @param[in] blockSize number of samples in each vector + * @param[out] *result output result returned here + * @return none. + */ + + void arm_dot_prod_q7( + q7_t * pSrcA, + q7_t * pSrcB, + uint32_t blockSize, + q31_t * result); + + /** + * @brief Dot product of Q15 vectors. + * @param[in] *pSrcA points to the first input vector + * @param[in] *pSrcB points to the second input vector + * @param[in] blockSize number of samples in each vector + * @param[out] *result output result returned here + * @return none. + */ + + void arm_dot_prod_q15( + q15_t * pSrcA, + q15_t * pSrcB, + uint32_t blockSize, + q63_t * result); + + /** + * @brief Dot product of Q31 vectors. + * @param[in] *pSrcA points to the first input vector + * @param[in] *pSrcB points to the second input vector + * @param[in] blockSize number of samples in each vector + * @param[out] *result output result returned here + * @return none. + */ + + void arm_dot_prod_q31( + q31_t * pSrcA, + q31_t * pSrcB, + uint32_t blockSize, + q63_t * result); + + /** + * @brief Shifts the elements of a Q7 vector a specified number of bits. + * @param[in] *pSrc points to the input vector + * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in the vector + * @return none. + */ + + void arm_shift_q7( + q7_t * pSrc, + int8_t shiftBits, + q7_t * pDst, + uint32_t blockSize); + + /** + * @brief Shifts the elements of a Q15 vector a specified number of bits. + * @param[in] *pSrc points to the input vector + * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in the vector + * @return none. + */ + + void arm_shift_q15( + q15_t * pSrc, + int8_t shiftBits, + q15_t * pDst, + uint32_t blockSize); + + /** + * @brief Shifts the elements of a Q31 vector a specified number of bits. + * @param[in] *pSrc points to the input vector + * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in the vector + * @return none. + */ + + void arm_shift_q31( + q31_t * pSrc, + int8_t shiftBits, + q31_t * pDst, + uint32_t blockSize); + + /** + * @brief Adds a constant offset to a floating-point vector. + * @param[in] *pSrc points to the input vector + * @param[in] offset is the offset to be added + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in the vector + * @return none. + */ + + void arm_offset_f32( + float32_t * pSrc, + float32_t offset, + float32_t * pDst, + uint32_t blockSize); + + /** + * @brief Adds a constant offset to a Q7 vector. + * @param[in] *pSrc points to the input vector + * @param[in] offset is the offset to be added + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in the vector + * @return none. + */ + + void arm_offset_q7( + q7_t * pSrc, + q7_t offset, + q7_t * pDst, + uint32_t blockSize); + + /** + * @brief Adds a constant offset to a Q15 vector. + * @param[in] *pSrc points to the input vector + * @param[in] offset is the offset to be added + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in the vector + * @return none. + */ + + void arm_offset_q15( + q15_t * pSrc, + q15_t offset, + q15_t * pDst, + uint32_t blockSize); + + /** + * @brief Adds a constant offset to a Q31 vector. + * @param[in] *pSrc points to the input vector + * @param[in] offset is the offset to be added + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in the vector + * @return none. + */ + + void arm_offset_q31( + q31_t * pSrc, + q31_t offset, + q31_t * pDst, + uint32_t blockSize); + + /** + * @brief Negates the elements of a floating-point vector. + * @param[in] *pSrc points to the input vector + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in the vector + * @return none. + */ + + void arm_negate_f32( + float32_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + /** + * @brief Negates the elements of a Q7 vector. + * @param[in] *pSrc points to the input vector + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in the vector + * @return none. + */ + + void arm_negate_q7( + q7_t * pSrc, + q7_t * pDst, + uint32_t blockSize); + + /** + * @brief Negates the elements of a Q15 vector. + * @param[in] *pSrc points to the input vector + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in the vector + * @return none. + */ + + void arm_negate_q15( + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + /** + * @brief Negates the elements of a Q31 vector. + * @param[in] *pSrc points to the input vector + * @param[out] *pDst points to the output vector + * @param[in] blockSize number of samples in the vector + * @return none. + */ + + void arm_negate_q31( + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + /** + * @brief Copies the elements of a floating-point vector. + * @param[in] *pSrc input pointer + * @param[out] *pDst output pointer + * @param[in] blockSize number of samples to process + * @return none. + */ + void arm_copy_f32( + float32_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + /** + * @brief Copies the elements of a Q7 vector. + * @param[in] *pSrc input pointer + * @param[out] *pDst output pointer + * @param[in] blockSize number of samples to process + * @return none. + */ + void arm_copy_q7( + q7_t * pSrc, + q7_t * pDst, + uint32_t blockSize); + + /** + * @brief Copies the elements of a Q15 vector. + * @param[in] *pSrc input pointer + * @param[out] *pDst output pointer + * @param[in] blockSize number of samples to process + * @return none. + */ + void arm_copy_q15( + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + /** + * @brief Copies the elements of a Q31 vector. + * @param[in] *pSrc input pointer + * @param[out] *pDst output pointer + * @param[in] blockSize number of samples to process + * @return none. + */ + void arm_copy_q31( + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + /** + * @brief Fills a constant value into a floating-point vector. + * @param[in] value input value to be filled + * @param[out] *pDst output pointer + * @param[in] blockSize number of samples to process + * @return none. + */ + void arm_fill_f32( + float32_t value, + float32_t * pDst, + uint32_t blockSize); + + /** + * @brief Fills a constant value into a Q7 vector. + * @param[in] value input value to be filled + * @param[out] *pDst output pointer + * @param[in] blockSize number of samples to process + * @return none. + */ + void arm_fill_q7( + q7_t value, + q7_t * pDst, + uint32_t blockSize); + + /** + * @brief Fills a constant value into a Q15 vector. + * @param[in] value input value to be filled + * @param[out] *pDst output pointer + * @param[in] blockSize number of samples to process + * @return none. + */ + void arm_fill_q15( + q15_t value, + q15_t * pDst, + uint32_t blockSize); + + /** + * @brief Fills a constant value into a Q31 vector. + * @param[in] value input value to be filled + * @param[out] *pDst output pointer + * @param[in] blockSize number of samples to process + * @return none. + */ + void arm_fill_q31( + q31_t value, + q31_t * pDst, + uint32_t blockSize); + +/** + * @brief Convolution of floating-point sequences. + * @param[in] *pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] *pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] *pDst points to the location where the output result is written. Length srcALen+srcBLen-1. + * @return none. + */ + + void arm_conv_f32( + float32_t * pSrcA, + uint32_t srcALen, + float32_t * pSrcB, + uint32_t srcBLen, + float32_t * pDst); + +/** + * @brief Convolution of Q15 sequences. + * @param[in] *pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] *pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] *pDst points to the location where the output result is written. Length srcALen+srcBLen-1. + * @return none. + */ + + void arm_conv_q15( + q15_t * pSrcA, + uint32_t srcALen, + q15_t * pSrcB, + uint32_t srcBLen, + q15_t * pDst); + + /** + * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 + * @param[in] *pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] *pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. + * @return none. + */ + + void arm_conv_fast_q15( + q15_t * pSrcA, + uint32_t srcALen, + q15_t * pSrcB, + uint32_t srcBLen, + q15_t * pDst); + + /** + * @brief Convolution of Q31 sequences. + * @param[in] *pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] *pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. + * @return none. + */ + + void arm_conv_q31( + q31_t * pSrcA, + uint32_t srcALen, + q31_t * pSrcB, + uint32_t srcBLen, + q31_t * pDst); + + /** + * @brief Convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 + * @param[in] *pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] *pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. + * @return none. + */ + + void arm_conv_fast_q31( + q31_t * pSrcA, + uint32_t srcALen, + q31_t * pSrcB, + uint32_t srcBLen, + q31_t * pDst); + + /** + * @brief Convolution of Q7 sequences. + * @param[in] *pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] *pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. + * @return none. + */ + + void arm_conv_q7( + q7_t * pSrcA, + uint32_t srcALen, + q7_t * pSrcB, + uint32_t srcBLen, + q7_t * pDst); + + /** + * @brief Partial convolution of floating-point sequences. + * @param[in] *pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] *pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] *pDst points to the block of output data + * @param[in] firstIndex is the first output sample to start with. + * @param[in] numPoints is the number of output points to be computed. + * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. + */ + + arm_status arm_conv_partial_f32( + float32_t * pSrcA, + uint32_t srcALen, + float32_t * pSrcB, + uint32_t srcBLen, + float32_t * pDst, + uint32_t firstIndex, + uint32_t numPoints); + + /** + * @brief Partial convolution of Q15 sequences. + * @param[in] *pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] *pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] *pDst points to the block of output data + * @param[in] firstIndex is the first output sample to start with. + * @param[in] numPoints is the number of output points to be computed. + * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. + */ + + arm_status arm_conv_partial_q15( + q15_t * pSrcA, + uint32_t srcALen, + q15_t * pSrcB, + uint32_t srcBLen, + q15_t * pDst, + uint32_t firstIndex, + uint32_t numPoints); + + /** + * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 + * @param[in] *pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] *pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] *pDst points to the block of output data + * @param[in] firstIndex is the first output sample to start with. + * @param[in] numPoints is the number of output points to be computed. + * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. + */ + + arm_status arm_conv_partial_fast_q15( + q15_t * pSrcA, + uint32_t srcALen, + q15_t * pSrcB, + uint32_t srcBLen, + q15_t * pDst, + uint32_t firstIndex, + uint32_t numPoints); + + /** + * @brief Partial convolution of Q31 sequences. + * @param[in] *pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] *pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] *pDst points to the block of output data + * @param[in] firstIndex is the first output sample to start with. + * @param[in] numPoints is the number of output points to be computed. + * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. + */ + + arm_status arm_conv_partial_q31( + q31_t * pSrcA, + uint32_t srcALen, + q31_t * pSrcB, + uint32_t srcBLen, + q31_t * pDst, + uint32_t firstIndex, + uint32_t numPoints); + + + /** + * @brief Partial convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 + * @param[in] *pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] *pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] *pDst points to the block of output data + * @param[in] firstIndex is the first output sample to start with. + * @param[in] numPoints is the number of output points to be computed. + * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. + */ + + arm_status arm_conv_partial_fast_q31( + q31_t * pSrcA, + uint32_t srcALen, + q31_t * pSrcB, + uint32_t srcBLen, + q31_t * pDst, + uint32_t firstIndex, + uint32_t numPoints); + + /** + * @brief Partial convolution of Q7 sequences. + * @param[in] *pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] *pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] *pDst points to the block of output data + * @param[in] firstIndex is the first output sample to start with. + * @param[in] numPoints is the number of output points to be computed. + * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. + */ + + arm_status arm_conv_partial_q7( + q7_t * pSrcA, + uint32_t srcALen, + q7_t * pSrcB, + uint32_t srcBLen, + q7_t * pDst, + uint32_t firstIndex, + uint32_t numPoints); + + + /** + * @brief Instance structure for the Q15 FIR decimator. + */ + + typedef struct + { + uint8_t M; /**< decimation factor. */ + uint16_t numTaps; /**< number of coefficients in the filter. */ + q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ + q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + } arm_fir_decimate_instance_q15; + + /** + * @brief Instance structure for the Q31 FIR decimator. + */ + + typedef struct + { + uint8_t M; /**< decimation factor. */ + uint16_t numTaps; /**< number of coefficients in the filter. */ + q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ + q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + + } arm_fir_decimate_instance_q31; + + /** + * @brief Instance structure for the floating-point FIR decimator. + */ + + typedef struct + { + uint8_t M; /**< decimation factor. */ + uint16_t numTaps; /**< number of coefficients in the filter. */ + float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ + float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + + } arm_fir_decimate_instance_f32; + + + + /** + * @brief Processing function for the floating-point FIR decimator. + * @param[in] *S points to an instance of the floating-point FIR decimator structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data + * @param[in] blockSize number of input samples to process per call. + * @return none + */ + + void arm_fir_decimate_f32( + const arm_fir_decimate_instance_f32 * S, + float32_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @brief Initialization function for the floating-point FIR decimator. + * @param[in,out] *S points to an instance of the floating-point FIR decimator structure. + * @param[in] numTaps number of coefficients in the filter. + * @param[in] M decimation factor. + * @param[in] *pCoeffs points to the filter coefficients. + * @param[in] *pState points to the state buffer. + * @param[in] blockSize number of input samples to process per call. + * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if + * blockSize is not a multiple of M. + */ + + arm_status arm_fir_decimate_init_f32( + arm_fir_decimate_instance_f32 * S, + uint16_t numTaps, + uint8_t M, + float32_t * pCoeffs, + float32_t * pState, + uint32_t blockSize); + + /** + * @brief Processing function for the Q15 FIR decimator. + * @param[in] *S points to an instance of the Q15 FIR decimator structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data + * @param[in] blockSize number of input samples to process per call. + * @return none + */ + + void arm_fir_decimate_q15( + const arm_fir_decimate_instance_q15 * S, + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + /** + * @brief Processing function for the Q15 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. + * @param[in] *S points to an instance of the Q15 FIR decimator structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data + * @param[in] blockSize number of input samples to process per call. + * @return none + */ + + void arm_fir_decimate_fast_q15( + const arm_fir_decimate_instance_q15 * S, + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + + + /** + * @brief Initialization function for the Q15 FIR decimator. + * @param[in,out] *S points to an instance of the Q15 FIR decimator structure. + * @param[in] numTaps number of coefficients in the filter. + * @param[in] M decimation factor. + * @param[in] *pCoeffs points to the filter coefficients. + * @param[in] *pState points to the state buffer. + * @param[in] blockSize number of input samples to process per call. + * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if + * blockSize is not a multiple of M. + */ + + arm_status arm_fir_decimate_init_q15( + arm_fir_decimate_instance_q15 * S, + uint16_t numTaps, + uint8_t M, + q15_t * pCoeffs, + q15_t * pState, + uint32_t blockSize); + + /** + * @brief Processing function for the Q31 FIR decimator. + * @param[in] *S points to an instance of the Q31 FIR decimator structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data + * @param[in] blockSize number of input samples to process per call. + * @return none + */ + + void arm_fir_decimate_q31( + const arm_fir_decimate_instance_q31 * S, + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + /** + * @brief Processing function for the Q31 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. + * @param[in] *S points to an instance of the Q31 FIR decimator structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data + * @param[in] blockSize number of input samples to process per call. + * @return none + */ + + void arm_fir_decimate_fast_q31( + arm_fir_decimate_instance_q31 * S, + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + + /** + * @brief Initialization function for the Q31 FIR decimator. + * @param[in,out] *S points to an instance of the Q31 FIR decimator structure. + * @param[in] numTaps number of coefficients in the filter. + * @param[in] M decimation factor. + * @param[in] *pCoeffs points to the filter coefficients. + * @param[in] *pState points to the state buffer. + * @param[in] blockSize number of input samples to process per call. + * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if + * blockSize is not a multiple of M. + */ + + arm_status arm_fir_decimate_init_q31( + arm_fir_decimate_instance_q31 * S, + uint16_t numTaps, + uint8_t M, + q31_t * pCoeffs, + q31_t * pState, + uint32_t blockSize); + + + + /** + * @brief Instance structure for the Q15 FIR interpolator. + */ + + typedef struct + { + uint8_t L; /**< upsample factor. */ + uint16_t phaseLength; /**< length of each polyphase filter component. */ + q15_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ + q15_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */ + } arm_fir_interpolate_instance_q15; + + /** + * @brief Instance structure for the Q31 FIR interpolator. + */ + + typedef struct + { + uint8_t L; /**< upsample factor. */ + uint16_t phaseLength; /**< length of each polyphase filter component. */ + q31_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ + q31_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */ + } arm_fir_interpolate_instance_q31; + + /** + * @brief Instance structure for the floating-point FIR interpolator. + */ + + typedef struct + { + uint8_t L; /**< upsample factor. */ + uint16_t phaseLength; /**< length of each polyphase filter component. */ + float32_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ + float32_t *pState; /**< points to the state variable array. The array is of length phaseLength+numTaps-1. */ + } arm_fir_interpolate_instance_f32; + + + /** + * @brief Processing function for the Q15 FIR interpolator. + * @param[in] *S points to an instance of the Q15 FIR interpolator structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data. + * @param[in] blockSize number of input samples to process per call. + * @return none. + */ + + void arm_fir_interpolate_q15( + const arm_fir_interpolate_instance_q15 * S, + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + + /** + * @brief Initialization function for the Q15 FIR interpolator. + * @param[in,out] *S points to an instance of the Q15 FIR interpolator structure. + * @param[in] L upsample factor. + * @param[in] numTaps number of filter coefficients in the filter. + * @param[in] *pCoeffs points to the filter coefficient buffer. + * @param[in] *pState points to the state buffer. + * @param[in] blockSize number of input samples to process per call. + * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if + * the filter length numTaps is not a multiple of the interpolation factor L. + */ + + arm_status arm_fir_interpolate_init_q15( + arm_fir_interpolate_instance_q15 * S, + uint8_t L, + uint16_t numTaps, + q15_t * pCoeffs, + q15_t * pState, + uint32_t blockSize); + + /** + * @brief Processing function for the Q31 FIR interpolator. + * @param[in] *S points to an instance of the Q15 FIR interpolator structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data. + * @param[in] blockSize number of input samples to process per call. + * @return none. + */ + + void arm_fir_interpolate_q31( + const arm_fir_interpolate_instance_q31 * S, + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + /** + * @brief Initialization function for the Q31 FIR interpolator. + * @param[in,out] *S points to an instance of the Q31 FIR interpolator structure. + * @param[in] L upsample factor. + * @param[in] numTaps number of filter coefficients in the filter. + * @param[in] *pCoeffs points to the filter coefficient buffer. + * @param[in] *pState points to the state buffer. + * @param[in] blockSize number of input samples to process per call. + * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if + * the filter length numTaps is not a multiple of the interpolation factor L. + */ + + arm_status arm_fir_interpolate_init_q31( + arm_fir_interpolate_instance_q31 * S, + uint8_t L, + uint16_t numTaps, + q31_t * pCoeffs, + q31_t * pState, + uint32_t blockSize); + + + /** + * @brief Processing function for the floating-point FIR interpolator. + * @param[in] *S points to an instance of the floating-point FIR interpolator structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data. + * @param[in] blockSize number of input samples to process per call. + * @return none. + */ + + void arm_fir_interpolate_f32( + const arm_fir_interpolate_instance_f32 * S, + float32_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + /** + * @brief Initialization function for the floating-point FIR interpolator. + * @param[in,out] *S points to an instance of the floating-point FIR interpolator structure. + * @param[in] L upsample factor. + * @param[in] numTaps number of filter coefficients in the filter. + * @param[in] *pCoeffs points to the filter coefficient buffer. + * @param[in] *pState points to the state buffer. + * @param[in] blockSize number of input samples to process per call. + * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if + * the filter length numTaps is not a multiple of the interpolation factor L. + */ + + arm_status arm_fir_interpolate_init_f32( + arm_fir_interpolate_instance_f32 * S, + uint8_t L, + uint16_t numTaps, + float32_t * pCoeffs, + float32_t * pState, + uint32_t blockSize); + + /** + * @brief Instance structure for the high precision Q31 Biquad cascade filter. + */ + + typedef struct + { + uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ + q63_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ + q31_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ + uint8_t postShift; /**< additional shift, in bits, applied to each output sample. */ + + } arm_biquad_cas_df1_32x64_ins_q31; + + + /** + * @param[in] *S points to an instance of the high precision Q31 Biquad cascade filter structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data + * @param[in] blockSize number of samples to process. + * @return none. + */ + + void arm_biquad_cas_df1_32x64_q31( + const arm_biquad_cas_df1_32x64_ins_q31 * S, + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + + /** + * @param[in,out] *S points to an instance of the high precision Q31 Biquad cascade filter structure. + * @param[in] numStages number of 2nd order stages in the filter. + * @param[in] *pCoeffs points to the filter coefficients. + * @param[in] *pState points to the state buffer. + * @param[in] postShift shift to be applied to the output. Varies according to the coefficients format + * @return none + */ + + void arm_biquad_cas_df1_32x64_init_q31( + arm_biquad_cas_df1_32x64_ins_q31 * S, + uint8_t numStages, + q31_t * pCoeffs, + q63_t * pState, + uint8_t postShift); + + + + /** + * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. + */ + + typedef struct + { + uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ + float32_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ + float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ + } arm_biquad_cascade_df2T_instance_f32; + + + /** + * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. + * @param[in] *S points to an instance of the filter data structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data + * @param[in] blockSize number of samples to process. + * @return none. + */ + + void arm_biquad_cascade_df2T_f32( + const arm_biquad_cascade_df2T_instance_f32 * S, + float32_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. + * @param[in,out] *S points to an instance of the filter data structure. + * @param[in] numStages number of 2nd order stages in the filter. + * @param[in] *pCoeffs points to the filter coefficients. + * @param[in] *pState points to the state buffer. + * @return none + */ + + void arm_biquad_cascade_df2T_init_f32( + arm_biquad_cascade_df2T_instance_f32 * S, + uint8_t numStages, + float32_t * pCoeffs, + float32_t * pState); + + + + /** + * @brief Instance structure for the Q15 FIR lattice filter. + */ + + typedef struct + { + uint16_t numStages; /**< number of filter stages. */ + q15_t *pState; /**< points to the state variable array. The array is of length numStages. */ + q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ + } arm_fir_lattice_instance_q15; + + /** + * @brief Instance structure for the Q31 FIR lattice filter. + */ + + typedef struct + { + uint16_t numStages; /**< number of filter stages. */ + q31_t *pState; /**< points to the state variable array. The array is of length numStages. */ + q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ + } arm_fir_lattice_instance_q31; + + /** + * @brief Instance structure for the floating-point FIR lattice filter. + */ + + typedef struct + { + uint16_t numStages; /**< number of filter stages. */ + float32_t *pState; /**< points to the state variable array. The array is of length numStages. */ + float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ + } arm_fir_lattice_instance_f32; + + /** + * @brief Initialization function for the Q15 FIR lattice filter. + * @param[in] *S points to an instance of the Q15 FIR lattice structure. + * @param[in] numStages number of filter stages. + * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages. + * @param[in] *pState points to the state buffer. The array is of length numStages. + * @return none. + */ + + void arm_fir_lattice_init_q15( + arm_fir_lattice_instance_q15 * S, + uint16_t numStages, + q15_t * pCoeffs, + q15_t * pState); + + + /** + * @brief Processing function for the Q15 FIR lattice filter. + * @param[in] *S points to an instance of the Q15 FIR lattice structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + * @return none. + */ + void arm_fir_lattice_q15( + const arm_fir_lattice_instance_q15 * S, + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + /** + * @brief Initialization function for the Q31 FIR lattice filter. + * @param[in] *S points to an instance of the Q31 FIR lattice structure. + * @param[in] numStages number of filter stages. + * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages. + * @param[in] *pState points to the state buffer. The array is of length numStages. + * @return none. + */ + + void arm_fir_lattice_init_q31( + arm_fir_lattice_instance_q31 * S, + uint16_t numStages, + q31_t * pCoeffs, + q31_t * pState); + + + /** + * @brief Processing function for the Q31 FIR lattice filter. + * @param[in] *S points to an instance of the Q31 FIR lattice structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data + * @param[in] blockSize number of samples to process. + * @return none. + */ + + void arm_fir_lattice_q31( + const arm_fir_lattice_instance_q31 * S, + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + +/** + * @brief Initialization function for the floating-point FIR lattice filter. + * @param[in] *S points to an instance of the floating-point FIR lattice structure. + * @param[in] numStages number of filter stages. + * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages. + * @param[in] *pState points to the state buffer. The array is of length numStages. + * @return none. + */ + + void arm_fir_lattice_init_f32( + arm_fir_lattice_instance_f32 * S, + uint16_t numStages, + float32_t * pCoeffs, + float32_t * pState); + + /** + * @brief Processing function for the floating-point FIR lattice filter. + * @param[in] *S points to an instance of the floating-point FIR lattice structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data + * @param[in] blockSize number of samples to process. + * @return none. + */ + + void arm_fir_lattice_f32( + const arm_fir_lattice_instance_f32 * S, + float32_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + /** + * @brief Instance structure for the Q15 IIR lattice filter. + */ + typedef struct + { + uint16_t numStages; /**< number of stages in the filter. */ + q15_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ + q15_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ + q15_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ + } arm_iir_lattice_instance_q15; + + /** + * @brief Instance structure for the Q31 IIR lattice filter. + */ + typedef struct + { + uint16_t numStages; /**< number of stages in the filter. */ + q31_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ + q31_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ + q31_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ + } arm_iir_lattice_instance_q31; + + /** + * @brief Instance structure for the floating-point IIR lattice filter. + */ + typedef struct + { + uint16_t numStages; /**< number of stages in the filter. */ + float32_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ + float32_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ + float32_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ + } arm_iir_lattice_instance_f32; + + /** + * @brief Processing function for the floating-point IIR lattice filter. + * @param[in] *S points to an instance of the floating-point IIR lattice structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + * @return none. + */ + + void arm_iir_lattice_f32( + const arm_iir_lattice_instance_f32 * S, + float32_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + /** + * @brief Initialization function for the floating-point IIR lattice filter. + * @param[in] *S points to an instance of the floating-point IIR lattice structure. + * @param[in] numStages number of stages in the filter. + * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. + * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. + * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize-1. + * @param[in] blockSize number of samples to process. + * @return none. + */ + + void arm_iir_lattice_init_f32( + arm_iir_lattice_instance_f32 * S, + uint16_t numStages, + float32_t *pkCoeffs, + float32_t *pvCoeffs, + float32_t *pState, + uint32_t blockSize); + + + /** + * @brief Processing function for the Q31 IIR lattice filter. + * @param[in] *S points to an instance of the Q31 IIR lattice structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + * @return none. + */ + + void arm_iir_lattice_q31( + const arm_iir_lattice_instance_q31 * S, + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + + /** + * @brief Initialization function for the Q31 IIR lattice filter. + * @param[in] *S points to an instance of the Q31 IIR lattice structure. + * @param[in] numStages number of stages in the filter. + * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. + * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. + * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize. + * @param[in] blockSize number of samples to process. + * @return none. + */ + + void arm_iir_lattice_init_q31( + arm_iir_lattice_instance_q31 * S, + uint16_t numStages, + q31_t *pkCoeffs, + q31_t *pvCoeffs, + q31_t *pState, + uint32_t blockSize); + + + /** + * @brief Processing function for the Q15 IIR lattice filter. + * @param[in] *S points to an instance of the Q15 IIR lattice structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + * @return none. + */ + + void arm_iir_lattice_q15( + const arm_iir_lattice_instance_q15 * S, + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + +/** + * @brief Initialization function for the Q15 IIR lattice filter. + * @param[in] *S points to an instance of the fixed-point Q15 IIR lattice structure. + * @param[in] numStages number of stages in the filter. + * @param[in] *pkCoeffs points to reflection coefficient buffer. The array is of length numStages. + * @param[in] *pvCoeffs points to ladder coefficient buffer. The array is of length numStages+1. + * @param[in] *pState points to state buffer. The array is of length numStages+blockSize. + * @param[in] blockSize number of samples to process per call. + * @return none. + */ + + void arm_iir_lattice_init_q15( + arm_iir_lattice_instance_q15 * S, + uint16_t numStages, + q15_t *pkCoeffs, + q15_t *pvCoeffs, + q15_t *pState, + uint32_t blockSize); + + /** + * @brief Instance structure for the floating-point LMS filter. + */ + + typedef struct + { + uint16_t numTaps; /**< number of coefficients in the filter. */ + float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ + float32_t mu; /**< step size that controls filter coefficient updates. */ + } arm_lms_instance_f32; + + /** + * @brief Processing function for floating-point LMS filter. + * @param[in] *S points to an instance of the floating-point LMS filter structure. + * @param[in] *pSrc points to the block of input data. + * @param[in] *pRef points to the block of reference data. + * @param[out] *pOut points to the block of output data. + * @param[out] *pErr points to the block of error data. + * @param[in] blockSize number of samples to process. + * @return none. + */ + + void arm_lms_f32( + const arm_lms_instance_f32 * S, + float32_t * pSrc, + float32_t * pRef, + float32_t * pOut, + float32_t * pErr, + uint32_t blockSize); + + /** + * @brief Initialization function for floating-point LMS filter. + * @param[in] *S points to an instance of the floating-point LMS filter structure. + * @param[in] numTaps number of filter coefficients. + * @param[in] *pCoeffs points to the coefficient buffer. + * @param[in] *pState points to state buffer. + * @param[in] mu step size that controls filter coefficient updates. + * @param[in] blockSize number of samples to process. + * @return none. + */ + + void arm_lms_init_f32( + arm_lms_instance_f32 * S, + uint16_t numTaps, + float32_t * pCoeffs, + float32_t * pState, + float32_t mu, + uint32_t blockSize); + + /** + * @brief Instance structure for the Q15 LMS filter. + */ + + typedef struct + { + uint16_t numTaps; /**< number of coefficients in the filter. */ + q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ + q15_t mu; /**< step size that controls filter coefficient updates. */ + uint32_t postShift; /**< bit shift applied to coefficients. */ + } arm_lms_instance_q15; + + + /** + * @brief Initialization function for the Q15 LMS filter. + * @param[in] *S points to an instance of the Q15 LMS filter structure. + * @param[in] numTaps number of filter coefficients. + * @param[in] *pCoeffs points to the coefficient buffer. + * @param[in] *pState points to the state buffer. + * @param[in] mu step size that controls filter coefficient updates. + * @param[in] blockSize number of samples to process. + * @param[in] postShift bit shift applied to coefficients. + * @return none. + */ + + void arm_lms_init_q15( + arm_lms_instance_q15 * S, + uint16_t numTaps, + q15_t * pCoeffs, + q15_t * pState, + q15_t mu, + uint32_t blockSize, + uint32_t postShift); + + /** + * @brief Processing function for Q15 LMS filter. + * @param[in] *S points to an instance of the Q15 LMS filter structure. + * @param[in] *pSrc points to the block of input data. + * @param[in] *pRef points to the block of reference data. + * @param[out] *pOut points to the block of output data. + * @param[out] *pErr points to the block of error data. + * @param[in] blockSize number of samples to process. + * @return none. + */ + + void arm_lms_q15( + const arm_lms_instance_q15 * S, + q15_t * pSrc, + q15_t * pRef, + q15_t * pOut, + q15_t * pErr, + uint32_t blockSize); + + + /** + * @brief Instance structure for the Q31 LMS filter. + */ + + typedef struct + { + uint16_t numTaps; /**< number of coefficients in the filter. */ + q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ + q31_t mu; /**< step size that controls filter coefficient updates. */ + uint32_t postShift; /**< bit shift applied to coefficients. */ + + } arm_lms_instance_q31; + + /** + * @brief Processing function for Q31 LMS filter. + * @param[in] *S points to an instance of the Q15 LMS filter structure. + * @param[in] *pSrc points to the block of input data. + * @param[in] *pRef points to the block of reference data. + * @param[out] *pOut points to the block of output data. + * @param[out] *pErr points to the block of error data. + * @param[in] blockSize number of samples to process. + * @return none. + */ + + void arm_lms_q31( + const arm_lms_instance_q31 * S, + q31_t * pSrc, + q31_t * pRef, + q31_t * pOut, + q31_t * pErr, + uint32_t blockSize); + + /** + * @brief Initialization function for Q31 LMS filter. + * @param[in] *S points to an instance of the Q31 LMS filter structure. + * @param[in] numTaps number of filter coefficients. + * @param[in] *pCoeffs points to coefficient buffer. + * @param[in] *pState points to state buffer. + * @param[in] mu step size that controls filter coefficient updates. + * @param[in] blockSize number of samples to process. + * @param[in] postShift bit shift applied to coefficients. + * @return none. + */ + + void arm_lms_init_q31( + arm_lms_instance_q31 * S, + uint16_t numTaps, + q31_t *pCoeffs, + q31_t *pState, + q31_t mu, + uint32_t blockSize, + uint32_t postShift); + + /** + * @brief Instance structure for the floating-point normalized LMS filter. + */ + + typedef struct + { + uint16_t numTaps; /**< number of coefficients in the filter. */ + float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ + float32_t mu; /**< step size that control filter coefficient updates. */ + float32_t energy; /**< saves previous frame energy. */ + float32_t x0; /**< saves previous input sample. */ + } arm_lms_norm_instance_f32; + + /** + * @brief Processing function for floating-point normalized LMS filter. + * @param[in] *S points to an instance of the floating-point normalized LMS filter structure. + * @param[in] *pSrc points to the block of input data. + * @param[in] *pRef points to the block of reference data. + * @param[out] *pOut points to the block of output data. + * @param[out] *pErr points to the block of error data. + * @param[in] blockSize number of samples to process. + * @return none. + */ + + void arm_lms_norm_f32( + arm_lms_norm_instance_f32 * S, + float32_t * pSrc, + float32_t * pRef, + float32_t * pOut, + float32_t * pErr, + uint32_t blockSize); + + /** + * @brief Initialization function for floating-point normalized LMS filter. + * @param[in] *S points to an instance of the floating-point LMS filter structure. + * @param[in] numTaps number of filter coefficients. + * @param[in] *pCoeffs points to coefficient buffer. + * @param[in] *pState points to state buffer. + * @param[in] mu step size that controls filter coefficient updates. + * @param[in] blockSize number of samples to process. + * @return none. + */ + + void arm_lms_norm_init_f32( + arm_lms_norm_instance_f32 * S, + uint16_t numTaps, + float32_t * pCoeffs, + float32_t * pState, + float32_t mu, + uint32_t blockSize); + + + /** + * @brief Instance structure for the Q31 normalized LMS filter. + */ + typedef struct + { + uint16_t numTaps; /**< number of coefficients in the filter. */ + q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ + q31_t mu; /**< step size that controls filter coefficient updates. */ + uint8_t postShift; /**< bit shift applied to coefficients. */ + q31_t *recipTable; /**< points to the reciprocal initial value table. */ + q31_t energy; /**< saves previous frame energy. */ + q31_t x0; /**< saves previous input sample. */ + } arm_lms_norm_instance_q31; + + /** + * @brief Processing function for Q31 normalized LMS filter. + * @param[in] *S points to an instance of the Q31 normalized LMS filter structure. + * @param[in] *pSrc points to the block of input data. + * @param[in] *pRef points to the block of reference data. + * @param[out] *pOut points to the block of output data. + * @param[out] *pErr points to the block of error data. + * @param[in] blockSize number of samples to process. + * @return none. + */ + + void arm_lms_norm_q31( + arm_lms_norm_instance_q31 * S, + q31_t * pSrc, + q31_t * pRef, + q31_t * pOut, + q31_t * pErr, + uint32_t blockSize); + + /** + * @brief Initialization function for Q31 normalized LMS filter. + * @param[in] *S points to an instance of the Q31 normalized LMS filter structure. + * @param[in] numTaps number of filter coefficients. + * @param[in] *pCoeffs points to coefficient buffer. + * @param[in] *pState points to state buffer. + * @param[in] mu step size that controls filter coefficient updates. + * @param[in] blockSize number of samples to process. + * @param[in] postShift bit shift applied to coefficients. + * @return none. + */ + + void arm_lms_norm_init_q31( + arm_lms_norm_instance_q31 * S, + uint16_t numTaps, + q31_t * pCoeffs, + q31_t * pState, + q31_t mu, + uint32_t blockSize, + uint8_t postShift); + + /** + * @brief Instance structure for the Q15 normalized LMS filter. + */ + + typedef struct + { + uint16_t numTaps; /**< Number of coefficients in the filter. */ + q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ + q15_t mu; /**< step size that controls filter coefficient updates. */ + uint8_t postShift; /**< bit shift applied to coefficients. */ + q15_t *recipTable; /**< Points to the reciprocal initial value table. */ + q15_t energy; /**< saves previous frame energy. */ + q15_t x0; /**< saves previous input sample. */ + } arm_lms_norm_instance_q15; + + /** + * @brief Processing function for Q15 normalized LMS filter. + * @param[in] *S points to an instance of the Q15 normalized LMS filter structure. + * @param[in] *pSrc points to the block of input data. + * @param[in] *pRef points to the block of reference data. + * @param[out] *pOut points to the block of output data. + * @param[out] *pErr points to the block of error data. + * @param[in] blockSize number of samples to process. + * @return none. + */ + + void arm_lms_norm_q15( + arm_lms_norm_instance_q15 * S, + q15_t * pSrc, + q15_t * pRef, + q15_t * pOut, + q15_t * pErr, + uint32_t blockSize); + + + /** + * @brief Initialization function for Q15 normalized LMS filter. + * @param[in] *S points to an instance of the Q15 normalized LMS filter structure. + * @param[in] numTaps number of filter coefficients. + * @param[in] *pCoeffs points to coefficient buffer. + * @param[in] *pState points to state buffer. + * @param[in] mu step size that controls filter coefficient updates. + * @param[in] blockSize number of samples to process. + * @param[in] postShift bit shift applied to coefficients. + * @return none. + */ + + void arm_lms_norm_init_q15( + arm_lms_norm_instance_q15 * S, + uint16_t numTaps, + q15_t * pCoeffs, + q15_t * pState, + q15_t mu, + uint32_t blockSize, + uint8_t postShift); + + /** + * @brief Correlation of floating-point sequences. + * @param[in] *pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] *pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. + * @return none. + */ + + void arm_correlate_f32( + float32_t * pSrcA, + uint32_t srcALen, + float32_t * pSrcB, + uint32_t srcBLen, + float32_t * pDst); + + /** + * @brief Correlation of Q15 sequences. + * @param[in] *pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] *pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. + * @return none. + */ + + void arm_correlate_q15( + q15_t * pSrcA, + uint32_t srcALen, + q15_t * pSrcB, + uint32_t srcBLen, + q15_t * pDst); + + /** + * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. + * @param[in] *pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] *pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. + * @return none. + */ + + void arm_correlate_fast_q15( + q15_t * pSrcA, + uint32_t srcALen, + q15_t * pSrcB, + uint32_t srcBLen, + q15_t * pDst); + + /** + * @brief Correlation of Q31 sequences. + * @param[in] *pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] *pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. + * @return none. + */ + + void arm_correlate_q31( + q31_t * pSrcA, + uint32_t srcALen, + q31_t * pSrcB, + uint32_t srcBLen, + q31_t * pDst); + + /** + * @brief Correlation of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 + * @param[in] *pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] *pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. + * @return none. + */ + + void arm_correlate_fast_q31( + q31_t * pSrcA, + uint32_t srcALen, + q31_t * pSrcB, + uint32_t srcBLen, + q31_t * pDst); + + /** + * @brief Correlation of Q7 sequences. + * @param[in] *pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] *pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. + * @return none. + */ + + void arm_correlate_q7( + q7_t * pSrcA, + uint32_t srcALen, + q7_t * pSrcB, + uint32_t srcBLen, + q7_t * pDst); + + /** + * @brief Instance structure for the floating-point sparse FIR filter. + */ + typedef struct + { + uint16_t numTaps; /**< number of coefficients in the filter. */ + uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ + float32_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ + float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ + uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ + int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ + } arm_fir_sparse_instance_f32; + + /** + * @brief Instance structure for the Q31 sparse FIR filter. + */ + + typedef struct + { + uint16_t numTaps; /**< number of coefficients in the filter. */ + uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ + q31_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ + q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ + uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ + int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ + } arm_fir_sparse_instance_q31; + + /** + * @brief Instance structure for the Q15 sparse FIR filter. + */ + + typedef struct + { + uint16_t numTaps; /**< number of coefficients in the filter. */ + uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ + q15_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ + q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ + uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ + int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ + } arm_fir_sparse_instance_q15; + + /** + * @brief Instance structure for the Q7 sparse FIR filter. + */ + + typedef struct + { + uint16_t numTaps; /**< number of coefficients in the filter. */ + uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ + q7_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ + q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ + uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ + int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ + } arm_fir_sparse_instance_q7; + + /** + * @brief Processing function for the floating-point sparse FIR filter. + * @param[in] *S points to an instance of the floating-point sparse FIR structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data + * @param[in] *pScratchIn points to a temporary buffer of size blockSize. + * @param[in] blockSize number of input samples to process per call. + * @return none. + */ + + void arm_fir_sparse_f32( + arm_fir_sparse_instance_f32 * S, + float32_t * pSrc, + float32_t * pDst, + float32_t * pScratchIn, + uint32_t blockSize); + + /** + * @brief Initialization function for the floating-point sparse FIR filter. + * @param[in,out] *S points to an instance of the floating-point sparse FIR structure. + * @param[in] numTaps number of nonzero coefficients in the filter. + * @param[in] *pCoeffs points to the array of filter coefficients. + * @param[in] *pState points to the state buffer. + * @param[in] *pTapDelay points to the array of offset times. + * @param[in] maxDelay maximum offset time supported. + * @param[in] blockSize number of samples that will be processed per block. + * @return none + */ + + void arm_fir_sparse_init_f32( + arm_fir_sparse_instance_f32 * S, + uint16_t numTaps, + float32_t * pCoeffs, + float32_t * pState, + int32_t * pTapDelay, + uint16_t maxDelay, + uint32_t blockSize); + + /** + * @brief Processing function for the Q31 sparse FIR filter. + * @param[in] *S points to an instance of the Q31 sparse FIR structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data + * @param[in] *pScratchIn points to a temporary buffer of size blockSize. + * @param[in] blockSize number of input samples to process per call. + * @return none. + */ + + void arm_fir_sparse_q31( + arm_fir_sparse_instance_q31 * S, + q31_t * pSrc, + q31_t * pDst, + q31_t * pScratchIn, + uint32_t blockSize); + + /** + * @brief Initialization function for the Q31 sparse FIR filter. + * @param[in,out] *S points to an instance of the Q31 sparse FIR structure. + * @param[in] numTaps number of nonzero coefficients in the filter. + * @param[in] *pCoeffs points to the array of filter coefficients. + * @param[in] *pState points to the state buffer. + * @param[in] *pTapDelay points to the array of offset times. + * @param[in] maxDelay maximum offset time supported. + * @param[in] blockSize number of samples that will be processed per block. + * @return none + */ + + void arm_fir_sparse_init_q31( + arm_fir_sparse_instance_q31 * S, + uint16_t numTaps, + q31_t * pCoeffs, + q31_t * pState, + int32_t * pTapDelay, + uint16_t maxDelay, + uint32_t blockSize); + + /** + * @brief Processing function for the Q15 sparse FIR filter. + * @param[in] *S points to an instance of the Q15 sparse FIR structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data + * @param[in] *pScratchIn points to a temporary buffer of size blockSize. + * @param[in] *pScratchOut points to a temporary buffer of size blockSize. + * @param[in] blockSize number of input samples to process per call. + * @return none. + */ + + void arm_fir_sparse_q15( + arm_fir_sparse_instance_q15 * S, + q15_t * pSrc, + q15_t * pDst, + q15_t * pScratchIn, + q31_t * pScratchOut, + uint32_t blockSize); + + + /** + * @brief Initialization function for the Q15 sparse FIR filter. + * @param[in,out] *S points to an instance of the Q15 sparse FIR structure. + * @param[in] numTaps number of nonzero coefficients in the filter. + * @param[in] *pCoeffs points to the array of filter coefficients. + * @param[in] *pState points to the state buffer. + * @param[in] *pTapDelay points to the array of offset times. + * @param[in] maxDelay maximum offset time supported. + * @param[in] blockSize number of samples that will be processed per block. + * @return none + */ + + void arm_fir_sparse_init_q15( + arm_fir_sparse_instance_q15 * S, + uint16_t numTaps, + q15_t * pCoeffs, + q15_t * pState, + int32_t * pTapDelay, + uint16_t maxDelay, + uint32_t blockSize); + + /** + * @brief Processing function for the Q7 sparse FIR filter. + * @param[in] *S points to an instance of the Q7 sparse FIR structure. + * @param[in] *pSrc points to the block of input data. + * @param[out] *pDst points to the block of output data + * @param[in] *pScratchIn points to a temporary buffer of size blockSize. + * @param[in] *pScratchOut points to a temporary buffer of size blockSize. + * @param[in] blockSize number of input samples to process per call. + * @return none. + */ + + void arm_fir_sparse_q7( + arm_fir_sparse_instance_q7 * S, + q7_t * pSrc, + q7_t * pDst, + q7_t * pScratchIn, + q31_t * pScratchOut, + uint32_t blockSize); + + /** + * @brief Initialization function for the Q7 sparse FIR filter. + * @param[in,out] *S points to an instance of the Q7 sparse FIR structure. + * @param[in] numTaps number of nonzero coefficients in the filter. + * @param[in] *pCoeffs points to the array of filter coefficients. + * @param[in] *pState points to the state buffer. + * @param[in] *pTapDelay points to the array of offset times. + * @param[in] maxDelay maximum offset time supported. + * @param[in] blockSize number of samples that will be processed per block. + * @return none + */ + + void arm_fir_sparse_init_q7( + arm_fir_sparse_instance_q7 * S, + uint16_t numTaps, + q7_t * pCoeffs, + q7_t * pState, + int32_t *pTapDelay, + uint16_t maxDelay, + uint32_t blockSize); + + + /* + * @brief Floating-point sin_cos function. + * @param[in] theta input value in degrees + * @param[out] *pSinVal points to the processed sine output. + * @param[out] *pCosVal points to the processed cos output. + * @return none. + */ + + void arm_sin_cos_f32( + float32_t theta, + float32_t *pSinVal, + float32_t *pCcosVal); + + /* + * @brief Q31 sin_cos function. + * @param[in] theta scaled input value in degrees + * @param[out] *pSinVal points to the processed sine output. + * @param[out] *pCosVal points to the processed cosine output. + * @return none. + */ + + void arm_sin_cos_q31( + q31_t theta, + q31_t *pSinVal, + q31_t *pCosVal); + + + /** + * @brief Floating-point complex conjugate. + * @param[in] *pSrc points to the input vector + * @param[out] *pDst points to the output vector + * @param[in] numSamples number of complex samples in each vector + * @return none. + */ + + void arm_cmplx_conj_f32( + float32_t * pSrc, + float32_t * pDst, + uint32_t numSamples); + + /** + * @brief Q31 complex conjugate. + * @param[in] *pSrc points to the input vector + * @param[out] *pDst points to the output vector + * @param[in] numSamples number of complex samples in each vector + * @return none. + */ + + void arm_cmplx_conj_q31( + q31_t * pSrc, + q31_t * pDst, + uint32_t numSamples); + + /** + * @brief Q15 complex conjugate. + * @param[in] *pSrc points to the input vector + * @param[out] *pDst points to the output vector + * @param[in] numSamples number of complex samples in each vector + * @return none. + */ + + void arm_cmplx_conj_q15( + q15_t * pSrc, + q15_t * pDst, + uint32_t numSamples); + + + + /** + * @brief Floating-point complex magnitude squared + * @param[in] *pSrc points to the complex input vector + * @param[out] *pDst points to the real output vector + * @param[in] numSamples number of complex samples in the input vector + * @return none. + */ + + void arm_cmplx_mag_squared_f32( + float32_t * pSrc, + float32_t * pDst, + uint32_t numSamples); + + /** + * @brief Q31 complex magnitude squared + * @param[in] *pSrc points to the complex input vector + * @param[out] *pDst points to the real output vector + * @param[in] numSamples number of complex samples in the input vector + * @return none. + */ + + void arm_cmplx_mag_squared_q31( + q31_t * pSrc, + q31_t * pDst, + uint32_t numSamples); + + /** + * @brief Q15 complex magnitude squared + * @param[in] *pSrc points to the complex input vector + * @param[out] *pDst points to the real output vector + * @param[in] numSamples number of complex samples in the input vector + * @return none. + */ + + void arm_cmplx_mag_squared_q15( + q15_t * pSrc, + q15_t * pDst, + uint32_t numSamples); + + + /** + * @ingroup groupController + */ + + /** + * @defgroup PID PID Motor Control + * + * A Proportional Integral Derivative (PID) controller is a generic feedback control + * loop mechanism widely used in industrial control systems. + * A PID controller is the most commonly used type of feedback controller. + * + * This set of functions implements (PID) controllers + * for Q15, Q31, and floating-point data types. The functions operate on a single sample + * of data and each call to the function returns a single processed value. + * S points to an instance of the PID control data structure. in + * is the input sample value. The functions return the output value. + * + * \par Algorithm: + *
+   *    y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2]
+   *    A0 = Kp + Ki + Kd
+   *    A1 = (-Kp ) - (2 * Kd )
+   *    A2 = Kd  
+ * + * \par + * where \c Kp is proportional constant, \c Ki is Integral constant and \c Kd is Derivative constant + * + * \par + * \image html PID.gif "Proportional Integral Derivative Controller" + * + * \par + * The PID controller calculates an "error" value as the difference between + * the measured output and the reference input. + * The controller attempts to minimize the error by adjusting the process control inputs. + * The proportional value determines the reaction to the current error, + * the integral value determines the reaction based on the sum of recent errors, + * and the derivative value determines the reaction based on the rate at which the error has been changing. + * + * \par Instance Structure + * The Gains A0, A1, A2 and state variables for a PID controller are stored together in an instance data structure. + * A separate instance structure must be defined for each PID Controller. + * There are separate instance structure declarations for each of the 3 supported data types. + * + * \par Reset Functions + * There is also an associated reset function for each data type which clears the state array. + * + * \par Initialization Functions + * There is also an associated initialization function for each data type. + * The initialization function performs the following operations: + * - Initializes the Gains A0, A1, A2 from Kp,Ki, Kd gains. + * - Zeros out the values in the state buffer. + * + * \par + * Instance structure cannot be placed into a const data section and it is recommended to use the initialization function. + * + * \par Fixed-Point Behavior + * Care must be taken when using the fixed-point versions of the PID Controller functions. + * In particular, the overflow and saturation behavior of the accumulator used in each function must be considered. + * Refer to the function specific documentation below for usage guidelines. + */ + + /** + * @addtogroup PID + * @{ + */ + + /** + * @brief Process function for the floating-point PID Control. + * @param[in,out] *S is an instance of the floating-point PID Control structure + * @param[in] in input sample to process + * @return out processed output sample. + */ + + + __STATIC_INLINE float32_t arm_pid_f32( + arm_pid_instance_f32 * S, + float32_t in) + { + float32_t out; + + /* y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2] */ + out = (S->A0 * in) + + (S->A1 * S->state[0]) + (S->A2 * S->state[1]) + (S->state[2]); + + /* Update state */ + S->state[1] = S->state[0]; + S->state[0] = in; + S->state[2] = out; + + /* return to application */ + return (out); + + } + + /** + * @brief Process function for the Q31 PID Control. + * @param[in,out] *S points to an instance of the Q31 PID Control structure + * @param[in] in input sample to process + * @return out processed output sample. + * + * Scaling and Overflow Behavior: + * \par + * The function is implemented using an internal 64-bit accumulator. + * The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit. + * Thus, if the accumulator result overflows it wraps around rather than clip. + * In order to avoid overflows completely the input signal must be scaled down by 2 bits as there are four additions. + * After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format. + */ + + __STATIC_INLINE q31_t arm_pid_q31( + arm_pid_instance_q31 * S, + q31_t in) + { + q63_t acc; + q31_t out; + + /* acc = A0 * x[n] */ + acc = (q63_t) S->A0 * in; + + /* acc += A1 * x[n-1] */ + acc += (q63_t) S->A1 * S->state[0]; + + /* acc += A2 * x[n-2] */ + acc += (q63_t) S->A2 * S->state[1]; + + /* convert output to 1.31 format to add y[n-1] */ + out = (q31_t) (acc >> 31u); + + /* out += y[n-1] */ + out += S->state[2]; + + /* Update state */ + S->state[1] = S->state[0]; + S->state[0] = in; + S->state[2] = out; + + /* return to application */ + return (out); + + } + + /** + * @brief Process function for the Q15 PID Control. + * @param[in,out] *S points to an instance of the Q15 PID Control structure + * @param[in] in input sample to process + * @return out processed output sample. + * + * Scaling and Overflow Behavior: + * \par + * The function is implemented using a 64-bit internal accumulator. + * Both Gains and state variables are represented in 1.15 format and multiplications yield a 2.30 result. + * The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format. + * There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved. + * After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits. + * Lastly, the accumulator is saturated to yield a result in 1.15 format. + */ + + __STATIC_INLINE q15_t arm_pid_q15( + arm_pid_instance_q15 * S, + q15_t in) + { + q63_t acc; + q15_t out; + + /* Implementation of PID controller */ + + #ifdef ARM_MATH_CM0 + + /* acc = A0 * x[n] */ + acc = ((q31_t) S->A0 )* in ; + + #else + + /* acc = A0 * x[n] */ + acc = (q31_t) __SMUAD(S->A0, in); + + #endif + + #ifdef ARM_MATH_CM0 + + /* acc += A1 * x[n-1] + A2 * x[n-2] */ + acc += (q31_t) S->A1 * S->state[0] ; + acc += (q31_t) S->A2 * S->state[1] ; + + #else + + /* acc += A1 * x[n-1] + A2 * x[n-2] */ + acc = __SMLALD(S->A1, (q31_t)__SIMD32(S->state), acc); + + #endif + + /* acc += y[n-1] */ + acc += (q31_t) S->state[2] << 15; + + /* saturate the output */ + out = (q15_t) (__SSAT((acc >> 15), 16)); + + /* Update state */ + S->state[1] = S->state[0]; + S->state[0] = in; + S->state[2] = out; + + /* return to application */ + return (out); + + } + + /** + * @} end of PID group + */ + + + /** + * @brief Floating-point matrix inverse. + * @param[in] *src points to the instance of the input floating-point matrix structure. + * @param[out] *dst points to the instance of the output floating-point matrix structure. + * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. + * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. + */ + + arm_status arm_mat_inverse_f32( + const arm_matrix_instance_f32 * src, + arm_matrix_instance_f32 * dst); + + + + /** + * @ingroup groupController + */ + + + /** + * @defgroup clarke Vector Clarke Transform + * Forward Clarke transform converts the instantaneous stator phases into a two-coordinate time invariant vector. + * Generally the Clarke transform uses three-phase currents Ia, Ib and Ic to calculate currents + * in the two-phase orthogonal stator axis Ialpha and Ibeta. + * When Ialpha is superposed with Ia as shown in the figure below + * \image html clarke.gif Stator current space vector and its components in (a,b). + * and Ia + Ib + Ic = 0, in this condition Ialpha and Ibeta + * can be calculated using only Ia and Ib. + * + * The function operates on a single sample of data and each call to the function returns the processed output. + * The library provides separate functions for Q31 and floating-point data types. + * \par Algorithm + * \image html clarkeFormula.gif + * where Ia and Ib are the instantaneous stator phases and + * pIalpha and pIbeta are the two coordinates of time invariant vector. + * \par Fixed-Point Behavior + * Care must be taken when using the Q31 version of the Clarke transform. + * In particular, the overflow and saturation behavior of the accumulator used must be considered. + * Refer to the function specific documentation below for usage guidelines. + */ + + /** + * @addtogroup clarke + * @{ + */ + + /** + * + * @brief Floating-point Clarke transform + * @param[in] Ia input three-phase coordinate a + * @param[in] Ib input three-phase coordinate b + * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha + * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta + * @return none. + */ + + __STATIC_INLINE void arm_clarke_f32( + float32_t Ia, + float32_t Ib, + float32_t * pIalpha, + float32_t * pIbeta) + { + /* Calculate pIalpha using the equation, pIalpha = Ia */ + *pIalpha = Ia; + + /* Calculate pIbeta using the equation, pIbeta = (1/sqrt(3)) * Ia + (2/sqrt(3)) * Ib */ + *pIbeta = ((float32_t) 0.57735026919 * Ia + (float32_t) 1.15470053838 * Ib); + + } + + /** + * @brief Clarke transform for Q31 version + * @param[in] Ia input three-phase coordinate a + * @param[in] Ib input three-phase coordinate b + * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha + * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta + * @return none. + * + * Scaling and Overflow Behavior: + * \par + * The function is implemented using an internal 32-bit accumulator. + * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. + * There is saturation on the addition, hence there is no risk of overflow. + */ + + __STATIC_INLINE void arm_clarke_q31( + q31_t Ia, + q31_t Ib, + q31_t * pIalpha, + q31_t * pIbeta) + { + q31_t product1, product2; /* Temporary variables used to store intermediate results */ + + /* Calculating pIalpha from Ia by equation pIalpha = Ia */ + *pIalpha = Ia; + + /* Intermediate product is calculated by (1/(sqrt(3)) * Ia) */ + product1 = (q31_t) (((q63_t) Ia * 0x24F34E8B) >> 30); + + /* Intermediate product is calculated by (2/sqrt(3) * Ib) */ + product2 = (q31_t) (((q63_t) Ib * 0x49E69D16) >> 30); + + /* pIbeta is calculated by adding the intermediate products */ + *pIbeta = __QADD(product1, product2); + } + + /** + * @} end of clarke group + */ + + /** + * @brief Converts the elements of the Q7 vector to Q31 vector. + * @param[in] *pSrc input pointer + * @param[out] *pDst output pointer + * @param[in] blockSize number of samples to process + * @return none. + */ + void arm_q7_to_q31( + q7_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + + + + /** + * @ingroup groupController + */ + + /** + * @defgroup inv_clarke Vector Inverse Clarke Transform + * Inverse Clarke transform converts the two-coordinate time invariant vector into instantaneous stator phases. + * + * The function operates on a single sample of data and each call to the function returns the processed output. + * The library provides separate functions for Q31 and floating-point data types. + * \par Algorithm + * \image html clarkeInvFormula.gif + * where pIa and pIb are the instantaneous stator phases and + * Ialpha and Ibeta are the two coordinates of time invariant vector. + * \par Fixed-Point Behavior + * Care must be taken when using the Q31 version of the Clarke transform. + * In particular, the overflow and saturation behavior of the accumulator used must be considered. + * Refer to the function specific documentation below for usage guidelines. + */ + + /** + * @addtogroup inv_clarke + * @{ + */ + + /** + * @brief Floating-point Inverse Clarke transform + * @param[in] Ialpha input two-phase orthogonal vector axis alpha + * @param[in] Ibeta input two-phase orthogonal vector axis beta + * @param[out] *pIa points to output three-phase coordinate a + * @param[out] *pIb points to output three-phase coordinate b + * @return none. + */ + + + __STATIC_INLINE void arm_inv_clarke_f32( + float32_t Ialpha, + float32_t Ibeta, + float32_t * pIa, + float32_t * pIb) + { + /* Calculating pIa from Ialpha by equation pIa = Ialpha */ + *pIa = Ialpha; + + /* Calculating pIb from Ialpha and Ibeta by equation pIb = -(1/2) * Ialpha + (sqrt(3)/2) * Ibeta */ + *pIb = -0.5 * Ialpha + (float32_t) 0.8660254039 *Ibeta; + + } + + /** + * @brief Inverse Clarke transform for Q31 version + * @param[in] Ialpha input two-phase orthogonal vector axis alpha + * @param[in] Ibeta input two-phase orthogonal vector axis beta + * @param[out] *pIa points to output three-phase coordinate a + * @param[out] *pIb points to output three-phase coordinate b + * @return none. + * + * Scaling and Overflow Behavior: + * \par + * The function is implemented using an internal 32-bit accumulator. + * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. + * There is saturation on the subtraction, hence there is no risk of overflow. + */ + + __STATIC_INLINE void arm_inv_clarke_q31( + q31_t Ialpha, + q31_t Ibeta, + q31_t * pIa, + q31_t * pIb) + { + q31_t product1, product2; /* Temporary variables used to store intermediate results */ + + /* Calculating pIa from Ialpha by equation pIa = Ialpha */ + *pIa = Ialpha; + + /* Intermediate product is calculated by (1/(2*sqrt(3)) * Ia) */ + product1 = (q31_t) (((q63_t) (Ialpha) * (0x40000000)) >> 31); + + /* Intermediate product is calculated by (1/sqrt(3) * pIb) */ + product2 = (q31_t) (((q63_t) (Ibeta) * (0x6ED9EBA1)) >> 31); + + /* pIb is calculated by subtracting the products */ + *pIb = __QSUB(product2, product1); + + } + + /** + * @} end of inv_clarke group + */ + + /** + * @brief Converts the elements of the Q7 vector to Q15 vector. + * @param[in] *pSrc input pointer + * @param[out] *pDst output pointer + * @param[in] blockSize number of samples to process + * @return none. + */ + void arm_q7_to_q15( + q7_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + + + /** + * @ingroup groupController + */ + + /** + * @defgroup park Vector Park Transform + * + * Forward Park transform converts the input two-coordinate vector to flux and torque components. + * The Park transform can be used to realize the transformation of the Ialpha and the Ibeta currents + * from the stationary to the moving reference frame and control the spatial relationship between + * the stator vector current and rotor flux vector. + * If we consider the d axis aligned with the rotor flux, the diagram below shows the + * current vector and the relationship from the two reference frames: + * \image html park.gif "Stator current space vector and its component in (a,b) and in the d,q rotating reference frame" + * + * The function operates on a single sample of data and each call to the function returns the processed output. + * The library provides separate functions for Q31 and floating-point data types. + * \par Algorithm + * \image html parkFormula.gif + * where Ialpha and Ibeta are the stator vector components, + * pId and pIq are rotor vector components and cosVal and sinVal are the + * cosine and sine values of theta (rotor flux position). + * \par Fixed-Point Behavior + * Care must be taken when using the Q31 version of the Park transform. + * In particular, the overflow and saturation behavior of the accumulator used must be considered. + * Refer to the function specific documentation below for usage guidelines. + */ + + /** + * @addtogroup park + * @{ + */ + + /** + * @brief Floating-point Park transform + * @param[in] Ialpha input two-phase vector coordinate alpha + * @param[in] Ibeta input two-phase vector coordinate beta + * @param[out] *pId points to output rotor reference frame d + * @param[out] *pIq points to output rotor reference frame q + * @param[in] sinVal sine value of rotation angle theta + * @param[in] cosVal cosine value of rotation angle theta + * @return none. + * + * The function implements the forward Park transform. + * + */ + + __STATIC_INLINE void arm_park_f32( + float32_t Ialpha, + float32_t Ibeta, + float32_t * pId, + float32_t * pIq, + float32_t sinVal, + float32_t cosVal) + { + /* Calculate pId using the equation, pId = Ialpha * cosVal + Ibeta * sinVal */ + *pId = Ialpha * cosVal + Ibeta * sinVal; + + /* Calculate pIq using the equation, pIq = - Ialpha * sinVal + Ibeta * cosVal */ + *pIq = -Ialpha * sinVal + Ibeta * cosVal; + + } + + /** + * @brief Park transform for Q31 version + * @param[in] Ialpha input two-phase vector coordinate alpha + * @param[in] Ibeta input two-phase vector coordinate beta + * @param[out] *pId points to output rotor reference frame d + * @param[out] *pIq points to output rotor reference frame q + * @param[in] sinVal sine value of rotation angle theta + * @param[in] cosVal cosine value of rotation angle theta + * @return none. + * + * Scaling and Overflow Behavior: + * \par + * The function is implemented using an internal 32-bit accumulator. + * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. + * There is saturation on the addition and subtraction, hence there is no risk of overflow. + */ + + + __STATIC_INLINE void arm_park_q31( + q31_t Ialpha, + q31_t Ibeta, + q31_t * pId, + q31_t * pIq, + q31_t sinVal, + q31_t cosVal) + { + q31_t product1, product2; /* Temporary variables used to store intermediate results */ + q31_t product3, product4; /* Temporary variables used to store intermediate results */ + + /* Intermediate product is calculated by (Ialpha * cosVal) */ + product1 = (q31_t) (((q63_t) (Ialpha) * (cosVal)) >> 31); + + /* Intermediate product is calculated by (Ibeta * sinVal) */ + product2 = (q31_t) (((q63_t) (Ibeta) * (sinVal)) >> 31); + + + /* Intermediate product is calculated by (Ialpha * sinVal) */ + product3 = (q31_t) (((q63_t) (Ialpha) * (sinVal)) >> 31); + + /* Intermediate product is calculated by (Ibeta * cosVal) */ + product4 = (q31_t) (((q63_t) (Ibeta) * (cosVal)) >> 31); + + /* Calculate pId by adding the two intermediate products 1 and 2 */ + *pId = __QADD(product1, product2); + + /* Calculate pIq by subtracting the two intermediate products 3 from 4 */ + *pIq = __QSUB(product4, product3); + } + + /** + * @} end of park group + */ + + /** + * @brief Converts the elements of the Q7 vector to floating-point vector. + * @param[in] *pSrc is input pointer + * @param[out] *pDst is output pointer + * @param[in] blockSize is the number of samples to process + * @return none. + */ + void arm_q7_to_float( + q7_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @ingroup groupController + */ + + /** + * @defgroup inv_park Vector Inverse Park transform + * Inverse Park transform converts the input flux and torque components to two-coordinate vector. + * + * The function operates on a single sample of data and each call to the function returns the processed output. + * The library provides separate functions for Q31 and floating-point data types. + * \par Algorithm + * \image html parkInvFormula.gif + * where pIalpha and pIbeta are the stator vector components, + * Id and Iq are rotor vector components and cosVal and sinVal are the + * cosine and sine values of theta (rotor flux position). + * \par Fixed-Point Behavior + * Care must be taken when using the Q31 version of the Park transform. + * In particular, the overflow and saturation behavior of the accumulator used must be considered. + * Refer to the function specific documentation below for usage guidelines. + */ + + /** + * @addtogroup inv_park + * @{ + */ + + /** + * @brief Floating-point Inverse Park transform + * @param[in] Id input coordinate of rotor reference frame d + * @param[in] Iq input coordinate of rotor reference frame q + * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha + * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta + * @param[in] sinVal sine value of rotation angle theta + * @param[in] cosVal cosine value of rotation angle theta + * @return none. + */ + + __STATIC_INLINE void arm_inv_park_f32( + float32_t Id, + float32_t Iq, + float32_t * pIalpha, + float32_t * pIbeta, + float32_t sinVal, + float32_t cosVal) + { + /* Calculate pIalpha using the equation, pIalpha = Id * cosVal - Iq * sinVal */ + *pIalpha = Id * cosVal - Iq * sinVal; + + /* Calculate pIbeta using the equation, pIbeta = Id * sinVal + Iq * cosVal */ + *pIbeta = Id * sinVal + Iq * cosVal; + + } + + + /** + * @brief Inverse Park transform for Q31 version + * @param[in] Id input coordinate of rotor reference frame d + * @param[in] Iq input coordinate of rotor reference frame q + * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha + * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta + * @param[in] sinVal sine value of rotation angle theta + * @param[in] cosVal cosine value of rotation angle theta + * @return none. + * + * Scaling and Overflow Behavior: + * \par + * The function is implemented using an internal 32-bit accumulator. + * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. + * There is saturation on the addition, hence there is no risk of overflow. + */ + + + __STATIC_INLINE void arm_inv_park_q31( + q31_t Id, + q31_t Iq, + q31_t * pIalpha, + q31_t * pIbeta, + q31_t sinVal, + q31_t cosVal) + { + q31_t product1, product2; /* Temporary variables used to store intermediate results */ + q31_t product3, product4; /* Temporary variables used to store intermediate results */ + + /* Intermediate product is calculated by (Id * cosVal) */ + product1 = (q31_t) (((q63_t) (Id) * (cosVal)) >> 31); + + /* Intermediate product is calculated by (Iq * sinVal) */ + product2 = (q31_t) (((q63_t) (Iq) * (sinVal)) >> 31); + + + /* Intermediate product is calculated by (Id * sinVal) */ + product3 = (q31_t) (((q63_t) (Id) * (sinVal)) >> 31); + + /* Intermediate product is calculated by (Iq * cosVal) */ + product4 = (q31_t) (((q63_t) (Iq) * (cosVal)) >> 31); + + /* Calculate pIalpha by using the two intermediate products 1 and 2 */ + *pIalpha = __QSUB(product1, product2); + + /* Calculate pIbeta by using the two intermediate products 3 and 4 */ + *pIbeta = __QADD(product4, product3); + + } + + /** + * @} end of Inverse park group + */ + + + /** + * @brief Converts the elements of the Q31 vector to floating-point vector. + * @param[in] *pSrc is input pointer + * @param[out] *pDst is output pointer + * @param[in] blockSize is the number of samples to process + * @return none. + */ + void arm_q31_to_float( + q31_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + /** + * @ingroup groupInterpolation + */ + + /** + * @defgroup LinearInterpolate Linear Interpolation + * + * Linear interpolation is a method of curve fitting using linear polynomials. + * Linear interpolation works by effectively drawing a straight line between two neighboring samples and returning the appropriate point along that line + * + * \par + * \image html LinearInterp.gif "Linear interpolation" + * + * \par + * A Linear Interpolate function calculates an output value(y), for the input(x) + * using linear interpolation of the input values x0, x1( nearest input values) and the output values y0 and y1(nearest output values) + * + * \par Algorithm: + *
+   *       y = y0 + (x - x0) * ((y1 - y0)/(x1-x0))
+   *       where x0, x1 are nearest values of input x
+   *             y0, y1 are nearest values to output y
+   * 
+ * + * \par + * This set of functions implements Linear interpolation process + * for Q7, Q15, Q31, and floating-point data types. The functions operate on a single + * sample of data and each call to the function returns a single processed value. + * S points to an instance of the Linear Interpolate function data structure. + * x is the input sample value. The functions returns the output value. + * + * \par + * if x is outside of the table boundary, Linear interpolation returns first value of the table + * if x is below input range and returns last value of table if x is above range. + */ + + /** + * @addtogroup LinearInterpolate + * @{ + */ + + /** + * @brief Process function for the floating-point Linear Interpolation Function. + * @param[in,out] *S is an instance of the floating-point Linear Interpolation structure + * @param[in] x input sample to process + * @return y processed output sample. + * + */ + + __STATIC_INLINE float32_t arm_linear_interp_f32( + arm_linear_interp_instance_f32 * S, + float32_t x) + { + + float32_t y; + float32_t x0, x1; /* Nearest input values */ + float32_t y0, y1; /* Nearest output values */ + float32_t xSpacing = S->xSpacing; /* spacing between input values */ + int32_t i; /* Index variable */ + float32_t *pYData = S->pYData; /* pointer to output table */ + + /* Calculation of index */ + i = (x - S->x1) / xSpacing; + + if(i < 0) + { + /* Iniatilize output for below specified range as least output value of table */ + y = pYData[0]; + } + else if(i >= S->nValues) + { + /* Iniatilize output for above specified range as last output value of table */ + y = pYData[S->nValues-1]; + } + else + { + /* Calculation of nearest input values */ + x0 = S->x1 + i * xSpacing; + x1 = S->x1 + (i +1) * xSpacing; + + /* Read of nearest output values */ + y0 = pYData[i]; + y1 = pYData[i + 1]; + + /* Calculation of output */ + y = y0 + (x - x0) * ((y1 - y0)/(x1-x0)); + + } + + /* returns output value */ + return (y); + } + + /** + * + * @brief Process function for the Q31 Linear Interpolation Function. + * @param[in] *pYData pointer to Q31 Linear Interpolation table + * @param[in] x input sample to process + * @param[in] nValues number of table values + * @return y processed output sample. + * + * \par + * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. + * This function can support maximum of table size 2^12. + * + */ + + + __STATIC_INLINE q31_t arm_linear_interp_q31(q31_t *pYData, + q31_t x, uint32_t nValues) + { + q31_t y; /* output */ + q31_t y0, y1; /* Nearest output values */ + q31_t fract; /* fractional part */ + int32_t index; /* Index to read nearest output values */ + + /* Input is in 12.20 format */ + /* 12 bits for the table index */ + /* Index value calculation */ + index = ((x & 0xFFF00000) >> 20); + + if(index >= (nValues - 1)) + { + return(pYData[nValues - 1]); + } + else if(index < 0) + { + return(pYData[0]); + } + else + { + + /* 20 bits for the fractional part */ + /* shift left by 11 to keep fract in 1.31 format */ + fract = (x & 0x000FFFFF) << 11; + + /* Read two nearest output values from the index in 1.31(q31) format */ + y0 = pYData[index]; + y1 = pYData[index + 1u]; + + /* Calculation of y0 * (1-fract) and y is in 2.30 format */ + y = ((q31_t) ((q63_t) y0 * (0x7FFFFFFF - fract) >> 32)); + + /* Calculation of y0 * (1-fract) + y1 *fract and y is in 2.30 format */ + y += ((q31_t) (((q63_t) y1 * fract) >> 32)); + + /* Convert y to 1.31 format */ + return (y << 1u); + + } + + } + + /** + * + * @brief Process function for the Q15 Linear Interpolation Function. + * @param[in] *pYData pointer to Q15 Linear Interpolation table + * @param[in] x input sample to process + * @param[in] nValues number of table values + * @return y processed output sample. + * + * \par + * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. + * This function can support maximum of table size 2^12. + * + */ + + + __STATIC_INLINE q15_t arm_linear_interp_q15(q15_t *pYData, q31_t x, uint32_t nValues) + { + q63_t y; /* output */ + q15_t y0, y1; /* Nearest output values */ + q31_t fract; /* fractional part */ + int32_t index; /* Index to read nearest output values */ + + /* Input is in 12.20 format */ + /* 12 bits for the table index */ + /* Index value calculation */ + index = ((x & 0xFFF00000) >> 20u); + + if(index >= (nValues - 1)) + { + return(pYData[nValues - 1]); + } + else if(index < 0) + { + return(pYData[0]); + } + else + { + /* 20 bits for the fractional part */ + /* fract is in 12.20 format */ + fract = (x & 0x000FFFFF); + + /* Read two nearest output values from the index */ + y0 = pYData[index]; + y1 = pYData[index + 1u]; + + /* Calculation of y0 * (1-fract) and y is in 13.35 format */ + y = ((q63_t) y0 * (0xFFFFF - fract)); + + /* Calculation of (y0 * (1-fract) + y1 * fract) and y is in 13.35 format */ + y += ((q63_t) y1 * (fract)); + + /* convert y to 1.15 format */ + return (y >> 20); + } + + + } + + /** + * + * @brief Process function for the Q7 Linear Interpolation Function. + * @param[in] *pYData pointer to Q7 Linear Interpolation table + * @param[in] x input sample to process + * @param[in] nValues number of table values + * @return y processed output sample. + * + * \par + * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. + * This function can support maximum of table size 2^12. + */ + + + __STATIC_INLINE q7_t arm_linear_interp_q7(q7_t *pYData, q31_t x, uint32_t nValues) + { + q31_t y; /* output */ + q7_t y0, y1; /* Nearest output values */ + q31_t fract; /* fractional part */ + int32_t index; /* Index to read nearest output values */ + + /* Input is in 12.20 format */ + /* 12 bits for the table index */ + /* Index value calculation */ + index = ((x & 0xFFF00000) >> 20u); + + + if(index >= (nValues - 1)) + { + return(pYData[nValues - 1]); + } + else if(index < 0) + { + return(pYData[0]); + } + else + { + + /* 20 bits for the fractional part */ + /* fract is in 12.20 format */ + fract = (x & 0x000FFFFF); + + /* Read two nearest output values from the index and are in 1.7(q7) format */ + y0 = pYData[index]; + y1 = pYData[index + 1u]; + + /* Calculation of y0 * (1-fract ) and y is in 13.27(q27) format */ + y = ((y0 * (0xFFFFF - fract))); + + /* Calculation of y1 * fract + y0 * (1-fract) and y is in 13.27(q27) format */ + y += (y1 * fract); + + /* convert y to 1.7(q7) format */ + return (y >> 20u); + + } + + } + /** + * @} end of LinearInterpolate group + */ + + /** + * @brief Fast approximation to the trigonometric sine function for floating-point data. + * @param[in] x input value in radians. + * @return sin(x). + */ + + float32_t arm_sin_f32( + float32_t x); + + /** + * @brief Fast approximation to the trigonometric sine function for Q31 data. + * @param[in] x Scaled input value in radians. + * @return sin(x). + */ + + q31_t arm_sin_q31( + q31_t x); + + /** + * @brief Fast approximation to the trigonometric sine function for Q15 data. + * @param[in] x Scaled input value in radians. + * @return sin(x). + */ + + q15_t arm_sin_q15( + q15_t x); + + /** + * @brief Fast approximation to the trigonometric cosine function for floating-point data. + * @param[in] x input value in radians. + * @return cos(x). + */ + + float32_t arm_cos_f32( + float32_t x); + + /** + * @brief Fast approximation to the trigonometric cosine function for Q31 data. + * @param[in] x Scaled input value in radians. + * @return cos(x). + */ + + q31_t arm_cos_q31( + q31_t x); + + /** + * @brief Fast approximation to the trigonometric cosine function for Q15 data. + * @param[in] x Scaled input value in radians. + * @return cos(x). + */ + + q15_t arm_cos_q15( + q15_t x); + + + /** + * @ingroup groupFastMath + */ + + + /** + * @defgroup SQRT Square Root + * + * Computes the square root of a number. + * There are separate functions for Q15, Q31, and floating-point data types. + * The square root function is computed using the Newton-Raphson algorithm. + * This is an iterative algorithm of the form: + *
+   *      x1 = x0 - f(x0)/f'(x0)
+   * 
+ * where x1 is the current estimate, + * x0 is the previous estimate and + * f'(x0) is the derivative of f() evaluated at x0. + * For the square root function, the algorithm reduces to: + *
+   *     x0 = in/2                         [initial guess]
+   *     x1 = 1/2 * ( x0 + in / x0)        [each iteration]
+   * 
+ */ + + + /** + * @addtogroup SQRT + * @{ + */ + + /** + * @brief Floating-point square root function. + * @param[in] in input value. + * @param[out] *pOut square root of input value. + * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if + * in is negative value and returns zero output for negative values. + */ + + __STATIC_INLINE arm_status arm_sqrt_f32( + float32_t in, float32_t *pOut) + { + if(in > 0) + { + +// #if __FPU_USED + #if (__FPU_USED == 1) && defined ( __CC_ARM ) + *pOut = __sqrtf(in); + #elif (__FPU_USED == 1) && defined ( __TMS_740 ) + *pOut = __builtin_sqrtf(in); + #else + *pOut = sqrtf(in); + #endif + + return (ARM_MATH_SUCCESS); + } + else + { + *pOut = 0.0f; + return (ARM_MATH_ARGUMENT_ERROR); + } + + } + + + /** + * @brief Q31 square root function. + * @param[in] in input value. The range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF. + * @param[out] *pOut square root of input value. + * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if + * in is negative value and returns zero output for negative values. + */ + arm_status arm_sqrt_q31( + q31_t in, q31_t *pOut); + + /** + * @brief Q15 square root function. + * @param[in] in input value. The range of the input value is [0 +1) or 0x0000 to 0x7FFF. + * @param[out] *pOut square root of input value. + * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if + * in is negative value and returns zero output for negative values. + */ + arm_status arm_sqrt_q15( + q15_t in, q15_t *pOut); + + /** + * @} end of SQRT group + */ + + + + + + + /** + * @brief floating-point Circular write function. + */ + + __STATIC_INLINE void arm_circularWrite_f32( + int32_t * circBuffer, + int32_t L, + uint16_t * writeOffset, + int32_t bufferInc, + const int32_t * src, + int32_t srcInc, + uint32_t blockSize) + { + uint32_t i = 0u; + int32_t wOffset; + + /* Copy the value of Index pointer that points + * to the current location where the input samples to be copied */ + wOffset = *writeOffset; + + /* Loop over the blockSize */ + i = blockSize; + + while(i > 0u) + { + /* copy the input sample to the circular buffer */ + circBuffer[wOffset] = *src; + + /* Update the input pointer */ + src += srcInc; + + /* Circularly update wOffset. Watch out for positive and negative value */ + wOffset += bufferInc; + if(wOffset >= L) + wOffset -= L; + + /* Decrement the loop counter */ + i--; + } + + /* Update the index pointer */ + *writeOffset = wOffset; + } + + + + /** + * @brief floating-point Circular Read function. + */ + __STATIC_INLINE void arm_circularRead_f32( + int32_t * circBuffer, + int32_t L, + int32_t * readOffset, + int32_t bufferInc, + int32_t * dst, + int32_t * dst_base, + int32_t dst_length, + int32_t dstInc, + uint32_t blockSize) + { + uint32_t i = 0u; + int32_t rOffset, dst_end; + + /* Copy the value of Index pointer that points + * to the current location from where the input samples to be read */ + rOffset = *readOffset; + dst_end = (int32_t) (dst_base + dst_length); + + /* Loop over the blockSize */ + i = blockSize; + + while(i > 0u) + { + /* copy the sample from the circular buffer to the destination buffer */ + *dst = circBuffer[rOffset]; + + /* Update the input pointer */ + dst += dstInc; + + if(dst == (int32_t *) dst_end) + { + dst = dst_base; + } + + /* Circularly update rOffset. Watch out for positive and negative value */ + rOffset += bufferInc; + + if(rOffset >= L) + { + rOffset -= L; + } + + /* Decrement the loop counter */ + i--; + } + + /* Update the index pointer */ + *readOffset = rOffset; + } + + /** + * @brief Q15 Circular write function. + */ + + __STATIC_INLINE void arm_circularWrite_q15( + q15_t * circBuffer, + int32_t L, + uint16_t * writeOffset, + int32_t bufferInc, + const q15_t * src, + int32_t srcInc, + uint32_t blockSize) + { + uint32_t i = 0u; + int32_t wOffset; + + /* Copy the value of Index pointer that points + * to the current location where the input samples to be copied */ + wOffset = *writeOffset; + + /* Loop over the blockSize */ + i = blockSize; + + while(i > 0u) + { + /* copy the input sample to the circular buffer */ + circBuffer[wOffset] = *src; + + /* Update the input pointer */ + src += srcInc; + + /* Circularly update wOffset. Watch out for positive and negative value */ + wOffset += bufferInc; + if(wOffset >= L) + wOffset -= L; + + /* Decrement the loop counter */ + i--; + } + + /* Update the index pointer */ + *writeOffset = wOffset; + } + + + + /** + * @brief Q15 Circular Read function. + */ + __STATIC_INLINE void arm_circularRead_q15( + q15_t * circBuffer, + int32_t L, + int32_t * readOffset, + int32_t bufferInc, + q15_t * dst, + q15_t * dst_base, + int32_t dst_length, + int32_t dstInc, + uint32_t blockSize) + { + uint32_t i = 0; + int32_t rOffset, dst_end; + + /* Copy the value of Index pointer that points + * to the current location from where the input samples to be read */ + rOffset = *readOffset; + + dst_end = (int32_t) (dst_base + dst_length); + + /* Loop over the blockSize */ + i = blockSize; + + while(i > 0u) + { + /* copy the sample from the circular buffer to the destination buffer */ + *dst = circBuffer[rOffset]; + + /* Update the input pointer */ + dst += dstInc; + + if(dst == (q15_t *) dst_end) + { + dst = dst_base; + } + + /* Circularly update wOffset. Watch out for positive and negative value */ + rOffset += bufferInc; + + if(rOffset >= L) + { + rOffset -= L; + } + + /* Decrement the loop counter */ + i--; + } + + /* Update the index pointer */ + *readOffset = rOffset; + } + + + /** + * @brief Q7 Circular write function. + */ + + __STATIC_INLINE void arm_circularWrite_q7( + q7_t * circBuffer, + int32_t L, + uint16_t * writeOffset, + int32_t bufferInc, + const q7_t * src, + int32_t srcInc, + uint32_t blockSize) + { + uint32_t i = 0u; + int32_t wOffset; + + /* Copy the value of Index pointer that points + * to the current location where the input samples to be copied */ + wOffset = *writeOffset; + + /* Loop over the blockSize */ + i = blockSize; + + while(i > 0u) + { + /* copy the input sample to the circular buffer */ + circBuffer[wOffset] = *src; + + /* Update the input pointer */ + src += srcInc; + + /* Circularly update wOffset. Watch out for positive and negative value */ + wOffset += bufferInc; + if(wOffset >= L) + wOffset -= L; + + /* Decrement the loop counter */ + i--; + } + + /* Update the index pointer */ + *writeOffset = wOffset; + } + + + + /** + * @brief Q7 Circular Read function. + */ + __STATIC_INLINE void arm_circularRead_q7( + q7_t * circBuffer, + int32_t L, + int32_t * readOffset, + int32_t bufferInc, + q7_t * dst, + q7_t * dst_base, + int32_t dst_length, + int32_t dstInc, + uint32_t blockSize) + { + uint32_t i = 0; + int32_t rOffset, dst_end; + + /* Copy the value of Index pointer that points + * to the current location from where the input samples to be read */ + rOffset = *readOffset; + + dst_end = (int32_t) (dst_base + dst_length); + + /* Loop over the blockSize */ + i = blockSize; + + while(i > 0u) + { + /* copy the sample from the circular buffer to the destination buffer */ + *dst = circBuffer[rOffset]; + + /* Update the input pointer */ + dst += dstInc; + + if(dst == (q7_t *) dst_end) + { + dst = dst_base; + } + + /* Circularly update rOffset. Watch out for positive and negative value */ + rOffset += bufferInc; + + if(rOffset >= L) + { + rOffset -= L; + } + + /* Decrement the loop counter */ + i--; + } + + /* Update the index pointer */ + *readOffset = rOffset; + } + + + /** + * @brief Sum of the squares of the elements of a Q31 vector. + * @param[in] *pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] *pResult is output value. + * @return none. + */ + + void arm_power_q31( + q31_t * pSrc, + uint32_t blockSize, + q63_t * pResult); + + /** + * @brief Sum of the squares of the elements of a floating-point vector. + * @param[in] *pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] *pResult is output value. + * @return none. + */ + + void arm_power_f32( + float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult); + + /** + * @brief Sum of the squares of the elements of a Q15 vector. + * @param[in] *pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] *pResult is output value. + * @return none. + */ + + void arm_power_q15( + q15_t * pSrc, + uint32_t blockSize, + q63_t * pResult); + + /** + * @brief Sum of the squares of the elements of a Q7 vector. + * @param[in] *pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] *pResult is output value. + * @return none. + */ + + void arm_power_q7( + q7_t * pSrc, + uint32_t blockSize, + q31_t * pResult); + + /** + * @brief Mean value of a Q7 vector. + * @param[in] *pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] *pResult is output value. + * @return none. + */ + + void arm_mean_q7( + q7_t * pSrc, + uint32_t blockSize, + q7_t * pResult); + + /** + * @brief Mean value of a Q15 vector. + * @param[in] *pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] *pResult is output value. + * @return none. + */ + void arm_mean_q15( + q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult); + + /** + * @brief Mean value of a Q31 vector. + * @param[in] *pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] *pResult is output value. + * @return none. + */ + void arm_mean_q31( + q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult); + + /** + * @brief Mean value of a floating-point vector. + * @param[in] *pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] *pResult is output value. + * @return none. + */ + void arm_mean_f32( + float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult); + + /** + * @brief Variance of the elements of a floating-point vector. + * @param[in] *pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] *pResult is output value. + * @return none. + */ + + void arm_var_f32( + float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult); + + /** + * @brief Variance of the elements of a Q31 vector. + * @param[in] *pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] *pResult is output value. + * @return none. + */ + + void arm_var_q31( + q31_t * pSrc, + uint32_t blockSize, + q63_t * pResult); + + /** + * @brief Variance of the elements of a Q15 vector. + * @param[in] *pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] *pResult is output value. + * @return none. + */ + + void arm_var_q15( + q15_t * pSrc, + uint32_t blockSize, + q31_t * pResult); + + /** + * @brief Root Mean Square of the elements of a floating-point vector. + * @param[in] *pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] *pResult is output value. + * @return none. + */ + + void arm_rms_f32( + float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult); + + /** + * @brief Root Mean Square of the elements of a Q31 vector. + * @param[in] *pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] *pResult is output value. + * @return none. + */ + + void arm_rms_q31( + q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult); + + /** + * @brief Root Mean Square of the elements of a Q15 vector. + * @param[in] *pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] *pResult is output value. + * @return none. + */ + + void arm_rms_q15( + q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult); + + /** + * @brief Standard deviation of the elements of a floating-point vector. + * @param[in] *pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] *pResult is output value. + * @return none. + */ + + void arm_std_f32( + float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult); + + /** + * @brief Standard deviation of the elements of a Q31 vector. + * @param[in] *pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] *pResult is output value. + * @return none. + */ + + void arm_std_q31( + q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult); + + /** + * @brief Standard deviation of the elements of a Q15 vector. + * @param[in] *pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] *pResult is output value. + * @return none. + */ + + void arm_std_q15( + q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult); + + /** + * @brief Floating-point complex magnitude + * @param[in] *pSrc points to the complex input vector + * @param[out] *pDst points to the real output vector + * @param[in] numSamples number of complex samples in the input vector + * @return none. + */ + + void arm_cmplx_mag_f32( + float32_t * pSrc, + float32_t * pDst, + uint32_t numSamples); + + /** + * @brief Q31 complex magnitude + * @param[in] *pSrc points to the complex input vector + * @param[out] *pDst points to the real output vector + * @param[in] numSamples number of complex samples in the input vector + * @return none. + */ + + void arm_cmplx_mag_q31( + q31_t * pSrc, + q31_t * pDst, + uint32_t numSamples); + + /** + * @brief Q15 complex magnitude + * @param[in] *pSrc points to the complex input vector + * @param[out] *pDst points to the real output vector + * @param[in] numSamples number of complex samples in the input vector + * @return none. + */ + + void arm_cmplx_mag_q15( + q15_t * pSrc, + q15_t * pDst, + uint32_t numSamples); + + /** + * @brief Q15 complex dot product + * @param[in] *pSrcA points to the first input vector + * @param[in] *pSrcB points to the second input vector + * @param[in] numSamples number of complex samples in each vector + * @param[out] *realResult real part of the result returned here + * @param[out] *imagResult imaginary part of the result returned here + * @return none. + */ + + void arm_cmplx_dot_prod_q15( + q15_t * pSrcA, + q15_t * pSrcB, + uint32_t numSamples, + q31_t * realResult, + q31_t * imagResult); + + /** + * @brief Q31 complex dot product + * @param[in] *pSrcA points to the first input vector + * @param[in] *pSrcB points to the second input vector + * @param[in] numSamples number of complex samples in each vector + * @param[out] *realResult real part of the result returned here + * @param[out] *imagResult imaginary part of the result returned here + * @return none. + */ + + void arm_cmplx_dot_prod_q31( + q31_t * pSrcA, + q31_t * pSrcB, + uint32_t numSamples, + q63_t * realResult, + q63_t * imagResult); + + /** + * @brief Floating-point complex dot product + * @param[in] *pSrcA points to the first input vector + * @param[in] *pSrcB points to the second input vector + * @param[in] numSamples number of complex samples in each vector + * @param[out] *realResult real part of the result returned here + * @param[out] *imagResult imaginary part of the result returned here + * @return none. + */ + + void arm_cmplx_dot_prod_f32( + float32_t * pSrcA, + float32_t * pSrcB, + uint32_t numSamples, + float32_t * realResult, + float32_t * imagResult); + + /** + * @brief Q15 complex-by-real multiplication + * @param[in] *pSrcCmplx points to the complex input vector + * @param[in] *pSrcReal points to the real input vector + * @param[out] *pCmplxDst points to the complex output vector + * @param[in] numSamples number of samples in each vector + * @return none. + */ + + void arm_cmplx_mult_real_q15( + q15_t * pSrcCmplx, + q15_t * pSrcReal, + q15_t * pCmplxDst, + uint32_t numSamples); + + /** + * @brief Q31 complex-by-real multiplication + * @param[in] *pSrcCmplx points to the complex input vector + * @param[in] *pSrcReal points to the real input vector + * @param[out] *pCmplxDst points to the complex output vector + * @param[in] numSamples number of samples in each vector + * @return none. + */ + + void arm_cmplx_mult_real_q31( + q31_t * pSrcCmplx, + q31_t * pSrcReal, + q31_t * pCmplxDst, + uint32_t numSamples); + + /** + * @brief Floating-point complex-by-real multiplication + * @param[in] *pSrcCmplx points to the complex input vector + * @param[in] *pSrcReal points to the real input vector + * @param[out] *pCmplxDst points to the complex output vector + * @param[in] numSamples number of samples in each vector + * @return none. + */ + + void arm_cmplx_mult_real_f32( + float32_t * pSrcCmplx, + float32_t * pSrcReal, + float32_t * pCmplxDst, + uint32_t numSamples); + + /** + * @brief Minimum value of a Q7 vector. + * @param[in] *pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] *result is output pointer + * @param[in] index is the array index of the minimum value in the input buffer. + * @return none. + */ + + void arm_min_q7( + q7_t * pSrc, + uint32_t blockSize, + q7_t * result, + uint32_t * index); + + /** + * @brief Minimum value of a Q15 vector. + * @param[in] *pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] *pResult is output pointer + * @param[in] *pIndex is the array index of the minimum value in the input buffer. + * @return none. + */ + + void arm_min_q15( + q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult, + uint32_t * pIndex); + + /** + * @brief Minimum value of a Q31 vector. + * @param[in] *pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] *pResult is output pointer + * @param[out] *pIndex is the array index of the minimum value in the input buffer. + * @return none. + */ + void arm_min_q31( + q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult, + uint32_t * pIndex); + + /** + * @brief Minimum value of a floating-point vector. + * @param[in] *pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] *pResult is output pointer + * @param[out] *pIndex is the array index of the minimum value in the input buffer. + * @return none. + */ + + void arm_min_f32( + float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult, + uint32_t * pIndex); + +/** + * @brief Maximum value of a Q7 vector. + * @param[in] *pSrc points to the input buffer + * @param[in] blockSize length of the input vector + * @param[out] *pResult maximum value returned here + * @param[out] *pIndex index of maximum value returned here + * @return none. + */ + + void arm_max_q7( + q7_t * pSrc, + uint32_t blockSize, + q7_t * pResult, + uint32_t * pIndex); + +/** + * @brief Maximum value of a Q15 vector. + * @param[in] *pSrc points to the input buffer + * @param[in] blockSize length of the input vector + * @param[out] *pResult maximum value returned here + * @param[out] *pIndex index of maximum value returned here + * @return none. + */ + + void arm_max_q15( + q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult, + uint32_t * pIndex); + +/** + * @brief Maximum value of a Q31 vector. + * @param[in] *pSrc points to the input buffer + * @param[in] blockSize length of the input vector + * @param[out] *pResult maximum value returned here + * @param[out] *pIndex index of maximum value returned here + * @return none. + */ + + void arm_max_q31( + q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult, + uint32_t * pIndex); + +/** + * @brief Maximum value of a floating-point vector. + * @param[in] *pSrc points to the input buffer + * @param[in] blockSize length of the input vector + * @param[out] *pResult maximum value returned here + * @param[out] *pIndex index of maximum value returned here + * @return none. + */ + + void arm_max_f32( + float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult, + uint32_t * pIndex); + + /** + * @brief Q15 complex-by-complex multiplication + * @param[in] *pSrcA points to the first input vector + * @param[in] *pSrcB points to the second input vector + * @param[out] *pDst points to the output vector + * @param[in] numSamples number of complex samples in each vector + * @return none. + */ + + void arm_cmplx_mult_cmplx_q15( + q15_t * pSrcA, + q15_t * pSrcB, + q15_t * pDst, + uint32_t numSamples); + + /** + * @brief Q31 complex-by-complex multiplication + * @param[in] *pSrcA points to the first input vector + * @param[in] *pSrcB points to the second input vector + * @param[out] *pDst points to the output vector + * @param[in] numSamples number of complex samples in each vector + * @return none. + */ + + void arm_cmplx_mult_cmplx_q31( + q31_t * pSrcA, + q31_t * pSrcB, + q31_t * pDst, + uint32_t numSamples); + + /** + * @brief Floating-point complex-by-complex multiplication + * @param[in] *pSrcA points to the first input vector + * @param[in] *pSrcB points to the second input vector + * @param[out] *pDst points to the output vector + * @param[in] numSamples number of complex samples in each vector + * @return none. + */ + + void arm_cmplx_mult_cmplx_f32( + float32_t * pSrcA, + float32_t * pSrcB, + float32_t * pDst, + uint32_t numSamples); + + /** + * @brief Converts the elements of the floating-point vector to Q31 vector. + * @param[in] *pSrc points to the floating-point input vector + * @param[out] *pDst points to the Q31 output vector + * @param[in] blockSize length of the input vector + * @return none. + */ + void arm_float_to_q31( + float32_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + /** + * @brief Converts the elements of the floating-point vector to Q15 vector. + * @param[in] *pSrc points to the floating-point input vector + * @param[out] *pDst points to the Q15 output vector + * @param[in] blockSize length of the input vector + * @return none + */ + void arm_float_to_q15( + float32_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + /** + * @brief Converts the elements of the floating-point vector to Q7 vector. + * @param[in] *pSrc points to the floating-point input vector + * @param[out] *pDst points to the Q7 output vector + * @param[in] blockSize length of the input vector + * @return none + */ + void arm_float_to_q7( + float32_t * pSrc, + q7_t * pDst, + uint32_t blockSize); + + + /** + * @brief Converts the elements of the Q31 vector to Q15 vector. + * @param[in] *pSrc is input pointer + * @param[out] *pDst is output pointer + * @param[in] blockSize is the number of samples to process + * @return none. + */ + void arm_q31_to_q15( + q31_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + /** + * @brief Converts the elements of the Q31 vector to Q7 vector. + * @param[in] *pSrc is input pointer + * @param[out] *pDst is output pointer + * @param[in] blockSize is the number of samples to process + * @return none. + */ + void arm_q31_to_q7( + q31_t * pSrc, + q7_t * pDst, + uint32_t blockSize); + + /** + * @brief Converts the elements of the Q15 vector to floating-point vector. + * @param[in] *pSrc is input pointer + * @param[out] *pDst is output pointer + * @param[in] blockSize is the number of samples to process + * @return none. + */ + void arm_q15_to_float( + q15_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @brief Converts the elements of the Q15 vector to Q31 vector. + * @param[in] *pSrc is input pointer + * @param[out] *pDst is output pointer + * @param[in] blockSize is the number of samples to process + * @return none. + */ + void arm_q15_to_q31( + q15_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + + /** + * @brief Converts the elements of the Q15 vector to Q7 vector. + * @param[in] *pSrc is input pointer + * @param[out] *pDst is output pointer + * @param[in] blockSize is the number of samples to process + * @return none. + */ + void arm_q15_to_q7( + q15_t * pSrc, + q7_t * pDst, + uint32_t blockSize); + + + /** + * @ingroup groupInterpolation + */ + + /** + * @defgroup BilinearInterpolate Bilinear Interpolation + * + * Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid. + * The underlying function f(x, y) is sampled on a regular grid and the interpolation process + * determines values between the grid points. + * Bilinear interpolation is equivalent to two step linear interpolation, first in the x-dimension and then in the y-dimension. + * Bilinear interpolation is often used in image processing to rescale images. + * The CMSIS DSP library provides bilinear interpolation functions for Q7, Q15, Q31, and floating-point data types. + * + * Algorithm + * \par + * The instance structure used by the bilinear interpolation functions describes a two dimensional data table. + * For floating-point, the instance structure is defined as: + *
+   *   typedef struct
+   *   {
+   *     uint16_t numRows;
+   *     uint16_t numCols;
+   *     float32_t *pData;
+   * } arm_bilinear_interp_instance_f32;
+   * 
+ * + * \par + * where numRows specifies the number of rows in the table; + * numCols specifies the number of columns in the table; + * and pData points to an array of size numRows*numCols values. + * The data table pTable is organized in row order and the supplied data values fall on integer indexes. + * That is, table element (x,y) is located at pTable[x + y*numCols] where x and y are integers. + * + * \par + * Let (x, y) specify the desired interpolation point. Then define: + *
+   *     XF = floor(x)
+   *     YF = floor(y)
+   * 
+ * \par + * The interpolated output point is computed as: + *
+   *  f(x, y) = f(XF, YF) * (1-(x-XF)) * (1-(y-YF))
+   *           + f(XF+1, YF) * (x-XF)*(1-(y-YF))
+   *           + f(XF, YF+1) * (1-(x-XF))*(y-YF)
+   *           + f(XF+1, YF+1) * (x-XF)*(y-YF)
+   * 
+ * Note that the coordinates (x, y) contain integer and fractional components. + * The integer components specify which portion of the table to use while the + * fractional components control the interpolation processor. + * + * \par + * if (x,y) are outside of the table boundary, Bilinear interpolation returns zero output. + */ + + /** + * @addtogroup BilinearInterpolate + * @{ + */ + + /** + * + * @brief Floating-point bilinear interpolation. + * @param[in,out] *S points to an instance of the interpolation structure. + * @param[in] X interpolation coordinate. + * @param[in] Y interpolation coordinate. + * @return out interpolated value. + */ + + + __STATIC_INLINE float32_t arm_bilinear_interp_f32( + const arm_bilinear_interp_instance_f32 * S, + float32_t X, + float32_t Y) + { + float32_t out; + float32_t f00, f01, f10, f11; + float32_t *pData = S->pData; + int32_t xIndex, yIndex, index; + float32_t xdiff, ydiff; + float32_t b1, b2, b3, b4; + + xIndex = (int32_t) X; + yIndex = (int32_t) Y; + + /* Care taken for table outside boundary */ + /* Returns zero output when values are outside table boundary */ + if(xIndex < 0 || xIndex > (S->numRows-1) || yIndex < 0 || yIndex > ( S->numCols-1)) + { + return(0); + } + + /* Calculation of index for two nearest points in X-direction */ + index = (xIndex - 1) + (yIndex-1) * S->numCols ; + + + /* Read two nearest points in X-direction */ + f00 = pData[index]; + f01 = pData[index + 1]; + + /* Calculation of index for two nearest points in Y-direction */ + index = (xIndex-1) + (yIndex) * S->numCols; + + + /* Read two nearest points in Y-direction */ + f10 = pData[index]; + f11 = pData[index + 1]; + + /* Calculation of intermediate values */ + b1 = f00; + b2 = f01 - f00; + b3 = f10 - f00; + b4 = f00 - f01 - f10 + f11; + + /* Calculation of fractional part in X */ + xdiff = X - xIndex; + + /* Calculation of fractional part in Y */ + ydiff = Y - yIndex; + + /* Calculation of bi-linear interpolated output */ + out = b1 + b2 * xdiff + b3 * ydiff + b4 * xdiff * ydiff; + + /* return to application */ + return (out); + + } + + /** + * + * @brief Q31 bilinear interpolation. + * @param[in,out] *S points to an instance of the interpolation structure. + * @param[in] X interpolation coordinate in 12.20 format. + * @param[in] Y interpolation coordinate in 12.20 format. + * @return out interpolated value. + */ + + __STATIC_INLINE q31_t arm_bilinear_interp_q31( + arm_bilinear_interp_instance_q31 * S, + q31_t X, + q31_t Y) + { + q31_t out; /* Temporary output */ + q31_t acc = 0; /* output */ + q31_t xfract, yfract; /* X, Y fractional parts */ + q31_t x1, x2, y1, y2; /* Nearest output values */ + int32_t rI, cI; /* Row and column indices */ + q31_t *pYData = S->pData; /* pointer to output table values */ + uint32_t nCols = S->numCols; /* num of rows */ + + + /* Input is in 12.20 format */ + /* 12 bits for the table index */ + /* Index value calculation */ + rI = ((X & 0xFFF00000) >> 20u); + + /* Input is in 12.20 format */ + /* 12 bits for the table index */ + /* Index value calculation */ + cI = ((Y & 0xFFF00000) >> 20u); + + /* Care taken for table outside boundary */ + /* Returns zero output when values are outside table boundary */ + if(rI < 0 || rI > (S->numRows-1) || cI < 0 || cI > ( S->numCols-1)) + { + return(0); + } + + /* 20 bits for the fractional part */ + /* shift left xfract by 11 to keep 1.31 format */ + xfract = (X & 0x000FFFFF) << 11u; + + /* Read two nearest output values from the index */ + x1 = pYData[(rI) + nCols * (cI)]; + x2 = pYData[(rI) + nCols * (cI) + 1u]; + + /* 20 bits for the fractional part */ + /* shift left yfract by 11 to keep 1.31 format */ + yfract = (Y & 0x000FFFFF) << 11u; + + /* Read two nearest output values from the index */ + y1 = pYData[(rI) + nCols * (cI + 1)]; + y2 = pYData[(rI) + nCols * (cI + 1) + 1u]; + + /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 3.29(q29) format */ + out = ((q31_t) (((q63_t) x1 * (0x7FFFFFFF - xfract)) >> 32)); + acc = ((q31_t) (((q63_t) out * (0x7FFFFFFF - yfract)) >> 32)); + + /* x2 * (xfract) * (1-yfract) in 3.29(q29) and adding to acc */ + out = ((q31_t) ((q63_t) x2 * (0x7FFFFFFF - yfract) >> 32)); + acc += ((q31_t) ((q63_t) out * (xfract) >> 32)); + + /* y1 * (1 - xfract) * (yfract) in 3.29(q29) and adding to acc */ + out = ((q31_t) ((q63_t) y1 * (0x7FFFFFFF - xfract) >> 32)); + acc += ((q31_t) ((q63_t) out * (yfract) >> 32)); + + /* y2 * (xfract) * (yfract) in 3.29(q29) and adding to acc */ + out = ((q31_t) ((q63_t) y2 * (xfract) >> 32)); + acc += ((q31_t) ((q63_t) out * (yfract) >> 32)); + + /* Convert acc to 1.31(q31) format */ + return (acc << 2u); + + } + + /** + * @brief Q15 bilinear interpolation. + * @param[in,out] *S points to an instance of the interpolation structure. + * @param[in] X interpolation coordinate in 12.20 format. + * @param[in] Y interpolation coordinate in 12.20 format. + * @return out interpolated value. + */ + + __STATIC_INLINE q15_t arm_bilinear_interp_q15( + arm_bilinear_interp_instance_q15 * S, + q31_t X, + q31_t Y) + { + q63_t acc = 0; /* output */ + q31_t out; /* Temporary output */ + q15_t x1, x2, y1, y2; /* Nearest output values */ + q31_t xfract, yfract; /* X, Y fractional parts */ + int32_t rI, cI; /* Row and column indices */ + q15_t *pYData = S->pData; /* pointer to output table values */ + uint32_t nCols = S->numCols; /* num of rows */ + + /* Input is in 12.20 format */ + /* 12 bits for the table index */ + /* Index value calculation */ + rI = ((X & 0xFFF00000) >> 20); + + /* Input is in 12.20 format */ + /* 12 bits for the table index */ + /* Index value calculation */ + cI = ((Y & 0xFFF00000) >> 20); + + /* Care taken for table outside boundary */ + /* Returns zero output when values are outside table boundary */ + if(rI < 0 || rI > (S->numRows-1) || cI < 0 || cI > ( S->numCols-1)) + { + return(0); + } + + /* 20 bits for the fractional part */ + /* xfract should be in 12.20 format */ + xfract = (X & 0x000FFFFF); + + /* Read two nearest output values from the index */ + x1 = pYData[(rI) + nCols * (cI)]; + x2 = pYData[(rI) + nCols * (cI) + 1u]; + + + /* 20 bits for the fractional part */ + /* yfract should be in 12.20 format */ + yfract = (Y & 0x000FFFFF); + + /* Read two nearest output values from the index */ + y1 = pYData[(rI) + nCols * (cI + 1)]; + y2 = pYData[(rI) + nCols * (cI + 1) + 1u]; + + /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 13.51 format */ + + /* x1 is in 1.15(q15), xfract in 12.20 format and out is in 13.35 format */ + /* convert 13.35 to 13.31 by right shifting and out is in 1.31 */ + out = (q31_t) (((q63_t) x1 * (0xFFFFF - xfract)) >> 4u); + acc = ((q63_t) out * (0xFFFFF - yfract)); + + /* x2 * (xfract) * (1-yfract) in 1.51 and adding to acc */ + out = (q31_t) (((q63_t) x2 * (0xFFFFF - yfract)) >> 4u); + acc += ((q63_t) out * (xfract)); + + /* y1 * (1 - xfract) * (yfract) in 1.51 and adding to acc */ + out = (q31_t) (((q63_t) y1 * (0xFFFFF - xfract)) >> 4u); + acc += ((q63_t) out * (yfract)); + + /* y2 * (xfract) * (yfract) in 1.51 and adding to acc */ + out = (q31_t) (((q63_t) y2 * (xfract)) >> 4u); + acc += ((q63_t) out * (yfract)); + + /* acc is in 13.51 format and down shift acc by 36 times */ + /* Convert out to 1.15 format */ + return (acc >> 36); + + } + + /** + * @brief Q7 bilinear interpolation. + * @param[in,out] *S points to an instance of the interpolation structure. + * @param[in] X interpolation coordinate in 12.20 format. + * @param[in] Y interpolation coordinate in 12.20 format. + * @return out interpolated value. + */ + + __STATIC_INLINE q7_t arm_bilinear_interp_q7( + arm_bilinear_interp_instance_q7 * S, + q31_t X, + q31_t Y) + { + q63_t acc = 0; /* output */ + q31_t out; /* Temporary output */ + q31_t xfract, yfract; /* X, Y fractional parts */ + q7_t x1, x2, y1, y2; /* Nearest output values */ + int32_t rI, cI; /* Row and column indices */ + q7_t *pYData = S->pData; /* pointer to output table values */ + uint32_t nCols = S->numCols; /* num of rows */ + + /* Input is in 12.20 format */ + /* 12 bits for the table index */ + /* Index value calculation */ + rI = ((X & 0xFFF00000) >> 20); + + /* Input is in 12.20 format */ + /* 12 bits for the table index */ + /* Index value calculation */ + cI = ((Y & 0xFFF00000) >> 20); + + /* Care taken for table outside boundary */ + /* Returns zero output when values are outside table boundary */ + if(rI < 0 || rI > (S->numRows-1) || cI < 0 || cI > ( S->numCols-1)) + { + return(0); + } + + /* 20 bits for the fractional part */ + /* xfract should be in 12.20 format */ + xfract = (X & 0x000FFFFF); + + /* Read two nearest output values from the index */ + x1 = pYData[(rI) + nCols * (cI)]; + x2 = pYData[(rI) + nCols * (cI) + 1u]; + + + /* 20 bits for the fractional part */ + /* yfract should be in 12.20 format */ + yfract = (Y & 0x000FFFFF); + + /* Read two nearest output values from the index */ + y1 = pYData[(rI) + nCols * (cI + 1)]; + y2 = pYData[(rI) + nCols * (cI + 1) + 1u]; + + /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 16.47 format */ + out = ((x1 * (0xFFFFF - xfract))); + acc = (((q63_t) out * (0xFFFFF - yfract))); + + /* x2 * (xfract) * (1-yfract) in 2.22 and adding to acc */ + out = ((x2 * (0xFFFFF - yfract))); + acc += (((q63_t) out * (xfract))); + + /* y1 * (1 - xfract) * (yfract) in 2.22 and adding to acc */ + out = ((y1 * (0xFFFFF - xfract))); + acc += (((q63_t) out * (yfract))); + + /* y2 * (xfract) * (yfract) in 2.22 and adding to acc */ + out = ((y2 * (yfract))); + acc += (((q63_t) out * (xfract))); + + /* acc in 16.47 format and down shift by 40 to convert to 1.7 format */ + return (acc >> 40); + + } + + /** + * @} end of BilinearInterpolate group + */ + + + + + + +#ifdef __cplusplus +} +#endif + + +#endif /* _ARM_MATH_H */ + + +/** + * + * End of file. + */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/Include/core_cm4.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/Include/core_cm4.h new file mode 100644 index 000000000..ef818e4d1 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/Include/core_cm4.h @@ -0,0 +1,1689 @@ +/**************************************************************************//** + * @file core_cm4.h + * @brief CMSIS Cortex-M4 Core Peripheral Access Layer Header File + * @version V3.00 + * @date 03. February 2012 + * + * @note + * Copyright (C) 2009-2012 ARM Limited. All rights reserved. + * + * @par + * ARM Limited (ARM) is supplying this software for use with Cortex-M + * processor based microcontrollers. This file can be freely distributed + * within development tools that are supporting such ARM based processors. + * + * @par + * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED + * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. + * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR + * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. + * + ******************************************************************************/ +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#endif + +#ifdef __cplusplus + extern "C" { +#endif + +#ifndef __CORE_CM4_H_GENERIC +#define __CORE_CM4_H_GENERIC + +/** \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_M4 + @{ + */ + +/* CMSIS CM4 definitions */ +#define __CM4_CMSIS_VERSION_MAIN (0x03) /*!< [31:16] CMSIS HAL main version */ +#define __CM4_CMSIS_VERSION_SUB (0x00) /*!< [15:0] CMSIS HAL sub version */ +#define __CM4_CMSIS_VERSION ((__CM4_CMSIS_VERSION_MAIN << 16) | \ + __CM4_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ + +#define __CORTEX_M (0x04) /*!< Cortex-M Core */ + + +#if defined ( __CC_ARM ) + #define __ASM __asm /*!< asm keyword for ARM Compiler */ + #define __INLINE __inline /*!< inline keyword for ARM Compiler */ + #define __STATIC_INLINE static __inline + +#elif defined ( __ICCARM__ ) + #define __ASM __asm /*!< asm keyword for IAR Compiler */ + #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ + #define __STATIC_INLINE static inline + +#elif defined ( __TMS470__ ) + #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ + #define __STATIC_INLINE static inline + +#elif defined ( __GNUC__ ) + #define __ASM __asm /*!< asm keyword for GNU Compiler */ + #define __INLINE inline /*!< inline keyword for GNU Compiler */ + #define __STATIC_INLINE static inline + +#elif defined ( __TASKING__ ) + #define __ASM __asm /*!< asm keyword for TASKING Compiler */ + #define __INLINE inline /*!< inline keyword for TASKING Compiler */ + #define __STATIC_INLINE static inline + +#endif + +/** __FPU_USED indicates whether an FPU is used or not. For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions. +*/ +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #if (__FPU_PRESENT == 1) + #define __FPU_USED 1 + #else + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0 + #endif + #else + #define __FPU_USED 0 + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #if (__FPU_PRESENT == 1) + #define __FPU_USED 1 + #else + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0 + #endif + #else + #define __FPU_USED 0 + #endif + +#elif defined ( __TMS470__ ) + #if defined __TI_VFP_SUPPORT__ + #if (__FPU_PRESENT == 1) + #define __FPU_USED 1 + #else + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0 + #endif + #else + #define __FPU_USED 0 + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #if (__FPU_PRESENT == 1) + #define __FPU_USED 1 + #else + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0 + #endif + #else + #define __FPU_USED 0 + #endif + +#elif defined ( __TASKING__ ) + /* add preprocessor checks to define __FPU_USED */ + #define __FPU_USED 0 +#endif + +#include /* standard types definitions */ +#include /* Core Instruction Access */ +#include /* Core Function Access */ +#include /* Compiler specific SIMD Intrinsics */ + +#endif /* __CORE_CM4_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_CM4_H_DEPENDANT +#define __CORE_CM4_H_DEPENDANT + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __CM4_REV + #define __CM4_REV 0x0000 + #warning "__CM4_REV not defined in device header file; using default!" + #endif + + #ifndef __FPU_PRESENT + #define __FPU_PRESENT 0 + #warning "__FPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0 + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 4 + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0 + #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 */ + +/*@} end of group Cortex_M4 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + - Core FPU 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 + { +#if (__CORTEX_M != 0x04) + uint32_t _reserved0:27; /*!< bit: 0..26 Reserved */ +#else + uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */ +#endif + 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; + + +/** \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; + + +/** \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ +#if (__CORTEX_M != 0x04) + uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */ +#else + uint32_t _reserved0:7; /*!< bit: 9..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */ +#endif + uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ + uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */ + 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; + + +/** \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 FPCA:1; /*!< bit: 2 FP extension active flag */ + uint32_t _reserved0:29; /*!< bit: 3..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/*@} 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 +{ + __IO uint32_t ISER[8]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[24]; + __IO uint32_t ICER[8]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[24]; + __IO uint32_t ISPR[8]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[24]; + __IO uint32_t ICPR[8]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[24]; + __IO uint32_t IABR[8]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[56]; + __IO uint8_t IP[240]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ + uint32_t RESERVED5[644]; + __O uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ +} NVIC_Type; + +/* Software Triggered Interrupt Register Definitions */ +#define NVIC_STIR_INTID_Pos 0 /*!< 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 +{ + __I uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IO uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + __IO uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ + __IO uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IO uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IO uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + __IO uint8_t SHP[12]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ + __IO uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ + __IO uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ + __IO uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ + __IO uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ + __IO uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ + __IO uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ + __IO uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ + __I uint32_t PFR[2]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ + __I uint32_t DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ + __I uint32_t ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __I uint32_t MMFR[4]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ + __I uint32_t ISAR[5]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ + uint32_t RESERVED0[5]; + __IO uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24 /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20 /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16 /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4 /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0 /*!< 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 31 /*!< SCB ICSR: NMIPENDSET Position */ +#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28 /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27 /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26 /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25 /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23 /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22 /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12 /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11 /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0 /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL << SCB_ICSR_VECTACTIVE_Pos) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Vector Table Offset Register Definitions */ +#define SCB_VTOR_TBLOFF_Pos 7 /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16 /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16 /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15 /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIGROUP_Pos 8 /*!< SCB AIRCR: PRIGROUP Position */ +#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2 /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1 /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +#define SCB_AIRCR_VECTRESET_Pos 0 /*!< 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 4 /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2 /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1 /*!< 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 9 /*!< SCB CCR: STKALIGN Position */ +#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8 /*!< 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 4 /*!< 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 3 /*!< 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 1 /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +#define SCB_CCR_NONBASETHRDENA_Pos 0 /*!< 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 18 /*!< SCB SHCSR: USGFAULTENA Position */ +#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ + +#define SCB_SHCSR_BUSFAULTENA_Pos 17 /*!< SCB SHCSR: BUSFAULTENA Position */ +#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ + +#define SCB_SHCSR_MEMFAULTENA_Pos 16 /*!< SCB SHCSR: MEMFAULTENA Position */ +#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15 /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_BUSFAULTPENDED_Pos 14 /*!< SCB SHCSR: BUSFAULTPENDED Position */ +#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ + +#define SCB_SHCSR_MEMFAULTPENDED_Pos 13 /*!< SCB SHCSR: MEMFAULTPENDED Position */ +#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ + +#define SCB_SHCSR_USGFAULTPENDED_Pos 12 /*!< SCB SHCSR: USGFAULTPENDED Position */ +#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11 /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10 /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_MONITORACT_Pos 8 /*!< SCB SHCSR: MONITORACT Position */ +#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7 /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_USGFAULTACT_Pos 3 /*!< SCB SHCSR: USGFAULTACT Position */ +#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ + +#define SCB_SHCSR_BUSFAULTACT_Pos 1 /*!< SCB SHCSR: BUSFAULTACT Position */ +#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ + +#define SCB_SHCSR_MEMFAULTACT_Pos 0 /*!< SCB SHCSR: MEMFAULTACT Position */ +#define SCB_SHCSR_MEMFAULTACT_Msk (1UL << SCB_SHCSR_MEMFAULTACT_Pos) /*!< SCB SHCSR: MEMFAULTACT Mask */ + +/* SCB Configurable Fault Status Registers Definitions */ +#define SCB_CFSR_USGFAULTSR_Pos 16 /*!< 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 8 /*!< 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 0 /*!< 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 */ + +/* SCB Hard Fault Status Registers Definitions */ +#define SCB_HFSR_DEBUGEVT_Pos 31 /*!< SCB HFSR: DEBUGEVT Position */ +#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ + +#define SCB_HFSR_FORCED_Pos 30 /*!< SCB HFSR: FORCED Position */ +#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ + +#define SCB_HFSR_VECTTBL_Pos 1 /*!< 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 4 /*!< SCB DFSR: EXTERNAL Position */ +#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ + +#define SCB_DFSR_VCATCH_Pos 3 /*!< SCB DFSR: VCATCH Position */ +#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ + +#define SCB_DFSR_DWTTRAP_Pos 2 /*!< SCB DFSR: DWTTRAP Position */ +#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ + +#define SCB_DFSR_BKPT_Pos 1 /*!< SCB DFSR: BKPT Position */ +#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ + +#define SCB_DFSR_HALTED_Pos 0 /*!< 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[1]; + __I uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ + __IO uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ +} SCnSCB_Type; + +/* Interrupt Controller Type Register Definitions */ +#define SCnSCB_ICTR_INTLINESNUM_Pos 0 /*!< ICTR: INTLINESNUM Position */ +#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL << SCnSCB_ICTR_INTLINESNUM_Pos) /*!< ICTR: INTLINESNUM Mask */ + +/* Auxiliary Control Register Definitions */ +#define SCnSCB_ACTLR_DISOOFP_Pos 9 /*!< ACTLR: DISOOFP Position */ +#define SCnSCB_ACTLR_DISOOFP_Msk (1UL << SCnSCB_ACTLR_DISOOFP_Pos) /*!< ACTLR: DISOOFP Mask */ + +#define SCnSCB_ACTLR_DISFPCA_Pos 8 /*!< ACTLR: DISFPCA Position */ +#define SCnSCB_ACTLR_DISFPCA_Msk (1UL << SCnSCB_ACTLR_DISFPCA_Pos) /*!< ACTLR: DISFPCA Mask */ + +#define SCnSCB_ACTLR_DISFOLD_Pos 2 /*!< ACTLR: DISFOLD Position */ +#define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) /*!< ACTLR: DISFOLD Mask */ + +#define SCnSCB_ACTLR_DISDEFWBUF_Pos 1 /*!< ACTLR: DISDEFWBUF Position */ +#define SCnSCB_ACTLR_DISDEFWBUF_Msk (1UL << SCnSCB_ACTLR_DISDEFWBUF_Pos) /*!< ACTLR: DISDEFWBUF Mask */ + +#define SCnSCB_ACTLR_DISMCYCINT_Pos 0 /*!< ACTLR: DISMCYCINT Position */ +#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL << SCnSCB_ACTLR_DISMCYCINT_Pos) /*!< ACTLR: DISMCYCINT Mask */ + +/*@} 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 +{ + __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IO uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IO uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __I uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16 /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2 /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1 /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0 /*!< 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 0 /*!< 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 0 /*!< 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 31 /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30 /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0 /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL << SysTick_VAL_CURRENT_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 +{ + __O union + { + __O uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ + __O uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ + __O uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ + } PORT [32]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ + uint32_t RESERVED0[864]; + __IO uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ + uint32_t RESERVED1[15]; + __IO uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ + uint32_t RESERVED2[15]; + __IO uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ +} ITM_Type; + +/* ITM Trace Privilege Register Definitions */ +#define ITM_TPR_PRIVMASK_Pos 0 /*!< ITM TPR: PRIVMASK Position */ +#define ITM_TPR_PRIVMASK_Msk (0xFUL << ITM_TPR_PRIVMASK_Pos) /*!< ITM TPR: PRIVMASK Mask */ + +/* ITM Trace Control Register Definitions */ +#define ITM_TCR_BUSY_Pos 23 /*!< ITM TCR: BUSY Position */ +#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ + +#define ITM_TCR_TraceBusID_Pos 16 /*!< ITM TCR: ATBID Position */ +#define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) /*!< ITM TCR: ATBID Mask */ + +#define ITM_TCR_GTSFREQ_Pos 10 /*!< 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 8 /*!< ITM TCR: TSPrescale Position */ +#define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */ + +#define ITM_TCR_SWOENA_Pos 4 /*!< ITM TCR: SWOENA Position */ +#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ + +#define ITM_TCR_TXENA_Pos 3 /*!< ITM TCR: TXENA Position */ +#define ITM_TCR_TXENA_Msk (1UL << ITM_TCR_TXENA_Pos) /*!< ITM TCR: TXENA Mask */ + +#define ITM_TCR_SYNCENA_Pos 2 /*!< ITM TCR: SYNCENA Position */ +#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ + +#define ITM_TCR_TSENA_Pos 1 /*!< ITM TCR: TSENA Position */ +#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ + +#define ITM_TCR_ITMENA_Pos 0 /*!< ITM TCR: ITM Enable bit Position */ +#define ITM_TCR_ITMENA_Msk (1UL << ITM_TCR_ITMENA_Pos) /*!< ITM TCR: ITM Enable bit 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 +{ + __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + __IO uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ + __IO uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ + __IO uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ + __IO uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ + __IO uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ + __IO uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ + __I uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IO uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + __IO uint32_t MASK0; /*!< Offset: 0x024 (R/W) Mask Register 0 */ + __IO uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED0[1]; + __IO uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + __IO uint32_t MASK1; /*!< Offset: 0x034 (R/W) Mask Register 1 */ + __IO uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + uint32_t RESERVED1[1]; + __IO uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + __IO uint32_t MASK2; /*!< Offset: 0x044 (R/W) Mask Register 2 */ + __IO uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED2[1]; + __IO uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + __IO uint32_t MASK3; /*!< Offset: 0x054 (R/W) Mask Register 3 */ + __IO uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28 /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27 /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26 /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25 /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24 /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +#define DWT_CTRL_CYCEVTENA_Pos 22 /*!< DWT CTRL: CYCEVTENA Position */ +#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ + +#define DWT_CTRL_FOLDEVTENA_Pos 21 /*!< DWT CTRL: FOLDEVTENA Position */ +#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ + +#define DWT_CTRL_LSUEVTENA_Pos 20 /*!< DWT CTRL: LSUEVTENA Position */ +#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ + +#define DWT_CTRL_SLEEPEVTENA_Pos 19 /*!< DWT CTRL: SLEEPEVTENA Position */ +#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ + +#define DWT_CTRL_EXCEVTENA_Pos 18 /*!< DWT CTRL: EXCEVTENA Position */ +#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ + +#define DWT_CTRL_CPIEVTENA_Pos 17 /*!< DWT CTRL: CPIEVTENA Position */ +#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ + +#define DWT_CTRL_EXCTRCENA_Pos 16 /*!< DWT CTRL: EXCTRCENA Position */ +#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ + +#define DWT_CTRL_PCSAMPLENA_Pos 12 /*!< DWT CTRL: PCSAMPLENA Position */ +#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ + +#define DWT_CTRL_SYNCTAP_Pos 10 /*!< DWT CTRL: SYNCTAP Position */ +#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ + +#define DWT_CTRL_CYCTAP_Pos 9 /*!< DWT CTRL: CYCTAP Position */ +#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ + +#define DWT_CTRL_POSTINIT_Pos 5 /*!< DWT CTRL: POSTINIT Position */ +#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ + +#define DWT_CTRL_POSTPRESET_Pos 1 /*!< DWT CTRL: POSTPRESET Position */ +#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ + +#define DWT_CTRL_CYCCNTENA_Pos 0 /*!< 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 0 /*!< 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 0 /*!< 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 0 /*!< 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 0 /*!< 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 0 /*!< 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 0 /*!< 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 24 /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVADDR1_Pos 16 /*!< DWT FUNCTION: DATAVADDR1 Position */ +#define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos) /*!< DWT FUNCTION: DATAVADDR1 Mask */ + +#define DWT_FUNCTION_DATAVADDR0_Pos 12 /*!< DWT FUNCTION: DATAVADDR0 Position */ +#define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos) /*!< DWT FUNCTION: DATAVADDR0 Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10 /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_LNK1ENA_Pos 9 /*!< DWT FUNCTION: LNK1ENA Position */ +#define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos) /*!< DWT FUNCTION: LNK1ENA Mask */ + +#define DWT_FUNCTION_DATAVMATCH_Pos 8 /*!< DWT FUNCTION: DATAVMATCH Position */ +#define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos) /*!< DWT FUNCTION: DATAVMATCH Mask */ + +#define DWT_FUNCTION_CYCMATCH_Pos 7 /*!< DWT FUNCTION: CYCMATCH Position */ +#define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos) /*!< DWT FUNCTION: CYCMATCH Mask */ + +#define DWT_FUNCTION_EMITRANGE_Pos 5 /*!< DWT FUNCTION: EMITRANGE Position */ +#define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos) /*!< DWT FUNCTION: EMITRANGE Mask */ + +#define DWT_FUNCTION_FUNCTION_Pos 0 /*!< 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 +{ + __IO uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ + __IO uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ + uint32_t RESERVED0[2]; + __IO uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55]; + __IO uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131]; + __I uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IO uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __I uint32_t FSCR; /*!< Offset: 0x308 (R/ ) Formatter Synchronization Counter Register */ + uint32_t RESERVED3[759]; + __I uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER */ + __I uint32_t FIFO0; /*!< Offset: 0xEEC (R/ ) Integration ETM Data */ + __I uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/ ) ITATBCTR2 */ + uint32_t RESERVED4[1]; + __I uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) ITATBCTR0 */ + __I uint32_t FIFO1; /*!< Offset: 0xEFC (R/ ) Integration ITM Data */ + __IO uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ + uint32_t RESERVED5[39]; + __IO uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ + __IO uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ + uint32_t RESERVED7[8]; + __I uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) TPIU_DEVID */ + __I uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) TPIU_DEVTYPE */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_PRESCALER_Pos 0 /*!< 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 0 /*!< 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 3 /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2 /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1 /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0 /*!< 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 8 /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_EnFCont_Pos 1 /*!< 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 0 /*!< 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 29 /*!< TPI FIFO0: ITM_ATVALID Position */ +#define TPI_FIFO0_ITM_ATVALID_Msk (0x3UL << TPI_FIFO0_ITM_ATVALID_Pos) /*!< TPI FIFO0: ITM_ATVALID Mask */ + +#define TPI_FIFO0_ITM_bytecount_Pos 27 /*!< 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 26 /*!< TPI FIFO0: ETM_ATVALID Position */ +#define TPI_FIFO0_ETM_ATVALID_Msk (0x3UL << TPI_FIFO0_ETM_ATVALID_Pos) /*!< TPI FIFO0: ETM_ATVALID Mask */ + +#define TPI_FIFO0_ETM_bytecount_Pos 24 /*!< 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 16 /*!< TPI FIFO0: ETM2 Position */ +#define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos) /*!< TPI FIFO0: ETM2 Mask */ + +#define TPI_FIFO0_ETM1_Pos 8 /*!< TPI FIFO0: ETM1 Position */ +#define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos) /*!< TPI FIFO0: ETM1 Mask */ + +#define TPI_FIFO0_ETM0_Pos 0 /*!< 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_ATREADY_Pos 0 /*!< TPI ITATBCTR2: ATREADY Position */ +#define TPI_ITATBCTR2_ATREADY_Msk (0x1UL << TPI_ITATBCTR2_ATREADY_Pos) /*!< TPI ITATBCTR2: ATREADY Mask */ + +/* TPI Integration ITM Data Register Definitions (FIFO1) */ +#define TPI_FIFO1_ITM_ATVALID_Pos 29 /*!< TPI FIFO1: ITM_ATVALID Position */ +#define TPI_FIFO1_ITM_ATVALID_Msk (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos) /*!< TPI FIFO1: ITM_ATVALID Mask */ + +#define TPI_FIFO1_ITM_bytecount_Pos 27 /*!< 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 26 /*!< TPI FIFO1: ETM_ATVALID Position */ +#define TPI_FIFO1_ETM_ATVALID_Msk (0x3UL << TPI_FIFO1_ETM_ATVALID_Pos) /*!< TPI FIFO1: ETM_ATVALID Mask */ + +#define TPI_FIFO1_ETM_bytecount_Pos 24 /*!< 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 16 /*!< TPI FIFO1: ITM2 Position */ +#define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos) /*!< TPI FIFO1: ITM2 Mask */ + +#define TPI_FIFO1_ITM1_Pos 8 /*!< TPI FIFO1: ITM1 Position */ +#define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos) /*!< TPI FIFO1: ITM1 Mask */ + +#define TPI_FIFO1_ITM0_Pos 0 /*!< 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_ATREADY_Pos 0 /*!< TPI ITATBCTR0: ATREADY Position */ +#define TPI_ITATBCTR0_ATREADY_Msk (0x1UL << TPI_ITATBCTR0_ATREADY_Pos) /*!< TPI ITATBCTR0: ATREADY Mask */ + +/* TPI Integration Mode Control Register Definitions */ +#define TPI_ITCTRL_Mode_Pos 0 /*!< TPI ITCTRL: Mode Position */ +#define TPI_ITCTRL_Mode_Msk (0x1UL << TPI_ITCTRL_Mode_Pos) /*!< TPI ITCTRL: Mode Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11 /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10 /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9 /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_MinBufSz_Pos 6 /*!< TPI DEVID: MinBufSz Position */ +#define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos) /*!< TPI DEVID: MinBufSz Mask */ + +#define TPI_DEVID_AsynClkIn_Pos 5 /*!< TPI DEVID: AsynClkIn Position */ +#define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos) /*!< TPI DEVID: AsynClkIn Mask */ + +#define TPI_DEVID_NrTraceInput_Pos 0 /*!< 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 0 /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL << TPI_DEVTYPE_SubType_Pos) /*!< TPI DEVTYPE: SubType Mask */ + +#define TPI_DEVTYPE_MajorType_Pos 4 /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + + +#if (__MPU_PRESENT == 1) +/** \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 +{ + __I uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IO uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IO uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ + __IO uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IO uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ + __IO uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Alias 1 Region Base Address Register */ + __IO uint32_t RASR_A1; /*!< Offset: 0x018 (R/W) MPU Alias 1 Region Attribute and Size Register */ + __IO uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Alias 2 Region Base Address Register */ + __IO uint32_t RASR_A2; /*!< Offset: 0x020 (R/W) MPU Alias 2 Region Attribute and Size Register */ + __IO uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Alias 3 Region Base Address Register */ + __IO uint32_t RASR_A3; /*!< Offset: 0x028 (R/W) MPU Alias 3 Region Attribute and Size Register */ +} MPU_Type; + +/* MPU Type Register */ +#define MPU_TYPE_IREGION_Pos 16 /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8 /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0 /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL << MPU_TYPE_SEPARATE_Pos) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register */ +#define MPU_CTRL_PRIVDEFENA_Pos 2 /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1 /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0 /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL << MPU_CTRL_ENABLE_Pos) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register */ +#define MPU_RNR_REGION_Pos 0 /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL << MPU_RNR_REGION_Pos) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register */ +#define MPU_RBAR_ADDR_Pos 5 /*!< MPU RBAR: ADDR Position */ +#define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ + +#define MPU_RBAR_VALID_Pos 4 /*!< MPU RBAR: VALID Position */ +#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ + +#define MPU_RBAR_REGION_Pos 0 /*!< MPU RBAR: REGION Position */ +#define MPU_RBAR_REGION_Msk (0xFUL << MPU_RBAR_REGION_Pos) /*!< MPU RBAR: REGION Mask */ + +/* MPU Region Attribute and Size Register */ +#define MPU_RASR_ATTRS_Pos 16 /*!< 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_SRD_Pos 8 /*!< 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 1 /*!< 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 0 /*!< 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 + + +#if (__FPU_PRESENT == 1) +/** \ingroup CMSIS_core_register + \defgroup CMSIS_FPU Floating Point Unit (FPU) + \brief Type definitions for the Floating Point Unit (FPU) + @{ + */ + +/** \brief Structure type to access the Floating Point Unit (FPU). + */ +typedef struct +{ + uint32_t RESERVED0[1]; + __IO uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */ + __IO uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */ + __IO uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */ + __I uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and FP Feature Register 0 */ + __I uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and FP Feature Register 1 */ +} FPU_Type; + +/* Floating-Point Context Control Register */ +#define FPU_FPCCR_ASPEN_Pos 31 /*!< FPCCR: ASPEN bit Position */ +#define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */ + +#define FPU_FPCCR_LSPEN_Pos 30 /*!< FPCCR: LSPEN Position */ +#define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */ + +#define FPU_FPCCR_MONRDY_Pos 8 /*!< FPCCR: MONRDY Position */ +#define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */ + +#define FPU_FPCCR_BFRDY_Pos 6 /*!< FPCCR: BFRDY Position */ +#define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */ + +#define FPU_FPCCR_MMRDY_Pos 5 /*!< FPCCR: MMRDY Position */ +#define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */ + +#define FPU_FPCCR_HFRDY_Pos 4 /*!< FPCCR: HFRDY Position */ +#define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */ + +#define FPU_FPCCR_THREAD_Pos 3 /*!< FPCCR: processor mode bit Position */ +#define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */ + +#define FPU_FPCCR_USER_Pos 1 /*!< FPCCR: privilege level bit Position */ +#define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */ + +#define FPU_FPCCR_LSPACT_Pos 0 /*!< FPCCR: Lazy state preservation active bit Position */ +#define FPU_FPCCR_LSPACT_Msk (1UL << FPU_FPCCR_LSPACT_Pos) /*!< FPCCR: Lazy state preservation active bit Mask */ + +/* Floating-Point Context Address Register */ +#define FPU_FPCAR_ADDRESS_Pos 3 /*!< FPCAR: ADDRESS bit Position */ +#define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */ + +/* Floating-Point Default Status Control Register */ +#define FPU_FPDSCR_AHP_Pos 26 /*!< FPDSCR: AHP bit Position */ +#define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */ + +#define FPU_FPDSCR_DN_Pos 25 /*!< FPDSCR: DN bit Position */ +#define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */ + +#define FPU_FPDSCR_FZ_Pos 24 /*!< FPDSCR: FZ bit Position */ +#define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */ + +#define FPU_FPDSCR_RMode_Pos 22 /*!< FPDSCR: RMode bit Position */ +#define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */ + +/* Media and FP Feature Register 0 */ +#define FPU_MVFR0_FP_rounding_modes_Pos 28 /*!< MVFR0: FP rounding modes bits Position */ +#define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) /*!< MVFR0: FP rounding modes bits Mask */ + +#define FPU_MVFR0_Short_vectors_Pos 24 /*!< MVFR0: Short vectors bits Position */ +#define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) /*!< MVFR0: Short vectors bits Mask */ + +#define FPU_MVFR0_Square_root_Pos 20 /*!< MVFR0: Square root bits Position */ +#define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) /*!< MVFR0: Square root bits Mask */ + +#define FPU_MVFR0_Divide_Pos 16 /*!< MVFR0: Divide bits Position */ +#define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) /*!< MVFR0: Divide bits Mask */ + +#define FPU_MVFR0_FP_excep_trapping_Pos 12 /*!< MVFR0: FP exception trapping bits Position */ +#define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) /*!< MVFR0: FP exception trapping bits Mask */ + +#define FPU_MVFR0_Double_precision_Pos 8 /*!< MVFR0: Double-precision bits Position */ +#define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) /*!< MVFR0: Double-precision bits Mask */ + +#define FPU_MVFR0_Single_precision_Pos 4 /*!< MVFR0: Single-precision bits Position */ +#define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) /*!< MVFR0: Single-precision bits Mask */ + +#define FPU_MVFR0_A_SIMD_registers_Pos 0 /*!< MVFR0: A_SIMD registers bits Position */ +#define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL << FPU_MVFR0_A_SIMD_registers_Pos) /*!< MVFR0: A_SIMD registers bits Mask */ + +/* Media and FP Feature Register 1 */ +#define FPU_MVFR1_FP_fused_MAC_Pos 28 /*!< MVFR1: FP fused MAC bits Position */ +#define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) /*!< MVFR1: FP fused MAC bits Mask */ + +#define FPU_MVFR1_FP_HPFP_Pos 24 /*!< MVFR1: FP HPFP bits Position */ +#define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) /*!< MVFR1: FP HPFP bits Mask */ + +#define FPU_MVFR1_D_NaN_mode_Pos 4 /*!< MVFR1: D_NaN mode bits Position */ +#define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) /*!< MVFR1: D_NaN mode bits Mask */ + +#define FPU_MVFR1_FtZ_mode_Pos 0 /*!< MVFR1: FtZ mode bits Position */ +#define FPU_MVFR1_FtZ_mode_Msk (0xFUL << FPU_MVFR1_FtZ_mode_Pos) /*!< MVFR1: FtZ mode bits Mask */ + +/*@} end of group CMSIS_FPU */ +#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 +{ + __IO uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __O uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IO uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IO uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ +} CoreDebug_Type; + +/* Debug Halting Control and Status Register */ +#define CoreDebug_DHCSR_DBGKEY_Pos 16 /*!< 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 25 /*!< 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 24 /*!< 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 19 /*!< 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 18 /*!< 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 17 /*!< 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 16 /*!< 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 5 /*!< 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 3 /*!< 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 2 /*!< 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 1 /*!< 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 0 /*!< 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 */ +#define CoreDebug_DCRSR_REGWnR_Pos 16 /*!< CoreDebug DCRSR: REGWnR Position */ +#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ + +#define CoreDebug_DCRSR_REGSEL_Pos 0 /*!< CoreDebug DCRSR: REGSEL Position */ +#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL << CoreDebug_DCRSR_REGSEL_Pos) /*!< CoreDebug DCRSR: REGSEL Mask */ + +/* Debug Exception and Monitor Control Register */ +#define CoreDebug_DEMCR_TRCENA_Pos 24 /*!< CoreDebug DEMCR: TRCENA Position */ +#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */ + +#define CoreDebug_DEMCR_MON_REQ_Pos 19 /*!< 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 18 /*!< 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 17 /*!< 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 16 /*!< 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 10 /*!< 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 9 /*!< 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 8 /*!< 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 7 /*!< 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 6 /*!< 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 5 /*!< 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 4 /*!< 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 0 /*!< 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_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Cortex-M4 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 (__MPU_PRESENT == 1) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ +#endif + +#if (__FPU_PRESENT == 1) + #define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ + #define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point 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. + @{ + */ + +/** \brief Set Priority Grouping + + The function 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)0x07); /* only values 0..7 are used */ + + reg_value = SCB->AIRCR; /* read old register configuration */ + reg_value &= ~(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FA << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << 8)); /* Insert write key and priorty group */ + SCB->AIRCR = reg_value; +} + + +/** \brief Get Priority Grouping + + The function 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 ((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos); /* read priority grouping field */ +} + + +/** \brief Enable External Interrupt + + The function enables a device-specific interrupt in the NVIC interrupt controller. + + \param [in] IRQn External interrupt number. Value cannot be negative. + */ +__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) +{ +/* NVIC->ISER[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); enable interrupt */ + NVIC->ISER[(uint32_t)((int32_t)IRQn) >> 5] = (uint32_t)(1 << ((uint32_t)((int32_t)IRQn) & (uint32_t)0x1F)); /* enable interrupt */ +} + + +/** \brief Disable External Interrupt + + The function disables a device-specific interrupt in the NVIC interrupt controller. + + \param [in] IRQn External interrupt number. Value cannot be negative. + */ +__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) +{ + NVIC->ICER[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* disable interrupt */ +} + + +/** \brief Get Pending Interrupt + + The function reads the pending register in the NVIC and returns the pending bit + for the specified interrupt. + + \param [in] IRQn Interrupt number. + + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + */ +__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + return((uint32_t) ((NVIC->ISPR[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0)); /* Return 1 if pending else 0 */ +} + + +/** \brief Set Pending Interrupt + + The function sets the pending bit of an external interrupt. + + \param [in] IRQn Interrupt number. Value cannot be negative. + */ +__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + NVIC->ISPR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* set interrupt pending */ +} + + +/** \brief Clear Pending Interrupt + + The function clears the pending bit of an external interrupt. + + \param [in] IRQn External interrupt number. Value cannot be negative. + */ +__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + NVIC->ICPR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* Clear pending interrupt */ +} + + +/** \brief Get Active Interrupt + + The function reads the active register in NVIC and returns the active bit. + + \param [in] IRQn Interrupt number. + + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + */ +__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn) +{ + return((uint32_t)((NVIC->IABR[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0)); /* Return 1 if active else 0 */ +} + + +/** \brief Set Interrupt Priority + + The function sets the priority of an interrupt. + + \note The priority cannot be set for every core interrupt. + + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + */ +__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if(IRQn < 0) { + SCB->SHP[((uint32_t)(IRQn) & 0xF)-4] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for Cortex-M System Interrupts */ + else { + NVIC->IP[(uint32_t)(IRQn)] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for device specific Interrupts */ +} + + +/** \brief Get Interrupt Priority + + The function reads the priority of an interrupt. The interrupt + number can be positive to specify an external (device specific) + interrupt, or negative to specify an internal (core) interrupt. + + + \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(IRQn < 0) { + return((uint32_t)(SCB->SHP[((uint32_t)(IRQn) & 0xF)-4] >> (8 - __NVIC_PRIO_BITS))); } /* get priority for Cortex-M system interrupts */ + else { + return((uint32_t)(NVIC->IP[(uint32_t)(IRQn)] >> (8 - __NVIC_PRIO_BITS))); } /* get priority for device specific interrupts */ +} + + +/** \brief Encode Priority + + The function 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 samllest 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 & 0x07); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7 - PriorityGroupTmp) > __NVIC_PRIO_BITS) ? __NVIC_PRIO_BITS : 7 - PriorityGroupTmp; + SubPriorityBits = ((PriorityGroupTmp + __NVIC_PRIO_BITS) < 7) ? 0 : PriorityGroupTmp - 7 + __NVIC_PRIO_BITS; + + return ( + ((PreemptPriority & ((1 << (PreemptPriorityBits)) - 1)) << SubPriorityBits) | + ((SubPriority & ((1 << (SubPriorityBits )) - 1))) + ); +} + + +/** \brief Decode Priority + + The function 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 samllest 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* pPreemptPriority, uint32_t* pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & 0x07); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7 - PriorityGroupTmp) > __NVIC_PRIO_BITS) ? __NVIC_PRIO_BITS : 7 - PriorityGroupTmp; + SubPriorityBits = ((PriorityGroupTmp + __NVIC_PRIO_BITS) < 7) ? 0 : PriorityGroupTmp - 7 + __NVIC_PRIO_BITS; + + *pPreemptPriority = (Priority >> SubPriorityBits) & ((1 << (PreemptPriorityBits)) - 1); + *pSubPriority = (Priority ) & ((1 << (SubPriorityBits )) - 1); +} + + +/** \brief System Reset + + The function initiates a system reset request to reset the MCU. + */ +__STATIC_INLINE void NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = ((0x5FA << SCB_AIRCR_VECTKEY_Pos) | + (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | + SCB_AIRCR_SYSRESETREQ_Msk); /* Keep priority group unchanged */ + __DSB(); /* Ensure completion of memory access */ + while(1); /* wait until reset */ +} + +/*@} end of CMSIS_Core_NVICFunctions */ + + + +/* ################################## SysTick function ############################################ */ +/** \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if (__Vendor_SysTickConfig == 0) + +/** \brief System Tick Configuration + + The function 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 > SysTick_LOAD_RELOAD_Msk) return (1); /* Reload value impossible */ + + SysTick->LOAD = (ticks & SysTick_LOAD_RELOAD_Msk) - 1; /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0; /* 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 (0); /* 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 0x5AA55AA5 /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ + + +/** \brief ITM Send Character + + The function 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) && /* ITM enabled */ + (ITM->TER & (1UL << 0) ) ) /* ITM Port #0 enabled */ + { + while (ITM->PORT[0].u32 == 0); + ITM->PORT[0].u8 = (uint8_t) ch; + } + return (ch); +} + + +/** \brief ITM Receive Character + + The function 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 + + The function 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 */ + +#endif /* __CORE_CM4_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ + +#ifdef __cplusplus +} +#endif diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/Include/core_cm4_simd.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/Include/core_cm4_simd.h new file mode 100644 index 000000000..34b395a04 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/Include/core_cm4_simd.h @@ -0,0 +1,649 @@ +/**************************************************************************//** + * @file core_cm4_simd.h + * @brief CMSIS Cortex-M4 SIMD Header File + * @version V3.00 + * @date 19. January 2012 + * + * @note + * Copyright (C) 2010-2012 ARM Limited. All rights reserved. + * + * @par + * ARM Limited (ARM) is supplying this software for use with Cortex-M + * processor based microcontrollers. This file can be freely distributed + * within development tools that are supporting such ARM based processors. + * + * @par + * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED + * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. + * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR + * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. + * + ******************************************************************************/ + +#ifdef __cplusplus + extern "C" { +#endif + +#ifndef __CORE_CM4_SIMD_H +#define __CORE_CM4_SIMD_H + + +/******************************************************************************* + * Hardware Abstraction Layer + ******************************************************************************/ + + +/* ################### Compiler specific Intrinsics ########################### */ +/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics + Access to dedicated SIMD instructions + @{ +*/ + +#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/ +/* ARM armcc specific functions */ + +/*------ CM4 SIMD Intrinsics -----------------------------------------------------*/ +#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) ) + + +/*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/ + + + +#elif defined ( __ICCARM__ ) /*------------------ ICC Compiler -------------------*/ +/* IAR iccarm specific functions */ + +/*------ CM4 SIMD Intrinsics -----------------------------------------------------*/ +#include + +/*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/ + + + +#elif defined ( __TMS470__ ) /*---------------- TI CCS Compiler ------------------*/ +/* TI CCS specific functions */ + +/*------ CM4 SIMD Intrinsics -----------------------------------------------------*/ +#include + +/*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/ + + + +#elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/ +/* GNU gcc specific functions */ + +/*------ CM4 SIMD Intrinsics -----------------------------------------------------*/ +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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) \ +({ \ + uint32_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; \ + }) + +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UXTB16(uint32_t op1) +{ + uint32_t result; + + __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1)); + return(result); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SXTB16(uint32_t op1) +{ + uint32_t result; + + __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1)); + return(result); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +#define __SMLALD(ARG1,ARG2,ARG3) \ +({ \ + uint32_t __ARG1 = (ARG1), __ARG2 = (ARG2), __ARG3_H = (uint32_t)((uint64_t)(ARG3) >> 32), __ARG3_L = (uint32_t)((uint64_t)(ARG3) & 0xFFFFFFFFUL); \ + __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (__ARG3_L), "=r" (__ARG3_H) : "r" (__ARG1), "r" (__ARG2), "0" (__ARG3_L), "1" (__ARG3_H) ); \ + (uint64_t)(((uint64_t)__ARG3_H << 32) | __ARG3_L); \ + }) + +#define __SMLALDX(ARG1,ARG2,ARG3) \ +({ \ + uint32_t __ARG1 = (ARG1), __ARG2 = (ARG2), __ARG3_H = (uint32_t)((uint64_t)(ARG3) >> 32), __ARG3_L = (uint32_t)((uint64_t)(ARG3) & 0xFFFFFFFFUL); \ + __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (__ARG3_L), "=r" (__ARG3_H) : "r" (__ARG1), "r" (__ARG2), "0" (__ARG3_L), "1" (__ARG3_H) ); \ + (uint64_t)(((uint64_t)__ARG3_H << 32) | __ARG3_L); \ + }) + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +#define __SMLSLD(ARG1,ARG2,ARG3) \ +({ \ + uint32_t __ARG1 = (ARG1), __ARG2 = (ARG2), __ARG3_H = (uint32_t)((ARG3) >> 32), __ARG3_L = (uint32_t)((ARG3) & 0xFFFFFFFFUL); \ + __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (__ARG3_L), "=r" (__ARG3_H) : "r" (__ARG1), "r" (__ARG2), "0" (__ARG3_L), "1" (__ARG3_H) ); \ + (uint64_t)(((uint64_t)__ARG3_H << 32) | __ARG3_L); \ + }) + +#define __SMLSLDX(ARG1,ARG2,ARG3) \ +({ \ + uint32_t __ARG1 = (ARG1), __ARG2 = (ARG2), __ARG3_H = (uint32_t)((ARG3) >> 32), __ARG3_L = (uint32_t)((ARG3) & 0xFFFFFFFFUL); \ + __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (__ARG3_L), "=r" (__ARG3_H) : "r" (__ARG1), "r" (__ARG2), "0" (__ARG3_L), "1" (__ARG3_H) ); \ + (uint64_t)(((uint64_t)__ARG3_H << 32) | __ARG3_L); \ + }) + +__attribute__( ( always_inline ) ) __STATIC_INLINE 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); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QADD(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSUB(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +#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; \ + }) + +/*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/ + + + +#elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/ +/* TASKING carm specific functions */ + + +/*------ CM4 SIMD Intrinsics -----------------------------------------------------*/ +/* not yet supported */ +/*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/ + + +#endif + +/*@} end of group CMSIS_SIMD_intrinsics */ + + +#endif /* __CORE_CM4_SIMD_H */ + +#ifdef __cplusplus +} +#endif diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/Include/core_cmFunc.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/Include/core_cmFunc.h new file mode 100644 index 000000000..1991ae3d9 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/Include/core_cmFunc.h @@ -0,0 +1,616 @@ +/**************************************************************************//** + * @file core_cmFunc.h + * @brief CMSIS Cortex-M Core Function Access Header File + * @version V3.00 + * @date 19. January 2012 + * + * @note + * Copyright (C) 2009-2012 ARM Limited. All rights reserved. + * + * @par + * ARM Limited (ARM) is supplying this software for use with Cortex-M + * processor based microcontrollers. This file can be freely distributed + * within development tools that are supporting such ARM based processors. + * + * @par + * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED + * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. + * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR + * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. + * + ******************************************************************************/ + +#ifndef __CORE_CMFUNC_H +#define __CORE_CMFUNC_H + + +/* ########################### Core Function Access ########################### */ +/** \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions + @{ + */ + +#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/ +/* ARM armcc specific functions */ + +#if (__ARMCC_VERSION < 400677) + #error "Please use ARM Compiler Toolchain V4.0.677 or later!" +#endif + +/* intrinsic void __enable_irq(); */ +/* intrinsic void __disable_irq(); */ + +/** \brief Get Control Register + + This function 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 + + This function 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 + + This function 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 + + This function 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 + + This function 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 + + This function 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 + + This function 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 + + This function 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 + + This function 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 + + This function 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 + + This function 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 (__CORTEX_M >= 0x03) + +/** \brief Enable FIQ + + This function 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 + + This function 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 + + This function 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 + + This function 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 & 0xff); +} + + +/** \brief Get Fault Mask + + This function 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 + + This function 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)1); +} + +#endif /* (__CORTEX_M >= 0x03) */ + + +#if (__CORTEX_M == 0x04) + +/** \brief Get FPSCR + + This function 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 (__FPU_PRESENT == 1) && (__FPU_USED == 1) + register uint32_t __regfpscr __ASM("fpscr"); + return(__regfpscr); +#else + return(0); +#endif +} + + +/** \brief Set FPSCR + + This function 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 (__FPU_PRESENT == 1) && (__FPU_USED == 1) + register uint32_t __regfpscr __ASM("fpscr"); + __regfpscr = (fpscr); +#endif +} + +#endif /* (__CORTEX_M == 0x04) */ + + +#elif defined ( __ICCARM__ ) /*------------------ ICC Compiler -------------------*/ +/* IAR iccarm specific functions */ + +#include + + +#elif defined ( __TMS470__ ) /*---------------- TI CCS Compiler ------------------*/ +/* TI CCS specific functions */ + +#include + + +#elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/ +/* GNU gcc specific functions */ + +/** \brief Enable IRQ Interrupts + + This function enables IRQ interrupts by clearing the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __enable_irq(void) +{ + __ASM volatile ("cpsie i"); +} + + +/** \brief Disable IRQ Interrupts + + This function disables IRQ interrupts by setting the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __disable_irq(void) +{ + __ASM volatile ("cpsid i"); +} + + +/** \brief Get Control Register + + This function returns the content of the Control Register. + + \return Control Register value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_CONTROL(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control" : "=r" (result) ); + return(result); +} + + +/** \brief Set Control Register + + This function writes the given value to the Control Register. + + \param [in] control Control Register value to set + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_CONTROL(uint32_t control) +{ + __ASM volatile ("MSR control, %0" : : "r" (control) ); +} + + +/** \brief Get IPSR Register + + This function returns the content of the IPSR Register. + + \return IPSR Register value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_IPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); + return(result); +} + + +/** \brief Get APSR Register + + This function returns the content of the APSR Register. + + \return APSR Register value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_APSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, apsr" : "=r" (result) ); + return(result); +} + + +/** \brief Get xPSR Register + + This function returns the content of the xPSR Register. + + \return xPSR Register value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_xPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); + return(result); +} + + +/** \brief Get Process Stack Pointer + + This function returns the current value of the Process Stack Pointer (PSP). + + \return PSP Register value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PSP(void) +{ + register uint32_t result; + + __ASM volatile ("MRS %0, psp\n" : "=r" (result) ); + return(result); +} + + +/** \brief Set Process Stack Pointer + + This function assigns the given value to the Process Stack Pointer (PSP). + + \param [in] topOfProcStack Process Stack Pointer value to set + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_PSP(uint32_t topOfProcStack) +{ + __ASM volatile ("MSR psp, %0\n" : : "r" (topOfProcStack) ); +} + + +/** \brief Get Main Stack Pointer + + This function returns the current value of the Main Stack Pointer (MSP). + + \return MSP Register value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_MSP(void) +{ + register uint32_t result; + + __ASM volatile ("MRS %0, msp\n" : "=r" (result) ); + return(result); +} + + +/** \brief Set Main Stack Pointer + + This function assigns the given value to the Main Stack Pointer (MSP). + + \param [in] topOfMainStack Main Stack Pointer value to set + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack) +{ + __ASM volatile ("MSR msp, %0\n" : : "r" (topOfMainStack) ); +} + + +/** \brief Get Priority Mask + + This function returns the current state of the priority mask bit from the Priority Mask Register. + + \return Priority Mask value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PRIMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask" : "=r" (result) ); + return(result); +} + + +/** \brief Set Priority Mask + + This function assigns the given value to the Priority Mask Register. + + \param [in] priMask Priority Mask + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_PRIMASK(uint32_t priMask) +{ + __ASM volatile ("MSR primask, %0" : : "r" (priMask) ); +} + + +#if (__CORTEX_M >= 0x03) + +/** \brief Enable FIQ + + This function enables FIQ interrupts by clearing the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __enable_fault_irq(void) +{ + __ASM volatile ("cpsie f"); +} + + +/** \brief Disable FIQ + + This function disables FIQ interrupts by setting the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __disable_fault_irq(void) +{ + __ASM volatile ("cpsid f"); +} + + +/** \brief Get Base Priority + + This function returns the current value of the Base Priority register. + + \return Base Priority register value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_BASEPRI(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, basepri_max" : "=r" (result) ); + return(result); +} + + +/** \brief Set Base Priority + + This function assigns the given value to the Base Priority register. + + \param [in] basePri Base Priority value to set + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_BASEPRI(uint32_t value) +{ + __ASM volatile ("MSR basepri, %0" : : "r" (value) ); +} + + +/** \brief Get Fault Mask + + This function returns the current value of the Fault Mask register. + + \return Fault Mask register value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_FAULTMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); + return(result); +} + + +/** \brief Set Fault Mask + + This function assigns the given value to the Fault Mask register. + + \param [in] faultMask Fault Mask value to set + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask) +{ + __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) ); +} + +#endif /* (__CORTEX_M >= 0x03) */ + + +#if (__CORTEX_M == 0x04) + +/** \brief Get FPSCR + + This function returns the current value of the Floating Point Status/Control register. + + \return Floating Point Status/Control register value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_FPSCR(void) +{ +#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) + uint32_t result; + + __ASM volatile ("VMRS %0, fpscr" : "=r" (result) ); + return(result); +#else + return(0); +#endif +} + + +/** \brief Set FPSCR + + This function assigns the given value to the Floating Point Status/Control register. + + \param [in] fpscr Floating Point Status/Control value to set + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr) +{ +#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) + __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) ); +#endif +} + +#endif /* (__CORTEX_M == 0x04) */ + + +#elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/ +/* TASKING carm specific functions */ + +/* + * The CMSIS functions have been implemented as intrinsics in the compiler. + * Please use "carm -?i" to get an up to date list of all instrinsics, + * Including the CMSIS ones. + */ + +#endif + +/*@} end of CMSIS_Core_RegAccFunctions */ + + +#endif /* __CORE_CMFUNC_H */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/Include/core_cmInstr.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/Include/core_cmInstr.h new file mode 100644 index 000000000..7981634e7 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/Include/core_cmInstr.h @@ -0,0 +1,618 @@ +/**************************************************************************//** + * @file core_cmInstr.h + * @brief CMSIS Cortex-M Core Instruction Access Header File + * @version V3.00 + * @date 07. February 2012 + * + * @note + * Copyright (C) 2009-2012 ARM Limited. All rights reserved. + * + * @par + * ARM Limited (ARM) is supplying this software for use with Cortex-M + * processor based microcontrollers. This file can be freely distributed + * within development tools that are supporting such ARM based processors. + * + * @par + * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED + * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. + * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR + * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. + * + ******************************************************************************/ + +#ifndef __CORE_CMINSTR_H +#define __CORE_CMINSTR_H + + +/* ########################## Core Instruction Access ######################### */ +/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface + Access to dedicated instructions + @{ +*/ + +#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/ +/* ARM armcc specific functions */ + +#if (__ARMCC_VERSION < 400677) + #error "Please use ARM Compiler Toolchain V4.0.677 or later!" +#endif + + +/** \brief No Operation + + No Operation does nothing. This instruction can be used for code alignment purposes. + */ +#define __NOP __nop + + +/** \brief Wait For Interrupt + + 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 + + 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 + + Send Event is a hint instruction. It causes an event to be signaled to the CPU. + */ +#define __SEV __sev + + +/** \brief Instruction Synchronization Barrier + + 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 + + This function 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 + + This function 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) + + This function reverses the byte order in integer value. + + \param [in] value Value to reverse + \return Reversed value + */ +#define __REV __rev + + +/** \brief Reverse byte order (16 bit) + + This function reverses the byte order in two unsigned short values. + + \param [in] value Value to reverse + \return Reversed value + */ +__attribute__((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value) +{ + rev16 r0, r0 + bx lr +} + + +/** \brief Reverse byte order in signed short value + + This function reverses the byte order in a signed short value with sign extension to integer. + + \param [in] value Value to reverse + \return Reversed value + */ +__attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int32_t __REVSH(int32_t value) +{ + revsh r0, r0 + bx lr +} + + +/** \brief Rotate Right in unsigned value (32 bit) + + This function Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. + + \param [in] value Value to rotate + \param [in] value Number of Bits to rotate + \return Rotated value + */ +#define __ROR __ror + + +#if (__CORTEX_M >= 0x03) + +/** \brief Reverse bit order of value + + This function reverses the bit order of the given value. + + \param [in] value Value to reverse + \return Reversed value + */ +#define __RBIT __rbit + + +/** \brief LDR Exclusive (8 bit) + + This function performs a exclusive LDR command for 8 bit value. + + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +#define __LDREXB(ptr) ((uint8_t ) __ldrex(ptr)) + + +/** \brief LDR Exclusive (16 bit) + + This function performs a exclusive LDR command for 16 bit values. + + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +#define __LDREXH(ptr) ((uint16_t) __ldrex(ptr)) + + +/** \brief LDR Exclusive (32 bit) + + This function performs a exclusive LDR command for 32 bit values. + + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +#define __LDREXW(ptr) ((uint32_t ) __ldrex(ptr)) + + +/** \brief STR Exclusive (8 bit) + + This function performs a exclusive STR command 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(value, ptr) __strex(value, ptr) + + +/** \brief STR Exclusive (16 bit) + + This function performs a exclusive STR command 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(value, ptr) __strex(value, ptr) + + +/** \brief STR Exclusive (32 bit) + + This function performs a exclusive STR command 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(value, ptr) __strex(value, ptr) + + +/** \brief Remove the exclusive lock + + This function removes the exclusive lock which is created by LDREX. + + */ +#define __CLREX __clrex + + +/** \brief Signed Saturate + + This function 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 + + This function 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 Count leading zeros + + This function 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 + +#endif /* (__CORTEX_M >= 0x03) */ + + + +#elif defined ( __ICCARM__ ) /*------------------ ICC Compiler -------------------*/ +/* IAR iccarm specific functions */ + +#include + + +#elif defined ( __TMS470__ ) /*---------------- TI CCS Compiler ------------------*/ +/* TI CCS specific functions */ + +#include + + +#elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/ +/* GNU gcc specific functions */ + +/** \brief No Operation + + No Operation does nothing. This instruction can be used for code alignment purposes. + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __NOP(void) +{ + __ASM volatile ("nop"); +} + + +/** \brief Wait For Interrupt + + Wait For Interrupt is a hint instruction that suspends execution + until one of a number of events occurs. + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __WFI(void) +{ + __ASM volatile ("wfi"); +} + + +/** \brief Wait For Event + + 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. + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __WFE(void) +{ + __ASM volatile ("wfe"); +} + + +/** \brief Send Event + + Send Event is a hint instruction. It causes an event to be signaled to the CPU. + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __SEV(void) +{ + __ASM volatile ("sev"); +} + + +/** \brief Instruction Synchronization Barrier + + 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. + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __ISB(void) +{ + __ASM volatile ("isb"); +} + + +/** \brief Data Synchronization Barrier + + This function acts as a special kind of Data Memory Barrier. + It completes when all explicit memory accesses before this instruction complete. + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __DSB(void) +{ + __ASM volatile ("dsb"); +} + + +/** \brief Data Memory Barrier + + This function ensures the apparent order of the explicit memory operations before + and after the instruction, without ensuring their completion. + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __DMB(void) +{ + __ASM volatile ("dmb"); +} + + +/** \brief Reverse byte order (32 bit) + + This function reverses the byte order in integer value. + + \param [in] value Value to reverse + \return Reversed value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __REV(uint32_t value) +{ + uint32_t result; + + __ASM volatile ("rev %0, %1" : "=r" (result) : "r" (value) ); + return(result); +} + + +/** \brief Reverse byte order (16 bit) + + This function reverses the byte order in two unsigned short values. + + \param [in] value Value to reverse + \return Reversed value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __REV16(uint32_t value) +{ + uint32_t result; + + __ASM volatile ("rev16 %0, %1" : "=r" (result) : "r" (value) ); + return(result); +} + + +/** \brief Reverse byte order in signed short value + + This function reverses the byte order in a signed short value with sign extension to integer. + + \param [in] value Value to reverse + \return Reversed value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE int32_t __REVSH(int32_t value) +{ + uint32_t result; + + __ASM volatile ("revsh %0, %1" : "=r" (result) : "r" (value) ); + return(result); +} + + +/** \brief Rotate Right in unsigned value (32 bit) + + This function Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. + + \param [in] value Value to rotate + \param [in] value Number of Bits to rotate + \return Rotated value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2) +{ + + __ASM volatile ("ror %0, %0, %1" : "+r" (op1) : "r" (op2) ); + return(op1); +} + + +#if (__CORTEX_M >= 0x03) + +/** \brief Reverse bit order of value + + This function reverses the bit order of the given value. + + \param [in] value Value to reverse + \return Reversed value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __RBIT(uint32_t value) +{ + uint32_t result; + + __ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) ); + return(result); +} + + +/** \brief LDR Exclusive (8 bit) + + This function performs a exclusive LDR command for 8 bit value. + + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint8_t __LDREXB(volatile uint8_t *addr) +{ + uint8_t result; + + __ASM volatile ("ldrexb %0, [%1]" : "=r" (result) : "r" (addr) ); + return(result); +} + + +/** \brief LDR Exclusive (16 bit) + + This function performs a exclusive LDR command for 16 bit values. + + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint16_t __LDREXH(volatile uint16_t *addr) +{ + uint16_t result; + + __ASM volatile ("ldrexh %0, [%1]" : "=r" (result) : "r" (addr) ); + return(result); +} + + +/** \brief LDR Exclusive (32 bit) + + This function performs a exclusive LDR command for 32 bit values. + + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __LDREXW(volatile uint32_t *addr) +{ + uint32_t result; + + __ASM volatile ("ldrex %0, [%1]" : "=r" (result) : "r" (addr) ); + return(result); +} + + +/** \brief STR Exclusive (8 bit) + + This function performs a exclusive STR command for 8 bit values. + + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __STREXB(uint8_t value, volatile uint8_t *addr) +{ + uint32_t result; + + __ASM volatile ("strexb %0, %2, [%1]" : "=&r" (result) : "r" (addr), "r" (value) ); + return(result); +} + + +/** \brief STR Exclusive (16 bit) + + This function performs a exclusive STR command for 16 bit values. + + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __STREXH(uint16_t value, volatile uint16_t *addr) +{ + uint32_t result; + + __ASM volatile ("strexh %0, %2, [%1]" : "=&r" (result) : "r" (addr), "r" (value) ); + return(result); +} + + +/** \brief STR Exclusive (32 bit) + + This function performs a exclusive STR command for 32 bit values. + + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __STREXW(uint32_t value, volatile uint32_t *addr) +{ + uint32_t result; + + __ASM volatile ("strex %0, %2, [%1]" : "=&r" (result) : "r" (addr), "r" (value) ); + return(result); +} + + +/** \brief Remove the exclusive lock + + This function removes the exclusive lock which is created by LDREX. + + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __CLREX(void) +{ + __ASM volatile ("clrex"); +} + + +/** \brief Signed Saturate + + This function 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(ARG1,ARG2) \ +({ \ + uint32_t __RES, __ARG1 = (ARG1); \ + __ASM ("ssat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ + __RES; \ + }) + + +/** \brief Unsigned Saturate + + This function 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(ARG1,ARG2) \ +({ \ + uint32_t __RES, __ARG1 = (ARG1); \ + __ASM ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ + __RES; \ + }) + + +/** \brief Count leading zeros + + This function 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 + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint8_t __CLZ(uint32_t value) +{ + uint8_t result; + + __ASM volatile ("clz %0, %1" : "=r" (result) : "r" (value) ); + return(result); +} + +#endif /* (__CORTEX_M >= 0x03) */ + + + + +#elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/ +/* TASKING carm specific functions */ + +/* + * 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. + */ + +#endif + +/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ + +#endif /* __CORE_CMINSTR_H */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/README.txt b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/README.txt new file mode 100644 index 000000000..efa2ad16e --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/thirdparty/CMSIS/README.txt @@ -0,0 +1,37 @@ +* ------------------------------------------------------------------- +* Copyright (C) 2011 ARM Limited. All rights reserved. +* +* Date: 11 October 2011 +* Revision: V3.00 +* +* Project: Cortex Microcontroller Software Interface Standard (CMSIS) +* Title: Release Note for CMSIS +* +* ------------------------------------------------------------------- + + +NOTE - Open the index.html file to access CMSIS documentation + + +The Cortex Microcontroller Software Interface Standard (CMSIS) provides a single standard across all +Cortex-Mx processor series vendors. It enables code re-use and code sharing across software projects +and reduces time-to-market for new embedded applications. + +CMSIS is released under the terms of the end user license agreement ("CMSIS END USER LICENCE AGREEMENT.pdf"). +Any user of the software package is bound to the terms and conditions of the end user license agreement. + + +You will find the following sub-directories: + +Documentation - Contains CMSIS documentation. + +DSP_Lib - MDK project files, Examples and source files etc.. to build the + CMSIS DSP Software Library for Cortex-M0, Cortex-M3, Cortex-M4 processors. + +Include - CMSIS Core Support and CMSIS DSP Include Files. + +Lib - CMSIS DSP Libraries. + +RTOS - CMSIS RTOS API template header file. + +SVD - CMSIS SVD Schema files and Conversion Utility. diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/FreeRTOSConfig.h new file mode 100644 index 000000000..44976b5c3 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/FreeRTOSConfig.h @@ -0,0 +1,196 @@ +/* + FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd. + + FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT + http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. + + *************************************************************************** + * * + * FreeRTOS tutorial books are available in pdf and paperback. * + * Complete, revised, and edited pdf reference manuals are also * + * available. * + * * + * Purchasing FreeRTOS documentation will not only help you, by * + * ensuring you get running as quickly as possible and with an * + * in-depth knowledge of how to use FreeRTOS, it will also help * + * the FreeRTOS project to continue with its mission of providing * + * professional grade, cross platform, de facto standard solutions * + * for microcontrollers - completely free of charge! * + * * + * >>> See http://www.FreeRTOS.org/Documentation for details. <<< * + * * + * Thank you for using FreeRTOS, and thank you for your support! * + * * + *************************************************************************** + + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + + >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to + distribute a combined work that includes FreeRTOS without being obliged to + provide the source code for proprietary components outside of the FreeRTOS + kernel. + + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + details. You should have received a copy of the GNU General Public License + and the FreeRTOS license exception along with FreeRTOS; if not itcan be + viewed here: http://www.freertos.org/a00114.html and also obtained by + writing to Real Time Engineers Ltd., contact details for whom are available + on the FreeRTOS WEB site. + + 1 tab == 4 spaces! + + *************************************************************************** + * * + * Having a problem? Start by reading the FAQ "My application does * + * not run, what could be wrong?" * + * * + * http://www.FreeRTOS.org/FAQHelp.html * + * * + *************************************************************************** + + + http://www.FreeRTOS.org - Documentation, books, training, latest versions, + license and Real Time Engineers Ltd. contact details. + + http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, + including FreeRTOS+Trace - an indispensable productivity tool, and our new + fully thread aware and reentrant UDP/IP stack. + + http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High + Integrity Systems, who sell the code with commercial support, + indemnification and middleware, under the OpenRTOS brand. + + http://www.SafeRTOS.com - High Integrity Systems also provide a safety + engineered and independently SIL3 certified version for use in safety and + mission critical applications that require provable dependability. +*/ + +#ifndef FREERTOS_CONFIG_H +#define FREERTOS_CONFIG_H + +/*----------------------------------------------------------- + * Application specific definitions. + * + * These definitions should be adjusted for your particular hardware and + * application requirements. + * + * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * + * See http://www.freertos.org/a00110.html. + *----------------------------------------------------------*/ + +/* Set configCREATE_LOW_POWER_DEMO to one to run the simple blinky demo, +or 0 to run the more comprehensive test and demo application. */ +#define configCREATE_LOW_POWER_DEMO 1 + +#if configCREATE_LOW_POWER_DEMO == 1 + #define configCPU_CLOCK_HZ 16384 /*( sysclk_get_cpu_hz() )*/ + #define configSYSTICK_CLOCK_HZ 16384 + #define configUSE_TICKLESS_IDLE 1 + #define configTICK_RATE_HZ ( ( portTickType ) 128 ) +#else + #define configCPU_CLOCK_HZ sysclk_get_cpu_hz() + #define configUSE_TICKLESS_IDLE 0 + #define configTICK_RATE_HZ ( ( portTickType ) 1000 ) +#endif /* configCREATE_LOW_POWER_DEMO */ + +#define configUSE_PREEMPTION 1 +#define configUSE_IDLE_HOOK 0 +#define configUSE_TICK_HOOK 0 +#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 ) +#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 130 ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 26000 ) ) +#define configMAX_TASK_NAME_LEN ( 10 ) +#define configUSE_TRACE_FACILITY 1 +#define configUSE_16_BIT_TICKS 0 +#define configIDLE_SHOULD_YIELD 1 +#define configUSE_MUTEXES 1 +#define configQUEUE_REGISTRY_SIZE 8 +#define configCHECK_FOR_STACK_OVERFLOW 0 +#define configUSE_RECURSIVE_MUTEXES 1 +#define configUSE_MALLOC_FAILED_HOOK 1 +#define configUSE_APPLICATION_TASK_TAG 0 +#define configUSE_COUNTING_SEMAPHORES 1 + +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + +/* Software timer definitions. */ +#define configUSE_TIMERS 1 +#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) +#define configTIMER_QUEUE_LENGTH 5 +#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 ) + +/* Set the following definitions to 1 to include the API function, or zero +to exclude the API function. */ +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskCleanUpResources 1 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 + +/* FreeRTOS+CLI definitions. */ + +/* Dimensions a buffer into which command outputs can be written. The buffer +can be declared in the CLI code itself, to allow multiple command consoles to +share the same buffer. For example, an application may allow access to the +command interpreter by UART and by Ethernet. Sharing a buffer is done purely +to save RAM. Note, however, that the command console itself is not re-entrant, +so only one command interpreter interface can be used at any one time. For +that reason, no attempt at providing mutual exclusion to the buffer is +attempted. */ +#define configCOMMAND_INT_MAX_OUTPUT_SIZE 400 + + +/* Cortex-M specific definitions. */ + +#ifdef __NVIC_PRIO_BITS + /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ + #define configPRIO_BITS __NVIC_PRIO_BITS +#else + #define configPRIO_BITS 4 /* 15 priority levels */ +#endif + +/* The lowest interrupt priority that can be used in a call to a "set priority" +function. */ +#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x0f + +/* The highest interrupt priority that can be used by any interrupt service +routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL +INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER +PRIORITY THAN THIS! (higher priorities are lower numeric values. */ +#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 10 + +/* Interrupt priorities used by the kernel port layer itself. These are generic +to all Cortex-M ports, and do not rely on any particular library functions. */ +#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) +#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) + +/* Normal assert() semantics without relying on the provision of an assert.h +header file. */ +void vAssertCalled( void ); +#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled(); +#define INCLUDE_MODULE_TEST 0 + +/* The configPRE_SLEEP_PROCESSING() and configPOST_SLEEP_PROCESSING() macros +allow the application writer to add additional code before and after the MCU is +placed into the low power state respectively. The empty implementations +provided in this demo can be extended to save even more power. */ +void vPreSleepProcessing( unsigned long xExpectedIdleTime ); +void vPostSleepProcessing( unsigned long xExpectedIdleTime ); +#define configPRE_SLEEP_PROCESSING( xExpectedIdleTime ) vPreSleepProcessing( xExpectedIdleTime ); +#define configPOST_SLEEP_PROCESSING( xExpectedIdleTime ) vPostSleepProcessing( xExpectedIdleTime ); + +#endif /* FREERTOS_CONFIG_H */ + diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/conf_ast.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/conf_ast.h new file mode 100644 index 000000000..895c4b7f3 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/conf_ast.h @@ -0,0 +1,55 @@ +/** + * \file + * + * \brief AST configuration. + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +//! Configuration of the AST driver + +#ifndef CONF_AST_H_INCLUDED +#define CONF_AST_H_INCLUDED + +//#define AST_PER_ENABLE +// #define AST_ALARM_ENABLE +// #define AST_OVF_ENABLE +// #define AST_READY_ENABLE +// #define AST_CLKREADY_ENABLE + +#endif /* CONF_AST_H_INCLUDED */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/conf_board.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/conf_board.h new file mode 100644 index 000000000..96e099f05 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/conf_board.h @@ -0,0 +1,53 @@ +/** + * \file + * + * \brief Configuration File for SAM4L-EK Board. + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#ifndef CONF_BOARD_H_INCLUDED +#define CONF_BOARD_H_INCLUDED + +/** Enable Com Port. */ +#define CONF_BOARD_COM_PORT + +/** Enable LCD backlight */ +#define CONF_BOARD_BL + +#endif /* CONF_BOARD_H_INCLUDED */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/conf_clock.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/conf_clock.h new file mode 100644 index 000000000..9a785bbee --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/conf_clock.h @@ -0,0 +1,97 @@ +/** + * \file + * + * \brief Chip-specific system clock manager configuration + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +#ifndef CONF_CLOCK_H_INCLUDED +#define CONF_CLOCK_H_INCLUDED + +//#define CONFIG_SYSCLK_INIT_CPUMASK 0 +//#define CONFIG_SYSCLK_INIT_PBAMASK ((1 << SYSCLK_USART2)) +//#define CONFIG_SYSCLK_INIT_PBBMASK ((1 << SYSCLK_HFLASHC_REGS)) +//#define CONFIG_SYSCLK_INIT_PBCMASK ((1 << SYSCLK_PM) | (1 << SYSCLK_SCIF) | (1 << SYSCLK_GPIO)) +//#define CONFIG_SYSCLK_INIT_PBDMASK ((1 << SYSCLK_BPM) | (1 << SYSCLK_BSCIF) | (1 << SYSCLK_AST)) +//#define CONFIG_SYSCLK_INIT_HSBMASK ((1 << SYSCLK_HFLASHC_DATA) | (SYSCLK_PBA_BRIDGE) | (SYSCLK_PBC_BRIDGE) | (SYSCLK_PBD_BRIDGE)) + +//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_RCSYS +//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_OSC0 +//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_PLL0 +//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_DFLL +//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_RC80M +#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_RCFAST +//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_RC1M + +/* RCFAST frequency selection: 0 for 4MHz, 1 for 8MHz and 2 for 12MHz */ +//#define CONFIG_RCFAST_FRANGE 0 +//#define CONFIG_RCFAST_FRANGE 1 +#define CONFIG_RCFAST_FRANGE 2 + +/* Fbus = Fsys / (2 ^ BUS_div) */ +#define CONFIG_SYSCLK_CPU_DIV 0 +#define CONFIG_SYSCLK_PBA_DIV 0 +#define CONFIG_SYSCLK_PBB_DIV 0 +#define CONFIG_SYSCLK_PBC_DIV 2 +#define CONFIG_SYSCLK_PBD_DIV 2 + +//#define CONFIG_USBCLK_SOURCE USBCLK_SRC_OSC0 +//#define CONFIG_USBCLK_SOURCE USBCLK_SRC_PLL0 + +/* Fusb = Fsys / USB_div */ +//#define CONFIG_USBCLK_DIV 1 + +//#define CONFIG_PLL0_SOURCE PLL_SRC_OSC0 + +/* Fpll0 = (Fclk * PLL_mul) / PLL_div */ +//#define CONFIG_PLL0_MUL (48000000UL / BOARD_OSC0_HZ) +//#define CONFIG_PLL0_DIV 1 + +//#define CONFIG_DFLL0_SOURCE GENCLK_SRC_OSC0 +//#define CONFIG_DFLL0_SOURCE GENCLK_SRC_RCSYS +//#define CONFIG_DFLL0_SOURCE GENCLK_SRC_OSC32K +//#define CONFIG_DFLL0_SOURCE GENCLK_SRC_RC80M +//#define CONFIG_DFLL0_SOURCE GENCLK_SRC_RC32K + +/* Fdfll = (Fclk * DFLL_mul) / DFLL_div */ +//#define CONFIG_DFLL0_FREQ 96000000UL +//#define CONFIG_DFLL0_MUL (CONFIG_DFLL0_FREQ / BOARD_OSC0_HZ) +//#define CONFIG_DFLL0_DIV 2 + +#endif /* CONF_CLOCK_H_INCLUDED */ + diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/conf_example.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/conf_example.h new file mode 100644 index 000000000..a401ffcdf --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/conf_example.h @@ -0,0 +1,133 @@ +/** + * \file + * + * \brief Configuration File for LCDCA example. + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#ifndef CONF_EXAMPLE_H_INCLUDED +#define CONF_EXAMPLE_H_INCLUDED + +/** This is the pin for the onboard PB0 button, corresponding to PC03. */ +#define NEXT_BUTTON GPIO_PUSH_BUTTON_0 + +/** LCD contrast level */ +#define LCD_CONTRAST_LEVEL 30 + +/** + * Here are definitions of C42364A glass LCD for this example + * @{ + */ + +/** \name LCD Common + * @{ + */ +#define NB_OF_COM 4 +#define NB_OF_SEG 40 +/** @} */ + +/** \name LCD Connection Initialization + * @{ + */ +#define PORT_MASK NB_OF_SEG +#define LCD_DUTY (NB_OF_COM % 4) +/** @} */ + +/** \name Digit Decoder + * @{ + */ +/** 7-segment with 3 commons terminals */ +#define FIRST_7SEG_3C 255 /* 255 = unavailable */ +#define WIDTH_7SEG_3C 255 /* 255 = unavailable */ +#define DIR_7SEG_3C 0 /* 0 = from left to right */ + +/** 7-segment with 4 commons terminals */ +#define FIRST_7SEG_4C 10 +#define WIDTH_7SEG_4C 4 +#define DIR_7SEG_4C 1 /* 1 = from right to left */ + +/** 14-segment with 4 commons terminals */ +#define FIRST_14SEG_4C 36 +#define WIDTH_14SEG_4C 7 +#define DIR_14SEG_4C 1 /* 1 = from right to left */ + +/** 16-segment with 3 commons terminals */ +#define FIRST_16SEG_3C 255 /* 255 = unavailable */ +#define WIDTH_16SEG_3C 255 /* 255 = unavailable */ +#define DIR_16SEG_3C 0 +/** @} */ + +/** \name Pixel With Blinking feature + * @{ + */ +#define ICON_USB 1, 0 +#define ICON_COLON 0, 0 +#define ICON_WLESS 2, 0 +#define ICON_AUDIO 3, 0 +#define ICON_BAT 0, 1 +#define ICON_ERROR 1, 1 +#define ICON_CHINESE 2, 1 +#define ICON_ARM 3, 1 +/** @} */ + +/** \name Pixel With No-Blinking feature + * @{ + */ +#define ICON_MINUS 0, 37 +#define ICON_MINUS_SEG1 3, 30 +#define ICON_MINUS_SEG2 0, 33 +#define ICON_DOT_1 0, 29 +#define ICON_DOT_2 3, 10 +#define ICON_DOT_3 3, 8 +#define ICON_DOT_4 3, 6 +#define ICON_BAT_LEVEL_1 0, 21 +#define ICON_BAT_LEVEL_2 0, 17 +#define ICON_BAT_LEVEL_3 0, 25 +#define ICON_AUDIO_PAUSE 3, 38 +#define ICON_AUDIO_PLAY 3, 34 +#define ICON_AM 3, 4 +#define ICON_PM 3, 26 +#define ICON_DEGREE_C 3, 22 +#define ICON_DEGREE_F 3, 18 +#define ICON_VOLT 3, 14 +#define ICON_MILLI_VOLT 0, 13 +/** @} */ +/** @} */ + +#endif /* CONF_EXAMPLE_H_INCLUDED */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/conf_sleepmgr.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/conf_sleepmgr.h new file mode 100644 index 000000000..bc41f8676 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/conf_sleepmgr.h @@ -0,0 +1,49 @@ +/** + * \file + * + * \brief Chip-specific sleep manager configuration + * + * Copyright (c) 2012 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +#ifndef CONF_SLEEPMGR_INCLUDED +#define CONF_SLEEPMGR_INCLUDED + +// Sleep manager options +#define CONFIG_SLEEPMGR_ENABLE + +#endif /* CONF_SLEEPMGR_INCLUDED */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/main.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/main.c new file mode 100644 index 000000000..607584ea5 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/main.c @@ -0,0 +1,309 @@ +/* + FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd. + + FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT + http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. + + *************************************************************************** + * * + * FreeRTOS tutorial books are available in pdf and paperback. * + * Complete, revised, and edited pdf reference manuals are also * + * available. * + * * + * Purchasing FreeRTOS documentation will not only help you, by * + * ensuring you get running as quickly as possible and with an * + * in-depth knowledge of how to use FreeRTOS, it will also help * + * the FreeRTOS project to continue with its mission of providing * + * professional grade, cross platform, de facto standard solutions * + * for microcontrollers - completely free of charge! * + * * + * >>> See http://www.FreeRTOS.org/Documentation for details. <<< * + * * + * Thank you for using FreeRTOS, and thank you for your support! * + * * + *************************************************************************** + + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + + >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to + distribute a combined work that includes FreeRTOS without being obliged to + provide the source code for proprietary components outside of the FreeRTOS + kernel. + + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + details. You should have received a copy of the GNU General Public License + and the FreeRTOS license exception along with FreeRTOS; if not itcan be + viewed here: http://www.freertos.org/a00114.html and also obtained by + writing to Real Time Engineers Ltd., contact details for whom are available + on the FreeRTOS WEB site. + + 1 tab == 4 spaces! + + *************************************************************************** + * * + * Having a problem? Start by reading the FAQ "My application does * + * not run, what could be wrong?" * + * * + * http://www.FreeRTOS.org/FAQHelp.html * + * * + *************************************************************************** + + + http://www.FreeRTOS.org - Documentation, books, training, latest versions, + license and Real Time Engineers Ltd. contact details. + + http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, + including FreeRTOS+Trace - an indispensable productivity tool, and our new + fully thread aware and reentrant UDP/IP stack. + + http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High + Integrity Systems, who sell the code with commercial support, + indemnification and middleware, under the OpenRTOS brand. + + http://www.SafeRTOS.com - High Integrity Systems also provide a safety + engineered and independently SIL3 certified version for use in safety and + mission critical applications that require provable dependability. +*/ + +/* + FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd. + + FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT + http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. + + *************************************************************************** + * * + * FreeRTOS tutorial books are available in pdf and paperback. * + * Complete, revised, and edited pdf reference manuals are also * + * available. * + * * + * Purchasing FreeRTOS documentation will not only help you, by * + * ensuring you get running as quickly as possible and with an * + * in-depth knowledge of how to use FreeRTOS, it will also help * + * the FreeRTOS project to continue with its mission of providing * + * professional grade, cross platform, de facto standard solutions * + * for microcontrollers - completely free of charge! * + * * + * >>> See http://www.FreeRTOS.org/Documentation for details. <<< * + * * + * Thank you for using FreeRTOS, and thank you for your support! * + * * + *************************************************************************** + + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + + >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to + distribute a combined work that includes FreeRTOS without being obliged to + provide the source code for proprietary components outside of the FreeRTOS + kernel. + + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + details. You should have received a copy of the GNU General Public License + and the FreeRTOS license exception along with FreeRTOS; if not itcan be + viewed here: http://www.freertos.org/a00114.html and also obtained by + writing to Real Time Engineers Ltd., contact details for whom are available + on the FreeRTOS WEB site. + + 1 tab == 4 spaces! + + *************************************************************************** + * * + * Having a problem? Start by reading the FAQ "My application does * + * not run, what could be wrong?" * + * * + * http://www.FreeRTOS.org/FAQHelp.html * + * * + *************************************************************************** + + + http://www.FreeRTOS.org - Documentation, books, training, latest versions, + license and Real Time Engineers Ltd. contact details. + + http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, + including FreeRTOS+Trace - an indispensable productivity tool, and our new + fully thread aware and reentrant UDP/IP stack. + + http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High + Integrity Systems, who sell the code with commercial support, + indemnification and middleware, under the OpenRTOS brand. + + http://www.SafeRTOS.com - High Integrity Systems also provide a safety + engineered and independently SIL3 certified version for use in safety and + mission critical applications that require provable dependability. +*/ + +/****************************************************************************** + * This project provides two demo applications. A low power project that + * demonstrates the FreeRTOS tickless mode, and a more comprehensive test and + * demo application. The configCREATE_LOW_POWER_DEMO setting (defined at the + * top of FreeRTOSConfig.h) is used to select between the two. The low power + * demo is implemented and described in main_low_power.c. The more + * comprehensive test and demo application is implemented and described in + * main_full.c. + * + * This file implements the code that is not demo specific, including the + * hardware setup and FreeRTOS hook functions. + */ + +/* Standard includes. */ +#include + +/* Kernel includes. */ +#include "FreeRTOS.h" +#include "task.h" + +/* Standard demo includes - just needed for the LED (ParTest) initialisation +function. */ +#include "partest.h" + +/* Atmel library includes. */ +#include + +/*-----------------------------------------------------------*/ + +/* + * Set up the hardware ready to run this demo. + */ +static void prvSetupHardware( void ); + +/* + * main_low_power() is used when configCREATE_LOW_POWER_DEMO is set to 1. + * main_full() is used when configCREATE_LOW_POWER_DEMO is set to 0. + * configCREATE_LOW_POWER_DEMO is defined at the top of main.c. + */ +extern void main_low_power( void ); +extern void main_full( void ); + +/* Prototypes for the standard FreeRTOS callback/hook functions implemented +within this file. */ +void vApplicationMallocFailedHook( void ); +void vApplicationIdleHook( void ); +void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName ); +void vApplicationTickHook( void ); + +/*-----------------------------------------------------------*/ + +/* See the documentation page for this demo on the FreeRTOS.org web site for +full information - including hardware setup requirements. */ +int main( void ) +{ + /* Prepare the hardware to run this demo. */ + prvSetupHardware(); + + /* The configCREATE_LOW_POWER_DEMO setting is described at the top of + this file. */ + #if configCREATE_LOW_POWER_DEMO == 1 + { + main_low_power(); + } + #else + { + main_full(); + } + #endif + + return 0; +} +/*-----------------------------------------------------------*/ + +static void prvSetupHardware( void ) +{ +extern void SystemCoreClockUpdate( void ); + + /* ASF function to setup clocking. */ + sysclk_init(); + + /* Ensure all priority bits are assigned as preemption priority bits. */ + NVIC_SetPriorityGrouping( 0 ); + + /* Atmel library function to setup for the evaluation kit being used. */ + board_init(); + + /* Initialise the sleep manager in case the low power demo is being used. */ + sleepmgr_init(); +} +/*-----------------------------------------------------------*/ + +void vApplicationMallocFailedHook( void ) +{ + /* vApplicationMallocFailedHook() will only be called if + configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h. It is a hook + function that will get called if a call to pvPortMalloc() fails. + pvPortMalloc() is called internally by the kernel whenever a task, queue, + timer or semaphore is created. It is also called by various parts of the + demo application. If heap_1.c or heap_2.c are used, then the size of the + heap available to pvPortMalloc() is defined by configTOTAL_HEAP_SIZE in + FreeRTOSConfig.h, and the xPortGetFreeHeapSize() API function can be used + to query the size of free heap space that remains (although it does not + provide information on how the remaining heap might be fragmented). */ + taskDISABLE_INTERRUPTS(); + for( ;; ); +} +/*-----------------------------------------------------------*/ + +void vApplicationIdleHook( void ) +{ + /* vApplicationIdleHook() will only be called if configUSE_IDLE_HOOK is set + to 1 in FreeRTOSConfig.h. It will be called on each iteration of the idle + task. It is essential that code added to this hook function never attempts + to block in any way (for example, call xQueueReceive() with a block time + specified, or call vTaskDelay()). If the application makes use of the + vTaskDelete() API function (as this demo application does) then it is also + important that vApplicationIdleHook() is permitted to return to its calling + function, because it is the responsibility of the idle task to clean up + memory allocated by the kernel to any task that has since been deleted. */ +} +/*-----------------------------------------------------------*/ + +void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName ) +{ + ( void ) pcTaskName; + ( void ) pxTask; + + /* Run time stack overflow checking is performed if + configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook + function is called if a stack overflow is detected. */ + taskDISABLE_INTERRUPTS(); + for( ;; ); +} +/*-----------------------------------------------------------*/ + +void vApplicationTickHook( void ) +{ + /* This function will be called by each tick interrupt if + configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h. User code can be + added here, but the tick hook is called from an interrupt context, so + code must not attempt to block, and only the interrupt safe FreeRTOS API + functions can be used (those that end in FromISR()). */ +} +/*-----------------------------------------------------------*/ + +void vAssertCalled( void ) +{ +volatile unsigned long ul = 0; + + taskENTER_CRITICAL(); + { + /* Set ul to a non-zero value using the debugger to step out of this + function. */ + while( ul == 0 ) + { + __asm volatile( "NOP" ); + } + } + taskEXIT_CRITICAL(); +} diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/main_full.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/main_full.c new file mode 100644 index 000000000..7cce6e283 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/main_full.c @@ -0,0 +1,273 @@ +/* + FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd. + + FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT + http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. + + *************************************************************************** + * * + * FreeRTOS tutorial books are available in pdf and paperback. * + * Complete, revised, and edited pdf reference manuals are also * + * available. * + * * + * Purchasing FreeRTOS documentation will not only help you, by * + * ensuring you get running as quickly as possible and with an * + * in-depth knowledge of how to use FreeRTOS, it will also help * + * the FreeRTOS project to continue with its mission of providing * + * professional grade, cross platform, de facto standard solutions * + * for microcontrollers - completely free of charge! * + * * + * >>> See http://www.FreeRTOS.org/Documentation for details. <<< * + * * + * Thank you for using FreeRTOS, and thank you for your support! * + * * + *************************************************************************** + + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + + >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to + distribute a combined work that includes FreeRTOS without being obliged to + provide the source code for proprietary components outside of the FreeRTOS + kernel. + + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + details. You should have received a copy of the GNU General Public License + and the FreeRTOS license exception along with FreeRTOS; if not itcan be + viewed here: http://www.freertos.org/a00114.html and also obtained by + writing to Real Time Engineers Ltd., contact details for whom are available + on the FreeRTOS WEB site. + + 1 tab == 4 spaces! + + *************************************************************************** + * * + * Having a problem? Start by reading the FAQ "My application does * + * not run, what could be wrong?" * + * * + * http://www.FreeRTOS.org/FAQHelp.html * + * * + *************************************************************************** + + + http://www.FreeRTOS.org - Documentation, books, training, latest versions, + license and Real Time Engineers Ltd. contact details. + + http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, + including FreeRTOS+Trace - an indispensable productivity tool, and our new + fully thread aware and reentrant UDP/IP stack. + + http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High + Integrity Systems, who sell the code with commercial support, + indemnification and middleware, under the OpenRTOS brand. + + http://www.SafeRTOS.com - High Integrity Systems also provide a safety + engineered and independently SIL3 certified version for use in safety and + mission critical applications that require provable dependability. +*/ + +/****************************************************************************** + * NOTE 1: This project provides two demo applications. A low power tickless + * project, and a more comprehensive test and demo application. The + * configCREATE_LOW_POWER_DEMO setting in FreeRTOSConfig.h is used to + * select between the two. See the notes on using + * configCREATE_LOW_POWER_DEMO in FreeRTOSConfig.h. This file implements + * the comprehensive test and demo version. + * + * NOTE 2: This file only contains the source code that is specific to the + * full demo. Generic functions, such FreeRTOS hook functions, and functions + * required to configure the hardware, are defined in main.c. + ****************************************************************************** + * + * main_full() creates all the demo application tasks and a software timer, then + * starts the scheduler. The web documentation provides more details of the + * standard demo application tasks, which provide no particular functionality, + * but do provide a good example of how to use the FreeRTOS API. + * + * In addition to the standard demo tasks, the following tasks and tests are + * defined and/or created within this file: + * + * "Check" timer - The check software timer period is initially set to three + * seconds. The callback function associated with the check software timer + * checks that all the standard demo tasks are not only still executing, but + * are executing without reporting any errors. If the check software timer + * discovers that a task has either stalled, or reported an error, then it + * changes its own execution period from the initial three seconds, to just + * 200ms. The check software timer callback function also toggles an LED each + * time it is called. This provides a visual indication of the system status: + * If the LED toggles every three seconds, then no issues have been discovered. + * If the LED toggles every 200ms, then an issue has been discovered with at + * least one task. + * + * See the documentation page for this demo on the FreeRTOS.org web site for + * full information, including hardware setup requirements. + */ + +/* Standard includes. */ +#include + +/* Kernel includes. */ +#include "FreeRTOS.h" +#include "task.h" +#include "timers.h" +#include "semphr.h" + +/* Standard demo application includes. */ +#include "PollQ.h" +#include "semtest.h" +#include "dynamic.h" +#include "BlockQ.h" +#include "blocktim.h" +#include "countsem.h" +#include "GenQTest.h" +#include "recmutex.h" +#include "partest.h" + +/* Atmel library includes. */ +#include "asf.h" + +/* Priorities for the demo application tasks. */ +#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 2UL ) +#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1UL ) +#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2UL ) + +/* A block time of zero simply means "don't block". */ +#define mainDONT_BLOCK ( 0UL ) + +/* The period after which the check timer will expire providing no errors +have been reported by any of the standard demo tasks. ms are converted to the +equivalent in ticks using the portTICK_RATE_MS constant. */ +#define mainCHECK_TIMER_PERIOD_MS ( 3000UL / portTICK_RATE_MS ) + +/* The period at which the check timer will expire, in ms, if an error has been +reported in one of the standard demo tasks. ms are converted to the equivalent +in ticks using the portTICK_RATE_MS constant. */ +#define mainERROR_CHECK_TIMER_PERIOD_MS ( 200UL / portTICK_RATE_MS ) + +/* The LED toggled by the check timer. */ +#define mainCHECK_LED ( 0 ) + +/*-----------------------------------------------------------*/ + +/* + * The check timer callback function, as described at the top of this file. + */ +static void prvCheckTimerCallback( xTimerHandle xTimer ); + +/*-----------------------------------------------------------*/ + +void main_full( void ) +{ +xTimerHandle xCheckTimer = NULL; + + /* Start all the other standard demo/test tasks. They have not particular + functionality, but do demonstrate how to use the FreeRTOS API and test the + kernel port. */ + vStartDynamicPriorityTasks(); + vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY ); + vCreateBlockTimeTasks(); + vStartCountingSemaphoreTasks(); + vStartGenericQueueTasks( tskIDLE_PRIORITY ); + vStartRecursiveMutexTasks(); + vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY ); + vStartSemaphoreTasks( mainSEM_TEST_PRIORITY ); + + /* Create the software timer that performs the 'check' functionality, + as described at the top of this file. */ + xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */ + ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */ + pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */ + ( void * ) 0, /* The ID is not used, so can be set to anything. */ + prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */ + ); + + if( xCheckTimer != NULL ) + { + xTimerStart( xCheckTimer, mainDONT_BLOCK ); + } + + /* Start the scheduler. */ + vTaskStartScheduler(); + + /* If all is well, the scheduler will now be running, and the following line + will never be reached. If the following line does execute, then there was + insufficient FreeRTOS heap memory available for the idle and/or timer tasks + to be created. See the memory management section on the FreeRTOS web site + for more details. */ + for( ;; ); +} +/*-----------------------------------------------------------*/ + +static void prvCheckTimerCallback( xTimerHandle xTimer ) +{ +static long lChangedTimerPeriodAlready = pdFALSE; +unsigned long ulErrorFound = pdFALSE; + + /* Check all the demo tasks (other than the flash tasks) to ensure + they are all still running, and that none have detected an error. */ + + if( xAreDynamicPriorityTasksStillRunning() != pdTRUE ) + { + ulErrorFound = pdTRUE; + } + + if( xAreBlockingQueuesStillRunning() != pdTRUE ) + { + ulErrorFound = pdTRUE; + } + + if ( xAreBlockTimeTestTasksStillRunning() != pdTRUE ) + { + ulErrorFound = pdTRUE; + } + + if ( xAreGenericQueueTasksStillRunning() != pdTRUE ) + { + ulErrorFound = pdTRUE; + } + + if ( xAreRecursiveMutexTasksStillRunning() != pdTRUE ) + { + ulErrorFound = pdTRUE; + } + + if( xArePollingQueuesStillRunning() != pdTRUE ) + { + ulErrorFound = pdTRUE; + } + + if( xAreSemaphoreTasksStillRunning() != pdTRUE ) + { + ulErrorFound = pdTRUE; + } + + /* Toggle the check LED to give an indication of the system status. If + the LED toggles every mainCHECK_TIMER_PERIOD_MS milliseconds then + everything is ok. A faster toggle indicates an error. */ + vParTestToggleLED( mainCHECK_LED ); + + /* Have any errors been latch in ulErrorFound? If so, shorten the + period of the check timer to mainERROR_CHECK_TIMER_PERIOD_MS milliseconds. + This will result in an increase in the rate at which mainCHECK_LED + toggles. */ + if( ulErrorFound != pdFALSE ) + { + if( lChangedTimerPeriodAlready == pdFALSE ) + { + lChangedTimerPeriodAlready = pdTRUE; + + /* This call to xTimerChangePeriod() uses a zero block time. + Functions called from inside of a timer callback function must + *never* attempt to block. */ + xTimerChangePeriod( xTimer, ( mainERROR_CHECK_TIMER_PERIOD_MS ), mainDONT_BLOCK ); + } + } +} +/*-----------------------------------------------------------*/ + diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/main_low_power.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/main_low_power.c new file mode 100644 index 000000000..24166a033 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/main_low_power.c @@ -0,0 +1,267 @@ +/* + FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd. + + FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT + http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. + + *************************************************************************** + * * + * FreeRTOS tutorial books are available in pdf and paperback. * + * Complete, revised, and edited pdf reference manuals are also * + * available. * + * * + * Purchasing FreeRTOS documentation will not only help you, by * + * ensuring you get running as quickly as possible and with an * + * in-depth knowledge of how to use FreeRTOS, it will also help * + * the FreeRTOS project to continue with its mission of providing * + * professional grade, cross platform, de facto standard solutions * + * for microcontrollers - completely free of charge! * + * * + * >>> See http://www.FreeRTOS.org/Documentation for details. <<< * + * * + * Thank you for using FreeRTOS, and thank you for your support! * + * * + *************************************************************************** + + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + + >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to + distribute a combined work that includes FreeRTOS without being obliged to + provide the source code for proprietary components outside of the FreeRTOS + kernel. + + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + details. You should have received a copy of the GNU General Public License + and the FreeRTOS license exception along with FreeRTOS; if not itcan be + viewed here: http://www.freertos.org/a00114.html and also obtained by + writing to Real Time Engineers Ltd., contact details for whom are available + on the FreeRTOS WEB site. + + 1 tab == 4 spaces! + + *************************************************************************** + * * + * Having a problem? Start by reading the FAQ "My application does * + * not run, what could be wrong?" * + * * + * http://www.FreeRTOS.org/FAQHelp.html * + * * + *************************************************************************** + + + http://www.FreeRTOS.org - Documentation, books, training, latest versions, + license and Real Time Engineers Ltd. contact details. + + http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, + including FreeRTOS+Trace - an indispensable productivity tool, and our new + fully thread aware and reentrant UDP/IP stack. + + http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High + Integrity Systems, who sell the code with commercial support, + indemnification and middleware, under the OpenRTOS brand. + + http://www.SafeRTOS.com - High Integrity Systems also provide a safety + engineered and independently SIL3 certified version for use in safety and + mission critical applications that require provable dependability. +*/ + +/* **************************************************************************** + * When configCREATE_LOW_POWER_DEMO is set to 1 in FreeRTOSConfig.h main() will + * call main_low_power(), which is defined in this file. main_low_power() + * demonstrates FreeRTOS tick suppression being used to allow the MCU to be + * placed into the Retention low power mode. When configCREATE_LOW_POWER_DEMO + * is set to 0 main will instead call main_full(), which is a more comprehensive + * RTOS demonstration. + * **************************************************************************** + * + * This application demonstrates the FreeRTOS tickless idle mode (tick + * suppression). See http://www.freertos.org/low-power-tickless-rtos.html + * The demo is configured to execute on the SAM4L-EK. + * + * Functionality: + * + * + Two tasks are created, an Rx task and a Tx task. + * + * + The Rx task blocks on a queue to wait for data, blipping an LED each time + * data is received (turning it on and then off again) before returning to + * block on the queue once more. + * + * + The Tx task repeatedly enters the Blocked state for 500ms. On exiting the + * blocked state the Tx task sends a value through the queue to the Rx task + * (causing the Rx task to exit the blocked state and blip the LED). + * + * Blocking for a finite period allows the kernel to stop the tick interrupt + * and place the SAM4L into Retention mode - the lowest power mode possible + * that allows the CPU registers and RAM to retain their state. + * + * Observed behaviour: + * + * For correct results the SAM4L-EK must be connected (and powered) using only + * the JTAG USB connector, but the debugger must not be connected (the + * application must be executed 'stand alone'). + * + * The MCU spends most of its time in the Retention low power state, during + * which times the current monitor (built onto the SAM4L-EK) will show a low + * current reading. + * + * Every 500ms the MCU will come out of the low power state to turn the LED on, + * then return to the low power state for 20ms before leaving the low power + * state again to turn the LED off. This will be observed as a fast blipping + * on the LED, and two very brief dots appearing on the current monitor graph + * (often observed as a single dot). + * + * The RTOS tick is suppressed while the MCU is in its low power state. + * + */ + +/* ASF includes. */ +#include + +/* Kernel includes. */ +#include "FreeRTOS.h" +#include "task.h" +#include "queue.h" + +/* Common demo includes. */ +#include "partest.h" + +/* Priorities at which the Rx and Tx tasks are created. */ +#define configQUEUE_RECEIVE_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) +#define configQUEUE_SEND_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 ) + +/* The number of items the queue can hold. This is 1 as the Rx task will +remove items as they are added so the Tx task should always find the queue +empty. */ +#define mainQUEUE_LENGTH ( 1 ) + +/* The LED used to indicate that a value has been received on the queue. */ +#define mainQUEUE_LED ( 0 ) + +/* The rate at which the Tx task sends to the queue. */ +#define mainTX_DELAY ( 500UL / portTICK_RATE_MS ) + +/* A block time of zero simply means "don't block". */ +#define mainDONT_BLOCK ( 0 ) + +/* The value that is sent from the Tx task to the Rx task on the queue. */ +#define mainQUEUED_VALUE ( 100UL ) + +/* The length of time the LED will remain on for. It is on just long enough +to be able to see with the human eye so as not to distort the power readings too +much. */ +#define mainLED_TOGGLE_DELAY ( 20 / portTICK_RATE_MS ) + +/*-----------------------------------------------------------*/ + +/* + * The Rx and Tx tasks as described at the top of this file. + */ +static void prvQueueReceiveTask( void *pvParameters ); +static void prvQueueSendTask( void *pvParameters ); + +/*-----------------------------------------------------------*/ + +/* The queue to pass data from the Tx task to the Rx task. */ +static xQueueHandle xQueue = NULL; + +/*-----------------------------------------------------------*/ + +void main_low_power( void ) +{ + /* Create the queue. */ + xQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( unsigned long ) ); + configASSERT( xQueue ); + + /* Start the two tasks as described at the top of this file. */ + xTaskCreate( prvQueueReceiveTask, ( const signed char * const ) "Rx", configMINIMAL_STACK_SIZE, NULL, configQUEUE_RECEIVE_TASK_PRIORITY, NULL ); + xTaskCreate( prvQueueSendTask, ( const signed char * const ) "TX", configMINIMAL_STACK_SIZE, NULL, configQUEUE_SEND_TASK_PRIORITY, NULL ); + + /* Start the scheduler running running. */ + vTaskStartScheduler(); + + /* If all is well the next line of code will not be reached as the + scheduler will be running. If the next line is reached then it is likely + there was insufficient FreeRTOS heap available for the idle task and/or + timer task to be created. See http://www.freertos.org/a00111.html. */ + for( ;; ); +} +/*-----------------------------------------------------------*/ + +static void prvQueueSendTask( void *pvParameters ) +{ +const unsigned long ulValueToSend = mainQUEUED_VALUE; + + /* Remove compiler warning about unused parameter. */ + ( void ) pvParameters; + + for( ;; ) + { + /* Place this task into the blocked state until it is time to run again. + The kernel will place the MCU into the Retention low power sleep state + when the idle task next runs. */ + vTaskDelay( mainTX_DELAY ); + + /* Send to the queue - causing the queue receive task to flash its LED. + It should not be necessary to block on the queue send because the Rx + task will already have removed the last queued item. */ + xQueueSend( xQueue, &ulValueToSend, mainDONT_BLOCK ); + } +} +/*-----------------------------------------------------------*/ + +static void prvQueueReceiveTask( void *pvParameters ) +{ +unsigned long ulReceivedValue; + + /* Remove compiler warning about unused parameter. */ + ( void ) pvParameters; + + for( ;; ) + { + /* Wait until something arrives in the queue. */ + xQueueReceive( xQueue, &ulReceivedValue, portMAX_DELAY ); + + /* To get here something must have arrived, but is it the expected + value? If it is, turn the LED on for a short while. */ + if( ulReceivedValue == mainQUEUED_VALUE ) + { + vParTestSetLED( mainQUEUE_LED, pdTRUE ); + vTaskDelay( mainLED_TOGGLE_DELAY ); + vParTestSetLED( mainQUEUE_LED, pdFALSE ); + } + } +} +/*-----------------------------------------------------------*/ + +void vPreSleepProcessing( unsigned long ulExpectedIdleTime ) +{ + /* Called by the kernel before it places the MCU into a sleep mode because + configPRE_SLEEP_PROCESSING() is #defined to vPreSleepProcessing(). + + NOTE: Additional actions can be taken here to get the power consumption + even lower. For example, peripherals can be turned off here, and then back + on again in the post sleep processing function. For maximum power saving + ensure all unused pins are in their lowest power state. */ + + /* Avoid compiler warnings about the unused parameter. */ + ( void ) ulExpectedIdleTime; +} +/*-----------------------------------------------------------*/ + +void vPostSleepProcessing( unsigned long ulExpectedIdleTime ) +{ + /* Called by the kernel when the MCU exits a sleep mode because + configPOST_SLEEP_PROCESSING is #defined to vPostSleepProcessing(). */ + + /* Avoid compiler warnings about the unused parameter. */ + ( void ) ulExpectedIdleTime; +} +/*-----------------------------------------------------------*/ + -- 2.39.5