]> kolegite.com Git - vmks.git/commitdiff
Added files for reverse-engineering workshop
authorvl_garistov <vl_garistov@gmail.com>
Thu, 6 May 2021 01:48:20 +0000 (04:48 +0300)
committervl_garistov <vl_garistov@gmail.com>
Thu, 6 May 2021 01:48:20 +0000 (04:48 +0300)
109 files changed:
Workshops/ghidra_demo_stm32f103/docs/ARMv7-M_ARM_Architecture.pdf [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/docs/Cortex_M3_Programming_manual.pdf [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/docs/Notes.txt [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/docs/STM32F103_Datasheet.pdf [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/docs/STM32F103_Datasheet_errata.pdf [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/docs/STM32F10xxx_Reference_manual.pdf [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/ghidra_demo.bin [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/ghidra_demo_patched.bin [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.gpr [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/idata/00/00000008.prp [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/idata/00/~00000008.db/db.2.gbf [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/idata/~index.bak [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/idata/~index.dat [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/idata/~journal.bak [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/project.prp [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/projectState [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/user/~index.dat [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/versioned/~index.bak [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/versioned/~index.dat [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/.cproject [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/.mxproject [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/.project [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/.settings/language.settings.xml [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Core/Inc/main.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Core/Inc/stm32_assert.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Core/Inc/stm32f1xx_it.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Core/Src/main.c [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Core/Src/stm32f1xx_it.c [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Core/Src/syscalls.c [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Core/Src/system_stm32f1xx.c [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/main.d [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/main.o [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/stm32f1xx_it.d [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/stm32f1xx_it.o [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/subdir.mk [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/syscalls.d [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/syscalls.o [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/system_stm32f1xx.d [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/system_stm32f1xx.o [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.d [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.d [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.d [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.o [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.d [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.o [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.d [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.d [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.d [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/subdir.mk [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/ghidra_demo.elf [new file with mode: 0755]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/ghidra_demo.hex [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/makefile [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/objects.list [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/objects.mk [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/output.map [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/sources.mk [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/startup/startup_stm32f103xb.o [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/startup/subdir.mk [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/cmsis_armcc.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/cmsis_armclang.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/cmsis_compiler.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/cmsis_gcc.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/cmsis_iccarm.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/cmsis_version.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_armv8mbl.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_armv8mml.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm0.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm0plus.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm1.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm23.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm3.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm33.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm4.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm7.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_sc000.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_sc300.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/mpu_armv7.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/mpu_armv8.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/tz_context.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_bus.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_cortex.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_dma.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_exti.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_gpio.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_pwr.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_rcc.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_system.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usart.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_utils.h [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.c [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.c [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.c [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.c [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.c [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.c [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.c [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/STM32F103C8Tx_FLASH.ld [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/ghidra_demo Run.cfg [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/ghidra_demo.ioc [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/ghidra_demo.xml [new file with mode: 0644]
Workshops/ghidra_demo_stm32f103/stm32f103_firmware/startup/startup_stm32f103xb.s [new file with mode: 0644]

diff --git a/Workshops/ghidra_demo_stm32f103/docs/ARMv7-M_ARM_Architecture.pdf b/Workshops/ghidra_demo_stm32f103/docs/ARMv7-M_ARM_Architecture.pdf
new file mode 100644 (file)
index 0000000..ae42636
Binary files /dev/null and b/Workshops/ghidra_demo_stm32f103/docs/ARMv7-M_ARM_Architecture.pdf differ
diff --git a/Workshops/ghidra_demo_stm32f103/docs/Cortex_M3_Programming_manual.pdf b/Workshops/ghidra_demo_stm32f103/docs/Cortex_M3_Programming_manual.pdf
new file mode 100644 (file)
index 0000000..659c9de
Binary files /dev/null and b/Workshops/ghidra_demo_stm32f103/docs/Cortex_M3_Programming_manual.pdf differ
diff --git a/Workshops/ghidra_demo_stm32f103/docs/Notes.txt b/Workshops/ghidra_demo_stm32f103/docs/Notes.txt
new file mode 100644 (file)
index 0000000..451ab04
--- /dev/null
@@ -0,0 +1,21 @@
+Ghidra - STM32F103 demonstration
+
+MCU: STM32F103C8T6
+USART1 pins: PA10 - RX, PA9 - TX
+USART1 parameters: 2400 baud, 8 data bits, 1 stop bit, even parity check
+Ghidra language: ARM Cortex 32-bit little endian
+Flash base address: 0x08000000
+Flash memory size: 64 KiB (0x10000)
+RAM base address: 0x20000000
+RAM size: 20 KiB (0x5000)
+Vector table size: 268 B (0x10C)
+EXTI2_IRQHandler pointer at: 0x08000060 (25-th entry in vector table)
+EXTI2_IRQHandler at: 0x080009f8
+Reset_handler pointer at: 0x08000004 (second entry in vector table)
+Reset_handler at: 0x0800132c
+Main at: 0x080006a8
+Main loop at: 0x080006d2
+Conditional branch instruction encoding:
+       BEQ - 0xD0XX
+       BNE - 0xD1XX
+       where XX is an 8-bit immediate offset relative to the program counter
diff --git a/Workshops/ghidra_demo_stm32f103/docs/STM32F103_Datasheet.pdf b/Workshops/ghidra_demo_stm32f103/docs/STM32F103_Datasheet.pdf
new file mode 100644 (file)
index 0000000..cbe5419
Binary files /dev/null and b/Workshops/ghidra_demo_stm32f103/docs/STM32F103_Datasheet.pdf differ
diff --git a/Workshops/ghidra_demo_stm32f103/docs/STM32F103_Datasheet_errata.pdf b/Workshops/ghidra_demo_stm32f103/docs/STM32F103_Datasheet_errata.pdf
new file mode 100644 (file)
index 0000000..8cde883
Binary files /dev/null and b/Workshops/ghidra_demo_stm32f103/docs/STM32F103_Datasheet_errata.pdf differ
diff --git a/Workshops/ghidra_demo_stm32f103/docs/STM32F10xxx_Reference_manual.pdf b/Workshops/ghidra_demo_stm32f103/docs/STM32F10xxx_Reference_manual.pdf
new file mode 100644 (file)
index 0000000..d1b38ad
Binary files /dev/null and b/Workshops/ghidra_demo_stm32f103/docs/STM32F10xxx_Reference_manual.pdf differ
diff --git a/Workshops/ghidra_demo_stm32f103/ghidra_demo.bin b/Workshops/ghidra_demo_stm32f103/ghidra_demo.bin
new file mode 100644 (file)
index 0000000..a1c0e74
Binary files /dev/null and b/Workshops/ghidra_demo_stm32f103/ghidra_demo.bin differ
diff --git a/Workshops/ghidra_demo_stm32f103/ghidra_demo_patched.bin b/Workshops/ghidra_demo_stm32f103/ghidra_demo_patched.bin
new file mode 100644 (file)
index 0000000..83ea804
Binary files /dev/null and b/Workshops/ghidra_demo_stm32f103/ghidra_demo_patched.bin differ
diff --git a/Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.gpr b/Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.gpr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/idata/00/00000008.prp b/Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/idata/00/00000008.prp
new file mode 100644 (file)
index 0000000..991b219
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<FILE_INFO>
+    <BASIC_INFO>
+        <STATE NAME="CONTENT_TYPE" TYPE="string" VALUE="Program" />
+        <STATE NAME="PARENT" TYPE="string" VALUE="/" />
+        <STATE NAME="FILE_ID" TYPE="string" VALUE="a152a29a833535037681810" />
+        <STATE NAME="FILE_TYPE" TYPE="int" VALUE="0" />
+        <STATE NAME="READ_ONLY" TYPE="boolean" VALUE="false" />
+        <STATE NAME="NAME" TYPE="string" VALUE="ghidra_demo.bin" />
+    </BASIC_INFO>
+</FILE_INFO>
diff --git a/Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/idata/00/~00000008.db/db.2.gbf b/Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/idata/00/~00000008.db/db.2.gbf
new file mode 100644 (file)
index 0000000..d411827
Binary files /dev/null and b/Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/idata/00/~00000008.db/db.2.gbf differ
diff --git a/Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/idata/~index.bak b/Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/idata/~index.bak
new file mode 100644 (file)
index 0000000..e284855
--- /dev/null
@@ -0,0 +1,4 @@
+VERSION=1
+/
+NEXT-ID:8
+MD5:d41d8cd98f00b204e9800998ecf8427e
diff --git a/Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/idata/~index.dat b/Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/idata/~index.dat
new file mode 100644 (file)
index 0000000..4157457
--- /dev/null
@@ -0,0 +1,5 @@
+VERSION=1
+/
+  00000008:ghidra_demo.bin:a152a29a833535037681810
+NEXT-ID:9
+MD5:d41d8cd98f00b204e9800998ecf8427e
diff --git a/Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/idata/~journal.bak b/Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/idata/~journal.bak
new file mode 100644 (file)
index 0000000..daced84
--- /dev/null
@@ -0,0 +1,2 @@
+IADD:00000008:/ghidra_demo.bin
+IDSET:/ghidra_demo.bin:a152a29a833535037681810
diff --git a/Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/project.prp b/Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/project.prp
new file mode 100644 (file)
index 0000000..2398110
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<FILE_INFO>
+    <BASIC_INFO>
+        <STATE NAME="OWNER" TYPE="string" VALUE="cartogan" />
+    </BASIC_INFO>
+</FILE_INFO>
diff --git a/Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/projectState b/Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/projectState
new file mode 100644 (file)
index 0000000..10dd62e
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<PROJECT>\r
+    <PROJECT_DATA_XML_NAME NAME="DISPLAY_DATA">\r
+        <SAVE_STATE>\r
+            <ARRAY NAME="EXPANDED_PATHS" TYPE="string">\r
+                <A VALUE="stm32_ghidra_demo:" />\r
+            </ARRAY>\r
+            <STATE NAME="SHOW_TABLE" TYPE="boolean" VALUE="false" />\r
+        </SAVE_STATE>\r
+    </PROJECT_DATA_XML_NAME>\r
+    <TOOL_MANAGER ACTIVE_WORKSPACE="Workspace">\r
+        <WORKSPACE NAME="Workspace" ACTIVE="true" />\r
+    </TOOL_MANAGER>\r
+</PROJECT>\r
+\r
diff --git a/Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/user/~index.dat b/Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/user/~index.dat
new file mode 100644 (file)
index 0000000..b1e697f
--- /dev/null
@@ -0,0 +1,4 @@
+VERSION=1
+/
+NEXT-ID:0
+MD5:d41d8cd98f00b204e9800998ecf8427e
diff --git a/Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/versioned/~index.bak b/Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/versioned/~index.bak
new file mode 100644 (file)
index 0000000..b1e697f
--- /dev/null
@@ -0,0 +1,4 @@
+VERSION=1
+/
+NEXT-ID:0
+MD5:d41d8cd98f00b204e9800998ecf8427e
diff --git a/Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/versioned/~index.dat b/Workshops/ghidra_demo_stm32f103/ghidra_project/stm32_ghidra_demo.rep/versioned/~index.dat
new file mode 100644 (file)
index 0000000..b1e697f
--- /dev/null
@@ -0,0 +1,4 @@
+VERSION=1
+/
+NEXT-ID:0
+MD5:d41d8cd98f00b204e9800998ecf8427e
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/.cproject b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/.cproject
new file mode 100644 (file)
index 0000000..3282322
--- /dev/null
@@ -0,0 +1,264 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
+<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">\r
+       <storageModule moduleId="org.eclipse.cdt.core.settings">\r
+               <cconfiguration id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.1710238831">\r
+                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.1710238831" moduleId="org.eclipse.cdt.core.settings" name="Debug">\r
+                               <externalSettings/>\r
+                               <extensions>\r
+                                       <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>\r
+                                       <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                               </extensions>\r
+                       </storageModule>\r
+                       <storageModule moduleId="cdtBuildSystem" version="4.0.0">\r
+                               <configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" errorParsers="org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GCCErrorParser" id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.1710238831" name="Debug" parent="fr.ac6.managedbuild.config.gnu.cross.exe.debug" postannouncebuildStep="Generating hex and Printing size information:" postbuildStep="arm-none-eabi-objcopy -O ihex &quot;${BuildArtifactFileBaseName}.elf&quot; &quot;${BuildArtifactFileBaseName}.hex&quot; &amp;&amp; arm-none-eabi-size &quot;${BuildArtifactFileName}&quot;" preannouncebuildStep="" prebuildStep="">\r
+                                       <folderInfo id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.1710238831." name="/" resourcePath="">\r
+                                               <toolChain errorParsers="" id="fr.ac6.managedbuild.toolchain.gnu.cross.exe.debug.1842067082" name="Ac6 STM32 MCU GCC" superClass="fr.ac6.managedbuild.toolchain.gnu.cross.exe.debug">\r
+                                                       <option id="fr.ac6.managedbuild.option.gnu.cross.prefix.1720952231" name="Prefix" superClass="fr.ac6.managedbuild.option.gnu.cross.prefix" useByScannerDiscovery="false" value="arm-none-eabi-" valueType="string"/>\r
+                                                       <option id="fr.ac6.managedbuild.option.gnu.cross.mcu.1686494869" name="Mcu" superClass="fr.ac6.managedbuild.option.gnu.cross.mcu" useByScannerDiscovery="false" value="STM32F103C8Tx" valueType="string"/>\r
+                                                       <option id="fr.ac6.managedbuild.option.gnu.cross.board.1322908050" name="Board" superClass="fr.ac6.managedbuild.option.gnu.cross.board" useByScannerDiscovery="false" value="ghidra_demo" valueType="string"/>\r
+                                                       <option id="fr.ac6.managedbuild.option.gnu.cross.core.1083960614" name="Core" superClass="fr.ac6.managedbuild.option.gnu.cross.core" useByScannerDiscovery="false" valueType="stringList">\r
+                                                               <listOptionValue builtIn="false" value="ARM Cortex-M3"/>\r
+                                                               <listOptionValue builtIn="false" value="CM3"/>\r
+                                                       </option>\r
+                                                       <option id="fr.ac6.managedbuild.option.gnu.cross.instructionSet.1123104237" name="Instruction Set" superClass="fr.ac6.managedbuild.option.gnu.cross.instructionSet" useByScannerDiscovery="false" value="fr.ac6.managedbuild.option.gnu.cross.instructionSet.thumbII" valueType="enumerated"/>\r
+                                                       <option id="fr.ac6.managedbuild.option.gnu.cross.fpu.570862278" name="Floating point hardware" superClass="fr.ac6.managedbuild.option.gnu.cross.fpu" useByScannerDiscovery="false" value="fr.ac6.managedbuild.option.gnu.cross.fpu.no" valueType="enumerated"/>\r
+                                                       <option id="fr.ac6.managedbuild.option.gnu.cross.floatabi.742337589" name="Floating-point ABI" superClass="fr.ac6.managedbuild.option.gnu.cross.floatabi" useByScannerDiscovery="false" value="fr.ac6.managedbuild.option.gnu.cross.floatabi.soft" valueType="enumerated"/>\r
+                                                       <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="fr.ac6.managedbuild.targetPlatform.gnu.cross.1278370293" isAbstract="false" osList="all" superClass="fr.ac6.managedbuild.targetPlatform.gnu.cross"/>\r
+                                                       <builder buildPath="${workspace_loc:/ghidra_demo}/Debug" errorParsers="org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.CWDLocator" id="fr.ac6.managedbuild.builder.gnu.cross.1472933406" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="fr.ac6.managedbuild.builder.gnu.cross">\r
+                                                               <outputEntries>\r
+                                                                       <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Debug"/>\r
+                                                               </outputEntries>\r
+                                                       </builder>\r
+                                                       <tool command="gcc" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GCCErrorParser" id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.182165752" name="MCU GCC Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler">\r
+                                                               <option defaultValue="gnu.c.optimization.level.none" id="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level.1003117901" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.c.optimization.level.none" valueType="enumerated"/>\r
+                                                               <option id="gnu.c.compiler.option.debugging.level.1112528529" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.none" valueType="enumerated"/>\r
+                                                               <option id="gnu.c.compiler.option.include.paths.1134333281" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">\r
+                                                                       <listOptionValue builtIn="false" value="../Core/Inc"/>\r
+                                                                       <listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc"/>\r
+                                                                       <listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F1xx/Include"/>\r
+                                                                       <listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>\r
+                                                               </option>\r
+                                                               <option id="gnu.c.compiler.option.preprocessor.def.symbols.1155647327" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">\r
+                                                                       <listOptionValue builtIn="false" value="USE_FULL_LL_DRIVER"/>\r
+                                                                       <listOptionValue builtIn="false" value="STM32F103xB"/>\r
+                                                                       <listOptionValue builtIn="false" value="HSE_VALUE=8000000"/>\r
+                                                                       <listOptionValue builtIn="false" value="HSE_STARTUP_TIMEOUT=100"/>\r
+                                                                       <listOptionValue builtIn="false" value="LSE_STARTUP_TIMEOUT=5000"/>\r
+                                                                       <listOptionValue builtIn="false" value="LSE_VALUE=32768"/>\r
+                                                                       <listOptionValue builtIn="false" value="HSI_VALUE=8000000"/>\r
+                                                                       <listOptionValue builtIn="false" value="LSI_VALUE=40000"/>\r
+                                                                       <listOptionValue builtIn="false" value="VDD_VALUE=3300"/>\r
+                                                                       <listOptionValue builtIn="false" value="PREFETCH_ENABLE=1"/>\r
+                                                               </option>\r
+                                                               <option id="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other.745531341" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-fmessage-length=0" valueType="string"/>\r
+                                                               <option id="gnu.c.compiler.option.dialect.std.1708208057" name="Language standard" superClass="gnu.c.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.c.compiler.dialect.default" valueType="enumerated"/>\r
+                                                               <inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c.1142928612" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c"/>\r
+                                                               <inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s.1520897009" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s"/>\r
+                                                       </tool>\r
+                                                       <tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.1198717456" name="MCU G++ Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler">\r
+                                                               <option defaultValue="gnu.cpp.optimization.level.none" id="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level.1853385162" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.cpp.optimization.level.debug" valueType="enumerated"/>\r
+                                                               <option id="gnu.cpp.compiler.option.debugging.level.171178287" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>\r
+                                                               <option id="gnu.cpp.compiler.option.include.paths.1918453833" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">\r
+                                                                       <listOptionValue builtIn="false" value="../Core/Inc"/>\r
+                                                                       <listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc"/>\r
+                                                                       <listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F1xx/Include"/>\r
+                                                                       <listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>\r
+                                                               </option>\r
+                                                               <option id="gnu.cpp.compiler.option.preprocessor.def.983392019" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">\r
+                                                                       <listOptionValue builtIn="false" value="USE_FULL_LL_DRIVER"/>\r
+                                                                       <listOptionValue builtIn="false" value="STM32F103xB"/>\r
+                                                                       <listOptionValue builtIn="false" value="HSE_VALUE=8000000"/>\r
+                                                                       <listOptionValue builtIn="false" value="HSE_STARTUP_TIMEOUT=100"/>\r
+                                                                       <listOptionValue builtIn="false" value="LSE_STARTUP_TIMEOUT=5000"/>\r
+                                                                       <listOptionValue builtIn="false" value="LSE_VALUE=32768"/>\r
+                                                                       <listOptionValue builtIn="false" value="HSI_VALUE=8000000"/>\r
+                                                                       <listOptionValue builtIn="false" value="LSI_VALUE=40000"/>\r
+                                                                       <listOptionValue builtIn="false" value="VDD_VALUE=3300"/>\r
+                                                                       <listOptionValue builtIn="false" value="PREFETCH_ENABLE=1"/>\r
+                                                               </option>\r
+                                                               <option id="fr.ac6.managedbuild.gnu.cpp.compiler.option.misc.other.268938090" name="Other flags" superClass="fr.ac6.managedbuild.gnu.cpp.compiler.option.misc.other" useByScannerDiscovery="false" value="-fmessage-length=0" valueType="string"/>\r
+                                                               <inputType id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.cpp.374023309" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.cpp"/>\r
+                                                               <inputType id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s.1363025639" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s"/>\r
+                                                       </tool>\r
+                                                       <tool command="gcc" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GLDErrorParser" id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.1235068361" name="MCU GCC Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker">\r
+                                                               <option id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script.1714183056" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script" useByScannerDiscovery="false" value="../STM32F103C8Tx_FLASH.ld" valueType="string"/>\r
+                                                               <option id="gnu.c.link.option.libs.552882225" name="Libraries (-l)" superClass="gnu.c.link.option.libs" useByScannerDiscovery="false"/>\r
+                                                               <option id="gnu.c.link.option.paths.1695282220" name="Library search path (-L)" superClass="gnu.c.link.option.paths" useByScannerDiscovery="false"/>\r
+                                                               <option id="gnu.c.link.option.ldflags.982852157" name="Linker flags" superClass="gnu.c.link.option.ldflags" useByScannerDiscovery="false" value="-specs=nosys.specs -specs=nano.specs" valueType="string"/>\r
+                                                               <option id="gnu.c.link.option.other.1662888634" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other" useByScannerDiscovery="false"/>\r
+                                                               <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1344957052" superClass="cdt.managedbuild.tool.gnu.c.linker.input">\r
+                                                                       <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>\r
+                                                                       <additionalInput kind="additionalinput" paths="$(LIBS)"/>\r
+                                                               </inputType>\r
+                                                       </tool>\r
+                                                       <tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.262375416" name="MCU G++ Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker">\r
+                                                               <option id="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.script.2051778070" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.script" value="../STM32F103C8Tx_FLASH.ld" valueType="string"/>\r
+                                                               <option id="gnu.cpp.link.option.libs.1205169584" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs"/>\r
+                                                               <option id="gnu.cpp.link.option.paths.1159117288" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths"/>\r
+                                                               <option id="gnu.cpp.link.option.flags.2015823076" name="Linker flags" superClass="gnu.cpp.link.option.flags" value="-specs=nosys.specs -specs=nano.specs" valueType="string"/>\r
+                                                               <option id="gnu.cpp.link.option.other.1852481450" name="Other options (-Xlinker [option])" superClass="gnu.cpp.link.option.other" useByScannerDiscovery="false"/>\r
+                                                               <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1377657884" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">\r
+                                                                       <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>\r
+                                                                       <additionalInput kind="additionalinput" paths="$(LIBS)"/>\r
+                                                               </inputType>\r
+                                                       </tool>\r
+                                                       <tool id="fr.ac6.managedbuild.tool.gnu.archiver.1738609065" name="MCU GCC Archiver" superClass="fr.ac6.managedbuild.tool.gnu.archiver"/>\r
+                                                       <tool command="as" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GASErrorParser" id="fr.ac6.managedbuild.tool.gnu.cross.assembler.354714043" name="MCU GCC Assembler" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler">\r
+                                                               <option id="gnu.both.asm.option.include.paths.1980324613" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" useByScannerDiscovery="false"/>\r
+                                                               <inputType id="cdt.managedbuild.tool.gnu.assembler.input.2043662183" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>\r
+                                                               <inputType id="fr.ac6.managedbuild.tool.gnu.cross.assembler.input.215160458" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler.input"/>\r
+                                                       </tool>\r
+                                               </toolChain>\r
+                                       </folderInfo>\r
+                                       <sourceEntries>\r
+                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="startup"/>\r
+                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>\r
+                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/>\r
+                                       </sourceEntries>\r
+                               </configuration>\r
+                       </storageModule>\r
+                       <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>\r
+               </cconfiguration>\r
+               <cconfiguration id="fr.ac6.managedbuild.config.gnu.cross.exe.release.298123458">\r
+                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="fr.ac6.managedbuild.config.gnu.cross.exe.release.298123458" moduleId="org.eclipse.cdt.core.settings" name="Release">\r
+                               <externalSettings/>\r
+                               <extensions>\r
+                                       <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>\r
+                                       <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                               </extensions>\r
+                       </storageModule>\r
+                       <storageModule moduleId="cdtBuildSystem" version="4.0.0">\r
+                               <configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" id="fr.ac6.managedbuild.config.gnu.cross.exe.release.298123458" name="Release" parent="fr.ac6.managedbuild.config.gnu.cross.exe.release" postannouncebuildStep="Generating hex and Printing size information:" postbuildStep="arm-none-eabi-objcopy -O ihex &quot;${BuildArtifactFileBaseName}.elf&quot; &quot;${BuildArtifactFileBaseName}.hex&quot; &amp;&amp; arm-none-eabi-size &quot;${BuildArtifactFileName}&quot;">\r
+                                       <folderInfo id="fr.ac6.managedbuild.config.gnu.cross.exe.release.298123458." name="/" resourcePath="">\r
+                                               <toolChain id="fr.ac6.managedbuild.toolchain.gnu.cross.exe.release.150820982" name="Ac6 STM32 MCU GCC" superClass="fr.ac6.managedbuild.toolchain.gnu.cross.exe.release">\r
+                                                       <option id="fr.ac6.managedbuild.option.gnu.cross.prefix.1720952231" name="Prefix" superClass="fr.ac6.managedbuild.option.gnu.cross.prefix" value="arm-none-eabi-" valueType="string"/>\r
+                                                       <option id="fr.ac6.managedbuild.option.gnu.cross.mcu.1686494869" name="Mcu" superClass="fr.ac6.managedbuild.option.gnu.cross.mcu" value="STM32F103C8Tx" valueType="string"/>\r
+                                                       <option id="fr.ac6.managedbuild.option.gnu.cross.board.1322908050" name="Board" superClass="fr.ac6.managedbuild.option.gnu.cross.board" value="ghidra_demo" valueType="string"/>\r
+                                                       <option id="fr.ac6.managedbuild.option.gnu.cross.core.1083960614" name="Core" superClass="fr.ac6.managedbuild.option.gnu.cross.core" valueType="stringList">\r
+                                                               <listOptionValue builtIn="false" value="ARM Cortex-M3"/>\r
+                                                               <listOptionValue builtIn="false" value="CM3"/>\r
+                                                       </option>\r
+                                                       <option id="fr.ac6.managedbuild.option.gnu.cross.instructionSet.1123104237" name="Instruction Set" superClass="fr.ac6.managedbuild.option.gnu.cross.instructionSet" value="fr.ac6.managedbuild.option.gnu.cross.instructionSet.thumbII" valueType="enumerated"/>\r
+                                                       <option id="fr.ac6.managedbuild.option.gnu.cross.fpu.570862278" name="Floating point hardware" superClass="fr.ac6.managedbuild.option.gnu.cross.fpu" value="fr.ac6.managedbuild.option.gnu.cross.fpu.no" valueType="enumerated"/>\r
+                                                       <option id="fr.ac6.managedbuild.option.gnu.cross.floatabi.742337589" name="Floating-point ABI" superClass="fr.ac6.managedbuild.option.gnu.cross.floatabi" value="fr.ac6.managedbuild.option.gnu.cross.floatabi.soft" valueType="enumerated"/>\r
+                                                       <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="fr.ac6.managedbuild.targetPlatform.gnu.cross.1278370293" isAbstract="false" osList="all" superClass="fr.ac6.managedbuild.targetPlatform.gnu.cross"/>\r
+                                                       <builder buildPath="${workspace_loc:/ghidra_demo}/Release" id="fr.ac6.managedbuild.builder.gnu.cross.1472933406" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="fr.ac6.managedbuild.builder.gnu.cross">\r
+                                                               <outputEntries>\r
+                                                                       <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Release"/>\r
+                                                               </outputEntries>\r
+                                                       </builder>\r
+                                                       <tool id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.182165752" name="MCU GCC Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler">\r
+                                                               <option defaultValue="gnu.c.optimization.level.none" id="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level.1003117901" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.c.optimization.level.debug" valueType="enumerated"/>\r
+                                                               <option id="gnu.c.compiler.option.debugging.level.1112528529" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>\r
+                                                               <option id="gnu.c.compiler.option.include.paths.1134333281" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">\r
+                                                                       <listOptionValue builtIn="false" value="../Core/Inc"/>\r
+                                                                       <listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc"/>\r
+                                                                       <listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F1xx/Include"/>\r
+                                                                       <listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>\r
+                                                               </option>\r
+                                                               <option id="gnu.c.compiler.option.preprocessor.def.symbols.1155647327" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">\r
+                                                                       <listOptionValue builtIn="false" value="USE_FULL_LL_DRIVER"/>\r
+                                                                       <listOptionValue builtIn="false" value="STM32F103xB"/>\r
+                                                                       <listOptionValue builtIn="false" value="HSE_VALUE=8000000"/>\r
+                                                                       <listOptionValue builtIn="false" value="HSE_STARTUP_TIMEOUT=100"/>\r
+                                                                       <listOptionValue builtIn="false" value="LSE_STARTUP_TIMEOUT=5000"/>\r
+                                                                       <listOptionValue builtIn="false" value="LSE_VALUE=32768"/>\r
+                                                                       <listOptionValue builtIn="false" value="HSI_VALUE=8000000"/>\r
+                                                                       <listOptionValue builtIn="false" value="LSI_VALUE=40000"/>\r
+                                                                       <listOptionValue builtIn="false" value="VDD_VALUE=3300"/>\r
+                                                                       <listOptionValue builtIn="false" value="PREFETCH_ENABLE=1"/>\r
+                                                               </option>\r
+                                                               <option id="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other.745531341" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-fmessage-length=0" valueType="string"/>\r
+                                                               <inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c.1142928612" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c"/>\r
+                                                               <inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s.1520897009" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s"/>\r
+                                                       </tool>\r
+                                                       <tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.1198717456" name="MCU G++ Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler">\r
+                                                               <option defaultValue="gnu.cpp.optimization.level.none" id="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level.1853385162" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.cpp.optimization.level.debug" valueType="enumerated"/>\r
+                                                               <option id="gnu.cpp.compiler.option.debugging.level.171178287" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.debugging.level.max" valueType="enumerated"/>\r
+                                                               <option id="gnu.cpp.compiler.option.include.paths.1918453833" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">\r
+                                                                       <listOptionValue builtIn="false" value="../Core/Inc"/>\r
+                                                                       <listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc"/>\r
+                                                                       <listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F1xx/Include"/>\r
+                                                                       <listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>\r
+                                                               </option>\r
+                                                               <option id="gnu.cpp.compiler.option.preprocessor.def.symbols.1394833070" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">\r
+                                                                       <listOptionValue builtIn="false" value="USE_FULL_LL_DRIVER"/>\r
+                                                                       <listOptionValue builtIn="false" value="STM32F103xB"/>\r
+                                                                       <listOptionValue builtIn="false" value="HSE_VALUE=8000000"/>\r
+                                                                       <listOptionValue builtIn="false" value="HSE_STARTUP_TIMEOUT=100"/>\r
+                                                                       <listOptionValue builtIn="false" value="LSE_STARTUP_TIMEOUT=5000"/>\r
+                                                                       <listOptionValue builtIn="false" value="LSE_VALUE=32768"/>\r
+                                                                       <listOptionValue builtIn="false" value="HSI_VALUE=8000000"/>\r
+                                                                       <listOptionValue builtIn="false" value="LSI_VALUE=40000"/>\r
+                                                                       <listOptionValue builtIn="false" value="VDD_VALUE=3300"/>\r
+                                                                       <listOptionValue builtIn="false" value="PREFETCH_ENABLE=1"/>\r
+                                                               </option>\r
+                                                               <option id="fr.ac6.managedbuild.gnu.cpp.compiler.option.misc.other.268938090" name="Other flags" superClass="fr.ac6.managedbuild.gnu.cpp.compiler.option.misc.other" useByScannerDiscovery="false" value="-fmessage-length=0" valueType="string"/>\r
+                                                               <inputType id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.cpp.374023309" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.cpp"/>\r
+                                                               <inputType id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s.1363025639" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s"/>\r
+                                                       </tool>\r
+                                                       <tool id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.1235068361" name="MCU GCC Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker">\r
+                                                               <option id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script.1714183056" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script" value="../STM32F103C8Tx_FLASH.ld" valueType="string"/>\r
+                                                               <option id="gnu.c.link.option.libs.552882225" name="Libraries (-l)" superClass="gnu.c.link.option.libs"/>\r
+                                                               <option id="gnu.c.link.option.paths.1695282220" name="Library search path (-L)" superClass="gnu.c.link.option.paths"/>\r
+                                                               <option id="gnu.c.link.option.ldflags.982852157" name="Linker flags" superClass="gnu.c.link.option.ldflags" value="-specs=nosys.specs -specs=nano.specs" valueType="string"/>\r
+                                                               <option id="gnu.c.link.option.other.1662888634" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other" useByScannerDiscovery="false"/>\r
+                                                               <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1344957052" superClass="cdt.managedbuild.tool.gnu.c.linker.input">\r
+                                                                       <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>\r
+                                                                       <additionalInput kind="additionalinput" paths="$(LIBS)"/>\r
+                                                               </inputType>\r
+                                                       </tool>\r
+                                                       <tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.262375416" name="MCU G++ Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker">\r
+                                                               <option id="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.script.2051778070" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.script" value="../STM32F103C8Tx_FLASH.ld" valueType="string"/>\r
+                                                               <option id="gnu.cpp.link.option.libs.1205169584" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs"/>\r
+                                                               <option id="gnu.cpp.link.option.paths.1159117288" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths"/>\r
+                                                               <option id="gnu.cpp.link.option.ldflags.1288282351" superClass="gnu.cpp.link.option.ldflags" value="-specs=nosys.specs -specs=nano.specs" valueType="string"/>\r
+                                                               <option id="gnu.cpp.link.option.other.1852481450" name="Other options (-Xlinker [option])" superClass="gnu.cpp.link.option.other" useByScannerDiscovery="false"/>\r
+                                                               <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1377657884" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">\r
+                                                                       <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>\r
+                                                                       <additionalInput kind="additionalinput" paths="$(LIBS)"/>\r
+                                                               </inputType>\r
+                                                       </tool>\r
+                                                       <tool id="fr.ac6.managedbuild.tool.gnu.archiver.1738609065" name="MCU GCC Archiver" superClass="fr.ac6.managedbuild.tool.gnu.archiver"/>\r
+                                                       <tool id="fr.ac6.managedbuild.tool.gnu.cross.assembler.exe.release.1533574181" name="MCU GCC Assembler" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler.exe.release">\r
+                                                               <option id="gnu.both.asm.option.include.paths.1980324613" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths"/>\r
+                                                               <inputType id="cdt.managedbuild.tool.gnu.assembler.input.2043662183" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>\r
+                                                               <inputType id="fr.ac6.managedbuild.tool.gnu.cross.assembler.input.215160458" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler.input"/>\r
+                                                       </tool>\r
+                                               </toolChain>\r
+                                       </folderInfo>\r
+                                       <sourceEntries>\r
+                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="startup"/>\r
+                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>\r
+                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/>\r
+                                       </sourceEntries>\r
+                               </configuration>\r
+                       </storageModule>\r
+                       <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>\r
+               </cconfiguration>\r
+       </storageModule>\r
+       <storageModule moduleId="cdtBuildSystem" version="4.0.0">\r
+               <project id="ghidra_demo.fr.ac6.managedbuild.target.gnu.cross.exe.2063825415" name="Executable" projectType="fr.ac6.managedbuild.target.gnu.cross.exe"/>\r
+       </storageModule>\r
+       <storageModule moduleId="scannerConfiguration">\r
+               <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>\r
+               <scannerConfigBuildInfo instanceId="fr.ac6.managedbuild.config.gnu.cross.exe.debug.1710238831;fr.ac6.managedbuild.config.gnu.cross.exe.debug.1710238831.;fr.ac6.managedbuild.tool.gnu.cross.c.compiler.182165752;fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c.1142928612">\r
+                       <autodiscovery enabled="false" problemReportingEnabled="true" selectedProfileId=""/>\r
+               </scannerConfigBuildInfo>\r
+       </storageModule>\r
+       <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>\r
+       <storageModule moduleId="refreshScope" versionNumber="2">\r
+               <configuration configurationName="Debug">\r
+                       <resource resourceType="PROJECT" workspacePath="/ghidra_demo"/>\r
+               </configuration>\r
+               <configuration configurationName="Release"/>\r
+       </storageModule>\r
+</cproject>\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/.mxproject b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/.mxproject
new file mode 100644 (file)
index 0000000..48ab9b9
--- /dev/null
@@ -0,0 +1,24 @@
+[PreviousLibFiles]\r
+LibFiles=Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_gpio.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_pwr.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_system.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_exti.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usart.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_bus.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_cortex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_utils.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_dma.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_rcc.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_gpio.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_pwr.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_system.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_exti.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usart.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_bus.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_cortex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_utils.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_dma.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_rcc.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h;Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/mpu_armv8.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/core_armv8mml.h;Drivers/CMSIS/Include/core_cm23.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/cmsis_iccarm.h;Drivers/CMSIS/Include/mpu_armv7.h;Drivers/CMSIS/Include/tz_context.h;Drivers/CMSIS/Include/core_cm33.h;Drivers/CMSIS/Include/cmsis_version.h;Drivers/CMSIS/Include/cmsis_armclang.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/core_cm1.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/cmsis_compiler.h;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/core_armv8mbl.h;\r
+\r
+[PreviousUsedSW4STM32Files]\r
+SourceFiles=../Core/Src/main.c;../Core/Src/stm32f1xx_it.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.c;../Core/Src/system_stm32f1xx.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.c;../Core/Src/system_stm32f1xx.c;../Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;;\r
+HeaderPath=../Drivers/STM32F1xx_HAL_Driver/Inc;../Drivers/CMSIS/Device/ST/STM32F1xx/Include;../Drivers/CMSIS/Include;../Core/Inc;\r
+CDefines=USE_FULL_LL_DRIVER;HSE_VALUE:8000000;HSE_STARTUP_TIMEOUT:100;LSE_STARTUP_TIMEOUT:5000;LSE_VALUE:32768;HSI_VALUE:8000000;LSI_VALUE:40000;VDD_VALUE:3300;PREFETCH_ENABLE:1;STM32F103xB;USE_FULL_LL_DRIVER;HSE_VALUE:8000000;HSE_STARTUP_TIMEOUT:100;LSE_STARTUP_TIMEOUT:5000;LSE_VALUE:32768;HSI_VALUE:8000000;LSI_VALUE:40000;VDD_VALUE:3300;PREFETCH_ENABLE:1;\r
+\r
+[PreviousGenFiles]\r
+AdvancedFolderStructure=true\r
+HeaderFileListSize=3\r
+HeaderFiles#0=/home/cartogan/Ac6/workspace/ghidra_demo/Core/Inc/stm32f1xx_it.h\r
+HeaderFiles#1=/home/cartogan/Ac6/workspace/ghidra_demo/Core/Inc/stm32_assert.h\r
+HeaderFiles#2=/home/cartogan/Ac6/workspace/ghidra_demo/Core/Inc/main.h\r
+HeaderFolderListSize=1\r
+HeaderPath#0=/home/cartogan/Ac6/workspace/ghidra_demo/Core/Inc\r
+HeaderFiles=;\r
+SourceFileListSize=2\r
+SourceFiles#0=/home/cartogan/Ac6/workspace/ghidra_demo/Core/Src/stm32f1xx_it.c\r
+SourceFiles#1=/home/cartogan/Ac6/workspace/ghidra_demo/Core/Src/main.c\r
+SourceFolderListSize=1\r
+SourcePath#0=/home/cartogan/Ac6/workspace/ghidra_demo/Core/Src\r
+SourceFiles=;\r
+\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/.project b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/.project
new file mode 100644 (file)
index 0000000..8f72d24
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>ghidra_demo</name>
+       <comment />
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+                       <triggers>clean,full,incremental,</triggers>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+                       <triggers>full,incremental,</triggers>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.cdt.core.cnature</nature>
+               <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+               <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+               <nature>fr.ac6.mcu.ide.core.MCUProjectNature</nature>
+       </natures>
+       <linkedResources>
+               
+       </linkedResources>
+</projectDescription>
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/.settings/language.settings.xml b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/.settings/language.settings.xml
new file mode 100644 (file)
index 0000000..0beb109
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<project>
+       <configuration id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.1710238831" name="Debug">
+               <extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+                       <provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
+                       <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+                       <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+                       <provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-1808984782890400805" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
+                               <language-scope id="org.eclipse.cdt.core.gcc"/>
+                               <language-scope id="org.eclipse.cdt.core.g++"/>
+                       </provider>
+               </extension>
+       </configuration>
+       <configuration id="fr.ac6.managedbuild.config.gnu.cross.exe.release.298123458" name="Release">
+               <extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+                       <provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
+                       <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+                       <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+                       <provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-1808984782890400805" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
+                               <language-scope id="org.eclipse.cdt.core.gcc"/>
+                               <language-scope id="org.eclipse.cdt.core.g++"/>
+                       </provider>
+               </extension>
+       </configuration>
+</project>
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Core/Inc/main.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Core/Inc/main.h
new file mode 100644 (file)
index 0000000..3667cf0
--- /dev/null
@@ -0,0 +1,101 @@
+/* USER CODE BEGIN Header */\r
+/**\r
+  ******************************************************************************\r
+  * @file           : main.h\r
+  * @brief          : Header for main.c file.\r
+  *                   This file contains the common defines of the application.\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+/* USER CODE END Header */\r
+\r
+/* Define to prevent recursive inclusion -------------------------------------*/\r
+#ifndef __MAIN_H\r
+#define __MAIN_H\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/* Includes ------------------------------------------------------------------*/\r
+#include "stm32f1xx_ll_rcc.h"\r
+#include "stm32f1xx_ll_bus.h"\r
+#include "stm32f1xx_ll_system.h"\r
+#include "stm32f1xx_ll_exti.h"\r
+#include "stm32f1xx_ll_cortex.h"\r
+#include "stm32f1xx_ll_utils.h"\r
+#include "stm32f1xx_ll_pwr.h"\r
+#include "stm32f1xx_ll_dma.h"\r
+#include "stm32f1xx_ll_usart.h"\r
+#include "stm32f1xx_ll_gpio.h"\r
+\r
+#if defined(USE_FULL_ASSERT)\r
+#include "stm32_assert.h"\r
+#endif /* USE_FULL_ASSERT */\r
+\r
+/* Private includes ----------------------------------------------------------*/\r
+/* USER CODE BEGIN Includes */\r
+\r
+/* USER CODE END Includes */\r
+\r
+/* Exported types ------------------------------------------------------------*/\r
+/* USER CODE BEGIN ET */\r
+\r
+/* USER CODE END ET */\r
+\r
+/* Exported constants --------------------------------------------------------*/\r
+/* USER CODE BEGIN EC */\r
+\r
+/* USER CODE END EC */\r
+\r
+/* Exported macro ------------------------------------------------------------*/\r
+/* USER CODE BEGIN EM */\r
+\r
+/* USER CODE END EM */\r
+\r
+/* Exported functions prototypes ---------------------------------------------*/\r
+void Error_Handler(void);\r
+\r
+/* USER CODE BEGIN EFP */\r
+\r
+/* USER CODE END EFP */\r
+\r
+/* Private defines -----------------------------------------------------------*/\r
+#define LED_Pin LL_GPIO_PIN_13\r
+#define LED_GPIO_Port GPIOC\r
+#define BUT_Pin LL_GPIO_PIN_2\r
+#define BUT_GPIO_Port GPIOB\r
+#define BUT_EXTI_IRQn EXTI2_IRQn\r
+#ifndef NVIC_PRIORITYGROUP_0\r
+#define NVIC_PRIORITYGROUP_0         ((uint32_t)0x00000007) /*!< 0 bit  for pre-emption priority,\r
+                                                                 4 bits for subpriority */\r
+#define NVIC_PRIORITYGROUP_1         ((uint32_t)0x00000006) /*!< 1 bit  for pre-emption priority,\r
+                                                                 3 bits for subpriority */\r
+#define NVIC_PRIORITYGROUP_2         ((uint32_t)0x00000005) /*!< 2 bits for pre-emption priority,\r
+                                                                 2 bits for subpriority */\r
+#define NVIC_PRIORITYGROUP_3         ((uint32_t)0x00000004) /*!< 3 bits for pre-emption priority,\r
+                                                                 1 bit  for subpriority */\r
+#define NVIC_PRIORITYGROUP_4         ((uint32_t)0x00000003) /*!< 4 bits for pre-emption priority,\r
+                                                                 0 bit  for subpriority */\r
+#endif\r
+/* USER CODE BEGIN Private defines */\r
+\r
+/* USER CODE END Private defines */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __MAIN_H */\r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Core/Inc/stm32_assert.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Core/Inc/stm32_assert.h
new file mode 100644 (file)
index 0000000..ca09699
--- /dev/null
@@ -0,0 +1,53 @@
+/**\r
+  ******************************************************************************\r
+  * @file    stm32_assert.h\r
+  * @brief   STM32 assert file.\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+\r
+/* Define to prevent recursive inclusion -------------------------------------*/\r
+#ifndef __STM32_ASSERT_H\r
+#define __STM32_ASSERT_H\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/* Exported types ------------------------------------------------------------*/\r
+/* Exported constants --------------------------------------------------------*/\r
+/* Includes ------------------------------------------------------------------*/\r
+/* Exported macro ------------------------------------------------------------*/\r
+#ifdef  USE_FULL_ASSERT\r
+/**\r
+  * @brief  The assert_param macro is used for function's parameters check.\r
+  * @param  expr: If expr is false, it calls assert_failed function\r
+  *         which reports the name of the source file and the source\r
+  *         line number of the call that failed.\r
+  *         If expr is true, it returns no value.\r
+  * @retval None\r
+  */\r
+ #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))\r
+/* Exported functions ------------------------------------------------------- */\r
+  void assert_failed(uint8_t* file, uint32_t line);\r
+#else\r
+  #define assert_param(expr) ((void)0U)\r
+#endif /* USE_FULL_ASSERT */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __STM32_ASSERT_H */\r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Core/Inc/stm32f1xx_it.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Core/Inc/stm32f1xx_it.h
new file mode 100644 (file)
index 0000000..0bdd6c1
--- /dev/null
@@ -0,0 +1,70 @@
+/* USER CODE BEGIN Header */\r
+/**\r
+  ******************************************************************************\r
+  * @file    stm32f1xx_it.h\r
+  * @brief   This file contains the headers of the interrupt handlers.\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+ ******************************************************************************\r
+  */\r
+/* USER CODE END Header */\r
+\r
+/* Define to prevent recursive inclusion -------------------------------------*/\r
+#ifndef __STM32F1xx_IT_H\r
+#define __STM32F1xx_IT_H\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/* Private includes ----------------------------------------------------------*/\r
+/* USER CODE BEGIN Includes */\r
+\r
+/* USER CODE END Includes */\r
+\r
+/* Exported types ------------------------------------------------------------*/\r
+/* USER CODE BEGIN ET */\r
+\r
+/* USER CODE END ET */\r
+\r
+/* Exported constants --------------------------------------------------------*/\r
+/* USER CODE BEGIN EC */\r
+\r
+/* USER CODE END EC */\r
+\r
+/* Exported macro ------------------------------------------------------------*/\r
+/* USER CODE BEGIN EM */\r
+\r
+/* USER CODE END EM */\r
+\r
+/* Exported functions prototypes ---------------------------------------------*/\r
+void NMI_Handler(void);\r
+void HardFault_Handler(void);\r
+void MemManage_Handler(void);\r
+void BusFault_Handler(void);\r
+void UsageFault_Handler(void);\r
+void SVC_Handler(void);\r
+void DebugMon_Handler(void);\r
+void PendSV_Handler(void);\r
+void SysTick_Handler(void);\r
+void EXTI2_IRQHandler(void);\r
+/* USER CODE BEGIN EFP */\r
+\r
+/* USER CODE END EFP */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __STM32F1xx_IT_H */\r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Core/Src/main.c b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Core/Src/main.c
new file mode 100644 (file)
index 0000000..43a1688
--- /dev/null
@@ -0,0 +1,312 @@
+/* USER CODE BEGIN Header */\r
+/**\r
+  ******************************************************************************\r
+  * @file           : main.c\r
+  * @brief          : Main program body\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+/* USER CODE END Header */\r
+/* Includes ------------------------------------------------------------------*/\r
+#include "main.h"\r
+\r
+/* Private includes ----------------------------------------------------------*/\r
+/* USER CODE BEGIN Includes */\r
+#include <stddef.h>\r
+#include <string.h>\r
+/* USER CODE END Includes */\r
+\r
+/* Private typedef -----------------------------------------------------------*/\r
+/* USER CODE BEGIN PTD */\r
+\r
+/* USER CODE END PTD */\r
+\r
+/* Private define ------------------------------------------------------------*/\r
+/* USER CODE BEGIN PD */\r
+/* USER CODE END PD */\r
+\r
+/* Private macro -------------------------------------------------------------*/\r
+/* USER CODE BEGIN PM */\r
+\r
+/* USER CODE END PM */\r
+\r
+/* Private variables ---------------------------------------------------------*/\r
+\r
+/* USER CODE BEGIN PV */\r
+volatile uint8_t activated = 0;\r
+const char *wait_str = "Awaiting input...\n";\r
+const char *active_str = "v=dQw4w9WgXcQ\n";\r
+/* USER CODE END PV */\r
+\r
+/* Private function prototypes -----------------------------------------------*/\r
+void SystemClock_Config(void);\r
+static void MX_GPIO_Init(void);\r
+static void MX_USART1_UART_Init(void);\r
+/* USER CODE BEGIN PFP */\r
+int uart_transmit(uint8_t *data, size_t size);\r
+/* USER CODE END PFP */\r
+\r
+/* Private user code ---------------------------------------------------------*/\r
+/* USER CODE BEGIN 0 */\r
+\r
+/* USER CODE END 0 */\r
+\r
+/**\r
+  * @brief  The application entry point.\r
+  * @retval int\r
+  */\r
+int main(void)\r
+{\r
+  /* USER CODE BEGIN 1 */\r
+       const char *str_to_send;\r
+  /* USER CODE END 1 */\r
+\r
+  /* MCU Configuration--------------------------------------------------------*/\r
+\r
+  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */\r
+\r
+  LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_AFIO);\r
+  LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR);\r
+\r
+  NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4);\r
+\r
+  /* System interrupt init*/\r
+\r
+  /** NOJTAG: JTAG-DP Disabled and SW-DP Enabled\r
+  */\r
+  LL_GPIO_AF_Remap_SWJ_NOJTAG();\r
+\r
+  /* USER CODE BEGIN Init */\r
+\r
+  /* USER CODE END Init */\r
+\r
+  /* Configure the system clock */\r
+  SystemClock_Config();\r
+\r
+  /* USER CODE BEGIN SysInit */\r
+\r
+  /* USER CODE END SysInit */\r
+\r
+  /* Initialize all configured peripherals */\r
+  MX_GPIO_Init();\r
+  MX_USART1_UART_Init();\r
+  /* USER CODE BEGIN 2 */\r
+\r
+  /* USER CODE END 2 */\r
+\r
+  /* Infinite loop */\r
+  /* USER CODE BEGIN WHILE */\r
+  while (1)\r
+  {\r
+         str_to_send = activated ? active_str : wait_str;\r
+         uart_transmit((uint8_t *) str_to_send, strlen(str_to_send));\r
+         LL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);\r
+         LL_mDelay(100);\r
+    /* USER CODE END WHILE */\r
+\r
+    /* USER CODE BEGIN 3 */\r
+  }\r
+  /* USER CODE END 3 */\r
+}\r
+\r
+/**\r
+  * @brief System Clock Configuration\r
+  * @retval None\r
+  */\r
+void SystemClock_Config(void)\r
+{\r
+  LL_FLASH_SetLatency(LL_FLASH_LATENCY_2);\r
+  while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_2)\r
+  {\r
+  }\r
+  LL_RCC_HSI_SetCalibTrimming(16);\r
+  LL_RCC_HSI_Enable();\r
+\r
+   /* Wait till HSI is ready */\r
+  while(LL_RCC_HSI_IsReady() != 1)\r
+  {\r
+\r
+  }\r
+  LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_HSI_DIV_2, LL_RCC_PLL_MUL_16);\r
+  LL_RCC_PLL_Enable();\r
+\r
+   /* Wait till PLL is ready */\r
+  while(LL_RCC_PLL_IsReady() != 1)\r
+  {\r
+\r
+  }\r
+  LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);\r
+  LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_2);\r
+  LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);\r
+  LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);\r
+\r
+   /* Wait till System clock is ready */\r
+  while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)\r
+  {\r
+\r
+  }\r
+  LL_Init1msTick(64000000);\r
+  LL_SetSystemCoreClock(64000000);\r
+}\r
+\r
+/**\r
+  * @brief USART1 Initialization Function\r
+  * @param None\r
+  * @retval None\r
+  */\r
+static void MX_USART1_UART_Init(void)\r
+{\r
+\r
+  /* USER CODE BEGIN USART1_Init 0 */\r
+\r
+  /* USER CODE END USART1_Init 0 */\r
+\r
+  LL_USART_InitTypeDef USART_InitStruct = {0};\r
+\r
+  LL_GPIO_InitTypeDef GPIO_InitStruct = {0};\r
+\r
+  /* Peripheral clock enable */\r
+  LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_USART1);\r
+\r
+  LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOA);\r
+  /**USART1 GPIO Configuration\r
+  PA9   ------> USART1_TX\r
+  PA10   ------> USART1_RX\r
+  */\r
+  GPIO_InitStruct.Pin = LL_GPIO_PIN_9;\r
+  GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE;\r
+  GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_HIGH;\r
+  GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;\r
+  LL_GPIO_Init(GPIOA, &GPIO_InitStruct);\r
+\r
+  GPIO_InitStruct.Pin = LL_GPIO_PIN_10;\r
+  GPIO_InitStruct.Mode = LL_GPIO_MODE_FLOATING;\r
+  LL_GPIO_Init(GPIOA, &GPIO_InitStruct);\r
+\r
+  /* USER CODE BEGIN USART1_Init 1 */\r
+\r
+  /* USER CODE END USART1_Init 1 */\r
+  USART_InitStruct.BaudRate = 2400;\r
+  USART_InitStruct.DataWidth = LL_USART_DATAWIDTH_9B;\r
+  USART_InitStruct.StopBits = LL_USART_STOPBITS_1;\r
+  USART_InitStruct.Parity = LL_USART_PARITY_EVEN;\r
+  USART_InitStruct.TransferDirection = LL_USART_DIRECTION_TX;\r
+  USART_InitStruct.HardwareFlowControl = LL_USART_HWCONTROL_NONE;\r
+  USART_InitStruct.OverSampling = LL_USART_OVERSAMPLING_16;\r
+  LL_USART_Init(USART1, &USART_InitStruct);\r
+  LL_USART_ConfigAsyncMode(USART1);\r
+  LL_USART_Enable(USART1);\r
+  /* USER CODE BEGIN USART1_Init 2 */\r
+\r
+  /* USER CODE END USART1_Init 2 */\r
+\r
+}\r
+\r
+/**\r
+  * @brief GPIO Initialization Function\r
+  * @param None\r
+  * @retval None\r
+  */\r
+static void MX_GPIO_Init(void)\r
+{\r
+  LL_EXTI_InitTypeDef EXTI_InitStruct = {0};\r
+  LL_GPIO_InitTypeDef GPIO_InitStruct = {0};\r
+\r
+  /* GPIO Ports Clock Enable */\r
+  LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOC);\r
+  LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOB);\r
+  LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOA);\r
+\r
+  /**/\r
+  LL_GPIO_ResetOutputPin(LED_GPIO_Port, LED_Pin);\r
+\r
+  /**/\r
+  GPIO_InitStruct.Pin = LED_Pin;\r
+  GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT;\r
+  GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_MEDIUM;\r
+  GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;\r
+  LL_GPIO_Init(LED_GPIO_Port, &GPIO_InitStruct);\r
+\r
+  /**/\r
+  LL_GPIO_AF_SetEXTISource(LL_GPIO_AF_EXTI_PORTB, LL_GPIO_AF_EXTI_LINE2);\r
+\r
+  /**/\r
+  EXTI_InitStruct.Line_0_31 = LL_EXTI_LINE_2;\r
+  EXTI_InitStruct.LineCommand = ENABLE;\r
+  EXTI_InitStruct.Mode = LL_EXTI_MODE_IT;\r
+  EXTI_InitStruct.Trigger = LL_EXTI_TRIGGER_RISING;\r
+  LL_EXTI_Init(&EXTI_InitStruct);\r
+\r
+  /**/\r
+  LL_GPIO_SetPinMode(BUT_GPIO_Port, BUT_Pin, LL_GPIO_MODE_FLOATING);\r
+\r
+  /* EXTI interrupt init*/\r
+  NVIC_SetPriority(EXTI2_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),1, 0));\r
+  NVIC_EnableIRQ(EXTI2_IRQn);\r
+\r
+}\r
+\r
+/* USER CODE BEGIN 4 */\r
+int uart_transmit(uint8_t *data, size_t size)\r
+{\r
+       size_t i = 0;\r
+\r
+       if (data == NULL)\r
+       {\r
+               return -1;\r
+       }\r
+\r
+       while (i < size)\r
+       {\r
+               LL_USART_TransmitData8(USART1, data[i]);\r
+               while (!LL_USART_IsActiveFlag_TXE(USART1));\r
+               i++;\r
+       }\r
+\r
+       return 0;\r
+}\r
+/* USER CODE END 4 */\r
+\r
+/**\r
+  * @brief  This function is executed in case of error occurrence.\r
+  * @retval None\r
+  */\r
+void Error_Handler(void)\r
+{\r
+  /* USER CODE BEGIN Error_Handler_Debug */\r
+  /* User can add his own implementation to report the HAL error return state */\r
+  __disable_irq();\r
+  while (1)\r
+  {\r
+  }\r
+  /* USER CODE END Error_Handler_Debug */\r
+}\r
+\r
+#ifdef  USE_FULL_ASSERT\r
+/**\r
+  * @brief  Reports the name of the source file and the source line number\r
+  *         where the assert_param error has occurred.\r
+  * @param  file: pointer to the source file name\r
+  * @param  line: assert_param error line source number\r
+  * @retval None\r
+  */\r
+void assert_failed(uint8_t *file, uint32_t line)\r
+{\r
+  /* USER CODE BEGIN 6 */\r
+  /* User can add his own implementation to report the file name and line number,\r
+     ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */\r
+  /* USER CODE END 6 */\r
+}\r
+#endif /* USE_FULL_ASSERT */\r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Core/Src/stm32f1xx_it.c b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Core/Src/stm32f1xx_it.c
new file mode 100644 (file)
index 0000000..96c50bc
--- /dev/null
@@ -0,0 +1,225 @@
+/* USER CODE BEGIN Header */\r
+/**\r
+  ******************************************************************************\r
+  * @file    stm32f1xx_it.c\r
+  * @brief   Interrupt Service Routines.\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+/* USER CODE END Header */\r
+\r
+/* Includes ------------------------------------------------------------------*/\r
+#include "main.h"\r
+#include "stm32f1xx_it.h"\r
+/* Private includes ----------------------------------------------------------*/\r
+/* USER CODE BEGIN Includes */\r
+/* USER CODE END Includes */\r
+\r
+/* Private typedef -----------------------------------------------------------*/\r
+/* USER CODE BEGIN TD */\r
+\r
+/* USER CODE END TD */\r
+\r
+/* Private define ------------------------------------------------------------*/\r
+/* USER CODE BEGIN PD */\r
+\r
+/* USER CODE END PD */\r
+\r
+/* Private macro -------------------------------------------------------------*/\r
+/* USER CODE BEGIN PM */\r
+\r
+/* USER CODE END PM */\r
+\r
+/* Private variables ---------------------------------------------------------*/\r
+/* USER CODE BEGIN PV */\r
+extern volatile uint8_t activated;\r
+/* USER CODE END PV */\r
+\r
+/* Private function prototypes -----------------------------------------------*/\r
+/* USER CODE BEGIN PFP */\r
+\r
+/* USER CODE END PFP */\r
+\r
+/* Private user code ---------------------------------------------------------*/\r
+/* USER CODE BEGIN 0 */\r
+\r
+/* USER CODE END 0 */\r
+\r
+/* External variables --------------------------------------------------------*/\r
+\r
+/* USER CODE BEGIN EV */\r
+\r
+/* USER CODE END EV */\r
+\r
+/******************************************************************************/\r
+/*           Cortex-M3 Processor Interruption and Exception Handlers          */\r
+/******************************************************************************/\r
+/**\r
+  * @brief This function handles Non maskable interrupt.\r
+  */\r
+void NMI_Handler(void)\r
+{\r
+  /* USER CODE BEGIN NonMaskableInt_IRQn 0 */\r
+\r
+  /* USER CODE END NonMaskableInt_IRQn 0 */\r
+  /* USER CODE BEGIN NonMaskableInt_IRQn 1 */\r
+  while (1)\r
+  {\r
+  }\r
+  /* USER CODE END NonMaskableInt_IRQn 1 */\r
+}\r
+\r
+/**\r
+  * @brief This function handles Hard fault interrupt.\r
+  */\r
+void HardFault_Handler(void)\r
+{\r
+  /* USER CODE BEGIN HardFault_IRQn 0 */\r
+\r
+  /* USER CODE END HardFault_IRQn 0 */\r
+  while (1)\r
+  {\r
+    /* USER CODE BEGIN W1_HardFault_IRQn 0 */\r
+    /* USER CODE END W1_HardFault_IRQn 0 */\r
+  }\r
+}\r
+\r
+/**\r
+  * @brief This function handles Memory management fault.\r
+  */\r
+void MemManage_Handler(void)\r
+{\r
+  /* USER CODE BEGIN MemoryManagement_IRQn 0 */\r
+\r
+  /* USER CODE END MemoryManagement_IRQn 0 */\r
+  while (1)\r
+  {\r
+    /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */\r
+    /* USER CODE END W1_MemoryManagement_IRQn 0 */\r
+  }\r
+}\r
+\r
+/**\r
+  * @brief This function handles Prefetch fault, memory access fault.\r
+  */\r
+void BusFault_Handler(void)\r
+{\r
+  /* USER CODE BEGIN BusFault_IRQn 0 */\r
+\r
+  /* USER CODE END BusFault_IRQn 0 */\r
+  while (1)\r
+  {\r
+    /* USER CODE BEGIN W1_BusFault_IRQn 0 */\r
+    /* USER CODE END W1_BusFault_IRQn 0 */\r
+  }\r
+}\r
+\r
+/**\r
+  * @brief This function handles Undefined instruction or illegal state.\r
+  */\r
+void UsageFault_Handler(void)\r
+{\r
+  /* USER CODE BEGIN UsageFault_IRQn 0 */\r
+\r
+  /* USER CODE END UsageFault_IRQn 0 */\r
+  while (1)\r
+  {\r
+    /* USER CODE BEGIN W1_UsageFault_IRQn 0 */\r
+    /* USER CODE END W1_UsageFault_IRQn 0 */\r
+  }\r
+}\r
+\r
+/**\r
+  * @brief This function handles System service call via SWI instruction.\r
+  */\r
+void SVC_Handler(void)\r
+{\r
+  /* USER CODE BEGIN SVCall_IRQn 0 */\r
+\r
+  /* USER CODE END SVCall_IRQn 0 */\r
+  /* USER CODE BEGIN SVCall_IRQn 1 */\r
+\r
+  /* USER CODE END SVCall_IRQn 1 */\r
+}\r
+\r
+/**\r
+  * @brief This function handles Debug monitor.\r
+  */\r
+void DebugMon_Handler(void)\r
+{\r
+  /* USER CODE BEGIN DebugMonitor_IRQn 0 */\r
+\r
+  /* USER CODE END DebugMonitor_IRQn 0 */\r
+  /* USER CODE BEGIN DebugMonitor_IRQn 1 */\r
+\r
+  /* USER CODE END DebugMonitor_IRQn 1 */\r
+}\r
+\r
+/**\r
+  * @brief This function handles Pendable request for system service.\r
+  */\r
+void PendSV_Handler(void)\r
+{\r
+  /* USER CODE BEGIN PendSV_IRQn 0 */\r
+\r
+  /* USER CODE END PendSV_IRQn 0 */\r
+  /* USER CODE BEGIN PendSV_IRQn 1 */\r
+\r
+  /* USER CODE END PendSV_IRQn 1 */\r
+}\r
+\r
+/**\r
+  * @brief This function handles System tick timer.\r
+  */\r
+void SysTick_Handler(void)\r
+{\r
+  /* USER CODE BEGIN SysTick_IRQn 0 */\r
+\r
+  /* USER CODE END SysTick_IRQn 0 */\r
+\r
+  /* USER CODE BEGIN SysTick_IRQn 1 */\r
+\r
+  /* USER CODE END SysTick_IRQn 1 */\r
+}\r
+\r
+/******************************************************************************/\r
+/* STM32F1xx Peripheral Interrupt Handlers                                    */\r
+/* Add here the Interrupt Handlers for the used peripherals.                  */\r
+/* For the available peripheral interrupt handler names,                      */\r
+/* please refer to the startup file (startup_stm32f1xx.s).                    */\r
+/******************************************************************************/\r
+\r
+/**\r
+  * @brief This function handles EXTI line2 interrupt.\r
+  */\r
+void EXTI2_IRQHandler(void)\r
+{\r
+  /* USER CODE BEGIN EXTI2_IRQn 0 */\r
+\r
+  /* USER CODE END EXTI2_IRQn 0 */\r
+  if (LL_EXTI_IsActiveFlag_0_31(LL_EXTI_LINE_2) != RESET)\r
+  {\r
+    LL_EXTI_ClearFlag_0_31(LL_EXTI_LINE_2);\r
+    /* USER CODE BEGIN LL_EXTI_LINE_2 */\r
+    activated = 1;\r
+    /* USER CODE END LL_EXTI_LINE_2 */\r
+  }\r
+  /* USER CODE BEGIN EXTI2_IRQn 1 */\r
+\r
+  /* USER CODE END EXTI2_IRQn 1 */\r
+}\r
+\r
+/* USER CODE BEGIN 1 */\r
+\r
+/* USER CODE END 1 */\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Core/Src/syscalls.c b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Core/Src/syscalls.c
new file mode 100644 (file)
index 0000000..914f768
--- /dev/null
@@ -0,0 +1,207 @@
+/**\r
+*****************************************************************************\r
+**\r
+**  File        : syscalls.c\r
+**\r
+**  Author             : Auto-generated by System workbench for STM32\r
+**\r
+**  Abstract    : System Workbench Minimal System calls file\r
+**\r
+**                       For more information about which c-functions\r
+**                need which of these lowlevel functions\r
+**                please consult the Newlib libc-manual\r
+**\r
+**  Target      : STMicroelectronics STM32\r
+**\r
+**  Distribution: The file is distributed “as is,” without any warranty\r
+**                of any kind.\r
+**\r
+*****************************************************************************\r
+** @attention\r
+**\r
+** <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>\r
+**\r
+** Redistribution and use in source and binary forms, with or without modification,\r
+** are permitted provided that the following conditions are met:\r
+**   1. Redistributions of source code must retain the above copyright notice,\r
+**      this list of conditions and the following disclaimer.\r
+**   2. Redistributions in binary form must reproduce the above copyright notice,\r
+**      this list of conditions and the following disclaimer in the documentation\r
+**      and/or other materials provided with the distribution.\r
+**   3. Neither the name of STMicroelectronics nor the names of its contributors\r
+**      may be used to endorse or promote products derived from this software\r
+**      without specific prior written permission.\r
+**\r
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
+** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r
+** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\r
+** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
+** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\r
+** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\r
+** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\r
+** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+**\r
+*****************************************************************************\r
+*/\r
+\r
+/* Includes */\r
+#include <sys/stat.h>\r
+#include <stdlib.h>\r
+#include <errno.h>\r
+#include <stdio.h>\r
+#include <signal.h>\r
+#include <time.h>\r
+#include <sys/time.h>\r
+#include <sys/times.h>\r
+\r
+\r
+/* Variables */\r
+//#undef errno\r
+extern int errno;\r
+extern int __io_putchar(int ch) __attribute__((weak));\r
+extern int __io_getchar(void) __attribute__((weak));\r
+\r
+register char * stack_ptr asm("sp");\r
+\r
+char *__env[1] = { 0 };\r
+char **environ = __env;\r
+\r
+\r
+/* Functions */\r
+void initialise_monitor_handles()\r
+{\r
+}\r
+\r
+int _getpid(void)\r
+{\r
+       return 1;\r
+}\r
+\r
+int _kill(int pid, int sig)\r
+{\r
+       errno = EINVAL;\r
+       return -1;\r
+}\r
+\r
+void _exit (int status)\r
+{\r
+       _kill(status, -1);\r
+       while (1) {}            /* Make sure we hang here */\r
+}\r
+\r
+__attribute__((weak)) int _read(int file, char *ptr, int len)\r
+{\r
+       int DataIdx;\r
+\r
+       for (DataIdx = 0; DataIdx < len; DataIdx++)\r
+       {\r
+               *ptr++ = __io_getchar();\r
+       }\r
+\r
+return len;\r
+}\r
+\r
+__attribute__((weak)) int _write(int file, char *ptr, int len)\r
+{\r
+       int DataIdx;\r
+\r
+       for (DataIdx = 0; DataIdx < len; DataIdx++)\r
+       {\r
+               __io_putchar(*ptr++);\r
+       }\r
+       return len;\r
+}\r
+\r
+caddr_t _sbrk(int incr)\r
+{\r
+       extern char end asm("end");\r
+       static char *heap_end;\r
+       char *prev_heap_end;\r
+\r
+       if (heap_end == 0)\r
+               heap_end = &end;\r
+\r
+       prev_heap_end = heap_end;\r
+       if (heap_end + incr > stack_ptr)\r
+       {\r
+//             write(1, "Heap and stack collision\n", 25);\r
+//             abort();\r
+               errno = ENOMEM;\r
+               return (caddr_t) -1;\r
+       }\r
+\r
+       heap_end += incr;\r
+\r
+       return (caddr_t) prev_heap_end;\r
+}\r
+\r
+int _close(int file)\r
+{\r
+       return -1;\r
+}\r
+\r
+\r
+int _fstat(int file, struct stat *st)\r
+{\r
+       st->st_mode = S_IFCHR;\r
+       return 0;\r
+}\r
+\r
+int _isatty(int file)\r
+{\r
+       return 1;\r
+}\r
+\r
+int _lseek(int file, int ptr, int dir)\r
+{\r
+       return 0;\r
+}\r
+\r
+int _open(char *path, int flags, ...)\r
+{\r
+       /* Pretend like we always fail */\r
+       return -1;\r
+}\r
+\r
+int _wait(int *status)\r
+{\r
+       errno = ECHILD;\r
+       return -1;\r
+}\r
+\r
+int _unlink(char *name)\r
+{\r
+       errno = ENOENT;\r
+       return -1;\r
+}\r
+\r
+int _times(struct tms *buf)\r
+{\r
+       return -1;\r
+}\r
+\r
+int _stat(char *file, struct stat *st)\r
+{\r
+       st->st_mode = S_IFCHR;\r
+       return 0;\r
+}\r
+\r
+int _link(char *old, char *new)\r
+{\r
+       errno = EMLINK;\r
+       return -1;\r
+}\r
+\r
+int _fork(void)\r
+{\r
+       errno = EAGAIN;\r
+       return -1;\r
+}\r
+\r
+int _execve(char *name, char **argv, char **env)\r
+{\r
+       errno = ENOMEM;\r
+       return -1;\r
+}\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Core/Src/system_stm32f1xx.c b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Core/Src/system_stm32f1xx.c
new file mode 100644 (file)
index 0000000..052bec6
--- /dev/null
@@ -0,0 +1,408 @@
+/**\r
+  ******************************************************************************\r
+  * @file    system_stm32f1xx.c\r
+  * @author  MCD Application Team\r
+  * @brief   CMSIS Cortex-M3 Device Peripheral Access Layer System Source File.\r
+  * \r
+  * 1.  This file provides two functions and one global variable to be called from \r
+  *     user application:\r
+  *      - SystemInit(): Setups the system clock (System clock source, PLL Multiplier\r
+  *                      factors, AHB/APBx prescalers and Flash settings). \r
+  *                      This function is called at startup just after reset and \r
+  *                      before branch to main program. This call is made inside\r
+  *                      the "startup_stm32f1xx_xx.s" file.\r
+  *\r
+  *      - SystemCoreClock variable: Contains the core clock (HCLK), it can be used\r
+  *                                  by the user application to setup the SysTick \r
+  *                                  timer or configure other parameters.\r
+  *                                     \r
+  *      - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must\r
+  *                                 be called whenever the core clock is changed\r
+  *                                 during program execution.\r
+  *\r
+  * 2. After each device reset the HSI (8 MHz) is used as system clock source.\r
+  *    Then SystemInit() function is called, in "startup_stm32f1xx_xx.s" file, to\r
+  *    configure the system clock before to branch to main program.\r
+  *\r
+  * 4. The default value of HSE crystal is set to 8 MHz (or 25 MHz, depending on\r
+  *    the product used), refer to "HSE_VALUE". \r
+  *    When HSE is used as system clock source, directly or through PLL, and you\r
+  *    are using different crystal you have to adapt the HSE value to your own\r
+  *    configuration.\r
+  *        \r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+\r
+/** @addtogroup CMSIS\r
+  * @{\r
+  */\r
+\r
+/** @addtogroup stm32f1xx_system\r
+  * @{\r
+  */  \r
+  \r
+/** @addtogroup STM32F1xx_System_Private_Includes\r
+  * @{\r
+  */\r
+\r
+#include "stm32f1xx.h"\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @addtogroup STM32F1xx_System_Private_TypesDefinitions\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @addtogroup STM32F1xx_System_Private_Defines\r
+  * @{\r
+  */\r
+\r
+#if !defined  (HSE_VALUE) \r
+  #define HSE_VALUE               8000000U /*!< Default value of the External oscillator in Hz.\r
+                                                This value can be provided and adapted by the user application. */\r
+#endif /* HSE_VALUE */\r
+\r
+#if !defined  (HSI_VALUE)\r
+  #define HSI_VALUE               8000000U /*!< Default value of the Internal oscillator in Hz.\r
+                                                This value can be provided and adapted by the user application. */\r
+#endif /* HSI_VALUE */\r
+\r
+/*!< Uncomment the following line if you need to use external SRAM  */ \r
+#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)\r
+/* #define DATA_IN_ExtSRAM */\r
+#endif /* STM32F100xE || STM32F101xE || STM32F101xG || STM32F103xE || STM32F103xG */\r
+\r
+/* Note: Following vector table addresses must be defined in line with linker\r
+         configuration. */\r
+/*!< Uncomment the following line if you need to relocate the vector table\r
+     anywhere in Flash or Sram, else the vector table is kept at the automatic\r
+     remap of boot address selected */\r
+/* #define USER_VECT_TAB_ADDRESS */\r
+\r
+#if defined(USER_VECT_TAB_ADDRESS)\r
+/*!< Uncomment the following line if you need to relocate your vector Table\r
+     in Sram else user remap will be done in Flash. */\r
+/* #define VECT_TAB_SRAM */\r
+#if defined(VECT_TAB_SRAM)\r
+#define VECT_TAB_BASE_ADDRESS   SRAM_BASE       /*!< Vector Table base address field.\r
+                                                     This value must be a multiple of 0x200. */\r
+#define VECT_TAB_OFFSET         0x00000000U     /*!< Vector Table base offset field.\r
+                                                     This value must be a multiple of 0x200. */\r
+#else\r
+#define VECT_TAB_BASE_ADDRESS   FLASH_BASE      /*!< Vector Table base address field.\r
+                                                     This value must be a multiple of 0x200. */\r
+#define VECT_TAB_OFFSET         0x00000000U     /*!< Vector Table base offset field.\r
+                                                     This value must be a multiple of 0x200. */\r
+#endif /* VECT_TAB_SRAM */\r
+#endif /* USER_VECT_TAB_ADDRESS */\r
+\r
+/******************************************************************************/\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @addtogroup STM32F1xx_System_Private_Macros\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @addtogroup STM32F1xx_System_Private_Variables\r
+  * @{\r
+  */\r
+\r
+  /* This variable is updated in three ways:\r
+      1) by calling CMSIS function SystemCoreClockUpdate()\r
+      2) by calling HAL API function HAL_RCC_GetHCLKFreq()\r
+      3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency \r
+         Note: If you use this function to configure the system clock; then there\r
+               is no need to call the 2 first functions listed above, since SystemCoreClock\r
+               variable is updated automatically.\r
+  */\r
+uint32_t SystemCoreClock = 16000000;\r
+const uint8_t AHBPrescTable[16U] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};\r
+const uint8_t APBPrescTable[8U] =  {0, 0, 0, 0, 1, 2, 3, 4};\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @addtogroup STM32F1xx_System_Private_FunctionPrototypes\r
+  * @{\r
+  */\r
+\r
+#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)\r
+#ifdef DATA_IN_ExtSRAM\r
+  static void SystemInit_ExtMemCtl(void); \r
+#endif /* DATA_IN_ExtSRAM */\r
+#endif /* STM32F100xE || STM32F101xE || STM32F101xG || STM32F103xE || STM32F103xG */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @addtogroup STM32F1xx_System_Private_Functions\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Setup the microcontroller system\r
+  *         Initialize the Embedded Flash Interface, the PLL and update the \r
+  *         SystemCoreClock variable.\r
+  * @note   This function should be used only after reset.\r
+  * @param  None\r
+  * @retval None\r
+  */\r
+void SystemInit (void)\r
+{\r
+#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)\r
+  #ifdef DATA_IN_ExtSRAM\r
+    SystemInit_ExtMemCtl(); \r
+  #endif /* DATA_IN_ExtSRAM */\r
+#endif \r
+\r
+  /* Configure the Vector Table location -------------------------------------*/\r
+#if defined(USER_VECT_TAB_ADDRESS)\r
+  SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM. */\r
+#endif /* USER_VECT_TAB_ADDRESS */\r
+}\r
+\r
+/**\r
+  * @brief  Update SystemCoreClock variable according to Clock Register Values.\r
+  *         The SystemCoreClock variable contains the core clock (HCLK), it can\r
+  *         be used by the user application to setup the SysTick timer or configure\r
+  *         other parameters.\r
+  *           \r
+  * @note   Each time the core clock (HCLK) changes, this function must be called\r
+  *         to update SystemCoreClock variable value. Otherwise, any configuration\r
+  *         based on this variable will be incorrect.         \r
+  *     \r
+  * @note   - The system frequency computed by this function is not the real \r
+  *           frequency in the chip. It is calculated based on the predefined \r
+  *           constant and the selected clock source:\r
+  *             \r
+  *           - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*)\r
+  *                                              \r
+  *           - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**)\r
+  *                          \r
+  *           - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) \r
+  *             or HSI_VALUE(*) multiplied by the PLL factors.\r
+  *         \r
+  *         (*) HSI_VALUE is a constant defined in stm32f1xx.h file (default value\r
+  *             8 MHz) but the real value may vary depending on the variations\r
+  *             in voltage and temperature.   \r
+  *    \r
+  *         (**) HSE_VALUE is a constant defined in stm32f1xx.h file (default value\r
+  *              8 MHz or 25 MHz, depending on the product used), user has to ensure\r
+  *              that HSE_VALUE is same as the real frequency of the crystal used.\r
+  *              Otherwise, this function may have wrong result.\r
+  *                \r
+  *         - The result of this function could be not correct when using fractional\r
+  *           value for HSE crystal.\r
+  * @param  None\r
+  * @retval None\r
+  */\r
+void SystemCoreClockUpdate (void)\r
+{\r
+  uint32_t tmp = 0U, pllmull = 0U, pllsource = 0U;\r
+\r
+#if defined(STM32F105xC) || defined(STM32F107xC)\r
+  uint32_t prediv1source = 0U, prediv1factor = 0U, prediv2factor = 0U, pll2mull = 0U;\r
+#endif /* STM32F105xC */\r
+\r
+#if defined(STM32F100xB) || defined(STM32F100xE)\r
+  uint32_t prediv1factor = 0U;\r
+#endif /* STM32F100xB or STM32F100xE */\r
+    \r
+  /* Get SYSCLK source -------------------------------------------------------*/\r
+  tmp = RCC->CFGR & RCC_CFGR_SWS;\r
+  \r
+  switch (tmp)\r
+  {\r
+    case 0x00U:  /* HSI used as system clock */\r
+      SystemCoreClock = HSI_VALUE;\r
+      break;\r
+    case 0x04U:  /* HSE used as system clock */\r
+      SystemCoreClock = HSE_VALUE;\r
+      break;\r
+    case 0x08U:  /* PLL used as system clock */\r
+\r
+      /* Get PLL clock source and multiplication factor ----------------------*/\r
+      pllmull = RCC->CFGR & RCC_CFGR_PLLMULL;\r
+      pllsource = RCC->CFGR & RCC_CFGR_PLLSRC;\r
+      \r
+#if !defined(STM32F105xC) && !defined(STM32F107xC)      \r
+      pllmull = ( pllmull >> 18U) + 2U;\r
+      \r
+      if (pllsource == 0x00U)\r
+      {\r
+        /* HSI oscillator clock divided by 2 selected as PLL clock entry */\r
+        SystemCoreClock = (HSI_VALUE >> 1U) * pllmull;\r
+      }\r
+      else\r
+      {\r
+ #if defined(STM32F100xB) || defined(STM32F100xE)\r
+       prediv1factor = (RCC->CFGR2 & RCC_CFGR2_PREDIV1) + 1U;\r
+       /* HSE oscillator clock selected as PREDIV1 clock entry */\r
+       SystemCoreClock = (HSE_VALUE / prediv1factor) * pllmull; \r
+ #else\r
+        /* HSE selected as PLL clock entry */\r
+        if ((RCC->CFGR & RCC_CFGR_PLLXTPRE) != (uint32_t)RESET)\r
+        {/* HSE oscillator clock divided by 2 */\r
+          SystemCoreClock = (HSE_VALUE >> 1U) * pllmull;\r
+        }\r
+        else\r
+        {\r
+          SystemCoreClock = HSE_VALUE * pllmull;\r
+        }\r
+ #endif\r
+      }\r
+#else\r
+      pllmull = pllmull >> 18U;\r
+      \r
+      if (pllmull != 0x0DU)\r
+      {\r
+         pllmull += 2U;\r
+      }\r
+      else\r
+      { /* PLL multiplication factor = PLL input clock * 6.5 */\r
+        pllmull = 13U / 2U; \r
+      }\r
+            \r
+      if (pllsource == 0x00U)\r
+      {\r
+        /* HSI oscillator clock divided by 2 selected as PLL clock entry */\r
+        SystemCoreClock = (HSI_VALUE >> 1U) * pllmull;\r
+      }\r
+      else\r
+      {/* PREDIV1 selected as PLL clock entry */\r
+        \r
+        /* Get PREDIV1 clock source and division factor */\r
+        prediv1source = RCC->CFGR2 & RCC_CFGR2_PREDIV1SRC;\r
+        prediv1factor = (RCC->CFGR2 & RCC_CFGR2_PREDIV1) + 1U;\r
+        \r
+        if (prediv1source == 0U)\r
+        { \r
+          /* HSE oscillator clock selected as PREDIV1 clock entry */\r
+          SystemCoreClock = (HSE_VALUE / prediv1factor) * pllmull;          \r
+        }\r
+        else\r
+        {/* PLL2 clock selected as PREDIV1 clock entry */\r
+          \r
+          /* Get PREDIV2 division factor and PLL2 multiplication factor */\r
+          prediv2factor = ((RCC->CFGR2 & RCC_CFGR2_PREDIV2) >> 4U) + 1U;\r
+          pll2mull = ((RCC->CFGR2 & RCC_CFGR2_PLL2MUL) >> 8U) + 2U; \r
+          SystemCoreClock = (((HSE_VALUE / prediv2factor) * pll2mull) / prediv1factor) * pllmull;                         \r
+        }\r
+      }\r
+#endif /* STM32F105xC */ \r
+      break;\r
+\r
+    default:\r
+      SystemCoreClock = HSI_VALUE;\r
+      break;\r
+  }\r
+  \r
+  /* Compute HCLK clock frequency ----------------*/\r
+  /* Get HCLK prescaler */\r
+  tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4U)];\r
+  /* HCLK clock frequency */\r
+  SystemCoreClock >>= tmp;  \r
+}\r
+\r
+#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)\r
+/**\r
+  * @brief  Setup the external memory controller. Called in startup_stm32f1xx.s \r
+  *          before jump to __main\r
+  * @param  None\r
+  * @retval None\r
+  */ \r
+#ifdef DATA_IN_ExtSRAM\r
+/**\r
+  * @brief  Setup the external memory controller. \r
+  *         Called in startup_stm32f1xx_xx.s/.c before jump to main.\r
+  *         This function configures the external SRAM mounted on STM3210E-EVAL\r
+  *         board (STM32 High density devices). This SRAM will be used as program\r
+  *         data memory (including heap and stack).\r
+  * @param  None\r
+  * @retval None\r
+  */ \r
+void SystemInit_ExtMemCtl(void) \r
+{\r
+  __IO uint32_t tmpreg;\r
+  /*!< FSMC Bank1 NOR/SRAM3 is used for the STM3210E-EVAL, if another Bank is \r
+    required, then adjust the Register Addresses */\r
+\r
+  /* Enable FSMC clock */\r
+  RCC->AHBENR = 0x00000114U;\r
+\r
+  /* Delay after an RCC peripheral clock enabling */\r
+  tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_FSMCEN);\r
+  \r
+  /* Enable GPIOD, GPIOE, GPIOF and GPIOG clocks */\r
+  RCC->APB2ENR = 0x000001E0U;\r
+  \r
+  /* Delay after an RCC peripheral clock enabling */\r
+  tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_IOPDEN);\r
+\r
+  (void)(tmpreg);\r
+  \r
+/* ---------------  SRAM Data lines, NOE and NWE configuration ---------------*/\r
+/*----------------  SRAM Address lines configuration -------------------------*/\r
+/*----------------  NOE and NWE configuration --------------------------------*/  \r
+/*----------------  NE3 configuration ----------------------------------------*/\r
+/*----------------  NBL0, NBL1 configuration ---------------------------------*/\r
+  \r
+  GPIOD->CRL = 0x44BB44BBU;  \r
+  GPIOD->CRH = 0xBBBBBBBBU;\r
+\r
+  GPIOE->CRL = 0xB44444BBU;  \r
+  GPIOE->CRH = 0xBBBBBBBBU;\r
+\r
+  GPIOF->CRL = 0x44BBBBBBU;  \r
+  GPIOF->CRH = 0xBBBB4444U;\r
+\r
+  GPIOG->CRL = 0x44BBBBBBU;  \r
+  GPIOG->CRH = 0x444B4B44U;\r
+   \r
+/*----------------  FSMC Configuration ---------------------------------------*/  \r
+/*----------------  Enable FSMC Bank1_SRAM Bank ------------------------------*/\r
+  \r
+  FSMC_Bank1->BTCR[4U] = 0x00001091U;\r
+  FSMC_Bank1->BTCR[5U] = 0x00110212U;\r
+}\r
+#endif /* DATA_IN_ExtSRAM */\r
+#endif /* STM32F100xE || STM32F101xE || STM32F101xG || STM32F103xE || STM32F103xG */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+  \r
+/**\r
+  * @}\r
+  */    \r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/main.d b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/main.d
new file mode 100644 (file)
index 0000000..cf75950
--- /dev/null
@@ -0,0 +1,55 @@
+Core/Src/main.o: ../Core/Src/main.c \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Core/Inc/main.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_rcc.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/core_cm3.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_version.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_compiler.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_gcc.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_bus.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_system.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_exti.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_cortex.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_utils.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_pwr.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_dma.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usart.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_gpio.h
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Core/Inc/main.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_rcc.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/core_cm3.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_version.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_compiler.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_gcc.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_bus.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_system.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_exti.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_cortex.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_utils.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_pwr.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_dma.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usart.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_gpio.h:
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/main.o b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/main.o
new file mode 100644 (file)
index 0000000..b958071
Binary files /dev/null and b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/main.o differ
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/stm32f1xx_it.d b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/stm32f1xx_it.d
new file mode 100644 (file)
index 0000000..b8a663e
--- /dev/null
@@ -0,0 +1,58 @@
+Core/Src/stm32f1xx_it.o: ../Core/Src/stm32f1xx_it.c \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Core/Inc/main.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_rcc.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/core_cm3.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_version.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_compiler.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_gcc.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_bus.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_system.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_exti.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_cortex.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_utils.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_pwr.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_dma.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usart.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_gpio.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Core/Inc/stm32f1xx_it.h
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Core/Inc/main.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_rcc.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/core_cm3.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_version.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_compiler.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_gcc.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_bus.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_system.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_exti.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_cortex.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_utils.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_pwr.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_dma.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usart.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_gpio.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Core/Inc/stm32f1xx_it.h:
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/stm32f1xx_it.o b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/stm32f1xx_it.o
new file mode 100644 (file)
index 0000000..502af37
Binary files /dev/null and b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/stm32f1xx_it.o differ
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/subdir.mk b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/subdir.mk
new file mode 100644 (file)
index 0000000..cf76f70
--- /dev/null
@@ -0,0 +1,34 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+# Add inputs and outputs from these tool invocations to the build variables 
+C_SRCS += \
+../Core/Src/main.c \
+../Core/Src/stm32f1xx_it.c \
+../Core/Src/syscalls.c \
+../Core/Src/system_stm32f1xx.c 
+
+OBJS += \
+./Core/Src/main.o \
+./Core/Src/stm32f1xx_it.o \
+./Core/Src/syscalls.o \
+./Core/Src/system_stm32f1xx.o 
+
+C_DEPS += \
+./Core/Src/main.d \
+./Core/Src/stm32f1xx_it.d \
+./Core/Src/syscalls.d \
+./Core/Src/system_stm32f1xx.d 
+
+
+# Each subdirectory must supply rules for building sources it contributes
+Core/Src/%.o: ../Core/Src/%.c
+       @echo 'Building file: $<'
+       @echo 'Invoking: MCU GCC Compiler'
+       @echo $(PWD)
+       arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -DUSE_FULL_LL_DRIVER -DSTM32F103xB '-DHSE_VALUE=8000000' '-DHSE_STARTUP_TIMEOUT=100' '-DLSE_STARTUP_TIMEOUT=5000' '-DLSE_VALUE=32768' '-DHSI_VALUE=8000000' '-DLSI_VALUE=40000' '-DVDD_VALUE=3300' '-DPREFETCH_ENABLE=1' -I"/home/cartogan/Ac6/workspace/ghidra_demo/Core/Inc" -I"/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc" -I"/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include" -I"/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include"  -O0 -Wall -fmessage-length=0 -ffunction-sections -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -o "$@" "$<"
+       @echo 'Finished building: $<'
+       @echo ' '
+
+
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/syscalls.d b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/syscalls.d
new file mode 100644 (file)
index 0000000..8667c70
--- /dev/null
@@ -0,0 +1 @@
+Core/Src/syscalls.o: ../Core/Src/syscalls.c
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/syscalls.o b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/syscalls.o
new file mode 100644 (file)
index 0000000..c7b2c93
Binary files /dev/null and b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/syscalls.o differ
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/system_stm32f1xx.d b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/system_stm32f1xx.d
new file mode 100644 (file)
index 0000000..811864c
--- /dev/null
@@ -0,0 +1,22 @@
+Core/Src/system_stm32f1xx.o: ../Core/Src/system_stm32f1xx.c \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/core_cm3.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_version.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_compiler.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_gcc.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/core_cm3.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_version.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_compiler.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_gcc.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h:
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/system_stm32f1xx.o b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/system_stm32f1xx.o
new file mode 100644 (file)
index 0000000..a01316f
Binary files /dev/null and b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Core/Src/system_stm32f1xx.o differ
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.d b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.d
new file mode 100644 (file)
index 0000000..ca0bdb4
--- /dev/null
@@ -0,0 +1,29 @@
+Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o: \
+ ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.c \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_dma.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/core_cm3.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_version.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_compiler.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_gcc.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_bus.h
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_dma.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/core_cm3.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_version.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_compiler.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_gcc.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_bus.h:
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o
new file mode 100644 (file)
index 0000000..f05efa2
Binary files /dev/null and b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o differ
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.d b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.d
new file mode 100644 (file)
index 0000000..c5aca51
--- /dev/null
@@ -0,0 +1,26 @@
+Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o: \
+ ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.c \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_exti.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/core_cm3.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_version.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_compiler.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_gcc.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_exti.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/core_cm3.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_version.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_compiler.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_gcc.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h:
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o
new file mode 100644 (file)
index 0000000..0e00715
Binary files /dev/null and b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o differ
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.d b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.d
new file mode 100644 (file)
index 0000000..3d3567b
--- /dev/null
@@ -0,0 +1,29 @@
+Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.o: \
+ ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.c \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_gpio.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/core_cm3.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_version.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_compiler.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_gcc.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_bus.h
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_gpio.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/core_cm3.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_version.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_compiler.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_gcc.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_bus.h:
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.o b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.o
new file mode 100644 (file)
index 0000000..45fa67c
Binary files /dev/null and b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.o differ
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.d b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.d
new file mode 100644 (file)
index 0000000..cfb6272
--- /dev/null
@@ -0,0 +1,29 @@
+Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.o: \
+ ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.c \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_pwr.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/core_cm3.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_version.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_compiler.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_gcc.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_bus.h
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_pwr.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/core_cm3.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_version.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_compiler.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_gcc.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_bus.h:
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.o b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.o
new file mode 100644 (file)
index 0000000..3c691ad
Binary files /dev/null and b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.o differ
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.d b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.d
new file mode 100644 (file)
index 0000000..0422411
--- /dev/null
@@ -0,0 +1,26 @@
+Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o: \
+ ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.c \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_rcc.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/core_cm3.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_version.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_compiler.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_gcc.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_rcc.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/core_cm3.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_version.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_compiler.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_gcc.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h:
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
new file mode 100644 (file)
index 0000000..b13b9be
Binary files /dev/null and b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o differ
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.d b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.d
new file mode 100644 (file)
index 0000000..39ae814
--- /dev/null
@@ -0,0 +1,32 @@
+Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o: \
+ ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.c \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usart.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/core_cm3.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_version.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_compiler.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_gcc.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_rcc.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_bus.h
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usart.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/core_cm3.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_version.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_compiler.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_gcc.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_rcc.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_bus.h:
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o
new file mode 100644 (file)
index 0000000..b66ddfc
Binary files /dev/null and b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o differ
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.d b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.d
new file mode 100644 (file)
index 0000000..d857a5a
--- /dev/null
@@ -0,0 +1,32 @@
+Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o: \
+ ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.c \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_rcc.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/core_cm3.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_version.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_compiler.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_gcc.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_utils.h \
+ /home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_system.h
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_rcc.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/core_cm3.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_version.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_compiler.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include/cmsis_gcc.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_utils.h:
+
+/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_system.h:
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
new file mode 100644 (file)
index 0000000..5173ce7
Binary files /dev/null and b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o differ
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/subdir.mk b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/Drivers/STM32F1xx_HAL_Driver/Src/subdir.mk
new file mode 100644 (file)
index 0000000..35d2cbd
--- /dev/null
@@ -0,0 +1,43 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+# Add inputs and outputs from these tool invocations to the build variables 
+C_SRCS += \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.c \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.c \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.c \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.c \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.c \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.c \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.c 
+
+OBJS += \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.o \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.o \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o 
+
+C_DEPS += \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.d \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.d \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.d \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.d \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.d \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.d \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.d 
+
+
+# Each subdirectory must supply rules for building sources it contributes
+Drivers/STM32F1xx_HAL_Driver/Src/%.o: ../Drivers/STM32F1xx_HAL_Driver/Src/%.c
+       @echo 'Building file: $<'
+       @echo 'Invoking: MCU GCC Compiler'
+       @echo $(PWD)
+       arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -DUSE_FULL_LL_DRIVER -DSTM32F103xB '-DHSE_VALUE=8000000' '-DHSE_STARTUP_TIMEOUT=100' '-DLSE_STARTUP_TIMEOUT=5000' '-DLSE_VALUE=32768' '-DHSI_VALUE=8000000' '-DLSI_VALUE=40000' '-DVDD_VALUE=3300' '-DPREFETCH_ENABLE=1' -I"/home/cartogan/Ac6/workspace/ghidra_demo/Core/Inc" -I"/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/STM32F1xx_HAL_Driver/Inc" -I"/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Device/ST/STM32F1xx/Include" -I"/home/cartogan/Ac6/workspace/ghidra_demo/Drivers/CMSIS/Include"  -O0 -Wall -fmessage-length=0 -ffunction-sections -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -o "$@" "$<"
+       @echo 'Finished building: $<'
+       @echo ' '
+
+
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/ghidra_demo.elf b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/ghidra_demo.elf
new file mode 100755 (executable)
index 0000000..16a606e
Binary files /dev/null and b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/ghidra_demo.elf differ
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/ghidra_demo.hex b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/ghidra_demo.hex
new file mode 100644 (file)
index 0000000..3e5b965
--- /dev/null
@@ -0,0 +1,329 @@
+:020000040800F2\r
+:100000000050002029130008A5090008AB090008CA\r
+:10001000B1090008B7090008BD0900080000000088\r
+:10002000000000000000000000000000C3090008FC\r
+:10003000CF09000800000000DB090008E7090008FC\r
+:100040007113000871130008711300087113000880\r
+:100050007113000871130008711300087113000870\r
+:10006000F5090008711300087113000871130008E6\r
+:100070007113000871130008711300087113000850\r
+:100080007113000871130008711300087113000840\r
+:100090007113000871130008711300087113000830\r
+:1000A0007113000871130008711300087113000820\r
+:1000B0007113000871130008711300087113000810\r
+:1000C0007113000871130008711300087113000800\r
+:1000D00071130008711300087113000871130008F0\r
+:1000E000711300087113000871130008000000006C\r
+:1000F0000000000000000000000000000000000000\r
+:0C01000000000000000000005FF808F1A3\r
+:10010C0010B5054C237833B9044B13B10448AFF345\r
+:10011C0000800123237010BD0C00002000000000A3\r
+:10012C00BC13000808B5034B1BB103490348AFF3DC\r
+:10013C00008008BD0000000010000020BC13000867\r
+:10014C00034613F8012B002AFBD1181A013870470B\r
+:10015C0080B485B000AF78607B6803F00703FB6068\r
+:10016C000C4BDB68BB60BA684FF6FF031340BB60F7\r
+:10017C00FB681A02BB68134343F0BF6343F40033BC\r
+:10018C00BB60044ABB68D36000BF1437BD4680BC5B\r
+:10019C00704700BF00ED00E080B400AF044BDB689B\r
+:1001AC001B0A03F007031846BD4680BC704700BF0E\r
+:1001BC0000ED00E080B483B000AF0346FB7197F90B\r
+:1001CC000730002B0BDBFB7903F01F02064997F974\r
+:1001DC0007305B09012000FA02F241F8232000BF2E\r
+:1001EC000C37BD4680BC704700E100E080B483B0A2\r
+:1001FC0000AF03463960FB7197F90730002B0ADB1F\r
+:10020C003B68DAB20C4997F907301201D2B20B44B1\r
+:10021C0083F800230AE03B68DAB20849FB7903F063\r
+:10022C000F03043B1201D2B20B441A7600BF0C37F9\r
+:10023C00BD4680BC704700BF00E100E000ED00E06F\r
+:10024C0080B489B000AFF860B9607A60FB6803F0E5\r
+:10025C000703FB61FB69C3F10703042B28BF0423CD\r
+:10026C00BB61FB690433062B02D9FB69033B00E03D\r
+:10027C0000237B614FF0FF32BB6902FA03F3DA43D0\r
+:10028C00BB681A407B699A404FF0FF317B6901FAD9\r
+:10029C0003F3D9437B680B40134318462437BD4600\r
+:1002AC0080BC704780B400AF044B1B68034A43F01A\r
+:1002BC000103136000BFBD4680BC704700100240B4\r
+:1002CC0080B400AF064B1B6803F00203022B0CBF7B\r
+:1002DC0001230023DBB21846BD4680BC704700BF2B\r
+:1002EC000010024080B483B000AF7860064B1B68EE\r
+:1002FC0023F0F8027B68DB00034913430B6000BF5B\r
+:10030C000C37BD4680BC70470010024080B483B0EF\r
+:10031C0000AF7860064B5B6823F0030204497B68EE\r
+:10032C0013434B6000BF0C37BD4680BC704700BF09\r
+:10033C000010024080B400AF034B5B6803F00C0369\r
+:10034C001846BD4680BC70470010024080B483B094\r
+:10035C0000AF7860064B5B6823F0F00204497B68C1\r
+:10036C0013434B6000BF0C37BD4680BC704700BFC9\r
+:10037C000010024080B483B000AF7860064B5B681D\r
+:10038C0023F4E06204497B6813434B6000BF0C37D5\r
+:10039C00BD4680BC704700BF0010024080B483B0E3\r
+:1003AC0000AF7860064B5B6823F4605204497B68AD\r
+:1003BC0013434B6000BF0C37BD4680BC704700BF79\r
+:1003CC000010024080B400AF044B1B68034A43F09A\r
+:1003DC008073136000BFBD4680BC704700100240A4\r
+:1003EC0080B400AF064B1B6803F00073B3F1007FC1\r
+:1003FC000CBF01230023DBB21846BD4680BC7047FE\r
+:10040C000010024080B483B000AF78603960084BB4\r
+:10041C005B6823F47C127B6803F440313B680B432C\r
+:10042C00034913434B6000BF0C37BD4680BC70477B\r
+:10043C000010024080B485B000AF7860084BDA69D8\r
+:10044C0007497B681343CB61054BDA697B68134022\r
+:10045C00FB60FB6800BF1437BD4680BC704700BF13\r
+:10046C000010024080B485B000AF7860084B9A69E8\r
+:10047C0007497B6813438B61054B9A697B68134072\r
+:10048C00FB60FB6800BF1437BD4680BC704700BFE3\r
+:10049C000010024080B483B000AF7860064B1B683C\r
+:1004AC0023F0070204497B6813430B6000BF0C3731\r
+:1004BC00BD4680BC704700BF0020024080B400AF36\r
+:1004CC00034B1B6803F007031846BD4680BC7047FE\r
+:1004DC000020024080B483B000AF78607B68DB689A\r
+:1004EC0043F400527B68DA6000BF0C37BD4680BC19\r
+:1004FC00704780B483B000AF78607B681B6923F4CD\r
+:10050C0090427B681A617B685B6923F02A027B68E6\r
+:10051C005A6100BF0C37BD4680BC704780B483B0B5\r
+:10052C0000AF78607B681B6803F08003802B0CBFE6\r
+:10053C0001230023DBB218460C37BD4680BC704744\r
+:10054C0080B483B000AF78600B46FB70FA787B68A0\r
+:10055C005A6000BF0C37BD4680BC704790B488B061\r
+:10056C0000AFF860B9607A60FB681A46BB681B0E76\r
+:10057C0013441C462268BB687B617B6993FAA3F326\r
+:10058C003B613B69B3FA83F3DBB29B000F2101FAA9\r
+:10059C0003F3DB431A40BB68FB61FB6993FAA3F3DB\r
+:1005AC00BB61BB69B3FA83F3DBB29B00796801FAD8\r
+:1005BC0003F31343236000BF2037BD4690BC704744\r
+:1005CC0080B483B000AF786039603B681B0A9AB284\r
+:1005DC007B685A6100BF0C37BD4680BC704780B445\r
+:1005EC0085B000AF786039607B68DB68FB603B6886\r
+:1005FC001B0A9BB2BB60FA68BB6813401A04FB6809\r
+:10060C00D943BB680B401A437B681A6100BF14378F\r
+:10061C00BD4680BC7047000080B400AF074B5B68E0\r
+:10062C00064A23F0E0635360044B5B68034A43F0D3\r
+:10063C000073536000BFBD4680BC70470000014092\r
+:10064C0080B485B000AF78603960134A3B68DBB288\r
+:10065C00023352F823203B681B0CDB4302EA0301F4\r
+:10066C003B681B0CFB60FB6893FAA3F3BB60BB6895\r
+:10067C00B3FA83F3DBB21A467B6803FA02F206483C\r
+:10068C003B68DBB20A43023340F8232000BF143727\r
+:10069C00BD4680BC704700BF0000014080B582B0F1\r
+:1006AC0000AF0120FFF7DEFE4FF08050FFF7C2FED7\r
+:1006BC000320FFF74DFDFFF7AFFF00F029F800F026\r
+:1006CC00C1F800F065F80D4B1B78DBB2002B02D0A3\r
+:1006DC000B4B1B6801E00B4B1B687B607868FFF7CA\r
+:1006EC002FFD03461946786800F008F906490748BB\r
+:1006FC00FFF775FF642000F0DFFDE4E72800002021\r
+:10070C000400002000000020200020040010014004\r
+:10071C0080B500AF0220FFF7BDFE00BFFFF7CEFE95\r
+:10072C000346022BFAD11020FFF7DCFDFFF7BAFDD0\r
+:10073C0000BFFFF7C5FD0346012BFAD14FF4601142\r
+:10074C000020FFF75FFEFFF73DFE00BFFFF748FEFE\r
+:10075C000346012BFAD10020FFF7F8FD4FF480601F\r
+:10076C00FFF708FE0020FFF719FE0220FFF7CEFD71\r
+:10077C0000BFFFF7DFFD0346082BFAD1034800F05A\r
+:10078C008DFD024800F0BCFD00BF80BD0090D00381\r
+:10079C0080B58CB000AF07F1140300221A605A60C8\r
+:1007AC009A60DA601A615A619A613B4600221A60BB\r
+:1007BC005A609A60DA601A614FF48040FFF752FE7B\r
+:1007CC000420FFF74FFE1B4B3B6009237B60032388\r
+:1007DC00BB600023FB603B461946174800F0E0FA6B\r
+:1007EC00164B3B6004237B603B461946124800F0D5\r
+:1007FC00D7FA4FF416637B614FF48053BB6100232F\r
+:10080C00FB614FF480633B6208237B620023BB6275\r
+:10081C000023FB6207F114031946094800F0C4FCDD\r
+:10082C000748FFF766FE0648FFF754FE00BF303757\r
+:10083C00BD4680BD0200020400080140040004040F\r
+:10084C000038014080B588B000AF07F118030022D2\r
+:10085C001A605A603B1D00221A605A609A60DA6076\r
+:10086C001A611020FFF7FEFD0820FFF7FBFD0420A6\r
+:10087C00FFF7F8FD1E491F48FFF7A2FE1C4B7B60DB\r
+:10088C000123BB600123FB6000233B613B1D194628\r
+:10089C00184800F085FA4FF070610120FFF7D0FE88\r
+:1008AC000423BB6101233B7700237B770123BB77B8\r
+:1008BC0007F11803184600F03FF9042240F20441F6\r
+:1008CC000D48FFF74BFEFFF767FC034600220121A2\r
+:1008DC001846FFF7B5FC034619460820FFF786FCBF\r
+:1008EC000820FFF767FC00BF2037BD4680BD00BF66\r
+:1008FC002000200400100140000C014080B584B0A1\r
+:10090C0000AF786039600023FB607B68002B14D14A\r
+:10091C004FF0FF3316E07A68FB6813441B781946D6\r
+:10092C000A48FFF70DFE00BF0848FFF7F7FD034626\r
+:10093C00002BF9D0FB680133FB60FA683B689A42E4\r
+:10094C00E9D3002318461037BD4680BD003801405E\r
+:10095C0080B483B000AF7860074B5A697B68134052\r
+:10096C007A689A420CBF01230023DBB218460C377D\r
+:10097C00BD4680BC704700BF0004014080B483B00A\r
+:10098C0000AF7860034A7B68536100BF0C37BD46EB\r
+:10099C0080BC70470004014080B400AFFEE780B417\r
+:1009AC0000AFFEE780B400AFFEE780B400AFFEE717\r
+:1009BC0080B400AFFEE780B400AF00BFBD4680BC82\r
+:1009CC00704780B400AF00BFBD4680BC704780B498\r
+:1009DC0000AF00BFBD4680BC704780B400AF00BF05\r
+:1009EC00BD4680BC7047000080B500AF0420FFF707\r
+:1009FC00AFFF0346002B05D00420FFF7BFFF024BCF\r
+:100A0C0001221A7000BF80BD2800002080B400AF06\r
+:100A1C0000BFBD4680BC704780B483B000AF786027\r
+:100A2C00054B1A6804497B6813430B6000BF0C37F5\r
+:100A3C00BD4680BC704700BF0004014080B483B049\r
+:100A4C0000AF7860054B1A687B68DB4303491340A1\r
+:100A5C000B6000BF0C37BD4680BC704700040140E2\r
+:100A6C0080B483B000AF7860054B5A6804497B684A\r
+:100A7C0013434B6000BF0C37BD4680BC704700BFB2\r
+:100A8C000004014080B483B000AF7860054B5A6815\r
+:100A9C007B68DB43034913404B6000BF0C37BD46FA\r
+:100AAC0080BC70470004014080B483B000AF786014\r
+:100ABC00054B9A6804497B6813438B6000BF0C3765\r
+:100ACC00BD4680BC704700BF0004014080B483B0B9\r
+:100ADC0000AF7860054B9A687B68DB430349134091\r
+:100AEC008B6000BF0C37BD4680BC704700040140D2\r
+:100AFC0080B483B000AF7860054BDA6804497B683A\r
+:100B0C001343CB6000BF0C37BD4680BC704700BFA1\r
+:100B1C000004014080B483B000AF7860054BDA6804\r
+:100B2C007B68DB4303491340CB6000BF0C37BD46E9\r
+:100B3C0080BC70470004014080B584B000AF786081\r
+:100B4C000023FB737B681B79002B60D07B681B68D0\r
+:100B5C00002B67D07B685B79012B0ED0022B17D052\r
+:100B6C00002B20D17B681B681846FFF78BFF7B6836\r
+:100B7C001B681846FFF750FF18E07B681B68184687\r
+:100B8C00FFF75CFF7B681B681846FFF769FF0DE0F9\r
+:100B9C007B681B681846FFF73FFF7B681B6818468D\r
+:100BAC00FFF75EFF02E00123FB7300BF7B689B79BC\r
+:100BBC00002B37D07B689B79022B0ED0032B17D0E0\r
+:100BCC00012B20D17B681B681846FFF7A3FF7B68BD\r
+:100BDC001B681846FFF768FF25E07B681B68184602\r
+:100BEC00FFF774FF7B681B681846FFF781FF1AE05C\r
+:100BFC007B681B681846FFF757FF7B681B68184615\r
+:100C0C00FFF776FF0FE00123FB7300BF0BE07B685F\r
+:100C1C001B681846FFF712FF7B681B681846FFF726\r
+:100C2C0031FF00E000BFFB7B18461037BD4680BD8E\r
+:100C3C0090B488B000AFF860B9607A60FB681A466F\r
+:100C4C00BB681B0E13441C462268BB687B617B6926\r
+:100C5C0093FAA3F33B613B69B3FA83F3DBB29B00DA\r
+:100C6C000F2101FA03F3DB431A40BB68FB61FB69FC\r
+:100C7C0093FAA3F3BB61BB69B3FA83F3DBB29B00BA\r
+:100C8C00796801FA03F31343236000BF2037BD4694\r
+:100C9C0090BC704790B488B000AFF860B9607A60CF\r
+:100CAC00FB681A46BB681B0E13441C462268BB68C3\r
+:100CBC007B617B6993FAA3F33B613B69B3FA83F3E2\r
+:100CCC00DBB29B00032101FA03F3DB431A40BB6840\r
+:100CDC00FB61FB6993FAA3F3BB61BB69B3FA83F3C2\r
+:100CEC00DBB29B00796801FA03F31343236000BF66\r
+:100CFC002037BD4690BC704790B488B000AFF86008\r
+:100D0C00B9607A60FB681A46BB681B0E13441C461C\r
+:100D1C002268BB687B617B6993FAA3F33B613B69F7\r
+:100D2C00B3FA83F3DBB29B00042101FA03F3DB4338\r
+:100D3C001A40BB68FB61FB6993FAA3F3BB61BB6907\r
+:100D4C00B3FA83F3DBB29B00796801FA03F3134324\r
+:100D5C00236000BF2037BD4690BC704780B487B07D\r
+:100D6C0000AFF860B9607A60FB68DA68BB681B0A90\r
+:100D7C00DB431A40BB681B0A7B617B6993FAA3F3C4\r
+:100D8C003B613B69B3FA83F3DBB219467B688B405A\r
+:100D9C001A43FB68DA6000BF1C37BD4680BC704745\r
+:100DAC0080B588B000AF786039603B681B681B0267\r
+:100DBC001B0C7B617B693B613B6993FAA3F3FB6082\r
+:100DCC00FB68B3FA83F3DBB2FB6140E00122FB6901\r
+:100DDC009A407B691340002B36D0FB69072B06D851\r
+:100DEC0040F20112FB6902FA03F3BB6108E0FB69F4\r
+:100DFC00083B4FF0011202FA03F343F08063BB612E\r
+:100E0C003B681B691A46B9697868FFF7A7FF3B680E\r
+:100E1C005B681A46B9697868FFF70AFF3B685B683C\r
+:100E2C00012B03D03B685B68092B0DD13B689B6899\r
+:100E3C001A46B9697868FFF72DFF3B68DB681A46DC\r
+:100E4C00B9697868FFF758FFFB690133FB617A6970\r
+:100E5C00FB6922FA03F3002BB8D100231846203784\r
+:100E6C00BD4680BD80B400AF034B5B6803F00C0340\r
+:100E7C001846BD4680BC70470010024080B400AFDD\r
+:100E8C00034B5B6803F0F0031846BD4680BC70470B\r
+:100E9C000010024080B400AF034B5B6803F4E063C6\r
+:100EAC001846BD4680BC70470010024080B400AFAD\r
+:100EBC00034B5B6803F460531846BD4680BC704717\r
+:100ECC000010024080B400AF034B5B6803F4803326\r
+:100EDC001846BD4680BC70470010024080B400AF7D\r
+:100EEC00034B5B6803F470131846BD4680BC704717\r
+:100EFC000010024080B400AF044B5B685B0C03F045\r
+:100F0C0001031846BD4680BC704700BF001002406C\r
+:100F1C0080B582B000AF786000F020F802467B68A4\r
+:100F2C001A607B681B68184600F03AF802467B682A\r
+:100F3C005A607B685B68184600F048F802467B688C\r
+:100F4C009A607B685B68184600F054F802467B6830\r
+:100F5C00DA6000BF0837BD4680BD000080B582B0A6\r
+:100F6C0000AF00237B60FFF77DFF0346042B06D008\r
+:100F7C00082B07D0002B09D1084B7B6009E0074BED\r
+:100F8C007B6006E000F04AF8786002E0034B7B607F\r
+:100F9C0000BF7B6818460837BD4680BD00127A003A\r
+:100FAC0080B582B000AF7860FFF768FF03461B097D\r
+:100FBC0003F00F03044AD35C1A467B68D3401846EF\r
+:100FCC000837BD4680BD00BF0014000880B582B054\r
+:100FDC0000AF7860FFF75EFF03461B0A044AD35C40\r
+:100FEC001A467B68D34018460837BD4680BD00BF03\r
+:100FFC001014000880B582B000AF7860FFF756FF80\r
+:10100C000346DB0A044AD35C1A467B68D340184675\r
+:10101C000837BD4680BD00BF1014000880B582B0F3\r
+:10102C0000AF00237B6000233B60FFF74BFF386071\r
+:10103C003B68002B03D0B3F5803F03D00BE00D4B86\r
+:10104C007B600BE0FFF756FF034601330A4AB2FB05\r
+:10105C00F3F37B6002E0074B7B6000BFFFF73EFFC2\r
+:10106C0003469B0C02337A6802FB03F318460837DD\r
+:10107C00BD4680BD00093D0000127A0080B483B0EB\r
+:10108C0000AF78607B68DB6803F40053B3F5005F56\r
+:10109C000CBF01230023DBB218460C37BD4680BCC5\r
+:1010AC00704780B483B000AF786039607B681B698F\r
+:1010BC0023F440523B681A437B681A6100BF0C371B\r
+:1010CC00BD4680BC704780B483B000AF7860396097\r
+:1010DC007B685B6923F440723B681A437B685A61F6\r
+:1010EC0000BF0C37BD4680BC7047000080B485B093\r
+:1010FC0000AFF860B9607A60BA6813469B0013447D\r
+:10110C009A001A447B689B00B2FBF3F3254AA2FBBE\r
+:10111C0003235B099BB21B0199B2BA6813469B006F\r
+:10112C0013449A001A447B689B00B2FBF3F21D4BEC\r
+:10113C00A3FB02035B09642000FB03F3D31A1B011E\r
+:10114C003233184AA2FB03235B099BB203F0F00372\r
+:10115C009BB20B4499B2BA6813469B0013449A0095\r
+:10116C001A447B689B00B2FBF3F20E4BA3FB020309\r
+:10117C005B09642000FB03F3D31A1B013233094AC9\r
+:10118C00A2FB03235B099BB203F00F039BB20B443E\r
+:10119C009BB21A46FB689A6000BF1437BD4680BCF0\r
+:1011AC00704700BF1F85EB5180B588B000AF7860E9\r
+:1011BC0039600123FB770023BB617868FFF75EFF82\r
+:1011CC000346002B45D17B68DB6823F4B05323F036\r
+:1011DC000C033A6851683A68D26811433A6812694C\r
+:1011EC000A431A437B68DA603B689B681946786847\r
+:1011FC00FFF757FF3B685B6919467868FFF763FF99\r
+:10120C0007F108031846FFF783FE7B68134A9342E5\r
+:10121C0002D17B69BB610CE07B68114A934202D11D\r
+:10122C003B69BB6105E07B680E4A934201D13B6987\r
+:10123C00BB61BB69002B0CD03B681B68002B08D032\r
+:10124C000023FB773B681B681A46B9697868FFF77F\r
+:10125C004DFFFB7F18462037BD4680BD003801404E\r
+:10126C00004400400048004080B483B000AF786078\r
+:10127C0039607A683B68B2FBF3F3074A013B536071\r
+:10128C00054B00229A60044B05221A6000BF0C37F4\r
+:10129C00BD4680BC704700BF10E000E080B582B056\r
+:1012AC0000AF78604FF47A717868FFF7DDFF00BF0C\r
+:1012BC000837BD4680BD000080B485B000AF7860B3\r
+:1012CC000E4B1B68FB60FB687B68B3F1FF3F0CD0D7\r
+:1012DC007B6801337B6008E0084B1B6803F48033A8\r
+:1012EC00002B02D07B68013B7B607B68002BF3D129\r
+:1012FC0000BF1437BD4680BC704700BF10E000E053\r
+:10130C0080B483B000AF7860034A7B68136000BF81\r
+:10131C000C37BD4680BC704708000020002103E05C\r
+:10132C000B4B5B58435004310A480B4B42189A4202\r
+:10133C00F6D30A4A02E0002342F8043B084B9A42D7\r
+:10134C00F9D3FFF763FB00F00FF8FFF7A7F970472D\r
+:10135C0020140008000000200C0000200C000020CD\r
+:10136C002C000020FEE7000070B500250C4E0D4C43\r
+:10137C00A41BA410A54209D100F01AF800250A4EAE\r
+:10138C000A4CA41BA410A54205D170BD56F82530FB\r
+:10139C0098470135EEE756F8253098470135F2E7C6\r
+:1013AC001814000818140008181400081C1400085D\r
+:1013BC00F8B500BFF8BC08BC9E467047F8B500BF36\r
+:0813CC00F8BC08BC9E46704706\r
+:1013D400081C3044586C80004177616974696E67F9\r
+:1013E40020696E7075742E2E2E0A0000763D6451AD\r
+:1013F4007734773957675863510A000000000000BA\r
+:1014040000000000010203040607080900000000B0\r
+:0414140001020304CA\r
+:041418003101000896\r
+:04141C000D010008B6\r
+:0C142000DC130008F01300080024F400A6\r
+:0400000508001329B3\r
+:00000001FF\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/makefile b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/makefile
new file mode 100644 (file)
index 0000000..2712e3e
--- /dev/null
@@ -0,0 +1,56 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+-include ../makefile.init
+
+RM := rm -rf
+
+# All of the sources participating in the build are defined here
+-include sources.mk
+-include startup/subdir.mk
+-include Drivers/STM32F1xx_HAL_Driver/Src/subdir.mk
+-include Core/Src/subdir.mk
+-include subdir.mk
+-include objects.mk
+
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(strip $(S_UPPER_DEPS)),)
+-include $(S_UPPER_DEPS)
+endif
+ifneq ($(strip $(C_DEPS)),)
+-include $(C_DEPS)
+endif
+endif
+
+-include ../makefile.defs
+
+# Add inputs and outputs from these tool invocations to the build variables 
+
+# All Target
+all: ghidra_demo.elf
+
+# Tool invocations
+ghidra_demo.elf: $(OBJS) $(USER_OBJS) ../STM32F103C8Tx_FLASH.ld
+       @echo 'Building target: $@'
+       @echo 'Invoking: MCU GCC Linker'
+       arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -specs=nosys.specs -specs=nano.specs -T"../STM32F103C8Tx_FLASH.ld" -Wl,-Map=output.map -Wl,--gc-sections -o "ghidra_demo.elf" @"objects.list" $(USER_OBJS) $(LIBS) -lm
+       @echo 'Finished building target: $@'
+       @echo ' '
+       $(MAKE) --no-print-directory post-build
+
+# Other Targets
+clean:
+       -$(RM) *
+       -@echo ' '
+
+post-build:
+       -@echo 'Generating hex and Printing size information:'
+       arm-none-eabi-objcopy -O ihex "ghidra_demo.elf" "ghidra_demo.hex"
+       arm-none-eabi-size "ghidra_demo.elf"
+       -@echo ' '
+
+.PHONY: all clean dependents
+.SECONDARY: post-build
+
+-include ../makefile.targets
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/objects.list b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/objects.list
new file mode 100644 (file)
index 0000000..04c5371
--- /dev/null
@@ -0,0 +1,12 @@
+"Core/Src/main.o"
+"Core/Src/stm32f1xx_it.o"
+"Core/Src/syscalls.o"
+"Core/Src/system_stm32f1xx.o"
+"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o"
+"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o"
+"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.o"
+"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.o"
+"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o"
+"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o"
+"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o"
+"startup/startup_stm32f103xb.o"
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/objects.mk b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/objects.mk
new file mode 100644 (file)
index 0000000..742c2da
--- /dev/null
@@ -0,0 +1,8 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+USER_OBJS :=
+
+LIBS :=
+
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/output.map b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/output.map
new file mode 100644 (file)
index 0000000..4599232
--- /dev/null
@@ -0,0 +1,763 @@
+Archive member included to satisfy reference by file (symbol)
+
+/home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-errno.o)
+                              Core/Src/syscalls.o (__errno)
+/home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-exit.o)
+                              /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/crt0.o (exit)
+/home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-impure.o)
+                              /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-exit.o) (_global_impure_ptr)
+/home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-init.o)
+                              /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/crt0.o (__libc_init_array)
+/home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-memset.o)
+                              /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/crt0.o (memset)
+/home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-strlen.o)
+                              Core/Src/main.o (strlen)
+
+Discarded input sections
+
+ .text          0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crti.o
+ .data          0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crti.o
+ .bss           0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crti.o
+ .data          0x0000000000000000        0x4 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtbegin.o
+ .text          0x0000000000000000       0x74 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/crt0.o
+ .data          0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/crt0.o
+ .bss           0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/crt0.o
+ .ARM.extab     0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/crt0.o
+ .ARM.exidx     0x0000000000000000        0x8 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/crt0.o
+ .ARM.attributes
+                0x0000000000000000       0x1b /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/crt0.o
+ .text          0x0000000000000000        0x0 Core/Src/main.o
+ .text.Error_Handler
+                0x0000000000000000        0x8 Core/Src/main.o
+ .text          0x0000000000000000        0x0 Core/Src/stm32f1xx_it.o
+ .data          0x0000000000000000        0x0 Core/Src/stm32f1xx_it.o
+ .bss           0x0000000000000000        0x0 Core/Src/stm32f1xx_it.o
+ .rodata        0x0000000000000000        0x7 Core/Src/stm32f1xx_it.o
+ .text          0x0000000000000000        0x0 Core/Src/syscalls.o
+ .data          0x0000000000000000        0x4 Core/Src/syscalls.o
+ .bss           0x0000000000000000        0x8 Core/Src/syscalls.o
+ .text.initialise_monitor_handles
+                0x0000000000000000        0xc Core/Src/syscalls.o
+ .text._getpid  0x0000000000000000        0xe Core/Src/syscalls.o
+ .text._kill    0x0000000000000000       0x20 Core/Src/syscalls.o
+ .text._exit    0x0000000000000000       0x14 Core/Src/syscalls.o
+ .text._read    0x0000000000000000       0x3a Core/Src/syscalls.o
+ .text._write   0x0000000000000000       0x38 Core/Src/syscalls.o
+ .text._sbrk    0x0000000000000000       0x58 Core/Src/syscalls.o
+ .text._close   0x0000000000000000       0x16 Core/Src/syscalls.o
+ .text._fstat   0x0000000000000000       0x1e Core/Src/syscalls.o
+ .text._isatty  0x0000000000000000       0x14 Core/Src/syscalls.o
+ .text._lseek   0x0000000000000000       0x18 Core/Src/syscalls.o
+ .text._open    0x0000000000000000       0x1a Core/Src/syscalls.o
+ .text._wait    0x0000000000000000       0x1e Core/Src/syscalls.o
+ .text._unlink  0x0000000000000000       0x1e Core/Src/syscalls.o
+ .text._times   0x0000000000000000       0x16 Core/Src/syscalls.o
+ .text._stat    0x0000000000000000       0x1e Core/Src/syscalls.o
+ .text._link    0x0000000000000000       0x20 Core/Src/syscalls.o
+ .text._fork    0x0000000000000000       0x16 Core/Src/syscalls.o
+ .text._execve  0x0000000000000000       0x22 Core/Src/syscalls.o
+ .comment       0x0000000000000000       0x80 Core/Src/syscalls.o
+ .ARM.attributes
+                0x0000000000000000       0x33 Core/Src/syscalls.o
+ .text          0x0000000000000000        0x0 Core/Src/system_stm32f1xx.o
+ .bss           0x0000000000000000        0x0 Core/Src/system_stm32f1xx.o
+ .text.SystemCoreClockUpdate
+                0x0000000000000000       0xd8 Core/Src/system_stm32f1xx.o
+ .text          0x0000000000000000        0x0 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o
+ .data          0x0000000000000000        0x0 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o
+ .bss           0x0000000000000000        0x0 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o
+ .rodata        0x0000000000000000        0x7 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o
+ .text.LL_DMA_ConfigTransfer
+                0x0000000000000000       0x48 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o
+ .text.LL_DMA_SetDataLength
+                0x0000000000000000       0x44 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o
+ .text.LL_DMA_SetMemoryAddress
+                0x0000000000000000       0x30 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o
+ .text.LL_DMA_SetPeriphAddress
+                0x0000000000000000       0x30 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o
+ .text.LL_DMA_ClearFlag_GI1
+                0x0000000000000000       0x18 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o
+ .text.LL_DMA_ClearFlag_GI2
+                0x0000000000000000       0x18 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o
+ .text.LL_DMA_ClearFlag_GI3
+                0x0000000000000000       0x1a Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o
+ .text.LL_DMA_ClearFlag_GI4
+                0x0000000000000000       0x1a Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o
+ .text.LL_DMA_ClearFlag_GI5
+                0x0000000000000000       0x1a Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o
+ .text.LL_DMA_ClearFlag_GI6
+                0x0000000000000000       0x1a Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o
+ .text.LL_DMA_ClearFlag_GI7
+                0x0000000000000000       0x1a Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o
+ .text.LL_DMA_DeInit
+                0x0000000000000000      0x140 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o
+ .text.LL_DMA_Init
+                0x0000000000000000       0x72 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o
+ .text.LL_DMA_StructInit
+                0x0000000000000000       0x4e Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o
+ .comment       0x0000000000000000       0x80 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o
+ .ARM.attributes
+                0x0000000000000000       0x33 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o
+ .text          0x0000000000000000        0x0 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o
+ .data          0x0000000000000000        0x0 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o
+ .bss           0x0000000000000000        0x0 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o
+ .text.LL_EXTI_DeInit
+                0x0000000000000000       0x3c Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o
+ .text.LL_EXTI_StructInit
+                0x0000000000000000       0x2a Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o
+ .text          0x0000000000000000        0x0 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.o
+ .data          0x0000000000000000        0x0 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.o
+ .bss           0x0000000000000000        0x0 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.o
+ .text.LL_APB2_GRP1_ForceReset
+                0x0000000000000000       0x24 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.o
+ .text.LL_APB2_GRP1_ReleaseReset
+                0x0000000000000000       0x24 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.o
+ .text.LL_GPIO_DeInit
+                0x0000000000000000       0x9c Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.o
+ .text.LL_GPIO_StructInit
+                0x0000000000000000       0x32 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.o
+ .text          0x0000000000000000        0x0 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.o
+ .data          0x0000000000000000        0x0 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.o
+ .bss           0x0000000000000000        0x0 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.o
+ .text.LL_APB1_GRP1_ForceReset
+                0x0000000000000000       0x24 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.o
+ .text.LL_APB1_GRP1_ReleaseReset
+                0x0000000000000000       0x24 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.o
+ .text.LL_PWR_DeInit
+                0x0000000000000000       0x1a Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.o
+ .comment       0x0000000000000000       0x80 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.o
+ .ARM.attributes
+                0x0000000000000000       0x33 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.o
+ .text          0x0000000000000000        0x0 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+ .data          0x0000000000000000        0x0 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+ .bss           0x0000000000000000        0x0 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+ .text.LL_RCC_HSI_Enable
+                0x0000000000000000       0x1c Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+ .text.LL_RCC_HSI_IsReady
+                0x0000000000000000       0x24 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+ .text.LL_RCC_HSI_SetCalibTrimming
+                0x0000000000000000       0x28 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+ .text.LL_RCC_SetSysClkSource
+                0x0000000000000000       0x28 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+ .text.LL_RCC_GetUSBClockSource
+                0x0000000000000000       0x20 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+ .text.LL_RCC_GetADCClockSource
+                0x0000000000000000       0x20 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+ .text.LL_RCC_PLL_IsReady
+                0x0000000000000000       0x24 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+ .text.LL_RCC_ClearResetFlags
+                0x0000000000000000       0x1c Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+ .text.LL_RCC_DeInit
+                0x0000000000000000       0x6c Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+ .text.LL_RCC_GetUSBClockFreq
+                0x0000000000000000       0x58 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+ .text.LL_RCC_GetADCClockFreq
+                0x0000000000000000       0x5c Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+ .text          0x0000000000000000        0x0 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o
+ .data          0x0000000000000000        0x0 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o
+ .bss           0x0000000000000000        0x0 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o
+ .text.LL_USART_DisableSCLKOutput
+                0x0000000000000000       0x1e Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o
+ .text.LL_APB1_GRP1_ForceReset
+                0x0000000000000000       0x24 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o
+ .text.LL_APB1_GRP1_ReleaseReset
+                0x0000000000000000       0x24 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o
+ .text.LL_APB2_GRP1_ForceReset
+                0x0000000000000000       0x24 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o
+ .text.LL_APB2_GRP1_ReleaseReset
+                0x0000000000000000       0x24 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o
+ .text.LL_USART_DeInit
+                0x0000000000000000       0x74 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o
+ .text.LL_USART_StructInit
+                0x0000000000000000       0x38 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o
+ .text.LL_USART_ClockInit
+                0x0000000000000000       0x5c Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o
+ .text.LL_USART_ClockStructInit
+                0x0000000000000000       0x2a Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o
+ .text          0x0000000000000000        0x0 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .data          0x0000000000000000        0x0 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .bss           0x0000000000000000        0x0 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.LL_RCC_HSE_EnableBypass
+                0x0000000000000000       0x1c Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.LL_RCC_HSE_DisableBypass
+                0x0000000000000000       0x1c Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.LL_RCC_HSE_Enable
+                0x0000000000000000       0x1c Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.LL_RCC_HSE_IsReady
+                0x0000000000000000       0x24 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.LL_RCC_HSI_Enable
+                0x0000000000000000       0x1c Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.LL_RCC_HSI_IsReady
+                0x0000000000000000       0x24 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.LL_RCC_SetSysClkSource
+                0x0000000000000000       0x28 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.LL_RCC_GetSysClkSource
+                0x0000000000000000       0x18 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.LL_RCC_SetAHBPrescaler
+                0x0000000000000000       0x28 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.LL_RCC_SetAPB1Prescaler
+                0x0000000000000000       0x28 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.LL_RCC_SetAPB2Prescaler
+                0x0000000000000000       0x28 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.LL_RCC_GetAHBPrescaler
+                0x0000000000000000       0x18 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.LL_RCC_PLL_Enable
+                0x0000000000000000       0x1c Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.LL_RCC_PLL_IsReady
+                0x0000000000000000       0x24 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.LL_RCC_PLL_ConfigDomain_SYS
+                0x0000000000000000       0x30 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.LL_FLASH_SetLatency
+                0x0000000000000000       0x28 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.LL_FLASH_GetLatency
+                0x0000000000000000       0x18 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.LL_SetFlashLatency
+                0x0000000000000000       0x8c Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.LL_PLL_ConfigSystemClock_HSI
+                0x0000000000000000       0x74 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.LL_PLL_ConfigSystemClock_HSE
+                0x0000000000000000       0x84 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.UTILS_GetPLLOutputFrequency
+                0x0000000000000000       0x36 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.UTILS_PLL_IsBusy
+                0x0000000000000000       0x22 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.UTILS_EnablePLLAndSwitchSystem
+                0x0000000000000000       0xc4 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text          0x0000000000000000       0x14 startup/startup_stm32f103xb.o
+ .data          0x0000000000000000        0x0 startup/startup_stm32f103xb.o
+ .bss           0x0000000000000000        0x0 startup/startup_stm32f103xb.o
+ .text          0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-errno.o)
+ .data          0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-errno.o)
+ .bss           0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-errno.o)
+ .text.__errno  0x0000000000000000        0xc /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-errno.o)
+ .debug_frame   0x0000000000000000       0x20 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-errno.o)
+ .ARM.attributes
+                0x0000000000000000       0x2d /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-errno.o)
+ .text          0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-exit.o)
+ .data          0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-exit.o)
+ .bss           0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-exit.o)
+ .text.exit     0x0000000000000000       0x28 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-exit.o)
+ .debug_frame   0x0000000000000000       0x28 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-exit.o)
+ .ARM.attributes
+                0x0000000000000000       0x2d /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-exit.o)
+ .text          0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-impure.o)
+ .data          0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-impure.o)
+ .bss           0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-impure.o)
+ .data._impure_ptr
+                0x0000000000000000        0x4 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-impure.o)
+ .data.impure_data
+                0x0000000000000000       0x60 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-impure.o)
+ .rodata._global_impure_ptr
+                0x0000000000000000        0x4 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-impure.o)
+ .ARM.attributes
+                0x0000000000000000       0x2d /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-impure.o)
+ .text          0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-init.o)
+ .data          0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-init.o)
+ .bss           0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-init.o)
+ .text          0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-memset.o)
+ .data          0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-memset.o)
+ .bss           0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-memset.o)
+ .text.memset   0x0000000000000000       0x10 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-memset.o)
+ .debug_frame   0x0000000000000000       0x20 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-memset.o)
+ .ARM.attributes
+                0x0000000000000000       0x2d /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-memset.o)
+ .data          0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-strlen.o)
+ .bss           0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-strlen.o)
+ .text          0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtend.o
+ .data          0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtend.o
+ .bss           0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtend.o
+ .eh_frame      0x0000000000000000        0x4 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtend.o
+ .ARM.attributes
+                0x0000000000000000       0x2d /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtend.o
+ .text          0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtn.o
+ .data          0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtn.o
+ .bss           0x0000000000000000        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtn.o
+
+Memory Configuration
+
+Name             Origin             Length             Attributes
+RAM              0x0000000020000000 0x0000000000005000 xrw
+FLASH            0x0000000008000000 0x0000000000010000 xr
+*default*        0x0000000000000000 0xffffffffffffffff
+
+Linker script and memory map
+
+LOAD /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crti.o
+LOAD /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtbegin.o
+LOAD /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/crt0.o
+LOAD Core/Src/main.o
+LOAD Core/Src/stm32f1xx_it.o
+LOAD Core/Src/syscalls.o
+LOAD Core/Src/system_stm32f1xx.o
+LOAD Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.o
+LOAD Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o
+LOAD Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.o
+LOAD Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.o
+LOAD Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+LOAD Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o
+LOAD Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+LOAD startup/startup_stm32f103xb.o
+LOAD /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libm.a
+START GROUP
+LOAD /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/libgcc.a
+LOAD /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a
+END GROUP
+START GROUP
+LOAD /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/libgcc.a
+LOAD /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a
+LOAD /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libnosys.a
+END GROUP
+START GROUP
+LOAD /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/libgcc.a
+LOAD /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a
+LOAD /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libnosys.a
+END GROUP
+LOAD /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtend.o
+LOAD /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtn.o
+                0x0000000020005000                _estack = 0x20005000
+                0x0000000000000200                _Min_Heap_Size = 0x200
+                0x0000000000000400                _Min_Stack_Size = 0x400
+
+.isr_vector     0x0000000008000000      0x10c
+                0x0000000008000000                . = ALIGN (0x4)
+ *(.isr_vector)
+ .isr_vector    0x0000000008000000      0x10c startup/startup_stm32f103xb.o
+                0x0000000008000000                g_pfnVectors
+                0x000000000800010c                . = ALIGN (0x4)
+
+.text           0x000000000800010c     0x12c8
+                0x000000000800010c                . = ALIGN (0x4)
+ *(.text)
+ .text          0x000000000800010c       0x40 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtbegin.o
+ .text          0x000000000800014c       0x10 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-strlen.o)
+                0x000000000800014c                strlen
+ *(.text*)
+ .text.__NVIC_SetPriorityGrouping
+                0x000000000800015c       0x48 Core/Src/main.o
+ .text.__NVIC_GetPriorityGrouping
+                0x00000000080001a4       0x1c Core/Src/main.o
+ .text.__NVIC_EnableIRQ
+                0x00000000080001c0       0x38 Core/Src/main.o
+ .text.__NVIC_SetPriority
+                0x00000000080001f8       0x54 Core/Src/main.o
+ .text.NVIC_EncodePriority
+                0x000000000800024c       0x64 Core/Src/main.o
+ .text.LL_RCC_HSI_Enable
+                0x00000000080002b0       0x1c Core/Src/main.o
+ .text.LL_RCC_HSI_IsReady
+                0x00000000080002cc       0x24 Core/Src/main.o
+ .text.LL_RCC_HSI_SetCalibTrimming
+                0x00000000080002f0       0x28 Core/Src/main.o
+ .text.LL_RCC_SetSysClkSource
+                0x0000000008000318       0x28 Core/Src/main.o
+ .text.LL_RCC_GetSysClkSource
+                0x0000000008000340       0x18 Core/Src/main.o
+ .text.LL_RCC_SetAHBPrescaler
+                0x0000000008000358       0x28 Core/Src/main.o
+ .text.LL_RCC_SetAPB1Prescaler
+                0x0000000008000380       0x28 Core/Src/main.o
+ .text.LL_RCC_SetAPB2Prescaler
+                0x00000000080003a8       0x28 Core/Src/main.o
+ .text.LL_RCC_PLL_Enable
+                0x00000000080003d0       0x1c Core/Src/main.o
+ .text.LL_RCC_PLL_IsReady
+                0x00000000080003ec       0x24 Core/Src/main.o
+ .text.LL_RCC_PLL_ConfigDomain_SYS
+                0x0000000008000410       0x30 Core/Src/main.o
+ .text.LL_APB1_GRP1_EnableClock
+                0x0000000008000440       0x30 Core/Src/main.o
+ .text.LL_APB2_GRP1_EnableClock
+                0x0000000008000470       0x30 Core/Src/main.o
+ .text.LL_FLASH_SetLatency
+                0x00000000080004a0       0x28 Core/Src/main.o
+ .text.LL_FLASH_GetLatency
+                0x00000000080004c8       0x18 Core/Src/main.o
+ .text.LL_USART_Enable
+                0x00000000080004e0       0x1e Core/Src/main.o
+ .text.LL_USART_ConfigAsyncMode
+                0x00000000080004fe       0x2a Core/Src/main.o
+ .text.LL_USART_IsActiveFlag_TXE
+                0x0000000008000528       0x24 Core/Src/main.o
+ .text.LL_USART_TransmitData8
+                0x000000000800054c       0x1c Core/Src/main.o
+ .text.LL_GPIO_SetPinMode
+                0x0000000008000568       0x64 Core/Src/main.o
+ .text.LL_GPIO_ResetOutputPin
+                0x00000000080005cc       0x1e Core/Src/main.o
+ .text.LL_GPIO_TogglePin
+                0x00000000080005ea       0x38 Core/Src/main.o
+ *fill*         0x0000000008000622        0x2 
+ .text.LL_GPIO_AF_Remap_SWJ_NOJTAG
+                0x0000000008000624       0x28 Core/Src/main.o
+ .text.LL_GPIO_AF_SetEXTISource
+                0x000000000800064c       0x5c Core/Src/main.o
+ .text.main     0x00000000080006a8       0x74 Core/Src/main.o
+                0x00000000080006a8                main
+ .text.SystemClock_Config
+                0x000000000800071c       0x80 Core/Src/main.o
+                0x000000000800071c                SystemClock_Config
+ .text.MX_USART1_UART_Init
+                0x000000000800079c       0xb4 Core/Src/main.o
+ .text.MX_GPIO_Init
+                0x0000000008000850       0xb8 Core/Src/main.o
+ .text.uart_transmit
+                0x0000000008000908       0x54 Core/Src/main.o
+                0x0000000008000908                uart_transmit
+ .text.LL_EXTI_IsActiveFlag_0_31
+                0x000000000800095c       0x2c Core/Src/stm32f1xx_it.o
+ .text.LL_EXTI_ClearFlag_0_31
+                0x0000000008000988       0x1c Core/Src/stm32f1xx_it.o
+ .text.NMI_Handler
+                0x00000000080009a4        0x6 Core/Src/stm32f1xx_it.o
+                0x00000000080009a4                NMI_Handler
+ .text.HardFault_Handler
+                0x00000000080009aa        0x6 Core/Src/stm32f1xx_it.o
+                0x00000000080009aa                HardFault_Handler
+ .text.MemManage_Handler
+                0x00000000080009b0        0x6 Core/Src/stm32f1xx_it.o
+                0x00000000080009b0                MemManage_Handler
+ .text.BusFault_Handler
+                0x00000000080009b6        0x6 Core/Src/stm32f1xx_it.o
+                0x00000000080009b6                BusFault_Handler
+ .text.UsageFault_Handler
+                0x00000000080009bc        0x6 Core/Src/stm32f1xx_it.o
+                0x00000000080009bc                UsageFault_Handler
+ .text.SVC_Handler
+                0x00000000080009c2        0xc Core/Src/stm32f1xx_it.o
+                0x00000000080009c2                SVC_Handler
+ .text.DebugMon_Handler
+                0x00000000080009ce        0xc Core/Src/stm32f1xx_it.o
+                0x00000000080009ce                DebugMon_Handler
+ .text.PendSV_Handler
+                0x00000000080009da        0xc Core/Src/stm32f1xx_it.o
+                0x00000000080009da                PendSV_Handler
+ .text.SysTick_Handler
+                0x00000000080009e6        0xc Core/Src/stm32f1xx_it.o
+                0x00000000080009e6                SysTick_Handler
+ *fill*         0x00000000080009f2        0x2 
+ .text.EXTI2_IRQHandler
+                0x00000000080009f4       0x24 Core/Src/stm32f1xx_it.o
+                0x00000000080009f4                EXTI2_IRQHandler
+ .text.SystemInit
+                0x0000000008000a18        0xc Core/Src/system_stm32f1xx.o
+                0x0000000008000a18                SystemInit
+ .text.LL_EXTI_EnableIT_0_31
+                0x0000000008000a24       0x24 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o
+ .text.LL_EXTI_DisableIT_0_31
+                0x0000000008000a48       0x24 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o
+ .text.LL_EXTI_EnableEvent_0_31
+                0x0000000008000a6c       0x24 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o
+ .text.LL_EXTI_DisableEvent_0_31
+                0x0000000008000a90       0x24 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o
+ .text.LL_EXTI_EnableRisingTrig_0_31
+                0x0000000008000ab4       0x24 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o
+ .text.LL_EXTI_DisableRisingTrig_0_31
+                0x0000000008000ad8       0x24 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o
+ .text.LL_EXTI_EnableFallingTrig_0_31
+                0x0000000008000afc       0x24 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o
+ .text.LL_EXTI_DisableFallingTrig_0_31
+                0x0000000008000b20       0x24 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o
+ .text.LL_EXTI_Init
+                0x0000000008000b44       0xf8 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o
+                0x0000000008000b44                LL_EXTI_Init
+ .text.LL_GPIO_SetPinMode
+                0x0000000008000c3c       0x64 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.o
+ .text.LL_GPIO_SetPinSpeed
+                0x0000000008000ca0       0x64 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.o
+ .text.LL_GPIO_SetPinOutputType
+                0x0000000008000d04       0x64 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.o
+ .text.LL_GPIO_SetPinPull
+                0x0000000008000d68       0x44 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.o
+ .text.LL_GPIO_Init
+                0x0000000008000dac       0xc4 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.o
+                0x0000000008000dac                LL_GPIO_Init
+ .text.LL_RCC_GetSysClkSource
+                0x0000000008000e70       0x18 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+ .text.LL_RCC_GetAHBPrescaler
+                0x0000000008000e88       0x18 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+ .text.LL_RCC_GetAPB1Prescaler
+                0x0000000008000ea0       0x18 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+ .text.LL_RCC_GetAPB2Prescaler
+                0x0000000008000eb8       0x18 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+ .text.LL_RCC_PLL_GetMainSource
+                0x0000000008000ed0       0x18 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+ .text.LL_RCC_PLL_GetMultiplicator
+                0x0000000008000ee8       0x18 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+ .text.LL_RCC_PLL_GetPrediv
+                0x0000000008000f00       0x1c Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+ .text.LL_RCC_GetSystemClocksFreq
+                0x0000000008000f1c       0x4a Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+                0x0000000008000f1c                LL_RCC_GetSystemClocksFreq
+ *fill*         0x0000000008000f66        0x2 
+ .text.RCC_GetSystemClockFreq
+                0x0000000008000f68       0x44 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+                0x0000000008000f68                RCC_GetSystemClockFreq
+ .text.RCC_GetHCLKClockFreq
+                0x0000000008000fac       0x2c Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+                0x0000000008000fac                RCC_GetHCLKClockFreq
+ .text.RCC_GetPCLK1ClockFreq
+                0x0000000008000fd8       0x28 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+                0x0000000008000fd8                RCC_GetPCLK1ClockFreq
+ .text.RCC_GetPCLK2ClockFreq
+                0x0000000008001000       0x28 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+                0x0000000008001000                RCC_GetPCLK2ClockFreq
+ .text.RCC_PLL_GetFreqDomain_SYS
+                0x0000000008001028       0x60 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+                0x0000000008001028                RCC_PLL_GetFreqDomain_SYS
+ .text.LL_USART_IsEnabled
+                0x0000000008001088       0x26 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o
+ .text.LL_USART_SetStopBitsLength
+                0x00000000080010ae       0x24 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o
+ .text.LL_USART_SetHWFlowCtrl
+                0x00000000080010d2       0x24 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o
+ *fill*         0x00000000080010f6        0x2 
+ .text.LL_USART_SetBaudRate
+                0x00000000080010f8       0xbc Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o
+ .text.LL_USART_Init
+                0x00000000080011b4       0xc0 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o
+                0x00000000080011b4                LL_USART_Init
+ .text.LL_InitTick
+                0x0000000008001274       0x34 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .text.LL_Init1msTick
+                0x00000000080012a8       0x1a Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+                0x00000000080012a8                LL_Init1msTick
+ *fill*         0x00000000080012c2        0x2 
+ .text.LL_mDelay
+                0x00000000080012c4       0x48 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+                0x00000000080012c4                LL_mDelay
+ .text.LL_SetSystemCoreClock
+                0x000000000800130c       0x1c Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+                0x000000000800130c                LL_SetSystemCoreClock
+ .text.Reset_Handler
+                0x0000000008001328       0x48 startup/startup_stm32f103xb.o
+                0x0000000008001328                Reset_Handler
+ .text.Default_Handler
+                0x0000000008001370        0x2 startup/startup_stm32f103xb.o
+                0x0000000008001370                RTC_Alarm_IRQHandler
+                0x0000000008001370                TIM1_CC_IRQHandler
+                0x0000000008001370                PVD_IRQHandler
+                0x0000000008001370                EXTI3_IRQHandler
+                0x0000000008001370                EXTI0_IRQHandler
+                0x0000000008001370                I2C2_EV_IRQHandler
+                0x0000000008001370                ADC1_2_IRQHandler
+                0x0000000008001370                SPI1_IRQHandler
+                0x0000000008001370                TAMPER_IRQHandler
+                0x0000000008001370                DMA1_Channel4_IRQHandler
+                0x0000000008001370                USART3_IRQHandler
+                0x0000000008001370                RTC_IRQHandler
+                0x0000000008001370                DMA1_Channel7_IRQHandler
+                0x0000000008001370                CAN1_RX1_IRQHandler
+                0x0000000008001370                TIM4_IRQHandler
+                0x0000000008001370                I2C1_EV_IRQHandler
+                0x0000000008001370                DMA1_Channel6_IRQHandler
+                0x0000000008001370                TIM3_IRQHandler
+                0x0000000008001370                RCC_IRQHandler
+                0x0000000008001370                TIM1_TRG_COM_IRQHandler
+                0x0000000008001370                DMA1_Channel1_IRQHandler
+                0x0000000008001370                Default_Handler
+                0x0000000008001370                EXTI15_10_IRQHandler
+                0x0000000008001370                EXTI9_5_IRQHandler
+                0x0000000008001370                SPI2_IRQHandler
+                0x0000000008001370                DMA1_Channel5_IRQHandler
+                0x0000000008001370                EXTI4_IRQHandler
+                0x0000000008001370                USB_LP_CAN1_RX0_IRQHandler
+                0x0000000008001370                USB_HP_CAN1_TX_IRQHandler
+                0x0000000008001370                DMA1_Channel3_IRQHandler
+                0x0000000008001370                TIM1_UP_IRQHandler
+                0x0000000008001370                WWDG_IRQHandler
+                0x0000000008001370                TIM2_IRQHandler
+                0x0000000008001370                TIM1_BRK_IRQHandler
+                0x0000000008001370                EXTI1_IRQHandler
+                0x0000000008001370                USART2_IRQHandler
+                0x0000000008001370                I2C2_ER_IRQHandler
+                0x0000000008001370                DMA1_Channel2_IRQHandler
+                0x0000000008001370                CAN1_SCE_IRQHandler
+                0x0000000008001370                FLASH_IRQHandler
+                0x0000000008001370                USART1_IRQHandler
+                0x0000000008001370                I2C1_ER_IRQHandler
+                0x0000000008001370                USBWakeUp_IRQHandler
+ *fill*         0x0000000008001372        0x2 
+ .text.__libc_init_array
+                0x0000000008001374       0x48 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-init.o)
+                0x0000000008001374                __libc_init_array
+ *(.glue_7)
+ .glue_7        0x00000000080013bc        0x0 linker stubs
+ *(.glue_7t)
+ .glue_7t       0x00000000080013bc        0x0 linker stubs
+ *(.eh_frame)
+ .eh_frame      0x00000000080013bc        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtbegin.o
+ *(.init)
+ .init          0x00000000080013bc        0x4 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crti.o
+                0x00000000080013bc                _init
+ .init          0x00000000080013c0        0x8 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtn.o
+ *(.fini)
+ .fini          0x00000000080013c8        0x4 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crti.o
+                0x00000000080013c8                _fini
+ .fini          0x00000000080013cc        0x8 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtn.o
+                0x00000000080013d4                . = ALIGN (0x4)
+                0x00000000080013d4                _etext = .
+
+.vfp11_veneer   0x00000000080013d4        0x0
+ .vfp11_veneer  0x00000000080013d4        0x0 linker stubs
+
+.v4_bx          0x00000000080013d4        0x0
+ .v4_bx         0x00000000080013d4        0x0 linker stubs
+
+.iplt           0x00000000080013d4        0x0
+ .iplt          0x00000000080013d4        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtbegin.o
+
+.rodata         0x00000000080013d4       0x44
+                0x00000000080013d4                . = ALIGN (0x4)
+ *(.rodata)
+ .rodata        0x00000000080013d4       0x2b Core/Src/main.o
+ *fill*         0x00000000080013ff        0x1 
+ .rodata        0x0000000008001400       0x18 Core/Src/system_stm32f1xx.o
+                0x0000000008001400                AHBPrescTable
+                0x0000000008001410                APBPrescTable
+ *(.rodata*)
+                0x0000000008001418                . = ALIGN (0x4)
+
+.rel.dyn        0x0000000008001418        0x0
+ .rel.iplt      0x0000000008001418        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtbegin.o
+
+.ARM.extab
+ *(.ARM.extab* .gnu.linkonce.armextab.*)
+
+.ARM            0x0000000008001418        0x0
+                0x0000000008001418                __exidx_start = .
+ *(.ARM.exidx*)
+                0x0000000008001418                __exidx_end = .
+
+.preinit_array  0x0000000008001418        0x0
+                0x0000000008001418                PROVIDE (__preinit_array_start = .)
+ *(.preinit_array*)
+                0x0000000008001418                PROVIDE (__preinit_array_end = .)
+
+.init_array     0x0000000008001418        0x4
+                0x0000000008001418                PROVIDE (__init_array_start = .)
+ *(SORT_BY_NAME(.init_array.*))
+ *(.init_array*)
+ .init_array    0x0000000008001418        0x4 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtbegin.o
+                0x000000000800141c                PROVIDE (__init_array_end = .)
+
+.fini_array     0x000000000800141c        0x4
+                [!provide]                        PROVIDE (__fini_array_start = .)
+ *(SORT_BY_NAME(.fini_array.*))
+ *(.fini_array*)
+ .fini_array    0x000000000800141c        0x4 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtbegin.o
+                [!provide]                        PROVIDE (__fini_array_end = .)
+                0x0000000008001420                _sidata = LOADADDR (.data)
+
+.data           0x0000000020000000        0xc load address 0x0000000008001420
+                0x0000000020000000                . = ALIGN (0x4)
+                0x0000000020000000                _sdata = .
+ *(.data)
+ .data          0x0000000020000000        0x8 Core/Src/main.o
+                0x0000000020000000                wait_str
+                0x0000000020000004                active_str
+ .data          0x0000000020000008        0x4 Core/Src/system_stm32f1xx.o
+                0x0000000020000008                SystemCoreClock
+ *(.data*)
+                0x000000002000000c                . = ALIGN (0x4)
+                0x000000002000000c                _edata = .
+
+.igot.plt       0x000000002000000c        0x0 load address 0x000000000800142c
+ .igot.plt      0x000000002000000c        0x0 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtbegin.o
+                0x000000002000000c                . = ALIGN (0x4)
+
+.bss            0x000000002000000c       0x20 load address 0x000000000800142c
+                0x000000002000000c                _sbss = .
+                0x000000002000000c                __bss_start__ = _sbss
+ *(.bss)
+ .bss           0x000000002000000c       0x1c /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtbegin.o
+ .bss           0x0000000020000028        0x1 Core/Src/main.o
+                0x0000000020000028                activated
+ *(.bss*)
+ *(COMMON)
+                0x000000002000002c                . = ALIGN (0x4)
+ *fill*         0x0000000020000029        0x3 
+                0x000000002000002c                _ebss = .
+                0x000000002000002c                __bss_end__ = _ebss
+
+._user_heap_stack
+                0x000000002000002c      0x604 load address 0x000000000800142c
+                0x0000000020000030                . = ALIGN (0x8)
+ *fill*         0x000000002000002c        0x4 
+                0x0000000020000030                PROVIDE (end = .)
+                [!provide]                        PROVIDE (_end = .)
+                0x0000000020000230                . = (. + _Min_Heap_Size)
+ *fill*         0x0000000020000030      0x200 
+                0x0000000020000630                . = (. + _Min_Stack_Size)
+ *fill*         0x0000000020000230      0x400 
+                0x0000000020000630                . = ALIGN (0x8)
+
+/DISCARD/
+ libc.a(*)
+ libm.a(*)
+ libgcc.a(*)
+
+.ARM.attributes
+                0x0000000000000000       0x29
+ *(.ARM.attributes)
+ .ARM.attributes
+                0x0000000000000000       0x1d /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crti.o
+ .ARM.attributes
+                0x000000000000001d       0x2d /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtbegin.o
+ .ARM.attributes
+                0x000000000000004a       0x33 Core/Src/main.o
+ .ARM.attributes
+                0x000000000000007d       0x33 Core/Src/stm32f1xx_it.o
+ .ARM.attributes
+                0x00000000000000b0       0x33 Core/Src/system_stm32f1xx.o
+ .ARM.attributes
+                0x00000000000000e3       0x33 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o
+ .ARM.attributes
+                0x0000000000000116       0x33 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.o
+ .ARM.attributes
+                0x0000000000000149       0x33 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+ .ARM.attributes
+                0x000000000000017c       0x33 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o
+ .ARM.attributes
+                0x00000000000001af       0x33 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+ .ARM.attributes
+                0x00000000000001e2       0x21 startup/startup_stm32f103xb.o
+ .ARM.attributes
+                0x0000000000000203       0x2d /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-init.o)
+ .ARM.attributes
+                0x0000000000000230       0x17 /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-strlen.o)
+ .ARM.attributes
+                0x0000000000000247       0x1d /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m/crtn.o
+OUTPUT(ghidra_demo.elf elf32-littlearm)
+
+.comment        0x0000000000000000       0x7f
+ .comment       0x0000000000000000       0x7f Core/Src/main.o
+                                         0x80 (size before relaxing)
+ .comment       0x000000000000007f       0x80 Core/Src/stm32f1xx_it.o
+ .comment       0x000000000000007f       0x80 Core/Src/system_stm32f1xx.o
+ .comment       0x000000000000007f       0x80 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.o
+ .comment       0x000000000000007f       0x80 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.o
+ .comment       0x000000000000007f       0x80 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.o
+ .comment       0x000000000000007f       0x80 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.o
+ .comment       0x000000000000007f       0x80 Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.o
+
+.debug_line     0x0000000000000000       0x7d
+ .debug_line    0x0000000000000000       0x7d startup/startup_stm32f103xb.o
+
+.debug_info     0x0000000000000000       0x22
+ .debug_info    0x0000000000000000       0x22 startup/startup_stm32f103xb.o
+
+.debug_abbrev   0x0000000000000000       0x12
+ .debug_abbrev  0x0000000000000000       0x12 startup/startup_stm32f103xb.o
+
+.debug_aranges  0x0000000000000000       0x28
+ .debug_aranges
+                0x0000000000000000       0x28 startup/startup_stm32f103xb.o
+
+.debug_str      0x0000000000000000       0x5e
+ .debug_str     0x0000000000000000       0x5e startup/startup_stm32f103xb.o
+
+.debug_ranges   0x0000000000000000       0x20
+ .debug_ranges  0x0000000000000000       0x20 startup/startup_stm32f103xb.o
+
+.debug_frame    0x0000000000000000       0x2c
+ .debug_frame   0x0000000000000000       0x2c /home/cartogan/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc_nano.a(lib_a-init.o)
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/sources.mk b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/sources.mk
new file mode 100644 (file)
index 0000000..6765975
--- /dev/null
@@ -0,0 +1,21 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+OBJ_SRCS := 
+S_SRCS := 
+ASM_SRCS := 
+C_SRCS := 
+S_UPPER_SRCS := 
+O_SRCS := 
+EXECUTABLES := 
+OBJS := 
+S_UPPER_DEPS := 
+C_DEPS := 
+
+# Every subdirectory with source files must be described here
+SUBDIRS := \
+Core/Src \
+Drivers/STM32F1xx_HAL_Driver/Src \
+startup \
+
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/startup/startup_stm32f103xb.o b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/startup/startup_stm32f103xb.o
new file mode 100644 (file)
index 0000000..36a3ebf
Binary files /dev/null and b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/startup/startup_stm32f103xb.o differ
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/startup/subdir.mk b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Debug/startup/subdir.mk
new file mode 100644 (file)
index 0000000..b95c77b
--- /dev/null
@@ -0,0 +1,22 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+# Add inputs and outputs from these tool invocations to the build variables 
+S_SRCS += \
+../startup/startup_stm32f103xb.s 
+
+OBJS += \
+./startup/startup_stm32f103xb.o 
+
+
+# Each subdirectory must supply rules for building sources it contributes
+startup/%.o: ../startup/%.s
+       @echo 'Building file: $<'
+       @echo 'Invoking: MCU GCC Assembler'
+       @echo $(PWD)
+       arm-none-eabi-as -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -g -o "$@" "$<"
+       @echo 'Finished building: $<'
+       @echo ' '
+
+
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h
new file mode 100644 (file)
index 0000000..9f62fe9
--- /dev/null
@@ -0,0 +1,10234 @@
+/**\r
+  ******************************************************************************\r
+  * @file    stm32f103xb.h\r
+  * @author  MCD Application Team\r
+  * @brief   CMSIS Cortex-M3 Device Peripheral Access Layer Header File. \r
+  *          This file contains all the peripheral register's definitions, bits \r
+  *          definitions and memory mapping for STM32F1xx devices.            \r
+  *            \r
+  *          This file contains:\r
+  *           - Data structures and the address mapping for all peripherals\r
+  *           - Peripheral's registers declarations and bits definition\r
+  *           - Macros to access peripheral\92s registers hardware\r
+  *  \r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+\r
+\r
+/** @addtogroup CMSIS\r
+  * @{\r
+  */\r
+\r
+/** @addtogroup stm32f103xb\r
+  * @{\r
+  */\r
+    \r
+#ifndef __STM32F103xB_H\r
+#define __STM32F103xB_H\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif \r
+\r
+/** @addtogroup Configuration_section_for_CMSIS\r
+  * @{\r
+  */\r
+/**\r
+  * @brief Configuration of the Cortex-M3 Processor and Core Peripherals \r
+ */\r
+#define __CM3_REV                  0x0200U  /*!< Core Revision r2p0                           */\r
+ #define __MPU_PRESENT             0U       /*!< Other STM32 devices does not provide an MPU  */\r
+#define __NVIC_PRIO_BITS           4U       /*!< STM32 uses 4 Bits for the Priority Levels    */\r
+#define __Vendor_SysTickConfig     0U       /*!< Set to 1 if different SysTick Config is used */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @addtogroup Peripheral_interrupt_number_definition\r
+  * @{\r
+  */\r
+\r
+/**\r
+ * @brief STM32F10x Interrupt Number Definition, according to the selected device \r
+ *        in @ref Library_configuration_section \r
+ */\r
+\r
+ /*!< Interrupt Number Definition */\r
+typedef enum\r
+{\r
+/******  Cortex-M3 Processor Exceptions Numbers ***************************************************/\r
+  NonMaskableInt_IRQn         = -14,    /*!< 2 Non Maskable Interrupt                             */\r
+  HardFault_IRQn              = -13,    /*!< 3 Cortex-M3 Hard Fault Interrupt                     */\r
+  MemoryManagement_IRQn       = -12,    /*!< 4 Cortex-M3 Memory Management Interrupt              */\r
+  BusFault_IRQn               = -11,    /*!< 5 Cortex-M3 Bus Fault Interrupt                      */\r
+  UsageFault_IRQn             = -10,    /*!< 6 Cortex-M3 Usage Fault Interrupt                    */\r
+  SVCall_IRQn                 = -5,     /*!< 11 Cortex-M3 SV Call Interrupt                       */\r
+  DebugMonitor_IRQn           = -4,     /*!< 12 Cortex-M3 Debug Monitor Interrupt                 */\r
+  PendSV_IRQn                 = -2,     /*!< 14 Cortex-M3 Pend SV Interrupt                       */\r
+  SysTick_IRQn                = -1,     /*!< 15 Cortex-M3 System Tick Interrupt                   */\r
+\r
+/******  STM32 specific Interrupt Numbers *********************************************************/\r
+  WWDG_IRQn                   = 0,      /*!< Window WatchDog Interrupt                            */\r
+  PVD_IRQn                    = 1,      /*!< PVD through EXTI Line detection Interrupt            */\r
+  TAMPER_IRQn                 = 2,      /*!< Tamper Interrupt                                     */\r
+  RTC_IRQn                    = 3,      /*!< RTC global Interrupt                                 */\r
+  FLASH_IRQn                  = 4,      /*!< FLASH global Interrupt                               */\r
+  RCC_IRQn                    = 5,      /*!< RCC global Interrupt                                 */\r
+  EXTI0_IRQn                  = 6,      /*!< EXTI Line0 Interrupt                                 */\r
+  EXTI1_IRQn                  = 7,      /*!< EXTI Line1 Interrupt                                 */\r
+  EXTI2_IRQn                  = 8,      /*!< EXTI Line2 Interrupt                                 */\r
+  EXTI3_IRQn                  = 9,      /*!< EXTI Line3 Interrupt                                 */\r
+  EXTI4_IRQn                  = 10,     /*!< EXTI Line4 Interrupt                                 */\r
+  DMA1_Channel1_IRQn          = 11,     /*!< DMA1 Channel 1 global Interrupt                      */\r
+  DMA1_Channel2_IRQn          = 12,     /*!< DMA1 Channel 2 global Interrupt                      */\r
+  DMA1_Channel3_IRQn          = 13,     /*!< DMA1 Channel 3 global Interrupt                      */\r
+  DMA1_Channel4_IRQn          = 14,     /*!< DMA1 Channel 4 global Interrupt                      */\r
+  DMA1_Channel5_IRQn          = 15,     /*!< DMA1 Channel 5 global Interrupt                      */\r
+  DMA1_Channel6_IRQn          = 16,     /*!< DMA1 Channel 6 global Interrupt                      */\r
+  DMA1_Channel7_IRQn          = 17,     /*!< DMA1 Channel 7 global Interrupt                      */\r
+  ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */\r
+  USB_HP_CAN1_TX_IRQn         = 19,     /*!< USB Device High Priority or CAN1 TX Interrupts       */\r
+  USB_LP_CAN1_RX0_IRQn        = 20,     /*!< USB Device Low Priority or CAN1 RX0 Interrupts       */\r
+  CAN1_RX1_IRQn               = 21,     /*!< CAN1 RX1 Interrupt                                   */\r
+  CAN1_SCE_IRQn               = 22,     /*!< CAN1 SCE Interrupt                                   */\r
+  EXTI9_5_IRQn                = 23,     /*!< External Line[9:5] Interrupts                        */\r
+  TIM1_BRK_IRQn               = 24,     /*!< TIM1 Break Interrupt                                 */\r
+  TIM1_UP_IRQn                = 25,     /*!< TIM1 Update Interrupt                                */\r
+  TIM1_TRG_COM_IRQn           = 26,     /*!< TIM1 Trigger and Commutation Interrupt               */\r
+  TIM1_CC_IRQn                = 27,     /*!< TIM1 Capture Compare Interrupt                       */\r
+  TIM2_IRQn                   = 28,     /*!< TIM2 global Interrupt                                */\r
+  TIM3_IRQn                   = 29,     /*!< TIM3 global Interrupt                                */\r
+  TIM4_IRQn                   = 30,     /*!< TIM4 global Interrupt                                */\r
+  I2C1_EV_IRQn                = 31,     /*!< I2C1 Event Interrupt                                 */\r
+  I2C1_ER_IRQn                = 32,     /*!< I2C1 Error Interrupt                                 */\r
+  I2C2_EV_IRQn                = 33,     /*!< I2C2 Event Interrupt                                 */\r
+  I2C2_ER_IRQn                = 34,     /*!< I2C2 Error Interrupt                                 */\r
+  SPI1_IRQn                   = 35,     /*!< SPI1 global Interrupt                                */\r
+  SPI2_IRQn                   = 36,     /*!< SPI2 global Interrupt                                */\r
+  USART1_IRQn                 = 37,     /*!< USART1 global Interrupt                              */\r
+  USART2_IRQn                 = 38,     /*!< USART2 global Interrupt                              */\r
+  USART3_IRQn                 = 39,     /*!< USART3 global Interrupt                              */\r
+  EXTI15_10_IRQn              = 40,     /*!< External Line[15:10] Interrupts                      */\r
+  RTC_Alarm_IRQn              = 41,     /*!< RTC Alarm through EXTI Line Interrupt                */\r
+  USBWakeUp_IRQn              = 42,     /*!< USB Device WakeUp from suspend through EXTI Line Interrupt */\r
+} IRQn_Type;\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#include "core_cm3.h"\r
+#include "system_stm32f1xx.h"\r
+#include <stdint.h>\r
+\r
+/** @addtogroup Peripheral_registers_structures\r
+  * @{\r
+  */   \r
+\r
+/** \r
+  * @brief Analog to Digital Converter  \r
+  */\r
+\r
+typedef struct\r
+{\r
+  __IO uint32_t SR;\r
+  __IO uint32_t CR1;\r
+  __IO uint32_t CR2;\r
+  __IO uint32_t SMPR1;\r
+  __IO uint32_t SMPR2;\r
+  __IO uint32_t JOFR1;\r
+  __IO uint32_t JOFR2;\r
+  __IO uint32_t JOFR3;\r
+  __IO uint32_t JOFR4;\r
+  __IO uint32_t HTR;\r
+  __IO uint32_t LTR;\r
+  __IO uint32_t SQR1;\r
+  __IO uint32_t SQR2;\r
+  __IO uint32_t SQR3;\r
+  __IO uint32_t JSQR;\r
+  __IO uint32_t JDR1;\r
+  __IO uint32_t JDR2;\r
+  __IO uint32_t JDR3;\r
+  __IO uint32_t JDR4;\r
+  __IO uint32_t DR;\r
+} ADC_TypeDef;\r
+\r
+typedef struct\r
+{\r
+  __IO uint32_t SR;               /*!< ADC status register,    used for ADC multimode (bits common to several ADC instances). Address offset: ADC1 base address         */\r
+  __IO uint32_t CR1;              /*!< ADC control register 1, used for ADC multimode (bits common to several ADC instances). Address offset: ADC1 base address + 0x04  */\r
+  __IO uint32_t CR2;              /*!< ADC control register 2, used for ADC multimode (bits common to several ADC instances). Address offset: ADC1 base address + 0x08  */\r
+  uint32_t  RESERVED[16];\r
+  __IO uint32_t DR;               /*!< ADC data register,      used for ADC multimode (bits common to several ADC instances). Address offset: ADC1 base address + 0x4C  */\r
+} ADC_Common_TypeDef;\r
+\r
+/** \r
+  * @brief Backup Registers  \r
+  */\r
+\r
+typedef struct\r
+{\r
+  uint32_t  RESERVED0;\r
+  __IO uint32_t DR1;\r
+  __IO uint32_t DR2;\r
+  __IO uint32_t DR3;\r
+  __IO uint32_t DR4;\r
+  __IO uint32_t DR5;\r
+  __IO uint32_t DR6;\r
+  __IO uint32_t DR7;\r
+  __IO uint32_t DR8;\r
+  __IO uint32_t DR9;\r
+  __IO uint32_t DR10;\r
+  __IO uint32_t RTCCR;\r
+  __IO uint32_t CR;\r
+  __IO uint32_t CSR;\r
+} BKP_TypeDef;\r
+  \r
+/** \r
+  * @brief Controller Area Network TxMailBox \r
+  */\r
+\r
+typedef struct\r
+{\r
+  __IO uint32_t TIR;\r
+  __IO uint32_t TDTR;\r
+  __IO uint32_t TDLR;\r
+  __IO uint32_t TDHR;\r
+} CAN_TxMailBox_TypeDef;\r
+\r
+/** \r
+  * @brief Controller Area Network FIFOMailBox \r
+  */\r
+  \r
+typedef struct\r
+{\r
+  __IO uint32_t RIR;\r
+  __IO uint32_t RDTR;\r
+  __IO uint32_t RDLR;\r
+  __IO uint32_t RDHR;\r
+} CAN_FIFOMailBox_TypeDef;\r
+\r
+/** \r
+  * @brief Controller Area Network FilterRegister \r
+  */\r
+  \r
+typedef struct\r
+{\r
+  __IO uint32_t FR1;\r
+  __IO uint32_t FR2;\r
+} CAN_FilterRegister_TypeDef;\r
+\r
+/** \r
+  * @brief Controller Area Network \r
+  */\r
+  \r
+typedef struct\r
+{\r
+  __IO uint32_t MCR;\r
+  __IO uint32_t MSR;\r
+  __IO uint32_t TSR;\r
+  __IO uint32_t RF0R;\r
+  __IO uint32_t RF1R;\r
+  __IO uint32_t IER;\r
+  __IO uint32_t ESR;\r
+  __IO uint32_t BTR;\r
+  uint32_t  RESERVED0[88];\r
+  CAN_TxMailBox_TypeDef sTxMailBox[3];\r
+  CAN_FIFOMailBox_TypeDef sFIFOMailBox[2];\r
+  uint32_t  RESERVED1[12];\r
+  __IO uint32_t FMR;\r
+  __IO uint32_t FM1R;\r
+  uint32_t  RESERVED2;\r
+  __IO uint32_t FS1R;\r
+  uint32_t  RESERVED3;\r
+  __IO uint32_t FFA1R;\r
+  uint32_t  RESERVED4;\r
+  __IO uint32_t FA1R;\r
+  uint32_t  RESERVED5[8];\r
+  CAN_FilterRegister_TypeDef sFilterRegister[14];\r
+} CAN_TypeDef;\r
+\r
+/** \r
+  * @brief CRC calculation unit \r
+  */\r
+\r
+typedef struct\r
+{\r
+  __IO uint32_t DR;           /*!< CRC Data register,                           Address offset: 0x00 */\r
+  __IO uint8_t  IDR;          /*!< CRC Independent data register,               Address offset: 0x04 */\r
+  uint8_t       RESERVED0;    /*!< Reserved,                                    Address offset: 0x05 */\r
+  uint16_t      RESERVED1;    /*!< Reserved,                                    Address offset: 0x06 */  \r
+  __IO uint32_t CR;           /*!< CRC Control register,                        Address offset: 0x08 */ \r
+} CRC_TypeDef;\r
+\r
+\r
+/** \r
+  * @brief Debug MCU\r
+  */\r
+\r
+typedef struct\r
+{\r
+  __IO uint32_t IDCODE;\r
+  __IO uint32_t CR;\r
+}DBGMCU_TypeDef;\r
+\r
+/** \r
+  * @brief DMA Controller\r
+  */\r
+\r
+typedef struct\r
+{\r
+  __IO uint32_t CCR;\r
+  __IO uint32_t CNDTR;\r
+  __IO uint32_t CPAR;\r
+  __IO uint32_t CMAR;\r
+} DMA_Channel_TypeDef;\r
+\r
+typedef struct\r
+{\r
+  __IO uint32_t ISR;\r
+  __IO uint32_t IFCR;\r
+} DMA_TypeDef;\r
+\r
+\r
+\r
+/** \r
+  * @brief External Interrupt/Event Controller\r
+  */\r
+\r
+typedef struct\r
+{\r
+  __IO uint32_t IMR;\r
+  __IO uint32_t EMR;\r
+  __IO uint32_t RTSR;\r
+  __IO uint32_t FTSR;\r
+  __IO uint32_t SWIER;\r
+  __IO uint32_t PR;\r
+} EXTI_TypeDef;\r
+\r
+/** \r
+  * @brief FLASH Registers\r
+  */\r
+\r
+typedef struct\r
+{\r
+  __IO uint32_t ACR;\r
+  __IO uint32_t KEYR;\r
+  __IO uint32_t OPTKEYR;\r
+  __IO uint32_t SR;\r
+  __IO uint32_t CR;\r
+  __IO uint32_t AR;\r
+  __IO uint32_t RESERVED;\r
+  __IO uint32_t OBR;\r
+  __IO uint32_t WRPR;\r
+} FLASH_TypeDef;\r
+\r
+/** \r
+  * @brief Option Bytes Registers\r
+  */\r
+  \r
+typedef struct\r
+{\r
+  __IO uint16_t RDP;\r
+  __IO uint16_t USER;\r
+  __IO uint16_t Data0;\r
+  __IO uint16_t Data1;\r
+  __IO uint16_t WRP0;\r
+  __IO uint16_t WRP1;\r
+  __IO uint16_t WRP2;\r
+  __IO uint16_t WRP3;\r
+} OB_TypeDef;\r
+\r
+/** \r
+  * @brief General Purpose I/O\r
+  */\r
+\r
+typedef struct\r
+{\r
+  __IO uint32_t CRL;\r
+  __IO uint32_t CRH;\r
+  __IO uint32_t IDR;\r
+  __IO uint32_t ODR;\r
+  __IO uint32_t BSRR;\r
+  __IO uint32_t BRR;\r
+  __IO uint32_t LCKR;\r
+} GPIO_TypeDef;\r
+\r
+/** \r
+  * @brief Alternate Function I/O\r
+  */\r
+\r
+typedef struct\r
+{\r
+  __IO uint32_t EVCR;\r
+  __IO uint32_t MAPR;\r
+  __IO uint32_t EXTICR[4];\r
+  uint32_t RESERVED0;\r
+  __IO uint32_t MAPR2;  \r
+} AFIO_TypeDef;\r
+/** \r
+  * @brief Inter Integrated Circuit Interface\r
+  */\r
+\r
+typedef struct\r
+{\r
+  __IO uint32_t CR1;\r
+  __IO uint32_t CR2;\r
+  __IO uint32_t OAR1;\r
+  __IO uint32_t OAR2;\r
+  __IO uint32_t DR;\r
+  __IO uint32_t SR1;\r
+  __IO uint32_t SR2;\r
+  __IO uint32_t CCR;\r
+  __IO uint32_t TRISE;\r
+} I2C_TypeDef;\r
+\r
+/** \r
+  * @brief Independent WATCHDOG\r
+  */\r
+\r
+typedef struct\r
+{\r
+  __IO uint32_t KR;           /*!< Key register,                                Address offset: 0x00 */\r
+  __IO uint32_t PR;           /*!< Prescaler register,                          Address offset: 0x04 */\r
+  __IO uint32_t RLR;          /*!< Reload register,                             Address offset: 0x08 */\r
+  __IO uint32_t SR;           /*!< Status register,                             Address offset: 0x0C */\r
+} IWDG_TypeDef;\r
+\r
+/** \r
+  * @brief Power Control\r
+  */\r
+\r
+typedef struct\r
+{\r
+  __IO uint32_t CR;\r
+  __IO uint32_t CSR;\r
+} PWR_TypeDef;\r
+\r
+/** \r
+  * @brief Reset and Clock Control\r
+  */\r
+\r
+typedef struct\r
+{\r
+  __IO uint32_t CR;\r
+  __IO uint32_t CFGR;\r
+  __IO uint32_t CIR;\r
+  __IO uint32_t APB2RSTR;\r
+  __IO uint32_t APB1RSTR;\r
+  __IO uint32_t AHBENR;\r
+  __IO uint32_t APB2ENR;\r
+  __IO uint32_t APB1ENR;\r
+  __IO uint32_t BDCR;\r
+  __IO uint32_t CSR;\r
+\r
+\r
+} RCC_TypeDef;\r
+\r
+/** \r
+  * @brief Real-Time Clock\r
+  */\r
+\r
+typedef struct\r
+{\r
+  __IO uint32_t CRH;\r
+  __IO uint32_t CRL;\r
+  __IO uint32_t PRLH;\r
+  __IO uint32_t PRLL;\r
+  __IO uint32_t DIVH;\r
+  __IO uint32_t DIVL;\r
+  __IO uint32_t CNTH;\r
+  __IO uint32_t CNTL;\r
+  __IO uint32_t ALRH;\r
+  __IO uint32_t ALRL;\r
+} RTC_TypeDef;\r
+\r
+/** \r
+  * @brief Serial Peripheral Interface\r
+  */\r
+\r
+typedef struct\r
+{\r
+  __IO uint32_t CR1;\r
+  __IO uint32_t CR2;\r
+  __IO uint32_t SR;\r
+  __IO uint32_t DR;\r
+  __IO uint32_t CRCPR;\r
+  __IO uint32_t RXCRCR;\r
+  __IO uint32_t TXCRCR;\r
+  __IO uint32_t I2SCFGR;\r
+} SPI_TypeDef;\r
+\r
+/**\r
+  * @brief TIM Timers\r
+  */\r
+typedef struct\r
+{\r
+  __IO uint32_t CR1;             /*!< TIM control register 1,                      Address offset: 0x00 */\r
+  __IO uint32_t CR2;             /*!< TIM control register 2,                      Address offset: 0x04 */\r
+  __IO uint32_t SMCR;            /*!< TIM slave Mode Control register,             Address offset: 0x08 */\r
+  __IO uint32_t DIER;            /*!< TIM DMA/interrupt enable register,           Address offset: 0x0C */\r
+  __IO uint32_t SR;              /*!< TIM status register,                         Address offset: 0x10 */\r
+  __IO uint32_t EGR;             /*!< TIM event generation register,               Address offset: 0x14 */\r
+  __IO uint32_t CCMR1;           /*!< TIM  capture/compare mode register 1,        Address offset: 0x18 */\r
+  __IO uint32_t CCMR2;           /*!< TIM  capture/compare mode register 2,        Address offset: 0x1C */\r
+  __IO uint32_t CCER;            /*!< TIM capture/compare enable register,         Address offset: 0x20 */\r
+  __IO uint32_t CNT;             /*!< TIM counter register,                        Address offset: 0x24 */\r
+  __IO uint32_t PSC;             /*!< TIM prescaler register,                      Address offset: 0x28 */\r
+  __IO uint32_t ARR;             /*!< TIM auto-reload register,                    Address offset: 0x2C */\r
+  __IO uint32_t RCR;             /*!< TIM  repetition counter register,            Address offset: 0x30 */\r
+  __IO uint32_t CCR1;            /*!< TIM capture/compare register 1,              Address offset: 0x34 */\r
+  __IO uint32_t CCR2;            /*!< TIM capture/compare register 2,              Address offset: 0x38 */\r
+  __IO uint32_t CCR3;            /*!< TIM capture/compare register 3,              Address offset: 0x3C */\r
+  __IO uint32_t CCR4;            /*!< TIM capture/compare register 4,              Address offset: 0x40 */\r
+  __IO uint32_t BDTR;            /*!< TIM break and dead-time register,            Address offset: 0x44 */\r
+  __IO uint32_t DCR;             /*!< TIM DMA control register,                    Address offset: 0x48 */\r
+  __IO uint32_t DMAR;            /*!< TIM DMA address for full transfer register,  Address offset: 0x4C */\r
+  __IO uint32_t OR;              /*!< TIM option register,                         Address offset: 0x50 */\r
+}TIM_TypeDef;\r
+\r
+\r
+/** \r
+  * @brief Universal Synchronous Asynchronous Receiver Transmitter\r
+  */\r
\r
+typedef struct\r
+{\r
+  __IO uint32_t SR;         /*!< USART Status register,                   Address offset: 0x00 */\r
+  __IO uint32_t DR;         /*!< USART Data register,                     Address offset: 0x04 */\r
+  __IO uint32_t BRR;        /*!< USART Baud rate register,                Address offset: 0x08 */\r
+  __IO uint32_t CR1;        /*!< USART Control register 1,                Address offset: 0x0C */\r
+  __IO uint32_t CR2;        /*!< USART Control register 2,                Address offset: 0x10 */\r
+  __IO uint32_t CR3;        /*!< USART Control register 3,                Address offset: 0x14 */\r
+  __IO uint32_t GTPR;       /*!< USART Guard time and prescaler register, Address offset: 0x18 */\r
+} USART_TypeDef;\r
+\r
+/** \r
+  * @brief Universal Serial Bus Full Speed Device\r
+  */\r
+  \r
+typedef struct\r
+{\r
+  __IO uint16_t EP0R;                 /*!< USB Endpoint 0 register,                   Address offset: 0x00 */ \r
+  __IO uint16_t RESERVED0;            /*!< Reserved */     \r
+  __IO uint16_t EP1R;                 /*!< USB Endpoint 1 register,                   Address offset: 0x04 */\r
+  __IO uint16_t RESERVED1;            /*!< Reserved */       \r
+  __IO uint16_t EP2R;                 /*!< USB Endpoint 2 register,                   Address offset: 0x08 */\r
+  __IO uint16_t RESERVED2;            /*!< Reserved */       \r
+  __IO uint16_t EP3R;                 /*!< USB Endpoint 3 register,                   Address offset: 0x0C */ \r
+  __IO uint16_t RESERVED3;            /*!< Reserved */       \r
+  __IO uint16_t EP4R;                 /*!< USB Endpoint 4 register,                   Address offset: 0x10 */\r
+  __IO uint16_t RESERVED4;            /*!< Reserved */       \r
+  __IO uint16_t EP5R;                 /*!< USB Endpoint 5 register,                   Address offset: 0x14 */\r
+  __IO uint16_t RESERVED5;            /*!< Reserved */       \r
+  __IO uint16_t EP6R;                 /*!< USB Endpoint 6 register,                   Address offset: 0x18 */\r
+  __IO uint16_t RESERVED6;            /*!< Reserved */       \r
+  __IO uint16_t EP7R;                 /*!< USB Endpoint 7 register,                   Address offset: 0x1C */\r
+  __IO uint16_t RESERVED7[17];        /*!< Reserved */     \r
+  __IO uint16_t CNTR;                 /*!< Control register,                          Address offset: 0x40 */\r
+  __IO uint16_t RESERVED8;            /*!< Reserved */       \r
+  __IO uint16_t ISTR;                 /*!< Interrupt status register,                 Address offset: 0x44 */\r
+  __IO uint16_t RESERVED9;            /*!< Reserved */       \r
+  __IO uint16_t FNR;                  /*!< Frame number register,                     Address offset: 0x48 */\r
+  __IO uint16_t RESERVEDA;            /*!< Reserved */       \r
+  __IO uint16_t DADDR;                /*!< Device address register,                   Address offset: 0x4C */\r
+  __IO uint16_t RESERVEDB;            /*!< Reserved */       \r
+  __IO uint16_t BTABLE;               /*!< Buffer Table address register,             Address offset: 0x50 */\r
+  __IO uint16_t RESERVEDC;            /*!< Reserved */       \r
+} USB_TypeDef;\r
+\r
+\r
+/** \r
+  * @brief Window WATCHDOG\r
+  */\r
+\r
+typedef struct\r
+{\r
+  __IO uint32_t CR;   /*!< WWDG Control register,       Address offset: 0x00 */\r
+  __IO uint32_t CFR;  /*!< WWDG Configuration register, Address offset: 0x04 */\r
+  __IO uint32_t SR;   /*!< WWDG Status register,        Address offset: 0x08 */\r
+} WWDG_TypeDef;\r
+\r
+/**\r
+  * @}\r
+  */\r
+  \r
+/** @addtogroup Peripheral_memory_map\r
+  * @{\r
+  */\r
+\r
+\r
+#define FLASH_BASE            0x08000000UL /*!< FLASH base address in the alias region */\r
+#define FLASH_BANK1_END       0x0801FFFFUL /*!< FLASH END address of bank1 */\r
+#define SRAM_BASE             0x20000000UL /*!< SRAM base address in the alias region */\r
+#define PERIPH_BASE           0x40000000UL /*!< Peripheral base address in the alias region */\r
+\r
+#define SRAM_BB_BASE          0x22000000UL /*!< SRAM base address in the bit-band region */\r
+#define PERIPH_BB_BASE        0x42000000UL /*!< Peripheral base address in the bit-band region */\r
+\r
+\r
+/*!< Peripheral memory map */\r
+#define APB1PERIPH_BASE       PERIPH_BASE\r
+#define APB2PERIPH_BASE       (PERIPH_BASE + 0x00010000UL)\r
+#define AHBPERIPH_BASE        (PERIPH_BASE + 0x00020000UL)\r
+\r
+#define TIM2_BASE             (APB1PERIPH_BASE + 0x00000000UL)\r
+#define TIM3_BASE             (APB1PERIPH_BASE + 0x00000400UL)\r
+#define TIM4_BASE             (APB1PERIPH_BASE + 0x00000800UL)\r
+#define RTC_BASE              (APB1PERIPH_BASE + 0x00002800UL)\r
+#define WWDG_BASE             (APB1PERIPH_BASE + 0x00002C00UL)\r
+#define IWDG_BASE             (APB1PERIPH_BASE + 0x00003000UL)\r
+#define SPI2_BASE             (APB1PERIPH_BASE + 0x00003800UL)\r
+#define USART2_BASE           (APB1PERIPH_BASE + 0x00004400UL)\r
+#define USART3_BASE           (APB1PERIPH_BASE + 0x00004800UL)\r
+#define I2C1_BASE             (APB1PERIPH_BASE + 0x00005400UL)\r
+#define I2C2_BASE             (APB1PERIPH_BASE + 0x00005800UL)\r
+#define CAN1_BASE             (APB1PERIPH_BASE + 0x00006400UL)\r
+#define BKP_BASE              (APB1PERIPH_BASE + 0x00006C00UL)\r
+#define PWR_BASE              (APB1PERIPH_BASE + 0x00007000UL)\r
+#define AFIO_BASE             (APB2PERIPH_BASE + 0x00000000UL)\r
+#define EXTI_BASE             (APB2PERIPH_BASE + 0x00000400UL)\r
+#define GPIOA_BASE            (APB2PERIPH_BASE + 0x00000800UL)\r
+#define GPIOB_BASE            (APB2PERIPH_BASE + 0x00000C00UL)\r
+#define GPIOC_BASE            (APB2PERIPH_BASE + 0x00001000UL)\r
+#define GPIOD_BASE            (APB2PERIPH_BASE + 0x00001400UL)\r
+#define GPIOE_BASE            (APB2PERIPH_BASE + 0x00001800UL)\r
+#define ADC1_BASE             (APB2PERIPH_BASE + 0x00002400UL)\r
+#define ADC2_BASE             (APB2PERIPH_BASE + 0x00002800UL)\r
+#define TIM1_BASE             (APB2PERIPH_BASE + 0x00002C00UL)\r
+#define SPI1_BASE             (APB2PERIPH_BASE + 0x00003000UL)\r
+#define USART1_BASE           (APB2PERIPH_BASE + 0x00003800UL)\r
+\r
+\r
+#define DMA1_BASE             (AHBPERIPH_BASE + 0x00000000UL)\r
+#define DMA1_Channel1_BASE    (AHBPERIPH_BASE + 0x00000008UL)\r
+#define DMA1_Channel2_BASE    (AHBPERIPH_BASE + 0x0000001CUL)\r
+#define DMA1_Channel3_BASE    (AHBPERIPH_BASE + 0x00000030UL)\r
+#define DMA1_Channel4_BASE    (AHBPERIPH_BASE + 0x00000044UL)\r
+#define DMA1_Channel5_BASE    (AHBPERIPH_BASE + 0x00000058UL)\r
+#define DMA1_Channel6_BASE    (AHBPERIPH_BASE + 0x0000006CUL)\r
+#define DMA1_Channel7_BASE    (AHBPERIPH_BASE + 0x00000080UL)\r
+#define RCC_BASE              (AHBPERIPH_BASE + 0x00001000UL)\r
+#define CRC_BASE              (AHBPERIPH_BASE + 0x00003000UL)\r
+\r
+#define FLASH_R_BASE          (AHBPERIPH_BASE + 0x00002000UL) /*!< Flash registers base address */\r
+#define FLASHSIZE_BASE        0x1FFFF7E0UL    /*!< FLASH Size register base address */\r
+#define UID_BASE              0x1FFFF7E8UL    /*!< Unique device ID register base address */\r
+#define OB_BASE               0x1FFFF800UL    /*!< Flash Option Bytes base address */\r
+\r
+\r
+\r
+#define DBGMCU_BASE          0xE0042000UL /*!< Debug MCU registers base address */\r
+\r
+/* USB device FS */\r
+#define USB_BASE              (APB1PERIPH_BASE + 0x00005C00UL) /*!< USB_IP Peripheral Registers base address */\r
+#define USB_PMAADDR           (APB1PERIPH_BASE + 0x00006000UL) /*!< USB_IP Packet Memory Area base address */\r
+\r
+\r
+/**\r
+  * @}\r
+  */\r
+  \r
+/** @addtogroup Peripheral_declaration\r
+  * @{\r
+  */  \r
+\r
+#define TIM2                ((TIM_TypeDef *)TIM2_BASE)\r
+#define TIM3                ((TIM_TypeDef *)TIM3_BASE)\r
+#define TIM4                ((TIM_TypeDef *)TIM4_BASE)\r
+#define RTC                 ((RTC_TypeDef *)RTC_BASE)\r
+#define WWDG                ((WWDG_TypeDef *)WWDG_BASE)\r
+#define IWDG                ((IWDG_TypeDef *)IWDG_BASE)\r
+#define SPI2                ((SPI_TypeDef *)SPI2_BASE)\r
+#define USART2              ((USART_TypeDef *)USART2_BASE)\r
+#define USART3              ((USART_TypeDef *)USART3_BASE)\r
+#define I2C1                ((I2C_TypeDef *)I2C1_BASE)\r
+#define I2C2                ((I2C_TypeDef *)I2C2_BASE)\r
+#define USB                 ((USB_TypeDef *)USB_BASE)\r
+#define CAN1                ((CAN_TypeDef *)CAN1_BASE)\r
+#define BKP                 ((BKP_TypeDef *)BKP_BASE)\r
+#define PWR                 ((PWR_TypeDef *)PWR_BASE)\r
+#define AFIO                ((AFIO_TypeDef *)AFIO_BASE)\r
+#define EXTI                ((EXTI_TypeDef *)EXTI_BASE)\r
+#define GPIOA               ((GPIO_TypeDef *)GPIOA_BASE)\r
+#define GPIOB               ((GPIO_TypeDef *)GPIOB_BASE)\r
+#define GPIOC               ((GPIO_TypeDef *)GPIOC_BASE)\r
+#define GPIOD               ((GPIO_TypeDef *)GPIOD_BASE)\r
+#define GPIOE               ((GPIO_TypeDef *)GPIOE_BASE)\r
+#define ADC1                ((ADC_TypeDef *)ADC1_BASE)\r
+#define ADC2                ((ADC_TypeDef *)ADC2_BASE)\r
+#define ADC12_COMMON        ((ADC_Common_TypeDef *)ADC1_BASE)\r
+#define TIM1                ((TIM_TypeDef *)TIM1_BASE)\r
+#define SPI1                ((SPI_TypeDef *)SPI1_BASE)\r
+#define USART1              ((USART_TypeDef *)USART1_BASE)\r
+#define DMA1                ((DMA_TypeDef *)DMA1_BASE)\r
+#define DMA1_Channel1       ((DMA_Channel_TypeDef *)DMA1_Channel1_BASE)\r
+#define DMA1_Channel2       ((DMA_Channel_TypeDef *)DMA1_Channel2_BASE)\r
+#define DMA1_Channel3       ((DMA_Channel_TypeDef *)DMA1_Channel3_BASE)\r
+#define DMA1_Channel4       ((DMA_Channel_TypeDef *)DMA1_Channel4_BASE)\r
+#define DMA1_Channel5       ((DMA_Channel_TypeDef *)DMA1_Channel5_BASE)\r
+#define DMA1_Channel6       ((DMA_Channel_TypeDef *)DMA1_Channel6_BASE)\r
+#define DMA1_Channel7       ((DMA_Channel_TypeDef *)DMA1_Channel7_BASE)\r
+#define RCC                 ((RCC_TypeDef *)RCC_BASE)\r
+#define CRC                 ((CRC_TypeDef *)CRC_BASE)\r
+#define FLASH               ((FLASH_TypeDef *)FLASH_R_BASE)\r
+#define OB                  ((OB_TypeDef *)OB_BASE)\r
+#define DBGMCU              ((DBGMCU_TypeDef *)DBGMCU_BASE)\r
+\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @addtogroup Exported_constants\r
+  * @{\r
+  */\r
+  \r
+  /** @addtogroup Peripheral_Registers_Bits_Definition\r
+  * @{\r
+  */\r
+    \r
+/******************************************************************************/\r
+/*                         Peripheral Registers_Bits_Definition               */\r
+/******************************************************************************/\r
+\r
+/******************************************************************************/\r
+/*                                                                            */\r
+/*                       CRC calculation unit (CRC)                           */\r
+/*                                                                            */\r
+/******************************************************************************/\r
+\r
+/*******************  Bit definition for CRC_DR register  *********************/\r
+#define CRC_DR_DR_Pos                       (0U)                               \r
+#define CRC_DR_DR_Msk                       (0xFFFFFFFFUL << CRC_DR_DR_Pos)     /*!< 0xFFFFFFFF */\r
+#define CRC_DR_DR                           CRC_DR_DR_Msk                      /*!< Data register bits */\r
+\r
+/*******************  Bit definition for CRC_IDR register  ********************/\r
+#define CRC_IDR_IDR_Pos                     (0U)                               \r
+#define CRC_IDR_IDR_Msk                     (0xFFUL << CRC_IDR_IDR_Pos)         /*!< 0x000000FF */\r
+#define CRC_IDR_IDR                         CRC_IDR_IDR_Msk                    /*!< General-purpose 8-bit data register bits */\r
+\r
+/********************  Bit definition for CRC_CR register  ********************/\r
+#define CRC_CR_RESET_Pos                    (0U)                               \r
+#define CRC_CR_RESET_Msk                    (0x1UL << CRC_CR_RESET_Pos)         /*!< 0x00000001 */\r
+#define CRC_CR_RESET                        CRC_CR_RESET_Msk                   /*!< RESET bit */\r
+\r
+/******************************************************************************/\r
+/*                                                                            */\r
+/*                             Power Control                                  */\r
+/*                                                                            */\r
+/******************************************************************************/\r
+\r
+/********************  Bit definition for PWR_CR register  ********************/\r
+#define PWR_CR_LPDS_Pos                     (0U)                               \r
+#define PWR_CR_LPDS_Msk                     (0x1UL << PWR_CR_LPDS_Pos)          /*!< 0x00000001 */\r
+#define PWR_CR_LPDS                         PWR_CR_LPDS_Msk                    /*!< Low-Power Deepsleep */\r
+#define PWR_CR_PDDS_Pos                     (1U)                               \r
+#define PWR_CR_PDDS_Msk                     (0x1UL << PWR_CR_PDDS_Pos)          /*!< 0x00000002 */\r
+#define PWR_CR_PDDS                         PWR_CR_PDDS_Msk                    /*!< Power Down Deepsleep */\r
+#define PWR_CR_CWUF_Pos                     (2U)                               \r
+#define PWR_CR_CWUF_Msk                     (0x1UL << PWR_CR_CWUF_Pos)          /*!< 0x00000004 */\r
+#define PWR_CR_CWUF                         PWR_CR_CWUF_Msk                    /*!< Clear Wakeup Flag */\r
+#define PWR_CR_CSBF_Pos                     (3U)                               \r
+#define PWR_CR_CSBF_Msk                     (0x1UL << PWR_CR_CSBF_Pos)          /*!< 0x00000008 */\r
+#define PWR_CR_CSBF                         PWR_CR_CSBF_Msk                    /*!< Clear Standby Flag */\r
+#define PWR_CR_PVDE_Pos                     (4U)                               \r
+#define PWR_CR_PVDE_Msk                     (0x1UL << PWR_CR_PVDE_Pos)          /*!< 0x00000010 */\r
+#define PWR_CR_PVDE                         PWR_CR_PVDE_Msk                    /*!< Power Voltage Detector Enable */\r
+\r
+#define PWR_CR_PLS_Pos                      (5U)                               \r
+#define PWR_CR_PLS_Msk                      (0x7UL << PWR_CR_PLS_Pos)           /*!< 0x000000E0 */\r
+#define PWR_CR_PLS                          PWR_CR_PLS_Msk                     /*!< PLS[2:0] bits (PVD Level Selection) */\r
+#define PWR_CR_PLS_0                        (0x1UL << PWR_CR_PLS_Pos)           /*!< 0x00000020 */\r
+#define PWR_CR_PLS_1                        (0x2UL << PWR_CR_PLS_Pos)           /*!< 0x00000040 */\r
+#define PWR_CR_PLS_2                        (0x4UL << PWR_CR_PLS_Pos)           /*!< 0x00000080 */\r
+\r
+/*!< PVD level configuration */\r
+#define PWR_CR_PLS_LEV0                      0x00000000U                           /*!< PVD level 2.2V */\r
+#define PWR_CR_PLS_LEV1                      0x00000020U                           /*!< PVD level 2.3V */\r
+#define PWR_CR_PLS_LEV2                      0x00000040U                           /*!< PVD level 2.4V */\r
+#define PWR_CR_PLS_LEV3                      0x00000060U                           /*!< PVD level 2.5V */\r
+#define PWR_CR_PLS_LEV4                      0x00000080U                           /*!< PVD level 2.6V */\r
+#define PWR_CR_PLS_LEV5                      0x000000A0U                           /*!< PVD level 2.7V */\r
+#define PWR_CR_PLS_LEV6                      0x000000C0U                           /*!< PVD level 2.8V */\r
+#define PWR_CR_PLS_LEV7                      0x000000E0U                           /*!< PVD level 2.9V */\r
+\r
+/* Legacy defines */\r
+#define PWR_CR_PLS_2V2                       PWR_CR_PLS_LEV0\r
+#define PWR_CR_PLS_2V3                       PWR_CR_PLS_LEV1\r
+#define PWR_CR_PLS_2V4                       PWR_CR_PLS_LEV2\r
+#define PWR_CR_PLS_2V5                       PWR_CR_PLS_LEV3\r
+#define PWR_CR_PLS_2V6                       PWR_CR_PLS_LEV4\r
+#define PWR_CR_PLS_2V7                       PWR_CR_PLS_LEV5\r
+#define PWR_CR_PLS_2V8                       PWR_CR_PLS_LEV6\r
+#define PWR_CR_PLS_2V9                       PWR_CR_PLS_LEV7\r
+\r
+#define PWR_CR_DBP_Pos                      (8U)                               \r
+#define PWR_CR_DBP_Msk                      (0x1UL << PWR_CR_DBP_Pos)           /*!< 0x00000100 */\r
+#define PWR_CR_DBP                          PWR_CR_DBP_Msk                     /*!< Disable Backup Domain write protection */\r
+\r
+\r
+/*******************  Bit definition for PWR_CSR register  ********************/\r
+#define PWR_CSR_WUF_Pos                     (0U)                               \r
+#define PWR_CSR_WUF_Msk                     (0x1UL << PWR_CSR_WUF_Pos)          /*!< 0x00000001 */\r
+#define PWR_CSR_WUF                         PWR_CSR_WUF_Msk                    /*!< Wakeup Flag */\r
+#define PWR_CSR_SBF_Pos                     (1U)                               \r
+#define PWR_CSR_SBF_Msk                     (0x1UL << PWR_CSR_SBF_Pos)          /*!< 0x00000002 */\r
+#define PWR_CSR_SBF                         PWR_CSR_SBF_Msk                    /*!< Standby Flag */\r
+#define PWR_CSR_PVDO_Pos                    (2U)                               \r
+#define PWR_CSR_PVDO_Msk                    (0x1UL << PWR_CSR_PVDO_Pos)         /*!< 0x00000004 */\r
+#define PWR_CSR_PVDO                        PWR_CSR_PVDO_Msk                   /*!< PVD Output */\r
+#define PWR_CSR_EWUP_Pos                    (8U)                               \r
+#define PWR_CSR_EWUP_Msk                    (0x1UL << PWR_CSR_EWUP_Pos)         /*!< 0x00000100 */\r
+#define PWR_CSR_EWUP                        PWR_CSR_EWUP_Msk                   /*!< Enable WKUP pin */\r
+\r
+/******************************************************************************/\r
+/*                                                                            */\r
+/*                            Backup registers                                */\r
+/*                                                                            */\r
+/******************************************************************************/\r
+\r
+/*******************  Bit definition for BKP_DR1 register  ********************/\r
+#define BKP_DR1_D_Pos                       (0U)                               \r
+#define BKP_DR1_D_Msk                       (0xFFFFUL << BKP_DR1_D_Pos)         /*!< 0x0000FFFF */\r
+#define BKP_DR1_D                           BKP_DR1_D_Msk                      /*!< Backup data */\r
+\r
+/*******************  Bit definition for BKP_DR2 register  ********************/\r
+#define BKP_DR2_D_Pos                       (0U)                               \r
+#define BKP_DR2_D_Msk                       (0xFFFFUL << BKP_DR2_D_Pos)         /*!< 0x0000FFFF */\r
+#define BKP_DR2_D                           BKP_DR2_D_Msk                      /*!< Backup data */\r
+\r
+/*******************  Bit definition for BKP_DR3 register  ********************/\r
+#define BKP_DR3_D_Pos                       (0U)                               \r
+#define BKP_DR3_D_Msk                       (0xFFFFUL << BKP_DR3_D_Pos)         /*!< 0x0000FFFF */\r
+#define BKP_DR3_D                           BKP_DR3_D_Msk                      /*!< Backup data */\r
+\r
+/*******************  Bit definition for BKP_DR4 register  ********************/\r
+#define BKP_DR4_D_Pos                       (0U)                               \r
+#define BKP_DR4_D_Msk                       (0xFFFFUL << BKP_DR4_D_Pos)         /*!< 0x0000FFFF */\r
+#define BKP_DR4_D                           BKP_DR4_D_Msk                      /*!< Backup data */\r
+\r
+/*******************  Bit definition for BKP_DR5 register  ********************/\r
+#define BKP_DR5_D_Pos                       (0U)                               \r
+#define BKP_DR5_D_Msk                       (0xFFFFUL << BKP_DR5_D_Pos)         /*!< 0x0000FFFF */\r
+#define BKP_DR5_D                           BKP_DR5_D_Msk                      /*!< Backup data */\r
+\r
+/*******************  Bit definition for BKP_DR6 register  ********************/\r
+#define BKP_DR6_D_Pos                       (0U)                               \r
+#define BKP_DR6_D_Msk                       (0xFFFFUL << BKP_DR6_D_Pos)         /*!< 0x0000FFFF */\r
+#define BKP_DR6_D                           BKP_DR6_D_Msk                      /*!< Backup data */\r
+\r
+/*******************  Bit definition for BKP_DR7 register  ********************/\r
+#define BKP_DR7_D_Pos                       (0U)                               \r
+#define BKP_DR7_D_Msk                       (0xFFFFUL << BKP_DR7_D_Pos)         /*!< 0x0000FFFF */\r
+#define BKP_DR7_D                           BKP_DR7_D_Msk                      /*!< Backup data */\r
+\r
+/*******************  Bit definition for BKP_DR8 register  ********************/\r
+#define BKP_DR8_D_Pos                       (0U)                               \r
+#define BKP_DR8_D_Msk                       (0xFFFFUL << BKP_DR8_D_Pos)         /*!< 0x0000FFFF */\r
+#define BKP_DR8_D                           BKP_DR8_D_Msk                      /*!< Backup data */\r
+\r
+/*******************  Bit definition for BKP_DR9 register  ********************/\r
+#define BKP_DR9_D_Pos                       (0U)                               \r
+#define BKP_DR9_D_Msk                       (0xFFFFUL << BKP_DR9_D_Pos)         /*!< 0x0000FFFF */\r
+#define BKP_DR9_D                           BKP_DR9_D_Msk                      /*!< Backup data */\r
+\r
+/*******************  Bit definition for BKP_DR10 register  *******************/\r
+#define BKP_DR10_D_Pos                      (0U)                               \r
+#define BKP_DR10_D_Msk                      (0xFFFFUL << BKP_DR10_D_Pos)        /*!< 0x0000FFFF */\r
+#define BKP_DR10_D                          BKP_DR10_D_Msk                     /*!< Backup data */\r
+\r
+#define RTC_BKP_NUMBER 10\r
+\r
+/******************  Bit definition for BKP_RTCCR register  *******************/\r
+#define BKP_RTCCR_CAL_Pos                   (0U)                               \r
+#define BKP_RTCCR_CAL_Msk                   (0x7FUL << BKP_RTCCR_CAL_Pos)       /*!< 0x0000007F */\r
+#define BKP_RTCCR_CAL                       BKP_RTCCR_CAL_Msk                  /*!< Calibration value */\r
+#define BKP_RTCCR_CCO_Pos                   (7U)                               \r
+#define BKP_RTCCR_CCO_Msk                   (0x1UL << BKP_RTCCR_CCO_Pos)        /*!< 0x00000080 */\r
+#define BKP_RTCCR_CCO                       BKP_RTCCR_CCO_Msk                  /*!< Calibration Clock Output */\r
+#define BKP_RTCCR_ASOE_Pos                  (8U)                               \r
+#define BKP_RTCCR_ASOE_Msk                  (0x1UL << BKP_RTCCR_ASOE_Pos)       /*!< 0x00000100 */\r
+#define BKP_RTCCR_ASOE                      BKP_RTCCR_ASOE_Msk                 /*!< Alarm or Second Output Enable */\r
+#define BKP_RTCCR_ASOS_Pos                  (9U)                               \r
+#define BKP_RTCCR_ASOS_Msk                  (0x1UL << BKP_RTCCR_ASOS_Pos)       /*!< 0x00000200 */\r
+#define BKP_RTCCR_ASOS                      BKP_RTCCR_ASOS_Msk                 /*!< Alarm or Second Output Selection */\r
+\r
+/********************  Bit definition for BKP_CR register  ********************/\r
+#define BKP_CR_TPE_Pos                      (0U)                               \r
+#define BKP_CR_TPE_Msk                      (0x1UL << BKP_CR_TPE_Pos)           /*!< 0x00000001 */\r
+#define BKP_CR_TPE                          BKP_CR_TPE_Msk                     /*!< TAMPER pin enable */\r
+#define BKP_CR_TPAL_Pos                     (1U)                               \r
+#define BKP_CR_TPAL_Msk                     (0x1UL << BKP_CR_TPAL_Pos)          /*!< 0x00000002 */\r
+#define BKP_CR_TPAL                         BKP_CR_TPAL_Msk                    /*!< TAMPER pin active level */\r
+\r
+/*******************  Bit definition for BKP_CSR register  ********************/\r
+#define BKP_CSR_CTE_Pos                     (0U)                               \r
+#define BKP_CSR_CTE_Msk                     (0x1UL << BKP_CSR_CTE_Pos)          /*!< 0x00000001 */\r
+#define BKP_CSR_CTE                         BKP_CSR_CTE_Msk                    /*!< Clear Tamper event */\r
+#define BKP_CSR_CTI_Pos                     (1U)                               \r
+#define BKP_CSR_CTI_Msk                     (0x1UL << BKP_CSR_CTI_Pos)          /*!< 0x00000002 */\r
+#define BKP_CSR_CTI                         BKP_CSR_CTI_Msk                    /*!< Clear Tamper Interrupt */\r
+#define BKP_CSR_TPIE_Pos                    (2U)                               \r
+#define BKP_CSR_TPIE_Msk                    (0x1UL << BKP_CSR_TPIE_Pos)         /*!< 0x00000004 */\r
+#define BKP_CSR_TPIE                        BKP_CSR_TPIE_Msk                   /*!< TAMPER Pin interrupt enable */\r
+#define BKP_CSR_TEF_Pos                     (8U)                               \r
+#define BKP_CSR_TEF_Msk                     (0x1UL << BKP_CSR_TEF_Pos)          /*!< 0x00000100 */\r
+#define BKP_CSR_TEF                         BKP_CSR_TEF_Msk                    /*!< Tamper Event Flag */\r
+#define BKP_CSR_TIF_Pos                     (9U)                               \r
+#define BKP_CSR_TIF_Msk                     (0x1UL << BKP_CSR_TIF_Pos)          /*!< 0x00000200 */\r
+#define BKP_CSR_TIF                         BKP_CSR_TIF_Msk                    /*!< Tamper Interrupt Flag */\r
+\r
+/******************************************************************************/\r
+/*                                                                            */\r
+/*                         Reset and Clock Control                            */\r
+/*                                                                            */\r
+/******************************************************************************/\r
+\r
+/********************  Bit definition for RCC_CR register  ********************/\r
+#define RCC_CR_HSION_Pos                     (0U)                              \r
+#define RCC_CR_HSION_Msk                     (0x1UL << RCC_CR_HSION_Pos)        /*!< 0x00000001 */\r
+#define RCC_CR_HSION                         RCC_CR_HSION_Msk                  /*!< Internal High Speed clock enable */\r
+#define RCC_CR_HSIRDY_Pos                    (1U)                              \r
+#define RCC_CR_HSIRDY_Msk                    (0x1UL << RCC_CR_HSIRDY_Pos)       /*!< 0x00000002 */\r
+#define RCC_CR_HSIRDY                        RCC_CR_HSIRDY_Msk                 /*!< Internal High Speed clock ready flag */\r
+#define RCC_CR_HSITRIM_Pos                   (3U)                              \r
+#define RCC_CR_HSITRIM_Msk                   (0x1FUL << RCC_CR_HSITRIM_Pos)     /*!< 0x000000F8 */\r
+#define RCC_CR_HSITRIM                       RCC_CR_HSITRIM_Msk                /*!< Internal High Speed clock trimming */\r
+#define RCC_CR_HSICAL_Pos                    (8U)                              \r
+#define RCC_CR_HSICAL_Msk                    (0xFFUL << RCC_CR_HSICAL_Pos)      /*!< 0x0000FF00 */\r
+#define RCC_CR_HSICAL                        RCC_CR_HSICAL_Msk                 /*!< Internal High Speed clock Calibration */\r
+#define RCC_CR_HSEON_Pos                     (16U)                             \r
+#define RCC_CR_HSEON_Msk                     (0x1UL << RCC_CR_HSEON_Pos)        /*!< 0x00010000 */\r
+#define RCC_CR_HSEON                         RCC_CR_HSEON_Msk                  /*!< External High Speed clock enable */\r
+#define RCC_CR_HSERDY_Pos                    (17U)                             \r
+#define RCC_CR_HSERDY_Msk                    (0x1UL << RCC_CR_HSERDY_Pos)       /*!< 0x00020000 */\r
+#define RCC_CR_HSERDY                        RCC_CR_HSERDY_Msk                 /*!< External High Speed clock ready flag */\r
+#define RCC_CR_HSEBYP_Pos                    (18U)                             \r
+#define RCC_CR_HSEBYP_Msk                    (0x1UL << RCC_CR_HSEBYP_Pos)       /*!< 0x00040000 */\r
+#define RCC_CR_HSEBYP                        RCC_CR_HSEBYP_Msk                 /*!< External High Speed clock Bypass */\r
+#define RCC_CR_CSSON_Pos                     (19U)                             \r
+#define RCC_CR_CSSON_Msk                     (0x1UL << RCC_CR_CSSON_Pos)        /*!< 0x00080000 */\r
+#define RCC_CR_CSSON                         RCC_CR_CSSON_Msk                  /*!< Clock Security System enable */\r
+#define RCC_CR_PLLON_Pos                     (24U)                             \r
+#define RCC_CR_PLLON_Msk                     (0x1UL << RCC_CR_PLLON_Pos)        /*!< 0x01000000 */\r
+#define RCC_CR_PLLON                         RCC_CR_PLLON_Msk                  /*!< PLL enable */\r
+#define RCC_CR_PLLRDY_Pos                    (25U)                             \r
+#define RCC_CR_PLLRDY_Msk                    (0x1UL << RCC_CR_PLLRDY_Pos)       /*!< 0x02000000 */\r
+#define RCC_CR_PLLRDY                        RCC_CR_PLLRDY_Msk                 /*!< PLL clock ready flag */\r
+\r
+\r
+/*******************  Bit definition for RCC_CFGR register  *******************/\r
+/*!< SW configuration */\r
+#define RCC_CFGR_SW_Pos                      (0U)                              \r
+#define RCC_CFGR_SW_Msk                      (0x3UL << RCC_CFGR_SW_Pos)         /*!< 0x00000003 */\r
+#define RCC_CFGR_SW                          RCC_CFGR_SW_Msk                   /*!< SW[1:0] bits (System clock Switch) */\r
+#define RCC_CFGR_SW_0                        (0x1UL << RCC_CFGR_SW_Pos)         /*!< 0x00000001 */\r
+#define RCC_CFGR_SW_1                        (0x2UL << RCC_CFGR_SW_Pos)         /*!< 0x00000002 */\r
+\r
+#define RCC_CFGR_SW_HSI                      0x00000000U                       /*!< HSI selected as system clock */\r
+#define RCC_CFGR_SW_HSE                      0x00000001U                       /*!< HSE selected as system clock */\r
+#define RCC_CFGR_SW_PLL                      0x00000002U                       /*!< PLL selected as system clock */\r
+\r
+/*!< SWS configuration */\r
+#define RCC_CFGR_SWS_Pos                     (2U)                              \r
+#define RCC_CFGR_SWS_Msk                     (0x3UL << RCC_CFGR_SWS_Pos)        /*!< 0x0000000C */\r
+#define RCC_CFGR_SWS                         RCC_CFGR_SWS_Msk                  /*!< SWS[1:0] bits (System Clock Switch Status) */\r
+#define RCC_CFGR_SWS_0                       (0x1UL << RCC_CFGR_SWS_Pos)        /*!< 0x00000004 */\r
+#define RCC_CFGR_SWS_1                       (0x2UL << RCC_CFGR_SWS_Pos)        /*!< 0x00000008 */\r
+\r
+#define RCC_CFGR_SWS_HSI                     0x00000000U                       /*!< HSI oscillator used as system clock */\r
+#define RCC_CFGR_SWS_HSE                     0x00000004U                       /*!< HSE oscillator used as system clock */\r
+#define RCC_CFGR_SWS_PLL                     0x00000008U                       /*!< PLL used as system clock */\r
+\r
+/*!< HPRE configuration */\r
+#define RCC_CFGR_HPRE_Pos                    (4U)                              \r
+#define RCC_CFGR_HPRE_Msk                    (0xFUL << RCC_CFGR_HPRE_Pos)       /*!< 0x000000F0 */\r
+#define RCC_CFGR_HPRE                        RCC_CFGR_HPRE_Msk                 /*!< HPRE[3:0] bits (AHB prescaler) */\r
+#define RCC_CFGR_HPRE_0                      (0x1UL << RCC_CFGR_HPRE_Pos)       /*!< 0x00000010 */\r
+#define RCC_CFGR_HPRE_1                      (0x2UL << RCC_CFGR_HPRE_Pos)       /*!< 0x00000020 */\r
+#define RCC_CFGR_HPRE_2                      (0x4UL << RCC_CFGR_HPRE_Pos)       /*!< 0x00000040 */\r
+#define RCC_CFGR_HPRE_3                      (0x8UL << RCC_CFGR_HPRE_Pos)       /*!< 0x00000080 */\r
+\r
+#define RCC_CFGR_HPRE_DIV1                   0x00000000U                       /*!< SYSCLK not divided */\r
+#define RCC_CFGR_HPRE_DIV2                   0x00000080U                       /*!< SYSCLK divided by 2 */\r
+#define RCC_CFGR_HPRE_DIV4                   0x00000090U                       /*!< SYSCLK divided by 4 */\r
+#define RCC_CFGR_HPRE_DIV8                   0x000000A0U                       /*!< SYSCLK divided by 8 */\r
+#define RCC_CFGR_HPRE_DIV16                  0x000000B0U                       /*!< SYSCLK divided by 16 */\r
+#define RCC_CFGR_HPRE_DIV64                  0x000000C0U                       /*!< SYSCLK divided by 64 */\r
+#define RCC_CFGR_HPRE_DIV128                 0x000000D0U                       /*!< SYSCLK divided by 128 */\r
+#define RCC_CFGR_HPRE_DIV256                 0x000000E0U                       /*!< SYSCLK divided by 256 */\r
+#define RCC_CFGR_HPRE_DIV512                 0x000000F0U                       /*!< SYSCLK divided by 512 */\r
+\r
+/*!< PPRE1 configuration */\r
+#define RCC_CFGR_PPRE1_Pos                   (8U)                              \r
+#define RCC_CFGR_PPRE1_Msk                   (0x7UL << RCC_CFGR_PPRE1_Pos)      /*!< 0x00000700 */\r
+#define RCC_CFGR_PPRE1                       RCC_CFGR_PPRE1_Msk                /*!< PRE1[2:0] bits (APB1 prescaler) */\r
+#define RCC_CFGR_PPRE1_0                     (0x1UL << RCC_CFGR_PPRE1_Pos)      /*!< 0x00000100 */\r
+#define RCC_CFGR_PPRE1_1                     (0x2UL << RCC_CFGR_PPRE1_Pos)      /*!< 0x00000200 */\r
+#define RCC_CFGR_PPRE1_2                     (0x4UL << RCC_CFGR_PPRE1_Pos)      /*!< 0x00000400 */\r
+\r
+#define RCC_CFGR_PPRE1_DIV1                  0x00000000U                       /*!< HCLK not divided */\r
+#define RCC_CFGR_PPRE1_DIV2                  0x00000400U                       /*!< HCLK divided by 2 */\r
+#define RCC_CFGR_PPRE1_DIV4                  0x00000500U                       /*!< HCLK divided by 4 */\r
+#define RCC_CFGR_PPRE1_DIV8                  0x00000600U                       /*!< HCLK divided by 8 */\r
+#define RCC_CFGR_PPRE1_DIV16                 0x00000700U                       /*!< HCLK divided by 16 */\r
+\r
+/*!< PPRE2 configuration */\r
+#define RCC_CFGR_PPRE2_Pos                   (11U)                             \r
+#define RCC_CFGR_PPRE2_Msk                   (0x7UL << RCC_CFGR_PPRE2_Pos)      /*!< 0x00003800 */\r
+#define RCC_CFGR_PPRE2                       RCC_CFGR_PPRE2_Msk                /*!< PRE2[2:0] bits (APB2 prescaler) */\r
+#define RCC_CFGR_PPRE2_0                     (0x1UL << RCC_CFGR_PPRE2_Pos)      /*!< 0x00000800 */\r
+#define RCC_CFGR_PPRE2_1                     (0x2UL << RCC_CFGR_PPRE2_Pos)      /*!< 0x00001000 */\r
+#define RCC_CFGR_PPRE2_2                     (0x4UL << RCC_CFGR_PPRE2_Pos)      /*!< 0x00002000 */\r
+\r
+#define RCC_CFGR_PPRE2_DIV1                  0x00000000U                       /*!< HCLK not divided */\r
+#define RCC_CFGR_PPRE2_DIV2                  0x00002000U                       /*!< HCLK divided by 2 */\r
+#define RCC_CFGR_PPRE2_DIV4                  0x00002800U                       /*!< HCLK divided by 4 */\r
+#define RCC_CFGR_PPRE2_DIV8                  0x00003000U                       /*!< HCLK divided by 8 */\r
+#define RCC_CFGR_PPRE2_DIV16                 0x00003800U                       /*!< HCLK divided by 16 */\r
+\r
+/*!< ADCPPRE configuration */\r
+#define RCC_CFGR_ADCPRE_Pos                  (14U)                             \r
+#define RCC_CFGR_ADCPRE_Msk                  (0x3UL << RCC_CFGR_ADCPRE_Pos)     /*!< 0x0000C000 */\r
+#define RCC_CFGR_ADCPRE                      RCC_CFGR_ADCPRE_Msk               /*!< ADCPRE[1:0] bits (ADC prescaler) */\r
+#define RCC_CFGR_ADCPRE_0                    (0x1UL << RCC_CFGR_ADCPRE_Pos)     /*!< 0x00004000 */\r
+#define RCC_CFGR_ADCPRE_1                    (0x2UL << RCC_CFGR_ADCPRE_Pos)     /*!< 0x00008000 */\r
+\r
+#define RCC_CFGR_ADCPRE_DIV2                 0x00000000U                       /*!< PCLK2 divided by 2 */\r
+#define RCC_CFGR_ADCPRE_DIV4                 0x00004000U                       /*!< PCLK2 divided by 4 */\r
+#define RCC_CFGR_ADCPRE_DIV6                 0x00008000U                       /*!< PCLK2 divided by 6 */\r
+#define RCC_CFGR_ADCPRE_DIV8                 0x0000C000U                       /*!< PCLK2 divided by 8 */\r
+\r
+#define RCC_CFGR_PLLSRC_Pos                  (16U)                             \r
+#define RCC_CFGR_PLLSRC_Msk                  (0x1UL << RCC_CFGR_PLLSRC_Pos)     /*!< 0x00010000 */\r
+#define RCC_CFGR_PLLSRC                      RCC_CFGR_PLLSRC_Msk               /*!< PLL entry clock source */\r
+\r
+#define RCC_CFGR_PLLXTPRE_Pos                (17U)                             \r
+#define RCC_CFGR_PLLXTPRE_Msk                (0x1UL << RCC_CFGR_PLLXTPRE_Pos)   /*!< 0x00020000 */\r
+#define RCC_CFGR_PLLXTPRE                    RCC_CFGR_PLLXTPRE_Msk             /*!< HSE divider for PLL entry */\r
+\r
+/*!< PLLMUL configuration */\r
+#define RCC_CFGR_PLLMULL_Pos                 (18U)                             \r
+#define RCC_CFGR_PLLMULL_Msk                 (0xFUL << RCC_CFGR_PLLMULL_Pos)    /*!< 0x003C0000 */\r
+#define RCC_CFGR_PLLMULL                     RCC_CFGR_PLLMULL_Msk              /*!< PLLMUL[3:0] bits (PLL multiplication factor) */\r
+#define RCC_CFGR_PLLMULL_0                   (0x1UL << RCC_CFGR_PLLMULL_Pos)    /*!< 0x00040000 */\r
+#define RCC_CFGR_PLLMULL_1                   (0x2UL << RCC_CFGR_PLLMULL_Pos)    /*!< 0x00080000 */\r
+#define RCC_CFGR_PLLMULL_2                   (0x4UL << RCC_CFGR_PLLMULL_Pos)    /*!< 0x00100000 */\r
+#define RCC_CFGR_PLLMULL_3                   (0x8UL << RCC_CFGR_PLLMULL_Pos)    /*!< 0x00200000 */\r
+\r
+#define RCC_CFGR_PLLXTPRE_HSE                0x00000000U                      /*!< HSE clock not divided for PLL entry */\r
+#define RCC_CFGR_PLLXTPRE_HSE_DIV2           0x00020000U                      /*!< HSE clock divided by 2 for PLL entry */\r
+\r
+#define RCC_CFGR_PLLMULL2                    0x00000000U                       /*!< PLL input clock*2 */\r
+#define RCC_CFGR_PLLMULL3_Pos                (18U)                             \r
+#define RCC_CFGR_PLLMULL3_Msk                (0x1UL << RCC_CFGR_PLLMULL3_Pos)   /*!< 0x00040000 */\r
+#define RCC_CFGR_PLLMULL3                    RCC_CFGR_PLLMULL3_Msk             /*!< PLL input clock*3 */\r
+#define RCC_CFGR_PLLMULL4_Pos                (19U)                             \r
+#define RCC_CFGR_PLLMULL4_Msk                (0x1UL << RCC_CFGR_PLLMULL4_Pos)   /*!< 0x00080000 */\r
+#define RCC_CFGR_PLLMULL4                    RCC_CFGR_PLLMULL4_Msk             /*!< PLL input clock*4 */\r
+#define RCC_CFGR_PLLMULL5_Pos                (18U)                             \r
+#define RCC_CFGR_PLLMULL5_Msk                (0x3UL << RCC_CFGR_PLLMULL5_Pos)   /*!< 0x000C0000 */\r
+#define RCC_CFGR_PLLMULL5                    RCC_CFGR_PLLMULL5_Msk             /*!< PLL input clock*5 */\r
+#define RCC_CFGR_PLLMULL6_Pos                (20U)                             \r
+#define RCC_CFGR_PLLMULL6_Msk                (0x1UL << RCC_CFGR_PLLMULL6_Pos)   /*!< 0x00100000 */\r
+#define RCC_CFGR_PLLMULL6                    RCC_CFGR_PLLMULL6_Msk             /*!< PLL input clock*6 */\r
+#define RCC_CFGR_PLLMULL7_Pos                (18U)                             \r
+#define RCC_CFGR_PLLMULL7_Msk                (0x5UL << RCC_CFGR_PLLMULL7_Pos)   /*!< 0x00140000 */\r
+#define RCC_CFGR_PLLMULL7                    RCC_CFGR_PLLMULL7_Msk             /*!< PLL input clock*7 */\r
+#define RCC_CFGR_PLLMULL8_Pos                (19U)                             \r
+#define RCC_CFGR_PLLMULL8_Msk                (0x3UL << RCC_CFGR_PLLMULL8_Pos)   /*!< 0x00180000 */\r
+#define RCC_CFGR_PLLMULL8                    RCC_CFGR_PLLMULL8_Msk             /*!< PLL input clock*8 */\r
+#define RCC_CFGR_PLLMULL9_Pos                (18U)                             \r
+#define RCC_CFGR_PLLMULL9_Msk                (0x7UL << RCC_CFGR_PLLMULL9_Pos)   /*!< 0x001C0000 */\r
+#define RCC_CFGR_PLLMULL9                    RCC_CFGR_PLLMULL9_Msk             /*!< PLL input clock*9 */\r
+#define RCC_CFGR_PLLMULL10_Pos               (21U)                             \r
+#define RCC_CFGR_PLLMULL10_Msk               (0x1UL << RCC_CFGR_PLLMULL10_Pos)  /*!< 0x00200000 */\r
+#define RCC_CFGR_PLLMULL10                   RCC_CFGR_PLLMULL10_Msk            /*!< PLL input clock10 */\r
+#define RCC_CFGR_PLLMULL11_Pos               (18U)                             \r
+#define RCC_CFGR_PLLMULL11_Msk               (0x9UL << RCC_CFGR_PLLMULL11_Pos)  /*!< 0x00240000 */\r
+#define RCC_CFGR_PLLMULL11                   RCC_CFGR_PLLMULL11_Msk            /*!< PLL input clock*11 */\r
+#define RCC_CFGR_PLLMULL12_Pos               (19U)                             \r
+#define RCC_CFGR_PLLMULL12_Msk               (0x5UL << RCC_CFGR_PLLMULL12_Pos)  /*!< 0x00280000 */\r
+#define RCC_CFGR_PLLMULL12                   RCC_CFGR_PLLMULL12_Msk            /*!< PLL input clock*12 */\r
+#define RCC_CFGR_PLLMULL13_Pos               (18U)                             \r
+#define RCC_CFGR_PLLMULL13_Msk               (0xBUL << RCC_CFGR_PLLMULL13_Pos)  /*!< 0x002C0000 */\r
+#define RCC_CFGR_PLLMULL13                   RCC_CFGR_PLLMULL13_Msk            /*!< PLL input clock*13 */\r
+#define RCC_CFGR_PLLMULL14_Pos               (20U)                             \r
+#define RCC_CFGR_PLLMULL14_Msk               (0x3UL << RCC_CFGR_PLLMULL14_Pos)  /*!< 0x00300000 */\r
+#define RCC_CFGR_PLLMULL14                   RCC_CFGR_PLLMULL14_Msk            /*!< PLL input clock*14 */\r
+#define RCC_CFGR_PLLMULL15_Pos               (18U)                             \r
+#define RCC_CFGR_PLLMULL15_Msk               (0xDUL << RCC_CFGR_PLLMULL15_Pos)  /*!< 0x00340000 */\r
+#define RCC_CFGR_PLLMULL15                   RCC_CFGR_PLLMULL15_Msk            /*!< PLL input clock*15 */\r
+#define RCC_CFGR_PLLMULL16_Pos               (19U)                             \r
+#define RCC_CFGR_PLLMULL16_Msk               (0x7UL << RCC_CFGR_PLLMULL16_Pos)  /*!< 0x00380000 */\r
+#define RCC_CFGR_PLLMULL16                   RCC_CFGR_PLLMULL16_Msk            /*!< PLL input clock*16 */\r
+#define RCC_CFGR_USBPRE_Pos                  (22U)                             \r
+#define RCC_CFGR_USBPRE_Msk                  (0x1UL << RCC_CFGR_USBPRE_Pos)     /*!< 0x00400000 */\r
+#define RCC_CFGR_USBPRE                      RCC_CFGR_USBPRE_Msk               /*!< USB Device prescaler */\r
+\r
+/*!< MCO configuration */\r
+#define RCC_CFGR_MCO_Pos                     (24U)                             \r
+#define RCC_CFGR_MCO_Msk                     (0x7UL << RCC_CFGR_MCO_Pos)        /*!< 0x07000000 */\r
+#define RCC_CFGR_MCO                         RCC_CFGR_MCO_Msk                  /*!< MCO[2:0] bits (Microcontroller Clock Output) */\r
+#define RCC_CFGR_MCO_0                       (0x1UL << RCC_CFGR_MCO_Pos)        /*!< 0x01000000 */\r
+#define RCC_CFGR_MCO_1                       (0x2UL << RCC_CFGR_MCO_Pos)        /*!< 0x02000000 */\r
+#define RCC_CFGR_MCO_2                       (0x4UL << RCC_CFGR_MCO_Pos)        /*!< 0x04000000 */\r
+\r
+#define RCC_CFGR_MCO_NOCLOCK                 0x00000000U                        /*!< No clock */\r
+#define RCC_CFGR_MCO_SYSCLK                  0x04000000U                        /*!< System clock selected as MCO source */\r
+#define RCC_CFGR_MCO_HSI                     0x05000000U                        /*!< HSI clock selected as MCO source */\r
+#define RCC_CFGR_MCO_HSE                     0x06000000U                        /*!< HSE clock selected as MCO source  */\r
+#define RCC_CFGR_MCO_PLLCLK_DIV2             0x07000000U                        /*!< PLL clock divided by 2 selected as MCO source */\r
+\r
+ /* Reference defines */\r
+ #define RCC_CFGR_MCOSEL                      RCC_CFGR_MCO\r
+ #define RCC_CFGR_MCOSEL_0                    RCC_CFGR_MCO_0\r
+ #define RCC_CFGR_MCOSEL_1                    RCC_CFGR_MCO_1\r
+ #define RCC_CFGR_MCOSEL_2                    RCC_CFGR_MCO_2\r
+ #define RCC_CFGR_MCOSEL_NOCLOCK              RCC_CFGR_MCO_NOCLOCK\r
+ #define RCC_CFGR_MCOSEL_SYSCLK               RCC_CFGR_MCO_SYSCLK\r
+ #define RCC_CFGR_MCOSEL_HSI                  RCC_CFGR_MCO_HSI\r
+ #define RCC_CFGR_MCOSEL_HSE                  RCC_CFGR_MCO_HSE\r
+ #define RCC_CFGR_MCOSEL_PLL_DIV2             RCC_CFGR_MCO_PLLCLK_DIV2\r
+\r
+/*!<******************  Bit definition for RCC_CIR register  ********************/\r
+#define RCC_CIR_LSIRDYF_Pos                  (0U)                              \r
+#define RCC_CIR_LSIRDYF_Msk                  (0x1UL << RCC_CIR_LSIRDYF_Pos)     /*!< 0x00000001 */\r
+#define RCC_CIR_LSIRDYF                      RCC_CIR_LSIRDYF_Msk               /*!< LSI Ready Interrupt flag */\r
+#define RCC_CIR_LSERDYF_Pos                  (1U)                              \r
+#define RCC_CIR_LSERDYF_Msk                  (0x1UL << RCC_CIR_LSERDYF_Pos)     /*!< 0x00000002 */\r
+#define RCC_CIR_LSERDYF                      RCC_CIR_LSERDYF_Msk               /*!< LSE Ready Interrupt flag */\r
+#define RCC_CIR_HSIRDYF_Pos                  (2U)                              \r
+#define RCC_CIR_HSIRDYF_Msk                  (0x1UL << RCC_CIR_HSIRDYF_Pos)     /*!< 0x00000004 */\r
+#define RCC_CIR_HSIRDYF                      RCC_CIR_HSIRDYF_Msk               /*!< HSI Ready Interrupt flag */\r
+#define RCC_CIR_HSERDYF_Pos                  (3U)                              \r
+#define RCC_CIR_HSERDYF_Msk                  (0x1UL << RCC_CIR_HSERDYF_Pos)     /*!< 0x00000008 */\r
+#define RCC_CIR_HSERDYF                      RCC_CIR_HSERDYF_Msk               /*!< HSE Ready Interrupt flag */\r
+#define RCC_CIR_PLLRDYF_Pos                  (4U)                              \r
+#define RCC_CIR_PLLRDYF_Msk                  (0x1UL << RCC_CIR_PLLRDYF_Pos)     /*!< 0x00000010 */\r
+#define RCC_CIR_PLLRDYF                      RCC_CIR_PLLRDYF_Msk               /*!< PLL Ready Interrupt flag */\r
+#define RCC_CIR_CSSF_Pos                     (7U)                              \r
+#define RCC_CIR_CSSF_Msk                     (0x1UL << RCC_CIR_CSSF_Pos)        /*!< 0x00000080 */\r
+#define RCC_CIR_CSSF                         RCC_CIR_CSSF_Msk                  /*!< Clock Security System Interrupt flag */\r
+#define RCC_CIR_LSIRDYIE_Pos                 (8U)                              \r
+#define RCC_CIR_LSIRDYIE_Msk                 (0x1UL << RCC_CIR_LSIRDYIE_Pos)    /*!< 0x00000100 */\r
+#define RCC_CIR_LSIRDYIE                     RCC_CIR_LSIRDYIE_Msk              /*!< LSI Ready Interrupt Enable */\r
+#define RCC_CIR_LSERDYIE_Pos                 (9U)                              \r
+#define RCC_CIR_LSERDYIE_Msk                 (0x1UL << RCC_CIR_LSERDYIE_Pos)    /*!< 0x00000200 */\r
+#define RCC_CIR_LSERDYIE                     RCC_CIR_LSERDYIE_Msk              /*!< LSE Ready Interrupt Enable */\r
+#define RCC_CIR_HSIRDYIE_Pos                 (10U)                             \r
+#define RCC_CIR_HSIRDYIE_Msk                 (0x1UL << RCC_CIR_HSIRDYIE_Pos)    /*!< 0x00000400 */\r
+#define RCC_CIR_HSIRDYIE                     RCC_CIR_HSIRDYIE_Msk              /*!< HSI Ready Interrupt Enable */\r
+#define RCC_CIR_HSERDYIE_Pos                 (11U)                             \r
+#define RCC_CIR_HSERDYIE_Msk                 (0x1UL << RCC_CIR_HSERDYIE_Pos)    /*!< 0x00000800 */\r
+#define RCC_CIR_HSERDYIE                     RCC_CIR_HSERDYIE_Msk              /*!< HSE Ready Interrupt Enable */\r
+#define RCC_CIR_PLLRDYIE_Pos                 (12U)                             \r
+#define RCC_CIR_PLLRDYIE_Msk                 (0x1UL << RCC_CIR_PLLRDYIE_Pos)    /*!< 0x00001000 */\r
+#define RCC_CIR_PLLRDYIE                     RCC_CIR_PLLRDYIE_Msk              /*!< PLL Ready Interrupt Enable */\r
+#define RCC_CIR_LSIRDYC_Pos                  (16U)                             \r
+#define RCC_CIR_LSIRDYC_Msk                  (0x1UL << RCC_CIR_LSIRDYC_Pos)     /*!< 0x00010000 */\r
+#define RCC_CIR_LSIRDYC                      RCC_CIR_LSIRDYC_Msk               /*!< LSI Ready Interrupt Clear */\r
+#define RCC_CIR_LSERDYC_Pos                  (17U)                             \r
+#define RCC_CIR_LSERDYC_Msk                  (0x1UL << RCC_CIR_LSERDYC_Pos)     /*!< 0x00020000 */\r
+#define RCC_CIR_LSERDYC                      RCC_CIR_LSERDYC_Msk               /*!< LSE Ready Interrupt Clear */\r
+#define RCC_CIR_HSIRDYC_Pos                  (18U)                             \r
+#define RCC_CIR_HSIRDYC_Msk                  (0x1UL << RCC_CIR_HSIRDYC_Pos)     /*!< 0x00040000 */\r
+#define RCC_CIR_HSIRDYC                      RCC_CIR_HSIRDYC_Msk               /*!< HSI Ready Interrupt Clear */\r
+#define RCC_CIR_HSERDYC_Pos                  (19U)                             \r
+#define RCC_CIR_HSERDYC_Msk                  (0x1UL << RCC_CIR_HSERDYC_Pos)     /*!< 0x00080000 */\r
+#define RCC_CIR_HSERDYC                      RCC_CIR_HSERDYC_Msk               /*!< HSE Ready Interrupt Clear */\r
+#define RCC_CIR_PLLRDYC_Pos                  (20U)                             \r
+#define RCC_CIR_PLLRDYC_Msk                  (0x1UL << RCC_CIR_PLLRDYC_Pos)     /*!< 0x00100000 */\r
+#define RCC_CIR_PLLRDYC                      RCC_CIR_PLLRDYC_Msk               /*!< PLL Ready Interrupt Clear */\r
+#define RCC_CIR_CSSC_Pos                     (23U)                             \r
+#define RCC_CIR_CSSC_Msk                     (0x1UL << RCC_CIR_CSSC_Pos)        /*!< 0x00800000 */\r
+#define RCC_CIR_CSSC                         RCC_CIR_CSSC_Msk                  /*!< Clock Security System Interrupt Clear */\r
+\r
+\r
+/*****************  Bit definition for RCC_APB2RSTR register  *****************/\r
+#define RCC_APB2RSTR_AFIORST_Pos             (0U)                              \r
+#define RCC_APB2RSTR_AFIORST_Msk             (0x1UL << RCC_APB2RSTR_AFIORST_Pos) /*!< 0x00000001 */\r
+#define RCC_APB2RSTR_AFIORST                 RCC_APB2RSTR_AFIORST_Msk          /*!< Alternate Function I/O reset */\r
+#define RCC_APB2RSTR_IOPARST_Pos             (2U)                              \r
+#define RCC_APB2RSTR_IOPARST_Msk             (0x1UL << RCC_APB2RSTR_IOPARST_Pos) /*!< 0x00000004 */\r
+#define RCC_APB2RSTR_IOPARST                 RCC_APB2RSTR_IOPARST_Msk          /*!< I/O port A reset */\r
+#define RCC_APB2RSTR_IOPBRST_Pos             (3U)                              \r
+#define RCC_APB2RSTR_IOPBRST_Msk             (0x1UL << RCC_APB2RSTR_IOPBRST_Pos) /*!< 0x00000008 */\r
+#define RCC_APB2RSTR_IOPBRST                 RCC_APB2RSTR_IOPBRST_Msk          /*!< I/O port B reset */\r
+#define RCC_APB2RSTR_IOPCRST_Pos             (4U)                              \r
+#define RCC_APB2RSTR_IOPCRST_Msk             (0x1UL << RCC_APB2RSTR_IOPCRST_Pos) /*!< 0x00000010 */\r
+#define RCC_APB2RSTR_IOPCRST                 RCC_APB2RSTR_IOPCRST_Msk          /*!< I/O port C reset */\r
+#define RCC_APB2RSTR_IOPDRST_Pos             (5U)                              \r
+#define RCC_APB2RSTR_IOPDRST_Msk             (0x1UL << RCC_APB2RSTR_IOPDRST_Pos) /*!< 0x00000020 */\r
+#define RCC_APB2RSTR_IOPDRST                 RCC_APB2RSTR_IOPDRST_Msk          /*!< I/O port D reset */\r
+#define RCC_APB2RSTR_ADC1RST_Pos             (9U)                              \r
+#define RCC_APB2RSTR_ADC1RST_Msk             (0x1UL << RCC_APB2RSTR_ADC1RST_Pos) /*!< 0x00000200 */\r
+#define RCC_APB2RSTR_ADC1RST                 RCC_APB2RSTR_ADC1RST_Msk          /*!< ADC 1 interface reset */\r
+\r
+#define RCC_APB2RSTR_ADC2RST_Pos             (10U)                             \r
+#define RCC_APB2RSTR_ADC2RST_Msk             (0x1UL << RCC_APB2RSTR_ADC2RST_Pos) /*!< 0x00000400 */\r
+#define RCC_APB2RSTR_ADC2RST                 RCC_APB2RSTR_ADC2RST_Msk          /*!< ADC 2 interface reset */\r
+\r
+#define RCC_APB2RSTR_TIM1RST_Pos             (11U)                             \r
+#define RCC_APB2RSTR_TIM1RST_Msk             (0x1UL << RCC_APB2RSTR_TIM1RST_Pos) /*!< 0x00000800 */\r
+#define RCC_APB2RSTR_TIM1RST                 RCC_APB2RSTR_TIM1RST_Msk          /*!< TIM1 Timer reset */\r
+#define RCC_APB2RSTR_SPI1RST_Pos             (12U)                             \r
+#define RCC_APB2RSTR_SPI1RST_Msk             (0x1UL << RCC_APB2RSTR_SPI1RST_Pos) /*!< 0x00001000 */\r
+#define RCC_APB2RSTR_SPI1RST                 RCC_APB2RSTR_SPI1RST_Msk          /*!< SPI 1 reset */\r
+#define RCC_APB2RSTR_USART1RST_Pos           (14U)                             \r
+#define RCC_APB2RSTR_USART1RST_Msk           (0x1UL << RCC_APB2RSTR_USART1RST_Pos) /*!< 0x00004000 */\r
+#define RCC_APB2RSTR_USART1RST               RCC_APB2RSTR_USART1RST_Msk        /*!< USART1 reset */\r
+\r
+\r
+#define RCC_APB2RSTR_IOPERST_Pos             (6U)                              \r
+#define RCC_APB2RSTR_IOPERST_Msk             (0x1UL << RCC_APB2RSTR_IOPERST_Pos) /*!< 0x00000040 */\r
+#define RCC_APB2RSTR_IOPERST                 RCC_APB2RSTR_IOPERST_Msk          /*!< I/O port E reset */\r
+\r
+\r
+\r
+\r
+/*****************  Bit definition for RCC_APB1RSTR register  *****************/\r
+#define RCC_APB1RSTR_TIM2RST_Pos             (0U)                              \r
+#define RCC_APB1RSTR_TIM2RST_Msk             (0x1UL << RCC_APB1RSTR_TIM2RST_Pos) /*!< 0x00000001 */\r
+#define RCC_APB1RSTR_TIM2RST                 RCC_APB1RSTR_TIM2RST_Msk          /*!< Timer 2 reset */\r
+#define RCC_APB1RSTR_TIM3RST_Pos             (1U)                              \r
+#define RCC_APB1RSTR_TIM3RST_Msk             (0x1UL << RCC_APB1RSTR_TIM3RST_Pos) /*!< 0x00000002 */\r
+#define RCC_APB1RSTR_TIM3RST                 RCC_APB1RSTR_TIM3RST_Msk          /*!< Timer 3 reset */\r
+#define RCC_APB1RSTR_WWDGRST_Pos             (11U)                             \r
+#define RCC_APB1RSTR_WWDGRST_Msk             (0x1UL << RCC_APB1RSTR_WWDGRST_Pos) /*!< 0x00000800 */\r
+#define RCC_APB1RSTR_WWDGRST                 RCC_APB1RSTR_WWDGRST_Msk          /*!< Window Watchdog reset */\r
+#define RCC_APB1RSTR_USART2RST_Pos           (17U)                             \r
+#define RCC_APB1RSTR_USART2RST_Msk           (0x1UL << RCC_APB1RSTR_USART2RST_Pos) /*!< 0x00020000 */\r
+#define RCC_APB1RSTR_USART2RST               RCC_APB1RSTR_USART2RST_Msk        /*!< USART 2 reset */\r
+#define RCC_APB1RSTR_I2C1RST_Pos             (21U)                             \r
+#define RCC_APB1RSTR_I2C1RST_Msk             (0x1UL << RCC_APB1RSTR_I2C1RST_Pos) /*!< 0x00200000 */\r
+#define RCC_APB1RSTR_I2C1RST                 RCC_APB1RSTR_I2C1RST_Msk          /*!< I2C 1 reset */\r
+\r
+#define RCC_APB1RSTR_CAN1RST_Pos             (25U)                             \r
+#define RCC_APB1RSTR_CAN1RST_Msk             (0x1UL << RCC_APB1RSTR_CAN1RST_Pos) /*!< 0x02000000 */\r
+#define RCC_APB1RSTR_CAN1RST                 RCC_APB1RSTR_CAN1RST_Msk          /*!< CAN1 reset */\r
+\r
+#define RCC_APB1RSTR_BKPRST_Pos              (27U)                             \r
+#define RCC_APB1RSTR_BKPRST_Msk              (0x1UL << RCC_APB1RSTR_BKPRST_Pos) /*!< 0x08000000 */\r
+#define RCC_APB1RSTR_BKPRST                  RCC_APB1RSTR_BKPRST_Msk           /*!< Backup interface reset */\r
+#define RCC_APB1RSTR_PWRRST_Pos              (28U)                             \r
+#define RCC_APB1RSTR_PWRRST_Msk              (0x1UL << RCC_APB1RSTR_PWRRST_Pos) /*!< 0x10000000 */\r
+#define RCC_APB1RSTR_PWRRST                  RCC_APB1RSTR_PWRRST_Msk           /*!< Power interface reset */\r
+\r
+#define RCC_APB1RSTR_TIM4RST_Pos             (2U)                              \r
+#define RCC_APB1RSTR_TIM4RST_Msk             (0x1UL << RCC_APB1RSTR_TIM4RST_Pos) /*!< 0x00000004 */\r
+#define RCC_APB1RSTR_TIM4RST                 RCC_APB1RSTR_TIM4RST_Msk          /*!< Timer 4 reset */\r
+#define RCC_APB1RSTR_SPI2RST_Pos             (14U)                             \r
+#define RCC_APB1RSTR_SPI2RST_Msk             (0x1UL << RCC_APB1RSTR_SPI2RST_Pos) /*!< 0x00004000 */\r
+#define RCC_APB1RSTR_SPI2RST                 RCC_APB1RSTR_SPI2RST_Msk          /*!< SPI 2 reset */\r
+#define RCC_APB1RSTR_USART3RST_Pos           (18U)                             \r
+#define RCC_APB1RSTR_USART3RST_Msk           (0x1UL << RCC_APB1RSTR_USART3RST_Pos) /*!< 0x00040000 */\r
+#define RCC_APB1RSTR_USART3RST               RCC_APB1RSTR_USART3RST_Msk        /*!< USART 3 reset */\r
+#define RCC_APB1RSTR_I2C2RST_Pos             (22U)                             \r
+#define RCC_APB1RSTR_I2C2RST_Msk             (0x1UL << RCC_APB1RSTR_I2C2RST_Pos) /*!< 0x00400000 */\r
+#define RCC_APB1RSTR_I2C2RST                 RCC_APB1RSTR_I2C2RST_Msk          /*!< I2C 2 reset */\r
+\r
+#define RCC_APB1RSTR_USBRST_Pos              (23U)                             \r
+#define RCC_APB1RSTR_USBRST_Msk              (0x1UL << RCC_APB1RSTR_USBRST_Pos) /*!< 0x00800000 */\r
+#define RCC_APB1RSTR_USBRST                  RCC_APB1RSTR_USBRST_Msk           /*!< USB Device reset */\r
+\r
+\r
+\r
+\r
+\r
+\r
+/******************  Bit definition for RCC_AHBENR register  ******************/\r
+#define RCC_AHBENR_DMA1EN_Pos                (0U)                              \r
+#define RCC_AHBENR_DMA1EN_Msk                (0x1UL << RCC_AHBENR_DMA1EN_Pos)   /*!< 0x00000001 */\r
+#define RCC_AHBENR_DMA1EN                    RCC_AHBENR_DMA1EN_Msk             /*!< DMA1 clock enable */\r
+#define RCC_AHBENR_SRAMEN_Pos                (2U)                              \r
+#define RCC_AHBENR_SRAMEN_Msk                (0x1UL << RCC_AHBENR_SRAMEN_Pos)   /*!< 0x00000004 */\r
+#define RCC_AHBENR_SRAMEN                    RCC_AHBENR_SRAMEN_Msk             /*!< SRAM interface clock enable */\r
+#define RCC_AHBENR_FLITFEN_Pos               (4U)                              \r
+#define RCC_AHBENR_FLITFEN_Msk               (0x1UL << RCC_AHBENR_FLITFEN_Pos)  /*!< 0x00000010 */\r
+#define RCC_AHBENR_FLITFEN                   RCC_AHBENR_FLITFEN_Msk            /*!< FLITF clock enable */\r
+#define RCC_AHBENR_CRCEN_Pos                 (6U)                              \r
+#define RCC_AHBENR_CRCEN_Msk                 (0x1UL << RCC_AHBENR_CRCEN_Pos)    /*!< 0x00000040 */\r
+#define RCC_AHBENR_CRCEN                     RCC_AHBENR_CRCEN_Msk              /*!< CRC clock enable */\r
+\r
+\r
+\r
+\r
+/******************  Bit definition for RCC_APB2ENR register  *****************/\r
+#define RCC_APB2ENR_AFIOEN_Pos               (0U)                              \r
+#define RCC_APB2ENR_AFIOEN_Msk               (0x1UL << RCC_APB2ENR_AFIOEN_Pos)  /*!< 0x00000001 */\r
+#define RCC_APB2ENR_AFIOEN                   RCC_APB2ENR_AFIOEN_Msk            /*!< Alternate Function I/O clock enable */\r
+#define RCC_APB2ENR_IOPAEN_Pos               (2U)                              \r
+#define RCC_APB2ENR_IOPAEN_Msk               (0x1UL << RCC_APB2ENR_IOPAEN_Pos)  /*!< 0x00000004 */\r
+#define RCC_APB2ENR_IOPAEN                   RCC_APB2ENR_IOPAEN_Msk            /*!< I/O port A clock enable */\r
+#define RCC_APB2ENR_IOPBEN_Pos               (3U)                              \r
+#define RCC_APB2ENR_IOPBEN_Msk               (0x1UL << RCC_APB2ENR_IOPBEN_Pos)  /*!< 0x00000008 */\r
+#define RCC_APB2ENR_IOPBEN                   RCC_APB2ENR_IOPBEN_Msk            /*!< I/O port B clock enable */\r
+#define RCC_APB2ENR_IOPCEN_Pos               (4U)                              \r
+#define RCC_APB2ENR_IOPCEN_Msk               (0x1UL << RCC_APB2ENR_IOPCEN_Pos)  /*!< 0x00000010 */\r
+#define RCC_APB2ENR_IOPCEN                   RCC_APB2ENR_IOPCEN_Msk            /*!< I/O port C clock enable */\r
+#define RCC_APB2ENR_IOPDEN_Pos               (5U)                              \r
+#define RCC_APB2ENR_IOPDEN_Msk               (0x1UL << RCC_APB2ENR_IOPDEN_Pos)  /*!< 0x00000020 */\r
+#define RCC_APB2ENR_IOPDEN                   RCC_APB2ENR_IOPDEN_Msk            /*!< I/O port D clock enable */\r
+#define RCC_APB2ENR_ADC1EN_Pos               (9U)                              \r
+#define RCC_APB2ENR_ADC1EN_Msk               (0x1UL << RCC_APB2ENR_ADC1EN_Pos)  /*!< 0x00000200 */\r
+#define RCC_APB2ENR_ADC1EN                   RCC_APB2ENR_ADC1EN_Msk            /*!< ADC 1 interface clock enable */\r
+\r
+#define RCC_APB2ENR_ADC2EN_Pos               (10U)                             \r
+#define RCC_APB2ENR_ADC2EN_Msk               (0x1UL << RCC_APB2ENR_ADC2EN_Pos)  /*!< 0x00000400 */\r
+#define RCC_APB2ENR_ADC2EN                   RCC_APB2ENR_ADC2EN_Msk            /*!< ADC 2 interface clock enable */\r
+\r
+#define RCC_APB2ENR_TIM1EN_Pos               (11U)                             \r
+#define RCC_APB2ENR_TIM1EN_Msk               (0x1UL << RCC_APB2ENR_TIM1EN_Pos)  /*!< 0x00000800 */\r
+#define RCC_APB2ENR_TIM1EN                   RCC_APB2ENR_TIM1EN_Msk            /*!< TIM1 Timer clock enable */\r
+#define RCC_APB2ENR_SPI1EN_Pos               (12U)                             \r
+#define RCC_APB2ENR_SPI1EN_Msk               (0x1UL << RCC_APB2ENR_SPI1EN_Pos)  /*!< 0x00001000 */\r
+#define RCC_APB2ENR_SPI1EN                   RCC_APB2ENR_SPI1EN_Msk            /*!< SPI 1 clock enable */\r
+#define RCC_APB2ENR_USART1EN_Pos             (14U)                             \r
+#define RCC_APB2ENR_USART1EN_Msk             (0x1UL << RCC_APB2ENR_USART1EN_Pos) /*!< 0x00004000 */\r
+#define RCC_APB2ENR_USART1EN                 RCC_APB2ENR_USART1EN_Msk          /*!< USART1 clock enable */\r
+\r
+\r
+#define RCC_APB2ENR_IOPEEN_Pos               (6U)                              \r
+#define RCC_APB2ENR_IOPEEN_Msk               (0x1UL << RCC_APB2ENR_IOPEEN_Pos)  /*!< 0x00000040 */\r
+#define RCC_APB2ENR_IOPEEN                   RCC_APB2ENR_IOPEEN_Msk            /*!< I/O port E clock enable */\r
+\r
+\r
+\r
+\r
+/*****************  Bit definition for RCC_APB1ENR register  ******************/\r
+#define RCC_APB1ENR_TIM2EN_Pos               (0U)                              \r
+#define RCC_APB1ENR_TIM2EN_Msk               (0x1UL << RCC_APB1ENR_TIM2EN_Pos)  /*!< 0x00000001 */\r
+#define RCC_APB1ENR_TIM2EN                   RCC_APB1ENR_TIM2EN_Msk            /*!< Timer 2 clock enabled*/\r
+#define RCC_APB1ENR_TIM3EN_Pos               (1U)                              \r
+#define RCC_APB1ENR_TIM3EN_Msk               (0x1UL << RCC_APB1ENR_TIM3EN_Pos)  /*!< 0x00000002 */\r
+#define RCC_APB1ENR_TIM3EN                   RCC_APB1ENR_TIM3EN_Msk            /*!< Timer 3 clock enable */\r
+#define RCC_APB1ENR_WWDGEN_Pos               (11U)                             \r
+#define RCC_APB1ENR_WWDGEN_Msk               (0x1UL << RCC_APB1ENR_WWDGEN_Pos)  /*!< 0x00000800 */\r
+#define RCC_APB1ENR_WWDGEN                   RCC_APB1ENR_WWDGEN_Msk            /*!< Window Watchdog clock enable */\r
+#define RCC_APB1ENR_USART2EN_Pos             (17U)                             \r
+#define RCC_APB1ENR_USART2EN_Msk             (0x1UL << RCC_APB1ENR_USART2EN_Pos) /*!< 0x00020000 */\r
+#define RCC_APB1ENR_USART2EN                 RCC_APB1ENR_USART2EN_Msk          /*!< USART 2 clock enable */\r
+#define RCC_APB1ENR_I2C1EN_Pos               (21U)                             \r
+#define RCC_APB1ENR_I2C1EN_Msk               (0x1UL << RCC_APB1ENR_I2C1EN_Pos)  /*!< 0x00200000 */\r
+#define RCC_APB1ENR_I2C1EN                   RCC_APB1ENR_I2C1EN_Msk            /*!< I2C 1 clock enable */\r
+\r
+#define RCC_APB1ENR_CAN1EN_Pos               (25U)                             \r
+#define RCC_APB1ENR_CAN1EN_Msk               (0x1UL << RCC_APB1ENR_CAN1EN_Pos)  /*!< 0x02000000 */\r
+#define RCC_APB1ENR_CAN1EN                   RCC_APB1ENR_CAN1EN_Msk            /*!< CAN1 clock enable */\r
+\r
+#define RCC_APB1ENR_BKPEN_Pos                (27U)                             \r
+#define RCC_APB1ENR_BKPEN_Msk                (0x1UL << RCC_APB1ENR_BKPEN_Pos)   /*!< 0x08000000 */\r
+#define RCC_APB1ENR_BKPEN                    RCC_APB1ENR_BKPEN_Msk             /*!< Backup interface clock enable */\r
+#define RCC_APB1ENR_PWREN_Pos                (28U)                             \r
+#define RCC_APB1ENR_PWREN_Msk                (0x1UL << RCC_APB1ENR_PWREN_Pos)   /*!< 0x10000000 */\r
+#define RCC_APB1ENR_PWREN                    RCC_APB1ENR_PWREN_Msk             /*!< Power interface clock enable */\r
+\r
+#define RCC_APB1ENR_TIM4EN_Pos               (2U)                              \r
+#define RCC_APB1ENR_TIM4EN_Msk               (0x1UL << RCC_APB1ENR_TIM4EN_Pos)  /*!< 0x00000004 */\r
+#define RCC_APB1ENR_TIM4EN                   RCC_APB1ENR_TIM4EN_Msk            /*!< Timer 4 clock enable */\r
+#define RCC_APB1ENR_SPI2EN_Pos               (14U)                             \r
+#define RCC_APB1ENR_SPI2EN_Msk               (0x1UL << RCC_APB1ENR_SPI2EN_Pos)  /*!< 0x00004000 */\r
+#define RCC_APB1ENR_SPI2EN                   RCC_APB1ENR_SPI2EN_Msk            /*!< SPI 2 clock enable */\r
+#define RCC_APB1ENR_USART3EN_Pos             (18U)                             \r
+#define RCC_APB1ENR_USART3EN_Msk             (0x1UL << RCC_APB1ENR_USART3EN_Pos) /*!< 0x00040000 */\r
+#define RCC_APB1ENR_USART3EN                 RCC_APB1ENR_USART3EN_Msk          /*!< USART 3 clock enable */\r
+#define RCC_APB1ENR_I2C2EN_Pos               (22U)                             \r
+#define RCC_APB1ENR_I2C2EN_Msk               (0x1UL << RCC_APB1ENR_I2C2EN_Pos)  /*!< 0x00400000 */\r
+#define RCC_APB1ENR_I2C2EN                   RCC_APB1ENR_I2C2EN_Msk            /*!< I2C 2 clock enable */\r
+\r
+#define RCC_APB1ENR_USBEN_Pos                (23U)                             \r
+#define RCC_APB1ENR_USBEN_Msk                (0x1UL << RCC_APB1ENR_USBEN_Pos)   /*!< 0x00800000 */\r
+#define RCC_APB1ENR_USBEN                    RCC_APB1ENR_USBEN_Msk             /*!< USB Device clock enable */\r
+\r
+\r
+\r
+\r
+\r
+\r
+/*******************  Bit definition for RCC_BDCR register  *******************/\r
+#define RCC_BDCR_LSEON_Pos                   (0U)                              \r
+#define RCC_BDCR_LSEON_Msk                   (0x1UL << RCC_BDCR_LSEON_Pos)      /*!< 0x00000001 */\r
+#define RCC_BDCR_LSEON                       RCC_BDCR_LSEON_Msk                /*!< External Low Speed oscillator enable */\r
+#define RCC_BDCR_LSERDY_Pos                  (1U)                              \r
+#define RCC_BDCR_LSERDY_Msk                  (0x1UL << RCC_BDCR_LSERDY_Pos)     /*!< 0x00000002 */\r
+#define RCC_BDCR_LSERDY                      RCC_BDCR_LSERDY_Msk               /*!< External Low Speed oscillator Ready */\r
+#define RCC_BDCR_LSEBYP_Pos                  (2U)                              \r
+#define RCC_BDCR_LSEBYP_Msk                  (0x1UL << RCC_BDCR_LSEBYP_Pos)     /*!< 0x00000004 */\r
+#define RCC_BDCR_LSEBYP                      RCC_BDCR_LSEBYP_Msk               /*!< External Low Speed oscillator Bypass */\r
+\r
+#define RCC_BDCR_RTCSEL_Pos                  (8U)                              \r
+#define RCC_BDCR_RTCSEL_Msk                  (0x3UL << RCC_BDCR_RTCSEL_Pos)     /*!< 0x00000300 */\r
+#define RCC_BDCR_RTCSEL                      RCC_BDCR_RTCSEL_Msk               /*!< RTCSEL[1:0] bits (RTC clock source selection) */\r
+#define RCC_BDCR_RTCSEL_0                    (0x1UL << RCC_BDCR_RTCSEL_Pos)     /*!< 0x00000100 */\r
+#define RCC_BDCR_RTCSEL_1                    (0x2UL << RCC_BDCR_RTCSEL_Pos)     /*!< 0x00000200 */\r
+\r
+/*!< RTC congiguration */\r
+#define RCC_BDCR_RTCSEL_NOCLOCK              0x00000000U                       /*!< No clock */\r
+#define RCC_BDCR_RTCSEL_LSE                  0x00000100U                       /*!< LSE oscillator clock used as RTC clock */\r
+#define RCC_BDCR_RTCSEL_LSI                  0x00000200U                       /*!< LSI oscillator clock used as RTC clock */\r
+#define RCC_BDCR_RTCSEL_HSE                  0x00000300U                       /*!< HSE oscillator clock divided by 128 used as RTC clock */\r
+\r
+#define RCC_BDCR_RTCEN_Pos                   (15U)                             \r
+#define RCC_BDCR_RTCEN_Msk                   (0x1UL << RCC_BDCR_RTCEN_Pos)      /*!< 0x00008000 */\r
+#define RCC_BDCR_RTCEN                       RCC_BDCR_RTCEN_Msk                /*!< RTC clock enable */\r
+#define RCC_BDCR_BDRST_Pos                   (16U)                             \r
+#define RCC_BDCR_BDRST_Msk                   (0x1UL << RCC_BDCR_BDRST_Pos)      /*!< 0x00010000 */\r
+#define RCC_BDCR_BDRST                       RCC_BDCR_BDRST_Msk                /*!< Backup domain software reset  */\r
+\r
+/*******************  Bit definition for RCC_CSR register  ********************/  \r
+#define RCC_CSR_LSION_Pos                    (0U)                              \r
+#define RCC_CSR_LSION_Msk                    (0x1UL << RCC_CSR_LSION_Pos)       /*!< 0x00000001 */\r
+#define RCC_CSR_LSION                        RCC_CSR_LSION_Msk                 /*!< Internal Low Speed oscillator enable */\r
+#define RCC_CSR_LSIRDY_Pos                   (1U)                              \r
+#define RCC_CSR_LSIRDY_Msk                   (0x1UL << RCC_CSR_LSIRDY_Pos)      /*!< 0x00000002 */\r
+#define RCC_CSR_LSIRDY                       RCC_CSR_LSIRDY_Msk                /*!< Internal Low Speed oscillator Ready */\r
+#define RCC_CSR_RMVF_Pos                     (24U)                             \r
+#define RCC_CSR_RMVF_Msk                     (0x1UL << RCC_CSR_RMVF_Pos)        /*!< 0x01000000 */\r
+#define RCC_CSR_RMVF                         RCC_CSR_RMVF_Msk                  /*!< Remove reset flag */\r
+#define RCC_CSR_PINRSTF_Pos                  (26U)                             \r
+#define RCC_CSR_PINRSTF_Msk                  (0x1UL << RCC_CSR_PINRSTF_Pos)     /*!< 0x04000000 */\r
+#define RCC_CSR_PINRSTF                      RCC_CSR_PINRSTF_Msk               /*!< PIN reset flag */\r
+#define RCC_CSR_PORRSTF_Pos                  (27U)                             \r
+#define RCC_CSR_PORRSTF_Msk                  (0x1UL << RCC_CSR_PORRSTF_Pos)     /*!< 0x08000000 */\r
+#define RCC_CSR_PORRSTF                      RCC_CSR_PORRSTF_Msk               /*!< POR/PDR reset flag */\r
+#define RCC_CSR_SFTRSTF_Pos                  (28U)                             \r
+#define RCC_CSR_SFTRSTF_Msk                  (0x1UL << RCC_CSR_SFTRSTF_Pos)     /*!< 0x10000000 */\r
+#define RCC_CSR_SFTRSTF                      RCC_CSR_SFTRSTF_Msk               /*!< Software Reset flag */\r
+#define RCC_CSR_IWDGRSTF_Pos                 (29U)                             \r
+#define RCC_CSR_IWDGRSTF_Msk                 (0x1UL << RCC_CSR_IWDGRSTF_Pos)    /*!< 0x20000000 */\r
+#define RCC_CSR_IWDGRSTF                     RCC_CSR_IWDGRSTF_Msk              /*!< Independent Watchdog reset flag */\r
+#define RCC_CSR_WWDGRSTF_Pos                 (30U)                             \r
+#define RCC_CSR_WWDGRSTF_Msk                 (0x1UL << RCC_CSR_WWDGRSTF_Pos)    /*!< 0x40000000 */\r
+#define RCC_CSR_WWDGRSTF                     RCC_CSR_WWDGRSTF_Msk              /*!< Window watchdog reset flag */\r
+#define RCC_CSR_LPWRRSTF_Pos                 (31U)                             \r
+#define RCC_CSR_LPWRRSTF_Msk                 (0x1UL << RCC_CSR_LPWRRSTF_Pos)    /*!< 0x80000000 */\r
+#define RCC_CSR_LPWRRSTF                     RCC_CSR_LPWRRSTF_Msk              /*!< Low-Power reset flag */\r
+\r
+\r
\r
+/******************************************************************************/\r
+/*                                                                            */\r
+/*                General Purpose and Alternate Function I/O                  */\r
+/*                                                                            */\r
+/******************************************************************************/\r
+\r
+/*******************  Bit definition for GPIO_CRL register  *******************/\r
+#define GPIO_CRL_MODE_Pos                    (0U)                              \r
+#define GPIO_CRL_MODE_Msk                    (0x33333333UL << GPIO_CRL_MODE_Pos) /*!< 0x33333333 */\r
+#define GPIO_CRL_MODE                        GPIO_CRL_MODE_Msk                 /*!< Port x mode bits */\r
+\r
+#define GPIO_CRL_MODE0_Pos                   (0U)                              \r
+#define GPIO_CRL_MODE0_Msk                   (0x3UL << GPIO_CRL_MODE0_Pos)      /*!< 0x00000003 */\r
+#define GPIO_CRL_MODE0                       GPIO_CRL_MODE0_Msk                /*!< MODE0[1:0] bits (Port x mode bits, pin 0) */\r
+#define GPIO_CRL_MODE0_0                     (0x1UL << GPIO_CRL_MODE0_Pos)      /*!< 0x00000001 */\r
+#define GPIO_CRL_MODE0_1                     (0x2UL << GPIO_CRL_MODE0_Pos)      /*!< 0x00000002 */\r
+\r
+#define GPIO_CRL_MODE1_Pos                   (4U)                              \r
+#define GPIO_CRL_MODE1_Msk                   (0x3UL << GPIO_CRL_MODE1_Pos)      /*!< 0x00000030 */\r
+#define GPIO_CRL_MODE1                       GPIO_CRL_MODE1_Msk                /*!< MODE1[1:0] bits (Port x mode bits, pin 1) */\r
+#define GPIO_CRL_MODE1_0                     (0x1UL << GPIO_CRL_MODE1_Pos)      /*!< 0x00000010 */\r
+#define GPIO_CRL_MODE1_1                     (0x2UL << GPIO_CRL_MODE1_Pos)      /*!< 0x00000020 */\r
+\r
+#define GPIO_CRL_MODE2_Pos                   (8U)                              \r
+#define GPIO_CRL_MODE2_Msk                   (0x3UL << GPIO_CRL_MODE2_Pos)      /*!< 0x00000300 */\r
+#define GPIO_CRL_MODE2                       GPIO_CRL_MODE2_Msk                /*!< MODE2[1:0] bits (Port x mode bits, pin 2) */\r
+#define GPIO_CRL_MODE2_0                     (0x1UL << GPIO_CRL_MODE2_Pos)      /*!< 0x00000100 */\r
+#define GPIO_CRL_MODE2_1                     (0x2UL << GPIO_CRL_MODE2_Pos)      /*!< 0x00000200 */\r
+\r
+#define GPIO_CRL_MODE3_Pos                   (12U)                             \r
+#define GPIO_CRL_MODE3_Msk                   (0x3UL << GPIO_CRL_MODE3_Pos)      /*!< 0x00003000 */\r
+#define GPIO_CRL_MODE3                       GPIO_CRL_MODE3_Msk                /*!< MODE3[1:0] bits (Port x mode bits, pin 3) */\r
+#define GPIO_CRL_MODE3_0                     (0x1UL << GPIO_CRL_MODE3_Pos)      /*!< 0x00001000 */\r
+#define GPIO_CRL_MODE3_1                     (0x2UL << GPIO_CRL_MODE3_Pos)      /*!< 0x00002000 */\r
+\r
+#define GPIO_CRL_MODE4_Pos                   (16U)                             \r
+#define GPIO_CRL_MODE4_Msk                   (0x3UL << GPIO_CRL_MODE4_Pos)      /*!< 0x00030000 */\r
+#define GPIO_CRL_MODE4                       GPIO_CRL_MODE4_Msk                /*!< MODE4[1:0] bits (Port x mode bits, pin 4) */\r
+#define GPIO_CRL_MODE4_0                     (0x1UL << GPIO_CRL_MODE4_Pos)      /*!< 0x00010000 */\r
+#define GPIO_CRL_MODE4_1                     (0x2UL << GPIO_CRL_MODE4_Pos)      /*!< 0x00020000 */\r
+\r
+#define GPIO_CRL_MODE5_Pos                   (20U)                             \r
+#define GPIO_CRL_MODE5_Msk                   (0x3UL << GPIO_CRL_MODE5_Pos)      /*!< 0x00300000 */\r
+#define GPIO_CRL_MODE5                       GPIO_CRL_MODE5_Msk                /*!< MODE5[1:0] bits (Port x mode bits, pin 5) */\r
+#define GPIO_CRL_MODE5_0                     (0x1UL << GPIO_CRL_MODE5_Pos)      /*!< 0x00100000 */\r
+#define GPIO_CRL_MODE5_1                     (0x2UL << GPIO_CRL_MODE5_Pos)      /*!< 0x00200000 */\r
+\r
+#define GPIO_CRL_MODE6_Pos                   (24U)                             \r
+#define GPIO_CRL_MODE6_Msk                   (0x3UL << GPIO_CRL_MODE6_Pos)      /*!< 0x03000000 */\r
+#define GPIO_CRL_MODE6                       GPIO_CRL_MODE6_Msk                /*!< MODE6[1:0] bits (Port x mode bits, pin 6) */\r
+#define GPIO_CRL_MODE6_0                     (0x1UL << GPIO_CRL_MODE6_Pos)      /*!< 0x01000000 */\r
+#define GPIO_CRL_MODE6_1                     (0x2UL << GPIO_CRL_MODE6_Pos)      /*!< 0x02000000 */\r
+\r
+#define GPIO_CRL_MODE7_Pos                   (28U)                             \r
+#define GPIO_CRL_MODE7_Msk                   (0x3UL << GPIO_CRL_MODE7_Pos)      /*!< 0x30000000 */\r
+#define GPIO_CRL_MODE7                       GPIO_CRL_MODE7_Msk                /*!< MODE7[1:0] bits (Port x mode bits, pin 7) */\r
+#define GPIO_CRL_MODE7_0                     (0x1UL << GPIO_CRL_MODE7_Pos)      /*!< 0x10000000 */\r
+#define GPIO_CRL_MODE7_1                     (0x2UL << GPIO_CRL_MODE7_Pos)      /*!< 0x20000000 */\r
+\r
+#define GPIO_CRL_CNF_Pos                     (2U)                              \r
+#define GPIO_CRL_CNF_Msk                     (0x33333333UL << GPIO_CRL_CNF_Pos) /*!< 0xCCCCCCCC */\r
+#define GPIO_CRL_CNF                         GPIO_CRL_CNF_Msk                  /*!< Port x configuration bits */\r
+\r
+#define GPIO_CRL_CNF0_Pos                    (2U)                              \r
+#define GPIO_CRL_CNF0_Msk                    (0x3UL << GPIO_CRL_CNF0_Pos)       /*!< 0x0000000C */\r
+#define GPIO_CRL_CNF0                        GPIO_CRL_CNF0_Msk                 /*!< CNF0[1:0] bits (Port x configuration bits, pin 0) */\r
+#define GPIO_CRL_CNF0_0                      (0x1UL << GPIO_CRL_CNF0_Pos)       /*!< 0x00000004 */\r
+#define GPIO_CRL_CNF0_1                      (0x2UL << GPIO_CRL_CNF0_Pos)       /*!< 0x00000008 */\r
+\r
+#define GPIO_CRL_CNF1_Pos                    (6U)                              \r
+#define GPIO_CRL_CNF1_Msk                    (0x3UL << GPIO_CRL_CNF1_Pos)       /*!< 0x000000C0 */\r
+#define GPIO_CRL_CNF1                        GPIO_CRL_CNF1_Msk                 /*!< CNF1[1:0] bits (Port x configuration bits, pin 1) */\r
+#define GPIO_CRL_CNF1_0                      (0x1UL << GPIO_CRL_CNF1_Pos)       /*!< 0x00000040 */\r
+#define GPIO_CRL_CNF1_1                      (0x2UL << GPIO_CRL_CNF1_Pos)       /*!< 0x00000080 */\r
+\r
+#define GPIO_CRL_CNF2_Pos                    (10U)                             \r
+#define GPIO_CRL_CNF2_Msk                    (0x3UL << GPIO_CRL_CNF2_Pos)       /*!< 0x00000C00 */\r
+#define GPIO_CRL_CNF2                        GPIO_CRL_CNF2_Msk                 /*!< CNF2[1:0] bits (Port x configuration bits, pin 2) */\r
+#define GPIO_CRL_CNF2_0                      (0x1UL << GPIO_CRL_CNF2_Pos)       /*!< 0x00000400 */\r
+#define GPIO_CRL_CNF2_1                      (0x2UL << GPIO_CRL_CNF2_Pos)       /*!< 0x00000800 */\r
+\r
+#define GPIO_CRL_CNF3_Pos                    (14U)                             \r
+#define GPIO_CRL_CNF3_Msk                    (0x3UL << GPIO_CRL_CNF3_Pos)       /*!< 0x0000C000 */\r
+#define GPIO_CRL_CNF3                        GPIO_CRL_CNF3_Msk                 /*!< CNF3[1:0] bits (Port x configuration bits, pin 3) */\r
+#define GPIO_CRL_CNF3_0                      (0x1UL << GPIO_CRL_CNF3_Pos)       /*!< 0x00004000 */\r
+#define GPIO_CRL_CNF3_1                      (0x2UL << GPIO_CRL_CNF3_Pos)       /*!< 0x00008000 */\r
+\r
+#define GPIO_CRL_CNF4_Pos                    (18U)                             \r
+#define GPIO_CRL_CNF4_Msk                    (0x3UL << GPIO_CRL_CNF4_Pos)       /*!< 0x000C0000 */\r
+#define GPIO_CRL_CNF4                        GPIO_CRL_CNF4_Msk                 /*!< CNF4[1:0] bits (Port x configuration bits, pin 4) */\r
+#define GPIO_CRL_CNF4_0                      (0x1UL << GPIO_CRL_CNF4_Pos)       /*!< 0x00040000 */\r
+#define GPIO_CRL_CNF4_1                      (0x2UL << GPIO_CRL_CNF4_Pos)       /*!< 0x00080000 */\r
+\r
+#define GPIO_CRL_CNF5_Pos                    (22U)                             \r
+#define GPIO_CRL_CNF5_Msk                    (0x3UL << GPIO_CRL_CNF5_Pos)       /*!< 0x00C00000 */\r
+#define GPIO_CRL_CNF5                        GPIO_CRL_CNF5_Msk                 /*!< CNF5[1:0] bits (Port x configuration bits, pin 5) */\r
+#define GPIO_CRL_CNF5_0                      (0x1UL << GPIO_CRL_CNF5_Pos)       /*!< 0x00400000 */\r
+#define GPIO_CRL_CNF5_1                      (0x2UL << GPIO_CRL_CNF5_Pos)       /*!< 0x00800000 */\r
+\r
+#define GPIO_CRL_CNF6_Pos                    (26U)                             \r
+#define GPIO_CRL_CNF6_Msk                    (0x3UL << GPIO_CRL_CNF6_Pos)       /*!< 0x0C000000 */\r
+#define GPIO_CRL_CNF6                        GPIO_CRL_CNF6_Msk                 /*!< CNF6[1:0] bits (Port x configuration bits, pin 6) */\r
+#define GPIO_CRL_CNF6_0                      (0x1UL << GPIO_CRL_CNF6_Pos)       /*!< 0x04000000 */\r
+#define GPIO_CRL_CNF6_1                      (0x2UL << GPIO_CRL_CNF6_Pos)       /*!< 0x08000000 */\r
+\r
+#define GPIO_CRL_CNF7_Pos                    (30U)                             \r
+#define GPIO_CRL_CNF7_Msk                    (0x3UL << GPIO_CRL_CNF7_Pos)       /*!< 0xC0000000 */\r
+#define GPIO_CRL_CNF7                        GPIO_CRL_CNF7_Msk                 /*!< CNF7[1:0] bits (Port x configuration bits, pin 7) */\r
+#define GPIO_CRL_CNF7_0                      (0x1UL << GPIO_CRL_CNF7_Pos)       /*!< 0x40000000 */\r
+#define GPIO_CRL_CNF7_1                      (0x2UL << GPIO_CRL_CNF7_Pos)       /*!< 0x80000000 */\r
+\r
+/*******************  Bit definition for GPIO_CRH register  *******************/\r
+#define GPIO_CRH_MODE_Pos                    (0U)                              \r
+#define GPIO_CRH_MODE_Msk                    (0x33333333UL << GPIO_CRH_MODE_Pos) /*!< 0x33333333 */\r
+#define GPIO_CRH_MODE                        GPIO_CRH_MODE_Msk                 /*!< Port x mode bits */\r
+\r
+#define GPIO_CRH_MODE8_Pos                   (0U)                              \r
+#define GPIO_CRH_MODE8_Msk                   (0x3UL << GPIO_CRH_MODE8_Pos)      /*!< 0x00000003 */\r
+#define GPIO_CRH_MODE8                       GPIO_CRH_MODE8_Msk                /*!< MODE8[1:0] bits (Port x mode bits, pin 8) */\r
+#define GPIO_CRH_MODE8_0                     (0x1UL << GPIO_CRH_MODE8_Pos)      /*!< 0x00000001 */\r
+#define GPIO_CRH_MODE8_1                     (0x2UL << GPIO_CRH_MODE8_Pos)      /*!< 0x00000002 */\r
+\r
+#define GPIO_CRH_MODE9_Pos                   (4U)                              \r
+#define GPIO_CRH_MODE9_Msk                   (0x3UL << GPIO_CRH_MODE9_Pos)      /*!< 0x00000030 */\r
+#define GPIO_CRH_MODE9                       GPIO_CRH_MODE9_Msk                /*!< MODE9[1:0] bits (Port x mode bits, pin 9) */\r
+#define GPIO_CRH_MODE9_0                     (0x1UL << GPIO_CRH_MODE9_Pos)      /*!< 0x00000010 */\r
+#define GPIO_CRH_MODE9_1                     (0x2UL << GPIO_CRH_MODE9_Pos)      /*!< 0x00000020 */\r
+\r
+#define GPIO_CRH_MODE10_Pos                  (8U)                              \r
+#define GPIO_CRH_MODE10_Msk                  (0x3UL << GPIO_CRH_MODE10_Pos)     /*!< 0x00000300 */\r
+#define GPIO_CRH_MODE10                      GPIO_CRH_MODE10_Msk               /*!< MODE10[1:0] bits (Port x mode bits, pin 10) */\r
+#define GPIO_CRH_MODE10_0                    (0x1UL << GPIO_CRH_MODE10_Pos)     /*!< 0x00000100 */\r
+#define GPIO_CRH_MODE10_1                    (0x2UL << GPIO_CRH_MODE10_Pos)     /*!< 0x00000200 */\r
+\r
+#define GPIO_CRH_MODE11_Pos                  (12U)                             \r
+#define GPIO_CRH_MODE11_Msk                  (0x3UL << GPIO_CRH_MODE11_Pos)     /*!< 0x00003000 */\r
+#define GPIO_CRH_MODE11                      GPIO_CRH_MODE11_Msk               /*!< MODE11[1:0] bits (Port x mode bits, pin 11) */\r
+#define GPIO_CRH_MODE11_0                    (0x1UL << GPIO_CRH_MODE11_Pos)     /*!< 0x00001000 */\r
+#define GPIO_CRH_MODE11_1                    (0x2UL << GPIO_CRH_MODE11_Pos)     /*!< 0x00002000 */\r
+\r
+#define GPIO_CRH_MODE12_Pos                  (16U)                             \r
+#define GPIO_CRH_MODE12_Msk                  (0x3UL << GPIO_CRH_MODE12_Pos)     /*!< 0x00030000 */\r
+#define GPIO_CRH_MODE12                      GPIO_CRH_MODE12_Msk               /*!< MODE12[1:0] bits (Port x mode bits, pin 12) */\r
+#define GPIO_CRH_MODE12_0                    (0x1UL << GPIO_CRH_MODE12_Pos)     /*!< 0x00010000 */\r
+#define GPIO_CRH_MODE12_1                    (0x2UL << GPIO_CRH_MODE12_Pos)     /*!< 0x00020000 */\r
+\r
+#define GPIO_CRH_MODE13_Pos                  (20U)                             \r
+#define GPIO_CRH_MODE13_Msk                  (0x3UL << GPIO_CRH_MODE13_Pos)     /*!< 0x00300000 */\r
+#define GPIO_CRH_MODE13                      GPIO_CRH_MODE13_Msk               /*!< MODE13[1:0] bits (Port x mode bits, pin 13) */\r
+#define GPIO_CRH_MODE13_0                    (0x1UL << GPIO_CRH_MODE13_Pos)     /*!< 0x00100000 */\r
+#define GPIO_CRH_MODE13_1                    (0x2UL << GPIO_CRH_MODE13_Pos)     /*!< 0x00200000 */\r
+\r
+#define GPIO_CRH_MODE14_Pos                  (24U)                             \r
+#define GPIO_CRH_MODE14_Msk                  (0x3UL << GPIO_CRH_MODE14_Pos)     /*!< 0x03000000 */\r
+#define GPIO_CRH_MODE14                      GPIO_CRH_MODE14_Msk               /*!< MODE14[1:0] bits (Port x mode bits, pin 14) */\r
+#define GPIO_CRH_MODE14_0                    (0x1UL << GPIO_CRH_MODE14_Pos)     /*!< 0x01000000 */\r
+#define GPIO_CRH_MODE14_1                    (0x2UL << GPIO_CRH_MODE14_Pos)     /*!< 0x02000000 */\r
+\r
+#define GPIO_CRH_MODE15_Pos                  (28U)                             \r
+#define GPIO_CRH_MODE15_Msk                  (0x3UL << GPIO_CRH_MODE15_Pos)     /*!< 0x30000000 */\r
+#define GPIO_CRH_MODE15                      GPIO_CRH_MODE15_Msk               /*!< MODE15[1:0] bits (Port x mode bits, pin 15) */\r
+#define GPIO_CRH_MODE15_0                    (0x1UL << GPIO_CRH_MODE15_Pos)     /*!< 0x10000000 */\r
+#define GPIO_CRH_MODE15_1                    (0x2UL << GPIO_CRH_MODE15_Pos)     /*!< 0x20000000 */\r
+\r
+#define GPIO_CRH_CNF_Pos                     (2U)                              \r
+#define GPIO_CRH_CNF_Msk                     (0x33333333UL << GPIO_CRH_CNF_Pos) /*!< 0xCCCCCCCC */\r
+#define GPIO_CRH_CNF                         GPIO_CRH_CNF_Msk                  /*!< Port x configuration bits */\r
+\r
+#define GPIO_CRH_CNF8_Pos                    (2U)                              \r
+#define GPIO_CRH_CNF8_Msk                    (0x3UL << GPIO_CRH_CNF8_Pos)       /*!< 0x0000000C */\r
+#define GPIO_CRH_CNF8                        GPIO_CRH_CNF8_Msk                 /*!< CNF8[1:0] bits (Port x configuration bits, pin 8) */\r
+#define GPIO_CRH_CNF8_0                      (0x1UL << GPIO_CRH_CNF8_Pos)       /*!< 0x00000004 */\r
+#define GPIO_CRH_CNF8_1                      (0x2UL << GPIO_CRH_CNF8_Pos)       /*!< 0x00000008 */\r
+\r
+#define GPIO_CRH_CNF9_Pos                    (6U)                              \r
+#define GPIO_CRH_CNF9_Msk                    (0x3UL << GPIO_CRH_CNF9_Pos)       /*!< 0x000000C0 */\r
+#define GPIO_CRH_CNF9                        GPIO_CRH_CNF9_Msk                 /*!< CNF9[1:0] bits (Port x configuration bits, pin 9) */\r
+#define GPIO_CRH_CNF9_0                      (0x1UL << GPIO_CRH_CNF9_Pos)       /*!< 0x00000040 */\r
+#define GPIO_CRH_CNF9_1                      (0x2UL << GPIO_CRH_CNF9_Pos)       /*!< 0x00000080 */\r
+\r
+#define GPIO_CRH_CNF10_Pos                   (10U)                             \r
+#define GPIO_CRH_CNF10_Msk                   (0x3UL << GPIO_CRH_CNF10_Pos)      /*!< 0x00000C00 */\r
+#define GPIO_CRH_CNF10                       GPIO_CRH_CNF10_Msk                /*!< CNF10[1:0] bits (Port x configuration bits, pin 10) */\r
+#define GPIO_CRH_CNF10_0                     (0x1UL << GPIO_CRH_CNF10_Pos)      /*!< 0x00000400 */\r
+#define GPIO_CRH_CNF10_1                     (0x2UL << GPIO_CRH_CNF10_Pos)      /*!< 0x00000800 */\r
+\r
+#define GPIO_CRH_CNF11_Pos                   (14U)                             \r
+#define GPIO_CRH_CNF11_Msk                   (0x3UL << GPIO_CRH_CNF11_Pos)      /*!< 0x0000C000 */\r
+#define GPIO_CRH_CNF11                       GPIO_CRH_CNF11_Msk                /*!< CNF11[1:0] bits (Port x configuration bits, pin 11) */\r
+#define GPIO_CRH_CNF11_0                     (0x1UL << GPIO_CRH_CNF11_Pos)      /*!< 0x00004000 */\r
+#define GPIO_CRH_CNF11_1                     (0x2UL << GPIO_CRH_CNF11_Pos)      /*!< 0x00008000 */\r
+\r
+#define GPIO_CRH_CNF12_Pos                   (18U)                             \r
+#define GPIO_CRH_CNF12_Msk                   (0x3UL << GPIO_CRH_CNF12_Pos)      /*!< 0x000C0000 */\r
+#define GPIO_CRH_CNF12                       GPIO_CRH_CNF12_Msk                /*!< CNF12[1:0] bits (Port x configuration bits, pin 12) */\r
+#define GPIO_CRH_CNF12_0                     (0x1UL << GPIO_CRH_CNF12_Pos)      /*!< 0x00040000 */\r
+#define GPIO_CRH_CNF12_1                     (0x2UL << GPIO_CRH_CNF12_Pos)      /*!< 0x00080000 */\r
+\r
+#define GPIO_CRH_CNF13_Pos                   (22U)                             \r
+#define GPIO_CRH_CNF13_Msk                   (0x3UL << GPIO_CRH_CNF13_Pos)      /*!< 0x00C00000 */\r
+#define GPIO_CRH_CNF13                       GPIO_CRH_CNF13_Msk                /*!< CNF13[1:0] bits (Port x configuration bits, pin 13) */\r
+#define GPIO_CRH_CNF13_0                     (0x1UL << GPIO_CRH_CNF13_Pos)      /*!< 0x00400000 */\r
+#define GPIO_CRH_CNF13_1                     (0x2UL << GPIO_CRH_CNF13_Pos)      /*!< 0x00800000 */\r
+\r
+#define GPIO_CRH_CNF14_Pos                   (26U)                             \r
+#define GPIO_CRH_CNF14_Msk                   (0x3UL << GPIO_CRH_CNF14_Pos)      /*!< 0x0C000000 */\r
+#define GPIO_CRH_CNF14                       GPIO_CRH_CNF14_Msk                /*!< CNF14[1:0] bits (Port x configuration bits, pin 14) */\r
+#define GPIO_CRH_CNF14_0                     (0x1UL << GPIO_CRH_CNF14_Pos)      /*!< 0x04000000 */\r
+#define GPIO_CRH_CNF14_1                     (0x2UL << GPIO_CRH_CNF14_Pos)      /*!< 0x08000000 */\r
+\r
+#define GPIO_CRH_CNF15_Pos                   (30U)                             \r
+#define GPIO_CRH_CNF15_Msk                   (0x3UL << GPIO_CRH_CNF15_Pos)      /*!< 0xC0000000 */\r
+#define GPIO_CRH_CNF15                       GPIO_CRH_CNF15_Msk                /*!< CNF15[1:0] bits (Port x configuration bits, pin 15) */\r
+#define GPIO_CRH_CNF15_0                     (0x1UL << GPIO_CRH_CNF15_Pos)      /*!< 0x40000000 */\r
+#define GPIO_CRH_CNF15_1                     (0x2UL << GPIO_CRH_CNF15_Pos)      /*!< 0x80000000 */\r
+\r
+/*!<******************  Bit definition for GPIO_IDR register  *******************/\r
+#define GPIO_IDR_IDR0_Pos                    (0U)                              \r
+#define GPIO_IDR_IDR0_Msk                    (0x1UL << GPIO_IDR_IDR0_Pos)       /*!< 0x00000001 */\r
+#define GPIO_IDR_IDR0                        GPIO_IDR_IDR0_Msk                 /*!< Port input data, bit 0 */\r
+#define GPIO_IDR_IDR1_Pos                    (1U)                              \r
+#define GPIO_IDR_IDR1_Msk                    (0x1UL << GPIO_IDR_IDR1_Pos)       /*!< 0x00000002 */\r
+#define GPIO_IDR_IDR1                        GPIO_IDR_IDR1_Msk                 /*!< Port input data, bit 1 */\r
+#define GPIO_IDR_IDR2_Pos                    (2U)                              \r
+#define GPIO_IDR_IDR2_Msk                    (0x1UL << GPIO_IDR_IDR2_Pos)       /*!< 0x00000004 */\r
+#define GPIO_IDR_IDR2                        GPIO_IDR_IDR2_Msk                 /*!< Port input data, bit 2 */\r
+#define GPIO_IDR_IDR3_Pos                    (3U)                              \r
+#define GPIO_IDR_IDR3_Msk                    (0x1UL << GPIO_IDR_IDR3_Pos)       /*!< 0x00000008 */\r
+#define GPIO_IDR_IDR3                        GPIO_IDR_IDR3_Msk                 /*!< Port input data, bit 3 */\r
+#define GPIO_IDR_IDR4_Pos                    (4U)                              \r
+#define GPIO_IDR_IDR4_Msk                    (0x1UL << GPIO_IDR_IDR4_Pos)       /*!< 0x00000010 */\r
+#define GPIO_IDR_IDR4                        GPIO_IDR_IDR4_Msk                 /*!< Port input data, bit 4 */\r
+#define GPIO_IDR_IDR5_Pos                    (5U)                              \r
+#define GPIO_IDR_IDR5_Msk                    (0x1UL << GPIO_IDR_IDR5_Pos)       /*!< 0x00000020 */\r
+#define GPIO_IDR_IDR5                        GPIO_IDR_IDR5_Msk                 /*!< Port input data, bit 5 */\r
+#define GPIO_IDR_IDR6_Pos                    (6U)                              \r
+#define GPIO_IDR_IDR6_Msk                    (0x1UL << GPIO_IDR_IDR6_Pos)       /*!< 0x00000040 */\r
+#define GPIO_IDR_IDR6                        GPIO_IDR_IDR6_Msk                 /*!< Port input data, bit 6 */\r
+#define GPIO_IDR_IDR7_Pos                    (7U)                              \r
+#define GPIO_IDR_IDR7_Msk                    (0x1UL << GPIO_IDR_IDR7_Pos)       /*!< 0x00000080 */\r
+#define GPIO_IDR_IDR7                        GPIO_IDR_IDR7_Msk                 /*!< Port input data, bit 7 */\r
+#define GPIO_IDR_IDR8_Pos                    (8U)                              \r
+#define GPIO_IDR_IDR8_Msk                    (0x1UL << GPIO_IDR_IDR8_Pos)       /*!< 0x00000100 */\r
+#define GPIO_IDR_IDR8                        GPIO_IDR_IDR8_Msk                 /*!< Port input data, bit 8 */\r
+#define GPIO_IDR_IDR9_Pos                    (9U)                              \r
+#define GPIO_IDR_IDR9_Msk                    (0x1UL << GPIO_IDR_IDR9_Pos)       /*!< 0x00000200 */\r
+#define GPIO_IDR_IDR9                        GPIO_IDR_IDR9_Msk                 /*!< Port input data, bit 9 */\r
+#define GPIO_IDR_IDR10_Pos                   (10U)                             \r
+#define GPIO_IDR_IDR10_Msk                   (0x1UL << GPIO_IDR_IDR10_Pos)      /*!< 0x00000400 */\r
+#define GPIO_IDR_IDR10                       GPIO_IDR_IDR10_Msk                /*!< Port input data, bit 10 */\r
+#define GPIO_IDR_IDR11_Pos                   (11U)                             \r
+#define GPIO_IDR_IDR11_Msk                   (0x1UL << GPIO_IDR_IDR11_Pos)      /*!< 0x00000800 */\r
+#define GPIO_IDR_IDR11                       GPIO_IDR_IDR11_Msk                /*!< Port input data, bit 11 */\r
+#define GPIO_IDR_IDR12_Pos                   (12U)                             \r
+#define GPIO_IDR_IDR12_Msk                   (0x1UL << GPIO_IDR_IDR12_Pos)      /*!< 0x00001000 */\r
+#define GPIO_IDR_IDR12                       GPIO_IDR_IDR12_Msk                /*!< Port input data, bit 12 */\r
+#define GPIO_IDR_IDR13_Pos                   (13U)                             \r
+#define GPIO_IDR_IDR13_Msk                   (0x1UL << GPIO_IDR_IDR13_Pos)      /*!< 0x00002000 */\r
+#define GPIO_IDR_IDR13                       GPIO_IDR_IDR13_Msk                /*!< Port input data, bit 13 */\r
+#define GPIO_IDR_IDR14_Pos                   (14U)                             \r
+#define GPIO_IDR_IDR14_Msk                   (0x1UL << GPIO_IDR_IDR14_Pos)      /*!< 0x00004000 */\r
+#define GPIO_IDR_IDR14                       GPIO_IDR_IDR14_Msk                /*!< Port input data, bit 14 */\r
+#define GPIO_IDR_IDR15_Pos                   (15U)                             \r
+#define GPIO_IDR_IDR15_Msk                   (0x1UL << GPIO_IDR_IDR15_Pos)      /*!< 0x00008000 */\r
+#define GPIO_IDR_IDR15                       GPIO_IDR_IDR15_Msk                /*!< Port input data, bit 15 */\r
+\r
+/*******************  Bit definition for GPIO_ODR register  *******************/\r
+#define GPIO_ODR_ODR0_Pos                    (0U)                              \r
+#define GPIO_ODR_ODR0_Msk                    (0x1UL << GPIO_ODR_ODR0_Pos)       /*!< 0x00000001 */\r
+#define GPIO_ODR_ODR0                        GPIO_ODR_ODR0_Msk                 /*!< Port output data, bit 0 */\r
+#define GPIO_ODR_ODR1_Pos                    (1U)                              \r
+#define GPIO_ODR_ODR1_Msk                    (0x1UL << GPIO_ODR_ODR1_Pos)       /*!< 0x00000002 */\r
+#define GPIO_ODR_ODR1                        GPIO_ODR_ODR1_Msk                 /*!< Port output data, bit 1 */\r
+#define GPIO_ODR_ODR2_Pos                    (2U)                              \r
+#define GPIO_ODR_ODR2_Msk                    (0x1UL << GPIO_ODR_ODR2_Pos)       /*!< 0x00000004 */\r
+#define GPIO_ODR_ODR2                        GPIO_ODR_ODR2_Msk                 /*!< Port output data, bit 2 */\r
+#define GPIO_ODR_ODR3_Pos                    (3U)                              \r
+#define GPIO_ODR_ODR3_Msk                    (0x1UL << GPIO_ODR_ODR3_Pos)       /*!< 0x00000008 */\r
+#define GPIO_ODR_ODR3                        GPIO_ODR_ODR3_Msk                 /*!< Port output data, bit 3 */\r
+#define GPIO_ODR_ODR4_Pos                    (4U)                              \r
+#define GPIO_ODR_ODR4_Msk                    (0x1UL << GPIO_ODR_ODR4_Pos)       /*!< 0x00000010 */\r
+#define GPIO_ODR_ODR4                        GPIO_ODR_ODR4_Msk                 /*!< Port output data, bit 4 */\r
+#define GPIO_ODR_ODR5_Pos                    (5U)                              \r
+#define GPIO_ODR_ODR5_Msk                    (0x1UL << GPIO_ODR_ODR5_Pos)       /*!< 0x00000020 */\r
+#define GPIO_ODR_ODR5                        GPIO_ODR_ODR5_Msk                 /*!< Port output data, bit 5 */\r
+#define GPIO_ODR_ODR6_Pos                    (6U)                              \r
+#define GPIO_ODR_ODR6_Msk                    (0x1UL << GPIO_ODR_ODR6_Pos)       /*!< 0x00000040 */\r
+#define GPIO_ODR_ODR6                        GPIO_ODR_ODR6_Msk                 /*!< Port output data, bit 6 */\r
+#define GPIO_ODR_ODR7_Pos                    (7U)                              \r
+#define GPIO_ODR_ODR7_Msk                    (0x1UL << GPIO_ODR_ODR7_Pos)       /*!< 0x00000080 */\r
+#define GPIO_ODR_ODR7                        GPIO_ODR_ODR7_Msk                 /*!< Port output data, bit 7 */\r
+#define GPIO_ODR_ODR8_Pos                    (8U)                              \r
+#define GPIO_ODR_ODR8_Msk                    (0x1UL << GPIO_ODR_ODR8_Pos)       /*!< 0x00000100 */\r
+#define GPIO_ODR_ODR8                        GPIO_ODR_ODR8_Msk                 /*!< Port output data, bit 8 */\r
+#define GPIO_ODR_ODR9_Pos                    (9U)                              \r
+#define GPIO_ODR_ODR9_Msk                    (0x1UL << GPIO_ODR_ODR9_Pos)       /*!< 0x00000200 */\r
+#define GPIO_ODR_ODR9                        GPIO_ODR_ODR9_Msk                 /*!< Port output data, bit 9 */\r
+#define GPIO_ODR_ODR10_Pos                   (10U)                             \r
+#define GPIO_ODR_ODR10_Msk                   (0x1UL << GPIO_ODR_ODR10_Pos)      /*!< 0x00000400 */\r
+#define GPIO_ODR_ODR10                       GPIO_ODR_ODR10_Msk                /*!< Port output data, bit 10 */\r
+#define GPIO_ODR_ODR11_Pos                   (11U)                             \r
+#define GPIO_ODR_ODR11_Msk                   (0x1UL << GPIO_ODR_ODR11_Pos)      /*!< 0x00000800 */\r
+#define GPIO_ODR_ODR11                       GPIO_ODR_ODR11_Msk                /*!< Port output data, bit 11 */\r
+#define GPIO_ODR_ODR12_Pos                   (12U)                             \r
+#define GPIO_ODR_ODR12_Msk                   (0x1UL << GPIO_ODR_ODR12_Pos)      /*!< 0x00001000 */\r
+#define GPIO_ODR_ODR12                       GPIO_ODR_ODR12_Msk                /*!< Port output data, bit 12 */\r
+#define GPIO_ODR_ODR13_Pos                   (13U)                             \r
+#define GPIO_ODR_ODR13_Msk                   (0x1UL << GPIO_ODR_ODR13_Pos)      /*!< 0x00002000 */\r
+#define GPIO_ODR_ODR13                       GPIO_ODR_ODR13_Msk                /*!< Port output data, bit 13 */\r
+#define GPIO_ODR_ODR14_Pos                   (14U)                             \r
+#define GPIO_ODR_ODR14_Msk                   (0x1UL << GPIO_ODR_ODR14_Pos)      /*!< 0x00004000 */\r
+#define GPIO_ODR_ODR14                       GPIO_ODR_ODR14_Msk                /*!< Port output data, bit 14 */\r
+#define GPIO_ODR_ODR15_Pos                   (15U)                             \r
+#define GPIO_ODR_ODR15_Msk                   (0x1UL << GPIO_ODR_ODR15_Pos)      /*!< 0x00008000 */\r
+#define GPIO_ODR_ODR15                       GPIO_ODR_ODR15_Msk                /*!< Port output data, bit 15 */\r
+\r
+/******************  Bit definition for GPIO_BSRR register  *******************/\r
+#define GPIO_BSRR_BS0_Pos                    (0U)                              \r
+#define GPIO_BSRR_BS0_Msk                    (0x1UL << GPIO_BSRR_BS0_Pos)       /*!< 0x00000001 */\r
+#define GPIO_BSRR_BS0                        GPIO_BSRR_BS0_Msk                 /*!< Port x Set bit 0 */\r
+#define GPIO_BSRR_BS1_Pos                    (1U)                              \r
+#define GPIO_BSRR_BS1_Msk                    (0x1UL << GPIO_BSRR_BS1_Pos)       /*!< 0x00000002 */\r
+#define GPIO_BSRR_BS1                        GPIO_BSRR_BS1_Msk                 /*!< Port x Set bit 1 */\r
+#define GPIO_BSRR_BS2_Pos                    (2U)                              \r
+#define GPIO_BSRR_BS2_Msk                    (0x1UL << GPIO_BSRR_BS2_Pos)       /*!< 0x00000004 */\r
+#define GPIO_BSRR_BS2                        GPIO_BSRR_BS2_Msk                 /*!< Port x Set bit 2 */\r
+#define GPIO_BSRR_BS3_Pos                    (3U)                              \r
+#define GPIO_BSRR_BS3_Msk                    (0x1UL << GPIO_BSRR_BS3_Pos)       /*!< 0x00000008 */\r
+#define GPIO_BSRR_BS3                        GPIO_BSRR_BS3_Msk                 /*!< Port x Set bit 3 */\r
+#define GPIO_BSRR_BS4_Pos                    (4U)                              \r
+#define GPIO_BSRR_BS4_Msk                    (0x1UL << GPIO_BSRR_BS4_Pos)       /*!< 0x00000010 */\r
+#define GPIO_BSRR_BS4                        GPIO_BSRR_BS4_Msk                 /*!< Port x Set bit 4 */\r
+#define GPIO_BSRR_BS5_Pos                    (5U)                              \r
+#define GPIO_BSRR_BS5_Msk                    (0x1UL << GPIO_BSRR_BS5_Pos)       /*!< 0x00000020 */\r
+#define GPIO_BSRR_BS5                        GPIO_BSRR_BS5_Msk                 /*!< Port x Set bit 5 */\r
+#define GPIO_BSRR_BS6_Pos                    (6U)                              \r
+#define GPIO_BSRR_BS6_Msk                    (0x1UL << GPIO_BSRR_BS6_Pos)       /*!< 0x00000040 */\r
+#define GPIO_BSRR_BS6                        GPIO_BSRR_BS6_Msk                 /*!< Port x Set bit 6 */\r
+#define GPIO_BSRR_BS7_Pos                    (7U)                              \r
+#define GPIO_BSRR_BS7_Msk                    (0x1UL << GPIO_BSRR_BS7_Pos)       /*!< 0x00000080 */\r
+#define GPIO_BSRR_BS7                        GPIO_BSRR_BS7_Msk                 /*!< Port x Set bit 7 */\r
+#define GPIO_BSRR_BS8_Pos                    (8U)                              \r
+#define GPIO_BSRR_BS8_Msk                    (0x1UL << GPIO_BSRR_BS8_Pos)       /*!< 0x00000100 */\r
+#define GPIO_BSRR_BS8                        GPIO_BSRR_BS8_Msk                 /*!< Port x Set bit 8 */\r
+#define GPIO_BSRR_BS9_Pos                    (9U)                              \r
+#define GPIO_BSRR_BS9_Msk                    (0x1UL << GPIO_BSRR_BS9_Pos)       /*!< 0x00000200 */\r
+#define GPIO_BSRR_BS9                        GPIO_BSRR_BS9_Msk                 /*!< Port x Set bit 9 */\r
+#define GPIO_BSRR_BS10_Pos                   (10U)                             \r
+#define GPIO_BSRR_BS10_Msk                   (0x1UL << GPIO_BSRR_BS10_Pos)      /*!< 0x00000400 */\r
+#define GPIO_BSRR_BS10                       GPIO_BSRR_BS10_Msk                /*!< Port x Set bit 10 */\r
+#define GPIO_BSRR_BS11_Pos                   (11U)                             \r
+#define GPIO_BSRR_BS11_Msk                   (0x1UL << GPIO_BSRR_BS11_Pos)      /*!< 0x00000800 */\r
+#define GPIO_BSRR_BS11                       GPIO_BSRR_BS11_Msk                /*!< Port x Set bit 11 */\r
+#define GPIO_BSRR_BS12_Pos                   (12U)                             \r
+#define GPIO_BSRR_BS12_Msk                   (0x1UL << GPIO_BSRR_BS12_Pos)      /*!< 0x00001000 */\r
+#define GPIO_BSRR_BS12                       GPIO_BSRR_BS12_Msk                /*!< Port x Set bit 12 */\r
+#define GPIO_BSRR_BS13_Pos                   (13U)                             \r
+#define GPIO_BSRR_BS13_Msk                   (0x1UL << GPIO_BSRR_BS13_Pos)      /*!< 0x00002000 */\r
+#define GPIO_BSRR_BS13                       GPIO_BSRR_BS13_Msk                /*!< Port x Set bit 13 */\r
+#define GPIO_BSRR_BS14_Pos                   (14U)                             \r
+#define GPIO_BSRR_BS14_Msk                   (0x1UL << GPIO_BSRR_BS14_Pos)      /*!< 0x00004000 */\r
+#define GPIO_BSRR_BS14                       GPIO_BSRR_BS14_Msk                /*!< Port x Set bit 14 */\r
+#define GPIO_BSRR_BS15_Pos                   (15U)                             \r
+#define GPIO_BSRR_BS15_Msk                   (0x1UL << GPIO_BSRR_BS15_Pos)      /*!< 0x00008000 */\r
+#define GPIO_BSRR_BS15                       GPIO_BSRR_BS15_Msk                /*!< Port x Set bit 15 */\r
+\r
+#define GPIO_BSRR_BR0_Pos                    (16U)                             \r
+#define GPIO_BSRR_BR0_Msk                    (0x1UL << GPIO_BSRR_BR0_Pos)       /*!< 0x00010000 */\r
+#define GPIO_BSRR_BR0                        GPIO_BSRR_BR0_Msk                 /*!< Port x Reset bit 0 */\r
+#define GPIO_BSRR_BR1_Pos                    (17U)                             \r
+#define GPIO_BSRR_BR1_Msk                    (0x1UL << GPIO_BSRR_BR1_Pos)       /*!< 0x00020000 */\r
+#define GPIO_BSRR_BR1                        GPIO_BSRR_BR1_Msk                 /*!< Port x Reset bit 1 */\r
+#define GPIO_BSRR_BR2_Pos                    (18U)                             \r
+#define GPIO_BSRR_BR2_Msk                    (0x1UL << GPIO_BSRR_BR2_Pos)       /*!< 0x00040000 */\r
+#define GPIO_BSRR_BR2                        GPIO_BSRR_BR2_Msk                 /*!< Port x Reset bit 2 */\r
+#define GPIO_BSRR_BR3_Pos                    (19U)                             \r
+#define GPIO_BSRR_BR3_Msk                    (0x1UL << GPIO_BSRR_BR3_Pos)       /*!< 0x00080000 */\r
+#define GPIO_BSRR_BR3                        GPIO_BSRR_BR3_Msk                 /*!< Port x Reset bit 3 */\r
+#define GPIO_BSRR_BR4_Pos                    (20U)                             \r
+#define GPIO_BSRR_BR4_Msk                    (0x1UL << GPIO_BSRR_BR4_Pos)       /*!< 0x00100000 */\r
+#define GPIO_BSRR_BR4                        GPIO_BSRR_BR4_Msk                 /*!< Port x Reset bit 4 */\r
+#define GPIO_BSRR_BR5_Pos                    (21U)                             \r
+#define GPIO_BSRR_BR5_Msk                    (0x1UL << GPIO_BSRR_BR5_Pos)       /*!< 0x00200000 */\r
+#define GPIO_BSRR_BR5                        GPIO_BSRR_BR5_Msk                 /*!< Port x Reset bit 5 */\r
+#define GPIO_BSRR_BR6_Pos                    (22U)                             \r
+#define GPIO_BSRR_BR6_Msk                    (0x1UL << GPIO_BSRR_BR6_Pos)       /*!< 0x00400000 */\r
+#define GPIO_BSRR_BR6                        GPIO_BSRR_BR6_Msk                 /*!< Port x Reset bit 6 */\r
+#define GPIO_BSRR_BR7_Pos                    (23U)                             \r
+#define GPIO_BSRR_BR7_Msk                    (0x1UL << GPIO_BSRR_BR7_Pos)       /*!< 0x00800000 */\r
+#define GPIO_BSRR_BR7                        GPIO_BSRR_BR7_Msk                 /*!< Port x Reset bit 7 */\r
+#define GPIO_BSRR_BR8_Pos                    (24U)                             \r
+#define GPIO_BSRR_BR8_Msk                    (0x1UL << GPIO_BSRR_BR8_Pos)       /*!< 0x01000000 */\r
+#define GPIO_BSRR_BR8                        GPIO_BSRR_BR8_Msk                 /*!< Port x Reset bit 8 */\r
+#define GPIO_BSRR_BR9_Pos                    (25U)                             \r
+#define GPIO_BSRR_BR9_Msk                    (0x1UL << GPIO_BSRR_BR9_Pos)       /*!< 0x02000000 */\r
+#define GPIO_BSRR_BR9                        GPIO_BSRR_BR9_Msk                 /*!< Port x Reset bit 9 */\r
+#define GPIO_BSRR_BR10_Pos                   (26U)                             \r
+#define GPIO_BSRR_BR10_Msk                   (0x1UL << GPIO_BSRR_BR10_Pos)      /*!< 0x04000000 */\r
+#define GPIO_BSRR_BR10                       GPIO_BSRR_BR10_Msk                /*!< Port x Reset bit 10 */\r
+#define GPIO_BSRR_BR11_Pos                   (27U)                             \r
+#define GPIO_BSRR_BR11_Msk                   (0x1UL << GPIO_BSRR_BR11_Pos)      /*!< 0x08000000 */\r
+#define GPIO_BSRR_BR11                       GPIO_BSRR_BR11_Msk                /*!< Port x Reset bit 11 */\r
+#define GPIO_BSRR_BR12_Pos                   (28U)                             \r
+#define GPIO_BSRR_BR12_Msk                   (0x1UL << GPIO_BSRR_BR12_Pos)      /*!< 0x10000000 */\r
+#define GPIO_BSRR_BR12                       GPIO_BSRR_BR12_Msk                /*!< Port x Reset bit 12 */\r
+#define GPIO_BSRR_BR13_Pos                   (29U)                             \r
+#define GPIO_BSRR_BR13_Msk                   (0x1UL << GPIO_BSRR_BR13_Pos)      /*!< 0x20000000 */\r
+#define GPIO_BSRR_BR13                       GPIO_BSRR_BR13_Msk                /*!< Port x Reset bit 13 */\r
+#define GPIO_BSRR_BR14_Pos                   (30U)                             \r
+#define GPIO_BSRR_BR14_Msk                   (0x1UL << GPIO_BSRR_BR14_Pos)      /*!< 0x40000000 */\r
+#define GPIO_BSRR_BR14                       GPIO_BSRR_BR14_Msk                /*!< Port x Reset bit 14 */\r
+#define GPIO_BSRR_BR15_Pos                   (31U)                             \r
+#define GPIO_BSRR_BR15_Msk                   (0x1UL << GPIO_BSRR_BR15_Pos)      /*!< 0x80000000 */\r
+#define GPIO_BSRR_BR15                       GPIO_BSRR_BR15_Msk                /*!< Port x Reset bit 15 */\r
+\r
+/*******************  Bit definition for GPIO_BRR register  *******************/\r
+#define GPIO_BRR_BR0_Pos                     (0U)                              \r
+#define GPIO_BRR_BR0_Msk                     (0x1UL << GPIO_BRR_BR0_Pos)        /*!< 0x00000001 */\r
+#define GPIO_BRR_BR0                         GPIO_BRR_BR0_Msk                  /*!< Port x Reset bit 0 */\r
+#define GPIO_BRR_BR1_Pos                     (1U)                              \r
+#define GPIO_BRR_BR1_Msk                     (0x1UL << GPIO_BRR_BR1_Pos)        /*!< 0x00000002 */\r
+#define GPIO_BRR_BR1                         GPIO_BRR_BR1_Msk                  /*!< Port x Reset bit 1 */\r
+#define GPIO_BRR_BR2_Pos                     (2U)                              \r
+#define GPIO_BRR_BR2_Msk                     (0x1UL << GPIO_BRR_BR2_Pos)        /*!< 0x00000004 */\r
+#define GPIO_BRR_BR2                         GPIO_BRR_BR2_Msk                  /*!< Port x Reset bit 2 */\r
+#define GPIO_BRR_BR3_Pos                     (3U)                              \r
+#define GPIO_BRR_BR3_Msk                     (0x1UL << GPIO_BRR_BR3_Pos)        /*!< 0x00000008 */\r
+#define GPIO_BRR_BR3                         GPIO_BRR_BR3_Msk                  /*!< Port x Reset bit 3 */\r
+#define GPIO_BRR_BR4_Pos                     (4U)                              \r
+#define GPIO_BRR_BR4_Msk                     (0x1UL << GPIO_BRR_BR4_Pos)        /*!< 0x00000010 */\r
+#define GPIO_BRR_BR4                         GPIO_BRR_BR4_Msk                  /*!< Port x Reset bit 4 */\r
+#define GPIO_BRR_BR5_Pos                     (5U)                              \r
+#define GPIO_BRR_BR5_Msk                     (0x1UL << GPIO_BRR_BR5_Pos)        /*!< 0x00000020 */\r
+#define GPIO_BRR_BR5                         GPIO_BRR_BR5_Msk                  /*!< Port x Reset bit 5 */\r
+#define GPIO_BRR_BR6_Pos                     (6U)                              \r
+#define GPIO_BRR_BR6_Msk                     (0x1UL << GPIO_BRR_BR6_Pos)        /*!< 0x00000040 */\r
+#define GPIO_BRR_BR6                         GPIO_BRR_BR6_Msk                  /*!< Port x Reset bit 6 */\r
+#define GPIO_BRR_BR7_Pos                     (7U)                              \r
+#define GPIO_BRR_BR7_Msk                     (0x1UL << GPIO_BRR_BR7_Pos)        /*!< 0x00000080 */\r
+#define GPIO_BRR_BR7                         GPIO_BRR_BR7_Msk                  /*!< Port x Reset bit 7 */\r
+#define GPIO_BRR_BR8_Pos                     (8U)                              \r
+#define GPIO_BRR_BR8_Msk                     (0x1UL << GPIO_BRR_BR8_Pos)        /*!< 0x00000100 */\r
+#define GPIO_BRR_BR8                         GPIO_BRR_BR8_Msk                  /*!< Port x Reset bit 8 */\r
+#define GPIO_BRR_BR9_Pos                     (9U)                              \r
+#define GPIO_BRR_BR9_Msk                     (0x1UL << GPIO_BRR_BR9_Pos)        /*!< 0x00000200 */\r
+#define GPIO_BRR_BR9                         GPIO_BRR_BR9_Msk                  /*!< Port x Reset bit 9 */\r
+#define GPIO_BRR_BR10_Pos                    (10U)                             \r
+#define GPIO_BRR_BR10_Msk                    (0x1UL << GPIO_BRR_BR10_Pos)       /*!< 0x00000400 */\r
+#define GPIO_BRR_BR10                        GPIO_BRR_BR10_Msk                 /*!< Port x Reset bit 10 */\r
+#define GPIO_BRR_BR11_Pos                    (11U)                             \r
+#define GPIO_BRR_BR11_Msk                    (0x1UL << GPIO_BRR_BR11_Pos)       /*!< 0x00000800 */\r
+#define GPIO_BRR_BR11                        GPIO_BRR_BR11_Msk                 /*!< Port x Reset bit 11 */\r
+#define GPIO_BRR_BR12_Pos                    (12U)                             \r
+#define GPIO_BRR_BR12_Msk                    (0x1UL << GPIO_BRR_BR12_Pos)       /*!< 0x00001000 */\r
+#define GPIO_BRR_BR12                        GPIO_BRR_BR12_Msk                 /*!< Port x Reset bit 12 */\r
+#define GPIO_BRR_BR13_Pos                    (13U)                             \r
+#define GPIO_BRR_BR13_Msk                    (0x1UL << GPIO_BRR_BR13_Pos)       /*!< 0x00002000 */\r
+#define GPIO_BRR_BR13                        GPIO_BRR_BR13_Msk                 /*!< Port x Reset bit 13 */\r
+#define GPIO_BRR_BR14_Pos                    (14U)                             \r
+#define GPIO_BRR_BR14_Msk                    (0x1UL << GPIO_BRR_BR14_Pos)       /*!< 0x00004000 */\r
+#define GPIO_BRR_BR14                        GPIO_BRR_BR14_Msk                 /*!< Port x Reset bit 14 */\r
+#define GPIO_BRR_BR15_Pos                    (15U)                             \r
+#define GPIO_BRR_BR15_Msk                    (0x1UL << GPIO_BRR_BR15_Pos)       /*!< 0x00008000 */\r
+#define GPIO_BRR_BR15                        GPIO_BRR_BR15_Msk                 /*!< Port x Reset bit 15 */\r
+\r
+/******************  Bit definition for GPIO_LCKR register  *******************/\r
+#define GPIO_LCKR_LCK0_Pos                   (0U)                              \r
+#define GPIO_LCKR_LCK0_Msk                   (0x1UL << GPIO_LCKR_LCK0_Pos)      /*!< 0x00000001 */\r
+#define GPIO_LCKR_LCK0                       GPIO_LCKR_LCK0_Msk                /*!< Port x Lock bit 0 */\r
+#define GPIO_LCKR_LCK1_Pos                   (1U)                              \r
+#define GPIO_LCKR_LCK1_Msk                   (0x1UL << GPIO_LCKR_LCK1_Pos)      /*!< 0x00000002 */\r
+#define GPIO_LCKR_LCK1                       GPIO_LCKR_LCK1_Msk                /*!< Port x Lock bit 1 */\r
+#define GPIO_LCKR_LCK2_Pos                   (2U)                              \r
+#define GPIO_LCKR_LCK2_Msk                   (0x1UL << GPIO_LCKR_LCK2_Pos)      /*!< 0x00000004 */\r
+#define GPIO_LCKR_LCK2                       GPIO_LCKR_LCK2_Msk                /*!< Port x Lock bit 2 */\r
+#define GPIO_LCKR_LCK3_Pos                   (3U)                              \r
+#define GPIO_LCKR_LCK3_Msk                   (0x1UL << GPIO_LCKR_LCK3_Pos)      /*!< 0x00000008 */\r
+#define GPIO_LCKR_LCK3                       GPIO_LCKR_LCK3_Msk                /*!< Port x Lock bit 3 */\r
+#define GPIO_LCKR_LCK4_Pos                   (4U)                              \r
+#define GPIO_LCKR_LCK4_Msk                   (0x1UL << GPIO_LCKR_LCK4_Pos)      /*!< 0x00000010 */\r
+#define GPIO_LCKR_LCK4                       GPIO_LCKR_LCK4_Msk                /*!< Port x Lock bit 4 */\r
+#define GPIO_LCKR_LCK5_Pos                   (5U)                              \r
+#define GPIO_LCKR_LCK5_Msk                   (0x1UL << GPIO_LCKR_LCK5_Pos)      /*!< 0x00000020 */\r
+#define GPIO_LCKR_LCK5                       GPIO_LCKR_LCK5_Msk                /*!< Port x Lock bit 5 */\r
+#define GPIO_LCKR_LCK6_Pos                   (6U)                              \r
+#define GPIO_LCKR_LCK6_Msk                   (0x1UL << GPIO_LCKR_LCK6_Pos)      /*!< 0x00000040 */\r
+#define GPIO_LCKR_LCK6                       GPIO_LCKR_LCK6_Msk                /*!< Port x Lock bit 6 */\r
+#define GPIO_LCKR_LCK7_Pos                   (7U)                              \r
+#define GPIO_LCKR_LCK7_Msk                   (0x1UL << GPIO_LCKR_LCK7_Pos)      /*!< 0x00000080 */\r
+#define GPIO_LCKR_LCK7                       GPIO_LCKR_LCK7_Msk                /*!< Port x Lock bit 7 */\r
+#define GPIO_LCKR_LCK8_Pos                   (8U)                              \r
+#define GPIO_LCKR_LCK8_Msk                   (0x1UL << GPIO_LCKR_LCK8_Pos)      /*!< 0x00000100 */\r
+#define GPIO_LCKR_LCK8                       GPIO_LCKR_LCK8_Msk                /*!< Port x Lock bit 8 */\r
+#define GPIO_LCKR_LCK9_Pos                   (9U)                              \r
+#define GPIO_LCKR_LCK9_Msk                   (0x1UL << GPIO_LCKR_LCK9_Pos)      /*!< 0x00000200 */\r
+#define GPIO_LCKR_LCK9                       GPIO_LCKR_LCK9_Msk                /*!< Port x Lock bit 9 */\r
+#define GPIO_LCKR_LCK10_Pos                  (10U)                             \r
+#define GPIO_LCKR_LCK10_Msk                  (0x1UL << GPIO_LCKR_LCK10_Pos)     /*!< 0x00000400 */\r
+#define GPIO_LCKR_LCK10                      GPIO_LCKR_LCK10_Msk               /*!< Port x Lock bit 10 */\r
+#define GPIO_LCKR_LCK11_Pos                  (11U)                             \r
+#define GPIO_LCKR_LCK11_Msk                  (0x1UL << GPIO_LCKR_LCK11_Pos)     /*!< 0x00000800 */\r
+#define GPIO_LCKR_LCK11                      GPIO_LCKR_LCK11_Msk               /*!< Port x Lock bit 11 */\r
+#define GPIO_LCKR_LCK12_Pos                  (12U)                             \r
+#define GPIO_LCKR_LCK12_Msk                  (0x1UL << GPIO_LCKR_LCK12_Pos)     /*!< 0x00001000 */\r
+#define GPIO_LCKR_LCK12                      GPIO_LCKR_LCK12_Msk               /*!< Port x Lock bit 12 */\r
+#define GPIO_LCKR_LCK13_Pos                  (13U)                             \r
+#define GPIO_LCKR_LCK13_Msk                  (0x1UL << GPIO_LCKR_LCK13_Pos)     /*!< 0x00002000 */\r
+#define GPIO_LCKR_LCK13                      GPIO_LCKR_LCK13_Msk               /*!< Port x Lock bit 13 */\r
+#define GPIO_LCKR_LCK14_Pos                  (14U)                             \r
+#define GPIO_LCKR_LCK14_Msk                  (0x1UL << GPIO_LCKR_LCK14_Pos)     /*!< 0x00004000 */\r
+#define GPIO_LCKR_LCK14                      GPIO_LCKR_LCK14_Msk               /*!< Port x Lock bit 14 */\r
+#define GPIO_LCKR_LCK15_Pos                  (15U)                             \r
+#define GPIO_LCKR_LCK15_Msk                  (0x1UL << GPIO_LCKR_LCK15_Pos)     /*!< 0x00008000 */\r
+#define GPIO_LCKR_LCK15                      GPIO_LCKR_LCK15_Msk               /*!< Port x Lock bit 15 */\r
+#define GPIO_LCKR_LCKK_Pos                   (16U)                             \r
+#define GPIO_LCKR_LCKK_Msk                   (0x1UL << GPIO_LCKR_LCKK_Pos)      /*!< 0x00010000 */\r
+#define GPIO_LCKR_LCKK                       GPIO_LCKR_LCKK_Msk                /*!< Lock key */\r
+\r
+/*----------------------------------------------------------------------------*/\r
+\r
+/******************  Bit definition for AFIO_EVCR register  *******************/\r
+#define AFIO_EVCR_PIN_Pos                    (0U)                              \r
+#define AFIO_EVCR_PIN_Msk                    (0xFUL << AFIO_EVCR_PIN_Pos)       /*!< 0x0000000F */\r
+#define AFIO_EVCR_PIN                        AFIO_EVCR_PIN_Msk                 /*!< PIN[3:0] bits (Pin selection) */\r
+#define AFIO_EVCR_PIN_0                      (0x1UL << AFIO_EVCR_PIN_Pos)       /*!< 0x00000001 */\r
+#define AFIO_EVCR_PIN_1                      (0x2UL << AFIO_EVCR_PIN_Pos)       /*!< 0x00000002 */\r
+#define AFIO_EVCR_PIN_2                      (0x4UL << AFIO_EVCR_PIN_Pos)       /*!< 0x00000004 */\r
+#define AFIO_EVCR_PIN_3                      (0x8UL << AFIO_EVCR_PIN_Pos)       /*!< 0x00000008 */\r
+\r
+/*!< PIN configuration */\r
+#define AFIO_EVCR_PIN_PX0                    0x00000000U                       /*!< Pin 0 selected */\r
+#define AFIO_EVCR_PIN_PX1_Pos                (0U)                              \r
+#define AFIO_EVCR_PIN_PX1_Msk                (0x1UL << AFIO_EVCR_PIN_PX1_Pos)   /*!< 0x00000001 */\r
+#define AFIO_EVCR_PIN_PX1                    AFIO_EVCR_PIN_PX1_Msk             /*!< Pin 1 selected */\r
+#define AFIO_EVCR_PIN_PX2_Pos                (1U)                              \r
+#define AFIO_EVCR_PIN_PX2_Msk                (0x1UL << AFIO_EVCR_PIN_PX2_Pos)   /*!< 0x00000002 */\r
+#define AFIO_EVCR_PIN_PX2                    AFIO_EVCR_PIN_PX2_Msk             /*!< Pin 2 selected */\r
+#define AFIO_EVCR_PIN_PX3_Pos                (0U)                              \r
+#define AFIO_EVCR_PIN_PX3_Msk                (0x3UL << AFIO_EVCR_PIN_PX3_Pos)   /*!< 0x00000003 */\r
+#define AFIO_EVCR_PIN_PX3                    AFIO_EVCR_PIN_PX3_Msk             /*!< Pin 3 selected */\r
+#define AFIO_EVCR_PIN_PX4_Pos                (2U)                              \r
+#define AFIO_EVCR_PIN_PX4_Msk                (0x1UL << AFIO_EVCR_PIN_PX4_Pos)   /*!< 0x00000004 */\r
+#define AFIO_EVCR_PIN_PX4                    AFIO_EVCR_PIN_PX4_Msk             /*!< Pin 4 selected */\r
+#define AFIO_EVCR_PIN_PX5_Pos                (0U)                              \r
+#define AFIO_EVCR_PIN_PX5_Msk                (0x5UL << AFIO_EVCR_PIN_PX5_Pos)   /*!< 0x00000005 */\r
+#define AFIO_EVCR_PIN_PX5                    AFIO_EVCR_PIN_PX5_Msk             /*!< Pin 5 selected */\r
+#define AFIO_EVCR_PIN_PX6_Pos                (1U)                              \r
+#define AFIO_EVCR_PIN_PX6_Msk                (0x3UL << AFIO_EVCR_PIN_PX6_Pos)   /*!< 0x00000006 */\r
+#define AFIO_EVCR_PIN_PX6                    AFIO_EVCR_PIN_PX6_Msk             /*!< Pin 6 selected */\r
+#define AFIO_EVCR_PIN_PX7_Pos                (0U)                              \r
+#define AFIO_EVCR_PIN_PX7_Msk                (0x7UL << AFIO_EVCR_PIN_PX7_Pos)   /*!< 0x00000007 */\r
+#define AFIO_EVCR_PIN_PX7                    AFIO_EVCR_PIN_PX7_Msk             /*!< Pin 7 selected */\r
+#define AFIO_EVCR_PIN_PX8_Pos                (3U)                              \r
+#define AFIO_EVCR_PIN_PX8_Msk                (0x1UL << AFIO_EVCR_PIN_PX8_Pos)   /*!< 0x00000008 */\r
+#define AFIO_EVCR_PIN_PX8                    AFIO_EVCR_PIN_PX8_Msk             /*!< Pin 8 selected */\r
+#define AFIO_EVCR_PIN_PX9_Pos                (0U)                              \r
+#define AFIO_EVCR_PIN_PX9_Msk                (0x9UL << AFIO_EVCR_PIN_PX9_Pos)   /*!< 0x00000009 */\r
+#define AFIO_EVCR_PIN_PX9                    AFIO_EVCR_PIN_PX9_Msk             /*!< Pin 9 selected */\r
+#define AFIO_EVCR_PIN_PX10_Pos               (1U)                              \r
+#define AFIO_EVCR_PIN_PX10_Msk               (0x5UL << AFIO_EVCR_PIN_PX10_Pos)  /*!< 0x0000000A */\r
+#define AFIO_EVCR_PIN_PX10                   AFIO_EVCR_PIN_PX10_Msk            /*!< Pin 10 selected */\r
+#define AFIO_EVCR_PIN_PX11_Pos               (0U)                              \r
+#define AFIO_EVCR_PIN_PX11_Msk               (0xBUL << AFIO_EVCR_PIN_PX11_Pos)  /*!< 0x0000000B */\r
+#define AFIO_EVCR_PIN_PX11                   AFIO_EVCR_PIN_PX11_Msk            /*!< Pin 11 selected */\r
+#define AFIO_EVCR_PIN_PX12_Pos               (2U)                              \r
+#define AFIO_EVCR_PIN_PX12_Msk               (0x3UL << AFIO_EVCR_PIN_PX12_Pos)  /*!< 0x0000000C */\r
+#define AFIO_EVCR_PIN_PX12                   AFIO_EVCR_PIN_PX12_Msk            /*!< Pin 12 selected */\r
+#define AFIO_EVCR_PIN_PX13_Pos               (0U)                              \r
+#define AFIO_EVCR_PIN_PX13_Msk               (0xDUL << AFIO_EVCR_PIN_PX13_Pos)  /*!< 0x0000000D */\r
+#define AFIO_EVCR_PIN_PX13                   AFIO_EVCR_PIN_PX13_Msk            /*!< Pin 13 selected */\r
+#define AFIO_EVCR_PIN_PX14_Pos               (1U)                              \r
+#define AFIO_EVCR_PIN_PX14_Msk               (0x7UL << AFIO_EVCR_PIN_PX14_Pos)  /*!< 0x0000000E */\r
+#define AFIO_EVCR_PIN_PX14                   AFIO_EVCR_PIN_PX14_Msk            /*!< Pin 14 selected */\r
+#define AFIO_EVCR_PIN_PX15_Pos               (0U)                              \r
+#define AFIO_EVCR_PIN_PX15_Msk               (0xFUL << AFIO_EVCR_PIN_PX15_Pos)  /*!< 0x0000000F */\r
+#define AFIO_EVCR_PIN_PX15                   AFIO_EVCR_PIN_PX15_Msk            /*!< Pin 15 selected */\r
+\r
+#define AFIO_EVCR_PORT_Pos                   (4U)                              \r
+#define AFIO_EVCR_PORT_Msk                   (0x7UL << AFIO_EVCR_PORT_Pos)      /*!< 0x00000070 */\r
+#define AFIO_EVCR_PORT                       AFIO_EVCR_PORT_Msk                /*!< PORT[2:0] bits (Port selection) */\r
+#define AFIO_EVCR_PORT_0                     (0x1UL << AFIO_EVCR_PORT_Pos)      /*!< 0x00000010 */\r
+#define AFIO_EVCR_PORT_1                     (0x2UL << AFIO_EVCR_PORT_Pos)      /*!< 0x00000020 */\r
+#define AFIO_EVCR_PORT_2                     (0x4UL << AFIO_EVCR_PORT_Pos)      /*!< 0x00000040 */\r
+\r
+/*!< PORT configuration */\r
+#define AFIO_EVCR_PORT_PA                    0x00000000                        /*!< Port A selected */\r
+#define AFIO_EVCR_PORT_PB_Pos                (4U)                              \r
+#define AFIO_EVCR_PORT_PB_Msk                (0x1UL << AFIO_EVCR_PORT_PB_Pos)   /*!< 0x00000010 */\r
+#define AFIO_EVCR_PORT_PB                    AFIO_EVCR_PORT_PB_Msk             /*!< Port B selected */\r
+#define AFIO_EVCR_PORT_PC_Pos                (5U)                              \r
+#define AFIO_EVCR_PORT_PC_Msk                (0x1UL << AFIO_EVCR_PORT_PC_Pos)   /*!< 0x00000020 */\r
+#define AFIO_EVCR_PORT_PC                    AFIO_EVCR_PORT_PC_Msk             /*!< Port C selected */\r
+#define AFIO_EVCR_PORT_PD_Pos                (4U)                              \r
+#define AFIO_EVCR_PORT_PD_Msk                (0x3UL << AFIO_EVCR_PORT_PD_Pos)   /*!< 0x00000030 */\r
+#define AFIO_EVCR_PORT_PD                    AFIO_EVCR_PORT_PD_Msk             /*!< Port D selected */\r
+#define AFIO_EVCR_PORT_PE_Pos                (6U)                              \r
+#define AFIO_EVCR_PORT_PE_Msk                (0x1UL << AFIO_EVCR_PORT_PE_Pos)   /*!< 0x00000040 */\r
+#define AFIO_EVCR_PORT_PE                    AFIO_EVCR_PORT_PE_Msk             /*!< Port E selected */\r
+\r
+#define AFIO_EVCR_EVOE_Pos                   (7U)                              \r
+#define AFIO_EVCR_EVOE_Msk                   (0x1UL << AFIO_EVCR_EVOE_Pos)      /*!< 0x00000080 */\r
+#define AFIO_EVCR_EVOE                       AFIO_EVCR_EVOE_Msk                /*!< Event Output Enable */\r
+\r
+/******************  Bit definition for AFIO_MAPR register  *******************/\r
+#define AFIO_MAPR_SPI1_REMAP_Pos             (0U)                              \r
+#define AFIO_MAPR_SPI1_REMAP_Msk             (0x1UL << AFIO_MAPR_SPI1_REMAP_Pos) /*!< 0x00000001 */\r
+#define AFIO_MAPR_SPI1_REMAP                 AFIO_MAPR_SPI1_REMAP_Msk          /*!< SPI1 remapping */\r
+#define AFIO_MAPR_I2C1_REMAP_Pos             (1U)                              \r
+#define AFIO_MAPR_I2C1_REMAP_Msk             (0x1UL << AFIO_MAPR_I2C1_REMAP_Pos) /*!< 0x00000002 */\r
+#define AFIO_MAPR_I2C1_REMAP                 AFIO_MAPR_I2C1_REMAP_Msk          /*!< I2C1 remapping */\r
+#define AFIO_MAPR_USART1_REMAP_Pos           (2U)                              \r
+#define AFIO_MAPR_USART1_REMAP_Msk           (0x1UL << AFIO_MAPR_USART1_REMAP_Pos) /*!< 0x00000004 */\r
+#define AFIO_MAPR_USART1_REMAP               AFIO_MAPR_USART1_REMAP_Msk        /*!< USART1 remapping */\r
+#define AFIO_MAPR_USART2_REMAP_Pos           (3U)                              \r
+#define AFIO_MAPR_USART2_REMAP_Msk           (0x1UL << AFIO_MAPR_USART2_REMAP_Pos) /*!< 0x00000008 */\r
+#define AFIO_MAPR_USART2_REMAP               AFIO_MAPR_USART2_REMAP_Msk        /*!< USART2 remapping */\r
+\r
+#define AFIO_MAPR_USART3_REMAP_Pos           (4U)                              \r
+#define AFIO_MAPR_USART3_REMAP_Msk           (0x3UL << AFIO_MAPR_USART3_REMAP_Pos) /*!< 0x00000030 */\r
+#define AFIO_MAPR_USART3_REMAP               AFIO_MAPR_USART3_REMAP_Msk        /*!< USART3_REMAP[1:0] bits (USART3 remapping) */\r
+#define AFIO_MAPR_USART3_REMAP_0             (0x1UL << AFIO_MAPR_USART3_REMAP_Pos) /*!< 0x00000010 */\r
+#define AFIO_MAPR_USART3_REMAP_1             (0x2UL << AFIO_MAPR_USART3_REMAP_Pos) /*!< 0x00000020 */\r
+\r
+/* USART3_REMAP configuration */\r
+#define AFIO_MAPR_USART3_REMAP_NOREMAP       0x00000000U                          /*!< No remap (TX/PB10, RX/PB11, CK/PB12, CTS/PB13, RTS/PB14) */\r
+#define AFIO_MAPR_USART3_REMAP_PARTIALREMAP_Pos (4U)                           \r
+#define AFIO_MAPR_USART3_REMAP_PARTIALREMAP_Msk (0x1UL << AFIO_MAPR_USART3_REMAP_PARTIALREMAP_Pos) /*!< 0x00000010 */\r
+#define AFIO_MAPR_USART3_REMAP_PARTIALREMAP  AFIO_MAPR_USART3_REMAP_PARTIALREMAP_Msk /*!< Partial remap (TX/PC10, RX/PC11, CK/PC12, CTS/PB13, RTS/PB14) */\r
+#define AFIO_MAPR_USART3_REMAP_FULLREMAP_Pos (4U)                              \r
+#define AFIO_MAPR_USART3_REMAP_FULLREMAP_Msk (0x3UL << AFIO_MAPR_USART3_REMAP_FULLREMAP_Pos) /*!< 0x00000030 */\r
+#define AFIO_MAPR_USART3_REMAP_FULLREMAP     AFIO_MAPR_USART3_REMAP_FULLREMAP_Msk /*!< Full remap (TX/PD8, RX/PD9, CK/PD10, CTS/PD11, RTS/PD12) */\r
+\r
+#define AFIO_MAPR_TIM1_REMAP_Pos             (6U)                              \r
+#define AFIO_MAPR_TIM1_REMAP_Msk             (0x3UL << AFIO_MAPR_TIM1_REMAP_Pos) /*!< 0x000000C0 */\r
+#define AFIO_MAPR_TIM1_REMAP                 AFIO_MAPR_TIM1_REMAP_Msk          /*!< TIM1_REMAP[1:0] bits (TIM1 remapping) */\r
+#define AFIO_MAPR_TIM1_REMAP_0               (0x1UL << AFIO_MAPR_TIM1_REMAP_Pos) /*!< 0x00000040 */\r
+#define AFIO_MAPR_TIM1_REMAP_1               (0x2UL << AFIO_MAPR_TIM1_REMAP_Pos) /*!< 0x00000080 */\r
+\r
+/*!< TIM1_REMAP configuration */\r
+#define AFIO_MAPR_TIM1_REMAP_NOREMAP         0x00000000U                          /*!< No remap (ETR/PA12, CH1/PA8, CH2/PA9, CH3/PA10, CH4/PA11, BKIN/PB12, CH1N/PB13, CH2N/PB14, CH3N/PB15) */\r
+#define AFIO_MAPR_TIM1_REMAP_PARTIALREMAP_Pos (6U)                             \r
+#define AFIO_MAPR_TIM1_REMAP_PARTIALREMAP_Msk (0x1UL << AFIO_MAPR_TIM1_REMAP_PARTIALREMAP_Pos) /*!< 0x00000040 */\r
+#define AFIO_MAPR_TIM1_REMAP_PARTIALREMAP    AFIO_MAPR_TIM1_REMAP_PARTIALREMAP_Msk /*!< Partial remap (ETR/PA12, CH1/PA8, CH2/PA9, CH3/PA10, CH4/PA11, BKIN/PA6, CH1N/PA7, CH2N/PB0, CH3N/PB1) */\r
+#define AFIO_MAPR_TIM1_REMAP_FULLREMAP_Pos   (6U)                              \r
+#define AFIO_MAPR_TIM1_REMAP_FULLREMAP_Msk   (0x3UL << AFIO_MAPR_TIM1_REMAP_FULLREMAP_Pos) /*!< 0x000000C0 */\r
+#define AFIO_MAPR_TIM1_REMAP_FULLREMAP       AFIO_MAPR_TIM1_REMAP_FULLREMAP_Msk /*!< Full remap (ETR/PE7, CH1/PE9, CH2/PE11, CH3/PE13, CH4/PE14, BKIN/PE15, CH1N/PE8, CH2N/PE10, CH3N/PE12) */\r
+\r
+#define AFIO_MAPR_TIM2_REMAP_Pos             (8U)                              \r
+#define AFIO_MAPR_TIM2_REMAP_Msk             (0x3UL << AFIO_MAPR_TIM2_REMAP_Pos) /*!< 0x00000300 */\r
+#define AFIO_MAPR_TIM2_REMAP                 AFIO_MAPR_TIM2_REMAP_Msk          /*!< TIM2_REMAP[1:0] bits (TIM2 remapping) */\r
+#define AFIO_MAPR_TIM2_REMAP_0               (0x1UL << AFIO_MAPR_TIM2_REMAP_Pos) /*!< 0x00000100 */\r
+#define AFIO_MAPR_TIM2_REMAP_1               (0x2UL << AFIO_MAPR_TIM2_REMAP_Pos) /*!< 0x00000200 */\r
+\r
+/*!< TIM2_REMAP configuration */\r
+#define AFIO_MAPR_TIM2_REMAP_NOREMAP         0x00000000U                          /*!< No remap (CH1/ETR/PA0, CH2/PA1, CH3/PA2, CH4/PA3) */\r
+#define AFIO_MAPR_TIM2_REMAP_PARTIALREMAP1_Pos (8U)                            \r
+#define AFIO_MAPR_TIM2_REMAP_PARTIALREMAP1_Msk (0x1UL << AFIO_MAPR_TIM2_REMAP_PARTIALREMAP1_Pos) /*!< 0x00000100 */\r
+#define AFIO_MAPR_TIM2_REMAP_PARTIALREMAP1   AFIO_MAPR_TIM2_REMAP_PARTIALREMAP1_Msk /*!< Partial remap (CH1/ETR/PA15, CH2/PB3, CH3/PA2, CH4/PA3) */\r
+#define AFIO_MAPR_TIM2_REMAP_PARTIALREMAP2_Pos (9U)                            \r
+#define AFIO_MAPR_TIM2_REMAP_PARTIALREMAP2_Msk (0x1UL << AFIO_MAPR_TIM2_REMAP_PARTIALREMAP2_Pos) /*!< 0x00000200 */\r
+#define AFIO_MAPR_TIM2_REMAP_PARTIALREMAP2   AFIO_MAPR_TIM2_REMAP_PARTIALREMAP2_Msk /*!< Partial remap (CH1/ETR/PA0, CH2/PA1, CH3/PB10, CH4/PB11) */\r
+#define AFIO_MAPR_TIM2_REMAP_FULLREMAP_Pos   (8U)                              \r
+#define AFIO_MAPR_TIM2_REMAP_FULLREMAP_Msk   (0x3UL << AFIO_MAPR_TIM2_REMAP_FULLREMAP_Pos) /*!< 0x00000300 */\r
+#define AFIO_MAPR_TIM2_REMAP_FULLREMAP       AFIO_MAPR_TIM2_REMAP_FULLREMAP_Msk /*!< Full remap (CH1/ETR/PA15, CH2/PB3, CH3/PB10, CH4/PB11) */\r
+\r
+#define AFIO_MAPR_TIM3_REMAP_Pos             (10U)                             \r
+#define AFIO_MAPR_TIM3_REMAP_Msk             (0x3UL << AFIO_MAPR_TIM3_REMAP_Pos) /*!< 0x00000C00 */\r
+#define AFIO_MAPR_TIM3_REMAP                 AFIO_MAPR_TIM3_REMAP_Msk          /*!< TIM3_REMAP[1:0] bits (TIM3 remapping) */\r
+#define AFIO_MAPR_TIM3_REMAP_0               (0x1UL << AFIO_MAPR_TIM3_REMAP_Pos) /*!< 0x00000400 */\r
+#define AFIO_MAPR_TIM3_REMAP_1               (0x2UL << AFIO_MAPR_TIM3_REMAP_Pos) /*!< 0x00000800 */\r
+\r
+/*!< TIM3_REMAP configuration */\r
+#define AFIO_MAPR_TIM3_REMAP_NOREMAP         0x00000000U                          /*!< No remap (CH1/PA6, CH2/PA7, CH3/PB0, CH4/PB1) */\r
+#define AFIO_MAPR_TIM3_REMAP_PARTIALREMAP_Pos (11U)                            \r
+#define AFIO_MAPR_TIM3_REMAP_PARTIALREMAP_Msk (0x1UL << AFIO_MAPR_TIM3_REMAP_PARTIALREMAP_Pos) /*!< 0x00000800 */\r
+#define AFIO_MAPR_TIM3_REMAP_PARTIALREMAP    AFIO_MAPR_TIM3_REMAP_PARTIALREMAP_Msk /*!< Partial remap (CH1/PB4, CH2/PB5, CH3/PB0, CH4/PB1) */\r
+#define AFIO_MAPR_TIM3_REMAP_FULLREMAP_Pos   (10U)                             \r
+#define AFIO_MAPR_TIM3_REMAP_FULLREMAP_Msk   (0x3UL << AFIO_MAPR_TIM3_REMAP_FULLREMAP_Pos) /*!< 0x00000C00 */\r
+#define AFIO_MAPR_TIM3_REMAP_FULLREMAP       AFIO_MAPR_TIM3_REMAP_FULLREMAP_Msk /*!< Full remap (CH1/PC6, CH2/PC7, CH3/PC8, CH4/PC9) */\r
+\r
+#define AFIO_MAPR_TIM4_REMAP_Pos             (12U)                             \r
+#define AFIO_MAPR_TIM4_REMAP_Msk             (0x1UL << AFIO_MAPR_TIM4_REMAP_Pos) /*!< 0x00001000 */\r
+#define AFIO_MAPR_TIM4_REMAP                 AFIO_MAPR_TIM4_REMAP_Msk          /*!< TIM4_REMAP bit (TIM4 remapping) */\r
+\r
+#define AFIO_MAPR_CAN_REMAP_Pos              (13U)                             \r
+#define AFIO_MAPR_CAN_REMAP_Msk              (0x3UL << AFIO_MAPR_CAN_REMAP_Pos) /*!< 0x00006000 */\r
+#define AFIO_MAPR_CAN_REMAP                  AFIO_MAPR_CAN_REMAP_Msk           /*!< CAN_REMAP[1:0] bits (CAN Alternate function remapping) */\r
+#define AFIO_MAPR_CAN_REMAP_0                (0x1UL << AFIO_MAPR_CAN_REMAP_Pos) /*!< 0x00002000 */\r
+#define AFIO_MAPR_CAN_REMAP_1                (0x2UL << AFIO_MAPR_CAN_REMAP_Pos) /*!< 0x00004000 */\r
+\r
+/*!< CAN_REMAP configuration */\r
+#define AFIO_MAPR_CAN_REMAP_REMAP1           0x00000000U                          /*!< CANRX mapped to PA11, CANTX mapped to PA12 */\r
+#define AFIO_MAPR_CAN_REMAP_REMAP2_Pos       (14U)                             \r
+#define AFIO_MAPR_CAN_REMAP_REMAP2_Msk       (0x1UL << AFIO_MAPR_CAN_REMAP_REMAP2_Pos) /*!< 0x00004000 */\r
+#define AFIO_MAPR_CAN_REMAP_REMAP2           AFIO_MAPR_CAN_REMAP_REMAP2_Msk    /*!< CANRX mapped to PB8, CANTX mapped to PB9 */\r
+#define AFIO_MAPR_CAN_REMAP_REMAP3_Pos       (13U)                             \r
+#define AFIO_MAPR_CAN_REMAP_REMAP3_Msk       (0x3UL << AFIO_MAPR_CAN_REMAP_REMAP3_Pos) /*!< 0x00006000 */\r
+#define AFIO_MAPR_CAN_REMAP_REMAP3           AFIO_MAPR_CAN_REMAP_REMAP3_Msk    /*!< CANRX mapped to PD0, CANTX mapped to PD1 */\r
+\r
+#define AFIO_MAPR_PD01_REMAP_Pos             (15U)                             \r
+#define AFIO_MAPR_PD01_REMAP_Msk             (0x1UL << AFIO_MAPR_PD01_REMAP_Pos) /*!< 0x00008000 */\r
+#define AFIO_MAPR_PD01_REMAP                 AFIO_MAPR_PD01_REMAP_Msk          /*!< Port D0/Port D1 mapping on OSC_IN/OSC_OUT */\r
+\r
+/*!< SWJ_CFG configuration */\r
+#define AFIO_MAPR_SWJ_CFG_Pos                (24U)                             \r
+#define AFIO_MAPR_SWJ_CFG_Msk                (0x7UL << AFIO_MAPR_SWJ_CFG_Pos)   /*!< 0x07000000 */\r
+#define AFIO_MAPR_SWJ_CFG                    AFIO_MAPR_SWJ_CFG_Msk             /*!< SWJ_CFG[2:0] bits (Serial Wire JTAG configuration) */\r
+#define AFIO_MAPR_SWJ_CFG_0                  (0x1UL << AFIO_MAPR_SWJ_CFG_Pos)   /*!< 0x01000000 */\r
+#define AFIO_MAPR_SWJ_CFG_1                  (0x2UL << AFIO_MAPR_SWJ_CFG_Pos)   /*!< 0x02000000 */\r
+#define AFIO_MAPR_SWJ_CFG_2                  (0x4UL << AFIO_MAPR_SWJ_CFG_Pos)   /*!< 0x04000000 */\r
+\r
+#define AFIO_MAPR_SWJ_CFG_RESET              0x00000000U                          /*!< Full SWJ (JTAG-DP + SW-DP) : Reset State */\r
+#define AFIO_MAPR_SWJ_CFG_NOJNTRST_Pos       (24U)                             \r
+#define AFIO_MAPR_SWJ_CFG_NOJNTRST_Msk       (0x1UL << AFIO_MAPR_SWJ_CFG_NOJNTRST_Pos) /*!< 0x01000000 */\r
+#define AFIO_MAPR_SWJ_CFG_NOJNTRST           AFIO_MAPR_SWJ_CFG_NOJNTRST_Msk    /*!< Full SWJ (JTAG-DP + SW-DP) but without JNTRST */\r
+#define AFIO_MAPR_SWJ_CFG_JTAGDISABLE_Pos    (25U)                             \r
+#define AFIO_MAPR_SWJ_CFG_JTAGDISABLE_Msk    (0x1UL << AFIO_MAPR_SWJ_CFG_JTAGDISABLE_Pos) /*!< 0x02000000 */\r
+#define AFIO_MAPR_SWJ_CFG_JTAGDISABLE        AFIO_MAPR_SWJ_CFG_JTAGDISABLE_Msk /*!< JTAG-DP Disabled and SW-DP Enabled */\r
+#define AFIO_MAPR_SWJ_CFG_DISABLE_Pos        (26U)                             \r
+#define AFIO_MAPR_SWJ_CFG_DISABLE_Msk        (0x1UL << AFIO_MAPR_SWJ_CFG_DISABLE_Pos) /*!< 0x04000000 */\r
+#define AFIO_MAPR_SWJ_CFG_DISABLE            AFIO_MAPR_SWJ_CFG_DISABLE_Msk     /*!< JTAG-DP Disabled and SW-DP Disabled */\r
+\r
+\r
+/*****************  Bit definition for AFIO_EXTICR1 register  *****************/\r
+#define AFIO_EXTICR1_EXTI0_Pos               (0U)                              \r
+#define AFIO_EXTICR1_EXTI0_Msk               (0xFUL << AFIO_EXTICR1_EXTI0_Pos)  /*!< 0x0000000F */\r
+#define AFIO_EXTICR1_EXTI0                   AFIO_EXTICR1_EXTI0_Msk            /*!< EXTI 0 configuration */\r
+#define AFIO_EXTICR1_EXTI1_Pos               (4U)                              \r
+#define AFIO_EXTICR1_EXTI1_Msk               (0xFUL << AFIO_EXTICR1_EXTI1_Pos)  /*!< 0x000000F0 */\r
+#define AFIO_EXTICR1_EXTI1                   AFIO_EXTICR1_EXTI1_Msk            /*!< EXTI 1 configuration */\r
+#define AFIO_EXTICR1_EXTI2_Pos               (8U)                              \r
+#define AFIO_EXTICR1_EXTI2_Msk               (0xFUL << AFIO_EXTICR1_EXTI2_Pos)  /*!< 0x00000F00 */\r
+#define AFIO_EXTICR1_EXTI2                   AFIO_EXTICR1_EXTI2_Msk            /*!< EXTI 2 configuration */\r
+#define AFIO_EXTICR1_EXTI3_Pos               (12U)                             \r
+#define AFIO_EXTICR1_EXTI3_Msk               (0xFUL << AFIO_EXTICR1_EXTI3_Pos)  /*!< 0x0000F000 */\r
+#define AFIO_EXTICR1_EXTI3                   AFIO_EXTICR1_EXTI3_Msk            /*!< EXTI 3 configuration */\r
+\r
+/*!< EXTI0 configuration */\r
+#define AFIO_EXTICR1_EXTI0_PA                0x00000000U                          /*!< PA[0] pin */\r
+#define AFIO_EXTICR1_EXTI0_PB_Pos            (0U)                              \r
+#define AFIO_EXTICR1_EXTI0_PB_Msk            (0x1UL << AFIO_EXTICR1_EXTI0_PB_Pos) /*!< 0x00000001 */\r
+#define AFIO_EXTICR1_EXTI0_PB                AFIO_EXTICR1_EXTI0_PB_Msk         /*!< PB[0] pin */\r
+#define AFIO_EXTICR1_EXTI0_PC_Pos            (1U)                              \r
+#define AFIO_EXTICR1_EXTI0_PC_Msk            (0x1UL << AFIO_EXTICR1_EXTI0_PC_Pos) /*!< 0x00000002 */\r
+#define AFIO_EXTICR1_EXTI0_PC                AFIO_EXTICR1_EXTI0_PC_Msk         /*!< PC[0] pin */\r
+#define AFIO_EXTICR1_EXTI0_PD_Pos            (0U)                              \r
+#define AFIO_EXTICR1_EXTI0_PD_Msk            (0x3UL << AFIO_EXTICR1_EXTI0_PD_Pos) /*!< 0x00000003 */\r
+#define AFIO_EXTICR1_EXTI0_PD                AFIO_EXTICR1_EXTI0_PD_Msk         /*!< PD[0] pin */\r
+#define AFIO_EXTICR1_EXTI0_PE_Pos            (2U)                              \r
+#define AFIO_EXTICR1_EXTI0_PE_Msk            (0x1UL << AFIO_EXTICR1_EXTI0_PE_Pos) /*!< 0x00000004 */\r
+#define AFIO_EXTICR1_EXTI0_PE                AFIO_EXTICR1_EXTI0_PE_Msk         /*!< PE[0] pin */\r
+#define AFIO_EXTICR1_EXTI0_PF_Pos            (0U)                              \r
+#define AFIO_EXTICR1_EXTI0_PF_Msk            (0x5UL << AFIO_EXTICR1_EXTI0_PF_Pos) /*!< 0x00000005 */\r
+#define AFIO_EXTICR1_EXTI0_PF                AFIO_EXTICR1_EXTI0_PF_Msk         /*!< PF[0] pin */\r
+#define AFIO_EXTICR1_EXTI0_PG_Pos            (1U)                              \r
+#define AFIO_EXTICR1_EXTI0_PG_Msk            (0x3UL << AFIO_EXTICR1_EXTI0_PG_Pos) /*!< 0x00000006 */\r
+#define AFIO_EXTICR1_EXTI0_PG                AFIO_EXTICR1_EXTI0_PG_Msk         /*!< PG[0] pin */\r
+\r
+/*!< EXTI1 configuration */\r
+#define AFIO_EXTICR1_EXTI1_PA                0x00000000U                          /*!< PA[1] pin */\r
+#define AFIO_EXTICR1_EXTI1_PB_Pos            (4U)                              \r
+#define AFIO_EXTICR1_EXTI1_PB_Msk            (0x1UL << AFIO_EXTICR1_EXTI1_PB_Pos) /*!< 0x00000010 */\r
+#define AFIO_EXTICR1_EXTI1_PB                AFIO_EXTICR1_EXTI1_PB_Msk         /*!< PB[1] pin */\r
+#define AFIO_EXTICR1_EXTI1_PC_Pos            (5U)                              \r
+#define AFIO_EXTICR1_EXTI1_PC_Msk            (0x1UL << AFIO_EXTICR1_EXTI1_PC_Pos) /*!< 0x00000020 */\r
+#define AFIO_EXTICR1_EXTI1_PC                AFIO_EXTICR1_EXTI1_PC_Msk         /*!< PC[1] pin */\r
+#define AFIO_EXTICR1_EXTI1_PD_Pos            (4U)                              \r
+#define AFIO_EXTICR1_EXTI1_PD_Msk            (0x3UL << AFIO_EXTICR1_EXTI1_PD_Pos) /*!< 0x00000030 */\r
+#define AFIO_EXTICR1_EXTI1_PD                AFIO_EXTICR1_EXTI1_PD_Msk         /*!< PD[1] pin */\r
+#define AFIO_EXTICR1_EXTI1_PE_Pos            (6U)                              \r
+#define AFIO_EXTICR1_EXTI1_PE_Msk            (0x1UL << AFIO_EXTICR1_EXTI1_PE_Pos) /*!< 0x00000040 */\r
+#define AFIO_EXTICR1_EXTI1_PE                AFIO_EXTICR1_EXTI1_PE_Msk         /*!< PE[1] pin */\r
+#define AFIO_EXTICR1_EXTI1_PF_Pos            (4U)                              \r
+#define AFIO_EXTICR1_EXTI1_PF_Msk            (0x5UL << AFIO_EXTICR1_EXTI1_PF_Pos) /*!< 0x00000050 */\r
+#define AFIO_EXTICR1_EXTI1_PF                AFIO_EXTICR1_EXTI1_PF_Msk         /*!< PF[1] pin */\r
+#define AFIO_EXTICR1_EXTI1_PG_Pos            (5U)                              \r
+#define AFIO_EXTICR1_EXTI1_PG_Msk            (0x3UL << AFIO_EXTICR1_EXTI1_PG_Pos) /*!< 0x00000060 */\r
+#define AFIO_EXTICR1_EXTI1_PG                AFIO_EXTICR1_EXTI1_PG_Msk         /*!< PG[1] pin */\r
+\r
+/*!< EXTI2 configuration */  \r
+#define AFIO_EXTICR1_EXTI2_PA                0x00000000U                          /*!< PA[2] pin */\r
+#define AFIO_EXTICR1_EXTI2_PB_Pos            (8U)                              \r
+#define AFIO_EXTICR1_EXTI2_PB_Msk            (0x1UL << AFIO_EXTICR1_EXTI2_PB_Pos) /*!< 0x00000100 */\r
+#define AFIO_EXTICR1_EXTI2_PB                AFIO_EXTICR1_EXTI2_PB_Msk         /*!< PB[2] pin */\r
+#define AFIO_EXTICR1_EXTI2_PC_Pos            (9U)                              \r
+#define AFIO_EXTICR1_EXTI2_PC_Msk            (0x1UL << AFIO_EXTICR1_EXTI2_PC_Pos) /*!< 0x00000200 */\r
+#define AFIO_EXTICR1_EXTI2_PC                AFIO_EXTICR1_EXTI2_PC_Msk         /*!< PC[2] pin */\r
+#define AFIO_EXTICR1_EXTI2_PD_Pos            (8U)                              \r
+#define AFIO_EXTICR1_EXTI2_PD_Msk            (0x3UL << AFIO_EXTICR1_EXTI2_PD_Pos) /*!< 0x00000300 */\r
+#define AFIO_EXTICR1_EXTI2_PD                AFIO_EXTICR1_EXTI2_PD_Msk         /*!< PD[2] pin */\r
+#define AFIO_EXTICR1_EXTI2_PE_Pos            (10U)                             \r
+#define AFIO_EXTICR1_EXTI2_PE_Msk            (0x1UL << AFIO_EXTICR1_EXTI2_PE_Pos) /*!< 0x00000400 */\r
+#define AFIO_EXTICR1_EXTI2_PE                AFIO_EXTICR1_EXTI2_PE_Msk         /*!< PE[2] pin */\r
+#define AFIO_EXTICR1_EXTI2_PF_Pos            (8U)                              \r
+#define AFIO_EXTICR1_EXTI2_PF_Msk            (0x5UL << AFIO_EXTICR1_EXTI2_PF_Pos) /*!< 0x00000500 */\r
+#define AFIO_EXTICR1_EXTI2_PF                AFIO_EXTICR1_EXTI2_PF_Msk         /*!< PF[2] pin */\r
+#define AFIO_EXTICR1_EXTI2_PG_Pos            (9U)                              \r
+#define AFIO_EXTICR1_EXTI2_PG_Msk            (0x3UL << AFIO_EXTICR1_EXTI2_PG_Pos) /*!< 0x00000600 */\r
+#define AFIO_EXTICR1_EXTI2_PG                AFIO_EXTICR1_EXTI2_PG_Msk         /*!< PG[2] pin */\r
+\r
+/*!< EXTI3 configuration */\r
+#define AFIO_EXTICR1_EXTI3_PA                0x00000000U                          /*!< PA[3] pin */\r
+#define AFIO_EXTICR1_EXTI3_PB_Pos            (12U)                             \r
+#define AFIO_EXTICR1_EXTI3_PB_Msk            (0x1UL << AFIO_EXTICR1_EXTI3_PB_Pos) /*!< 0x00001000 */\r
+#define AFIO_EXTICR1_EXTI3_PB                AFIO_EXTICR1_EXTI3_PB_Msk         /*!< PB[3] pin */\r
+#define AFIO_EXTICR1_EXTI3_PC_Pos            (13U)                             \r
+#define AFIO_EXTICR1_EXTI3_PC_Msk            (0x1UL << AFIO_EXTICR1_EXTI3_PC_Pos) /*!< 0x00002000 */\r
+#define AFIO_EXTICR1_EXTI3_PC                AFIO_EXTICR1_EXTI3_PC_Msk         /*!< PC[3] pin */\r
+#define AFIO_EXTICR1_EXTI3_PD_Pos            (12U)                             \r
+#define AFIO_EXTICR1_EXTI3_PD_Msk            (0x3UL << AFIO_EXTICR1_EXTI3_PD_Pos) /*!< 0x00003000 */\r
+#define AFIO_EXTICR1_EXTI3_PD                AFIO_EXTICR1_EXTI3_PD_Msk         /*!< PD[3] pin */\r
+#define AFIO_EXTICR1_EXTI3_PE_Pos            (14U)                             \r
+#define AFIO_EXTICR1_EXTI3_PE_Msk            (0x1UL << AFIO_EXTICR1_EXTI3_PE_Pos) /*!< 0x00004000 */\r
+#define AFIO_EXTICR1_EXTI3_PE                AFIO_EXTICR1_EXTI3_PE_Msk         /*!< PE[3] pin */\r
+#define AFIO_EXTICR1_EXTI3_PF_Pos            (12U)                             \r
+#define AFIO_EXTICR1_EXTI3_PF_Msk            (0x5UL << AFIO_EXTICR1_EXTI3_PF_Pos) /*!< 0x00005000 */\r
+#define AFIO_EXTICR1_EXTI3_PF                AFIO_EXTICR1_EXTI3_PF_Msk         /*!< PF[3] pin */\r
+#define AFIO_EXTICR1_EXTI3_PG_Pos            (13U)                             \r
+#define AFIO_EXTICR1_EXTI3_PG_Msk            (0x3UL << AFIO_EXTICR1_EXTI3_PG_Pos) /*!< 0x00006000 */\r
+#define AFIO_EXTICR1_EXTI3_PG                AFIO_EXTICR1_EXTI3_PG_Msk         /*!< PG[3] pin */\r
+\r
+/*****************  Bit definition for AFIO_EXTICR2 register  *****************/\r
+#define AFIO_EXTICR2_EXTI4_Pos               (0U)                              \r
+#define AFIO_EXTICR2_EXTI4_Msk               (0xFUL << AFIO_EXTICR2_EXTI4_Pos)  /*!< 0x0000000F */\r
+#define AFIO_EXTICR2_EXTI4                   AFIO_EXTICR2_EXTI4_Msk            /*!< EXTI 4 configuration */\r
+#define AFIO_EXTICR2_EXTI5_Pos               (4U)                              \r
+#define AFIO_EXTICR2_EXTI5_Msk               (0xFUL << AFIO_EXTICR2_EXTI5_Pos)  /*!< 0x000000F0 */\r
+#define AFIO_EXTICR2_EXTI5                   AFIO_EXTICR2_EXTI5_Msk            /*!< EXTI 5 configuration */\r
+#define AFIO_EXTICR2_EXTI6_Pos               (8U)                              \r
+#define AFIO_EXTICR2_EXTI6_Msk               (0xFUL << AFIO_EXTICR2_EXTI6_Pos)  /*!< 0x00000F00 */\r
+#define AFIO_EXTICR2_EXTI6                   AFIO_EXTICR2_EXTI6_Msk            /*!< EXTI 6 configuration */\r
+#define AFIO_EXTICR2_EXTI7_Pos               (12U)                             \r
+#define AFIO_EXTICR2_EXTI7_Msk               (0xFUL << AFIO_EXTICR2_EXTI7_Pos)  /*!< 0x0000F000 */\r
+#define AFIO_EXTICR2_EXTI7                   AFIO_EXTICR2_EXTI7_Msk            /*!< EXTI 7 configuration */\r
+\r
+/*!< EXTI4 configuration */\r
+#define AFIO_EXTICR2_EXTI4_PA                0x00000000U                          /*!< PA[4] pin */\r
+#define AFIO_EXTICR2_EXTI4_PB_Pos            (0U)                              \r
+#define AFIO_EXTICR2_EXTI4_PB_Msk            (0x1UL << AFIO_EXTICR2_EXTI4_PB_Pos) /*!< 0x00000001 */\r
+#define AFIO_EXTICR2_EXTI4_PB                AFIO_EXTICR2_EXTI4_PB_Msk         /*!< PB[4] pin */\r
+#define AFIO_EXTICR2_EXTI4_PC_Pos            (1U)                              \r
+#define AFIO_EXTICR2_EXTI4_PC_Msk            (0x1UL << AFIO_EXTICR2_EXTI4_PC_Pos) /*!< 0x00000002 */\r
+#define AFIO_EXTICR2_EXTI4_PC                AFIO_EXTICR2_EXTI4_PC_Msk         /*!< PC[4] pin */\r
+#define AFIO_EXTICR2_EXTI4_PD_Pos            (0U)                              \r
+#define AFIO_EXTICR2_EXTI4_PD_Msk            (0x3UL << AFIO_EXTICR2_EXTI4_PD_Pos) /*!< 0x00000003 */\r
+#define AFIO_EXTICR2_EXTI4_PD                AFIO_EXTICR2_EXTI4_PD_Msk         /*!< PD[4] pin */\r
+#define AFIO_EXTICR2_EXTI4_PE_Pos            (2U)                              \r
+#define AFIO_EXTICR2_EXTI4_PE_Msk            (0x1UL << AFIO_EXTICR2_EXTI4_PE_Pos) /*!< 0x00000004 */\r
+#define AFIO_EXTICR2_EXTI4_PE                AFIO_EXTICR2_EXTI4_PE_Msk         /*!< PE[4] pin */\r
+#define AFIO_EXTICR2_EXTI4_PF_Pos            (0U)                              \r
+#define AFIO_EXTICR2_EXTI4_PF_Msk            (0x5UL << AFIO_EXTICR2_EXTI4_PF_Pos) /*!< 0x00000005 */\r
+#define AFIO_EXTICR2_EXTI4_PF                AFIO_EXTICR2_EXTI4_PF_Msk         /*!< PF[4] pin */\r
+#define AFIO_EXTICR2_EXTI4_PG_Pos            (1U)                              \r
+#define AFIO_EXTICR2_EXTI4_PG_Msk            (0x3UL << AFIO_EXTICR2_EXTI4_PG_Pos) /*!< 0x00000006 */\r
+#define AFIO_EXTICR2_EXTI4_PG                AFIO_EXTICR2_EXTI4_PG_Msk         /*!< PG[4] pin */\r
+\r
+/* EXTI5 configuration */\r
+#define AFIO_EXTICR2_EXTI5_PA                0x00000000U                          /*!< PA[5] pin */\r
+#define AFIO_EXTICR2_EXTI5_PB_Pos            (4U)                              \r
+#define AFIO_EXTICR2_EXTI5_PB_Msk            (0x1UL << AFIO_EXTICR2_EXTI5_PB_Pos) /*!< 0x00000010 */\r
+#define AFIO_EXTICR2_EXTI5_PB                AFIO_EXTICR2_EXTI5_PB_Msk         /*!< PB[5] pin */\r
+#define AFIO_EXTICR2_EXTI5_PC_Pos            (5U)                              \r
+#define AFIO_EXTICR2_EXTI5_PC_Msk            (0x1UL << AFIO_EXTICR2_EXTI5_PC_Pos) /*!< 0x00000020 */\r
+#define AFIO_EXTICR2_EXTI5_PC                AFIO_EXTICR2_EXTI5_PC_Msk         /*!< PC[5] pin */\r
+#define AFIO_EXTICR2_EXTI5_PD_Pos            (4U)                              \r
+#define AFIO_EXTICR2_EXTI5_PD_Msk            (0x3UL << AFIO_EXTICR2_EXTI5_PD_Pos) /*!< 0x00000030 */\r
+#define AFIO_EXTICR2_EXTI5_PD                AFIO_EXTICR2_EXTI5_PD_Msk         /*!< PD[5] pin */\r
+#define AFIO_EXTICR2_EXTI5_PE_Pos            (6U)                              \r
+#define AFIO_EXTICR2_EXTI5_PE_Msk            (0x1UL << AFIO_EXTICR2_EXTI5_PE_Pos) /*!< 0x00000040 */\r
+#define AFIO_EXTICR2_EXTI5_PE                AFIO_EXTICR2_EXTI5_PE_Msk         /*!< PE[5] pin */\r
+#define AFIO_EXTICR2_EXTI5_PF_Pos            (4U)                              \r
+#define AFIO_EXTICR2_EXTI5_PF_Msk            (0x5UL << AFIO_EXTICR2_EXTI5_PF_Pos) /*!< 0x00000050 */\r
+#define AFIO_EXTICR2_EXTI5_PF                AFIO_EXTICR2_EXTI5_PF_Msk         /*!< PF[5] pin */\r
+#define AFIO_EXTICR2_EXTI5_PG_Pos            (5U)                              \r
+#define AFIO_EXTICR2_EXTI5_PG_Msk            (0x3UL << AFIO_EXTICR2_EXTI5_PG_Pos) /*!< 0x00000060 */\r
+#define AFIO_EXTICR2_EXTI5_PG                AFIO_EXTICR2_EXTI5_PG_Msk         /*!< PG[5] pin */\r
+\r
+/*!< EXTI6 configuration */  \r
+#define AFIO_EXTICR2_EXTI6_PA                0x00000000U                          /*!< PA[6] pin */\r
+#define AFIO_EXTICR2_EXTI6_PB_Pos            (8U)                              \r
+#define AFIO_EXTICR2_EXTI6_PB_Msk            (0x1UL << AFIO_EXTICR2_EXTI6_PB_Pos) /*!< 0x00000100 */\r
+#define AFIO_EXTICR2_EXTI6_PB                AFIO_EXTICR2_EXTI6_PB_Msk         /*!< PB[6] pin */\r
+#define AFIO_EXTICR2_EXTI6_PC_Pos            (9U)                              \r
+#define AFIO_EXTICR2_EXTI6_PC_Msk            (0x1UL << AFIO_EXTICR2_EXTI6_PC_Pos) /*!< 0x00000200 */\r
+#define AFIO_EXTICR2_EXTI6_PC                AFIO_EXTICR2_EXTI6_PC_Msk         /*!< PC[6] pin */\r
+#define AFIO_EXTICR2_EXTI6_PD_Pos            (8U)                              \r
+#define AFIO_EXTICR2_EXTI6_PD_Msk            (0x3UL << AFIO_EXTICR2_EXTI6_PD_Pos) /*!< 0x00000300 */\r
+#define AFIO_EXTICR2_EXTI6_PD                AFIO_EXTICR2_EXTI6_PD_Msk         /*!< PD[6] pin */\r
+#define AFIO_EXTICR2_EXTI6_PE_Pos            (10U)                             \r
+#define AFIO_EXTICR2_EXTI6_PE_Msk            (0x1UL << AFIO_EXTICR2_EXTI6_PE_Pos) /*!< 0x00000400 */\r
+#define AFIO_EXTICR2_EXTI6_PE                AFIO_EXTICR2_EXTI6_PE_Msk         /*!< PE[6] pin */\r
+#define AFIO_EXTICR2_EXTI6_PF_Pos            (8U)                              \r
+#define AFIO_EXTICR2_EXTI6_PF_Msk            (0x5UL << AFIO_EXTICR2_EXTI6_PF_Pos) /*!< 0x00000500 */\r
+#define AFIO_EXTICR2_EXTI6_PF                AFIO_EXTICR2_EXTI6_PF_Msk         /*!< PF[6] pin */\r
+#define AFIO_EXTICR2_EXTI6_PG_Pos            (9U)                              \r
+#define AFIO_EXTICR2_EXTI6_PG_Msk            (0x3UL << AFIO_EXTICR2_EXTI6_PG_Pos) /*!< 0x00000600 */\r
+#define AFIO_EXTICR2_EXTI6_PG                AFIO_EXTICR2_EXTI6_PG_Msk         /*!< PG[6] pin */\r
+\r
+/*!< EXTI7 configuration */\r
+#define AFIO_EXTICR2_EXTI7_PA                0x00000000U                          /*!< PA[7] pin */\r
+#define AFIO_EXTICR2_EXTI7_PB_Pos            (12U)                             \r
+#define AFIO_EXTICR2_EXTI7_PB_Msk            (0x1UL << AFIO_EXTICR2_EXTI7_PB_Pos) /*!< 0x00001000 */\r
+#define AFIO_EXTICR2_EXTI7_PB                AFIO_EXTICR2_EXTI7_PB_Msk         /*!< PB[7] pin */\r
+#define AFIO_EXTICR2_EXTI7_PC_Pos            (13U)                             \r
+#define AFIO_EXTICR2_EXTI7_PC_Msk            (0x1UL << AFIO_EXTICR2_EXTI7_PC_Pos) /*!< 0x00002000 */\r
+#define AFIO_EXTICR2_EXTI7_PC                AFIO_EXTICR2_EXTI7_PC_Msk         /*!< PC[7] pin */\r
+#define AFIO_EXTICR2_EXTI7_PD_Pos            (12U)                             \r
+#define AFIO_EXTICR2_EXTI7_PD_Msk            (0x3UL << AFIO_EXTICR2_EXTI7_PD_Pos) /*!< 0x00003000 */\r
+#define AFIO_EXTICR2_EXTI7_PD                AFIO_EXTICR2_EXTI7_PD_Msk         /*!< PD[7] pin */\r
+#define AFIO_EXTICR2_EXTI7_PE_Pos            (14U)                             \r
+#define AFIO_EXTICR2_EXTI7_PE_Msk            (0x1UL << AFIO_EXTICR2_EXTI7_PE_Pos) /*!< 0x00004000 */\r
+#define AFIO_EXTICR2_EXTI7_PE                AFIO_EXTICR2_EXTI7_PE_Msk         /*!< PE[7] pin */\r
+#define AFIO_EXTICR2_EXTI7_PF_Pos            (12U)                             \r
+#define AFIO_EXTICR2_EXTI7_PF_Msk            (0x5UL << AFIO_EXTICR2_EXTI7_PF_Pos) /*!< 0x00005000 */\r
+#define AFIO_EXTICR2_EXTI7_PF                AFIO_EXTICR2_EXTI7_PF_Msk         /*!< PF[7] pin */\r
+#define AFIO_EXTICR2_EXTI7_PG_Pos            (13U)                             \r
+#define AFIO_EXTICR2_EXTI7_PG_Msk            (0x3UL << AFIO_EXTICR2_EXTI7_PG_Pos) /*!< 0x00006000 */\r
+#define AFIO_EXTICR2_EXTI7_PG                AFIO_EXTICR2_EXTI7_PG_Msk         /*!< PG[7] pin */\r
+\r
+/*****************  Bit definition for AFIO_EXTICR3 register  *****************/\r
+#define AFIO_EXTICR3_EXTI8_Pos               (0U)                              \r
+#define AFIO_EXTICR3_EXTI8_Msk               (0xFUL << AFIO_EXTICR3_EXTI8_Pos)  /*!< 0x0000000F */\r
+#define AFIO_EXTICR3_EXTI8                   AFIO_EXTICR3_EXTI8_Msk            /*!< EXTI 8 configuration */\r
+#define AFIO_EXTICR3_EXTI9_Pos               (4U)                              \r
+#define AFIO_EXTICR3_EXTI9_Msk               (0xFUL << AFIO_EXTICR3_EXTI9_Pos)  /*!< 0x000000F0 */\r
+#define AFIO_EXTICR3_EXTI9                   AFIO_EXTICR3_EXTI9_Msk            /*!< EXTI 9 configuration */\r
+#define AFIO_EXTICR3_EXTI10_Pos              (8U)                              \r
+#define AFIO_EXTICR3_EXTI10_Msk              (0xFUL << AFIO_EXTICR3_EXTI10_Pos) /*!< 0x00000F00 */\r
+#define AFIO_EXTICR3_EXTI10                  AFIO_EXTICR3_EXTI10_Msk           /*!< EXTI 10 configuration */\r
+#define AFIO_EXTICR3_EXTI11_Pos              (12U)                             \r
+#define AFIO_EXTICR3_EXTI11_Msk              (0xFUL << AFIO_EXTICR3_EXTI11_Pos) /*!< 0x0000F000 */\r
+#define AFIO_EXTICR3_EXTI11                  AFIO_EXTICR3_EXTI11_Msk           /*!< EXTI 11 configuration */\r
+\r
+/*!< EXTI8 configuration */\r
+#define AFIO_EXTICR3_EXTI8_PA                0x00000000U                          /*!< PA[8] pin */\r
+#define AFIO_EXTICR3_EXTI8_PB_Pos            (0U)                              \r
+#define AFIO_EXTICR3_EXTI8_PB_Msk            (0x1UL << AFIO_EXTICR3_EXTI8_PB_Pos) /*!< 0x00000001 */\r
+#define AFIO_EXTICR3_EXTI8_PB                AFIO_EXTICR3_EXTI8_PB_Msk         /*!< PB[8] pin */\r
+#define AFIO_EXTICR3_EXTI8_PC_Pos            (1U)                              \r
+#define AFIO_EXTICR3_EXTI8_PC_Msk            (0x1UL << AFIO_EXTICR3_EXTI8_PC_Pos) /*!< 0x00000002 */\r
+#define AFIO_EXTICR3_EXTI8_PC                AFIO_EXTICR3_EXTI8_PC_Msk         /*!< PC[8] pin */\r
+#define AFIO_EXTICR3_EXTI8_PD_Pos            (0U)                              \r
+#define AFIO_EXTICR3_EXTI8_PD_Msk            (0x3UL << AFIO_EXTICR3_EXTI8_PD_Pos) /*!< 0x00000003 */\r
+#define AFIO_EXTICR3_EXTI8_PD                AFIO_EXTICR3_EXTI8_PD_Msk         /*!< PD[8] pin */\r
+#define AFIO_EXTICR3_EXTI8_PE_Pos            (2U)                              \r
+#define AFIO_EXTICR3_EXTI8_PE_Msk            (0x1UL << AFIO_EXTICR3_EXTI8_PE_Pos) /*!< 0x00000004 */\r
+#define AFIO_EXTICR3_EXTI8_PE                AFIO_EXTICR3_EXTI8_PE_Msk         /*!< PE[8] pin */\r
+#define AFIO_EXTICR3_EXTI8_PF_Pos            (0U)                              \r
+#define AFIO_EXTICR3_EXTI8_PF_Msk            (0x5UL << AFIO_EXTICR3_EXTI8_PF_Pos) /*!< 0x00000005 */\r
+#define AFIO_EXTICR3_EXTI8_PF                AFIO_EXTICR3_EXTI8_PF_Msk         /*!< PF[8] pin */\r
+#define AFIO_EXTICR3_EXTI8_PG_Pos            (1U)                              \r
+#define AFIO_EXTICR3_EXTI8_PG_Msk            (0x3UL << AFIO_EXTICR3_EXTI8_PG_Pos) /*!< 0x00000006 */\r
+#define AFIO_EXTICR3_EXTI8_PG                AFIO_EXTICR3_EXTI8_PG_Msk         /*!< PG[8] pin */\r
+\r
+/*!< EXTI9 configuration */\r
+#define AFIO_EXTICR3_EXTI9_PA                0x00000000U                          /*!< PA[9] pin */\r
+#define AFIO_EXTICR3_EXTI9_PB_Pos            (4U)                              \r
+#define AFIO_EXTICR3_EXTI9_PB_Msk            (0x1UL << AFIO_EXTICR3_EXTI9_PB_Pos) /*!< 0x00000010 */\r
+#define AFIO_EXTICR3_EXTI9_PB                AFIO_EXTICR3_EXTI9_PB_Msk         /*!< PB[9] pin */\r
+#define AFIO_EXTICR3_EXTI9_PC_Pos            (5U)                              \r
+#define AFIO_EXTICR3_EXTI9_PC_Msk            (0x1UL << AFIO_EXTICR3_EXTI9_PC_Pos) /*!< 0x00000020 */\r
+#define AFIO_EXTICR3_EXTI9_PC                AFIO_EXTICR3_EXTI9_PC_Msk         /*!< PC[9] pin */\r
+#define AFIO_EXTICR3_EXTI9_PD_Pos            (4U)                              \r
+#define AFIO_EXTICR3_EXTI9_PD_Msk            (0x3UL << AFIO_EXTICR3_EXTI9_PD_Pos) /*!< 0x00000030 */\r
+#define AFIO_EXTICR3_EXTI9_PD                AFIO_EXTICR3_EXTI9_PD_Msk         /*!< PD[9] pin */\r
+#define AFIO_EXTICR3_EXTI9_PE_Pos            (6U)                              \r
+#define AFIO_EXTICR3_EXTI9_PE_Msk            (0x1UL << AFIO_EXTICR3_EXTI9_PE_Pos) /*!< 0x00000040 */\r
+#define AFIO_EXTICR3_EXTI9_PE                AFIO_EXTICR3_EXTI9_PE_Msk         /*!< PE[9] pin */\r
+#define AFIO_EXTICR3_EXTI9_PF_Pos            (4U)                              \r
+#define AFIO_EXTICR3_EXTI9_PF_Msk            (0x5UL << AFIO_EXTICR3_EXTI9_PF_Pos) /*!< 0x00000050 */\r
+#define AFIO_EXTICR3_EXTI9_PF                AFIO_EXTICR3_EXTI9_PF_Msk         /*!< PF[9] pin */\r
+#define AFIO_EXTICR3_EXTI9_PG_Pos            (5U)                              \r
+#define AFIO_EXTICR3_EXTI9_PG_Msk            (0x3UL << AFIO_EXTICR3_EXTI9_PG_Pos) /*!< 0x00000060 */\r
+#define AFIO_EXTICR3_EXTI9_PG                AFIO_EXTICR3_EXTI9_PG_Msk         /*!< PG[9] pin */\r
+\r
+/*!< EXTI10 configuration */  \r
+#define AFIO_EXTICR3_EXTI10_PA               0x00000000U                          /*!< PA[10] pin */\r
+#define AFIO_EXTICR3_EXTI10_PB_Pos           (8U)                              \r
+#define AFIO_EXTICR3_EXTI10_PB_Msk           (0x1UL << AFIO_EXTICR3_EXTI10_PB_Pos) /*!< 0x00000100 */\r
+#define AFIO_EXTICR3_EXTI10_PB               AFIO_EXTICR3_EXTI10_PB_Msk        /*!< PB[10] pin */\r
+#define AFIO_EXTICR3_EXTI10_PC_Pos           (9U)                              \r
+#define AFIO_EXTICR3_EXTI10_PC_Msk           (0x1UL << AFIO_EXTICR3_EXTI10_PC_Pos) /*!< 0x00000200 */\r
+#define AFIO_EXTICR3_EXTI10_PC               AFIO_EXTICR3_EXTI10_PC_Msk        /*!< PC[10] pin */\r
+#define AFIO_EXTICR3_EXTI10_PD_Pos           (8U)                              \r
+#define AFIO_EXTICR3_EXTI10_PD_Msk           (0x3UL << AFIO_EXTICR3_EXTI10_PD_Pos) /*!< 0x00000300 */\r
+#define AFIO_EXTICR3_EXTI10_PD               AFIO_EXTICR3_EXTI10_PD_Msk        /*!< PD[10] pin */\r
+#define AFIO_EXTICR3_EXTI10_PE_Pos           (10U)                             \r
+#define AFIO_EXTICR3_EXTI10_PE_Msk           (0x1UL << AFIO_EXTICR3_EXTI10_PE_Pos) /*!< 0x00000400 */\r
+#define AFIO_EXTICR3_EXTI10_PE               AFIO_EXTICR3_EXTI10_PE_Msk        /*!< PE[10] pin */\r
+#define AFIO_EXTICR3_EXTI10_PF_Pos           (8U)                              \r
+#define AFIO_EXTICR3_EXTI10_PF_Msk           (0x5UL << AFIO_EXTICR3_EXTI10_PF_Pos) /*!< 0x00000500 */\r
+#define AFIO_EXTICR3_EXTI10_PF               AFIO_EXTICR3_EXTI10_PF_Msk        /*!< PF[10] pin */\r
+#define AFIO_EXTICR3_EXTI10_PG_Pos           (9U)                              \r
+#define AFIO_EXTICR3_EXTI10_PG_Msk           (0x3UL << AFIO_EXTICR3_EXTI10_PG_Pos) /*!< 0x00000600 */\r
+#define AFIO_EXTICR3_EXTI10_PG               AFIO_EXTICR3_EXTI10_PG_Msk        /*!< PG[10] pin */\r
+\r
+/*!< EXTI11 configuration */\r
+#define AFIO_EXTICR3_EXTI11_PA               0x00000000U                          /*!< PA[11] pin */\r
+#define AFIO_EXTICR3_EXTI11_PB_Pos           (12U)                             \r
+#define AFIO_EXTICR3_EXTI11_PB_Msk           (0x1UL << AFIO_EXTICR3_EXTI11_PB_Pos) /*!< 0x00001000 */\r
+#define AFIO_EXTICR3_EXTI11_PB               AFIO_EXTICR3_EXTI11_PB_Msk        /*!< PB[11] pin */\r
+#define AFIO_EXTICR3_EXTI11_PC_Pos           (13U)                             \r
+#define AFIO_EXTICR3_EXTI11_PC_Msk           (0x1UL << AFIO_EXTICR3_EXTI11_PC_Pos) /*!< 0x00002000 */\r
+#define AFIO_EXTICR3_EXTI11_PC               AFIO_EXTICR3_EXTI11_PC_Msk        /*!< PC[11] pin */\r
+#define AFIO_EXTICR3_EXTI11_PD_Pos           (12U)                             \r
+#define AFIO_EXTICR3_EXTI11_PD_Msk           (0x3UL << AFIO_EXTICR3_EXTI11_PD_Pos) /*!< 0x00003000 */\r
+#define AFIO_EXTICR3_EXTI11_PD               AFIO_EXTICR3_EXTI11_PD_Msk        /*!< PD[11] pin */\r
+#define AFIO_EXTICR3_EXTI11_PE_Pos           (14U)                             \r
+#define AFIO_EXTICR3_EXTI11_PE_Msk           (0x1UL << AFIO_EXTICR3_EXTI11_PE_Pos) /*!< 0x00004000 */\r
+#define AFIO_EXTICR3_EXTI11_PE               AFIO_EXTICR3_EXTI11_PE_Msk        /*!< PE[11] pin */\r
+#define AFIO_EXTICR3_EXTI11_PF_Pos           (12U)                             \r
+#define AFIO_EXTICR3_EXTI11_PF_Msk           (0x5UL << AFIO_EXTICR3_EXTI11_PF_Pos) /*!< 0x00005000 */\r
+#define AFIO_EXTICR3_EXTI11_PF               AFIO_EXTICR3_EXTI11_PF_Msk        /*!< PF[11] pin */\r
+#define AFIO_EXTICR3_EXTI11_PG_Pos           (13U)                             \r
+#define AFIO_EXTICR3_EXTI11_PG_Msk           (0x3UL << AFIO_EXTICR3_EXTI11_PG_Pos) /*!< 0x00006000 */\r
+#define AFIO_EXTICR3_EXTI11_PG               AFIO_EXTICR3_EXTI11_PG_Msk        /*!< PG[11] pin */\r
+\r
+/*****************  Bit definition for AFIO_EXTICR4 register  *****************/\r
+#define AFIO_EXTICR4_EXTI12_Pos              (0U)                              \r
+#define AFIO_EXTICR4_EXTI12_Msk              (0xFUL << AFIO_EXTICR4_EXTI12_Pos) /*!< 0x0000000F */\r
+#define AFIO_EXTICR4_EXTI12                  AFIO_EXTICR4_EXTI12_Msk           /*!< EXTI 12 configuration */\r
+#define AFIO_EXTICR4_EXTI13_Pos              (4U)                              \r
+#define AFIO_EXTICR4_EXTI13_Msk              (0xFUL << AFIO_EXTICR4_EXTI13_Pos) /*!< 0x000000F0 */\r
+#define AFIO_EXTICR4_EXTI13                  AFIO_EXTICR4_EXTI13_Msk           /*!< EXTI 13 configuration */\r
+#define AFIO_EXTICR4_EXTI14_Pos              (8U)                              \r
+#define AFIO_EXTICR4_EXTI14_Msk              (0xFUL << AFIO_EXTICR4_EXTI14_Pos) /*!< 0x00000F00 */\r
+#define AFIO_EXTICR4_EXTI14                  AFIO_EXTICR4_EXTI14_Msk           /*!< EXTI 14 configuration */\r
+#define AFIO_EXTICR4_EXTI15_Pos              (12U)                             \r
+#define AFIO_EXTICR4_EXTI15_Msk              (0xFUL << AFIO_EXTICR4_EXTI15_Pos) /*!< 0x0000F000 */\r
+#define AFIO_EXTICR4_EXTI15                  AFIO_EXTICR4_EXTI15_Msk           /*!< EXTI 15 configuration */\r
+\r
+/* EXTI12 configuration */\r
+#define AFIO_EXTICR4_EXTI12_PA               0x00000000U                          /*!< PA[12] pin */\r
+#define AFIO_EXTICR4_EXTI12_PB_Pos           (0U)                              \r
+#define AFIO_EXTICR4_EXTI12_PB_Msk           (0x1UL << AFIO_EXTICR4_EXTI12_PB_Pos) /*!< 0x00000001 */\r
+#define AFIO_EXTICR4_EXTI12_PB               AFIO_EXTICR4_EXTI12_PB_Msk        /*!< PB[12] pin */\r
+#define AFIO_EXTICR4_EXTI12_PC_Pos           (1U)                              \r
+#define AFIO_EXTICR4_EXTI12_PC_Msk           (0x1UL << AFIO_EXTICR4_EXTI12_PC_Pos) /*!< 0x00000002 */\r
+#define AFIO_EXTICR4_EXTI12_PC               AFIO_EXTICR4_EXTI12_PC_Msk        /*!< PC[12] pin */\r
+#define AFIO_EXTICR4_EXTI12_PD_Pos           (0U)                              \r
+#define AFIO_EXTICR4_EXTI12_PD_Msk           (0x3UL << AFIO_EXTICR4_EXTI12_PD_Pos) /*!< 0x00000003 */\r
+#define AFIO_EXTICR4_EXTI12_PD               AFIO_EXTICR4_EXTI12_PD_Msk        /*!< PD[12] pin */\r
+#define AFIO_EXTICR4_EXTI12_PE_Pos           (2U)                              \r
+#define AFIO_EXTICR4_EXTI12_PE_Msk           (0x1UL << AFIO_EXTICR4_EXTI12_PE_Pos) /*!< 0x00000004 */\r
+#define AFIO_EXTICR4_EXTI12_PE               AFIO_EXTICR4_EXTI12_PE_Msk        /*!< PE[12] pin */\r
+#define AFIO_EXTICR4_EXTI12_PF_Pos           (0U)                              \r
+#define AFIO_EXTICR4_EXTI12_PF_Msk           (0x5UL << AFIO_EXTICR4_EXTI12_PF_Pos) /*!< 0x00000005 */\r
+#define AFIO_EXTICR4_EXTI12_PF               AFIO_EXTICR4_EXTI12_PF_Msk        /*!< PF[12] pin */\r
+#define AFIO_EXTICR4_EXTI12_PG_Pos           (1U)                              \r
+#define AFIO_EXTICR4_EXTI12_PG_Msk           (0x3UL << AFIO_EXTICR4_EXTI12_PG_Pos) /*!< 0x00000006 */\r
+#define AFIO_EXTICR4_EXTI12_PG               AFIO_EXTICR4_EXTI12_PG_Msk        /*!< PG[12] pin */\r
+\r
+/* EXTI13 configuration */\r
+#define AFIO_EXTICR4_EXTI13_PA               0x00000000U                          /*!< PA[13] pin */\r
+#define AFIO_EXTICR4_EXTI13_PB_Pos           (4U)                              \r
+#define AFIO_EXTICR4_EXTI13_PB_Msk           (0x1UL << AFIO_EXTICR4_EXTI13_PB_Pos) /*!< 0x00000010 */\r
+#define AFIO_EXTICR4_EXTI13_PB               AFIO_EXTICR4_EXTI13_PB_Msk        /*!< PB[13] pin */\r
+#define AFIO_EXTICR4_EXTI13_PC_Pos           (5U)                              \r
+#define AFIO_EXTICR4_EXTI13_PC_Msk           (0x1UL << AFIO_EXTICR4_EXTI13_PC_Pos) /*!< 0x00000020 */\r
+#define AFIO_EXTICR4_EXTI13_PC               AFIO_EXTICR4_EXTI13_PC_Msk        /*!< PC[13] pin */\r
+#define AFIO_EXTICR4_EXTI13_PD_Pos           (4U)                              \r
+#define AFIO_EXTICR4_EXTI13_PD_Msk           (0x3UL << AFIO_EXTICR4_EXTI13_PD_Pos) /*!< 0x00000030 */\r
+#define AFIO_EXTICR4_EXTI13_PD               AFIO_EXTICR4_EXTI13_PD_Msk        /*!< PD[13] pin */\r
+#define AFIO_EXTICR4_EXTI13_PE_Pos           (6U)                              \r
+#define AFIO_EXTICR4_EXTI13_PE_Msk           (0x1UL << AFIO_EXTICR4_EXTI13_PE_Pos) /*!< 0x00000040 */\r
+#define AFIO_EXTICR4_EXTI13_PE               AFIO_EXTICR4_EXTI13_PE_Msk        /*!< PE[13] pin */\r
+#define AFIO_EXTICR4_EXTI13_PF_Pos           (4U)                              \r
+#define AFIO_EXTICR4_EXTI13_PF_Msk           (0x5UL << AFIO_EXTICR4_EXTI13_PF_Pos) /*!< 0x00000050 */\r
+#define AFIO_EXTICR4_EXTI13_PF               AFIO_EXTICR4_EXTI13_PF_Msk        /*!< PF[13] pin */\r
+#define AFIO_EXTICR4_EXTI13_PG_Pos           (5U)                              \r
+#define AFIO_EXTICR4_EXTI13_PG_Msk           (0x3UL << AFIO_EXTICR4_EXTI13_PG_Pos) /*!< 0x00000060 */\r
+#define AFIO_EXTICR4_EXTI13_PG               AFIO_EXTICR4_EXTI13_PG_Msk        /*!< PG[13] pin */\r
+\r
+/*!< EXTI14 configuration */  \r
+#define AFIO_EXTICR4_EXTI14_PA               0x00000000U                          /*!< PA[14] pin */\r
+#define AFIO_EXTICR4_EXTI14_PB_Pos           (8U)                              \r
+#define AFIO_EXTICR4_EXTI14_PB_Msk           (0x1UL << AFIO_EXTICR4_EXTI14_PB_Pos) /*!< 0x00000100 */\r
+#define AFIO_EXTICR4_EXTI14_PB               AFIO_EXTICR4_EXTI14_PB_Msk        /*!< PB[14] pin */\r
+#define AFIO_EXTICR4_EXTI14_PC_Pos           (9U)                              \r
+#define AFIO_EXTICR4_EXTI14_PC_Msk           (0x1UL << AFIO_EXTICR4_EXTI14_PC_Pos) /*!< 0x00000200 */\r
+#define AFIO_EXTICR4_EXTI14_PC               AFIO_EXTICR4_EXTI14_PC_Msk        /*!< PC[14] pin */\r
+#define AFIO_EXTICR4_EXTI14_PD_Pos           (8U)                              \r
+#define AFIO_EXTICR4_EXTI14_PD_Msk           (0x3UL << AFIO_EXTICR4_EXTI14_PD_Pos) /*!< 0x00000300 */\r
+#define AFIO_EXTICR4_EXTI14_PD               AFIO_EXTICR4_EXTI14_PD_Msk        /*!< PD[14] pin */\r
+#define AFIO_EXTICR4_EXTI14_PE_Pos           (10U)                             \r
+#define AFIO_EXTICR4_EXTI14_PE_Msk           (0x1UL << AFIO_EXTICR4_EXTI14_PE_Pos) /*!< 0x00000400 */\r
+#define AFIO_EXTICR4_EXTI14_PE               AFIO_EXTICR4_EXTI14_PE_Msk        /*!< PE[14] pin */\r
+#define AFIO_EXTICR4_EXTI14_PF_Pos           (8U)                              \r
+#define AFIO_EXTICR4_EXTI14_PF_Msk           (0x5UL << AFIO_EXTICR4_EXTI14_PF_Pos) /*!< 0x00000500 */\r
+#define AFIO_EXTICR4_EXTI14_PF               AFIO_EXTICR4_EXTI14_PF_Msk        /*!< PF[14] pin */\r
+#define AFIO_EXTICR4_EXTI14_PG_Pos           (9U)                              \r
+#define AFIO_EXTICR4_EXTI14_PG_Msk           (0x3UL << AFIO_EXTICR4_EXTI14_PG_Pos) /*!< 0x00000600 */\r
+#define AFIO_EXTICR4_EXTI14_PG               AFIO_EXTICR4_EXTI14_PG_Msk        /*!< PG[14] pin */\r
+\r
+/*!< EXTI15 configuration */\r
+#define AFIO_EXTICR4_EXTI15_PA               0x00000000U                          /*!< PA[15] pin */\r
+#define AFIO_EXTICR4_EXTI15_PB_Pos           (12U)                             \r
+#define AFIO_EXTICR4_EXTI15_PB_Msk           (0x1UL << AFIO_EXTICR4_EXTI15_PB_Pos) /*!< 0x00001000 */\r
+#define AFIO_EXTICR4_EXTI15_PB               AFIO_EXTICR4_EXTI15_PB_Msk        /*!< PB[15] pin */\r
+#define AFIO_EXTICR4_EXTI15_PC_Pos           (13U)                             \r
+#define AFIO_EXTICR4_EXTI15_PC_Msk           (0x1UL << AFIO_EXTICR4_EXTI15_PC_Pos) /*!< 0x00002000 */\r
+#define AFIO_EXTICR4_EXTI15_PC               AFIO_EXTICR4_EXTI15_PC_Msk        /*!< PC[15] pin */\r
+#define AFIO_EXTICR4_EXTI15_PD_Pos           (12U)                             \r
+#define AFIO_EXTICR4_EXTI15_PD_Msk           (0x3UL << AFIO_EXTICR4_EXTI15_PD_Pos) /*!< 0x00003000 */\r
+#define AFIO_EXTICR4_EXTI15_PD               AFIO_EXTICR4_EXTI15_PD_Msk        /*!< PD[15] pin */\r
+#define AFIO_EXTICR4_EXTI15_PE_Pos           (14U)                             \r
+#define AFIO_EXTICR4_EXTI15_PE_Msk           (0x1UL << AFIO_EXTICR4_EXTI15_PE_Pos) /*!< 0x00004000 */\r
+#define AFIO_EXTICR4_EXTI15_PE               AFIO_EXTICR4_EXTI15_PE_Msk        /*!< PE[15] pin */\r
+#define AFIO_EXTICR4_EXTI15_PF_Pos           (12U)                             \r
+#define AFIO_EXTICR4_EXTI15_PF_Msk           (0x5UL << AFIO_EXTICR4_EXTI15_PF_Pos) /*!< 0x00005000 */\r
+#define AFIO_EXTICR4_EXTI15_PF               AFIO_EXTICR4_EXTI15_PF_Msk        /*!< PF[15] pin */\r
+#define AFIO_EXTICR4_EXTI15_PG_Pos           (13U)                             \r
+#define AFIO_EXTICR4_EXTI15_PG_Msk           (0x3UL << AFIO_EXTICR4_EXTI15_PG_Pos) /*!< 0x00006000 */\r
+#define AFIO_EXTICR4_EXTI15_PG               AFIO_EXTICR4_EXTI15_PG_Msk        /*!< PG[15] pin */\r
+\r
+/******************  Bit definition for AFIO_MAPR2 register  ******************/\r
+\r
+\r
+\r
+/******************************************************************************/\r
+/*                                                                            */\r
+/*                    External Interrupt/Event Controller                     */\r
+/*                                                                            */\r
+/******************************************************************************/\r
+\r
+/*******************  Bit definition for EXTI_IMR register  *******************/\r
+#define EXTI_IMR_MR0_Pos                    (0U)                               \r
+#define EXTI_IMR_MR0_Msk                    (0x1UL << EXTI_IMR_MR0_Pos)         /*!< 0x00000001 */\r
+#define EXTI_IMR_MR0                        EXTI_IMR_MR0_Msk                   /*!< Interrupt Mask on line 0 */\r
+#define EXTI_IMR_MR1_Pos                    (1U)                               \r
+#define EXTI_IMR_MR1_Msk                    (0x1UL << EXTI_IMR_MR1_Pos)         /*!< 0x00000002 */\r
+#define EXTI_IMR_MR1                        EXTI_IMR_MR1_Msk                   /*!< Interrupt Mask on line 1 */\r
+#define EXTI_IMR_MR2_Pos                    (2U)                               \r
+#define EXTI_IMR_MR2_Msk                    (0x1UL << EXTI_IMR_MR2_Pos)         /*!< 0x00000004 */\r
+#define EXTI_IMR_MR2                        EXTI_IMR_MR2_Msk                   /*!< Interrupt Mask on line 2 */\r
+#define EXTI_IMR_MR3_Pos                    (3U)                               \r
+#define EXTI_IMR_MR3_Msk                    (0x1UL << EXTI_IMR_MR3_Pos)         /*!< 0x00000008 */\r
+#define EXTI_IMR_MR3                        EXTI_IMR_MR3_Msk                   /*!< Interrupt Mask on line 3 */\r
+#define EXTI_IMR_MR4_Pos                    (4U)                               \r
+#define EXTI_IMR_MR4_Msk                    (0x1UL << EXTI_IMR_MR4_Pos)         /*!< 0x00000010 */\r
+#define EXTI_IMR_MR4                        EXTI_IMR_MR4_Msk                   /*!< Interrupt Mask on line 4 */\r
+#define EXTI_IMR_MR5_Pos                    (5U)                               \r
+#define EXTI_IMR_MR5_Msk                    (0x1UL << EXTI_IMR_MR5_Pos)         /*!< 0x00000020 */\r
+#define EXTI_IMR_MR5                        EXTI_IMR_MR5_Msk                   /*!< Interrupt Mask on line 5 */\r
+#define EXTI_IMR_MR6_Pos                    (6U)                               \r
+#define EXTI_IMR_MR6_Msk                    (0x1UL << EXTI_IMR_MR6_Pos)         /*!< 0x00000040 */\r
+#define EXTI_IMR_MR6                        EXTI_IMR_MR6_Msk                   /*!< Interrupt Mask on line 6 */\r
+#define EXTI_IMR_MR7_Pos                    (7U)                               \r
+#define EXTI_IMR_MR7_Msk                    (0x1UL << EXTI_IMR_MR7_Pos)         /*!< 0x00000080 */\r
+#define EXTI_IMR_MR7                        EXTI_IMR_MR7_Msk                   /*!< Interrupt Mask on line 7 */\r
+#define EXTI_IMR_MR8_Pos                    (8U)                               \r
+#define EXTI_IMR_MR8_Msk                    (0x1UL << EXTI_IMR_MR8_Pos)         /*!< 0x00000100 */\r
+#define EXTI_IMR_MR8                        EXTI_IMR_MR8_Msk                   /*!< Interrupt Mask on line 8 */\r
+#define EXTI_IMR_MR9_Pos                    (9U)                               \r
+#define EXTI_IMR_MR9_Msk                    (0x1UL << EXTI_IMR_MR9_Pos)         /*!< 0x00000200 */\r
+#define EXTI_IMR_MR9                        EXTI_IMR_MR9_Msk                   /*!< Interrupt Mask on line 9 */\r
+#define EXTI_IMR_MR10_Pos                   (10U)                              \r
+#define EXTI_IMR_MR10_Msk                   (0x1UL << EXTI_IMR_MR10_Pos)        /*!< 0x00000400 */\r
+#define EXTI_IMR_MR10                       EXTI_IMR_MR10_Msk                  /*!< Interrupt Mask on line 10 */\r
+#define EXTI_IMR_MR11_Pos                   (11U)                              \r
+#define EXTI_IMR_MR11_Msk                   (0x1UL << EXTI_IMR_MR11_Pos)        /*!< 0x00000800 */\r
+#define EXTI_IMR_MR11                       EXTI_IMR_MR11_Msk                  /*!< Interrupt Mask on line 11 */\r
+#define EXTI_IMR_MR12_Pos                   (12U)                              \r
+#define EXTI_IMR_MR12_Msk                   (0x1UL << EXTI_IMR_MR12_Pos)        /*!< 0x00001000 */\r
+#define EXTI_IMR_MR12                       EXTI_IMR_MR12_Msk                  /*!< Interrupt Mask on line 12 */\r
+#define EXTI_IMR_MR13_Pos                   (13U)                              \r
+#define EXTI_IMR_MR13_Msk                   (0x1UL << EXTI_IMR_MR13_Pos)        /*!< 0x00002000 */\r
+#define EXTI_IMR_MR13                       EXTI_IMR_MR13_Msk                  /*!< Interrupt Mask on line 13 */\r
+#define EXTI_IMR_MR14_Pos                   (14U)                              \r
+#define EXTI_IMR_MR14_Msk                   (0x1UL << EXTI_IMR_MR14_Pos)        /*!< 0x00004000 */\r
+#define EXTI_IMR_MR14                       EXTI_IMR_MR14_Msk                  /*!< Interrupt Mask on line 14 */\r
+#define EXTI_IMR_MR15_Pos                   (15U)                              \r
+#define EXTI_IMR_MR15_Msk                   (0x1UL << EXTI_IMR_MR15_Pos)        /*!< 0x00008000 */\r
+#define EXTI_IMR_MR15                       EXTI_IMR_MR15_Msk                  /*!< Interrupt Mask on line 15 */\r
+#define EXTI_IMR_MR16_Pos                   (16U)                              \r
+#define EXTI_IMR_MR16_Msk                   (0x1UL << EXTI_IMR_MR16_Pos)        /*!< 0x00010000 */\r
+#define EXTI_IMR_MR16                       EXTI_IMR_MR16_Msk                  /*!< Interrupt Mask on line 16 */\r
+#define EXTI_IMR_MR17_Pos                   (17U)                              \r
+#define EXTI_IMR_MR17_Msk                   (0x1UL << EXTI_IMR_MR17_Pos)        /*!< 0x00020000 */\r
+#define EXTI_IMR_MR17                       EXTI_IMR_MR17_Msk                  /*!< Interrupt Mask on line 17 */\r
+#define EXTI_IMR_MR18_Pos                   (18U)                              \r
+#define EXTI_IMR_MR18_Msk                   (0x1UL << EXTI_IMR_MR18_Pos)        /*!< 0x00040000 */\r
+#define EXTI_IMR_MR18                       EXTI_IMR_MR18_Msk                  /*!< Interrupt Mask on line 18 */\r
+\r
+/* References Defines */\r
+#define  EXTI_IMR_IM0 EXTI_IMR_MR0\r
+#define  EXTI_IMR_IM1 EXTI_IMR_MR1\r
+#define  EXTI_IMR_IM2 EXTI_IMR_MR2\r
+#define  EXTI_IMR_IM3 EXTI_IMR_MR3\r
+#define  EXTI_IMR_IM4 EXTI_IMR_MR4\r
+#define  EXTI_IMR_IM5 EXTI_IMR_MR5\r
+#define  EXTI_IMR_IM6 EXTI_IMR_MR6\r
+#define  EXTI_IMR_IM7 EXTI_IMR_MR7\r
+#define  EXTI_IMR_IM8 EXTI_IMR_MR8\r
+#define  EXTI_IMR_IM9 EXTI_IMR_MR9\r
+#define  EXTI_IMR_IM10 EXTI_IMR_MR10\r
+#define  EXTI_IMR_IM11 EXTI_IMR_MR11\r
+#define  EXTI_IMR_IM12 EXTI_IMR_MR12\r
+#define  EXTI_IMR_IM13 EXTI_IMR_MR13\r
+#define  EXTI_IMR_IM14 EXTI_IMR_MR14\r
+#define  EXTI_IMR_IM15 EXTI_IMR_MR15\r
+#define  EXTI_IMR_IM16 EXTI_IMR_MR16\r
+#define  EXTI_IMR_IM17 EXTI_IMR_MR17\r
+#define  EXTI_IMR_IM18 EXTI_IMR_MR18\r
+#define  EXTI_IMR_IM   0x0007FFFFU        /*!< Interrupt Mask All */\r
\r
+/*******************  Bit definition for EXTI_EMR register  *******************/\r
+#define EXTI_EMR_MR0_Pos                    (0U)                               \r
+#define EXTI_EMR_MR0_Msk                    (0x1UL << EXTI_EMR_MR0_Pos)         /*!< 0x00000001 */\r
+#define EXTI_EMR_MR0                        EXTI_EMR_MR0_Msk                   /*!< Event Mask on line 0 */\r
+#define EXTI_EMR_MR1_Pos                    (1U)                               \r
+#define EXTI_EMR_MR1_Msk                    (0x1UL << EXTI_EMR_MR1_Pos)         /*!< 0x00000002 */\r
+#define EXTI_EMR_MR1                        EXTI_EMR_MR1_Msk                   /*!< Event Mask on line 1 */\r
+#define EXTI_EMR_MR2_Pos                    (2U)                               \r
+#define EXTI_EMR_MR2_Msk                    (0x1UL << EXTI_EMR_MR2_Pos)         /*!< 0x00000004 */\r
+#define EXTI_EMR_MR2                        EXTI_EMR_MR2_Msk                   /*!< Event Mask on line 2 */\r
+#define EXTI_EMR_MR3_Pos                    (3U)                               \r
+#define EXTI_EMR_MR3_Msk                    (0x1UL << EXTI_EMR_MR3_Pos)         /*!< 0x00000008 */\r
+#define EXTI_EMR_MR3                        EXTI_EMR_MR3_Msk                   /*!< Event Mask on line 3 */\r
+#define EXTI_EMR_MR4_Pos                    (4U)                               \r
+#define EXTI_EMR_MR4_Msk                    (0x1UL << EXTI_EMR_MR4_Pos)         /*!< 0x00000010 */\r
+#define EXTI_EMR_MR4                        EXTI_EMR_MR4_Msk                   /*!< Event Mask on line 4 */\r
+#define EXTI_EMR_MR5_Pos                    (5U)                               \r
+#define EXTI_EMR_MR5_Msk                    (0x1UL << EXTI_EMR_MR5_Pos)         /*!< 0x00000020 */\r
+#define EXTI_EMR_MR5                        EXTI_EMR_MR5_Msk                   /*!< Event Mask on line 5 */\r
+#define EXTI_EMR_MR6_Pos                    (6U)                               \r
+#define EXTI_EMR_MR6_Msk                    (0x1UL << EXTI_EMR_MR6_Pos)         /*!< 0x00000040 */\r
+#define EXTI_EMR_MR6                        EXTI_EMR_MR6_Msk                   /*!< Event Mask on line 6 */\r
+#define EXTI_EMR_MR7_Pos                    (7U)                               \r
+#define EXTI_EMR_MR7_Msk                    (0x1UL << EXTI_EMR_MR7_Pos)         /*!< 0x00000080 */\r
+#define EXTI_EMR_MR7                        EXTI_EMR_MR7_Msk                   /*!< Event Mask on line 7 */\r
+#define EXTI_EMR_MR8_Pos                    (8U)                               \r
+#define EXTI_EMR_MR8_Msk                    (0x1UL << EXTI_EMR_MR8_Pos)         /*!< 0x00000100 */\r
+#define EXTI_EMR_MR8                        EXTI_EMR_MR8_Msk                   /*!< Event Mask on line 8 */\r
+#define EXTI_EMR_MR9_Pos                    (9U)                               \r
+#define EXTI_EMR_MR9_Msk                    (0x1UL << EXTI_EMR_MR9_Pos)         /*!< 0x00000200 */\r
+#define EXTI_EMR_MR9                        EXTI_EMR_MR9_Msk                   /*!< Event Mask on line 9 */\r
+#define EXTI_EMR_MR10_Pos                   (10U)                              \r
+#define EXTI_EMR_MR10_Msk                   (0x1UL << EXTI_EMR_MR10_Pos)        /*!< 0x00000400 */\r
+#define EXTI_EMR_MR10                       EXTI_EMR_MR10_Msk                  /*!< Event Mask on line 10 */\r
+#define EXTI_EMR_MR11_Pos                   (11U)                              \r
+#define EXTI_EMR_MR11_Msk                   (0x1UL << EXTI_EMR_MR11_Pos)        /*!< 0x00000800 */\r
+#define EXTI_EMR_MR11                       EXTI_EMR_MR11_Msk                  /*!< Event Mask on line 11 */\r
+#define EXTI_EMR_MR12_Pos                   (12U)                              \r
+#define EXTI_EMR_MR12_Msk                   (0x1UL << EXTI_EMR_MR12_Pos)        /*!< 0x00001000 */\r
+#define EXTI_EMR_MR12                       EXTI_EMR_MR12_Msk                  /*!< Event Mask on line 12 */\r
+#define EXTI_EMR_MR13_Pos                   (13U)                              \r
+#define EXTI_EMR_MR13_Msk                   (0x1UL << EXTI_EMR_MR13_Pos)        /*!< 0x00002000 */\r
+#define EXTI_EMR_MR13                       EXTI_EMR_MR13_Msk                  /*!< Event Mask on line 13 */\r
+#define EXTI_EMR_MR14_Pos                   (14U)                              \r
+#define EXTI_EMR_MR14_Msk                   (0x1UL << EXTI_EMR_MR14_Pos)        /*!< 0x00004000 */\r
+#define EXTI_EMR_MR14                       EXTI_EMR_MR14_Msk                  /*!< Event Mask on line 14 */\r
+#define EXTI_EMR_MR15_Pos                   (15U)                              \r
+#define EXTI_EMR_MR15_Msk                   (0x1UL << EXTI_EMR_MR15_Pos)        /*!< 0x00008000 */\r
+#define EXTI_EMR_MR15                       EXTI_EMR_MR15_Msk                  /*!< Event Mask on line 15 */\r
+#define EXTI_EMR_MR16_Pos                   (16U)                              \r
+#define EXTI_EMR_MR16_Msk                   (0x1UL << EXTI_EMR_MR16_Pos)        /*!< 0x00010000 */\r
+#define EXTI_EMR_MR16                       EXTI_EMR_MR16_Msk                  /*!< Event Mask on line 16 */\r
+#define EXTI_EMR_MR17_Pos                   (17U)                              \r
+#define EXTI_EMR_MR17_Msk                   (0x1UL << EXTI_EMR_MR17_Pos)        /*!< 0x00020000 */\r
+#define EXTI_EMR_MR17                       EXTI_EMR_MR17_Msk                  /*!< Event Mask on line 17 */\r
+#define EXTI_EMR_MR18_Pos                   (18U)                              \r
+#define EXTI_EMR_MR18_Msk                   (0x1UL << EXTI_EMR_MR18_Pos)        /*!< 0x00040000 */\r
+#define EXTI_EMR_MR18                       EXTI_EMR_MR18_Msk                  /*!< Event Mask on line 18 */\r
+\r
+/* References Defines */\r
+#define  EXTI_EMR_EM0 EXTI_EMR_MR0\r
+#define  EXTI_EMR_EM1 EXTI_EMR_MR1\r
+#define  EXTI_EMR_EM2 EXTI_EMR_MR2\r
+#define  EXTI_EMR_EM3 EXTI_EMR_MR3\r
+#define  EXTI_EMR_EM4 EXTI_EMR_MR4\r
+#define  EXTI_EMR_EM5 EXTI_EMR_MR5\r
+#define  EXTI_EMR_EM6 EXTI_EMR_MR6\r
+#define  EXTI_EMR_EM7 EXTI_EMR_MR7\r
+#define  EXTI_EMR_EM8 EXTI_EMR_MR8\r
+#define  EXTI_EMR_EM9 EXTI_EMR_MR9\r
+#define  EXTI_EMR_EM10 EXTI_EMR_MR10\r
+#define  EXTI_EMR_EM11 EXTI_EMR_MR11\r
+#define  EXTI_EMR_EM12 EXTI_EMR_MR12\r
+#define  EXTI_EMR_EM13 EXTI_EMR_MR13\r
+#define  EXTI_EMR_EM14 EXTI_EMR_MR14\r
+#define  EXTI_EMR_EM15 EXTI_EMR_MR15\r
+#define  EXTI_EMR_EM16 EXTI_EMR_MR16\r
+#define  EXTI_EMR_EM17 EXTI_EMR_MR17\r
+#define  EXTI_EMR_EM18 EXTI_EMR_MR18\r
+\r
+/******************  Bit definition for EXTI_RTSR register  *******************/\r
+#define EXTI_RTSR_TR0_Pos                   (0U)                               \r
+#define EXTI_RTSR_TR0_Msk                   (0x1UL << EXTI_RTSR_TR0_Pos)        /*!< 0x00000001 */\r
+#define EXTI_RTSR_TR0                       EXTI_RTSR_TR0_Msk                  /*!< Rising trigger event configuration bit of line 0 */\r
+#define EXTI_RTSR_TR1_Pos                   (1U)                               \r
+#define EXTI_RTSR_TR1_Msk                   (0x1UL << EXTI_RTSR_TR1_Pos)        /*!< 0x00000002 */\r
+#define EXTI_RTSR_TR1                       EXTI_RTSR_TR1_Msk                  /*!< Rising trigger event configuration bit of line 1 */\r
+#define EXTI_RTSR_TR2_Pos                   (2U)                               \r
+#define EXTI_RTSR_TR2_Msk                   (0x1UL << EXTI_RTSR_TR2_Pos)        /*!< 0x00000004 */\r
+#define EXTI_RTSR_TR2                       EXTI_RTSR_TR2_Msk                  /*!< Rising trigger event configuration bit of line 2 */\r
+#define EXTI_RTSR_TR3_Pos                   (3U)                               \r
+#define EXTI_RTSR_TR3_Msk                   (0x1UL << EXTI_RTSR_TR3_Pos)        /*!< 0x00000008 */\r
+#define EXTI_RTSR_TR3                       EXTI_RTSR_TR3_Msk                  /*!< Rising trigger event configuration bit of line 3 */\r
+#define EXTI_RTSR_TR4_Pos                   (4U)                               \r
+#define EXTI_RTSR_TR4_Msk                   (0x1UL << EXTI_RTSR_TR4_Pos)        /*!< 0x00000010 */\r
+#define EXTI_RTSR_TR4                       EXTI_RTSR_TR4_Msk                  /*!< Rising trigger event configuration bit of line 4 */\r
+#define EXTI_RTSR_TR5_Pos                   (5U)                               \r
+#define EXTI_RTSR_TR5_Msk                   (0x1UL << EXTI_RTSR_TR5_Pos)        /*!< 0x00000020 */\r
+#define EXTI_RTSR_TR5                       EXTI_RTSR_TR5_Msk                  /*!< Rising trigger event configuration bit of line 5 */\r
+#define EXTI_RTSR_TR6_Pos                   (6U)                               \r
+#define EXTI_RTSR_TR6_Msk                   (0x1UL << EXTI_RTSR_TR6_Pos)        /*!< 0x00000040 */\r
+#define EXTI_RTSR_TR6                       EXTI_RTSR_TR6_Msk                  /*!< Rising trigger event configuration bit of line 6 */\r
+#define EXTI_RTSR_TR7_Pos                   (7U)                               \r
+#define EXTI_RTSR_TR7_Msk                   (0x1UL << EXTI_RTSR_TR7_Pos)        /*!< 0x00000080 */\r
+#define EXTI_RTSR_TR7                       EXTI_RTSR_TR7_Msk                  /*!< Rising trigger event configuration bit of line 7 */\r
+#define EXTI_RTSR_TR8_Pos                   (8U)                               \r
+#define EXTI_RTSR_TR8_Msk                   (0x1UL << EXTI_RTSR_TR8_Pos)        /*!< 0x00000100 */\r
+#define EXTI_RTSR_TR8                       EXTI_RTSR_TR8_Msk                  /*!< Rising trigger event configuration bit of line 8 */\r
+#define EXTI_RTSR_TR9_Pos                   (9U)                               \r
+#define EXTI_RTSR_TR9_Msk                   (0x1UL << EXTI_RTSR_TR9_Pos)        /*!< 0x00000200 */\r
+#define EXTI_RTSR_TR9                       EXTI_RTSR_TR9_Msk                  /*!< Rising trigger event configuration bit of line 9 */\r
+#define EXTI_RTSR_TR10_Pos                  (10U)                              \r
+#define EXTI_RTSR_TR10_Msk                  (0x1UL << EXTI_RTSR_TR10_Pos)       /*!< 0x00000400 */\r
+#define EXTI_RTSR_TR10                      EXTI_RTSR_TR10_Msk                 /*!< Rising trigger event configuration bit of line 10 */\r
+#define EXTI_RTSR_TR11_Pos                  (11U)                              \r
+#define EXTI_RTSR_TR11_Msk                  (0x1UL << EXTI_RTSR_TR11_Pos)       /*!< 0x00000800 */\r
+#define EXTI_RTSR_TR11                      EXTI_RTSR_TR11_Msk                 /*!< Rising trigger event configuration bit of line 11 */\r
+#define EXTI_RTSR_TR12_Pos                  (12U)                              \r
+#define EXTI_RTSR_TR12_Msk                  (0x1UL << EXTI_RTSR_TR12_Pos)       /*!< 0x00001000 */\r
+#define EXTI_RTSR_TR12                      EXTI_RTSR_TR12_Msk                 /*!< Rising trigger event configuration bit of line 12 */\r
+#define EXTI_RTSR_TR13_Pos                  (13U)                              \r
+#define EXTI_RTSR_TR13_Msk                  (0x1UL << EXTI_RTSR_TR13_Pos)       /*!< 0x00002000 */\r
+#define EXTI_RTSR_TR13                      EXTI_RTSR_TR13_Msk                 /*!< Rising trigger event configuration bit of line 13 */\r
+#define EXTI_RTSR_TR14_Pos                  (14U)                              \r
+#define EXTI_RTSR_TR14_Msk                  (0x1UL << EXTI_RTSR_TR14_Pos)       /*!< 0x00004000 */\r
+#define EXTI_RTSR_TR14                      EXTI_RTSR_TR14_Msk                 /*!< Rising trigger event configuration bit of line 14 */\r
+#define EXTI_RTSR_TR15_Pos                  (15U)                              \r
+#define EXTI_RTSR_TR15_Msk                  (0x1UL << EXTI_RTSR_TR15_Pos)       /*!< 0x00008000 */\r
+#define EXTI_RTSR_TR15                      EXTI_RTSR_TR15_Msk                 /*!< Rising trigger event configuration bit of line 15 */\r
+#define EXTI_RTSR_TR16_Pos                  (16U)                              \r
+#define EXTI_RTSR_TR16_Msk                  (0x1UL << EXTI_RTSR_TR16_Pos)       /*!< 0x00010000 */\r
+#define EXTI_RTSR_TR16                      EXTI_RTSR_TR16_Msk                 /*!< Rising trigger event configuration bit of line 16 */\r
+#define EXTI_RTSR_TR17_Pos                  (17U)                              \r
+#define EXTI_RTSR_TR17_Msk                  (0x1UL << EXTI_RTSR_TR17_Pos)       /*!< 0x00020000 */\r
+#define EXTI_RTSR_TR17                      EXTI_RTSR_TR17_Msk                 /*!< Rising trigger event configuration bit of line 17 */\r
+#define EXTI_RTSR_TR18_Pos                  (18U)                              \r
+#define EXTI_RTSR_TR18_Msk                  (0x1UL << EXTI_RTSR_TR18_Pos)       /*!< 0x00040000 */\r
+#define EXTI_RTSR_TR18                      EXTI_RTSR_TR18_Msk                 /*!< Rising trigger event configuration bit of line 18 */\r
+\r
+/* References Defines */\r
+#define  EXTI_RTSR_RT0 EXTI_RTSR_TR0\r
+#define  EXTI_RTSR_RT1 EXTI_RTSR_TR1\r
+#define  EXTI_RTSR_RT2 EXTI_RTSR_TR2\r
+#define  EXTI_RTSR_RT3 EXTI_RTSR_TR3\r
+#define  EXTI_RTSR_RT4 EXTI_RTSR_TR4\r
+#define  EXTI_RTSR_RT5 EXTI_RTSR_TR5\r
+#define  EXTI_RTSR_RT6 EXTI_RTSR_TR6\r
+#define  EXTI_RTSR_RT7 EXTI_RTSR_TR7\r
+#define  EXTI_RTSR_RT8 EXTI_RTSR_TR8\r
+#define  EXTI_RTSR_RT9 EXTI_RTSR_TR9\r
+#define  EXTI_RTSR_RT10 EXTI_RTSR_TR10\r
+#define  EXTI_RTSR_RT11 EXTI_RTSR_TR11\r
+#define  EXTI_RTSR_RT12 EXTI_RTSR_TR12\r
+#define  EXTI_RTSR_RT13 EXTI_RTSR_TR13\r
+#define  EXTI_RTSR_RT14 EXTI_RTSR_TR14\r
+#define  EXTI_RTSR_RT15 EXTI_RTSR_TR15\r
+#define  EXTI_RTSR_RT16 EXTI_RTSR_TR16\r
+#define  EXTI_RTSR_RT17 EXTI_RTSR_TR17\r
+#define  EXTI_RTSR_RT18 EXTI_RTSR_TR18\r
+\r
+/******************  Bit definition for EXTI_FTSR register  *******************/\r
+#define EXTI_FTSR_TR0_Pos                   (0U)                               \r
+#define EXTI_FTSR_TR0_Msk                   (0x1UL << EXTI_FTSR_TR0_Pos)        /*!< 0x00000001 */\r
+#define EXTI_FTSR_TR0                       EXTI_FTSR_TR0_Msk                  /*!< Falling trigger event configuration bit of line 0 */\r
+#define EXTI_FTSR_TR1_Pos                   (1U)                               \r
+#define EXTI_FTSR_TR1_Msk                   (0x1UL << EXTI_FTSR_TR1_Pos)        /*!< 0x00000002 */\r
+#define EXTI_FTSR_TR1                       EXTI_FTSR_TR1_Msk                  /*!< Falling trigger event configuration bit of line 1 */\r
+#define EXTI_FTSR_TR2_Pos                   (2U)                               \r
+#define EXTI_FTSR_TR2_Msk                   (0x1UL << EXTI_FTSR_TR2_Pos)        /*!< 0x00000004 */\r
+#define EXTI_FTSR_TR2                       EXTI_FTSR_TR2_Msk                  /*!< Falling trigger event configuration bit of line 2 */\r
+#define EXTI_FTSR_TR3_Pos                   (3U)                               \r
+#define EXTI_FTSR_TR3_Msk                   (0x1UL << EXTI_FTSR_TR3_Pos)        /*!< 0x00000008 */\r
+#define EXTI_FTSR_TR3                       EXTI_FTSR_TR3_Msk                  /*!< Falling trigger event configuration bit of line 3 */\r
+#define EXTI_FTSR_TR4_Pos                   (4U)                               \r
+#define EXTI_FTSR_TR4_Msk                   (0x1UL << EXTI_FTSR_TR4_Pos)        /*!< 0x00000010 */\r
+#define EXTI_FTSR_TR4                       EXTI_FTSR_TR4_Msk                  /*!< Falling trigger event configuration bit of line 4 */\r
+#define EXTI_FTSR_TR5_Pos                   (5U)                               \r
+#define EXTI_FTSR_TR5_Msk                   (0x1UL << EXTI_FTSR_TR5_Pos)        /*!< 0x00000020 */\r
+#define EXTI_FTSR_TR5                       EXTI_FTSR_TR5_Msk                  /*!< Falling trigger event configuration bit of line 5 */\r
+#define EXTI_FTSR_TR6_Pos                   (6U)                               \r
+#define EXTI_FTSR_TR6_Msk                   (0x1UL << EXTI_FTSR_TR6_Pos)        /*!< 0x00000040 */\r
+#define EXTI_FTSR_TR6                       EXTI_FTSR_TR6_Msk                  /*!< Falling trigger event configuration bit of line 6 */\r
+#define EXTI_FTSR_TR7_Pos                   (7U)                               \r
+#define EXTI_FTSR_TR7_Msk                   (0x1UL << EXTI_FTSR_TR7_Pos)        /*!< 0x00000080 */\r
+#define EXTI_FTSR_TR7                       EXTI_FTSR_TR7_Msk                  /*!< Falling trigger event configuration bit of line 7 */\r
+#define EXTI_FTSR_TR8_Pos                   (8U)                               \r
+#define EXTI_FTSR_TR8_Msk                   (0x1UL << EXTI_FTSR_TR8_Pos)        /*!< 0x00000100 */\r
+#define EXTI_FTSR_TR8                       EXTI_FTSR_TR8_Msk                  /*!< Falling trigger event configuration bit of line 8 */\r
+#define EXTI_FTSR_TR9_Pos                   (9U)                               \r
+#define EXTI_FTSR_TR9_Msk                   (0x1UL << EXTI_FTSR_TR9_Pos)        /*!< 0x00000200 */\r
+#define EXTI_FTSR_TR9                       EXTI_FTSR_TR9_Msk                  /*!< Falling trigger event configuration bit of line 9 */\r
+#define EXTI_FTSR_TR10_Pos                  (10U)                              \r
+#define EXTI_FTSR_TR10_Msk                  (0x1UL << EXTI_FTSR_TR10_Pos)       /*!< 0x00000400 */\r
+#define EXTI_FTSR_TR10                      EXTI_FTSR_TR10_Msk                 /*!< Falling trigger event configuration bit of line 10 */\r
+#define EXTI_FTSR_TR11_Pos                  (11U)                              \r
+#define EXTI_FTSR_TR11_Msk                  (0x1UL << EXTI_FTSR_TR11_Pos)       /*!< 0x00000800 */\r
+#define EXTI_FTSR_TR11                      EXTI_FTSR_TR11_Msk                 /*!< Falling trigger event configuration bit of line 11 */\r
+#define EXTI_FTSR_TR12_Pos                  (12U)                              \r
+#define EXTI_FTSR_TR12_Msk                  (0x1UL << EXTI_FTSR_TR12_Pos)       /*!< 0x00001000 */\r
+#define EXTI_FTSR_TR12                      EXTI_FTSR_TR12_Msk                 /*!< Falling trigger event configuration bit of line 12 */\r
+#define EXTI_FTSR_TR13_Pos                  (13U)                              \r
+#define EXTI_FTSR_TR13_Msk                  (0x1UL << EXTI_FTSR_TR13_Pos)       /*!< 0x00002000 */\r
+#define EXTI_FTSR_TR13                      EXTI_FTSR_TR13_Msk                 /*!< Falling trigger event configuration bit of line 13 */\r
+#define EXTI_FTSR_TR14_Pos                  (14U)                              \r
+#define EXTI_FTSR_TR14_Msk                  (0x1UL << EXTI_FTSR_TR14_Pos)       /*!< 0x00004000 */\r
+#define EXTI_FTSR_TR14                      EXTI_FTSR_TR14_Msk                 /*!< Falling trigger event configuration bit of line 14 */\r
+#define EXTI_FTSR_TR15_Pos                  (15U)                              \r
+#define EXTI_FTSR_TR15_Msk                  (0x1UL << EXTI_FTSR_TR15_Pos)       /*!< 0x00008000 */\r
+#define EXTI_FTSR_TR15                      EXTI_FTSR_TR15_Msk                 /*!< Falling trigger event configuration bit of line 15 */\r
+#define EXTI_FTSR_TR16_Pos                  (16U)                              \r
+#define EXTI_FTSR_TR16_Msk                  (0x1UL << EXTI_FTSR_TR16_Pos)       /*!< 0x00010000 */\r
+#define EXTI_FTSR_TR16                      EXTI_FTSR_TR16_Msk                 /*!< Falling trigger event configuration bit of line 16 */\r
+#define EXTI_FTSR_TR17_Pos                  (17U)                              \r
+#define EXTI_FTSR_TR17_Msk                  (0x1UL << EXTI_FTSR_TR17_Pos)       /*!< 0x00020000 */\r
+#define EXTI_FTSR_TR17                      EXTI_FTSR_TR17_Msk                 /*!< Falling trigger event configuration bit of line 17 */\r
+#define EXTI_FTSR_TR18_Pos                  (18U)                              \r
+#define EXTI_FTSR_TR18_Msk                  (0x1UL << EXTI_FTSR_TR18_Pos)       /*!< 0x00040000 */\r
+#define EXTI_FTSR_TR18                      EXTI_FTSR_TR18_Msk                 /*!< Falling trigger event configuration bit of line 18 */\r
+\r
+/* References Defines */\r
+#define  EXTI_FTSR_FT0 EXTI_FTSR_TR0\r
+#define  EXTI_FTSR_FT1 EXTI_FTSR_TR1\r
+#define  EXTI_FTSR_FT2 EXTI_FTSR_TR2\r
+#define  EXTI_FTSR_FT3 EXTI_FTSR_TR3\r
+#define  EXTI_FTSR_FT4 EXTI_FTSR_TR4\r
+#define  EXTI_FTSR_FT5 EXTI_FTSR_TR5\r
+#define  EXTI_FTSR_FT6 EXTI_FTSR_TR6\r
+#define  EXTI_FTSR_FT7 EXTI_FTSR_TR7\r
+#define  EXTI_FTSR_FT8 EXTI_FTSR_TR8\r
+#define  EXTI_FTSR_FT9 EXTI_FTSR_TR9\r
+#define  EXTI_FTSR_FT10 EXTI_FTSR_TR10\r
+#define  EXTI_FTSR_FT11 EXTI_FTSR_TR11\r
+#define  EXTI_FTSR_FT12 EXTI_FTSR_TR12\r
+#define  EXTI_FTSR_FT13 EXTI_FTSR_TR13\r
+#define  EXTI_FTSR_FT14 EXTI_FTSR_TR14\r
+#define  EXTI_FTSR_FT15 EXTI_FTSR_TR15\r
+#define  EXTI_FTSR_FT16 EXTI_FTSR_TR16\r
+#define  EXTI_FTSR_FT17 EXTI_FTSR_TR17\r
+#define  EXTI_FTSR_FT18 EXTI_FTSR_TR18\r
+\r
+/******************  Bit definition for EXTI_SWIER register  ******************/\r
+#define EXTI_SWIER_SWIER0_Pos               (0U)                               \r
+#define EXTI_SWIER_SWIER0_Msk               (0x1UL << EXTI_SWIER_SWIER0_Pos)    /*!< 0x00000001 */\r
+#define EXTI_SWIER_SWIER0                   EXTI_SWIER_SWIER0_Msk              /*!< Software Interrupt on line 0 */\r
+#define EXTI_SWIER_SWIER1_Pos               (1U)                               \r
+#define EXTI_SWIER_SWIER1_Msk               (0x1UL << EXTI_SWIER_SWIER1_Pos)    /*!< 0x00000002 */\r
+#define EXTI_SWIER_SWIER1                   EXTI_SWIER_SWIER1_Msk              /*!< Software Interrupt on line 1 */\r
+#define EXTI_SWIER_SWIER2_Pos               (2U)                               \r
+#define EXTI_SWIER_SWIER2_Msk               (0x1UL << EXTI_SWIER_SWIER2_Pos)    /*!< 0x00000004 */\r
+#define EXTI_SWIER_SWIER2                   EXTI_SWIER_SWIER2_Msk              /*!< Software Interrupt on line 2 */\r
+#define EXTI_SWIER_SWIER3_Pos               (3U)                               \r
+#define EXTI_SWIER_SWIER3_Msk               (0x1UL << EXTI_SWIER_SWIER3_Pos)    /*!< 0x00000008 */\r
+#define EXTI_SWIER_SWIER3                   EXTI_SWIER_SWIER3_Msk              /*!< Software Interrupt on line 3 */\r
+#define EXTI_SWIER_SWIER4_Pos               (4U)                               \r
+#define EXTI_SWIER_SWIER4_Msk               (0x1UL << EXTI_SWIER_SWIER4_Pos)    /*!< 0x00000010 */\r
+#define EXTI_SWIER_SWIER4                   EXTI_SWIER_SWIER4_Msk              /*!< Software Interrupt on line 4 */\r
+#define EXTI_SWIER_SWIER5_Pos               (5U)                               \r
+#define EXTI_SWIER_SWIER5_Msk               (0x1UL << EXTI_SWIER_SWIER5_Pos)    /*!< 0x00000020 */\r
+#define EXTI_SWIER_SWIER5                   EXTI_SWIER_SWIER5_Msk              /*!< Software Interrupt on line 5 */\r
+#define EXTI_SWIER_SWIER6_Pos               (6U)                               \r
+#define EXTI_SWIER_SWIER6_Msk               (0x1UL << EXTI_SWIER_SWIER6_Pos)    /*!< 0x00000040 */\r
+#define EXTI_SWIER_SWIER6                   EXTI_SWIER_SWIER6_Msk              /*!< Software Interrupt on line 6 */\r
+#define EXTI_SWIER_SWIER7_Pos               (7U)                               \r
+#define EXTI_SWIER_SWIER7_Msk               (0x1UL << EXTI_SWIER_SWIER7_Pos)    /*!< 0x00000080 */\r
+#define EXTI_SWIER_SWIER7                   EXTI_SWIER_SWIER7_Msk              /*!< Software Interrupt on line 7 */\r
+#define EXTI_SWIER_SWIER8_Pos               (8U)                               \r
+#define EXTI_SWIER_SWIER8_Msk               (0x1UL << EXTI_SWIER_SWIER8_Pos)    /*!< 0x00000100 */\r
+#define EXTI_SWIER_SWIER8                   EXTI_SWIER_SWIER8_Msk              /*!< Software Interrupt on line 8 */\r
+#define EXTI_SWIER_SWIER9_Pos               (9U)                               \r
+#define EXTI_SWIER_SWIER9_Msk               (0x1UL << EXTI_SWIER_SWIER9_Pos)    /*!< 0x00000200 */\r
+#define EXTI_SWIER_SWIER9                   EXTI_SWIER_SWIER9_Msk              /*!< Software Interrupt on line 9 */\r
+#define EXTI_SWIER_SWIER10_Pos              (10U)                              \r
+#define EXTI_SWIER_SWIER10_Msk              (0x1UL << EXTI_SWIER_SWIER10_Pos)   /*!< 0x00000400 */\r
+#define EXTI_SWIER_SWIER10                  EXTI_SWIER_SWIER10_Msk             /*!< Software Interrupt on line 10 */\r
+#define EXTI_SWIER_SWIER11_Pos              (11U)                              \r
+#define EXTI_SWIER_SWIER11_Msk              (0x1UL << EXTI_SWIER_SWIER11_Pos)   /*!< 0x00000800 */\r
+#define EXTI_SWIER_SWIER11                  EXTI_SWIER_SWIER11_Msk             /*!< Software Interrupt on line 11 */\r
+#define EXTI_SWIER_SWIER12_Pos              (12U)                              \r
+#define EXTI_SWIER_SWIER12_Msk              (0x1UL << EXTI_SWIER_SWIER12_Pos)   /*!< 0x00001000 */\r
+#define EXTI_SWIER_SWIER12                  EXTI_SWIER_SWIER12_Msk             /*!< Software Interrupt on line 12 */\r
+#define EXTI_SWIER_SWIER13_Pos              (13U)                              \r
+#define EXTI_SWIER_SWIER13_Msk              (0x1UL << EXTI_SWIER_SWIER13_Pos)   /*!< 0x00002000 */\r
+#define EXTI_SWIER_SWIER13                  EXTI_SWIER_SWIER13_Msk             /*!< Software Interrupt on line 13 */\r
+#define EXTI_SWIER_SWIER14_Pos              (14U)                              \r
+#define EXTI_SWIER_SWIER14_Msk              (0x1UL << EXTI_SWIER_SWIER14_Pos)   /*!< 0x00004000 */\r
+#define EXTI_SWIER_SWIER14                  EXTI_SWIER_SWIER14_Msk             /*!< Software Interrupt on line 14 */\r
+#define EXTI_SWIER_SWIER15_Pos              (15U)                              \r
+#define EXTI_SWIER_SWIER15_Msk              (0x1UL << EXTI_SWIER_SWIER15_Pos)   /*!< 0x00008000 */\r
+#define EXTI_SWIER_SWIER15                  EXTI_SWIER_SWIER15_Msk             /*!< Software Interrupt on line 15 */\r
+#define EXTI_SWIER_SWIER16_Pos              (16U)                              \r
+#define EXTI_SWIER_SWIER16_Msk              (0x1UL << EXTI_SWIER_SWIER16_Pos)   /*!< 0x00010000 */\r
+#define EXTI_SWIER_SWIER16                  EXTI_SWIER_SWIER16_Msk             /*!< Software Interrupt on line 16 */\r
+#define EXTI_SWIER_SWIER17_Pos              (17U)                              \r
+#define EXTI_SWIER_SWIER17_Msk              (0x1UL << EXTI_SWIER_SWIER17_Pos)   /*!< 0x00020000 */\r
+#define EXTI_SWIER_SWIER17                  EXTI_SWIER_SWIER17_Msk             /*!< Software Interrupt on line 17 */\r
+#define EXTI_SWIER_SWIER18_Pos              (18U)                              \r
+#define EXTI_SWIER_SWIER18_Msk              (0x1UL << EXTI_SWIER_SWIER18_Pos)   /*!< 0x00040000 */\r
+#define EXTI_SWIER_SWIER18                  EXTI_SWIER_SWIER18_Msk             /*!< Software Interrupt on line 18 */\r
+\r
+/* References Defines */\r
+#define  EXTI_SWIER_SWI0 EXTI_SWIER_SWIER0\r
+#define  EXTI_SWIER_SWI1 EXTI_SWIER_SWIER1\r
+#define  EXTI_SWIER_SWI2 EXTI_SWIER_SWIER2\r
+#define  EXTI_SWIER_SWI3 EXTI_SWIER_SWIER3\r
+#define  EXTI_SWIER_SWI4 EXTI_SWIER_SWIER4\r
+#define  EXTI_SWIER_SWI5 EXTI_SWIER_SWIER5\r
+#define  EXTI_SWIER_SWI6 EXTI_SWIER_SWIER6\r
+#define  EXTI_SWIER_SWI7 EXTI_SWIER_SWIER7\r
+#define  EXTI_SWIER_SWI8 EXTI_SWIER_SWIER8\r
+#define  EXTI_SWIER_SWI9 EXTI_SWIER_SWIER9\r
+#define  EXTI_SWIER_SWI10 EXTI_SWIER_SWIER10\r
+#define  EXTI_SWIER_SWI11 EXTI_SWIER_SWIER11\r
+#define  EXTI_SWIER_SWI12 EXTI_SWIER_SWIER12\r
+#define  EXTI_SWIER_SWI13 EXTI_SWIER_SWIER13\r
+#define  EXTI_SWIER_SWI14 EXTI_SWIER_SWIER14\r
+#define  EXTI_SWIER_SWI15 EXTI_SWIER_SWIER15\r
+#define  EXTI_SWIER_SWI16 EXTI_SWIER_SWIER16\r
+#define  EXTI_SWIER_SWI17 EXTI_SWIER_SWIER17\r
+#define  EXTI_SWIER_SWI18 EXTI_SWIER_SWIER18\r
+\r
+/*******************  Bit definition for EXTI_PR register  ********************/\r
+#define EXTI_PR_PR0_Pos                     (0U)                               \r
+#define EXTI_PR_PR0_Msk                     (0x1UL << EXTI_PR_PR0_Pos)          /*!< 0x00000001 */\r
+#define EXTI_PR_PR0                         EXTI_PR_PR0_Msk                    /*!< Pending bit for line 0 */\r
+#define EXTI_PR_PR1_Pos                     (1U)                               \r
+#define EXTI_PR_PR1_Msk                     (0x1UL << EXTI_PR_PR1_Pos)          /*!< 0x00000002 */\r
+#define EXTI_PR_PR1                         EXTI_PR_PR1_Msk                    /*!< Pending bit for line 1 */\r
+#define EXTI_PR_PR2_Pos                     (2U)                               \r
+#define EXTI_PR_PR2_Msk                     (0x1UL << EXTI_PR_PR2_Pos)          /*!< 0x00000004 */\r
+#define EXTI_PR_PR2                         EXTI_PR_PR2_Msk                    /*!< Pending bit for line 2 */\r
+#define EXTI_PR_PR3_Pos                     (3U)                               \r
+#define EXTI_PR_PR3_Msk                     (0x1UL << EXTI_PR_PR3_Pos)          /*!< 0x00000008 */\r
+#define EXTI_PR_PR3                         EXTI_PR_PR3_Msk                    /*!< Pending bit for line 3 */\r
+#define EXTI_PR_PR4_Pos                     (4U)                               \r
+#define EXTI_PR_PR4_Msk                     (0x1UL << EXTI_PR_PR4_Pos)          /*!< 0x00000010 */\r
+#define EXTI_PR_PR4                         EXTI_PR_PR4_Msk                    /*!< Pending bit for line 4 */\r
+#define EXTI_PR_PR5_Pos                     (5U)                               \r
+#define EXTI_PR_PR5_Msk                     (0x1UL << EXTI_PR_PR5_Pos)          /*!< 0x00000020 */\r
+#define EXTI_PR_PR5                         EXTI_PR_PR5_Msk                    /*!< Pending bit for line 5 */\r
+#define EXTI_PR_PR6_Pos                     (6U)                               \r
+#define EXTI_PR_PR6_Msk                     (0x1UL << EXTI_PR_PR6_Pos)          /*!< 0x00000040 */\r
+#define EXTI_PR_PR6                         EXTI_PR_PR6_Msk                    /*!< Pending bit for line 6 */\r
+#define EXTI_PR_PR7_Pos                     (7U)                               \r
+#define EXTI_PR_PR7_Msk                     (0x1UL << EXTI_PR_PR7_Pos)          /*!< 0x00000080 */\r
+#define EXTI_PR_PR7                         EXTI_PR_PR7_Msk                    /*!< Pending bit for line 7 */\r
+#define EXTI_PR_PR8_Pos                     (8U)                               \r
+#define EXTI_PR_PR8_Msk                     (0x1UL << EXTI_PR_PR8_Pos)          /*!< 0x00000100 */\r
+#define EXTI_PR_PR8                         EXTI_PR_PR8_Msk                    /*!< Pending bit for line 8 */\r
+#define EXTI_PR_PR9_Pos                     (9U)                               \r
+#define EXTI_PR_PR9_Msk                     (0x1UL << EXTI_PR_PR9_Pos)          /*!< 0x00000200 */\r
+#define EXTI_PR_PR9                         EXTI_PR_PR9_Msk                    /*!< Pending bit for line 9 */\r
+#define EXTI_PR_PR10_Pos                    (10U)                              \r
+#define EXTI_PR_PR10_Msk                    (0x1UL << EXTI_PR_PR10_Pos)         /*!< 0x00000400 */\r
+#define EXTI_PR_PR10                        EXTI_PR_PR10_Msk                   /*!< Pending bit for line 10 */\r
+#define EXTI_PR_PR11_Pos                    (11U)                              \r
+#define EXTI_PR_PR11_Msk                    (0x1UL << EXTI_PR_PR11_Pos)         /*!< 0x00000800 */\r
+#define EXTI_PR_PR11                        EXTI_PR_PR11_Msk                   /*!< Pending bit for line 11 */\r
+#define EXTI_PR_PR12_Pos                    (12U)                              \r
+#define EXTI_PR_PR12_Msk                    (0x1UL << EXTI_PR_PR12_Pos)         /*!< 0x00001000 */\r
+#define EXTI_PR_PR12                        EXTI_PR_PR12_Msk                   /*!< Pending bit for line 12 */\r
+#define EXTI_PR_PR13_Pos                    (13U)                              \r
+#define EXTI_PR_PR13_Msk                    (0x1UL << EXTI_PR_PR13_Pos)         /*!< 0x00002000 */\r
+#define EXTI_PR_PR13                        EXTI_PR_PR13_Msk                   /*!< Pending bit for line 13 */\r
+#define EXTI_PR_PR14_Pos                    (14U)                              \r
+#define EXTI_PR_PR14_Msk                    (0x1UL << EXTI_PR_PR14_Pos)         /*!< 0x00004000 */\r
+#define EXTI_PR_PR14                        EXTI_PR_PR14_Msk                   /*!< Pending bit for line 14 */\r
+#define EXTI_PR_PR15_Pos                    (15U)                              \r
+#define EXTI_PR_PR15_Msk                    (0x1UL << EXTI_PR_PR15_Pos)         /*!< 0x00008000 */\r
+#define EXTI_PR_PR15                        EXTI_PR_PR15_Msk                   /*!< Pending bit for line 15 */\r
+#define EXTI_PR_PR16_Pos                    (16U)                              \r
+#define EXTI_PR_PR16_Msk                    (0x1UL << EXTI_PR_PR16_Pos)         /*!< 0x00010000 */\r
+#define EXTI_PR_PR16                        EXTI_PR_PR16_Msk                   /*!< Pending bit for line 16 */\r
+#define EXTI_PR_PR17_Pos                    (17U)                              \r
+#define EXTI_PR_PR17_Msk                    (0x1UL << EXTI_PR_PR17_Pos)         /*!< 0x00020000 */\r
+#define EXTI_PR_PR17                        EXTI_PR_PR17_Msk                   /*!< Pending bit for line 17 */\r
+#define EXTI_PR_PR18_Pos                    (18U)                              \r
+#define EXTI_PR_PR18_Msk                    (0x1UL << EXTI_PR_PR18_Pos)         /*!< 0x00040000 */\r
+#define EXTI_PR_PR18                        EXTI_PR_PR18_Msk                   /*!< Pending bit for line 18 */\r
+\r
+/* References Defines */\r
+#define  EXTI_PR_PIF0 EXTI_PR_PR0\r
+#define  EXTI_PR_PIF1 EXTI_PR_PR1\r
+#define  EXTI_PR_PIF2 EXTI_PR_PR2\r
+#define  EXTI_PR_PIF3 EXTI_PR_PR3\r
+#define  EXTI_PR_PIF4 EXTI_PR_PR4\r
+#define  EXTI_PR_PIF5 EXTI_PR_PR5\r
+#define  EXTI_PR_PIF6 EXTI_PR_PR6\r
+#define  EXTI_PR_PIF7 EXTI_PR_PR7\r
+#define  EXTI_PR_PIF8 EXTI_PR_PR8\r
+#define  EXTI_PR_PIF9 EXTI_PR_PR9\r
+#define  EXTI_PR_PIF10 EXTI_PR_PR10\r
+#define  EXTI_PR_PIF11 EXTI_PR_PR11\r
+#define  EXTI_PR_PIF12 EXTI_PR_PR12\r
+#define  EXTI_PR_PIF13 EXTI_PR_PR13\r
+#define  EXTI_PR_PIF14 EXTI_PR_PR14\r
+#define  EXTI_PR_PIF15 EXTI_PR_PR15\r
+#define  EXTI_PR_PIF16 EXTI_PR_PR16\r
+#define  EXTI_PR_PIF17 EXTI_PR_PR17\r
+#define  EXTI_PR_PIF18 EXTI_PR_PR18\r
+\r
+/******************************************************************************/\r
+/*                                                                            */\r
+/*                             DMA Controller                                 */\r
+/*                                                                            */\r
+/******************************************************************************/\r
+\r
+/*******************  Bit definition for DMA_ISR register  ********************/\r
+#define DMA_ISR_GIF1_Pos                    (0U)                               \r
+#define DMA_ISR_GIF1_Msk                    (0x1UL << DMA_ISR_GIF1_Pos)         /*!< 0x00000001 */\r
+#define DMA_ISR_GIF1                        DMA_ISR_GIF1_Msk                   /*!< Channel 1 Global interrupt flag */\r
+#define DMA_ISR_TCIF1_Pos                   (1U)                               \r
+#define DMA_ISR_TCIF1_Msk                   (0x1UL << DMA_ISR_TCIF1_Pos)        /*!< 0x00000002 */\r
+#define DMA_ISR_TCIF1                       DMA_ISR_TCIF1_Msk                  /*!< Channel 1 Transfer Complete flag */\r
+#define DMA_ISR_HTIF1_Pos                   (2U)                               \r
+#define DMA_ISR_HTIF1_Msk                   (0x1UL << DMA_ISR_HTIF1_Pos)        /*!< 0x00000004 */\r
+#define DMA_ISR_HTIF1                       DMA_ISR_HTIF1_Msk                  /*!< Channel 1 Half Transfer flag */\r
+#define DMA_ISR_TEIF1_Pos                   (3U)                               \r
+#define DMA_ISR_TEIF1_Msk                   (0x1UL << DMA_ISR_TEIF1_Pos)        /*!< 0x00000008 */\r
+#define DMA_ISR_TEIF1                       DMA_ISR_TEIF1_Msk                  /*!< Channel 1 Transfer Error flag */\r
+#define DMA_ISR_GIF2_Pos                    (4U)                               \r
+#define DMA_ISR_GIF2_Msk                    (0x1UL << DMA_ISR_GIF2_Pos)         /*!< 0x00000010 */\r
+#define DMA_ISR_GIF2                        DMA_ISR_GIF2_Msk                   /*!< Channel 2 Global interrupt flag */\r
+#define DMA_ISR_TCIF2_Pos                   (5U)                               \r
+#define DMA_ISR_TCIF2_Msk                   (0x1UL << DMA_ISR_TCIF2_Pos)        /*!< 0x00000020 */\r
+#define DMA_ISR_TCIF2                       DMA_ISR_TCIF2_Msk                  /*!< Channel 2 Transfer Complete flag */\r
+#define DMA_ISR_HTIF2_Pos                   (6U)                               \r
+#define DMA_ISR_HTIF2_Msk                   (0x1UL << DMA_ISR_HTIF2_Pos)        /*!< 0x00000040 */\r
+#define DMA_ISR_HTIF2                       DMA_ISR_HTIF2_Msk                  /*!< Channel 2 Half Transfer flag */\r
+#define DMA_ISR_TEIF2_Pos                   (7U)                               \r
+#define DMA_ISR_TEIF2_Msk                   (0x1UL << DMA_ISR_TEIF2_Pos)        /*!< 0x00000080 */\r
+#define DMA_ISR_TEIF2                       DMA_ISR_TEIF2_Msk                  /*!< Channel 2 Transfer Error flag */\r
+#define DMA_ISR_GIF3_Pos                    (8U)                               \r
+#define DMA_ISR_GIF3_Msk                    (0x1UL << DMA_ISR_GIF3_Pos)         /*!< 0x00000100 */\r
+#define DMA_ISR_GIF3                        DMA_ISR_GIF3_Msk                   /*!< Channel 3 Global interrupt flag */\r
+#define DMA_ISR_TCIF3_Pos                   (9U)                               \r
+#define DMA_ISR_TCIF3_Msk                   (0x1UL << DMA_ISR_TCIF3_Pos)        /*!< 0x00000200 */\r
+#define DMA_ISR_TCIF3                       DMA_ISR_TCIF3_Msk                  /*!< Channel 3 Transfer Complete flag */\r
+#define DMA_ISR_HTIF3_Pos                   (10U)                              \r
+#define DMA_ISR_HTIF3_Msk                   (0x1UL << DMA_ISR_HTIF3_Pos)        /*!< 0x00000400 */\r
+#define DMA_ISR_HTIF3                       DMA_ISR_HTIF3_Msk                  /*!< Channel 3 Half Transfer flag */\r
+#define DMA_ISR_TEIF3_Pos                   (11U)                              \r
+#define DMA_ISR_TEIF3_Msk                   (0x1UL << DMA_ISR_TEIF3_Pos)        /*!< 0x00000800 */\r
+#define DMA_ISR_TEIF3                       DMA_ISR_TEIF3_Msk                  /*!< Channel 3 Transfer Error flag */\r
+#define DMA_ISR_GIF4_Pos                    (12U)                              \r
+#define DMA_ISR_GIF4_Msk                    (0x1UL << DMA_ISR_GIF4_Pos)         /*!< 0x00001000 */\r
+#define DMA_ISR_GIF4                        DMA_ISR_GIF4_Msk                   /*!< Channel 4 Global interrupt flag */\r
+#define DMA_ISR_TCIF4_Pos                   (13U)                              \r
+#define DMA_ISR_TCIF4_Msk                   (0x1UL << DMA_ISR_TCIF4_Pos)        /*!< 0x00002000 */\r
+#define DMA_ISR_TCIF4                       DMA_ISR_TCIF4_Msk                  /*!< Channel 4 Transfer Complete flag */\r
+#define DMA_ISR_HTIF4_Pos                   (14U)                              \r
+#define DMA_ISR_HTIF4_Msk                   (0x1UL << DMA_ISR_HTIF4_Pos)        /*!< 0x00004000 */\r
+#define DMA_ISR_HTIF4                       DMA_ISR_HTIF4_Msk                  /*!< Channel 4 Half Transfer flag */\r
+#define DMA_ISR_TEIF4_Pos                   (15U)                              \r
+#define DMA_ISR_TEIF4_Msk                   (0x1UL << DMA_ISR_TEIF4_Pos)        /*!< 0x00008000 */\r
+#define DMA_ISR_TEIF4                       DMA_ISR_TEIF4_Msk                  /*!< Channel 4 Transfer Error flag */\r
+#define DMA_ISR_GIF5_Pos                    (16U)                              \r
+#define DMA_ISR_GIF5_Msk                    (0x1UL << DMA_ISR_GIF5_Pos)         /*!< 0x00010000 */\r
+#define DMA_ISR_GIF5                        DMA_ISR_GIF5_Msk                   /*!< Channel 5 Global interrupt flag */\r
+#define DMA_ISR_TCIF5_Pos                   (17U)                              \r
+#define DMA_ISR_TCIF5_Msk                   (0x1UL << DMA_ISR_TCIF5_Pos)        /*!< 0x00020000 */\r
+#define DMA_ISR_TCIF5                       DMA_ISR_TCIF5_Msk                  /*!< Channel 5 Transfer Complete flag */\r
+#define DMA_ISR_HTIF5_Pos                   (18U)                              \r
+#define DMA_ISR_HTIF5_Msk                   (0x1UL << DMA_ISR_HTIF5_Pos)        /*!< 0x00040000 */\r
+#define DMA_ISR_HTIF5                       DMA_ISR_HTIF5_Msk                  /*!< Channel 5 Half Transfer flag */\r
+#define DMA_ISR_TEIF5_Pos                   (19U)                              \r
+#define DMA_ISR_TEIF5_Msk                   (0x1UL << DMA_ISR_TEIF5_Pos)        /*!< 0x00080000 */\r
+#define DMA_ISR_TEIF5                       DMA_ISR_TEIF5_Msk                  /*!< Channel 5 Transfer Error flag */\r
+#define DMA_ISR_GIF6_Pos                    (20U)                              \r
+#define DMA_ISR_GIF6_Msk                    (0x1UL << DMA_ISR_GIF6_Pos)         /*!< 0x00100000 */\r
+#define DMA_ISR_GIF6                        DMA_ISR_GIF6_Msk                   /*!< Channel 6 Global interrupt flag */\r
+#define DMA_ISR_TCIF6_Pos                   (21U)                              \r
+#define DMA_ISR_TCIF6_Msk                   (0x1UL << DMA_ISR_TCIF6_Pos)        /*!< 0x00200000 */\r
+#define DMA_ISR_TCIF6                       DMA_ISR_TCIF6_Msk                  /*!< Channel 6 Transfer Complete flag */\r
+#define DMA_ISR_HTIF6_Pos                   (22U)                              \r
+#define DMA_ISR_HTIF6_Msk                   (0x1UL << DMA_ISR_HTIF6_Pos)        /*!< 0x00400000 */\r
+#define DMA_ISR_HTIF6                       DMA_ISR_HTIF6_Msk                  /*!< Channel 6 Half Transfer flag */\r
+#define DMA_ISR_TEIF6_Pos                   (23U)                              \r
+#define DMA_ISR_TEIF6_Msk                   (0x1UL << DMA_ISR_TEIF6_Pos)        /*!< 0x00800000 */\r
+#define DMA_ISR_TEIF6                       DMA_ISR_TEIF6_Msk                  /*!< Channel 6 Transfer Error flag */\r
+#define DMA_ISR_GIF7_Pos                    (24U)                              \r
+#define DMA_ISR_GIF7_Msk                    (0x1UL << DMA_ISR_GIF7_Pos)         /*!< 0x01000000 */\r
+#define DMA_ISR_GIF7                        DMA_ISR_GIF7_Msk                   /*!< Channel 7 Global interrupt flag */\r
+#define DMA_ISR_TCIF7_Pos                   (25U)                              \r
+#define DMA_ISR_TCIF7_Msk                   (0x1UL << DMA_ISR_TCIF7_Pos)        /*!< 0x02000000 */\r
+#define DMA_ISR_TCIF7                       DMA_ISR_TCIF7_Msk                  /*!< Channel 7 Transfer Complete flag */\r
+#define DMA_ISR_HTIF7_Pos                   (26U)                              \r
+#define DMA_ISR_HTIF7_Msk                   (0x1UL << DMA_ISR_HTIF7_Pos)        /*!< 0x04000000 */\r
+#define DMA_ISR_HTIF7                       DMA_ISR_HTIF7_Msk                  /*!< Channel 7 Half Transfer flag */\r
+#define DMA_ISR_TEIF7_Pos                   (27U)                              \r
+#define DMA_ISR_TEIF7_Msk                   (0x1UL << DMA_ISR_TEIF7_Pos)        /*!< 0x08000000 */\r
+#define DMA_ISR_TEIF7                       DMA_ISR_TEIF7_Msk                  /*!< Channel 7 Transfer Error flag */\r
+\r
+/*******************  Bit definition for DMA_IFCR register  *******************/\r
+#define DMA_IFCR_CGIF1_Pos                  (0U)                               \r
+#define DMA_IFCR_CGIF1_Msk                  (0x1UL << DMA_IFCR_CGIF1_Pos)       /*!< 0x00000001 */\r
+#define DMA_IFCR_CGIF1                      DMA_IFCR_CGIF1_Msk                 /*!< Channel 1 Global interrupt clear */\r
+#define DMA_IFCR_CTCIF1_Pos                 (1U)                               \r
+#define DMA_IFCR_CTCIF1_Msk                 (0x1UL << DMA_IFCR_CTCIF1_Pos)      /*!< 0x00000002 */\r
+#define DMA_IFCR_CTCIF1                     DMA_IFCR_CTCIF1_Msk                /*!< Channel 1 Transfer Complete clear */\r
+#define DMA_IFCR_CHTIF1_Pos                 (2U)                               \r
+#define DMA_IFCR_CHTIF1_Msk                 (0x1UL << DMA_IFCR_CHTIF1_Pos)      /*!< 0x00000004 */\r
+#define DMA_IFCR_CHTIF1                     DMA_IFCR_CHTIF1_Msk                /*!< Channel 1 Half Transfer clear */\r
+#define DMA_IFCR_CTEIF1_Pos                 (3U)                               \r
+#define DMA_IFCR_CTEIF1_Msk                 (0x1UL << DMA_IFCR_CTEIF1_Pos)      /*!< 0x00000008 */\r
+#define DMA_IFCR_CTEIF1                     DMA_IFCR_CTEIF1_Msk                /*!< Channel 1 Transfer Error clear */\r
+#define DMA_IFCR_CGIF2_Pos                  (4U)                               \r
+#define DMA_IFCR_CGIF2_Msk                  (0x1UL << DMA_IFCR_CGIF2_Pos)       /*!< 0x00000010 */\r
+#define DMA_IFCR_CGIF2                      DMA_IFCR_CGIF2_Msk                 /*!< Channel 2 Global interrupt clear */\r
+#define DMA_IFCR_CTCIF2_Pos                 (5U)                               \r
+#define DMA_IFCR_CTCIF2_Msk                 (0x1UL << DMA_IFCR_CTCIF2_Pos)      /*!< 0x00000020 */\r
+#define DMA_IFCR_CTCIF2                     DMA_IFCR_CTCIF2_Msk                /*!< Channel 2 Transfer Complete clear */\r
+#define DMA_IFCR_CHTIF2_Pos                 (6U)                               \r
+#define DMA_IFCR_CHTIF2_Msk                 (0x1UL << DMA_IFCR_CHTIF2_Pos)      /*!< 0x00000040 */\r
+#define DMA_IFCR_CHTIF2                     DMA_IFCR_CHTIF2_Msk                /*!< Channel 2 Half Transfer clear */\r
+#define DMA_IFCR_CTEIF2_Pos                 (7U)                               \r
+#define DMA_IFCR_CTEIF2_Msk                 (0x1UL << DMA_IFCR_CTEIF2_Pos)      /*!< 0x00000080 */\r
+#define DMA_IFCR_CTEIF2                     DMA_IFCR_CTEIF2_Msk                /*!< Channel 2 Transfer Error clear */\r
+#define DMA_IFCR_CGIF3_Pos                  (8U)                               \r
+#define DMA_IFCR_CGIF3_Msk                  (0x1UL << DMA_IFCR_CGIF3_Pos)       /*!< 0x00000100 */\r
+#define DMA_IFCR_CGIF3                      DMA_IFCR_CGIF3_Msk                 /*!< Channel 3 Global interrupt clear */\r
+#define DMA_IFCR_CTCIF3_Pos                 (9U)                               \r
+#define DMA_IFCR_CTCIF3_Msk                 (0x1UL << DMA_IFCR_CTCIF3_Pos)      /*!< 0x00000200 */\r
+#define DMA_IFCR_CTCIF3                     DMA_IFCR_CTCIF3_Msk                /*!< Channel 3 Transfer Complete clear */\r
+#define DMA_IFCR_CHTIF3_Pos                 (10U)                              \r
+#define DMA_IFCR_CHTIF3_Msk                 (0x1UL << DMA_IFCR_CHTIF3_Pos)      /*!< 0x00000400 */\r
+#define DMA_IFCR_CHTIF3                     DMA_IFCR_CHTIF3_Msk                /*!< Channel 3 Half Transfer clear */\r
+#define DMA_IFCR_CTEIF3_Pos                 (11U)                              \r
+#define DMA_IFCR_CTEIF3_Msk                 (0x1UL << DMA_IFCR_CTEIF3_Pos)      /*!< 0x00000800 */\r
+#define DMA_IFCR_CTEIF3                     DMA_IFCR_CTEIF3_Msk                /*!< Channel 3 Transfer Error clear */\r
+#define DMA_IFCR_CGIF4_Pos                  (12U)                              \r
+#define DMA_IFCR_CGIF4_Msk                  (0x1UL << DMA_IFCR_CGIF4_Pos)       /*!< 0x00001000 */\r
+#define DMA_IFCR_CGIF4                      DMA_IFCR_CGIF4_Msk                 /*!< Channel 4 Global interrupt clear */\r
+#define DMA_IFCR_CTCIF4_Pos                 (13U)                              \r
+#define DMA_IFCR_CTCIF4_Msk                 (0x1UL << DMA_IFCR_CTCIF4_Pos)      /*!< 0x00002000 */\r
+#define DMA_IFCR_CTCIF4                     DMA_IFCR_CTCIF4_Msk                /*!< Channel 4 Transfer Complete clear */\r
+#define DMA_IFCR_CHTIF4_Pos                 (14U)                              \r
+#define DMA_IFCR_CHTIF4_Msk                 (0x1UL << DMA_IFCR_CHTIF4_Pos)      /*!< 0x00004000 */\r
+#define DMA_IFCR_CHTIF4                     DMA_IFCR_CHTIF4_Msk                /*!< Channel 4 Half Transfer clear */\r
+#define DMA_IFCR_CTEIF4_Pos                 (15U)                              \r
+#define DMA_IFCR_CTEIF4_Msk                 (0x1UL << DMA_IFCR_CTEIF4_Pos)      /*!< 0x00008000 */\r
+#define DMA_IFCR_CTEIF4                     DMA_IFCR_CTEIF4_Msk                /*!< Channel 4 Transfer Error clear */\r
+#define DMA_IFCR_CGIF5_Pos                  (16U)                              \r
+#define DMA_IFCR_CGIF5_Msk                  (0x1UL << DMA_IFCR_CGIF5_Pos)       /*!< 0x00010000 */\r
+#define DMA_IFCR_CGIF5                      DMA_IFCR_CGIF5_Msk                 /*!< Channel 5 Global interrupt clear */\r
+#define DMA_IFCR_CTCIF5_Pos                 (17U)                              \r
+#define DMA_IFCR_CTCIF5_Msk                 (0x1UL << DMA_IFCR_CTCIF5_Pos)      /*!< 0x00020000 */\r
+#define DMA_IFCR_CTCIF5                     DMA_IFCR_CTCIF5_Msk                /*!< Channel 5 Transfer Complete clear */\r
+#define DMA_IFCR_CHTIF5_Pos                 (18U)                              \r
+#define DMA_IFCR_CHTIF5_Msk                 (0x1UL << DMA_IFCR_CHTIF5_Pos)      /*!< 0x00040000 */\r
+#define DMA_IFCR_CHTIF5                     DMA_IFCR_CHTIF5_Msk                /*!< Channel 5 Half Transfer clear */\r
+#define DMA_IFCR_CTEIF5_Pos                 (19U)                              \r
+#define DMA_IFCR_CTEIF5_Msk                 (0x1UL << DMA_IFCR_CTEIF5_Pos)      /*!< 0x00080000 */\r
+#define DMA_IFCR_CTEIF5                     DMA_IFCR_CTEIF5_Msk                /*!< Channel 5 Transfer Error clear */\r
+#define DMA_IFCR_CGIF6_Pos                  (20U)                              \r
+#define DMA_IFCR_CGIF6_Msk                  (0x1UL << DMA_IFCR_CGIF6_Pos)       /*!< 0x00100000 */\r
+#define DMA_IFCR_CGIF6                      DMA_IFCR_CGIF6_Msk                 /*!< Channel 6 Global interrupt clear */\r
+#define DMA_IFCR_CTCIF6_Pos                 (21U)                              \r
+#define DMA_IFCR_CTCIF6_Msk                 (0x1UL << DMA_IFCR_CTCIF6_Pos)      /*!< 0x00200000 */\r
+#define DMA_IFCR_CTCIF6                     DMA_IFCR_CTCIF6_Msk                /*!< Channel 6 Transfer Complete clear */\r
+#define DMA_IFCR_CHTIF6_Pos                 (22U)                              \r
+#define DMA_IFCR_CHTIF6_Msk                 (0x1UL << DMA_IFCR_CHTIF6_Pos)      /*!< 0x00400000 */\r
+#define DMA_IFCR_CHTIF6                     DMA_IFCR_CHTIF6_Msk                /*!< Channel 6 Half Transfer clear */\r
+#define DMA_IFCR_CTEIF6_Pos                 (23U)                              \r
+#define DMA_IFCR_CTEIF6_Msk                 (0x1UL << DMA_IFCR_CTEIF6_Pos)      /*!< 0x00800000 */\r
+#define DMA_IFCR_CTEIF6                     DMA_IFCR_CTEIF6_Msk                /*!< Channel 6 Transfer Error clear */\r
+#define DMA_IFCR_CGIF7_Pos                  (24U)                              \r
+#define DMA_IFCR_CGIF7_Msk                  (0x1UL << DMA_IFCR_CGIF7_Pos)       /*!< 0x01000000 */\r
+#define DMA_IFCR_CGIF7                      DMA_IFCR_CGIF7_Msk                 /*!< Channel 7 Global interrupt clear */\r
+#define DMA_IFCR_CTCIF7_Pos                 (25U)                              \r
+#define DMA_IFCR_CTCIF7_Msk                 (0x1UL << DMA_IFCR_CTCIF7_Pos)      /*!< 0x02000000 */\r
+#define DMA_IFCR_CTCIF7                     DMA_IFCR_CTCIF7_Msk                /*!< Channel 7 Transfer Complete clear */\r
+#define DMA_IFCR_CHTIF7_Pos                 (26U)                              \r
+#define DMA_IFCR_CHTIF7_Msk                 (0x1UL << DMA_IFCR_CHTIF7_Pos)      /*!< 0x04000000 */\r
+#define DMA_IFCR_CHTIF7                     DMA_IFCR_CHTIF7_Msk                /*!< Channel 7 Half Transfer clear */\r
+#define DMA_IFCR_CTEIF7_Pos                 (27U)                              \r
+#define DMA_IFCR_CTEIF7_Msk                 (0x1UL << DMA_IFCR_CTEIF7_Pos)      /*!< 0x08000000 */\r
+#define DMA_IFCR_CTEIF7                     DMA_IFCR_CTEIF7_Msk                /*!< Channel 7 Transfer Error clear */\r
+\r
+/*******************  Bit definition for DMA_CCR register   *******************/\r
+#define DMA_CCR_EN_Pos                      (0U)                               \r
+#define DMA_CCR_EN_Msk                      (0x1UL << DMA_CCR_EN_Pos)           /*!< 0x00000001 */\r
+#define DMA_CCR_EN                          DMA_CCR_EN_Msk                     /*!< Channel enable */\r
+#define DMA_CCR_TCIE_Pos                    (1U)                               \r
+#define DMA_CCR_TCIE_Msk                    (0x1UL << DMA_CCR_TCIE_Pos)         /*!< 0x00000002 */\r
+#define DMA_CCR_TCIE                        DMA_CCR_TCIE_Msk                   /*!< Transfer complete interrupt enable */\r
+#define DMA_CCR_HTIE_Pos                    (2U)                               \r
+#define DMA_CCR_HTIE_Msk                    (0x1UL << DMA_CCR_HTIE_Pos)         /*!< 0x00000004 */\r
+#define DMA_CCR_HTIE                        DMA_CCR_HTIE_Msk                   /*!< Half Transfer interrupt enable */\r
+#define DMA_CCR_TEIE_Pos                    (3U)                               \r
+#define DMA_CCR_TEIE_Msk                    (0x1UL << DMA_CCR_TEIE_Pos)         /*!< 0x00000008 */\r
+#define DMA_CCR_TEIE                        DMA_CCR_TEIE_Msk                   /*!< Transfer error interrupt enable */\r
+#define DMA_CCR_DIR_Pos                     (4U)                               \r
+#define DMA_CCR_DIR_Msk                     (0x1UL << DMA_CCR_DIR_Pos)          /*!< 0x00000010 */\r
+#define DMA_CCR_DIR                         DMA_CCR_DIR_Msk                    /*!< Data transfer direction */\r
+#define DMA_CCR_CIRC_Pos                    (5U)                               \r
+#define DMA_CCR_CIRC_Msk                    (0x1UL << DMA_CCR_CIRC_Pos)         /*!< 0x00000020 */\r
+#define DMA_CCR_CIRC                        DMA_CCR_CIRC_Msk                   /*!< Circular mode */\r
+#define DMA_CCR_PINC_Pos                    (6U)                               \r
+#define DMA_CCR_PINC_Msk                    (0x1UL << DMA_CCR_PINC_Pos)         /*!< 0x00000040 */\r
+#define DMA_CCR_PINC                        DMA_CCR_PINC_Msk                   /*!< Peripheral increment mode */\r
+#define DMA_CCR_MINC_Pos                    (7U)                               \r
+#define DMA_CCR_MINC_Msk                    (0x1UL << DMA_CCR_MINC_Pos)         /*!< 0x00000080 */\r
+#define DMA_CCR_MINC                        DMA_CCR_MINC_Msk                   /*!< Memory increment mode */\r
+\r
+#define DMA_CCR_PSIZE_Pos                   (8U)                               \r
+#define DMA_CCR_PSIZE_Msk                   (0x3UL << DMA_CCR_PSIZE_Pos)        /*!< 0x00000300 */\r
+#define DMA_CCR_PSIZE                       DMA_CCR_PSIZE_Msk                  /*!< PSIZE[1:0] bits (Peripheral size) */\r
+#define DMA_CCR_PSIZE_0                     (0x1UL << DMA_CCR_PSIZE_Pos)        /*!< 0x00000100 */\r
+#define DMA_CCR_PSIZE_1                     (0x2UL << DMA_CCR_PSIZE_Pos)        /*!< 0x00000200 */\r
+\r
+#define DMA_CCR_MSIZE_Pos                   (10U)                              \r
+#define DMA_CCR_MSIZE_Msk                   (0x3UL << DMA_CCR_MSIZE_Pos)        /*!< 0x00000C00 */\r
+#define DMA_CCR_MSIZE                       DMA_CCR_MSIZE_Msk                  /*!< MSIZE[1:0] bits (Memory size) */\r
+#define DMA_CCR_MSIZE_0                     (0x1UL << DMA_CCR_MSIZE_Pos)        /*!< 0x00000400 */\r
+#define DMA_CCR_MSIZE_1                     (0x2UL << DMA_CCR_MSIZE_Pos)        /*!< 0x00000800 */\r
+\r
+#define DMA_CCR_PL_Pos                      (12U)                              \r
+#define DMA_CCR_PL_Msk                      (0x3UL << DMA_CCR_PL_Pos)           /*!< 0x00003000 */\r
+#define DMA_CCR_PL                          DMA_CCR_PL_Msk                     /*!< PL[1:0] bits(Channel Priority level) */\r
+#define DMA_CCR_PL_0                        (0x1UL << DMA_CCR_PL_Pos)           /*!< 0x00001000 */\r
+#define DMA_CCR_PL_1                        (0x2UL << DMA_CCR_PL_Pos)           /*!< 0x00002000 */\r
+\r
+#define DMA_CCR_MEM2MEM_Pos                 (14U)                              \r
+#define DMA_CCR_MEM2MEM_Msk                 (0x1UL << DMA_CCR_MEM2MEM_Pos)      /*!< 0x00004000 */\r
+#define DMA_CCR_MEM2MEM                     DMA_CCR_MEM2MEM_Msk                /*!< Memory to memory mode */\r
+\r
+/******************  Bit definition for DMA_CNDTR  register  ******************/\r
+#define DMA_CNDTR_NDT_Pos                   (0U)                               \r
+#define DMA_CNDTR_NDT_Msk                   (0xFFFFUL << DMA_CNDTR_NDT_Pos)     /*!< 0x0000FFFF */\r
+#define DMA_CNDTR_NDT                       DMA_CNDTR_NDT_Msk                  /*!< Number of data to Transfer */\r
+\r
+/******************  Bit definition for DMA_CPAR  register  *******************/\r
+#define DMA_CPAR_PA_Pos                     (0U)                               \r
+#define DMA_CPAR_PA_Msk                     (0xFFFFFFFFUL << DMA_CPAR_PA_Pos)   /*!< 0xFFFFFFFF */\r
+#define DMA_CPAR_PA                         DMA_CPAR_PA_Msk                    /*!< Peripheral Address */\r
+\r
+/******************  Bit definition for DMA_CMAR  register  *******************/\r
+#define DMA_CMAR_MA_Pos                     (0U)                               \r
+#define DMA_CMAR_MA_Msk                     (0xFFFFFFFFUL << DMA_CMAR_MA_Pos)   /*!< 0xFFFFFFFF */\r
+#define DMA_CMAR_MA                         DMA_CMAR_MA_Msk                    /*!< Memory Address */\r
+\r
+/******************************************************************************/\r
+/*                                                                            */\r
+/*                      Analog to Digital Converter (ADC)                     */\r
+/*                                                                            */\r
+/******************************************************************************/\r
+\r
+/*\r
+ * @brief Specific device feature definitions (not present on all devices in the STM32F1 family)\r
+ */\r
+#define ADC_MULTIMODE_SUPPORT                          /*!< ADC feature available only on specific devices: multimode available on devices with several ADC instances */\r
+\r
+/********************  Bit definition for ADC_SR register  ********************/\r
+#define ADC_SR_AWD_Pos                      (0U)                               \r
+#define ADC_SR_AWD_Msk                      (0x1UL << ADC_SR_AWD_Pos)           /*!< 0x00000001 */\r
+#define ADC_SR_AWD                          ADC_SR_AWD_Msk                     /*!< ADC analog watchdog 1 flag */\r
+#define ADC_SR_EOS_Pos                      (1U)                               \r
+#define ADC_SR_EOS_Msk                      (0x1UL << ADC_SR_EOS_Pos)           /*!< 0x00000002 */\r
+#define ADC_SR_EOS                          ADC_SR_EOS_Msk                     /*!< ADC group regular end of sequence conversions flag */\r
+#define ADC_SR_JEOS_Pos                     (2U)                               \r
+#define ADC_SR_JEOS_Msk                     (0x1UL << ADC_SR_JEOS_Pos)          /*!< 0x00000004 */\r
+#define ADC_SR_JEOS                         ADC_SR_JEOS_Msk                    /*!< ADC group injected end of sequence conversions flag */\r
+#define ADC_SR_JSTRT_Pos                    (3U)                               \r
+#define ADC_SR_JSTRT_Msk                    (0x1UL << ADC_SR_JSTRT_Pos)         /*!< 0x00000008 */\r
+#define ADC_SR_JSTRT                        ADC_SR_JSTRT_Msk                   /*!< ADC group injected conversion start flag */\r
+#define ADC_SR_STRT_Pos                     (4U)                               \r
+#define ADC_SR_STRT_Msk                     (0x1UL << ADC_SR_STRT_Pos)          /*!< 0x00000010 */\r
+#define ADC_SR_STRT                         ADC_SR_STRT_Msk                    /*!< ADC group regular conversion start flag */\r
+\r
+/* Legacy defines */\r
+#define  ADC_SR_EOC                          (ADC_SR_EOS)\r
+#define  ADC_SR_JEOC                         (ADC_SR_JEOS)\r
+\r
+/*******************  Bit definition for ADC_CR1 register  ********************/\r
+#define ADC_CR1_AWDCH_Pos                   (0U)                               \r
+#define ADC_CR1_AWDCH_Msk                   (0x1FUL << ADC_CR1_AWDCH_Pos)       /*!< 0x0000001F */\r
+#define ADC_CR1_AWDCH                       ADC_CR1_AWDCH_Msk                  /*!< ADC analog watchdog 1 monitored channel selection */\r
+#define ADC_CR1_AWDCH_0                     (0x01UL << ADC_CR1_AWDCH_Pos)       /*!< 0x00000001 */\r
+#define ADC_CR1_AWDCH_1                     (0x02UL << ADC_CR1_AWDCH_Pos)       /*!< 0x00000002 */\r
+#define ADC_CR1_AWDCH_2                     (0x04UL << ADC_CR1_AWDCH_Pos)       /*!< 0x00000004 */\r
+#define ADC_CR1_AWDCH_3                     (0x08UL << ADC_CR1_AWDCH_Pos)       /*!< 0x00000008 */\r
+#define ADC_CR1_AWDCH_4                     (0x10UL << ADC_CR1_AWDCH_Pos)       /*!< 0x00000010 */\r
+\r
+#define ADC_CR1_EOSIE_Pos                   (5U)                               \r
+#define ADC_CR1_EOSIE_Msk                   (0x1UL << ADC_CR1_EOSIE_Pos)        /*!< 0x00000020 */\r
+#define ADC_CR1_EOSIE                       ADC_CR1_EOSIE_Msk                  /*!< ADC group regular end of sequence conversions interrupt */\r
+#define ADC_CR1_AWDIE_Pos                   (6U)                               \r
+#define ADC_CR1_AWDIE_Msk                   (0x1UL << ADC_CR1_AWDIE_Pos)        /*!< 0x00000040 */\r
+#define ADC_CR1_AWDIE                       ADC_CR1_AWDIE_Msk                  /*!< ADC analog watchdog 1 interrupt */\r
+#define ADC_CR1_JEOSIE_Pos                  (7U)                               \r
+#define ADC_CR1_JEOSIE_Msk                  (0x1UL << ADC_CR1_JEOSIE_Pos)       /*!< 0x00000080 */\r
+#define ADC_CR1_JEOSIE                      ADC_CR1_JEOSIE_Msk                 /*!< ADC group injected end of sequence conversions interrupt */\r
+#define ADC_CR1_SCAN_Pos                    (8U)                               \r
+#define ADC_CR1_SCAN_Msk                    (0x1UL << ADC_CR1_SCAN_Pos)         /*!< 0x00000100 */\r
+#define ADC_CR1_SCAN                        ADC_CR1_SCAN_Msk                   /*!< ADC scan mode */\r
+#define ADC_CR1_AWDSGL_Pos                  (9U)                               \r
+#define ADC_CR1_AWDSGL_Msk                  (0x1UL << ADC_CR1_AWDSGL_Pos)       /*!< 0x00000200 */\r
+#define ADC_CR1_AWDSGL                      ADC_CR1_AWDSGL_Msk                 /*!< ADC analog watchdog 1 monitoring a single channel or all channels */\r
+#define ADC_CR1_JAUTO_Pos                   (10U)                              \r
+#define ADC_CR1_JAUTO_Msk                   (0x1UL << ADC_CR1_JAUTO_Pos)        /*!< 0x00000400 */\r
+#define ADC_CR1_JAUTO                       ADC_CR1_JAUTO_Msk                  /*!< ADC group injected automatic trigger mode */\r
+#define ADC_CR1_DISCEN_Pos                  (11U)                              \r
+#define ADC_CR1_DISCEN_Msk                  (0x1UL << ADC_CR1_DISCEN_Pos)       /*!< 0x00000800 */\r
+#define ADC_CR1_DISCEN                      ADC_CR1_DISCEN_Msk                 /*!< ADC group regular sequencer discontinuous mode */\r
+#define ADC_CR1_JDISCEN_Pos                 (12U)                              \r
+#define ADC_CR1_JDISCEN_Msk                 (0x1UL << ADC_CR1_JDISCEN_Pos)      /*!< 0x00001000 */\r
+#define ADC_CR1_JDISCEN                     ADC_CR1_JDISCEN_Msk                /*!< ADC group injected sequencer discontinuous mode */\r
+\r
+#define ADC_CR1_DISCNUM_Pos                 (13U)                              \r
+#define ADC_CR1_DISCNUM_Msk                 (0x7UL << ADC_CR1_DISCNUM_Pos)      /*!< 0x0000E000 */\r
+#define ADC_CR1_DISCNUM                     ADC_CR1_DISCNUM_Msk                /*!< ADC group regular sequencer discontinuous number of ranks */\r
+#define ADC_CR1_DISCNUM_0                   (0x1UL << ADC_CR1_DISCNUM_Pos)      /*!< 0x00002000 */\r
+#define ADC_CR1_DISCNUM_1                   (0x2UL << ADC_CR1_DISCNUM_Pos)      /*!< 0x00004000 */\r
+#define ADC_CR1_DISCNUM_2                   (0x4UL << ADC_CR1_DISCNUM_Pos)      /*!< 0x00008000 */\r
+\r
+#define ADC_CR1_DUALMOD_Pos                 (16U)                              \r
+#define ADC_CR1_DUALMOD_Msk                 (0xFUL << ADC_CR1_DUALMOD_Pos)      /*!< 0x000F0000 */\r
+#define ADC_CR1_DUALMOD                     ADC_CR1_DUALMOD_Msk                /*!< ADC multimode mode selection */\r
+#define ADC_CR1_DUALMOD_0                   (0x1UL << ADC_CR1_DUALMOD_Pos)      /*!< 0x00010000 */\r
+#define ADC_CR1_DUALMOD_1                   (0x2UL << ADC_CR1_DUALMOD_Pos)      /*!< 0x00020000 */\r
+#define ADC_CR1_DUALMOD_2                   (0x4UL << ADC_CR1_DUALMOD_Pos)      /*!< 0x00040000 */\r
+#define ADC_CR1_DUALMOD_3                   (0x8UL << ADC_CR1_DUALMOD_Pos)      /*!< 0x00080000 */\r
+\r
+#define ADC_CR1_JAWDEN_Pos                  (22U)                              \r
+#define ADC_CR1_JAWDEN_Msk                  (0x1UL << ADC_CR1_JAWDEN_Pos)       /*!< 0x00400000 */\r
+#define ADC_CR1_JAWDEN                      ADC_CR1_JAWDEN_Msk                 /*!< ADC analog watchdog 1 enable on scope ADC group injected */\r
+#define ADC_CR1_AWDEN_Pos                   (23U)                              \r
+#define ADC_CR1_AWDEN_Msk                   (0x1UL << ADC_CR1_AWDEN_Pos)        /*!< 0x00800000 */\r
+#define ADC_CR1_AWDEN                       ADC_CR1_AWDEN_Msk                  /*!< ADC analog watchdog 1 enable on scope ADC group regular */\r
+\r
+/* Legacy defines */\r
+#define  ADC_CR1_EOCIE                       (ADC_CR1_EOSIE)\r
+#define  ADC_CR1_JEOCIE                      (ADC_CR1_JEOSIE)\r
+\r
+/*******************  Bit definition for ADC_CR2 register  ********************/\r
+#define ADC_CR2_ADON_Pos                    (0U)                               \r
+#define ADC_CR2_ADON_Msk                    (0x1UL << ADC_CR2_ADON_Pos)         /*!< 0x00000001 */\r
+#define ADC_CR2_ADON                        ADC_CR2_ADON_Msk                   /*!< ADC enable */\r
+#define ADC_CR2_CONT_Pos                    (1U)                               \r
+#define ADC_CR2_CONT_Msk                    (0x1UL << ADC_CR2_CONT_Pos)         /*!< 0x00000002 */\r
+#define ADC_CR2_CONT                        ADC_CR2_CONT_Msk                   /*!< ADC group regular continuous conversion mode */\r
+#define ADC_CR2_CAL_Pos                     (2U)                               \r
+#define ADC_CR2_CAL_Msk                     (0x1UL << ADC_CR2_CAL_Pos)          /*!< 0x00000004 */\r
+#define ADC_CR2_CAL                         ADC_CR2_CAL_Msk                    /*!< ADC calibration start */\r
+#define ADC_CR2_RSTCAL_Pos                  (3U)                               \r
+#define ADC_CR2_RSTCAL_Msk                  (0x1UL << ADC_CR2_RSTCAL_Pos)       /*!< 0x00000008 */\r
+#define ADC_CR2_RSTCAL                      ADC_CR2_RSTCAL_Msk                 /*!< ADC calibration reset */\r
+#define ADC_CR2_DMA_Pos                     (8U)                               \r
+#define ADC_CR2_DMA_Msk                     (0x1UL << ADC_CR2_DMA_Pos)          /*!< 0x00000100 */\r
+#define ADC_CR2_DMA                         ADC_CR2_DMA_Msk                    /*!< ADC DMA transfer enable */\r
+#define ADC_CR2_ALIGN_Pos                   (11U)                              \r
+#define ADC_CR2_ALIGN_Msk                   (0x1UL << ADC_CR2_ALIGN_Pos)        /*!< 0x00000800 */\r
+#define ADC_CR2_ALIGN                       ADC_CR2_ALIGN_Msk                  /*!< ADC data alignement */\r
+\r
+#define ADC_CR2_JEXTSEL_Pos                 (12U)                              \r
+#define ADC_CR2_JEXTSEL_Msk                 (0x7UL << ADC_CR2_JEXTSEL_Pos)      /*!< 0x00007000 */\r
+#define ADC_CR2_JEXTSEL                     ADC_CR2_JEXTSEL_Msk                /*!< ADC group injected external trigger source */\r
+#define ADC_CR2_JEXTSEL_0                   (0x1UL << ADC_CR2_JEXTSEL_Pos)      /*!< 0x00001000 */\r
+#define ADC_CR2_JEXTSEL_1                   (0x2UL << ADC_CR2_JEXTSEL_Pos)      /*!< 0x00002000 */\r
+#define ADC_CR2_JEXTSEL_2                   (0x4UL << ADC_CR2_JEXTSEL_Pos)      /*!< 0x00004000 */\r
+\r
+#define ADC_CR2_JEXTTRIG_Pos                (15U)                              \r
+#define ADC_CR2_JEXTTRIG_Msk                (0x1UL << ADC_CR2_JEXTTRIG_Pos)     /*!< 0x00008000 */\r
+#define ADC_CR2_JEXTTRIG                    ADC_CR2_JEXTTRIG_Msk               /*!< ADC group injected external trigger enable */\r
+\r
+#define ADC_CR2_EXTSEL_Pos                  (17U)                              \r
+#define ADC_CR2_EXTSEL_Msk                  (0x7UL << ADC_CR2_EXTSEL_Pos)       /*!< 0x000E0000 */\r
+#define ADC_CR2_EXTSEL                      ADC_CR2_EXTSEL_Msk                 /*!< ADC group regular external trigger source */\r
+#define ADC_CR2_EXTSEL_0                    (0x1UL << ADC_CR2_EXTSEL_Pos)       /*!< 0x00020000 */\r
+#define ADC_CR2_EXTSEL_1                    (0x2UL << ADC_CR2_EXTSEL_Pos)       /*!< 0x00040000 */\r
+#define ADC_CR2_EXTSEL_2                    (0x4UL << ADC_CR2_EXTSEL_Pos)       /*!< 0x00080000 */\r
+\r
+#define ADC_CR2_EXTTRIG_Pos                 (20U)                              \r
+#define ADC_CR2_EXTTRIG_Msk                 (0x1UL << ADC_CR2_EXTTRIG_Pos)      /*!< 0x00100000 */\r
+#define ADC_CR2_EXTTRIG                     ADC_CR2_EXTTRIG_Msk                /*!< ADC group regular external trigger enable */\r
+#define ADC_CR2_JSWSTART_Pos                (21U)                              \r
+#define ADC_CR2_JSWSTART_Msk                (0x1UL << ADC_CR2_JSWSTART_Pos)     /*!< 0x00200000 */\r
+#define ADC_CR2_JSWSTART                    ADC_CR2_JSWSTART_Msk               /*!< ADC group injected conversion start */\r
+#define ADC_CR2_SWSTART_Pos                 (22U)                              \r
+#define ADC_CR2_SWSTART_Msk                 (0x1UL << ADC_CR2_SWSTART_Pos)      /*!< 0x00400000 */\r
+#define ADC_CR2_SWSTART                     ADC_CR2_SWSTART_Msk                /*!< ADC group regular conversion start */\r
+#define ADC_CR2_TSVREFE_Pos                 (23U)                              \r
+#define ADC_CR2_TSVREFE_Msk                 (0x1UL << ADC_CR2_TSVREFE_Pos)      /*!< 0x00800000 */\r
+#define ADC_CR2_TSVREFE                     ADC_CR2_TSVREFE_Msk                /*!< ADC internal path to VrefInt and temperature sensor enable */\r
+\r
+/******************  Bit definition for ADC_SMPR1 register  *******************/\r
+#define ADC_SMPR1_SMP10_Pos                 (0U)                               \r
+#define ADC_SMPR1_SMP10_Msk                 (0x7UL << ADC_SMPR1_SMP10_Pos)      /*!< 0x00000007 */\r
+#define ADC_SMPR1_SMP10                     ADC_SMPR1_SMP10_Msk                /*!< ADC channel 10 sampling time selection  */\r
+#define ADC_SMPR1_SMP10_0                   (0x1UL << ADC_SMPR1_SMP10_Pos)      /*!< 0x00000001 */\r
+#define ADC_SMPR1_SMP10_1                   (0x2UL << ADC_SMPR1_SMP10_Pos)      /*!< 0x00000002 */\r
+#define ADC_SMPR1_SMP10_2                   (0x4UL << ADC_SMPR1_SMP10_Pos)      /*!< 0x00000004 */\r
+\r
+#define ADC_SMPR1_SMP11_Pos                 (3U)                               \r
+#define ADC_SMPR1_SMP11_Msk                 (0x7UL << ADC_SMPR1_SMP11_Pos)      /*!< 0x00000038 */\r
+#define ADC_SMPR1_SMP11                     ADC_SMPR1_SMP11_Msk                /*!< ADC channel 11 sampling time selection  */\r
+#define ADC_SMPR1_SMP11_0                   (0x1UL << ADC_SMPR1_SMP11_Pos)      /*!< 0x00000008 */\r
+#define ADC_SMPR1_SMP11_1                   (0x2UL << ADC_SMPR1_SMP11_Pos)      /*!< 0x00000010 */\r
+#define ADC_SMPR1_SMP11_2                   (0x4UL << ADC_SMPR1_SMP11_Pos)      /*!< 0x00000020 */\r
+\r
+#define ADC_SMPR1_SMP12_Pos                 (6U)                               \r
+#define ADC_SMPR1_SMP12_Msk                 (0x7UL << ADC_SMPR1_SMP12_Pos)      /*!< 0x000001C0 */\r
+#define ADC_SMPR1_SMP12                     ADC_SMPR1_SMP12_Msk                /*!< ADC channel 12 sampling time selection  */\r
+#define ADC_SMPR1_SMP12_0                   (0x1UL << ADC_SMPR1_SMP12_Pos)      /*!< 0x00000040 */\r
+#define ADC_SMPR1_SMP12_1                   (0x2UL << ADC_SMPR1_SMP12_Pos)      /*!< 0x00000080 */\r
+#define ADC_SMPR1_SMP12_2                   (0x4UL << ADC_SMPR1_SMP12_Pos)      /*!< 0x00000100 */\r
+\r
+#define ADC_SMPR1_SMP13_Pos                 (9U)                               \r
+#define ADC_SMPR1_SMP13_Msk                 (0x7UL << ADC_SMPR1_SMP13_Pos)      /*!< 0x00000E00 */\r
+#define ADC_SMPR1_SMP13                     ADC_SMPR1_SMP13_Msk                /*!< ADC channel 13 sampling time selection  */\r
+#define ADC_SMPR1_SMP13_0                   (0x1UL << ADC_SMPR1_SMP13_Pos)      /*!< 0x00000200 */\r
+#define ADC_SMPR1_SMP13_1                   (0x2UL << ADC_SMPR1_SMP13_Pos)      /*!< 0x00000400 */\r
+#define ADC_SMPR1_SMP13_2                   (0x4UL << ADC_SMPR1_SMP13_Pos)      /*!< 0x00000800 */\r
+\r
+#define ADC_SMPR1_SMP14_Pos                 (12U)                              \r
+#define ADC_SMPR1_SMP14_Msk                 (0x7UL << ADC_SMPR1_SMP14_Pos)      /*!< 0x00007000 */\r
+#define ADC_SMPR1_SMP14                     ADC_SMPR1_SMP14_Msk                /*!< ADC channel 14 sampling time selection  */\r
+#define ADC_SMPR1_SMP14_0                   (0x1UL << ADC_SMPR1_SMP14_Pos)      /*!< 0x00001000 */\r
+#define ADC_SMPR1_SMP14_1                   (0x2UL << ADC_SMPR1_SMP14_Pos)      /*!< 0x00002000 */\r
+#define ADC_SMPR1_SMP14_2                   (0x4UL << ADC_SMPR1_SMP14_Pos)      /*!< 0x00004000 */\r
+\r
+#define ADC_SMPR1_SMP15_Pos                 (15U)                              \r
+#define ADC_SMPR1_SMP15_Msk                 (0x7UL << ADC_SMPR1_SMP15_Pos)      /*!< 0x00038000 */\r
+#define ADC_SMPR1_SMP15                     ADC_SMPR1_SMP15_Msk                /*!< ADC channel 15 sampling time selection  */\r
+#define ADC_SMPR1_SMP15_0                   (0x1UL << ADC_SMPR1_SMP15_Pos)      /*!< 0x00008000 */\r
+#define ADC_SMPR1_SMP15_1                   (0x2UL << ADC_SMPR1_SMP15_Pos)      /*!< 0x00010000 */\r
+#define ADC_SMPR1_SMP15_2                   (0x4UL << ADC_SMPR1_SMP15_Pos)      /*!< 0x00020000 */\r
+\r
+#define ADC_SMPR1_SMP16_Pos                 (18U)                              \r
+#define ADC_SMPR1_SMP16_Msk                 (0x7UL << ADC_SMPR1_SMP16_Pos)      /*!< 0x001C0000 */\r
+#define ADC_SMPR1_SMP16                     ADC_SMPR1_SMP16_Msk                /*!< ADC channel 16 sampling time selection  */\r
+#define ADC_SMPR1_SMP16_0                   (0x1UL << ADC_SMPR1_SMP16_Pos)      /*!< 0x00040000 */\r
+#define ADC_SMPR1_SMP16_1                   (0x2UL << ADC_SMPR1_SMP16_Pos)      /*!< 0x00080000 */\r
+#define ADC_SMPR1_SMP16_2                   (0x4UL << ADC_SMPR1_SMP16_Pos)      /*!< 0x00100000 */\r
+\r
+#define ADC_SMPR1_SMP17_Pos                 (21U)                              \r
+#define ADC_SMPR1_SMP17_Msk                 (0x7UL << ADC_SMPR1_SMP17_Pos)      /*!< 0x00E00000 */\r
+#define ADC_SMPR1_SMP17                     ADC_SMPR1_SMP17_Msk                /*!< ADC channel 17 sampling time selection  */\r
+#define ADC_SMPR1_SMP17_0                   (0x1UL << ADC_SMPR1_SMP17_Pos)      /*!< 0x00200000 */\r
+#define ADC_SMPR1_SMP17_1                   (0x2UL << ADC_SMPR1_SMP17_Pos)      /*!< 0x00400000 */\r
+#define ADC_SMPR1_SMP17_2                   (0x4UL << ADC_SMPR1_SMP17_Pos)      /*!< 0x00800000 */\r
+\r
+/******************  Bit definition for ADC_SMPR2 register  *******************/\r
+#define ADC_SMPR2_SMP0_Pos                  (0U)                               \r
+#define ADC_SMPR2_SMP0_Msk                  (0x7UL << ADC_SMPR2_SMP0_Pos)       /*!< 0x00000007 */\r
+#define ADC_SMPR2_SMP0                      ADC_SMPR2_SMP0_Msk                 /*!< ADC channel 0 sampling time selection  */\r
+#define ADC_SMPR2_SMP0_0                    (0x1UL << ADC_SMPR2_SMP0_Pos)       /*!< 0x00000001 */\r
+#define ADC_SMPR2_SMP0_1                    (0x2UL << ADC_SMPR2_SMP0_Pos)       /*!< 0x00000002 */\r
+#define ADC_SMPR2_SMP0_2                    (0x4UL << ADC_SMPR2_SMP0_Pos)       /*!< 0x00000004 */\r
+\r
+#define ADC_SMPR2_SMP1_Pos                  (3U)                               \r
+#define ADC_SMPR2_SMP1_Msk                  (0x7UL << ADC_SMPR2_SMP1_Pos)       /*!< 0x00000038 */\r
+#define ADC_SMPR2_SMP1                      ADC_SMPR2_SMP1_Msk                 /*!< ADC channel 1 sampling time selection  */\r
+#define ADC_SMPR2_SMP1_0                    (0x1UL << ADC_SMPR2_SMP1_Pos)       /*!< 0x00000008 */\r
+#define ADC_SMPR2_SMP1_1                    (0x2UL << ADC_SMPR2_SMP1_Pos)       /*!< 0x00000010 */\r
+#define ADC_SMPR2_SMP1_2                    (0x4UL << ADC_SMPR2_SMP1_Pos)       /*!< 0x00000020 */\r
+\r
+#define ADC_SMPR2_SMP2_Pos                  (6U)                               \r
+#define ADC_SMPR2_SMP2_Msk                  (0x7UL << ADC_SMPR2_SMP2_Pos)       /*!< 0x000001C0 */\r
+#define ADC_SMPR2_SMP2                      ADC_SMPR2_SMP2_Msk                 /*!< ADC channel 2 sampling time selection  */\r
+#define ADC_SMPR2_SMP2_0                    (0x1UL << ADC_SMPR2_SMP2_Pos)       /*!< 0x00000040 */\r
+#define ADC_SMPR2_SMP2_1                    (0x2UL << ADC_SMPR2_SMP2_Pos)       /*!< 0x00000080 */\r
+#define ADC_SMPR2_SMP2_2                    (0x4UL << ADC_SMPR2_SMP2_Pos)       /*!< 0x00000100 */\r
+\r
+#define ADC_SMPR2_SMP3_Pos                  (9U)                               \r
+#define ADC_SMPR2_SMP3_Msk                  (0x7UL << ADC_SMPR2_SMP3_Pos)       /*!< 0x00000E00 */\r
+#define ADC_SMPR2_SMP3                      ADC_SMPR2_SMP3_Msk                 /*!< ADC channel 3 sampling time selection  */\r
+#define ADC_SMPR2_SMP3_0                    (0x1UL << ADC_SMPR2_SMP3_Pos)       /*!< 0x00000200 */\r
+#define ADC_SMPR2_SMP3_1                    (0x2UL << ADC_SMPR2_SMP3_Pos)       /*!< 0x00000400 */\r
+#define ADC_SMPR2_SMP3_2                    (0x4UL << ADC_SMPR2_SMP3_Pos)       /*!< 0x00000800 */\r
+\r
+#define ADC_SMPR2_SMP4_Pos                  (12U)                              \r
+#define ADC_SMPR2_SMP4_Msk                  (0x7UL << ADC_SMPR2_SMP4_Pos)       /*!< 0x00007000 */\r
+#define ADC_SMPR2_SMP4                      ADC_SMPR2_SMP4_Msk                 /*!< ADC channel 4 sampling time selection  */\r
+#define ADC_SMPR2_SMP4_0                    (0x1UL << ADC_SMPR2_SMP4_Pos)       /*!< 0x00001000 */\r
+#define ADC_SMPR2_SMP4_1                    (0x2UL << ADC_SMPR2_SMP4_Pos)       /*!< 0x00002000 */\r
+#define ADC_SMPR2_SMP4_2                    (0x4UL << ADC_SMPR2_SMP4_Pos)       /*!< 0x00004000 */\r
+\r
+#define ADC_SMPR2_SMP5_Pos                  (15U)                              \r
+#define ADC_SMPR2_SMP5_Msk                  (0x7UL << ADC_SMPR2_SMP5_Pos)       /*!< 0x00038000 */\r
+#define ADC_SMPR2_SMP5                      ADC_SMPR2_SMP5_Msk                 /*!< ADC channel 5 sampling time selection  */\r
+#define ADC_SMPR2_SMP5_0                    (0x1UL << ADC_SMPR2_SMP5_Pos)       /*!< 0x00008000 */\r
+#define ADC_SMPR2_SMP5_1                    (0x2UL << ADC_SMPR2_SMP5_Pos)       /*!< 0x00010000 */\r
+#define ADC_SMPR2_SMP5_2                    (0x4UL << ADC_SMPR2_SMP5_Pos)       /*!< 0x00020000 */\r
+\r
+#define ADC_SMPR2_SMP6_Pos                  (18U)                              \r
+#define ADC_SMPR2_SMP6_Msk                  (0x7UL << ADC_SMPR2_SMP6_Pos)       /*!< 0x001C0000 */\r
+#define ADC_SMPR2_SMP6                      ADC_SMPR2_SMP6_Msk                 /*!< ADC channel 6 sampling time selection  */\r
+#define ADC_SMPR2_SMP6_0                    (0x1UL << ADC_SMPR2_SMP6_Pos)       /*!< 0x00040000 */\r
+#define ADC_SMPR2_SMP6_1                    (0x2UL << ADC_SMPR2_SMP6_Pos)       /*!< 0x00080000 */\r
+#define ADC_SMPR2_SMP6_2                    (0x4UL << ADC_SMPR2_SMP6_Pos)       /*!< 0x00100000 */\r
+\r
+#define ADC_SMPR2_SMP7_Pos                  (21U)                              \r
+#define ADC_SMPR2_SMP7_Msk                  (0x7UL << ADC_SMPR2_SMP7_Pos)       /*!< 0x00E00000 */\r
+#define ADC_SMPR2_SMP7                      ADC_SMPR2_SMP7_Msk                 /*!< ADC channel 7 sampling time selection  */\r
+#define ADC_SMPR2_SMP7_0                    (0x1UL << ADC_SMPR2_SMP7_Pos)       /*!< 0x00200000 */\r
+#define ADC_SMPR2_SMP7_1                    (0x2UL << ADC_SMPR2_SMP7_Pos)       /*!< 0x00400000 */\r
+#define ADC_SMPR2_SMP7_2                    (0x4UL << ADC_SMPR2_SMP7_Pos)       /*!< 0x00800000 */\r
+\r
+#define ADC_SMPR2_SMP8_Pos                  (24U)                              \r
+#define ADC_SMPR2_SMP8_Msk                  (0x7UL << ADC_SMPR2_SMP8_Pos)       /*!< 0x07000000 */\r
+#define ADC_SMPR2_SMP8                      ADC_SMPR2_SMP8_Msk                 /*!< ADC channel 8 sampling time selection  */\r
+#define ADC_SMPR2_SMP8_0                    (0x1UL << ADC_SMPR2_SMP8_Pos)       /*!< 0x01000000 */\r
+#define ADC_SMPR2_SMP8_1                    (0x2UL << ADC_SMPR2_SMP8_Pos)       /*!< 0x02000000 */\r
+#define ADC_SMPR2_SMP8_2                    (0x4UL << ADC_SMPR2_SMP8_Pos)       /*!< 0x04000000 */\r
+\r
+#define ADC_SMPR2_SMP9_Pos                  (27U)                              \r
+#define ADC_SMPR2_SMP9_Msk                  (0x7UL << ADC_SMPR2_SMP9_Pos)       /*!< 0x38000000 */\r
+#define ADC_SMPR2_SMP9                      ADC_SMPR2_SMP9_Msk                 /*!< ADC channel 9 sampling time selection  */\r
+#define ADC_SMPR2_SMP9_0                    (0x1UL << ADC_SMPR2_SMP9_Pos)       /*!< 0x08000000 */\r
+#define ADC_SMPR2_SMP9_1                    (0x2UL << ADC_SMPR2_SMP9_Pos)       /*!< 0x10000000 */\r
+#define ADC_SMPR2_SMP9_2                    (0x4UL << ADC_SMPR2_SMP9_Pos)       /*!< 0x20000000 */\r
+\r
+/******************  Bit definition for ADC_JOFR1 register  *******************/\r
+#define ADC_JOFR1_JOFFSET1_Pos              (0U)                               \r
+#define ADC_JOFR1_JOFFSET1_Msk              (0xFFFUL << ADC_JOFR1_JOFFSET1_Pos) /*!< 0x00000FFF */\r
+#define ADC_JOFR1_JOFFSET1                  ADC_JOFR1_JOFFSET1_Msk             /*!< ADC group injected sequencer rank 1 offset value */\r
+\r
+/******************  Bit definition for ADC_JOFR2 register  *******************/\r
+#define ADC_JOFR2_JOFFSET2_Pos              (0U)                               \r
+#define ADC_JOFR2_JOFFSET2_Msk              (0xFFFUL << ADC_JOFR2_JOFFSET2_Pos) /*!< 0x00000FFF */\r
+#define ADC_JOFR2_JOFFSET2                  ADC_JOFR2_JOFFSET2_Msk             /*!< ADC group injected sequencer rank 2 offset value */\r
+\r
+/******************  Bit definition for ADC_JOFR3 register  *******************/\r
+#define ADC_JOFR3_JOFFSET3_Pos              (0U)                               \r
+#define ADC_JOFR3_JOFFSET3_Msk              (0xFFFUL << ADC_JOFR3_JOFFSET3_Pos) /*!< 0x00000FFF */\r
+#define ADC_JOFR3_JOFFSET3                  ADC_JOFR3_JOFFSET3_Msk             /*!< ADC group injected sequencer rank 3 offset value */\r
+\r
+/******************  Bit definition for ADC_JOFR4 register  *******************/\r
+#define ADC_JOFR4_JOFFSET4_Pos              (0U)                               \r
+#define ADC_JOFR4_JOFFSET4_Msk              (0xFFFUL << ADC_JOFR4_JOFFSET4_Pos) /*!< 0x00000FFF */\r
+#define ADC_JOFR4_JOFFSET4                  ADC_JOFR4_JOFFSET4_Msk             /*!< ADC group injected sequencer rank 4 offset value */\r
+\r
+/*******************  Bit definition for ADC_HTR register  ********************/\r
+#define ADC_HTR_HT_Pos                      (0U)                               \r
+#define ADC_HTR_HT_Msk                      (0xFFFUL << ADC_HTR_HT_Pos)         /*!< 0x00000FFF */\r
+#define ADC_HTR_HT                          ADC_HTR_HT_Msk                     /*!< ADC analog watchdog 1 threshold high */\r
+\r
+/*******************  Bit definition for ADC_LTR register  ********************/\r
+#define ADC_LTR_LT_Pos                      (0U)                               \r
+#define ADC_LTR_LT_Msk                      (0xFFFUL << ADC_LTR_LT_Pos)         /*!< 0x00000FFF */\r
+#define ADC_LTR_LT                          ADC_LTR_LT_Msk                     /*!< ADC analog watchdog 1 threshold low */\r
+\r
+/*******************  Bit definition for ADC_SQR1 register  *******************/\r
+#define ADC_SQR1_SQ13_Pos                   (0U)                               \r
+#define ADC_SQR1_SQ13_Msk                   (0x1FUL << ADC_SQR1_SQ13_Pos)       /*!< 0x0000001F */\r
+#define ADC_SQR1_SQ13                       ADC_SQR1_SQ13_Msk                  /*!< ADC group regular sequencer rank 13 */\r
+#define ADC_SQR1_SQ13_0                     (0x01UL << ADC_SQR1_SQ13_Pos)       /*!< 0x00000001 */\r
+#define ADC_SQR1_SQ13_1                     (0x02UL << ADC_SQR1_SQ13_Pos)       /*!< 0x00000002 */\r
+#define ADC_SQR1_SQ13_2                     (0x04UL << ADC_SQR1_SQ13_Pos)       /*!< 0x00000004 */\r
+#define ADC_SQR1_SQ13_3                     (0x08UL << ADC_SQR1_SQ13_Pos)       /*!< 0x00000008 */\r
+#define ADC_SQR1_SQ13_4                     (0x10UL << ADC_SQR1_SQ13_Pos)       /*!< 0x00000010 */\r
+\r
+#define ADC_SQR1_SQ14_Pos                   (5U)                               \r
+#define ADC_SQR1_SQ14_Msk                   (0x1FUL << ADC_SQR1_SQ14_Pos)       /*!< 0x000003E0 */\r
+#define ADC_SQR1_SQ14                       ADC_SQR1_SQ14_Msk                  /*!< ADC group regular sequencer rank 14 */\r
+#define ADC_SQR1_SQ14_0                     (0x01UL << ADC_SQR1_SQ14_Pos)       /*!< 0x00000020 */\r
+#define ADC_SQR1_SQ14_1                     (0x02UL << ADC_SQR1_SQ14_Pos)       /*!< 0x00000040 */\r
+#define ADC_SQR1_SQ14_2                     (0x04UL << ADC_SQR1_SQ14_Pos)       /*!< 0x00000080 */\r
+#define ADC_SQR1_SQ14_3                     (0x08UL << ADC_SQR1_SQ14_Pos)       /*!< 0x00000100 */\r
+#define ADC_SQR1_SQ14_4                     (0x10UL << ADC_SQR1_SQ14_Pos)       /*!< 0x00000200 */\r
+\r
+#define ADC_SQR1_SQ15_Pos                   (10U)                              \r
+#define ADC_SQR1_SQ15_Msk                   (0x1FUL << ADC_SQR1_SQ15_Pos)       /*!< 0x00007C00 */\r
+#define ADC_SQR1_SQ15                       ADC_SQR1_SQ15_Msk                  /*!< ADC group regular sequencer rank 15 */\r
+#define ADC_SQR1_SQ15_0                     (0x01UL << ADC_SQR1_SQ15_Pos)       /*!< 0x00000400 */\r
+#define ADC_SQR1_SQ15_1                     (0x02UL << ADC_SQR1_SQ15_Pos)       /*!< 0x00000800 */\r
+#define ADC_SQR1_SQ15_2                     (0x04UL << ADC_SQR1_SQ15_Pos)       /*!< 0x00001000 */\r
+#define ADC_SQR1_SQ15_3                     (0x08UL << ADC_SQR1_SQ15_Pos)       /*!< 0x00002000 */\r
+#define ADC_SQR1_SQ15_4                     (0x10UL << ADC_SQR1_SQ15_Pos)       /*!< 0x00004000 */\r
+\r
+#define ADC_SQR1_SQ16_Pos                   (15U)                              \r
+#define ADC_SQR1_SQ16_Msk                   (0x1FUL << ADC_SQR1_SQ16_Pos)       /*!< 0x000F8000 */\r
+#define ADC_SQR1_SQ16                       ADC_SQR1_SQ16_Msk                  /*!< ADC group regular sequencer rank 16 */\r
+#define ADC_SQR1_SQ16_0                     (0x01UL << ADC_SQR1_SQ16_Pos)       /*!< 0x00008000 */\r
+#define ADC_SQR1_SQ16_1                     (0x02UL << ADC_SQR1_SQ16_Pos)       /*!< 0x00010000 */\r
+#define ADC_SQR1_SQ16_2                     (0x04UL << ADC_SQR1_SQ16_Pos)       /*!< 0x00020000 */\r
+#define ADC_SQR1_SQ16_3                     (0x08UL << ADC_SQR1_SQ16_Pos)       /*!< 0x00040000 */\r
+#define ADC_SQR1_SQ16_4                     (0x10UL << ADC_SQR1_SQ16_Pos)       /*!< 0x00080000 */\r
+\r
+#define ADC_SQR1_L_Pos                      (20U)                              \r
+#define ADC_SQR1_L_Msk                      (0xFUL << ADC_SQR1_L_Pos)           /*!< 0x00F00000 */\r
+#define ADC_SQR1_L                          ADC_SQR1_L_Msk                     /*!< ADC group regular sequencer scan length */\r
+#define ADC_SQR1_L_0                        (0x1UL << ADC_SQR1_L_Pos)           /*!< 0x00100000 */\r
+#define ADC_SQR1_L_1                        (0x2UL << ADC_SQR1_L_Pos)           /*!< 0x00200000 */\r
+#define ADC_SQR1_L_2                        (0x4UL << ADC_SQR1_L_Pos)           /*!< 0x00400000 */\r
+#define ADC_SQR1_L_3                        (0x8UL << ADC_SQR1_L_Pos)           /*!< 0x00800000 */\r
+\r
+/*******************  Bit definition for ADC_SQR2 register  *******************/\r
+#define ADC_SQR2_SQ7_Pos                    (0U)                               \r
+#define ADC_SQR2_SQ7_Msk                    (0x1FUL << ADC_SQR2_SQ7_Pos)        /*!< 0x0000001F */\r
+#define ADC_SQR2_SQ7                        ADC_SQR2_SQ7_Msk                   /*!< ADC group regular sequencer rank 7 */\r
+#define ADC_SQR2_SQ7_0                      (0x01UL << ADC_SQR2_SQ7_Pos)        /*!< 0x00000001 */\r
+#define ADC_SQR2_SQ7_1                      (0x02UL << ADC_SQR2_SQ7_Pos)        /*!< 0x00000002 */\r
+#define ADC_SQR2_SQ7_2                      (0x04UL << ADC_SQR2_SQ7_Pos)        /*!< 0x00000004 */\r
+#define ADC_SQR2_SQ7_3                      (0x08UL << ADC_SQR2_SQ7_Pos)        /*!< 0x00000008 */\r
+#define ADC_SQR2_SQ7_4                      (0x10UL << ADC_SQR2_SQ7_Pos)        /*!< 0x00000010 */\r
+\r
+#define ADC_SQR2_SQ8_Pos                    (5U)                               \r
+#define ADC_SQR2_SQ8_Msk                    (0x1FUL << ADC_SQR2_SQ8_Pos)        /*!< 0x000003E0 */\r
+#define ADC_SQR2_SQ8                        ADC_SQR2_SQ8_Msk                   /*!< ADC group regular sequencer rank 8 */\r
+#define ADC_SQR2_SQ8_0                      (0x01UL << ADC_SQR2_SQ8_Pos)        /*!< 0x00000020 */\r
+#define ADC_SQR2_SQ8_1                      (0x02UL << ADC_SQR2_SQ8_Pos)        /*!< 0x00000040 */\r
+#define ADC_SQR2_SQ8_2                      (0x04UL << ADC_SQR2_SQ8_Pos)        /*!< 0x00000080 */\r
+#define ADC_SQR2_SQ8_3                      (0x08UL << ADC_SQR2_SQ8_Pos)        /*!< 0x00000100 */\r
+#define ADC_SQR2_SQ8_4                      (0x10UL << ADC_SQR2_SQ8_Pos)        /*!< 0x00000200 */\r
+\r
+#define ADC_SQR2_SQ9_Pos                    (10U)                              \r
+#define ADC_SQR2_SQ9_Msk                    (0x1FUL << ADC_SQR2_SQ9_Pos)        /*!< 0x00007C00 */\r
+#define ADC_SQR2_SQ9                        ADC_SQR2_SQ9_Msk                   /*!< ADC group regular sequencer rank 9 */\r
+#define ADC_SQR2_SQ9_0                      (0x01UL << ADC_SQR2_SQ9_Pos)        /*!< 0x00000400 */\r
+#define ADC_SQR2_SQ9_1                      (0x02UL << ADC_SQR2_SQ9_Pos)        /*!< 0x00000800 */\r
+#define ADC_SQR2_SQ9_2                      (0x04UL << ADC_SQR2_SQ9_Pos)        /*!< 0x00001000 */\r
+#define ADC_SQR2_SQ9_3                      (0x08UL << ADC_SQR2_SQ9_Pos)        /*!< 0x00002000 */\r
+#define ADC_SQR2_SQ9_4                      (0x10UL << ADC_SQR2_SQ9_Pos)        /*!< 0x00004000 */\r
+\r
+#define ADC_SQR2_SQ10_Pos                   (15U)                              \r
+#define ADC_SQR2_SQ10_Msk                   (0x1FUL << ADC_SQR2_SQ10_Pos)       /*!< 0x000F8000 */\r
+#define ADC_SQR2_SQ10                       ADC_SQR2_SQ10_Msk                  /*!< ADC group regular sequencer rank 10 */\r
+#define ADC_SQR2_SQ10_0                     (0x01UL << ADC_SQR2_SQ10_Pos)       /*!< 0x00008000 */\r
+#define ADC_SQR2_SQ10_1                     (0x02UL << ADC_SQR2_SQ10_Pos)       /*!< 0x00010000 */\r
+#define ADC_SQR2_SQ10_2                     (0x04UL << ADC_SQR2_SQ10_Pos)       /*!< 0x00020000 */\r
+#define ADC_SQR2_SQ10_3                     (0x08UL << ADC_SQR2_SQ10_Pos)       /*!< 0x00040000 */\r
+#define ADC_SQR2_SQ10_4                     (0x10UL << ADC_SQR2_SQ10_Pos)       /*!< 0x00080000 */\r
+\r
+#define ADC_SQR2_SQ11_Pos                   (20U)                              \r
+#define ADC_SQR2_SQ11_Msk                   (0x1FUL << ADC_SQR2_SQ11_Pos)       /*!< 0x01F00000 */\r
+#define ADC_SQR2_SQ11                       ADC_SQR2_SQ11_Msk                  /*!< ADC group regular sequencer rank 1 */\r
+#define ADC_SQR2_SQ11_0                     (0x01UL << ADC_SQR2_SQ11_Pos)       /*!< 0x00100000 */\r
+#define ADC_SQR2_SQ11_1                     (0x02UL << ADC_SQR2_SQ11_Pos)       /*!< 0x00200000 */\r
+#define ADC_SQR2_SQ11_2                     (0x04UL << ADC_SQR2_SQ11_Pos)       /*!< 0x00400000 */\r
+#define ADC_SQR2_SQ11_3                     (0x08UL << ADC_SQR2_SQ11_Pos)       /*!< 0x00800000 */\r
+#define ADC_SQR2_SQ11_4                     (0x10UL << ADC_SQR2_SQ11_Pos)       /*!< 0x01000000 */\r
+\r
+#define ADC_SQR2_SQ12_Pos                   (25U)                              \r
+#define ADC_SQR2_SQ12_Msk                   (0x1FUL << ADC_SQR2_SQ12_Pos)       /*!< 0x3E000000 */\r
+#define ADC_SQR2_SQ12                       ADC_SQR2_SQ12_Msk                  /*!< ADC group regular sequencer rank 12 */\r
+#define ADC_SQR2_SQ12_0                     (0x01UL << ADC_SQR2_SQ12_Pos)       /*!< 0x02000000 */\r
+#define ADC_SQR2_SQ12_1                     (0x02UL << ADC_SQR2_SQ12_Pos)       /*!< 0x04000000 */\r
+#define ADC_SQR2_SQ12_2                     (0x04UL << ADC_SQR2_SQ12_Pos)       /*!< 0x08000000 */\r
+#define ADC_SQR2_SQ12_3                     (0x08UL << ADC_SQR2_SQ12_Pos)       /*!< 0x10000000 */\r
+#define ADC_SQR2_SQ12_4                     (0x10UL << ADC_SQR2_SQ12_Pos)       /*!< 0x20000000 */\r
+\r
+/*******************  Bit definition for ADC_SQR3 register  *******************/\r
+#define ADC_SQR3_SQ1_Pos                    (0U)                               \r
+#define ADC_SQR3_SQ1_Msk                    (0x1FUL << ADC_SQR3_SQ1_Pos)        /*!< 0x0000001F */\r
+#define ADC_SQR3_SQ1                        ADC_SQR3_SQ1_Msk                   /*!< ADC group regular sequencer rank 1 */\r
+#define ADC_SQR3_SQ1_0                      (0x01UL << ADC_SQR3_SQ1_Pos)        /*!< 0x00000001 */\r
+#define ADC_SQR3_SQ1_1                      (0x02UL << ADC_SQR3_SQ1_Pos)        /*!< 0x00000002 */\r
+#define ADC_SQR3_SQ1_2                      (0x04UL << ADC_SQR3_SQ1_Pos)        /*!< 0x00000004 */\r
+#define ADC_SQR3_SQ1_3                      (0x08UL << ADC_SQR3_SQ1_Pos)        /*!< 0x00000008 */\r
+#define ADC_SQR3_SQ1_4                      (0x10UL << ADC_SQR3_SQ1_Pos)        /*!< 0x00000010 */\r
+\r
+#define ADC_SQR3_SQ2_Pos                    (5U)                               \r
+#define ADC_SQR3_SQ2_Msk                    (0x1FUL << ADC_SQR3_SQ2_Pos)        /*!< 0x000003E0 */\r
+#define ADC_SQR3_SQ2                        ADC_SQR3_SQ2_Msk                   /*!< ADC group regular sequencer rank 2 */\r
+#define ADC_SQR3_SQ2_0                      (0x01UL << ADC_SQR3_SQ2_Pos)        /*!< 0x00000020 */\r
+#define ADC_SQR3_SQ2_1                      (0x02UL << ADC_SQR3_SQ2_Pos)        /*!< 0x00000040 */\r
+#define ADC_SQR3_SQ2_2                      (0x04UL << ADC_SQR3_SQ2_Pos)        /*!< 0x00000080 */\r
+#define ADC_SQR3_SQ2_3                      (0x08UL << ADC_SQR3_SQ2_Pos)        /*!< 0x00000100 */\r
+#define ADC_SQR3_SQ2_4                      (0x10UL << ADC_SQR3_SQ2_Pos)        /*!< 0x00000200 */\r
+\r
+#define ADC_SQR3_SQ3_Pos                    (10U)                              \r
+#define ADC_SQR3_SQ3_Msk                    (0x1FUL << ADC_SQR3_SQ3_Pos)        /*!< 0x00007C00 */\r
+#define ADC_SQR3_SQ3                        ADC_SQR3_SQ3_Msk                   /*!< ADC group regular sequencer rank 3 */\r
+#define ADC_SQR3_SQ3_0                      (0x01UL << ADC_SQR3_SQ3_Pos)        /*!< 0x00000400 */\r
+#define ADC_SQR3_SQ3_1                      (0x02UL << ADC_SQR3_SQ3_Pos)        /*!< 0x00000800 */\r
+#define ADC_SQR3_SQ3_2                      (0x04UL << ADC_SQR3_SQ3_Pos)        /*!< 0x00001000 */\r
+#define ADC_SQR3_SQ3_3                      (0x08UL << ADC_SQR3_SQ3_Pos)        /*!< 0x00002000 */\r
+#define ADC_SQR3_SQ3_4                      (0x10UL << ADC_SQR3_SQ3_Pos)        /*!< 0x00004000 */\r
+\r
+#define ADC_SQR3_SQ4_Pos                    (15U)                              \r
+#define ADC_SQR3_SQ4_Msk                    (0x1FUL << ADC_SQR3_SQ4_Pos)        /*!< 0x000F8000 */\r
+#define ADC_SQR3_SQ4                        ADC_SQR3_SQ4_Msk                   /*!< ADC group regular sequencer rank 4 */\r
+#define ADC_SQR3_SQ4_0                      (0x01UL << ADC_SQR3_SQ4_Pos)        /*!< 0x00008000 */\r
+#define ADC_SQR3_SQ4_1                      (0x02UL << ADC_SQR3_SQ4_Pos)        /*!< 0x00010000 */\r
+#define ADC_SQR3_SQ4_2                      (0x04UL << ADC_SQR3_SQ4_Pos)        /*!< 0x00020000 */\r
+#define ADC_SQR3_SQ4_3                      (0x08UL << ADC_SQR3_SQ4_Pos)        /*!< 0x00040000 */\r
+#define ADC_SQR3_SQ4_4                      (0x10UL << ADC_SQR3_SQ4_Pos)        /*!< 0x00080000 */\r
+\r
+#define ADC_SQR3_SQ5_Pos                    (20U)                              \r
+#define ADC_SQR3_SQ5_Msk                    (0x1FUL << ADC_SQR3_SQ5_Pos)        /*!< 0x01F00000 */\r
+#define ADC_SQR3_SQ5                        ADC_SQR3_SQ5_Msk                   /*!< ADC group regular sequencer rank 5 */\r
+#define ADC_SQR3_SQ5_0                      (0x01UL << ADC_SQR3_SQ5_Pos)        /*!< 0x00100000 */\r
+#define ADC_SQR3_SQ5_1                      (0x02UL << ADC_SQR3_SQ5_Pos)        /*!< 0x00200000 */\r
+#define ADC_SQR3_SQ5_2                      (0x04UL << ADC_SQR3_SQ5_Pos)        /*!< 0x00400000 */\r
+#define ADC_SQR3_SQ5_3                      (0x08UL << ADC_SQR3_SQ5_Pos)        /*!< 0x00800000 */\r
+#define ADC_SQR3_SQ5_4                      (0x10UL << ADC_SQR3_SQ5_Pos)        /*!< 0x01000000 */\r
+\r
+#define ADC_SQR3_SQ6_Pos                    (25U)                              \r
+#define ADC_SQR3_SQ6_Msk                    (0x1FUL << ADC_SQR3_SQ6_Pos)        /*!< 0x3E000000 */\r
+#define ADC_SQR3_SQ6                        ADC_SQR3_SQ6_Msk                   /*!< ADC group regular sequencer rank 6 */\r
+#define ADC_SQR3_SQ6_0                      (0x01UL << ADC_SQR3_SQ6_Pos)        /*!< 0x02000000 */\r
+#define ADC_SQR3_SQ6_1                      (0x02UL << ADC_SQR3_SQ6_Pos)        /*!< 0x04000000 */\r
+#define ADC_SQR3_SQ6_2                      (0x04UL << ADC_SQR3_SQ6_Pos)        /*!< 0x08000000 */\r
+#define ADC_SQR3_SQ6_3                      (0x08UL << ADC_SQR3_SQ6_Pos)        /*!< 0x10000000 */\r
+#define ADC_SQR3_SQ6_4                      (0x10UL << ADC_SQR3_SQ6_Pos)        /*!< 0x20000000 */\r
+\r
+/*******************  Bit definition for ADC_JSQR register  *******************/\r
+#define ADC_JSQR_JSQ1_Pos                   (0U)                               \r
+#define ADC_JSQR_JSQ1_Msk                   (0x1FUL << ADC_JSQR_JSQ1_Pos)       /*!< 0x0000001F */\r
+#define ADC_JSQR_JSQ1                       ADC_JSQR_JSQ1_Msk                  /*!< ADC group injected sequencer rank 1 */\r
+#define ADC_JSQR_JSQ1_0                     (0x01UL << ADC_JSQR_JSQ1_Pos)       /*!< 0x00000001 */\r
+#define ADC_JSQR_JSQ1_1                     (0x02UL << ADC_JSQR_JSQ1_Pos)       /*!< 0x00000002 */\r
+#define ADC_JSQR_JSQ1_2                     (0x04UL << ADC_JSQR_JSQ1_Pos)       /*!< 0x00000004 */\r
+#define ADC_JSQR_JSQ1_3                     (0x08UL << ADC_JSQR_JSQ1_Pos)       /*!< 0x00000008 */\r
+#define ADC_JSQR_JSQ1_4                     (0x10UL << ADC_JSQR_JSQ1_Pos)       /*!< 0x00000010 */\r
+\r
+#define ADC_JSQR_JSQ2_Pos                   (5U)                               \r
+#define ADC_JSQR_JSQ2_Msk                   (0x1FUL << ADC_JSQR_JSQ2_Pos)       /*!< 0x000003E0 */\r
+#define ADC_JSQR_JSQ2                       ADC_JSQR_JSQ2_Msk                  /*!< ADC group injected sequencer rank 2 */\r
+#define ADC_JSQR_JSQ2_0                     (0x01UL << ADC_JSQR_JSQ2_Pos)       /*!< 0x00000020 */\r
+#define ADC_JSQR_JSQ2_1                     (0x02UL << ADC_JSQR_JSQ2_Pos)       /*!< 0x00000040 */\r
+#define ADC_JSQR_JSQ2_2                     (0x04UL << ADC_JSQR_JSQ2_Pos)       /*!< 0x00000080 */\r
+#define ADC_JSQR_JSQ2_3                     (0x08UL << ADC_JSQR_JSQ2_Pos)       /*!< 0x00000100 */\r
+#define ADC_JSQR_JSQ2_4                     (0x10UL << ADC_JSQR_JSQ2_Pos)       /*!< 0x00000200 */\r
+\r
+#define ADC_JSQR_JSQ3_Pos                   (10U)                              \r
+#define ADC_JSQR_JSQ3_Msk                   (0x1FUL << ADC_JSQR_JSQ3_Pos)       /*!< 0x00007C00 */\r
+#define ADC_JSQR_JSQ3                       ADC_JSQR_JSQ3_Msk                  /*!< ADC group injected sequencer rank 3 */\r
+#define ADC_JSQR_JSQ3_0                     (0x01UL << ADC_JSQR_JSQ3_Pos)       /*!< 0x00000400 */\r
+#define ADC_JSQR_JSQ3_1                     (0x02UL << ADC_JSQR_JSQ3_Pos)       /*!< 0x00000800 */\r
+#define ADC_JSQR_JSQ3_2                     (0x04UL << ADC_JSQR_JSQ3_Pos)       /*!< 0x00001000 */\r
+#define ADC_JSQR_JSQ3_3                     (0x08UL << ADC_JSQR_JSQ3_Pos)       /*!< 0x00002000 */\r
+#define ADC_JSQR_JSQ3_4                     (0x10UL << ADC_JSQR_JSQ3_Pos)       /*!< 0x00004000 */\r
+\r
+#define ADC_JSQR_JSQ4_Pos                   (15U)                              \r
+#define ADC_JSQR_JSQ4_Msk                   (0x1FUL << ADC_JSQR_JSQ4_Pos)       /*!< 0x000F8000 */\r
+#define ADC_JSQR_JSQ4                       ADC_JSQR_JSQ4_Msk                  /*!< ADC group injected sequencer rank 4 */\r
+#define ADC_JSQR_JSQ4_0                     (0x01UL << ADC_JSQR_JSQ4_Pos)       /*!< 0x00008000 */\r
+#define ADC_JSQR_JSQ4_1                     (0x02UL << ADC_JSQR_JSQ4_Pos)       /*!< 0x00010000 */\r
+#define ADC_JSQR_JSQ4_2                     (0x04UL << ADC_JSQR_JSQ4_Pos)       /*!< 0x00020000 */\r
+#define ADC_JSQR_JSQ4_3                     (0x08UL << ADC_JSQR_JSQ4_Pos)       /*!< 0x00040000 */\r
+#define ADC_JSQR_JSQ4_4                     (0x10UL << ADC_JSQR_JSQ4_Pos)       /*!< 0x00080000 */\r
+\r
+#define ADC_JSQR_JL_Pos                     (20U)                              \r
+#define ADC_JSQR_JL_Msk                     (0x3UL << ADC_JSQR_JL_Pos)          /*!< 0x00300000 */\r
+#define ADC_JSQR_JL                         ADC_JSQR_JL_Msk                    /*!< ADC group injected sequencer scan length */\r
+#define ADC_JSQR_JL_0                       (0x1UL << ADC_JSQR_JL_Pos)          /*!< 0x00100000 */\r
+#define ADC_JSQR_JL_1                       (0x2UL << ADC_JSQR_JL_Pos)          /*!< 0x00200000 */\r
+\r
+/*******************  Bit definition for ADC_JDR1 register  *******************/\r
+#define ADC_JDR1_JDATA_Pos                  (0U)                               \r
+#define ADC_JDR1_JDATA_Msk                  (0xFFFFUL << ADC_JDR1_JDATA_Pos)    /*!< 0x0000FFFF */\r
+#define ADC_JDR1_JDATA                      ADC_JDR1_JDATA_Msk                 /*!< ADC group injected sequencer rank 1 conversion data */\r
+\r
+/*******************  Bit definition for ADC_JDR2 register  *******************/\r
+#define ADC_JDR2_JDATA_Pos                  (0U)                               \r
+#define ADC_JDR2_JDATA_Msk                  (0xFFFFUL << ADC_JDR2_JDATA_Pos)    /*!< 0x0000FFFF */\r
+#define ADC_JDR2_JDATA                      ADC_JDR2_JDATA_Msk                 /*!< ADC group injected sequencer rank 2 conversion data */\r
+\r
+/*******************  Bit definition for ADC_JDR3 register  *******************/\r
+#define ADC_JDR3_JDATA_Pos                  (0U)                               \r
+#define ADC_JDR3_JDATA_Msk                  (0xFFFFUL << ADC_JDR3_JDATA_Pos)    /*!< 0x0000FFFF */\r
+#define ADC_JDR3_JDATA                      ADC_JDR3_JDATA_Msk                 /*!< ADC group injected sequencer rank 3 conversion data */\r
+\r
+/*******************  Bit definition for ADC_JDR4 register  *******************/\r
+#define ADC_JDR4_JDATA_Pos                  (0U)                               \r
+#define ADC_JDR4_JDATA_Msk                  (0xFFFFUL << ADC_JDR4_JDATA_Pos)    /*!< 0x0000FFFF */\r
+#define ADC_JDR4_JDATA                      ADC_JDR4_JDATA_Msk                 /*!< ADC group injected sequencer rank 4 conversion data */\r
+\r
+/********************  Bit definition for ADC_DR register  ********************/\r
+#define ADC_DR_DATA_Pos                     (0U)                               \r
+#define ADC_DR_DATA_Msk                     (0xFFFFUL << ADC_DR_DATA_Pos)       /*!< 0x0000FFFF */\r
+#define ADC_DR_DATA                         ADC_DR_DATA_Msk                    /*!< ADC group regular conversion data */\r
+#define ADC_DR_ADC2DATA_Pos                 (16U)                              \r
+#define ADC_DR_ADC2DATA_Msk                 (0xFFFFUL << ADC_DR_ADC2DATA_Pos)   /*!< 0xFFFF0000 */\r
+#define ADC_DR_ADC2DATA                     ADC_DR_ADC2DATA_Msk                /*!< ADC group regular conversion data for ADC slave, in multimode */\r
+\r
+\r
+/*****************************************************************************/\r
+/*                                                                           */\r
+/*                               Timers (TIM)                                */\r
+/*                                                                           */\r
+/*****************************************************************************/\r
+/*******************  Bit definition for TIM_CR1 register  *******************/\r
+#define TIM_CR1_CEN_Pos                     (0U)                               \r
+#define TIM_CR1_CEN_Msk                     (0x1UL << TIM_CR1_CEN_Pos)          /*!< 0x00000001 */\r
+#define TIM_CR1_CEN                         TIM_CR1_CEN_Msk                    /*!<Counter enable */\r
+#define TIM_CR1_UDIS_Pos                    (1U)                               \r
+#define TIM_CR1_UDIS_Msk                    (0x1UL << TIM_CR1_UDIS_Pos)         /*!< 0x00000002 */\r
+#define TIM_CR1_UDIS                        TIM_CR1_UDIS_Msk                   /*!<Update disable */\r
+#define TIM_CR1_URS_Pos                     (2U)                               \r
+#define TIM_CR1_URS_Msk                     (0x1UL << TIM_CR1_URS_Pos)          /*!< 0x00000004 */\r
+#define TIM_CR1_URS                         TIM_CR1_URS_Msk                    /*!<Update request source */\r
+#define TIM_CR1_OPM_Pos                     (3U)                               \r
+#define TIM_CR1_OPM_Msk                     (0x1UL << TIM_CR1_OPM_Pos)          /*!< 0x00000008 */\r
+#define TIM_CR1_OPM                         TIM_CR1_OPM_Msk                    /*!<One pulse mode */\r
+#define TIM_CR1_DIR_Pos                     (4U)                               \r
+#define TIM_CR1_DIR_Msk                     (0x1UL << TIM_CR1_DIR_Pos)          /*!< 0x00000010 */\r
+#define TIM_CR1_DIR                         TIM_CR1_DIR_Msk                    /*!<Direction */\r
+\r
+#define TIM_CR1_CMS_Pos                     (5U)                               \r
+#define TIM_CR1_CMS_Msk                     (0x3UL << TIM_CR1_CMS_Pos)          /*!< 0x00000060 */\r
+#define TIM_CR1_CMS                         TIM_CR1_CMS_Msk                    /*!<CMS[1:0] bits (Center-aligned mode selection) */\r
+#define TIM_CR1_CMS_0                       (0x1UL << TIM_CR1_CMS_Pos)          /*!< 0x00000020 */\r
+#define TIM_CR1_CMS_1                       (0x2UL << TIM_CR1_CMS_Pos)          /*!< 0x00000040 */\r
+\r
+#define TIM_CR1_ARPE_Pos                    (7U)                               \r
+#define TIM_CR1_ARPE_Msk                    (0x1UL << TIM_CR1_ARPE_Pos)         /*!< 0x00000080 */\r
+#define TIM_CR1_ARPE                        TIM_CR1_ARPE_Msk                   /*!<Auto-reload preload enable */\r
+\r
+#define TIM_CR1_CKD_Pos                     (8U)                               \r
+#define TIM_CR1_CKD_Msk                     (0x3UL << TIM_CR1_CKD_Pos)          /*!< 0x00000300 */\r
+#define TIM_CR1_CKD                         TIM_CR1_CKD_Msk                    /*!<CKD[1:0] bits (clock division) */\r
+#define TIM_CR1_CKD_0                       (0x1UL << TIM_CR1_CKD_Pos)          /*!< 0x00000100 */\r
+#define TIM_CR1_CKD_1                       (0x2UL << TIM_CR1_CKD_Pos)          /*!< 0x00000200 */\r
+\r
+/*******************  Bit definition for TIM_CR2 register  *******************/\r
+#define TIM_CR2_CCPC_Pos                    (0U)                               \r
+#define TIM_CR2_CCPC_Msk                    (0x1UL << TIM_CR2_CCPC_Pos)         /*!< 0x00000001 */\r
+#define TIM_CR2_CCPC                        TIM_CR2_CCPC_Msk                   /*!<Capture/Compare Preloaded Control */\r
+#define TIM_CR2_CCUS_Pos                    (2U)                               \r
+#define TIM_CR2_CCUS_Msk                    (0x1UL << TIM_CR2_CCUS_Pos)         /*!< 0x00000004 */\r
+#define TIM_CR2_CCUS                        TIM_CR2_CCUS_Msk                   /*!<Capture/Compare Control Update Selection */\r
+#define TIM_CR2_CCDS_Pos                    (3U)                               \r
+#define TIM_CR2_CCDS_Msk                    (0x1UL << TIM_CR2_CCDS_Pos)         /*!< 0x00000008 */\r
+#define TIM_CR2_CCDS                        TIM_CR2_CCDS_Msk                   /*!<Capture/Compare DMA Selection */\r
+\r
+#define TIM_CR2_MMS_Pos                     (4U)                               \r
+#define TIM_CR2_MMS_Msk                     (0x7UL << TIM_CR2_MMS_Pos)          /*!< 0x00000070 */\r
+#define TIM_CR2_MMS                         TIM_CR2_MMS_Msk                    /*!<MMS[2:0] bits (Master Mode Selection) */\r
+#define TIM_CR2_MMS_0                       (0x1UL << TIM_CR2_MMS_Pos)          /*!< 0x00000010 */\r
+#define TIM_CR2_MMS_1                       (0x2UL << TIM_CR2_MMS_Pos)          /*!< 0x00000020 */\r
+#define TIM_CR2_MMS_2                       (0x4UL << TIM_CR2_MMS_Pos)          /*!< 0x00000040 */\r
+\r
+#define TIM_CR2_TI1S_Pos                    (7U)                               \r
+#define TIM_CR2_TI1S_Msk                    (0x1UL << TIM_CR2_TI1S_Pos)         /*!< 0x00000080 */\r
+#define TIM_CR2_TI1S                        TIM_CR2_TI1S_Msk                   /*!<TI1 Selection */\r
+#define TIM_CR2_OIS1_Pos                    (8U)                               \r
+#define TIM_CR2_OIS1_Msk                    (0x1UL << TIM_CR2_OIS1_Pos)         /*!< 0x00000100 */\r
+#define TIM_CR2_OIS1                        TIM_CR2_OIS1_Msk                   /*!<Output Idle state 1 (OC1 output) */\r
+#define TIM_CR2_OIS1N_Pos                   (9U)                               \r
+#define TIM_CR2_OIS1N_Msk                   (0x1UL << TIM_CR2_OIS1N_Pos)        /*!< 0x00000200 */\r
+#define TIM_CR2_OIS1N                       TIM_CR2_OIS1N_Msk                  /*!<Output Idle state 1 (OC1N output) */\r
+#define TIM_CR2_OIS2_Pos                    (10U)                              \r
+#define TIM_CR2_OIS2_Msk                    (0x1UL << TIM_CR2_OIS2_Pos)         /*!< 0x00000400 */\r
+#define TIM_CR2_OIS2                        TIM_CR2_OIS2_Msk                   /*!<Output Idle state 2 (OC2 output) */\r
+#define TIM_CR2_OIS2N_Pos                   (11U)                              \r
+#define TIM_CR2_OIS2N_Msk                   (0x1UL << TIM_CR2_OIS2N_Pos)        /*!< 0x00000800 */\r
+#define TIM_CR2_OIS2N                       TIM_CR2_OIS2N_Msk                  /*!<Output Idle state 2 (OC2N output) */\r
+#define TIM_CR2_OIS3_Pos                    (12U)                              \r
+#define TIM_CR2_OIS3_Msk                    (0x1UL << TIM_CR2_OIS3_Pos)         /*!< 0x00001000 */\r
+#define TIM_CR2_OIS3                        TIM_CR2_OIS3_Msk                   /*!<Output Idle state 3 (OC3 output) */\r
+#define TIM_CR2_OIS3N_Pos                   (13U)                              \r
+#define TIM_CR2_OIS3N_Msk                   (0x1UL << TIM_CR2_OIS3N_Pos)        /*!< 0x00002000 */\r
+#define TIM_CR2_OIS3N                       TIM_CR2_OIS3N_Msk                  /*!<Output Idle state 3 (OC3N output) */\r
+#define TIM_CR2_OIS4_Pos                    (14U)                              \r
+#define TIM_CR2_OIS4_Msk                    (0x1UL << TIM_CR2_OIS4_Pos)         /*!< 0x00004000 */\r
+#define TIM_CR2_OIS4                        TIM_CR2_OIS4_Msk                   /*!<Output Idle state 4 (OC4 output) */\r
+\r
+/*******************  Bit definition for TIM_SMCR register  ******************/\r
+#define TIM_SMCR_SMS_Pos                    (0U)                               \r
+#define TIM_SMCR_SMS_Msk                    (0x7UL << TIM_SMCR_SMS_Pos)         /*!< 0x00000007 */\r
+#define TIM_SMCR_SMS                        TIM_SMCR_SMS_Msk                   /*!<SMS[2:0] bits (Slave mode selection) */\r
+#define TIM_SMCR_SMS_0                      (0x1UL << TIM_SMCR_SMS_Pos)         /*!< 0x00000001 */\r
+#define TIM_SMCR_SMS_1                      (0x2UL << TIM_SMCR_SMS_Pos)         /*!< 0x00000002 */\r
+#define TIM_SMCR_SMS_2                      (0x4UL << TIM_SMCR_SMS_Pos)         /*!< 0x00000004 */\r
+\r
+#define TIM_SMCR_TS_Pos                     (4U)                               \r
+#define TIM_SMCR_TS_Msk                     (0x7UL << TIM_SMCR_TS_Pos)          /*!< 0x00000070 */\r
+#define TIM_SMCR_TS                         TIM_SMCR_TS_Msk                    /*!<TS[2:0] bits (Trigger selection) */\r
+#define TIM_SMCR_TS_0                       (0x1UL << TIM_SMCR_TS_Pos)          /*!< 0x00000010 */\r
+#define TIM_SMCR_TS_1                       (0x2UL << TIM_SMCR_TS_Pos)          /*!< 0x00000020 */\r
+#define TIM_SMCR_TS_2                       (0x4UL << TIM_SMCR_TS_Pos)          /*!< 0x00000040 */\r
+\r
+#define TIM_SMCR_MSM_Pos                    (7U)                               \r
+#define TIM_SMCR_MSM_Msk                    (0x1UL << TIM_SMCR_MSM_Pos)         /*!< 0x00000080 */\r
+#define TIM_SMCR_MSM                        TIM_SMCR_MSM_Msk                   /*!<Master/slave mode */\r
+\r
+#define TIM_SMCR_ETF_Pos                    (8U)                               \r
+#define TIM_SMCR_ETF_Msk                    (0xFUL << TIM_SMCR_ETF_Pos)         /*!< 0x00000F00 */\r
+#define TIM_SMCR_ETF                        TIM_SMCR_ETF_Msk                   /*!<ETF[3:0] bits (External trigger filter) */\r
+#define TIM_SMCR_ETF_0                      (0x1UL << TIM_SMCR_ETF_Pos)         /*!< 0x00000100 */\r
+#define TIM_SMCR_ETF_1                      (0x2UL << TIM_SMCR_ETF_Pos)         /*!< 0x00000200 */\r
+#define TIM_SMCR_ETF_2                      (0x4UL << TIM_SMCR_ETF_Pos)         /*!< 0x00000400 */\r
+#define TIM_SMCR_ETF_3                      (0x8UL << TIM_SMCR_ETF_Pos)         /*!< 0x00000800 */\r
+\r
+#define TIM_SMCR_ETPS_Pos                   (12U)                              \r
+#define TIM_SMCR_ETPS_Msk                   (0x3UL << TIM_SMCR_ETPS_Pos)        /*!< 0x00003000 */\r
+#define TIM_SMCR_ETPS                       TIM_SMCR_ETPS_Msk                  /*!<ETPS[1:0] bits (External trigger prescaler) */\r
+#define TIM_SMCR_ETPS_0                     (0x1UL << TIM_SMCR_ETPS_Pos)        /*!< 0x00001000 */\r
+#define TIM_SMCR_ETPS_1                     (0x2UL << TIM_SMCR_ETPS_Pos)        /*!< 0x00002000 */\r
+\r
+#define TIM_SMCR_ECE_Pos                    (14U)                              \r
+#define TIM_SMCR_ECE_Msk                    (0x1UL << TIM_SMCR_ECE_Pos)         /*!< 0x00004000 */\r
+#define TIM_SMCR_ECE                        TIM_SMCR_ECE_Msk                   /*!<External clock enable */\r
+#define TIM_SMCR_ETP_Pos                    (15U)                              \r
+#define TIM_SMCR_ETP_Msk                    (0x1UL << TIM_SMCR_ETP_Pos)         /*!< 0x00008000 */\r
+#define TIM_SMCR_ETP                        TIM_SMCR_ETP_Msk                   /*!<External trigger polarity */\r
+\r
+/*******************  Bit definition for TIM_DIER register  ******************/\r
+#define TIM_DIER_UIE_Pos                    (0U)                               \r
+#define TIM_DIER_UIE_Msk                    (0x1UL << TIM_DIER_UIE_Pos)         /*!< 0x00000001 */\r
+#define TIM_DIER_UIE                        TIM_DIER_UIE_Msk                   /*!<Update interrupt enable */\r
+#define TIM_DIER_CC1IE_Pos                  (1U)                               \r
+#define TIM_DIER_CC1IE_Msk                  (0x1UL << TIM_DIER_CC1IE_Pos)       /*!< 0x00000002 */\r
+#define TIM_DIER_CC1IE                      TIM_DIER_CC1IE_Msk                 /*!<Capture/Compare 1 interrupt enable */\r
+#define TIM_DIER_CC2IE_Pos                  (2U)                               \r
+#define TIM_DIER_CC2IE_Msk                  (0x1UL << TIM_DIER_CC2IE_Pos)       /*!< 0x00000004 */\r
+#define TIM_DIER_CC2IE                      TIM_DIER_CC2IE_Msk                 /*!<Capture/Compare 2 interrupt enable */\r
+#define TIM_DIER_CC3IE_Pos                  (3U)                               \r
+#define TIM_DIER_CC3IE_Msk                  (0x1UL << TIM_DIER_CC3IE_Pos)       /*!< 0x00000008 */\r
+#define TIM_DIER_CC3IE                      TIM_DIER_CC3IE_Msk                 /*!<Capture/Compare 3 interrupt enable */\r
+#define TIM_DIER_CC4IE_Pos                  (4U)                               \r
+#define TIM_DIER_CC4IE_Msk                  (0x1UL << TIM_DIER_CC4IE_Pos)       /*!< 0x00000010 */\r
+#define TIM_DIER_CC4IE                      TIM_DIER_CC4IE_Msk                 /*!<Capture/Compare 4 interrupt enable */\r
+#define TIM_DIER_COMIE_Pos                  (5U)                               \r
+#define TIM_DIER_COMIE_Msk                  (0x1UL << TIM_DIER_COMIE_Pos)       /*!< 0x00000020 */\r
+#define TIM_DIER_COMIE                      TIM_DIER_COMIE_Msk                 /*!<COM interrupt enable */\r
+#define TIM_DIER_TIE_Pos                    (6U)                               \r
+#define TIM_DIER_TIE_Msk                    (0x1UL << TIM_DIER_TIE_Pos)         /*!< 0x00000040 */\r
+#define TIM_DIER_TIE                        TIM_DIER_TIE_Msk                   /*!<Trigger interrupt enable */\r
+#define TIM_DIER_BIE_Pos                    (7U)                               \r
+#define TIM_DIER_BIE_Msk                    (0x1UL << TIM_DIER_BIE_Pos)         /*!< 0x00000080 */\r
+#define TIM_DIER_BIE                        TIM_DIER_BIE_Msk                   /*!<Break interrupt enable */\r
+#define TIM_DIER_UDE_Pos                    (8U)                               \r
+#define TIM_DIER_UDE_Msk                    (0x1UL << TIM_DIER_UDE_Pos)         /*!< 0x00000100 */\r
+#define TIM_DIER_UDE                        TIM_DIER_UDE_Msk                   /*!<Update DMA request enable */\r
+#define TIM_DIER_CC1DE_Pos                  (9U)                               \r
+#define TIM_DIER_CC1DE_Msk                  (0x1UL << TIM_DIER_CC1DE_Pos)       /*!< 0x00000200 */\r
+#define TIM_DIER_CC1DE                      TIM_DIER_CC1DE_Msk                 /*!<Capture/Compare 1 DMA request enable */\r
+#define TIM_DIER_CC2DE_Pos                  (10U)                              \r
+#define TIM_DIER_CC2DE_Msk                  (0x1UL << TIM_DIER_CC2DE_Pos)       /*!< 0x00000400 */\r
+#define TIM_DIER_CC2DE                      TIM_DIER_CC2DE_Msk                 /*!<Capture/Compare 2 DMA request enable */\r
+#define TIM_DIER_CC3DE_Pos                  (11U)                              \r
+#define TIM_DIER_CC3DE_Msk                  (0x1UL << TIM_DIER_CC3DE_Pos)       /*!< 0x00000800 */\r
+#define TIM_DIER_CC3DE                      TIM_DIER_CC3DE_Msk                 /*!<Capture/Compare 3 DMA request enable */\r
+#define TIM_DIER_CC4DE_Pos                  (12U)                              \r
+#define TIM_DIER_CC4DE_Msk                  (0x1UL << TIM_DIER_CC4DE_Pos)       /*!< 0x00001000 */\r
+#define TIM_DIER_CC4DE                      TIM_DIER_CC4DE_Msk                 /*!<Capture/Compare 4 DMA request enable */\r
+#define TIM_DIER_COMDE_Pos                  (13U)                              \r
+#define TIM_DIER_COMDE_Msk                  (0x1UL << TIM_DIER_COMDE_Pos)       /*!< 0x00002000 */\r
+#define TIM_DIER_COMDE                      TIM_DIER_COMDE_Msk                 /*!<COM DMA request enable */\r
+#define TIM_DIER_TDE_Pos                    (14U)                              \r
+#define TIM_DIER_TDE_Msk                    (0x1UL << TIM_DIER_TDE_Pos)         /*!< 0x00004000 */\r
+#define TIM_DIER_TDE                        TIM_DIER_TDE_Msk                   /*!<Trigger DMA request enable */\r
+\r
+/********************  Bit definition for TIM_SR register  *******************/\r
+#define TIM_SR_UIF_Pos                      (0U)                               \r
+#define TIM_SR_UIF_Msk                      (0x1UL << TIM_SR_UIF_Pos)           /*!< 0x00000001 */\r
+#define TIM_SR_UIF                          TIM_SR_UIF_Msk                     /*!<Update interrupt Flag */\r
+#define TIM_SR_CC1IF_Pos                    (1U)                               \r
+#define TIM_SR_CC1IF_Msk                    (0x1UL << TIM_SR_CC1IF_Pos)         /*!< 0x00000002 */\r
+#define TIM_SR_CC1IF                        TIM_SR_CC1IF_Msk                   /*!<Capture/Compare 1 interrupt Flag */\r
+#define TIM_SR_CC2IF_Pos                    (2U)                               \r
+#define TIM_SR_CC2IF_Msk                    (0x1UL << TIM_SR_CC2IF_Pos)         /*!< 0x00000004 */\r
+#define TIM_SR_CC2IF                        TIM_SR_CC2IF_Msk                   /*!<Capture/Compare 2 interrupt Flag */\r
+#define TIM_SR_CC3IF_Pos                    (3U)                               \r
+#define TIM_SR_CC3IF_Msk                    (0x1UL << TIM_SR_CC3IF_Pos)         /*!< 0x00000008 */\r
+#define TIM_SR_CC3IF                        TIM_SR_CC3IF_Msk                   /*!<Capture/Compare 3 interrupt Flag */\r
+#define TIM_SR_CC4IF_Pos                    (4U)                               \r
+#define TIM_SR_CC4IF_Msk                    (0x1UL << TIM_SR_CC4IF_Pos)         /*!< 0x00000010 */\r
+#define TIM_SR_CC4IF                        TIM_SR_CC4IF_Msk                   /*!<Capture/Compare 4 interrupt Flag */\r
+#define TIM_SR_COMIF_Pos                    (5U)                               \r
+#define TIM_SR_COMIF_Msk                    (0x1UL << TIM_SR_COMIF_Pos)         /*!< 0x00000020 */\r
+#define TIM_SR_COMIF                        TIM_SR_COMIF_Msk                   /*!<COM interrupt Flag */\r
+#define TIM_SR_TIF_Pos                      (6U)                               \r
+#define TIM_SR_TIF_Msk                      (0x1UL << TIM_SR_TIF_Pos)           /*!< 0x00000040 */\r
+#define TIM_SR_TIF                          TIM_SR_TIF_Msk                     /*!<Trigger interrupt Flag */\r
+#define TIM_SR_BIF_Pos                      (7U)                               \r
+#define TIM_SR_BIF_Msk                      (0x1UL << TIM_SR_BIF_Pos)           /*!< 0x00000080 */\r
+#define TIM_SR_BIF                          TIM_SR_BIF_Msk                     /*!<Break interrupt Flag */\r
+#define TIM_SR_CC1OF_Pos                    (9U)                               \r
+#define TIM_SR_CC1OF_Msk                    (0x1UL << TIM_SR_CC1OF_Pos)         /*!< 0x00000200 */\r
+#define TIM_SR_CC1OF                        TIM_SR_CC1OF_Msk                   /*!<Capture/Compare 1 Overcapture Flag */\r
+#define TIM_SR_CC2OF_Pos                    (10U)                              \r
+#define TIM_SR_CC2OF_Msk                    (0x1UL << TIM_SR_CC2OF_Pos)         /*!< 0x00000400 */\r
+#define TIM_SR_CC2OF                        TIM_SR_CC2OF_Msk                   /*!<Capture/Compare 2 Overcapture Flag */\r
+#define TIM_SR_CC3OF_Pos                    (11U)                              \r
+#define TIM_SR_CC3OF_Msk                    (0x1UL << TIM_SR_CC3OF_Pos)         /*!< 0x00000800 */\r
+#define TIM_SR_CC3OF                        TIM_SR_CC3OF_Msk                   /*!<Capture/Compare 3 Overcapture Flag */\r
+#define TIM_SR_CC4OF_Pos                    (12U)                              \r
+#define TIM_SR_CC4OF_Msk                    (0x1UL << TIM_SR_CC4OF_Pos)         /*!< 0x00001000 */\r
+#define TIM_SR_CC4OF                        TIM_SR_CC4OF_Msk                   /*!<Capture/Compare 4 Overcapture Flag */\r
+\r
+/*******************  Bit definition for TIM_EGR register  *******************/\r
+#define TIM_EGR_UG_Pos                      (0U)                               \r
+#define TIM_EGR_UG_Msk                      (0x1UL << TIM_EGR_UG_Pos)           /*!< 0x00000001 */\r
+#define TIM_EGR_UG                          TIM_EGR_UG_Msk                     /*!<Update Generation */\r
+#define TIM_EGR_CC1G_Pos                    (1U)                               \r
+#define TIM_EGR_CC1G_Msk                    (0x1UL << TIM_EGR_CC1G_Pos)         /*!< 0x00000002 */\r
+#define TIM_EGR_CC1G                        TIM_EGR_CC1G_Msk                   /*!<Capture/Compare 1 Generation */\r
+#define TIM_EGR_CC2G_Pos                    (2U)                               \r
+#define TIM_EGR_CC2G_Msk                    (0x1UL << TIM_EGR_CC2G_Pos)         /*!< 0x00000004 */\r
+#define TIM_EGR_CC2G                        TIM_EGR_CC2G_Msk                   /*!<Capture/Compare 2 Generation */\r
+#define TIM_EGR_CC3G_Pos                    (3U)                               \r
+#define TIM_EGR_CC3G_Msk                    (0x1UL << TIM_EGR_CC3G_Pos)         /*!< 0x00000008 */\r
+#define TIM_EGR_CC3G                        TIM_EGR_CC3G_Msk                   /*!<Capture/Compare 3 Generation */\r
+#define TIM_EGR_CC4G_Pos                    (4U)                               \r
+#define TIM_EGR_CC4G_Msk                    (0x1UL << TIM_EGR_CC4G_Pos)         /*!< 0x00000010 */\r
+#define TIM_EGR_CC4G                        TIM_EGR_CC4G_Msk                   /*!<Capture/Compare 4 Generation */\r
+#define TIM_EGR_COMG_Pos                    (5U)                               \r
+#define TIM_EGR_COMG_Msk                    (0x1UL << TIM_EGR_COMG_Pos)         /*!< 0x00000020 */\r
+#define TIM_EGR_COMG                        TIM_EGR_COMG_Msk                   /*!<Capture/Compare Control Update Generation */\r
+#define TIM_EGR_TG_Pos                      (6U)                               \r
+#define TIM_EGR_TG_Msk                      (0x1UL << TIM_EGR_TG_Pos)           /*!< 0x00000040 */\r
+#define TIM_EGR_TG                          TIM_EGR_TG_Msk                     /*!<Trigger Generation */\r
+#define TIM_EGR_BG_Pos                      (7U)                               \r
+#define TIM_EGR_BG_Msk                      (0x1UL << TIM_EGR_BG_Pos)           /*!< 0x00000080 */\r
+#define TIM_EGR_BG                          TIM_EGR_BG_Msk                     /*!<Break Generation */\r
+\r
+/******************  Bit definition for TIM_CCMR1 register  ******************/\r
+#define TIM_CCMR1_CC1S_Pos                  (0U)                               \r
+#define TIM_CCMR1_CC1S_Msk                  (0x3UL << TIM_CCMR1_CC1S_Pos)       /*!< 0x00000003 */\r
+#define TIM_CCMR1_CC1S                      TIM_CCMR1_CC1S_Msk                 /*!<CC1S[1:0] bits (Capture/Compare 1 Selection) */\r
+#define TIM_CCMR1_CC1S_0                    (0x1UL << TIM_CCMR1_CC1S_Pos)       /*!< 0x00000001 */\r
+#define TIM_CCMR1_CC1S_1                    (0x2UL << TIM_CCMR1_CC1S_Pos)       /*!< 0x00000002 */\r
+\r
+#define TIM_CCMR1_OC1FE_Pos                 (2U)                               \r
+#define TIM_CCMR1_OC1FE_Msk                 (0x1UL << TIM_CCMR1_OC1FE_Pos)      /*!< 0x00000004 */\r
+#define TIM_CCMR1_OC1FE                     TIM_CCMR1_OC1FE_Msk                /*!<Output Compare 1 Fast enable */\r
+#define TIM_CCMR1_OC1PE_Pos                 (3U)                               \r
+#define TIM_CCMR1_OC1PE_Msk                 (0x1UL << TIM_CCMR1_OC1PE_Pos)      /*!< 0x00000008 */\r
+#define TIM_CCMR1_OC1PE                     TIM_CCMR1_OC1PE_Msk                /*!<Output Compare 1 Preload enable */\r
+\r
+#define TIM_CCMR1_OC1M_Pos                  (4U)                               \r
+#define TIM_CCMR1_OC1M_Msk                  (0x7UL << TIM_CCMR1_OC1M_Pos)       /*!< 0x00000070 */\r
+#define TIM_CCMR1_OC1M                      TIM_CCMR1_OC1M_Msk                 /*!<OC1M[2:0] bits (Output Compare 1 Mode) */\r
+#define TIM_CCMR1_OC1M_0                    (0x1UL << TIM_CCMR1_OC1M_Pos)       /*!< 0x00000010 */\r
+#define TIM_CCMR1_OC1M_1                    (0x2UL << TIM_CCMR1_OC1M_Pos)       /*!< 0x00000020 */\r
+#define TIM_CCMR1_OC1M_2                    (0x4UL << TIM_CCMR1_OC1M_Pos)       /*!< 0x00000040 */\r
+\r
+#define TIM_CCMR1_OC1CE_Pos                 (7U)                               \r
+#define TIM_CCMR1_OC1CE_Msk                 (0x1UL << TIM_CCMR1_OC1CE_Pos)      /*!< 0x00000080 */\r
+#define TIM_CCMR1_OC1CE                     TIM_CCMR1_OC1CE_Msk                /*!<Output Compare 1Clear Enable */\r
+\r
+#define TIM_CCMR1_CC2S_Pos                  (8U)                               \r
+#define TIM_CCMR1_CC2S_Msk                  (0x3UL << TIM_CCMR1_CC2S_Pos)       /*!< 0x00000300 */\r
+#define TIM_CCMR1_CC2S                      TIM_CCMR1_CC2S_Msk                 /*!<CC2S[1:0] bits (Capture/Compare 2 Selection) */\r
+#define TIM_CCMR1_CC2S_0                    (0x1UL << TIM_CCMR1_CC2S_Pos)       /*!< 0x00000100 */\r
+#define TIM_CCMR1_CC2S_1                    (0x2UL << TIM_CCMR1_CC2S_Pos)       /*!< 0x00000200 */\r
+\r
+#define TIM_CCMR1_OC2FE_Pos                 (10U)                              \r
+#define TIM_CCMR1_OC2FE_Msk                 (0x1UL << TIM_CCMR1_OC2FE_Pos)      /*!< 0x00000400 */\r
+#define TIM_CCMR1_OC2FE                     TIM_CCMR1_OC2FE_Msk                /*!<Output Compare 2 Fast enable */\r
+#define TIM_CCMR1_OC2PE_Pos                 (11U)                              \r
+#define TIM_CCMR1_OC2PE_Msk                 (0x1UL << TIM_CCMR1_OC2PE_Pos)      /*!< 0x00000800 */\r
+#define TIM_CCMR1_OC2PE                     TIM_CCMR1_OC2PE_Msk                /*!<Output Compare 2 Preload enable */\r
+\r
+#define TIM_CCMR1_OC2M_Pos                  (12U)                              \r
+#define TIM_CCMR1_OC2M_Msk                  (0x7UL << TIM_CCMR1_OC2M_Pos)       /*!< 0x00007000 */\r
+#define TIM_CCMR1_OC2M                      TIM_CCMR1_OC2M_Msk                 /*!<OC2M[2:0] bits (Output Compare 2 Mode) */\r
+#define TIM_CCMR1_OC2M_0                    (0x1UL << TIM_CCMR1_OC2M_Pos)       /*!< 0x00001000 */\r
+#define TIM_CCMR1_OC2M_1                    (0x2UL << TIM_CCMR1_OC2M_Pos)       /*!< 0x00002000 */\r
+#define TIM_CCMR1_OC2M_2                    (0x4UL << TIM_CCMR1_OC2M_Pos)       /*!< 0x00004000 */\r
+\r
+#define TIM_CCMR1_OC2CE_Pos                 (15U)                              \r
+#define TIM_CCMR1_OC2CE_Msk                 (0x1UL << TIM_CCMR1_OC2CE_Pos)      /*!< 0x00008000 */\r
+#define TIM_CCMR1_OC2CE                     TIM_CCMR1_OC2CE_Msk                /*!<Output Compare 2 Clear Enable */\r
+\r
+/*---------------------------------------------------------------------------*/\r
+\r
+#define TIM_CCMR1_IC1PSC_Pos                (2U)                               \r
+#define TIM_CCMR1_IC1PSC_Msk                (0x3UL << TIM_CCMR1_IC1PSC_Pos)     /*!< 0x0000000C */\r
+#define TIM_CCMR1_IC1PSC                    TIM_CCMR1_IC1PSC_Msk               /*!<IC1PSC[1:0] bits (Input Capture 1 Prescaler) */\r
+#define TIM_CCMR1_IC1PSC_0                  (0x1UL << TIM_CCMR1_IC1PSC_Pos)     /*!< 0x00000004 */\r
+#define TIM_CCMR1_IC1PSC_1                  (0x2UL << TIM_CCMR1_IC1PSC_Pos)     /*!< 0x00000008 */\r
+\r
+#define TIM_CCMR1_IC1F_Pos                  (4U)                               \r
+#define TIM_CCMR1_IC1F_Msk                  (0xFUL << TIM_CCMR1_IC1F_Pos)       /*!< 0x000000F0 */\r
+#define TIM_CCMR1_IC1F                      TIM_CCMR1_IC1F_Msk                 /*!<IC1F[3:0] bits (Input Capture 1 Filter) */\r
+#define TIM_CCMR1_IC1F_0                    (0x1UL << TIM_CCMR1_IC1F_Pos)       /*!< 0x00000010 */\r
+#define TIM_CCMR1_IC1F_1                    (0x2UL << TIM_CCMR1_IC1F_Pos)       /*!< 0x00000020 */\r
+#define TIM_CCMR1_IC1F_2                    (0x4UL << TIM_CCMR1_IC1F_Pos)       /*!< 0x00000040 */\r
+#define TIM_CCMR1_IC1F_3                    (0x8UL << TIM_CCMR1_IC1F_Pos)       /*!< 0x00000080 */\r
+\r
+#define TIM_CCMR1_IC2PSC_Pos                (10U)                              \r
+#define TIM_CCMR1_IC2PSC_Msk                (0x3UL << TIM_CCMR1_IC2PSC_Pos)     /*!< 0x00000C00 */\r
+#define TIM_CCMR1_IC2PSC                    TIM_CCMR1_IC2PSC_Msk               /*!<IC2PSC[1:0] bits (Input Capture 2 Prescaler) */\r
+#define TIM_CCMR1_IC2PSC_0                  (0x1UL << TIM_CCMR1_IC2PSC_Pos)     /*!< 0x00000400 */\r
+#define TIM_CCMR1_IC2PSC_1                  (0x2UL << TIM_CCMR1_IC2PSC_Pos)     /*!< 0x00000800 */\r
+\r
+#define TIM_CCMR1_IC2F_Pos                  (12U)                              \r
+#define TIM_CCMR1_IC2F_Msk                  (0xFUL << TIM_CCMR1_IC2F_Pos)       /*!< 0x0000F000 */\r
+#define TIM_CCMR1_IC2F                      TIM_CCMR1_IC2F_Msk                 /*!<IC2F[3:0] bits (Input Capture 2 Filter) */\r
+#define TIM_CCMR1_IC2F_0                    (0x1UL << TIM_CCMR1_IC2F_Pos)       /*!< 0x00001000 */\r
+#define TIM_CCMR1_IC2F_1                    (0x2UL << TIM_CCMR1_IC2F_Pos)       /*!< 0x00002000 */\r
+#define TIM_CCMR1_IC2F_2                    (0x4UL << TIM_CCMR1_IC2F_Pos)       /*!< 0x00004000 */\r
+#define TIM_CCMR1_IC2F_3                    (0x8UL << TIM_CCMR1_IC2F_Pos)       /*!< 0x00008000 */\r
+\r
+/******************  Bit definition for TIM_CCMR2 register  ******************/\r
+#define TIM_CCMR2_CC3S_Pos                  (0U)                               \r
+#define TIM_CCMR2_CC3S_Msk                  (0x3UL << TIM_CCMR2_CC3S_Pos)       /*!< 0x00000003 */\r
+#define TIM_CCMR2_CC3S                      TIM_CCMR2_CC3S_Msk                 /*!<CC3S[1:0] bits (Capture/Compare 3 Selection) */\r
+#define TIM_CCMR2_CC3S_0                    (0x1UL << TIM_CCMR2_CC3S_Pos)       /*!< 0x00000001 */\r
+#define TIM_CCMR2_CC3S_1                    (0x2UL << TIM_CCMR2_CC3S_Pos)       /*!< 0x00000002 */\r
+\r
+#define TIM_CCMR2_OC3FE_Pos                 (2U)                               \r
+#define TIM_CCMR2_OC3FE_Msk                 (0x1UL << TIM_CCMR2_OC3FE_Pos)      /*!< 0x00000004 */\r
+#define TIM_CCMR2_OC3FE                     TIM_CCMR2_OC3FE_Msk                /*!<Output Compare 3 Fast enable */\r
+#define TIM_CCMR2_OC3PE_Pos                 (3U)                               \r
+#define TIM_CCMR2_OC3PE_Msk                 (0x1UL << TIM_CCMR2_OC3PE_Pos)      /*!< 0x00000008 */\r
+#define TIM_CCMR2_OC3PE                     TIM_CCMR2_OC3PE_Msk                /*!<Output Compare 3 Preload enable */\r
+\r
+#define TIM_CCMR2_OC3M_Pos                  (4U)                               \r
+#define TIM_CCMR2_OC3M_Msk                  (0x7UL << TIM_CCMR2_OC3M_Pos)       /*!< 0x00000070 */\r
+#define TIM_CCMR2_OC3M                      TIM_CCMR2_OC3M_Msk                 /*!<OC3M[2:0] bits (Output Compare 3 Mode) */\r
+#define TIM_CCMR2_OC3M_0                    (0x1UL << TIM_CCMR2_OC3M_Pos)       /*!< 0x00000010 */\r
+#define TIM_CCMR2_OC3M_1                    (0x2UL << TIM_CCMR2_OC3M_Pos)       /*!< 0x00000020 */\r
+#define TIM_CCMR2_OC3M_2                    (0x4UL << TIM_CCMR2_OC3M_Pos)       /*!< 0x00000040 */\r
+\r
+#define TIM_CCMR2_OC3CE_Pos                 (7U)                               \r
+#define TIM_CCMR2_OC3CE_Msk                 (0x1UL << TIM_CCMR2_OC3CE_Pos)      /*!< 0x00000080 */\r
+#define TIM_CCMR2_OC3CE                     TIM_CCMR2_OC3CE_Msk                /*!<Output Compare 3 Clear Enable */\r
+\r
+#define TIM_CCMR2_CC4S_Pos                  (8U)                               \r
+#define TIM_CCMR2_CC4S_Msk                  (0x3UL << TIM_CCMR2_CC4S_Pos)       /*!< 0x00000300 */\r
+#define TIM_CCMR2_CC4S                      TIM_CCMR2_CC4S_Msk                 /*!<CC4S[1:0] bits (Capture/Compare 4 Selection) */\r
+#define TIM_CCMR2_CC4S_0                    (0x1UL << TIM_CCMR2_CC4S_Pos)       /*!< 0x00000100 */\r
+#define TIM_CCMR2_CC4S_1                    (0x2UL << TIM_CCMR2_CC4S_Pos)       /*!< 0x00000200 */\r
+\r
+#define TIM_CCMR2_OC4FE_Pos                 (10U)                              \r
+#define TIM_CCMR2_OC4FE_Msk                 (0x1UL << TIM_CCMR2_OC4FE_Pos)      /*!< 0x00000400 */\r
+#define TIM_CCMR2_OC4FE                     TIM_CCMR2_OC4FE_Msk                /*!<Output Compare 4 Fast enable */\r
+#define TIM_CCMR2_OC4PE_Pos                 (11U)                              \r
+#define TIM_CCMR2_OC4PE_Msk                 (0x1UL << TIM_CCMR2_OC4PE_Pos)      /*!< 0x00000800 */\r
+#define TIM_CCMR2_OC4PE                     TIM_CCMR2_OC4PE_Msk                /*!<Output Compare 4 Preload enable */\r
+\r
+#define TIM_CCMR2_OC4M_Pos                  (12U)                              \r
+#define TIM_CCMR2_OC4M_Msk                  (0x7UL << TIM_CCMR2_OC4M_Pos)       /*!< 0x00007000 */\r
+#define TIM_CCMR2_OC4M                      TIM_CCMR2_OC4M_Msk                 /*!<OC4M[2:0] bits (Output Compare 4 Mode) */\r
+#define TIM_CCMR2_OC4M_0                    (0x1UL << TIM_CCMR2_OC4M_Pos)       /*!< 0x00001000 */\r
+#define TIM_CCMR2_OC4M_1                    (0x2UL << TIM_CCMR2_OC4M_Pos)       /*!< 0x00002000 */\r
+#define TIM_CCMR2_OC4M_2                    (0x4UL << TIM_CCMR2_OC4M_Pos)       /*!< 0x00004000 */\r
+\r
+#define TIM_CCMR2_OC4CE_Pos                 (15U)                              \r
+#define TIM_CCMR2_OC4CE_Msk                 (0x1UL << TIM_CCMR2_OC4CE_Pos)      /*!< 0x00008000 */\r
+#define TIM_CCMR2_OC4CE                     TIM_CCMR2_OC4CE_Msk                /*!<Output Compare 4 Clear Enable */\r
+\r
+/*---------------------------------------------------------------------------*/\r
+\r
+#define TIM_CCMR2_IC3PSC_Pos                (2U)                               \r
+#define TIM_CCMR2_IC3PSC_Msk                (0x3UL << TIM_CCMR2_IC3PSC_Pos)     /*!< 0x0000000C */\r
+#define TIM_CCMR2_IC3PSC                    TIM_CCMR2_IC3PSC_Msk               /*!<IC3PSC[1:0] bits (Input Capture 3 Prescaler) */\r
+#define TIM_CCMR2_IC3PSC_0                  (0x1UL << TIM_CCMR2_IC3PSC_Pos)     /*!< 0x00000004 */\r
+#define TIM_CCMR2_IC3PSC_1                  (0x2UL << TIM_CCMR2_IC3PSC_Pos)     /*!< 0x00000008 */\r
+\r
+#define TIM_CCMR2_IC3F_Pos                  (4U)                               \r
+#define TIM_CCMR2_IC3F_Msk                  (0xFUL << TIM_CCMR2_IC3F_Pos)       /*!< 0x000000F0 */\r
+#define TIM_CCMR2_IC3F                      TIM_CCMR2_IC3F_Msk                 /*!<IC3F[3:0] bits (Input Capture 3 Filter) */\r
+#define TIM_CCMR2_IC3F_0                    (0x1UL << TIM_CCMR2_IC3F_Pos)       /*!< 0x00000010 */\r
+#define TIM_CCMR2_IC3F_1                    (0x2UL << TIM_CCMR2_IC3F_Pos)       /*!< 0x00000020 */\r
+#define TIM_CCMR2_IC3F_2                    (0x4UL << TIM_CCMR2_IC3F_Pos)       /*!< 0x00000040 */\r
+#define TIM_CCMR2_IC3F_3                    (0x8UL << TIM_CCMR2_IC3F_Pos)       /*!< 0x00000080 */\r
+\r
+#define TIM_CCMR2_IC4PSC_Pos                (10U)                              \r
+#define TIM_CCMR2_IC4PSC_Msk                (0x3UL << TIM_CCMR2_IC4PSC_Pos)     /*!< 0x00000C00 */\r
+#define TIM_CCMR2_IC4PSC                    TIM_CCMR2_IC4PSC_Msk               /*!<IC4PSC[1:0] bits (Input Capture 4 Prescaler) */\r
+#define TIM_CCMR2_IC4PSC_0                  (0x1UL << TIM_CCMR2_IC4PSC_Pos)     /*!< 0x00000400 */\r
+#define TIM_CCMR2_IC4PSC_1                  (0x2UL << TIM_CCMR2_IC4PSC_Pos)     /*!< 0x00000800 */\r
+\r
+#define TIM_CCMR2_IC4F_Pos                  (12U)                              \r
+#define TIM_CCMR2_IC4F_Msk                  (0xFUL << TIM_CCMR2_IC4F_Pos)       /*!< 0x0000F000 */\r
+#define TIM_CCMR2_IC4F                      TIM_CCMR2_IC4F_Msk                 /*!<IC4F[3:0] bits (Input Capture 4 Filter) */\r
+#define TIM_CCMR2_IC4F_0                    (0x1UL << TIM_CCMR2_IC4F_Pos)       /*!< 0x00001000 */\r
+#define TIM_CCMR2_IC4F_1                    (0x2UL << TIM_CCMR2_IC4F_Pos)       /*!< 0x00002000 */\r
+#define TIM_CCMR2_IC4F_2                    (0x4UL << TIM_CCMR2_IC4F_Pos)       /*!< 0x00004000 */\r
+#define TIM_CCMR2_IC4F_3                    (0x8UL << TIM_CCMR2_IC4F_Pos)       /*!< 0x00008000 */\r
+\r
+/*******************  Bit definition for TIM_CCER register  ******************/\r
+#define TIM_CCER_CC1E_Pos                   (0U)                               \r
+#define TIM_CCER_CC1E_Msk                   (0x1UL << TIM_CCER_CC1E_Pos)        /*!< 0x00000001 */\r
+#define TIM_CCER_CC1E                       TIM_CCER_CC1E_Msk                  /*!<Capture/Compare 1 output enable */\r
+#define TIM_CCER_CC1P_Pos                   (1U)                               \r
+#define TIM_CCER_CC1P_Msk                   (0x1UL << TIM_CCER_CC1P_Pos)        /*!< 0x00000002 */\r
+#define TIM_CCER_CC1P                       TIM_CCER_CC1P_Msk                  /*!<Capture/Compare 1 output Polarity */\r
+#define TIM_CCER_CC1NE_Pos                  (2U)                               \r
+#define TIM_CCER_CC1NE_Msk                  (0x1UL << TIM_CCER_CC1NE_Pos)       /*!< 0x00000004 */\r
+#define TIM_CCER_CC1NE                      TIM_CCER_CC1NE_Msk                 /*!<Capture/Compare 1 Complementary output enable */\r
+#define TIM_CCER_CC1NP_Pos                  (3U)                               \r
+#define TIM_CCER_CC1NP_Msk                  (0x1UL << TIM_CCER_CC1NP_Pos)       /*!< 0x00000008 */\r
+#define TIM_CCER_CC1NP                      TIM_CCER_CC1NP_Msk                 /*!<Capture/Compare 1 Complementary output Polarity */\r
+#define TIM_CCER_CC2E_Pos                   (4U)                               \r
+#define TIM_CCER_CC2E_Msk                   (0x1UL << TIM_CCER_CC2E_Pos)        /*!< 0x00000010 */\r
+#define TIM_CCER_CC2E                       TIM_CCER_CC2E_Msk                  /*!<Capture/Compare 2 output enable */\r
+#define TIM_CCER_CC2P_Pos                   (5U)                               \r
+#define TIM_CCER_CC2P_Msk                   (0x1UL << TIM_CCER_CC2P_Pos)        /*!< 0x00000020 */\r
+#define TIM_CCER_CC2P                       TIM_CCER_CC2P_Msk                  /*!<Capture/Compare 2 output Polarity */\r
+#define TIM_CCER_CC2NE_Pos                  (6U)                               \r
+#define TIM_CCER_CC2NE_Msk                  (0x1UL << TIM_CCER_CC2NE_Pos)       /*!< 0x00000040 */\r
+#define TIM_CCER_CC2NE                      TIM_CCER_CC2NE_Msk                 /*!<Capture/Compare 2 Complementary output enable */\r
+#define TIM_CCER_CC2NP_Pos                  (7U)                               \r
+#define TIM_CCER_CC2NP_Msk                  (0x1UL << TIM_CCER_CC2NP_Pos)       /*!< 0x00000080 */\r
+#define TIM_CCER_CC2NP                      TIM_CCER_CC2NP_Msk                 /*!<Capture/Compare 2 Complementary output Polarity */\r
+#define TIM_CCER_CC3E_Pos                   (8U)                               \r
+#define TIM_CCER_CC3E_Msk                   (0x1UL << TIM_CCER_CC3E_Pos)        /*!< 0x00000100 */\r
+#define TIM_CCER_CC3E                       TIM_CCER_CC3E_Msk                  /*!<Capture/Compare 3 output enable */\r
+#define TIM_CCER_CC3P_Pos                   (9U)                               \r
+#define TIM_CCER_CC3P_Msk                   (0x1UL << TIM_CCER_CC3P_Pos)        /*!< 0x00000200 */\r
+#define TIM_CCER_CC3P                       TIM_CCER_CC3P_Msk                  /*!<Capture/Compare 3 output Polarity */\r
+#define TIM_CCER_CC3NE_Pos                  (10U)                              \r
+#define TIM_CCER_CC3NE_Msk                  (0x1UL << TIM_CCER_CC3NE_Pos)       /*!< 0x00000400 */\r
+#define TIM_CCER_CC3NE                      TIM_CCER_CC3NE_Msk                 /*!<Capture/Compare 3 Complementary output enable */\r
+#define TIM_CCER_CC3NP_Pos                  (11U)                              \r
+#define TIM_CCER_CC3NP_Msk                  (0x1UL << TIM_CCER_CC3NP_Pos)       /*!< 0x00000800 */\r
+#define TIM_CCER_CC3NP                      TIM_CCER_CC3NP_Msk                 /*!<Capture/Compare 3 Complementary output Polarity */\r
+#define TIM_CCER_CC4E_Pos                   (12U)                              \r
+#define TIM_CCER_CC4E_Msk                   (0x1UL << TIM_CCER_CC4E_Pos)        /*!< 0x00001000 */\r
+#define TIM_CCER_CC4E                       TIM_CCER_CC4E_Msk                  /*!<Capture/Compare 4 output enable */\r
+#define TIM_CCER_CC4P_Pos                   (13U)                              \r
+#define TIM_CCER_CC4P_Msk                   (0x1UL << TIM_CCER_CC4P_Pos)        /*!< 0x00002000 */\r
+#define TIM_CCER_CC4P                       TIM_CCER_CC4P_Msk                  /*!<Capture/Compare 4 output Polarity */\r
+\r
+/*******************  Bit definition for TIM_CNT register  *******************/\r
+#define TIM_CNT_CNT_Pos                     (0U)                               \r
+#define TIM_CNT_CNT_Msk                     (0xFFFFFFFFUL << TIM_CNT_CNT_Pos)   /*!< 0xFFFFFFFF */\r
+#define TIM_CNT_CNT                         TIM_CNT_CNT_Msk                    /*!<Counter Value */\r
+\r
+/*******************  Bit definition for TIM_PSC register  *******************/\r
+#define TIM_PSC_PSC_Pos                     (0U)                               \r
+#define TIM_PSC_PSC_Msk                     (0xFFFFUL << TIM_PSC_PSC_Pos)       /*!< 0x0000FFFF */\r
+#define TIM_PSC_PSC                         TIM_PSC_PSC_Msk                    /*!<Prescaler Value */\r
+\r
+/*******************  Bit definition for TIM_ARR register  *******************/\r
+#define TIM_ARR_ARR_Pos                     (0U)                               \r
+#define TIM_ARR_ARR_Msk                     (0xFFFFFFFFUL << TIM_ARR_ARR_Pos)   /*!< 0xFFFFFFFF */\r
+#define TIM_ARR_ARR                         TIM_ARR_ARR_Msk                    /*!<actual auto-reload Value */\r
+\r
+/*******************  Bit definition for TIM_RCR register  *******************/\r
+#define TIM_RCR_REP_Pos                     (0U)                               \r
+#define TIM_RCR_REP_Msk                     (0xFFUL << TIM_RCR_REP_Pos)         /*!< 0x000000FF */\r
+#define TIM_RCR_REP                         TIM_RCR_REP_Msk                    /*!<Repetition Counter Value */\r
+\r
+/*******************  Bit definition for TIM_CCR1 register  ******************/\r
+#define TIM_CCR1_CCR1_Pos                   (0U)                               \r
+#define TIM_CCR1_CCR1_Msk                   (0xFFFFUL << TIM_CCR1_CCR1_Pos)     /*!< 0x0000FFFF */\r
+#define TIM_CCR1_CCR1                       TIM_CCR1_CCR1_Msk                  /*!<Capture/Compare 1 Value */\r
+\r
+/*******************  Bit definition for TIM_CCR2 register  ******************/\r
+#define TIM_CCR2_CCR2_Pos                   (0U)                               \r
+#define TIM_CCR2_CCR2_Msk                   (0xFFFFUL << TIM_CCR2_CCR2_Pos)     /*!< 0x0000FFFF */\r
+#define TIM_CCR2_CCR2                       TIM_CCR2_CCR2_Msk                  /*!<Capture/Compare 2 Value */\r
+\r
+/*******************  Bit definition for TIM_CCR3 register  ******************/\r
+#define TIM_CCR3_CCR3_Pos                   (0U)                               \r
+#define TIM_CCR3_CCR3_Msk                   (0xFFFFUL << TIM_CCR3_CCR3_Pos)     /*!< 0x0000FFFF */\r
+#define TIM_CCR3_CCR3                       TIM_CCR3_CCR3_Msk                  /*!<Capture/Compare 3 Value */\r
+\r
+/*******************  Bit definition for TIM_CCR4 register  ******************/\r
+#define TIM_CCR4_CCR4_Pos                   (0U)                               \r
+#define TIM_CCR4_CCR4_Msk                   (0xFFFFUL << TIM_CCR4_CCR4_Pos)     /*!< 0x0000FFFF */\r
+#define TIM_CCR4_CCR4                       TIM_CCR4_CCR4_Msk                  /*!<Capture/Compare 4 Value */\r
+\r
+/*******************  Bit definition for TIM_BDTR register  ******************/\r
+#define TIM_BDTR_DTG_Pos                    (0U)                               \r
+#define TIM_BDTR_DTG_Msk                    (0xFFUL << TIM_BDTR_DTG_Pos)        /*!< 0x000000FF */\r
+#define TIM_BDTR_DTG                        TIM_BDTR_DTG_Msk                   /*!<DTG[0:7] bits (Dead-Time Generator set-up) */\r
+#define TIM_BDTR_DTG_0                      (0x01UL << TIM_BDTR_DTG_Pos)        /*!< 0x00000001 */\r
+#define TIM_BDTR_DTG_1                      (0x02UL << TIM_BDTR_DTG_Pos)        /*!< 0x00000002 */\r
+#define TIM_BDTR_DTG_2                      (0x04UL << TIM_BDTR_DTG_Pos)        /*!< 0x00000004 */\r
+#define TIM_BDTR_DTG_3                      (0x08UL << TIM_BDTR_DTG_Pos)        /*!< 0x00000008 */\r
+#define TIM_BDTR_DTG_4                      (0x10UL << TIM_BDTR_DTG_Pos)        /*!< 0x00000010 */\r
+#define TIM_BDTR_DTG_5                      (0x20UL << TIM_BDTR_DTG_Pos)        /*!< 0x00000020 */\r
+#define TIM_BDTR_DTG_6                      (0x40UL << TIM_BDTR_DTG_Pos)        /*!< 0x00000040 */\r
+#define TIM_BDTR_DTG_7                      (0x80UL << TIM_BDTR_DTG_Pos)        /*!< 0x00000080 */\r
+\r
+#define TIM_BDTR_LOCK_Pos                   (8U)                               \r
+#define TIM_BDTR_LOCK_Msk                   (0x3UL << TIM_BDTR_LOCK_Pos)        /*!< 0x00000300 */\r
+#define TIM_BDTR_LOCK                       TIM_BDTR_LOCK_Msk                  /*!<LOCK[1:0] bits (Lock Configuration) */\r
+#define TIM_BDTR_LOCK_0                     (0x1UL << TIM_BDTR_LOCK_Pos)        /*!< 0x00000100 */\r
+#define TIM_BDTR_LOCK_1                     (0x2UL << TIM_BDTR_LOCK_Pos)        /*!< 0x00000200 */\r
+\r
+#define TIM_BDTR_OSSI_Pos                   (10U)                              \r
+#define TIM_BDTR_OSSI_Msk                   (0x1UL << TIM_BDTR_OSSI_Pos)        /*!< 0x00000400 */\r
+#define TIM_BDTR_OSSI                       TIM_BDTR_OSSI_Msk                  /*!<Off-State Selection for Idle mode */\r
+#define TIM_BDTR_OSSR_Pos                   (11U)                              \r
+#define TIM_BDTR_OSSR_Msk                   (0x1UL << TIM_BDTR_OSSR_Pos)        /*!< 0x00000800 */\r
+#define TIM_BDTR_OSSR                       TIM_BDTR_OSSR_Msk                  /*!<Off-State Selection for Run mode */\r
+#define TIM_BDTR_BKE_Pos                    (12U)                              \r
+#define TIM_BDTR_BKE_Msk                    (0x1UL << TIM_BDTR_BKE_Pos)         /*!< 0x00001000 */\r
+#define TIM_BDTR_BKE                        TIM_BDTR_BKE_Msk                   /*!<Break enable */\r
+#define TIM_BDTR_BKP_Pos                    (13U)                              \r
+#define TIM_BDTR_BKP_Msk                    (0x1UL << TIM_BDTR_BKP_Pos)         /*!< 0x00002000 */\r
+#define TIM_BDTR_BKP                        TIM_BDTR_BKP_Msk                   /*!<Break Polarity */\r
+#define TIM_BDTR_AOE_Pos                    (14U)                              \r
+#define TIM_BDTR_AOE_Msk                    (0x1UL << TIM_BDTR_AOE_Pos)         /*!< 0x00004000 */\r
+#define TIM_BDTR_AOE                        TIM_BDTR_AOE_Msk                   /*!<Automatic Output enable */\r
+#define TIM_BDTR_MOE_Pos                    (15U)                              \r
+#define TIM_BDTR_MOE_Msk                    (0x1UL << TIM_BDTR_MOE_Pos)         /*!< 0x00008000 */\r
+#define TIM_BDTR_MOE                        TIM_BDTR_MOE_Msk                   /*!<Main Output enable */\r
+\r
+/*******************  Bit definition for TIM_DCR register  *******************/\r
+#define TIM_DCR_DBA_Pos                     (0U)                               \r
+#define TIM_DCR_DBA_Msk                     (0x1FUL << TIM_DCR_DBA_Pos)         /*!< 0x0000001F */\r
+#define TIM_DCR_DBA                         TIM_DCR_DBA_Msk                    /*!<DBA[4:0] bits (DMA Base Address) */\r
+#define TIM_DCR_DBA_0                       (0x01UL << TIM_DCR_DBA_Pos)         /*!< 0x00000001 */\r
+#define TIM_DCR_DBA_1                       (0x02UL << TIM_DCR_DBA_Pos)         /*!< 0x00000002 */\r
+#define TIM_DCR_DBA_2                       (0x04UL << TIM_DCR_DBA_Pos)         /*!< 0x00000004 */\r
+#define TIM_DCR_DBA_3                       (0x08UL << TIM_DCR_DBA_Pos)         /*!< 0x00000008 */\r
+#define TIM_DCR_DBA_4                       (0x10UL << TIM_DCR_DBA_Pos)         /*!< 0x00000010 */\r
+\r
+#define TIM_DCR_DBL_Pos                     (8U)                               \r
+#define TIM_DCR_DBL_Msk                     (0x1FUL << TIM_DCR_DBL_Pos)         /*!< 0x00001F00 */\r
+#define TIM_DCR_DBL                         TIM_DCR_DBL_Msk                    /*!<DBL[4:0] bits (DMA Burst Length) */\r
+#define TIM_DCR_DBL_0                       (0x01UL << TIM_DCR_DBL_Pos)         /*!< 0x00000100 */\r
+#define TIM_DCR_DBL_1                       (0x02UL << TIM_DCR_DBL_Pos)         /*!< 0x00000200 */\r
+#define TIM_DCR_DBL_2                       (0x04UL << TIM_DCR_DBL_Pos)         /*!< 0x00000400 */\r
+#define TIM_DCR_DBL_3                       (0x08UL << TIM_DCR_DBL_Pos)         /*!< 0x00000800 */\r
+#define TIM_DCR_DBL_4                       (0x10UL << TIM_DCR_DBL_Pos)         /*!< 0x00001000 */\r
+\r
+/*******************  Bit definition for TIM_DMAR register  ******************/\r
+#define TIM_DMAR_DMAB_Pos                   (0U)                               \r
+#define TIM_DMAR_DMAB_Msk                   (0xFFFFUL << TIM_DMAR_DMAB_Pos)     /*!< 0x0000FFFF */\r
+#define TIM_DMAR_DMAB                       TIM_DMAR_DMAB_Msk                  /*!<DMA register for burst accesses */\r
+\r
+/******************************************************************************/\r
+/*                                                                            */\r
+/*                             Real-Time Clock                                */\r
+/*                                                                            */\r
+/******************************************************************************/\r
+\r
+/*******************  Bit definition for RTC_CRH register  ********************/\r
+#define RTC_CRH_SECIE_Pos                   (0U)                               \r
+#define RTC_CRH_SECIE_Msk                   (0x1UL << RTC_CRH_SECIE_Pos)        /*!< 0x00000001 */\r
+#define RTC_CRH_SECIE                       RTC_CRH_SECIE_Msk                  /*!< Second Interrupt Enable */\r
+#define RTC_CRH_ALRIE_Pos                   (1U)                               \r
+#define RTC_CRH_ALRIE_Msk                   (0x1UL << RTC_CRH_ALRIE_Pos)        /*!< 0x00000002 */\r
+#define RTC_CRH_ALRIE                       RTC_CRH_ALRIE_Msk                  /*!< Alarm Interrupt Enable */\r
+#define RTC_CRH_OWIE_Pos                    (2U)                               \r
+#define RTC_CRH_OWIE_Msk                    (0x1UL << RTC_CRH_OWIE_Pos)         /*!< 0x00000004 */\r
+#define RTC_CRH_OWIE                        RTC_CRH_OWIE_Msk                   /*!< OverfloW Interrupt Enable */\r
+\r
+/*******************  Bit definition for RTC_CRL register  ********************/\r
+#define RTC_CRL_SECF_Pos                    (0U)                               \r
+#define RTC_CRL_SECF_Msk                    (0x1UL << RTC_CRL_SECF_Pos)         /*!< 0x00000001 */\r
+#define RTC_CRL_SECF                        RTC_CRL_SECF_Msk                   /*!< Second Flag */\r
+#define RTC_CRL_ALRF_Pos                    (1U)                               \r
+#define RTC_CRL_ALRF_Msk                    (0x1UL << RTC_CRL_ALRF_Pos)         /*!< 0x00000002 */\r
+#define RTC_CRL_ALRF                        RTC_CRL_ALRF_Msk                   /*!< Alarm Flag */\r
+#define RTC_CRL_OWF_Pos                     (2U)                               \r
+#define RTC_CRL_OWF_Msk                     (0x1UL << RTC_CRL_OWF_Pos)          /*!< 0x00000004 */\r
+#define RTC_CRL_OWF                         RTC_CRL_OWF_Msk                    /*!< OverfloW Flag */\r
+#define RTC_CRL_RSF_Pos                     (3U)                               \r
+#define RTC_CRL_RSF_Msk                     (0x1UL << RTC_CRL_RSF_Pos)          /*!< 0x00000008 */\r
+#define RTC_CRL_RSF                         RTC_CRL_RSF_Msk                    /*!< Registers Synchronized Flag */\r
+#define RTC_CRL_CNF_Pos                     (4U)                               \r
+#define RTC_CRL_CNF_Msk                     (0x1UL << RTC_CRL_CNF_Pos)          /*!< 0x00000010 */\r
+#define RTC_CRL_CNF                         RTC_CRL_CNF_Msk                    /*!< Configuration Flag */\r
+#define RTC_CRL_RTOFF_Pos                   (5U)                               \r
+#define RTC_CRL_RTOFF_Msk                   (0x1UL << RTC_CRL_RTOFF_Pos)        /*!< 0x00000020 */\r
+#define RTC_CRL_RTOFF                       RTC_CRL_RTOFF_Msk                  /*!< RTC operation OFF */\r
+\r
+/*******************  Bit definition for RTC_PRLH register  *******************/\r
+#define RTC_PRLH_PRL_Pos                    (0U)                               \r
+#define RTC_PRLH_PRL_Msk                    (0xFUL << RTC_PRLH_PRL_Pos)         /*!< 0x0000000F */\r
+#define RTC_PRLH_PRL                        RTC_PRLH_PRL_Msk                   /*!< RTC Prescaler Reload Value High */\r
+\r
+/*******************  Bit definition for RTC_PRLL register  *******************/\r
+#define RTC_PRLL_PRL_Pos                    (0U)                               \r
+#define RTC_PRLL_PRL_Msk                    (0xFFFFUL << RTC_PRLL_PRL_Pos)      /*!< 0x0000FFFF */\r
+#define RTC_PRLL_PRL                        RTC_PRLL_PRL_Msk                   /*!< RTC Prescaler Reload Value Low */\r
+\r
+/*******************  Bit definition for RTC_DIVH register  *******************/\r
+#define RTC_DIVH_RTC_DIV_Pos                (0U)                               \r
+#define RTC_DIVH_RTC_DIV_Msk                (0xFUL << RTC_DIVH_RTC_DIV_Pos)     /*!< 0x0000000F */\r
+#define RTC_DIVH_RTC_DIV                    RTC_DIVH_RTC_DIV_Msk               /*!< RTC Clock Divider High */\r
+\r
+/*******************  Bit definition for RTC_DIVL register  *******************/\r
+#define RTC_DIVL_RTC_DIV_Pos                (0U)                               \r
+#define RTC_DIVL_RTC_DIV_Msk                (0xFFFFUL << RTC_DIVL_RTC_DIV_Pos)  /*!< 0x0000FFFF */\r
+#define RTC_DIVL_RTC_DIV                    RTC_DIVL_RTC_DIV_Msk               /*!< RTC Clock Divider Low */\r
+\r
+/*******************  Bit definition for RTC_CNTH register  *******************/\r
+#define RTC_CNTH_RTC_CNT_Pos                (0U)                               \r
+#define RTC_CNTH_RTC_CNT_Msk                (0xFFFFUL << RTC_CNTH_RTC_CNT_Pos)  /*!< 0x0000FFFF */\r
+#define RTC_CNTH_RTC_CNT                    RTC_CNTH_RTC_CNT_Msk               /*!< RTC Counter High */\r
+\r
+/*******************  Bit definition for RTC_CNTL register  *******************/\r
+#define RTC_CNTL_RTC_CNT_Pos                (0U)                               \r
+#define RTC_CNTL_RTC_CNT_Msk                (0xFFFFUL << RTC_CNTL_RTC_CNT_Pos)  /*!< 0x0000FFFF */\r
+#define RTC_CNTL_RTC_CNT                    RTC_CNTL_RTC_CNT_Msk               /*!< RTC Counter Low */\r
+\r
+/*******************  Bit definition for RTC_ALRH register  *******************/\r
+#define RTC_ALRH_RTC_ALR_Pos                (0U)                               \r
+#define RTC_ALRH_RTC_ALR_Msk                (0xFFFFUL << RTC_ALRH_RTC_ALR_Pos)  /*!< 0x0000FFFF */\r
+#define RTC_ALRH_RTC_ALR                    RTC_ALRH_RTC_ALR_Msk               /*!< RTC Alarm High */\r
+\r
+/*******************  Bit definition for RTC_ALRL register  *******************/\r
+#define RTC_ALRL_RTC_ALR_Pos                (0U)                               \r
+#define RTC_ALRL_RTC_ALR_Msk                (0xFFFFUL << RTC_ALRL_RTC_ALR_Pos)  /*!< 0x0000FFFF */\r
+#define RTC_ALRL_RTC_ALR                    RTC_ALRL_RTC_ALR_Msk               /*!< RTC Alarm Low */\r
+\r
+/******************************************************************************/\r
+/*                                                                            */\r
+/*                        Independent WATCHDOG (IWDG)                         */\r
+/*                                                                            */\r
+/******************************************************************************/\r
+\r
+/*******************  Bit definition for IWDG_KR register  ********************/\r
+#define IWDG_KR_KEY_Pos                     (0U)                               \r
+#define IWDG_KR_KEY_Msk                     (0xFFFFUL << IWDG_KR_KEY_Pos)       /*!< 0x0000FFFF */\r
+#define IWDG_KR_KEY                         IWDG_KR_KEY_Msk                    /*!< Key value (write only, read 0000h) */\r
+\r
+/*******************  Bit definition for IWDG_PR register  ********************/\r
+#define IWDG_PR_PR_Pos                      (0U)                               \r
+#define IWDG_PR_PR_Msk                      (0x7UL << IWDG_PR_PR_Pos)           /*!< 0x00000007 */\r
+#define IWDG_PR_PR                          IWDG_PR_PR_Msk                     /*!< PR[2:0] (Prescaler divider) */\r
+#define IWDG_PR_PR_0                        (0x1UL << IWDG_PR_PR_Pos)           /*!< 0x00000001 */\r
+#define IWDG_PR_PR_1                        (0x2UL << IWDG_PR_PR_Pos)           /*!< 0x00000002 */\r
+#define IWDG_PR_PR_2                        (0x4UL << IWDG_PR_PR_Pos)           /*!< 0x00000004 */\r
+\r
+/*******************  Bit definition for IWDG_RLR register  *******************/\r
+#define IWDG_RLR_RL_Pos                     (0U)                               \r
+#define IWDG_RLR_RL_Msk                     (0xFFFUL << IWDG_RLR_RL_Pos)        /*!< 0x00000FFF */\r
+#define IWDG_RLR_RL                         IWDG_RLR_RL_Msk                    /*!< Watchdog counter reload value */\r
+\r
+/*******************  Bit definition for IWDG_SR register  ********************/\r
+#define IWDG_SR_PVU_Pos                     (0U)                               \r
+#define IWDG_SR_PVU_Msk                     (0x1UL << IWDG_SR_PVU_Pos)          /*!< 0x00000001 */\r
+#define IWDG_SR_PVU                         IWDG_SR_PVU_Msk                    /*!< Watchdog prescaler value update */\r
+#define IWDG_SR_RVU_Pos                     (1U)                               \r
+#define IWDG_SR_RVU_Msk                     (0x1UL << IWDG_SR_RVU_Pos)          /*!< 0x00000002 */\r
+#define IWDG_SR_RVU                         IWDG_SR_RVU_Msk                    /*!< Watchdog counter reload value update */\r
+\r
+/******************************************************************************/\r
+/*                                                                            */\r
+/*                         Window WATCHDOG (WWDG)                             */\r
+/*                                                                            */\r
+/******************************************************************************/\r
+\r
+/*******************  Bit definition for WWDG_CR register  ********************/\r
+#define WWDG_CR_T_Pos                       (0U)                               \r
+#define WWDG_CR_T_Msk                       (0x7FUL << WWDG_CR_T_Pos)           /*!< 0x0000007F */\r
+#define WWDG_CR_T                           WWDG_CR_T_Msk                      /*!< T[6:0] bits (7-Bit counter (MSB to LSB)) */\r
+#define WWDG_CR_T_0                         (0x01UL << WWDG_CR_T_Pos)           /*!< 0x00000001 */\r
+#define WWDG_CR_T_1                         (0x02UL << WWDG_CR_T_Pos)           /*!< 0x00000002 */\r
+#define WWDG_CR_T_2                         (0x04UL << WWDG_CR_T_Pos)           /*!< 0x00000004 */\r
+#define WWDG_CR_T_3                         (0x08UL << WWDG_CR_T_Pos)           /*!< 0x00000008 */\r
+#define WWDG_CR_T_4                         (0x10UL << WWDG_CR_T_Pos)           /*!< 0x00000010 */\r
+#define WWDG_CR_T_5                         (0x20UL << WWDG_CR_T_Pos)           /*!< 0x00000020 */\r
+#define WWDG_CR_T_6                         (0x40UL << WWDG_CR_T_Pos)           /*!< 0x00000040 */\r
+\r
+/* Legacy defines */\r
+#define  WWDG_CR_T0 WWDG_CR_T_0\r
+#define  WWDG_CR_T1 WWDG_CR_T_1\r
+#define  WWDG_CR_T2 WWDG_CR_T_2\r
+#define  WWDG_CR_T3 WWDG_CR_T_3\r
+#define  WWDG_CR_T4 WWDG_CR_T_4\r
+#define  WWDG_CR_T5 WWDG_CR_T_5\r
+#define  WWDG_CR_T6 WWDG_CR_T_6\r
+\r
+#define WWDG_CR_WDGA_Pos                    (7U)                               \r
+#define WWDG_CR_WDGA_Msk                    (0x1UL << WWDG_CR_WDGA_Pos)         /*!< 0x00000080 */\r
+#define WWDG_CR_WDGA                        WWDG_CR_WDGA_Msk                   /*!< Activation bit */\r
+\r
+/*******************  Bit definition for WWDG_CFR register  *******************/\r
+#define WWDG_CFR_W_Pos                      (0U)                               \r
+#define WWDG_CFR_W_Msk                      (0x7FUL << WWDG_CFR_W_Pos)          /*!< 0x0000007F */\r
+#define WWDG_CFR_W                          WWDG_CFR_W_Msk                     /*!< W[6:0] bits (7-bit window value) */\r
+#define WWDG_CFR_W_0                        (0x01UL << WWDG_CFR_W_Pos)          /*!< 0x00000001 */\r
+#define WWDG_CFR_W_1                        (0x02UL << WWDG_CFR_W_Pos)          /*!< 0x00000002 */\r
+#define WWDG_CFR_W_2                        (0x04UL << WWDG_CFR_W_Pos)          /*!< 0x00000004 */\r
+#define WWDG_CFR_W_3                        (0x08UL << WWDG_CFR_W_Pos)          /*!< 0x00000008 */\r
+#define WWDG_CFR_W_4                        (0x10UL << WWDG_CFR_W_Pos)          /*!< 0x00000010 */\r
+#define WWDG_CFR_W_5                        (0x20UL << WWDG_CFR_W_Pos)          /*!< 0x00000020 */\r
+#define WWDG_CFR_W_6                        (0x40UL << WWDG_CFR_W_Pos)          /*!< 0x00000040 */\r
+\r
+/* Legacy defines */\r
+#define  WWDG_CFR_W0 WWDG_CFR_W_0\r
+#define  WWDG_CFR_W1 WWDG_CFR_W_1\r
+#define  WWDG_CFR_W2 WWDG_CFR_W_2\r
+#define  WWDG_CFR_W3 WWDG_CFR_W_3\r
+#define  WWDG_CFR_W4 WWDG_CFR_W_4\r
+#define  WWDG_CFR_W5 WWDG_CFR_W_5\r
+#define  WWDG_CFR_W6 WWDG_CFR_W_6\r
+\r
+#define WWDG_CFR_WDGTB_Pos                  (7U)                               \r
+#define WWDG_CFR_WDGTB_Msk                  (0x3UL << WWDG_CFR_WDGTB_Pos)       /*!< 0x00000180 */\r
+#define WWDG_CFR_WDGTB                      WWDG_CFR_WDGTB_Msk                 /*!< WDGTB[1:0] bits (Timer Base) */\r
+#define WWDG_CFR_WDGTB_0                    (0x1UL << WWDG_CFR_WDGTB_Pos)       /*!< 0x00000080 */\r
+#define WWDG_CFR_WDGTB_1                    (0x2UL << WWDG_CFR_WDGTB_Pos)       /*!< 0x00000100 */\r
+\r
+/* Legacy defines */\r
+#define  WWDG_CFR_WDGTB0 WWDG_CFR_WDGTB_0\r
+#define  WWDG_CFR_WDGTB1 WWDG_CFR_WDGTB_1\r
+\r
+#define WWDG_CFR_EWI_Pos                    (9U)                               \r
+#define WWDG_CFR_EWI_Msk                    (0x1UL << WWDG_CFR_EWI_Pos)         /*!< 0x00000200 */\r
+#define WWDG_CFR_EWI                        WWDG_CFR_EWI_Msk                   /*!< Early Wakeup Interrupt */\r
+\r
+/*******************  Bit definition for WWDG_SR register  ********************/\r
+#define WWDG_SR_EWIF_Pos                    (0U)                               \r
+#define WWDG_SR_EWIF_Msk                    (0x1UL << WWDG_SR_EWIF_Pos)         /*!< 0x00000001 */\r
+#define WWDG_SR_EWIF                        WWDG_SR_EWIF_Msk                   /*!< Early Wakeup Interrupt Flag */\r
+\r
+/******************************************************************************/\r
+/*                                                                            */\r
+/*                                   USB Device FS                            */\r
+/*                                                                            */\r
+/******************************************************************************/\r
+\r
+/*!< Endpoint-specific registers */\r
+#define  USB_EP0R                            USB_BASE                      /*!< Endpoint 0 register address */\r
+#define  USB_EP1R                            (USB_BASE + 0x00000004)       /*!< Endpoint 1 register address */\r
+#define  USB_EP2R                            (USB_BASE + 0x00000008)       /*!< Endpoint 2 register address */\r
+#define  USB_EP3R                            (USB_BASE + 0x0000000C)       /*!< Endpoint 3 register address */\r
+#define  USB_EP4R                            (USB_BASE + 0x00000010)       /*!< Endpoint 4 register address */\r
+#define  USB_EP5R                            (USB_BASE + 0x00000014)       /*!< Endpoint 5 register address */\r
+#define  USB_EP6R                            (USB_BASE + 0x00000018)       /*!< Endpoint 6 register address */\r
+#define  USB_EP7R                            (USB_BASE + 0x0000001C)       /*!< Endpoint 7 register address */\r
+\r
+/* bit positions */ \r
+#define USB_EP_CTR_RX_Pos                       (15U)                          \r
+#define USB_EP_CTR_RX_Msk                       (0x1UL << USB_EP_CTR_RX_Pos)    /*!< 0x00008000 */\r
+#define USB_EP_CTR_RX                           USB_EP_CTR_RX_Msk              /*!< EndPoint Correct TRansfer RX */\r
+#define USB_EP_DTOG_RX_Pos                      (14U)                          \r
+#define USB_EP_DTOG_RX_Msk                      (0x1UL << USB_EP_DTOG_RX_Pos)   /*!< 0x00004000 */\r
+#define USB_EP_DTOG_RX                          USB_EP_DTOG_RX_Msk             /*!< EndPoint Data TOGGLE RX */\r
+#define USB_EPRX_STAT_Pos                       (12U)                          \r
+#define USB_EPRX_STAT_Msk                       (0x3UL << USB_EPRX_STAT_Pos)    /*!< 0x00003000 */\r
+#define USB_EPRX_STAT                           USB_EPRX_STAT_Msk              /*!< EndPoint RX STATus bit field */\r
+#define USB_EP_SETUP_Pos                        (11U)                          \r
+#define USB_EP_SETUP_Msk                        (0x1UL << USB_EP_SETUP_Pos)     /*!< 0x00000800 */\r
+#define USB_EP_SETUP                            USB_EP_SETUP_Msk               /*!< EndPoint SETUP */\r
+#define USB_EP_T_FIELD_Pos                      (9U)                           \r
+#define USB_EP_T_FIELD_Msk                      (0x3UL << USB_EP_T_FIELD_Pos)   /*!< 0x00000600 */\r
+#define USB_EP_T_FIELD                          USB_EP_T_FIELD_Msk             /*!< EndPoint TYPE */\r
+#define USB_EP_KIND_Pos                         (8U)                           \r
+#define USB_EP_KIND_Msk                         (0x1UL << USB_EP_KIND_Pos)      /*!< 0x00000100 */\r
+#define USB_EP_KIND                             USB_EP_KIND_Msk                /*!< EndPoint KIND */\r
+#define USB_EP_CTR_TX_Pos                       (7U)                           \r
+#define USB_EP_CTR_TX_Msk                       (0x1UL << USB_EP_CTR_TX_Pos)    /*!< 0x00000080 */\r
+#define USB_EP_CTR_TX                           USB_EP_CTR_TX_Msk              /*!< EndPoint Correct TRansfer TX */\r
+#define USB_EP_DTOG_TX_Pos                      (6U)                           \r
+#define USB_EP_DTOG_TX_Msk                      (0x1UL << USB_EP_DTOG_TX_Pos)   /*!< 0x00000040 */\r
+#define USB_EP_DTOG_TX                          USB_EP_DTOG_TX_Msk             /*!< EndPoint Data TOGGLE TX */\r
+#define USB_EPTX_STAT_Pos                       (4U)                           \r
+#define USB_EPTX_STAT_Msk                       (0x3UL << USB_EPTX_STAT_Pos)    /*!< 0x00000030 */\r
+#define USB_EPTX_STAT                           USB_EPTX_STAT_Msk              /*!< EndPoint TX STATus bit field */\r
+#define USB_EPADDR_FIELD_Pos                    (0U)                           \r
+#define USB_EPADDR_FIELD_Msk                    (0xFUL << USB_EPADDR_FIELD_Pos) /*!< 0x0000000F */\r
+#define USB_EPADDR_FIELD                        USB_EPADDR_FIELD_Msk           /*!< EndPoint ADDRess FIELD */\r
+\r
+/* EndPoint REGister MASK (no toggle fields) */\r
+#define  USB_EPREG_MASK                      (USB_EP_CTR_RX|USB_EP_SETUP|USB_EP_T_FIELD|USB_EP_KIND|USB_EP_CTR_TX|USB_EPADDR_FIELD)\r
+                                                                           /*!< EP_TYPE[1:0] EndPoint TYPE */\r
+#define USB_EP_TYPE_MASK_Pos                    (9U)                           \r
+#define USB_EP_TYPE_MASK_Msk                    (0x3UL << USB_EP_TYPE_MASK_Pos) /*!< 0x00000600 */\r
+#define USB_EP_TYPE_MASK                        USB_EP_TYPE_MASK_Msk           /*!< EndPoint TYPE Mask */\r
+#define USB_EP_BULK                             0x00000000U                    /*!< EndPoint BULK */\r
+#define USB_EP_CONTROL                          0x00000200U                    /*!< EndPoint CONTROL */\r
+#define USB_EP_ISOCHRONOUS                      0x00000400U                    /*!< EndPoint ISOCHRONOUS */\r
+#define USB_EP_INTERRUPT                        0x00000600U                    /*!< EndPoint INTERRUPT */\r
+#define  USB_EP_T_MASK                          (~USB_EP_T_FIELD & USB_EPREG_MASK)\r
+\r
+#define  USB_EPKIND_MASK                        (~USB_EP_KIND & USB_EPREG_MASK)  /*!< EP_KIND EndPoint KIND */\r
+                                                                               /*!< STAT_TX[1:0] STATus for TX transfer */\r
+#define USB_EP_TX_DIS                           0x00000000U                    /*!< EndPoint TX DISabled */\r
+#define USB_EP_TX_STALL                         0x00000010U                    /*!< EndPoint TX STALLed */\r
+#define USB_EP_TX_NAK                           0x00000020U                    /*!< EndPoint TX NAKed */\r
+#define USB_EP_TX_VALID                         0x00000030U                    /*!< EndPoint TX VALID */\r
+#define USB_EPTX_DTOG1                          0x00000010U                    /*!< EndPoint TX Data TOGgle bit1 */\r
+#define USB_EPTX_DTOG2                          0x00000020U                    /*!< EndPoint TX Data TOGgle bit2 */\r
+#define  USB_EPTX_DTOGMASK  (USB_EPTX_STAT|USB_EPREG_MASK)\r
+                                                                               /*!< STAT_RX[1:0] STATus for RX transfer */\r
+#define USB_EP_RX_DIS                           0x00000000U                    /*!< EndPoint RX DISabled */\r
+#define USB_EP_RX_STALL                         0x00001000U                    /*!< EndPoint RX STALLed */\r
+#define USB_EP_RX_NAK                           0x00002000U                    /*!< EndPoint RX NAKed */\r
+#define USB_EP_RX_VALID                         0x00003000U                    /*!< EndPoint RX VALID */\r
+#define USB_EPRX_DTOG1                          0x00001000U                    /*!< EndPoint RX Data TOGgle bit1 */\r
+#define USB_EPRX_DTOG2                          0x00002000U                    /*!< EndPoint RX Data TOGgle bit1 */\r
+#define  USB_EPRX_DTOGMASK  (USB_EPRX_STAT|USB_EPREG_MASK)\r
+\r
+/*******************  Bit definition for USB_EP0R register  *******************/\r
+#define USB_EP0R_EA_Pos                         (0U)                           \r
+#define USB_EP0R_EA_Msk                         (0xFUL << USB_EP0R_EA_Pos)      /*!< 0x0000000F */\r
+#define USB_EP0R_EA                             USB_EP0R_EA_Msk                /*!< Endpoint Address */\r
+\r
+#define USB_EP0R_STAT_TX_Pos                    (4U)                           \r
+#define USB_EP0R_STAT_TX_Msk                    (0x3UL << USB_EP0R_STAT_TX_Pos) /*!< 0x00000030 */\r
+#define USB_EP0R_STAT_TX                        USB_EP0R_STAT_TX_Msk           /*!< STAT_TX[1:0] bits (Status bits, for transmission transfers) */\r
+#define USB_EP0R_STAT_TX_0                      (0x1UL << USB_EP0R_STAT_TX_Pos) /*!< 0x00000010 */\r
+#define USB_EP0R_STAT_TX_1                      (0x2UL << USB_EP0R_STAT_TX_Pos) /*!< 0x00000020 */\r
+\r
+#define USB_EP0R_DTOG_TX_Pos                    (6U)                           \r
+#define USB_EP0R_DTOG_TX_Msk                    (0x1UL << USB_EP0R_DTOG_TX_Pos) /*!< 0x00000040 */\r
+#define USB_EP0R_DTOG_TX                        USB_EP0R_DTOG_TX_Msk           /*!< Data Toggle, for transmission transfers */\r
+#define USB_EP0R_CTR_TX_Pos                     (7U)                           \r
+#define USB_EP0R_CTR_TX_Msk                     (0x1UL << USB_EP0R_CTR_TX_Pos)  /*!< 0x00000080 */\r
+#define USB_EP0R_CTR_TX                         USB_EP0R_CTR_TX_Msk            /*!< Correct Transfer for transmission */\r
+#define USB_EP0R_EP_KIND_Pos                    (8U)                           \r
+#define USB_EP0R_EP_KIND_Msk                    (0x1UL << USB_EP0R_EP_KIND_Pos) /*!< 0x00000100 */\r
+#define USB_EP0R_EP_KIND                        USB_EP0R_EP_KIND_Msk           /*!< Endpoint Kind */\r
+                                                                           \r
+#define USB_EP0R_EP_TYPE_Pos                    (9U)                           \r
+#define USB_EP0R_EP_TYPE_Msk                    (0x3UL << USB_EP0R_EP_TYPE_Pos) /*!< 0x00000600 */\r
+#define USB_EP0R_EP_TYPE                        USB_EP0R_EP_TYPE_Msk           /*!< EP_TYPE[1:0] bits (Endpoint type) */\r
+#define USB_EP0R_EP_TYPE_0                      (0x1UL << USB_EP0R_EP_TYPE_Pos) /*!< 0x00000200 */\r
+#define USB_EP0R_EP_TYPE_1                      (0x2UL << USB_EP0R_EP_TYPE_Pos) /*!< 0x00000400 */\r
+\r
+#define USB_EP0R_SETUP_Pos                      (11U)                          \r
+#define USB_EP0R_SETUP_Msk                      (0x1UL << USB_EP0R_SETUP_Pos)   /*!< 0x00000800 */\r
+#define USB_EP0R_SETUP                          USB_EP0R_SETUP_Msk             /*!< Setup transaction completed */\r
+\r
+#define USB_EP0R_STAT_RX_Pos                    (12U)                          \r
+#define USB_EP0R_STAT_RX_Msk                    (0x3UL << USB_EP0R_STAT_RX_Pos) /*!< 0x00003000 */\r
+#define USB_EP0R_STAT_RX                        USB_EP0R_STAT_RX_Msk           /*!< STAT_RX[1:0] bits (Status bits, for reception transfers) */\r
+#define USB_EP0R_STAT_RX_0                      (0x1UL << USB_EP0R_STAT_RX_Pos) /*!< 0x00001000 */\r
+#define USB_EP0R_STAT_RX_1                      (0x2UL << USB_EP0R_STAT_RX_Pos) /*!< 0x00002000 */\r
+\r
+#define USB_EP0R_DTOG_RX_Pos                    (14U)                          \r
+#define USB_EP0R_DTOG_RX_Msk                    (0x1UL << USB_EP0R_DTOG_RX_Pos) /*!< 0x00004000 */\r
+#define USB_EP0R_DTOG_RX                        USB_EP0R_DTOG_RX_Msk           /*!< Data Toggle, for reception transfers */\r
+#define USB_EP0R_CTR_RX_Pos                     (15U)                          \r
+#define USB_EP0R_CTR_RX_Msk                     (0x1UL << USB_EP0R_CTR_RX_Pos)  /*!< 0x00008000 */\r
+#define USB_EP0R_CTR_RX                         USB_EP0R_CTR_RX_Msk            /*!< Correct Transfer for reception */\r
+\r
+/*******************  Bit definition for USB_EP1R register  *******************/\r
+#define USB_EP1R_EA_Pos                         (0U)                           \r
+#define USB_EP1R_EA_Msk                         (0xFUL << USB_EP1R_EA_Pos)      /*!< 0x0000000F */\r
+#define USB_EP1R_EA                             USB_EP1R_EA_Msk                /*!< Endpoint Address */\r
+                                                                          \r
+#define USB_EP1R_STAT_TX_Pos                    (4U)                           \r
+#define USB_EP1R_STAT_TX_Msk                    (0x3UL << USB_EP1R_STAT_TX_Pos) /*!< 0x00000030 */\r
+#define USB_EP1R_STAT_TX                        USB_EP1R_STAT_TX_Msk           /*!< STAT_TX[1:0] bits (Status bits, for transmission transfers) */\r
+#define USB_EP1R_STAT_TX_0                      (0x1UL << USB_EP1R_STAT_TX_Pos) /*!< 0x00000010 */\r
+#define USB_EP1R_STAT_TX_1                      (0x2UL << USB_EP1R_STAT_TX_Pos) /*!< 0x00000020 */\r
+\r
+#define USB_EP1R_DTOG_TX_Pos                    (6U)                           \r
+#define USB_EP1R_DTOG_TX_Msk                    (0x1UL << USB_EP1R_DTOG_TX_Pos) /*!< 0x00000040 */\r
+#define USB_EP1R_DTOG_TX                        USB_EP1R_DTOG_TX_Msk           /*!< Data Toggle, for transmission transfers */\r
+#define USB_EP1R_CTR_TX_Pos                     (7U)                           \r
+#define USB_EP1R_CTR_TX_Msk                     (0x1UL << USB_EP1R_CTR_TX_Pos)  /*!< 0x00000080 */\r
+#define USB_EP1R_CTR_TX                         USB_EP1R_CTR_TX_Msk            /*!< Correct Transfer for transmission */\r
+#define USB_EP1R_EP_KIND_Pos                    (8U)                           \r
+#define USB_EP1R_EP_KIND_Msk                    (0x1UL << USB_EP1R_EP_KIND_Pos) /*!< 0x00000100 */\r
+#define USB_EP1R_EP_KIND                        USB_EP1R_EP_KIND_Msk           /*!< Endpoint Kind */\r
+\r
+#define USB_EP1R_EP_TYPE_Pos                    (9U)                           \r
+#define USB_EP1R_EP_TYPE_Msk                    (0x3UL << USB_EP1R_EP_TYPE_Pos) /*!< 0x00000600 */\r
+#define USB_EP1R_EP_TYPE                        USB_EP1R_EP_TYPE_Msk           /*!< EP_TYPE[1:0] bits (Endpoint type) */\r
+#define USB_EP1R_EP_TYPE_0                      (0x1UL << USB_EP1R_EP_TYPE_Pos) /*!< 0x00000200 */\r
+#define USB_EP1R_EP_TYPE_1                      (0x2UL << USB_EP1R_EP_TYPE_Pos) /*!< 0x00000400 */\r
+\r
+#define USB_EP1R_SETUP_Pos                      (11U)                          \r
+#define USB_EP1R_SETUP_Msk                      (0x1UL << USB_EP1R_SETUP_Pos)   /*!< 0x00000800 */\r
+#define USB_EP1R_SETUP                          USB_EP1R_SETUP_Msk             /*!< Setup transaction completed */\r
+                                                                           \r
+#define USB_EP1R_STAT_RX_Pos                    (12U)                          \r
+#define USB_EP1R_STAT_RX_Msk                    (0x3UL << USB_EP1R_STAT_RX_Pos) /*!< 0x00003000 */\r
+#define USB_EP1R_STAT_RX                        USB_EP1R_STAT_RX_Msk           /*!< STAT_RX[1:0] bits (Status bits, for reception transfers) */\r
+#define USB_EP1R_STAT_RX_0                      (0x1UL << USB_EP1R_STAT_RX_Pos) /*!< 0x00001000 */\r
+#define USB_EP1R_STAT_RX_1                      (0x2UL << USB_EP1R_STAT_RX_Pos) /*!< 0x00002000 */\r
+\r
+#define USB_EP1R_DTOG_RX_Pos                    (14U)                          \r
+#define USB_EP1R_DTOG_RX_Msk                    (0x1UL << USB_EP1R_DTOG_RX_Pos) /*!< 0x00004000 */\r
+#define USB_EP1R_DTOG_RX                        USB_EP1R_DTOG_RX_Msk           /*!< Data Toggle, for reception transfers */\r
+#define USB_EP1R_CTR_RX_Pos                     (15U)                          \r
+#define USB_EP1R_CTR_RX_Msk                     (0x1UL << USB_EP1R_CTR_RX_Pos)  /*!< 0x00008000 */\r
+#define USB_EP1R_CTR_RX                         USB_EP1R_CTR_RX_Msk            /*!< Correct Transfer for reception */\r
+\r
+/*******************  Bit definition for USB_EP2R register  *******************/\r
+#define USB_EP2R_EA_Pos                         (0U)                           \r
+#define USB_EP2R_EA_Msk                         (0xFUL << USB_EP2R_EA_Pos)      /*!< 0x0000000F */\r
+#define USB_EP2R_EA                             USB_EP2R_EA_Msk                /*!< Endpoint Address */\r
+\r
+#define USB_EP2R_STAT_TX_Pos                    (4U)                           \r
+#define USB_EP2R_STAT_TX_Msk                    (0x3UL << USB_EP2R_STAT_TX_Pos) /*!< 0x00000030 */\r
+#define USB_EP2R_STAT_TX                        USB_EP2R_STAT_TX_Msk           /*!< STAT_TX[1:0] bits (Status bits, for transmission transfers) */\r
+#define USB_EP2R_STAT_TX_0                      (0x1UL << USB_EP2R_STAT_TX_Pos) /*!< 0x00000010 */\r
+#define USB_EP2R_STAT_TX_1                      (0x2UL << USB_EP2R_STAT_TX_Pos) /*!< 0x00000020 */\r
+\r
+#define USB_EP2R_DTOG_TX_Pos                    (6U)                           \r
+#define USB_EP2R_DTOG_TX_Msk                    (0x1UL << USB_EP2R_DTOG_TX_Pos) /*!< 0x00000040 */\r
+#define USB_EP2R_DTOG_TX                        USB_EP2R_DTOG_TX_Msk           /*!< Data Toggle, for transmission transfers */\r
+#define USB_EP2R_CTR_TX_Pos                     (7U)                           \r
+#define USB_EP2R_CTR_TX_Msk                     (0x1UL << USB_EP2R_CTR_TX_Pos)  /*!< 0x00000080 */\r
+#define USB_EP2R_CTR_TX                         USB_EP2R_CTR_TX_Msk            /*!< Correct Transfer for transmission */\r
+#define USB_EP2R_EP_KIND_Pos                    (8U)                           \r
+#define USB_EP2R_EP_KIND_Msk                    (0x1UL << USB_EP2R_EP_KIND_Pos) /*!< 0x00000100 */\r
+#define USB_EP2R_EP_KIND                        USB_EP2R_EP_KIND_Msk           /*!< Endpoint Kind */\r
+\r
+#define USB_EP2R_EP_TYPE_Pos                    (9U)                           \r
+#define USB_EP2R_EP_TYPE_Msk                    (0x3UL << USB_EP2R_EP_TYPE_Pos) /*!< 0x00000600 */\r
+#define USB_EP2R_EP_TYPE                        USB_EP2R_EP_TYPE_Msk           /*!< EP_TYPE[1:0] bits (Endpoint type) */\r
+#define USB_EP2R_EP_TYPE_0                      (0x1UL << USB_EP2R_EP_TYPE_Pos) /*!< 0x00000200 */\r
+#define USB_EP2R_EP_TYPE_1                      (0x2UL << USB_EP2R_EP_TYPE_Pos) /*!< 0x00000400 */\r
+\r
+#define USB_EP2R_SETUP_Pos                      (11U)                          \r
+#define USB_EP2R_SETUP_Msk                      (0x1UL << USB_EP2R_SETUP_Pos)   /*!< 0x00000800 */\r
+#define USB_EP2R_SETUP                          USB_EP2R_SETUP_Msk             /*!< Setup transaction completed */\r
+\r
+#define USB_EP2R_STAT_RX_Pos                    (12U)                          \r
+#define USB_EP2R_STAT_RX_Msk                    (0x3UL << USB_EP2R_STAT_RX_Pos) /*!< 0x00003000 */\r
+#define USB_EP2R_STAT_RX                        USB_EP2R_STAT_RX_Msk           /*!< STAT_RX[1:0] bits (Status bits, for reception transfers) */\r
+#define USB_EP2R_STAT_RX_0                      (0x1UL << USB_EP2R_STAT_RX_Pos) /*!< 0x00001000 */\r
+#define USB_EP2R_STAT_RX_1                      (0x2UL << USB_EP2R_STAT_RX_Pos) /*!< 0x00002000 */\r
+\r
+#define USB_EP2R_DTOG_RX_Pos                    (14U)                          \r
+#define USB_EP2R_DTOG_RX_Msk                    (0x1UL << USB_EP2R_DTOG_RX_Pos) /*!< 0x00004000 */\r
+#define USB_EP2R_DTOG_RX                        USB_EP2R_DTOG_RX_Msk           /*!< Data Toggle, for reception transfers */\r
+#define USB_EP2R_CTR_RX_Pos                     (15U)                          \r
+#define USB_EP2R_CTR_RX_Msk                     (0x1UL << USB_EP2R_CTR_RX_Pos)  /*!< 0x00008000 */\r
+#define USB_EP2R_CTR_RX                         USB_EP2R_CTR_RX_Msk            /*!< Correct Transfer for reception */\r
+\r
+/*******************  Bit definition for USB_EP3R register  *******************/\r
+#define USB_EP3R_EA_Pos                         (0U)                           \r
+#define USB_EP3R_EA_Msk                         (0xFUL << USB_EP3R_EA_Pos)      /*!< 0x0000000F */\r
+#define USB_EP3R_EA                             USB_EP3R_EA_Msk                /*!< Endpoint Address */\r
+\r
+#define USB_EP3R_STAT_TX_Pos                    (4U)                           \r
+#define USB_EP3R_STAT_TX_Msk                    (0x3UL << USB_EP3R_STAT_TX_Pos) /*!< 0x00000030 */\r
+#define USB_EP3R_STAT_TX                        USB_EP3R_STAT_TX_Msk           /*!< STAT_TX[1:0] bits (Status bits, for transmission transfers) */\r
+#define USB_EP3R_STAT_TX_0                      (0x1UL << USB_EP3R_STAT_TX_Pos) /*!< 0x00000010 */\r
+#define USB_EP3R_STAT_TX_1                      (0x2UL << USB_EP3R_STAT_TX_Pos) /*!< 0x00000020 */\r
+\r
+#define USB_EP3R_DTOG_TX_Pos                    (6U)                           \r
+#define USB_EP3R_DTOG_TX_Msk                    (0x1UL << USB_EP3R_DTOG_TX_Pos) /*!< 0x00000040 */\r
+#define USB_EP3R_DTOG_TX                        USB_EP3R_DTOG_TX_Msk           /*!< Data Toggle, for transmission transfers */\r
+#define USB_EP3R_CTR_TX_Pos                     (7U)                           \r
+#define USB_EP3R_CTR_TX_Msk                     (0x1UL << USB_EP3R_CTR_TX_Pos)  /*!< 0x00000080 */\r
+#define USB_EP3R_CTR_TX                         USB_EP3R_CTR_TX_Msk            /*!< Correct Transfer for transmission */\r
+#define USB_EP3R_EP_KIND_Pos                    (8U)                           \r
+#define USB_EP3R_EP_KIND_Msk                    (0x1UL << USB_EP3R_EP_KIND_Pos) /*!< 0x00000100 */\r
+#define USB_EP3R_EP_KIND                        USB_EP3R_EP_KIND_Msk           /*!< Endpoint Kind */\r
+\r
+#define USB_EP3R_EP_TYPE_Pos                    (9U)                           \r
+#define USB_EP3R_EP_TYPE_Msk                    (0x3UL << USB_EP3R_EP_TYPE_Pos) /*!< 0x00000600 */\r
+#define USB_EP3R_EP_TYPE                        USB_EP3R_EP_TYPE_Msk           /*!< EP_TYPE[1:0] bits (Endpoint type) */\r
+#define USB_EP3R_EP_TYPE_0                      (0x1UL << USB_EP3R_EP_TYPE_Pos) /*!< 0x00000200 */\r
+#define USB_EP3R_EP_TYPE_1                      (0x2UL << USB_EP3R_EP_TYPE_Pos) /*!< 0x00000400 */\r
+\r
+#define USB_EP3R_SETUP_Pos                      (11U)                          \r
+#define USB_EP3R_SETUP_Msk                      (0x1UL << USB_EP3R_SETUP_Pos)   /*!< 0x00000800 */\r
+#define USB_EP3R_SETUP                          USB_EP3R_SETUP_Msk             /*!< Setup transaction completed */\r
+\r
+#define USB_EP3R_STAT_RX_Pos                    (12U)                          \r
+#define USB_EP3R_STAT_RX_Msk                    (0x3UL << USB_EP3R_STAT_RX_Pos) /*!< 0x00003000 */\r
+#define USB_EP3R_STAT_RX                        USB_EP3R_STAT_RX_Msk           /*!< STAT_RX[1:0] bits (Status bits, for reception transfers) */\r
+#define USB_EP3R_STAT_RX_0                      (0x1UL << USB_EP3R_STAT_RX_Pos) /*!< 0x00001000 */\r
+#define USB_EP3R_STAT_RX_1                      (0x2UL << USB_EP3R_STAT_RX_Pos) /*!< 0x00002000 */\r
+\r
+#define USB_EP3R_DTOG_RX_Pos                    (14U)                          \r
+#define USB_EP3R_DTOG_RX_Msk                    (0x1UL << USB_EP3R_DTOG_RX_Pos) /*!< 0x00004000 */\r
+#define USB_EP3R_DTOG_RX                        USB_EP3R_DTOG_RX_Msk           /*!< Data Toggle, for reception transfers */\r
+#define USB_EP3R_CTR_RX_Pos                     (15U)                          \r
+#define USB_EP3R_CTR_RX_Msk                     (0x1UL << USB_EP3R_CTR_RX_Pos)  /*!< 0x00008000 */\r
+#define USB_EP3R_CTR_RX                         USB_EP3R_CTR_RX_Msk            /*!< Correct Transfer for reception */\r
+\r
+/*******************  Bit definition for USB_EP4R register  *******************/\r
+#define USB_EP4R_EA_Pos                         (0U)                           \r
+#define USB_EP4R_EA_Msk                         (0xFUL << USB_EP4R_EA_Pos)      /*!< 0x0000000F */\r
+#define USB_EP4R_EA                             USB_EP4R_EA_Msk                /*!< Endpoint Address */\r
+\r
+#define USB_EP4R_STAT_TX_Pos                    (4U)                           \r
+#define USB_EP4R_STAT_TX_Msk                    (0x3UL << USB_EP4R_STAT_TX_Pos) /*!< 0x00000030 */\r
+#define USB_EP4R_STAT_TX                        USB_EP4R_STAT_TX_Msk           /*!< STAT_TX[1:0] bits (Status bits, for transmission transfers) */\r
+#define USB_EP4R_STAT_TX_0                      (0x1UL << USB_EP4R_STAT_TX_Pos) /*!< 0x00000010 */\r
+#define USB_EP4R_STAT_TX_1                      (0x2UL << USB_EP4R_STAT_TX_Pos) /*!< 0x00000020 */\r
+\r
+#define USB_EP4R_DTOG_TX_Pos                    (6U)                           \r
+#define USB_EP4R_DTOG_TX_Msk                    (0x1UL << USB_EP4R_DTOG_TX_Pos) /*!< 0x00000040 */\r
+#define USB_EP4R_DTOG_TX                        USB_EP4R_DTOG_TX_Msk           /*!< Data Toggle, for transmission transfers */\r
+#define USB_EP4R_CTR_TX_Pos                     (7U)                           \r
+#define USB_EP4R_CTR_TX_Msk                     (0x1UL << USB_EP4R_CTR_TX_Pos)  /*!< 0x00000080 */\r
+#define USB_EP4R_CTR_TX                         USB_EP4R_CTR_TX_Msk            /*!< Correct Transfer for transmission */\r
+#define USB_EP4R_EP_KIND_Pos                    (8U)                           \r
+#define USB_EP4R_EP_KIND_Msk                    (0x1UL << USB_EP4R_EP_KIND_Pos) /*!< 0x00000100 */\r
+#define USB_EP4R_EP_KIND                        USB_EP4R_EP_KIND_Msk           /*!< Endpoint Kind */\r
+\r
+#define USB_EP4R_EP_TYPE_Pos                    (9U)                           \r
+#define USB_EP4R_EP_TYPE_Msk                    (0x3UL << USB_EP4R_EP_TYPE_Pos) /*!< 0x00000600 */\r
+#define USB_EP4R_EP_TYPE                        USB_EP4R_EP_TYPE_Msk           /*!< EP_TYPE[1:0] bits (Endpoint type) */\r
+#define USB_EP4R_EP_TYPE_0                      (0x1UL << USB_EP4R_EP_TYPE_Pos) /*!< 0x00000200 */\r
+#define USB_EP4R_EP_TYPE_1                      (0x2UL << USB_EP4R_EP_TYPE_Pos) /*!< 0x00000400 */\r
+\r
+#define USB_EP4R_SETUP_Pos                      (11U)                          \r
+#define USB_EP4R_SETUP_Msk                      (0x1UL << USB_EP4R_SETUP_Pos)   /*!< 0x00000800 */\r
+#define USB_EP4R_SETUP                          USB_EP4R_SETUP_Msk             /*!< Setup transaction completed */\r
+\r
+#define USB_EP4R_STAT_RX_Pos                    (12U)                          \r
+#define USB_EP4R_STAT_RX_Msk                    (0x3UL << USB_EP4R_STAT_RX_Pos) /*!< 0x00003000 */\r
+#define USB_EP4R_STAT_RX                        USB_EP4R_STAT_RX_Msk           /*!< STAT_RX[1:0] bits (Status bits, for reception transfers) */\r
+#define USB_EP4R_STAT_RX_0                      (0x1UL << USB_EP4R_STAT_RX_Pos) /*!< 0x00001000 */\r
+#define USB_EP4R_STAT_RX_1                      (0x2UL << USB_EP4R_STAT_RX_Pos) /*!< 0x00002000 */\r
+\r
+#define USB_EP4R_DTOG_RX_Pos                    (14U)                          \r
+#define USB_EP4R_DTOG_RX_Msk                    (0x1UL << USB_EP4R_DTOG_RX_Pos) /*!< 0x00004000 */\r
+#define USB_EP4R_DTOG_RX                        USB_EP4R_DTOG_RX_Msk           /*!< Data Toggle, for reception transfers */\r
+#define USB_EP4R_CTR_RX_Pos                     (15U)                          \r
+#define USB_EP4R_CTR_RX_Msk                     (0x1UL << USB_EP4R_CTR_RX_Pos)  /*!< 0x00008000 */\r
+#define USB_EP4R_CTR_RX                         USB_EP4R_CTR_RX_Msk            /*!< Correct Transfer for reception */\r
+\r
+/*******************  Bit definition for USB_EP5R register  *******************/\r
+#define USB_EP5R_EA_Pos                         (0U)                           \r
+#define USB_EP5R_EA_Msk                         (0xFUL << USB_EP5R_EA_Pos)      /*!< 0x0000000F */\r
+#define USB_EP5R_EA                             USB_EP5R_EA_Msk                /*!< Endpoint Address */\r
+\r
+#define USB_EP5R_STAT_TX_Pos                    (4U)                           \r
+#define USB_EP5R_STAT_TX_Msk                    (0x3UL << USB_EP5R_STAT_TX_Pos) /*!< 0x00000030 */\r
+#define USB_EP5R_STAT_TX                        USB_EP5R_STAT_TX_Msk           /*!< STAT_TX[1:0] bits (Status bits, for transmission transfers) */\r
+#define USB_EP5R_STAT_TX_0                      (0x1UL << USB_EP5R_STAT_TX_Pos) /*!< 0x00000010 */\r
+#define USB_EP5R_STAT_TX_1                      (0x2UL << USB_EP5R_STAT_TX_Pos) /*!< 0x00000020 */\r
+\r
+#define USB_EP5R_DTOG_TX_Pos                    (6U)                           \r
+#define USB_EP5R_DTOG_TX_Msk                    (0x1UL << USB_EP5R_DTOG_TX_Pos) /*!< 0x00000040 */\r
+#define USB_EP5R_DTOG_TX                        USB_EP5R_DTOG_TX_Msk           /*!< Data Toggle, for transmission transfers */\r
+#define USB_EP5R_CTR_TX_Pos                     (7U)                           \r
+#define USB_EP5R_CTR_TX_Msk                     (0x1UL << USB_EP5R_CTR_TX_Pos)  /*!< 0x00000080 */\r
+#define USB_EP5R_CTR_TX                         USB_EP5R_CTR_TX_Msk            /*!< Correct Transfer for transmission */\r
+#define USB_EP5R_EP_KIND_Pos                    (8U)                           \r
+#define USB_EP5R_EP_KIND_Msk                    (0x1UL << USB_EP5R_EP_KIND_Pos) /*!< 0x00000100 */\r
+#define USB_EP5R_EP_KIND                        USB_EP5R_EP_KIND_Msk           /*!< Endpoint Kind */\r
+\r
+#define USB_EP5R_EP_TYPE_Pos                    (9U)                           \r
+#define USB_EP5R_EP_TYPE_Msk                    (0x3UL << USB_EP5R_EP_TYPE_Pos) /*!< 0x00000600 */\r
+#define USB_EP5R_EP_TYPE                        USB_EP5R_EP_TYPE_Msk           /*!< EP_TYPE[1:0] bits (Endpoint type) */\r
+#define USB_EP5R_EP_TYPE_0                      (0x1UL << USB_EP5R_EP_TYPE_Pos) /*!< 0x00000200 */\r
+#define USB_EP5R_EP_TYPE_1                      (0x2UL << USB_EP5R_EP_TYPE_Pos) /*!< 0x00000400 */\r
+\r
+#define USB_EP5R_SETUP_Pos                      (11U)                          \r
+#define USB_EP5R_SETUP_Msk                      (0x1UL << USB_EP5R_SETUP_Pos)   /*!< 0x00000800 */\r
+#define USB_EP5R_SETUP                          USB_EP5R_SETUP_Msk             /*!< Setup transaction completed */\r
+\r
+#define USB_EP5R_STAT_RX_Pos                    (12U)                          \r
+#define USB_EP5R_STAT_RX_Msk                    (0x3UL << USB_EP5R_STAT_RX_Pos) /*!< 0x00003000 */\r
+#define USB_EP5R_STAT_RX                        USB_EP5R_STAT_RX_Msk           /*!< STAT_RX[1:0] bits (Status bits, for reception transfers) */\r
+#define USB_EP5R_STAT_RX_0                      (0x1UL << USB_EP5R_STAT_RX_Pos) /*!< 0x00001000 */\r
+#define USB_EP5R_STAT_RX_1                      (0x2UL << USB_EP5R_STAT_RX_Pos) /*!< 0x00002000 */\r
+\r
+#define USB_EP5R_DTOG_RX_Pos                    (14U)                          \r
+#define USB_EP5R_DTOG_RX_Msk                    (0x1UL << USB_EP5R_DTOG_RX_Pos) /*!< 0x00004000 */\r
+#define USB_EP5R_DTOG_RX                        USB_EP5R_DTOG_RX_Msk           /*!< Data Toggle, for reception transfers */\r
+#define USB_EP5R_CTR_RX_Pos                     (15U)                          \r
+#define USB_EP5R_CTR_RX_Msk                     (0x1UL << USB_EP5R_CTR_RX_Pos)  /*!< 0x00008000 */\r
+#define USB_EP5R_CTR_RX                         USB_EP5R_CTR_RX_Msk            /*!< Correct Transfer for reception */\r
+\r
+/*******************  Bit definition for USB_EP6R register  *******************/\r
+#define USB_EP6R_EA_Pos                         (0U)                           \r
+#define USB_EP6R_EA_Msk                         (0xFUL << USB_EP6R_EA_Pos)      /*!< 0x0000000F */\r
+#define USB_EP6R_EA                             USB_EP6R_EA_Msk                /*!< Endpoint Address */\r
+\r
+#define USB_EP6R_STAT_TX_Pos                    (4U)                           \r
+#define USB_EP6R_STAT_TX_Msk                    (0x3UL << USB_EP6R_STAT_TX_Pos) /*!< 0x00000030 */\r
+#define USB_EP6R_STAT_TX                        USB_EP6R_STAT_TX_Msk           /*!< STAT_TX[1:0] bits (Status bits, for transmission transfers) */\r
+#define USB_EP6R_STAT_TX_0                      (0x1UL << USB_EP6R_STAT_TX_Pos) /*!< 0x00000010 */\r
+#define USB_EP6R_STAT_TX_1                      (0x2UL << USB_EP6R_STAT_TX_Pos) /*!< 0x00000020 */\r
+\r
+#define USB_EP6R_DTOG_TX_Pos                    (6U)                           \r
+#define USB_EP6R_DTOG_TX_Msk                    (0x1UL << USB_EP6R_DTOG_TX_Pos) /*!< 0x00000040 */\r
+#define USB_EP6R_DTOG_TX                        USB_EP6R_DTOG_TX_Msk           /*!< Data Toggle, for transmission transfers */\r
+#define USB_EP6R_CTR_TX_Pos                     (7U)                           \r
+#define USB_EP6R_CTR_TX_Msk                     (0x1UL << USB_EP6R_CTR_TX_Pos)  /*!< 0x00000080 */\r
+#define USB_EP6R_CTR_TX                         USB_EP6R_CTR_TX_Msk            /*!< Correct Transfer for transmission */\r
+#define USB_EP6R_EP_KIND_Pos                    (8U)                           \r
+#define USB_EP6R_EP_KIND_Msk                    (0x1UL << USB_EP6R_EP_KIND_Pos) /*!< 0x00000100 */\r
+#define USB_EP6R_EP_KIND                        USB_EP6R_EP_KIND_Msk           /*!< Endpoint Kind */\r
+\r
+#define USB_EP6R_EP_TYPE_Pos                    (9U)                           \r
+#define USB_EP6R_EP_TYPE_Msk                    (0x3UL << USB_EP6R_EP_TYPE_Pos) /*!< 0x00000600 */\r
+#define USB_EP6R_EP_TYPE                        USB_EP6R_EP_TYPE_Msk           /*!< EP_TYPE[1:0] bits (Endpoint type) */\r
+#define USB_EP6R_EP_TYPE_0                      (0x1UL << USB_EP6R_EP_TYPE_Pos) /*!< 0x00000200 */\r
+#define USB_EP6R_EP_TYPE_1                      (0x2UL << USB_EP6R_EP_TYPE_Pos) /*!< 0x00000400 */\r
+\r
+#define USB_EP6R_SETUP_Pos                      (11U)                          \r
+#define USB_EP6R_SETUP_Msk                      (0x1UL << USB_EP6R_SETUP_Pos)   /*!< 0x00000800 */\r
+#define USB_EP6R_SETUP                          USB_EP6R_SETUP_Msk             /*!< Setup transaction completed */\r
+\r
+#define USB_EP6R_STAT_RX_Pos                    (12U)                          \r
+#define USB_EP6R_STAT_RX_Msk                    (0x3UL << USB_EP6R_STAT_RX_Pos) /*!< 0x00003000 */\r
+#define USB_EP6R_STAT_RX                        USB_EP6R_STAT_RX_Msk           /*!< STAT_RX[1:0] bits (Status bits, for reception transfers) */\r
+#define USB_EP6R_STAT_RX_0                      (0x1UL << USB_EP6R_STAT_RX_Pos) /*!< 0x00001000 */\r
+#define USB_EP6R_STAT_RX_1                      (0x2UL << USB_EP6R_STAT_RX_Pos) /*!< 0x00002000 */\r
+\r
+#define USB_EP6R_DTOG_RX_Pos                    (14U)                          \r
+#define USB_EP6R_DTOG_RX_Msk                    (0x1UL << USB_EP6R_DTOG_RX_Pos) /*!< 0x00004000 */\r
+#define USB_EP6R_DTOG_RX                        USB_EP6R_DTOG_RX_Msk           /*!< Data Toggle, for reception transfers */\r
+#define USB_EP6R_CTR_RX_Pos                     (15U)                          \r
+#define USB_EP6R_CTR_RX_Msk                     (0x1UL << USB_EP6R_CTR_RX_Pos)  /*!< 0x00008000 */\r
+#define USB_EP6R_CTR_RX                         USB_EP6R_CTR_RX_Msk            /*!< Correct Transfer for reception */\r
+\r
+/*******************  Bit definition for USB_EP7R register  *******************/\r
+#define USB_EP7R_EA_Pos                         (0U)                           \r
+#define USB_EP7R_EA_Msk                         (0xFUL << USB_EP7R_EA_Pos)      /*!< 0x0000000F */\r
+#define USB_EP7R_EA                             USB_EP7R_EA_Msk                /*!< Endpoint Address */\r
+\r
+#define USB_EP7R_STAT_TX_Pos                    (4U)                           \r
+#define USB_EP7R_STAT_TX_Msk                    (0x3UL << USB_EP7R_STAT_TX_Pos) /*!< 0x00000030 */\r
+#define USB_EP7R_STAT_TX                        USB_EP7R_STAT_TX_Msk           /*!< STAT_TX[1:0] bits (Status bits, for transmission transfers) */\r
+#define USB_EP7R_STAT_TX_0                      (0x1UL << USB_EP7R_STAT_TX_Pos) /*!< 0x00000010 */\r
+#define USB_EP7R_STAT_TX_1                      (0x2UL << USB_EP7R_STAT_TX_Pos) /*!< 0x00000020 */\r
+\r
+#define USB_EP7R_DTOG_TX_Pos                    (6U)                           \r
+#define USB_EP7R_DTOG_TX_Msk                    (0x1UL << USB_EP7R_DTOG_TX_Pos) /*!< 0x00000040 */\r
+#define USB_EP7R_DTOG_TX                        USB_EP7R_DTOG_TX_Msk           /*!< Data Toggle, for transmission transfers */\r
+#define USB_EP7R_CTR_TX_Pos                     (7U)                           \r
+#define USB_EP7R_CTR_TX_Msk                     (0x1UL << USB_EP7R_CTR_TX_Pos)  /*!< 0x00000080 */\r
+#define USB_EP7R_CTR_TX                         USB_EP7R_CTR_TX_Msk            /*!< Correct Transfer for transmission */\r
+#define USB_EP7R_EP_KIND_Pos                    (8U)                           \r
+#define USB_EP7R_EP_KIND_Msk                    (0x1UL << USB_EP7R_EP_KIND_Pos) /*!< 0x00000100 */\r
+#define USB_EP7R_EP_KIND                        USB_EP7R_EP_KIND_Msk           /*!< Endpoint Kind */\r
+\r
+#define USB_EP7R_EP_TYPE_Pos                    (9U)                           \r
+#define USB_EP7R_EP_TYPE_Msk                    (0x3UL << USB_EP7R_EP_TYPE_Pos) /*!< 0x00000600 */\r
+#define USB_EP7R_EP_TYPE                        USB_EP7R_EP_TYPE_Msk           /*!< EP_TYPE[1:0] bits (Endpoint type) */\r
+#define USB_EP7R_EP_TYPE_0                      (0x1UL << USB_EP7R_EP_TYPE_Pos) /*!< 0x00000200 */\r
+#define USB_EP7R_EP_TYPE_1                      (0x2UL << USB_EP7R_EP_TYPE_Pos) /*!< 0x00000400 */\r
+\r
+#define USB_EP7R_SETUP_Pos                      (11U)                          \r
+#define USB_EP7R_SETUP_Msk                      (0x1UL << USB_EP7R_SETUP_Pos)   /*!< 0x00000800 */\r
+#define USB_EP7R_SETUP                          USB_EP7R_SETUP_Msk             /*!< Setup transaction completed */\r
+\r
+#define USB_EP7R_STAT_RX_Pos                    (12U)                          \r
+#define USB_EP7R_STAT_RX_Msk                    (0x3UL << USB_EP7R_STAT_RX_Pos) /*!< 0x00003000 */\r
+#define USB_EP7R_STAT_RX                        USB_EP7R_STAT_RX_Msk           /*!< STAT_RX[1:0] bits (Status bits, for reception transfers) */\r
+#define USB_EP7R_STAT_RX_0                      (0x1UL << USB_EP7R_STAT_RX_Pos) /*!< 0x00001000 */\r
+#define USB_EP7R_STAT_RX_1                      (0x2UL << USB_EP7R_STAT_RX_Pos) /*!< 0x00002000 */\r
+\r
+#define USB_EP7R_DTOG_RX_Pos                    (14U)                          \r
+#define USB_EP7R_DTOG_RX_Msk                    (0x1UL << USB_EP7R_DTOG_RX_Pos) /*!< 0x00004000 */\r
+#define USB_EP7R_DTOG_RX                        USB_EP7R_DTOG_RX_Msk           /*!< Data Toggle, for reception transfers */\r
+#define USB_EP7R_CTR_RX_Pos                     (15U)                          \r
+#define USB_EP7R_CTR_RX_Msk                     (0x1UL << USB_EP7R_CTR_RX_Pos)  /*!< 0x00008000 */\r
+#define USB_EP7R_CTR_RX                         USB_EP7R_CTR_RX_Msk            /*!< Correct Transfer for reception */\r
+\r
+/*!< Common registers */\r
+/*******************  Bit definition for USB_CNTR register  *******************/\r
+#define USB_CNTR_FRES_Pos                       (0U)                           \r
+#define USB_CNTR_FRES_Msk                       (0x1UL << USB_CNTR_FRES_Pos)    /*!< 0x00000001 */\r
+#define USB_CNTR_FRES                           USB_CNTR_FRES_Msk              /*!< Force USB Reset */\r
+#define USB_CNTR_PDWN_Pos                       (1U)                           \r
+#define USB_CNTR_PDWN_Msk                       (0x1UL << USB_CNTR_PDWN_Pos)    /*!< 0x00000002 */\r
+#define USB_CNTR_PDWN                           USB_CNTR_PDWN_Msk              /*!< Power down */\r
+#define USB_CNTR_LP_MODE_Pos                    (2U)                           \r
+#define USB_CNTR_LP_MODE_Msk                    (0x1UL << USB_CNTR_LP_MODE_Pos) /*!< 0x00000004 */\r
+#define USB_CNTR_LP_MODE                        USB_CNTR_LP_MODE_Msk           /*!< Low-power mode */\r
+#define USB_CNTR_FSUSP_Pos                      (3U)                           \r
+#define USB_CNTR_FSUSP_Msk                      (0x1UL << USB_CNTR_FSUSP_Pos)   /*!< 0x00000008 */\r
+#define USB_CNTR_FSUSP                          USB_CNTR_FSUSP_Msk             /*!< Force suspend */\r
+#define USB_CNTR_RESUME_Pos                     (4U)                           \r
+#define USB_CNTR_RESUME_Msk                     (0x1UL << USB_CNTR_RESUME_Pos)  /*!< 0x00000010 */\r
+#define USB_CNTR_RESUME                         USB_CNTR_RESUME_Msk            /*!< Resume request */\r
+#define USB_CNTR_ESOFM_Pos                      (8U)                           \r
+#define USB_CNTR_ESOFM_Msk                      (0x1UL << USB_CNTR_ESOFM_Pos)   /*!< 0x00000100 */\r
+#define USB_CNTR_ESOFM                          USB_CNTR_ESOFM_Msk             /*!< Expected Start Of Frame Interrupt Mask */\r
+#define USB_CNTR_SOFM_Pos                       (9U)                           \r
+#define USB_CNTR_SOFM_Msk                       (0x1UL << USB_CNTR_SOFM_Pos)    /*!< 0x00000200 */\r
+#define USB_CNTR_SOFM                           USB_CNTR_SOFM_Msk              /*!< Start Of Frame Interrupt Mask */\r
+#define USB_CNTR_RESETM_Pos                     (10U)                          \r
+#define USB_CNTR_RESETM_Msk                     (0x1UL << USB_CNTR_RESETM_Pos)  /*!< 0x00000400 */\r
+#define USB_CNTR_RESETM                         USB_CNTR_RESETM_Msk            /*!< RESET Interrupt Mask */\r
+#define USB_CNTR_SUSPM_Pos                      (11U)                          \r
+#define USB_CNTR_SUSPM_Msk                      (0x1UL << USB_CNTR_SUSPM_Pos)   /*!< 0x00000800 */\r
+#define USB_CNTR_SUSPM                          USB_CNTR_SUSPM_Msk             /*!< Suspend mode Interrupt Mask */\r
+#define USB_CNTR_WKUPM_Pos                      (12U)                          \r
+#define USB_CNTR_WKUPM_Msk                      (0x1UL << USB_CNTR_WKUPM_Pos)   /*!< 0x00001000 */\r
+#define USB_CNTR_WKUPM                          USB_CNTR_WKUPM_Msk             /*!< Wakeup Interrupt Mask */\r
+#define USB_CNTR_ERRM_Pos                       (13U)                          \r
+#define USB_CNTR_ERRM_Msk                       (0x1UL << USB_CNTR_ERRM_Pos)    /*!< 0x00002000 */\r
+#define USB_CNTR_ERRM                           USB_CNTR_ERRM_Msk              /*!< Error Interrupt Mask */\r
+#define USB_CNTR_PMAOVRM_Pos                    (14U)                          \r
+#define USB_CNTR_PMAOVRM_Msk                    (0x1UL << USB_CNTR_PMAOVRM_Pos) /*!< 0x00004000 */\r
+#define USB_CNTR_PMAOVRM                        USB_CNTR_PMAOVRM_Msk           /*!< Packet Memory Area Over / Underrun Interrupt Mask */\r
+#define USB_CNTR_CTRM_Pos                       (15U)                          \r
+#define USB_CNTR_CTRM_Msk                       (0x1UL << USB_CNTR_CTRM_Pos)    /*!< 0x00008000 */\r
+#define USB_CNTR_CTRM                           USB_CNTR_CTRM_Msk              /*!< Correct Transfer Interrupt Mask */\r
+\r
+/*******************  Bit definition for USB_ISTR register  *******************/\r
+#define USB_ISTR_EP_ID_Pos                      (0U)                           \r
+#define USB_ISTR_EP_ID_Msk                      (0xFUL << USB_ISTR_EP_ID_Pos)   /*!< 0x0000000F */\r
+#define USB_ISTR_EP_ID                          USB_ISTR_EP_ID_Msk             /*!< Endpoint Identifier */\r
+#define USB_ISTR_DIR_Pos                        (4U)                           \r
+#define USB_ISTR_DIR_Msk                        (0x1UL << USB_ISTR_DIR_Pos)     /*!< 0x00000010 */\r
+#define USB_ISTR_DIR                            USB_ISTR_DIR_Msk               /*!< Direction of transaction */\r
+#define USB_ISTR_ESOF_Pos                       (8U)                           \r
+#define USB_ISTR_ESOF_Msk                       (0x1UL << USB_ISTR_ESOF_Pos)    /*!< 0x00000100 */\r
+#define USB_ISTR_ESOF                           USB_ISTR_ESOF_Msk              /*!< Expected Start Of Frame */\r
+#define USB_ISTR_SOF_Pos                        (9U)                           \r
+#define USB_ISTR_SOF_Msk                        (0x1UL << USB_ISTR_SOF_Pos)     /*!< 0x00000200 */\r
+#define USB_ISTR_SOF                            USB_ISTR_SOF_Msk               /*!< Start Of Frame */\r
+#define USB_ISTR_RESET_Pos                      (10U)                          \r
+#define USB_ISTR_RESET_Msk                      (0x1UL << USB_ISTR_RESET_Pos)   /*!< 0x00000400 */\r
+#define USB_ISTR_RESET                          USB_ISTR_RESET_Msk             /*!< USB RESET request */\r
+#define USB_ISTR_SUSP_Pos                       (11U)                          \r
+#define USB_ISTR_SUSP_Msk                       (0x1UL << USB_ISTR_SUSP_Pos)    /*!< 0x00000800 */\r
+#define USB_ISTR_SUSP                           USB_ISTR_SUSP_Msk              /*!< Suspend mode request */\r
+#define USB_ISTR_WKUP_Pos                       (12U)                          \r
+#define USB_ISTR_WKUP_Msk                       (0x1UL << USB_ISTR_WKUP_Pos)    /*!< 0x00001000 */\r
+#define USB_ISTR_WKUP                           USB_ISTR_WKUP_Msk              /*!< Wake up */\r
+#define USB_ISTR_ERR_Pos                        (13U)                          \r
+#define USB_ISTR_ERR_Msk                        (0x1UL << USB_ISTR_ERR_Pos)     /*!< 0x00002000 */\r
+#define USB_ISTR_ERR                            USB_ISTR_ERR_Msk               /*!< Error */\r
+#define USB_ISTR_PMAOVR_Pos                     (14U)                          \r
+#define USB_ISTR_PMAOVR_Msk                     (0x1UL << USB_ISTR_PMAOVR_Pos)  /*!< 0x00004000 */\r
+#define USB_ISTR_PMAOVR                         USB_ISTR_PMAOVR_Msk            /*!< Packet Memory Area Over / Underrun */\r
+#define USB_ISTR_CTR_Pos                        (15U)                          \r
+#define USB_ISTR_CTR_Msk                        (0x1UL << USB_ISTR_CTR_Pos)     /*!< 0x00008000 */\r
+#define USB_ISTR_CTR                            USB_ISTR_CTR_Msk               /*!< Correct Transfer */\r
+\r
+/*******************  Bit definition for USB_FNR register  ********************/\r
+#define USB_FNR_FN_Pos                          (0U)                           \r
+#define USB_FNR_FN_Msk                          (0x7FFUL << USB_FNR_FN_Pos)     /*!< 0x000007FF */\r
+#define USB_FNR_FN                              USB_FNR_FN_Msk                 /*!< Frame Number */\r
+#define USB_FNR_LSOF_Pos                        (11U)                          \r
+#define USB_FNR_LSOF_Msk                        (0x3UL << USB_FNR_LSOF_Pos)     /*!< 0x00001800 */\r
+#define USB_FNR_LSOF                            USB_FNR_LSOF_Msk               /*!< Lost SOF */\r
+#define USB_FNR_LCK_Pos                         (13U)                          \r
+#define USB_FNR_LCK_Msk                         (0x1UL << USB_FNR_LCK_Pos)      /*!< 0x00002000 */\r
+#define USB_FNR_LCK                             USB_FNR_LCK_Msk                /*!< Locked */\r
+#define USB_FNR_RXDM_Pos                        (14U)                          \r
+#define USB_FNR_RXDM_Msk                        (0x1UL << USB_FNR_RXDM_Pos)     /*!< 0x00004000 */\r
+#define USB_FNR_RXDM                            USB_FNR_RXDM_Msk               /*!< Receive Data - Line Status */\r
+#define USB_FNR_RXDP_Pos                        (15U)                          \r
+#define USB_FNR_RXDP_Msk                        (0x1UL << USB_FNR_RXDP_Pos)     /*!< 0x00008000 */\r
+#define USB_FNR_RXDP                            USB_FNR_RXDP_Msk               /*!< Receive Data + Line Status */\r
+\r
+/******************  Bit definition for USB_DADDR register  *******************/\r
+#define USB_DADDR_ADD_Pos                       (0U)                           \r
+#define USB_DADDR_ADD_Msk                       (0x7FUL << USB_DADDR_ADD_Pos)   /*!< 0x0000007F */\r
+#define USB_DADDR_ADD                           USB_DADDR_ADD_Msk              /*!< ADD[6:0] bits (Device Address) */\r
+#define USB_DADDR_ADD0_Pos                      (0U)                           \r
+#define USB_DADDR_ADD0_Msk                      (0x1UL << USB_DADDR_ADD0_Pos)   /*!< 0x00000001 */\r
+#define USB_DADDR_ADD0                          USB_DADDR_ADD0_Msk             /*!< Bit 0 */\r
+#define USB_DADDR_ADD1_Pos                      (1U)                           \r
+#define USB_DADDR_ADD1_Msk                      (0x1UL << USB_DADDR_ADD1_Pos)   /*!< 0x00000002 */\r
+#define USB_DADDR_ADD1                          USB_DADDR_ADD1_Msk             /*!< Bit 1 */\r
+#define USB_DADDR_ADD2_Pos                      (2U)                           \r
+#define USB_DADDR_ADD2_Msk                      (0x1UL << USB_DADDR_ADD2_Pos)   /*!< 0x00000004 */\r
+#define USB_DADDR_ADD2                          USB_DADDR_ADD2_Msk             /*!< Bit 2 */\r
+#define USB_DADDR_ADD3_Pos                      (3U)                           \r
+#define USB_DADDR_ADD3_Msk                      (0x1UL << USB_DADDR_ADD3_Pos)   /*!< 0x00000008 */\r
+#define USB_DADDR_ADD3                          USB_DADDR_ADD3_Msk             /*!< Bit 3 */\r
+#define USB_DADDR_ADD4_Pos                      (4U)                           \r
+#define USB_DADDR_ADD4_Msk                      (0x1UL << USB_DADDR_ADD4_Pos)   /*!< 0x00000010 */\r
+#define USB_DADDR_ADD4                          USB_DADDR_ADD4_Msk             /*!< Bit 4 */\r
+#define USB_DADDR_ADD5_Pos                      (5U)                           \r
+#define USB_DADDR_ADD5_Msk                      (0x1UL << USB_DADDR_ADD5_Pos)   /*!< 0x00000020 */\r
+#define USB_DADDR_ADD5                          USB_DADDR_ADD5_Msk             /*!< Bit 5 */\r
+#define USB_DADDR_ADD6_Pos                      (6U)                           \r
+#define USB_DADDR_ADD6_Msk                      (0x1UL << USB_DADDR_ADD6_Pos)   /*!< 0x00000040 */\r
+#define USB_DADDR_ADD6                          USB_DADDR_ADD6_Msk             /*!< Bit 6 */\r
+\r
+#define USB_DADDR_EF_Pos                        (7U)                           \r
+#define USB_DADDR_EF_Msk                        (0x1UL << USB_DADDR_EF_Pos)     /*!< 0x00000080 */\r
+#define USB_DADDR_EF                            USB_DADDR_EF_Msk               /*!< Enable Function */\r
+\r
+/******************  Bit definition for USB_BTABLE register  ******************/    \r
+#define USB_BTABLE_BTABLE_Pos                   (3U)                           \r
+#define USB_BTABLE_BTABLE_Msk                   (0x1FFFUL << USB_BTABLE_BTABLE_Pos) /*!< 0x0000FFF8 */\r
+#define USB_BTABLE_BTABLE                       USB_BTABLE_BTABLE_Msk          /*!< Buffer Table */\r
+\r
+/*!< Buffer descriptor table */\r
+/*****************  Bit definition for USB_ADDR0_TX register  *****************/\r
+#define USB_ADDR0_TX_ADDR0_TX_Pos               (1U)                           \r
+#define USB_ADDR0_TX_ADDR0_TX_Msk               (0x7FFFUL << USB_ADDR0_TX_ADDR0_TX_Pos) /*!< 0x0000FFFE */\r
+#define USB_ADDR0_TX_ADDR0_TX                   USB_ADDR0_TX_ADDR0_TX_Msk      /*!< Transmission Buffer Address 0 */\r
+\r
+/*****************  Bit definition for USB_ADDR1_TX register  *****************/\r
+#define USB_ADDR1_TX_ADDR1_TX_Pos               (1U)                           \r
+#define USB_ADDR1_TX_ADDR1_TX_Msk               (0x7FFFUL << USB_ADDR1_TX_ADDR1_TX_Pos) /*!< 0x0000FFFE */\r
+#define USB_ADDR1_TX_ADDR1_TX                   USB_ADDR1_TX_ADDR1_TX_Msk      /*!< Transmission Buffer Address 1 */\r
+\r
+/*****************  Bit definition for USB_ADDR2_TX register  *****************/\r
+#define USB_ADDR2_TX_ADDR2_TX_Pos               (1U)                           \r
+#define USB_ADDR2_TX_ADDR2_TX_Msk               (0x7FFFUL << USB_ADDR2_TX_ADDR2_TX_Pos) /*!< 0x0000FFFE */\r
+#define USB_ADDR2_TX_ADDR2_TX                   USB_ADDR2_TX_ADDR2_TX_Msk      /*!< Transmission Buffer Address 2 */\r
+\r
+/*****************  Bit definition for USB_ADDR3_TX register  *****************/\r
+#define USB_ADDR3_TX_ADDR3_TX_Pos               (1U)                           \r
+#define USB_ADDR3_TX_ADDR3_TX_Msk               (0x7FFFUL << USB_ADDR3_TX_ADDR3_TX_Pos) /*!< 0x0000FFFE */\r
+#define USB_ADDR3_TX_ADDR3_TX                   USB_ADDR3_TX_ADDR3_TX_Msk      /*!< Transmission Buffer Address 3 */\r
+\r
+/*****************  Bit definition for USB_ADDR4_TX register  *****************/\r
+#define USB_ADDR4_TX_ADDR4_TX_Pos               (1U)                           \r
+#define USB_ADDR4_TX_ADDR4_TX_Msk               (0x7FFFUL << USB_ADDR4_TX_ADDR4_TX_Pos) /*!< 0x0000FFFE */\r
+#define USB_ADDR4_TX_ADDR4_TX                   USB_ADDR4_TX_ADDR4_TX_Msk      /*!< Transmission Buffer Address 4 */\r
+\r
+/*****************  Bit definition for USB_ADDR5_TX register  *****************/\r
+#define USB_ADDR5_TX_ADDR5_TX_Pos               (1U)                           \r
+#define USB_ADDR5_TX_ADDR5_TX_Msk               (0x7FFFUL << USB_ADDR5_TX_ADDR5_TX_Pos) /*!< 0x0000FFFE */\r
+#define USB_ADDR5_TX_ADDR5_TX                   USB_ADDR5_TX_ADDR5_TX_Msk      /*!< Transmission Buffer Address 5 */\r
+\r
+/*****************  Bit definition for USB_ADDR6_TX register  *****************/\r
+#define USB_ADDR6_TX_ADDR6_TX_Pos               (1U)                           \r
+#define USB_ADDR6_TX_ADDR6_TX_Msk               (0x7FFFUL << USB_ADDR6_TX_ADDR6_TX_Pos) /*!< 0x0000FFFE */\r
+#define USB_ADDR6_TX_ADDR6_TX                   USB_ADDR6_TX_ADDR6_TX_Msk      /*!< Transmission Buffer Address 6 */\r
+\r
+/*****************  Bit definition for USB_ADDR7_TX register  *****************/\r
+#define USB_ADDR7_TX_ADDR7_TX_Pos               (1U)                           \r
+#define USB_ADDR7_TX_ADDR7_TX_Msk               (0x7FFFUL << USB_ADDR7_TX_ADDR7_TX_Pos) /*!< 0x0000FFFE */\r
+#define USB_ADDR7_TX_ADDR7_TX                   USB_ADDR7_TX_ADDR7_TX_Msk      /*!< Transmission Buffer Address 7 */\r
+\r
+/*----------------------------------------------------------------------------*/\r
+\r
+/*****************  Bit definition for USB_COUNT0_TX register  ****************/\r
+#define USB_COUNT0_TX_COUNT0_TX_Pos             (0U)                           \r
+#define USB_COUNT0_TX_COUNT0_TX_Msk             (0x3FFUL << USB_COUNT0_TX_COUNT0_TX_Pos) /*!< 0x000003FF */\r
+#define USB_COUNT0_TX_COUNT0_TX                 USB_COUNT0_TX_COUNT0_TX_Msk    /*!< Transmission Byte Count 0 */\r
+\r
+/*****************  Bit definition for USB_COUNT1_TX register  ****************/\r
+#define USB_COUNT1_TX_COUNT1_TX_Pos             (0U)                           \r
+#define USB_COUNT1_TX_COUNT1_TX_Msk             (0x3FFUL << USB_COUNT1_TX_COUNT1_TX_Pos) /*!< 0x000003FF */\r
+#define USB_COUNT1_TX_COUNT1_TX                 USB_COUNT1_TX_COUNT1_TX_Msk    /*!< Transmission Byte Count 1 */\r
+\r
+/*****************  Bit definition for USB_COUNT2_TX register  ****************/\r
+#define USB_COUNT2_TX_COUNT2_TX_Pos             (0U)                           \r
+#define USB_COUNT2_TX_COUNT2_TX_Msk             (0x3FFUL << USB_COUNT2_TX_COUNT2_TX_Pos) /*!< 0x000003FF */\r
+#define USB_COUNT2_TX_COUNT2_TX                 USB_COUNT2_TX_COUNT2_TX_Msk    /*!< Transmission Byte Count 2 */\r
+\r
+/*****************  Bit definition for USB_COUNT3_TX register  ****************/\r
+#define USB_COUNT3_TX_COUNT3_TX_Pos             (0U)                           \r
+#define USB_COUNT3_TX_COUNT3_TX_Msk             (0x3FFUL << USB_COUNT3_TX_COUNT3_TX_Pos) /*!< 0x000003FF */\r
+#define USB_COUNT3_TX_COUNT3_TX                 USB_COUNT3_TX_COUNT3_TX_Msk    /*!< Transmission Byte Count 3 */\r
+\r
+/*****************  Bit definition for USB_COUNT4_TX register  ****************/\r
+#define USB_COUNT4_TX_COUNT4_TX_Pos             (0U)                           \r
+#define USB_COUNT4_TX_COUNT4_TX_Msk             (0x3FFUL << USB_COUNT4_TX_COUNT4_TX_Pos) /*!< 0x000003FF */\r
+#define USB_COUNT4_TX_COUNT4_TX                 USB_COUNT4_TX_COUNT4_TX_Msk    /*!< Transmission Byte Count 4 */\r
+\r
+/*****************  Bit definition for USB_COUNT5_TX register  ****************/\r
+#define USB_COUNT5_TX_COUNT5_TX_Pos             (0U)                           \r
+#define USB_COUNT5_TX_COUNT5_TX_Msk             (0x3FFUL << USB_COUNT5_TX_COUNT5_TX_Pos) /*!< 0x000003FF */\r
+#define USB_COUNT5_TX_COUNT5_TX                 USB_COUNT5_TX_COUNT5_TX_Msk    /*!< Transmission Byte Count 5 */\r
+\r
+/*****************  Bit definition for USB_COUNT6_TX register  ****************/\r
+#define USB_COUNT6_TX_COUNT6_TX_Pos             (0U)                           \r
+#define USB_COUNT6_TX_COUNT6_TX_Msk             (0x3FFUL << USB_COUNT6_TX_COUNT6_TX_Pos) /*!< 0x000003FF */\r
+#define USB_COUNT6_TX_COUNT6_TX                 USB_COUNT6_TX_COUNT6_TX_Msk    /*!< Transmission Byte Count 6 */\r
+\r
+/*****************  Bit definition for USB_COUNT7_TX register  ****************/\r
+#define USB_COUNT7_TX_COUNT7_TX_Pos             (0U)                           \r
+#define USB_COUNT7_TX_COUNT7_TX_Msk             (0x3FFUL << USB_COUNT7_TX_COUNT7_TX_Pos) /*!< 0x000003FF */\r
+#define USB_COUNT7_TX_COUNT7_TX                 USB_COUNT7_TX_COUNT7_TX_Msk    /*!< Transmission Byte Count 7 */\r
+\r
+/*----------------------------------------------------------------------------*/\r
+\r
+/****************  Bit definition for USB_COUNT0_TX_0 register  ***************/\r
+#define USB_COUNT0_TX_0_COUNT0_TX_0             0x000003FFU         /*!< Transmission Byte Count 0 (low) */\r
+\r
+/****************  Bit definition for USB_COUNT0_TX_1 register  ***************/\r
+#define USB_COUNT0_TX_1_COUNT0_TX_1             0x03FF0000U         /*!< Transmission Byte Count 0 (high) */\r
+\r
+/****************  Bit definition for USB_COUNT1_TX_0 register  ***************/\r
+#define USB_COUNT1_TX_0_COUNT1_TX_0             0x000003FFU         /*!< Transmission Byte Count 1 (low) */\r
+\r
+/****************  Bit definition for USB_COUNT1_TX_1 register  ***************/\r
+#define USB_COUNT1_TX_1_COUNT1_TX_1             0x03FF0000U         /*!< Transmission Byte Count 1 (high) */\r
+\r
+/****************  Bit definition for USB_COUNT2_TX_0 register  ***************/\r
+#define USB_COUNT2_TX_0_COUNT2_TX_0             0x000003FFU         /*!< Transmission Byte Count 2 (low) */\r
+\r
+/****************  Bit definition for USB_COUNT2_TX_1 register  ***************/\r
+#define USB_COUNT2_TX_1_COUNT2_TX_1             0x03FF0000U         /*!< Transmission Byte Count 2 (high) */\r
+\r
+/****************  Bit definition for USB_COUNT3_TX_0 register  ***************/\r
+#define USB_COUNT3_TX_0_COUNT3_TX_0             0x000003FFU         /*!< Transmission Byte Count 3 (low) */\r
+\r
+/****************  Bit definition for USB_COUNT3_TX_1 register  ***************/\r
+#define USB_COUNT3_TX_1_COUNT3_TX_1             0x03FF0000U         /*!< Transmission Byte Count 3 (high) */\r
+\r
+/****************  Bit definition for USB_COUNT4_TX_0 register  ***************/\r
+#define USB_COUNT4_TX_0_COUNT4_TX_0             0x000003FFU         /*!< Transmission Byte Count 4 (low) */\r
+\r
+/****************  Bit definition for USB_COUNT4_TX_1 register  ***************/\r
+#define USB_COUNT4_TX_1_COUNT4_TX_1             0x03FF0000U         /*!< Transmission Byte Count 4 (high) */\r
+\r
+/****************  Bit definition for USB_COUNT5_TX_0 register  ***************/\r
+#define USB_COUNT5_TX_0_COUNT5_TX_0             0x000003FFU         /*!< Transmission Byte Count 5 (low) */\r
+\r
+/****************  Bit definition for USB_COUNT5_TX_1 register  ***************/\r
+#define USB_COUNT5_TX_1_COUNT5_TX_1             0x03FF0000U         /*!< Transmission Byte Count 5 (high) */\r
+\r
+/****************  Bit definition for USB_COUNT6_TX_0 register  ***************/\r
+#define USB_COUNT6_TX_0_COUNT6_TX_0             0x000003FFU         /*!< Transmission Byte Count 6 (low) */\r
+\r
+/****************  Bit definition for USB_COUNT6_TX_1 register  ***************/\r
+#define USB_COUNT6_TX_1_COUNT6_TX_1             0x03FF0000U         /*!< Transmission Byte Count 6 (high) */\r
+\r
+/****************  Bit definition for USB_COUNT7_TX_0 register  ***************/\r
+#define USB_COUNT7_TX_0_COUNT7_TX_0             0x000003FFU         /*!< Transmission Byte Count 7 (low) */\r
+\r
+/****************  Bit definition for USB_COUNT7_TX_1 register  ***************/\r
+#define USB_COUNT7_TX_1_COUNT7_TX_1             0x03FF0000U         /*!< Transmission Byte Count 7 (high) */\r
+\r
+/*----------------------------------------------------------------------------*/\r
+\r
+/*****************  Bit definition for USB_ADDR0_RX register  *****************/\r
+#define USB_ADDR0_RX_ADDR0_RX_Pos               (1U)                           \r
+#define USB_ADDR0_RX_ADDR0_RX_Msk               (0x7FFFUL << USB_ADDR0_RX_ADDR0_RX_Pos) /*!< 0x0000FFFE */\r
+#define USB_ADDR0_RX_ADDR0_RX                   USB_ADDR0_RX_ADDR0_RX_Msk      /*!< Reception Buffer Address 0 */\r
+\r
+/*****************  Bit definition for USB_ADDR1_RX register  *****************/\r
+#define USB_ADDR1_RX_ADDR1_RX_Pos               (1U)                           \r
+#define USB_ADDR1_RX_ADDR1_RX_Msk               (0x7FFFUL << USB_ADDR1_RX_ADDR1_RX_Pos) /*!< 0x0000FFFE */\r
+#define USB_ADDR1_RX_ADDR1_RX                   USB_ADDR1_RX_ADDR1_RX_Msk      /*!< Reception Buffer Address 1 */\r
+\r
+/*****************  Bit definition for USB_ADDR2_RX register  *****************/\r
+#define USB_ADDR2_RX_ADDR2_RX_Pos               (1U)                           \r
+#define USB_ADDR2_RX_ADDR2_RX_Msk               (0x7FFFUL << USB_ADDR2_RX_ADDR2_RX_Pos) /*!< 0x0000FFFE */\r
+#define USB_ADDR2_RX_ADDR2_RX                   USB_ADDR2_RX_ADDR2_RX_Msk      /*!< Reception Buffer Address 2 */\r
+\r
+/*****************  Bit definition for USB_ADDR3_RX register  *****************/\r
+#define USB_ADDR3_RX_ADDR3_RX_Pos               (1U)                           \r
+#define USB_ADDR3_RX_ADDR3_RX_Msk               (0x7FFFUL << USB_ADDR3_RX_ADDR3_RX_Pos) /*!< 0x0000FFFE */\r
+#define USB_ADDR3_RX_ADDR3_RX                   USB_ADDR3_RX_ADDR3_RX_Msk      /*!< Reception Buffer Address 3 */\r
+\r
+/*****************  Bit definition for USB_ADDR4_RX register  *****************/\r
+#define USB_ADDR4_RX_ADDR4_RX_Pos               (1U)                           \r
+#define USB_ADDR4_RX_ADDR4_RX_Msk               (0x7FFFUL << USB_ADDR4_RX_ADDR4_RX_Pos) /*!< 0x0000FFFE */\r
+#define USB_ADDR4_RX_ADDR4_RX                   USB_ADDR4_RX_ADDR4_RX_Msk      /*!< Reception Buffer Address 4 */\r
+\r
+/*****************  Bit definition for USB_ADDR5_RX register  *****************/\r
+#define USB_ADDR5_RX_ADDR5_RX_Pos               (1U)                           \r
+#define USB_ADDR5_RX_ADDR5_RX_Msk               (0x7FFFUL << USB_ADDR5_RX_ADDR5_RX_Pos) /*!< 0x0000FFFE */\r
+#define USB_ADDR5_RX_ADDR5_RX                   USB_ADDR5_RX_ADDR5_RX_Msk      /*!< Reception Buffer Address 5 */\r
+\r
+/*****************  Bit definition for USB_ADDR6_RX register  *****************/\r
+#define USB_ADDR6_RX_ADDR6_RX_Pos               (1U)                           \r
+#define USB_ADDR6_RX_ADDR6_RX_Msk               (0x7FFFUL << USB_ADDR6_RX_ADDR6_RX_Pos) /*!< 0x0000FFFE */\r
+#define USB_ADDR6_RX_ADDR6_RX                   USB_ADDR6_RX_ADDR6_RX_Msk      /*!< Reception Buffer Address 6 */\r
+\r
+/*****************  Bit definition for USB_ADDR7_RX register  *****************/\r
+#define USB_ADDR7_RX_ADDR7_RX_Pos               (1U)                           \r
+#define USB_ADDR7_RX_ADDR7_RX_Msk               (0x7FFFUL << USB_ADDR7_RX_ADDR7_RX_Pos) /*!< 0x0000FFFE */\r
+#define USB_ADDR7_RX_ADDR7_RX                   USB_ADDR7_RX_ADDR7_RX_Msk      /*!< Reception Buffer Address 7 */\r
+\r
+/*----------------------------------------------------------------------------*/\r
+\r
+/*****************  Bit definition for USB_COUNT0_RX register  ****************/\r
+#define USB_COUNT0_RX_COUNT0_RX_Pos             (0U)                           \r
+#define USB_COUNT0_RX_COUNT0_RX_Msk             (0x3FFUL << USB_COUNT0_RX_COUNT0_RX_Pos) /*!< 0x000003FF */\r
+#define USB_COUNT0_RX_COUNT0_RX                 USB_COUNT0_RX_COUNT0_RX_Msk    /*!< Reception Byte Count */\r
+\r
+#define USB_COUNT0_RX_NUM_BLOCK_Pos             (10U)                          \r
+#define USB_COUNT0_RX_NUM_BLOCK_Msk             (0x1FUL << USB_COUNT0_RX_NUM_BLOCK_Pos) /*!< 0x00007C00 */\r
+#define USB_COUNT0_RX_NUM_BLOCK                 USB_COUNT0_RX_NUM_BLOCK_Msk    /*!< NUM_BLOCK[4:0] bits (Number of blocks) */\r
+#define USB_COUNT0_RX_NUM_BLOCK_0               (0x01UL << USB_COUNT0_RX_NUM_BLOCK_Pos) /*!< 0x00000400 */\r
+#define USB_COUNT0_RX_NUM_BLOCK_1               (0x02UL << USB_COUNT0_RX_NUM_BLOCK_Pos) /*!< 0x00000800 */\r
+#define USB_COUNT0_RX_NUM_BLOCK_2               (0x04UL << USB_COUNT0_RX_NUM_BLOCK_Pos) /*!< 0x00001000 */\r
+#define USB_COUNT0_RX_NUM_BLOCK_3               (0x08UL << USB_COUNT0_RX_NUM_BLOCK_Pos) /*!< 0x00002000 */\r
+#define USB_COUNT0_RX_NUM_BLOCK_4               (0x10UL << USB_COUNT0_RX_NUM_BLOCK_Pos) /*!< 0x00004000 */\r
+\r
+#define USB_COUNT0_RX_BLSIZE_Pos                (15U)                          \r
+#define USB_COUNT0_RX_BLSIZE_Msk                (0x1UL << USB_COUNT0_RX_BLSIZE_Pos) /*!< 0x00008000 */\r
+#define USB_COUNT0_RX_BLSIZE                    USB_COUNT0_RX_BLSIZE_Msk       /*!< BLock SIZE */\r
+\r
+/*****************  Bit definition for USB_COUNT1_RX register  ****************/\r
+#define USB_COUNT1_RX_COUNT1_RX_Pos             (0U)                           \r
+#define USB_COUNT1_RX_COUNT1_RX_Msk             (0x3FFUL << USB_COUNT1_RX_COUNT1_RX_Pos) /*!< 0x000003FF */\r
+#define USB_COUNT1_RX_COUNT1_RX                 USB_COUNT1_RX_COUNT1_RX_Msk    /*!< Reception Byte Count */\r
+\r
+#define USB_COUNT1_RX_NUM_BLOCK_Pos             (10U)                          \r
+#define USB_COUNT1_RX_NUM_BLOCK_Msk             (0x1FUL << USB_COUNT1_RX_NUM_BLOCK_Pos) /*!< 0x00007C00 */\r
+#define USB_COUNT1_RX_NUM_BLOCK                 USB_COUNT1_RX_NUM_BLOCK_Msk    /*!< NUM_BLOCK[4:0] bits (Number of blocks) */\r
+#define USB_COUNT1_RX_NUM_BLOCK_0               (0x01UL << USB_COUNT1_RX_NUM_BLOCK_Pos) /*!< 0x00000400 */\r
+#define USB_COUNT1_RX_NUM_BLOCK_1               (0x02UL << USB_COUNT1_RX_NUM_BLOCK_Pos) /*!< 0x00000800 */\r
+#define USB_COUNT1_RX_NUM_BLOCK_2               (0x04UL << USB_COUNT1_RX_NUM_BLOCK_Pos) /*!< 0x00001000 */\r
+#define USB_COUNT1_RX_NUM_BLOCK_3               (0x08UL << USB_COUNT1_RX_NUM_BLOCK_Pos) /*!< 0x00002000 */\r
+#define USB_COUNT1_RX_NUM_BLOCK_4               (0x10UL << USB_COUNT1_RX_NUM_BLOCK_Pos) /*!< 0x00004000 */\r
+\r
+#define USB_COUNT1_RX_BLSIZE_Pos                (15U)                          \r
+#define USB_COUNT1_RX_BLSIZE_Msk                (0x1UL << USB_COUNT1_RX_BLSIZE_Pos) /*!< 0x00008000 */\r
+#define USB_COUNT1_RX_BLSIZE                    USB_COUNT1_RX_BLSIZE_Msk       /*!< BLock SIZE */\r
+\r
+/*****************  Bit definition for USB_COUNT2_RX register  ****************/\r
+#define USB_COUNT2_RX_COUNT2_RX_Pos             (0U)                           \r
+#define USB_COUNT2_RX_COUNT2_RX_Msk             (0x3FFUL << USB_COUNT2_RX_COUNT2_RX_Pos) /*!< 0x000003FF */\r
+#define USB_COUNT2_RX_COUNT2_RX                 USB_COUNT2_RX_COUNT2_RX_Msk    /*!< Reception Byte Count */\r
+\r
+#define USB_COUNT2_RX_NUM_BLOCK_Pos             (10U)                          \r
+#define USB_COUNT2_RX_NUM_BLOCK_Msk             (0x1FUL << USB_COUNT2_RX_NUM_BLOCK_Pos) /*!< 0x00007C00 */\r
+#define USB_COUNT2_RX_NUM_BLOCK                 USB_COUNT2_RX_NUM_BLOCK_Msk    /*!< NUM_BLOCK[4:0] bits (Number of blocks) */\r
+#define USB_COUNT2_RX_NUM_BLOCK_0               (0x01UL << USB_COUNT2_RX_NUM_BLOCK_Pos) /*!< 0x00000400 */\r
+#define USB_COUNT2_RX_NUM_BLOCK_1               (0x02UL << USB_COUNT2_RX_NUM_BLOCK_Pos) /*!< 0x00000800 */\r
+#define USB_COUNT2_RX_NUM_BLOCK_2               (0x04UL << USB_COUNT2_RX_NUM_BLOCK_Pos) /*!< 0x00001000 */\r
+#define USB_COUNT2_RX_NUM_BLOCK_3               (0x08UL << USB_COUNT2_RX_NUM_BLOCK_Pos) /*!< 0x00002000 */\r
+#define USB_COUNT2_RX_NUM_BLOCK_4               (0x10UL << USB_COUNT2_RX_NUM_BLOCK_Pos) /*!< 0x00004000 */\r
+\r
+#define USB_COUNT2_RX_BLSIZE_Pos                (15U)                          \r
+#define USB_COUNT2_RX_BLSIZE_Msk                (0x1UL << USB_COUNT2_RX_BLSIZE_Pos) /*!< 0x00008000 */\r
+#define USB_COUNT2_RX_BLSIZE                    USB_COUNT2_RX_BLSIZE_Msk       /*!< BLock SIZE */\r
+\r
+/*****************  Bit definition for USB_COUNT3_RX register  ****************/\r
+#define USB_COUNT3_RX_COUNT3_RX_Pos             (0U)                           \r
+#define USB_COUNT3_RX_COUNT3_RX_Msk             (0x3FFUL << USB_COUNT3_RX_COUNT3_RX_Pos) /*!< 0x000003FF */\r
+#define USB_COUNT3_RX_COUNT3_RX                 USB_COUNT3_RX_COUNT3_RX_Msk    /*!< Reception Byte Count */\r
+\r
+#define USB_COUNT3_RX_NUM_BLOCK_Pos             (10U)                          \r
+#define USB_COUNT3_RX_NUM_BLOCK_Msk             (0x1FUL << USB_COUNT3_RX_NUM_BLOCK_Pos) /*!< 0x00007C00 */\r
+#define USB_COUNT3_RX_NUM_BLOCK                 USB_COUNT3_RX_NUM_BLOCK_Msk    /*!< NUM_BLOCK[4:0] bits (Number of blocks) */\r
+#define USB_COUNT3_RX_NUM_BLOCK_0               (0x01UL << USB_COUNT3_RX_NUM_BLOCK_Pos) /*!< 0x00000400 */\r
+#define USB_COUNT3_RX_NUM_BLOCK_1               (0x02UL << USB_COUNT3_RX_NUM_BLOCK_Pos) /*!< 0x00000800 */\r
+#define USB_COUNT3_RX_NUM_BLOCK_2               (0x04UL << USB_COUNT3_RX_NUM_BLOCK_Pos) /*!< 0x00001000 */\r
+#define USB_COUNT3_RX_NUM_BLOCK_3               (0x08UL << USB_COUNT3_RX_NUM_BLOCK_Pos) /*!< 0x00002000 */\r
+#define USB_COUNT3_RX_NUM_BLOCK_4               (0x10UL << USB_COUNT3_RX_NUM_BLOCK_Pos) /*!< 0x00004000 */\r
+\r
+#define USB_COUNT3_RX_BLSIZE_Pos                (15U)                          \r
+#define USB_COUNT3_RX_BLSIZE_Msk                (0x1UL << USB_COUNT3_RX_BLSIZE_Pos) /*!< 0x00008000 */\r
+#define USB_COUNT3_RX_BLSIZE                    USB_COUNT3_RX_BLSIZE_Msk       /*!< BLock SIZE */\r
+\r
+/*****************  Bit definition for USB_COUNT4_RX register  ****************/\r
+#define USB_COUNT4_RX_COUNT4_RX_Pos             (0U)                           \r
+#define USB_COUNT4_RX_COUNT4_RX_Msk             (0x3FFUL << USB_COUNT4_RX_COUNT4_RX_Pos) /*!< 0x000003FF */\r
+#define USB_COUNT4_RX_COUNT4_RX                 USB_COUNT4_RX_COUNT4_RX_Msk    /*!< Reception Byte Count */\r
+\r
+#define USB_COUNT4_RX_NUM_BLOCK_Pos             (10U)                          \r
+#define USB_COUNT4_RX_NUM_BLOCK_Msk             (0x1FUL << USB_COUNT4_RX_NUM_BLOCK_Pos) /*!< 0x00007C00 */\r
+#define USB_COUNT4_RX_NUM_BLOCK                 USB_COUNT4_RX_NUM_BLOCK_Msk    /*!< NUM_BLOCK[4:0] bits (Number of blocks) */\r
+#define USB_COUNT4_RX_NUM_BLOCK_0               (0x01UL << USB_COUNT4_RX_NUM_BLOCK_Pos) /*!< 0x00000400 */\r
+#define USB_COUNT4_RX_NUM_BLOCK_1               (0x02UL << USB_COUNT4_RX_NUM_BLOCK_Pos) /*!< 0x00000800 */\r
+#define USB_COUNT4_RX_NUM_BLOCK_2               (0x04UL << USB_COUNT4_RX_NUM_BLOCK_Pos) /*!< 0x00001000 */\r
+#define USB_COUNT4_RX_NUM_BLOCK_3               (0x08UL << USB_COUNT4_RX_NUM_BLOCK_Pos) /*!< 0x00002000 */\r
+#define USB_COUNT4_RX_NUM_BLOCK_4               (0x10UL << USB_COUNT4_RX_NUM_BLOCK_Pos) /*!< 0x00004000 */\r
+\r
+#define USB_COUNT4_RX_BLSIZE_Pos                (15U)                          \r
+#define USB_COUNT4_RX_BLSIZE_Msk                (0x1UL << USB_COUNT4_RX_BLSIZE_Pos) /*!< 0x00008000 */\r
+#define USB_COUNT4_RX_BLSIZE                    USB_COUNT4_RX_BLSIZE_Msk       /*!< BLock SIZE */\r
+\r
+/*****************  Bit definition for USB_COUNT5_RX register  ****************/\r
+#define USB_COUNT5_RX_COUNT5_RX_Pos             (0U)                           \r
+#define USB_COUNT5_RX_COUNT5_RX_Msk             (0x3FFUL << USB_COUNT5_RX_COUNT5_RX_Pos) /*!< 0x000003FF */\r
+#define USB_COUNT5_RX_COUNT5_RX                 USB_COUNT5_RX_COUNT5_RX_Msk    /*!< Reception Byte Count */\r
+\r
+#define USB_COUNT5_RX_NUM_BLOCK_Pos             (10U)                          \r
+#define USB_COUNT5_RX_NUM_BLOCK_Msk             (0x1FUL << USB_COUNT5_RX_NUM_BLOCK_Pos) /*!< 0x00007C00 */\r
+#define USB_COUNT5_RX_NUM_BLOCK                 USB_COUNT5_RX_NUM_BLOCK_Msk    /*!< NUM_BLOCK[4:0] bits (Number of blocks) */\r
+#define USB_COUNT5_RX_NUM_BLOCK_0               (0x01UL << USB_COUNT5_RX_NUM_BLOCK_Pos) /*!< 0x00000400 */\r
+#define USB_COUNT5_RX_NUM_BLOCK_1               (0x02UL << USB_COUNT5_RX_NUM_BLOCK_Pos) /*!< 0x00000800 */\r
+#define USB_COUNT5_RX_NUM_BLOCK_2               (0x04UL << USB_COUNT5_RX_NUM_BLOCK_Pos) /*!< 0x00001000 */\r
+#define USB_COUNT5_RX_NUM_BLOCK_3               (0x08UL << USB_COUNT5_RX_NUM_BLOCK_Pos) /*!< 0x00002000 */\r
+#define USB_COUNT5_RX_NUM_BLOCK_4               (0x10UL << USB_COUNT5_RX_NUM_BLOCK_Pos) /*!< 0x00004000 */\r
+\r
+#define USB_COUNT5_RX_BLSIZE_Pos                (15U)                          \r
+#define USB_COUNT5_RX_BLSIZE_Msk                (0x1UL << USB_COUNT5_RX_BLSIZE_Pos) /*!< 0x00008000 */\r
+#define USB_COUNT5_RX_BLSIZE                    USB_COUNT5_RX_BLSIZE_Msk       /*!< BLock SIZE */\r
+\r
+/*****************  Bit definition for USB_COUNT6_RX register  ****************/\r
+#define USB_COUNT6_RX_COUNT6_RX_Pos             (0U)                           \r
+#define USB_COUNT6_RX_COUNT6_RX_Msk             (0x3FFUL << USB_COUNT6_RX_COUNT6_RX_Pos) /*!< 0x000003FF */\r
+#define USB_COUNT6_RX_COUNT6_RX                 USB_COUNT6_RX_COUNT6_RX_Msk    /*!< Reception Byte Count */\r
+\r
+#define USB_COUNT6_RX_NUM_BLOCK_Pos             (10U)                          \r
+#define USB_COUNT6_RX_NUM_BLOCK_Msk             (0x1FUL << USB_COUNT6_RX_NUM_BLOCK_Pos) /*!< 0x00007C00 */\r
+#define USB_COUNT6_RX_NUM_BLOCK                 USB_COUNT6_RX_NUM_BLOCK_Msk    /*!< NUM_BLOCK[4:0] bits (Number of blocks) */\r
+#define USB_COUNT6_RX_NUM_BLOCK_0               (0x01UL << USB_COUNT6_RX_NUM_BLOCK_Pos) /*!< 0x00000400 */\r
+#define USB_COUNT6_RX_NUM_BLOCK_1               (0x02UL << USB_COUNT6_RX_NUM_BLOCK_Pos) /*!< 0x00000800 */\r
+#define USB_COUNT6_RX_NUM_BLOCK_2               (0x04UL << USB_COUNT6_RX_NUM_BLOCK_Pos) /*!< 0x00001000 */\r
+#define USB_COUNT6_RX_NUM_BLOCK_3               (0x08UL << USB_COUNT6_RX_NUM_BLOCK_Pos) /*!< 0x00002000 */\r
+#define USB_COUNT6_RX_NUM_BLOCK_4               (0x10UL << USB_COUNT6_RX_NUM_BLOCK_Pos) /*!< 0x00004000 */\r
+\r
+#define USB_COUNT6_RX_BLSIZE_Pos                (15U)                          \r
+#define USB_COUNT6_RX_BLSIZE_Msk                (0x1UL << USB_COUNT6_RX_BLSIZE_Pos) /*!< 0x00008000 */\r
+#define USB_COUNT6_RX_BLSIZE                    USB_COUNT6_RX_BLSIZE_Msk       /*!< BLock SIZE */\r
+\r
+/*****************  Bit definition for USB_COUNT7_RX register  ****************/\r
+#define USB_COUNT7_RX_COUNT7_RX_Pos             (0U)                           \r
+#define USB_COUNT7_RX_COUNT7_RX_Msk             (0x3FFUL << USB_COUNT7_RX_COUNT7_RX_Pos) /*!< 0x000003FF */\r
+#define USB_COUNT7_RX_COUNT7_RX                 USB_COUNT7_RX_COUNT7_RX_Msk    /*!< Reception Byte Count */\r
+\r
+#define USB_COUNT7_RX_NUM_BLOCK_Pos             (10U)                          \r
+#define USB_COUNT7_RX_NUM_BLOCK_Msk             (0x1FUL << USB_COUNT7_RX_NUM_BLOCK_Pos) /*!< 0x00007C00 */\r
+#define USB_COUNT7_RX_NUM_BLOCK                 USB_COUNT7_RX_NUM_BLOCK_Msk    /*!< NUM_BLOCK[4:0] bits (Number of blocks) */\r
+#define USB_COUNT7_RX_NUM_BLOCK_0               (0x01UL << USB_COUNT7_RX_NUM_BLOCK_Pos) /*!< 0x00000400 */\r
+#define USB_COUNT7_RX_NUM_BLOCK_1               (0x02UL << USB_COUNT7_RX_NUM_BLOCK_Pos) /*!< 0x00000800 */\r
+#define USB_COUNT7_RX_NUM_BLOCK_2               (0x04UL << USB_COUNT7_RX_NUM_BLOCK_Pos) /*!< 0x00001000 */\r
+#define USB_COUNT7_RX_NUM_BLOCK_3               (0x08UL << USB_COUNT7_RX_NUM_BLOCK_Pos) /*!< 0x00002000 */\r
+#define USB_COUNT7_RX_NUM_BLOCK_4               (0x10UL << USB_COUNT7_RX_NUM_BLOCK_Pos) /*!< 0x00004000 */\r
+\r
+#define USB_COUNT7_RX_BLSIZE_Pos                (15U)                          \r
+#define USB_COUNT7_RX_BLSIZE_Msk                (0x1UL << USB_COUNT7_RX_BLSIZE_Pos) /*!< 0x00008000 */\r
+#define USB_COUNT7_RX_BLSIZE                    USB_COUNT7_RX_BLSIZE_Msk       /*!< BLock SIZE */\r
+\r
+/*----------------------------------------------------------------------------*/\r
+\r
+/****************  Bit definition for USB_COUNT0_RX_0 register  ***************/\r
+#define USB_COUNT0_RX_0_COUNT0_RX_0             0x000003FFU                    /*!< Reception Byte Count (low) */\r
+\r
+#define USB_COUNT0_RX_0_NUM_BLOCK_0             0x00007C00U                    /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */\r
+#define USB_COUNT0_RX_0_NUM_BLOCK_0_0           0x00000400U                    /*!< Bit 0 */\r
+#define USB_COUNT0_RX_0_NUM_BLOCK_0_1           0x00000800U                    /*!< Bit 1 */\r
+#define USB_COUNT0_RX_0_NUM_BLOCK_0_2           0x00001000U                    /*!< Bit 2 */\r
+#define USB_COUNT0_RX_0_NUM_BLOCK_0_3           0x00002000U                    /*!< Bit 3 */\r
+#define USB_COUNT0_RX_0_NUM_BLOCK_0_4           0x00004000U                    /*!< Bit 4 */\r
+\r
+#define USB_COUNT0_RX_0_BLSIZE_0                0x00008000U                    /*!< BLock SIZE (low) */\r
+\r
+/****************  Bit definition for USB_COUNT0_RX_1 register  ***************/\r
+#define USB_COUNT0_RX_1_COUNT0_RX_1             0x03FF0000U                    /*!< Reception Byte Count (high) */\r
+\r
+#define USB_COUNT0_RX_1_NUM_BLOCK_1             0x7C000000U                    /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */\r
+#define USB_COUNT0_RX_1_NUM_BLOCK_1_0           0x04000000U                    /*!< Bit 1 */\r
+#define USB_COUNT0_RX_1_NUM_BLOCK_1_1           0x08000000U                    /*!< Bit 1 */\r
+#define USB_COUNT0_RX_1_NUM_BLOCK_1_2           0x10000000U                    /*!< Bit 2 */\r
+#define USB_COUNT0_RX_1_NUM_BLOCK_1_3           0x20000000U                    /*!< Bit 3 */\r
+#define USB_COUNT0_RX_1_NUM_BLOCK_1_4           0x40000000U                    /*!< Bit 4 */\r
+\r
+#define USB_COUNT0_RX_1_BLSIZE_1                0x80000000U                    /*!< BLock SIZE (high) */\r
+\r
+/****************  Bit definition for USB_COUNT1_RX_0 register  ***************/\r
+#define USB_COUNT1_RX_0_COUNT1_RX_0             0x000003FFU                    /*!< Reception Byte Count (low) */\r
+\r
+#define USB_COUNT1_RX_0_NUM_BLOCK_0             0x00007C00U                    /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */\r
+#define USB_COUNT1_RX_0_NUM_BLOCK_0_0           0x00000400U                    /*!< Bit 0 */\r
+#define USB_COUNT1_RX_0_NUM_BLOCK_0_1           0x00000800U                    /*!< Bit 1 */\r
+#define USB_COUNT1_RX_0_NUM_BLOCK_0_2           0x00001000U                    /*!< Bit 2 */\r
+#define USB_COUNT1_RX_0_NUM_BLOCK_0_3           0x00002000U                    /*!< Bit 3 */\r
+#define USB_COUNT1_RX_0_NUM_BLOCK_0_4           0x00004000U                    /*!< Bit 4 */\r
+\r
+#define USB_COUNT1_RX_0_BLSIZE_0                0x00008000U                    /*!< BLock SIZE (low) */\r
+\r
+/****************  Bit definition for USB_COUNT1_RX_1 register  ***************/\r
+#define USB_COUNT1_RX_1_COUNT1_RX_1             0x03FF0000U                    /*!< Reception Byte Count (high) */\r
+\r
+#define USB_COUNT1_RX_1_NUM_BLOCK_1             0x7C000000U                    /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */\r
+#define USB_COUNT1_RX_1_NUM_BLOCK_1_0           0x04000000U                    /*!< Bit 0 */\r
+#define USB_COUNT1_RX_1_NUM_BLOCK_1_1           0x08000000U                    /*!< Bit 1 */\r
+#define USB_COUNT1_RX_1_NUM_BLOCK_1_2           0x10000000U                    /*!< Bit 2 */\r
+#define USB_COUNT1_RX_1_NUM_BLOCK_1_3           0x20000000U                    /*!< Bit 3 */\r
+#define USB_COUNT1_RX_1_NUM_BLOCK_1_4           0x40000000U                    /*!< Bit 4 */\r
+\r
+#define USB_COUNT1_RX_1_BLSIZE_1                0x80000000U                    /*!< BLock SIZE (high) */\r
+\r
+/****************  Bit definition for USB_COUNT2_RX_0 register  ***************/\r
+#define USB_COUNT2_RX_0_COUNT2_RX_0             0x000003FFU                    /*!< Reception Byte Count (low) */\r
+\r
+#define USB_COUNT2_RX_0_NUM_BLOCK_0             0x00007C00U                    /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */\r
+#define USB_COUNT2_RX_0_NUM_BLOCK_0_0           0x00000400U                    /*!< Bit 0 */\r
+#define USB_COUNT2_RX_0_NUM_BLOCK_0_1           0x00000800U                    /*!< Bit 1 */\r
+#define USB_COUNT2_RX_0_NUM_BLOCK_0_2           0x00001000U                    /*!< Bit 2 */\r
+#define USB_COUNT2_RX_0_NUM_BLOCK_0_3           0x00002000U                    /*!< Bit 3 */\r
+#define USB_COUNT2_RX_0_NUM_BLOCK_0_4           0x00004000U                    /*!< Bit 4 */\r
+\r
+#define USB_COUNT2_RX_0_BLSIZE_0                0x00008000U                    /*!< BLock SIZE (low) */\r
+\r
+/****************  Bit definition for USB_COUNT2_RX_1 register  ***************/\r
+#define USB_COUNT2_RX_1_COUNT2_RX_1             0x03FF0000U                    /*!< Reception Byte Count (high) */\r
+\r
+#define USB_COUNT2_RX_1_NUM_BLOCK_1             0x7C000000U                    /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */\r
+#define USB_COUNT2_RX_1_NUM_BLOCK_1_0           0x04000000U                    /*!< Bit 0 */\r
+#define USB_COUNT2_RX_1_NUM_BLOCK_1_1           0x08000000U                    /*!< Bit 1 */\r
+#define USB_COUNT2_RX_1_NUM_BLOCK_1_2           0x10000000U                    /*!< Bit 2 */\r
+#define USB_COUNT2_RX_1_NUM_BLOCK_1_3           0x20000000U                    /*!< Bit 3 */\r
+#define USB_COUNT2_RX_1_NUM_BLOCK_1_4           0x40000000U                    /*!< Bit 4 */\r
+\r
+#define USB_COUNT2_RX_1_BLSIZE_1                0x80000000U                    /*!< BLock SIZE (high) */\r
+\r
+/****************  Bit definition for USB_COUNT3_RX_0 register  ***************/\r
+#define USB_COUNT3_RX_0_COUNT3_RX_0             0x000003FFU                    /*!< Reception Byte Count (low) */\r
+\r
+#define USB_COUNT3_RX_0_NUM_BLOCK_0             0x00007C00U                    /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */\r
+#define USB_COUNT3_RX_0_NUM_BLOCK_0_0           0x00000400U                    /*!< Bit 0 */\r
+#define USB_COUNT3_RX_0_NUM_BLOCK_0_1           0x00000800U                    /*!< Bit 1 */\r
+#define USB_COUNT3_RX_0_NUM_BLOCK_0_2           0x00001000U                    /*!< Bit 2 */\r
+#define USB_COUNT3_RX_0_NUM_BLOCK_0_3           0x00002000U                    /*!< Bit 3 */\r
+#define USB_COUNT3_RX_0_NUM_BLOCK_0_4           0x00004000U                    /*!< Bit 4 */\r
+\r
+#define USB_COUNT3_RX_0_BLSIZE_0                0x00008000U                    /*!< BLock SIZE (low) */\r
+\r
+/****************  Bit definition for USB_COUNT3_RX_1 register  ***************/\r
+#define USB_COUNT3_RX_1_COUNT3_RX_1             0x03FF0000U                    /*!< Reception Byte Count (high) */\r
+\r
+#define USB_COUNT3_RX_1_NUM_BLOCK_1             0x7C000000U                    /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */\r
+#define USB_COUNT3_RX_1_NUM_BLOCK_1_0           0x04000000U                    /*!< Bit 0 */\r
+#define USB_COUNT3_RX_1_NUM_BLOCK_1_1           0x08000000U                    /*!< Bit 1 */\r
+#define USB_COUNT3_RX_1_NUM_BLOCK_1_2           0x10000000U                    /*!< Bit 2 */\r
+#define USB_COUNT3_RX_1_NUM_BLOCK_1_3           0x20000000U                    /*!< Bit 3 */\r
+#define USB_COUNT3_RX_1_NUM_BLOCK_1_4           0x40000000U                    /*!< Bit 4 */\r
+\r
+#define USB_COUNT3_RX_1_BLSIZE_1                0x80000000U                    /*!< BLock SIZE (high) */\r
+\r
+/****************  Bit definition for USB_COUNT4_RX_0 register  ***************/\r
+#define USB_COUNT4_RX_0_COUNT4_RX_0             0x000003FFU                    /*!< Reception Byte Count (low) */\r
+\r
+#define USB_COUNT4_RX_0_NUM_BLOCK_0             0x00007C00U                    /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */\r
+#define USB_COUNT4_RX_0_NUM_BLOCK_0_0           0x00000400U                    /*!< Bit 0 */\r
+#define USB_COUNT4_RX_0_NUM_BLOCK_0_1           0x00000800U                    /*!< Bit 1 */\r
+#define USB_COUNT4_RX_0_NUM_BLOCK_0_2           0x00001000U                    /*!< Bit 2 */\r
+#define USB_COUNT4_RX_0_NUM_BLOCK_0_3           0x00002000U                    /*!< Bit 3 */\r
+#define USB_COUNT4_RX_0_NUM_BLOCK_0_4           0x00004000U                    /*!< Bit 4 */\r
+\r
+#define USB_COUNT4_RX_0_BLSIZE_0                0x00008000U                    /*!< BLock SIZE (low) */\r
+\r
+/****************  Bit definition for USB_COUNT4_RX_1 register  ***************/\r
+#define USB_COUNT4_RX_1_COUNT4_RX_1             0x03FF0000U                    /*!< Reception Byte Count (high) */\r
+\r
+#define USB_COUNT4_RX_1_NUM_BLOCK_1             0x7C000000U                    /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */\r
+#define USB_COUNT4_RX_1_NUM_BLOCK_1_0           0x04000000U                    /*!< Bit 0 */\r
+#define USB_COUNT4_RX_1_NUM_BLOCK_1_1           0x08000000U                    /*!< Bit 1 */\r
+#define USB_COUNT4_RX_1_NUM_BLOCK_1_2           0x10000000U                    /*!< Bit 2 */\r
+#define USB_COUNT4_RX_1_NUM_BLOCK_1_3           0x20000000U                    /*!< Bit 3 */\r
+#define USB_COUNT4_RX_1_NUM_BLOCK_1_4           0x40000000U                    /*!< Bit 4 */\r
+\r
+#define USB_COUNT4_RX_1_BLSIZE_1                0x80000000U                    /*!< BLock SIZE (high) */\r
+\r
+/****************  Bit definition for USB_COUNT5_RX_0 register  ***************/\r
+#define USB_COUNT5_RX_0_COUNT5_RX_0             0x000003FFU                    /*!< Reception Byte Count (low) */\r
+\r
+#define USB_COUNT5_RX_0_NUM_BLOCK_0             0x00007C00U                    /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */\r
+#define USB_COUNT5_RX_0_NUM_BLOCK_0_0           0x00000400U                    /*!< Bit 0 */\r
+#define USB_COUNT5_RX_0_NUM_BLOCK_0_1           0x00000800U                    /*!< Bit 1 */\r
+#define USB_COUNT5_RX_0_NUM_BLOCK_0_2           0x00001000U                    /*!< Bit 2 */\r
+#define USB_COUNT5_RX_0_NUM_BLOCK_0_3           0x00002000U                    /*!< Bit 3 */\r
+#define USB_COUNT5_RX_0_NUM_BLOCK_0_4           0x00004000U                    /*!< Bit 4 */\r
+\r
+#define USB_COUNT5_RX_0_BLSIZE_0                0x00008000U                    /*!< BLock SIZE (low) */\r
+\r
+/****************  Bit definition for USB_COUNT5_RX_1 register  ***************/\r
+#define USB_COUNT5_RX_1_COUNT5_RX_1             0x03FF0000U                    /*!< Reception Byte Count (high) */\r
+\r
+#define USB_COUNT5_RX_1_NUM_BLOCK_1             0x7C000000U                    /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */\r
+#define USB_COUNT5_RX_1_NUM_BLOCK_1_0           0x04000000U                    /*!< Bit 0 */\r
+#define USB_COUNT5_RX_1_NUM_BLOCK_1_1           0x08000000U                    /*!< Bit 1 */\r
+#define USB_COUNT5_RX_1_NUM_BLOCK_1_2           0x10000000U                    /*!< Bit 2 */\r
+#define USB_COUNT5_RX_1_NUM_BLOCK_1_3           0x20000000U                    /*!< Bit 3 */\r
+#define USB_COUNT5_RX_1_NUM_BLOCK_1_4           0x40000000U                    /*!< Bit 4 */\r
+\r
+#define USB_COUNT5_RX_1_BLSIZE_1                0x80000000U                    /*!< BLock SIZE (high) */\r
+\r
+/***************  Bit definition for USB_COUNT6_RX_0  register  ***************/\r
+#define USB_COUNT6_RX_0_COUNT6_RX_0             0x000003FFU                    /*!< Reception Byte Count (low) */\r
+\r
+#define USB_COUNT6_RX_0_NUM_BLOCK_0             0x00007C00U                    /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */\r
+#define USB_COUNT6_RX_0_NUM_BLOCK_0_0           0x00000400U                    /*!< Bit 0 */\r
+#define USB_COUNT6_RX_0_NUM_BLOCK_0_1           0x00000800U                    /*!< Bit 1 */\r
+#define USB_COUNT6_RX_0_NUM_BLOCK_0_2           0x00001000U                    /*!< Bit 2 */\r
+#define USB_COUNT6_RX_0_NUM_BLOCK_0_3           0x00002000U                    /*!< Bit 3 */\r
+#define USB_COUNT6_RX_0_NUM_BLOCK_0_4           0x00004000U                    /*!< Bit 4 */\r
+\r
+#define USB_COUNT6_RX_0_BLSIZE_0                0x00008000U                    /*!< BLock SIZE (low) */\r
+\r
+/****************  Bit definition for USB_COUNT6_RX_1 register  ***************/\r
+#define USB_COUNT6_RX_1_COUNT6_RX_1             0x03FF0000U                   /*!< Reception Byte Count (high) */\r
+\r
+#define USB_COUNT6_RX_1_NUM_BLOCK_1             0x7C000000U                   /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */\r
+#define USB_COUNT6_RX_1_NUM_BLOCK_1_0           0x04000000U                   /*!< Bit 0 */\r
+#define USB_COUNT6_RX_1_NUM_BLOCK_1_1           0x08000000U                   /*!< Bit 1 */\r
+#define USB_COUNT6_RX_1_NUM_BLOCK_1_2           0x10000000U                   /*!< Bit 2 */\r
+#define USB_COUNT6_RX_1_NUM_BLOCK_1_3           0x20000000U                   /*!< Bit 3 */\r
+#define USB_COUNT6_RX_1_NUM_BLOCK_1_4           0x40000000U                   /*!< Bit 4 */\r
+\r
+#define USB_COUNT6_RX_1_BLSIZE_1                0x80000000U                   /*!< BLock SIZE (high) */\r
+\r
+/***************  Bit definition for USB_COUNT7_RX_0 register  ****************/\r
+#define USB_COUNT7_RX_0_COUNT7_RX_0             0x000003FFU                    /*!< Reception Byte Count (low) */\r
+\r
+#define USB_COUNT7_RX_0_NUM_BLOCK_0             0x00007C00U                    /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */\r
+#define USB_COUNT7_RX_0_NUM_BLOCK_0_0           0x00000400U                    /*!< Bit 0 */\r
+#define USB_COUNT7_RX_0_NUM_BLOCK_0_1           0x00000800U                    /*!< Bit 1 */\r
+#define USB_COUNT7_RX_0_NUM_BLOCK_0_2           0x00001000U                    /*!< Bit 2 */\r
+#define USB_COUNT7_RX_0_NUM_BLOCK_0_3           0x00002000U                    /*!< Bit 3 */\r
+#define USB_COUNT7_RX_0_NUM_BLOCK_0_4           0x00004000U                    /*!< Bit 4 */\r
+\r
+#define USB_COUNT7_RX_0_BLSIZE_0                0x00008000U                    /*!< BLock SIZE (low) */\r
+\r
+/***************  Bit definition for USB_COUNT7_RX_1 register  ****************/\r
+#define USB_COUNT7_RX_1_COUNT7_RX_1             0x03FF0000U                    /*!< Reception Byte Count (high) */\r
+\r
+#define USB_COUNT7_RX_1_NUM_BLOCK_1             0x7C000000U                    /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */\r
+#define USB_COUNT7_RX_1_NUM_BLOCK_1_0           0x04000000U                    /*!< Bit 0 */\r
+#define USB_COUNT7_RX_1_NUM_BLOCK_1_1           0x08000000U                    /*!< Bit 1 */\r
+#define USB_COUNT7_RX_1_NUM_BLOCK_1_2           0x10000000U                    /*!< Bit 2 */\r
+#define USB_COUNT7_RX_1_NUM_BLOCK_1_3           0x20000000U                    /*!< Bit 3 */\r
+#define USB_COUNT7_RX_1_NUM_BLOCK_1_4           0x40000000U                    /*!< Bit 4 */\r
+\r
+#define USB_COUNT7_RX_1_BLSIZE_1                0x80000000U                    /*!< BLock SIZE (high) */\r
+\r
+/******************************************************************************/\r
+/*                                                                            */\r
+/*                         Controller Area Network                            */\r
+/*                                                                            */\r
+/******************************************************************************/\r
+\r
+/*!< CAN control and status registers */\r
+/*******************  Bit definition for CAN_MCR register  ********************/\r
+#define CAN_MCR_INRQ_Pos                     (0U)                              \r
+#define CAN_MCR_INRQ_Msk                     (0x1UL << CAN_MCR_INRQ_Pos)        /*!< 0x00000001 */\r
+#define CAN_MCR_INRQ                         CAN_MCR_INRQ_Msk                  /*!< Initialization Request */\r
+#define CAN_MCR_SLEEP_Pos                    (1U)                              \r
+#define CAN_MCR_SLEEP_Msk                    (0x1UL << CAN_MCR_SLEEP_Pos)       /*!< 0x00000002 */\r
+#define CAN_MCR_SLEEP                        CAN_MCR_SLEEP_Msk                 /*!< Sleep Mode Request */\r
+#define CAN_MCR_TXFP_Pos                     (2U)                              \r
+#define CAN_MCR_TXFP_Msk                     (0x1UL << CAN_MCR_TXFP_Pos)        /*!< 0x00000004 */\r
+#define CAN_MCR_TXFP                         CAN_MCR_TXFP_Msk                  /*!< Transmit FIFO Priority */\r
+#define CAN_MCR_RFLM_Pos                     (3U)                              \r
+#define CAN_MCR_RFLM_Msk                     (0x1UL << CAN_MCR_RFLM_Pos)        /*!< 0x00000008 */\r
+#define CAN_MCR_RFLM                         CAN_MCR_RFLM_Msk                  /*!< Receive FIFO Locked Mode */\r
+#define CAN_MCR_NART_Pos                     (4U)                              \r
+#define CAN_MCR_NART_Msk                     (0x1UL << CAN_MCR_NART_Pos)        /*!< 0x00000010 */\r
+#define CAN_MCR_NART                         CAN_MCR_NART_Msk                  /*!< No Automatic Retransmission */\r
+#define CAN_MCR_AWUM_Pos                     (5U)                              \r
+#define CAN_MCR_AWUM_Msk                     (0x1UL << CAN_MCR_AWUM_Pos)        /*!< 0x00000020 */\r
+#define CAN_MCR_AWUM                         CAN_MCR_AWUM_Msk                  /*!< Automatic Wakeup Mode */\r
+#define CAN_MCR_ABOM_Pos                     (6U)                              \r
+#define CAN_MCR_ABOM_Msk                     (0x1UL << CAN_MCR_ABOM_Pos)        /*!< 0x00000040 */\r
+#define CAN_MCR_ABOM                         CAN_MCR_ABOM_Msk                  /*!< Automatic Bus-Off Management */\r
+#define CAN_MCR_TTCM_Pos                     (7U)                              \r
+#define CAN_MCR_TTCM_Msk                     (0x1UL << CAN_MCR_TTCM_Pos)        /*!< 0x00000080 */\r
+#define CAN_MCR_TTCM                         CAN_MCR_TTCM_Msk                  /*!< Time Triggered Communication Mode */\r
+#define CAN_MCR_RESET_Pos                    (15U)                             \r
+#define CAN_MCR_RESET_Msk                    (0x1UL << CAN_MCR_RESET_Pos)       /*!< 0x00008000 */\r
+#define CAN_MCR_RESET                        CAN_MCR_RESET_Msk                 /*!< CAN software master reset */\r
+#define CAN_MCR_DBF_Pos                      (16U)                             \r
+#define CAN_MCR_DBF_Msk                      (0x1UL << CAN_MCR_DBF_Pos)         /*!< 0x00010000 */\r
+#define CAN_MCR_DBF                          CAN_MCR_DBF_Msk                   /*!< CAN Debug freeze */\r
+\r
+/*******************  Bit definition for CAN_MSR register  ********************/\r
+#define CAN_MSR_INAK_Pos                     (0U)                              \r
+#define CAN_MSR_INAK_Msk                     (0x1UL << CAN_MSR_INAK_Pos)        /*!< 0x00000001 */\r
+#define CAN_MSR_INAK                         CAN_MSR_INAK_Msk                  /*!< Initialization Acknowledge */\r
+#define CAN_MSR_SLAK_Pos                     (1U)                              \r
+#define CAN_MSR_SLAK_Msk                     (0x1UL << CAN_MSR_SLAK_Pos)        /*!< 0x00000002 */\r
+#define CAN_MSR_SLAK                         CAN_MSR_SLAK_Msk                  /*!< Sleep Acknowledge */\r
+#define CAN_MSR_ERRI_Pos                     (2U)                              \r
+#define CAN_MSR_ERRI_Msk                     (0x1UL << CAN_MSR_ERRI_Pos)        /*!< 0x00000004 */\r
+#define CAN_MSR_ERRI                         CAN_MSR_ERRI_Msk                  /*!< Error Interrupt */\r
+#define CAN_MSR_WKUI_Pos                     (3U)                              \r
+#define CAN_MSR_WKUI_Msk                     (0x1UL << CAN_MSR_WKUI_Pos)        /*!< 0x00000008 */\r
+#define CAN_MSR_WKUI                         CAN_MSR_WKUI_Msk                  /*!< Wakeup Interrupt */\r
+#define CAN_MSR_SLAKI_Pos                    (4U)                              \r
+#define CAN_MSR_SLAKI_Msk                    (0x1UL << CAN_MSR_SLAKI_Pos)       /*!< 0x00000010 */\r
+#define CAN_MSR_SLAKI                        CAN_MSR_SLAKI_Msk                 /*!< Sleep Acknowledge Interrupt */\r
+#define CAN_MSR_TXM_Pos                      (8U)                              \r
+#define CAN_MSR_TXM_Msk                      (0x1UL << CAN_MSR_TXM_Pos)         /*!< 0x00000100 */\r
+#define CAN_MSR_TXM                          CAN_MSR_TXM_Msk                   /*!< Transmit Mode */\r
+#define CAN_MSR_RXM_Pos                      (9U)                              \r
+#define CAN_MSR_RXM_Msk                      (0x1UL << CAN_MSR_RXM_Pos)         /*!< 0x00000200 */\r
+#define CAN_MSR_RXM                          CAN_MSR_RXM_Msk                   /*!< Receive Mode */\r
+#define CAN_MSR_SAMP_Pos                     (10U)                             \r
+#define CAN_MSR_SAMP_Msk                     (0x1UL << CAN_MSR_SAMP_Pos)        /*!< 0x00000400 */\r
+#define CAN_MSR_SAMP                         CAN_MSR_SAMP_Msk                  /*!< Last Sample Point */\r
+#define CAN_MSR_RX_Pos                       (11U)                             \r
+#define CAN_MSR_RX_Msk                       (0x1UL << CAN_MSR_RX_Pos)          /*!< 0x00000800 */\r
+#define CAN_MSR_RX                           CAN_MSR_RX_Msk                    /*!< CAN Rx Signal */\r
+\r
+/*******************  Bit definition for CAN_TSR register  ********************/\r
+#define CAN_TSR_RQCP0_Pos                    (0U)                              \r
+#define CAN_TSR_RQCP0_Msk                    (0x1UL << CAN_TSR_RQCP0_Pos)       /*!< 0x00000001 */\r
+#define CAN_TSR_RQCP0                        CAN_TSR_RQCP0_Msk                 /*!< Request Completed Mailbox0 */\r
+#define CAN_TSR_TXOK0_Pos                    (1U)                              \r
+#define CAN_TSR_TXOK0_Msk                    (0x1UL << CAN_TSR_TXOK0_Pos)       /*!< 0x00000002 */\r
+#define CAN_TSR_TXOK0                        CAN_TSR_TXOK0_Msk                 /*!< Transmission OK of Mailbox0 */\r
+#define CAN_TSR_ALST0_Pos                    (2U)                              \r
+#define CAN_TSR_ALST0_Msk                    (0x1UL << CAN_TSR_ALST0_Pos)       /*!< 0x00000004 */\r
+#define CAN_TSR_ALST0                        CAN_TSR_ALST0_Msk                 /*!< Arbitration Lost for Mailbox0 */\r
+#define CAN_TSR_TERR0_Pos                    (3U)                              \r
+#define CAN_TSR_TERR0_Msk                    (0x1UL << CAN_TSR_TERR0_Pos)       /*!< 0x00000008 */\r
+#define CAN_TSR_TERR0                        CAN_TSR_TERR0_Msk                 /*!< Transmission Error of Mailbox0 */\r
+#define CAN_TSR_ABRQ0_Pos                    (7U)                              \r
+#define CAN_TSR_ABRQ0_Msk                    (0x1UL << CAN_TSR_ABRQ0_Pos)       /*!< 0x00000080 */\r
+#define CAN_TSR_ABRQ0                        CAN_TSR_ABRQ0_Msk                 /*!< Abort Request for Mailbox0 */\r
+#define CAN_TSR_RQCP1_Pos                    (8U)                              \r
+#define CAN_TSR_RQCP1_Msk                    (0x1UL << CAN_TSR_RQCP1_Pos)       /*!< 0x00000100 */\r
+#define CAN_TSR_RQCP1                        CAN_TSR_RQCP1_Msk                 /*!< Request Completed Mailbox1 */\r
+#define CAN_TSR_TXOK1_Pos                    (9U)                              \r
+#define CAN_TSR_TXOK1_Msk                    (0x1UL << CAN_TSR_TXOK1_Pos)       /*!< 0x00000200 */\r
+#define CAN_TSR_TXOK1                        CAN_TSR_TXOK1_Msk                 /*!< Transmission OK of Mailbox1 */\r
+#define CAN_TSR_ALST1_Pos                    (10U)                             \r
+#define CAN_TSR_ALST1_Msk                    (0x1UL << CAN_TSR_ALST1_Pos)       /*!< 0x00000400 */\r
+#define CAN_TSR_ALST1                        CAN_TSR_ALST1_Msk                 /*!< Arbitration Lost for Mailbox1 */\r
+#define CAN_TSR_TERR1_Pos                    (11U)                             \r
+#define CAN_TSR_TERR1_Msk                    (0x1UL << CAN_TSR_TERR1_Pos)       /*!< 0x00000800 */\r
+#define CAN_TSR_TERR1                        CAN_TSR_TERR1_Msk                 /*!< Transmission Error of Mailbox1 */\r
+#define CAN_TSR_ABRQ1_Pos                    (15U)                             \r
+#define CAN_TSR_ABRQ1_Msk                    (0x1UL << CAN_TSR_ABRQ1_Pos)       /*!< 0x00008000 */\r
+#define CAN_TSR_ABRQ1                        CAN_TSR_ABRQ1_Msk                 /*!< Abort Request for Mailbox 1 */\r
+#define CAN_TSR_RQCP2_Pos                    (16U)                             \r
+#define CAN_TSR_RQCP2_Msk                    (0x1UL << CAN_TSR_RQCP2_Pos)       /*!< 0x00010000 */\r
+#define CAN_TSR_RQCP2                        CAN_TSR_RQCP2_Msk                 /*!< Request Completed Mailbox2 */\r
+#define CAN_TSR_TXOK2_Pos                    (17U)                             \r
+#define CAN_TSR_TXOK2_Msk                    (0x1UL << CAN_TSR_TXOK2_Pos)       /*!< 0x00020000 */\r
+#define CAN_TSR_TXOK2                        CAN_TSR_TXOK2_Msk                 /*!< Transmission OK of Mailbox 2 */\r
+#define CAN_TSR_ALST2_Pos                    (18U)                             \r
+#define CAN_TSR_ALST2_Msk                    (0x1UL << CAN_TSR_ALST2_Pos)       /*!< 0x00040000 */\r
+#define CAN_TSR_ALST2                        CAN_TSR_ALST2_Msk                 /*!< Arbitration Lost for mailbox 2 */\r
+#define CAN_TSR_TERR2_Pos                    (19U)                             \r
+#define CAN_TSR_TERR2_Msk                    (0x1UL << CAN_TSR_TERR2_Pos)       /*!< 0x00080000 */\r
+#define CAN_TSR_TERR2                        CAN_TSR_TERR2_Msk                 /*!< Transmission Error of Mailbox 2 */\r
+#define CAN_TSR_ABRQ2_Pos                    (23U)                             \r
+#define CAN_TSR_ABRQ2_Msk                    (0x1UL << CAN_TSR_ABRQ2_Pos)       /*!< 0x00800000 */\r
+#define CAN_TSR_ABRQ2                        CAN_TSR_ABRQ2_Msk                 /*!< Abort Request for Mailbox 2 */\r
+#define CAN_TSR_CODE_Pos                     (24U)                             \r
+#define CAN_TSR_CODE_Msk                     (0x3UL << CAN_TSR_CODE_Pos)        /*!< 0x03000000 */\r
+#define CAN_TSR_CODE                         CAN_TSR_CODE_Msk                  /*!< Mailbox Code */\r
+\r
+#define CAN_TSR_TME_Pos                      (26U)                             \r
+#define CAN_TSR_TME_Msk                      (0x7UL << CAN_TSR_TME_Pos)         /*!< 0x1C000000 */\r
+#define CAN_TSR_TME                          CAN_TSR_TME_Msk                   /*!< TME[2:0] bits */\r
+#define CAN_TSR_TME0_Pos                     (26U)                             \r
+#define CAN_TSR_TME0_Msk                     (0x1UL << CAN_TSR_TME0_Pos)        /*!< 0x04000000 */\r
+#define CAN_TSR_TME0                         CAN_TSR_TME0_Msk                  /*!< Transmit Mailbox 0 Empty */\r
+#define CAN_TSR_TME1_Pos                     (27U)                             \r
+#define CAN_TSR_TME1_Msk                     (0x1UL << CAN_TSR_TME1_Pos)        /*!< 0x08000000 */\r
+#define CAN_TSR_TME1                         CAN_TSR_TME1_Msk                  /*!< Transmit Mailbox 1 Empty */\r
+#define CAN_TSR_TME2_Pos                     (28U)                             \r
+#define CAN_TSR_TME2_Msk                     (0x1UL << CAN_TSR_TME2_Pos)        /*!< 0x10000000 */\r
+#define CAN_TSR_TME2                         CAN_TSR_TME2_Msk                  /*!< Transmit Mailbox 2 Empty */\r
+\r
+#define CAN_TSR_LOW_Pos                      (29U)                             \r
+#define CAN_TSR_LOW_Msk                      (0x7UL << CAN_TSR_LOW_Pos)         /*!< 0xE0000000 */\r
+#define CAN_TSR_LOW                          CAN_TSR_LOW_Msk                   /*!< LOW[2:0] bits */\r
+#define CAN_TSR_LOW0_Pos                     (29U)                             \r
+#define CAN_TSR_LOW0_Msk                     (0x1UL << CAN_TSR_LOW0_Pos)        /*!< 0x20000000 */\r
+#define CAN_TSR_LOW0                         CAN_TSR_LOW0_Msk                  /*!< Lowest Priority Flag for Mailbox 0 */\r
+#define CAN_TSR_LOW1_Pos                     (30U)                             \r
+#define CAN_TSR_LOW1_Msk                     (0x1UL << CAN_TSR_LOW1_Pos)        /*!< 0x40000000 */\r
+#define CAN_TSR_LOW1                         CAN_TSR_LOW1_Msk                  /*!< Lowest Priority Flag for Mailbox 1 */\r
+#define CAN_TSR_LOW2_Pos                     (31U)                             \r
+#define CAN_TSR_LOW2_Msk                     (0x1UL << CAN_TSR_LOW2_Pos)        /*!< 0x80000000 */\r
+#define CAN_TSR_LOW2                         CAN_TSR_LOW2_Msk                  /*!< Lowest Priority Flag for Mailbox 2 */\r
+\r
+/*******************  Bit definition for CAN_RF0R register  *******************/\r
+#define CAN_RF0R_FMP0_Pos                    (0U)                              \r
+#define CAN_RF0R_FMP0_Msk                    (0x3UL << CAN_RF0R_FMP0_Pos)       /*!< 0x00000003 */\r
+#define CAN_RF0R_FMP0                        CAN_RF0R_FMP0_Msk                 /*!< FIFO 0 Message Pending */\r
+#define CAN_RF0R_FULL0_Pos                   (3U)                              \r
+#define CAN_RF0R_FULL0_Msk                   (0x1UL << CAN_RF0R_FULL0_Pos)      /*!< 0x00000008 */\r
+#define CAN_RF0R_FULL0                       CAN_RF0R_FULL0_Msk                /*!< FIFO 0 Full */\r
+#define CAN_RF0R_FOVR0_Pos                   (4U)                              \r
+#define CAN_RF0R_FOVR0_Msk                   (0x1UL << CAN_RF0R_FOVR0_Pos)      /*!< 0x00000010 */\r
+#define CAN_RF0R_FOVR0                       CAN_RF0R_FOVR0_Msk                /*!< FIFO 0 Overrun */\r
+#define CAN_RF0R_RFOM0_Pos                   (5U)                              \r
+#define CAN_RF0R_RFOM0_Msk                   (0x1UL << CAN_RF0R_RFOM0_Pos)      /*!< 0x00000020 */\r
+#define CAN_RF0R_RFOM0                       CAN_RF0R_RFOM0_Msk                /*!< Release FIFO 0 Output Mailbox */\r
+\r
+/*******************  Bit definition for CAN_RF1R register  *******************/\r
+#define CAN_RF1R_FMP1_Pos                    (0U)                              \r
+#define CAN_RF1R_FMP1_Msk                    (0x3UL << CAN_RF1R_FMP1_Pos)       /*!< 0x00000003 */\r
+#define CAN_RF1R_FMP1                        CAN_RF1R_FMP1_Msk                 /*!< FIFO 1 Message Pending */\r
+#define CAN_RF1R_FULL1_Pos                   (3U)                              \r
+#define CAN_RF1R_FULL1_Msk                   (0x1UL << CAN_RF1R_FULL1_Pos)      /*!< 0x00000008 */\r
+#define CAN_RF1R_FULL1                       CAN_RF1R_FULL1_Msk                /*!< FIFO 1 Full */\r
+#define CAN_RF1R_FOVR1_Pos                   (4U)                              \r
+#define CAN_RF1R_FOVR1_Msk                   (0x1UL << CAN_RF1R_FOVR1_Pos)      /*!< 0x00000010 */\r
+#define CAN_RF1R_FOVR1                       CAN_RF1R_FOVR1_Msk                /*!< FIFO 1 Overrun */\r
+#define CAN_RF1R_RFOM1_Pos                   (5U)                              \r
+#define CAN_RF1R_RFOM1_Msk                   (0x1UL << CAN_RF1R_RFOM1_Pos)      /*!< 0x00000020 */\r
+#define CAN_RF1R_RFOM1                       CAN_RF1R_RFOM1_Msk                /*!< Release FIFO 1 Output Mailbox */\r
+\r
+/********************  Bit definition for CAN_IER register  *******************/\r
+#define CAN_IER_TMEIE_Pos                    (0U)                              \r
+#define CAN_IER_TMEIE_Msk                    (0x1UL << CAN_IER_TMEIE_Pos)       /*!< 0x00000001 */\r
+#define CAN_IER_TMEIE                        CAN_IER_TMEIE_Msk                 /*!< Transmit Mailbox Empty Interrupt Enable */\r
+#define CAN_IER_FMPIE0_Pos                   (1U)                              \r
+#define CAN_IER_FMPIE0_Msk                   (0x1UL << CAN_IER_FMPIE0_Pos)      /*!< 0x00000002 */\r
+#define CAN_IER_FMPIE0                       CAN_IER_FMPIE0_Msk                /*!< FIFO Message Pending Interrupt Enable */\r
+#define CAN_IER_FFIE0_Pos                    (2U)                              \r
+#define CAN_IER_FFIE0_Msk                    (0x1UL << CAN_IER_FFIE0_Pos)       /*!< 0x00000004 */\r
+#define CAN_IER_FFIE0                        CAN_IER_FFIE0_Msk                 /*!< FIFO Full Interrupt Enable */\r
+#define CAN_IER_FOVIE0_Pos                   (3U)                              \r
+#define CAN_IER_FOVIE0_Msk                   (0x1UL << CAN_IER_FOVIE0_Pos)      /*!< 0x00000008 */\r
+#define CAN_IER_FOVIE0                       CAN_IER_FOVIE0_Msk                /*!< FIFO Overrun Interrupt Enable */\r
+#define CAN_IER_FMPIE1_Pos                   (4U)                              \r
+#define CAN_IER_FMPIE1_Msk                   (0x1UL << CAN_IER_FMPIE1_Pos)      /*!< 0x00000010 */\r
+#define CAN_IER_FMPIE1                       CAN_IER_FMPIE1_Msk                /*!< FIFO Message Pending Interrupt Enable */\r
+#define CAN_IER_FFIE1_Pos                    (5U)                              \r
+#define CAN_IER_FFIE1_Msk                    (0x1UL << CAN_IER_FFIE1_Pos)       /*!< 0x00000020 */\r
+#define CAN_IER_FFIE1                        CAN_IER_FFIE1_Msk                 /*!< FIFO Full Interrupt Enable */\r
+#define CAN_IER_FOVIE1_Pos                   (6U)                              \r
+#define CAN_IER_FOVIE1_Msk                   (0x1UL << CAN_IER_FOVIE1_Pos)      /*!< 0x00000040 */\r
+#define CAN_IER_FOVIE1                       CAN_IER_FOVIE1_Msk                /*!< FIFO Overrun Interrupt Enable */\r
+#define CAN_IER_EWGIE_Pos                    (8U)                              \r
+#define CAN_IER_EWGIE_Msk                    (0x1UL << CAN_IER_EWGIE_Pos)       /*!< 0x00000100 */\r
+#define CAN_IER_EWGIE                        CAN_IER_EWGIE_Msk                 /*!< Error Warning Interrupt Enable */\r
+#define CAN_IER_EPVIE_Pos                    (9U)                              \r
+#define CAN_IER_EPVIE_Msk                    (0x1UL << CAN_IER_EPVIE_Pos)       /*!< 0x00000200 */\r
+#define CAN_IER_EPVIE                        CAN_IER_EPVIE_Msk                 /*!< Error Passive Interrupt Enable */\r
+#define CAN_IER_BOFIE_Pos                    (10U)                             \r
+#define CAN_IER_BOFIE_Msk                    (0x1UL << CAN_IER_BOFIE_Pos)       /*!< 0x00000400 */\r
+#define CAN_IER_BOFIE                        CAN_IER_BOFIE_Msk                 /*!< Bus-Off Interrupt Enable */\r
+#define CAN_IER_LECIE_Pos                    (11U)                             \r
+#define CAN_IER_LECIE_Msk                    (0x1UL << CAN_IER_LECIE_Pos)       /*!< 0x00000800 */\r
+#define CAN_IER_LECIE                        CAN_IER_LECIE_Msk                 /*!< Last Error Code Interrupt Enable */\r
+#define CAN_IER_ERRIE_Pos                    (15U)                             \r
+#define CAN_IER_ERRIE_Msk                    (0x1UL << CAN_IER_ERRIE_Pos)       /*!< 0x00008000 */\r
+#define CAN_IER_ERRIE                        CAN_IER_ERRIE_Msk                 /*!< Error Interrupt Enable */\r
+#define CAN_IER_WKUIE_Pos                    (16U)                             \r
+#define CAN_IER_WKUIE_Msk                    (0x1UL << CAN_IER_WKUIE_Pos)       /*!< 0x00010000 */\r
+#define CAN_IER_WKUIE                        CAN_IER_WKUIE_Msk                 /*!< Wakeup Interrupt Enable */\r
+#define CAN_IER_SLKIE_Pos                    (17U)                             \r
+#define CAN_IER_SLKIE_Msk                    (0x1UL << CAN_IER_SLKIE_Pos)       /*!< 0x00020000 */\r
+#define CAN_IER_SLKIE                        CAN_IER_SLKIE_Msk                 /*!< Sleep Interrupt Enable */\r
+\r
+/********************  Bit definition for CAN_ESR register  *******************/\r
+#define CAN_ESR_EWGF_Pos                     (0U)                              \r
+#define CAN_ESR_EWGF_Msk                     (0x1UL << CAN_ESR_EWGF_Pos)        /*!< 0x00000001 */\r
+#define CAN_ESR_EWGF                         CAN_ESR_EWGF_Msk                  /*!< Error Warning Flag */\r
+#define CAN_ESR_EPVF_Pos                     (1U)                              \r
+#define CAN_ESR_EPVF_Msk                     (0x1UL << CAN_ESR_EPVF_Pos)        /*!< 0x00000002 */\r
+#define CAN_ESR_EPVF                         CAN_ESR_EPVF_Msk                  /*!< Error Passive Flag */\r
+#define CAN_ESR_BOFF_Pos                     (2U)                              \r
+#define CAN_ESR_BOFF_Msk                     (0x1UL << CAN_ESR_BOFF_Pos)        /*!< 0x00000004 */\r
+#define CAN_ESR_BOFF                         CAN_ESR_BOFF_Msk                  /*!< Bus-Off Flag */\r
+\r
+#define CAN_ESR_LEC_Pos                      (4U)                              \r
+#define CAN_ESR_LEC_Msk                      (0x7UL << CAN_ESR_LEC_Pos)         /*!< 0x00000070 */\r
+#define CAN_ESR_LEC                          CAN_ESR_LEC_Msk                   /*!< LEC[2:0] bits (Last Error Code) */\r
+#define CAN_ESR_LEC_0                        (0x1UL << CAN_ESR_LEC_Pos)         /*!< 0x00000010 */\r
+#define CAN_ESR_LEC_1                        (0x2UL << CAN_ESR_LEC_Pos)         /*!< 0x00000020 */\r
+#define CAN_ESR_LEC_2                        (0x4UL << CAN_ESR_LEC_Pos)         /*!< 0x00000040 */\r
+\r
+#define CAN_ESR_TEC_Pos                      (16U)                             \r
+#define CAN_ESR_TEC_Msk                      (0xFFUL << CAN_ESR_TEC_Pos)        /*!< 0x00FF0000 */\r
+#define CAN_ESR_TEC                          CAN_ESR_TEC_Msk                   /*!< Least significant byte of the 9-bit Transmit Error Counter */\r
+#define CAN_ESR_REC_Pos                      (24U)                             \r
+#define CAN_ESR_REC_Msk                      (0xFFUL << CAN_ESR_REC_Pos)        /*!< 0xFF000000 */\r
+#define CAN_ESR_REC                          CAN_ESR_REC_Msk                   /*!< Receive Error Counter */\r
+\r
+/*******************  Bit definition for CAN_BTR register  ********************/\r
+#define CAN_BTR_BRP_Pos                      (0U)                              \r
+#define CAN_BTR_BRP_Msk                      (0x3FFUL << CAN_BTR_BRP_Pos)       /*!< 0x000003FF */\r
+#define CAN_BTR_BRP                          CAN_BTR_BRP_Msk                   /*!<Baud Rate Prescaler */\r
+#define CAN_BTR_TS1_Pos                      (16U)                             \r
+#define CAN_BTR_TS1_Msk                      (0xFUL << CAN_BTR_TS1_Pos)         /*!< 0x000F0000 */\r
+#define CAN_BTR_TS1                          CAN_BTR_TS1_Msk                   /*!<Time Segment 1 */\r
+#define CAN_BTR_TS1_0                        (0x1UL << CAN_BTR_TS1_Pos)         /*!< 0x00010000 */\r
+#define CAN_BTR_TS1_1                        (0x2UL << CAN_BTR_TS1_Pos)         /*!< 0x00020000 */\r
+#define CAN_BTR_TS1_2                        (0x4UL << CAN_BTR_TS1_Pos)         /*!< 0x00040000 */\r
+#define CAN_BTR_TS1_3                        (0x8UL << CAN_BTR_TS1_Pos)         /*!< 0x00080000 */\r
+#define CAN_BTR_TS2_Pos                      (20U)                             \r
+#define CAN_BTR_TS2_Msk                      (0x7UL << CAN_BTR_TS2_Pos)         /*!< 0x00700000 */\r
+#define CAN_BTR_TS2                          CAN_BTR_TS2_Msk                   /*!<Time Segment 2 */\r
+#define CAN_BTR_TS2_0                        (0x1UL << CAN_BTR_TS2_Pos)         /*!< 0x00100000 */\r
+#define CAN_BTR_TS2_1                        (0x2UL << CAN_BTR_TS2_Pos)         /*!< 0x00200000 */\r
+#define CAN_BTR_TS2_2                        (0x4UL << CAN_BTR_TS2_Pos)         /*!< 0x00400000 */\r
+#define CAN_BTR_SJW_Pos                      (24U)                             \r
+#define CAN_BTR_SJW_Msk                      (0x3UL << CAN_BTR_SJW_Pos)         /*!< 0x03000000 */\r
+#define CAN_BTR_SJW                          CAN_BTR_SJW_Msk                   /*!<Resynchronization Jump Width */\r
+#define CAN_BTR_SJW_0                        (0x1UL << CAN_BTR_SJW_Pos)         /*!< 0x01000000 */\r
+#define CAN_BTR_SJW_1                        (0x2UL << CAN_BTR_SJW_Pos)         /*!< 0x02000000 */\r
+#define CAN_BTR_LBKM_Pos                     (30U)                             \r
+#define CAN_BTR_LBKM_Msk                     (0x1UL << CAN_BTR_LBKM_Pos)        /*!< 0x40000000 */\r
+#define CAN_BTR_LBKM                         CAN_BTR_LBKM_Msk                  /*!<Loop Back Mode (Debug) */\r
+#define CAN_BTR_SILM_Pos                     (31U)                             \r
+#define CAN_BTR_SILM_Msk                     (0x1UL << CAN_BTR_SILM_Pos)        /*!< 0x80000000 */\r
+#define CAN_BTR_SILM                         CAN_BTR_SILM_Msk                  /*!<Silent Mode */\r
+\r
+/*!< Mailbox registers */\r
+/******************  Bit definition for CAN_TI0R register  ********************/\r
+#define CAN_TI0R_TXRQ_Pos                    (0U)                              \r
+#define CAN_TI0R_TXRQ_Msk                    (0x1UL << CAN_TI0R_TXRQ_Pos)       /*!< 0x00000001 */\r
+#define CAN_TI0R_TXRQ                        CAN_TI0R_TXRQ_Msk                 /*!< Transmit Mailbox Request */\r
+#define CAN_TI0R_RTR_Pos                     (1U)                              \r
+#define CAN_TI0R_RTR_Msk                     (0x1UL << CAN_TI0R_RTR_Pos)        /*!< 0x00000002 */\r
+#define CAN_TI0R_RTR                         CAN_TI0R_RTR_Msk                  /*!< Remote Transmission Request */\r
+#define CAN_TI0R_IDE_Pos                     (2U)                              \r
+#define CAN_TI0R_IDE_Msk                     (0x1UL << CAN_TI0R_IDE_Pos)        /*!< 0x00000004 */\r
+#define CAN_TI0R_IDE                         CAN_TI0R_IDE_Msk                  /*!< Identifier Extension */\r
+#define CAN_TI0R_EXID_Pos                    (3U)                              \r
+#define CAN_TI0R_EXID_Msk                    (0x3FFFFUL << CAN_TI0R_EXID_Pos)   /*!< 0x001FFFF8 */\r
+#define CAN_TI0R_EXID                        CAN_TI0R_EXID_Msk                 /*!< Extended Identifier */\r
+#define CAN_TI0R_STID_Pos                    (21U)                             \r
+#define CAN_TI0R_STID_Msk                    (0x7FFUL << CAN_TI0R_STID_Pos)     /*!< 0xFFE00000 */\r
+#define CAN_TI0R_STID                        CAN_TI0R_STID_Msk                 /*!< Standard Identifier or Extended Identifier */\r
+\r
+/******************  Bit definition for CAN_TDT0R register  *******************/\r
+#define CAN_TDT0R_DLC_Pos                    (0U)                              \r
+#define CAN_TDT0R_DLC_Msk                    (0xFUL << CAN_TDT0R_DLC_Pos)       /*!< 0x0000000F */\r
+#define CAN_TDT0R_DLC                        CAN_TDT0R_DLC_Msk                 /*!< Data Length Code */\r
+#define CAN_TDT0R_TGT_Pos                    (8U)                              \r
+#define CAN_TDT0R_TGT_Msk                    (0x1UL << CAN_TDT0R_TGT_Pos)       /*!< 0x00000100 */\r
+#define CAN_TDT0R_TGT                        CAN_TDT0R_TGT_Msk                 /*!< Transmit Global Time */\r
+#define CAN_TDT0R_TIME_Pos                   (16U)                             \r
+#define CAN_TDT0R_TIME_Msk                   (0xFFFFUL << CAN_TDT0R_TIME_Pos)   /*!< 0xFFFF0000 */\r
+#define CAN_TDT0R_TIME                       CAN_TDT0R_TIME_Msk                /*!< Message Time Stamp */\r
+\r
+/******************  Bit definition for CAN_TDL0R register  *******************/\r
+#define CAN_TDL0R_DATA0_Pos                  (0U)                              \r
+#define CAN_TDL0R_DATA0_Msk                  (0xFFUL << CAN_TDL0R_DATA0_Pos)    /*!< 0x000000FF */\r
+#define CAN_TDL0R_DATA0                      CAN_TDL0R_DATA0_Msk               /*!< Data byte 0 */\r
+#define CAN_TDL0R_DATA1_Pos                  (8U)                              \r
+#define CAN_TDL0R_DATA1_Msk                  (0xFFUL << CAN_TDL0R_DATA1_Pos)    /*!< 0x0000FF00 */\r
+#define CAN_TDL0R_DATA1                      CAN_TDL0R_DATA1_Msk               /*!< Data byte 1 */\r
+#define CAN_TDL0R_DATA2_Pos                  (16U)                             \r
+#define CAN_TDL0R_DATA2_Msk                  (0xFFUL << CAN_TDL0R_DATA2_Pos)    /*!< 0x00FF0000 */\r
+#define CAN_TDL0R_DATA2                      CAN_TDL0R_DATA2_Msk               /*!< Data byte 2 */\r
+#define CAN_TDL0R_DATA3_Pos                  (24U)                             \r
+#define CAN_TDL0R_DATA3_Msk                  (0xFFUL << CAN_TDL0R_DATA3_Pos)    /*!< 0xFF000000 */\r
+#define CAN_TDL0R_DATA3                      CAN_TDL0R_DATA3_Msk               /*!< Data byte 3 */\r
+\r
+/******************  Bit definition for CAN_TDH0R register  *******************/\r
+#define CAN_TDH0R_DATA4_Pos                  (0U)                              \r
+#define CAN_TDH0R_DATA4_Msk                  (0xFFUL << CAN_TDH0R_DATA4_Pos)    /*!< 0x000000FF */\r
+#define CAN_TDH0R_DATA4                      CAN_TDH0R_DATA4_Msk               /*!< Data byte 4 */\r
+#define CAN_TDH0R_DATA5_Pos                  (8U)                              \r
+#define CAN_TDH0R_DATA5_Msk                  (0xFFUL << CAN_TDH0R_DATA5_Pos)    /*!< 0x0000FF00 */\r
+#define CAN_TDH0R_DATA5                      CAN_TDH0R_DATA5_Msk               /*!< Data byte 5 */\r
+#define CAN_TDH0R_DATA6_Pos                  (16U)                             \r
+#define CAN_TDH0R_DATA6_Msk                  (0xFFUL << CAN_TDH0R_DATA6_Pos)    /*!< 0x00FF0000 */\r
+#define CAN_TDH0R_DATA6                      CAN_TDH0R_DATA6_Msk               /*!< Data byte 6 */\r
+#define CAN_TDH0R_DATA7_Pos                  (24U)                             \r
+#define CAN_TDH0R_DATA7_Msk                  (0xFFUL << CAN_TDH0R_DATA7_Pos)    /*!< 0xFF000000 */\r
+#define CAN_TDH0R_DATA7                      CAN_TDH0R_DATA7_Msk               /*!< Data byte 7 */\r
+\r
+/*******************  Bit definition for CAN_TI1R register  *******************/\r
+#define CAN_TI1R_TXRQ_Pos                    (0U)                              \r
+#define CAN_TI1R_TXRQ_Msk                    (0x1UL << CAN_TI1R_TXRQ_Pos)       /*!< 0x00000001 */\r
+#define CAN_TI1R_TXRQ                        CAN_TI1R_TXRQ_Msk                 /*!< Transmit Mailbox Request */\r
+#define CAN_TI1R_RTR_Pos                     (1U)                              \r
+#define CAN_TI1R_RTR_Msk                     (0x1UL << CAN_TI1R_RTR_Pos)        /*!< 0x00000002 */\r
+#define CAN_TI1R_RTR                         CAN_TI1R_RTR_Msk                  /*!< Remote Transmission Request */\r
+#define CAN_TI1R_IDE_Pos                     (2U)                              \r
+#define CAN_TI1R_IDE_Msk                     (0x1UL << CAN_TI1R_IDE_Pos)        /*!< 0x00000004 */\r
+#define CAN_TI1R_IDE                         CAN_TI1R_IDE_Msk                  /*!< Identifier Extension */\r
+#define CAN_TI1R_EXID_Pos                    (3U)                              \r
+#define CAN_TI1R_EXID_Msk                    (0x3FFFFUL << CAN_TI1R_EXID_Pos)   /*!< 0x001FFFF8 */\r
+#define CAN_TI1R_EXID                        CAN_TI1R_EXID_Msk                 /*!< Extended Identifier */\r
+#define CAN_TI1R_STID_Pos                    (21U)                             \r
+#define CAN_TI1R_STID_Msk                    (0x7FFUL << CAN_TI1R_STID_Pos)     /*!< 0xFFE00000 */\r
+#define CAN_TI1R_STID                        CAN_TI1R_STID_Msk                 /*!< Standard Identifier or Extended Identifier */\r
+\r
+/*******************  Bit definition for CAN_TDT1R register  ******************/\r
+#define CAN_TDT1R_DLC_Pos                    (0U)                              \r
+#define CAN_TDT1R_DLC_Msk                    (0xFUL << CAN_TDT1R_DLC_Pos)       /*!< 0x0000000F */\r
+#define CAN_TDT1R_DLC                        CAN_TDT1R_DLC_Msk                 /*!< Data Length Code */\r
+#define CAN_TDT1R_TGT_Pos                    (8U)                              \r
+#define CAN_TDT1R_TGT_Msk                    (0x1UL << CAN_TDT1R_TGT_Pos)       /*!< 0x00000100 */\r
+#define CAN_TDT1R_TGT                        CAN_TDT1R_TGT_Msk                 /*!< Transmit Global Time */\r
+#define CAN_TDT1R_TIME_Pos                   (16U)                             \r
+#define CAN_TDT1R_TIME_Msk                   (0xFFFFUL << CAN_TDT1R_TIME_Pos)   /*!< 0xFFFF0000 */\r
+#define CAN_TDT1R_TIME                       CAN_TDT1R_TIME_Msk                /*!< Message Time Stamp */\r
+\r
+/*******************  Bit definition for CAN_TDL1R register  ******************/\r
+#define CAN_TDL1R_DATA0_Pos                  (0U)                              \r
+#define CAN_TDL1R_DATA0_Msk                  (0xFFUL << CAN_TDL1R_DATA0_Pos)    /*!< 0x000000FF */\r
+#define CAN_TDL1R_DATA0                      CAN_TDL1R_DATA0_Msk               /*!< Data byte 0 */\r
+#define CAN_TDL1R_DATA1_Pos                  (8U)                              \r
+#define CAN_TDL1R_DATA1_Msk                  (0xFFUL << CAN_TDL1R_DATA1_Pos)    /*!< 0x0000FF00 */\r
+#define CAN_TDL1R_DATA1                      CAN_TDL1R_DATA1_Msk               /*!< Data byte 1 */\r
+#define CAN_TDL1R_DATA2_Pos                  (16U)                             \r
+#define CAN_TDL1R_DATA2_Msk                  (0xFFUL << CAN_TDL1R_DATA2_Pos)    /*!< 0x00FF0000 */\r
+#define CAN_TDL1R_DATA2                      CAN_TDL1R_DATA2_Msk               /*!< Data byte 2 */\r
+#define CAN_TDL1R_DATA3_Pos                  (24U)                             \r
+#define CAN_TDL1R_DATA3_Msk                  (0xFFUL << CAN_TDL1R_DATA3_Pos)    /*!< 0xFF000000 */\r
+#define CAN_TDL1R_DATA3                      CAN_TDL1R_DATA3_Msk               /*!< Data byte 3 */\r
+\r
+/*******************  Bit definition for CAN_TDH1R register  ******************/\r
+#define CAN_TDH1R_DATA4_Pos                  (0U)                              \r
+#define CAN_TDH1R_DATA4_Msk                  (0xFFUL << CAN_TDH1R_DATA4_Pos)    /*!< 0x000000FF */\r
+#define CAN_TDH1R_DATA4                      CAN_TDH1R_DATA4_Msk               /*!< Data byte 4 */\r
+#define CAN_TDH1R_DATA5_Pos                  (8U)                              \r
+#define CAN_TDH1R_DATA5_Msk                  (0xFFUL << CAN_TDH1R_DATA5_Pos)    /*!< 0x0000FF00 */\r
+#define CAN_TDH1R_DATA5                      CAN_TDH1R_DATA5_Msk               /*!< Data byte 5 */\r
+#define CAN_TDH1R_DATA6_Pos                  (16U)                             \r
+#define CAN_TDH1R_DATA6_Msk                  (0xFFUL << CAN_TDH1R_DATA6_Pos)    /*!< 0x00FF0000 */\r
+#define CAN_TDH1R_DATA6                      CAN_TDH1R_DATA6_Msk               /*!< Data byte 6 */\r
+#define CAN_TDH1R_DATA7_Pos                  (24U)                             \r
+#define CAN_TDH1R_DATA7_Msk                  (0xFFUL << CAN_TDH1R_DATA7_Pos)    /*!< 0xFF000000 */\r
+#define CAN_TDH1R_DATA7                      CAN_TDH1R_DATA7_Msk               /*!< Data byte 7 */\r
+\r
+/*******************  Bit definition for CAN_TI2R register  *******************/\r
+#define CAN_TI2R_TXRQ_Pos                    (0U)                              \r
+#define CAN_TI2R_TXRQ_Msk                    (0x1UL << CAN_TI2R_TXRQ_Pos)       /*!< 0x00000001 */\r
+#define CAN_TI2R_TXRQ                        CAN_TI2R_TXRQ_Msk                 /*!< Transmit Mailbox Request */\r
+#define CAN_TI2R_RTR_Pos                     (1U)                              \r
+#define CAN_TI2R_RTR_Msk                     (0x1UL << CAN_TI2R_RTR_Pos)        /*!< 0x00000002 */\r
+#define CAN_TI2R_RTR                         CAN_TI2R_RTR_Msk                  /*!< Remote Transmission Request */\r
+#define CAN_TI2R_IDE_Pos                     (2U)                              \r
+#define CAN_TI2R_IDE_Msk                     (0x1UL << CAN_TI2R_IDE_Pos)        /*!< 0x00000004 */\r
+#define CAN_TI2R_IDE                         CAN_TI2R_IDE_Msk                  /*!< Identifier Extension */\r
+#define CAN_TI2R_EXID_Pos                    (3U)                              \r
+#define CAN_TI2R_EXID_Msk                    (0x3FFFFUL << CAN_TI2R_EXID_Pos)   /*!< 0x001FFFF8 */\r
+#define CAN_TI2R_EXID                        CAN_TI2R_EXID_Msk                 /*!< Extended identifier */\r
+#define CAN_TI2R_STID_Pos                    (21U)                             \r
+#define CAN_TI2R_STID_Msk                    (0x7FFUL << CAN_TI2R_STID_Pos)     /*!< 0xFFE00000 */\r
+#define CAN_TI2R_STID                        CAN_TI2R_STID_Msk                 /*!< Standard Identifier or Extended Identifier */\r
+\r
+/*******************  Bit definition for CAN_TDT2R register  ******************/  \r
+#define CAN_TDT2R_DLC_Pos                    (0U)                              \r
+#define CAN_TDT2R_DLC_Msk                    (0xFUL << CAN_TDT2R_DLC_Pos)       /*!< 0x0000000F */\r
+#define CAN_TDT2R_DLC                        CAN_TDT2R_DLC_Msk                 /*!< Data Length Code */\r
+#define CAN_TDT2R_TGT_Pos                    (8U)                              \r
+#define CAN_TDT2R_TGT_Msk                    (0x1UL << CAN_TDT2R_TGT_Pos)       /*!< 0x00000100 */\r
+#define CAN_TDT2R_TGT                        CAN_TDT2R_TGT_Msk                 /*!< Transmit Global Time */\r
+#define CAN_TDT2R_TIME_Pos                   (16U)                             \r
+#define CAN_TDT2R_TIME_Msk                   (0xFFFFUL << CAN_TDT2R_TIME_Pos)   /*!< 0xFFFF0000 */\r
+#define CAN_TDT2R_TIME                       CAN_TDT2R_TIME_Msk                /*!< Message Time Stamp */\r
+\r
+/*******************  Bit definition for CAN_TDL2R register  ******************/\r
+#define CAN_TDL2R_DATA0_Pos                  (0U)                              \r
+#define CAN_TDL2R_DATA0_Msk                  (0xFFUL << CAN_TDL2R_DATA0_Pos)    /*!< 0x000000FF */\r
+#define CAN_TDL2R_DATA0                      CAN_TDL2R_DATA0_Msk               /*!< Data byte 0 */\r
+#define CAN_TDL2R_DATA1_Pos                  (8U)                              \r
+#define CAN_TDL2R_DATA1_Msk                  (0xFFUL << CAN_TDL2R_DATA1_Pos)    /*!< 0x0000FF00 */\r
+#define CAN_TDL2R_DATA1                      CAN_TDL2R_DATA1_Msk               /*!< Data byte 1 */\r
+#define CAN_TDL2R_DATA2_Pos                  (16U)                             \r
+#define CAN_TDL2R_DATA2_Msk                  (0xFFUL << CAN_TDL2R_DATA2_Pos)    /*!< 0x00FF0000 */\r
+#define CAN_TDL2R_DATA2                      CAN_TDL2R_DATA2_Msk               /*!< Data byte 2 */\r
+#define CAN_TDL2R_DATA3_Pos                  (24U)                             \r
+#define CAN_TDL2R_DATA3_Msk                  (0xFFUL << CAN_TDL2R_DATA3_Pos)    /*!< 0xFF000000 */\r
+#define CAN_TDL2R_DATA3                      CAN_TDL2R_DATA3_Msk               /*!< Data byte 3 */\r
+\r
+/*******************  Bit definition for CAN_TDH2R register  ******************/\r
+#define CAN_TDH2R_DATA4_Pos                  (0U)                              \r
+#define CAN_TDH2R_DATA4_Msk                  (0xFFUL << CAN_TDH2R_DATA4_Pos)    /*!< 0x000000FF */\r
+#define CAN_TDH2R_DATA4                      CAN_TDH2R_DATA4_Msk               /*!< Data byte 4 */\r
+#define CAN_TDH2R_DATA5_Pos                  (8U)                              \r
+#define CAN_TDH2R_DATA5_Msk                  (0xFFUL << CAN_TDH2R_DATA5_Pos)    /*!< 0x0000FF00 */\r
+#define CAN_TDH2R_DATA5                      CAN_TDH2R_DATA5_Msk               /*!< Data byte 5 */\r
+#define CAN_TDH2R_DATA6_Pos                  (16U)                             \r
+#define CAN_TDH2R_DATA6_Msk                  (0xFFUL << CAN_TDH2R_DATA6_Pos)    /*!< 0x00FF0000 */\r
+#define CAN_TDH2R_DATA6                      CAN_TDH2R_DATA6_Msk               /*!< Data byte 6 */\r
+#define CAN_TDH2R_DATA7_Pos                  (24U)                             \r
+#define CAN_TDH2R_DATA7_Msk                  (0xFFUL << CAN_TDH2R_DATA7_Pos)    /*!< 0xFF000000 */\r
+#define CAN_TDH2R_DATA7                      CAN_TDH2R_DATA7_Msk               /*!< Data byte 7 */\r
+\r
+/*******************  Bit definition for CAN_RI0R register  *******************/\r
+#define CAN_RI0R_RTR_Pos                     (1U)                              \r
+#define CAN_RI0R_RTR_Msk                     (0x1UL << CAN_RI0R_RTR_Pos)        /*!< 0x00000002 */\r
+#define CAN_RI0R_RTR                         CAN_RI0R_RTR_Msk                  /*!< Remote Transmission Request */\r
+#define CAN_RI0R_IDE_Pos                     (2U)                              \r
+#define CAN_RI0R_IDE_Msk                     (0x1UL << CAN_RI0R_IDE_Pos)        /*!< 0x00000004 */\r
+#define CAN_RI0R_IDE                         CAN_RI0R_IDE_Msk                  /*!< Identifier Extension */\r
+#define CAN_RI0R_EXID_Pos                    (3U)                              \r
+#define CAN_RI0R_EXID_Msk                    (0x3FFFFUL << CAN_RI0R_EXID_Pos)   /*!< 0x001FFFF8 */\r
+#define CAN_RI0R_EXID                        CAN_RI0R_EXID_Msk                 /*!< Extended Identifier */\r
+#define CAN_RI0R_STID_Pos                    (21U)                             \r
+#define CAN_RI0R_STID_Msk                    (0x7FFUL << CAN_RI0R_STID_Pos)     /*!< 0xFFE00000 */\r
+#define CAN_RI0R_STID                        CAN_RI0R_STID_Msk                 /*!< Standard Identifier or Extended Identifier */\r
+\r
+/*******************  Bit definition for CAN_RDT0R register  ******************/\r
+#define CAN_RDT0R_DLC_Pos                    (0U)                              \r
+#define CAN_RDT0R_DLC_Msk                    (0xFUL << CAN_RDT0R_DLC_Pos)       /*!< 0x0000000F */\r
+#define CAN_RDT0R_DLC                        CAN_RDT0R_DLC_Msk                 /*!< Data Length Code */\r
+#define CAN_RDT0R_FMI_Pos                    (8U)                              \r
+#define CAN_RDT0R_FMI_Msk                    (0xFFUL << CAN_RDT0R_FMI_Pos)      /*!< 0x0000FF00 */\r
+#define CAN_RDT0R_FMI                        CAN_RDT0R_FMI_Msk                 /*!< Filter Match Index */\r
+#define CAN_RDT0R_TIME_Pos                   (16U)                             \r
+#define CAN_RDT0R_TIME_Msk                   (0xFFFFUL << CAN_RDT0R_TIME_Pos)   /*!< 0xFFFF0000 */\r
+#define CAN_RDT0R_TIME                       CAN_RDT0R_TIME_Msk                /*!< Message Time Stamp */\r
+\r
+/*******************  Bit definition for CAN_RDL0R register  ******************/\r
+#define CAN_RDL0R_DATA0_Pos                  (0U)                              \r
+#define CAN_RDL0R_DATA0_Msk                  (0xFFUL << CAN_RDL0R_DATA0_Pos)    /*!< 0x000000FF */\r
+#define CAN_RDL0R_DATA0                      CAN_RDL0R_DATA0_Msk               /*!< Data byte 0 */\r
+#define CAN_RDL0R_DATA1_Pos                  (8U)                              \r
+#define CAN_RDL0R_DATA1_Msk                  (0xFFUL << CAN_RDL0R_DATA1_Pos)    /*!< 0x0000FF00 */\r
+#define CAN_RDL0R_DATA1                      CAN_RDL0R_DATA1_Msk               /*!< Data byte 1 */\r
+#define CAN_RDL0R_DATA2_Pos                  (16U)                             \r
+#define CAN_RDL0R_DATA2_Msk                  (0xFFUL << CAN_RDL0R_DATA2_Pos)    /*!< 0x00FF0000 */\r
+#define CAN_RDL0R_DATA2                      CAN_RDL0R_DATA2_Msk               /*!< Data byte 2 */\r
+#define CAN_RDL0R_DATA3_Pos                  (24U)                             \r
+#define CAN_RDL0R_DATA3_Msk                  (0xFFUL << CAN_RDL0R_DATA3_Pos)    /*!< 0xFF000000 */\r
+#define CAN_RDL0R_DATA3                      CAN_RDL0R_DATA3_Msk               /*!< Data byte 3 */\r
+\r
+/*******************  Bit definition for CAN_RDH0R register  ******************/\r
+#define CAN_RDH0R_DATA4_Pos                  (0U)                              \r
+#define CAN_RDH0R_DATA4_Msk                  (0xFFUL << CAN_RDH0R_DATA4_Pos)    /*!< 0x000000FF */\r
+#define CAN_RDH0R_DATA4                      CAN_RDH0R_DATA4_Msk               /*!< Data byte 4 */\r
+#define CAN_RDH0R_DATA5_Pos                  (8U)                              \r
+#define CAN_RDH0R_DATA5_Msk                  (0xFFUL << CAN_RDH0R_DATA5_Pos)    /*!< 0x0000FF00 */\r
+#define CAN_RDH0R_DATA5                      CAN_RDH0R_DATA5_Msk               /*!< Data byte 5 */\r
+#define CAN_RDH0R_DATA6_Pos                  (16U)                             \r
+#define CAN_RDH0R_DATA6_Msk                  (0xFFUL << CAN_RDH0R_DATA6_Pos)    /*!< 0x00FF0000 */\r
+#define CAN_RDH0R_DATA6                      CAN_RDH0R_DATA6_Msk               /*!< Data byte 6 */\r
+#define CAN_RDH0R_DATA7_Pos                  (24U)                             \r
+#define CAN_RDH0R_DATA7_Msk                  (0xFFUL << CAN_RDH0R_DATA7_Pos)    /*!< 0xFF000000 */\r
+#define CAN_RDH0R_DATA7                      CAN_RDH0R_DATA7_Msk               /*!< Data byte 7 */\r
+\r
+/*******************  Bit definition for CAN_RI1R register  *******************/\r
+#define CAN_RI1R_RTR_Pos                     (1U)                              \r
+#define CAN_RI1R_RTR_Msk                     (0x1UL << CAN_RI1R_RTR_Pos)        /*!< 0x00000002 */\r
+#define CAN_RI1R_RTR                         CAN_RI1R_RTR_Msk                  /*!< Remote Transmission Request */\r
+#define CAN_RI1R_IDE_Pos                     (2U)                              \r
+#define CAN_RI1R_IDE_Msk                     (0x1UL << CAN_RI1R_IDE_Pos)        /*!< 0x00000004 */\r
+#define CAN_RI1R_IDE                         CAN_RI1R_IDE_Msk                  /*!< Identifier Extension */\r
+#define CAN_RI1R_EXID_Pos                    (3U)                              \r
+#define CAN_RI1R_EXID_Msk                    (0x3FFFFUL << CAN_RI1R_EXID_Pos)   /*!< 0x001FFFF8 */\r
+#define CAN_RI1R_EXID                        CAN_RI1R_EXID_Msk                 /*!< Extended identifier */\r
+#define CAN_RI1R_STID_Pos                    (21U)                             \r
+#define CAN_RI1R_STID_Msk                    (0x7FFUL << CAN_RI1R_STID_Pos)     /*!< 0xFFE00000 */\r
+#define CAN_RI1R_STID                        CAN_RI1R_STID_Msk                 /*!< Standard Identifier or Extended Identifier */\r
+\r
+/*******************  Bit definition for CAN_RDT1R register  ******************/\r
+#define CAN_RDT1R_DLC_Pos                    (0U)                              \r
+#define CAN_RDT1R_DLC_Msk                    (0xFUL << CAN_RDT1R_DLC_Pos)       /*!< 0x0000000F */\r
+#define CAN_RDT1R_DLC                        CAN_RDT1R_DLC_Msk                 /*!< Data Length Code */\r
+#define CAN_RDT1R_FMI_Pos                    (8U)                              \r
+#define CAN_RDT1R_FMI_Msk                    (0xFFUL << CAN_RDT1R_FMI_Pos)      /*!< 0x0000FF00 */\r
+#define CAN_RDT1R_FMI                        CAN_RDT1R_FMI_Msk                 /*!< Filter Match Index */\r
+#define CAN_RDT1R_TIME_Pos                   (16U)                             \r
+#define CAN_RDT1R_TIME_Msk                   (0xFFFFUL << CAN_RDT1R_TIME_Pos)   /*!< 0xFFFF0000 */\r
+#define CAN_RDT1R_TIME                       CAN_RDT1R_TIME_Msk                /*!< Message Time Stamp */\r
+\r
+/*******************  Bit definition for CAN_RDL1R register  ******************/\r
+#define CAN_RDL1R_DATA0_Pos                  (0U)                              \r
+#define CAN_RDL1R_DATA0_Msk                  (0xFFUL << CAN_RDL1R_DATA0_Pos)    /*!< 0x000000FF */\r
+#define CAN_RDL1R_DATA0                      CAN_RDL1R_DATA0_Msk               /*!< Data byte 0 */\r
+#define CAN_RDL1R_DATA1_Pos                  (8U)                              \r
+#define CAN_RDL1R_DATA1_Msk                  (0xFFUL << CAN_RDL1R_DATA1_Pos)    /*!< 0x0000FF00 */\r
+#define CAN_RDL1R_DATA1                      CAN_RDL1R_DATA1_Msk               /*!< Data byte 1 */\r
+#define CAN_RDL1R_DATA2_Pos                  (16U)                             \r
+#define CAN_RDL1R_DATA2_Msk                  (0xFFUL << CAN_RDL1R_DATA2_Pos)    /*!< 0x00FF0000 */\r
+#define CAN_RDL1R_DATA2                      CAN_RDL1R_DATA2_Msk               /*!< Data byte 2 */\r
+#define CAN_RDL1R_DATA3_Pos                  (24U)                             \r
+#define CAN_RDL1R_DATA3_Msk                  (0xFFUL << CAN_RDL1R_DATA3_Pos)    /*!< 0xFF000000 */\r
+#define CAN_RDL1R_DATA3                      CAN_RDL1R_DATA3_Msk               /*!< Data byte 3 */\r
+\r
+/*******************  Bit definition for CAN_RDH1R register  ******************/\r
+#define CAN_RDH1R_DATA4_Pos                  (0U)                              \r
+#define CAN_RDH1R_DATA4_Msk                  (0xFFUL << CAN_RDH1R_DATA4_Pos)    /*!< 0x000000FF */\r
+#define CAN_RDH1R_DATA4                      CAN_RDH1R_DATA4_Msk               /*!< Data byte 4 */\r
+#define CAN_RDH1R_DATA5_Pos                  (8U)                              \r
+#define CAN_RDH1R_DATA5_Msk                  (0xFFUL << CAN_RDH1R_DATA5_Pos)    /*!< 0x0000FF00 */\r
+#define CAN_RDH1R_DATA5                      CAN_RDH1R_DATA5_Msk               /*!< Data byte 5 */\r
+#define CAN_RDH1R_DATA6_Pos                  (16U)                             \r
+#define CAN_RDH1R_DATA6_Msk                  (0xFFUL << CAN_RDH1R_DATA6_Pos)    /*!< 0x00FF0000 */\r
+#define CAN_RDH1R_DATA6                      CAN_RDH1R_DATA6_Msk               /*!< Data byte 6 */\r
+#define CAN_RDH1R_DATA7_Pos                  (24U)                             \r
+#define CAN_RDH1R_DATA7_Msk                  (0xFFUL << CAN_RDH1R_DATA7_Pos)    /*!< 0xFF000000 */\r
+#define CAN_RDH1R_DATA7                      CAN_RDH1R_DATA7_Msk               /*!< Data byte 7 */\r
+\r
+/*!< CAN filter registers */\r
+/*******************  Bit definition for CAN_FMR register  ********************/\r
+#define CAN_FMR_FINIT_Pos                    (0U)                              \r
+#define CAN_FMR_FINIT_Msk                    (0x1UL << CAN_FMR_FINIT_Pos)       /*!< 0x00000001 */\r
+#define CAN_FMR_FINIT                        CAN_FMR_FINIT_Msk                 /*!< Filter Init Mode */\r
+#define CAN_FMR_CAN2SB_Pos                   (8U)                              \r
+#define CAN_FMR_CAN2SB_Msk                   (0x3FUL << CAN_FMR_CAN2SB_Pos)     /*!< 0x00003F00 */\r
+#define CAN_FMR_CAN2SB                       CAN_FMR_CAN2SB_Msk                /*!< CAN2 start bank */\r
+\r
+/*******************  Bit definition for CAN_FM1R register  *******************/\r
+#define CAN_FM1R_FBM_Pos                     (0U)                              \r
+#define CAN_FM1R_FBM_Msk                     (0x3FFFUL << CAN_FM1R_FBM_Pos)     /*!< 0x00003FFF */\r
+#define CAN_FM1R_FBM                         CAN_FM1R_FBM_Msk                  /*!< Filter Mode */\r
+#define CAN_FM1R_FBM0_Pos                    (0U)                              \r
+#define CAN_FM1R_FBM0_Msk                    (0x1UL << CAN_FM1R_FBM0_Pos)       /*!< 0x00000001 */\r
+#define CAN_FM1R_FBM0                        CAN_FM1R_FBM0_Msk                 /*!< Filter Init Mode for filter 0 */\r
+#define CAN_FM1R_FBM1_Pos                    (1U)                              \r
+#define CAN_FM1R_FBM1_Msk                    (0x1UL << CAN_FM1R_FBM1_Pos)       /*!< 0x00000002 */\r
+#define CAN_FM1R_FBM1                        CAN_FM1R_FBM1_Msk                 /*!< Filter Init Mode for filter 1 */\r
+#define CAN_FM1R_FBM2_Pos                    (2U)                              \r
+#define CAN_FM1R_FBM2_Msk                    (0x1UL << CAN_FM1R_FBM2_Pos)       /*!< 0x00000004 */\r
+#define CAN_FM1R_FBM2                        CAN_FM1R_FBM2_Msk                 /*!< Filter Init Mode for filter 2 */\r
+#define CAN_FM1R_FBM3_Pos                    (3U)                              \r
+#define CAN_FM1R_FBM3_Msk                    (0x1UL << CAN_FM1R_FBM3_Pos)       /*!< 0x00000008 */\r
+#define CAN_FM1R_FBM3                        CAN_FM1R_FBM3_Msk                 /*!< Filter Init Mode for filter 3 */\r
+#define CAN_FM1R_FBM4_Pos                    (4U)                              \r
+#define CAN_FM1R_FBM4_Msk                    (0x1UL << CAN_FM1R_FBM4_Pos)       /*!< 0x00000010 */\r
+#define CAN_FM1R_FBM4                        CAN_FM1R_FBM4_Msk                 /*!< Filter Init Mode for filter 4 */\r
+#define CAN_FM1R_FBM5_Pos                    (5U)                              \r
+#define CAN_FM1R_FBM5_Msk                    (0x1UL << CAN_FM1R_FBM5_Pos)       /*!< 0x00000020 */\r
+#define CAN_FM1R_FBM5                        CAN_FM1R_FBM5_Msk                 /*!< Filter Init Mode for filter 5 */\r
+#define CAN_FM1R_FBM6_Pos                    (6U)                              \r
+#define CAN_FM1R_FBM6_Msk                    (0x1UL << CAN_FM1R_FBM6_Pos)       /*!< 0x00000040 */\r
+#define CAN_FM1R_FBM6                        CAN_FM1R_FBM6_Msk                 /*!< Filter Init Mode for filter 6 */\r
+#define CAN_FM1R_FBM7_Pos                    (7U)                              \r
+#define CAN_FM1R_FBM7_Msk                    (0x1UL << CAN_FM1R_FBM7_Pos)       /*!< 0x00000080 */\r
+#define CAN_FM1R_FBM7                        CAN_FM1R_FBM7_Msk                 /*!< Filter Init Mode for filter 7 */\r
+#define CAN_FM1R_FBM8_Pos                    (8U)                              \r
+#define CAN_FM1R_FBM8_Msk                    (0x1UL << CAN_FM1R_FBM8_Pos)       /*!< 0x00000100 */\r
+#define CAN_FM1R_FBM8                        CAN_FM1R_FBM8_Msk                 /*!< Filter Init Mode for filter 8 */\r
+#define CAN_FM1R_FBM9_Pos                    (9U)                              \r
+#define CAN_FM1R_FBM9_Msk                    (0x1UL << CAN_FM1R_FBM9_Pos)       /*!< 0x00000200 */\r
+#define CAN_FM1R_FBM9                        CAN_FM1R_FBM9_Msk                 /*!< Filter Init Mode for filter 9 */\r
+#define CAN_FM1R_FBM10_Pos                   (10U)                             \r
+#define CAN_FM1R_FBM10_Msk                   (0x1UL << CAN_FM1R_FBM10_Pos)      /*!< 0x00000400 */\r
+#define CAN_FM1R_FBM10                       CAN_FM1R_FBM10_Msk                /*!< Filter Init Mode for filter 10 */\r
+#define CAN_FM1R_FBM11_Pos                   (11U)                             \r
+#define CAN_FM1R_FBM11_Msk                   (0x1UL << CAN_FM1R_FBM11_Pos)      /*!< 0x00000800 */\r
+#define CAN_FM1R_FBM11                       CAN_FM1R_FBM11_Msk                /*!< Filter Init Mode for filter 11 */\r
+#define CAN_FM1R_FBM12_Pos                   (12U)                             \r
+#define CAN_FM1R_FBM12_Msk                   (0x1UL << CAN_FM1R_FBM12_Pos)      /*!< 0x00001000 */\r
+#define CAN_FM1R_FBM12                       CAN_FM1R_FBM12_Msk                /*!< Filter Init Mode for filter 12 */\r
+#define CAN_FM1R_FBM13_Pos                   (13U)                             \r
+#define CAN_FM1R_FBM13_Msk                   (0x1UL << CAN_FM1R_FBM13_Pos)      /*!< 0x00002000 */\r
+#define CAN_FM1R_FBM13                       CAN_FM1R_FBM13_Msk                /*!< Filter Init Mode for filter 13 */\r
+\r
+/*******************  Bit definition for CAN_FS1R register  *******************/\r
+#define CAN_FS1R_FSC_Pos                     (0U)                              \r
+#define CAN_FS1R_FSC_Msk                     (0x3FFFUL << CAN_FS1R_FSC_Pos)     /*!< 0x00003FFF */\r
+#define CAN_FS1R_FSC                         CAN_FS1R_FSC_Msk                  /*!< Filter Scale Configuration */\r
+#define CAN_FS1R_FSC0_Pos                    (0U)                              \r
+#define CAN_FS1R_FSC0_Msk                    (0x1UL << CAN_FS1R_FSC0_Pos)       /*!< 0x00000001 */\r
+#define CAN_FS1R_FSC0                        CAN_FS1R_FSC0_Msk                 /*!< Filter Scale Configuration for filter 0 */\r
+#define CAN_FS1R_FSC1_Pos                    (1U)                              \r
+#define CAN_FS1R_FSC1_Msk                    (0x1UL << CAN_FS1R_FSC1_Pos)       /*!< 0x00000002 */\r
+#define CAN_FS1R_FSC1                        CAN_FS1R_FSC1_Msk                 /*!< Filter Scale Configuration for filter 1 */\r
+#define CAN_FS1R_FSC2_Pos                    (2U)                              \r
+#define CAN_FS1R_FSC2_Msk                    (0x1UL << CAN_FS1R_FSC2_Pos)       /*!< 0x00000004 */\r
+#define CAN_FS1R_FSC2                        CAN_FS1R_FSC2_Msk                 /*!< Filter Scale Configuration for filter 2 */\r
+#define CAN_FS1R_FSC3_Pos                    (3U)                              \r
+#define CAN_FS1R_FSC3_Msk                    (0x1UL << CAN_FS1R_FSC3_Pos)       /*!< 0x00000008 */\r
+#define CAN_FS1R_FSC3                        CAN_FS1R_FSC3_Msk                 /*!< Filter Scale Configuration for filter 3 */\r
+#define CAN_FS1R_FSC4_Pos                    (4U)                              \r
+#define CAN_FS1R_FSC4_Msk                    (0x1UL << CAN_FS1R_FSC4_Pos)       /*!< 0x00000010 */\r
+#define CAN_FS1R_FSC4                        CAN_FS1R_FSC4_Msk                 /*!< Filter Scale Configuration for filter 4 */\r
+#define CAN_FS1R_FSC5_Pos                    (5U)                              \r
+#define CAN_FS1R_FSC5_Msk                    (0x1UL << CAN_FS1R_FSC5_Pos)       /*!< 0x00000020 */\r
+#define CAN_FS1R_FSC5                        CAN_FS1R_FSC5_Msk                 /*!< Filter Scale Configuration for filter 5 */\r
+#define CAN_FS1R_FSC6_Pos                    (6U)                              \r
+#define CAN_FS1R_FSC6_Msk                    (0x1UL << CAN_FS1R_FSC6_Pos)       /*!< 0x00000040 */\r
+#define CAN_FS1R_FSC6                        CAN_FS1R_FSC6_Msk                 /*!< Filter Scale Configuration for filter 6 */\r
+#define CAN_FS1R_FSC7_Pos                    (7U)                              \r
+#define CAN_FS1R_FSC7_Msk                    (0x1UL << CAN_FS1R_FSC7_Pos)       /*!< 0x00000080 */\r
+#define CAN_FS1R_FSC7                        CAN_FS1R_FSC7_Msk                 /*!< Filter Scale Configuration for filter 7 */\r
+#define CAN_FS1R_FSC8_Pos                    (8U)                              \r
+#define CAN_FS1R_FSC8_Msk                    (0x1UL << CAN_FS1R_FSC8_Pos)       /*!< 0x00000100 */\r
+#define CAN_FS1R_FSC8                        CAN_FS1R_FSC8_Msk                 /*!< Filter Scale Configuration for filter 8 */\r
+#define CAN_FS1R_FSC9_Pos                    (9U)                              \r
+#define CAN_FS1R_FSC9_Msk                    (0x1UL << CAN_FS1R_FSC9_Pos)       /*!< 0x00000200 */\r
+#define CAN_FS1R_FSC9                        CAN_FS1R_FSC9_Msk                 /*!< Filter Scale Configuration for filter 9 */\r
+#define CAN_FS1R_FSC10_Pos                   (10U)                             \r
+#define CAN_FS1R_FSC10_Msk                   (0x1UL << CAN_FS1R_FSC10_Pos)      /*!< 0x00000400 */\r
+#define CAN_FS1R_FSC10                       CAN_FS1R_FSC10_Msk                /*!< Filter Scale Configuration for filter 10 */\r
+#define CAN_FS1R_FSC11_Pos                   (11U)                             \r
+#define CAN_FS1R_FSC11_Msk                   (0x1UL << CAN_FS1R_FSC11_Pos)      /*!< 0x00000800 */\r
+#define CAN_FS1R_FSC11                       CAN_FS1R_FSC11_Msk                /*!< Filter Scale Configuration for filter 11 */\r
+#define CAN_FS1R_FSC12_Pos                   (12U)                             \r
+#define CAN_FS1R_FSC12_Msk                   (0x1UL << CAN_FS1R_FSC12_Pos)      /*!< 0x00001000 */\r
+#define CAN_FS1R_FSC12                       CAN_FS1R_FSC12_Msk                /*!< Filter Scale Configuration for filter 12 */\r
+#define CAN_FS1R_FSC13_Pos                   (13U)                             \r
+#define CAN_FS1R_FSC13_Msk                   (0x1UL << CAN_FS1R_FSC13_Pos)      /*!< 0x00002000 */\r
+#define CAN_FS1R_FSC13                       CAN_FS1R_FSC13_Msk                /*!< Filter Scale Configuration for filter 13 */\r
+\r
+/******************  Bit definition for CAN_FFA1R register  *******************/\r
+#define CAN_FFA1R_FFA_Pos                    (0U)                              \r
+#define CAN_FFA1R_FFA_Msk                    (0x3FFFUL << CAN_FFA1R_FFA_Pos)    /*!< 0x00003FFF */\r
+#define CAN_FFA1R_FFA                        CAN_FFA1R_FFA_Msk                 /*!< Filter FIFO Assignment */\r
+#define CAN_FFA1R_FFA0_Pos                   (0U)                              \r
+#define CAN_FFA1R_FFA0_Msk                   (0x1UL << CAN_FFA1R_FFA0_Pos)      /*!< 0x00000001 */\r
+#define CAN_FFA1R_FFA0                       CAN_FFA1R_FFA0_Msk                /*!< Filter FIFO Assignment for filter 0 */\r
+#define CAN_FFA1R_FFA1_Pos                   (1U)                              \r
+#define CAN_FFA1R_FFA1_Msk                   (0x1UL << CAN_FFA1R_FFA1_Pos)      /*!< 0x00000002 */\r
+#define CAN_FFA1R_FFA1                       CAN_FFA1R_FFA1_Msk                /*!< Filter FIFO Assignment for filter 1 */\r
+#define CAN_FFA1R_FFA2_Pos                   (2U)                              \r
+#define CAN_FFA1R_FFA2_Msk                   (0x1UL << CAN_FFA1R_FFA2_Pos)      /*!< 0x00000004 */\r
+#define CAN_FFA1R_FFA2                       CAN_FFA1R_FFA2_Msk                /*!< Filter FIFO Assignment for filter 2 */\r
+#define CAN_FFA1R_FFA3_Pos                   (3U)                              \r
+#define CAN_FFA1R_FFA3_Msk                   (0x1UL << CAN_FFA1R_FFA3_Pos)      /*!< 0x00000008 */\r
+#define CAN_FFA1R_FFA3                       CAN_FFA1R_FFA3_Msk                /*!< Filter FIFO Assignment for filter 3 */\r
+#define CAN_FFA1R_FFA4_Pos                   (4U)                              \r
+#define CAN_FFA1R_FFA4_Msk                   (0x1UL << CAN_FFA1R_FFA4_Pos)      /*!< 0x00000010 */\r
+#define CAN_FFA1R_FFA4                       CAN_FFA1R_FFA4_Msk                /*!< Filter FIFO Assignment for filter 4 */\r
+#define CAN_FFA1R_FFA5_Pos                   (5U)                              \r
+#define CAN_FFA1R_FFA5_Msk                   (0x1UL << CAN_FFA1R_FFA5_Pos)      /*!< 0x00000020 */\r
+#define CAN_FFA1R_FFA5                       CAN_FFA1R_FFA5_Msk                /*!< Filter FIFO Assignment for filter 5 */\r
+#define CAN_FFA1R_FFA6_Pos                   (6U)                              \r
+#define CAN_FFA1R_FFA6_Msk                   (0x1UL << CAN_FFA1R_FFA6_Pos)      /*!< 0x00000040 */\r
+#define CAN_FFA1R_FFA6                       CAN_FFA1R_FFA6_Msk                /*!< Filter FIFO Assignment for filter 6 */\r
+#define CAN_FFA1R_FFA7_Pos                   (7U)                              \r
+#define CAN_FFA1R_FFA7_Msk                   (0x1UL << CAN_FFA1R_FFA7_Pos)      /*!< 0x00000080 */\r
+#define CAN_FFA1R_FFA7                       CAN_FFA1R_FFA7_Msk                /*!< Filter FIFO Assignment for filter 7 */\r
+#define CAN_FFA1R_FFA8_Pos                   (8U)                              \r
+#define CAN_FFA1R_FFA8_Msk                   (0x1UL << CAN_FFA1R_FFA8_Pos)      /*!< 0x00000100 */\r
+#define CAN_FFA1R_FFA8                       CAN_FFA1R_FFA8_Msk                /*!< Filter FIFO Assignment for filter 8 */\r
+#define CAN_FFA1R_FFA9_Pos                   (9U)                              \r
+#define CAN_FFA1R_FFA9_Msk                   (0x1UL << CAN_FFA1R_FFA9_Pos)      /*!< 0x00000200 */\r
+#define CAN_FFA1R_FFA9                       CAN_FFA1R_FFA9_Msk                /*!< Filter FIFO Assignment for filter 9 */\r
+#define CAN_FFA1R_FFA10_Pos                  (10U)                             \r
+#define CAN_FFA1R_FFA10_Msk                  (0x1UL << CAN_FFA1R_FFA10_Pos)     /*!< 0x00000400 */\r
+#define CAN_FFA1R_FFA10                      CAN_FFA1R_FFA10_Msk               /*!< Filter FIFO Assignment for filter 10 */\r
+#define CAN_FFA1R_FFA11_Pos                  (11U)                             \r
+#define CAN_FFA1R_FFA11_Msk                  (0x1UL << CAN_FFA1R_FFA11_Pos)     /*!< 0x00000800 */\r
+#define CAN_FFA1R_FFA11                      CAN_FFA1R_FFA11_Msk               /*!< Filter FIFO Assignment for filter 11 */\r
+#define CAN_FFA1R_FFA12_Pos                  (12U)                             \r
+#define CAN_FFA1R_FFA12_Msk                  (0x1UL << CAN_FFA1R_FFA12_Pos)     /*!< 0x00001000 */\r
+#define CAN_FFA1R_FFA12                      CAN_FFA1R_FFA12_Msk               /*!< Filter FIFO Assignment for filter 12 */\r
+#define CAN_FFA1R_FFA13_Pos                  (13U)                             \r
+#define CAN_FFA1R_FFA13_Msk                  (0x1UL << CAN_FFA1R_FFA13_Pos)     /*!< 0x00002000 */\r
+#define CAN_FFA1R_FFA13                      CAN_FFA1R_FFA13_Msk               /*!< Filter FIFO Assignment for filter 13 */\r
+\r
+/*******************  Bit definition for CAN_FA1R register  *******************/\r
+#define CAN_FA1R_FACT_Pos                    (0U)                              \r
+#define CAN_FA1R_FACT_Msk                    (0x3FFFUL << CAN_FA1R_FACT_Pos)    /*!< 0x00003FFF */\r
+#define CAN_FA1R_FACT                        CAN_FA1R_FACT_Msk                 /*!< Filter Active */\r
+#define CAN_FA1R_FACT0_Pos                   (0U)                              \r
+#define CAN_FA1R_FACT0_Msk                   (0x1UL << CAN_FA1R_FACT0_Pos)      /*!< 0x00000001 */\r
+#define CAN_FA1R_FACT0                       CAN_FA1R_FACT0_Msk                /*!< Filter 0 Active */\r
+#define CAN_FA1R_FACT1_Pos                   (1U)                              \r
+#define CAN_FA1R_FACT1_Msk                   (0x1UL << CAN_FA1R_FACT1_Pos)      /*!< 0x00000002 */\r
+#define CAN_FA1R_FACT1                       CAN_FA1R_FACT1_Msk                /*!< Filter 1 Active */\r
+#define CAN_FA1R_FACT2_Pos                   (2U)                              \r
+#define CAN_FA1R_FACT2_Msk                   (0x1UL << CAN_FA1R_FACT2_Pos)      /*!< 0x00000004 */\r
+#define CAN_FA1R_FACT2                       CAN_FA1R_FACT2_Msk                /*!< Filter 2 Active */\r
+#define CAN_FA1R_FACT3_Pos                   (3U)                              \r
+#define CAN_FA1R_FACT3_Msk                   (0x1UL << CAN_FA1R_FACT3_Pos)      /*!< 0x00000008 */\r
+#define CAN_FA1R_FACT3                       CAN_FA1R_FACT3_Msk                /*!< Filter 3 Active */\r
+#define CAN_FA1R_FACT4_Pos                   (4U)                              \r
+#define CAN_FA1R_FACT4_Msk                   (0x1UL << CAN_FA1R_FACT4_Pos)      /*!< 0x00000010 */\r
+#define CAN_FA1R_FACT4                       CAN_FA1R_FACT4_Msk                /*!< Filter 4 Active */\r
+#define CAN_FA1R_FACT5_Pos                   (5U)                              \r
+#define CAN_FA1R_FACT5_Msk                   (0x1UL << CAN_FA1R_FACT5_Pos)      /*!< 0x00000020 */\r
+#define CAN_FA1R_FACT5                       CAN_FA1R_FACT5_Msk                /*!< Filter 5 Active */\r
+#define CAN_FA1R_FACT6_Pos                   (6U)                              \r
+#define CAN_FA1R_FACT6_Msk                   (0x1UL << CAN_FA1R_FACT6_Pos)      /*!< 0x00000040 */\r
+#define CAN_FA1R_FACT6                       CAN_FA1R_FACT6_Msk                /*!< Filter 6 Active */\r
+#define CAN_FA1R_FACT7_Pos                   (7U)                              \r
+#define CAN_FA1R_FACT7_Msk                   (0x1UL << CAN_FA1R_FACT7_Pos)      /*!< 0x00000080 */\r
+#define CAN_FA1R_FACT7                       CAN_FA1R_FACT7_Msk                /*!< Filter 7 Active */\r
+#define CAN_FA1R_FACT8_Pos                   (8U)                              \r
+#define CAN_FA1R_FACT8_Msk                   (0x1UL << CAN_FA1R_FACT8_Pos)      /*!< 0x00000100 */\r
+#define CAN_FA1R_FACT8                       CAN_FA1R_FACT8_Msk                /*!< Filter 8 Active */\r
+#define CAN_FA1R_FACT9_Pos                   (9U)                              \r
+#define CAN_FA1R_FACT9_Msk                   (0x1UL << CAN_FA1R_FACT9_Pos)      /*!< 0x00000200 */\r
+#define CAN_FA1R_FACT9                       CAN_FA1R_FACT9_Msk                /*!< Filter 9 Active */\r
+#define CAN_FA1R_FACT10_Pos                  (10U)                             \r
+#define CAN_FA1R_FACT10_Msk                  (0x1UL << CAN_FA1R_FACT10_Pos)     /*!< 0x00000400 */\r
+#define CAN_FA1R_FACT10                      CAN_FA1R_FACT10_Msk               /*!< Filter 10 Active */\r
+#define CAN_FA1R_FACT11_Pos                  (11U)                             \r
+#define CAN_FA1R_FACT11_Msk                  (0x1UL << CAN_FA1R_FACT11_Pos)     /*!< 0x00000800 */\r
+#define CAN_FA1R_FACT11                      CAN_FA1R_FACT11_Msk               /*!< Filter 11 Active */\r
+#define CAN_FA1R_FACT12_Pos                  (12U)                             \r
+#define CAN_FA1R_FACT12_Msk                  (0x1UL << CAN_FA1R_FACT12_Pos)     /*!< 0x00001000 */\r
+#define CAN_FA1R_FACT12                      CAN_FA1R_FACT12_Msk               /*!< Filter 12 Active */\r
+#define CAN_FA1R_FACT13_Pos                  (13U)                             \r
+#define CAN_FA1R_FACT13_Msk                  (0x1UL << CAN_FA1R_FACT13_Pos)     /*!< 0x00002000 */\r
+#define CAN_FA1R_FACT13                      CAN_FA1R_FACT13_Msk               /*!< Filter 13 Active */\r
+\r
+/*******************  Bit definition for CAN_F0R1 register  *******************/\r
+#define CAN_F0R1_FB0_Pos                     (0U)                              \r
+#define CAN_F0R1_FB0_Msk                     (0x1UL << CAN_F0R1_FB0_Pos)        /*!< 0x00000001 */\r
+#define CAN_F0R1_FB0                         CAN_F0R1_FB0_Msk                  /*!< Filter bit 0 */\r
+#define CAN_F0R1_FB1_Pos                     (1U)                              \r
+#define CAN_F0R1_FB1_Msk                     (0x1UL << CAN_F0R1_FB1_Pos)        /*!< 0x00000002 */\r
+#define CAN_F0R1_FB1                         CAN_F0R1_FB1_Msk                  /*!< Filter bit 1 */\r
+#define CAN_F0R1_FB2_Pos                     (2U)                              \r
+#define CAN_F0R1_FB2_Msk                     (0x1UL << CAN_F0R1_FB2_Pos)        /*!< 0x00000004 */\r
+#define CAN_F0R1_FB2                         CAN_F0R1_FB2_Msk                  /*!< Filter bit 2 */\r
+#define CAN_F0R1_FB3_Pos                     (3U)                              \r
+#define CAN_F0R1_FB3_Msk                     (0x1UL << CAN_F0R1_FB3_Pos)        /*!< 0x00000008 */\r
+#define CAN_F0R1_FB3                         CAN_F0R1_FB3_Msk                  /*!< Filter bit 3 */\r
+#define CAN_F0R1_FB4_Pos                     (4U)                              \r
+#define CAN_F0R1_FB4_Msk                     (0x1UL << CAN_F0R1_FB4_Pos)        /*!< 0x00000010 */\r
+#define CAN_F0R1_FB4                         CAN_F0R1_FB4_Msk                  /*!< Filter bit 4 */\r
+#define CAN_F0R1_FB5_Pos                     (5U)                              \r
+#define CAN_F0R1_FB5_Msk                     (0x1UL << CAN_F0R1_FB5_Pos)        /*!< 0x00000020 */\r
+#define CAN_F0R1_FB5                         CAN_F0R1_FB5_Msk                  /*!< Filter bit 5 */\r
+#define CAN_F0R1_FB6_Pos                     (6U)                              \r
+#define CAN_F0R1_FB6_Msk                     (0x1UL << CAN_F0R1_FB6_Pos)        /*!< 0x00000040 */\r
+#define CAN_F0R1_FB6                         CAN_F0R1_FB6_Msk                  /*!< Filter bit 6 */\r
+#define CAN_F0R1_FB7_Pos                     (7U)                              \r
+#define CAN_F0R1_FB7_Msk                     (0x1UL << CAN_F0R1_FB7_Pos)        /*!< 0x00000080 */\r
+#define CAN_F0R1_FB7                         CAN_F0R1_FB7_Msk                  /*!< Filter bit 7 */\r
+#define CAN_F0R1_FB8_Pos                     (8U)                              \r
+#define CAN_F0R1_FB8_Msk                     (0x1UL << CAN_F0R1_FB8_Pos)        /*!< 0x00000100 */\r
+#define CAN_F0R1_FB8                         CAN_F0R1_FB8_Msk                  /*!< Filter bit 8 */\r
+#define CAN_F0R1_FB9_Pos                     (9U)                              \r
+#define CAN_F0R1_FB9_Msk                     (0x1UL << CAN_F0R1_FB9_Pos)        /*!< 0x00000200 */\r
+#define CAN_F0R1_FB9                         CAN_F0R1_FB9_Msk                  /*!< Filter bit 9 */\r
+#define CAN_F0R1_FB10_Pos                    (10U)                             \r
+#define CAN_F0R1_FB10_Msk                    (0x1UL << CAN_F0R1_FB10_Pos)       /*!< 0x00000400 */\r
+#define CAN_F0R1_FB10                        CAN_F0R1_FB10_Msk                 /*!< Filter bit 10 */\r
+#define CAN_F0R1_FB11_Pos                    (11U)                             \r
+#define CAN_F0R1_FB11_Msk                    (0x1UL << CAN_F0R1_FB11_Pos)       /*!< 0x00000800 */\r
+#define CAN_F0R1_FB11                        CAN_F0R1_FB11_Msk                 /*!< Filter bit 11 */\r
+#define CAN_F0R1_FB12_Pos                    (12U)                             \r
+#define CAN_F0R1_FB12_Msk                    (0x1UL << CAN_F0R1_FB12_Pos)       /*!< 0x00001000 */\r
+#define CAN_F0R1_FB12                        CAN_F0R1_FB12_Msk                 /*!< Filter bit 12 */\r
+#define CAN_F0R1_FB13_Pos                    (13U)                             \r
+#define CAN_F0R1_FB13_Msk                    (0x1UL << CAN_F0R1_FB13_Pos)       /*!< 0x00002000 */\r
+#define CAN_F0R1_FB13                        CAN_F0R1_FB13_Msk                 /*!< Filter bit 13 */\r
+#define CAN_F0R1_FB14_Pos                    (14U)                             \r
+#define CAN_F0R1_FB14_Msk                    (0x1UL << CAN_F0R1_FB14_Pos)       /*!< 0x00004000 */\r
+#define CAN_F0R1_FB14                        CAN_F0R1_FB14_Msk                 /*!< Filter bit 14 */\r
+#define CAN_F0R1_FB15_Pos                    (15U)                             \r
+#define CAN_F0R1_FB15_Msk                    (0x1UL << CAN_F0R1_FB15_Pos)       /*!< 0x00008000 */\r
+#define CAN_F0R1_FB15                        CAN_F0R1_FB15_Msk                 /*!< Filter bit 15 */\r
+#define CAN_F0R1_FB16_Pos                    (16U)                             \r
+#define CAN_F0R1_FB16_Msk                    (0x1UL << CAN_F0R1_FB16_Pos)       /*!< 0x00010000 */\r
+#define CAN_F0R1_FB16                        CAN_F0R1_FB16_Msk                 /*!< Filter bit 16 */\r
+#define CAN_F0R1_FB17_Pos                    (17U)                             \r
+#define CAN_F0R1_FB17_Msk                    (0x1UL << CAN_F0R1_FB17_Pos)       /*!< 0x00020000 */\r
+#define CAN_F0R1_FB17                        CAN_F0R1_FB17_Msk                 /*!< Filter bit 17 */\r
+#define CAN_F0R1_FB18_Pos                    (18U)                             \r
+#define CAN_F0R1_FB18_Msk                    (0x1UL << CAN_F0R1_FB18_Pos)       /*!< 0x00040000 */\r
+#define CAN_F0R1_FB18                        CAN_F0R1_FB18_Msk                 /*!< Filter bit 18 */\r
+#define CAN_F0R1_FB19_Pos                    (19U)                             \r
+#define CAN_F0R1_FB19_Msk                    (0x1UL << CAN_F0R1_FB19_Pos)       /*!< 0x00080000 */\r
+#define CAN_F0R1_FB19                        CAN_F0R1_FB19_Msk                 /*!< Filter bit 19 */\r
+#define CAN_F0R1_FB20_Pos                    (20U)                             \r
+#define CAN_F0R1_FB20_Msk                    (0x1UL << CAN_F0R1_FB20_Pos)       /*!< 0x00100000 */\r
+#define CAN_F0R1_FB20                        CAN_F0R1_FB20_Msk                 /*!< Filter bit 20 */\r
+#define CAN_F0R1_FB21_Pos                    (21U)                             \r
+#define CAN_F0R1_FB21_Msk                    (0x1UL << CAN_F0R1_FB21_Pos)       /*!< 0x00200000 */\r
+#define CAN_F0R1_FB21                        CAN_F0R1_FB21_Msk                 /*!< Filter bit 21 */\r
+#define CAN_F0R1_FB22_Pos                    (22U)                             \r
+#define CAN_F0R1_FB22_Msk                    (0x1UL << CAN_F0R1_FB22_Pos)       /*!< 0x00400000 */\r
+#define CAN_F0R1_FB22                        CAN_F0R1_FB22_Msk                 /*!< Filter bit 22 */\r
+#define CAN_F0R1_FB23_Pos                    (23U)                             \r
+#define CAN_F0R1_FB23_Msk                    (0x1UL << CAN_F0R1_FB23_Pos)       /*!< 0x00800000 */\r
+#define CAN_F0R1_FB23                        CAN_F0R1_FB23_Msk                 /*!< Filter bit 23 */\r
+#define CAN_F0R1_FB24_Pos                    (24U)                             \r
+#define CAN_F0R1_FB24_Msk                    (0x1UL << CAN_F0R1_FB24_Pos)       /*!< 0x01000000 */\r
+#define CAN_F0R1_FB24                        CAN_F0R1_FB24_Msk                 /*!< Filter bit 24 */\r
+#define CAN_F0R1_FB25_Pos                    (25U)                             \r
+#define CAN_F0R1_FB25_Msk                    (0x1UL << CAN_F0R1_FB25_Pos)       /*!< 0x02000000 */\r
+#define CAN_F0R1_FB25                        CAN_F0R1_FB25_Msk                 /*!< Filter bit 25 */\r
+#define CAN_F0R1_FB26_Pos                    (26U)                             \r
+#define CAN_F0R1_FB26_Msk                    (0x1UL << CAN_F0R1_FB26_Pos)       /*!< 0x04000000 */\r
+#define CAN_F0R1_FB26                        CAN_F0R1_FB26_Msk                 /*!< Filter bit 26 */\r
+#define CAN_F0R1_FB27_Pos                    (27U)                             \r
+#define CAN_F0R1_FB27_Msk                    (0x1UL << CAN_F0R1_FB27_Pos)       /*!< 0x08000000 */\r
+#define CAN_F0R1_FB27                        CAN_F0R1_FB27_Msk                 /*!< Filter bit 27 */\r
+#define CAN_F0R1_FB28_Pos                    (28U)                             \r
+#define CAN_F0R1_FB28_Msk                    (0x1UL << CAN_F0R1_FB28_Pos)       /*!< 0x10000000 */\r
+#define CAN_F0R1_FB28                        CAN_F0R1_FB28_Msk                 /*!< Filter bit 28 */\r
+#define CAN_F0R1_FB29_Pos                    (29U)                             \r
+#define CAN_F0R1_FB29_Msk                    (0x1UL << CAN_F0R1_FB29_Pos)       /*!< 0x20000000 */\r
+#define CAN_F0R1_FB29                        CAN_F0R1_FB29_Msk                 /*!< Filter bit 29 */\r
+#define CAN_F0R1_FB30_Pos                    (30U)                             \r
+#define CAN_F0R1_FB30_Msk                    (0x1UL << CAN_F0R1_FB30_Pos)       /*!< 0x40000000 */\r
+#define CAN_F0R1_FB30                        CAN_F0R1_FB30_Msk                 /*!< Filter bit 30 */\r
+#define CAN_F0R1_FB31_Pos                    (31U)                             \r
+#define CAN_F0R1_FB31_Msk                    (0x1UL << CAN_F0R1_FB31_Pos)       /*!< 0x80000000 */\r
+#define CAN_F0R1_FB31                        CAN_F0R1_FB31_Msk                 /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F1R1 register  *******************/\r
+#define CAN_F1R1_FB0_Pos                     (0U)                              \r
+#define CAN_F1R1_FB0_Msk                     (0x1UL << CAN_F1R1_FB0_Pos)        /*!< 0x00000001 */\r
+#define CAN_F1R1_FB0                         CAN_F1R1_FB0_Msk                  /*!< Filter bit 0 */\r
+#define CAN_F1R1_FB1_Pos                     (1U)                              \r
+#define CAN_F1R1_FB1_Msk                     (0x1UL << CAN_F1R1_FB1_Pos)        /*!< 0x00000002 */\r
+#define CAN_F1R1_FB1                         CAN_F1R1_FB1_Msk                  /*!< Filter bit 1 */\r
+#define CAN_F1R1_FB2_Pos                     (2U)                              \r
+#define CAN_F1R1_FB2_Msk                     (0x1UL << CAN_F1R1_FB2_Pos)        /*!< 0x00000004 */\r
+#define CAN_F1R1_FB2                         CAN_F1R1_FB2_Msk                  /*!< Filter bit 2 */\r
+#define CAN_F1R1_FB3_Pos                     (3U)                              \r
+#define CAN_F1R1_FB3_Msk                     (0x1UL << CAN_F1R1_FB3_Pos)        /*!< 0x00000008 */\r
+#define CAN_F1R1_FB3                         CAN_F1R1_FB3_Msk                  /*!< Filter bit 3 */\r
+#define CAN_F1R1_FB4_Pos                     (4U)                              \r
+#define CAN_F1R1_FB4_Msk                     (0x1UL << CAN_F1R1_FB4_Pos)        /*!< 0x00000010 */\r
+#define CAN_F1R1_FB4                         CAN_F1R1_FB4_Msk                  /*!< Filter bit 4 */\r
+#define CAN_F1R1_FB5_Pos                     (5U)                              \r
+#define CAN_F1R1_FB5_Msk                     (0x1UL << CAN_F1R1_FB5_Pos)        /*!< 0x00000020 */\r
+#define CAN_F1R1_FB5                         CAN_F1R1_FB5_Msk                  /*!< Filter bit 5 */\r
+#define CAN_F1R1_FB6_Pos                     (6U)                              \r
+#define CAN_F1R1_FB6_Msk                     (0x1UL << CAN_F1R1_FB6_Pos)        /*!< 0x00000040 */\r
+#define CAN_F1R1_FB6                         CAN_F1R1_FB6_Msk                  /*!< Filter bit 6 */\r
+#define CAN_F1R1_FB7_Pos                     (7U)                              \r
+#define CAN_F1R1_FB7_Msk                     (0x1UL << CAN_F1R1_FB7_Pos)        /*!< 0x00000080 */\r
+#define CAN_F1R1_FB7                         CAN_F1R1_FB7_Msk                  /*!< Filter bit 7 */\r
+#define CAN_F1R1_FB8_Pos                     (8U)                              \r
+#define CAN_F1R1_FB8_Msk                     (0x1UL << CAN_F1R1_FB8_Pos)        /*!< 0x00000100 */\r
+#define CAN_F1R1_FB8                         CAN_F1R1_FB8_Msk                  /*!< Filter bit 8 */\r
+#define CAN_F1R1_FB9_Pos                     (9U)                              \r
+#define CAN_F1R1_FB9_Msk                     (0x1UL << CAN_F1R1_FB9_Pos)        /*!< 0x00000200 */\r
+#define CAN_F1R1_FB9                         CAN_F1R1_FB9_Msk                  /*!< Filter bit 9 */\r
+#define CAN_F1R1_FB10_Pos                    (10U)                             \r
+#define CAN_F1R1_FB10_Msk                    (0x1UL << CAN_F1R1_FB10_Pos)       /*!< 0x00000400 */\r
+#define CAN_F1R1_FB10                        CAN_F1R1_FB10_Msk                 /*!< Filter bit 10 */\r
+#define CAN_F1R1_FB11_Pos                    (11U)                             \r
+#define CAN_F1R1_FB11_Msk                    (0x1UL << CAN_F1R1_FB11_Pos)       /*!< 0x00000800 */\r
+#define CAN_F1R1_FB11                        CAN_F1R1_FB11_Msk                 /*!< Filter bit 11 */\r
+#define CAN_F1R1_FB12_Pos                    (12U)                             \r
+#define CAN_F1R1_FB12_Msk                    (0x1UL << CAN_F1R1_FB12_Pos)       /*!< 0x00001000 */\r
+#define CAN_F1R1_FB12                        CAN_F1R1_FB12_Msk                 /*!< Filter bit 12 */\r
+#define CAN_F1R1_FB13_Pos                    (13U)                             \r
+#define CAN_F1R1_FB13_Msk                    (0x1UL << CAN_F1R1_FB13_Pos)       /*!< 0x00002000 */\r
+#define CAN_F1R1_FB13                        CAN_F1R1_FB13_Msk                 /*!< Filter bit 13 */\r
+#define CAN_F1R1_FB14_Pos                    (14U)                             \r
+#define CAN_F1R1_FB14_Msk                    (0x1UL << CAN_F1R1_FB14_Pos)       /*!< 0x00004000 */\r
+#define CAN_F1R1_FB14                        CAN_F1R1_FB14_Msk                 /*!< Filter bit 14 */\r
+#define CAN_F1R1_FB15_Pos                    (15U)                             \r
+#define CAN_F1R1_FB15_Msk                    (0x1UL << CAN_F1R1_FB15_Pos)       /*!< 0x00008000 */\r
+#define CAN_F1R1_FB15                        CAN_F1R1_FB15_Msk                 /*!< Filter bit 15 */\r
+#define CAN_F1R1_FB16_Pos                    (16U)                             \r
+#define CAN_F1R1_FB16_Msk                    (0x1UL << CAN_F1R1_FB16_Pos)       /*!< 0x00010000 */\r
+#define CAN_F1R1_FB16                        CAN_F1R1_FB16_Msk                 /*!< Filter bit 16 */\r
+#define CAN_F1R1_FB17_Pos                    (17U)                             \r
+#define CAN_F1R1_FB17_Msk                    (0x1UL << CAN_F1R1_FB17_Pos)       /*!< 0x00020000 */\r
+#define CAN_F1R1_FB17                        CAN_F1R1_FB17_Msk                 /*!< Filter bit 17 */\r
+#define CAN_F1R1_FB18_Pos                    (18U)                             \r
+#define CAN_F1R1_FB18_Msk                    (0x1UL << CAN_F1R1_FB18_Pos)       /*!< 0x00040000 */\r
+#define CAN_F1R1_FB18                        CAN_F1R1_FB18_Msk                 /*!< Filter bit 18 */\r
+#define CAN_F1R1_FB19_Pos                    (19U)                             \r
+#define CAN_F1R1_FB19_Msk                    (0x1UL << CAN_F1R1_FB19_Pos)       /*!< 0x00080000 */\r
+#define CAN_F1R1_FB19                        CAN_F1R1_FB19_Msk                 /*!< Filter bit 19 */\r
+#define CAN_F1R1_FB20_Pos                    (20U)                             \r
+#define CAN_F1R1_FB20_Msk                    (0x1UL << CAN_F1R1_FB20_Pos)       /*!< 0x00100000 */\r
+#define CAN_F1R1_FB20                        CAN_F1R1_FB20_Msk                 /*!< Filter bit 20 */\r
+#define CAN_F1R1_FB21_Pos                    (21U)                             \r
+#define CAN_F1R1_FB21_Msk                    (0x1UL << CAN_F1R1_FB21_Pos)       /*!< 0x00200000 */\r
+#define CAN_F1R1_FB21                        CAN_F1R1_FB21_Msk                 /*!< Filter bit 21 */\r
+#define CAN_F1R1_FB22_Pos                    (22U)                             \r
+#define CAN_F1R1_FB22_Msk                    (0x1UL << CAN_F1R1_FB22_Pos)       /*!< 0x00400000 */\r
+#define CAN_F1R1_FB22                        CAN_F1R1_FB22_Msk                 /*!< Filter bit 22 */\r
+#define CAN_F1R1_FB23_Pos                    (23U)                             \r
+#define CAN_F1R1_FB23_Msk                    (0x1UL << CAN_F1R1_FB23_Pos)       /*!< 0x00800000 */\r
+#define CAN_F1R1_FB23                        CAN_F1R1_FB23_Msk                 /*!< Filter bit 23 */\r
+#define CAN_F1R1_FB24_Pos                    (24U)                             \r
+#define CAN_F1R1_FB24_Msk                    (0x1UL << CAN_F1R1_FB24_Pos)       /*!< 0x01000000 */\r
+#define CAN_F1R1_FB24                        CAN_F1R1_FB24_Msk                 /*!< Filter bit 24 */\r
+#define CAN_F1R1_FB25_Pos                    (25U)                             \r
+#define CAN_F1R1_FB25_Msk                    (0x1UL << CAN_F1R1_FB25_Pos)       /*!< 0x02000000 */\r
+#define CAN_F1R1_FB25                        CAN_F1R1_FB25_Msk                 /*!< Filter bit 25 */\r
+#define CAN_F1R1_FB26_Pos                    (26U)                             \r
+#define CAN_F1R1_FB26_Msk                    (0x1UL << CAN_F1R1_FB26_Pos)       /*!< 0x04000000 */\r
+#define CAN_F1R1_FB26                        CAN_F1R1_FB26_Msk                 /*!< Filter bit 26 */\r
+#define CAN_F1R1_FB27_Pos                    (27U)                             \r
+#define CAN_F1R1_FB27_Msk                    (0x1UL << CAN_F1R1_FB27_Pos)       /*!< 0x08000000 */\r
+#define CAN_F1R1_FB27                        CAN_F1R1_FB27_Msk                 /*!< Filter bit 27 */\r
+#define CAN_F1R1_FB28_Pos                    (28U)                             \r
+#define CAN_F1R1_FB28_Msk                    (0x1UL << CAN_F1R1_FB28_Pos)       /*!< 0x10000000 */\r
+#define CAN_F1R1_FB28                        CAN_F1R1_FB28_Msk                 /*!< Filter bit 28 */\r
+#define CAN_F1R1_FB29_Pos                    (29U)                             \r
+#define CAN_F1R1_FB29_Msk                    (0x1UL << CAN_F1R1_FB29_Pos)       /*!< 0x20000000 */\r
+#define CAN_F1R1_FB29                        CAN_F1R1_FB29_Msk                 /*!< Filter bit 29 */\r
+#define CAN_F1R1_FB30_Pos                    (30U)                             \r
+#define CAN_F1R1_FB30_Msk                    (0x1UL << CAN_F1R1_FB30_Pos)       /*!< 0x40000000 */\r
+#define CAN_F1R1_FB30                        CAN_F1R1_FB30_Msk                 /*!< Filter bit 30 */\r
+#define CAN_F1R1_FB31_Pos                    (31U)                             \r
+#define CAN_F1R1_FB31_Msk                    (0x1UL << CAN_F1R1_FB31_Pos)       /*!< 0x80000000 */\r
+#define CAN_F1R1_FB31                        CAN_F1R1_FB31_Msk                 /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F2R1 register  *******************/\r
+#define CAN_F2R1_FB0_Pos                     (0U)                              \r
+#define CAN_F2R1_FB0_Msk                     (0x1UL << CAN_F2R1_FB0_Pos)        /*!< 0x00000001 */\r
+#define CAN_F2R1_FB0                         CAN_F2R1_FB0_Msk                  /*!< Filter bit 0 */\r
+#define CAN_F2R1_FB1_Pos                     (1U)                              \r
+#define CAN_F2R1_FB1_Msk                     (0x1UL << CAN_F2R1_FB1_Pos)        /*!< 0x00000002 */\r
+#define CAN_F2R1_FB1                         CAN_F2R1_FB1_Msk                  /*!< Filter bit 1 */\r
+#define CAN_F2R1_FB2_Pos                     (2U)                              \r
+#define CAN_F2R1_FB2_Msk                     (0x1UL << CAN_F2R1_FB2_Pos)        /*!< 0x00000004 */\r
+#define CAN_F2R1_FB2                         CAN_F2R1_FB2_Msk                  /*!< Filter bit 2 */\r
+#define CAN_F2R1_FB3_Pos                     (3U)                              \r
+#define CAN_F2R1_FB3_Msk                     (0x1UL << CAN_F2R1_FB3_Pos)        /*!< 0x00000008 */\r
+#define CAN_F2R1_FB3                         CAN_F2R1_FB3_Msk                  /*!< Filter bit 3 */\r
+#define CAN_F2R1_FB4_Pos                     (4U)                              \r
+#define CAN_F2R1_FB4_Msk                     (0x1UL << CAN_F2R1_FB4_Pos)        /*!< 0x00000010 */\r
+#define CAN_F2R1_FB4                         CAN_F2R1_FB4_Msk                  /*!< Filter bit 4 */\r
+#define CAN_F2R1_FB5_Pos                     (5U)                              \r
+#define CAN_F2R1_FB5_Msk                     (0x1UL << CAN_F2R1_FB5_Pos)        /*!< 0x00000020 */\r
+#define CAN_F2R1_FB5                         CAN_F2R1_FB5_Msk                  /*!< Filter bit 5 */\r
+#define CAN_F2R1_FB6_Pos                     (6U)                              \r
+#define CAN_F2R1_FB6_Msk                     (0x1UL << CAN_F2R1_FB6_Pos)        /*!< 0x00000040 */\r
+#define CAN_F2R1_FB6                         CAN_F2R1_FB6_Msk                  /*!< Filter bit 6 */\r
+#define CAN_F2R1_FB7_Pos                     (7U)                              \r
+#define CAN_F2R1_FB7_Msk                     (0x1UL << CAN_F2R1_FB7_Pos)        /*!< 0x00000080 */\r
+#define CAN_F2R1_FB7                         CAN_F2R1_FB7_Msk                  /*!< Filter bit 7 */\r
+#define CAN_F2R1_FB8_Pos                     (8U)                              \r
+#define CAN_F2R1_FB8_Msk                     (0x1UL << CAN_F2R1_FB8_Pos)        /*!< 0x00000100 */\r
+#define CAN_F2R1_FB8                         CAN_F2R1_FB8_Msk                  /*!< Filter bit 8 */\r
+#define CAN_F2R1_FB9_Pos                     (9U)                              \r
+#define CAN_F2R1_FB9_Msk                     (0x1UL << CAN_F2R1_FB9_Pos)        /*!< 0x00000200 */\r
+#define CAN_F2R1_FB9                         CAN_F2R1_FB9_Msk                  /*!< Filter bit 9 */\r
+#define CAN_F2R1_FB10_Pos                    (10U)                             \r
+#define CAN_F2R1_FB10_Msk                    (0x1UL << CAN_F2R1_FB10_Pos)       /*!< 0x00000400 */\r
+#define CAN_F2R1_FB10                        CAN_F2R1_FB10_Msk                 /*!< Filter bit 10 */\r
+#define CAN_F2R1_FB11_Pos                    (11U)                             \r
+#define CAN_F2R1_FB11_Msk                    (0x1UL << CAN_F2R1_FB11_Pos)       /*!< 0x00000800 */\r
+#define CAN_F2R1_FB11                        CAN_F2R1_FB11_Msk                 /*!< Filter bit 11 */\r
+#define CAN_F2R1_FB12_Pos                    (12U)                             \r
+#define CAN_F2R1_FB12_Msk                    (0x1UL << CAN_F2R1_FB12_Pos)       /*!< 0x00001000 */\r
+#define CAN_F2R1_FB12                        CAN_F2R1_FB12_Msk                 /*!< Filter bit 12 */\r
+#define CAN_F2R1_FB13_Pos                    (13U)                             \r
+#define CAN_F2R1_FB13_Msk                    (0x1UL << CAN_F2R1_FB13_Pos)       /*!< 0x00002000 */\r
+#define CAN_F2R1_FB13                        CAN_F2R1_FB13_Msk                 /*!< Filter bit 13 */\r
+#define CAN_F2R1_FB14_Pos                    (14U)                             \r
+#define CAN_F2R1_FB14_Msk                    (0x1UL << CAN_F2R1_FB14_Pos)       /*!< 0x00004000 */\r
+#define CAN_F2R1_FB14                        CAN_F2R1_FB14_Msk                 /*!< Filter bit 14 */\r
+#define CAN_F2R1_FB15_Pos                    (15U)                             \r
+#define CAN_F2R1_FB15_Msk                    (0x1UL << CAN_F2R1_FB15_Pos)       /*!< 0x00008000 */\r
+#define CAN_F2R1_FB15                        CAN_F2R1_FB15_Msk                 /*!< Filter bit 15 */\r
+#define CAN_F2R1_FB16_Pos                    (16U)                             \r
+#define CAN_F2R1_FB16_Msk                    (0x1UL << CAN_F2R1_FB16_Pos)       /*!< 0x00010000 */\r
+#define CAN_F2R1_FB16                        CAN_F2R1_FB16_Msk                 /*!< Filter bit 16 */\r
+#define CAN_F2R1_FB17_Pos                    (17U)                             \r
+#define CAN_F2R1_FB17_Msk                    (0x1UL << CAN_F2R1_FB17_Pos)       /*!< 0x00020000 */\r
+#define CAN_F2R1_FB17                        CAN_F2R1_FB17_Msk                 /*!< Filter bit 17 */\r
+#define CAN_F2R1_FB18_Pos                    (18U)                             \r
+#define CAN_F2R1_FB18_Msk                    (0x1UL << CAN_F2R1_FB18_Pos)       /*!< 0x00040000 */\r
+#define CAN_F2R1_FB18                        CAN_F2R1_FB18_Msk                 /*!< Filter bit 18 */\r
+#define CAN_F2R1_FB19_Pos                    (19U)                             \r
+#define CAN_F2R1_FB19_Msk                    (0x1UL << CAN_F2R1_FB19_Pos)       /*!< 0x00080000 */\r
+#define CAN_F2R1_FB19                        CAN_F2R1_FB19_Msk                 /*!< Filter bit 19 */\r
+#define CAN_F2R1_FB20_Pos                    (20U)                             \r
+#define CAN_F2R1_FB20_Msk                    (0x1UL << CAN_F2R1_FB20_Pos)       /*!< 0x00100000 */\r
+#define CAN_F2R1_FB20                        CAN_F2R1_FB20_Msk                 /*!< Filter bit 20 */\r
+#define CAN_F2R1_FB21_Pos                    (21U)                             \r
+#define CAN_F2R1_FB21_Msk                    (0x1UL << CAN_F2R1_FB21_Pos)       /*!< 0x00200000 */\r
+#define CAN_F2R1_FB21                        CAN_F2R1_FB21_Msk                 /*!< Filter bit 21 */\r
+#define CAN_F2R1_FB22_Pos                    (22U)                             \r
+#define CAN_F2R1_FB22_Msk                    (0x1UL << CAN_F2R1_FB22_Pos)       /*!< 0x00400000 */\r
+#define CAN_F2R1_FB22                        CAN_F2R1_FB22_Msk                 /*!< Filter bit 22 */\r
+#define CAN_F2R1_FB23_Pos                    (23U)                             \r
+#define CAN_F2R1_FB23_Msk                    (0x1UL << CAN_F2R1_FB23_Pos)       /*!< 0x00800000 */\r
+#define CAN_F2R1_FB23                        CAN_F2R1_FB23_Msk                 /*!< Filter bit 23 */\r
+#define CAN_F2R1_FB24_Pos                    (24U)                             \r
+#define CAN_F2R1_FB24_Msk                    (0x1UL << CAN_F2R1_FB24_Pos)       /*!< 0x01000000 */\r
+#define CAN_F2R1_FB24                        CAN_F2R1_FB24_Msk                 /*!< Filter bit 24 */\r
+#define CAN_F2R1_FB25_Pos                    (25U)                             \r
+#define CAN_F2R1_FB25_Msk                    (0x1UL << CAN_F2R1_FB25_Pos)       /*!< 0x02000000 */\r
+#define CAN_F2R1_FB25                        CAN_F2R1_FB25_Msk                 /*!< Filter bit 25 */\r
+#define CAN_F2R1_FB26_Pos                    (26U)                             \r
+#define CAN_F2R1_FB26_Msk                    (0x1UL << CAN_F2R1_FB26_Pos)       /*!< 0x04000000 */\r
+#define CAN_F2R1_FB26                        CAN_F2R1_FB26_Msk                 /*!< Filter bit 26 */\r
+#define CAN_F2R1_FB27_Pos                    (27U)                             \r
+#define CAN_F2R1_FB27_Msk                    (0x1UL << CAN_F2R1_FB27_Pos)       /*!< 0x08000000 */\r
+#define CAN_F2R1_FB27                        CAN_F2R1_FB27_Msk                 /*!< Filter bit 27 */\r
+#define CAN_F2R1_FB28_Pos                    (28U)                             \r
+#define CAN_F2R1_FB28_Msk                    (0x1UL << CAN_F2R1_FB28_Pos)       /*!< 0x10000000 */\r
+#define CAN_F2R1_FB28                        CAN_F2R1_FB28_Msk                 /*!< Filter bit 28 */\r
+#define CAN_F2R1_FB29_Pos                    (29U)                             \r
+#define CAN_F2R1_FB29_Msk                    (0x1UL << CAN_F2R1_FB29_Pos)       /*!< 0x20000000 */\r
+#define CAN_F2R1_FB29                        CAN_F2R1_FB29_Msk                 /*!< Filter bit 29 */\r
+#define CAN_F2R1_FB30_Pos                    (30U)                             \r
+#define CAN_F2R1_FB30_Msk                    (0x1UL << CAN_F2R1_FB30_Pos)       /*!< 0x40000000 */\r
+#define CAN_F2R1_FB30                        CAN_F2R1_FB30_Msk                 /*!< Filter bit 30 */\r
+#define CAN_F2R1_FB31_Pos                    (31U)                             \r
+#define CAN_F2R1_FB31_Msk                    (0x1UL << CAN_F2R1_FB31_Pos)       /*!< 0x80000000 */\r
+#define CAN_F2R1_FB31                        CAN_F2R1_FB31_Msk                 /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F3R1 register  *******************/\r
+#define CAN_F3R1_FB0_Pos                     (0U)                              \r
+#define CAN_F3R1_FB0_Msk                     (0x1UL << CAN_F3R1_FB0_Pos)        /*!< 0x00000001 */\r
+#define CAN_F3R1_FB0                         CAN_F3R1_FB0_Msk                  /*!< Filter bit 0 */\r
+#define CAN_F3R1_FB1_Pos                     (1U)                              \r
+#define CAN_F3R1_FB1_Msk                     (0x1UL << CAN_F3R1_FB1_Pos)        /*!< 0x00000002 */\r
+#define CAN_F3R1_FB1                         CAN_F3R1_FB1_Msk                  /*!< Filter bit 1 */\r
+#define CAN_F3R1_FB2_Pos                     (2U)                              \r
+#define CAN_F3R1_FB2_Msk                     (0x1UL << CAN_F3R1_FB2_Pos)        /*!< 0x00000004 */\r
+#define CAN_F3R1_FB2                         CAN_F3R1_FB2_Msk                  /*!< Filter bit 2 */\r
+#define CAN_F3R1_FB3_Pos                     (3U)                              \r
+#define CAN_F3R1_FB3_Msk                     (0x1UL << CAN_F3R1_FB3_Pos)        /*!< 0x00000008 */\r
+#define CAN_F3R1_FB3                         CAN_F3R1_FB3_Msk                  /*!< Filter bit 3 */\r
+#define CAN_F3R1_FB4_Pos                     (4U)                              \r
+#define CAN_F3R1_FB4_Msk                     (0x1UL << CAN_F3R1_FB4_Pos)        /*!< 0x00000010 */\r
+#define CAN_F3R1_FB4                         CAN_F3R1_FB4_Msk                  /*!< Filter bit 4 */\r
+#define CAN_F3R1_FB5_Pos                     (5U)                              \r
+#define CAN_F3R1_FB5_Msk                     (0x1UL << CAN_F3R1_FB5_Pos)        /*!< 0x00000020 */\r
+#define CAN_F3R1_FB5                         CAN_F3R1_FB5_Msk                  /*!< Filter bit 5 */\r
+#define CAN_F3R1_FB6_Pos                     (6U)                              \r
+#define CAN_F3R1_FB6_Msk                     (0x1UL << CAN_F3R1_FB6_Pos)        /*!< 0x00000040 */\r
+#define CAN_F3R1_FB6                         CAN_F3R1_FB6_Msk                  /*!< Filter bit 6 */\r
+#define CAN_F3R1_FB7_Pos                     (7U)                              \r
+#define CAN_F3R1_FB7_Msk                     (0x1UL << CAN_F3R1_FB7_Pos)        /*!< 0x00000080 */\r
+#define CAN_F3R1_FB7                         CAN_F3R1_FB7_Msk                  /*!< Filter bit 7 */\r
+#define CAN_F3R1_FB8_Pos                     (8U)                              \r
+#define CAN_F3R1_FB8_Msk                     (0x1UL << CAN_F3R1_FB8_Pos)        /*!< 0x00000100 */\r
+#define CAN_F3R1_FB8                         CAN_F3R1_FB8_Msk                  /*!< Filter bit 8 */\r
+#define CAN_F3R1_FB9_Pos                     (9U)                              \r
+#define CAN_F3R1_FB9_Msk                     (0x1UL << CAN_F3R1_FB9_Pos)        /*!< 0x00000200 */\r
+#define CAN_F3R1_FB9                         CAN_F3R1_FB9_Msk                  /*!< Filter bit 9 */\r
+#define CAN_F3R1_FB10_Pos                    (10U)                             \r
+#define CAN_F3R1_FB10_Msk                    (0x1UL << CAN_F3R1_FB10_Pos)       /*!< 0x00000400 */\r
+#define CAN_F3R1_FB10                        CAN_F3R1_FB10_Msk                 /*!< Filter bit 10 */\r
+#define CAN_F3R1_FB11_Pos                    (11U)                             \r
+#define CAN_F3R1_FB11_Msk                    (0x1UL << CAN_F3R1_FB11_Pos)       /*!< 0x00000800 */\r
+#define CAN_F3R1_FB11                        CAN_F3R1_FB11_Msk                 /*!< Filter bit 11 */\r
+#define CAN_F3R1_FB12_Pos                    (12U)                             \r
+#define CAN_F3R1_FB12_Msk                    (0x1UL << CAN_F3R1_FB12_Pos)       /*!< 0x00001000 */\r
+#define CAN_F3R1_FB12                        CAN_F3R1_FB12_Msk                 /*!< Filter bit 12 */\r
+#define CAN_F3R1_FB13_Pos                    (13U)                             \r
+#define CAN_F3R1_FB13_Msk                    (0x1UL << CAN_F3R1_FB13_Pos)       /*!< 0x00002000 */\r
+#define CAN_F3R1_FB13                        CAN_F3R1_FB13_Msk                 /*!< Filter bit 13 */\r
+#define CAN_F3R1_FB14_Pos                    (14U)                             \r
+#define CAN_F3R1_FB14_Msk                    (0x1UL << CAN_F3R1_FB14_Pos)       /*!< 0x00004000 */\r
+#define CAN_F3R1_FB14                        CAN_F3R1_FB14_Msk                 /*!< Filter bit 14 */\r
+#define CAN_F3R1_FB15_Pos                    (15U)                             \r
+#define CAN_F3R1_FB15_Msk                    (0x1UL << CAN_F3R1_FB15_Pos)       /*!< 0x00008000 */\r
+#define CAN_F3R1_FB15                        CAN_F3R1_FB15_Msk                 /*!< Filter bit 15 */\r
+#define CAN_F3R1_FB16_Pos                    (16U)                             \r
+#define CAN_F3R1_FB16_Msk                    (0x1UL << CAN_F3R1_FB16_Pos)       /*!< 0x00010000 */\r
+#define CAN_F3R1_FB16                        CAN_F3R1_FB16_Msk                 /*!< Filter bit 16 */\r
+#define CAN_F3R1_FB17_Pos                    (17U)                             \r
+#define CAN_F3R1_FB17_Msk                    (0x1UL << CAN_F3R1_FB17_Pos)       /*!< 0x00020000 */\r
+#define CAN_F3R1_FB17                        CAN_F3R1_FB17_Msk                 /*!< Filter bit 17 */\r
+#define CAN_F3R1_FB18_Pos                    (18U)                             \r
+#define CAN_F3R1_FB18_Msk                    (0x1UL << CAN_F3R1_FB18_Pos)       /*!< 0x00040000 */\r
+#define CAN_F3R1_FB18                        CAN_F3R1_FB18_Msk                 /*!< Filter bit 18 */\r
+#define CAN_F3R1_FB19_Pos                    (19U)                             \r
+#define CAN_F3R1_FB19_Msk                    (0x1UL << CAN_F3R1_FB19_Pos)       /*!< 0x00080000 */\r
+#define CAN_F3R1_FB19                        CAN_F3R1_FB19_Msk                 /*!< Filter bit 19 */\r
+#define CAN_F3R1_FB20_Pos                    (20U)                             \r
+#define CAN_F3R1_FB20_Msk                    (0x1UL << CAN_F3R1_FB20_Pos)       /*!< 0x00100000 */\r
+#define CAN_F3R1_FB20                        CAN_F3R1_FB20_Msk                 /*!< Filter bit 20 */\r
+#define CAN_F3R1_FB21_Pos                    (21U)                             \r
+#define CAN_F3R1_FB21_Msk                    (0x1UL << CAN_F3R1_FB21_Pos)       /*!< 0x00200000 */\r
+#define CAN_F3R1_FB21                        CAN_F3R1_FB21_Msk                 /*!< Filter bit 21 */\r
+#define CAN_F3R1_FB22_Pos                    (22U)                             \r
+#define CAN_F3R1_FB22_Msk                    (0x1UL << CAN_F3R1_FB22_Pos)       /*!< 0x00400000 */\r
+#define CAN_F3R1_FB22                        CAN_F3R1_FB22_Msk                 /*!< Filter bit 22 */\r
+#define CAN_F3R1_FB23_Pos                    (23U)                             \r
+#define CAN_F3R1_FB23_Msk                    (0x1UL << CAN_F3R1_FB23_Pos)       /*!< 0x00800000 */\r
+#define CAN_F3R1_FB23                        CAN_F3R1_FB23_Msk                 /*!< Filter bit 23 */\r
+#define CAN_F3R1_FB24_Pos                    (24U)                             \r
+#define CAN_F3R1_FB24_Msk                    (0x1UL << CAN_F3R1_FB24_Pos)       /*!< 0x01000000 */\r
+#define CAN_F3R1_FB24                        CAN_F3R1_FB24_Msk                 /*!< Filter bit 24 */\r
+#define CAN_F3R1_FB25_Pos                    (25U)                             \r
+#define CAN_F3R1_FB25_Msk                    (0x1UL << CAN_F3R1_FB25_Pos)       /*!< 0x02000000 */\r
+#define CAN_F3R1_FB25                        CAN_F3R1_FB25_Msk                 /*!< Filter bit 25 */\r
+#define CAN_F3R1_FB26_Pos                    (26U)                             \r
+#define CAN_F3R1_FB26_Msk                    (0x1UL << CAN_F3R1_FB26_Pos)       /*!< 0x04000000 */\r
+#define CAN_F3R1_FB26                        CAN_F3R1_FB26_Msk                 /*!< Filter bit 26 */\r
+#define CAN_F3R1_FB27_Pos                    (27U)                             \r
+#define CAN_F3R1_FB27_Msk                    (0x1UL << CAN_F3R1_FB27_Pos)       /*!< 0x08000000 */\r
+#define CAN_F3R1_FB27                        CAN_F3R1_FB27_Msk                 /*!< Filter bit 27 */\r
+#define CAN_F3R1_FB28_Pos                    (28U)                             \r
+#define CAN_F3R1_FB28_Msk                    (0x1UL << CAN_F3R1_FB28_Pos)       /*!< 0x10000000 */\r
+#define CAN_F3R1_FB28                        CAN_F3R1_FB28_Msk                 /*!< Filter bit 28 */\r
+#define CAN_F3R1_FB29_Pos                    (29U)                             \r
+#define CAN_F3R1_FB29_Msk                    (0x1UL << CAN_F3R1_FB29_Pos)       /*!< 0x20000000 */\r
+#define CAN_F3R1_FB29                        CAN_F3R1_FB29_Msk                 /*!< Filter bit 29 */\r
+#define CAN_F3R1_FB30_Pos                    (30U)                             \r
+#define CAN_F3R1_FB30_Msk                    (0x1UL << CAN_F3R1_FB30_Pos)       /*!< 0x40000000 */\r
+#define CAN_F3R1_FB30                        CAN_F3R1_FB30_Msk                 /*!< Filter bit 30 */\r
+#define CAN_F3R1_FB31_Pos                    (31U)                             \r
+#define CAN_F3R1_FB31_Msk                    (0x1UL << CAN_F3R1_FB31_Pos)       /*!< 0x80000000 */\r
+#define CAN_F3R1_FB31                        CAN_F3R1_FB31_Msk                 /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F4R1 register  *******************/\r
+#define CAN_F4R1_FB0_Pos                     (0U)                              \r
+#define CAN_F4R1_FB0_Msk                     (0x1UL << CAN_F4R1_FB0_Pos)        /*!< 0x00000001 */\r
+#define CAN_F4R1_FB0                         CAN_F4R1_FB0_Msk                  /*!< Filter bit 0 */\r
+#define CAN_F4R1_FB1_Pos                     (1U)                              \r
+#define CAN_F4R1_FB1_Msk                     (0x1UL << CAN_F4R1_FB1_Pos)        /*!< 0x00000002 */\r
+#define CAN_F4R1_FB1                         CAN_F4R1_FB1_Msk                  /*!< Filter bit 1 */\r
+#define CAN_F4R1_FB2_Pos                     (2U)                              \r
+#define CAN_F4R1_FB2_Msk                     (0x1UL << CAN_F4R1_FB2_Pos)        /*!< 0x00000004 */\r
+#define CAN_F4R1_FB2                         CAN_F4R1_FB2_Msk                  /*!< Filter bit 2 */\r
+#define CAN_F4R1_FB3_Pos                     (3U)                              \r
+#define CAN_F4R1_FB3_Msk                     (0x1UL << CAN_F4R1_FB3_Pos)        /*!< 0x00000008 */\r
+#define CAN_F4R1_FB3                         CAN_F4R1_FB3_Msk                  /*!< Filter bit 3 */\r
+#define CAN_F4R1_FB4_Pos                     (4U)                              \r
+#define CAN_F4R1_FB4_Msk                     (0x1UL << CAN_F4R1_FB4_Pos)        /*!< 0x00000010 */\r
+#define CAN_F4R1_FB4                         CAN_F4R1_FB4_Msk                  /*!< Filter bit 4 */\r
+#define CAN_F4R1_FB5_Pos                     (5U)                              \r
+#define CAN_F4R1_FB5_Msk                     (0x1UL << CAN_F4R1_FB5_Pos)        /*!< 0x00000020 */\r
+#define CAN_F4R1_FB5                         CAN_F4R1_FB5_Msk                  /*!< Filter bit 5 */\r
+#define CAN_F4R1_FB6_Pos                     (6U)                              \r
+#define CAN_F4R1_FB6_Msk                     (0x1UL << CAN_F4R1_FB6_Pos)        /*!< 0x00000040 */\r
+#define CAN_F4R1_FB6                         CAN_F4R1_FB6_Msk                  /*!< Filter bit 6 */\r
+#define CAN_F4R1_FB7_Pos                     (7U)                              \r
+#define CAN_F4R1_FB7_Msk                     (0x1UL << CAN_F4R1_FB7_Pos)        /*!< 0x00000080 */\r
+#define CAN_F4R1_FB7                         CAN_F4R1_FB7_Msk                  /*!< Filter bit 7 */\r
+#define CAN_F4R1_FB8_Pos                     (8U)                              \r
+#define CAN_F4R1_FB8_Msk                     (0x1UL << CAN_F4R1_FB8_Pos)        /*!< 0x00000100 */\r
+#define CAN_F4R1_FB8                         CAN_F4R1_FB8_Msk                  /*!< Filter bit 8 */\r
+#define CAN_F4R1_FB9_Pos                     (9U)                              \r
+#define CAN_F4R1_FB9_Msk                     (0x1UL << CAN_F4R1_FB9_Pos)        /*!< 0x00000200 */\r
+#define CAN_F4R1_FB9                         CAN_F4R1_FB9_Msk                  /*!< Filter bit 9 */\r
+#define CAN_F4R1_FB10_Pos                    (10U)                             \r
+#define CAN_F4R1_FB10_Msk                    (0x1UL << CAN_F4R1_FB10_Pos)       /*!< 0x00000400 */\r
+#define CAN_F4R1_FB10                        CAN_F4R1_FB10_Msk                 /*!< Filter bit 10 */\r
+#define CAN_F4R1_FB11_Pos                    (11U)                             \r
+#define CAN_F4R1_FB11_Msk                    (0x1UL << CAN_F4R1_FB11_Pos)       /*!< 0x00000800 */\r
+#define CAN_F4R1_FB11                        CAN_F4R1_FB11_Msk                 /*!< Filter bit 11 */\r
+#define CAN_F4R1_FB12_Pos                    (12U)                             \r
+#define CAN_F4R1_FB12_Msk                    (0x1UL << CAN_F4R1_FB12_Pos)       /*!< 0x00001000 */\r
+#define CAN_F4R1_FB12                        CAN_F4R1_FB12_Msk                 /*!< Filter bit 12 */\r
+#define CAN_F4R1_FB13_Pos                    (13U)                             \r
+#define CAN_F4R1_FB13_Msk                    (0x1UL << CAN_F4R1_FB13_Pos)       /*!< 0x00002000 */\r
+#define CAN_F4R1_FB13                        CAN_F4R1_FB13_Msk                 /*!< Filter bit 13 */\r
+#define CAN_F4R1_FB14_Pos                    (14U)                             \r
+#define CAN_F4R1_FB14_Msk                    (0x1UL << CAN_F4R1_FB14_Pos)       /*!< 0x00004000 */\r
+#define CAN_F4R1_FB14                        CAN_F4R1_FB14_Msk                 /*!< Filter bit 14 */\r
+#define CAN_F4R1_FB15_Pos                    (15U)                             \r
+#define CAN_F4R1_FB15_Msk                    (0x1UL << CAN_F4R1_FB15_Pos)       /*!< 0x00008000 */\r
+#define CAN_F4R1_FB15                        CAN_F4R1_FB15_Msk                 /*!< Filter bit 15 */\r
+#define CAN_F4R1_FB16_Pos                    (16U)                             \r
+#define CAN_F4R1_FB16_Msk                    (0x1UL << CAN_F4R1_FB16_Pos)       /*!< 0x00010000 */\r
+#define CAN_F4R1_FB16                        CAN_F4R1_FB16_Msk                 /*!< Filter bit 16 */\r
+#define CAN_F4R1_FB17_Pos                    (17U)                             \r
+#define CAN_F4R1_FB17_Msk                    (0x1UL << CAN_F4R1_FB17_Pos)       /*!< 0x00020000 */\r
+#define CAN_F4R1_FB17                        CAN_F4R1_FB17_Msk                 /*!< Filter bit 17 */\r
+#define CAN_F4R1_FB18_Pos                    (18U)                             \r
+#define CAN_F4R1_FB18_Msk                    (0x1UL << CAN_F4R1_FB18_Pos)       /*!< 0x00040000 */\r
+#define CAN_F4R1_FB18                        CAN_F4R1_FB18_Msk                 /*!< Filter bit 18 */\r
+#define CAN_F4R1_FB19_Pos                    (19U)                             \r
+#define CAN_F4R1_FB19_Msk                    (0x1UL << CAN_F4R1_FB19_Pos)       /*!< 0x00080000 */\r
+#define CAN_F4R1_FB19                        CAN_F4R1_FB19_Msk                 /*!< Filter bit 19 */\r
+#define CAN_F4R1_FB20_Pos                    (20U)                             \r
+#define CAN_F4R1_FB20_Msk                    (0x1UL << CAN_F4R1_FB20_Pos)       /*!< 0x00100000 */\r
+#define CAN_F4R1_FB20                        CAN_F4R1_FB20_Msk                 /*!< Filter bit 20 */\r
+#define CAN_F4R1_FB21_Pos                    (21U)                             \r
+#define CAN_F4R1_FB21_Msk                    (0x1UL << CAN_F4R1_FB21_Pos)       /*!< 0x00200000 */\r
+#define CAN_F4R1_FB21                        CAN_F4R1_FB21_Msk                 /*!< Filter bit 21 */\r
+#define CAN_F4R1_FB22_Pos                    (22U)                             \r
+#define CAN_F4R1_FB22_Msk                    (0x1UL << CAN_F4R1_FB22_Pos)       /*!< 0x00400000 */\r
+#define CAN_F4R1_FB22                        CAN_F4R1_FB22_Msk                 /*!< Filter bit 22 */\r
+#define CAN_F4R1_FB23_Pos                    (23U)                             \r
+#define CAN_F4R1_FB23_Msk                    (0x1UL << CAN_F4R1_FB23_Pos)       /*!< 0x00800000 */\r
+#define CAN_F4R1_FB23                        CAN_F4R1_FB23_Msk                 /*!< Filter bit 23 */\r
+#define CAN_F4R1_FB24_Pos                    (24U)                             \r
+#define CAN_F4R1_FB24_Msk                    (0x1UL << CAN_F4R1_FB24_Pos)       /*!< 0x01000000 */\r
+#define CAN_F4R1_FB24                        CAN_F4R1_FB24_Msk                 /*!< Filter bit 24 */\r
+#define CAN_F4R1_FB25_Pos                    (25U)                             \r
+#define CAN_F4R1_FB25_Msk                    (0x1UL << CAN_F4R1_FB25_Pos)       /*!< 0x02000000 */\r
+#define CAN_F4R1_FB25                        CAN_F4R1_FB25_Msk                 /*!< Filter bit 25 */\r
+#define CAN_F4R1_FB26_Pos                    (26U)                             \r
+#define CAN_F4R1_FB26_Msk                    (0x1UL << CAN_F4R1_FB26_Pos)       /*!< 0x04000000 */\r
+#define CAN_F4R1_FB26                        CAN_F4R1_FB26_Msk                 /*!< Filter bit 26 */\r
+#define CAN_F4R1_FB27_Pos                    (27U)                             \r
+#define CAN_F4R1_FB27_Msk                    (0x1UL << CAN_F4R1_FB27_Pos)       /*!< 0x08000000 */\r
+#define CAN_F4R1_FB27                        CAN_F4R1_FB27_Msk                 /*!< Filter bit 27 */\r
+#define CAN_F4R1_FB28_Pos                    (28U)                             \r
+#define CAN_F4R1_FB28_Msk                    (0x1UL << CAN_F4R1_FB28_Pos)       /*!< 0x10000000 */\r
+#define CAN_F4R1_FB28                        CAN_F4R1_FB28_Msk                 /*!< Filter bit 28 */\r
+#define CAN_F4R1_FB29_Pos                    (29U)                             \r
+#define CAN_F4R1_FB29_Msk                    (0x1UL << CAN_F4R1_FB29_Pos)       /*!< 0x20000000 */\r
+#define CAN_F4R1_FB29                        CAN_F4R1_FB29_Msk                 /*!< Filter bit 29 */\r
+#define CAN_F4R1_FB30_Pos                    (30U)                             \r
+#define CAN_F4R1_FB30_Msk                    (0x1UL << CAN_F4R1_FB30_Pos)       /*!< 0x40000000 */\r
+#define CAN_F4R1_FB30                        CAN_F4R1_FB30_Msk                 /*!< Filter bit 30 */\r
+#define CAN_F4R1_FB31_Pos                    (31U)                             \r
+#define CAN_F4R1_FB31_Msk                    (0x1UL << CAN_F4R1_FB31_Pos)       /*!< 0x80000000 */\r
+#define CAN_F4R1_FB31                        CAN_F4R1_FB31_Msk                 /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F5R1 register  *******************/\r
+#define CAN_F5R1_FB0_Pos                     (0U)                              \r
+#define CAN_F5R1_FB0_Msk                     (0x1UL << CAN_F5R1_FB0_Pos)        /*!< 0x00000001 */\r
+#define CAN_F5R1_FB0                         CAN_F5R1_FB0_Msk                  /*!< Filter bit 0 */\r
+#define CAN_F5R1_FB1_Pos                     (1U)                              \r
+#define CAN_F5R1_FB1_Msk                     (0x1UL << CAN_F5R1_FB1_Pos)        /*!< 0x00000002 */\r
+#define CAN_F5R1_FB1                         CAN_F5R1_FB1_Msk                  /*!< Filter bit 1 */\r
+#define CAN_F5R1_FB2_Pos                     (2U)                              \r
+#define CAN_F5R1_FB2_Msk                     (0x1UL << CAN_F5R1_FB2_Pos)        /*!< 0x00000004 */\r
+#define CAN_F5R1_FB2                         CAN_F5R1_FB2_Msk                  /*!< Filter bit 2 */\r
+#define CAN_F5R1_FB3_Pos                     (3U)                              \r
+#define CAN_F5R1_FB3_Msk                     (0x1UL << CAN_F5R1_FB3_Pos)        /*!< 0x00000008 */\r
+#define CAN_F5R1_FB3                         CAN_F5R1_FB3_Msk                  /*!< Filter bit 3 */\r
+#define CAN_F5R1_FB4_Pos                     (4U)                              \r
+#define CAN_F5R1_FB4_Msk                     (0x1UL << CAN_F5R1_FB4_Pos)        /*!< 0x00000010 */\r
+#define CAN_F5R1_FB4                         CAN_F5R1_FB4_Msk                  /*!< Filter bit 4 */\r
+#define CAN_F5R1_FB5_Pos                     (5U)                              \r
+#define CAN_F5R1_FB5_Msk                     (0x1UL << CAN_F5R1_FB5_Pos)        /*!< 0x00000020 */\r
+#define CAN_F5R1_FB5                         CAN_F5R1_FB5_Msk                  /*!< Filter bit 5 */\r
+#define CAN_F5R1_FB6_Pos                     (6U)                              \r
+#define CAN_F5R1_FB6_Msk                     (0x1UL << CAN_F5R1_FB6_Pos)        /*!< 0x00000040 */\r
+#define CAN_F5R1_FB6                         CAN_F5R1_FB6_Msk                  /*!< Filter bit 6 */\r
+#define CAN_F5R1_FB7_Pos                     (7U)                              \r
+#define CAN_F5R1_FB7_Msk                     (0x1UL << CAN_F5R1_FB7_Pos)        /*!< 0x00000080 */\r
+#define CAN_F5R1_FB7                         CAN_F5R1_FB7_Msk                  /*!< Filter bit 7 */\r
+#define CAN_F5R1_FB8_Pos                     (8U)                              \r
+#define CAN_F5R1_FB8_Msk                     (0x1UL << CAN_F5R1_FB8_Pos)        /*!< 0x00000100 */\r
+#define CAN_F5R1_FB8                         CAN_F5R1_FB8_Msk                  /*!< Filter bit 8 */\r
+#define CAN_F5R1_FB9_Pos                     (9U)                              \r
+#define CAN_F5R1_FB9_Msk                     (0x1UL << CAN_F5R1_FB9_Pos)        /*!< 0x00000200 */\r
+#define CAN_F5R1_FB9                         CAN_F5R1_FB9_Msk                  /*!< Filter bit 9 */\r
+#define CAN_F5R1_FB10_Pos                    (10U)                             \r
+#define CAN_F5R1_FB10_Msk                    (0x1UL << CAN_F5R1_FB10_Pos)       /*!< 0x00000400 */\r
+#define CAN_F5R1_FB10                        CAN_F5R1_FB10_Msk                 /*!< Filter bit 10 */\r
+#define CAN_F5R1_FB11_Pos                    (11U)                             \r
+#define CAN_F5R1_FB11_Msk                    (0x1UL << CAN_F5R1_FB11_Pos)       /*!< 0x00000800 */\r
+#define CAN_F5R1_FB11                        CAN_F5R1_FB11_Msk                 /*!< Filter bit 11 */\r
+#define CAN_F5R1_FB12_Pos                    (12U)                             \r
+#define CAN_F5R1_FB12_Msk                    (0x1UL << CAN_F5R1_FB12_Pos)       /*!< 0x00001000 */\r
+#define CAN_F5R1_FB12                        CAN_F5R1_FB12_Msk                 /*!< Filter bit 12 */\r
+#define CAN_F5R1_FB13_Pos                    (13U)                             \r
+#define CAN_F5R1_FB13_Msk                    (0x1UL << CAN_F5R1_FB13_Pos)       /*!< 0x00002000 */\r
+#define CAN_F5R1_FB13                        CAN_F5R1_FB13_Msk                 /*!< Filter bit 13 */\r
+#define CAN_F5R1_FB14_Pos                    (14U)                             \r
+#define CAN_F5R1_FB14_Msk                    (0x1UL << CAN_F5R1_FB14_Pos)       /*!< 0x00004000 */\r
+#define CAN_F5R1_FB14                        CAN_F5R1_FB14_Msk                 /*!< Filter bit 14 */\r
+#define CAN_F5R1_FB15_Pos                    (15U)                             \r
+#define CAN_F5R1_FB15_Msk                    (0x1UL << CAN_F5R1_FB15_Pos)       /*!< 0x00008000 */\r
+#define CAN_F5R1_FB15                        CAN_F5R1_FB15_Msk                 /*!< Filter bit 15 */\r
+#define CAN_F5R1_FB16_Pos                    (16U)                             \r
+#define CAN_F5R1_FB16_Msk                    (0x1UL << CAN_F5R1_FB16_Pos)       /*!< 0x00010000 */\r
+#define CAN_F5R1_FB16                        CAN_F5R1_FB16_Msk                 /*!< Filter bit 16 */\r
+#define CAN_F5R1_FB17_Pos                    (17U)                             \r
+#define CAN_F5R1_FB17_Msk                    (0x1UL << CAN_F5R1_FB17_Pos)       /*!< 0x00020000 */\r
+#define CAN_F5R1_FB17                        CAN_F5R1_FB17_Msk                 /*!< Filter bit 17 */\r
+#define CAN_F5R1_FB18_Pos                    (18U)                             \r
+#define CAN_F5R1_FB18_Msk                    (0x1UL << CAN_F5R1_FB18_Pos)       /*!< 0x00040000 */\r
+#define CAN_F5R1_FB18                        CAN_F5R1_FB18_Msk                 /*!< Filter bit 18 */\r
+#define CAN_F5R1_FB19_Pos                    (19U)                             \r
+#define CAN_F5R1_FB19_Msk                    (0x1UL << CAN_F5R1_FB19_Pos)       /*!< 0x00080000 */\r
+#define CAN_F5R1_FB19                        CAN_F5R1_FB19_Msk                 /*!< Filter bit 19 */\r
+#define CAN_F5R1_FB20_Pos                    (20U)                             \r
+#define CAN_F5R1_FB20_Msk                    (0x1UL << CAN_F5R1_FB20_Pos)       /*!< 0x00100000 */\r
+#define CAN_F5R1_FB20                        CAN_F5R1_FB20_Msk                 /*!< Filter bit 20 */\r
+#define CAN_F5R1_FB21_Pos                    (21U)                             \r
+#define CAN_F5R1_FB21_Msk                    (0x1UL << CAN_F5R1_FB21_Pos)       /*!< 0x00200000 */\r
+#define CAN_F5R1_FB21                        CAN_F5R1_FB21_Msk                 /*!< Filter bit 21 */\r
+#define CAN_F5R1_FB22_Pos                    (22U)                             \r
+#define CAN_F5R1_FB22_Msk                    (0x1UL << CAN_F5R1_FB22_Pos)       /*!< 0x00400000 */\r
+#define CAN_F5R1_FB22                        CAN_F5R1_FB22_Msk                 /*!< Filter bit 22 */\r
+#define CAN_F5R1_FB23_Pos                    (23U)                             \r
+#define CAN_F5R1_FB23_Msk                    (0x1UL << CAN_F5R1_FB23_Pos)       /*!< 0x00800000 */\r
+#define CAN_F5R1_FB23                        CAN_F5R1_FB23_Msk                 /*!< Filter bit 23 */\r
+#define CAN_F5R1_FB24_Pos                    (24U)                             \r
+#define CAN_F5R1_FB24_Msk                    (0x1UL << CAN_F5R1_FB24_Pos)       /*!< 0x01000000 */\r
+#define CAN_F5R1_FB24                        CAN_F5R1_FB24_Msk                 /*!< Filter bit 24 */\r
+#define CAN_F5R1_FB25_Pos                    (25U)                             \r
+#define CAN_F5R1_FB25_Msk                    (0x1UL << CAN_F5R1_FB25_Pos)       /*!< 0x02000000 */\r
+#define CAN_F5R1_FB25                        CAN_F5R1_FB25_Msk                 /*!< Filter bit 25 */\r
+#define CAN_F5R1_FB26_Pos                    (26U)                             \r
+#define CAN_F5R1_FB26_Msk                    (0x1UL << CAN_F5R1_FB26_Pos)       /*!< 0x04000000 */\r
+#define CAN_F5R1_FB26                        CAN_F5R1_FB26_Msk                 /*!< Filter bit 26 */\r
+#define CAN_F5R1_FB27_Pos                    (27U)                             \r
+#define CAN_F5R1_FB27_Msk                    (0x1UL << CAN_F5R1_FB27_Pos)       /*!< 0x08000000 */\r
+#define CAN_F5R1_FB27                        CAN_F5R1_FB27_Msk                 /*!< Filter bit 27 */\r
+#define CAN_F5R1_FB28_Pos                    (28U)                             \r
+#define CAN_F5R1_FB28_Msk                    (0x1UL << CAN_F5R1_FB28_Pos)       /*!< 0x10000000 */\r
+#define CAN_F5R1_FB28                        CAN_F5R1_FB28_Msk                 /*!< Filter bit 28 */\r
+#define CAN_F5R1_FB29_Pos                    (29U)                             \r
+#define CAN_F5R1_FB29_Msk                    (0x1UL << CAN_F5R1_FB29_Pos)       /*!< 0x20000000 */\r
+#define CAN_F5R1_FB29                        CAN_F5R1_FB29_Msk                 /*!< Filter bit 29 */\r
+#define CAN_F5R1_FB30_Pos                    (30U)                             \r
+#define CAN_F5R1_FB30_Msk                    (0x1UL << CAN_F5R1_FB30_Pos)       /*!< 0x40000000 */\r
+#define CAN_F5R1_FB30                        CAN_F5R1_FB30_Msk                 /*!< Filter bit 30 */\r
+#define CAN_F5R1_FB31_Pos                    (31U)                             \r
+#define CAN_F5R1_FB31_Msk                    (0x1UL << CAN_F5R1_FB31_Pos)       /*!< 0x80000000 */\r
+#define CAN_F5R1_FB31                        CAN_F5R1_FB31_Msk                 /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F6R1 register  *******************/\r
+#define CAN_F6R1_FB0_Pos                     (0U)                              \r
+#define CAN_F6R1_FB0_Msk                     (0x1UL << CAN_F6R1_FB0_Pos)        /*!< 0x00000001 */\r
+#define CAN_F6R1_FB0                         CAN_F6R1_FB0_Msk                  /*!< Filter bit 0 */\r
+#define CAN_F6R1_FB1_Pos                     (1U)                              \r
+#define CAN_F6R1_FB1_Msk                     (0x1UL << CAN_F6R1_FB1_Pos)        /*!< 0x00000002 */\r
+#define CAN_F6R1_FB1                         CAN_F6R1_FB1_Msk                  /*!< Filter bit 1 */\r
+#define CAN_F6R1_FB2_Pos                     (2U)                              \r
+#define CAN_F6R1_FB2_Msk                     (0x1UL << CAN_F6R1_FB2_Pos)        /*!< 0x00000004 */\r
+#define CAN_F6R1_FB2                         CAN_F6R1_FB2_Msk                  /*!< Filter bit 2 */\r
+#define CAN_F6R1_FB3_Pos                     (3U)                              \r
+#define CAN_F6R1_FB3_Msk                     (0x1UL << CAN_F6R1_FB3_Pos)        /*!< 0x00000008 */\r
+#define CAN_F6R1_FB3                         CAN_F6R1_FB3_Msk                  /*!< Filter bit 3 */\r
+#define CAN_F6R1_FB4_Pos                     (4U)                              \r
+#define CAN_F6R1_FB4_Msk                     (0x1UL << CAN_F6R1_FB4_Pos)        /*!< 0x00000010 */\r
+#define CAN_F6R1_FB4                         CAN_F6R1_FB4_Msk                  /*!< Filter bit 4 */\r
+#define CAN_F6R1_FB5_Pos                     (5U)                              \r
+#define CAN_F6R1_FB5_Msk                     (0x1UL << CAN_F6R1_FB5_Pos)        /*!< 0x00000020 */\r
+#define CAN_F6R1_FB5                         CAN_F6R1_FB5_Msk                  /*!< Filter bit 5 */\r
+#define CAN_F6R1_FB6_Pos                     (6U)                              \r
+#define CAN_F6R1_FB6_Msk                     (0x1UL << CAN_F6R1_FB6_Pos)        /*!< 0x00000040 */\r
+#define CAN_F6R1_FB6                         CAN_F6R1_FB6_Msk                  /*!< Filter bit 6 */\r
+#define CAN_F6R1_FB7_Pos                     (7U)                              \r
+#define CAN_F6R1_FB7_Msk                     (0x1UL << CAN_F6R1_FB7_Pos)        /*!< 0x00000080 */\r
+#define CAN_F6R1_FB7                         CAN_F6R1_FB7_Msk                  /*!< Filter bit 7 */\r
+#define CAN_F6R1_FB8_Pos                     (8U)                              \r
+#define CAN_F6R1_FB8_Msk                     (0x1UL << CAN_F6R1_FB8_Pos)        /*!< 0x00000100 */\r
+#define CAN_F6R1_FB8                         CAN_F6R1_FB8_Msk                  /*!< Filter bit 8 */\r
+#define CAN_F6R1_FB9_Pos                     (9U)                              \r
+#define CAN_F6R1_FB9_Msk                     (0x1UL << CAN_F6R1_FB9_Pos)        /*!< 0x00000200 */\r
+#define CAN_F6R1_FB9                         CAN_F6R1_FB9_Msk                  /*!< Filter bit 9 */\r
+#define CAN_F6R1_FB10_Pos                    (10U)                             \r
+#define CAN_F6R1_FB10_Msk                    (0x1UL << CAN_F6R1_FB10_Pos)       /*!< 0x00000400 */\r
+#define CAN_F6R1_FB10                        CAN_F6R1_FB10_Msk                 /*!< Filter bit 10 */\r
+#define CAN_F6R1_FB11_Pos                    (11U)                             \r
+#define CAN_F6R1_FB11_Msk                    (0x1UL << CAN_F6R1_FB11_Pos)       /*!< 0x00000800 */\r
+#define CAN_F6R1_FB11                        CAN_F6R1_FB11_Msk                 /*!< Filter bit 11 */\r
+#define CAN_F6R1_FB12_Pos                    (12U)                             \r
+#define CAN_F6R1_FB12_Msk                    (0x1UL << CAN_F6R1_FB12_Pos)       /*!< 0x00001000 */\r
+#define CAN_F6R1_FB12                        CAN_F6R1_FB12_Msk                 /*!< Filter bit 12 */\r
+#define CAN_F6R1_FB13_Pos                    (13U)                             \r
+#define CAN_F6R1_FB13_Msk                    (0x1UL << CAN_F6R1_FB13_Pos)       /*!< 0x00002000 */\r
+#define CAN_F6R1_FB13                        CAN_F6R1_FB13_Msk                 /*!< Filter bit 13 */\r
+#define CAN_F6R1_FB14_Pos                    (14U)                             \r
+#define CAN_F6R1_FB14_Msk                    (0x1UL << CAN_F6R1_FB14_Pos)       /*!< 0x00004000 */\r
+#define CAN_F6R1_FB14                        CAN_F6R1_FB14_Msk                 /*!< Filter bit 14 */\r
+#define CAN_F6R1_FB15_Pos                    (15U)                             \r
+#define CAN_F6R1_FB15_Msk                    (0x1UL << CAN_F6R1_FB15_Pos)       /*!< 0x00008000 */\r
+#define CAN_F6R1_FB15                        CAN_F6R1_FB15_Msk                 /*!< Filter bit 15 */\r
+#define CAN_F6R1_FB16_Pos                    (16U)                             \r
+#define CAN_F6R1_FB16_Msk                    (0x1UL << CAN_F6R1_FB16_Pos)       /*!< 0x00010000 */\r
+#define CAN_F6R1_FB16                        CAN_F6R1_FB16_Msk                 /*!< Filter bit 16 */\r
+#define CAN_F6R1_FB17_Pos                    (17U)                             \r
+#define CAN_F6R1_FB17_Msk                    (0x1UL << CAN_F6R1_FB17_Pos)       /*!< 0x00020000 */\r
+#define CAN_F6R1_FB17                        CAN_F6R1_FB17_Msk                 /*!< Filter bit 17 */\r
+#define CAN_F6R1_FB18_Pos                    (18U)                             \r
+#define CAN_F6R1_FB18_Msk                    (0x1UL << CAN_F6R1_FB18_Pos)       /*!< 0x00040000 */\r
+#define CAN_F6R1_FB18                        CAN_F6R1_FB18_Msk                 /*!< Filter bit 18 */\r
+#define CAN_F6R1_FB19_Pos                    (19U)                             \r
+#define CAN_F6R1_FB19_Msk                    (0x1UL << CAN_F6R1_FB19_Pos)       /*!< 0x00080000 */\r
+#define CAN_F6R1_FB19                        CAN_F6R1_FB19_Msk                 /*!< Filter bit 19 */\r
+#define CAN_F6R1_FB20_Pos                    (20U)                             \r
+#define CAN_F6R1_FB20_Msk                    (0x1UL << CAN_F6R1_FB20_Pos)       /*!< 0x00100000 */\r
+#define CAN_F6R1_FB20                        CAN_F6R1_FB20_Msk                 /*!< Filter bit 20 */\r
+#define CAN_F6R1_FB21_Pos                    (21U)                             \r
+#define CAN_F6R1_FB21_Msk                    (0x1UL << CAN_F6R1_FB21_Pos)       /*!< 0x00200000 */\r
+#define CAN_F6R1_FB21                        CAN_F6R1_FB21_Msk                 /*!< Filter bit 21 */\r
+#define CAN_F6R1_FB22_Pos                    (22U)                             \r
+#define CAN_F6R1_FB22_Msk                    (0x1UL << CAN_F6R1_FB22_Pos)       /*!< 0x00400000 */\r
+#define CAN_F6R1_FB22                        CAN_F6R1_FB22_Msk                 /*!< Filter bit 22 */\r
+#define CAN_F6R1_FB23_Pos                    (23U)                             \r
+#define CAN_F6R1_FB23_Msk                    (0x1UL << CAN_F6R1_FB23_Pos)       /*!< 0x00800000 */\r
+#define CAN_F6R1_FB23                        CAN_F6R1_FB23_Msk                 /*!< Filter bit 23 */\r
+#define CAN_F6R1_FB24_Pos                    (24U)                             \r
+#define CAN_F6R1_FB24_Msk                    (0x1UL << CAN_F6R1_FB24_Pos)       /*!< 0x01000000 */\r
+#define CAN_F6R1_FB24                        CAN_F6R1_FB24_Msk                 /*!< Filter bit 24 */\r
+#define CAN_F6R1_FB25_Pos                    (25U)                             \r
+#define CAN_F6R1_FB25_Msk                    (0x1UL << CAN_F6R1_FB25_Pos)       /*!< 0x02000000 */\r
+#define CAN_F6R1_FB25                        CAN_F6R1_FB25_Msk                 /*!< Filter bit 25 */\r
+#define CAN_F6R1_FB26_Pos                    (26U)                             \r
+#define CAN_F6R1_FB26_Msk                    (0x1UL << CAN_F6R1_FB26_Pos)       /*!< 0x04000000 */\r
+#define CAN_F6R1_FB26                        CAN_F6R1_FB26_Msk                 /*!< Filter bit 26 */\r
+#define CAN_F6R1_FB27_Pos                    (27U)                             \r
+#define CAN_F6R1_FB27_Msk                    (0x1UL << CAN_F6R1_FB27_Pos)       /*!< 0x08000000 */\r
+#define CAN_F6R1_FB27                        CAN_F6R1_FB27_Msk                 /*!< Filter bit 27 */\r
+#define CAN_F6R1_FB28_Pos                    (28U)                             \r
+#define CAN_F6R1_FB28_Msk                    (0x1UL << CAN_F6R1_FB28_Pos)       /*!< 0x10000000 */\r
+#define CAN_F6R1_FB28                        CAN_F6R1_FB28_Msk                 /*!< Filter bit 28 */\r
+#define CAN_F6R1_FB29_Pos                    (29U)                             \r
+#define CAN_F6R1_FB29_Msk                    (0x1UL << CAN_F6R1_FB29_Pos)       /*!< 0x20000000 */\r
+#define CAN_F6R1_FB29                        CAN_F6R1_FB29_Msk                 /*!< Filter bit 29 */\r
+#define CAN_F6R1_FB30_Pos                    (30U)                             \r
+#define CAN_F6R1_FB30_Msk                    (0x1UL << CAN_F6R1_FB30_Pos)       /*!< 0x40000000 */\r
+#define CAN_F6R1_FB30                        CAN_F6R1_FB30_Msk                 /*!< Filter bit 30 */\r
+#define CAN_F6R1_FB31_Pos                    (31U)                             \r
+#define CAN_F6R1_FB31_Msk                    (0x1UL << CAN_F6R1_FB31_Pos)       /*!< 0x80000000 */\r
+#define CAN_F6R1_FB31                        CAN_F6R1_FB31_Msk                 /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F7R1 register  *******************/\r
+#define CAN_F7R1_FB0_Pos                     (0U)                              \r
+#define CAN_F7R1_FB0_Msk                     (0x1UL << CAN_F7R1_FB0_Pos)        /*!< 0x00000001 */\r
+#define CAN_F7R1_FB0                         CAN_F7R1_FB0_Msk                  /*!< Filter bit 0 */\r
+#define CAN_F7R1_FB1_Pos                     (1U)                              \r
+#define CAN_F7R1_FB1_Msk                     (0x1UL << CAN_F7R1_FB1_Pos)        /*!< 0x00000002 */\r
+#define CAN_F7R1_FB1                         CAN_F7R1_FB1_Msk                  /*!< Filter bit 1 */\r
+#define CAN_F7R1_FB2_Pos                     (2U)                              \r
+#define CAN_F7R1_FB2_Msk                     (0x1UL << CAN_F7R1_FB2_Pos)        /*!< 0x00000004 */\r
+#define CAN_F7R1_FB2                         CAN_F7R1_FB2_Msk                  /*!< Filter bit 2 */\r
+#define CAN_F7R1_FB3_Pos                     (3U)                              \r
+#define CAN_F7R1_FB3_Msk                     (0x1UL << CAN_F7R1_FB3_Pos)        /*!< 0x00000008 */\r
+#define CAN_F7R1_FB3                         CAN_F7R1_FB3_Msk                  /*!< Filter bit 3 */\r
+#define CAN_F7R1_FB4_Pos                     (4U)                              \r
+#define CAN_F7R1_FB4_Msk                     (0x1UL << CAN_F7R1_FB4_Pos)        /*!< 0x00000010 */\r
+#define CAN_F7R1_FB4                         CAN_F7R1_FB4_Msk                  /*!< Filter bit 4 */\r
+#define CAN_F7R1_FB5_Pos                     (5U)                              \r
+#define CAN_F7R1_FB5_Msk                     (0x1UL << CAN_F7R1_FB5_Pos)        /*!< 0x00000020 */\r
+#define CAN_F7R1_FB5                         CAN_F7R1_FB5_Msk                  /*!< Filter bit 5 */\r
+#define CAN_F7R1_FB6_Pos                     (6U)                              \r
+#define CAN_F7R1_FB6_Msk                     (0x1UL << CAN_F7R1_FB6_Pos)        /*!< 0x00000040 */\r
+#define CAN_F7R1_FB6                         CAN_F7R1_FB6_Msk                  /*!< Filter bit 6 */\r
+#define CAN_F7R1_FB7_Pos                     (7U)                              \r
+#define CAN_F7R1_FB7_Msk                     (0x1UL << CAN_F7R1_FB7_Pos)        /*!< 0x00000080 */\r
+#define CAN_F7R1_FB7                         CAN_F7R1_FB7_Msk                  /*!< Filter bit 7 */\r
+#define CAN_F7R1_FB8_Pos                     (8U)                              \r
+#define CAN_F7R1_FB8_Msk                     (0x1UL << CAN_F7R1_FB8_Pos)        /*!< 0x00000100 */\r
+#define CAN_F7R1_FB8                         CAN_F7R1_FB8_Msk                  /*!< Filter bit 8 */\r
+#define CAN_F7R1_FB9_Pos                     (9U)                              \r
+#define CAN_F7R1_FB9_Msk                     (0x1UL << CAN_F7R1_FB9_Pos)        /*!< 0x00000200 */\r
+#define CAN_F7R1_FB9                         CAN_F7R1_FB9_Msk                  /*!< Filter bit 9 */\r
+#define CAN_F7R1_FB10_Pos                    (10U)                             \r
+#define CAN_F7R1_FB10_Msk                    (0x1UL << CAN_F7R1_FB10_Pos)       /*!< 0x00000400 */\r
+#define CAN_F7R1_FB10                        CAN_F7R1_FB10_Msk                 /*!< Filter bit 10 */\r
+#define CAN_F7R1_FB11_Pos                    (11U)                             \r
+#define CAN_F7R1_FB11_Msk                    (0x1UL << CAN_F7R1_FB11_Pos)       /*!< 0x00000800 */\r
+#define CAN_F7R1_FB11                        CAN_F7R1_FB11_Msk                 /*!< Filter bit 11 */\r
+#define CAN_F7R1_FB12_Pos                    (12U)                             \r
+#define CAN_F7R1_FB12_Msk                    (0x1UL << CAN_F7R1_FB12_Pos)       /*!< 0x00001000 */\r
+#define CAN_F7R1_FB12                        CAN_F7R1_FB12_Msk                 /*!< Filter bit 12 */\r
+#define CAN_F7R1_FB13_Pos                    (13U)                             \r
+#define CAN_F7R1_FB13_Msk                    (0x1UL << CAN_F7R1_FB13_Pos)       /*!< 0x00002000 */\r
+#define CAN_F7R1_FB13                        CAN_F7R1_FB13_Msk                 /*!< Filter bit 13 */\r
+#define CAN_F7R1_FB14_Pos                    (14U)                             \r
+#define CAN_F7R1_FB14_Msk                    (0x1UL << CAN_F7R1_FB14_Pos)       /*!< 0x00004000 */\r
+#define CAN_F7R1_FB14                        CAN_F7R1_FB14_Msk                 /*!< Filter bit 14 */\r
+#define CAN_F7R1_FB15_Pos                    (15U)                             \r
+#define CAN_F7R1_FB15_Msk                    (0x1UL << CAN_F7R1_FB15_Pos)       /*!< 0x00008000 */\r
+#define CAN_F7R1_FB15                        CAN_F7R1_FB15_Msk                 /*!< Filter bit 15 */\r
+#define CAN_F7R1_FB16_Pos                    (16U)                             \r
+#define CAN_F7R1_FB16_Msk                    (0x1UL << CAN_F7R1_FB16_Pos)       /*!< 0x00010000 */\r
+#define CAN_F7R1_FB16                        CAN_F7R1_FB16_Msk                 /*!< Filter bit 16 */\r
+#define CAN_F7R1_FB17_Pos                    (17U)                             \r
+#define CAN_F7R1_FB17_Msk                    (0x1UL << CAN_F7R1_FB17_Pos)       /*!< 0x00020000 */\r
+#define CAN_F7R1_FB17                        CAN_F7R1_FB17_Msk                 /*!< Filter bit 17 */\r
+#define CAN_F7R1_FB18_Pos                    (18U)                             \r
+#define CAN_F7R1_FB18_Msk                    (0x1UL << CAN_F7R1_FB18_Pos)       /*!< 0x00040000 */\r
+#define CAN_F7R1_FB18                        CAN_F7R1_FB18_Msk                 /*!< Filter bit 18 */\r
+#define CAN_F7R1_FB19_Pos                    (19U)                             \r
+#define CAN_F7R1_FB19_Msk                    (0x1UL << CAN_F7R1_FB19_Pos)       /*!< 0x00080000 */\r
+#define CAN_F7R1_FB19                        CAN_F7R1_FB19_Msk                 /*!< Filter bit 19 */\r
+#define CAN_F7R1_FB20_Pos                    (20U)                             \r
+#define CAN_F7R1_FB20_Msk                    (0x1UL << CAN_F7R1_FB20_Pos)       /*!< 0x00100000 */\r
+#define CAN_F7R1_FB20                        CAN_F7R1_FB20_Msk                 /*!< Filter bit 20 */\r
+#define CAN_F7R1_FB21_Pos                    (21U)                             \r
+#define CAN_F7R1_FB21_Msk                    (0x1UL << CAN_F7R1_FB21_Pos)       /*!< 0x00200000 */\r
+#define CAN_F7R1_FB21                        CAN_F7R1_FB21_Msk                 /*!< Filter bit 21 */\r
+#define CAN_F7R1_FB22_Pos                    (22U)                             \r
+#define CAN_F7R1_FB22_Msk                    (0x1UL << CAN_F7R1_FB22_Pos)       /*!< 0x00400000 */\r
+#define CAN_F7R1_FB22                        CAN_F7R1_FB22_Msk                 /*!< Filter bit 22 */\r
+#define CAN_F7R1_FB23_Pos                    (23U)                             \r
+#define CAN_F7R1_FB23_Msk                    (0x1UL << CAN_F7R1_FB23_Pos)       /*!< 0x00800000 */\r
+#define CAN_F7R1_FB23                        CAN_F7R1_FB23_Msk                 /*!< Filter bit 23 */\r
+#define CAN_F7R1_FB24_Pos                    (24U)                             \r
+#define CAN_F7R1_FB24_Msk                    (0x1UL << CAN_F7R1_FB24_Pos)       /*!< 0x01000000 */\r
+#define CAN_F7R1_FB24                        CAN_F7R1_FB24_Msk                 /*!< Filter bit 24 */\r
+#define CAN_F7R1_FB25_Pos                    (25U)                             \r
+#define CAN_F7R1_FB25_Msk                    (0x1UL << CAN_F7R1_FB25_Pos)       /*!< 0x02000000 */\r
+#define CAN_F7R1_FB25                        CAN_F7R1_FB25_Msk                 /*!< Filter bit 25 */\r
+#define CAN_F7R1_FB26_Pos                    (26U)                             \r
+#define CAN_F7R1_FB26_Msk                    (0x1UL << CAN_F7R1_FB26_Pos)       /*!< 0x04000000 */\r
+#define CAN_F7R1_FB26                        CAN_F7R1_FB26_Msk                 /*!< Filter bit 26 */\r
+#define CAN_F7R1_FB27_Pos                    (27U)                             \r
+#define CAN_F7R1_FB27_Msk                    (0x1UL << CAN_F7R1_FB27_Pos)       /*!< 0x08000000 */\r
+#define CAN_F7R1_FB27                        CAN_F7R1_FB27_Msk                 /*!< Filter bit 27 */\r
+#define CAN_F7R1_FB28_Pos                    (28U)                             \r
+#define CAN_F7R1_FB28_Msk                    (0x1UL << CAN_F7R1_FB28_Pos)       /*!< 0x10000000 */\r
+#define CAN_F7R1_FB28                        CAN_F7R1_FB28_Msk                 /*!< Filter bit 28 */\r
+#define CAN_F7R1_FB29_Pos                    (29U)                             \r
+#define CAN_F7R1_FB29_Msk                    (0x1UL << CAN_F7R1_FB29_Pos)       /*!< 0x20000000 */\r
+#define CAN_F7R1_FB29                        CAN_F7R1_FB29_Msk                 /*!< Filter bit 29 */\r
+#define CAN_F7R1_FB30_Pos                    (30U)                             \r
+#define CAN_F7R1_FB30_Msk                    (0x1UL << CAN_F7R1_FB30_Pos)       /*!< 0x40000000 */\r
+#define CAN_F7R1_FB30                        CAN_F7R1_FB30_Msk                 /*!< Filter bit 30 */\r
+#define CAN_F7R1_FB31_Pos                    (31U)                             \r
+#define CAN_F7R1_FB31_Msk                    (0x1UL << CAN_F7R1_FB31_Pos)       /*!< 0x80000000 */\r
+#define CAN_F7R1_FB31                        CAN_F7R1_FB31_Msk                 /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F8R1 register  *******************/\r
+#define CAN_F8R1_FB0_Pos                     (0U)                              \r
+#define CAN_F8R1_FB0_Msk                     (0x1UL << CAN_F8R1_FB0_Pos)        /*!< 0x00000001 */\r
+#define CAN_F8R1_FB0                         CAN_F8R1_FB0_Msk                  /*!< Filter bit 0 */\r
+#define CAN_F8R1_FB1_Pos                     (1U)                              \r
+#define CAN_F8R1_FB1_Msk                     (0x1UL << CAN_F8R1_FB1_Pos)        /*!< 0x00000002 */\r
+#define CAN_F8R1_FB1                         CAN_F8R1_FB1_Msk                  /*!< Filter bit 1 */\r
+#define CAN_F8R1_FB2_Pos                     (2U)                              \r
+#define CAN_F8R1_FB2_Msk                     (0x1UL << CAN_F8R1_FB2_Pos)        /*!< 0x00000004 */\r
+#define CAN_F8R1_FB2                         CAN_F8R1_FB2_Msk                  /*!< Filter bit 2 */\r
+#define CAN_F8R1_FB3_Pos                     (3U)                              \r
+#define CAN_F8R1_FB3_Msk                     (0x1UL << CAN_F8R1_FB3_Pos)        /*!< 0x00000008 */\r
+#define CAN_F8R1_FB3                         CAN_F8R1_FB3_Msk                  /*!< Filter bit 3 */\r
+#define CAN_F8R1_FB4_Pos                     (4U)                              \r
+#define CAN_F8R1_FB4_Msk                     (0x1UL << CAN_F8R1_FB4_Pos)        /*!< 0x00000010 */\r
+#define CAN_F8R1_FB4                         CAN_F8R1_FB4_Msk                  /*!< Filter bit 4 */\r
+#define CAN_F8R1_FB5_Pos                     (5U)                              \r
+#define CAN_F8R1_FB5_Msk                     (0x1UL << CAN_F8R1_FB5_Pos)        /*!< 0x00000020 */\r
+#define CAN_F8R1_FB5                         CAN_F8R1_FB5_Msk                  /*!< Filter bit 5 */\r
+#define CAN_F8R1_FB6_Pos                     (6U)                              \r
+#define CAN_F8R1_FB6_Msk                     (0x1UL << CAN_F8R1_FB6_Pos)        /*!< 0x00000040 */\r
+#define CAN_F8R1_FB6                         CAN_F8R1_FB6_Msk                  /*!< Filter bit 6 */\r
+#define CAN_F8R1_FB7_Pos                     (7U)                              \r
+#define CAN_F8R1_FB7_Msk                     (0x1UL << CAN_F8R1_FB7_Pos)        /*!< 0x00000080 */\r
+#define CAN_F8R1_FB7                         CAN_F8R1_FB7_Msk                  /*!< Filter bit 7 */\r
+#define CAN_F8R1_FB8_Pos                     (8U)                              \r
+#define CAN_F8R1_FB8_Msk                     (0x1UL << CAN_F8R1_FB8_Pos)        /*!< 0x00000100 */\r
+#define CAN_F8R1_FB8                         CAN_F8R1_FB8_Msk                  /*!< Filter bit 8 */\r
+#define CAN_F8R1_FB9_Pos                     (9U)                              \r
+#define CAN_F8R1_FB9_Msk                     (0x1UL << CAN_F8R1_FB9_Pos)        /*!< 0x00000200 */\r
+#define CAN_F8R1_FB9                         CAN_F8R1_FB9_Msk                  /*!< Filter bit 9 */\r
+#define CAN_F8R1_FB10_Pos                    (10U)                             \r
+#define CAN_F8R1_FB10_Msk                    (0x1UL << CAN_F8R1_FB10_Pos)       /*!< 0x00000400 */\r
+#define CAN_F8R1_FB10                        CAN_F8R1_FB10_Msk                 /*!< Filter bit 10 */\r
+#define CAN_F8R1_FB11_Pos                    (11U)                             \r
+#define CAN_F8R1_FB11_Msk                    (0x1UL << CAN_F8R1_FB11_Pos)       /*!< 0x00000800 */\r
+#define CAN_F8R1_FB11                        CAN_F8R1_FB11_Msk                 /*!< Filter bit 11 */\r
+#define CAN_F8R1_FB12_Pos                    (12U)                             \r
+#define CAN_F8R1_FB12_Msk                    (0x1UL << CAN_F8R1_FB12_Pos)       /*!< 0x00001000 */\r
+#define CAN_F8R1_FB12                        CAN_F8R1_FB12_Msk                 /*!< Filter bit 12 */\r
+#define CAN_F8R1_FB13_Pos                    (13U)                             \r
+#define CAN_F8R1_FB13_Msk                    (0x1UL << CAN_F8R1_FB13_Pos)       /*!< 0x00002000 */\r
+#define CAN_F8R1_FB13                        CAN_F8R1_FB13_Msk                 /*!< Filter bit 13 */\r
+#define CAN_F8R1_FB14_Pos                    (14U)                             \r
+#define CAN_F8R1_FB14_Msk                    (0x1UL << CAN_F8R1_FB14_Pos)       /*!< 0x00004000 */\r
+#define CAN_F8R1_FB14                        CAN_F8R1_FB14_Msk                 /*!< Filter bit 14 */\r
+#define CAN_F8R1_FB15_Pos                    (15U)                             \r
+#define CAN_F8R1_FB15_Msk                    (0x1UL << CAN_F8R1_FB15_Pos)       /*!< 0x00008000 */\r
+#define CAN_F8R1_FB15                        CAN_F8R1_FB15_Msk                 /*!< Filter bit 15 */\r
+#define CAN_F8R1_FB16_Pos                    (16U)                             \r
+#define CAN_F8R1_FB16_Msk                    (0x1UL << CAN_F8R1_FB16_Pos)       /*!< 0x00010000 */\r
+#define CAN_F8R1_FB16                        CAN_F8R1_FB16_Msk                 /*!< Filter bit 16 */\r
+#define CAN_F8R1_FB17_Pos                    (17U)                             \r
+#define CAN_F8R1_FB17_Msk                    (0x1UL << CAN_F8R1_FB17_Pos)       /*!< 0x00020000 */\r
+#define CAN_F8R1_FB17                        CAN_F8R1_FB17_Msk                 /*!< Filter bit 17 */\r
+#define CAN_F8R1_FB18_Pos                    (18U)                             \r
+#define CAN_F8R1_FB18_Msk                    (0x1UL << CAN_F8R1_FB18_Pos)       /*!< 0x00040000 */\r
+#define CAN_F8R1_FB18                        CAN_F8R1_FB18_Msk                 /*!< Filter bit 18 */\r
+#define CAN_F8R1_FB19_Pos                    (19U)                             \r
+#define CAN_F8R1_FB19_Msk                    (0x1UL << CAN_F8R1_FB19_Pos)       /*!< 0x00080000 */\r
+#define CAN_F8R1_FB19                        CAN_F8R1_FB19_Msk                 /*!< Filter bit 19 */\r
+#define CAN_F8R1_FB20_Pos                    (20U)                             \r
+#define CAN_F8R1_FB20_Msk                    (0x1UL << CAN_F8R1_FB20_Pos)       /*!< 0x00100000 */\r
+#define CAN_F8R1_FB20                        CAN_F8R1_FB20_Msk                 /*!< Filter bit 20 */\r
+#define CAN_F8R1_FB21_Pos                    (21U)                             \r
+#define CAN_F8R1_FB21_Msk                    (0x1UL << CAN_F8R1_FB21_Pos)       /*!< 0x00200000 */\r
+#define CAN_F8R1_FB21                        CAN_F8R1_FB21_Msk                 /*!< Filter bit 21 */\r
+#define CAN_F8R1_FB22_Pos                    (22U)                             \r
+#define CAN_F8R1_FB22_Msk                    (0x1UL << CAN_F8R1_FB22_Pos)       /*!< 0x00400000 */\r
+#define CAN_F8R1_FB22                        CAN_F8R1_FB22_Msk                 /*!< Filter bit 22 */\r
+#define CAN_F8R1_FB23_Pos                    (23U)                             \r
+#define CAN_F8R1_FB23_Msk                    (0x1UL << CAN_F8R1_FB23_Pos)       /*!< 0x00800000 */\r
+#define CAN_F8R1_FB23                        CAN_F8R1_FB23_Msk                 /*!< Filter bit 23 */\r
+#define CAN_F8R1_FB24_Pos                    (24U)                             \r
+#define CAN_F8R1_FB24_Msk                    (0x1UL << CAN_F8R1_FB24_Pos)       /*!< 0x01000000 */\r
+#define CAN_F8R1_FB24                        CAN_F8R1_FB24_Msk                 /*!< Filter bit 24 */\r
+#define CAN_F8R1_FB25_Pos                    (25U)                             \r
+#define CAN_F8R1_FB25_Msk                    (0x1UL << CAN_F8R1_FB25_Pos)       /*!< 0x02000000 */\r
+#define CAN_F8R1_FB25                        CAN_F8R1_FB25_Msk                 /*!< Filter bit 25 */\r
+#define CAN_F8R1_FB26_Pos                    (26U)                             \r
+#define CAN_F8R1_FB26_Msk                    (0x1UL << CAN_F8R1_FB26_Pos)       /*!< 0x04000000 */\r
+#define CAN_F8R1_FB26                        CAN_F8R1_FB26_Msk                 /*!< Filter bit 26 */\r
+#define CAN_F8R1_FB27_Pos                    (27U)                             \r
+#define CAN_F8R1_FB27_Msk                    (0x1UL << CAN_F8R1_FB27_Pos)       /*!< 0x08000000 */\r
+#define CAN_F8R1_FB27                        CAN_F8R1_FB27_Msk                 /*!< Filter bit 27 */\r
+#define CAN_F8R1_FB28_Pos                    (28U)                             \r
+#define CAN_F8R1_FB28_Msk                    (0x1UL << CAN_F8R1_FB28_Pos)       /*!< 0x10000000 */\r
+#define CAN_F8R1_FB28                        CAN_F8R1_FB28_Msk                 /*!< Filter bit 28 */\r
+#define CAN_F8R1_FB29_Pos                    (29U)                             \r
+#define CAN_F8R1_FB29_Msk                    (0x1UL << CAN_F8R1_FB29_Pos)       /*!< 0x20000000 */\r
+#define CAN_F8R1_FB29                        CAN_F8R1_FB29_Msk                 /*!< Filter bit 29 */\r
+#define CAN_F8R1_FB30_Pos                    (30U)                             \r
+#define CAN_F8R1_FB30_Msk                    (0x1UL << CAN_F8R1_FB30_Pos)       /*!< 0x40000000 */\r
+#define CAN_F8R1_FB30                        CAN_F8R1_FB30_Msk                 /*!< Filter bit 30 */\r
+#define CAN_F8R1_FB31_Pos                    (31U)                             \r
+#define CAN_F8R1_FB31_Msk                    (0x1UL << CAN_F8R1_FB31_Pos)       /*!< 0x80000000 */\r
+#define CAN_F8R1_FB31                        CAN_F8R1_FB31_Msk                 /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F9R1 register  *******************/\r
+#define CAN_F9R1_FB0_Pos                     (0U)                              \r
+#define CAN_F9R1_FB0_Msk                     (0x1UL << CAN_F9R1_FB0_Pos)        /*!< 0x00000001 */\r
+#define CAN_F9R1_FB0                         CAN_F9R1_FB0_Msk                  /*!< Filter bit 0 */\r
+#define CAN_F9R1_FB1_Pos                     (1U)                              \r
+#define CAN_F9R1_FB1_Msk                     (0x1UL << CAN_F9R1_FB1_Pos)        /*!< 0x00000002 */\r
+#define CAN_F9R1_FB1                         CAN_F9R1_FB1_Msk                  /*!< Filter bit 1 */\r
+#define CAN_F9R1_FB2_Pos                     (2U)                              \r
+#define CAN_F9R1_FB2_Msk                     (0x1UL << CAN_F9R1_FB2_Pos)        /*!< 0x00000004 */\r
+#define CAN_F9R1_FB2                         CAN_F9R1_FB2_Msk                  /*!< Filter bit 2 */\r
+#define CAN_F9R1_FB3_Pos                     (3U)                              \r
+#define CAN_F9R1_FB3_Msk                     (0x1UL << CAN_F9R1_FB3_Pos)        /*!< 0x00000008 */\r
+#define CAN_F9R1_FB3                         CAN_F9R1_FB3_Msk                  /*!< Filter bit 3 */\r
+#define CAN_F9R1_FB4_Pos                     (4U)                              \r
+#define CAN_F9R1_FB4_Msk                     (0x1UL << CAN_F9R1_FB4_Pos)        /*!< 0x00000010 */\r
+#define CAN_F9R1_FB4                         CAN_F9R1_FB4_Msk                  /*!< Filter bit 4 */\r
+#define CAN_F9R1_FB5_Pos                     (5U)                              \r
+#define CAN_F9R1_FB5_Msk                     (0x1UL << CAN_F9R1_FB5_Pos)        /*!< 0x00000020 */\r
+#define CAN_F9R1_FB5                         CAN_F9R1_FB5_Msk                  /*!< Filter bit 5 */\r
+#define CAN_F9R1_FB6_Pos                     (6U)                              \r
+#define CAN_F9R1_FB6_Msk                     (0x1UL << CAN_F9R1_FB6_Pos)        /*!< 0x00000040 */\r
+#define CAN_F9R1_FB6                         CAN_F9R1_FB6_Msk                  /*!< Filter bit 6 */\r
+#define CAN_F9R1_FB7_Pos                     (7U)                              \r
+#define CAN_F9R1_FB7_Msk                     (0x1UL << CAN_F9R1_FB7_Pos)        /*!< 0x00000080 */\r
+#define CAN_F9R1_FB7                         CAN_F9R1_FB7_Msk                  /*!< Filter bit 7 */\r
+#define CAN_F9R1_FB8_Pos                     (8U)                              \r
+#define CAN_F9R1_FB8_Msk                     (0x1UL << CAN_F9R1_FB8_Pos)        /*!< 0x00000100 */\r
+#define CAN_F9R1_FB8                         CAN_F9R1_FB8_Msk                  /*!< Filter bit 8 */\r
+#define CAN_F9R1_FB9_Pos                     (9U)                              \r
+#define CAN_F9R1_FB9_Msk                     (0x1UL << CAN_F9R1_FB9_Pos)        /*!< 0x00000200 */\r
+#define CAN_F9R1_FB9                         CAN_F9R1_FB9_Msk                  /*!< Filter bit 9 */\r
+#define CAN_F9R1_FB10_Pos                    (10U)                             \r
+#define CAN_F9R1_FB10_Msk                    (0x1UL << CAN_F9R1_FB10_Pos)       /*!< 0x00000400 */\r
+#define CAN_F9R1_FB10                        CAN_F9R1_FB10_Msk                 /*!< Filter bit 10 */\r
+#define CAN_F9R1_FB11_Pos                    (11U)                             \r
+#define CAN_F9R1_FB11_Msk                    (0x1UL << CAN_F9R1_FB11_Pos)       /*!< 0x00000800 */\r
+#define CAN_F9R1_FB11                        CAN_F9R1_FB11_Msk                 /*!< Filter bit 11 */\r
+#define CAN_F9R1_FB12_Pos                    (12U)                             \r
+#define CAN_F9R1_FB12_Msk                    (0x1UL << CAN_F9R1_FB12_Pos)       /*!< 0x00001000 */\r
+#define CAN_F9R1_FB12                        CAN_F9R1_FB12_Msk                 /*!< Filter bit 12 */\r
+#define CAN_F9R1_FB13_Pos                    (13U)                             \r
+#define CAN_F9R1_FB13_Msk                    (0x1UL << CAN_F9R1_FB13_Pos)       /*!< 0x00002000 */\r
+#define CAN_F9R1_FB13                        CAN_F9R1_FB13_Msk                 /*!< Filter bit 13 */\r
+#define CAN_F9R1_FB14_Pos                    (14U)                             \r
+#define CAN_F9R1_FB14_Msk                    (0x1UL << CAN_F9R1_FB14_Pos)       /*!< 0x00004000 */\r
+#define CAN_F9R1_FB14                        CAN_F9R1_FB14_Msk                 /*!< Filter bit 14 */\r
+#define CAN_F9R1_FB15_Pos                    (15U)                             \r
+#define CAN_F9R1_FB15_Msk                    (0x1UL << CAN_F9R1_FB15_Pos)       /*!< 0x00008000 */\r
+#define CAN_F9R1_FB15                        CAN_F9R1_FB15_Msk                 /*!< Filter bit 15 */\r
+#define CAN_F9R1_FB16_Pos                    (16U)                             \r
+#define CAN_F9R1_FB16_Msk                    (0x1UL << CAN_F9R1_FB16_Pos)       /*!< 0x00010000 */\r
+#define CAN_F9R1_FB16                        CAN_F9R1_FB16_Msk                 /*!< Filter bit 16 */\r
+#define CAN_F9R1_FB17_Pos                    (17U)                             \r
+#define CAN_F9R1_FB17_Msk                    (0x1UL << CAN_F9R1_FB17_Pos)       /*!< 0x00020000 */\r
+#define CAN_F9R1_FB17                        CAN_F9R1_FB17_Msk                 /*!< Filter bit 17 */\r
+#define CAN_F9R1_FB18_Pos                    (18U)                             \r
+#define CAN_F9R1_FB18_Msk                    (0x1UL << CAN_F9R1_FB18_Pos)       /*!< 0x00040000 */\r
+#define CAN_F9R1_FB18                        CAN_F9R1_FB18_Msk                 /*!< Filter bit 18 */\r
+#define CAN_F9R1_FB19_Pos                    (19U)                             \r
+#define CAN_F9R1_FB19_Msk                    (0x1UL << CAN_F9R1_FB19_Pos)       /*!< 0x00080000 */\r
+#define CAN_F9R1_FB19                        CAN_F9R1_FB19_Msk                 /*!< Filter bit 19 */\r
+#define CAN_F9R1_FB20_Pos                    (20U)                             \r
+#define CAN_F9R1_FB20_Msk                    (0x1UL << CAN_F9R1_FB20_Pos)       /*!< 0x00100000 */\r
+#define CAN_F9R1_FB20                        CAN_F9R1_FB20_Msk                 /*!< Filter bit 20 */\r
+#define CAN_F9R1_FB21_Pos                    (21U)                             \r
+#define CAN_F9R1_FB21_Msk                    (0x1UL << CAN_F9R1_FB21_Pos)       /*!< 0x00200000 */\r
+#define CAN_F9R1_FB21                        CAN_F9R1_FB21_Msk                 /*!< Filter bit 21 */\r
+#define CAN_F9R1_FB22_Pos                    (22U)                             \r
+#define CAN_F9R1_FB22_Msk                    (0x1UL << CAN_F9R1_FB22_Pos)       /*!< 0x00400000 */\r
+#define CAN_F9R1_FB22                        CAN_F9R1_FB22_Msk                 /*!< Filter bit 22 */\r
+#define CAN_F9R1_FB23_Pos                    (23U)                             \r
+#define CAN_F9R1_FB23_Msk                    (0x1UL << CAN_F9R1_FB23_Pos)       /*!< 0x00800000 */\r
+#define CAN_F9R1_FB23                        CAN_F9R1_FB23_Msk                 /*!< Filter bit 23 */\r
+#define CAN_F9R1_FB24_Pos                    (24U)                             \r
+#define CAN_F9R1_FB24_Msk                    (0x1UL << CAN_F9R1_FB24_Pos)       /*!< 0x01000000 */\r
+#define CAN_F9R1_FB24                        CAN_F9R1_FB24_Msk                 /*!< Filter bit 24 */\r
+#define CAN_F9R1_FB25_Pos                    (25U)                             \r
+#define CAN_F9R1_FB25_Msk                    (0x1UL << CAN_F9R1_FB25_Pos)       /*!< 0x02000000 */\r
+#define CAN_F9R1_FB25                        CAN_F9R1_FB25_Msk                 /*!< Filter bit 25 */\r
+#define CAN_F9R1_FB26_Pos                    (26U)                             \r
+#define CAN_F9R1_FB26_Msk                    (0x1UL << CAN_F9R1_FB26_Pos)       /*!< 0x04000000 */\r
+#define CAN_F9R1_FB26                        CAN_F9R1_FB26_Msk                 /*!< Filter bit 26 */\r
+#define CAN_F9R1_FB27_Pos                    (27U)                             \r
+#define CAN_F9R1_FB27_Msk                    (0x1UL << CAN_F9R1_FB27_Pos)       /*!< 0x08000000 */\r
+#define CAN_F9R1_FB27                        CAN_F9R1_FB27_Msk                 /*!< Filter bit 27 */\r
+#define CAN_F9R1_FB28_Pos                    (28U)                             \r
+#define CAN_F9R1_FB28_Msk                    (0x1UL << CAN_F9R1_FB28_Pos)       /*!< 0x10000000 */\r
+#define CAN_F9R1_FB28                        CAN_F9R1_FB28_Msk                 /*!< Filter bit 28 */\r
+#define CAN_F9R1_FB29_Pos                    (29U)                             \r
+#define CAN_F9R1_FB29_Msk                    (0x1UL << CAN_F9R1_FB29_Pos)       /*!< 0x20000000 */\r
+#define CAN_F9R1_FB29                        CAN_F9R1_FB29_Msk                 /*!< Filter bit 29 */\r
+#define CAN_F9R1_FB30_Pos                    (30U)                             \r
+#define CAN_F9R1_FB30_Msk                    (0x1UL << CAN_F9R1_FB30_Pos)       /*!< 0x40000000 */\r
+#define CAN_F9R1_FB30                        CAN_F9R1_FB30_Msk                 /*!< Filter bit 30 */\r
+#define CAN_F9R1_FB31_Pos                    (31U)                             \r
+#define CAN_F9R1_FB31_Msk                    (0x1UL << CAN_F9R1_FB31_Pos)       /*!< 0x80000000 */\r
+#define CAN_F9R1_FB31                        CAN_F9R1_FB31_Msk                 /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F10R1 register  ******************/\r
+#define CAN_F10R1_FB0_Pos                    (0U)                              \r
+#define CAN_F10R1_FB0_Msk                    (0x1UL << CAN_F10R1_FB0_Pos)       /*!< 0x00000001 */\r
+#define CAN_F10R1_FB0                        CAN_F10R1_FB0_Msk                 /*!< Filter bit 0 */\r
+#define CAN_F10R1_FB1_Pos                    (1U)                              \r
+#define CAN_F10R1_FB1_Msk                    (0x1UL << CAN_F10R1_FB1_Pos)       /*!< 0x00000002 */\r
+#define CAN_F10R1_FB1                        CAN_F10R1_FB1_Msk                 /*!< Filter bit 1 */\r
+#define CAN_F10R1_FB2_Pos                    (2U)                              \r
+#define CAN_F10R1_FB2_Msk                    (0x1UL << CAN_F10R1_FB2_Pos)       /*!< 0x00000004 */\r
+#define CAN_F10R1_FB2                        CAN_F10R1_FB2_Msk                 /*!< Filter bit 2 */\r
+#define CAN_F10R1_FB3_Pos                    (3U)                              \r
+#define CAN_F10R1_FB3_Msk                    (0x1UL << CAN_F10R1_FB3_Pos)       /*!< 0x00000008 */\r
+#define CAN_F10R1_FB3                        CAN_F10R1_FB3_Msk                 /*!< Filter bit 3 */\r
+#define CAN_F10R1_FB4_Pos                    (4U)                              \r
+#define CAN_F10R1_FB4_Msk                    (0x1UL << CAN_F10R1_FB4_Pos)       /*!< 0x00000010 */\r
+#define CAN_F10R1_FB4                        CAN_F10R1_FB4_Msk                 /*!< Filter bit 4 */\r
+#define CAN_F10R1_FB5_Pos                    (5U)                              \r
+#define CAN_F10R1_FB5_Msk                    (0x1UL << CAN_F10R1_FB5_Pos)       /*!< 0x00000020 */\r
+#define CAN_F10R1_FB5                        CAN_F10R1_FB5_Msk                 /*!< Filter bit 5 */\r
+#define CAN_F10R1_FB6_Pos                    (6U)                              \r
+#define CAN_F10R1_FB6_Msk                    (0x1UL << CAN_F10R1_FB6_Pos)       /*!< 0x00000040 */\r
+#define CAN_F10R1_FB6                        CAN_F10R1_FB6_Msk                 /*!< Filter bit 6 */\r
+#define CAN_F10R1_FB7_Pos                    (7U)                              \r
+#define CAN_F10R1_FB7_Msk                    (0x1UL << CAN_F10R1_FB7_Pos)       /*!< 0x00000080 */\r
+#define CAN_F10R1_FB7                        CAN_F10R1_FB7_Msk                 /*!< Filter bit 7 */\r
+#define CAN_F10R1_FB8_Pos                    (8U)                              \r
+#define CAN_F10R1_FB8_Msk                    (0x1UL << CAN_F10R1_FB8_Pos)       /*!< 0x00000100 */\r
+#define CAN_F10R1_FB8                        CAN_F10R1_FB8_Msk                 /*!< Filter bit 8 */\r
+#define CAN_F10R1_FB9_Pos                    (9U)                              \r
+#define CAN_F10R1_FB9_Msk                    (0x1UL << CAN_F10R1_FB9_Pos)       /*!< 0x00000200 */\r
+#define CAN_F10R1_FB9                        CAN_F10R1_FB9_Msk                 /*!< Filter bit 9 */\r
+#define CAN_F10R1_FB10_Pos                   (10U)                             \r
+#define CAN_F10R1_FB10_Msk                   (0x1UL << CAN_F10R1_FB10_Pos)      /*!< 0x00000400 */\r
+#define CAN_F10R1_FB10                       CAN_F10R1_FB10_Msk                /*!< Filter bit 10 */\r
+#define CAN_F10R1_FB11_Pos                   (11U)                             \r
+#define CAN_F10R1_FB11_Msk                   (0x1UL << CAN_F10R1_FB11_Pos)      /*!< 0x00000800 */\r
+#define CAN_F10R1_FB11                       CAN_F10R1_FB11_Msk                /*!< Filter bit 11 */\r
+#define CAN_F10R1_FB12_Pos                   (12U)                             \r
+#define CAN_F10R1_FB12_Msk                   (0x1UL << CAN_F10R1_FB12_Pos)      /*!< 0x00001000 */\r
+#define CAN_F10R1_FB12                       CAN_F10R1_FB12_Msk                /*!< Filter bit 12 */\r
+#define CAN_F10R1_FB13_Pos                   (13U)                             \r
+#define CAN_F10R1_FB13_Msk                   (0x1UL << CAN_F10R1_FB13_Pos)      /*!< 0x00002000 */\r
+#define CAN_F10R1_FB13                       CAN_F10R1_FB13_Msk                /*!< Filter bit 13 */\r
+#define CAN_F10R1_FB14_Pos                   (14U)                             \r
+#define CAN_F10R1_FB14_Msk                   (0x1UL << CAN_F10R1_FB14_Pos)      /*!< 0x00004000 */\r
+#define CAN_F10R1_FB14                       CAN_F10R1_FB14_Msk                /*!< Filter bit 14 */\r
+#define CAN_F10R1_FB15_Pos                   (15U)                             \r
+#define CAN_F10R1_FB15_Msk                   (0x1UL << CAN_F10R1_FB15_Pos)      /*!< 0x00008000 */\r
+#define CAN_F10R1_FB15                       CAN_F10R1_FB15_Msk                /*!< Filter bit 15 */\r
+#define CAN_F10R1_FB16_Pos                   (16U)                             \r
+#define CAN_F10R1_FB16_Msk                   (0x1UL << CAN_F10R1_FB16_Pos)      /*!< 0x00010000 */\r
+#define CAN_F10R1_FB16                       CAN_F10R1_FB16_Msk                /*!< Filter bit 16 */\r
+#define CAN_F10R1_FB17_Pos                   (17U)                             \r
+#define CAN_F10R1_FB17_Msk                   (0x1UL << CAN_F10R1_FB17_Pos)      /*!< 0x00020000 */\r
+#define CAN_F10R1_FB17                       CAN_F10R1_FB17_Msk                /*!< Filter bit 17 */\r
+#define CAN_F10R1_FB18_Pos                   (18U)                             \r
+#define CAN_F10R1_FB18_Msk                   (0x1UL << CAN_F10R1_FB18_Pos)      /*!< 0x00040000 */\r
+#define CAN_F10R1_FB18                       CAN_F10R1_FB18_Msk                /*!< Filter bit 18 */\r
+#define CAN_F10R1_FB19_Pos                   (19U)                             \r
+#define CAN_F10R1_FB19_Msk                   (0x1UL << CAN_F10R1_FB19_Pos)      /*!< 0x00080000 */\r
+#define CAN_F10R1_FB19                       CAN_F10R1_FB19_Msk                /*!< Filter bit 19 */\r
+#define CAN_F10R1_FB20_Pos                   (20U)                             \r
+#define CAN_F10R1_FB20_Msk                   (0x1UL << CAN_F10R1_FB20_Pos)      /*!< 0x00100000 */\r
+#define CAN_F10R1_FB20                       CAN_F10R1_FB20_Msk                /*!< Filter bit 20 */\r
+#define CAN_F10R1_FB21_Pos                   (21U)                             \r
+#define CAN_F10R1_FB21_Msk                   (0x1UL << CAN_F10R1_FB21_Pos)      /*!< 0x00200000 */\r
+#define CAN_F10R1_FB21                       CAN_F10R1_FB21_Msk                /*!< Filter bit 21 */\r
+#define CAN_F10R1_FB22_Pos                   (22U)                             \r
+#define CAN_F10R1_FB22_Msk                   (0x1UL << CAN_F10R1_FB22_Pos)      /*!< 0x00400000 */\r
+#define CAN_F10R1_FB22                       CAN_F10R1_FB22_Msk                /*!< Filter bit 22 */\r
+#define CAN_F10R1_FB23_Pos                   (23U)                             \r
+#define CAN_F10R1_FB23_Msk                   (0x1UL << CAN_F10R1_FB23_Pos)      /*!< 0x00800000 */\r
+#define CAN_F10R1_FB23                       CAN_F10R1_FB23_Msk                /*!< Filter bit 23 */\r
+#define CAN_F10R1_FB24_Pos                   (24U)                             \r
+#define CAN_F10R1_FB24_Msk                   (0x1UL << CAN_F10R1_FB24_Pos)      /*!< 0x01000000 */\r
+#define CAN_F10R1_FB24                       CAN_F10R1_FB24_Msk                /*!< Filter bit 24 */\r
+#define CAN_F10R1_FB25_Pos                   (25U)                             \r
+#define CAN_F10R1_FB25_Msk                   (0x1UL << CAN_F10R1_FB25_Pos)      /*!< 0x02000000 */\r
+#define CAN_F10R1_FB25                       CAN_F10R1_FB25_Msk                /*!< Filter bit 25 */\r
+#define CAN_F10R1_FB26_Pos                   (26U)                             \r
+#define CAN_F10R1_FB26_Msk                   (0x1UL << CAN_F10R1_FB26_Pos)      /*!< 0x04000000 */\r
+#define CAN_F10R1_FB26                       CAN_F10R1_FB26_Msk                /*!< Filter bit 26 */\r
+#define CAN_F10R1_FB27_Pos                   (27U)                             \r
+#define CAN_F10R1_FB27_Msk                   (0x1UL << CAN_F10R1_FB27_Pos)      /*!< 0x08000000 */\r
+#define CAN_F10R1_FB27                       CAN_F10R1_FB27_Msk                /*!< Filter bit 27 */\r
+#define CAN_F10R1_FB28_Pos                   (28U)                             \r
+#define CAN_F10R1_FB28_Msk                   (0x1UL << CAN_F10R1_FB28_Pos)      /*!< 0x10000000 */\r
+#define CAN_F10R1_FB28                       CAN_F10R1_FB28_Msk                /*!< Filter bit 28 */\r
+#define CAN_F10R1_FB29_Pos                   (29U)                             \r
+#define CAN_F10R1_FB29_Msk                   (0x1UL << CAN_F10R1_FB29_Pos)      /*!< 0x20000000 */\r
+#define CAN_F10R1_FB29                       CAN_F10R1_FB29_Msk                /*!< Filter bit 29 */\r
+#define CAN_F10R1_FB30_Pos                   (30U)                             \r
+#define CAN_F10R1_FB30_Msk                   (0x1UL << CAN_F10R1_FB30_Pos)      /*!< 0x40000000 */\r
+#define CAN_F10R1_FB30                       CAN_F10R1_FB30_Msk                /*!< Filter bit 30 */\r
+#define CAN_F10R1_FB31_Pos                   (31U)                             \r
+#define CAN_F10R1_FB31_Msk                   (0x1UL << CAN_F10R1_FB31_Pos)      /*!< 0x80000000 */\r
+#define CAN_F10R1_FB31                       CAN_F10R1_FB31_Msk                /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F11R1 register  ******************/\r
+#define CAN_F11R1_FB0_Pos                    (0U)                              \r
+#define CAN_F11R1_FB0_Msk                    (0x1UL << CAN_F11R1_FB0_Pos)       /*!< 0x00000001 */\r
+#define CAN_F11R1_FB0                        CAN_F11R1_FB0_Msk                 /*!< Filter bit 0 */\r
+#define CAN_F11R1_FB1_Pos                    (1U)                              \r
+#define CAN_F11R1_FB1_Msk                    (0x1UL << CAN_F11R1_FB1_Pos)       /*!< 0x00000002 */\r
+#define CAN_F11R1_FB1                        CAN_F11R1_FB1_Msk                 /*!< Filter bit 1 */\r
+#define CAN_F11R1_FB2_Pos                    (2U)                              \r
+#define CAN_F11R1_FB2_Msk                    (0x1UL << CAN_F11R1_FB2_Pos)       /*!< 0x00000004 */\r
+#define CAN_F11R1_FB2                        CAN_F11R1_FB2_Msk                 /*!< Filter bit 2 */\r
+#define CAN_F11R1_FB3_Pos                    (3U)                              \r
+#define CAN_F11R1_FB3_Msk                    (0x1UL << CAN_F11R1_FB3_Pos)       /*!< 0x00000008 */\r
+#define CAN_F11R1_FB3                        CAN_F11R1_FB3_Msk                 /*!< Filter bit 3 */\r
+#define CAN_F11R1_FB4_Pos                    (4U)                              \r
+#define CAN_F11R1_FB4_Msk                    (0x1UL << CAN_F11R1_FB4_Pos)       /*!< 0x00000010 */\r
+#define CAN_F11R1_FB4                        CAN_F11R1_FB4_Msk                 /*!< Filter bit 4 */\r
+#define CAN_F11R1_FB5_Pos                    (5U)                              \r
+#define CAN_F11R1_FB5_Msk                    (0x1UL << CAN_F11R1_FB5_Pos)       /*!< 0x00000020 */\r
+#define CAN_F11R1_FB5                        CAN_F11R1_FB5_Msk                 /*!< Filter bit 5 */\r
+#define CAN_F11R1_FB6_Pos                    (6U)                              \r
+#define CAN_F11R1_FB6_Msk                    (0x1UL << CAN_F11R1_FB6_Pos)       /*!< 0x00000040 */\r
+#define CAN_F11R1_FB6                        CAN_F11R1_FB6_Msk                 /*!< Filter bit 6 */\r
+#define CAN_F11R1_FB7_Pos                    (7U)                              \r
+#define CAN_F11R1_FB7_Msk                    (0x1UL << CAN_F11R1_FB7_Pos)       /*!< 0x00000080 */\r
+#define CAN_F11R1_FB7                        CAN_F11R1_FB7_Msk                 /*!< Filter bit 7 */\r
+#define CAN_F11R1_FB8_Pos                    (8U)                              \r
+#define CAN_F11R1_FB8_Msk                    (0x1UL << CAN_F11R1_FB8_Pos)       /*!< 0x00000100 */\r
+#define CAN_F11R1_FB8                        CAN_F11R1_FB8_Msk                 /*!< Filter bit 8 */\r
+#define CAN_F11R1_FB9_Pos                    (9U)                              \r
+#define CAN_F11R1_FB9_Msk                    (0x1UL << CAN_F11R1_FB9_Pos)       /*!< 0x00000200 */\r
+#define CAN_F11R1_FB9                        CAN_F11R1_FB9_Msk                 /*!< Filter bit 9 */\r
+#define CAN_F11R1_FB10_Pos                   (10U)                             \r
+#define CAN_F11R1_FB10_Msk                   (0x1UL << CAN_F11R1_FB10_Pos)      /*!< 0x00000400 */\r
+#define CAN_F11R1_FB10                       CAN_F11R1_FB10_Msk                /*!< Filter bit 10 */\r
+#define CAN_F11R1_FB11_Pos                   (11U)                             \r
+#define CAN_F11R1_FB11_Msk                   (0x1UL << CAN_F11R1_FB11_Pos)      /*!< 0x00000800 */\r
+#define CAN_F11R1_FB11                       CAN_F11R1_FB11_Msk                /*!< Filter bit 11 */\r
+#define CAN_F11R1_FB12_Pos                   (12U)                             \r
+#define CAN_F11R1_FB12_Msk                   (0x1UL << CAN_F11R1_FB12_Pos)      /*!< 0x00001000 */\r
+#define CAN_F11R1_FB12                       CAN_F11R1_FB12_Msk                /*!< Filter bit 12 */\r
+#define CAN_F11R1_FB13_Pos                   (13U)                             \r
+#define CAN_F11R1_FB13_Msk                   (0x1UL << CAN_F11R1_FB13_Pos)      /*!< 0x00002000 */\r
+#define CAN_F11R1_FB13                       CAN_F11R1_FB13_Msk                /*!< Filter bit 13 */\r
+#define CAN_F11R1_FB14_Pos                   (14U)                             \r
+#define CAN_F11R1_FB14_Msk                   (0x1UL << CAN_F11R1_FB14_Pos)      /*!< 0x00004000 */\r
+#define CAN_F11R1_FB14                       CAN_F11R1_FB14_Msk                /*!< Filter bit 14 */\r
+#define CAN_F11R1_FB15_Pos                   (15U)                             \r
+#define CAN_F11R1_FB15_Msk                   (0x1UL << CAN_F11R1_FB15_Pos)      /*!< 0x00008000 */\r
+#define CAN_F11R1_FB15                       CAN_F11R1_FB15_Msk                /*!< Filter bit 15 */\r
+#define CAN_F11R1_FB16_Pos                   (16U)                             \r
+#define CAN_F11R1_FB16_Msk                   (0x1UL << CAN_F11R1_FB16_Pos)      /*!< 0x00010000 */\r
+#define CAN_F11R1_FB16                       CAN_F11R1_FB16_Msk                /*!< Filter bit 16 */\r
+#define CAN_F11R1_FB17_Pos                   (17U)                             \r
+#define CAN_F11R1_FB17_Msk                   (0x1UL << CAN_F11R1_FB17_Pos)      /*!< 0x00020000 */\r
+#define CAN_F11R1_FB17                       CAN_F11R1_FB17_Msk                /*!< Filter bit 17 */\r
+#define CAN_F11R1_FB18_Pos                   (18U)                             \r
+#define CAN_F11R1_FB18_Msk                   (0x1UL << CAN_F11R1_FB18_Pos)      /*!< 0x00040000 */\r
+#define CAN_F11R1_FB18                       CAN_F11R1_FB18_Msk                /*!< Filter bit 18 */\r
+#define CAN_F11R1_FB19_Pos                   (19U)                             \r
+#define CAN_F11R1_FB19_Msk                   (0x1UL << CAN_F11R1_FB19_Pos)      /*!< 0x00080000 */\r
+#define CAN_F11R1_FB19                       CAN_F11R1_FB19_Msk                /*!< Filter bit 19 */\r
+#define CAN_F11R1_FB20_Pos                   (20U)                             \r
+#define CAN_F11R1_FB20_Msk                   (0x1UL << CAN_F11R1_FB20_Pos)      /*!< 0x00100000 */\r
+#define CAN_F11R1_FB20                       CAN_F11R1_FB20_Msk                /*!< Filter bit 20 */\r
+#define CAN_F11R1_FB21_Pos                   (21U)                             \r
+#define CAN_F11R1_FB21_Msk                   (0x1UL << CAN_F11R1_FB21_Pos)      /*!< 0x00200000 */\r
+#define CAN_F11R1_FB21                       CAN_F11R1_FB21_Msk                /*!< Filter bit 21 */\r
+#define CAN_F11R1_FB22_Pos                   (22U)                             \r
+#define CAN_F11R1_FB22_Msk                   (0x1UL << CAN_F11R1_FB22_Pos)      /*!< 0x00400000 */\r
+#define CAN_F11R1_FB22                       CAN_F11R1_FB22_Msk                /*!< Filter bit 22 */\r
+#define CAN_F11R1_FB23_Pos                   (23U)                             \r
+#define CAN_F11R1_FB23_Msk                   (0x1UL << CAN_F11R1_FB23_Pos)      /*!< 0x00800000 */\r
+#define CAN_F11R1_FB23                       CAN_F11R1_FB23_Msk                /*!< Filter bit 23 */\r
+#define CAN_F11R1_FB24_Pos                   (24U)                             \r
+#define CAN_F11R1_FB24_Msk                   (0x1UL << CAN_F11R1_FB24_Pos)      /*!< 0x01000000 */\r
+#define CAN_F11R1_FB24                       CAN_F11R1_FB24_Msk                /*!< Filter bit 24 */\r
+#define CAN_F11R1_FB25_Pos                   (25U)                             \r
+#define CAN_F11R1_FB25_Msk                   (0x1UL << CAN_F11R1_FB25_Pos)      /*!< 0x02000000 */\r
+#define CAN_F11R1_FB25                       CAN_F11R1_FB25_Msk                /*!< Filter bit 25 */\r
+#define CAN_F11R1_FB26_Pos                   (26U)                             \r
+#define CAN_F11R1_FB26_Msk                   (0x1UL << CAN_F11R1_FB26_Pos)      /*!< 0x04000000 */\r
+#define CAN_F11R1_FB26                       CAN_F11R1_FB26_Msk                /*!< Filter bit 26 */\r
+#define CAN_F11R1_FB27_Pos                   (27U)                             \r
+#define CAN_F11R1_FB27_Msk                   (0x1UL << CAN_F11R1_FB27_Pos)      /*!< 0x08000000 */\r
+#define CAN_F11R1_FB27                       CAN_F11R1_FB27_Msk                /*!< Filter bit 27 */\r
+#define CAN_F11R1_FB28_Pos                   (28U)                             \r
+#define CAN_F11R1_FB28_Msk                   (0x1UL << CAN_F11R1_FB28_Pos)      /*!< 0x10000000 */\r
+#define CAN_F11R1_FB28                       CAN_F11R1_FB28_Msk                /*!< Filter bit 28 */\r
+#define CAN_F11R1_FB29_Pos                   (29U)                             \r
+#define CAN_F11R1_FB29_Msk                   (0x1UL << CAN_F11R1_FB29_Pos)      /*!< 0x20000000 */\r
+#define CAN_F11R1_FB29                       CAN_F11R1_FB29_Msk                /*!< Filter bit 29 */\r
+#define CAN_F11R1_FB30_Pos                   (30U)                             \r
+#define CAN_F11R1_FB30_Msk                   (0x1UL << CAN_F11R1_FB30_Pos)      /*!< 0x40000000 */\r
+#define CAN_F11R1_FB30                       CAN_F11R1_FB30_Msk                /*!< Filter bit 30 */\r
+#define CAN_F11R1_FB31_Pos                   (31U)                             \r
+#define CAN_F11R1_FB31_Msk                   (0x1UL << CAN_F11R1_FB31_Pos)      /*!< 0x80000000 */\r
+#define CAN_F11R1_FB31                       CAN_F11R1_FB31_Msk                /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F12R1 register  ******************/\r
+#define CAN_F12R1_FB0_Pos                    (0U)                              \r
+#define CAN_F12R1_FB0_Msk                    (0x1UL << CAN_F12R1_FB0_Pos)       /*!< 0x00000001 */\r
+#define CAN_F12R1_FB0                        CAN_F12R1_FB0_Msk                 /*!< Filter bit 0 */\r
+#define CAN_F12R1_FB1_Pos                    (1U)                              \r
+#define CAN_F12R1_FB1_Msk                    (0x1UL << CAN_F12R1_FB1_Pos)       /*!< 0x00000002 */\r
+#define CAN_F12R1_FB1                        CAN_F12R1_FB1_Msk                 /*!< Filter bit 1 */\r
+#define CAN_F12R1_FB2_Pos                    (2U)                              \r
+#define CAN_F12R1_FB2_Msk                    (0x1UL << CAN_F12R1_FB2_Pos)       /*!< 0x00000004 */\r
+#define CAN_F12R1_FB2                        CAN_F12R1_FB2_Msk                 /*!< Filter bit 2 */\r
+#define CAN_F12R1_FB3_Pos                    (3U)                              \r
+#define CAN_F12R1_FB3_Msk                    (0x1UL << CAN_F12R1_FB3_Pos)       /*!< 0x00000008 */\r
+#define CAN_F12R1_FB3                        CAN_F12R1_FB3_Msk                 /*!< Filter bit 3 */\r
+#define CAN_F12R1_FB4_Pos                    (4U)                              \r
+#define CAN_F12R1_FB4_Msk                    (0x1UL << CAN_F12R1_FB4_Pos)       /*!< 0x00000010 */\r
+#define CAN_F12R1_FB4                        CAN_F12R1_FB4_Msk                 /*!< Filter bit 4 */\r
+#define CAN_F12R1_FB5_Pos                    (5U)                              \r
+#define CAN_F12R1_FB5_Msk                    (0x1UL << CAN_F12R1_FB5_Pos)       /*!< 0x00000020 */\r
+#define CAN_F12R1_FB5                        CAN_F12R1_FB5_Msk                 /*!< Filter bit 5 */\r
+#define CAN_F12R1_FB6_Pos                    (6U)                              \r
+#define CAN_F12R1_FB6_Msk                    (0x1UL << CAN_F12R1_FB6_Pos)       /*!< 0x00000040 */\r
+#define CAN_F12R1_FB6                        CAN_F12R1_FB6_Msk                 /*!< Filter bit 6 */\r
+#define CAN_F12R1_FB7_Pos                    (7U)                              \r
+#define CAN_F12R1_FB7_Msk                    (0x1UL << CAN_F12R1_FB7_Pos)       /*!< 0x00000080 */\r
+#define CAN_F12R1_FB7                        CAN_F12R1_FB7_Msk                 /*!< Filter bit 7 */\r
+#define CAN_F12R1_FB8_Pos                    (8U)                              \r
+#define CAN_F12R1_FB8_Msk                    (0x1UL << CAN_F12R1_FB8_Pos)       /*!< 0x00000100 */\r
+#define CAN_F12R1_FB8                        CAN_F12R1_FB8_Msk                 /*!< Filter bit 8 */\r
+#define CAN_F12R1_FB9_Pos                    (9U)                              \r
+#define CAN_F12R1_FB9_Msk                    (0x1UL << CAN_F12R1_FB9_Pos)       /*!< 0x00000200 */\r
+#define CAN_F12R1_FB9                        CAN_F12R1_FB9_Msk                 /*!< Filter bit 9 */\r
+#define CAN_F12R1_FB10_Pos                   (10U)                             \r
+#define CAN_F12R1_FB10_Msk                   (0x1UL << CAN_F12R1_FB10_Pos)      /*!< 0x00000400 */\r
+#define CAN_F12R1_FB10                       CAN_F12R1_FB10_Msk                /*!< Filter bit 10 */\r
+#define CAN_F12R1_FB11_Pos                   (11U)                             \r
+#define CAN_F12R1_FB11_Msk                   (0x1UL << CAN_F12R1_FB11_Pos)      /*!< 0x00000800 */\r
+#define CAN_F12R1_FB11                       CAN_F12R1_FB11_Msk                /*!< Filter bit 11 */\r
+#define CAN_F12R1_FB12_Pos                   (12U)                             \r
+#define CAN_F12R1_FB12_Msk                   (0x1UL << CAN_F12R1_FB12_Pos)      /*!< 0x00001000 */\r
+#define CAN_F12R1_FB12                       CAN_F12R1_FB12_Msk                /*!< Filter bit 12 */\r
+#define CAN_F12R1_FB13_Pos                   (13U)                             \r
+#define CAN_F12R1_FB13_Msk                   (0x1UL << CAN_F12R1_FB13_Pos)      /*!< 0x00002000 */\r
+#define CAN_F12R1_FB13                       CAN_F12R1_FB13_Msk                /*!< Filter bit 13 */\r
+#define CAN_F12R1_FB14_Pos                   (14U)                             \r
+#define CAN_F12R1_FB14_Msk                   (0x1UL << CAN_F12R1_FB14_Pos)      /*!< 0x00004000 */\r
+#define CAN_F12R1_FB14                       CAN_F12R1_FB14_Msk                /*!< Filter bit 14 */\r
+#define CAN_F12R1_FB15_Pos                   (15U)                             \r
+#define CAN_F12R1_FB15_Msk                   (0x1UL << CAN_F12R1_FB15_Pos)      /*!< 0x00008000 */\r
+#define CAN_F12R1_FB15                       CAN_F12R1_FB15_Msk                /*!< Filter bit 15 */\r
+#define CAN_F12R1_FB16_Pos                   (16U)                             \r
+#define CAN_F12R1_FB16_Msk                   (0x1UL << CAN_F12R1_FB16_Pos)      /*!< 0x00010000 */\r
+#define CAN_F12R1_FB16                       CAN_F12R1_FB16_Msk                /*!< Filter bit 16 */\r
+#define CAN_F12R1_FB17_Pos                   (17U)                             \r
+#define CAN_F12R1_FB17_Msk                   (0x1UL << CAN_F12R1_FB17_Pos)      /*!< 0x00020000 */\r
+#define CAN_F12R1_FB17                       CAN_F12R1_FB17_Msk                /*!< Filter bit 17 */\r
+#define CAN_F12R1_FB18_Pos                   (18U)                             \r
+#define CAN_F12R1_FB18_Msk                   (0x1UL << CAN_F12R1_FB18_Pos)      /*!< 0x00040000 */\r
+#define CAN_F12R1_FB18                       CAN_F12R1_FB18_Msk                /*!< Filter bit 18 */\r
+#define CAN_F12R1_FB19_Pos                   (19U)                             \r
+#define CAN_F12R1_FB19_Msk                   (0x1UL << CAN_F12R1_FB19_Pos)      /*!< 0x00080000 */\r
+#define CAN_F12R1_FB19                       CAN_F12R1_FB19_Msk                /*!< Filter bit 19 */\r
+#define CAN_F12R1_FB20_Pos                   (20U)                             \r
+#define CAN_F12R1_FB20_Msk                   (0x1UL << CAN_F12R1_FB20_Pos)      /*!< 0x00100000 */\r
+#define CAN_F12R1_FB20                       CAN_F12R1_FB20_Msk                /*!< Filter bit 20 */\r
+#define CAN_F12R1_FB21_Pos                   (21U)                             \r
+#define CAN_F12R1_FB21_Msk                   (0x1UL << CAN_F12R1_FB21_Pos)      /*!< 0x00200000 */\r
+#define CAN_F12R1_FB21                       CAN_F12R1_FB21_Msk                /*!< Filter bit 21 */\r
+#define CAN_F12R1_FB22_Pos                   (22U)                             \r
+#define CAN_F12R1_FB22_Msk                   (0x1UL << CAN_F12R1_FB22_Pos)      /*!< 0x00400000 */\r
+#define CAN_F12R1_FB22                       CAN_F12R1_FB22_Msk                /*!< Filter bit 22 */\r
+#define CAN_F12R1_FB23_Pos                   (23U)                             \r
+#define CAN_F12R1_FB23_Msk                   (0x1UL << CAN_F12R1_FB23_Pos)      /*!< 0x00800000 */\r
+#define CAN_F12R1_FB23                       CAN_F12R1_FB23_Msk                /*!< Filter bit 23 */\r
+#define CAN_F12R1_FB24_Pos                   (24U)                             \r
+#define CAN_F12R1_FB24_Msk                   (0x1UL << CAN_F12R1_FB24_Pos)      /*!< 0x01000000 */\r
+#define CAN_F12R1_FB24                       CAN_F12R1_FB24_Msk                /*!< Filter bit 24 */\r
+#define CAN_F12R1_FB25_Pos                   (25U)                             \r
+#define CAN_F12R1_FB25_Msk                   (0x1UL << CAN_F12R1_FB25_Pos)      /*!< 0x02000000 */\r
+#define CAN_F12R1_FB25                       CAN_F12R1_FB25_Msk                /*!< Filter bit 25 */\r
+#define CAN_F12R1_FB26_Pos                   (26U)                             \r
+#define CAN_F12R1_FB26_Msk                   (0x1UL << CAN_F12R1_FB26_Pos)      /*!< 0x04000000 */\r
+#define CAN_F12R1_FB26                       CAN_F12R1_FB26_Msk                /*!< Filter bit 26 */\r
+#define CAN_F12R1_FB27_Pos                   (27U)                             \r
+#define CAN_F12R1_FB27_Msk                   (0x1UL << CAN_F12R1_FB27_Pos)      /*!< 0x08000000 */\r
+#define CAN_F12R1_FB27                       CAN_F12R1_FB27_Msk                /*!< Filter bit 27 */\r
+#define CAN_F12R1_FB28_Pos                   (28U)                             \r
+#define CAN_F12R1_FB28_Msk                   (0x1UL << CAN_F12R1_FB28_Pos)      /*!< 0x10000000 */\r
+#define CAN_F12R1_FB28                       CAN_F12R1_FB28_Msk                /*!< Filter bit 28 */\r
+#define CAN_F12R1_FB29_Pos                   (29U)                             \r
+#define CAN_F12R1_FB29_Msk                   (0x1UL << CAN_F12R1_FB29_Pos)      /*!< 0x20000000 */\r
+#define CAN_F12R1_FB29                       CAN_F12R1_FB29_Msk                /*!< Filter bit 29 */\r
+#define CAN_F12R1_FB30_Pos                   (30U)                             \r
+#define CAN_F12R1_FB30_Msk                   (0x1UL << CAN_F12R1_FB30_Pos)      /*!< 0x40000000 */\r
+#define CAN_F12R1_FB30                       CAN_F12R1_FB30_Msk                /*!< Filter bit 30 */\r
+#define CAN_F12R1_FB31_Pos                   (31U)                             \r
+#define CAN_F12R1_FB31_Msk                   (0x1UL << CAN_F12R1_FB31_Pos)      /*!< 0x80000000 */\r
+#define CAN_F12R1_FB31                       CAN_F12R1_FB31_Msk                /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F13R1 register  ******************/\r
+#define CAN_F13R1_FB0_Pos                    (0U)                              \r
+#define CAN_F13R1_FB0_Msk                    (0x1UL << CAN_F13R1_FB0_Pos)       /*!< 0x00000001 */\r
+#define CAN_F13R1_FB0                        CAN_F13R1_FB0_Msk                 /*!< Filter bit 0 */\r
+#define CAN_F13R1_FB1_Pos                    (1U)                              \r
+#define CAN_F13R1_FB1_Msk                    (0x1UL << CAN_F13R1_FB1_Pos)       /*!< 0x00000002 */\r
+#define CAN_F13R1_FB1                        CAN_F13R1_FB1_Msk                 /*!< Filter bit 1 */\r
+#define CAN_F13R1_FB2_Pos                    (2U)                              \r
+#define CAN_F13R1_FB2_Msk                    (0x1UL << CAN_F13R1_FB2_Pos)       /*!< 0x00000004 */\r
+#define CAN_F13R1_FB2                        CAN_F13R1_FB2_Msk                 /*!< Filter bit 2 */\r
+#define CAN_F13R1_FB3_Pos                    (3U)                              \r
+#define CAN_F13R1_FB3_Msk                    (0x1UL << CAN_F13R1_FB3_Pos)       /*!< 0x00000008 */\r
+#define CAN_F13R1_FB3                        CAN_F13R1_FB3_Msk                 /*!< Filter bit 3 */\r
+#define CAN_F13R1_FB4_Pos                    (4U)                              \r
+#define CAN_F13R1_FB4_Msk                    (0x1UL << CAN_F13R1_FB4_Pos)       /*!< 0x00000010 */\r
+#define CAN_F13R1_FB4                        CAN_F13R1_FB4_Msk                 /*!< Filter bit 4 */\r
+#define CAN_F13R1_FB5_Pos                    (5U)                              \r
+#define CAN_F13R1_FB5_Msk                    (0x1UL << CAN_F13R1_FB5_Pos)       /*!< 0x00000020 */\r
+#define CAN_F13R1_FB5                        CAN_F13R1_FB5_Msk                 /*!< Filter bit 5 */\r
+#define CAN_F13R1_FB6_Pos                    (6U)                              \r
+#define CAN_F13R1_FB6_Msk                    (0x1UL << CAN_F13R1_FB6_Pos)       /*!< 0x00000040 */\r
+#define CAN_F13R1_FB6                        CAN_F13R1_FB6_Msk                 /*!< Filter bit 6 */\r
+#define CAN_F13R1_FB7_Pos                    (7U)                              \r
+#define CAN_F13R1_FB7_Msk                    (0x1UL << CAN_F13R1_FB7_Pos)       /*!< 0x00000080 */\r
+#define CAN_F13R1_FB7                        CAN_F13R1_FB7_Msk                 /*!< Filter bit 7 */\r
+#define CAN_F13R1_FB8_Pos                    (8U)                              \r
+#define CAN_F13R1_FB8_Msk                    (0x1UL << CAN_F13R1_FB8_Pos)       /*!< 0x00000100 */\r
+#define CAN_F13R1_FB8                        CAN_F13R1_FB8_Msk                 /*!< Filter bit 8 */\r
+#define CAN_F13R1_FB9_Pos                    (9U)                              \r
+#define CAN_F13R1_FB9_Msk                    (0x1UL << CAN_F13R1_FB9_Pos)       /*!< 0x00000200 */\r
+#define CAN_F13R1_FB9                        CAN_F13R1_FB9_Msk                 /*!< Filter bit 9 */\r
+#define CAN_F13R1_FB10_Pos                   (10U)                             \r
+#define CAN_F13R1_FB10_Msk                   (0x1UL << CAN_F13R1_FB10_Pos)      /*!< 0x00000400 */\r
+#define CAN_F13R1_FB10                       CAN_F13R1_FB10_Msk                /*!< Filter bit 10 */\r
+#define CAN_F13R1_FB11_Pos                   (11U)                             \r
+#define CAN_F13R1_FB11_Msk                   (0x1UL << CAN_F13R1_FB11_Pos)      /*!< 0x00000800 */\r
+#define CAN_F13R1_FB11                       CAN_F13R1_FB11_Msk                /*!< Filter bit 11 */\r
+#define CAN_F13R1_FB12_Pos                   (12U)                             \r
+#define CAN_F13R1_FB12_Msk                   (0x1UL << CAN_F13R1_FB12_Pos)      /*!< 0x00001000 */\r
+#define CAN_F13R1_FB12                       CAN_F13R1_FB12_Msk                /*!< Filter bit 12 */\r
+#define CAN_F13R1_FB13_Pos                   (13U)                             \r
+#define CAN_F13R1_FB13_Msk                   (0x1UL << CAN_F13R1_FB13_Pos)      /*!< 0x00002000 */\r
+#define CAN_F13R1_FB13                       CAN_F13R1_FB13_Msk                /*!< Filter bit 13 */\r
+#define CAN_F13R1_FB14_Pos                   (14U)                             \r
+#define CAN_F13R1_FB14_Msk                   (0x1UL << CAN_F13R1_FB14_Pos)      /*!< 0x00004000 */\r
+#define CAN_F13R1_FB14                       CAN_F13R1_FB14_Msk                /*!< Filter bit 14 */\r
+#define CAN_F13R1_FB15_Pos                   (15U)                             \r
+#define CAN_F13R1_FB15_Msk                   (0x1UL << CAN_F13R1_FB15_Pos)      /*!< 0x00008000 */\r
+#define CAN_F13R1_FB15                       CAN_F13R1_FB15_Msk                /*!< Filter bit 15 */\r
+#define CAN_F13R1_FB16_Pos                   (16U)                             \r
+#define CAN_F13R1_FB16_Msk                   (0x1UL << CAN_F13R1_FB16_Pos)      /*!< 0x00010000 */\r
+#define CAN_F13R1_FB16                       CAN_F13R1_FB16_Msk                /*!< Filter bit 16 */\r
+#define CAN_F13R1_FB17_Pos                   (17U)                             \r
+#define CAN_F13R1_FB17_Msk                   (0x1UL << CAN_F13R1_FB17_Pos)      /*!< 0x00020000 */\r
+#define CAN_F13R1_FB17                       CAN_F13R1_FB17_Msk                /*!< Filter bit 17 */\r
+#define CAN_F13R1_FB18_Pos                   (18U)                             \r
+#define CAN_F13R1_FB18_Msk                   (0x1UL << CAN_F13R1_FB18_Pos)      /*!< 0x00040000 */\r
+#define CAN_F13R1_FB18                       CAN_F13R1_FB18_Msk                /*!< Filter bit 18 */\r
+#define CAN_F13R1_FB19_Pos                   (19U)                             \r
+#define CAN_F13R1_FB19_Msk                   (0x1UL << CAN_F13R1_FB19_Pos)      /*!< 0x00080000 */\r
+#define CAN_F13R1_FB19                       CAN_F13R1_FB19_Msk                /*!< Filter bit 19 */\r
+#define CAN_F13R1_FB20_Pos                   (20U)                             \r
+#define CAN_F13R1_FB20_Msk                   (0x1UL << CAN_F13R1_FB20_Pos)      /*!< 0x00100000 */\r
+#define CAN_F13R1_FB20                       CAN_F13R1_FB20_Msk                /*!< Filter bit 20 */\r
+#define CAN_F13R1_FB21_Pos                   (21U)                             \r
+#define CAN_F13R1_FB21_Msk                   (0x1UL << CAN_F13R1_FB21_Pos)      /*!< 0x00200000 */\r
+#define CAN_F13R1_FB21                       CAN_F13R1_FB21_Msk                /*!< Filter bit 21 */\r
+#define CAN_F13R1_FB22_Pos                   (22U)                             \r
+#define CAN_F13R1_FB22_Msk                   (0x1UL << CAN_F13R1_FB22_Pos)      /*!< 0x00400000 */\r
+#define CAN_F13R1_FB22                       CAN_F13R1_FB22_Msk                /*!< Filter bit 22 */\r
+#define CAN_F13R1_FB23_Pos                   (23U)                             \r
+#define CAN_F13R1_FB23_Msk                   (0x1UL << CAN_F13R1_FB23_Pos)      /*!< 0x00800000 */\r
+#define CAN_F13R1_FB23                       CAN_F13R1_FB23_Msk                /*!< Filter bit 23 */\r
+#define CAN_F13R1_FB24_Pos                   (24U)                             \r
+#define CAN_F13R1_FB24_Msk                   (0x1UL << CAN_F13R1_FB24_Pos)      /*!< 0x01000000 */\r
+#define CAN_F13R1_FB24                       CAN_F13R1_FB24_Msk                /*!< Filter bit 24 */\r
+#define CAN_F13R1_FB25_Pos                   (25U)                             \r
+#define CAN_F13R1_FB25_Msk                   (0x1UL << CAN_F13R1_FB25_Pos)      /*!< 0x02000000 */\r
+#define CAN_F13R1_FB25                       CAN_F13R1_FB25_Msk                /*!< Filter bit 25 */\r
+#define CAN_F13R1_FB26_Pos                   (26U)                             \r
+#define CAN_F13R1_FB26_Msk                   (0x1UL << CAN_F13R1_FB26_Pos)      /*!< 0x04000000 */\r
+#define CAN_F13R1_FB26                       CAN_F13R1_FB26_Msk                /*!< Filter bit 26 */\r
+#define CAN_F13R1_FB27_Pos                   (27U)                             \r
+#define CAN_F13R1_FB27_Msk                   (0x1UL << CAN_F13R1_FB27_Pos)      /*!< 0x08000000 */\r
+#define CAN_F13R1_FB27                       CAN_F13R1_FB27_Msk                /*!< Filter bit 27 */\r
+#define CAN_F13R1_FB28_Pos                   (28U)                             \r
+#define CAN_F13R1_FB28_Msk                   (0x1UL << CAN_F13R1_FB28_Pos)      /*!< 0x10000000 */\r
+#define CAN_F13R1_FB28                       CAN_F13R1_FB28_Msk                /*!< Filter bit 28 */\r
+#define CAN_F13R1_FB29_Pos                   (29U)                             \r
+#define CAN_F13R1_FB29_Msk                   (0x1UL << CAN_F13R1_FB29_Pos)      /*!< 0x20000000 */\r
+#define CAN_F13R1_FB29                       CAN_F13R1_FB29_Msk                /*!< Filter bit 29 */\r
+#define CAN_F13R1_FB30_Pos                   (30U)                             \r
+#define CAN_F13R1_FB30_Msk                   (0x1UL << CAN_F13R1_FB30_Pos)      /*!< 0x40000000 */\r
+#define CAN_F13R1_FB30                       CAN_F13R1_FB30_Msk                /*!< Filter bit 30 */\r
+#define CAN_F13R1_FB31_Pos                   (31U)                             \r
+#define CAN_F13R1_FB31_Msk                   (0x1UL << CAN_F13R1_FB31_Pos)      /*!< 0x80000000 */\r
+#define CAN_F13R1_FB31                       CAN_F13R1_FB31_Msk                /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F0R2 register  *******************/\r
+#define CAN_F0R2_FB0_Pos                     (0U)                              \r
+#define CAN_F0R2_FB0_Msk                     (0x1UL << CAN_F0R2_FB0_Pos)        /*!< 0x00000001 */\r
+#define CAN_F0R2_FB0                         CAN_F0R2_FB0_Msk                  /*!< Filter bit 0 */\r
+#define CAN_F0R2_FB1_Pos                     (1U)                              \r
+#define CAN_F0R2_FB1_Msk                     (0x1UL << CAN_F0R2_FB1_Pos)        /*!< 0x00000002 */\r
+#define CAN_F0R2_FB1                         CAN_F0R2_FB1_Msk                  /*!< Filter bit 1 */\r
+#define CAN_F0R2_FB2_Pos                     (2U)                              \r
+#define CAN_F0R2_FB2_Msk                     (0x1UL << CAN_F0R2_FB2_Pos)        /*!< 0x00000004 */\r
+#define CAN_F0R2_FB2                         CAN_F0R2_FB2_Msk                  /*!< Filter bit 2 */\r
+#define CAN_F0R2_FB3_Pos                     (3U)                              \r
+#define CAN_F0R2_FB3_Msk                     (0x1UL << CAN_F0R2_FB3_Pos)        /*!< 0x00000008 */\r
+#define CAN_F0R2_FB3                         CAN_F0R2_FB3_Msk                  /*!< Filter bit 3 */\r
+#define CAN_F0R2_FB4_Pos                     (4U)                              \r
+#define CAN_F0R2_FB4_Msk                     (0x1UL << CAN_F0R2_FB4_Pos)        /*!< 0x00000010 */\r
+#define CAN_F0R2_FB4                         CAN_F0R2_FB4_Msk                  /*!< Filter bit 4 */\r
+#define CAN_F0R2_FB5_Pos                     (5U)                              \r
+#define CAN_F0R2_FB5_Msk                     (0x1UL << CAN_F0R2_FB5_Pos)        /*!< 0x00000020 */\r
+#define CAN_F0R2_FB5                         CAN_F0R2_FB5_Msk                  /*!< Filter bit 5 */\r
+#define CAN_F0R2_FB6_Pos                     (6U)                              \r
+#define CAN_F0R2_FB6_Msk                     (0x1UL << CAN_F0R2_FB6_Pos)        /*!< 0x00000040 */\r
+#define CAN_F0R2_FB6                         CAN_F0R2_FB6_Msk                  /*!< Filter bit 6 */\r
+#define CAN_F0R2_FB7_Pos                     (7U)                              \r
+#define CAN_F0R2_FB7_Msk                     (0x1UL << CAN_F0R2_FB7_Pos)        /*!< 0x00000080 */\r
+#define CAN_F0R2_FB7                         CAN_F0R2_FB7_Msk                  /*!< Filter bit 7 */\r
+#define CAN_F0R2_FB8_Pos                     (8U)                              \r
+#define CAN_F0R2_FB8_Msk                     (0x1UL << CAN_F0R2_FB8_Pos)        /*!< 0x00000100 */\r
+#define CAN_F0R2_FB8                         CAN_F0R2_FB8_Msk                  /*!< Filter bit 8 */\r
+#define CAN_F0R2_FB9_Pos                     (9U)                              \r
+#define CAN_F0R2_FB9_Msk                     (0x1UL << CAN_F0R2_FB9_Pos)        /*!< 0x00000200 */\r
+#define CAN_F0R2_FB9                         CAN_F0R2_FB9_Msk                  /*!< Filter bit 9 */\r
+#define CAN_F0R2_FB10_Pos                    (10U)                             \r
+#define CAN_F0R2_FB10_Msk                    (0x1UL << CAN_F0R2_FB10_Pos)       /*!< 0x00000400 */\r
+#define CAN_F0R2_FB10                        CAN_F0R2_FB10_Msk                 /*!< Filter bit 10 */\r
+#define CAN_F0R2_FB11_Pos                    (11U)                             \r
+#define CAN_F0R2_FB11_Msk                    (0x1UL << CAN_F0R2_FB11_Pos)       /*!< 0x00000800 */\r
+#define CAN_F0R2_FB11                        CAN_F0R2_FB11_Msk                 /*!< Filter bit 11 */\r
+#define CAN_F0R2_FB12_Pos                    (12U)                             \r
+#define CAN_F0R2_FB12_Msk                    (0x1UL << CAN_F0R2_FB12_Pos)       /*!< 0x00001000 */\r
+#define CAN_F0R2_FB12                        CAN_F0R2_FB12_Msk                 /*!< Filter bit 12 */\r
+#define CAN_F0R2_FB13_Pos                    (13U)                             \r
+#define CAN_F0R2_FB13_Msk                    (0x1UL << CAN_F0R2_FB13_Pos)       /*!< 0x00002000 */\r
+#define CAN_F0R2_FB13                        CAN_F0R2_FB13_Msk                 /*!< Filter bit 13 */\r
+#define CAN_F0R2_FB14_Pos                    (14U)                             \r
+#define CAN_F0R2_FB14_Msk                    (0x1UL << CAN_F0R2_FB14_Pos)       /*!< 0x00004000 */\r
+#define CAN_F0R2_FB14                        CAN_F0R2_FB14_Msk                 /*!< Filter bit 14 */\r
+#define CAN_F0R2_FB15_Pos                    (15U)                             \r
+#define CAN_F0R2_FB15_Msk                    (0x1UL << CAN_F0R2_FB15_Pos)       /*!< 0x00008000 */\r
+#define CAN_F0R2_FB15                        CAN_F0R2_FB15_Msk                 /*!< Filter bit 15 */\r
+#define CAN_F0R2_FB16_Pos                    (16U)                             \r
+#define CAN_F0R2_FB16_Msk                    (0x1UL << CAN_F0R2_FB16_Pos)       /*!< 0x00010000 */\r
+#define CAN_F0R2_FB16                        CAN_F0R2_FB16_Msk                 /*!< Filter bit 16 */\r
+#define CAN_F0R2_FB17_Pos                    (17U)                             \r
+#define CAN_F0R2_FB17_Msk                    (0x1UL << CAN_F0R2_FB17_Pos)       /*!< 0x00020000 */\r
+#define CAN_F0R2_FB17                        CAN_F0R2_FB17_Msk                 /*!< Filter bit 17 */\r
+#define CAN_F0R2_FB18_Pos                    (18U)                             \r
+#define CAN_F0R2_FB18_Msk                    (0x1UL << CAN_F0R2_FB18_Pos)       /*!< 0x00040000 */\r
+#define CAN_F0R2_FB18                        CAN_F0R2_FB18_Msk                 /*!< Filter bit 18 */\r
+#define CAN_F0R2_FB19_Pos                    (19U)                             \r
+#define CAN_F0R2_FB19_Msk                    (0x1UL << CAN_F0R2_FB19_Pos)       /*!< 0x00080000 */\r
+#define CAN_F0R2_FB19                        CAN_F0R2_FB19_Msk                 /*!< Filter bit 19 */\r
+#define CAN_F0R2_FB20_Pos                    (20U)                             \r
+#define CAN_F0R2_FB20_Msk                    (0x1UL << CAN_F0R2_FB20_Pos)       /*!< 0x00100000 */\r
+#define CAN_F0R2_FB20                        CAN_F0R2_FB20_Msk                 /*!< Filter bit 20 */\r
+#define CAN_F0R2_FB21_Pos                    (21U)                             \r
+#define CAN_F0R2_FB21_Msk                    (0x1UL << CAN_F0R2_FB21_Pos)       /*!< 0x00200000 */\r
+#define CAN_F0R2_FB21                        CAN_F0R2_FB21_Msk                 /*!< Filter bit 21 */\r
+#define CAN_F0R2_FB22_Pos                    (22U)                             \r
+#define CAN_F0R2_FB22_Msk                    (0x1UL << CAN_F0R2_FB22_Pos)       /*!< 0x00400000 */\r
+#define CAN_F0R2_FB22                        CAN_F0R2_FB22_Msk                 /*!< Filter bit 22 */\r
+#define CAN_F0R2_FB23_Pos                    (23U)                             \r
+#define CAN_F0R2_FB23_Msk                    (0x1UL << CAN_F0R2_FB23_Pos)       /*!< 0x00800000 */\r
+#define CAN_F0R2_FB23                        CAN_F0R2_FB23_Msk                 /*!< Filter bit 23 */\r
+#define CAN_F0R2_FB24_Pos                    (24U)                             \r
+#define CAN_F0R2_FB24_Msk                    (0x1UL << CAN_F0R2_FB24_Pos)       /*!< 0x01000000 */\r
+#define CAN_F0R2_FB24                        CAN_F0R2_FB24_Msk                 /*!< Filter bit 24 */\r
+#define CAN_F0R2_FB25_Pos                    (25U)                             \r
+#define CAN_F0R2_FB25_Msk                    (0x1UL << CAN_F0R2_FB25_Pos)       /*!< 0x02000000 */\r
+#define CAN_F0R2_FB25                        CAN_F0R2_FB25_Msk                 /*!< Filter bit 25 */\r
+#define CAN_F0R2_FB26_Pos                    (26U)                             \r
+#define CAN_F0R2_FB26_Msk                    (0x1UL << CAN_F0R2_FB26_Pos)       /*!< 0x04000000 */\r
+#define CAN_F0R2_FB26                        CAN_F0R2_FB26_Msk                 /*!< Filter bit 26 */\r
+#define CAN_F0R2_FB27_Pos                    (27U)                             \r
+#define CAN_F0R2_FB27_Msk                    (0x1UL << CAN_F0R2_FB27_Pos)       /*!< 0x08000000 */\r
+#define CAN_F0R2_FB27                        CAN_F0R2_FB27_Msk                 /*!< Filter bit 27 */\r
+#define CAN_F0R2_FB28_Pos                    (28U)                             \r
+#define CAN_F0R2_FB28_Msk                    (0x1UL << CAN_F0R2_FB28_Pos)       /*!< 0x10000000 */\r
+#define CAN_F0R2_FB28                        CAN_F0R2_FB28_Msk                 /*!< Filter bit 28 */\r
+#define CAN_F0R2_FB29_Pos                    (29U)                             \r
+#define CAN_F0R2_FB29_Msk                    (0x1UL << CAN_F0R2_FB29_Pos)       /*!< 0x20000000 */\r
+#define CAN_F0R2_FB29                        CAN_F0R2_FB29_Msk                 /*!< Filter bit 29 */\r
+#define CAN_F0R2_FB30_Pos                    (30U)                             \r
+#define CAN_F0R2_FB30_Msk                    (0x1UL << CAN_F0R2_FB30_Pos)       /*!< 0x40000000 */\r
+#define CAN_F0R2_FB30                        CAN_F0R2_FB30_Msk                 /*!< Filter bit 30 */\r
+#define CAN_F0R2_FB31_Pos                    (31U)                             \r
+#define CAN_F0R2_FB31_Msk                    (0x1UL << CAN_F0R2_FB31_Pos)       /*!< 0x80000000 */\r
+#define CAN_F0R2_FB31                        CAN_F0R2_FB31_Msk                 /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F1R2 register  *******************/\r
+#define CAN_F1R2_FB0_Pos                     (0U)                              \r
+#define CAN_F1R2_FB0_Msk                     (0x1UL << CAN_F1R2_FB0_Pos)        /*!< 0x00000001 */\r
+#define CAN_F1R2_FB0                         CAN_F1R2_FB0_Msk                  /*!< Filter bit 0 */\r
+#define CAN_F1R2_FB1_Pos                     (1U)                              \r
+#define CAN_F1R2_FB1_Msk                     (0x1UL << CAN_F1R2_FB1_Pos)        /*!< 0x00000002 */\r
+#define CAN_F1R2_FB1                         CAN_F1R2_FB1_Msk                  /*!< Filter bit 1 */\r
+#define CAN_F1R2_FB2_Pos                     (2U)                              \r
+#define CAN_F1R2_FB2_Msk                     (0x1UL << CAN_F1R2_FB2_Pos)        /*!< 0x00000004 */\r
+#define CAN_F1R2_FB2                         CAN_F1R2_FB2_Msk                  /*!< Filter bit 2 */\r
+#define CAN_F1R2_FB3_Pos                     (3U)                              \r
+#define CAN_F1R2_FB3_Msk                     (0x1UL << CAN_F1R2_FB3_Pos)        /*!< 0x00000008 */\r
+#define CAN_F1R2_FB3                         CAN_F1R2_FB3_Msk                  /*!< Filter bit 3 */\r
+#define CAN_F1R2_FB4_Pos                     (4U)                              \r
+#define CAN_F1R2_FB4_Msk                     (0x1UL << CAN_F1R2_FB4_Pos)        /*!< 0x00000010 */\r
+#define CAN_F1R2_FB4                         CAN_F1R2_FB4_Msk                  /*!< Filter bit 4 */\r
+#define CAN_F1R2_FB5_Pos                     (5U)                              \r
+#define CAN_F1R2_FB5_Msk                     (0x1UL << CAN_F1R2_FB5_Pos)        /*!< 0x00000020 */\r
+#define CAN_F1R2_FB5                         CAN_F1R2_FB5_Msk                  /*!< Filter bit 5 */\r
+#define CAN_F1R2_FB6_Pos                     (6U)                              \r
+#define CAN_F1R2_FB6_Msk                     (0x1UL << CAN_F1R2_FB6_Pos)        /*!< 0x00000040 */\r
+#define CAN_F1R2_FB6                         CAN_F1R2_FB6_Msk                  /*!< Filter bit 6 */\r
+#define CAN_F1R2_FB7_Pos                     (7U)                              \r
+#define CAN_F1R2_FB7_Msk                     (0x1UL << CAN_F1R2_FB7_Pos)        /*!< 0x00000080 */\r
+#define CAN_F1R2_FB7                         CAN_F1R2_FB7_Msk                  /*!< Filter bit 7 */\r
+#define CAN_F1R2_FB8_Pos                     (8U)                              \r
+#define CAN_F1R2_FB8_Msk                     (0x1UL << CAN_F1R2_FB8_Pos)        /*!< 0x00000100 */\r
+#define CAN_F1R2_FB8                         CAN_F1R2_FB8_Msk                  /*!< Filter bit 8 */\r
+#define CAN_F1R2_FB9_Pos                     (9U)                              \r
+#define CAN_F1R2_FB9_Msk                     (0x1UL << CAN_F1R2_FB9_Pos)        /*!< 0x00000200 */\r
+#define CAN_F1R2_FB9                         CAN_F1R2_FB9_Msk                  /*!< Filter bit 9 */\r
+#define CAN_F1R2_FB10_Pos                    (10U)                             \r
+#define CAN_F1R2_FB10_Msk                    (0x1UL << CAN_F1R2_FB10_Pos)       /*!< 0x00000400 */\r
+#define CAN_F1R2_FB10                        CAN_F1R2_FB10_Msk                 /*!< Filter bit 10 */\r
+#define CAN_F1R2_FB11_Pos                    (11U)                             \r
+#define CAN_F1R2_FB11_Msk                    (0x1UL << CAN_F1R2_FB11_Pos)       /*!< 0x00000800 */\r
+#define CAN_F1R2_FB11                        CAN_F1R2_FB11_Msk                 /*!< Filter bit 11 */\r
+#define CAN_F1R2_FB12_Pos                    (12U)                             \r
+#define CAN_F1R2_FB12_Msk                    (0x1UL << CAN_F1R2_FB12_Pos)       /*!< 0x00001000 */\r
+#define CAN_F1R2_FB12                        CAN_F1R2_FB12_Msk                 /*!< Filter bit 12 */\r
+#define CAN_F1R2_FB13_Pos                    (13U)                             \r
+#define CAN_F1R2_FB13_Msk                    (0x1UL << CAN_F1R2_FB13_Pos)       /*!< 0x00002000 */\r
+#define CAN_F1R2_FB13                        CAN_F1R2_FB13_Msk                 /*!< Filter bit 13 */\r
+#define CAN_F1R2_FB14_Pos                    (14U)                             \r
+#define CAN_F1R2_FB14_Msk                    (0x1UL << CAN_F1R2_FB14_Pos)       /*!< 0x00004000 */\r
+#define CAN_F1R2_FB14                        CAN_F1R2_FB14_Msk                 /*!< Filter bit 14 */\r
+#define CAN_F1R2_FB15_Pos                    (15U)                             \r
+#define CAN_F1R2_FB15_Msk                    (0x1UL << CAN_F1R2_FB15_Pos)       /*!< 0x00008000 */\r
+#define CAN_F1R2_FB15                        CAN_F1R2_FB15_Msk                 /*!< Filter bit 15 */\r
+#define CAN_F1R2_FB16_Pos                    (16U)                             \r
+#define CAN_F1R2_FB16_Msk                    (0x1UL << CAN_F1R2_FB16_Pos)       /*!< 0x00010000 */\r
+#define CAN_F1R2_FB16                        CAN_F1R2_FB16_Msk                 /*!< Filter bit 16 */\r
+#define CAN_F1R2_FB17_Pos                    (17U)                             \r
+#define CAN_F1R2_FB17_Msk                    (0x1UL << CAN_F1R2_FB17_Pos)       /*!< 0x00020000 */\r
+#define CAN_F1R2_FB17                        CAN_F1R2_FB17_Msk                 /*!< Filter bit 17 */\r
+#define CAN_F1R2_FB18_Pos                    (18U)                             \r
+#define CAN_F1R2_FB18_Msk                    (0x1UL << CAN_F1R2_FB18_Pos)       /*!< 0x00040000 */\r
+#define CAN_F1R2_FB18                        CAN_F1R2_FB18_Msk                 /*!< Filter bit 18 */\r
+#define CAN_F1R2_FB19_Pos                    (19U)                             \r
+#define CAN_F1R2_FB19_Msk                    (0x1UL << CAN_F1R2_FB19_Pos)       /*!< 0x00080000 */\r
+#define CAN_F1R2_FB19                        CAN_F1R2_FB19_Msk                 /*!< Filter bit 19 */\r
+#define CAN_F1R2_FB20_Pos                    (20U)                             \r
+#define CAN_F1R2_FB20_Msk                    (0x1UL << CAN_F1R2_FB20_Pos)       /*!< 0x00100000 */\r
+#define CAN_F1R2_FB20                        CAN_F1R2_FB20_Msk                 /*!< Filter bit 20 */\r
+#define CAN_F1R2_FB21_Pos                    (21U)                             \r
+#define CAN_F1R2_FB21_Msk                    (0x1UL << CAN_F1R2_FB21_Pos)       /*!< 0x00200000 */\r
+#define CAN_F1R2_FB21                        CAN_F1R2_FB21_Msk                 /*!< Filter bit 21 */\r
+#define CAN_F1R2_FB22_Pos                    (22U)                             \r
+#define CAN_F1R2_FB22_Msk                    (0x1UL << CAN_F1R2_FB22_Pos)       /*!< 0x00400000 */\r
+#define CAN_F1R2_FB22                        CAN_F1R2_FB22_Msk                 /*!< Filter bit 22 */\r
+#define CAN_F1R2_FB23_Pos                    (23U)                             \r
+#define CAN_F1R2_FB23_Msk                    (0x1UL << CAN_F1R2_FB23_Pos)       /*!< 0x00800000 */\r
+#define CAN_F1R2_FB23                        CAN_F1R2_FB23_Msk                 /*!< Filter bit 23 */\r
+#define CAN_F1R2_FB24_Pos                    (24U)                             \r
+#define CAN_F1R2_FB24_Msk                    (0x1UL << CAN_F1R2_FB24_Pos)       /*!< 0x01000000 */\r
+#define CAN_F1R2_FB24                        CAN_F1R2_FB24_Msk                 /*!< Filter bit 24 */\r
+#define CAN_F1R2_FB25_Pos                    (25U)                             \r
+#define CAN_F1R2_FB25_Msk                    (0x1UL << CAN_F1R2_FB25_Pos)       /*!< 0x02000000 */\r
+#define CAN_F1R2_FB25                        CAN_F1R2_FB25_Msk                 /*!< Filter bit 25 */\r
+#define CAN_F1R2_FB26_Pos                    (26U)                             \r
+#define CAN_F1R2_FB26_Msk                    (0x1UL << CAN_F1R2_FB26_Pos)       /*!< 0x04000000 */\r
+#define CAN_F1R2_FB26                        CAN_F1R2_FB26_Msk                 /*!< Filter bit 26 */\r
+#define CAN_F1R2_FB27_Pos                    (27U)                             \r
+#define CAN_F1R2_FB27_Msk                    (0x1UL << CAN_F1R2_FB27_Pos)       /*!< 0x08000000 */\r
+#define CAN_F1R2_FB27                        CAN_F1R2_FB27_Msk                 /*!< Filter bit 27 */\r
+#define CAN_F1R2_FB28_Pos                    (28U)                             \r
+#define CAN_F1R2_FB28_Msk                    (0x1UL << CAN_F1R2_FB28_Pos)       /*!< 0x10000000 */\r
+#define CAN_F1R2_FB28                        CAN_F1R2_FB28_Msk                 /*!< Filter bit 28 */\r
+#define CAN_F1R2_FB29_Pos                    (29U)                             \r
+#define CAN_F1R2_FB29_Msk                    (0x1UL << CAN_F1R2_FB29_Pos)       /*!< 0x20000000 */\r
+#define CAN_F1R2_FB29                        CAN_F1R2_FB29_Msk                 /*!< Filter bit 29 */\r
+#define CAN_F1R2_FB30_Pos                    (30U)                             \r
+#define CAN_F1R2_FB30_Msk                    (0x1UL << CAN_F1R2_FB30_Pos)       /*!< 0x40000000 */\r
+#define CAN_F1R2_FB30                        CAN_F1R2_FB30_Msk                 /*!< Filter bit 30 */\r
+#define CAN_F1R2_FB31_Pos                    (31U)                             \r
+#define CAN_F1R2_FB31_Msk                    (0x1UL << CAN_F1R2_FB31_Pos)       /*!< 0x80000000 */\r
+#define CAN_F1R2_FB31                        CAN_F1R2_FB31_Msk                 /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F2R2 register  *******************/\r
+#define CAN_F2R2_FB0_Pos                     (0U)                              \r
+#define CAN_F2R2_FB0_Msk                     (0x1UL << CAN_F2R2_FB0_Pos)        /*!< 0x00000001 */\r
+#define CAN_F2R2_FB0                         CAN_F2R2_FB0_Msk                  /*!< Filter bit 0 */\r
+#define CAN_F2R2_FB1_Pos                     (1U)                              \r
+#define CAN_F2R2_FB1_Msk                     (0x1UL << CAN_F2R2_FB1_Pos)        /*!< 0x00000002 */\r
+#define CAN_F2R2_FB1                         CAN_F2R2_FB1_Msk                  /*!< Filter bit 1 */\r
+#define CAN_F2R2_FB2_Pos                     (2U)                              \r
+#define CAN_F2R2_FB2_Msk                     (0x1UL << CAN_F2R2_FB2_Pos)        /*!< 0x00000004 */\r
+#define CAN_F2R2_FB2                         CAN_F2R2_FB2_Msk                  /*!< Filter bit 2 */\r
+#define CAN_F2R2_FB3_Pos                     (3U)                              \r
+#define CAN_F2R2_FB3_Msk                     (0x1UL << CAN_F2R2_FB3_Pos)        /*!< 0x00000008 */\r
+#define CAN_F2R2_FB3                         CAN_F2R2_FB3_Msk                  /*!< Filter bit 3 */\r
+#define CAN_F2R2_FB4_Pos                     (4U)                              \r
+#define CAN_F2R2_FB4_Msk                     (0x1UL << CAN_F2R2_FB4_Pos)        /*!< 0x00000010 */\r
+#define CAN_F2R2_FB4                         CAN_F2R2_FB4_Msk                  /*!< Filter bit 4 */\r
+#define CAN_F2R2_FB5_Pos                     (5U)                              \r
+#define CAN_F2R2_FB5_Msk                     (0x1UL << CAN_F2R2_FB5_Pos)        /*!< 0x00000020 */\r
+#define CAN_F2R2_FB5                         CAN_F2R2_FB5_Msk                  /*!< Filter bit 5 */\r
+#define CAN_F2R2_FB6_Pos                     (6U)                              \r
+#define CAN_F2R2_FB6_Msk                     (0x1UL << CAN_F2R2_FB6_Pos)        /*!< 0x00000040 */\r
+#define CAN_F2R2_FB6                         CAN_F2R2_FB6_Msk                  /*!< Filter bit 6 */\r
+#define CAN_F2R2_FB7_Pos                     (7U)                              \r
+#define CAN_F2R2_FB7_Msk                     (0x1UL << CAN_F2R2_FB7_Pos)        /*!< 0x00000080 */\r
+#define CAN_F2R2_FB7                         CAN_F2R2_FB7_Msk                  /*!< Filter bit 7 */\r
+#define CAN_F2R2_FB8_Pos                     (8U)                              \r
+#define CAN_F2R2_FB8_Msk                     (0x1UL << CAN_F2R2_FB8_Pos)        /*!< 0x00000100 */\r
+#define CAN_F2R2_FB8                         CAN_F2R2_FB8_Msk                  /*!< Filter bit 8 */\r
+#define CAN_F2R2_FB9_Pos                     (9U)                              \r
+#define CAN_F2R2_FB9_Msk                     (0x1UL << CAN_F2R2_FB9_Pos)        /*!< 0x00000200 */\r
+#define CAN_F2R2_FB9                         CAN_F2R2_FB9_Msk                  /*!< Filter bit 9 */\r
+#define CAN_F2R2_FB10_Pos                    (10U)                             \r
+#define CAN_F2R2_FB10_Msk                    (0x1UL << CAN_F2R2_FB10_Pos)       /*!< 0x00000400 */\r
+#define CAN_F2R2_FB10                        CAN_F2R2_FB10_Msk                 /*!< Filter bit 10 */\r
+#define CAN_F2R2_FB11_Pos                    (11U)                             \r
+#define CAN_F2R2_FB11_Msk                    (0x1UL << CAN_F2R2_FB11_Pos)       /*!< 0x00000800 */\r
+#define CAN_F2R2_FB11                        CAN_F2R2_FB11_Msk                 /*!< Filter bit 11 */\r
+#define CAN_F2R2_FB12_Pos                    (12U)                             \r
+#define CAN_F2R2_FB12_Msk                    (0x1UL << CAN_F2R2_FB12_Pos)       /*!< 0x00001000 */\r
+#define CAN_F2R2_FB12                        CAN_F2R2_FB12_Msk                 /*!< Filter bit 12 */\r
+#define CAN_F2R2_FB13_Pos                    (13U)                             \r
+#define CAN_F2R2_FB13_Msk                    (0x1UL << CAN_F2R2_FB13_Pos)       /*!< 0x00002000 */\r
+#define CAN_F2R2_FB13                        CAN_F2R2_FB13_Msk                 /*!< Filter bit 13 */\r
+#define CAN_F2R2_FB14_Pos                    (14U)                             \r
+#define CAN_F2R2_FB14_Msk                    (0x1UL << CAN_F2R2_FB14_Pos)       /*!< 0x00004000 */\r
+#define CAN_F2R2_FB14                        CAN_F2R2_FB14_Msk                 /*!< Filter bit 14 */\r
+#define CAN_F2R2_FB15_Pos                    (15U)                             \r
+#define CAN_F2R2_FB15_Msk                    (0x1UL << CAN_F2R2_FB15_Pos)       /*!< 0x00008000 */\r
+#define CAN_F2R2_FB15                        CAN_F2R2_FB15_Msk                 /*!< Filter bit 15 */\r
+#define CAN_F2R2_FB16_Pos                    (16U)                             \r
+#define CAN_F2R2_FB16_Msk                    (0x1UL << CAN_F2R2_FB16_Pos)       /*!< 0x00010000 */\r
+#define CAN_F2R2_FB16                        CAN_F2R2_FB16_Msk                 /*!< Filter bit 16 */\r
+#define CAN_F2R2_FB17_Pos                    (17U)                             \r
+#define CAN_F2R2_FB17_Msk                    (0x1UL << CAN_F2R2_FB17_Pos)       /*!< 0x00020000 */\r
+#define CAN_F2R2_FB17                        CAN_F2R2_FB17_Msk                 /*!< Filter bit 17 */\r
+#define CAN_F2R2_FB18_Pos                    (18U)                             \r
+#define CAN_F2R2_FB18_Msk                    (0x1UL << CAN_F2R2_FB18_Pos)       /*!< 0x00040000 */\r
+#define CAN_F2R2_FB18                        CAN_F2R2_FB18_Msk                 /*!< Filter bit 18 */\r
+#define CAN_F2R2_FB19_Pos                    (19U)                             \r
+#define CAN_F2R2_FB19_Msk                    (0x1UL << CAN_F2R2_FB19_Pos)       /*!< 0x00080000 */\r
+#define CAN_F2R2_FB19                        CAN_F2R2_FB19_Msk                 /*!< Filter bit 19 */\r
+#define CAN_F2R2_FB20_Pos                    (20U)                             \r
+#define CAN_F2R2_FB20_Msk                    (0x1UL << CAN_F2R2_FB20_Pos)       /*!< 0x00100000 */\r
+#define CAN_F2R2_FB20                        CAN_F2R2_FB20_Msk                 /*!< Filter bit 20 */\r
+#define CAN_F2R2_FB21_Pos                    (21U)                             \r
+#define CAN_F2R2_FB21_Msk                    (0x1UL << CAN_F2R2_FB21_Pos)       /*!< 0x00200000 */\r
+#define CAN_F2R2_FB21                        CAN_F2R2_FB21_Msk                 /*!< Filter bit 21 */\r
+#define CAN_F2R2_FB22_Pos                    (22U)                             \r
+#define CAN_F2R2_FB22_Msk                    (0x1UL << CAN_F2R2_FB22_Pos)       /*!< 0x00400000 */\r
+#define CAN_F2R2_FB22                        CAN_F2R2_FB22_Msk                 /*!< Filter bit 22 */\r
+#define CAN_F2R2_FB23_Pos                    (23U)                             \r
+#define CAN_F2R2_FB23_Msk                    (0x1UL << CAN_F2R2_FB23_Pos)       /*!< 0x00800000 */\r
+#define CAN_F2R2_FB23                        CAN_F2R2_FB23_Msk                 /*!< Filter bit 23 */\r
+#define CAN_F2R2_FB24_Pos                    (24U)                             \r
+#define CAN_F2R2_FB24_Msk                    (0x1UL << CAN_F2R2_FB24_Pos)       /*!< 0x01000000 */\r
+#define CAN_F2R2_FB24                        CAN_F2R2_FB24_Msk                 /*!< Filter bit 24 */\r
+#define CAN_F2R2_FB25_Pos                    (25U)                             \r
+#define CAN_F2R2_FB25_Msk                    (0x1UL << CAN_F2R2_FB25_Pos)       /*!< 0x02000000 */\r
+#define CAN_F2R2_FB25                        CAN_F2R2_FB25_Msk                 /*!< Filter bit 25 */\r
+#define CAN_F2R2_FB26_Pos                    (26U)                             \r
+#define CAN_F2R2_FB26_Msk                    (0x1UL << CAN_F2R2_FB26_Pos)       /*!< 0x04000000 */\r
+#define CAN_F2R2_FB26                        CAN_F2R2_FB26_Msk                 /*!< Filter bit 26 */\r
+#define CAN_F2R2_FB27_Pos                    (27U)                             \r
+#define CAN_F2R2_FB27_Msk                    (0x1UL << CAN_F2R2_FB27_Pos)       /*!< 0x08000000 */\r
+#define CAN_F2R2_FB27                        CAN_F2R2_FB27_Msk                 /*!< Filter bit 27 */\r
+#define CAN_F2R2_FB28_Pos                    (28U)                             \r
+#define CAN_F2R2_FB28_Msk                    (0x1UL << CAN_F2R2_FB28_Pos)       /*!< 0x10000000 */\r
+#define CAN_F2R2_FB28                        CAN_F2R2_FB28_Msk                 /*!< Filter bit 28 */\r
+#define CAN_F2R2_FB29_Pos                    (29U)                             \r
+#define CAN_F2R2_FB29_Msk                    (0x1UL << CAN_F2R2_FB29_Pos)       /*!< 0x20000000 */\r
+#define CAN_F2R2_FB29                        CAN_F2R2_FB29_Msk                 /*!< Filter bit 29 */\r
+#define CAN_F2R2_FB30_Pos                    (30U)                             \r
+#define CAN_F2R2_FB30_Msk                    (0x1UL << CAN_F2R2_FB30_Pos)       /*!< 0x40000000 */\r
+#define CAN_F2R2_FB30                        CAN_F2R2_FB30_Msk                 /*!< Filter bit 30 */\r
+#define CAN_F2R2_FB31_Pos                    (31U)                             \r
+#define CAN_F2R2_FB31_Msk                    (0x1UL << CAN_F2R2_FB31_Pos)       /*!< 0x80000000 */\r
+#define CAN_F2R2_FB31                        CAN_F2R2_FB31_Msk                 /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F3R2 register  *******************/\r
+#define CAN_F3R2_FB0_Pos                     (0U)                              \r
+#define CAN_F3R2_FB0_Msk                     (0x1UL << CAN_F3R2_FB0_Pos)        /*!< 0x00000001 */\r
+#define CAN_F3R2_FB0                         CAN_F3R2_FB0_Msk                  /*!< Filter bit 0 */\r
+#define CAN_F3R2_FB1_Pos                     (1U)                              \r
+#define CAN_F3R2_FB1_Msk                     (0x1UL << CAN_F3R2_FB1_Pos)        /*!< 0x00000002 */\r
+#define CAN_F3R2_FB1                         CAN_F3R2_FB1_Msk                  /*!< Filter bit 1 */\r
+#define CAN_F3R2_FB2_Pos                     (2U)                              \r
+#define CAN_F3R2_FB2_Msk                     (0x1UL << CAN_F3R2_FB2_Pos)        /*!< 0x00000004 */\r
+#define CAN_F3R2_FB2                         CAN_F3R2_FB2_Msk                  /*!< Filter bit 2 */\r
+#define CAN_F3R2_FB3_Pos                     (3U)                              \r
+#define CAN_F3R2_FB3_Msk                     (0x1UL << CAN_F3R2_FB3_Pos)        /*!< 0x00000008 */\r
+#define CAN_F3R2_FB3                         CAN_F3R2_FB3_Msk                  /*!< Filter bit 3 */\r
+#define CAN_F3R2_FB4_Pos                     (4U)                              \r
+#define CAN_F3R2_FB4_Msk                     (0x1UL << CAN_F3R2_FB4_Pos)        /*!< 0x00000010 */\r
+#define CAN_F3R2_FB4                         CAN_F3R2_FB4_Msk                  /*!< Filter bit 4 */\r
+#define CAN_F3R2_FB5_Pos                     (5U)                              \r
+#define CAN_F3R2_FB5_Msk                     (0x1UL << CAN_F3R2_FB5_Pos)        /*!< 0x00000020 */\r
+#define CAN_F3R2_FB5                         CAN_F3R2_FB5_Msk                  /*!< Filter bit 5 */\r
+#define CAN_F3R2_FB6_Pos                     (6U)                              \r
+#define CAN_F3R2_FB6_Msk                     (0x1UL << CAN_F3R2_FB6_Pos)        /*!< 0x00000040 */\r
+#define CAN_F3R2_FB6                         CAN_F3R2_FB6_Msk                  /*!< Filter bit 6 */\r
+#define CAN_F3R2_FB7_Pos                     (7U)                              \r
+#define CAN_F3R2_FB7_Msk                     (0x1UL << CAN_F3R2_FB7_Pos)        /*!< 0x00000080 */\r
+#define CAN_F3R2_FB7                         CAN_F3R2_FB7_Msk                  /*!< Filter bit 7 */\r
+#define CAN_F3R2_FB8_Pos                     (8U)                              \r
+#define CAN_F3R2_FB8_Msk                     (0x1UL << CAN_F3R2_FB8_Pos)        /*!< 0x00000100 */\r
+#define CAN_F3R2_FB8                         CAN_F3R2_FB8_Msk                  /*!< Filter bit 8 */\r
+#define CAN_F3R2_FB9_Pos                     (9U)                              \r
+#define CAN_F3R2_FB9_Msk                     (0x1UL << CAN_F3R2_FB9_Pos)        /*!< 0x00000200 */\r
+#define CAN_F3R2_FB9                         CAN_F3R2_FB9_Msk                  /*!< Filter bit 9 */\r
+#define CAN_F3R2_FB10_Pos                    (10U)                             \r
+#define CAN_F3R2_FB10_Msk                    (0x1UL << CAN_F3R2_FB10_Pos)       /*!< 0x00000400 */\r
+#define CAN_F3R2_FB10                        CAN_F3R2_FB10_Msk                 /*!< Filter bit 10 */\r
+#define CAN_F3R2_FB11_Pos                    (11U)                             \r
+#define CAN_F3R2_FB11_Msk                    (0x1UL << CAN_F3R2_FB11_Pos)       /*!< 0x00000800 */\r
+#define CAN_F3R2_FB11                        CAN_F3R2_FB11_Msk                 /*!< Filter bit 11 */\r
+#define CAN_F3R2_FB12_Pos                    (12U)                             \r
+#define CAN_F3R2_FB12_Msk                    (0x1UL << CAN_F3R2_FB12_Pos)       /*!< 0x00001000 */\r
+#define CAN_F3R2_FB12                        CAN_F3R2_FB12_Msk                 /*!< Filter bit 12 */\r
+#define CAN_F3R2_FB13_Pos                    (13U)                             \r
+#define CAN_F3R2_FB13_Msk                    (0x1UL << CAN_F3R2_FB13_Pos)       /*!< 0x00002000 */\r
+#define CAN_F3R2_FB13                        CAN_F3R2_FB13_Msk                 /*!< Filter bit 13 */\r
+#define CAN_F3R2_FB14_Pos                    (14U)                             \r
+#define CAN_F3R2_FB14_Msk                    (0x1UL << CAN_F3R2_FB14_Pos)       /*!< 0x00004000 */\r
+#define CAN_F3R2_FB14                        CAN_F3R2_FB14_Msk                 /*!< Filter bit 14 */\r
+#define CAN_F3R2_FB15_Pos                    (15U)                             \r
+#define CAN_F3R2_FB15_Msk                    (0x1UL << CAN_F3R2_FB15_Pos)       /*!< 0x00008000 */\r
+#define CAN_F3R2_FB15                        CAN_F3R2_FB15_Msk                 /*!< Filter bit 15 */\r
+#define CAN_F3R2_FB16_Pos                    (16U)                             \r
+#define CAN_F3R2_FB16_Msk                    (0x1UL << CAN_F3R2_FB16_Pos)       /*!< 0x00010000 */\r
+#define CAN_F3R2_FB16                        CAN_F3R2_FB16_Msk                 /*!< Filter bit 16 */\r
+#define CAN_F3R2_FB17_Pos                    (17U)                             \r
+#define CAN_F3R2_FB17_Msk                    (0x1UL << CAN_F3R2_FB17_Pos)       /*!< 0x00020000 */\r
+#define CAN_F3R2_FB17                        CAN_F3R2_FB17_Msk                 /*!< Filter bit 17 */\r
+#define CAN_F3R2_FB18_Pos                    (18U)                             \r
+#define CAN_F3R2_FB18_Msk                    (0x1UL << CAN_F3R2_FB18_Pos)       /*!< 0x00040000 */\r
+#define CAN_F3R2_FB18                        CAN_F3R2_FB18_Msk                 /*!< Filter bit 18 */\r
+#define CAN_F3R2_FB19_Pos                    (19U)                             \r
+#define CAN_F3R2_FB19_Msk                    (0x1UL << CAN_F3R2_FB19_Pos)       /*!< 0x00080000 */\r
+#define CAN_F3R2_FB19                        CAN_F3R2_FB19_Msk                 /*!< Filter bit 19 */\r
+#define CAN_F3R2_FB20_Pos                    (20U)                             \r
+#define CAN_F3R2_FB20_Msk                    (0x1UL << CAN_F3R2_FB20_Pos)       /*!< 0x00100000 */\r
+#define CAN_F3R2_FB20                        CAN_F3R2_FB20_Msk                 /*!< Filter bit 20 */\r
+#define CAN_F3R2_FB21_Pos                    (21U)                             \r
+#define CAN_F3R2_FB21_Msk                    (0x1UL << CAN_F3R2_FB21_Pos)       /*!< 0x00200000 */\r
+#define CAN_F3R2_FB21                        CAN_F3R2_FB21_Msk                 /*!< Filter bit 21 */\r
+#define CAN_F3R2_FB22_Pos                    (22U)                             \r
+#define CAN_F3R2_FB22_Msk                    (0x1UL << CAN_F3R2_FB22_Pos)       /*!< 0x00400000 */\r
+#define CAN_F3R2_FB22                        CAN_F3R2_FB22_Msk                 /*!< Filter bit 22 */\r
+#define CAN_F3R2_FB23_Pos                    (23U)                             \r
+#define CAN_F3R2_FB23_Msk                    (0x1UL << CAN_F3R2_FB23_Pos)       /*!< 0x00800000 */\r
+#define CAN_F3R2_FB23                        CAN_F3R2_FB23_Msk                 /*!< Filter bit 23 */\r
+#define CAN_F3R2_FB24_Pos                    (24U)                             \r
+#define CAN_F3R2_FB24_Msk                    (0x1UL << CAN_F3R2_FB24_Pos)       /*!< 0x01000000 */\r
+#define CAN_F3R2_FB24                        CAN_F3R2_FB24_Msk                 /*!< Filter bit 24 */\r
+#define CAN_F3R2_FB25_Pos                    (25U)                             \r
+#define CAN_F3R2_FB25_Msk                    (0x1UL << CAN_F3R2_FB25_Pos)       /*!< 0x02000000 */\r
+#define CAN_F3R2_FB25                        CAN_F3R2_FB25_Msk                 /*!< Filter bit 25 */\r
+#define CAN_F3R2_FB26_Pos                    (26U)                             \r
+#define CAN_F3R2_FB26_Msk                    (0x1UL << CAN_F3R2_FB26_Pos)       /*!< 0x04000000 */\r
+#define CAN_F3R2_FB26                        CAN_F3R2_FB26_Msk                 /*!< Filter bit 26 */\r
+#define CAN_F3R2_FB27_Pos                    (27U)                             \r
+#define CAN_F3R2_FB27_Msk                    (0x1UL << CAN_F3R2_FB27_Pos)       /*!< 0x08000000 */\r
+#define CAN_F3R2_FB27                        CAN_F3R2_FB27_Msk                 /*!< Filter bit 27 */\r
+#define CAN_F3R2_FB28_Pos                    (28U)                             \r
+#define CAN_F3R2_FB28_Msk                    (0x1UL << CAN_F3R2_FB28_Pos)       /*!< 0x10000000 */\r
+#define CAN_F3R2_FB28                        CAN_F3R2_FB28_Msk                 /*!< Filter bit 28 */\r
+#define CAN_F3R2_FB29_Pos                    (29U)                             \r
+#define CAN_F3R2_FB29_Msk                    (0x1UL << CAN_F3R2_FB29_Pos)       /*!< 0x20000000 */\r
+#define CAN_F3R2_FB29                        CAN_F3R2_FB29_Msk                 /*!< Filter bit 29 */\r
+#define CAN_F3R2_FB30_Pos                    (30U)                             \r
+#define CAN_F3R2_FB30_Msk                    (0x1UL << CAN_F3R2_FB30_Pos)       /*!< 0x40000000 */\r
+#define CAN_F3R2_FB30                        CAN_F3R2_FB30_Msk                 /*!< Filter bit 30 */\r
+#define CAN_F3R2_FB31_Pos                    (31U)                             \r
+#define CAN_F3R2_FB31_Msk                    (0x1UL << CAN_F3R2_FB31_Pos)       /*!< 0x80000000 */\r
+#define CAN_F3R2_FB31                        CAN_F3R2_FB31_Msk                 /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F4R2 register  *******************/\r
+#define CAN_F4R2_FB0_Pos                     (0U)                              \r
+#define CAN_F4R2_FB0_Msk                     (0x1UL << CAN_F4R2_FB0_Pos)        /*!< 0x00000001 */\r
+#define CAN_F4R2_FB0                         CAN_F4R2_FB0_Msk                  /*!< Filter bit 0 */\r
+#define CAN_F4R2_FB1_Pos                     (1U)                              \r
+#define CAN_F4R2_FB1_Msk                     (0x1UL << CAN_F4R2_FB1_Pos)        /*!< 0x00000002 */\r
+#define CAN_F4R2_FB1                         CAN_F4R2_FB1_Msk                  /*!< Filter bit 1 */\r
+#define CAN_F4R2_FB2_Pos                     (2U)                              \r
+#define CAN_F4R2_FB2_Msk                     (0x1UL << CAN_F4R2_FB2_Pos)        /*!< 0x00000004 */\r
+#define CAN_F4R2_FB2                         CAN_F4R2_FB2_Msk                  /*!< Filter bit 2 */\r
+#define CAN_F4R2_FB3_Pos                     (3U)                              \r
+#define CAN_F4R2_FB3_Msk                     (0x1UL << CAN_F4R2_FB3_Pos)        /*!< 0x00000008 */\r
+#define CAN_F4R2_FB3                         CAN_F4R2_FB3_Msk                  /*!< Filter bit 3 */\r
+#define CAN_F4R2_FB4_Pos                     (4U)                              \r
+#define CAN_F4R2_FB4_Msk                     (0x1UL << CAN_F4R2_FB4_Pos)        /*!< 0x00000010 */\r
+#define CAN_F4R2_FB4                         CAN_F4R2_FB4_Msk                  /*!< Filter bit 4 */\r
+#define CAN_F4R2_FB5_Pos                     (5U)                              \r
+#define CAN_F4R2_FB5_Msk                     (0x1UL << CAN_F4R2_FB5_Pos)        /*!< 0x00000020 */\r
+#define CAN_F4R2_FB5                         CAN_F4R2_FB5_Msk                  /*!< Filter bit 5 */\r
+#define CAN_F4R2_FB6_Pos                     (6U)                              \r
+#define CAN_F4R2_FB6_Msk                     (0x1UL << CAN_F4R2_FB6_Pos)        /*!< 0x00000040 */\r
+#define CAN_F4R2_FB6                         CAN_F4R2_FB6_Msk                  /*!< Filter bit 6 */\r
+#define CAN_F4R2_FB7_Pos                     (7U)                              \r
+#define CAN_F4R2_FB7_Msk                     (0x1UL << CAN_F4R2_FB7_Pos)        /*!< 0x00000080 */\r
+#define CAN_F4R2_FB7                         CAN_F4R2_FB7_Msk                  /*!< Filter bit 7 */\r
+#define CAN_F4R2_FB8_Pos                     (8U)                              \r
+#define CAN_F4R2_FB8_Msk                     (0x1UL << CAN_F4R2_FB8_Pos)        /*!< 0x00000100 */\r
+#define CAN_F4R2_FB8                         CAN_F4R2_FB8_Msk                  /*!< Filter bit 8 */\r
+#define CAN_F4R2_FB9_Pos                     (9U)                              \r
+#define CAN_F4R2_FB9_Msk                     (0x1UL << CAN_F4R2_FB9_Pos)        /*!< 0x00000200 */\r
+#define CAN_F4R2_FB9                         CAN_F4R2_FB9_Msk                  /*!< Filter bit 9 */\r
+#define CAN_F4R2_FB10_Pos                    (10U)                             \r
+#define CAN_F4R2_FB10_Msk                    (0x1UL << CAN_F4R2_FB10_Pos)       /*!< 0x00000400 */\r
+#define CAN_F4R2_FB10                        CAN_F4R2_FB10_Msk                 /*!< Filter bit 10 */\r
+#define CAN_F4R2_FB11_Pos                    (11U)                             \r
+#define CAN_F4R2_FB11_Msk                    (0x1UL << CAN_F4R2_FB11_Pos)       /*!< 0x00000800 */\r
+#define CAN_F4R2_FB11                        CAN_F4R2_FB11_Msk                 /*!< Filter bit 11 */\r
+#define CAN_F4R2_FB12_Pos                    (12U)                             \r
+#define CAN_F4R2_FB12_Msk                    (0x1UL << CAN_F4R2_FB12_Pos)       /*!< 0x00001000 */\r
+#define CAN_F4R2_FB12                        CAN_F4R2_FB12_Msk                 /*!< Filter bit 12 */\r
+#define CAN_F4R2_FB13_Pos                    (13U)                             \r
+#define CAN_F4R2_FB13_Msk                    (0x1UL << CAN_F4R2_FB13_Pos)       /*!< 0x00002000 */\r
+#define CAN_F4R2_FB13                        CAN_F4R2_FB13_Msk                 /*!< Filter bit 13 */\r
+#define CAN_F4R2_FB14_Pos                    (14U)                             \r
+#define CAN_F4R2_FB14_Msk                    (0x1UL << CAN_F4R2_FB14_Pos)       /*!< 0x00004000 */\r
+#define CAN_F4R2_FB14                        CAN_F4R2_FB14_Msk                 /*!< Filter bit 14 */\r
+#define CAN_F4R2_FB15_Pos                    (15U)                             \r
+#define CAN_F4R2_FB15_Msk                    (0x1UL << CAN_F4R2_FB15_Pos)       /*!< 0x00008000 */\r
+#define CAN_F4R2_FB15                        CAN_F4R2_FB15_Msk                 /*!< Filter bit 15 */\r
+#define CAN_F4R2_FB16_Pos                    (16U)                             \r
+#define CAN_F4R2_FB16_Msk                    (0x1UL << CAN_F4R2_FB16_Pos)       /*!< 0x00010000 */\r
+#define CAN_F4R2_FB16                        CAN_F4R2_FB16_Msk                 /*!< Filter bit 16 */\r
+#define CAN_F4R2_FB17_Pos                    (17U)                             \r
+#define CAN_F4R2_FB17_Msk                    (0x1UL << CAN_F4R2_FB17_Pos)       /*!< 0x00020000 */\r
+#define CAN_F4R2_FB17                        CAN_F4R2_FB17_Msk                 /*!< Filter bit 17 */\r
+#define CAN_F4R2_FB18_Pos                    (18U)                             \r
+#define CAN_F4R2_FB18_Msk                    (0x1UL << CAN_F4R2_FB18_Pos)       /*!< 0x00040000 */\r
+#define CAN_F4R2_FB18                        CAN_F4R2_FB18_Msk                 /*!< Filter bit 18 */\r
+#define CAN_F4R2_FB19_Pos                    (19U)                             \r
+#define CAN_F4R2_FB19_Msk                    (0x1UL << CAN_F4R2_FB19_Pos)       /*!< 0x00080000 */\r
+#define CAN_F4R2_FB19                        CAN_F4R2_FB19_Msk                 /*!< Filter bit 19 */\r
+#define CAN_F4R2_FB20_Pos                    (20U)                             \r
+#define CAN_F4R2_FB20_Msk                    (0x1UL << CAN_F4R2_FB20_Pos)       /*!< 0x00100000 */\r
+#define CAN_F4R2_FB20                        CAN_F4R2_FB20_Msk                 /*!< Filter bit 20 */\r
+#define CAN_F4R2_FB21_Pos                    (21U)                             \r
+#define CAN_F4R2_FB21_Msk                    (0x1UL << CAN_F4R2_FB21_Pos)       /*!< 0x00200000 */\r
+#define CAN_F4R2_FB21                        CAN_F4R2_FB21_Msk                 /*!< Filter bit 21 */\r
+#define CAN_F4R2_FB22_Pos                    (22U)                             \r
+#define CAN_F4R2_FB22_Msk                    (0x1UL << CAN_F4R2_FB22_Pos)       /*!< 0x00400000 */\r
+#define CAN_F4R2_FB22                        CAN_F4R2_FB22_Msk                 /*!< Filter bit 22 */\r
+#define CAN_F4R2_FB23_Pos                    (23U)                             \r
+#define CAN_F4R2_FB23_Msk                    (0x1UL << CAN_F4R2_FB23_Pos)       /*!< 0x00800000 */\r
+#define CAN_F4R2_FB23                        CAN_F4R2_FB23_Msk                 /*!< Filter bit 23 */\r
+#define CAN_F4R2_FB24_Pos                    (24U)                             \r
+#define CAN_F4R2_FB24_Msk                    (0x1UL << CAN_F4R2_FB24_Pos)       /*!< 0x01000000 */\r
+#define CAN_F4R2_FB24                        CAN_F4R2_FB24_Msk                 /*!< Filter bit 24 */\r
+#define CAN_F4R2_FB25_Pos                    (25U)                             \r
+#define CAN_F4R2_FB25_Msk                    (0x1UL << CAN_F4R2_FB25_Pos)       /*!< 0x02000000 */\r
+#define CAN_F4R2_FB25                        CAN_F4R2_FB25_Msk                 /*!< Filter bit 25 */\r
+#define CAN_F4R2_FB26_Pos                    (26U)                             \r
+#define CAN_F4R2_FB26_Msk                    (0x1UL << CAN_F4R2_FB26_Pos)       /*!< 0x04000000 */\r
+#define CAN_F4R2_FB26                        CAN_F4R2_FB26_Msk                 /*!< Filter bit 26 */\r
+#define CAN_F4R2_FB27_Pos                    (27U)                             \r
+#define CAN_F4R2_FB27_Msk                    (0x1UL << CAN_F4R2_FB27_Pos)       /*!< 0x08000000 */\r
+#define CAN_F4R2_FB27                        CAN_F4R2_FB27_Msk                 /*!< Filter bit 27 */\r
+#define CAN_F4R2_FB28_Pos                    (28U)                             \r
+#define CAN_F4R2_FB28_Msk                    (0x1UL << CAN_F4R2_FB28_Pos)       /*!< 0x10000000 */\r
+#define CAN_F4R2_FB28                        CAN_F4R2_FB28_Msk                 /*!< Filter bit 28 */\r
+#define CAN_F4R2_FB29_Pos                    (29U)                             \r
+#define CAN_F4R2_FB29_Msk                    (0x1UL << CAN_F4R2_FB29_Pos)       /*!< 0x20000000 */\r
+#define CAN_F4R2_FB29                        CAN_F4R2_FB29_Msk                 /*!< Filter bit 29 */\r
+#define CAN_F4R2_FB30_Pos                    (30U)                             \r
+#define CAN_F4R2_FB30_Msk                    (0x1UL << CAN_F4R2_FB30_Pos)       /*!< 0x40000000 */\r
+#define CAN_F4R2_FB30                        CAN_F4R2_FB30_Msk                 /*!< Filter bit 30 */\r
+#define CAN_F4R2_FB31_Pos                    (31U)                             \r
+#define CAN_F4R2_FB31_Msk                    (0x1UL << CAN_F4R2_FB31_Pos)       /*!< 0x80000000 */\r
+#define CAN_F4R2_FB31                        CAN_F4R2_FB31_Msk                 /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F5R2 register  *******************/\r
+#define CAN_F5R2_FB0_Pos                     (0U)                              \r
+#define CAN_F5R2_FB0_Msk                     (0x1UL << CAN_F5R2_FB0_Pos)        /*!< 0x00000001 */\r
+#define CAN_F5R2_FB0                         CAN_F5R2_FB0_Msk                  /*!< Filter bit 0 */\r
+#define CAN_F5R2_FB1_Pos                     (1U)                              \r
+#define CAN_F5R2_FB1_Msk                     (0x1UL << CAN_F5R2_FB1_Pos)        /*!< 0x00000002 */\r
+#define CAN_F5R2_FB1                         CAN_F5R2_FB1_Msk                  /*!< Filter bit 1 */\r
+#define CAN_F5R2_FB2_Pos                     (2U)                              \r
+#define CAN_F5R2_FB2_Msk                     (0x1UL << CAN_F5R2_FB2_Pos)        /*!< 0x00000004 */\r
+#define CAN_F5R2_FB2                         CAN_F5R2_FB2_Msk                  /*!< Filter bit 2 */\r
+#define CAN_F5R2_FB3_Pos                     (3U)                              \r
+#define CAN_F5R2_FB3_Msk                     (0x1UL << CAN_F5R2_FB3_Pos)        /*!< 0x00000008 */\r
+#define CAN_F5R2_FB3                         CAN_F5R2_FB3_Msk                  /*!< Filter bit 3 */\r
+#define CAN_F5R2_FB4_Pos                     (4U)                              \r
+#define CAN_F5R2_FB4_Msk                     (0x1UL << CAN_F5R2_FB4_Pos)        /*!< 0x00000010 */\r
+#define CAN_F5R2_FB4                         CAN_F5R2_FB4_Msk                  /*!< Filter bit 4 */\r
+#define CAN_F5R2_FB5_Pos                     (5U)                              \r
+#define CAN_F5R2_FB5_Msk                     (0x1UL << CAN_F5R2_FB5_Pos)        /*!< 0x00000020 */\r
+#define CAN_F5R2_FB5                         CAN_F5R2_FB5_Msk                  /*!< Filter bit 5 */\r
+#define CAN_F5R2_FB6_Pos                     (6U)                              \r
+#define CAN_F5R2_FB6_Msk                     (0x1UL << CAN_F5R2_FB6_Pos)        /*!< 0x00000040 */\r
+#define CAN_F5R2_FB6                         CAN_F5R2_FB6_Msk                  /*!< Filter bit 6 */\r
+#define CAN_F5R2_FB7_Pos                     (7U)                              \r
+#define CAN_F5R2_FB7_Msk                     (0x1UL << CAN_F5R2_FB7_Pos)        /*!< 0x00000080 */\r
+#define CAN_F5R2_FB7                         CAN_F5R2_FB7_Msk                  /*!< Filter bit 7 */\r
+#define CAN_F5R2_FB8_Pos                     (8U)                              \r
+#define CAN_F5R2_FB8_Msk                     (0x1UL << CAN_F5R2_FB8_Pos)        /*!< 0x00000100 */\r
+#define CAN_F5R2_FB8                         CAN_F5R2_FB8_Msk                  /*!< Filter bit 8 */\r
+#define CAN_F5R2_FB9_Pos                     (9U)                              \r
+#define CAN_F5R2_FB9_Msk                     (0x1UL << CAN_F5R2_FB9_Pos)        /*!< 0x00000200 */\r
+#define CAN_F5R2_FB9                         CAN_F5R2_FB9_Msk                  /*!< Filter bit 9 */\r
+#define CAN_F5R2_FB10_Pos                    (10U)                             \r
+#define CAN_F5R2_FB10_Msk                    (0x1UL << CAN_F5R2_FB10_Pos)       /*!< 0x00000400 */\r
+#define CAN_F5R2_FB10                        CAN_F5R2_FB10_Msk                 /*!< Filter bit 10 */\r
+#define CAN_F5R2_FB11_Pos                    (11U)                             \r
+#define CAN_F5R2_FB11_Msk                    (0x1UL << CAN_F5R2_FB11_Pos)       /*!< 0x00000800 */\r
+#define CAN_F5R2_FB11                        CAN_F5R2_FB11_Msk                 /*!< Filter bit 11 */\r
+#define CAN_F5R2_FB12_Pos                    (12U)                             \r
+#define CAN_F5R2_FB12_Msk                    (0x1UL << CAN_F5R2_FB12_Pos)       /*!< 0x00001000 */\r
+#define CAN_F5R2_FB12                        CAN_F5R2_FB12_Msk                 /*!< Filter bit 12 */\r
+#define CAN_F5R2_FB13_Pos                    (13U)                             \r
+#define CAN_F5R2_FB13_Msk                    (0x1UL << CAN_F5R2_FB13_Pos)       /*!< 0x00002000 */\r
+#define CAN_F5R2_FB13                        CAN_F5R2_FB13_Msk                 /*!< Filter bit 13 */\r
+#define CAN_F5R2_FB14_Pos                    (14U)                             \r
+#define CAN_F5R2_FB14_Msk                    (0x1UL << CAN_F5R2_FB14_Pos)       /*!< 0x00004000 */\r
+#define CAN_F5R2_FB14                        CAN_F5R2_FB14_Msk                 /*!< Filter bit 14 */\r
+#define CAN_F5R2_FB15_Pos                    (15U)                             \r
+#define CAN_F5R2_FB15_Msk                    (0x1UL << CAN_F5R2_FB15_Pos)       /*!< 0x00008000 */\r
+#define CAN_F5R2_FB15                        CAN_F5R2_FB15_Msk                 /*!< Filter bit 15 */\r
+#define CAN_F5R2_FB16_Pos                    (16U)                             \r
+#define CAN_F5R2_FB16_Msk                    (0x1UL << CAN_F5R2_FB16_Pos)       /*!< 0x00010000 */\r
+#define CAN_F5R2_FB16                        CAN_F5R2_FB16_Msk                 /*!< Filter bit 16 */\r
+#define CAN_F5R2_FB17_Pos                    (17U)                             \r
+#define CAN_F5R2_FB17_Msk                    (0x1UL << CAN_F5R2_FB17_Pos)       /*!< 0x00020000 */\r
+#define CAN_F5R2_FB17                        CAN_F5R2_FB17_Msk                 /*!< Filter bit 17 */\r
+#define CAN_F5R2_FB18_Pos                    (18U)                             \r
+#define CAN_F5R2_FB18_Msk                    (0x1UL << CAN_F5R2_FB18_Pos)       /*!< 0x00040000 */\r
+#define CAN_F5R2_FB18                        CAN_F5R2_FB18_Msk                 /*!< Filter bit 18 */\r
+#define CAN_F5R2_FB19_Pos                    (19U)                             \r
+#define CAN_F5R2_FB19_Msk                    (0x1UL << CAN_F5R2_FB19_Pos)       /*!< 0x00080000 */\r
+#define CAN_F5R2_FB19                        CAN_F5R2_FB19_Msk                 /*!< Filter bit 19 */\r
+#define CAN_F5R2_FB20_Pos                    (20U)                             \r
+#define CAN_F5R2_FB20_Msk                    (0x1UL << CAN_F5R2_FB20_Pos)       /*!< 0x00100000 */\r
+#define CAN_F5R2_FB20                        CAN_F5R2_FB20_Msk                 /*!< Filter bit 20 */\r
+#define CAN_F5R2_FB21_Pos                    (21U)                             \r
+#define CAN_F5R2_FB21_Msk                    (0x1UL << CAN_F5R2_FB21_Pos)       /*!< 0x00200000 */\r
+#define CAN_F5R2_FB21                        CAN_F5R2_FB21_Msk                 /*!< Filter bit 21 */\r
+#define CAN_F5R2_FB22_Pos                    (22U)                             \r
+#define CAN_F5R2_FB22_Msk                    (0x1UL << CAN_F5R2_FB22_Pos)       /*!< 0x00400000 */\r
+#define CAN_F5R2_FB22                        CAN_F5R2_FB22_Msk                 /*!< Filter bit 22 */\r
+#define CAN_F5R2_FB23_Pos                    (23U)                             \r
+#define CAN_F5R2_FB23_Msk                    (0x1UL << CAN_F5R2_FB23_Pos)       /*!< 0x00800000 */\r
+#define CAN_F5R2_FB23                        CAN_F5R2_FB23_Msk                 /*!< Filter bit 23 */\r
+#define CAN_F5R2_FB24_Pos                    (24U)                             \r
+#define CAN_F5R2_FB24_Msk                    (0x1UL << CAN_F5R2_FB24_Pos)       /*!< 0x01000000 */\r
+#define CAN_F5R2_FB24                        CAN_F5R2_FB24_Msk                 /*!< Filter bit 24 */\r
+#define CAN_F5R2_FB25_Pos                    (25U)                             \r
+#define CAN_F5R2_FB25_Msk                    (0x1UL << CAN_F5R2_FB25_Pos)       /*!< 0x02000000 */\r
+#define CAN_F5R2_FB25                        CAN_F5R2_FB25_Msk                 /*!< Filter bit 25 */\r
+#define CAN_F5R2_FB26_Pos                    (26U)                             \r
+#define CAN_F5R2_FB26_Msk                    (0x1UL << CAN_F5R2_FB26_Pos)       /*!< 0x04000000 */\r
+#define CAN_F5R2_FB26                        CAN_F5R2_FB26_Msk                 /*!< Filter bit 26 */\r
+#define CAN_F5R2_FB27_Pos                    (27U)                             \r
+#define CAN_F5R2_FB27_Msk                    (0x1UL << CAN_F5R2_FB27_Pos)       /*!< 0x08000000 */\r
+#define CAN_F5R2_FB27                        CAN_F5R2_FB27_Msk                 /*!< Filter bit 27 */\r
+#define CAN_F5R2_FB28_Pos                    (28U)                             \r
+#define CAN_F5R2_FB28_Msk                    (0x1UL << CAN_F5R2_FB28_Pos)       /*!< 0x10000000 */\r
+#define CAN_F5R2_FB28                        CAN_F5R2_FB28_Msk                 /*!< Filter bit 28 */\r
+#define CAN_F5R2_FB29_Pos                    (29U)                             \r
+#define CAN_F5R2_FB29_Msk                    (0x1UL << CAN_F5R2_FB29_Pos)       /*!< 0x20000000 */\r
+#define CAN_F5R2_FB29                        CAN_F5R2_FB29_Msk                 /*!< Filter bit 29 */\r
+#define CAN_F5R2_FB30_Pos                    (30U)                             \r
+#define CAN_F5R2_FB30_Msk                    (0x1UL << CAN_F5R2_FB30_Pos)       /*!< 0x40000000 */\r
+#define CAN_F5R2_FB30                        CAN_F5R2_FB30_Msk                 /*!< Filter bit 30 */\r
+#define CAN_F5R2_FB31_Pos                    (31U)                             \r
+#define CAN_F5R2_FB31_Msk                    (0x1UL << CAN_F5R2_FB31_Pos)       /*!< 0x80000000 */\r
+#define CAN_F5R2_FB31                        CAN_F5R2_FB31_Msk                 /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F6R2 register  *******************/\r
+#define CAN_F6R2_FB0_Pos                     (0U)                              \r
+#define CAN_F6R2_FB0_Msk                     (0x1UL << CAN_F6R2_FB0_Pos)        /*!< 0x00000001 */\r
+#define CAN_F6R2_FB0                         CAN_F6R2_FB0_Msk                  /*!< Filter bit 0 */\r
+#define CAN_F6R2_FB1_Pos                     (1U)                              \r
+#define CAN_F6R2_FB1_Msk                     (0x1UL << CAN_F6R2_FB1_Pos)        /*!< 0x00000002 */\r
+#define CAN_F6R2_FB1                         CAN_F6R2_FB1_Msk                  /*!< Filter bit 1 */\r
+#define CAN_F6R2_FB2_Pos                     (2U)                              \r
+#define CAN_F6R2_FB2_Msk                     (0x1UL << CAN_F6R2_FB2_Pos)        /*!< 0x00000004 */\r
+#define CAN_F6R2_FB2                         CAN_F6R2_FB2_Msk                  /*!< Filter bit 2 */\r
+#define CAN_F6R2_FB3_Pos                     (3U)                              \r
+#define CAN_F6R2_FB3_Msk                     (0x1UL << CAN_F6R2_FB3_Pos)        /*!< 0x00000008 */\r
+#define CAN_F6R2_FB3                         CAN_F6R2_FB3_Msk                  /*!< Filter bit 3 */\r
+#define CAN_F6R2_FB4_Pos                     (4U)                              \r
+#define CAN_F6R2_FB4_Msk                     (0x1UL << CAN_F6R2_FB4_Pos)        /*!< 0x00000010 */\r
+#define CAN_F6R2_FB4                         CAN_F6R2_FB4_Msk                  /*!< Filter bit 4 */\r
+#define CAN_F6R2_FB5_Pos                     (5U)                              \r
+#define CAN_F6R2_FB5_Msk                     (0x1UL << CAN_F6R2_FB5_Pos)        /*!< 0x00000020 */\r
+#define CAN_F6R2_FB5                         CAN_F6R2_FB5_Msk                  /*!< Filter bit 5 */\r
+#define CAN_F6R2_FB6_Pos                     (6U)                              \r
+#define CAN_F6R2_FB6_Msk                     (0x1UL << CAN_F6R2_FB6_Pos)        /*!< 0x00000040 */\r
+#define CAN_F6R2_FB6                         CAN_F6R2_FB6_Msk                  /*!< Filter bit 6 */\r
+#define CAN_F6R2_FB7_Pos                     (7U)                              \r
+#define CAN_F6R2_FB7_Msk                     (0x1UL << CAN_F6R2_FB7_Pos)        /*!< 0x00000080 */\r
+#define CAN_F6R2_FB7                         CAN_F6R2_FB7_Msk                  /*!< Filter bit 7 */\r
+#define CAN_F6R2_FB8_Pos                     (8U)                              \r
+#define CAN_F6R2_FB8_Msk                     (0x1UL << CAN_F6R2_FB8_Pos)        /*!< 0x00000100 */\r
+#define CAN_F6R2_FB8                         CAN_F6R2_FB8_Msk                  /*!< Filter bit 8 */\r
+#define CAN_F6R2_FB9_Pos                     (9U)                              \r
+#define CAN_F6R2_FB9_Msk                     (0x1UL << CAN_F6R2_FB9_Pos)        /*!< 0x00000200 */\r
+#define CAN_F6R2_FB9                         CAN_F6R2_FB9_Msk                  /*!< Filter bit 9 */\r
+#define CAN_F6R2_FB10_Pos                    (10U)                             \r
+#define CAN_F6R2_FB10_Msk                    (0x1UL << CAN_F6R2_FB10_Pos)       /*!< 0x00000400 */\r
+#define CAN_F6R2_FB10                        CAN_F6R2_FB10_Msk                 /*!< Filter bit 10 */\r
+#define CAN_F6R2_FB11_Pos                    (11U)                             \r
+#define CAN_F6R2_FB11_Msk                    (0x1UL << CAN_F6R2_FB11_Pos)       /*!< 0x00000800 */\r
+#define CAN_F6R2_FB11                        CAN_F6R2_FB11_Msk                 /*!< Filter bit 11 */\r
+#define CAN_F6R2_FB12_Pos                    (12U)                             \r
+#define CAN_F6R2_FB12_Msk                    (0x1UL << CAN_F6R2_FB12_Pos)       /*!< 0x00001000 */\r
+#define CAN_F6R2_FB12                        CAN_F6R2_FB12_Msk                 /*!< Filter bit 12 */\r
+#define CAN_F6R2_FB13_Pos                    (13U)                             \r
+#define CAN_F6R2_FB13_Msk                    (0x1UL << CAN_F6R2_FB13_Pos)       /*!< 0x00002000 */\r
+#define CAN_F6R2_FB13                        CAN_F6R2_FB13_Msk                 /*!< Filter bit 13 */\r
+#define CAN_F6R2_FB14_Pos                    (14U)                             \r
+#define CAN_F6R2_FB14_Msk                    (0x1UL << CAN_F6R2_FB14_Pos)       /*!< 0x00004000 */\r
+#define CAN_F6R2_FB14                        CAN_F6R2_FB14_Msk                 /*!< Filter bit 14 */\r
+#define CAN_F6R2_FB15_Pos                    (15U)                             \r
+#define CAN_F6R2_FB15_Msk                    (0x1UL << CAN_F6R2_FB15_Pos)       /*!< 0x00008000 */\r
+#define CAN_F6R2_FB15                        CAN_F6R2_FB15_Msk                 /*!< Filter bit 15 */\r
+#define CAN_F6R2_FB16_Pos                    (16U)                             \r
+#define CAN_F6R2_FB16_Msk                    (0x1UL << CAN_F6R2_FB16_Pos)       /*!< 0x00010000 */\r
+#define CAN_F6R2_FB16                        CAN_F6R2_FB16_Msk                 /*!< Filter bit 16 */\r
+#define CAN_F6R2_FB17_Pos                    (17U)                             \r
+#define CAN_F6R2_FB17_Msk                    (0x1UL << CAN_F6R2_FB17_Pos)       /*!< 0x00020000 */\r
+#define CAN_F6R2_FB17                        CAN_F6R2_FB17_Msk                 /*!< Filter bit 17 */\r
+#define CAN_F6R2_FB18_Pos                    (18U)                             \r
+#define CAN_F6R2_FB18_Msk                    (0x1UL << CAN_F6R2_FB18_Pos)       /*!< 0x00040000 */\r
+#define CAN_F6R2_FB18                        CAN_F6R2_FB18_Msk                 /*!< Filter bit 18 */\r
+#define CAN_F6R2_FB19_Pos                    (19U)                             \r
+#define CAN_F6R2_FB19_Msk                    (0x1UL << CAN_F6R2_FB19_Pos)       /*!< 0x00080000 */\r
+#define CAN_F6R2_FB19                        CAN_F6R2_FB19_Msk                 /*!< Filter bit 19 */\r
+#define CAN_F6R2_FB20_Pos                    (20U)                             \r
+#define CAN_F6R2_FB20_Msk                    (0x1UL << CAN_F6R2_FB20_Pos)       /*!< 0x00100000 */\r
+#define CAN_F6R2_FB20                        CAN_F6R2_FB20_Msk                 /*!< Filter bit 20 */\r
+#define CAN_F6R2_FB21_Pos                    (21U)                             \r
+#define CAN_F6R2_FB21_Msk                    (0x1UL << CAN_F6R2_FB21_Pos)       /*!< 0x00200000 */\r
+#define CAN_F6R2_FB21                        CAN_F6R2_FB21_Msk                 /*!< Filter bit 21 */\r
+#define CAN_F6R2_FB22_Pos                    (22U)                             \r
+#define CAN_F6R2_FB22_Msk                    (0x1UL << CAN_F6R2_FB22_Pos)       /*!< 0x00400000 */\r
+#define CAN_F6R2_FB22                        CAN_F6R2_FB22_Msk                 /*!< Filter bit 22 */\r
+#define CAN_F6R2_FB23_Pos                    (23U)                             \r
+#define CAN_F6R2_FB23_Msk                    (0x1UL << CAN_F6R2_FB23_Pos)       /*!< 0x00800000 */\r
+#define CAN_F6R2_FB23                        CAN_F6R2_FB23_Msk                 /*!< Filter bit 23 */\r
+#define CAN_F6R2_FB24_Pos                    (24U)                             \r
+#define CAN_F6R2_FB24_Msk                    (0x1UL << CAN_F6R2_FB24_Pos)       /*!< 0x01000000 */\r
+#define CAN_F6R2_FB24                        CAN_F6R2_FB24_Msk                 /*!< Filter bit 24 */\r
+#define CAN_F6R2_FB25_Pos                    (25U)                             \r
+#define CAN_F6R2_FB25_Msk                    (0x1UL << CAN_F6R2_FB25_Pos)       /*!< 0x02000000 */\r
+#define CAN_F6R2_FB25                        CAN_F6R2_FB25_Msk                 /*!< Filter bit 25 */\r
+#define CAN_F6R2_FB26_Pos                    (26U)                             \r
+#define CAN_F6R2_FB26_Msk                    (0x1UL << CAN_F6R2_FB26_Pos)       /*!< 0x04000000 */\r
+#define CAN_F6R2_FB26                        CAN_F6R2_FB26_Msk                 /*!< Filter bit 26 */\r
+#define CAN_F6R2_FB27_Pos                    (27U)                             \r
+#define CAN_F6R2_FB27_Msk                    (0x1UL << CAN_F6R2_FB27_Pos)       /*!< 0x08000000 */\r
+#define CAN_F6R2_FB27                        CAN_F6R2_FB27_Msk                 /*!< Filter bit 27 */\r
+#define CAN_F6R2_FB28_Pos                    (28U)                             \r
+#define CAN_F6R2_FB28_Msk                    (0x1UL << CAN_F6R2_FB28_Pos)       /*!< 0x10000000 */\r
+#define CAN_F6R2_FB28                        CAN_F6R2_FB28_Msk                 /*!< Filter bit 28 */\r
+#define CAN_F6R2_FB29_Pos                    (29U)                             \r
+#define CAN_F6R2_FB29_Msk                    (0x1UL << CAN_F6R2_FB29_Pos)       /*!< 0x20000000 */\r
+#define CAN_F6R2_FB29                        CAN_F6R2_FB29_Msk                 /*!< Filter bit 29 */\r
+#define CAN_F6R2_FB30_Pos                    (30U)                             \r
+#define CAN_F6R2_FB30_Msk                    (0x1UL << CAN_F6R2_FB30_Pos)       /*!< 0x40000000 */\r
+#define CAN_F6R2_FB30                        CAN_F6R2_FB30_Msk                 /*!< Filter bit 30 */\r
+#define CAN_F6R2_FB31_Pos                    (31U)                             \r
+#define CAN_F6R2_FB31_Msk                    (0x1UL << CAN_F6R2_FB31_Pos)       /*!< 0x80000000 */\r
+#define CAN_F6R2_FB31                        CAN_F6R2_FB31_Msk                 /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F7R2 register  *******************/\r
+#define CAN_F7R2_FB0_Pos                     (0U)                              \r
+#define CAN_F7R2_FB0_Msk                     (0x1UL << CAN_F7R2_FB0_Pos)        /*!< 0x00000001 */\r
+#define CAN_F7R2_FB0                         CAN_F7R2_FB0_Msk                  /*!< Filter bit 0 */\r
+#define CAN_F7R2_FB1_Pos                     (1U)                              \r
+#define CAN_F7R2_FB1_Msk                     (0x1UL << CAN_F7R2_FB1_Pos)        /*!< 0x00000002 */\r
+#define CAN_F7R2_FB1                         CAN_F7R2_FB1_Msk                  /*!< Filter bit 1 */\r
+#define CAN_F7R2_FB2_Pos                     (2U)                              \r
+#define CAN_F7R2_FB2_Msk                     (0x1UL << CAN_F7R2_FB2_Pos)        /*!< 0x00000004 */\r
+#define CAN_F7R2_FB2                         CAN_F7R2_FB2_Msk                  /*!< Filter bit 2 */\r
+#define CAN_F7R2_FB3_Pos                     (3U)                              \r
+#define CAN_F7R2_FB3_Msk                     (0x1UL << CAN_F7R2_FB3_Pos)        /*!< 0x00000008 */\r
+#define CAN_F7R2_FB3                         CAN_F7R2_FB3_Msk                  /*!< Filter bit 3 */\r
+#define CAN_F7R2_FB4_Pos                     (4U)                              \r
+#define CAN_F7R2_FB4_Msk                     (0x1UL << CAN_F7R2_FB4_Pos)        /*!< 0x00000010 */\r
+#define CAN_F7R2_FB4                         CAN_F7R2_FB4_Msk                  /*!< Filter bit 4 */\r
+#define CAN_F7R2_FB5_Pos                     (5U)                              \r
+#define CAN_F7R2_FB5_Msk                     (0x1UL << CAN_F7R2_FB5_Pos)        /*!< 0x00000020 */\r
+#define CAN_F7R2_FB5                         CAN_F7R2_FB5_Msk                  /*!< Filter bit 5 */\r
+#define CAN_F7R2_FB6_Pos                     (6U)                              \r
+#define CAN_F7R2_FB6_Msk                     (0x1UL << CAN_F7R2_FB6_Pos)        /*!< 0x00000040 */\r
+#define CAN_F7R2_FB6                         CAN_F7R2_FB6_Msk                  /*!< Filter bit 6 */\r
+#define CAN_F7R2_FB7_Pos                     (7U)                              \r
+#define CAN_F7R2_FB7_Msk                     (0x1UL << CAN_F7R2_FB7_Pos)        /*!< 0x00000080 */\r
+#define CAN_F7R2_FB7                         CAN_F7R2_FB7_Msk                  /*!< Filter bit 7 */\r
+#define CAN_F7R2_FB8_Pos                     (8U)                              \r
+#define CAN_F7R2_FB8_Msk                     (0x1UL << CAN_F7R2_FB8_Pos)        /*!< 0x00000100 */\r
+#define CAN_F7R2_FB8                         CAN_F7R2_FB8_Msk                  /*!< Filter bit 8 */\r
+#define CAN_F7R2_FB9_Pos                     (9U)                              \r
+#define CAN_F7R2_FB9_Msk                     (0x1UL << CAN_F7R2_FB9_Pos)        /*!< 0x00000200 */\r
+#define CAN_F7R2_FB9                         CAN_F7R2_FB9_Msk                  /*!< Filter bit 9 */\r
+#define CAN_F7R2_FB10_Pos                    (10U)                             \r
+#define CAN_F7R2_FB10_Msk                    (0x1UL << CAN_F7R2_FB10_Pos)       /*!< 0x00000400 */\r
+#define CAN_F7R2_FB10                        CAN_F7R2_FB10_Msk                 /*!< Filter bit 10 */\r
+#define CAN_F7R2_FB11_Pos                    (11U)                             \r
+#define CAN_F7R2_FB11_Msk                    (0x1UL << CAN_F7R2_FB11_Pos)       /*!< 0x00000800 */\r
+#define CAN_F7R2_FB11                        CAN_F7R2_FB11_Msk                 /*!< Filter bit 11 */\r
+#define CAN_F7R2_FB12_Pos                    (12U)                             \r
+#define CAN_F7R2_FB12_Msk                    (0x1UL << CAN_F7R2_FB12_Pos)       /*!< 0x00001000 */\r
+#define CAN_F7R2_FB12                        CAN_F7R2_FB12_Msk                 /*!< Filter bit 12 */\r
+#define CAN_F7R2_FB13_Pos                    (13U)                             \r
+#define CAN_F7R2_FB13_Msk                    (0x1UL << CAN_F7R2_FB13_Pos)       /*!< 0x00002000 */\r
+#define CAN_F7R2_FB13                        CAN_F7R2_FB13_Msk                 /*!< Filter bit 13 */\r
+#define CAN_F7R2_FB14_Pos                    (14U)                             \r
+#define CAN_F7R2_FB14_Msk                    (0x1UL << CAN_F7R2_FB14_Pos)       /*!< 0x00004000 */\r
+#define CAN_F7R2_FB14                        CAN_F7R2_FB14_Msk                 /*!< Filter bit 14 */\r
+#define CAN_F7R2_FB15_Pos                    (15U)                             \r
+#define CAN_F7R2_FB15_Msk                    (0x1UL << CAN_F7R2_FB15_Pos)       /*!< 0x00008000 */\r
+#define CAN_F7R2_FB15                        CAN_F7R2_FB15_Msk                 /*!< Filter bit 15 */\r
+#define CAN_F7R2_FB16_Pos                    (16U)                             \r
+#define CAN_F7R2_FB16_Msk                    (0x1UL << CAN_F7R2_FB16_Pos)       /*!< 0x00010000 */\r
+#define CAN_F7R2_FB16                        CAN_F7R2_FB16_Msk                 /*!< Filter bit 16 */\r
+#define CAN_F7R2_FB17_Pos                    (17U)                             \r
+#define CAN_F7R2_FB17_Msk                    (0x1UL << CAN_F7R2_FB17_Pos)       /*!< 0x00020000 */\r
+#define CAN_F7R2_FB17                        CAN_F7R2_FB17_Msk                 /*!< Filter bit 17 */\r
+#define CAN_F7R2_FB18_Pos                    (18U)                             \r
+#define CAN_F7R2_FB18_Msk                    (0x1UL << CAN_F7R2_FB18_Pos)       /*!< 0x00040000 */\r
+#define CAN_F7R2_FB18                        CAN_F7R2_FB18_Msk                 /*!< Filter bit 18 */\r
+#define CAN_F7R2_FB19_Pos                    (19U)                             \r
+#define CAN_F7R2_FB19_Msk                    (0x1UL << CAN_F7R2_FB19_Pos)       /*!< 0x00080000 */\r
+#define CAN_F7R2_FB19                        CAN_F7R2_FB19_Msk                 /*!< Filter bit 19 */\r
+#define CAN_F7R2_FB20_Pos                    (20U)                             \r
+#define CAN_F7R2_FB20_Msk                    (0x1UL << CAN_F7R2_FB20_Pos)       /*!< 0x00100000 */\r
+#define CAN_F7R2_FB20                        CAN_F7R2_FB20_Msk                 /*!< Filter bit 20 */\r
+#define CAN_F7R2_FB21_Pos                    (21U)                             \r
+#define CAN_F7R2_FB21_Msk                    (0x1UL << CAN_F7R2_FB21_Pos)       /*!< 0x00200000 */\r
+#define CAN_F7R2_FB21                        CAN_F7R2_FB21_Msk                 /*!< Filter bit 21 */\r
+#define CAN_F7R2_FB22_Pos                    (22U)                             \r
+#define CAN_F7R2_FB22_Msk                    (0x1UL << CAN_F7R2_FB22_Pos)       /*!< 0x00400000 */\r
+#define CAN_F7R2_FB22                        CAN_F7R2_FB22_Msk                 /*!< Filter bit 22 */\r
+#define CAN_F7R2_FB23_Pos                    (23U)                             \r
+#define CAN_F7R2_FB23_Msk                    (0x1UL << CAN_F7R2_FB23_Pos)       /*!< 0x00800000 */\r
+#define CAN_F7R2_FB23                        CAN_F7R2_FB23_Msk                 /*!< Filter bit 23 */\r
+#define CAN_F7R2_FB24_Pos                    (24U)                             \r
+#define CAN_F7R2_FB24_Msk                    (0x1UL << CAN_F7R2_FB24_Pos)       /*!< 0x01000000 */\r
+#define CAN_F7R2_FB24                        CAN_F7R2_FB24_Msk                 /*!< Filter bit 24 */\r
+#define CAN_F7R2_FB25_Pos                    (25U)                             \r
+#define CAN_F7R2_FB25_Msk                    (0x1UL << CAN_F7R2_FB25_Pos)       /*!< 0x02000000 */\r
+#define CAN_F7R2_FB25                        CAN_F7R2_FB25_Msk                 /*!< Filter bit 25 */\r
+#define CAN_F7R2_FB26_Pos                    (26U)                             \r
+#define CAN_F7R2_FB26_Msk                    (0x1UL << CAN_F7R2_FB26_Pos)       /*!< 0x04000000 */\r
+#define CAN_F7R2_FB26                        CAN_F7R2_FB26_Msk                 /*!< Filter bit 26 */\r
+#define CAN_F7R2_FB27_Pos                    (27U)                             \r
+#define CAN_F7R2_FB27_Msk                    (0x1UL << CAN_F7R2_FB27_Pos)       /*!< 0x08000000 */\r
+#define CAN_F7R2_FB27                        CAN_F7R2_FB27_Msk                 /*!< Filter bit 27 */\r
+#define CAN_F7R2_FB28_Pos                    (28U)                             \r
+#define CAN_F7R2_FB28_Msk                    (0x1UL << CAN_F7R2_FB28_Pos)       /*!< 0x10000000 */\r
+#define CAN_F7R2_FB28                        CAN_F7R2_FB28_Msk                 /*!< Filter bit 28 */\r
+#define CAN_F7R2_FB29_Pos                    (29U)                             \r
+#define CAN_F7R2_FB29_Msk                    (0x1UL << CAN_F7R2_FB29_Pos)       /*!< 0x20000000 */\r
+#define CAN_F7R2_FB29                        CAN_F7R2_FB29_Msk                 /*!< Filter bit 29 */\r
+#define CAN_F7R2_FB30_Pos                    (30U)                             \r
+#define CAN_F7R2_FB30_Msk                    (0x1UL << CAN_F7R2_FB30_Pos)       /*!< 0x40000000 */\r
+#define CAN_F7R2_FB30                        CAN_F7R2_FB30_Msk                 /*!< Filter bit 30 */\r
+#define CAN_F7R2_FB31_Pos                    (31U)                             \r
+#define CAN_F7R2_FB31_Msk                    (0x1UL << CAN_F7R2_FB31_Pos)       /*!< 0x80000000 */\r
+#define CAN_F7R2_FB31                        CAN_F7R2_FB31_Msk                 /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F8R2 register  *******************/\r
+#define CAN_F8R2_FB0_Pos                     (0U)                              \r
+#define CAN_F8R2_FB0_Msk                     (0x1UL << CAN_F8R2_FB0_Pos)        /*!< 0x00000001 */\r
+#define CAN_F8R2_FB0                         CAN_F8R2_FB0_Msk                  /*!< Filter bit 0 */\r
+#define CAN_F8R2_FB1_Pos                     (1U)                              \r
+#define CAN_F8R2_FB1_Msk                     (0x1UL << CAN_F8R2_FB1_Pos)        /*!< 0x00000002 */\r
+#define CAN_F8R2_FB1                         CAN_F8R2_FB1_Msk                  /*!< Filter bit 1 */\r
+#define CAN_F8R2_FB2_Pos                     (2U)                              \r
+#define CAN_F8R2_FB2_Msk                     (0x1UL << CAN_F8R2_FB2_Pos)        /*!< 0x00000004 */\r
+#define CAN_F8R2_FB2                         CAN_F8R2_FB2_Msk                  /*!< Filter bit 2 */\r
+#define CAN_F8R2_FB3_Pos                     (3U)                              \r
+#define CAN_F8R2_FB3_Msk                     (0x1UL << CAN_F8R2_FB3_Pos)        /*!< 0x00000008 */\r
+#define CAN_F8R2_FB3                         CAN_F8R2_FB3_Msk                  /*!< Filter bit 3 */\r
+#define CAN_F8R2_FB4_Pos                     (4U)                              \r
+#define CAN_F8R2_FB4_Msk                     (0x1UL << CAN_F8R2_FB4_Pos)        /*!< 0x00000010 */\r
+#define CAN_F8R2_FB4                         CAN_F8R2_FB4_Msk                  /*!< Filter bit 4 */\r
+#define CAN_F8R2_FB5_Pos                     (5U)                              \r
+#define CAN_F8R2_FB5_Msk                     (0x1UL << CAN_F8R2_FB5_Pos)        /*!< 0x00000020 */\r
+#define CAN_F8R2_FB5                         CAN_F8R2_FB5_Msk                  /*!< Filter bit 5 */\r
+#define CAN_F8R2_FB6_Pos                     (6U)                              \r
+#define CAN_F8R2_FB6_Msk                     (0x1UL << CAN_F8R2_FB6_Pos)        /*!< 0x00000040 */\r
+#define CAN_F8R2_FB6                         CAN_F8R2_FB6_Msk                  /*!< Filter bit 6 */\r
+#define CAN_F8R2_FB7_Pos                     (7U)                              \r
+#define CAN_F8R2_FB7_Msk                     (0x1UL << CAN_F8R2_FB7_Pos)        /*!< 0x00000080 */\r
+#define CAN_F8R2_FB7                         CAN_F8R2_FB7_Msk                  /*!< Filter bit 7 */\r
+#define CAN_F8R2_FB8_Pos                     (8U)                              \r
+#define CAN_F8R2_FB8_Msk                     (0x1UL << CAN_F8R2_FB8_Pos)        /*!< 0x00000100 */\r
+#define CAN_F8R2_FB8                         CAN_F8R2_FB8_Msk                  /*!< Filter bit 8 */\r
+#define CAN_F8R2_FB9_Pos                     (9U)                              \r
+#define CAN_F8R2_FB9_Msk                     (0x1UL << CAN_F8R2_FB9_Pos)        /*!< 0x00000200 */\r
+#define CAN_F8R2_FB9                         CAN_F8R2_FB9_Msk                  /*!< Filter bit 9 */\r
+#define CAN_F8R2_FB10_Pos                    (10U)                             \r
+#define CAN_F8R2_FB10_Msk                    (0x1UL << CAN_F8R2_FB10_Pos)       /*!< 0x00000400 */\r
+#define CAN_F8R2_FB10                        CAN_F8R2_FB10_Msk                 /*!< Filter bit 10 */\r
+#define CAN_F8R2_FB11_Pos                    (11U)                             \r
+#define CAN_F8R2_FB11_Msk                    (0x1UL << CAN_F8R2_FB11_Pos)       /*!< 0x00000800 */\r
+#define CAN_F8R2_FB11                        CAN_F8R2_FB11_Msk                 /*!< Filter bit 11 */\r
+#define CAN_F8R2_FB12_Pos                    (12U)                             \r
+#define CAN_F8R2_FB12_Msk                    (0x1UL << CAN_F8R2_FB12_Pos)       /*!< 0x00001000 */\r
+#define CAN_F8R2_FB12                        CAN_F8R2_FB12_Msk                 /*!< Filter bit 12 */\r
+#define CAN_F8R2_FB13_Pos                    (13U)                             \r
+#define CAN_F8R2_FB13_Msk                    (0x1UL << CAN_F8R2_FB13_Pos)       /*!< 0x00002000 */\r
+#define CAN_F8R2_FB13                        CAN_F8R2_FB13_Msk                 /*!< Filter bit 13 */\r
+#define CAN_F8R2_FB14_Pos                    (14U)                             \r
+#define CAN_F8R2_FB14_Msk                    (0x1UL << CAN_F8R2_FB14_Pos)       /*!< 0x00004000 */\r
+#define CAN_F8R2_FB14                        CAN_F8R2_FB14_Msk                 /*!< Filter bit 14 */\r
+#define CAN_F8R2_FB15_Pos                    (15U)                             \r
+#define CAN_F8R2_FB15_Msk                    (0x1UL << CAN_F8R2_FB15_Pos)       /*!< 0x00008000 */\r
+#define CAN_F8R2_FB15                        CAN_F8R2_FB15_Msk                 /*!< Filter bit 15 */\r
+#define CAN_F8R2_FB16_Pos                    (16U)                             \r
+#define CAN_F8R2_FB16_Msk                    (0x1UL << CAN_F8R2_FB16_Pos)       /*!< 0x00010000 */\r
+#define CAN_F8R2_FB16                        CAN_F8R2_FB16_Msk                 /*!< Filter bit 16 */\r
+#define CAN_F8R2_FB17_Pos                    (17U)                             \r
+#define CAN_F8R2_FB17_Msk                    (0x1UL << CAN_F8R2_FB17_Pos)       /*!< 0x00020000 */\r
+#define CAN_F8R2_FB17                        CAN_F8R2_FB17_Msk                 /*!< Filter bit 17 */\r
+#define CAN_F8R2_FB18_Pos                    (18U)                             \r
+#define CAN_F8R2_FB18_Msk                    (0x1UL << CAN_F8R2_FB18_Pos)       /*!< 0x00040000 */\r
+#define CAN_F8R2_FB18                        CAN_F8R2_FB18_Msk                 /*!< Filter bit 18 */\r
+#define CAN_F8R2_FB19_Pos                    (19U)                             \r
+#define CAN_F8R2_FB19_Msk                    (0x1UL << CAN_F8R2_FB19_Pos)       /*!< 0x00080000 */\r
+#define CAN_F8R2_FB19                        CAN_F8R2_FB19_Msk                 /*!< Filter bit 19 */\r
+#define CAN_F8R2_FB20_Pos                    (20U)                             \r
+#define CAN_F8R2_FB20_Msk                    (0x1UL << CAN_F8R2_FB20_Pos)       /*!< 0x00100000 */\r
+#define CAN_F8R2_FB20                        CAN_F8R2_FB20_Msk                 /*!< Filter bit 20 */\r
+#define CAN_F8R2_FB21_Pos                    (21U)                             \r
+#define CAN_F8R2_FB21_Msk                    (0x1UL << CAN_F8R2_FB21_Pos)       /*!< 0x00200000 */\r
+#define CAN_F8R2_FB21                        CAN_F8R2_FB21_Msk                 /*!< Filter bit 21 */\r
+#define CAN_F8R2_FB22_Pos                    (22U)                             \r
+#define CAN_F8R2_FB22_Msk                    (0x1UL << CAN_F8R2_FB22_Pos)       /*!< 0x00400000 */\r
+#define CAN_F8R2_FB22                        CAN_F8R2_FB22_Msk                 /*!< Filter bit 22 */\r
+#define CAN_F8R2_FB23_Pos                    (23U)                             \r
+#define CAN_F8R2_FB23_Msk                    (0x1UL << CAN_F8R2_FB23_Pos)       /*!< 0x00800000 */\r
+#define CAN_F8R2_FB23                        CAN_F8R2_FB23_Msk                 /*!< Filter bit 23 */\r
+#define CAN_F8R2_FB24_Pos                    (24U)                             \r
+#define CAN_F8R2_FB24_Msk                    (0x1UL << CAN_F8R2_FB24_Pos)       /*!< 0x01000000 */\r
+#define CAN_F8R2_FB24                        CAN_F8R2_FB24_Msk                 /*!< Filter bit 24 */\r
+#define CAN_F8R2_FB25_Pos                    (25U)                             \r
+#define CAN_F8R2_FB25_Msk                    (0x1UL << CAN_F8R2_FB25_Pos)       /*!< 0x02000000 */\r
+#define CAN_F8R2_FB25                        CAN_F8R2_FB25_Msk                 /*!< Filter bit 25 */\r
+#define CAN_F8R2_FB26_Pos                    (26U)                             \r
+#define CAN_F8R2_FB26_Msk                    (0x1UL << CAN_F8R2_FB26_Pos)       /*!< 0x04000000 */\r
+#define CAN_F8R2_FB26                        CAN_F8R2_FB26_Msk                 /*!< Filter bit 26 */\r
+#define CAN_F8R2_FB27_Pos                    (27U)                             \r
+#define CAN_F8R2_FB27_Msk                    (0x1UL << CAN_F8R2_FB27_Pos)       /*!< 0x08000000 */\r
+#define CAN_F8R2_FB27                        CAN_F8R2_FB27_Msk                 /*!< Filter bit 27 */\r
+#define CAN_F8R2_FB28_Pos                    (28U)                             \r
+#define CAN_F8R2_FB28_Msk                    (0x1UL << CAN_F8R2_FB28_Pos)       /*!< 0x10000000 */\r
+#define CAN_F8R2_FB28                        CAN_F8R2_FB28_Msk                 /*!< Filter bit 28 */\r
+#define CAN_F8R2_FB29_Pos                    (29U)                             \r
+#define CAN_F8R2_FB29_Msk                    (0x1UL << CAN_F8R2_FB29_Pos)       /*!< 0x20000000 */\r
+#define CAN_F8R2_FB29                        CAN_F8R2_FB29_Msk                 /*!< Filter bit 29 */\r
+#define CAN_F8R2_FB30_Pos                    (30U)                             \r
+#define CAN_F8R2_FB30_Msk                    (0x1UL << CAN_F8R2_FB30_Pos)       /*!< 0x40000000 */\r
+#define CAN_F8R2_FB30                        CAN_F8R2_FB30_Msk                 /*!< Filter bit 30 */\r
+#define CAN_F8R2_FB31_Pos                    (31U)                             \r
+#define CAN_F8R2_FB31_Msk                    (0x1UL << CAN_F8R2_FB31_Pos)       /*!< 0x80000000 */\r
+#define CAN_F8R2_FB31                        CAN_F8R2_FB31_Msk                 /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F9R2 register  *******************/\r
+#define CAN_F9R2_FB0_Pos                     (0U)                              \r
+#define CAN_F9R2_FB0_Msk                     (0x1UL << CAN_F9R2_FB0_Pos)        /*!< 0x00000001 */\r
+#define CAN_F9R2_FB0                         CAN_F9R2_FB0_Msk                  /*!< Filter bit 0 */\r
+#define CAN_F9R2_FB1_Pos                     (1U)                              \r
+#define CAN_F9R2_FB1_Msk                     (0x1UL << CAN_F9R2_FB1_Pos)        /*!< 0x00000002 */\r
+#define CAN_F9R2_FB1                         CAN_F9R2_FB1_Msk                  /*!< Filter bit 1 */\r
+#define CAN_F9R2_FB2_Pos                     (2U)                              \r
+#define CAN_F9R2_FB2_Msk                     (0x1UL << CAN_F9R2_FB2_Pos)        /*!< 0x00000004 */\r
+#define CAN_F9R2_FB2                         CAN_F9R2_FB2_Msk                  /*!< Filter bit 2 */\r
+#define CAN_F9R2_FB3_Pos                     (3U)                              \r
+#define CAN_F9R2_FB3_Msk                     (0x1UL << CAN_F9R2_FB3_Pos)        /*!< 0x00000008 */\r
+#define CAN_F9R2_FB3                         CAN_F9R2_FB3_Msk                  /*!< Filter bit 3 */\r
+#define CAN_F9R2_FB4_Pos                     (4U)                              \r
+#define CAN_F9R2_FB4_Msk                     (0x1UL << CAN_F9R2_FB4_Pos)        /*!< 0x00000010 */\r
+#define CAN_F9R2_FB4                         CAN_F9R2_FB4_Msk                  /*!< Filter bit 4 */\r
+#define CAN_F9R2_FB5_Pos                     (5U)                              \r
+#define CAN_F9R2_FB5_Msk                     (0x1UL << CAN_F9R2_FB5_Pos)        /*!< 0x00000020 */\r
+#define CAN_F9R2_FB5                         CAN_F9R2_FB5_Msk                  /*!< Filter bit 5 */\r
+#define CAN_F9R2_FB6_Pos                     (6U)                              \r
+#define CAN_F9R2_FB6_Msk                     (0x1UL << CAN_F9R2_FB6_Pos)        /*!< 0x00000040 */\r
+#define CAN_F9R2_FB6                         CAN_F9R2_FB6_Msk                  /*!< Filter bit 6 */\r
+#define CAN_F9R2_FB7_Pos                     (7U)                              \r
+#define CAN_F9R2_FB7_Msk                     (0x1UL << CAN_F9R2_FB7_Pos)        /*!< 0x00000080 */\r
+#define CAN_F9R2_FB7                         CAN_F9R2_FB7_Msk                  /*!< Filter bit 7 */\r
+#define CAN_F9R2_FB8_Pos                     (8U)                              \r
+#define CAN_F9R2_FB8_Msk                     (0x1UL << CAN_F9R2_FB8_Pos)        /*!< 0x00000100 */\r
+#define CAN_F9R2_FB8                         CAN_F9R2_FB8_Msk                  /*!< Filter bit 8 */\r
+#define CAN_F9R2_FB9_Pos                     (9U)                              \r
+#define CAN_F9R2_FB9_Msk                     (0x1UL << CAN_F9R2_FB9_Pos)        /*!< 0x00000200 */\r
+#define CAN_F9R2_FB9                         CAN_F9R2_FB9_Msk                  /*!< Filter bit 9 */\r
+#define CAN_F9R2_FB10_Pos                    (10U)                             \r
+#define CAN_F9R2_FB10_Msk                    (0x1UL << CAN_F9R2_FB10_Pos)       /*!< 0x00000400 */\r
+#define CAN_F9R2_FB10                        CAN_F9R2_FB10_Msk                 /*!< Filter bit 10 */\r
+#define CAN_F9R2_FB11_Pos                    (11U)                             \r
+#define CAN_F9R2_FB11_Msk                    (0x1UL << CAN_F9R2_FB11_Pos)       /*!< 0x00000800 */\r
+#define CAN_F9R2_FB11                        CAN_F9R2_FB11_Msk                 /*!< Filter bit 11 */\r
+#define CAN_F9R2_FB12_Pos                    (12U)                             \r
+#define CAN_F9R2_FB12_Msk                    (0x1UL << CAN_F9R2_FB12_Pos)       /*!< 0x00001000 */\r
+#define CAN_F9R2_FB12                        CAN_F9R2_FB12_Msk                 /*!< Filter bit 12 */\r
+#define CAN_F9R2_FB13_Pos                    (13U)                             \r
+#define CAN_F9R2_FB13_Msk                    (0x1UL << CAN_F9R2_FB13_Pos)       /*!< 0x00002000 */\r
+#define CAN_F9R2_FB13                        CAN_F9R2_FB13_Msk                 /*!< Filter bit 13 */\r
+#define CAN_F9R2_FB14_Pos                    (14U)                             \r
+#define CAN_F9R2_FB14_Msk                    (0x1UL << CAN_F9R2_FB14_Pos)       /*!< 0x00004000 */\r
+#define CAN_F9R2_FB14                        CAN_F9R2_FB14_Msk                 /*!< Filter bit 14 */\r
+#define CAN_F9R2_FB15_Pos                    (15U)                             \r
+#define CAN_F9R2_FB15_Msk                    (0x1UL << CAN_F9R2_FB15_Pos)       /*!< 0x00008000 */\r
+#define CAN_F9R2_FB15                        CAN_F9R2_FB15_Msk                 /*!< Filter bit 15 */\r
+#define CAN_F9R2_FB16_Pos                    (16U)                             \r
+#define CAN_F9R2_FB16_Msk                    (0x1UL << CAN_F9R2_FB16_Pos)       /*!< 0x00010000 */\r
+#define CAN_F9R2_FB16                        CAN_F9R2_FB16_Msk                 /*!< Filter bit 16 */\r
+#define CAN_F9R2_FB17_Pos                    (17U)                             \r
+#define CAN_F9R2_FB17_Msk                    (0x1UL << CAN_F9R2_FB17_Pos)       /*!< 0x00020000 */\r
+#define CAN_F9R2_FB17                        CAN_F9R2_FB17_Msk                 /*!< Filter bit 17 */\r
+#define CAN_F9R2_FB18_Pos                    (18U)                             \r
+#define CAN_F9R2_FB18_Msk                    (0x1UL << CAN_F9R2_FB18_Pos)       /*!< 0x00040000 */\r
+#define CAN_F9R2_FB18                        CAN_F9R2_FB18_Msk                 /*!< Filter bit 18 */\r
+#define CAN_F9R2_FB19_Pos                    (19U)                             \r
+#define CAN_F9R2_FB19_Msk                    (0x1UL << CAN_F9R2_FB19_Pos)       /*!< 0x00080000 */\r
+#define CAN_F9R2_FB19                        CAN_F9R2_FB19_Msk                 /*!< Filter bit 19 */\r
+#define CAN_F9R2_FB20_Pos                    (20U)                             \r
+#define CAN_F9R2_FB20_Msk                    (0x1UL << CAN_F9R2_FB20_Pos)       /*!< 0x00100000 */\r
+#define CAN_F9R2_FB20                        CAN_F9R2_FB20_Msk                 /*!< Filter bit 20 */\r
+#define CAN_F9R2_FB21_Pos                    (21U)                             \r
+#define CAN_F9R2_FB21_Msk                    (0x1UL << CAN_F9R2_FB21_Pos)       /*!< 0x00200000 */\r
+#define CAN_F9R2_FB21                        CAN_F9R2_FB21_Msk                 /*!< Filter bit 21 */\r
+#define CAN_F9R2_FB22_Pos                    (22U)                             \r
+#define CAN_F9R2_FB22_Msk                    (0x1UL << CAN_F9R2_FB22_Pos)       /*!< 0x00400000 */\r
+#define CAN_F9R2_FB22                        CAN_F9R2_FB22_Msk                 /*!< Filter bit 22 */\r
+#define CAN_F9R2_FB23_Pos                    (23U)                             \r
+#define CAN_F9R2_FB23_Msk                    (0x1UL << CAN_F9R2_FB23_Pos)       /*!< 0x00800000 */\r
+#define CAN_F9R2_FB23                        CAN_F9R2_FB23_Msk                 /*!< Filter bit 23 */\r
+#define CAN_F9R2_FB24_Pos                    (24U)                             \r
+#define CAN_F9R2_FB24_Msk                    (0x1UL << CAN_F9R2_FB24_Pos)       /*!< 0x01000000 */\r
+#define CAN_F9R2_FB24                        CAN_F9R2_FB24_Msk                 /*!< Filter bit 24 */\r
+#define CAN_F9R2_FB25_Pos                    (25U)                             \r
+#define CAN_F9R2_FB25_Msk                    (0x1UL << CAN_F9R2_FB25_Pos)       /*!< 0x02000000 */\r
+#define CAN_F9R2_FB25                        CAN_F9R2_FB25_Msk                 /*!< Filter bit 25 */\r
+#define CAN_F9R2_FB26_Pos                    (26U)                             \r
+#define CAN_F9R2_FB26_Msk                    (0x1UL << CAN_F9R2_FB26_Pos)       /*!< 0x04000000 */\r
+#define CAN_F9R2_FB26                        CAN_F9R2_FB26_Msk                 /*!< Filter bit 26 */\r
+#define CAN_F9R2_FB27_Pos                    (27U)                             \r
+#define CAN_F9R2_FB27_Msk                    (0x1UL << CAN_F9R2_FB27_Pos)       /*!< 0x08000000 */\r
+#define CAN_F9R2_FB27                        CAN_F9R2_FB27_Msk                 /*!< Filter bit 27 */\r
+#define CAN_F9R2_FB28_Pos                    (28U)                             \r
+#define CAN_F9R2_FB28_Msk                    (0x1UL << CAN_F9R2_FB28_Pos)       /*!< 0x10000000 */\r
+#define CAN_F9R2_FB28                        CAN_F9R2_FB28_Msk                 /*!< Filter bit 28 */\r
+#define CAN_F9R2_FB29_Pos                    (29U)                             \r
+#define CAN_F9R2_FB29_Msk                    (0x1UL << CAN_F9R2_FB29_Pos)       /*!< 0x20000000 */\r
+#define CAN_F9R2_FB29                        CAN_F9R2_FB29_Msk                 /*!< Filter bit 29 */\r
+#define CAN_F9R2_FB30_Pos                    (30U)                             \r
+#define CAN_F9R2_FB30_Msk                    (0x1UL << CAN_F9R2_FB30_Pos)       /*!< 0x40000000 */\r
+#define CAN_F9R2_FB30                        CAN_F9R2_FB30_Msk                 /*!< Filter bit 30 */\r
+#define CAN_F9R2_FB31_Pos                    (31U)                             \r
+#define CAN_F9R2_FB31_Msk                    (0x1UL << CAN_F9R2_FB31_Pos)       /*!< 0x80000000 */\r
+#define CAN_F9R2_FB31                        CAN_F9R2_FB31_Msk                 /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F10R2 register  ******************/\r
+#define CAN_F10R2_FB0_Pos                    (0U)                              \r
+#define CAN_F10R2_FB0_Msk                    (0x1UL << CAN_F10R2_FB0_Pos)       /*!< 0x00000001 */\r
+#define CAN_F10R2_FB0                        CAN_F10R2_FB0_Msk                 /*!< Filter bit 0 */\r
+#define CAN_F10R2_FB1_Pos                    (1U)                              \r
+#define CAN_F10R2_FB1_Msk                    (0x1UL << CAN_F10R2_FB1_Pos)       /*!< 0x00000002 */\r
+#define CAN_F10R2_FB1                        CAN_F10R2_FB1_Msk                 /*!< Filter bit 1 */\r
+#define CAN_F10R2_FB2_Pos                    (2U)                              \r
+#define CAN_F10R2_FB2_Msk                    (0x1UL << CAN_F10R2_FB2_Pos)       /*!< 0x00000004 */\r
+#define CAN_F10R2_FB2                        CAN_F10R2_FB2_Msk                 /*!< Filter bit 2 */\r
+#define CAN_F10R2_FB3_Pos                    (3U)                              \r
+#define CAN_F10R2_FB3_Msk                    (0x1UL << CAN_F10R2_FB3_Pos)       /*!< 0x00000008 */\r
+#define CAN_F10R2_FB3                        CAN_F10R2_FB3_Msk                 /*!< Filter bit 3 */\r
+#define CAN_F10R2_FB4_Pos                    (4U)                              \r
+#define CAN_F10R2_FB4_Msk                    (0x1UL << CAN_F10R2_FB4_Pos)       /*!< 0x00000010 */\r
+#define CAN_F10R2_FB4                        CAN_F10R2_FB4_Msk                 /*!< Filter bit 4 */\r
+#define CAN_F10R2_FB5_Pos                    (5U)                              \r
+#define CAN_F10R2_FB5_Msk                    (0x1UL << CAN_F10R2_FB5_Pos)       /*!< 0x00000020 */\r
+#define CAN_F10R2_FB5                        CAN_F10R2_FB5_Msk                 /*!< Filter bit 5 */\r
+#define CAN_F10R2_FB6_Pos                    (6U)                              \r
+#define CAN_F10R2_FB6_Msk                    (0x1UL << CAN_F10R2_FB6_Pos)       /*!< 0x00000040 */\r
+#define CAN_F10R2_FB6                        CAN_F10R2_FB6_Msk                 /*!< Filter bit 6 */\r
+#define CAN_F10R2_FB7_Pos                    (7U)                              \r
+#define CAN_F10R2_FB7_Msk                    (0x1UL << CAN_F10R2_FB7_Pos)       /*!< 0x00000080 */\r
+#define CAN_F10R2_FB7                        CAN_F10R2_FB7_Msk                 /*!< Filter bit 7 */\r
+#define CAN_F10R2_FB8_Pos                    (8U)                              \r
+#define CAN_F10R2_FB8_Msk                    (0x1UL << CAN_F10R2_FB8_Pos)       /*!< 0x00000100 */\r
+#define CAN_F10R2_FB8                        CAN_F10R2_FB8_Msk                 /*!< Filter bit 8 */\r
+#define CAN_F10R2_FB9_Pos                    (9U)                              \r
+#define CAN_F10R2_FB9_Msk                    (0x1UL << CAN_F10R2_FB9_Pos)       /*!< 0x00000200 */\r
+#define CAN_F10R2_FB9                        CAN_F10R2_FB9_Msk                 /*!< Filter bit 9 */\r
+#define CAN_F10R2_FB10_Pos                   (10U)                             \r
+#define CAN_F10R2_FB10_Msk                   (0x1UL << CAN_F10R2_FB10_Pos)      /*!< 0x00000400 */\r
+#define CAN_F10R2_FB10                       CAN_F10R2_FB10_Msk                /*!< Filter bit 10 */\r
+#define CAN_F10R2_FB11_Pos                   (11U)                             \r
+#define CAN_F10R2_FB11_Msk                   (0x1UL << CAN_F10R2_FB11_Pos)      /*!< 0x00000800 */\r
+#define CAN_F10R2_FB11                       CAN_F10R2_FB11_Msk                /*!< Filter bit 11 */\r
+#define CAN_F10R2_FB12_Pos                   (12U)                             \r
+#define CAN_F10R2_FB12_Msk                   (0x1UL << CAN_F10R2_FB12_Pos)      /*!< 0x00001000 */\r
+#define CAN_F10R2_FB12                       CAN_F10R2_FB12_Msk                /*!< Filter bit 12 */\r
+#define CAN_F10R2_FB13_Pos                   (13U)                             \r
+#define CAN_F10R2_FB13_Msk                   (0x1UL << CAN_F10R2_FB13_Pos)      /*!< 0x00002000 */\r
+#define CAN_F10R2_FB13                       CAN_F10R2_FB13_Msk                /*!< Filter bit 13 */\r
+#define CAN_F10R2_FB14_Pos                   (14U)                             \r
+#define CAN_F10R2_FB14_Msk                   (0x1UL << CAN_F10R2_FB14_Pos)      /*!< 0x00004000 */\r
+#define CAN_F10R2_FB14                       CAN_F10R2_FB14_Msk                /*!< Filter bit 14 */\r
+#define CAN_F10R2_FB15_Pos                   (15U)                             \r
+#define CAN_F10R2_FB15_Msk                   (0x1UL << CAN_F10R2_FB15_Pos)      /*!< 0x00008000 */\r
+#define CAN_F10R2_FB15                       CAN_F10R2_FB15_Msk                /*!< Filter bit 15 */\r
+#define CAN_F10R2_FB16_Pos                   (16U)                             \r
+#define CAN_F10R2_FB16_Msk                   (0x1UL << CAN_F10R2_FB16_Pos)      /*!< 0x00010000 */\r
+#define CAN_F10R2_FB16                       CAN_F10R2_FB16_Msk                /*!< Filter bit 16 */\r
+#define CAN_F10R2_FB17_Pos                   (17U)                             \r
+#define CAN_F10R2_FB17_Msk                   (0x1UL << CAN_F10R2_FB17_Pos)      /*!< 0x00020000 */\r
+#define CAN_F10R2_FB17                       CAN_F10R2_FB17_Msk                /*!< Filter bit 17 */\r
+#define CAN_F10R2_FB18_Pos                   (18U)                             \r
+#define CAN_F10R2_FB18_Msk                   (0x1UL << CAN_F10R2_FB18_Pos)      /*!< 0x00040000 */\r
+#define CAN_F10R2_FB18                       CAN_F10R2_FB18_Msk                /*!< Filter bit 18 */\r
+#define CAN_F10R2_FB19_Pos                   (19U)                             \r
+#define CAN_F10R2_FB19_Msk                   (0x1UL << CAN_F10R2_FB19_Pos)      /*!< 0x00080000 */\r
+#define CAN_F10R2_FB19                       CAN_F10R2_FB19_Msk                /*!< Filter bit 19 */\r
+#define CAN_F10R2_FB20_Pos                   (20U)                             \r
+#define CAN_F10R2_FB20_Msk                   (0x1UL << CAN_F10R2_FB20_Pos)      /*!< 0x00100000 */\r
+#define CAN_F10R2_FB20                       CAN_F10R2_FB20_Msk                /*!< Filter bit 20 */\r
+#define CAN_F10R2_FB21_Pos                   (21U)                             \r
+#define CAN_F10R2_FB21_Msk                   (0x1UL << CAN_F10R2_FB21_Pos)      /*!< 0x00200000 */\r
+#define CAN_F10R2_FB21                       CAN_F10R2_FB21_Msk                /*!< Filter bit 21 */\r
+#define CAN_F10R2_FB22_Pos                   (22U)                             \r
+#define CAN_F10R2_FB22_Msk                   (0x1UL << CAN_F10R2_FB22_Pos)      /*!< 0x00400000 */\r
+#define CAN_F10R2_FB22                       CAN_F10R2_FB22_Msk                /*!< Filter bit 22 */\r
+#define CAN_F10R2_FB23_Pos                   (23U)                             \r
+#define CAN_F10R2_FB23_Msk                   (0x1UL << CAN_F10R2_FB23_Pos)      /*!< 0x00800000 */\r
+#define CAN_F10R2_FB23                       CAN_F10R2_FB23_Msk                /*!< Filter bit 23 */\r
+#define CAN_F10R2_FB24_Pos                   (24U)                             \r
+#define CAN_F10R2_FB24_Msk                   (0x1UL << CAN_F10R2_FB24_Pos)      /*!< 0x01000000 */\r
+#define CAN_F10R2_FB24                       CAN_F10R2_FB24_Msk                /*!< Filter bit 24 */\r
+#define CAN_F10R2_FB25_Pos                   (25U)                             \r
+#define CAN_F10R2_FB25_Msk                   (0x1UL << CAN_F10R2_FB25_Pos)      /*!< 0x02000000 */\r
+#define CAN_F10R2_FB25                       CAN_F10R2_FB25_Msk                /*!< Filter bit 25 */\r
+#define CAN_F10R2_FB26_Pos                   (26U)                             \r
+#define CAN_F10R2_FB26_Msk                   (0x1UL << CAN_F10R2_FB26_Pos)      /*!< 0x04000000 */\r
+#define CAN_F10R2_FB26                       CAN_F10R2_FB26_Msk                /*!< Filter bit 26 */\r
+#define CAN_F10R2_FB27_Pos                   (27U)                             \r
+#define CAN_F10R2_FB27_Msk                   (0x1UL << CAN_F10R2_FB27_Pos)      /*!< 0x08000000 */\r
+#define CAN_F10R2_FB27                       CAN_F10R2_FB27_Msk                /*!< Filter bit 27 */\r
+#define CAN_F10R2_FB28_Pos                   (28U)                             \r
+#define CAN_F10R2_FB28_Msk                   (0x1UL << CAN_F10R2_FB28_Pos)      /*!< 0x10000000 */\r
+#define CAN_F10R2_FB28                       CAN_F10R2_FB28_Msk                /*!< Filter bit 28 */\r
+#define CAN_F10R2_FB29_Pos                   (29U)                             \r
+#define CAN_F10R2_FB29_Msk                   (0x1UL << CAN_F10R2_FB29_Pos)      /*!< 0x20000000 */\r
+#define CAN_F10R2_FB29                       CAN_F10R2_FB29_Msk                /*!< Filter bit 29 */\r
+#define CAN_F10R2_FB30_Pos                   (30U)                             \r
+#define CAN_F10R2_FB30_Msk                   (0x1UL << CAN_F10R2_FB30_Pos)      /*!< 0x40000000 */\r
+#define CAN_F10R2_FB30                       CAN_F10R2_FB30_Msk                /*!< Filter bit 30 */\r
+#define CAN_F10R2_FB31_Pos                   (31U)                             \r
+#define CAN_F10R2_FB31_Msk                   (0x1UL << CAN_F10R2_FB31_Pos)      /*!< 0x80000000 */\r
+#define CAN_F10R2_FB31                       CAN_F10R2_FB31_Msk                /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F11R2 register  ******************/\r
+#define CAN_F11R2_FB0_Pos                    (0U)                              \r
+#define CAN_F11R2_FB0_Msk                    (0x1UL << CAN_F11R2_FB0_Pos)       /*!< 0x00000001 */\r
+#define CAN_F11R2_FB0                        CAN_F11R2_FB0_Msk                 /*!< Filter bit 0 */\r
+#define CAN_F11R2_FB1_Pos                    (1U)                              \r
+#define CAN_F11R2_FB1_Msk                    (0x1UL << CAN_F11R2_FB1_Pos)       /*!< 0x00000002 */\r
+#define CAN_F11R2_FB1                        CAN_F11R2_FB1_Msk                 /*!< Filter bit 1 */\r
+#define CAN_F11R2_FB2_Pos                    (2U)                              \r
+#define CAN_F11R2_FB2_Msk                    (0x1UL << CAN_F11R2_FB2_Pos)       /*!< 0x00000004 */\r
+#define CAN_F11R2_FB2                        CAN_F11R2_FB2_Msk                 /*!< Filter bit 2 */\r
+#define CAN_F11R2_FB3_Pos                    (3U)                              \r
+#define CAN_F11R2_FB3_Msk                    (0x1UL << CAN_F11R2_FB3_Pos)       /*!< 0x00000008 */\r
+#define CAN_F11R2_FB3                        CAN_F11R2_FB3_Msk                 /*!< Filter bit 3 */\r
+#define CAN_F11R2_FB4_Pos                    (4U)                              \r
+#define CAN_F11R2_FB4_Msk                    (0x1UL << CAN_F11R2_FB4_Pos)       /*!< 0x00000010 */\r
+#define CAN_F11R2_FB4                        CAN_F11R2_FB4_Msk                 /*!< Filter bit 4 */\r
+#define CAN_F11R2_FB5_Pos                    (5U)                              \r
+#define CAN_F11R2_FB5_Msk                    (0x1UL << CAN_F11R2_FB5_Pos)       /*!< 0x00000020 */\r
+#define CAN_F11R2_FB5                        CAN_F11R2_FB5_Msk                 /*!< Filter bit 5 */\r
+#define CAN_F11R2_FB6_Pos                    (6U)                              \r
+#define CAN_F11R2_FB6_Msk                    (0x1UL << CAN_F11R2_FB6_Pos)       /*!< 0x00000040 */\r
+#define CAN_F11R2_FB6                        CAN_F11R2_FB6_Msk                 /*!< Filter bit 6 */\r
+#define CAN_F11R2_FB7_Pos                    (7U)                              \r
+#define CAN_F11R2_FB7_Msk                    (0x1UL << CAN_F11R2_FB7_Pos)       /*!< 0x00000080 */\r
+#define CAN_F11R2_FB7                        CAN_F11R2_FB7_Msk                 /*!< Filter bit 7 */\r
+#define CAN_F11R2_FB8_Pos                    (8U)                              \r
+#define CAN_F11R2_FB8_Msk                    (0x1UL << CAN_F11R2_FB8_Pos)       /*!< 0x00000100 */\r
+#define CAN_F11R2_FB8                        CAN_F11R2_FB8_Msk                 /*!< Filter bit 8 */\r
+#define CAN_F11R2_FB9_Pos                    (9U)                              \r
+#define CAN_F11R2_FB9_Msk                    (0x1UL << CAN_F11R2_FB9_Pos)       /*!< 0x00000200 */\r
+#define CAN_F11R2_FB9                        CAN_F11R2_FB9_Msk                 /*!< Filter bit 9 */\r
+#define CAN_F11R2_FB10_Pos                   (10U)                             \r
+#define CAN_F11R2_FB10_Msk                   (0x1UL << CAN_F11R2_FB10_Pos)      /*!< 0x00000400 */\r
+#define CAN_F11R2_FB10                       CAN_F11R2_FB10_Msk                /*!< Filter bit 10 */\r
+#define CAN_F11R2_FB11_Pos                   (11U)                             \r
+#define CAN_F11R2_FB11_Msk                   (0x1UL << CAN_F11R2_FB11_Pos)      /*!< 0x00000800 */\r
+#define CAN_F11R2_FB11                       CAN_F11R2_FB11_Msk                /*!< Filter bit 11 */\r
+#define CAN_F11R2_FB12_Pos                   (12U)                             \r
+#define CAN_F11R2_FB12_Msk                   (0x1UL << CAN_F11R2_FB12_Pos)      /*!< 0x00001000 */\r
+#define CAN_F11R2_FB12                       CAN_F11R2_FB12_Msk                /*!< Filter bit 12 */\r
+#define CAN_F11R2_FB13_Pos                   (13U)                             \r
+#define CAN_F11R2_FB13_Msk                   (0x1UL << CAN_F11R2_FB13_Pos)      /*!< 0x00002000 */\r
+#define CAN_F11R2_FB13                       CAN_F11R2_FB13_Msk                /*!< Filter bit 13 */\r
+#define CAN_F11R2_FB14_Pos                   (14U)                             \r
+#define CAN_F11R2_FB14_Msk                   (0x1UL << CAN_F11R2_FB14_Pos)      /*!< 0x00004000 */\r
+#define CAN_F11R2_FB14                       CAN_F11R2_FB14_Msk                /*!< Filter bit 14 */\r
+#define CAN_F11R2_FB15_Pos                   (15U)                             \r
+#define CAN_F11R2_FB15_Msk                   (0x1UL << CAN_F11R2_FB15_Pos)      /*!< 0x00008000 */\r
+#define CAN_F11R2_FB15                       CAN_F11R2_FB15_Msk                /*!< Filter bit 15 */\r
+#define CAN_F11R2_FB16_Pos                   (16U)                             \r
+#define CAN_F11R2_FB16_Msk                   (0x1UL << CAN_F11R2_FB16_Pos)      /*!< 0x00010000 */\r
+#define CAN_F11R2_FB16                       CAN_F11R2_FB16_Msk                /*!< Filter bit 16 */\r
+#define CAN_F11R2_FB17_Pos                   (17U)                             \r
+#define CAN_F11R2_FB17_Msk                   (0x1UL << CAN_F11R2_FB17_Pos)      /*!< 0x00020000 */\r
+#define CAN_F11R2_FB17                       CAN_F11R2_FB17_Msk                /*!< Filter bit 17 */\r
+#define CAN_F11R2_FB18_Pos                   (18U)                             \r
+#define CAN_F11R2_FB18_Msk                   (0x1UL << CAN_F11R2_FB18_Pos)      /*!< 0x00040000 */\r
+#define CAN_F11R2_FB18                       CAN_F11R2_FB18_Msk                /*!< Filter bit 18 */\r
+#define CAN_F11R2_FB19_Pos                   (19U)                             \r
+#define CAN_F11R2_FB19_Msk                   (0x1UL << CAN_F11R2_FB19_Pos)      /*!< 0x00080000 */\r
+#define CAN_F11R2_FB19                       CAN_F11R2_FB19_Msk                /*!< Filter bit 19 */\r
+#define CAN_F11R2_FB20_Pos                   (20U)                             \r
+#define CAN_F11R2_FB20_Msk                   (0x1UL << CAN_F11R2_FB20_Pos)      /*!< 0x00100000 */\r
+#define CAN_F11R2_FB20                       CAN_F11R2_FB20_Msk                /*!< Filter bit 20 */\r
+#define CAN_F11R2_FB21_Pos                   (21U)                             \r
+#define CAN_F11R2_FB21_Msk                   (0x1UL << CAN_F11R2_FB21_Pos)      /*!< 0x00200000 */\r
+#define CAN_F11R2_FB21                       CAN_F11R2_FB21_Msk                /*!< Filter bit 21 */\r
+#define CAN_F11R2_FB22_Pos                   (22U)                             \r
+#define CAN_F11R2_FB22_Msk                   (0x1UL << CAN_F11R2_FB22_Pos)      /*!< 0x00400000 */\r
+#define CAN_F11R2_FB22                       CAN_F11R2_FB22_Msk                /*!< Filter bit 22 */\r
+#define CAN_F11R2_FB23_Pos                   (23U)                             \r
+#define CAN_F11R2_FB23_Msk                   (0x1UL << CAN_F11R2_FB23_Pos)      /*!< 0x00800000 */\r
+#define CAN_F11R2_FB23                       CAN_F11R2_FB23_Msk                /*!< Filter bit 23 */\r
+#define CAN_F11R2_FB24_Pos                   (24U)                             \r
+#define CAN_F11R2_FB24_Msk                   (0x1UL << CAN_F11R2_FB24_Pos)      /*!< 0x01000000 */\r
+#define CAN_F11R2_FB24                       CAN_F11R2_FB24_Msk                /*!< Filter bit 24 */\r
+#define CAN_F11R2_FB25_Pos                   (25U)                             \r
+#define CAN_F11R2_FB25_Msk                   (0x1UL << CAN_F11R2_FB25_Pos)      /*!< 0x02000000 */\r
+#define CAN_F11R2_FB25                       CAN_F11R2_FB25_Msk                /*!< Filter bit 25 */\r
+#define CAN_F11R2_FB26_Pos                   (26U)                             \r
+#define CAN_F11R2_FB26_Msk                   (0x1UL << CAN_F11R2_FB26_Pos)      /*!< 0x04000000 */\r
+#define CAN_F11R2_FB26                       CAN_F11R2_FB26_Msk                /*!< Filter bit 26 */\r
+#define CAN_F11R2_FB27_Pos                   (27U)                             \r
+#define CAN_F11R2_FB27_Msk                   (0x1UL << CAN_F11R2_FB27_Pos)      /*!< 0x08000000 */\r
+#define CAN_F11R2_FB27                       CAN_F11R2_FB27_Msk                /*!< Filter bit 27 */\r
+#define CAN_F11R2_FB28_Pos                   (28U)                             \r
+#define CAN_F11R2_FB28_Msk                   (0x1UL << CAN_F11R2_FB28_Pos)      /*!< 0x10000000 */\r
+#define CAN_F11R2_FB28                       CAN_F11R2_FB28_Msk                /*!< Filter bit 28 */\r
+#define CAN_F11R2_FB29_Pos                   (29U)                             \r
+#define CAN_F11R2_FB29_Msk                   (0x1UL << CAN_F11R2_FB29_Pos)      /*!< 0x20000000 */\r
+#define CAN_F11R2_FB29                       CAN_F11R2_FB29_Msk                /*!< Filter bit 29 */\r
+#define CAN_F11R2_FB30_Pos                   (30U)                             \r
+#define CAN_F11R2_FB30_Msk                   (0x1UL << CAN_F11R2_FB30_Pos)      /*!< 0x40000000 */\r
+#define CAN_F11R2_FB30                       CAN_F11R2_FB30_Msk                /*!< Filter bit 30 */\r
+#define CAN_F11R2_FB31_Pos                   (31U)                             \r
+#define CAN_F11R2_FB31_Msk                   (0x1UL << CAN_F11R2_FB31_Pos)      /*!< 0x80000000 */\r
+#define CAN_F11R2_FB31                       CAN_F11R2_FB31_Msk                /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F12R2 register  ******************/\r
+#define CAN_F12R2_FB0_Pos                    (0U)                              \r
+#define CAN_F12R2_FB0_Msk                    (0x1UL << CAN_F12R2_FB0_Pos)       /*!< 0x00000001 */\r
+#define CAN_F12R2_FB0                        CAN_F12R2_FB0_Msk                 /*!< Filter bit 0 */\r
+#define CAN_F12R2_FB1_Pos                    (1U)                              \r
+#define CAN_F12R2_FB1_Msk                    (0x1UL << CAN_F12R2_FB1_Pos)       /*!< 0x00000002 */\r
+#define CAN_F12R2_FB1                        CAN_F12R2_FB1_Msk                 /*!< Filter bit 1 */\r
+#define CAN_F12R2_FB2_Pos                    (2U)                              \r
+#define CAN_F12R2_FB2_Msk                    (0x1UL << CAN_F12R2_FB2_Pos)       /*!< 0x00000004 */\r
+#define CAN_F12R2_FB2                        CAN_F12R2_FB2_Msk                 /*!< Filter bit 2 */\r
+#define CAN_F12R2_FB3_Pos                    (3U)                              \r
+#define CAN_F12R2_FB3_Msk                    (0x1UL << CAN_F12R2_FB3_Pos)       /*!< 0x00000008 */\r
+#define CAN_F12R2_FB3                        CAN_F12R2_FB3_Msk                 /*!< Filter bit 3 */\r
+#define CAN_F12R2_FB4_Pos                    (4U)                              \r
+#define CAN_F12R2_FB4_Msk                    (0x1UL << CAN_F12R2_FB4_Pos)       /*!< 0x00000010 */\r
+#define CAN_F12R2_FB4                        CAN_F12R2_FB4_Msk                 /*!< Filter bit 4 */\r
+#define CAN_F12R2_FB5_Pos                    (5U)                              \r
+#define CAN_F12R2_FB5_Msk                    (0x1UL << CAN_F12R2_FB5_Pos)       /*!< 0x00000020 */\r
+#define CAN_F12R2_FB5                        CAN_F12R2_FB5_Msk                 /*!< Filter bit 5 */\r
+#define CAN_F12R2_FB6_Pos                    (6U)                              \r
+#define CAN_F12R2_FB6_Msk                    (0x1UL << CAN_F12R2_FB6_Pos)       /*!< 0x00000040 */\r
+#define CAN_F12R2_FB6                        CAN_F12R2_FB6_Msk                 /*!< Filter bit 6 */\r
+#define CAN_F12R2_FB7_Pos                    (7U)                              \r
+#define CAN_F12R2_FB7_Msk                    (0x1UL << CAN_F12R2_FB7_Pos)       /*!< 0x00000080 */\r
+#define CAN_F12R2_FB7                        CAN_F12R2_FB7_Msk                 /*!< Filter bit 7 */\r
+#define CAN_F12R2_FB8_Pos                    (8U)                              \r
+#define CAN_F12R2_FB8_Msk                    (0x1UL << CAN_F12R2_FB8_Pos)       /*!< 0x00000100 */\r
+#define CAN_F12R2_FB8                        CAN_F12R2_FB8_Msk                 /*!< Filter bit 8 */\r
+#define CAN_F12R2_FB9_Pos                    (9U)                              \r
+#define CAN_F12R2_FB9_Msk                    (0x1UL << CAN_F12R2_FB9_Pos)       /*!< 0x00000200 */\r
+#define CAN_F12R2_FB9                        CAN_F12R2_FB9_Msk                 /*!< Filter bit 9 */\r
+#define CAN_F12R2_FB10_Pos                   (10U)                             \r
+#define CAN_F12R2_FB10_Msk                   (0x1UL << CAN_F12R2_FB10_Pos)      /*!< 0x00000400 */\r
+#define CAN_F12R2_FB10                       CAN_F12R2_FB10_Msk                /*!< Filter bit 10 */\r
+#define CAN_F12R2_FB11_Pos                   (11U)                             \r
+#define CAN_F12R2_FB11_Msk                   (0x1UL << CAN_F12R2_FB11_Pos)      /*!< 0x00000800 */\r
+#define CAN_F12R2_FB11                       CAN_F12R2_FB11_Msk                /*!< Filter bit 11 */\r
+#define CAN_F12R2_FB12_Pos                   (12U)                             \r
+#define CAN_F12R2_FB12_Msk                   (0x1UL << CAN_F12R2_FB12_Pos)      /*!< 0x00001000 */\r
+#define CAN_F12R2_FB12                       CAN_F12R2_FB12_Msk                /*!< Filter bit 12 */\r
+#define CAN_F12R2_FB13_Pos                   (13U)                             \r
+#define CAN_F12R2_FB13_Msk                   (0x1UL << CAN_F12R2_FB13_Pos)      /*!< 0x00002000 */\r
+#define CAN_F12R2_FB13                       CAN_F12R2_FB13_Msk                /*!< Filter bit 13 */\r
+#define CAN_F12R2_FB14_Pos                   (14U)                             \r
+#define CAN_F12R2_FB14_Msk                   (0x1UL << CAN_F12R2_FB14_Pos)      /*!< 0x00004000 */\r
+#define CAN_F12R2_FB14                       CAN_F12R2_FB14_Msk                /*!< Filter bit 14 */\r
+#define CAN_F12R2_FB15_Pos                   (15U)                             \r
+#define CAN_F12R2_FB15_Msk                   (0x1UL << CAN_F12R2_FB15_Pos)      /*!< 0x00008000 */\r
+#define CAN_F12R2_FB15                       CAN_F12R2_FB15_Msk                /*!< Filter bit 15 */\r
+#define CAN_F12R2_FB16_Pos                   (16U)                             \r
+#define CAN_F12R2_FB16_Msk                   (0x1UL << CAN_F12R2_FB16_Pos)      /*!< 0x00010000 */\r
+#define CAN_F12R2_FB16                       CAN_F12R2_FB16_Msk                /*!< Filter bit 16 */\r
+#define CAN_F12R2_FB17_Pos                   (17U)                             \r
+#define CAN_F12R2_FB17_Msk                   (0x1UL << CAN_F12R2_FB17_Pos)      /*!< 0x00020000 */\r
+#define CAN_F12R2_FB17                       CAN_F12R2_FB17_Msk                /*!< Filter bit 17 */\r
+#define CAN_F12R2_FB18_Pos                   (18U)                             \r
+#define CAN_F12R2_FB18_Msk                   (0x1UL << CAN_F12R2_FB18_Pos)      /*!< 0x00040000 */\r
+#define CAN_F12R2_FB18                       CAN_F12R2_FB18_Msk                /*!< Filter bit 18 */\r
+#define CAN_F12R2_FB19_Pos                   (19U)                             \r
+#define CAN_F12R2_FB19_Msk                   (0x1UL << CAN_F12R2_FB19_Pos)      /*!< 0x00080000 */\r
+#define CAN_F12R2_FB19                       CAN_F12R2_FB19_Msk                /*!< Filter bit 19 */\r
+#define CAN_F12R2_FB20_Pos                   (20U)                             \r
+#define CAN_F12R2_FB20_Msk                   (0x1UL << CAN_F12R2_FB20_Pos)      /*!< 0x00100000 */\r
+#define CAN_F12R2_FB20                       CAN_F12R2_FB20_Msk                /*!< Filter bit 20 */\r
+#define CAN_F12R2_FB21_Pos                   (21U)                             \r
+#define CAN_F12R2_FB21_Msk                   (0x1UL << CAN_F12R2_FB21_Pos)      /*!< 0x00200000 */\r
+#define CAN_F12R2_FB21                       CAN_F12R2_FB21_Msk                /*!< Filter bit 21 */\r
+#define CAN_F12R2_FB22_Pos                   (22U)                             \r
+#define CAN_F12R2_FB22_Msk                   (0x1UL << CAN_F12R2_FB22_Pos)      /*!< 0x00400000 */\r
+#define CAN_F12R2_FB22                       CAN_F12R2_FB22_Msk                /*!< Filter bit 22 */\r
+#define CAN_F12R2_FB23_Pos                   (23U)                             \r
+#define CAN_F12R2_FB23_Msk                   (0x1UL << CAN_F12R2_FB23_Pos)      /*!< 0x00800000 */\r
+#define CAN_F12R2_FB23                       CAN_F12R2_FB23_Msk                /*!< Filter bit 23 */\r
+#define CAN_F12R2_FB24_Pos                   (24U)                             \r
+#define CAN_F12R2_FB24_Msk                   (0x1UL << CAN_F12R2_FB24_Pos)      /*!< 0x01000000 */\r
+#define CAN_F12R2_FB24                       CAN_F12R2_FB24_Msk                /*!< Filter bit 24 */\r
+#define CAN_F12R2_FB25_Pos                   (25U)                             \r
+#define CAN_F12R2_FB25_Msk                   (0x1UL << CAN_F12R2_FB25_Pos)      /*!< 0x02000000 */\r
+#define CAN_F12R2_FB25                       CAN_F12R2_FB25_Msk                /*!< Filter bit 25 */\r
+#define CAN_F12R2_FB26_Pos                   (26U)                             \r
+#define CAN_F12R2_FB26_Msk                   (0x1UL << CAN_F12R2_FB26_Pos)      /*!< 0x04000000 */\r
+#define CAN_F12R2_FB26                       CAN_F12R2_FB26_Msk                /*!< Filter bit 26 */\r
+#define CAN_F12R2_FB27_Pos                   (27U)                             \r
+#define CAN_F12R2_FB27_Msk                   (0x1UL << CAN_F12R2_FB27_Pos)      /*!< 0x08000000 */\r
+#define CAN_F12R2_FB27                       CAN_F12R2_FB27_Msk                /*!< Filter bit 27 */\r
+#define CAN_F12R2_FB28_Pos                   (28U)                             \r
+#define CAN_F12R2_FB28_Msk                   (0x1UL << CAN_F12R2_FB28_Pos)      /*!< 0x10000000 */\r
+#define CAN_F12R2_FB28                       CAN_F12R2_FB28_Msk                /*!< Filter bit 28 */\r
+#define CAN_F12R2_FB29_Pos                   (29U)                             \r
+#define CAN_F12R2_FB29_Msk                   (0x1UL << CAN_F12R2_FB29_Pos)      /*!< 0x20000000 */\r
+#define CAN_F12R2_FB29                       CAN_F12R2_FB29_Msk                /*!< Filter bit 29 */\r
+#define CAN_F12R2_FB30_Pos                   (30U)                             \r
+#define CAN_F12R2_FB30_Msk                   (0x1UL << CAN_F12R2_FB30_Pos)      /*!< 0x40000000 */\r
+#define CAN_F12R2_FB30                       CAN_F12R2_FB30_Msk                /*!< Filter bit 30 */\r
+#define CAN_F12R2_FB31_Pos                   (31U)                             \r
+#define CAN_F12R2_FB31_Msk                   (0x1UL << CAN_F12R2_FB31_Pos)      /*!< 0x80000000 */\r
+#define CAN_F12R2_FB31                       CAN_F12R2_FB31_Msk                /*!< Filter bit 31 */\r
+\r
+/*******************  Bit definition for CAN_F13R2 register  ******************/\r
+#define CAN_F13R2_FB0_Pos                    (0U)                              \r
+#define CAN_F13R2_FB0_Msk                    (0x1UL << CAN_F13R2_FB0_Pos)       /*!< 0x00000001 */\r
+#define CAN_F13R2_FB0                        CAN_F13R2_FB0_Msk                 /*!< Filter bit 0 */\r
+#define CAN_F13R2_FB1_Pos                    (1U)                              \r
+#define CAN_F13R2_FB1_Msk                    (0x1UL << CAN_F13R2_FB1_Pos)       /*!< 0x00000002 */\r
+#define CAN_F13R2_FB1                        CAN_F13R2_FB1_Msk                 /*!< Filter bit 1 */\r
+#define CAN_F13R2_FB2_Pos                    (2U)                              \r
+#define CAN_F13R2_FB2_Msk                    (0x1UL << CAN_F13R2_FB2_Pos)       /*!< 0x00000004 */\r
+#define CAN_F13R2_FB2                        CAN_F13R2_FB2_Msk                 /*!< Filter bit 2 */\r
+#define CAN_F13R2_FB3_Pos                    (3U)                              \r
+#define CAN_F13R2_FB3_Msk                    (0x1UL << CAN_F13R2_FB3_Pos)       /*!< 0x00000008 */\r
+#define CAN_F13R2_FB3                        CAN_F13R2_FB3_Msk                 /*!< Filter bit 3 */\r
+#define CAN_F13R2_FB4_Pos                    (4U)                              \r
+#define CAN_F13R2_FB4_Msk                    (0x1UL << CAN_F13R2_FB4_Pos)       /*!< 0x00000010 */\r
+#define CAN_F13R2_FB4                        CAN_F13R2_FB4_Msk                 /*!< Filter bit 4 */\r
+#define CAN_F13R2_FB5_Pos                    (5U)                              \r
+#define CAN_F13R2_FB5_Msk                    (0x1UL << CAN_F13R2_FB5_Pos)       /*!< 0x00000020 */\r
+#define CAN_F13R2_FB5                        CAN_F13R2_FB5_Msk                 /*!< Filter bit 5 */\r
+#define CAN_F13R2_FB6_Pos                    (6U)                              \r
+#define CAN_F13R2_FB6_Msk                    (0x1UL << CAN_F13R2_FB6_Pos)       /*!< 0x00000040 */\r
+#define CAN_F13R2_FB6                        CAN_F13R2_FB6_Msk                 /*!< Filter bit 6 */\r
+#define CAN_F13R2_FB7_Pos                    (7U)                              \r
+#define CAN_F13R2_FB7_Msk                    (0x1UL << CAN_F13R2_FB7_Pos)       /*!< 0x00000080 */\r
+#define CAN_F13R2_FB7                        CAN_F13R2_FB7_Msk                 /*!< Filter bit 7 */\r
+#define CAN_F13R2_FB8_Pos                    (8U)                              \r
+#define CAN_F13R2_FB8_Msk                    (0x1UL << CAN_F13R2_FB8_Pos)       /*!< 0x00000100 */\r
+#define CAN_F13R2_FB8                        CAN_F13R2_FB8_Msk                 /*!< Filter bit 8 */\r
+#define CAN_F13R2_FB9_Pos                    (9U)                              \r
+#define CAN_F13R2_FB9_Msk                    (0x1UL << CAN_F13R2_FB9_Pos)       /*!< 0x00000200 */\r
+#define CAN_F13R2_FB9                        CAN_F13R2_FB9_Msk                 /*!< Filter bit 9 */\r
+#define CAN_F13R2_FB10_Pos                   (10U)                             \r
+#define CAN_F13R2_FB10_Msk                   (0x1UL << CAN_F13R2_FB10_Pos)      /*!< 0x00000400 */\r
+#define CAN_F13R2_FB10                       CAN_F13R2_FB10_Msk                /*!< Filter bit 10 */\r
+#define CAN_F13R2_FB11_Pos                   (11U)                             \r
+#define CAN_F13R2_FB11_Msk                   (0x1UL << CAN_F13R2_FB11_Pos)      /*!< 0x00000800 */\r
+#define CAN_F13R2_FB11                       CAN_F13R2_FB11_Msk                /*!< Filter bit 11 */\r
+#define CAN_F13R2_FB12_Pos                   (12U)                             \r
+#define CAN_F13R2_FB12_Msk                   (0x1UL << CAN_F13R2_FB12_Pos)      /*!< 0x00001000 */\r
+#define CAN_F13R2_FB12                       CAN_F13R2_FB12_Msk                /*!< Filter bit 12 */\r
+#define CAN_F13R2_FB13_Pos                   (13U)                             \r
+#define CAN_F13R2_FB13_Msk                   (0x1UL << CAN_F13R2_FB13_Pos)      /*!< 0x00002000 */\r
+#define CAN_F13R2_FB13                       CAN_F13R2_FB13_Msk                /*!< Filter bit 13 */\r
+#define CAN_F13R2_FB14_Pos                   (14U)                             \r
+#define CAN_F13R2_FB14_Msk                   (0x1UL << CAN_F13R2_FB14_Pos)      /*!< 0x00004000 */\r
+#define CAN_F13R2_FB14                       CAN_F13R2_FB14_Msk                /*!< Filter bit 14 */\r
+#define CAN_F13R2_FB15_Pos                   (15U)                             \r
+#define CAN_F13R2_FB15_Msk                   (0x1UL << CAN_F13R2_FB15_Pos)      /*!< 0x00008000 */\r
+#define CAN_F13R2_FB15                       CAN_F13R2_FB15_Msk                /*!< Filter bit 15 */\r
+#define CAN_F13R2_FB16_Pos                   (16U)                             \r
+#define CAN_F13R2_FB16_Msk                   (0x1UL << CAN_F13R2_FB16_Pos)      /*!< 0x00010000 */\r
+#define CAN_F13R2_FB16                       CAN_F13R2_FB16_Msk                /*!< Filter bit 16 */\r
+#define CAN_F13R2_FB17_Pos                   (17U)                             \r
+#define CAN_F13R2_FB17_Msk                   (0x1UL << CAN_F13R2_FB17_Pos)      /*!< 0x00020000 */\r
+#define CAN_F13R2_FB17                       CAN_F13R2_FB17_Msk                /*!< Filter bit 17 */\r
+#define CAN_F13R2_FB18_Pos                   (18U)                             \r
+#define CAN_F13R2_FB18_Msk                   (0x1UL << CAN_F13R2_FB18_Pos)      /*!< 0x00040000 */\r
+#define CAN_F13R2_FB18                       CAN_F13R2_FB18_Msk                /*!< Filter bit 18 */\r
+#define CAN_F13R2_FB19_Pos                   (19U)                             \r
+#define CAN_F13R2_FB19_Msk                   (0x1UL << CAN_F13R2_FB19_Pos)      /*!< 0x00080000 */\r
+#define CAN_F13R2_FB19                       CAN_F13R2_FB19_Msk                /*!< Filter bit 19 */\r
+#define CAN_F13R2_FB20_Pos                   (20U)                             \r
+#define CAN_F13R2_FB20_Msk                   (0x1UL << CAN_F13R2_FB20_Pos)      /*!< 0x00100000 */\r
+#define CAN_F13R2_FB20                       CAN_F13R2_FB20_Msk                /*!< Filter bit 20 */\r
+#define CAN_F13R2_FB21_Pos                   (21U)                             \r
+#define CAN_F13R2_FB21_Msk                   (0x1UL << CAN_F13R2_FB21_Pos)      /*!< 0x00200000 */\r
+#define CAN_F13R2_FB21                       CAN_F13R2_FB21_Msk                /*!< Filter bit 21 */\r
+#define CAN_F13R2_FB22_Pos                   (22U)                             \r
+#define CAN_F13R2_FB22_Msk                   (0x1UL << CAN_F13R2_FB22_Pos)      /*!< 0x00400000 */\r
+#define CAN_F13R2_FB22                       CAN_F13R2_FB22_Msk                /*!< Filter bit 22 */\r
+#define CAN_F13R2_FB23_Pos                   (23U)                             \r
+#define CAN_F13R2_FB23_Msk                   (0x1UL << CAN_F13R2_FB23_Pos)      /*!< 0x00800000 */\r
+#define CAN_F13R2_FB23                       CAN_F13R2_FB23_Msk                /*!< Filter bit 23 */\r
+#define CAN_F13R2_FB24_Pos                   (24U)                             \r
+#define CAN_F13R2_FB24_Msk                   (0x1UL << CAN_F13R2_FB24_Pos)      /*!< 0x01000000 */\r
+#define CAN_F13R2_FB24                       CAN_F13R2_FB24_Msk                /*!< Filter bit 24 */\r
+#define CAN_F13R2_FB25_Pos                   (25U)                             \r
+#define CAN_F13R2_FB25_Msk                   (0x1UL << CAN_F13R2_FB25_Pos)      /*!< 0x02000000 */\r
+#define CAN_F13R2_FB25                       CAN_F13R2_FB25_Msk                /*!< Filter bit 25 */\r
+#define CAN_F13R2_FB26_Pos                   (26U)                             \r
+#define CAN_F13R2_FB26_Msk                   (0x1UL << CAN_F13R2_FB26_Pos)      /*!< 0x04000000 */\r
+#define CAN_F13R2_FB26                       CAN_F13R2_FB26_Msk                /*!< Filter bit 26 */\r
+#define CAN_F13R2_FB27_Pos                   (27U)                             \r
+#define CAN_F13R2_FB27_Msk                   (0x1UL << CAN_F13R2_FB27_Pos)      /*!< 0x08000000 */\r
+#define CAN_F13R2_FB27                       CAN_F13R2_FB27_Msk                /*!< Filter bit 27 */\r
+#define CAN_F13R2_FB28_Pos                   (28U)                             \r
+#define CAN_F13R2_FB28_Msk                   (0x1UL << CAN_F13R2_FB28_Pos)      /*!< 0x10000000 */\r
+#define CAN_F13R2_FB28                       CAN_F13R2_FB28_Msk                /*!< Filter bit 28 */\r
+#define CAN_F13R2_FB29_Pos                   (29U)                             \r
+#define CAN_F13R2_FB29_Msk                   (0x1UL << CAN_F13R2_FB29_Pos)      /*!< 0x20000000 */\r
+#define CAN_F13R2_FB29                       CAN_F13R2_FB29_Msk                /*!< Filter bit 29 */\r
+#define CAN_F13R2_FB30_Pos                   (30U)                             \r
+#define CAN_F13R2_FB30_Msk                   (0x1UL << CAN_F13R2_FB30_Pos)      /*!< 0x40000000 */\r
+#define CAN_F13R2_FB30                       CAN_F13R2_FB30_Msk                /*!< Filter bit 30 */\r
+#define CAN_F13R2_FB31_Pos                   (31U)                             \r
+#define CAN_F13R2_FB31_Msk                   (0x1UL << CAN_F13R2_FB31_Pos)      /*!< 0x80000000 */\r
+#define CAN_F13R2_FB31                       CAN_F13R2_FB31_Msk                /*!< Filter bit 31 */\r
+\r
+/******************************************************************************/\r
+/*                                                                            */\r
+/*                        Serial Peripheral Interface                         */\r
+/*                                                                            */\r
+/******************************************************************************/\r
+\r
+/*******************  Bit definition for SPI_CR1 register  ********************/\r
+#define SPI_CR1_CPHA_Pos                    (0U)                               \r
+#define SPI_CR1_CPHA_Msk                    (0x1UL << SPI_CR1_CPHA_Pos)         /*!< 0x00000001 */\r
+#define SPI_CR1_CPHA                        SPI_CR1_CPHA_Msk                   /*!< Clock Phase */\r
+#define SPI_CR1_CPOL_Pos                    (1U)                               \r
+#define SPI_CR1_CPOL_Msk                    (0x1UL << SPI_CR1_CPOL_Pos)         /*!< 0x00000002 */\r
+#define SPI_CR1_CPOL                        SPI_CR1_CPOL_Msk                   /*!< Clock Polarity */\r
+#define SPI_CR1_MSTR_Pos                    (2U)                               \r
+#define SPI_CR1_MSTR_Msk                    (0x1UL << SPI_CR1_MSTR_Pos)         /*!< 0x00000004 */\r
+#define SPI_CR1_MSTR                        SPI_CR1_MSTR_Msk                   /*!< Master Selection */\r
+\r
+#define SPI_CR1_BR_Pos                      (3U)                               \r
+#define SPI_CR1_BR_Msk                      (0x7UL << SPI_CR1_BR_Pos)           /*!< 0x00000038 */\r
+#define SPI_CR1_BR                          SPI_CR1_BR_Msk                     /*!< BR[2:0] bits (Baud Rate Control) */\r
+#define SPI_CR1_BR_0                        (0x1UL << SPI_CR1_BR_Pos)           /*!< 0x00000008 */\r
+#define SPI_CR1_BR_1                        (0x2UL << SPI_CR1_BR_Pos)           /*!< 0x00000010 */\r
+#define SPI_CR1_BR_2                        (0x4UL << SPI_CR1_BR_Pos)           /*!< 0x00000020 */\r
+\r
+#define SPI_CR1_SPE_Pos                     (6U)                               \r
+#define SPI_CR1_SPE_Msk                     (0x1UL << SPI_CR1_SPE_Pos)          /*!< 0x00000040 */\r
+#define SPI_CR1_SPE                         SPI_CR1_SPE_Msk                    /*!< SPI Enable */\r
+#define SPI_CR1_LSBFIRST_Pos                (7U)                               \r
+#define SPI_CR1_LSBFIRST_Msk                (0x1UL << SPI_CR1_LSBFIRST_Pos)     /*!< 0x00000080 */\r
+#define SPI_CR1_LSBFIRST                    SPI_CR1_LSBFIRST_Msk               /*!< Frame Format */\r
+#define SPI_CR1_SSI_Pos                     (8U)                               \r
+#define SPI_CR1_SSI_Msk                     (0x1UL << SPI_CR1_SSI_Pos)          /*!< 0x00000100 */\r
+#define SPI_CR1_SSI                         SPI_CR1_SSI_Msk                    /*!< Internal slave select */\r
+#define SPI_CR1_SSM_Pos                     (9U)                               \r
+#define SPI_CR1_SSM_Msk                     (0x1UL << SPI_CR1_SSM_Pos)          /*!< 0x00000200 */\r
+#define SPI_CR1_SSM                         SPI_CR1_SSM_Msk                    /*!< Software slave management */\r
+#define SPI_CR1_RXONLY_Pos                  (10U)                              \r
+#define SPI_CR1_RXONLY_Msk                  (0x1UL << SPI_CR1_RXONLY_Pos)       /*!< 0x00000400 */\r
+#define SPI_CR1_RXONLY                      SPI_CR1_RXONLY_Msk                 /*!< Receive only */\r
+#define SPI_CR1_DFF_Pos                     (11U)                              \r
+#define SPI_CR1_DFF_Msk                     (0x1UL << SPI_CR1_DFF_Pos)          /*!< 0x00000800 */\r
+#define SPI_CR1_DFF                         SPI_CR1_DFF_Msk                    /*!< Data Frame Format */\r
+#define SPI_CR1_CRCNEXT_Pos                 (12U)                              \r
+#define SPI_CR1_CRCNEXT_Msk                 (0x1UL << SPI_CR1_CRCNEXT_Pos)      /*!< 0x00001000 */\r
+#define SPI_CR1_CRCNEXT                     SPI_CR1_CRCNEXT_Msk                /*!< Transmit CRC next */\r
+#define SPI_CR1_CRCEN_Pos                   (13U)                              \r
+#define SPI_CR1_CRCEN_Msk                   (0x1UL << SPI_CR1_CRCEN_Pos)        /*!< 0x00002000 */\r
+#define SPI_CR1_CRCEN                       SPI_CR1_CRCEN_Msk                  /*!< Hardware CRC calculation enable */\r
+#define SPI_CR1_BIDIOE_Pos                  (14U)                              \r
+#define SPI_CR1_BIDIOE_Msk                  (0x1UL << SPI_CR1_BIDIOE_Pos)       /*!< 0x00004000 */\r
+#define SPI_CR1_BIDIOE                      SPI_CR1_BIDIOE_Msk                 /*!< Output enable in bidirectional mode */\r
+#define SPI_CR1_BIDIMODE_Pos                (15U)                              \r
+#define SPI_CR1_BIDIMODE_Msk                (0x1UL << SPI_CR1_BIDIMODE_Pos)     /*!< 0x00008000 */\r
+#define SPI_CR1_BIDIMODE                    SPI_CR1_BIDIMODE_Msk               /*!< Bidirectional data mode enable */\r
+\r
+/*******************  Bit definition for SPI_CR2 register  ********************/\r
+#define SPI_CR2_RXDMAEN_Pos                 (0U)                               \r
+#define SPI_CR2_RXDMAEN_Msk                 (0x1UL << SPI_CR2_RXDMAEN_Pos)      /*!< 0x00000001 */\r
+#define SPI_CR2_RXDMAEN                     SPI_CR2_RXDMAEN_Msk                /*!< Rx Buffer DMA Enable */\r
+#define SPI_CR2_TXDMAEN_Pos                 (1U)                               \r
+#define SPI_CR2_TXDMAEN_Msk                 (0x1UL << SPI_CR2_TXDMAEN_Pos)      /*!< 0x00000002 */\r
+#define SPI_CR2_TXDMAEN                     SPI_CR2_TXDMAEN_Msk                /*!< Tx Buffer DMA Enable */\r
+#define SPI_CR2_SSOE_Pos                    (2U)                               \r
+#define SPI_CR2_SSOE_Msk                    (0x1UL << SPI_CR2_SSOE_Pos)         /*!< 0x00000004 */\r
+#define SPI_CR2_SSOE                        SPI_CR2_SSOE_Msk                   /*!< SS Output Enable */\r
+#define SPI_CR2_ERRIE_Pos                   (5U)                               \r
+#define SPI_CR2_ERRIE_Msk                   (0x1UL << SPI_CR2_ERRIE_Pos)        /*!< 0x00000020 */\r
+#define SPI_CR2_ERRIE                       SPI_CR2_ERRIE_Msk                  /*!< Error Interrupt Enable */\r
+#define SPI_CR2_RXNEIE_Pos                  (6U)                               \r
+#define SPI_CR2_RXNEIE_Msk                  (0x1UL << SPI_CR2_RXNEIE_Pos)       /*!< 0x00000040 */\r
+#define SPI_CR2_RXNEIE                      SPI_CR2_RXNEIE_Msk                 /*!< RX buffer Not Empty Interrupt Enable */\r
+#define SPI_CR2_TXEIE_Pos                   (7U)                               \r
+#define SPI_CR2_TXEIE_Msk                   (0x1UL << SPI_CR2_TXEIE_Pos)        /*!< 0x00000080 */\r
+#define SPI_CR2_TXEIE                       SPI_CR2_TXEIE_Msk                  /*!< Tx buffer Empty Interrupt Enable */\r
+\r
+/********************  Bit definition for SPI_SR register  ********************/\r
+#define SPI_SR_RXNE_Pos                     (0U)                               \r
+#define SPI_SR_RXNE_Msk                     (0x1UL << SPI_SR_RXNE_Pos)          /*!< 0x00000001 */\r
+#define SPI_SR_RXNE                         SPI_SR_RXNE_Msk                    /*!< Receive buffer Not Empty */\r
+#define SPI_SR_TXE_Pos                      (1U)                               \r
+#define SPI_SR_TXE_Msk                      (0x1UL << SPI_SR_TXE_Pos)           /*!< 0x00000002 */\r
+#define SPI_SR_TXE                          SPI_SR_TXE_Msk                     /*!< Transmit buffer Empty */\r
+#define SPI_SR_CHSIDE_Pos                   (2U)                               \r
+#define SPI_SR_CHSIDE_Msk                   (0x1UL << SPI_SR_CHSIDE_Pos)        /*!< 0x00000004 */\r
+#define SPI_SR_CHSIDE                       SPI_SR_CHSIDE_Msk                  /*!< Channel side */\r
+#define SPI_SR_UDR_Pos                      (3U)                               \r
+#define SPI_SR_UDR_Msk                      (0x1UL << SPI_SR_UDR_Pos)           /*!< 0x00000008 */\r
+#define SPI_SR_UDR                          SPI_SR_UDR_Msk                     /*!< Underrun flag */\r
+#define SPI_SR_CRCERR_Pos                   (4U)                               \r
+#define SPI_SR_CRCERR_Msk                   (0x1UL << SPI_SR_CRCERR_Pos)        /*!< 0x00000010 */\r
+#define SPI_SR_CRCERR                       SPI_SR_CRCERR_Msk                  /*!< CRC Error flag */\r
+#define SPI_SR_MODF_Pos                     (5U)                               \r
+#define SPI_SR_MODF_Msk                     (0x1UL << SPI_SR_MODF_Pos)          /*!< 0x00000020 */\r
+#define SPI_SR_MODF                         SPI_SR_MODF_Msk                    /*!< Mode fault */\r
+#define SPI_SR_OVR_Pos                      (6U)                               \r
+#define SPI_SR_OVR_Msk                      (0x1UL << SPI_SR_OVR_Pos)           /*!< 0x00000040 */\r
+#define SPI_SR_OVR                          SPI_SR_OVR_Msk                     /*!< Overrun flag */\r
+#define SPI_SR_BSY_Pos                      (7U)                               \r
+#define SPI_SR_BSY_Msk                      (0x1UL << SPI_SR_BSY_Pos)           /*!< 0x00000080 */\r
+#define SPI_SR_BSY                          SPI_SR_BSY_Msk                     /*!< Busy flag */\r
+\r
+/********************  Bit definition for SPI_DR register  ********************/\r
+#define SPI_DR_DR_Pos                       (0U)                               \r
+#define SPI_DR_DR_Msk                       (0xFFFFUL << SPI_DR_DR_Pos)         /*!< 0x0000FFFF */\r
+#define SPI_DR_DR                           SPI_DR_DR_Msk                      /*!< Data Register */\r
+\r
+/*******************  Bit definition for SPI_CRCPR register  ******************/\r
+#define SPI_CRCPR_CRCPOLY_Pos               (0U)                               \r
+#define SPI_CRCPR_CRCPOLY_Msk               (0xFFFFUL << SPI_CRCPR_CRCPOLY_Pos) /*!< 0x0000FFFF */\r
+#define SPI_CRCPR_CRCPOLY                   SPI_CRCPR_CRCPOLY_Msk              /*!< CRC polynomial register */\r
+\r
+/******************  Bit definition for SPI_RXCRCR register  ******************/\r
+#define SPI_RXCRCR_RXCRC_Pos                (0U)                               \r
+#define SPI_RXCRCR_RXCRC_Msk                (0xFFFFUL << SPI_RXCRCR_RXCRC_Pos)  /*!< 0x0000FFFF */\r
+#define SPI_RXCRCR_RXCRC                    SPI_RXCRCR_RXCRC_Msk               /*!< Rx CRC Register */\r
+\r
+/******************  Bit definition for SPI_TXCRCR register  ******************/\r
+#define SPI_TXCRCR_TXCRC_Pos                (0U)                               \r
+#define SPI_TXCRCR_TXCRC_Msk                (0xFFFFUL << SPI_TXCRCR_TXCRC_Pos)  /*!< 0x0000FFFF */\r
+#define SPI_TXCRCR_TXCRC                    SPI_TXCRCR_TXCRC_Msk               /*!< Tx CRC Register */\r
+\r
+#define SPI_I2SCFGR_I2SMOD_Pos              (11U)                              \r
+#define SPI_I2SCFGR_I2SMOD_Msk              (0x1UL << SPI_I2SCFGR_I2SMOD_Pos)   /*!< 0x00000800 */\r
+#define SPI_I2SCFGR_I2SMOD                  SPI_I2SCFGR_I2SMOD_Msk             /*!< I2S mode selection */\r
+\r
+/******************************************************************************/\r
+/*                                                                            */\r
+/*                      Inter-integrated Circuit Interface                    */\r
+/*                                                                            */\r
+/******************************************************************************/\r
+\r
+/*******************  Bit definition for I2C_CR1 register  ********************/\r
+#define I2C_CR1_PE_Pos                      (0U)                               \r
+#define I2C_CR1_PE_Msk                      (0x1UL << I2C_CR1_PE_Pos)           /*!< 0x00000001 */\r
+#define I2C_CR1_PE                          I2C_CR1_PE_Msk                     /*!< Peripheral Enable */\r
+#define I2C_CR1_SMBUS_Pos                   (1U)                               \r
+#define I2C_CR1_SMBUS_Msk                   (0x1UL << I2C_CR1_SMBUS_Pos)        /*!< 0x00000002 */\r
+#define I2C_CR1_SMBUS                       I2C_CR1_SMBUS_Msk                  /*!< SMBus Mode */\r
+#define I2C_CR1_SMBTYPE_Pos                 (3U)                               \r
+#define I2C_CR1_SMBTYPE_Msk                 (0x1UL << I2C_CR1_SMBTYPE_Pos)      /*!< 0x00000008 */\r
+#define I2C_CR1_SMBTYPE                     I2C_CR1_SMBTYPE_Msk                /*!< SMBus Type */\r
+#define I2C_CR1_ENARP_Pos                   (4U)                               \r
+#define I2C_CR1_ENARP_Msk                   (0x1UL << I2C_CR1_ENARP_Pos)        /*!< 0x00000010 */\r
+#define I2C_CR1_ENARP                       I2C_CR1_ENARP_Msk                  /*!< ARP Enable */\r
+#define I2C_CR1_ENPEC_Pos                   (5U)                               \r
+#define I2C_CR1_ENPEC_Msk                   (0x1UL << I2C_CR1_ENPEC_Pos)        /*!< 0x00000020 */\r
+#define I2C_CR1_ENPEC                       I2C_CR1_ENPEC_Msk                  /*!< PEC Enable */\r
+#define I2C_CR1_ENGC_Pos                    (6U)                               \r
+#define I2C_CR1_ENGC_Msk                    (0x1UL << I2C_CR1_ENGC_Pos)         /*!< 0x00000040 */\r
+#define I2C_CR1_ENGC                        I2C_CR1_ENGC_Msk                   /*!< General Call Enable */\r
+#define I2C_CR1_NOSTRETCH_Pos               (7U)                               \r
+#define I2C_CR1_NOSTRETCH_Msk               (0x1UL << I2C_CR1_NOSTRETCH_Pos)    /*!< 0x00000080 */\r
+#define I2C_CR1_NOSTRETCH                   I2C_CR1_NOSTRETCH_Msk              /*!< Clock Stretching Disable (Slave mode) */\r
+#define I2C_CR1_START_Pos                   (8U)                               \r
+#define I2C_CR1_START_Msk                   (0x1UL << I2C_CR1_START_Pos)        /*!< 0x00000100 */\r
+#define I2C_CR1_START                       I2C_CR1_START_Msk                  /*!< Start Generation */\r
+#define I2C_CR1_STOP_Pos                    (9U)                               \r
+#define I2C_CR1_STOP_Msk                    (0x1UL << I2C_CR1_STOP_Pos)         /*!< 0x00000200 */\r
+#define I2C_CR1_STOP                        I2C_CR1_STOP_Msk                   /*!< Stop Generation */\r
+#define I2C_CR1_ACK_Pos                     (10U)                              \r
+#define I2C_CR1_ACK_Msk                     (0x1UL << I2C_CR1_ACK_Pos)          /*!< 0x00000400 */\r
+#define I2C_CR1_ACK                         I2C_CR1_ACK_Msk                    /*!< Acknowledge Enable */\r
+#define I2C_CR1_POS_Pos                     (11U)                              \r
+#define I2C_CR1_POS_Msk                     (0x1UL << I2C_CR1_POS_Pos)          /*!< 0x00000800 */\r
+#define I2C_CR1_POS                         I2C_CR1_POS_Msk                    /*!< Acknowledge/PEC Position (for data reception) */\r
+#define I2C_CR1_PEC_Pos                     (12U)                              \r
+#define I2C_CR1_PEC_Msk                     (0x1UL << I2C_CR1_PEC_Pos)          /*!< 0x00001000 */\r
+#define I2C_CR1_PEC                         I2C_CR1_PEC_Msk                    /*!< Packet Error Checking */\r
+#define I2C_CR1_ALERT_Pos                   (13U)                              \r
+#define I2C_CR1_ALERT_Msk                   (0x1UL << I2C_CR1_ALERT_Pos)        /*!< 0x00002000 */\r
+#define I2C_CR1_ALERT                       I2C_CR1_ALERT_Msk                  /*!< SMBus Alert */\r
+#define I2C_CR1_SWRST_Pos                   (15U)                              \r
+#define I2C_CR1_SWRST_Msk                   (0x1UL << I2C_CR1_SWRST_Pos)        /*!< 0x00008000 */\r
+#define I2C_CR1_SWRST                       I2C_CR1_SWRST_Msk                  /*!< Software Reset */\r
+\r
+/*******************  Bit definition for I2C_CR2 register  ********************/\r
+#define I2C_CR2_FREQ_Pos                    (0U)                               \r
+#define I2C_CR2_FREQ_Msk                    (0x3FUL << I2C_CR2_FREQ_Pos)        /*!< 0x0000003F */\r
+#define I2C_CR2_FREQ                        I2C_CR2_FREQ_Msk                   /*!< FREQ[5:0] bits (Peripheral Clock Frequency) */\r
+#define I2C_CR2_FREQ_0                      (0x01UL << I2C_CR2_FREQ_Pos)        /*!< 0x00000001 */\r
+#define I2C_CR2_FREQ_1                      (0x02UL << I2C_CR2_FREQ_Pos)        /*!< 0x00000002 */\r
+#define I2C_CR2_FREQ_2                      (0x04UL << I2C_CR2_FREQ_Pos)        /*!< 0x00000004 */\r
+#define I2C_CR2_FREQ_3                      (0x08UL << I2C_CR2_FREQ_Pos)        /*!< 0x00000008 */\r
+#define I2C_CR2_FREQ_4                      (0x10UL << I2C_CR2_FREQ_Pos)        /*!< 0x00000010 */\r
+#define I2C_CR2_FREQ_5                      (0x20UL << I2C_CR2_FREQ_Pos)        /*!< 0x00000020 */\r
+\r
+#define I2C_CR2_ITERREN_Pos                 (8U)                               \r
+#define I2C_CR2_ITERREN_Msk                 (0x1UL << I2C_CR2_ITERREN_Pos)      /*!< 0x00000100 */\r
+#define I2C_CR2_ITERREN                     I2C_CR2_ITERREN_Msk                /*!< Error Interrupt Enable */\r
+#define I2C_CR2_ITEVTEN_Pos                 (9U)                               \r
+#define I2C_CR2_ITEVTEN_Msk                 (0x1UL << I2C_CR2_ITEVTEN_Pos)      /*!< 0x00000200 */\r
+#define I2C_CR2_ITEVTEN                     I2C_CR2_ITEVTEN_Msk                /*!< Event Interrupt Enable */\r
+#define I2C_CR2_ITBUFEN_Pos                 (10U)                              \r
+#define I2C_CR2_ITBUFEN_Msk                 (0x1UL << I2C_CR2_ITBUFEN_Pos)      /*!< 0x00000400 */\r
+#define I2C_CR2_ITBUFEN                     I2C_CR2_ITBUFEN_Msk                /*!< Buffer Interrupt Enable */\r
+#define I2C_CR2_DMAEN_Pos                   (11U)                              \r
+#define I2C_CR2_DMAEN_Msk                   (0x1UL << I2C_CR2_DMAEN_Pos)        /*!< 0x00000800 */\r
+#define I2C_CR2_DMAEN                       I2C_CR2_DMAEN_Msk                  /*!< DMA Requests Enable */\r
+#define I2C_CR2_LAST_Pos                    (12U)                              \r
+#define I2C_CR2_LAST_Msk                    (0x1UL << I2C_CR2_LAST_Pos)         /*!< 0x00001000 */\r
+#define I2C_CR2_LAST                        I2C_CR2_LAST_Msk                   /*!< DMA Last Transfer */\r
+\r
+/*******************  Bit definition for I2C_OAR1 register  *******************/\r
+#define I2C_OAR1_ADD1_7                     0x000000FEU             /*!< Interface Address */\r
+#define I2C_OAR1_ADD8_9                     0x00000300U             /*!< Interface Address */\r
+\r
+#define I2C_OAR1_ADD0_Pos                   (0U)                               \r
+#define I2C_OAR1_ADD0_Msk                   (0x1UL << I2C_OAR1_ADD0_Pos)        /*!< 0x00000001 */\r
+#define I2C_OAR1_ADD0                       I2C_OAR1_ADD0_Msk                  /*!< Bit 0 */\r
+#define I2C_OAR1_ADD1_Pos                   (1U)                               \r
+#define I2C_OAR1_ADD1_Msk                   (0x1UL << I2C_OAR1_ADD1_Pos)        /*!< 0x00000002 */\r
+#define I2C_OAR1_ADD1                       I2C_OAR1_ADD1_Msk                  /*!< Bit 1 */\r
+#define I2C_OAR1_ADD2_Pos                   (2U)                               \r
+#define I2C_OAR1_ADD2_Msk                   (0x1UL << I2C_OAR1_ADD2_Pos)        /*!< 0x00000004 */\r
+#define I2C_OAR1_ADD2                       I2C_OAR1_ADD2_Msk                  /*!< Bit 2 */\r
+#define I2C_OAR1_ADD3_Pos                   (3U)                               \r
+#define I2C_OAR1_ADD3_Msk                   (0x1UL << I2C_OAR1_ADD3_Pos)        /*!< 0x00000008 */\r
+#define I2C_OAR1_ADD3                       I2C_OAR1_ADD3_Msk                  /*!< Bit 3 */\r
+#define I2C_OAR1_ADD4_Pos                   (4U)                               \r
+#define I2C_OAR1_ADD4_Msk                   (0x1UL << I2C_OAR1_ADD4_Pos)        /*!< 0x00000010 */\r
+#define I2C_OAR1_ADD4                       I2C_OAR1_ADD4_Msk                  /*!< Bit 4 */\r
+#define I2C_OAR1_ADD5_Pos                   (5U)                               \r
+#define I2C_OAR1_ADD5_Msk                   (0x1UL << I2C_OAR1_ADD5_Pos)        /*!< 0x00000020 */\r
+#define I2C_OAR1_ADD5                       I2C_OAR1_ADD5_Msk                  /*!< Bit 5 */\r
+#define I2C_OAR1_ADD6_Pos                   (6U)                               \r
+#define I2C_OAR1_ADD6_Msk                   (0x1UL << I2C_OAR1_ADD6_Pos)        /*!< 0x00000040 */\r
+#define I2C_OAR1_ADD6                       I2C_OAR1_ADD6_Msk                  /*!< Bit 6 */\r
+#define I2C_OAR1_ADD7_Pos                   (7U)                               \r
+#define I2C_OAR1_ADD7_Msk                   (0x1UL << I2C_OAR1_ADD7_Pos)        /*!< 0x00000080 */\r
+#define I2C_OAR1_ADD7                       I2C_OAR1_ADD7_Msk                  /*!< Bit 7 */\r
+#define I2C_OAR1_ADD8_Pos                   (8U)                               \r
+#define I2C_OAR1_ADD8_Msk                   (0x1UL << I2C_OAR1_ADD8_Pos)        /*!< 0x00000100 */\r
+#define I2C_OAR1_ADD8                       I2C_OAR1_ADD8_Msk                  /*!< Bit 8 */\r
+#define I2C_OAR1_ADD9_Pos                   (9U)                               \r
+#define I2C_OAR1_ADD9_Msk                   (0x1UL << I2C_OAR1_ADD9_Pos)        /*!< 0x00000200 */\r
+#define I2C_OAR1_ADD9                       I2C_OAR1_ADD9_Msk                  /*!< Bit 9 */\r
+\r
+#define I2C_OAR1_ADDMODE_Pos                (15U)                              \r
+#define I2C_OAR1_ADDMODE_Msk                (0x1UL << I2C_OAR1_ADDMODE_Pos)     /*!< 0x00008000 */\r
+#define I2C_OAR1_ADDMODE                    I2C_OAR1_ADDMODE_Msk               /*!< Addressing Mode (Slave mode) */\r
+\r
+/*******************  Bit definition for I2C_OAR2 register  *******************/\r
+#define I2C_OAR2_ENDUAL_Pos                 (0U)                               \r
+#define I2C_OAR2_ENDUAL_Msk                 (0x1UL << I2C_OAR2_ENDUAL_Pos)      /*!< 0x00000001 */\r
+#define I2C_OAR2_ENDUAL                     I2C_OAR2_ENDUAL_Msk                /*!< Dual addressing mode enable */\r
+#define I2C_OAR2_ADD2_Pos                   (1U)                               \r
+#define I2C_OAR2_ADD2_Msk                   (0x7FUL << I2C_OAR2_ADD2_Pos)       /*!< 0x000000FE */\r
+#define I2C_OAR2_ADD2                       I2C_OAR2_ADD2_Msk                  /*!< Interface address */\r
+\r
+/********************  Bit definition for I2C_DR register  ********************/\r
+#define I2C_DR_DR_Pos             (0U)                                         \r
+#define I2C_DR_DR_Msk             (0xFFUL << I2C_DR_DR_Pos)                     /*!< 0x000000FF */\r
+#define I2C_DR_DR                 I2C_DR_DR_Msk                                /*!< 8-bit Data Register         */\r
+\r
+/*******************  Bit definition for I2C_SR1 register  ********************/\r
+#define I2C_SR1_SB_Pos                      (0U)                               \r
+#define I2C_SR1_SB_Msk                      (0x1UL << I2C_SR1_SB_Pos)           /*!< 0x00000001 */\r
+#define I2C_SR1_SB                          I2C_SR1_SB_Msk                     /*!< Start Bit (Master mode) */\r
+#define I2C_SR1_ADDR_Pos                    (1U)                               \r
+#define I2C_SR1_ADDR_Msk                    (0x1UL << I2C_SR1_ADDR_Pos)         /*!< 0x00000002 */\r
+#define I2C_SR1_ADDR                        I2C_SR1_ADDR_Msk                   /*!< Address sent (master mode)/matched (slave mode) */\r
+#define I2C_SR1_BTF_Pos                     (2U)                               \r
+#define I2C_SR1_BTF_Msk                     (0x1UL << I2C_SR1_BTF_Pos)          /*!< 0x00000004 */\r
+#define I2C_SR1_BTF                         I2C_SR1_BTF_Msk                    /*!< Byte Transfer Finished */\r
+#define I2C_SR1_ADD10_Pos                   (3U)                               \r
+#define I2C_SR1_ADD10_Msk                   (0x1UL << I2C_SR1_ADD10_Pos)        /*!< 0x00000008 */\r
+#define I2C_SR1_ADD10                       I2C_SR1_ADD10_Msk                  /*!< 10-bit header sent (Master mode) */\r
+#define I2C_SR1_STOPF_Pos                   (4U)                               \r
+#define I2C_SR1_STOPF_Msk                   (0x1UL << I2C_SR1_STOPF_Pos)        /*!< 0x00000010 */\r
+#define I2C_SR1_STOPF                       I2C_SR1_STOPF_Msk                  /*!< Stop detection (Slave mode) */\r
+#define I2C_SR1_RXNE_Pos                    (6U)                               \r
+#define I2C_SR1_RXNE_Msk                    (0x1UL << I2C_SR1_RXNE_Pos)         /*!< 0x00000040 */\r
+#define I2C_SR1_RXNE                        I2C_SR1_RXNE_Msk                   /*!< Data Register not Empty (receivers) */\r
+#define I2C_SR1_TXE_Pos                     (7U)                               \r
+#define I2C_SR1_TXE_Msk                     (0x1UL << I2C_SR1_TXE_Pos)          /*!< 0x00000080 */\r
+#define I2C_SR1_TXE                         I2C_SR1_TXE_Msk                    /*!< Data Register Empty (transmitters) */\r
+#define I2C_SR1_BERR_Pos                    (8U)                               \r
+#define I2C_SR1_BERR_Msk                    (0x1UL << I2C_SR1_BERR_Pos)         /*!< 0x00000100 */\r
+#define I2C_SR1_BERR                        I2C_SR1_BERR_Msk                   /*!< Bus Error */\r
+#define I2C_SR1_ARLO_Pos                    (9U)                               \r
+#define I2C_SR1_ARLO_Msk                    (0x1UL << I2C_SR1_ARLO_Pos)         /*!< 0x00000200 */\r
+#define I2C_SR1_ARLO                        I2C_SR1_ARLO_Msk                   /*!< Arbitration Lost (master mode) */\r
+#define I2C_SR1_AF_Pos                      (10U)                              \r
+#define I2C_SR1_AF_Msk                      (0x1UL << I2C_SR1_AF_Pos)           /*!< 0x00000400 */\r
+#define I2C_SR1_AF                          I2C_SR1_AF_Msk                     /*!< Acknowledge Failure */\r
+#define I2C_SR1_OVR_Pos                     (11U)                              \r
+#define I2C_SR1_OVR_Msk                     (0x1UL << I2C_SR1_OVR_Pos)          /*!< 0x00000800 */\r
+#define I2C_SR1_OVR                         I2C_SR1_OVR_Msk                    /*!< Overrun/Underrun */\r
+#define I2C_SR1_PECERR_Pos                  (12U)                              \r
+#define I2C_SR1_PECERR_Msk                  (0x1UL << I2C_SR1_PECERR_Pos)       /*!< 0x00001000 */\r
+#define I2C_SR1_PECERR                      I2C_SR1_PECERR_Msk                 /*!< PEC Error in reception */\r
+#define I2C_SR1_TIMEOUT_Pos                 (14U)                              \r
+#define I2C_SR1_TIMEOUT_Msk                 (0x1UL << I2C_SR1_TIMEOUT_Pos)      /*!< 0x00004000 */\r
+#define I2C_SR1_TIMEOUT                     I2C_SR1_TIMEOUT_Msk                /*!< Timeout or Tlow Error */\r
+#define I2C_SR1_SMBALERT_Pos                (15U)                              \r
+#define I2C_SR1_SMBALERT_Msk                (0x1UL << I2C_SR1_SMBALERT_Pos)     /*!< 0x00008000 */\r
+#define I2C_SR1_SMBALERT                    I2C_SR1_SMBALERT_Msk               /*!< SMBus Alert */\r
+\r
+/*******************  Bit definition for I2C_SR2 register  ********************/\r
+#define I2C_SR2_MSL_Pos                     (0U)                               \r
+#define I2C_SR2_MSL_Msk                     (0x1UL << I2C_SR2_MSL_Pos)          /*!< 0x00000001 */\r
+#define I2C_SR2_MSL                         I2C_SR2_MSL_Msk                    /*!< Master/Slave */\r
+#define I2C_SR2_BUSY_Pos                    (1U)                               \r
+#define I2C_SR2_BUSY_Msk                    (0x1UL << I2C_SR2_BUSY_Pos)         /*!< 0x00000002 */\r
+#define I2C_SR2_BUSY                        I2C_SR2_BUSY_Msk                   /*!< Bus Busy */\r
+#define I2C_SR2_TRA_Pos                     (2U)                               \r
+#define I2C_SR2_TRA_Msk                     (0x1UL << I2C_SR2_TRA_Pos)          /*!< 0x00000004 */\r
+#define I2C_SR2_TRA                         I2C_SR2_TRA_Msk                    /*!< Transmitter/Receiver */\r
+#define I2C_SR2_GENCALL_Pos                 (4U)                               \r
+#define I2C_SR2_GENCALL_Msk                 (0x1UL << I2C_SR2_GENCALL_Pos)      /*!< 0x00000010 */\r
+#define I2C_SR2_GENCALL                     I2C_SR2_GENCALL_Msk                /*!< General Call Address (Slave mode) */\r
+#define I2C_SR2_SMBDEFAULT_Pos              (5U)                               \r
+#define I2C_SR2_SMBDEFAULT_Msk              (0x1UL << I2C_SR2_SMBDEFAULT_Pos)   /*!< 0x00000020 */\r
+#define I2C_SR2_SMBDEFAULT                  I2C_SR2_SMBDEFAULT_Msk             /*!< SMBus Device Default Address (Slave mode) */\r
+#define I2C_SR2_SMBHOST_Pos                 (6U)                               \r
+#define I2C_SR2_SMBHOST_Msk                 (0x1UL << I2C_SR2_SMBHOST_Pos)      /*!< 0x00000040 */\r
+#define I2C_SR2_SMBHOST                     I2C_SR2_SMBHOST_Msk                /*!< SMBus Host Header (Slave mode) */\r
+#define I2C_SR2_DUALF_Pos                   (7U)                               \r
+#define I2C_SR2_DUALF_Msk                   (0x1UL << I2C_SR2_DUALF_Pos)        /*!< 0x00000080 */\r
+#define I2C_SR2_DUALF                       I2C_SR2_DUALF_Msk                  /*!< Dual Flag (Slave mode) */\r
+#define I2C_SR2_PEC_Pos                     (8U)                               \r
+#define I2C_SR2_PEC_Msk                     (0xFFUL << I2C_SR2_PEC_Pos)         /*!< 0x0000FF00 */\r
+#define I2C_SR2_PEC                         I2C_SR2_PEC_Msk                    /*!< Packet Error Checking Register */\r
+\r
+/*******************  Bit definition for I2C_CCR register  ********************/\r
+#define I2C_CCR_CCR_Pos                     (0U)                               \r
+#define I2C_CCR_CCR_Msk                     (0xFFFUL << I2C_CCR_CCR_Pos)        /*!< 0x00000FFF */\r
+#define I2C_CCR_CCR                         I2C_CCR_CCR_Msk                    /*!< Clock Control Register in Fast/Standard mode (Master mode) */\r
+#define I2C_CCR_DUTY_Pos                    (14U)                              \r
+#define I2C_CCR_DUTY_Msk                    (0x1UL << I2C_CCR_DUTY_Pos)         /*!< 0x00004000 */\r
+#define I2C_CCR_DUTY                        I2C_CCR_DUTY_Msk                   /*!< Fast Mode Duty Cycle */\r
+#define I2C_CCR_FS_Pos                      (15U)                              \r
+#define I2C_CCR_FS_Msk                      (0x1UL << I2C_CCR_FS_Pos)           /*!< 0x00008000 */\r
+#define I2C_CCR_FS                          I2C_CCR_FS_Msk                     /*!< I2C Master Mode Selection */\r
+\r
+/******************  Bit definition for I2C_TRISE register  *******************/\r
+#define I2C_TRISE_TRISE_Pos                 (0U)                               \r
+#define I2C_TRISE_TRISE_Msk                 (0x3FUL << I2C_TRISE_TRISE_Pos)     /*!< 0x0000003F */\r
+#define I2C_TRISE_TRISE                     I2C_TRISE_TRISE_Msk                /*!< Maximum Rise Time in Fast/Standard mode (Master mode) */\r
+\r
+/******************************************************************************/\r
+/*                                                                            */\r
+/*         Universal Synchronous Asynchronous Receiver Transmitter            */\r
+/*                                                                            */\r
+/******************************************************************************/\r
+\r
+/*******************  Bit definition for USART_SR register  *******************/\r
+#define USART_SR_PE_Pos                     (0U)                               \r
+#define USART_SR_PE_Msk                     (0x1UL << USART_SR_PE_Pos)          /*!< 0x00000001 */\r
+#define USART_SR_PE                         USART_SR_PE_Msk                    /*!< Parity Error */\r
+#define USART_SR_FE_Pos                     (1U)                               \r
+#define USART_SR_FE_Msk                     (0x1UL << USART_SR_FE_Pos)          /*!< 0x00000002 */\r
+#define USART_SR_FE                         USART_SR_FE_Msk                    /*!< Framing Error */\r
+#define USART_SR_NE_Pos                     (2U)                               \r
+#define USART_SR_NE_Msk                     (0x1UL << USART_SR_NE_Pos)          /*!< 0x00000004 */\r
+#define USART_SR_NE                         USART_SR_NE_Msk                    /*!< Noise Error Flag */\r
+#define USART_SR_ORE_Pos                    (3U)                               \r
+#define USART_SR_ORE_Msk                    (0x1UL << USART_SR_ORE_Pos)         /*!< 0x00000008 */\r
+#define USART_SR_ORE                        USART_SR_ORE_Msk                   /*!< OverRun Error */\r
+#define USART_SR_IDLE_Pos                   (4U)                               \r
+#define USART_SR_IDLE_Msk                   (0x1UL << USART_SR_IDLE_Pos)        /*!< 0x00000010 */\r
+#define USART_SR_IDLE                       USART_SR_IDLE_Msk                  /*!< IDLE line detected */\r
+#define USART_SR_RXNE_Pos                   (5U)                               \r
+#define USART_SR_RXNE_Msk                   (0x1UL << USART_SR_RXNE_Pos)        /*!< 0x00000020 */\r
+#define USART_SR_RXNE                       USART_SR_RXNE_Msk                  /*!< Read Data Register Not Empty */\r
+#define USART_SR_TC_Pos                     (6U)                               \r
+#define USART_SR_TC_Msk                     (0x1UL << USART_SR_TC_Pos)          /*!< 0x00000040 */\r
+#define USART_SR_TC                         USART_SR_TC_Msk                    /*!< Transmission Complete */\r
+#define USART_SR_TXE_Pos                    (7U)                               \r
+#define USART_SR_TXE_Msk                    (0x1UL << USART_SR_TXE_Pos)         /*!< 0x00000080 */\r
+#define USART_SR_TXE                        USART_SR_TXE_Msk                   /*!< Transmit Data Register Empty */\r
+#define USART_SR_LBD_Pos                    (8U)                               \r
+#define USART_SR_LBD_Msk                    (0x1UL << USART_SR_LBD_Pos)         /*!< 0x00000100 */\r
+#define USART_SR_LBD                        USART_SR_LBD_Msk                   /*!< LIN Break Detection Flag */\r
+#define USART_SR_CTS_Pos                    (9U)                               \r
+#define USART_SR_CTS_Msk                    (0x1UL << USART_SR_CTS_Pos)         /*!< 0x00000200 */\r
+#define USART_SR_CTS                        USART_SR_CTS_Msk                   /*!< CTS Flag */\r
+\r
+/*******************  Bit definition for USART_DR register  *******************/\r
+#define USART_DR_DR_Pos                     (0U)                               \r
+#define USART_DR_DR_Msk                     (0x1FFUL << USART_DR_DR_Pos)        /*!< 0x000001FF */\r
+#define USART_DR_DR                         USART_DR_DR_Msk                    /*!< Data value */\r
+\r
+/******************  Bit definition for USART_BRR register  *******************/\r
+#define USART_BRR_DIV_Fraction_Pos          (0U)                               \r
+#define USART_BRR_DIV_Fraction_Msk          (0xFUL << USART_BRR_DIV_Fraction_Pos) /*!< 0x0000000F */\r
+#define USART_BRR_DIV_Fraction              USART_BRR_DIV_Fraction_Msk         /*!< Fraction of USARTDIV */\r
+#define USART_BRR_DIV_Mantissa_Pos          (4U)                               \r
+#define USART_BRR_DIV_Mantissa_Msk          (0xFFFUL << USART_BRR_DIV_Mantissa_Pos) /*!< 0x0000FFF0 */\r
+#define USART_BRR_DIV_Mantissa              USART_BRR_DIV_Mantissa_Msk         /*!< Mantissa of USARTDIV */\r
+\r
+/******************  Bit definition for USART_CR1 register  *******************/\r
+#define USART_CR1_SBK_Pos                   (0U)                               \r
+#define USART_CR1_SBK_Msk                   (0x1UL << USART_CR1_SBK_Pos)        /*!< 0x00000001 */\r
+#define USART_CR1_SBK                       USART_CR1_SBK_Msk                  /*!< Send Break */\r
+#define USART_CR1_RWU_Pos                   (1U)                               \r
+#define USART_CR1_RWU_Msk                   (0x1UL << USART_CR1_RWU_Pos)        /*!< 0x00000002 */\r
+#define USART_CR1_RWU                       USART_CR1_RWU_Msk                  /*!< Receiver wakeup */\r
+#define USART_CR1_RE_Pos                    (2U)                               \r
+#define USART_CR1_RE_Msk                    (0x1UL << USART_CR1_RE_Pos)         /*!< 0x00000004 */\r
+#define USART_CR1_RE                        USART_CR1_RE_Msk                   /*!< Receiver Enable */\r
+#define USART_CR1_TE_Pos                    (3U)                               \r
+#define USART_CR1_TE_Msk                    (0x1UL << USART_CR1_TE_Pos)         /*!< 0x00000008 */\r
+#define USART_CR1_TE                        USART_CR1_TE_Msk                   /*!< Transmitter Enable */\r
+#define USART_CR1_IDLEIE_Pos                (4U)                               \r
+#define USART_CR1_IDLEIE_Msk                (0x1UL << USART_CR1_IDLEIE_Pos)     /*!< 0x00000010 */\r
+#define USART_CR1_IDLEIE                    USART_CR1_IDLEIE_Msk               /*!< IDLE Interrupt Enable */\r
+#define USART_CR1_RXNEIE_Pos                (5U)                               \r
+#define USART_CR1_RXNEIE_Msk                (0x1UL << USART_CR1_RXNEIE_Pos)     /*!< 0x00000020 */\r
+#define USART_CR1_RXNEIE                    USART_CR1_RXNEIE_Msk               /*!< RXNE Interrupt Enable */\r
+#define USART_CR1_TCIE_Pos                  (6U)                               \r
+#define USART_CR1_TCIE_Msk                  (0x1UL << USART_CR1_TCIE_Pos)       /*!< 0x00000040 */\r
+#define USART_CR1_TCIE                      USART_CR1_TCIE_Msk                 /*!< Transmission Complete Interrupt Enable */\r
+#define USART_CR1_TXEIE_Pos                 (7U)                               \r
+#define USART_CR1_TXEIE_Msk                 (0x1UL << USART_CR1_TXEIE_Pos)      /*!< 0x00000080 */\r
+#define USART_CR1_TXEIE                     USART_CR1_TXEIE_Msk                /*!< PE Interrupt Enable */\r
+#define USART_CR1_PEIE_Pos                  (8U)                               \r
+#define USART_CR1_PEIE_Msk                  (0x1UL << USART_CR1_PEIE_Pos)       /*!< 0x00000100 */\r
+#define USART_CR1_PEIE                      USART_CR1_PEIE_Msk                 /*!< PE Interrupt Enable */\r
+#define USART_CR1_PS_Pos                    (9U)                               \r
+#define USART_CR1_PS_Msk                    (0x1UL << USART_CR1_PS_Pos)         /*!< 0x00000200 */\r
+#define USART_CR1_PS                        USART_CR1_PS_Msk                   /*!< Parity Selection */\r
+#define USART_CR1_PCE_Pos                   (10U)                              \r
+#define USART_CR1_PCE_Msk                   (0x1UL << USART_CR1_PCE_Pos)        /*!< 0x00000400 */\r
+#define USART_CR1_PCE                       USART_CR1_PCE_Msk                  /*!< Parity Control Enable */\r
+#define USART_CR1_WAKE_Pos                  (11U)                              \r
+#define USART_CR1_WAKE_Msk                  (0x1UL << USART_CR1_WAKE_Pos)       /*!< 0x00000800 */\r
+#define USART_CR1_WAKE                      USART_CR1_WAKE_Msk                 /*!< Wakeup method */\r
+#define USART_CR1_M_Pos                     (12U)                              \r
+#define USART_CR1_M_Msk                     (0x1UL << USART_CR1_M_Pos)          /*!< 0x00001000 */\r
+#define USART_CR1_M                         USART_CR1_M_Msk                    /*!< Word length */\r
+#define USART_CR1_UE_Pos                    (13U)                              \r
+#define USART_CR1_UE_Msk                    (0x1UL << USART_CR1_UE_Pos)         /*!< 0x00002000 */\r
+#define USART_CR1_UE                        USART_CR1_UE_Msk                   /*!< USART Enable */\r
+\r
+/******************  Bit definition for USART_CR2 register  *******************/\r
+#define USART_CR2_ADD_Pos                   (0U)                               \r
+#define USART_CR2_ADD_Msk                   (0xFUL << USART_CR2_ADD_Pos)        /*!< 0x0000000F */\r
+#define USART_CR2_ADD                       USART_CR2_ADD_Msk                  /*!< Address of the USART node */\r
+#define USART_CR2_LBDL_Pos                  (5U)                               \r
+#define USART_CR2_LBDL_Msk                  (0x1UL << USART_CR2_LBDL_Pos)       /*!< 0x00000020 */\r
+#define USART_CR2_LBDL                      USART_CR2_LBDL_Msk                 /*!< LIN Break Detection Length */\r
+#define USART_CR2_LBDIE_Pos                 (6U)                               \r
+#define USART_CR2_LBDIE_Msk                 (0x1UL << USART_CR2_LBDIE_Pos)      /*!< 0x00000040 */\r
+#define USART_CR2_LBDIE                     USART_CR2_LBDIE_Msk                /*!< LIN Break Detection Interrupt Enable */\r
+#define USART_CR2_LBCL_Pos                  (8U)                               \r
+#define USART_CR2_LBCL_Msk                  (0x1UL << USART_CR2_LBCL_Pos)       /*!< 0x00000100 */\r
+#define USART_CR2_LBCL                      USART_CR2_LBCL_Msk                 /*!< Last Bit Clock pulse */\r
+#define USART_CR2_CPHA_Pos                  (9U)                               \r
+#define USART_CR2_CPHA_Msk                  (0x1UL << USART_CR2_CPHA_Pos)       /*!< 0x00000200 */\r
+#define USART_CR2_CPHA                      USART_CR2_CPHA_Msk                 /*!< Clock Phase */\r
+#define USART_CR2_CPOL_Pos                  (10U)                              \r
+#define USART_CR2_CPOL_Msk                  (0x1UL << USART_CR2_CPOL_Pos)       /*!< 0x00000400 */\r
+#define USART_CR2_CPOL                      USART_CR2_CPOL_Msk                 /*!< Clock Polarity */\r
+#define USART_CR2_CLKEN_Pos                 (11U)                              \r
+#define USART_CR2_CLKEN_Msk                 (0x1UL << USART_CR2_CLKEN_Pos)      /*!< 0x00000800 */\r
+#define USART_CR2_CLKEN                     USART_CR2_CLKEN_Msk                /*!< Clock Enable */\r
+\r
+#define USART_CR2_STOP_Pos                  (12U)                              \r
+#define USART_CR2_STOP_Msk                  (0x3UL << USART_CR2_STOP_Pos)       /*!< 0x00003000 */\r
+#define USART_CR2_STOP                      USART_CR2_STOP_Msk                 /*!< STOP[1:0] bits (STOP bits) */\r
+#define USART_CR2_STOP_0                    (0x1UL << USART_CR2_STOP_Pos)       /*!< 0x00001000 */\r
+#define USART_CR2_STOP_1                    (0x2UL << USART_CR2_STOP_Pos)       /*!< 0x00002000 */\r
+\r
+#define USART_CR2_LINEN_Pos                 (14U)                              \r
+#define USART_CR2_LINEN_Msk                 (0x1UL << USART_CR2_LINEN_Pos)      /*!< 0x00004000 */\r
+#define USART_CR2_LINEN                     USART_CR2_LINEN_Msk                /*!< LIN mode enable */\r
+\r
+/******************  Bit definition for USART_CR3 register  *******************/\r
+#define USART_CR3_EIE_Pos                   (0U)                               \r
+#define USART_CR3_EIE_Msk                   (0x1UL << USART_CR3_EIE_Pos)        /*!< 0x00000001 */\r
+#define USART_CR3_EIE                       USART_CR3_EIE_Msk                  /*!< Error Interrupt Enable */\r
+#define USART_CR3_IREN_Pos                  (1U)                               \r
+#define USART_CR3_IREN_Msk                  (0x1UL << USART_CR3_IREN_Pos)       /*!< 0x00000002 */\r
+#define USART_CR3_IREN                      USART_CR3_IREN_Msk                 /*!< IrDA mode Enable */\r
+#define USART_CR3_IRLP_Pos                  (2U)                               \r
+#define USART_CR3_IRLP_Msk                  (0x1UL << USART_CR3_IRLP_Pos)       /*!< 0x00000004 */\r
+#define USART_CR3_IRLP                      USART_CR3_IRLP_Msk                 /*!< IrDA Low-Power */\r
+#define USART_CR3_HDSEL_Pos                 (3U)                               \r
+#define USART_CR3_HDSEL_Msk                 (0x1UL << USART_CR3_HDSEL_Pos)      /*!< 0x00000008 */\r
+#define USART_CR3_HDSEL                     USART_CR3_HDSEL_Msk                /*!< Half-Duplex Selection */\r
+#define USART_CR3_NACK_Pos                  (4U)                               \r
+#define USART_CR3_NACK_Msk                  (0x1UL << USART_CR3_NACK_Pos)       /*!< 0x00000010 */\r
+#define USART_CR3_NACK                      USART_CR3_NACK_Msk                 /*!< Smartcard NACK enable */\r
+#define USART_CR3_SCEN_Pos                  (5U)                               \r
+#define USART_CR3_SCEN_Msk                  (0x1UL << USART_CR3_SCEN_Pos)       /*!< 0x00000020 */\r
+#define USART_CR3_SCEN                      USART_CR3_SCEN_Msk                 /*!< Smartcard mode enable */\r
+#define USART_CR3_DMAR_Pos                  (6U)                               \r
+#define USART_CR3_DMAR_Msk                  (0x1UL << USART_CR3_DMAR_Pos)       /*!< 0x00000040 */\r
+#define USART_CR3_DMAR                      USART_CR3_DMAR_Msk                 /*!< DMA Enable Receiver */\r
+#define USART_CR3_DMAT_Pos                  (7U)                               \r
+#define USART_CR3_DMAT_Msk                  (0x1UL << USART_CR3_DMAT_Pos)       /*!< 0x00000080 */\r
+#define USART_CR3_DMAT                      USART_CR3_DMAT_Msk                 /*!< DMA Enable Transmitter */\r
+#define USART_CR3_RTSE_Pos                  (8U)                               \r
+#define USART_CR3_RTSE_Msk                  (0x1UL << USART_CR3_RTSE_Pos)       /*!< 0x00000100 */\r
+#define USART_CR3_RTSE                      USART_CR3_RTSE_Msk                 /*!< RTS Enable */\r
+#define USART_CR3_CTSE_Pos                  (9U)                               \r
+#define USART_CR3_CTSE_Msk                  (0x1UL << USART_CR3_CTSE_Pos)       /*!< 0x00000200 */\r
+#define USART_CR3_CTSE                      USART_CR3_CTSE_Msk                 /*!< CTS Enable */\r
+#define USART_CR3_CTSIE_Pos                 (10U)                              \r
+#define USART_CR3_CTSIE_Msk                 (0x1UL << USART_CR3_CTSIE_Pos)      /*!< 0x00000400 */\r
+#define USART_CR3_CTSIE                     USART_CR3_CTSIE_Msk                /*!< CTS Interrupt Enable */\r
+\r
+/******************  Bit definition for USART_GTPR register  ******************/\r
+#define USART_GTPR_PSC_Pos                  (0U)                               \r
+#define USART_GTPR_PSC_Msk                  (0xFFUL << USART_GTPR_PSC_Pos)      /*!< 0x000000FF */\r
+#define USART_GTPR_PSC                      USART_GTPR_PSC_Msk                 /*!< PSC[7:0] bits (Prescaler value) */\r
+#define USART_GTPR_PSC_0                    (0x01UL << USART_GTPR_PSC_Pos)      /*!< 0x00000001 */\r
+#define USART_GTPR_PSC_1                    (0x02UL << USART_GTPR_PSC_Pos)      /*!< 0x00000002 */\r
+#define USART_GTPR_PSC_2                    (0x04UL << USART_GTPR_PSC_Pos)      /*!< 0x00000004 */\r
+#define USART_GTPR_PSC_3                    (0x08UL << USART_GTPR_PSC_Pos)      /*!< 0x00000008 */\r
+#define USART_GTPR_PSC_4                    (0x10UL << USART_GTPR_PSC_Pos)      /*!< 0x00000010 */\r
+#define USART_GTPR_PSC_5                    (0x20UL << USART_GTPR_PSC_Pos)      /*!< 0x00000020 */\r
+#define USART_GTPR_PSC_6                    (0x40UL << USART_GTPR_PSC_Pos)      /*!< 0x00000040 */\r
+#define USART_GTPR_PSC_7                    (0x80UL << USART_GTPR_PSC_Pos)      /*!< 0x00000080 */\r
+\r
+#define USART_GTPR_GT_Pos                   (8U)                               \r
+#define USART_GTPR_GT_Msk                   (0xFFUL << USART_GTPR_GT_Pos)       /*!< 0x0000FF00 */\r
+#define USART_GTPR_GT                       USART_GTPR_GT_Msk                  /*!< Guard time value */\r
+\r
+/******************************************************************************/\r
+/*                                                                            */\r
+/*                                 Debug MCU                                  */\r
+/*                                                                            */\r
+/******************************************************************************/\r
+\r
+/****************  Bit definition for DBGMCU_IDCODE register  *****************/\r
+#define DBGMCU_IDCODE_DEV_ID_Pos            (0U)                               \r
+#define DBGMCU_IDCODE_DEV_ID_Msk            (0xFFFUL << DBGMCU_IDCODE_DEV_ID_Pos) /*!< 0x00000FFF */\r
+#define DBGMCU_IDCODE_DEV_ID                DBGMCU_IDCODE_DEV_ID_Msk           /*!< Device Identifier */\r
+\r
+#define DBGMCU_IDCODE_REV_ID_Pos            (16U)                              \r
+#define DBGMCU_IDCODE_REV_ID_Msk            (0xFFFFUL << DBGMCU_IDCODE_REV_ID_Pos) /*!< 0xFFFF0000 */\r
+#define DBGMCU_IDCODE_REV_ID                DBGMCU_IDCODE_REV_ID_Msk           /*!< REV_ID[15:0] bits (Revision Identifier) */\r
+#define DBGMCU_IDCODE_REV_ID_0              (0x0001UL << DBGMCU_IDCODE_REV_ID_Pos) /*!< 0x00010000 */\r
+#define DBGMCU_IDCODE_REV_ID_1              (0x0002UL << DBGMCU_IDCODE_REV_ID_Pos) /*!< 0x00020000 */\r
+#define DBGMCU_IDCODE_REV_ID_2              (0x0004UL << DBGMCU_IDCODE_REV_ID_Pos) /*!< 0x00040000 */\r
+#define DBGMCU_IDCODE_REV_ID_3              (0x0008UL << DBGMCU_IDCODE_REV_ID_Pos) /*!< 0x00080000 */\r
+#define DBGMCU_IDCODE_REV_ID_4              (0x0010UL << DBGMCU_IDCODE_REV_ID_Pos) /*!< 0x00100000 */\r
+#define DBGMCU_IDCODE_REV_ID_5              (0x0020UL << DBGMCU_IDCODE_REV_ID_Pos) /*!< 0x00200000 */\r
+#define DBGMCU_IDCODE_REV_ID_6              (0x0040UL << DBGMCU_IDCODE_REV_ID_Pos) /*!< 0x00400000 */\r
+#define DBGMCU_IDCODE_REV_ID_7              (0x0080UL << DBGMCU_IDCODE_REV_ID_Pos) /*!< 0x00800000 */\r
+#define DBGMCU_IDCODE_REV_ID_8              (0x0100UL << DBGMCU_IDCODE_REV_ID_Pos) /*!< 0x01000000 */\r
+#define DBGMCU_IDCODE_REV_ID_9              (0x0200UL << DBGMCU_IDCODE_REV_ID_Pos) /*!< 0x02000000 */\r
+#define DBGMCU_IDCODE_REV_ID_10             (0x0400UL << DBGMCU_IDCODE_REV_ID_Pos) /*!< 0x04000000 */\r
+#define DBGMCU_IDCODE_REV_ID_11             (0x0800UL << DBGMCU_IDCODE_REV_ID_Pos) /*!< 0x08000000 */\r
+#define DBGMCU_IDCODE_REV_ID_12             (0x1000UL << DBGMCU_IDCODE_REV_ID_Pos) /*!< 0x10000000 */\r
+#define DBGMCU_IDCODE_REV_ID_13             (0x2000UL << DBGMCU_IDCODE_REV_ID_Pos) /*!< 0x20000000 */\r
+#define DBGMCU_IDCODE_REV_ID_14             (0x4000UL << DBGMCU_IDCODE_REV_ID_Pos) /*!< 0x40000000 */\r
+#define DBGMCU_IDCODE_REV_ID_15             (0x8000UL << DBGMCU_IDCODE_REV_ID_Pos) /*!< 0x80000000 */\r
+\r
+/******************  Bit definition for DBGMCU_CR register  *******************/\r
+#define DBGMCU_CR_DBG_SLEEP_Pos             (0U)                               \r
+#define DBGMCU_CR_DBG_SLEEP_Msk             (0x1UL << DBGMCU_CR_DBG_SLEEP_Pos)  /*!< 0x00000001 */\r
+#define DBGMCU_CR_DBG_SLEEP                 DBGMCU_CR_DBG_SLEEP_Msk            /*!< Debug Sleep Mode */\r
+#define DBGMCU_CR_DBG_STOP_Pos              (1U)                               \r
+#define DBGMCU_CR_DBG_STOP_Msk              (0x1UL << DBGMCU_CR_DBG_STOP_Pos)   /*!< 0x00000002 */\r
+#define DBGMCU_CR_DBG_STOP                  DBGMCU_CR_DBG_STOP_Msk             /*!< Debug Stop Mode */\r
+#define DBGMCU_CR_DBG_STANDBY_Pos           (2U)                               \r
+#define DBGMCU_CR_DBG_STANDBY_Msk           (0x1UL << DBGMCU_CR_DBG_STANDBY_Pos) /*!< 0x00000004 */\r
+#define DBGMCU_CR_DBG_STANDBY               DBGMCU_CR_DBG_STANDBY_Msk          /*!< Debug Standby mode */\r
+#define DBGMCU_CR_TRACE_IOEN_Pos            (5U)                               \r
+#define DBGMCU_CR_TRACE_IOEN_Msk            (0x1UL << DBGMCU_CR_TRACE_IOEN_Pos) /*!< 0x00000020 */\r
+#define DBGMCU_CR_TRACE_IOEN                DBGMCU_CR_TRACE_IOEN_Msk           /*!< Trace Pin Assignment Control */\r
+\r
+#define DBGMCU_CR_TRACE_MODE_Pos            (6U)                               \r
+#define DBGMCU_CR_TRACE_MODE_Msk            (0x3UL << DBGMCU_CR_TRACE_MODE_Pos) /*!< 0x000000C0 */\r
+#define DBGMCU_CR_TRACE_MODE                DBGMCU_CR_TRACE_MODE_Msk           /*!< TRACE_MODE[1:0] bits (Trace Pin Assignment Control) */\r
+#define DBGMCU_CR_TRACE_MODE_0              (0x1UL << DBGMCU_CR_TRACE_MODE_Pos) /*!< 0x00000040 */\r
+#define DBGMCU_CR_TRACE_MODE_1              (0x2UL << DBGMCU_CR_TRACE_MODE_Pos) /*!< 0x00000080 */\r
+\r
+#define DBGMCU_CR_DBG_IWDG_STOP_Pos         (8U)                               \r
+#define DBGMCU_CR_DBG_IWDG_STOP_Msk         (0x1UL << DBGMCU_CR_DBG_IWDG_STOP_Pos) /*!< 0x00000100 */\r
+#define DBGMCU_CR_DBG_IWDG_STOP             DBGMCU_CR_DBG_IWDG_STOP_Msk        /*!< Debug Independent Watchdog stopped when Core is halted */\r
+#define DBGMCU_CR_DBG_WWDG_STOP_Pos         (9U)                               \r
+#define DBGMCU_CR_DBG_WWDG_STOP_Msk         (0x1UL << DBGMCU_CR_DBG_WWDG_STOP_Pos) /*!< 0x00000200 */\r
+#define DBGMCU_CR_DBG_WWDG_STOP             DBGMCU_CR_DBG_WWDG_STOP_Msk        /*!< Debug Window Watchdog stopped when Core is halted */\r
+#define DBGMCU_CR_DBG_TIM1_STOP_Pos         (10U)                              \r
+#define DBGMCU_CR_DBG_TIM1_STOP_Msk         (0x1UL << DBGMCU_CR_DBG_TIM1_STOP_Pos) /*!< 0x00000400 */\r
+#define DBGMCU_CR_DBG_TIM1_STOP             DBGMCU_CR_DBG_TIM1_STOP_Msk        /*!< TIM1 counter stopped when core is halted */\r
+#define DBGMCU_CR_DBG_TIM2_STOP_Pos         (11U)                              \r
+#define DBGMCU_CR_DBG_TIM2_STOP_Msk         (0x1UL << DBGMCU_CR_DBG_TIM2_STOP_Pos) /*!< 0x00000800 */\r
+#define DBGMCU_CR_DBG_TIM2_STOP             DBGMCU_CR_DBG_TIM2_STOP_Msk        /*!< TIM2 counter stopped when core is halted */\r
+#define DBGMCU_CR_DBG_TIM3_STOP_Pos         (12U)                              \r
+#define DBGMCU_CR_DBG_TIM3_STOP_Msk         (0x1UL << DBGMCU_CR_DBG_TIM3_STOP_Pos) /*!< 0x00001000 */\r
+#define DBGMCU_CR_DBG_TIM3_STOP             DBGMCU_CR_DBG_TIM3_STOP_Msk        /*!< TIM3 counter stopped when core is halted */\r
+#define DBGMCU_CR_DBG_TIM4_STOP_Pos         (13U)                              \r
+#define DBGMCU_CR_DBG_TIM4_STOP_Msk         (0x1UL << DBGMCU_CR_DBG_TIM4_STOP_Pos) /*!< 0x00002000 */\r
+#define DBGMCU_CR_DBG_TIM4_STOP             DBGMCU_CR_DBG_TIM4_STOP_Msk        /*!< TIM4 counter stopped when core is halted */\r
+#define DBGMCU_CR_DBG_CAN1_STOP_Pos         (14U)                              \r
+#define DBGMCU_CR_DBG_CAN1_STOP_Msk         (0x1UL << DBGMCU_CR_DBG_CAN1_STOP_Pos) /*!< 0x00004000 */\r
+#define DBGMCU_CR_DBG_CAN1_STOP             DBGMCU_CR_DBG_CAN1_STOP_Msk        /*!< Debug CAN1 stopped when Core is halted */\r
+#define DBGMCU_CR_DBG_I2C1_SMBUS_TIMEOUT_Pos (15U)                             \r
+#define DBGMCU_CR_DBG_I2C1_SMBUS_TIMEOUT_Msk (0x1UL << DBGMCU_CR_DBG_I2C1_SMBUS_TIMEOUT_Pos) /*!< 0x00008000 */\r
+#define DBGMCU_CR_DBG_I2C1_SMBUS_TIMEOUT    DBGMCU_CR_DBG_I2C1_SMBUS_TIMEOUT_Msk /*!< SMBUS timeout mode stopped when Core is halted */\r
+#define DBGMCU_CR_DBG_I2C2_SMBUS_TIMEOUT_Pos (16U)                             \r
+#define DBGMCU_CR_DBG_I2C2_SMBUS_TIMEOUT_Msk (0x1UL << DBGMCU_CR_DBG_I2C2_SMBUS_TIMEOUT_Pos) /*!< 0x00010000 */\r
+#define DBGMCU_CR_DBG_I2C2_SMBUS_TIMEOUT    DBGMCU_CR_DBG_I2C2_SMBUS_TIMEOUT_Msk /*!< SMBUS timeout mode stopped when Core is halted */\r
+\r
+/******************************************************************************/\r
+/*                                                                            */\r
+/*                      FLASH and Option Bytes Registers                      */\r
+/*                                                                            */\r
+/******************************************************************************/\r
+/*******************  Bit definition for FLASH_ACR register  ******************/\r
+#define FLASH_ACR_LATENCY_Pos               (0U)                               \r
+#define FLASH_ACR_LATENCY_Msk               (0x7UL << FLASH_ACR_LATENCY_Pos)    /*!< 0x00000007 */\r
+#define FLASH_ACR_LATENCY                   FLASH_ACR_LATENCY_Msk              /*!< LATENCY[2:0] bits (Latency) */\r
+#define FLASH_ACR_LATENCY_0                 (0x1UL << FLASH_ACR_LATENCY_Pos)    /*!< 0x00000001 */\r
+#define FLASH_ACR_LATENCY_1                 (0x2UL << FLASH_ACR_LATENCY_Pos)    /*!< 0x00000002 */\r
+#define FLASH_ACR_LATENCY_2                 (0x4UL << FLASH_ACR_LATENCY_Pos)    /*!< 0x00000004 */\r
+\r
+#define FLASH_ACR_HLFCYA_Pos                (3U)                               \r
+#define FLASH_ACR_HLFCYA_Msk                (0x1UL << FLASH_ACR_HLFCYA_Pos)     /*!< 0x00000008 */\r
+#define FLASH_ACR_HLFCYA                    FLASH_ACR_HLFCYA_Msk               /*!< Flash Half Cycle Access Enable */\r
+#define FLASH_ACR_PRFTBE_Pos                (4U)                               \r
+#define FLASH_ACR_PRFTBE_Msk                (0x1UL << FLASH_ACR_PRFTBE_Pos)     /*!< 0x00000010 */\r
+#define FLASH_ACR_PRFTBE                    FLASH_ACR_PRFTBE_Msk               /*!< Prefetch Buffer Enable */\r
+#define FLASH_ACR_PRFTBS_Pos                (5U)                               \r
+#define FLASH_ACR_PRFTBS_Msk                (0x1UL << FLASH_ACR_PRFTBS_Pos)     /*!< 0x00000020 */\r
+#define FLASH_ACR_PRFTBS                    FLASH_ACR_PRFTBS_Msk               /*!< Prefetch Buffer Status */\r
+\r
+/******************  Bit definition for FLASH_KEYR register  ******************/\r
+#define FLASH_KEYR_FKEYR_Pos                (0U)                               \r
+#define FLASH_KEYR_FKEYR_Msk                (0xFFFFFFFFUL << FLASH_KEYR_FKEYR_Pos) /*!< 0xFFFFFFFF */\r
+#define FLASH_KEYR_FKEYR                    FLASH_KEYR_FKEYR_Msk               /*!< FPEC Key */\r
+\r
+#define RDP_KEY_Pos                         (0U)                               \r
+#define RDP_KEY_Msk                         (0xA5UL << RDP_KEY_Pos)             /*!< 0x000000A5 */\r
+#define RDP_KEY                             RDP_KEY_Msk                        /*!< RDP Key */\r
+#define FLASH_KEY1_Pos                      (0U)                               \r
+#define FLASH_KEY1_Msk                      (0x45670123UL << FLASH_KEY1_Pos)    /*!< 0x45670123 */\r
+#define FLASH_KEY1                          FLASH_KEY1_Msk                     /*!< FPEC Key1 */\r
+#define FLASH_KEY2_Pos                      (0U)                               \r
+#define FLASH_KEY2_Msk                      (0xCDEF89ABUL << FLASH_KEY2_Pos)    /*!< 0xCDEF89AB */\r
+#define FLASH_KEY2                          FLASH_KEY2_Msk                     /*!< FPEC Key2 */\r
+\r
+/*****************  Bit definition for FLASH_OPTKEYR register  ****************/\r
+#define FLASH_OPTKEYR_OPTKEYR_Pos           (0U)                               \r
+#define FLASH_OPTKEYR_OPTKEYR_Msk           (0xFFFFFFFFUL << FLASH_OPTKEYR_OPTKEYR_Pos) /*!< 0xFFFFFFFF */\r
+#define FLASH_OPTKEYR_OPTKEYR               FLASH_OPTKEYR_OPTKEYR_Msk          /*!< Option Byte Key */\r
+\r
+#define  FLASH_OPTKEY1                       FLASH_KEY1                    /*!< Option Byte Key1 */\r
+#define  FLASH_OPTKEY2                       FLASH_KEY2                    /*!< Option Byte Key2 */\r
+\r
+/******************  Bit definition for FLASH_SR register  ********************/\r
+#define FLASH_SR_BSY_Pos                    (0U)                               \r
+#define FLASH_SR_BSY_Msk                    (0x1UL << FLASH_SR_BSY_Pos)         /*!< 0x00000001 */\r
+#define FLASH_SR_BSY                        FLASH_SR_BSY_Msk                   /*!< Busy */\r
+#define FLASH_SR_PGERR_Pos                  (2U)                               \r
+#define FLASH_SR_PGERR_Msk                  (0x1UL << FLASH_SR_PGERR_Pos)       /*!< 0x00000004 */\r
+#define FLASH_SR_PGERR                      FLASH_SR_PGERR_Msk                 /*!< Programming Error */\r
+#define FLASH_SR_WRPRTERR_Pos               (4U)                               \r
+#define FLASH_SR_WRPRTERR_Msk               (0x1UL << FLASH_SR_WRPRTERR_Pos)    /*!< 0x00000010 */\r
+#define FLASH_SR_WRPRTERR                   FLASH_SR_WRPRTERR_Msk              /*!< Write Protection Error */\r
+#define FLASH_SR_EOP_Pos                    (5U)                               \r
+#define FLASH_SR_EOP_Msk                    (0x1UL << FLASH_SR_EOP_Pos)         /*!< 0x00000020 */\r
+#define FLASH_SR_EOP                        FLASH_SR_EOP_Msk                   /*!< End of operation */\r
+\r
+/*******************  Bit definition for FLASH_CR register  *******************/\r
+#define FLASH_CR_PG_Pos                     (0U)                               \r
+#define FLASH_CR_PG_Msk                     (0x1UL << FLASH_CR_PG_Pos)          /*!< 0x00000001 */\r
+#define FLASH_CR_PG                         FLASH_CR_PG_Msk                    /*!< Programming */\r
+#define FLASH_CR_PER_Pos                    (1U)                               \r
+#define FLASH_CR_PER_Msk                    (0x1UL << FLASH_CR_PER_Pos)         /*!< 0x00000002 */\r
+#define FLASH_CR_PER                        FLASH_CR_PER_Msk                   /*!< Page Erase */\r
+#define FLASH_CR_MER_Pos                    (2U)                               \r
+#define FLASH_CR_MER_Msk                    (0x1UL << FLASH_CR_MER_Pos)         /*!< 0x00000004 */\r
+#define FLASH_CR_MER                        FLASH_CR_MER_Msk                   /*!< Mass Erase */\r
+#define FLASH_CR_OPTPG_Pos                  (4U)                               \r
+#define FLASH_CR_OPTPG_Msk                  (0x1UL << FLASH_CR_OPTPG_Pos)       /*!< 0x00000010 */\r
+#define FLASH_CR_OPTPG                      FLASH_CR_OPTPG_Msk                 /*!< Option Byte Programming */\r
+#define FLASH_CR_OPTER_Pos                  (5U)                               \r
+#define FLASH_CR_OPTER_Msk                  (0x1UL << FLASH_CR_OPTER_Pos)       /*!< 0x00000020 */\r
+#define FLASH_CR_OPTER                      FLASH_CR_OPTER_Msk                 /*!< Option Byte Erase */\r
+#define FLASH_CR_STRT_Pos                   (6U)                               \r
+#define FLASH_CR_STRT_Msk                   (0x1UL << FLASH_CR_STRT_Pos)        /*!< 0x00000040 */\r
+#define FLASH_CR_STRT                       FLASH_CR_STRT_Msk                  /*!< Start */\r
+#define FLASH_CR_LOCK_Pos                   (7U)                               \r
+#define FLASH_CR_LOCK_Msk                   (0x1UL << FLASH_CR_LOCK_Pos)        /*!< 0x00000080 */\r
+#define FLASH_CR_LOCK                       FLASH_CR_LOCK_Msk                  /*!< Lock */\r
+#define FLASH_CR_OPTWRE_Pos                 (9U)                               \r
+#define FLASH_CR_OPTWRE_Msk                 (0x1UL << FLASH_CR_OPTWRE_Pos)      /*!< 0x00000200 */\r
+#define FLASH_CR_OPTWRE                     FLASH_CR_OPTWRE_Msk                /*!< Option Bytes Write Enable */\r
+#define FLASH_CR_ERRIE_Pos                  (10U)                              \r
+#define FLASH_CR_ERRIE_Msk                  (0x1UL << FLASH_CR_ERRIE_Pos)       /*!< 0x00000400 */\r
+#define FLASH_CR_ERRIE                      FLASH_CR_ERRIE_Msk                 /*!< Error Interrupt Enable */\r
+#define FLASH_CR_EOPIE_Pos                  (12U)                              \r
+#define FLASH_CR_EOPIE_Msk                  (0x1UL << FLASH_CR_EOPIE_Pos)       /*!< 0x00001000 */\r
+#define FLASH_CR_EOPIE                      FLASH_CR_EOPIE_Msk                 /*!< End of operation interrupt enable */\r
+\r
+/*******************  Bit definition for FLASH_AR register  *******************/\r
+#define FLASH_AR_FAR_Pos                    (0U)                               \r
+#define FLASH_AR_FAR_Msk                    (0xFFFFFFFFUL << FLASH_AR_FAR_Pos)  /*!< 0xFFFFFFFF */\r
+#define FLASH_AR_FAR                        FLASH_AR_FAR_Msk                   /*!< Flash Address */\r
+\r
+/******************  Bit definition for FLASH_OBR register  *******************/\r
+#define FLASH_OBR_OPTERR_Pos                (0U)                               \r
+#define FLASH_OBR_OPTERR_Msk                (0x1UL << FLASH_OBR_OPTERR_Pos)     /*!< 0x00000001 */\r
+#define FLASH_OBR_OPTERR                    FLASH_OBR_OPTERR_Msk               /*!< Option Byte Error */\r
+#define FLASH_OBR_RDPRT_Pos                 (1U)                               \r
+#define FLASH_OBR_RDPRT_Msk                 (0x1UL << FLASH_OBR_RDPRT_Pos)      /*!< 0x00000002 */\r
+#define FLASH_OBR_RDPRT                     FLASH_OBR_RDPRT_Msk                /*!< Read protection */\r
+\r
+#define FLASH_OBR_IWDG_SW_Pos               (2U)                               \r
+#define FLASH_OBR_IWDG_SW_Msk               (0x1UL << FLASH_OBR_IWDG_SW_Pos)    /*!< 0x00000004 */\r
+#define FLASH_OBR_IWDG_SW                   FLASH_OBR_IWDG_SW_Msk              /*!< IWDG SW */\r
+#define FLASH_OBR_nRST_STOP_Pos             (3U)                               \r
+#define FLASH_OBR_nRST_STOP_Msk             (0x1UL << FLASH_OBR_nRST_STOP_Pos)  /*!< 0x00000008 */\r
+#define FLASH_OBR_nRST_STOP                 FLASH_OBR_nRST_STOP_Msk            /*!< nRST_STOP */\r
+#define FLASH_OBR_nRST_STDBY_Pos            (4U)                               \r
+#define FLASH_OBR_nRST_STDBY_Msk            (0x1UL << FLASH_OBR_nRST_STDBY_Pos) /*!< 0x00000010 */\r
+#define FLASH_OBR_nRST_STDBY                FLASH_OBR_nRST_STDBY_Msk           /*!< nRST_STDBY */\r
+#define FLASH_OBR_USER_Pos                  (2U)                               \r
+#define FLASH_OBR_USER_Msk                  (0x7UL << FLASH_OBR_USER_Pos)       /*!< 0x0000001C */\r
+#define FLASH_OBR_USER                      FLASH_OBR_USER_Msk                 /*!< User Option Bytes */\r
+#define FLASH_OBR_DATA0_Pos                 (10U)                              \r
+#define FLASH_OBR_DATA0_Msk                 (0xFFUL << FLASH_OBR_DATA0_Pos)     /*!< 0x0003FC00 */\r
+#define FLASH_OBR_DATA0                     FLASH_OBR_DATA0_Msk                /*!< Data0 */\r
+#define FLASH_OBR_DATA1_Pos                 (18U)                              \r
+#define FLASH_OBR_DATA1_Msk                 (0xFFUL << FLASH_OBR_DATA1_Pos)     /*!< 0x03FC0000 */\r
+#define FLASH_OBR_DATA1                     FLASH_OBR_DATA1_Msk                /*!< Data1 */\r
+\r
+/******************  Bit definition for FLASH_WRPR register  ******************/\r
+#define FLASH_WRPR_WRP_Pos                  (0U)                               \r
+#define FLASH_WRPR_WRP_Msk                  (0xFFFFFFFFUL << FLASH_WRPR_WRP_Pos) /*!< 0xFFFFFFFF */\r
+#define FLASH_WRPR_WRP                      FLASH_WRPR_WRP_Msk                 /*!< Write Protect */\r
+\r
+/*----------------------------------------------------------------------------*/\r
+\r
+/******************  Bit definition for FLASH_RDP register  *******************/\r
+#define FLASH_RDP_RDP_Pos                   (0U)                               \r
+#define FLASH_RDP_RDP_Msk                   (0xFFUL << FLASH_RDP_RDP_Pos)       /*!< 0x000000FF */\r
+#define FLASH_RDP_RDP                       FLASH_RDP_RDP_Msk                  /*!< Read protection option byte */\r
+#define FLASH_RDP_nRDP_Pos                  (8U)                               \r
+#define FLASH_RDP_nRDP_Msk                  (0xFFUL << FLASH_RDP_nRDP_Pos)      /*!< 0x0000FF00 */\r
+#define FLASH_RDP_nRDP                      FLASH_RDP_nRDP_Msk                 /*!< Read protection complemented option byte */\r
+\r
+/******************  Bit definition for FLASH_USER register  ******************/\r
+#define FLASH_USER_USER_Pos                 (16U)                              \r
+#define FLASH_USER_USER_Msk                 (0xFFUL << FLASH_USER_USER_Pos)     /*!< 0x00FF0000 */\r
+#define FLASH_USER_USER                     FLASH_USER_USER_Msk                /*!< User option byte */\r
+#define FLASH_USER_nUSER_Pos                (24U)                              \r
+#define FLASH_USER_nUSER_Msk                (0xFFUL << FLASH_USER_nUSER_Pos)    /*!< 0xFF000000 */\r
+#define FLASH_USER_nUSER                    FLASH_USER_nUSER_Msk               /*!< User complemented option byte */\r
+\r
+/******************  Bit definition for FLASH_Data0 register  *****************/\r
+#define FLASH_DATA0_DATA0_Pos               (0U)                               \r
+#define FLASH_DATA0_DATA0_Msk               (0xFFUL << FLASH_DATA0_DATA0_Pos)   /*!< 0x000000FF */\r
+#define FLASH_DATA0_DATA0                   FLASH_DATA0_DATA0_Msk              /*!< User data storage option byte */\r
+#define FLASH_DATA0_nDATA0_Pos              (8U)                               \r
+#define FLASH_DATA0_nDATA0_Msk              (0xFFUL << FLASH_DATA0_nDATA0_Pos)  /*!< 0x0000FF00 */\r
+#define FLASH_DATA0_nDATA0                  FLASH_DATA0_nDATA0_Msk             /*!< User data storage complemented option byte */\r
+\r
+/******************  Bit definition for FLASH_Data1 register  *****************/\r
+#define FLASH_DATA1_DATA1_Pos               (16U)                              \r
+#define FLASH_DATA1_DATA1_Msk               (0xFFUL << FLASH_DATA1_DATA1_Pos)   /*!< 0x00FF0000 */\r
+#define FLASH_DATA1_DATA1                   FLASH_DATA1_DATA1_Msk              /*!< User data storage option byte */\r
+#define FLASH_DATA1_nDATA1_Pos              (24U)                              \r
+#define FLASH_DATA1_nDATA1_Msk              (0xFFUL << FLASH_DATA1_nDATA1_Pos)  /*!< 0xFF000000 */\r
+#define FLASH_DATA1_nDATA1                  FLASH_DATA1_nDATA1_Msk             /*!< User data storage complemented option byte */\r
+\r
+/******************  Bit definition for FLASH_WRP0 register  ******************/\r
+#define FLASH_WRP0_WRP0_Pos                 (0U)                               \r
+#define FLASH_WRP0_WRP0_Msk                 (0xFFUL << FLASH_WRP0_WRP0_Pos)     /*!< 0x000000FF */\r
+#define FLASH_WRP0_WRP0                     FLASH_WRP0_WRP0_Msk                /*!< Flash memory write protection option bytes */\r
+#define FLASH_WRP0_nWRP0_Pos                (8U)                               \r
+#define FLASH_WRP0_nWRP0_Msk                (0xFFUL << FLASH_WRP0_nWRP0_Pos)    /*!< 0x0000FF00 */\r
+#define FLASH_WRP0_nWRP0                    FLASH_WRP0_nWRP0_Msk               /*!< Flash memory write protection complemented option bytes */\r
+\r
+/******************  Bit definition for FLASH_WRP1 register  ******************/\r
+#define FLASH_WRP1_WRP1_Pos                 (16U)                              \r
+#define FLASH_WRP1_WRP1_Msk                 (0xFFUL << FLASH_WRP1_WRP1_Pos)     /*!< 0x00FF0000 */\r
+#define FLASH_WRP1_WRP1                     FLASH_WRP1_WRP1_Msk                /*!< Flash memory write protection option bytes */\r
+#define FLASH_WRP1_nWRP1_Pos                (24U)                              \r
+#define FLASH_WRP1_nWRP1_Msk                (0xFFUL << FLASH_WRP1_nWRP1_Pos)    /*!< 0xFF000000 */\r
+#define FLASH_WRP1_nWRP1                    FLASH_WRP1_nWRP1_Msk               /*!< Flash memory write protection complemented option bytes */\r
+\r
+/******************  Bit definition for FLASH_WRP2 register  ******************/\r
+#define FLASH_WRP2_WRP2_Pos                 (0U)                               \r
+#define FLASH_WRP2_WRP2_Msk                 (0xFFUL << FLASH_WRP2_WRP2_Pos)     /*!< 0x000000FF */\r
+#define FLASH_WRP2_WRP2                     FLASH_WRP2_WRP2_Msk                /*!< Flash memory write protection option bytes */\r
+#define FLASH_WRP2_nWRP2_Pos                (8U)                               \r
+#define FLASH_WRP2_nWRP2_Msk                (0xFFUL << FLASH_WRP2_nWRP2_Pos)    /*!< 0x0000FF00 */\r
+#define FLASH_WRP2_nWRP2                    FLASH_WRP2_nWRP2_Msk               /*!< Flash memory write protection complemented option bytes */\r
+\r
+/******************  Bit definition for FLASH_WRP3 register  ******************/\r
+#define FLASH_WRP3_WRP3_Pos                 (16U)                              \r
+#define FLASH_WRP3_WRP3_Msk                 (0xFFUL << FLASH_WRP3_WRP3_Pos)     /*!< 0x00FF0000 */\r
+#define FLASH_WRP3_WRP3                     FLASH_WRP3_WRP3_Msk                /*!< Flash memory write protection option bytes */\r
+#define FLASH_WRP3_nWRP3_Pos                (24U)                              \r
+#define FLASH_WRP3_nWRP3_Msk                (0xFFUL << FLASH_WRP3_nWRP3_Pos)    /*!< 0xFF000000 */\r
+#define FLASH_WRP3_nWRP3                    FLASH_WRP3_nWRP3_Msk               /*!< Flash memory write protection complemented option bytes */\r
+\r
+\r
+\r
+/**\r
+  * @}\r
+*/\r
+\r
+/**\r
+  * @}\r
+*/ \r
+\r
+/** @addtogroup Exported_macro\r
+  * @{\r
+  */\r
+\r
+/****************************** ADC Instances *********************************/\r
+#define IS_ADC_ALL_INSTANCE(INSTANCE) (((INSTANCE) == ADC1) || \\r
+                                       ((INSTANCE) == ADC2))\r
+\r
+#define IS_ADC_COMMON_INSTANCE(INSTANCE) ((INSTANCE) == ADC12_COMMON)\r
+\r
+#define IS_ADC_MULTIMODE_MASTER_INSTANCE(INSTANCE) ((INSTANCE) == ADC1)\r
+\r
+#define IS_ADC_DMA_CAPABILITY_INSTANCE(INSTANCE) ((INSTANCE) == ADC1)\r
+\r
+/****************************** CAN Instances *********************************/    \r
+#define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN1)\r
+\r
+/****************************** CRC Instances *********************************/\r
+#define IS_CRC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CRC)\r
+\r
+/****************************** DAC Instances *********************************/\r
+\r
+/****************************** DMA Instances *********************************/\r
+#define IS_DMA_ALL_INSTANCE(INSTANCE) (((INSTANCE) == DMA1_Channel1) || \\r
+                                       ((INSTANCE) == DMA1_Channel2) || \\r
+                                       ((INSTANCE) == DMA1_Channel3) || \\r
+                                       ((INSTANCE) == DMA1_Channel4) || \\r
+                                       ((INSTANCE) == DMA1_Channel5) || \\r
+                                       ((INSTANCE) == DMA1_Channel6) || \\r
+                                       ((INSTANCE) == DMA1_Channel7))\r
+  \r
+/******************************* GPIO Instances *******************************/\r
+#define IS_GPIO_ALL_INSTANCE(INSTANCE) (((INSTANCE) == GPIOA) || \\r
+                                        ((INSTANCE) == GPIOB) || \\r
+                                        ((INSTANCE) == GPIOC) || \\r
+                                        ((INSTANCE) == GPIOD) || \\r
+                                        ((INSTANCE) == GPIOE))\r
+\r
+/**************************** GPIO Alternate Function Instances ***************/\r
+#define IS_GPIO_AF_INSTANCE(INSTANCE) IS_GPIO_ALL_INSTANCE(INSTANCE)\r
+\r
+/**************************** GPIO Lock Instances *****************************/\r
+#define IS_GPIO_LOCK_INSTANCE(INSTANCE) IS_GPIO_ALL_INSTANCE(INSTANCE)\r
+\r
+/******************************** I2C Instances *******************************/\r
+#define IS_I2C_ALL_INSTANCE(INSTANCE) (((INSTANCE) == I2C1) || \\r
+                                       ((INSTANCE) == I2C2))\r
+\r
+/******************************* SMBUS Instances ******************************/\r
+#define IS_SMBUS_ALL_INSTANCE         IS_I2C_ALL_INSTANCE\r
+\r
+/****************************** IWDG Instances ********************************/\r
+#define IS_IWDG_ALL_INSTANCE(INSTANCE)  ((INSTANCE) == IWDG)\r
+\r
+/******************************** SPI Instances *******************************/\r
+#define IS_SPI_ALL_INSTANCE(INSTANCE) (((INSTANCE) == SPI1) || \\r
+                                       ((INSTANCE) == SPI2))\r
+\r
+/****************************** START TIM Instances ***************************/\r
+/****************************** TIM Instances *********************************/\r
+#define IS_TIM_INSTANCE(INSTANCE)\\r
+  (((INSTANCE) == TIM1)    || \\r
+   ((INSTANCE) == TIM2)    || \\r
+   ((INSTANCE) == TIM3)    || \\r
+   ((INSTANCE) == TIM4))\r
+\r
+#define IS_TIM_ADVANCED_INSTANCE(INSTANCE) ((INSTANCE) == TIM1)\r
+\r
+#define IS_TIM_CC1_INSTANCE(INSTANCE)\\r
+  (((INSTANCE) == TIM1)    || \\r
+   ((INSTANCE) == TIM2)    || \\r
+   ((INSTANCE) == TIM3)    || \\r
+   ((INSTANCE) == TIM4))\r
+\r
+#define IS_TIM_CC2_INSTANCE(INSTANCE)\\r
+  (((INSTANCE) == TIM1)    || \\r
+   ((INSTANCE) == TIM2)    || \\r
+   ((INSTANCE) == TIM3)    || \\r
+   ((INSTANCE) == TIM4))\r
+\r
+#define IS_TIM_CC3_INSTANCE(INSTANCE)\\r
+  (((INSTANCE) == TIM1)    || \\r
+   ((INSTANCE) == TIM2)    || \\r
+   ((INSTANCE) == TIM3)    || \\r
+   ((INSTANCE) == TIM4))\r
+\r
+#define IS_TIM_CC4_INSTANCE(INSTANCE)\\r
+  (((INSTANCE) == TIM1)    || \\r
+   ((INSTANCE) == TIM2)    || \\r
+   ((INSTANCE) == TIM3)    || \\r
+   ((INSTANCE) == TIM4))\r
+\r
+#define IS_TIM_CLOCKSOURCE_ETRMODE1_INSTANCE(INSTANCE)\\r
+  (((INSTANCE) == TIM1)    || \\r
+   ((INSTANCE) == TIM2)    || \\r
+   ((INSTANCE) == TIM3)    || \\r
+   ((INSTANCE) == TIM4))\r
+\r
+#define IS_TIM_CLOCKSOURCE_ETRMODE2_INSTANCE(INSTANCE)\\r
+  (((INSTANCE) == TIM1)    || \\r
+   ((INSTANCE) == TIM2)    || \\r
+   ((INSTANCE) == TIM3)    || \\r
+   ((INSTANCE) == TIM4))\r
+\r
+#define IS_TIM_CLOCKSOURCE_TIX_INSTANCE(INSTANCE)\\r
+  (((INSTANCE) == TIM1)    || \\r
+   ((INSTANCE) == TIM2)    || \\r
+   ((INSTANCE) == TIM3)    || \\r
+   ((INSTANCE) == TIM4))\r
+\r
+#define IS_TIM_CLOCKSOURCE_ITRX_INSTANCE(INSTANCE)\\r
+  (((INSTANCE) == TIM1)    || \\r
+   ((INSTANCE) == TIM2)    || \\r
+   ((INSTANCE) == TIM3)    || \\r
+   ((INSTANCE) == TIM4))\r
+\r
+#define IS_TIM_OCXREF_CLEAR_INSTANCE(INSTANCE)\\r
+  (((INSTANCE) == TIM1)    || \\r
+   ((INSTANCE) == TIM2)    || \\r
+   ((INSTANCE) == TIM3)    || \\r
+   ((INSTANCE) == TIM4))\r
+\r
+#define IS_TIM_ENCODER_INTERFACE_INSTANCE(INSTANCE)\\r
+  (((INSTANCE) == TIM1)    || \\r
+   ((INSTANCE) == TIM2)    || \\r
+   ((INSTANCE) == TIM3)    || \\r
+   ((INSTANCE) == TIM4))\r
+\r
+#define IS_TIM_XOR_INSTANCE(INSTANCE)\\r
+  (((INSTANCE) == TIM1)    || \\r
+   ((INSTANCE) == TIM2)    || \\r
+   ((INSTANCE) == TIM3)    || \\r
+   ((INSTANCE) == TIM4))\r
+\r
+#define IS_TIM_MASTER_INSTANCE(INSTANCE)\\r
+  (((INSTANCE) == TIM1)    || \\r
+   ((INSTANCE) == TIM2)    || \\r
+   ((INSTANCE) == TIM3)    || \\r
+   ((INSTANCE) == TIM4))\r
+\r
+#define IS_TIM_SLAVE_INSTANCE(INSTANCE)\\r
+  (((INSTANCE) == TIM1)    || \\r
+   ((INSTANCE) == TIM2)    || \\r
+   ((INSTANCE) == TIM3)    || \\r
+   ((INSTANCE) == TIM4))\r
+\r
+#define IS_TIM_DMABURST_INSTANCE(INSTANCE)\\r
+  (((INSTANCE) == TIM1)    || \\r
+   ((INSTANCE) == TIM2)    || \\r
+   ((INSTANCE) == TIM3)    || \\r
+   ((INSTANCE) == TIM4))\r
+\r
+#define IS_TIM_BREAK_INSTANCE(INSTANCE)\\r
+  ((INSTANCE) == TIM1)\r
+\r
+#define IS_TIM_CCX_INSTANCE(INSTANCE, CHANNEL) \\r
+   ((((INSTANCE) == TIM1) &&                  \\r
+     (((CHANNEL) == TIM_CHANNEL_1) ||          \\r
+      ((CHANNEL) == TIM_CHANNEL_2) ||          \\r
+      ((CHANNEL) == TIM_CHANNEL_3) ||          \\r
+      ((CHANNEL) == TIM_CHANNEL_4)))           \\r
+    ||                                         \\r
+    (((INSTANCE) == TIM2) &&                   \\r
+     (((CHANNEL) == TIM_CHANNEL_1) ||          \\r
+      ((CHANNEL) == TIM_CHANNEL_2) ||          \\r
+      ((CHANNEL) == TIM_CHANNEL_3) ||          \\r
+      ((CHANNEL) == TIM_CHANNEL_4)))           \\r
+    ||                                         \\r
+    (((INSTANCE) == TIM3) &&                   \\r
+     (((CHANNEL) == TIM_CHANNEL_1) ||          \\r
+      ((CHANNEL) == TIM_CHANNEL_2) ||          \\r
+      ((CHANNEL) == TIM_CHANNEL_3) ||          \\r
+      ((CHANNEL) == TIM_CHANNEL_4)))           \\r
+    ||                                         \\r
+    (((INSTANCE) == TIM4) &&                   \\r
+     (((CHANNEL) == TIM_CHANNEL_1) ||          \\r
+      ((CHANNEL) == TIM_CHANNEL_2) ||          \\r
+      ((CHANNEL) == TIM_CHANNEL_3) ||          \\r
+      ((CHANNEL) == TIM_CHANNEL_4))))\r
+\r
+#define IS_TIM_CCXN_INSTANCE(INSTANCE, CHANNEL) \\r
+    (((INSTANCE) == TIM1) &&                    \\r
+     (((CHANNEL) == TIM_CHANNEL_1) ||           \\r
+      ((CHANNEL) == TIM_CHANNEL_2) ||           \\r
+      ((CHANNEL) == TIM_CHANNEL_3)))\r
+\r
+#define IS_TIM_COUNTER_MODE_SELECT_INSTANCE(INSTANCE)\\r
+  (((INSTANCE) == TIM1)    || \\r
+   ((INSTANCE) == TIM2)    || \\r
+   ((INSTANCE) == TIM3)    || \\r
+   ((INSTANCE) == TIM4))\r
+\r
+#define IS_TIM_REPETITION_COUNTER_INSTANCE(INSTANCE)\\r
+  ((INSTANCE) == TIM1)\r
+\r
+#define IS_TIM_CLOCK_DIVISION_INSTANCE(INSTANCE)\\r
+  (((INSTANCE) == TIM1)    || \\r
+   ((INSTANCE) == TIM2)    || \\r
+   ((INSTANCE) == TIM3)    || \\r
+   ((INSTANCE) == TIM4))\r
+\r
+#define IS_TIM_DMA_INSTANCE(INSTANCE)\\r
+  (((INSTANCE) == TIM1)    || \\r
+   ((INSTANCE) == TIM2)    || \\r
+   ((INSTANCE) == TIM3)    || \\r
+   ((INSTANCE) == TIM4))\r
+    \r
+#define IS_TIM_DMA_CC_INSTANCE(INSTANCE)\\r
+  (((INSTANCE) == TIM1)    || \\r
+   ((INSTANCE) == TIM2)    || \\r
+   ((INSTANCE) == TIM3)    || \\r
+   ((INSTANCE) == TIM4))\r
+    \r
+#define IS_TIM_COMMUTATION_EVENT_INSTANCE(INSTANCE)\\r
+  ((INSTANCE) == TIM1)\r
+\r
+#define IS_TIM_ETR_INSTANCE(INSTANCE)  (((INSTANCE) == TIM1)    || \\r
+                                        ((INSTANCE) == TIM2)    || \\r
+                                        ((INSTANCE) == TIM3)    || \\r
+                                        ((INSTANCE) == TIM4))\r
+\r
+#define IS_TIM_HALL_SENSOR_INTERFACE_INSTANCE(INSTANCE) (((INSTANCE) == TIM1)    || \\r
+                                                         ((INSTANCE) == TIM2)    || \\r
+                                                         ((INSTANCE) == TIM3)    || \\r
+                                                         ((INSTANCE) == TIM4))\r
+\r
+#define IS_TIM_32B_COUNTER_INSTANCE(INSTANCE)           0U\r
+\r
+/****************************** END TIM Instances *****************************/\r
+\r
+\r
+/******************** USART Instances : Synchronous mode **********************/                                           \r
+#define IS_USART_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \\r
+                                     ((INSTANCE) == USART2) || \\r
+                                     ((INSTANCE) == USART3))\r
+\r
+/******************** UART Instances : Asynchronous mode **********************/\r
+#define IS_UART_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \\r
+                                    ((INSTANCE) == USART2) || \\r
+                                    ((INSTANCE) == USART3))\r
+\r
+/******************** UART Instances : Half-Duplex mode **********************/\r
+#define IS_UART_HALFDUPLEX_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \\r
+                                               ((INSTANCE) == USART2) || \\r
+                                               ((INSTANCE) == USART3))\r
+\r
+/******************** UART Instances : LIN mode **********************/\r
+#define IS_UART_LIN_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \\r
+                                        ((INSTANCE) == USART2) || \\r
+                                        ((INSTANCE) == USART3))\r
+\r
+/****************** UART Instances : Hardware Flow control ********************/                                    \r
+#define IS_UART_HWFLOW_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \\r
+                                           ((INSTANCE) == USART2) || \\r
+                                           ((INSTANCE) == USART3))\r
+\r
+/********************* UART Instances : Smard card mode ***********************/\r
+#define IS_SMARTCARD_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \\r
+                                         ((INSTANCE) == USART2) || \\r
+                                         ((INSTANCE) == USART3))\r
+\r
+/*********************** UART Instances : IRDA mode ***************************/\r
+#define IS_IRDA_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \\r
+                                    ((INSTANCE) == USART2) || \\r
+                                    ((INSTANCE) == USART3))\r
+\r
+/***************** UART Instances : Multi-Processor mode **********************/\r
+#define IS_UART_MULTIPROCESSOR_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \\r
+                                                   ((INSTANCE) == USART2) || \\r
+                                                   ((INSTANCE) == USART3))\r
+\r
+/***************** UART Instances : DMA mode available **********************/\r
+#define IS_UART_DMA_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \\r
+                                        ((INSTANCE) == USART2) || \\r
+                                        ((INSTANCE) == USART3))\r
+\r
+/****************************** RTC Instances *********************************/\r
+#define IS_RTC_ALL_INSTANCE(INSTANCE)  ((INSTANCE) == RTC)\r
+\r
+/**************************** WWDG Instances *****************************/\r
+#define IS_WWDG_ALL_INSTANCE(INSTANCE)  ((INSTANCE) == WWDG)\r
+\r
+/****************************** USB Instances ********************************/\r
+#define IS_PCD_ALL_INSTANCE(INSTANCE)   ((INSTANCE) == USB)\r
+\r
+\r
+\r
+#define RCC_HSE_MIN         4000000U\r
+#define RCC_HSE_MAX        16000000U\r
+\r
+#define RCC_MAX_FREQUENCY  72000000U\r
+\r
+/**\r
+  * @}\r
+  */ \r
+/******************************************************************************/\r
+/*  For a painless codes migration between the STM32F1xx device product       */\r
+/*  lines, the aliases defined below are put in place to overcome the         */\r
+/*  differences in the interrupt handlers and IRQn definitions.               */\r
+/*  No need to update developed interrupt code when moving across             */ \r
+/*  product lines within the same STM32F1 Family                              */\r
+/******************************************************************************/\r
+\r
+/* Aliases for __IRQn */\r
+#define ADC1_IRQn               ADC1_2_IRQn\r
+#define TIM1_BRK_TIM15_IRQn     TIM1_BRK_IRQn\r
+#define TIM9_IRQn               TIM1_BRK_IRQn\r
+#define TIM1_BRK_TIM9_IRQn      TIM1_BRK_IRQn\r
+#define TIM1_TRG_COM_TIM17_IRQn TIM1_TRG_COM_IRQn\r
+#define TIM1_TRG_COM_TIM11_IRQn TIM1_TRG_COM_IRQn\r
+#define TIM11_IRQn              TIM1_TRG_COM_IRQn\r
+#define TIM10_IRQn              TIM1_UP_IRQn\r
+#define TIM1_UP_TIM16_IRQn      TIM1_UP_IRQn\r
+#define TIM1_UP_TIM10_IRQn      TIM1_UP_IRQn\r
+#define OTG_FS_WKUP_IRQn        USBWakeUp_IRQn\r
+#define CEC_IRQn                USBWakeUp_IRQn\r
+#define CAN1_TX_IRQn            USB_HP_CAN1_TX_IRQn\r
+#define USB_HP_IRQn             USB_HP_CAN1_TX_IRQn\r
+#define CAN1_RX0_IRQn           USB_LP_CAN1_RX0_IRQn\r
+#define USB_LP_IRQn             USB_LP_CAN1_RX0_IRQn\r
+\r
+\r
+/* Aliases for __IRQHandler */\r
+#define ADC1_IRQHandler               ADC1_2_IRQHandler\r
+#define TIM1_BRK_TIM15_IRQHandler     TIM1_BRK_IRQHandler\r
+#define TIM9_IRQHandler               TIM1_BRK_IRQHandler\r
+#define TIM1_BRK_TIM9_IRQHandler      TIM1_BRK_IRQHandler\r
+#define TIM1_TRG_COM_TIM17_IRQHandler TIM1_TRG_COM_IRQHandler\r
+#define TIM1_TRG_COM_TIM11_IRQHandler TIM1_TRG_COM_IRQHandler\r
+#define TIM11_IRQHandler              TIM1_TRG_COM_IRQHandler\r
+#define TIM10_IRQHandler              TIM1_UP_IRQHandler\r
+#define TIM1_UP_TIM16_IRQHandler      TIM1_UP_IRQHandler\r
+#define TIM1_UP_TIM10_IRQHandler      TIM1_UP_IRQHandler\r
+#define OTG_FS_WKUP_IRQHandler        USBWakeUp_IRQHandler\r
+#define CEC_IRQHandler                USBWakeUp_IRQHandler\r
+#define CAN1_TX_IRQHandler            USB_HP_CAN1_TX_IRQHandler\r
+#define USB_HP_IRQHandler             USB_HP_CAN1_TX_IRQHandler\r
+#define CAN1_RX0_IRQHandler           USB_LP_CAN1_RX0_IRQHandler\r
+#define USB_LP_IRQHandler             USB_LP_CAN1_RX0_IRQHandler\r
+\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+\r
+#ifdef __cplusplus\r
+  }\r
+#endif /* __cplusplus */\r
+  \r
+#endif /* __STM32F103xB_H */\r
+  \r
+  \r
+  \r
+  /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h
new file mode 100644 (file)
index 0000000..470d78a
--- /dev/null
@@ -0,0 +1,220 @@
+/**\r
+  ******************************************************************************\r
+  * @file    stm32f1xx.h\r
+  * @author  MCD Application Team\r
+  * @brief   CMSIS STM32F1xx Device Peripheral Access Layer Header File. \r
+  *\r
+  *          The file is the unique include file that the application programmer\r
+  *          is using in the C source code, usually in main.c. This file contains:\r
+  *            - Configuration section that allows to select:\r
+  *              - The STM32F1xx device used in the target application\r
+  *              - To use or not the peripheral\92s drivers in application code(i.e. \r
+  *                code will be based on direct access to peripheral\92s registers \r
+  *                rather than drivers API), this option is controlled by \r
+  *                "#define USE_HAL_DRIVER"\r
+  *  \r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+\r
+/** @addtogroup CMSIS\r
+  * @{\r
+  */\r
+\r
+/** @addtogroup stm32f1xx\r
+  * @{\r
+  */\r
+    \r
+#ifndef __STM32F1XX_H\r
+#define __STM32F1XX_H\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif /* __cplusplus */\r
+  \r
+/** @addtogroup Library_configuration_section\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief STM32 Family\r
+  */\r
+#if !defined (STM32F1)\r
+#define STM32F1\r
+#endif /* STM32F1 */\r
+\r
+/* Uncomment the line below according to the target STM32L device used in your \r
+   application \r
+  */\r
+\r
+#if !defined (STM32F100xB) && !defined (STM32F100xE) && !defined (STM32F101x6) && \\r
+    !defined (STM32F101xB) && !defined (STM32F101xE) && !defined (STM32F101xG) && !defined (STM32F102x6) && !defined (STM32F102xB) && !defined (STM32F103x6) && \\r
+    !defined (STM32F103xB) && !defined (STM32F103xE) && !defined (STM32F103xG) && !defined (STM32F105xC) && !defined (STM32F107xC)\r
+  /* #define STM32F100xB  */   /*!< STM32F100C4, STM32F100R4, STM32F100C6, STM32F100R6, STM32F100C8, STM32F100R8, STM32F100V8, STM32F100CB, STM32F100RB and STM32F100VB */\r
+  /* #define STM32F100xE */    /*!< STM32F100RC, STM32F100VC, STM32F100ZC, STM32F100RD, STM32F100VD, STM32F100ZD, STM32F100RE, STM32F100VE and STM32F100ZE */\r
+  /* #define STM32F101x6  */   /*!< STM32F101C4, STM32F101R4, STM32F101T4, STM32F101C6, STM32F101R6 and STM32F101T6 Devices */\r
+  /* #define STM32F101xB  */   /*!< STM32F101C8, STM32F101R8, STM32F101T8, STM32F101V8, STM32F101CB, STM32F101RB, STM32F101TB and STM32F101VB */\r
+  /* #define STM32F101xE */    /*!< STM32F101RC, STM32F101VC, STM32F101ZC, STM32F101RD, STM32F101VD, STM32F101ZD, STM32F101RE, STM32F101VE and STM32F101ZE */ \r
+  /* #define STM32F101xG  */   /*!< STM32F101RF, STM32F101VF, STM32F101ZF, STM32F101RG, STM32F101VG and STM32F101ZG */\r
+  /* #define STM32F102x6 */    /*!< STM32F102C4, STM32F102R4, STM32F102C6 and STM32F102R6 */\r
+  /* #define STM32F102xB  */   /*!< STM32F102C8, STM32F102R8, STM32F102CB and STM32F102RB */\r
+  /* #define STM32F103x6  */   /*!< STM32F103C4, STM32F103R4, STM32F103T4, STM32F103C6, STM32F103R6 and STM32F103T6 */\r
+  /* #define STM32F103xB  */   /*!< STM32F103C8, STM32F103R8, STM32F103T8, STM32F103V8, STM32F103CB, STM32F103RB, STM32F103TB and STM32F103VB */\r
+  /* #define STM32F103xE */    /*!< STM32F103RC, STM32F103VC, STM32F103ZC, STM32F103RD, STM32F103VD, STM32F103ZD, STM32F103RE, STM32F103VE and STM32F103ZE */\r
+  /* #define STM32F103xG  */   /*!< STM32F103RF, STM32F103VF, STM32F103ZF, STM32F103RG, STM32F103VG and STM32F103ZG */\r
+  /* #define STM32F105xC */    /*!< STM32F105R8, STM32F105V8, STM32F105RB, STM32F105VB, STM32F105RC and STM32F105VC */\r
+  /* #define STM32F107xC  */   /*!< STM32F107RB, STM32F107VB, STM32F107RC and STM32F107VC */  \r
+#endif\r
+\r
+/*  Tip: To avoid modifying this file each time you need to switch between these\r
+        devices, you can define the device in your toolchain compiler preprocessor.\r
+  */\r
+  \r
+#if !defined  (USE_HAL_DRIVER)\r
+/**\r
+ * @brief Comment the line below if you will not use the peripherals drivers.\r
+   In this case, these drivers will not be included and the application code will \r
+   be based on direct access to peripherals registers \r
+   */\r
+  /*#define USE_HAL_DRIVER */\r
+#endif /* USE_HAL_DRIVER */\r
+\r
+/**\r
+  * @brief CMSIS Device version number V4.3.2\r
+  */\r
+#define __STM32F1_CMSIS_VERSION_MAIN   (0x04) /*!< [31:24] main version */\r
+#define __STM32F1_CMSIS_VERSION_SUB1   (0x03) /*!< [23:16] sub1 version */\r
+#define __STM32F1_CMSIS_VERSION_SUB2   (0x02) /*!< [15:8]  sub2 version */\r
+#define __STM32F1_CMSIS_VERSION_RC     (0x00) /*!< [7:0]  release candidate */ \r
+#define __STM32F1_CMSIS_VERSION        ((__STM32F1_CMSIS_VERSION_MAIN << 24)\\r
+                                       |(__STM32F1_CMSIS_VERSION_SUB1 << 16)\\r
+                                       |(__STM32F1_CMSIS_VERSION_SUB2 << 8 )\\r
+                                       |(__STM32F1_CMSIS_VERSION_RC))\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @addtogroup Device_Included\r
+  * @{\r
+  */\r
+\r
+#if defined(STM32F100xB)\r
+  #include "stm32f100xb.h"\r
+#elif defined(STM32F100xE)\r
+  #include "stm32f100xe.h"\r
+#elif defined(STM32F101x6)\r
+  #include "stm32f101x6.h"\r
+#elif defined(STM32F101xB)\r
+  #include "stm32f101xb.h"\r
+#elif defined(STM32F101xE)\r
+  #include "stm32f101xe.h"\r
+#elif defined(STM32F101xG)\r
+  #include "stm32f101xg.h"\r
+#elif defined(STM32F102x6)\r
+  #include "stm32f102x6.h"\r
+#elif defined(STM32F102xB)\r
+  #include "stm32f102xb.h"\r
+#elif defined(STM32F103x6)\r
+  #include "stm32f103x6.h"\r
+#elif defined(STM32F103xB)\r
+  #include "stm32f103xb.h"\r
+#elif defined(STM32F103xE)\r
+  #include "stm32f103xe.h"\r
+#elif defined(STM32F103xG)\r
+  #include "stm32f103xg.h"\r
+#elif defined(STM32F105xC)\r
+  #include "stm32f105xc.h"\r
+#elif defined(STM32F107xC)\r
+  #include "stm32f107xc.h"\r
+#else\r
+ #error "Please select first the target STM32F1xx device used in your application (in stm32f1xx.h file)"\r
+#endif\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @addtogroup Exported_types\r
+  * @{\r
+  */  \r
+typedef enum \r
+{\r
+  RESET = 0, \r
+  SET = !RESET\r
+} FlagStatus, ITStatus;\r
+\r
+typedef enum \r
+{\r
+  DISABLE = 0, \r
+  ENABLE = !DISABLE\r
+} FunctionalState;\r
+#define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))\r
+\r
+typedef enum\r
+{\r
+  SUCCESS = 0U,\r
+  ERROR = !SUCCESS\r
+} ErrorStatus;\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+\r
+/** @addtogroup Exported_macros\r
+  * @{\r
+  */\r
+#define SET_BIT(REG, BIT)     ((REG) |= (BIT))\r
+\r
+#define CLEAR_BIT(REG, BIT)   ((REG) &= ~(BIT))\r
+\r
+#define READ_BIT(REG, BIT)    ((REG) & (BIT))\r
+\r
+#define CLEAR_REG(REG)        ((REG) = (0x0))\r
+\r
+#define WRITE_REG(REG, VAL)   ((REG) = (VAL))\r
+\r
+#define READ_REG(REG)         ((REG))\r
+\r
+#define MODIFY_REG(REG, CLEARMASK, SETMASK)  WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))\r
+\r
+#define POSITION_VAL(VAL)     (__CLZ(__RBIT(VAL))) \r
+\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#if defined (USE_HAL_DRIVER)\r
+ #include "stm32f1xx_hal.h"\r
+#endif /* USE_HAL_DRIVER */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif /* __cplusplus */\r
+\r
+#endif /* __STM32F1xx_H */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+  \r
+\r
+\r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h
new file mode 100644 (file)
index 0000000..8e33366
--- /dev/null
@@ -0,0 +1,98 @@
+/**\r
+  ******************************************************************************\r
+  * @file    system_stm32f10x.h\r
+  * @author  MCD Application Team\r
+  * @brief   CMSIS Cortex-M3 Device Peripheral Access Layer System Header File.\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+\r
+/** @addtogroup CMSIS\r
+  * @{\r
+  */\r
+\r
+/** @addtogroup stm32f10x_system\r
+  * @{\r
+  */  \r
+  \r
+/**\r
+  * @brief Define to prevent recursive inclusion\r
+  */\r
+#ifndef __SYSTEM_STM32F10X_H\r
+#define __SYSTEM_STM32F10X_H\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif \r
+\r
+/** @addtogroup STM32F10x_System_Includes\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+\r
+/** @addtogroup STM32F10x_System_Exported_types\r
+  * @{\r
+  */\r
+\r
+extern uint32_t SystemCoreClock;          /*!< System Clock Frequency (Core Clock) */\r
+extern const uint8_t  AHBPrescTable[16U];  /*!< AHB prescalers table values */\r
+extern const uint8_t  APBPrescTable[8U];   /*!< APB prescalers table values */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @addtogroup STM32F10x_System_Exported_Constants\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @addtogroup STM32F10x_System_Exported_Macros\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @addtogroup STM32F10x_System_Exported_Functions\r
+  * @{\r
+  */\r
+  \r
+extern void SystemInit(void);\r
+extern void SystemCoreClockUpdate(void);\r
+/**\r
+  * @}\r
+  */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /*__SYSTEM_STM32F10X_H */\r
+\r
+/**\r
+  * @}\r
+  */\r
+  \r
+/**\r
+  * @}\r
+  */  \r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/cmsis_armcc.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/cmsis_armcc.h
new file mode 100644 (file)
index 0000000..7d751fb
--- /dev/null
@@ -0,0 +1,865 @@
+/**************************************************************************//**\r
+ * @file     cmsis_armcc.h\r
+ * @brief    CMSIS compiler ARMCC (Arm Compiler 5) header file\r
+ * @version  V5.0.4\r
+ * @date     10. January 2018\r
+ ******************************************************************************/\r
+/*\r
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.\r
+ *\r
+ * SPDX-License-Identifier: Apache-2.0\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the License); you may\r
+ * not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#ifndef __CMSIS_ARMCC_H\r
+#define __CMSIS_ARMCC_H\r
+\r
+\r
+#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 400677)\r
+  #error "Please use Arm Compiler Toolchain V4.0.677 or later!"\r
+#endif\r
+\r
+/* CMSIS compiler control architecture macros */\r
+#if ((defined (__TARGET_ARCH_6_M  ) && (__TARGET_ARCH_6_M   == 1)) || \\r
+     (defined (__TARGET_ARCH_6S_M ) && (__TARGET_ARCH_6S_M  == 1))   )\r
+  #define __ARM_ARCH_6M__           1\r
+#endif\r
+\r
+#if (defined (__TARGET_ARCH_7_M ) && (__TARGET_ARCH_7_M  == 1))\r
+  #define __ARM_ARCH_7M__           1\r
+#endif\r
+\r
+#if (defined (__TARGET_ARCH_7E_M) && (__TARGET_ARCH_7E_M == 1))\r
+  #define __ARM_ARCH_7EM__          1\r
+#endif\r
+\r
+  /* __ARM_ARCH_8M_BASE__  not applicable */\r
+  /* __ARM_ARCH_8M_MAIN__  not applicable */\r
+\r
+\r
+/* CMSIS compiler specific defines */\r
+#ifndef   __ASM\r
+  #define __ASM                                  __asm\r
+#endif\r
+#ifndef   __INLINE\r
+  #define __INLINE                               __inline\r
+#endif\r
+#ifndef   __STATIC_INLINE\r
+  #define __STATIC_INLINE                        static __inline\r
+#endif\r
+#ifndef   __STATIC_FORCEINLINE                 \r
+  #define __STATIC_FORCEINLINE                   static __forceinline\r
+#endif           \r
+#ifndef   __NO_RETURN\r
+  #define __NO_RETURN                            __declspec(noreturn)\r
+#endif\r
+#ifndef   __USED\r
+  #define __USED                                 __attribute__((used))\r
+#endif\r
+#ifndef   __WEAK\r
+  #define __WEAK                                 __attribute__((weak))\r
+#endif\r
+#ifndef   __PACKED\r
+  #define __PACKED                               __attribute__((packed))\r
+#endif\r
+#ifndef   __PACKED_STRUCT\r
+  #define __PACKED_STRUCT                        __packed struct\r
+#endif\r
+#ifndef   __PACKED_UNION\r
+  #define __PACKED_UNION                         __packed union\r
+#endif\r
+#ifndef   __UNALIGNED_UINT32        /* deprecated */\r
+  #define __UNALIGNED_UINT32(x)                  (*((__packed uint32_t *)(x)))\r
+#endif\r
+#ifndef   __UNALIGNED_UINT16_WRITE\r
+  #define __UNALIGNED_UINT16_WRITE(addr, val)    ((*((__packed uint16_t *)(addr))) = (val))\r
+#endif\r
+#ifndef   __UNALIGNED_UINT16_READ\r
+  #define __UNALIGNED_UINT16_READ(addr)          (*((const __packed uint16_t *)(addr)))\r
+#endif\r
+#ifndef   __UNALIGNED_UINT32_WRITE\r
+  #define __UNALIGNED_UINT32_WRITE(addr, val)    ((*((__packed uint32_t *)(addr))) = (val))\r
+#endif\r
+#ifndef   __UNALIGNED_UINT32_READ\r
+  #define __UNALIGNED_UINT32_READ(addr)          (*((const __packed uint32_t *)(addr)))\r
+#endif\r
+#ifndef   __ALIGNED\r
+  #define __ALIGNED(x)                           __attribute__((aligned(x)))\r
+#endif\r
+#ifndef   __RESTRICT\r
+  #define __RESTRICT                             __restrict\r
+#endif\r
+\r
+/* ###########################  Core Function Access  ########################### */\r
+/** \ingroup  CMSIS_Core_FunctionInterface\r
+    \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   Enable IRQ Interrupts\r
+  \details Enables IRQ interrupts by clearing the I-bit in the CPSR.\r
+           Can only be executed in Privileged modes.\r
+ */\r
+/* intrinsic void __enable_irq();     */\r
+\r
+\r
+/**\r
+  \brief   Disable IRQ Interrupts\r
+  \details Disables IRQ interrupts by setting the I-bit in the CPSR.\r
+           Can only be executed in Privileged modes.\r
+ */\r
+/* intrinsic void __disable_irq();    */\r
+\r
+/**\r
+  \brief   Get Control Register\r
+  \details Returns the content of the Control Register.\r
+  \return               Control Register value\r
+ */\r
+__STATIC_INLINE uint32_t __get_CONTROL(void)\r
+{\r
+  register uint32_t __regControl         __ASM("control");\r
+  return(__regControl);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Control Register\r
+  \details Writes the given value to the Control Register.\r
+  \param [in]    control  Control Register value to set\r
+ */\r
+__STATIC_INLINE void __set_CONTROL(uint32_t control)\r
+{\r
+  register uint32_t __regControl         __ASM("control");\r
+  __regControl = control;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get IPSR Register\r
+  \details Returns the content of the IPSR Register.\r
+  \return               IPSR Register value\r
+ */\r
+__STATIC_INLINE uint32_t __get_IPSR(void)\r
+{\r
+  register uint32_t __regIPSR          __ASM("ipsr");\r
+  return(__regIPSR);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get APSR Register\r
+  \details Returns the content of the APSR Register.\r
+  \return               APSR Register value\r
+ */\r
+__STATIC_INLINE uint32_t __get_APSR(void)\r
+{\r
+  register uint32_t __regAPSR          __ASM("apsr");\r
+  return(__regAPSR);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get xPSR Register\r
+  \details Returns the content of the xPSR Register.\r
+  \return               xPSR Register value\r
+ */\r
+__STATIC_INLINE uint32_t __get_xPSR(void)\r
+{\r
+  register uint32_t __regXPSR          __ASM("xpsr");\r
+  return(__regXPSR);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Process Stack Pointer\r
+  \details Returns the current value of the Process Stack Pointer (PSP).\r
+  \return               PSP Register value\r
+ */\r
+__STATIC_INLINE uint32_t __get_PSP(void)\r
+{\r
+  register uint32_t __regProcessStackPointer  __ASM("psp");\r
+  return(__regProcessStackPointer);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Process Stack Pointer\r
+  \details Assigns the given value to the Process Stack Pointer (PSP).\r
+  \param [in]    topOfProcStack  Process Stack Pointer value to set\r
+ */\r
+__STATIC_INLINE void __set_PSP(uint32_t topOfProcStack)\r
+{\r
+  register uint32_t __regProcessStackPointer  __ASM("psp");\r
+  __regProcessStackPointer = topOfProcStack;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Main Stack Pointer\r
+  \details Returns the current value of the Main Stack Pointer (MSP).\r
+  \return               MSP Register value\r
+ */\r
+__STATIC_INLINE uint32_t __get_MSP(void)\r
+{\r
+  register uint32_t __regMainStackPointer     __ASM("msp");\r
+  return(__regMainStackPointer);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Main Stack Pointer\r
+  \details Assigns the given value to the Main Stack Pointer (MSP).\r
+  \param [in]    topOfMainStack  Main Stack Pointer value to set\r
+ */\r
+__STATIC_INLINE void __set_MSP(uint32_t topOfMainStack)\r
+{\r
+  register uint32_t __regMainStackPointer     __ASM("msp");\r
+  __regMainStackPointer = topOfMainStack;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Priority Mask\r
+  \details Returns the current state of the priority mask bit from the Priority Mask Register.\r
+  \return               Priority Mask value\r
+ */\r
+__STATIC_INLINE uint32_t __get_PRIMASK(void)\r
+{\r
+  register uint32_t __regPriMask         __ASM("primask");\r
+  return(__regPriMask);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Priority Mask\r
+  \details Assigns the given value to the Priority Mask Register.\r
+  \param [in]    priMask  Priority Mask\r
+ */\r
+__STATIC_INLINE void __set_PRIMASK(uint32_t priMask)\r
+{\r
+  register uint32_t __regPriMask         __ASM("primask");\r
+  __regPriMask = (priMask);\r
+}\r
+\r
+\r
+#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__  == 1)) || \\r
+     (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1))     )\r
+\r
+/**\r
+  \brief   Enable FIQ\r
+  \details Enables FIQ interrupts by clearing the F-bit in the CPSR.\r
+           Can only be executed in Privileged modes.\r
+ */\r
+#define __enable_fault_irq                __enable_fiq\r
+\r
+\r
+/**\r
+  \brief   Disable FIQ\r
+  \details Disables FIQ interrupts by setting the F-bit in the CPSR.\r
+           Can only be executed in Privileged modes.\r
+ */\r
+#define __disable_fault_irq               __disable_fiq\r
+\r
+\r
+/**\r
+  \brief   Get Base Priority\r
+  \details Returns the current value of the Base Priority register.\r
+  \return               Base Priority register value\r
+ */\r
+__STATIC_INLINE uint32_t  __get_BASEPRI(void)\r
+{\r
+  register uint32_t __regBasePri         __ASM("basepri");\r
+  return(__regBasePri);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Base Priority\r
+  \details Assigns the given value to the Base Priority register.\r
+  \param [in]    basePri  Base Priority value to set\r
+ */\r
+__STATIC_INLINE void __set_BASEPRI(uint32_t basePri)\r
+{\r
+  register uint32_t __regBasePri         __ASM("basepri");\r
+  __regBasePri = (basePri & 0xFFU);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Base Priority with condition\r
+  \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled,\r
+           or the new value increases the BASEPRI priority level.\r
+  \param [in]    basePri  Base Priority value to set\r
+ */\r
+__STATIC_INLINE void __set_BASEPRI_MAX(uint32_t basePri)\r
+{\r
+  register uint32_t __regBasePriMax      __ASM("basepri_max");\r
+  __regBasePriMax = (basePri & 0xFFU);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Fault Mask\r
+  \details Returns the current value of the Fault Mask register.\r
+  \return               Fault Mask register value\r
+ */\r
+__STATIC_INLINE uint32_t __get_FAULTMASK(void)\r
+{\r
+  register uint32_t __regFaultMask       __ASM("faultmask");\r
+  return(__regFaultMask);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Fault Mask\r
+  \details Assigns the given value to the Fault Mask register.\r
+  \param [in]    faultMask  Fault Mask value to set\r
+ */\r
+__STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask)\r
+{\r
+  register uint32_t __regFaultMask       __ASM("faultmask");\r
+  __regFaultMask = (faultMask & (uint32_t)1U);\r
+}\r
+\r
+#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__  == 1)) || \\r
+           (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1))     ) */\r
+\r
+\r
+/**\r
+  \brief   Get FPSCR\r
+  \details Returns the current value of the Floating Point Status/Control register.\r
+  \return               Floating Point Status/Control register value\r
+ */\r
+__STATIC_INLINE uint32_t __get_FPSCR(void)\r
+{\r
+#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \\r
+     (defined (__FPU_USED   ) && (__FPU_USED    == 1U))     )\r
+  register uint32_t __regfpscr         __ASM("fpscr");\r
+  return(__regfpscr);\r
+#else\r
+   return(0U);\r
+#endif\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set FPSCR\r
+  \details Assigns the given value to the Floating Point Status/Control register.\r
+  \param [in]    fpscr  Floating Point Status/Control value to set\r
+ */\r
+__STATIC_INLINE void __set_FPSCR(uint32_t fpscr)\r
+{\r
+#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \\r
+     (defined (__FPU_USED   ) && (__FPU_USED    == 1U))     )\r
+  register uint32_t __regfpscr         __ASM("fpscr");\r
+  __regfpscr = (fpscr);\r
+#else\r
+  (void)fpscr;\r
+#endif\r
+}\r
+\r
+\r
+/*@} end of CMSIS_Core_RegAccFunctions */\r
+\r
+\r
+/* ##########################  Core Instruction Access  ######################### */\r
+/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface\r
+  Access to dedicated instructions\r
+  @{\r
+*/\r
+\r
+/**\r
+  \brief   No Operation\r
+  \details No Operation does nothing. This instruction can be used for code alignment purposes.\r
+ */\r
+#define __NOP                             __nop\r
+\r
+\r
+/**\r
+  \brief   Wait For Interrupt\r
+  \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs.\r
+ */\r
+#define __WFI                             __wfi\r
+\r
+\r
+/**\r
+  \brief   Wait For Event\r
+  \details Wait For Event is a hint instruction that permits the processor to enter\r
+           a low-power state until one of a number of events occurs.\r
+ */\r
+#define __WFE                             __wfe\r
+\r
+\r
+/**\r
+  \brief   Send Event\r
+  \details Send Event is a hint instruction. It causes an event to be signaled to the CPU.\r
+ */\r
+#define __SEV                             __sev\r
+\r
+\r
+/**\r
+  \brief   Instruction Synchronization Barrier\r
+  \details Instruction Synchronization Barrier flushes the pipeline in the processor,\r
+           so that all instructions following the ISB are fetched from cache or memory,\r
+           after the instruction has been completed.\r
+ */\r
+#define __ISB() do {\\r
+                   __schedule_barrier();\\r
+                   __isb(0xF);\\r
+                   __schedule_barrier();\\r
+                } while (0U)\r
+\r
+/**\r
+  \brief   Data Synchronization Barrier\r
+  \details Acts as a special kind of Data Memory Barrier.\r
+           It completes when all explicit memory accesses before this instruction complete.\r
+ */\r
+#define __DSB() do {\\r
+                   __schedule_barrier();\\r
+                   __dsb(0xF);\\r
+                   __schedule_barrier();\\r
+                } while (0U)\r
+\r
+/**\r
+  \brief   Data Memory Barrier\r
+  \details Ensures the apparent order of the explicit memory operations before\r
+           and after the instruction, without ensuring their completion.\r
+ */\r
+#define __DMB() do {\\r
+                   __schedule_barrier();\\r
+                   __dmb(0xF);\\r
+                   __schedule_barrier();\\r
+                } while (0U)\r
+\r
+                  \r
+/**\r
+  \brief   Reverse byte order (32 bit)\r
+  \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412.\r
+  \param [in]    value  Value to reverse\r
+  \return               Reversed value\r
+ */\r
+#define __REV                             __rev\r
+\r
+\r
+/**\r
+  \brief   Reverse byte order (16 bit)\r
+  \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856.\r
+  \param [in]    value  Value to reverse\r
+  \return               Reversed value\r
+ */\r
+#ifndef __NO_EMBEDDED_ASM\r
+__attribute__((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value)\r
+{\r
+  rev16 r0, r0\r
+  bx lr\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Reverse byte order (16 bit)\r
+  \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000.\r
+  \param [in]    value  Value to reverse\r
+  \return               Reversed value\r
+ */\r
+#ifndef __NO_EMBEDDED_ASM\r
+__attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int16_t __REVSH(int16_t value)\r
+{\r
+  revsh r0, r0\r
+  bx lr\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Rotate Right in unsigned value (32 bit)\r
+  \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.\r
+  \param [in]    op1  Value to rotate\r
+  \param [in]    op2  Number of Bits to rotate\r
+  \return               Rotated value\r
+ */\r
+#define __ROR                             __ror\r
+\r
+\r
+/**\r
+  \brief   Breakpoint\r
+  \details Causes the processor to enter Debug state.\r
+           Debug tools can use this to investigate system state when the instruction at a particular address is reached.\r
+  \param [in]    value  is ignored by the processor.\r
+                 If required, a debugger can use it to store additional information about the breakpoint.\r
+ */\r
+#define __BKPT(value)                       __breakpoint(value)\r
+\r
+\r
+/**\r
+  \brief   Reverse bit order of value\r
+  \details Reverses the bit order of the given value.\r
+  \param [in]    value  Value to reverse\r
+  \return               Reversed value\r
+ */\r
+#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__  == 1)) || \\r
+     (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1))     )\r
+  #define __RBIT                          __rbit\r
+#else\r
+__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value)\r
+{\r
+  uint32_t result;\r
+  uint32_t s = (4U /*sizeof(v)*/ * 8U) - 1U; /* extra shift needed at end */\r
+\r
+  result = value;                      /* r will be reversed bits of v; first get LSB of v */\r
+  for (value >>= 1U; value != 0U; value >>= 1U)\r
+  {\r
+    result <<= 1U;\r
+    result |= value & 1U;\r
+    s--;\r
+  }\r
+  result <<= s;                        /* shift when v's highest bits are zero */\r
+  return result;\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Count leading zeros\r
+  \details Counts the number of leading zeros of a data value.\r
+  \param [in]  value  Value to count the leading zeros\r
+  \return             number of leading zeros in value\r
+ */\r
+#define __CLZ                             __clz\r
+\r
+\r
+#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__  == 1)) || \\r
+     (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1))     )\r
+\r
+/**\r
+  \brief   LDR Exclusive (8 bit)\r
+  \details Executes a exclusive LDR instruction for 8 bit value.\r
+  \param [in]    ptr  Pointer to data\r
+  \return             value of type uint8_t at (*ptr)\r
+ */\r
+#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)\r
+  #define __LDREXB(ptr)                                                        ((uint8_t ) __ldrex(ptr))\r
+#else\r
+  #define __LDREXB(ptr)          _Pragma("push") _Pragma("diag_suppress 3731") ((uint8_t ) __ldrex(ptr))  _Pragma("pop")\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   LDR Exclusive (16 bit)\r
+  \details Executes a exclusive LDR instruction for 16 bit values.\r
+  \param [in]    ptr  Pointer to data\r
+  \return        value of type uint16_t at (*ptr)\r
+ */\r
+#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)\r
+  #define __LDREXH(ptr)                                                        ((uint16_t) __ldrex(ptr))\r
+#else\r
+  #define __LDREXH(ptr)          _Pragma("push") _Pragma("diag_suppress 3731") ((uint16_t) __ldrex(ptr))  _Pragma("pop")\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   LDR Exclusive (32 bit)\r
+  \details Executes a exclusive LDR instruction for 32 bit values.\r
+  \param [in]    ptr  Pointer to data\r
+  \return        value of type uint32_t at (*ptr)\r
+ */\r
+#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)\r
+  #define __LDREXW(ptr)                                                        ((uint32_t ) __ldrex(ptr))\r
+#else\r
+  #define __LDREXW(ptr)          _Pragma("push") _Pragma("diag_suppress 3731") ((uint32_t ) __ldrex(ptr))  _Pragma("pop")\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   STR Exclusive (8 bit)\r
+  \details Executes a exclusive STR instruction for 8 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+  \return          0  Function succeeded\r
+  \return          1  Function failed\r
+ */\r
+#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)\r
+  #define __STREXB(value, ptr)                                                 __strex(value, ptr)\r
+#else\r
+  #define __STREXB(value, ptr)   _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr)        _Pragma("pop")\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   STR Exclusive (16 bit)\r
+  \details Executes a exclusive STR instruction for 16 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+  \return          0  Function succeeded\r
+  \return          1  Function failed\r
+ */\r
+#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)\r
+  #define __STREXH(value, ptr)                                                 __strex(value, ptr)\r
+#else\r
+  #define __STREXH(value, ptr)   _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr)        _Pragma("pop")\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   STR Exclusive (32 bit)\r
+  \details Executes a exclusive STR instruction for 32 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+  \return          0  Function succeeded\r
+  \return          1  Function failed\r
+ */\r
+#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)\r
+  #define __STREXW(value, ptr)                                                 __strex(value, ptr)\r
+#else\r
+  #define __STREXW(value, ptr)   _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr)        _Pragma("pop")\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Remove the exclusive lock\r
+  \details Removes the exclusive lock which is created by LDREX.\r
+ */\r
+#define __CLREX                           __clrex\r
+\r
+\r
+/**\r
+  \brief   Signed Saturate\r
+  \details Saturates a signed value.\r
+  \param [in]  value  Value to be saturated\r
+  \param [in]    sat  Bit position to saturate to (1..32)\r
+  \return             Saturated value\r
+ */\r
+#define __SSAT                            __ssat\r
+\r
+\r
+/**\r
+  \brief   Unsigned Saturate\r
+  \details Saturates an unsigned value.\r
+  \param [in]  value  Value to be saturated\r
+  \param [in]    sat  Bit position to saturate to (0..31)\r
+  \return             Saturated value\r
+ */\r
+#define __USAT                            __usat\r
+\r
+\r
+/**\r
+  \brief   Rotate Right with Extend (32 bit)\r
+  \details Moves each bit of a bitstring right by one bit.\r
+           The carry input is shifted in at the left end of the bitstring.\r
+  \param [in]    value  Value to rotate\r
+  \return               Rotated value\r
+ */\r
+#ifndef __NO_EMBEDDED_ASM\r
+__attribute__((section(".rrx_text"))) __STATIC_INLINE __ASM uint32_t __RRX(uint32_t value)\r
+{\r
+  rrx r0, r0\r
+  bx lr\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   LDRT Unprivileged (8 bit)\r
+  \details Executes a Unprivileged LDRT instruction for 8 bit value.\r
+  \param [in]    ptr  Pointer to data\r
+  \return             value of type uint8_t at (*ptr)\r
+ */\r
+#define __LDRBT(ptr)                      ((uint8_t )  __ldrt(ptr))\r
+\r
+\r
+/**\r
+  \brief   LDRT Unprivileged (16 bit)\r
+  \details Executes a Unprivileged LDRT instruction for 16 bit values.\r
+  \param [in]    ptr  Pointer to data\r
+  \return        value of type uint16_t at (*ptr)\r
+ */\r
+#define __LDRHT(ptr)                      ((uint16_t)  __ldrt(ptr))\r
+\r
+\r
+/**\r
+  \brief   LDRT Unprivileged (32 bit)\r
+  \details Executes a Unprivileged LDRT instruction for 32 bit values.\r
+  \param [in]    ptr  Pointer to data\r
+  \return        value of type uint32_t at (*ptr)\r
+ */\r
+#define __LDRT(ptr)                       ((uint32_t ) __ldrt(ptr))\r
+\r
+\r
+/**\r
+  \brief   STRT Unprivileged (8 bit)\r
+  \details Executes a Unprivileged STRT instruction for 8 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+ */\r
+#define __STRBT(value, ptr)               __strt(value, ptr)\r
+\r
+\r
+/**\r
+  \brief   STRT Unprivileged (16 bit)\r
+  \details Executes a Unprivileged STRT instruction for 16 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+ */\r
+#define __STRHT(value, ptr)               __strt(value, ptr)\r
+\r
+\r
+/**\r
+  \brief   STRT Unprivileged (32 bit)\r
+  \details Executes a Unprivileged STRT instruction for 32 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+ */\r
+#define __STRT(value, ptr)                __strt(value, ptr)\r
+\r
+#else  /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__  == 1)) || \\r
+           (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1))     ) */\r
+\r
+/**\r
+  \brief   Signed Saturate\r
+  \details Saturates a signed value.\r
+  \param [in]  value  Value to be saturated\r
+  \param [in]    sat  Bit position to saturate to (1..32)\r
+  \return             Saturated value\r
+ */\r
+__attribute__((always_inline)) __STATIC_INLINE int32_t __SSAT(int32_t val, uint32_t sat)\r
+{\r
+  if ((sat >= 1U) && (sat <= 32U))\r
+  {\r
+    const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U);\r
+    const int32_t min = -1 - max ;\r
+    if (val > max)\r
+    {\r
+      return max;\r
+    }\r
+    else if (val < min)\r
+    {\r
+      return min;\r
+    }\r
+  }\r
+  return val;\r
+}\r
+\r
+/**\r
+  \brief   Unsigned Saturate\r
+  \details Saturates an unsigned value.\r
+  \param [in]  value  Value to be saturated\r
+  \param [in]    sat  Bit position to saturate to (0..31)\r
+  \return             Saturated value\r
+ */\r
+__attribute__((always_inline)) __STATIC_INLINE uint32_t __USAT(int32_t val, uint32_t sat)\r
+{\r
+  if (sat <= 31U)\r
+  {\r
+    const uint32_t max = ((1U << sat) - 1U);\r
+    if (val > (int32_t)max)\r
+    {\r
+      return max;\r
+    }\r
+    else if (val < 0)\r
+    {\r
+      return 0U;\r
+    }\r
+  }\r
+  return (uint32_t)val;\r
+}\r
+\r
+#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__  == 1)) || \\r
+           (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1))     ) */\r
+\r
+/*@}*/ /* end of group CMSIS_Core_InstructionInterface */\r
+\r
+\r
+/* ###################  Compiler specific Intrinsics  ########################### */\r
+/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics\r
+  Access to dedicated SIMD instructions\r
+  @{\r
+*/\r
+\r
+#if ((defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1))     )\r
+\r
+#define __SADD8                           __sadd8\r
+#define __QADD8                           __qadd8\r
+#define __SHADD8                          __shadd8\r
+#define __UADD8                           __uadd8\r
+#define __UQADD8                          __uqadd8\r
+#define __UHADD8                          __uhadd8\r
+#define __SSUB8                           __ssub8\r
+#define __QSUB8                           __qsub8\r
+#define __SHSUB8                          __shsub8\r
+#define __USUB8                           __usub8\r
+#define __UQSUB8                          __uqsub8\r
+#define __UHSUB8                          __uhsub8\r
+#define __SADD16                          __sadd16\r
+#define __QADD16                          __qadd16\r
+#define __SHADD16                         __shadd16\r
+#define __UADD16                          __uadd16\r
+#define __UQADD16                         __uqadd16\r
+#define __UHADD16                         __uhadd16\r
+#define __SSUB16                          __ssub16\r
+#define __QSUB16                          __qsub16\r
+#define __SHSUB16                         __shsub16\r
+#define __USUB16                          __usub16\r
+#define __UQSUB16                         __uqsub16\r
+#define __UHSUB16                         __uhsub16\r
+#define __SASX                            __sasx\r
+#define __QASX                            __qasx\r
+#define __SHASX                           __shasx\r
+#define __UASX                            __uasx\r
+#define __UQASX                           __uqasx\r
+#define __UHASX                           __uhasx\r
+#define __SSAX                            __ssax\r
+#define __QSAX                            __qsax\r
+#define __SHSAX                           __shsax\r
+#define __USAX                            __usax\r
+#define __UQSAX                           __uqsax\r
+#define __UHSAX                           __uhsax\r
+#define __USAD8                           __usad8\r
+#define __USADA8                          __usada8\r
+#define __SSAT16                          __ssat16\r
+#define __USAT16                          __usat16\r
+#define __UXTB16                          __uxtb16\r
+#define __UXTAB16                         __uxtab16\r
+#define __SXTB16                          __sxtb16\r
+#define __SXTAB16                         __sxtab16\r
+#define __SMUAD                           __smuad\r
+#define __SMUADX                          __smuadx\r
+#define __SMLAD                           __smlad\r
+#define __SMLADX                          __smladx\r
+#define __SMLALD                          __smlald\r
+#define __SMLALDX                         __smlaldx\r
+#define __SMUSD                           __smusd\r
+#define __SMUSDX                          __smusdx\r
+#define __SMLSD                           __smlsd\r
+#define __SMLSDX                          __smlsdx\r
+#define __SMLSLD                          __smlsld\r
+#define __SMLSLDX                         __smlsldx\r
+#define __SEL                             __sel\r
+#define __QADD                            __qadd\r
+#define __QSUB                            __qsub\r
+\r
+#define __PKHBT(ARG1,ARG2,ARG3)          ( ((((uint32_t)(ARG1))          ) & 0x0000FFFFUL) |  \\r
+                                           ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL)  )\r
+\r
+#define __PKHTB(ARG1,ARG2,ARG3)          ( ((((uint32_t)(ARG1))          ) & 0xFFFF0000UL) |  \\r
+                                           ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL)  )\r
+\r
+#define __SMMLA(ARG1,ARG2,ARG3)          ( (int32_t)((((int64_t)(ARG1) * (ARG2)) + \\r
+                                                      ((int64_t)(ARG3) << 32U)     ) >> 32U))\r
+\r
+#endif /* ((defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1))     ) */\r
+/*@} end of group CMSIS_SIMD_intrinsics */\r
+\r
+\r
+#endif /* __CMSIS_ARMCC_H */\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/cmsis_armclang.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/cmsis_armclang.h
new file mode 100644 (file)
index 0000000..d8031b0
--- /dev/null
@@ -0,0 +1,1869 @@
+/**************************************************************************//**\r
+ * @file     cmsis_armclang.h\r
+ * @brief    CMSIS compiler armclang (Arm Compiler 6) header file\r
+ * @version  V5.0.4\r
+ * @date     10. January 2018\r
+ ******************************************************************************/\r
+/*\r
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.\r
+ *\r
+ * SPDX-License-Identifier: Apache-2.0\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the License); you may\r
+ * not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+/*lint -esym(9058, IRQn)*/ /* disable MISRA 2012 Rule 2.4 for IRQn */\r
+\r
+#ifndef __CMSIS_ARMCLANG_H\r
+#define __CMSIS_ARMCLANG_H\r
+\r
+#pragma clang system_header   /* treat file as system include file */\r
+\r
+#ifndef __ARM_COMPAT_H\r
+#include <arm_compat.h>    /* Compatibility header for Arm Compiler 5 intrinsics */\r
+#endif\r
+\r
+/* CMSIS compiler specific defines */\r
+#ifndef   __ASM\r
+  #define __ASM                                  __asm\r
+#endif\r
+#ifndef   __INLINE\r
+  #define __INLINE                               __inline\r
+#endif\r
+#ifndef   __STATIC_INLINE\r
+  #define __STATIC_INLINE                        static __inline\r
+#endif\r
+#ifndef   __STATIC_FORCEINLINE                 \r
+  #define __STATIC_FORCEINLINE                   __attribute__((always_inline)) static __inline\r
+#endif                                           \r
+#ifndef   __NO_RETURN\r
+  #define __NO_RETURN                            __attribute__((__noreturn__))\r
+#endif\r
+#ifndef   __USED\r
+  #define __USED                                 __attribute__((used))\r
+#endif\r
+#ifndef   __WEAK\r
+  #define __WEAK                                 __attribute__((weak))\r
+#endif\r
+#ifndef   __PACKED\r
+  #define __PACKED                               __attribute__((packed, aligned(1)))\r
+#endif\r
+#ifndef   __PACKED_STRUCT\r
+  #define __PACKED_STRUCT                        struct __attribute__((packed, aligned(1)))\r
+#endif\r
+#ifndef   __PACKED_UNION\r
+  #define __PACKED_UNION                         union __attribute__((packed, aligned(1)))\r
+#endif\r
+#ifndef   __UNALIGNED_UINT32        /* deprecated */\r
+  #pragma clang diagnostic push\r
+  #pragma clang diagnostic ignored "-Wpacked"\r
+/*lint -esym(9058, T_UINT32)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32 */\r
+  struct __attribute__((packed)) T_UINT32 { uint32_t v; };\r
+  #pragma clang diagnostic pop\r
+  #define __UNALIGNED_UINT32(x)                  (((struct T_UINT32 *)(x))->v)\r
+#endif\r
+#ifndef   __UNALIGNED_UINT16_WRITE\r
+  #pragma clang diagnostic push\r
+  #pragma clang diagnostic ignored "-Wpacked"\r
+/*lint -esym(9058, T_UINT16_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_WRITE */\r
+  __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };\r
+  #pragma clang diagnostic pop\r
+  #define __UNALIGNED_UINT16_WRITE(addr, val)    (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))\r
+#endif\r
+#ifndef   __UNALIGNED_UINT16_READ\r
+  #pragma clang diagnostic push\r
+  #pragma clang diagnostic ignored "-Wpacked"\r
+/*lint -esym(9058, T_UINT16_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_READ */\r
+  __PACKED_STRUCT T_UINT16_READ { uint16_t v; };\r
+  #pragma clang diagnostic pop\r
+  #define __UNALIGNED_UINT16_READ(addr)          (((const struct T_UINT16_READ *)(const void *)(addr))->v)\r
+#endif\r
+#ifndef   __UNALIGNED_UINT32_WRITE\r
+  #pragma clang diagnostic push\r
+  #pragma clang diagnostic ignored "-Wpacked"\r
+/*lint -esym(9058, T_UINT32_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_WRITE */\r
+  __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };\r
+  #pragma clang diagnostic pop\r
+  #define __UNALIGNED_UINT32_WRITE(addr, val)    (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))\r
+#endif\r
+#ifndef   __UNALIGNED_UINT32_READ\r
+  #pragma clang diagnostic push\r
+  #pragma clang diagnostic ignored "-Wpacked"\r
+/*lint -esym(9058, T_UINT32_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_READ */\r
+  __PACKED_STRUCT T_UINT32_READ { uint32_t v; };\r
+  #pragma clang diagnostic pop\r
+  #define __UNALIGNED_UINT32_READ(addr)          (((const struct T_UINT32_READ *)(const void *)(addr))->v)\r
+#endif\r
+#ifndef   __ALIGNED\r
+  #define __ALIGNED(x)                           __attribute__((aligned(x)))\r
+#endif\r
+#ifndef   __RESTRICT\r
+  #define __RESTRICT                             __restrict\r
+#endif\r
+\r
+\r
+/* ###########################  Core Function Access  ########################### */\r
+/** \ingroup  CMSIS_Core_FunctionInterface\r
+    \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   Enable IRQ Interrupts\r
+  \details Enables IRQ interrupts by clearing the I-bit in the CPSR.\r
+           Can only be executed in Privileged modes.\r
+ */\r
+/* intrinsic void __enable_irq();  see arm_compat.h */\r
+\r
+\r
+/**\r
+  \brief   Disable IRQ Interrupts\r
+  \details Disables IRQ interrupts by setting the I-bit in the CPSR.\r
+           Can only be executed in Privileged modes.\r
+ */\r
+/* intrinsic void __disable_irq();  see arm_compat.h */\r
+\r
+\r
+/**\r
+  \brief   Get Control Register\r
+  \details Returns the content of the Control Register.\r
+  \return               Control Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __get_CONTROL(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, control" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Get Control Register (non-secure)\r
+  \details Returns the content of the non-secure Control Register when in secure mode.\r
+  \return               non-secure Control Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, control_ns" : "=r" (result) );\r
+  return(result);\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Set Control Register\r
+  \details Writes the given value to the Control Register.\r
+  \param [in]    control  Control Register value to set\r
+ */\r
+__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control)\r
+{\r
+  __ASM volatile ("MSR control, %0" : : "r" (control) : "memory");\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Set Control Register (non-secure)\r
+  \details Writes the given value to the non-secure Control Register when in secure state.\r
+  \param [in]    control  Control Register value to set\r
+ */\r
+__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control)\r
+{\r
+  __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory");\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Get IPSR Register\r
+  \details Returns the content of the IPSR Register.\r
+  \return               IPSR Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __get_IPSR(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, ipsr" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get APSR Register\r
+  \details Returns the content of the APSR Register.\r
+  \return               APSR Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __get_APSR(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, apsr" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get xPSR Register\r
+  \details Returns the content of the xPSR Register.\r
+  \return               xPSR Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __get_xPSR(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, xpsr" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Process Stack Pointer\r
+  \details Returns the current value of the Process Stack Pointer (PSP).\r
+  \return               PSP Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __get_PSP(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, psp"  : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Get Process Stack Pointer (non-secure)\r
+  \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state.\r
+  \return               PSP Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, psp_ns"  : "=r" (result) );\r
+  return(result);\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Set Process Stack Pointer\r
+  \details Assigns the given value to the Process Stack Pointer (PSP).\r
+  \param [in]    topOfProcStack  Process Stack Pointer value to set\r
+ */\r
+__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack)\r
+{\r
+  __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : );\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Set Process Stack Pointer (non-secure)\r
+  \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state.\r
+  \param [in]    topOfProcStack  Process Stack Pointer value to set\r
+ */\r
+__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack)\r
+{\r
+  __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : );\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Get Main Stack Pointer\r
+  \details Returns the current value of the Main Stack Pointer (MSP).\r
+  \return               MSP Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __get_MSP(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, msp" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Get Main Stack Pointer (non-secure)\r
+  \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state.\r
+  \return               MSP Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, msp_ns" : "=r" (result) );\r
+  return(result);\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Set Main Stack Pointer\r
+  \details Assigns the given value to the Main Stack Pointer (MSP).\r
+  \param [in]    topOfMainStack  Main Stack Pointer value to set\r
+ */\r
+__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack)\r
+{\r
+  __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : );\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Set Main Stack Pointer (non-secure)\r
+  \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state.\r
+  \param [in]    topOfMainStack  Main Stack Pointer value to set\r
+ */\r
+__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack)\r
+{\r
+  __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : );\r
+}\r
+#endif\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Get Stack Pointer (non-secure)\r
+  \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state.\r
+  \return               SP Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, sp_ns" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Stack Pointer (non-secure)\r
+  \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state.\r
+  \param [in]    topOfStack  Stack Pointer value to set\r
+ */\r
+__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack)\r
+{\r
+  __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : );\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Get Priority Mask\r
+  \details Returns the current state of the priority mask bit from the Priority Mask Register.\r
+  \return               Priority Mask value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, primask" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Get Priority Mask (non-secure)\r
+  \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state.\r
+  \return               Priority Mask value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, primask_ns" : "=r" (result) );\r
+  return(result);\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Set Priority Mask\r
+  \details Assigns the given value to the Priority Mask Register.\r
+  \param [in]    priMask  Priority Mask\r
+ */\r
+__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask)\r
+{\r
+  __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory");\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Set Priority Mask (non-secure)\r
+  \details Assigns the given value to the non-secure Priority Mask Register when in secure state.\r
+  \param [in]    priMask  Priority Mask\r
+ */\r
+__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask)\r
+{\r
+  __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory");\r
+}\r
+#endif\r
+\r
+\r
+#if ((defined (__ARM_ARCH_7M__      ) && (__ARM_ARCH_7M__      == 1)) || \\r
+     (defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \\r
+     (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))    )\r
+/**\r
+  \brief   Enable FIQ\r
+  \details Enables FIQ interrupts by clearing the F-bit in the CPSR.\r
+           Can only be executed in Privileged modes.\r
+ */\r
+#define __enable_fault_irq                __enable_fiq   /* see arm_compat.h */\r
+\r
+\r
+/**\r
+  \brief   Disable FIQ\r
+  \details Disables FIQ interrupts by setting the F-bit in the CPSR.\r
+           Can only be executed in Privileged modes.\r
+ */\r
+#define __disable_fault_irq               __disable_fiq   /* see arm_compat.h */\r
+\r
+\r
+/**\r
+  \brief   Get Base Priority\r
+  \details Returns the current value of the Base Priority register.\r
+  \return               Base Priority register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, basepri" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Get Base Priority (non-secure)\r
+  \details Returns the current value of the non-secure Base Priority register when in secure state.\r
+  \return               Base Priority register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) );\r
+  return(result);\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Set Base Priority\r
+  \details Assigns the given value to the Base Priority register.\r
+  \param [in]    basePri  Base Priority value to set\r
+ */\r
+__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri)\r
+{\r
+  __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory");\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Set Base Priority (non-secure)\r
+  \details Assigns the given value to the non-secure Base Priority register when in secure state.\r
+  \param [in]    basePri  Base Priority value to set\r
+ */\r
+__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri)\r
+{\r
+  __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory");\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Set Base Priority with condition\r
+  \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled,\r
+           or the new value increases the BASEPRI priority level.\r
+  \param [in]    basePri  Base Priority value to set\r
+ */\r
+__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri)\r
+{\r
+  __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory");\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Fault Mask\r
+  \details Returns the current value of the Fault Mask register.\r
+  \return               Fault Mask register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, faultmask" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Get Fault Mask (non-secure)\r
+  \details Returns the current value of the non-secure Fault Mask register when in secure state.\r
+  \return               Fault Mask register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) );\r
+  return(result);\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Set Fault Mask\r
+  \details Assigns the given value to the Fault Mask register.\r
+  \param [in]    faultMask  Fault Mask value to set\r
+ */\r
+__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask)\r
+{\r
+  __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory");\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Set Fault Mask (non-secure)\r
+  \details Assigns the given value to the non-secure Fault Mask register when in secure state.\r
+  \param [in]    faultMask  Fault Mask value to set\r
+ */\r
+__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask)\r
+{\r
+  __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory");\r
+}\r
+#endif\r
+\r
+#endif /* ((defined (__ARM_ARCH_7M__      ) && (__ARM_ARCH_7M__      == 1)) || \\r
+           (defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \\r
+           (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))    ) */\r
+\r
+\r
+#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \\r
+     (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1))    )\r
+\r
+/**\r
+  \brief   Get Process Stack Pointer Limit\r
+  Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure\r
+  Stack Pointer Limit register hence zero is returned always in non-secure\r
+  mode.\r
+  \r
+  \details Returns the current value of the Process Stack Pointer Limit (PSPLIM).\r
+  \return               PSPLIM Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void)\r
+{\r
+#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \\r
+    (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))\r
+    // without main extensions, the non-secure PSPLIM is RAZ/WI\r
+  return 0U;\r
+#else\r
+  uint32_t result;\r
+  __ASM volatile ("MRS %0, psplim"  : "=r" (result) );\r
+  return result;\r
+#endif\r
+}\r
+\r
+#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Get Process Stack Pointer Limit (non-secure)\r
+  Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure\r
+  Stack Pointer Limit register hence zero is returned always in non-secure\r
+  mode.\r
+\r
+  \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state.\r
+  \return               PSPLIM Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void)\r
+{\r
+#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))\r
+  // without main extensions, the non-secure PSPLIM is RAZ/WI\r
+  return 0U;\r
+#else\r
+  uint32_t result;\r
+  __ASM volatile ("MRS %0, psplim_ns"  : "=r" (result) );\r
+  return result;\r
+#endif\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Set Process Stack Pointer Limit\r
+  Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure\r
+  Stack Pointer Limit register hence the write is silently ignored in non-secure\r
+  mode.\r
+  \r
+  \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM).\r
+  \param [in]    ProcStackPtrLimit  Process Stack Pointer Limit value to set\r
+ */\r
+__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit)\r
+{\r
+#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \\r
+    (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))\r
+  // without main extensions, the non-secure PSPLIM is RAZ/WI\r
+  (void)ProcStackPtrLimit;\r
+#else\r
+  __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit));\r
+#endif\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE  ) && (__ARM_FEATURE_CMSE   == 3))\r
+/**\r
+  \brief   Set Process Stack Pointer (non-secure)\r
+  Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure\r
+  Stack Pointer Limit register hence the write is silently ignored in non-secure\r
+  mode.\r
+\r
+  \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state.\r
+  \param [in]    ProcStackPtrLimit  Process Stack Pointer Limit value to set\r
+ */\r
+__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit)\r
+{\r
+#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))\r
+  // without main extensions, the non-secure PSPLIM is RAZ/WI\r
+  (void)ProcStackPtrLimit;\r
+#else\r
+  __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit));\r
+#endif\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Get Main Stack Pointer Limit\r
+  Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure\r
+  Stack Pointer Limit register hence zero is returned always.\r
+\r
+  \details Returns the current value of the Main Stack Pointer Limit (MSPLIM).\r
+  \return               MSPLIM Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void)\r
+{\r
+#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \\r
+    (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))\r
+  // without main extensions, the non-secure MSPLIM is RAZ/WI\r
+  return 0U;\r
+#else\r
+  uint32_t result;\r
+  __ASM volatile ("MRS %0, msplim" : "=r" (result) );\r
+  return result;\r
+#endif\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE  ) && (__ARM_FEATURE_CMSE   == 3))\r
+/**\r
+  \brief   Get Main Stack Pointer Limit (non-secure)\r
+  Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure\r
+  Stack Pointer Limit register hence zero is returned always.\r
+\r
+  \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state.\r
+  \return               MSPLIM Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void)\r
+{\r
+#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))\r
+  // without main extensions, the non-secure MSPLIM is RAZ/WI\r
+  return 0U;\r
+#else\r
+  uint32_t result;\r
+  __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) );\r
+  return result;\r
+#endif\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Set Main Stack Pointer Limit\r
+  Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure\r
+  Stack Pointer Limit register hence the write is silently ignored.\r
+\r
+  \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM).\r
+  \param [in]    MainStackPtrLimit  Main Stack Pointer Limit value to set\r
+ */\r
+__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit)\r
+{\r
+#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \\r
+    (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))\r
+  // without main extensions, the non-secure MSPLIM is RAZ/WI\r
+  (void)MainStackPtrLimit;\r
+#else\r
+  __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit));\r
+#endif\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE  ) && (__ARM_FEATURE_CMSE   == 3))\r
+/**\r
+  \brief   Set Main Stack Pointer Limit (non-secure)\r
+  Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure\r
+  Stack Pointer Limit register hence the write is silently ignored.\r
+\r
+  \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state.\r
+  \param [in]    MainStackPtrLimit  Main Stack Pointer value to set\r
+ */\r
+__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit)\r
+{\r
+#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))\r
+  // without main extensions, the non-secure MSPLIM is RAZ/WI\r
+  (void)MainStackPtrLimit;\r
+#else\r
+  __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit));\r
+#endif\r
+}\r
+#endif\r
+\r
+#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \\r
+           (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1))    ) */\r
+\r
+/**\r
+  \brief   Get FPSCR\r
+  \details Returns the current value of the Floating Point Status/Control register.\r
+  \return               Floating Point Status/Control register value\r
+ */\r
+#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \\r
+     (defined (__FPU_USED   ) && (__FPU_USED    == 1U))     )\r
+#define __get_FPSCR      (uint32_t)__builtin_arm_get_fpscr\r
+#else\r
+#define __get_FPSCR()      ((uint32_t)0U)\r
+#endif\r
+\r
+/**\r
+  \brief   Set FPSCR\r
+  \details Assigns the given value to the Floating Point Status/Control register.\r
+  \param [in]    fpscr  Floating Point Status/Control value to set\r
+ */\r
+#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \\r
+     (defined (__FPU_USED   ) && (__FPU_USED    == 1U))     )\r
+#define __set_FPSCR      __builtin_arm_set_fpscr\r
+#else\r
+#define __set_FPSCR(x)      ((void)(x))\r
+#endif\r
+\r
+\r
+/*@} end of CMSIS_Core_RegAccFunctions */\r
+\r
+\r
+/* ##########################  Core Instruction Access  ######################### */\r
+/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface\r
+  Access to dedicated instructions\r
+  @{\r
+*/\r
+\r
+/* Define macros for porting to both thumb1 and thumb2.\r
+ * For thumb1, use low register (r0-r7), specified by constraint "l"\r
+ * Otherwise, use general registers, specified by constraint "r" */\r
+#if defined (__thumb__) && !defined (__thumb2__)\r
+#define __CMSIS_GCC_OUT_REG(r) "=l" (r)\r
+#define __CMSIS_GCC_USE_REG(r) "l" (r)\r
+#else\r
+#define __CMSIS_GCC_OUT_REG(r) "=r" (r)\r
+#define __CMSIS_GCC_USE_REG(r) "r" (r)\r
+#endif\r
+\r
+/**\r
+  \brief   No Operation\r
+  \details No Operation does nothing. This instruction can be used for code alignment purposes.\r
+ */\r
+#define __NOP          __builtin_arm_nop\r
+\r
+/**\r
+  \brief   Wait For Interrupt\r
+  \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs.\r
+ */\r
+#define __WFI          __builtin_arm_wfi\r
+\r
+\r
+/**\r
+  \brief   Wait For Event\r
+  \details Wait For Event is a hint instruction that permits the processor to enter\r
+           a low-power state until one of a number of events occurs.\r
+ */\r
+#define __WFE          __builtin_arm_wfe\r
+\r
+\r
+/**\r
+  \brief   Send Event\r
+  \details Send Event is a hint instruction. It causes an event to be signaled to the CPU.\r
+ */\r
+#define __SEV          __builtin_arm_sev\r
+\r
+\r
+/**\r
+  \brief   Instruction Synchronization Barrier\r
+  \details Instruction Synchronization Barrier flushes the pipeline in the processor,\r
+           so that all instructions following the ISB are fetched from cache or memory,\r
+           after the instruction has been completed.\r
+ */\r
+#define __ISB()        __builtin_arm_isb(0xF);\r
+\r
+/**\r
+  \brief   Data Synchronization Barrier\r
+  \details Acts as a special kind of Data Memory Barrier.\r
+           It completes when all explicit memory accesses before this instruction complete.\r
+ */\r
+#define __DSB()        __builtin_arm_dsb(0xF);\r
+\r
+\r
+/**\r
+  \brief   Data Memory Barrier\r
+  \details Ensures the apparent order of the explicit memory operations before\r
+           and after the instruction, without ensuring their completion.\r
+ */\r
+#define __DMB()        __builtin_arm_dmb(0xF);\r
+\r
+\r
+/**\r
+  \brief   Reverse byte order (32 bit)\r
+  \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412.\r
+  \param [in]    value  Value to reverse\r
+  \return               Reversed value\r
+ */\r
+#define __REV(value)   __builtin_bswap32(value)\r
+\r
+\r
+/**\r
+  \brief   Reverse byte order (16 bit)\r
+  \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856.\r
+  \param [in]    value  Value to reverse\r
+  \return               Reversed value\r
+ */\r
+#define __REV16(value) __ROR(__REV(value), 16)\r
+\r
+\r
+/**\r
+  \brief   Reverse byte order (16 bit)\r
+  \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000.\r
+  \param [in]    value  Value to reverse\r
+  \return               Reversed value\r
+ */\r
+#define __REVSH(value) (int16_t)__builtin_bswap16(value)\r
+\r
+\r
+/**\r
+  \brief   Rotate Right in unsigned value (32 bit)\r
+  \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.\r
+  \param [in]    op1  Value to rotate\r
+  \param [in]    op2  Number of Bits to rotate\r
+  \return               Rotated value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2)\r
+{\r
+  op2 %= 32U;\r
+  if (op2 == 0U)\r
+  {\r
+    return op1;\r
+  }\r
+  return (op1 >> op2) | (op1 << (32U - op2));\r
+}\r
+\r
+\r
+/**\r
+  \brief   Breakpoint\r
+  \details Causes the processor to enter Debug state.\r
+           Debug tools can use this to investigate system state when the instruction at a particular address is reached.\r
+  \param [in]    value  is ignored by the processor.\r
+                 If required, a debugger can use it to store additional information about the breakpoint.\r
+ */\r
+#define __BKPT(value)     __ASM volatile ("bkpt "#value)\r
+\r
+\r
+/**\r
+  \brief   Reverse bit order of value\r
+  \details Reverses the bit order of the given value.\r
+  \param [in]    value  Value to reverse\r
+  \return               Reversed value\r
+ */\r
+#define __RBIT            __builtin_arm_rbit\r
+\r
+/**\r
+  \brief   Count leading zeros\r
+  \details Counts the number of leading zeros of a data value.\r
+  \param [in]  value  Value to count the leading zeros\r
+  \return             number of leading zeros in value\r
+ */\r
+#define __CLZ             (uint8_t)__builtin_clz\r
+\r
+\r
+#if ((defined (__ARM_ARCH_7M__      ) && (__ARM_ARCH_7M__      == 1)) || \\r
+     (defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \\r
+     (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \\r
+     (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1))    )\r
+/**\r
+  \brief   LDR Exclusive (8 bit)\r
+  \details Executes a exclusive LDR instruction for 8 bit value.\r
+  \param [in]    ptr  Pointer to data\r
+  \return             value of type uint8_t at (*ptr)\r
+ */\r
+#define __LDREXB        (uint8_t)__builtin_arm_ldrex\r
+\r
+\r
+/**\r
+  \brief   LDR Exclusive (16 bit)\r
+  \details Executes a exclusive LDR instruction for 16 bit values.\r
+  \param [in]    ptr  Pointer to data\r
+  \return        value of type uint16_t at (*ptr)\r
+ */\r
+#define __LDREXH        (uint16_t)__builtin_arm_ldrex\r
+\r
+\r
+/**\r
+  \brief   LDR Exclusive (32 bit)\r
+  \details Executes a exclusive LDR instruction for 32 bit values.\r
+  \param [in]    ptr  Pointer to data\r
+  \return        value of type uint32_t at (*ptr)\r
+ */\r
+#define __LDREXW        (uint32_t)__builtin_arm_ldrex\r
+\r
+\r
+/**\r
+  \brief   STR Exclusive (8 bit)\r
+  \details Executes a exclusive STR instruction for 8 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+  \return          0  Function succeeded\r
+  \return          1  Function failed\r
+ */\r
+#define __STREXB        (uint32_t)__builtin_arm_strex\r
+\r
+\r
+/**\r
+  \brief   STR Exclusive (16 bit)\r
+  \details Executes a exclusive STR instruction for 16 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+  \return          0  Function succeeded\r
+  \return          1  Function failed\r
+ */\r
+#define __STREXH        (uint32_t)__builtin_arm_strex\r
+\r
+\r
+/**\r
+  \brief   STR Exclusive (32 bit)\r
+  \details Executes a exclusive STR instruction for 32 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+  \return          0  Function succeeded\r
+  \return          1  Function failed\r
+ */\r
+#define __STREXW        (uint32_t)__builtin_arm_strex\r
+\r
+\r
+/**\r
+  \brief   Remove the exclusive lock\r
+  \details Removes the exclusive lock which is created by LDREX.\r
+ */\r
+#define __CLREX             __builtin_arm_clrex\r
+\r
+#endif /* ((defined (__ARM_ARCH_7M__      ) && (__ARM_ARCH_7M__      == 1)) || \\r
+           (defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \\r
+           (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \\r
+           (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1))    ) */\r
+\r
+\r
+#if ((defined (__ARM_ARCH_7M__      ) && (__ARM_ARCH_7M__      == 1)) || \\r
+     (defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \\r
+     (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))    )\r
+\r
+/**\r
+  \brief   Signed Saturate\r
+  \details Saturates a signed value.\r
+  \param [in]  value  Value to be saturated\r
+  \param [in]    sat  Bit position to saturate to (1..32)\r
+  \return             Saturated value\r
+ */\r
+#define __SSAT             __builtin_arm_ssat\r
+\r
+\r
+/**\r
+  \brief   Unsigned Saturate\r
+  \details Saturates an unsigned value.\r
+  \param [in]  value  Value to be saturated\r
+  \param [in]    sat  Bit position to saturate to (0..31)\r
+  \return             Saturated value\r
+ */\r
+#define __USAT             __builtin_arm_usat\r
+\r
+\r
+/**\r
+  \brief   Rotate Right with Extend (32 bit)\r
+  \details Moves each bit of a bitstring right by one bit.\r
+           The carry input is shifted in at the left end of the bitstring.\r
+  \param [in]    value  Value to rotate\r
+  \return               Rotated value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) );\r
+  return(result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   LDRT Unprivileged (8 bit)\r
+  \details Executes a Unprivileged LDRT instruction for 8 bit value.\r
+  \param [in]    ptr  Pointer to data\r
+  \return             value of type uint8_t at (*ptr)\r
+ */\r
+__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) );\r
+  return ((uint8_t) result);    /* Add explicit type cast here */\r
+}\r
+\r
+\r
+/**\r
+  \brief   LDRT Unprivileged (16 bit)\r
+  \details Executes a Unprivileged LDRT instruction for 16 bit values.\r
+  \param [in]    ptr  Pointer to data\r
+  \return        value of type uint16_t at (*ptr)\r
+ */\r
+__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) );\r
+  return ((uint16_t) result);    /* Add explicit type cast here */\r
+}\r
+\r
+\r
+/**\r
+  \brief   LDRT Unprivileged (32 bit)\r
+  \details Executes a Unprivileged LDRT instruction for 32 bit values.\r
+  \param [in]    ptr  Pointer to data\r
+  \return        value of type uint32_t at (*ptr)\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) );\r
+  return(result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   STRT Unprivileged (8 bit)\r
+  \details Executes a Unprivileged STRT instruction for 8 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+ */\r
+__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr)\r
+{\r
+  __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) );\r
+}\r
+\r
+\r
+/**\r
+  \brief   STRT Unprivileged (16 bit)\r
+  \details Executes a Unprivileged STRT instruction for 16 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+ */\r
+__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr)\r
+{\r
+  __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) );\r
+}\r
+\r
+\r
+/**\r
+  \brief   STRT Unprivileged (32 bit)\r
+  \details Executes a Unprivileged STRT instruction for 32 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+ */\r
+__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr)\r
+{\r
+  __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) );\r
+}\r
+\r
+#else  /* ((defined (__ARM_ARCH_7M__      ) && (__ARM_ARCH_7M__      == 1)) || \\r
+           (defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \\r
+           (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))    ) */\r
+\r
+/**\r
+  \brief   Signed Saturate\r
+  \details Saturates a signed value.\r
+  \param [in]  value  Value to be saturated\r
+  \param [in]    sat  Bit position to saturate to (1..32)\r
+  \return             Saturated value\r
+ */\r
+__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat)\r
+{\r
+  if ((sat >= 1U) && (sat <= 32U))\r
+  {\r
+    const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U);\r
+    const int32_t min = -1 - max ;\r
+    if (val > max)\r
+    {\r
+      return max;\r
+    }\r
+    else if (val < min)\r
+    {\r
+      return min;\r
+    }\r
+  }\r
+  return val;\r
+}\r
+\r
+/**\r
+  \brief   Unsigned Saturate\r
+  \details Saturates an unsigned value.\r
+  \param [in]  value  Value to be saturated\r
+  \param [in]    sat  Bit position to saturate to (0..31)\r
+  \return             Saturated value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat)\r
+{\r
+  if (sat <= 31U)\r
+  {\r
+    const uint32_t max = ((1U << sat) - 1U);\r
+    if (val > (int32_t)max)\r
+    {\r
+      return max;\r
+    }\r
+    else if (val < 0)\r
+    {\r
+      return 0U;\r
+    }\r
+  }\r
+  return (uint32_t)val;\r
+}\r
+\r
+#endif /* ((defined (__ARM_ARCH_7M__      ) && (__ARM_ARCH_7M__      == 1)) || \\r
+           (defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \\r
+           (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))    ) */\r
+\r
+\r
+#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \\r
+     (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1))    )\r
+/**\r
+  \brief   Load-Acquire (8 bit)\r
+  \details Executes a LDAB instruction for 8 bit value.\r
+  \param [in]    ptr  Pointer to data\r
+  \return             value of type uint8_t at (*ptr)\r
+ */\r
+__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) );\r
+  return ((uint8_t) result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Load-Acquire (16 bit)\r
+  \details Executes a LDAH instruction for 16 bit values.\r
+  \param [in]    ptr  Pointer to data\r
+  \return        value of type uint16_t at (*ptr)\r
+ */\r
+__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) );\r
+  return ((uint16_t) result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Load-Acquire (32 bit)\r
+  \details Executes a LDA instruction for 32 bit values.\r
+  \param [in]    ptr  Pointer to data\r
+  \return        value of type uint32_t at (*ptr)\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) );\r
+  return(result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Store-Release (8 bit)\r
+  \details Executes a STLB instruction for 8 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+ */\r
+__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr)\r
+{\r
+  __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) );\r
+}\r
+\r
+\r
+/**\r
+  \brief   Store-Release (16 bit)\r
+  \details Executes a STLH instruction for 16 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+ */\r
+__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr)\r
+{\r
+  __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) );\r
+}\r
+\r
+\r
+/**\r
+  \brief   Store-Release (32 bit)\r
+  \details Executes a STL instruction for 32 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+ */\r
+__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr)\r
+{\r
+  __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) );\r
+}\r
+\r
+\r
+/**\r
+  \brief   Load-Acquire Exclusive (8 bit)\r
+  \details Executes a LDAB exclusive instruction for 8 bit value.\r
+  \param [in]    ptr  Pointer to data\r
+  \return             value of type uint8_t at (*ptr)\r
+ */\r
+#define     __LDAEXB                 (uint8_t)__builtin_arm_ldaex\r
+\r
+\r
+/**\r
+  \brief   Load-Acquire Exclusive (16 bit)\r
+  \details Executes a LDAH exclusive instruction for 16 bit values.\r
+  \param [in]    ptr  Pointer to data\r
+  \return        value of type uint16_t at (*ptr)\r
+ */\r
+#define     __LDAEXH                 (uint16_t)__builtin_arm_ldaex\r
+\r
+\r
+/**\r
+  \brief   Load-Acquire Exclusive (32 bit)\r
+  \details Executes a LDA exclusive instruction for 32 bit values.\r
+  \param [in]    ptr  Pointer to data\r
+  \return        value of type uint32_t at (*ptr)\r
+ */\r
+#define     __LDAEX                  (uint32_t)__builtin_arm_ldaex\r
+\r
+\r
+/**\r
+  \brief   Store-Release Exclusive (8 bit)\r
+  \details Executes a STLB exclusive instruction for 8 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+  \return          0  Function succeeded\r
+  \return          1  Function failed\r
+ */\r
+#define     __STLEXB                 (uint32_t)__builtin_arm_stlex\r
+\r
+\r
+/**\r
+  \brief   Store-Release Exclusive (16 bit)\r
+  \details Executes a STLH exclusive instruction for 16 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+  \return          0  Function succeeded\r
+  \return          1  Function failed\r
+ */\r
+#define     __STLEXH                 (uint32_t)__builtin_arm_stlex\r
+\r
+\r
+/**\r
+  \brief   Store-Release Exclusive (32 bit)\r
+  \details Executes a STL exclusive instruction for 32 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+  \return          0  Function succeeded\r
+  \return          1  Function failed\r
+ */\r
+#define     __STLEX                  (uint32_t)__builtin_arm_stlex\r
+\r
+#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \\r
+           (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1))    ) */\r
+\r
+/*@}*/ /* end of group CMSIS_Core_InstructionInterface */\r
+\r
+\r
+/* ###################  Compiler specific Intrinsics  ########################### */\r
+/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics\r
+  Access to dedicated SIMD instructions\r
+  @{\r
+*/\r
+\r
+#if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1))\r
+\r
+__STATIC_FORCEINLINE uint32_t __SADD8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __QADD8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UADD8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+\r
+__STATIC_FORCEINLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __USUB8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+\r
+__STATIC_FORCEINLINE uint32_t __SADD16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __QADD16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UADD16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __USUB16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SASX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __QASX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SHASX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UASX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UQASX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UHASX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SSAX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __QSAX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __USAX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __USAD8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );\r
+  return(result);\r
+}\r
+\r
+#define __SSAT16(ARG1,ARG2) \\r
+({                          \\r
+  int32_t __RES, __ARG1 = (ARG1); \\r
+  __ASM ("ssat16 %0, %1, %2" : "=r" (__RES) :  "I" (ARG2), "r" (__ARG1) ); \\r
+  __RES; \\r
+ })\r
+\r
+#define __USAT16(ARG1,ARG2) \\r
+({                          \\r
+  uint32_t __RES, __ARG1 = (ARG1); \\r
+  __ASM ("usat16 %0, %1, %2" : "=r" (__RES) :  "I" (ARG2), "r" (__ARG1) ); \\r
+  __RES; \\r
+ })\r
+\r
+__STATIC_FORCEINLINE uint32_t __UXTB16(uint32_t op1)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1));\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SXTB16(uint32_t op1)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1));\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SMUAD  (uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint64_t __SMLALD (uint32_t op1, uint32_t op2, uint64_t acc)\r
+{\r
+  union llreg_u{\r
+    uint32_t w32[2];\r
+    uint64_t w64;\r
+  } llr;\r
+  llr.w64 = acc;\r
+\r
+#ifndef __ARMEB__   /* Little endian */\r
+  __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) );\r
+#else               /* Big endian */\r
+  __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) );\r
+#endif\r
+\r
+  return(llr.w64);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint64_t __SMLALDX (uint32_t op1, uint32_t op2, uint64_t acc)\r
+{\r
+  union llreg_u{\r
+    uint32_t w32[2];\r
+    uint64_t w64;\r
+  } llr;\r
+  llr.w64 = acc;\r
+\r
+#ifndef __ARMEB__   /* Little endian */\r
+  __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) );\r
+#else               /* Big endian */\r
+  __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) );\r
+#endif\r
+\r
+  return(llr.w64);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SMUSD  (uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint64_t __SMLSLD (uint32_t op1, uint32_t op2, uint64_t acc)\r
+{\r
+  union llreg_u{\r
+    uint32_t w32[2];\r
+    uint64_t w64;\r
+  } llr;\r
+  llr.w64 = acc;\r
+\r
+#ifndef __ARMEB__   /* Little endian */\r
+  __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) );\r
+#else               /* Big endian */\r
+  __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) );\r
+#endif\r
+\r
+  return(llr.w64);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint64_t __SMLSLDX (uint32_t op1, uint32_t op2, uint64_t acc)\r
+{\r
+  union llreg_u{\r
+    uint32_t w32[2];\r
+    uint64_t w64;\r
+  } llr;\r
+  llr.w64 = acc;\r
+\r
+#ifndef __ARMEB__   /* Little endian */\r
+  __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) );\r
+#else               /* Big endian */\r
+  __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) );\r
+#endif\r
+\r
+  return(llr.w64);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SEL  (uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE  int32_t __QADD( int32_t op1,  int32_t op2)\r
+{\r
+  int32_t result;\r
+\r
+  __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE  int32_t __QSUB( int32_t op1,  int32_t op2)\r
+{\r
+  int32_t result;\r
+\r
+  __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+#if 0\r
+#define __PKHBT(ARG1,ARG2,ARG3) \\r
+({                          \\r
+  uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \\r
+  __ASM ("pkhbt %0, %1, %2, lsl %3" : "=r" (__RES) :  "r" (__ARG1), "r" (__ARG2), "I" (ARG3)  ); \\r
+  __RES; \\r
+ })\r
+\r
+#define __PKHTB(ARG1,ARG2,ARG3) \\r
+({                          \\r
+  uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \\r
+  if (ARG3 == 0) \\r
+    __ASM ("pkhtb %0, %1, %2" : "=r" (__RES) :  "r" (__ARG1), "r" (__ARG2)  ); \\r
+  else \\r
+    __ASM ("pkhtb %0, %1, %2, asr %3" : "=r" (__RES) :  "r" (__ARG1), "r" (__ARG2), "I" (ARG3)  ); \\r
+  __RES; \\r
+ })\r
+#endif\r
+\r
+#define __PKHBT(ARG1,ARG2,ARG3)          ( ((((uint32_t)(ARG1))          ) & 0x0000FFFFUL) |  \\r
+                                           ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL)  )\r
+\r
+#define __PKHTB(ARG1,ARG2,ARG3)          ( ((((uint32_t)(ARG1))          ) & 0xFFFF0000UL) |  \\r
+                                           ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL)  )\r
+\r
+__STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3)\r
+{\r
+  int32_t result;\r
+\r
+  __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r"  (op1), "r" (op2), "r" (op3) );\r
+  return(result);\r
+}\r
+\r
+#endif /* (__ARM_FEATURE_DSP == 1) */\r
+/*@} end of group CMSIS_SIMD_intrinsics */\r
+\r
+\r
+#endif /* __CMSIS_ARMCLANG_H */\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/cmsis_compiler.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/cmsis_compiler.h
new file mode 100644 (file)
index 0000000..79a2cac
--- /dev/null
@@ -0,0 +1,266 @@
+/**************************************************************************//**\r
+ * @file     cmsis_compiler.h\r
+ * @brief    CMSIS compiler generic header file\r
+ * @version  V5.0.4\r
+ * @date     10. January 2018\r
+ ******************************************************************************/\r
+/*\r
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.\r
+ *\r
+ * SPDX-License-Identifier: Apache-2.0\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the License); you may\r
+ * not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#ifndef __CMSIS_COMPILER_H\r
+#define __CMSIS_COMPILER_H\r
+\r
+#include <stdint.h>\r
+\r
+/*\r
+ * Arm Compiler 4/5\r
+ */\r
+#if   defined ( __CC_ARM )\r
+  #include "cmsis_armcc.h"\r
+\r
+\r
+/*\r
+ * Arm Compiler 6 (armclang)\r
+ */\r
+#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)\r
+  #include "cmsis_armclang.h"\r
+\r
+\r
+/*\r
+ * GNU Compiler\r
+ */\r
+#elif defined ( __GNUC__ )\r
+  #include "cmsis_gcc.h"\r
+\r
+\r
+/*\r
+ * IAR Compiler\r
+ */\r
+#elif defined ( __ICCARM__ )\r
+  #include <cmsis_iccarm.h>\r
+\r
+\r
+/*\r
+ * TI Arm Compiler\r
+ */\r
+#elif defined ( __TI_ARM__ )\r
+  #include <cmsis_ccs.h>\r
+\r
+  #ifndef   __ASM\r
+    #define __ASM                                  __asm\r
+  #endif\r
+  #ifndef   __INLINE\r
+    #define __INLINE                               inline\r
+  #endif\r
+  #ifndef   __STATIC_INLINE\r
+    #define __STATIC_INLINE                        static inline\r
+  #endif\r
+  #ifndef   __STATIC_FORCEINLINE\r
+    #define __STATIC_FORCEINLINE                   __STATIC_INLINE\r
+  #endif\r
+  #ifndef   __NO_RETURN\r
+    #define __NO_RETURN                            __attribute__((noreturn))\r
+  #endif\r
+  #ifndef   __USED\r
+    #define __USED                                 __attribute__((used))\r
+  #endif\r
+  #ifndef   __WEAK\r
+    #define __WEAK                                 __attribute__((weak))\r
+  #endif\r
+  #ifndef   __PACKED\r
+    #define __PACKED                               __attribute__((packed))\r
+  #endif\r
+  #ifndef   __PACKED_STRUCT\r
+    #define __PACKED_STRUCT                        struct __attribute__((packed))\r
+  #endif\r
+  #ifndef   __PACKED_UNION\r
+    #define __PACKED_UNION                         union __attribute__((packed))\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT32        /* deprecated */\r
+    struct __attribute__((packed)) T_UINT32 { uint32_t v; };\r
+    #define __UNALIGNED_UINT32(x)                  (((struct T_UINT32 *)(x))->v)\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT16_WRITE\r
+    __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };\r
+    #define __UNALIGNED_UINT16_WRITE(addr, val)    (void)((((struct T_UINT16_WRITE *)(void*)(addr))->v) = (val))\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT16_READ\r
+    __PACKED_STRUCT T_UINT16_READ { uint16_t v; };\r
+    #define __UNALIGNED_UINT16_READ(addr)          (((const struct T_UINT16_READ *)(const void *)(addr))->v)\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT32_WRITE\r
+    __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };\r
+    #define __UNALIGNED_UINT32_WRITE(addr, val)    (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT32_READ\r
+    __PACKED_STRUCT T_UINT32_READ { uint32_t v; };\r
+    #define __UNALIGNED_UINT32_READ(addr)          (((const struct T_UINT32_READ *)(const void *)(addr))->v)\r
+  #endif\r
+  #ifndef   __ALIGNED\r
+    #define __ALIGNED(x)                           __attribute__((aligned(x)))\r
+  #endif\r
+  #ifndef   __RESTRICT\r
+    #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored.\r
+    #define __RESTRICT\r
+  #endif\r
+\r
+\r
+/*\r
+ * TASKING Compiler\r
+ */\r
+#elif defined ( __TASKING__ )\r
+  /*\r
+   * The CMSIS functions have been implemented as intrinsics in the compiler.\r
+   * Please use "carm -?i" to get an up to date list of all intrinsics,\r
+   * Including the CMSIS ones.\r
+   */\r
+\r
+  #ifndef   __ASM\r
+    #define __ASM                                  __asm\r
+  #endif\r
+  #ifndef   __INLINE\r
+    #define __INLINE                               inline\r
+  #endif\r
+  #ifndef   __STATIC_INLINE\r
+    #define __STATIC_INLINE                        static inline\r
+  #endif\r
+  #ifndef   __STATIC_FORCEINLINE\r
+    #define __STATIC_FORCEINLINE                   __STATIC_INLINE\r
+  #endif\r
+  #ifndef   __NO_RETURN\r
+    #define __NO_RETURN                            __attribute__((noreturn))\r
+  #endif\r
+  #ifndef   __USED\r
+    #define __USED                                 __attribute__((used))\r
+  #endif\r
+  #ifndef   __WEAK\r
+    #define __WEAK                                 __attribute__((weak))\r
+  #endif\r
+  #ifndef   __PACKED\r
+    #define __PACKED                               __packed__\r
+  #endif\r
+  #ifndef   __PACKED_STRUCT\r
+    #define __PACKED_STRUCT                        struct __packed__\r
+  #endif\r
+  #ifndef   __PACKED_UNION\r
+    #define __PACKED_UNION                         union __packed__\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT32        /* deprecated */\r
+    struct __packed__ T_UINT32 { uint32_t v; };\r
+    #define __UNALIGNED_UINT32(x)                  (((struct T_UINT32 *)(x))->v)\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT16_WRITE\r
+    __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };\r
+    #define __UNALIGNED_UINT16_WRITE(addr, val)    (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT16_READ\r
+    __PACKED_STRUCT T_UINT16_READ { uint16_t v; };\r
+    #define __UNALIGNED_UINT16_READ(addr)          (((const struct T_UINT16_READ *)(const void *)(addr))->v)\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT32_WRITE\r
+    __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };\r
+    #define __UNALIGNED_UINT32_WRITE(addr, val)    (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT32_READ\r
+    __PACKED_STRUCT T_UINT32_READ { uint32_t v; };\r
+    #define __UNALIGNED_UINT32_READ(addr)          (((const struct T_UINT32_READ *)(const void *)(addr))->v)\r
+  #endif\r
+  #ifndef   __ALIGNED\r
+    #define __ALIGNED(x)              __align(x)\r
+  #endif\r
+  #ifndef   __RESTRICT\r
+    #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored.\r
+    #define __RESTRICT\r
+  #endif\r
+\r
+\r
+/*\r
+ * COSMIC Compiler\r
+ */\r
+#elif defined ( __CSMC__ )\r
+   #include <cmsis_csm.h>\r
+\r
+ #ifndef   __ASM\r
+    #define __ASM                                  _asm\r
+  #endif\r
+  #ifndef   __INLINE\r
+    #define __INLINE                               inline\r
+  #endif\r
+  #ifndef   __STATIC_INLINE\r
+    #define __STATIC_INLINE                        static inline\r
+  #endif\r
+  #ifndef   __STATIC_FORCEINLINE\r
+    #define __STATIC_FORCEINLINE                   __STATIC_INLINE\r
+  #endif\r
+  #ifndef   __NO_RETURN\r
+    // NO RETURN is automatically detected hence no warning here\r
+    #define __NO_RETURN\r
+  #endif\r
+  #ifndef   __USED\r
+    #warning No compiler specific solution for __USED. __USED is ignored.\r
+    #define __USED\r
+  #endif\r
+  #ifndef   __WEAK\r
+    #define __WEAK                                 __weak\r
+  #endif\r
+  #ifndef   __PACKED\r
+    #define __PACKED                               @packed\r
+  #endif\r
+  #ifndef   __PACKED_STRUCT\r
+    #define __PACKED_STRUCT                        @packed struct\r
+  #endif\r
+  #ifndef   __PACKED_UNION\r
+    #define __PACKED_UNION                         @packed union\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT32        /* deprecated */\r
+    @packed struct T_UINT32 { uint32_t v; };\r
+    #define __UNALIGNED_UINT32(x)                  (((struct T_UINT32 *)(x))->v)\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT16_WRITE\r
+    __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };\r
+    #define __UNALIGNED_UINT16_WRITE(addr, val)    (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT16_READ\r
+    __PACKED_STRUCT T_UINT16_READ { uint16_t v; };\r
+    #define __UNALIGNED_UINT16_READ(addr)          (((const struct T_UINT16_READ *)(const void *)(addr))->v)\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT32_WRITE\r
+    __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };\r
+    #define __UNALIGNED_UINT32_WRITE(addr, val)    (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT32_READ\r
+    __PACKED_STRUCT T_UINT32_READ { uint32_t v; };\r
+    #define __UNALIGNED_UINT32_READ(addr)          (((const struct T_UINT32_READ *)(const void *)(addr))->v)\r
+  #endif\r
+  #ifndef   __ALIGNED\r
+    #warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored.\r
+    #define __ALIGNED(x)\r
+  #endif\r
+  #ifndef   __RESTRICT\r
+    #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored.\r
+    #define __RESTRICT\r
+  #endif\r
+\r
+\r
+#else\r
+  #error Unknown compiler.\r
+#endif\r
+\r
+\r
+#endif /* __CMSIS_COMPILER_H */\r
+\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/cmsis_gcc.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/cmsis_gcc.h
new file mode 100644 (file)
index 0000000..1bd41a4
--- /dev/null
@@ -0,0 +1,2085 @@
+/**************************************************************************//**\r
+ * @file     cmsis_gcc.h\r
+ * @brief    CMSIS compiler GCC header file\r
+ * @version  V5.0.4\r
+ * @date     09. April 2018\r
+ ******************************************************************************/\r
+/*\r
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.\r
+ *\r
+ * SPDX-License-Identifier: Apache-2.0\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the License); you may\r
+ * not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#ifndef __CMSIS_GCC_H\r
+#define __CMSIS_GCC_H\r
+\r
+/* ignore some GCC warnings */\r
+#pragma GCC diagnostic push\r
+#pragma GCC diagnostic ignored "-Wsign-conversion"\r
+#pragma GCC diagnostic ignored "-Wconversion"\r
+#pragma GCC diagnostic ignored "-Wunused-parameter"\r
+\r
+/* Fallback for __has_builtin */\r
+#ifndef __has_builtin\r
+  #define __has_builtin(x) (0)\r
+#endif\r
+\r
+/* CMSIS compiler specific defines */\r
+#ifndef   __ASM\r
+  #define __ASM                                  __asm\r
+#endif\r
+#ifndef   __INLINE\r
+  #define __INLINE                               inline\r
+#endif\r
+#ifndef   __STATIC_INLINE\r
+  #define __STATIC_INLINE                        static inline\r
+#endif\r
+#ifndef   __STATIC_FORCEINLINE                 \r
+  #define __STATIC_FORCEINLINE                   __attribute__((always_inline)) static inline\r
+#endif                                           \r
+#ifndef   __NO_RETURN\r
+  #define __NO_RETURN                            __attribute__((__noreturn__))\r
+#endif\r
+#ifndef   __USED\r
+  #define __USED                                 __attribute__((used))\r
+#endif\r
+#ifndef   __WEAK\r
+  #define __WEAK                                 __attribute__((weak))\r
+#endif\r
+#ifndef   __PACKED\r
+  #define __PACKED                               __attribute__((packed, aligned(1)))\r
+#endif\r
+#ifndef   __PACKED_STRUCT\r
+  #define __PACKED_STRUCT                        struct __attribute__((packed, aligned(1)))\r
+#endif\r
+#ifndef   __PACKED_UNION\r
+  #define __PACKED_UNION                         union __attribute__((packed, aligned(1)))\r
+#endif\r
+#ifndef   __UNALIGNED_UINT32        /* deprecated */\r
+  #pragma GCC diagnostic push\r
+  #pragma GCC diagnostic ignored "-Wpacked"\r
+  #pragma GCC diagnostic ignored "-Wattributes"\r
+  struct __attribute__((packed)) T_UINT32 { uint32_t v; };\r
+  #pragma GCC diagnostic pop\r
+  #define __UNALIGNED_UINT32(x)                  (((struct T_UINT32 *)(x))->v)\r
+#endif\r
+#ifndef   __UNALIGNED_UINT16_WRITE\r
+  #pragma GCC diagnostic push\r
+  #pragma GCC diagnostic ignored "-Wpacked"\r
+  #pragma GCC diagnostic ignored "-Wattributes"\r
+  __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };\r
+  #pragma GCC diagnostic pop\r
+  #define __UNALIGNED_UINT16_WRITE(addr, val)    (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))\r
+#endif\r
+#ifndef   __UNALIGNED_UINT16_READ\r
+  #pragma GCC diagnostic push\r
+  #pragma GCC diagnostic ignored "-Wpacked"\r
+  #pragma GCC diagnostic ignored "-Wattributes"\r
+  __PACKED_STRUCT T_UINT16_READ { uint16_t v; };\r
+  #pragma GCC diagnostic pop\r
+  #define __UNALIGNED_UINT16_READ(addr)          (((const struct T_UINT16_READ *)(const void *)(addr))->v)\r
+#endif\r
+#ifndef   __UNALIGNED_UINT32_WRITE\r
+  #pragma GCC diagnostic push\r
+  #pragma GCC diagnostic ignored "-Wpacked"\r
+  #pragma GCC diagnostic ignored "-Wattributes"\r
+  __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };\r
+  #pragma GCC diagnostic pop\r
+  #define __UNALIGNED_UINT32_WRITE(addr, val)    (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))\r
+#endif\r
+#ifndef   __UNALIGNED_UINT32_READ\r
+  #pragma GCC diagnostic push\r
+  #pragma GCC diagnostic ignored "-Wpacked"\r
+  #pragma GCC diagnostic ignored "-Wattributes"\r
+  __PACKED_STRUCT T_UINT32_READ { uint32_t v; };\r
+  #pragma GCC diagnostic pop\r
+  #define __UNALIGNED_UINT32_READ(addr)          (((const struct T_UINT32_READ *)(const void *)(addr))->v)\r
+#endif\r
+#ifndef   __ALIGNED\r
+  #define __ALIGNED(x)                           __attribute__((aligned(x)))\r
+#endif\r
+#ifndef   __RESTRICT\r
+  #define __RESTRICT                             __restrict\r
+#endif\r
+\r
+\r
+/* ###########################  Core Function Access  ########################### */\r
+/** \ingroup  CMSIS_Core_FunctionInterface\r
+    \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   Enable IRQ Interrupts\r
+  \details Enables IRQ interrupts by clearing the I-bit in the CPSR.\r
+           Can only be executed in Privileged modes.\r
+ */\r
+__STATIC_FORCEINLINE void __enable_irq(void)\r
+{\r
+  __ASM volatile ("cpsie i" : : : "memory");\r
+}\r
+\r
+\r
+/**\r
+  \brief   Disable IRQ Interrupts\r
+  \details Disables IRQ interrupts by setting the I-bit in the CPSR.\r
+           Can only be executed in Privileged modes.\r
+ */\r
+__STATIC_FORCEINLINE void __disable_irq(void)\r
+{\r
+  __ASM volatile ("cpsid i" : : : "memory");\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Control Register\r
+  \details Returns the content of the Control Register.\r
+  \return               Control Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __get_CONTROL(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, control" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Get Control Register (non-secure)\r
+  \details Returns the content of the non-secure Control Register when in secure mode.\r
+  \return               non-secure Control Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, control_ns" : "=r" (result) );\r
+  return(result);\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Set Control Register\r
+  \details Writes the given value to the Control Register.\r
+  \param [in]    control  Control Register value to set\r
+ */\r
+__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control)\r
+{\r
+  __ASM volatile ("MSR control, %0" : : "r" (control) : "memory");\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Set Control Register (non-secure)\r
+  \details Writes the given value to the non-secure Control Register when in secure state.\r
+  \param [in]    control  Control Register value to set\r
+ */\r
+__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control)\r
+{\r
+  __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory");\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Get IPSR Register\r
+  \details Returns the content of the IPSR Register.\r
+  \return               IPSR Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __get_IPSR(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, ipsr" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get APSR Register\r
+  \details Returns the content of the APSR Register.\r
+  \return               APSR Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __get_APSR(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, apsr" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get xPSR Register\r
+  \details Returns the content of the xPSR Register.\r
+  \return               xPSR Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __get_xPSR(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, xpsr" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Process Stack Pointer\r
+  \details Returns the current value of the Process Stack Pointer (PSP).\r
+  \return               PSP Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __get_PSP(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, psp"  : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Get Process Stack Pointer (non-secure)\r
+  \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state.\r
+  \return               PSP Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, psp_ns"  : "=r" (result) );\r
+  return(result);\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Set Process Stack Pointer\r
+  \details Assigns the given value to the Process Stack Pointer (PSP).\r
+  \param [in]    topOfProcStack  Process Stack Pointer value to set\r
+ */\r
+__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack)\r
+{\r
+  __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : );\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Set Process Stack Pointer (non-secure)\r
+  \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state.\r
+  \param [in]    topOfProcStack  Process Stack Pointer value to set\r
+ */\r
+__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack)\r
+{\r
+  __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : );\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Get Main Stack Pointer\r
+  \details Returns the current value of the Main Stack Pointer (MSP).\r
+  \return               MSP Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __get_MSP(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, msp" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Get Main Stack Pointer (non-secure)\r
+  \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state.\r
+  \return               MSP Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, msp_ns" : "=r" (result) );\r
+  return(result);\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Set Main Stack Pointer\r
+  \details Assigns the given value to the Main Stack Pointer (MSP).\r
+  \param [in]    topOfMainStack  Main Stack Pointer value to set\r
+ */\r
+__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack)\r
+{\r
+  __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : );\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Set Main Stack Pointer (non-secure)\r
+  \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state.\r
+  \param [in]    topOfMainStack  Main Stack Pointer value to set\r
+ */\r
+__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack)\r
+{\r
+  __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : );\r
+}\r
+#endif\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Get Stack Pointer (non-secure)\r
+  \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state.\r
+  \return               SP Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, sp_ns" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Stack Pointer (non-secure)\r
+  \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state.\r
+  \param [in]    topOfStack  Stack Pointer value to set\r
+ */\r
+__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack)\r
+{\r
+  __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : );\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Get Priority Mask\r
+  \details Returns the current state of the priority mask bit from the Priority Mask Register.\r
+  \return               Priority Mask value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, primask" : "=r" (result) :: "memory");\r
+  return(result);\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Get Priority Mask (non-secure)\r
+  \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state.\r
+  \return               Priority Mask value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, primask_ns" : "=r" (result) :: "memory");\r
+  return(result);\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Set Priority Mask\r
+  \details Assigns the given value to the Priority Mask Register.\r
+  \param [in]    priMask  Priority Mask\r
+ */\r
+__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask)\r
+{\r
+  __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory");\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Set Priority Mask (non-secure)\r
+  \details Assigns the given value to the non-secure Priority Mask Register when in secure state.\r
+  \param [in]    priMask  Priority Mask\r
+ */\r
+__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask)\r
+{\r
+  __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory");\r
+}\r
+#endif\r
+\r
+\r
+#if ((defined (__ARM_ARCH_7M__      ) && (__ARM_ARCH_7M__      == 1)) || \\r
+     (defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \\r
+     (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))    )\r
+/**\r
+  \brief   Enable FIQ\r
+  \details Enables FIQ interrupts by clearing the F-bit in the CPSR.\r
+           Can only be executed in Privileged modes.\r
+ */\r
+__STATIC_FORCEINLINE void __enable_fault_irq(void)\r
+{\r
+  __ASM volatile ("cpsie f" : : : "memory");\r
+}\r
+\r
+\r
+/**\r
+  \brief   Disable FIQ\r
+  \details Disables FIQ interrupts by setting the F-bit in the CPSR.\r
+           Can only be executed in Privileged modes.\r
+ */\r
+__STATIC_FORCEINLINE void __disable_fault_irq(void)\r
+{\r
+  __ASM volatile ("cpsid f" : : : "memory");\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Base Priority\r
+  \details Returns the current value of the Base Priority register.\r
+  \return               Base Priority register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, basepri" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Get Base Priority (non-secure)\r
+  \details Returns the current value of the non-secure Base Priority register when in secure state.\r
+  \return               Base Priority register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) );\r
+  return(result);\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Set Base Priority\r
+  \details Assigns the given value to the Base Priority register.\r
+  \param [in]    basePri  Base Priority value to set\r
+ */\r
+__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri)\r
+{\r
+  __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory");\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Set Base Priority (non-secure)\r
+  \details Assigns the given value to the non-secure Base Priority register when in secure state.\r
+  \param [in]    basePri  Base Priority value to set\r
+ */\r
+__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri)\r
+{\r
+  __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory");\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Set Base Priority with condition\r
+  \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled,\r
+           or the new value increases the BASEPRI priority level.\r
+  \param [in]    basePri  Base Priority value to set\r
+ */\r
+__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri)\r
+{\r
+  __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory");\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Fault Mask\r
+  \details Returns the current value of the Fault Mask register.\r
+  \return               Fault Mask register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, faultmask" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Get Fault Mask (non-secure)\r
+  \details Returns the current value of the non-secure Fault Mask register when in secure state.\r
+  \return               Fault Mask register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) );\r
+  return(result);\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Set Fault Mask\r
+  \details Assigns the given value to the Fault Mask register.\r
+  \param [in]    faultMask  Fault Mask value to set\r
+ */\r
+__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask)\r
+{\r
+  __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory");\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Set Fault Mask (non-secure)\r
+  \details Assigns the given value to the non-secure Fault Mask register when in secure state.\r
+  \param [in]    faultMask  Fault Mask value to set\r
+ */\r
+__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask)\r
+{\r
+  __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory");\r
+}\r
+#endif\r
+\r
+#endif /* ((defined (__ARM_ARCH_7M__      ) && (__ARM_ARCH_7M__      == 1)) || \\r
+           (defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \\r
+           (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))    ) */\r
+\r
+\r
+#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \\r
+     (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1))    )\r
+\r
+/**\r
+  \brief   Get Process Stack Pointer Limit\r
+  Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure\r
+  Stack Pointer Limit register hence zero is returned always in non-secure\r
+  mode.\r
+  \r
+  \details Returns the current value of the Process Stack Pointer Limit (PSPLIM).\r
+  \return               PSPLIM Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void)\r
+{\r
+#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \\r
+    (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))\r
+    // without main extensions, the non-secure PSPLIM is RAZ/WI\r
+  return 0U;\r
+#else\r
+  uint32_t result;\r
+  __ASM volatile ("MRS %0, psplim"  : "=r" (result) );\r
+  return result;\r
+#endif\r
+}\r
+\r
+#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3))\r
+/**\r
+  \brief   Get Process Stack Pointer Limit (non-secure)\r
+  Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure\r
+  Stack Pointer Limit register hence zero is returned always.\r
+\r
+  \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state.\r
+  \return               PSPLIM Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void)\r
+{\r
+#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))\r
+  // without main extensions, the non-secure PSPLIM is RAZ/WI\r
+  return 0U;\r
+#else\r
+  uint32_t result;\r
+  __ASM volatile ("MRS %0, psplim_ns"  : "=r" (result) );\r
+  return result;\r
+#endif\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Set Process Stack Pointer Limit\r
+  Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure\r
+  Stack Pointer Limit register hence the write is silently ignored in non-secure\r
+  mode.\r
+  \r
+  \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM).\r
+  \param [in]    ProcStackPtrLimit  Process Stack Pointer Limit value to set\r
+ */\r
+__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit)\r
+{\r
+#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \\r
+    (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))\r
+  // without main extensions, the non-secure PSPLIM is RAZ/WI\r
+  (void)ProcStackPtrLimit;\r
+#else\r
+  __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit));\r
+#endif\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE  ) && (__ARM_FEATURE_CMSE   == 3))\r
+/**\r
+  \brief   Set Process Stack Pointer (non-secure)\r
+  Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure\r
+  Stack Pointer Limit register hence the write is silently ignored.\r
+\r
+  \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state.\r
+  \param [in]    ProcStackPtrLimit  Process Stack Pointer Limit value to set\r
+ */\r
+__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit)\r
+{\r
+#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))\r
+  // without main extensions, the non-secure PSPLIM is RAZ/WI\r
+  (void)ProcStackPtrLimit;\r
+#else\r
+  __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit));\r
+#endif\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Get Main Stack Pointer Limit\r
+  Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure\r
+  Stack Pointer Limit register hence zero is returned always in non-secure\r
+  mode.\r
+\r
+  \details Returns the current value of the Main Stack Pointer Limit (MSPLIM).\r
+  \return               MSPLIM Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void)\r
+{\r
+#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \\r
+    (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))\r
+  // without main extensions, the non-secure MSPLIM is RAZ/WI\r
+  return 0U;\r
+#else\r
+  uint32_t result;\r
+  __ASM volatile ("MRS %0, msplim" : "=r" (result) );\r
+  return result;\r
+#endif\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE  ) && (__ARM_FEATURE_CMSE   == 3))\r
+/**\r
+  \brief   Get Main Stack Pointer Limit (non-secure)\r
+  Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure\r
+  Stack Pointer Limit register hence zero is returned always.\r
+\r
+  \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state.\r
+  \return               MSPLIM Register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void)\r
+{\r
+#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))\r
+  // without main extensions, the non-secure MSPLIM is RAZ/WI\r
+  return 0U;\r
+#else\r
+  uint32_t result;\r
+  __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) );\r
+  return result;\r
+#endif\r
+}\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Set Main Stack Pointer Limit\r
+  Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure\r
+  Stack Pointer Limit register hence the write is silently ignored in non-secure\r
+  mode.\r
+\r
+  \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM).\r
+  \param [in]    MainStackPtrLimit  Main Stack Pointer Limit value to set\r
+ */\r
+__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit)\r
+{\r
+#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \\r
+    (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))\r
+  // without main extensions, the non-secure MSPLIM is RAZ/WI\r
+  (void)MainStackPtrLimit;\r
+#else\r
+  __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit));\r
+#endif\r
+}\r
+\r
+\r
+#if (defined (__ARM_FEATURE_CMSE  ) && (__ARM_FEATURE_CMSE   == 3))\r
+/**\r
+  \brief   Set Main Stack Pointer Limit (non-secure)\r
+  Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure\r
+  Stack Pointer Limit register hence the write is silently ignored.\r
+\r
+  \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state.\r
+  \param [in]    MainStackPtrLimit  Main Stack Pointer value to set\r
+ */\r
+__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit)\r
+{\r
+#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))\r
+  // without main extensions, the non-secure MSPLIM is RAZ/WI\r
+  (void)MainStackPtrLimit;\r
+#else\r
+  __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit));\r
+#endif\r
+}\r
+#endif\r
+\r
+#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \\r
+           (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1))    ) */\r
+\r
+\r
+/**\r
+  \brief   Get FPSCR\r
+  \details Returns the current value of the Floating Point Status/Control register.\r
+  \return               Floating Point Status/Control register value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __get_FPSCR(void)\r
+{\r
+#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \\r
+     (defined (__FPU_USED   ) && (__FPU_USED    == 1U))     )\r
+#if __has_builtin(__builtin_arm_get_fpscr) \r
+// Re-enable using built-in when GCC has been fixed\r
+// || (__GNUC__ > 7) || (__GNUC__ == 7 && __GNUC_MINOR__ >= 2)\r
+  /* see https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00443.html */\r
+  return __builtin_arm_get_fpscr();\r
+#else\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("VMRS %0, fpscr" : "=r" (result) );\r
+  return(result);\r
+#endif\r
+#else\r
+  return(0U);\r
+#endif\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set FPSCR\r
+  \details Assigns the given value to the Floating Point Status/Control register.\r
+  \param [in]    fpscr  Floating Point Status/Control value to set\r
+ */\r
+__STATIC_FORCEINLINE void __set_FPSCR(uint32_t fpscr)\r
+{\r
+#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \\r
+     (defined (__FPU_USED   ) && (__FPU_USED    == 1U))     )\r
+#if __has_builtin(__builtin_arm_set_fpscr)\r
+// Re-enable using built-in when GCC has been fixed\r
+// || (__GNUC__ > 7) || (__GNUC__ == 7 && __GNUC_MINOR__ >= 2)\r
+  /* see https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00443.html */\r
+  __builtin_arm_set_fpscr(fpscr);\r
+#else\r
+  __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "vfpcc", "memory");\r
+#endif\r
+#else\r
+  (void)fpscr;\r
+#endif\r
+}\r
+\r
+\r
+/*@} end of CMSIS_Core_RegAccFunctions */\r
+\r
+\r
+/* ##########################  Core Instruction Access  ######################### */\r
+/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface\r
+  Access to dedicated instructions\r
+  @{\r
+*/\r
+\r
+/* Define macros for porting to both thumb1 and thumb2.\r
+ * For thumb1, use low register (r0-r7), specified by constraint "l"\r
+ * Otherwise, use general registers, specified by constraint "r" */\r
+#if defined (__thumb__) && !defined (__thumb2__)\r
+#define __CMSIS_GCC_OUT_REG(r) "=l" (r)\r
+#define __CMSIS_GCC_RW_REG(r) "+l" (r)\r
+#define __CMSIS_GCC_USE_REG(r) "l" (r)\r
+#else\r
+#define __CMSIS_GCC_OUT_REG(r) "=r" (r)\r
+#define __CMSIS_GCC_RW_REG(r) "+r" (r)\r
+#define __CMSIS_GCC_USE_REG(r) "r" (r)\r
+#endif\r
+\r
+/**\r
+  \brief   No Operation\r
+  \details No Operation does nothing. This instruction can be used for code alignment purposes.\r
+ */\r
+#define __NOP()                             __ASM volatile ("nop")\r
+\r
+/**\r
+  \brief   Wait For Interrupt\r
+  \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs.\r
+ */\r
+#define __WFI()                             __ASM volatile ("wfi")\r
+\r
+\r
+/**\r
+  \brief   Wait For Event\r
+  \details Wait For Event is a hint instruction that permits the processor to enter\r
+           a low-power state until one of a number of events occurs.\r
+ */\r
+#define __WFE()                             __ASM volatile ("wfe")\r
+\r
+\r
+/**\r
+  \brief   Send Event\r
+  \details Send Event is a hint instruction. It causes an event to be signaled to the CPU.\r
+ */\r
+#define __SEV()                             __ASM volatile ("sev")\r
+\r
+\r
+/**\r
+  \brief   Instruction Synchronization Barrier\r
+  \details Instruction Synchronization Barrier flushes the pipeline in the processor,\r
+           so that all instructions following the ISB are fetched from cache or memory,\r
+           after the instruction has been completed.\r
+ */\r
+__STATIC_FORCEINLINE void __ISB(void)\r
+{\r
+  __ASM volatile ("isb 0xF":::"memory");\r
+}\r
+\r
+\r
+/**\r
+  \brief   Data Synchronization Barrier\r
+  \details Acts as a special kind of Data Memory Barrier.\r
+           It completes when all explicit memory accesses before this instruction complete.\r
+ */\r
+__STATIC_FORCEINLINE void __DSB(void)\r
+{\r
+  __ASM volatile ("dsb 0xF":::"memory");\r
+}\r
+\r
+\r
+/**\r
+  \brief   Data Memory Barrier\r
+  \details Ensures the apparent order of the explicit memory operations before\r
+           and after the instruction, without ensuring their completion.\r
+ */\r
+__STATIC_FORCEINLINE void __DMB(void)\r
+{\r
+  __ASM volatile ("dmb 0xF":::"memory");\r
+}\r
+\r
+\r
+/**\r
+  \brief   Reverse byte order (32 bit)\r
+  \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412.\r
+  \param [in]    value  Value to reverse\r
+  \return               Reversed value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __REV(uint32_t value)\r
+{\r
+#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)\r
+  return __builtin_bswap32(value);\r
+#else\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("rev %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) );\r
+  return result;\r
+#endif\r
+}\r
+\r
+\r
+/**\r
+  \brief   Reverse byte order (16 bit)\r
+  \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856.\r
+  \param [in]    value  Value to reverse\r
+  \return               Reversed value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __REV16(uint32_t value)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("rev16 %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) );\r
+  return result;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Reverse byte order (16 bit)\r
+  \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000.\r
+  \param [in]    value  Value to reverse\r
+  \return               Reversed value\r
+ */\r
+__STATIC_FORCEINLINE int16_t __REVSH(int16_t value)\r
+{\r
+#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)\r
+  return (int16_t)__builtin_bswap16(value);\r
+#else\r
+  int16_t result;\r
+\r
+  __ASM volatile ("revsh %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) );\r
+  return result;\r
+#endif\r
+}\r
+\r
+\r
+/**\r
+  \brief   Rotate Right in unsigned value (32 bit)\r
+  \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.\r
+  \param [in]    op1  Value to rotate\r
+  \param [in]    op2  Number of Bits to rotate\r
+  \return               Rotated value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2)\r
+{\r
+  op2 %= 32U;\r
+  if (op2 == 0U)\r
+  {\r
+    return op1;\r
+  }\r
+  return (op1 >> op2) | (op1 << (32U - op2));\r
+}\r
+\r
+\r
+/**\r
+  \brief   Breakpoint\r
+  \details Causes the processor to enter Debug state.\r
+           Debug tools can use this to investigate system state when the instruction at a particular address is reached.\r
+  \param [in]    value  is ignored by the processor.\r
+                 If required, a debugger can use it to store additional information about the breakpoint.\r
+ */\r
+#define __BKPT(value)                       __ASM volatile ("bkpt "#value)\r
+\r
+\r
+/**\r
+  \brief   Reverse bit order of value\r
+  \details Reverses the bit order of the given value.\r
+  \param [in]    value  Value to reverse\r
+  \return               Reversed value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __RBIT(uint32_t value)\r
+{\r
+  uint32_t result;\r
+\r
+#if ((defined (__ARM_ARCH_7M__      ) && (__ARM_ARCH_7M__      == 1)) || \\r
+     (defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \\r
+     (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))    )\r
+   __ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) );\r
+#else\r
+  uint32_t s = (4U /*sizeof(v)*/ * 8U) - 1U; /* extra shift needed at end */\r
+\r
+  result = value;                      /* r will be reversed bits of v; first get LSB of v */\r
+  for (value >>= 1U; value != 0U; value >>= 1U)\r
+  {\r
+    result <<= 1U;\r
+    result |= value & 1U;\r
+    s--;\r
+  }\r
+  result <<= s;                        /* shift when v's highest bits are zero */\r
+#endif\r
+  return result;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Count leading zeros\r
+  \details Counts the number of leading zeros of a data value.\r
+  \param [in]  value  Value to count the leading zeros\r
+  \return             number of leading zeros in value\r
+ */\r
+#define __CLZ             (uint8_t)__builtin_clz\r
+\r
+\r
+#if ((defined (__ARM_ARCH_7M__      ) && (__ARM_ARCH_7M__      == 1)) || \\r
+     (defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \\r
+     (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \\r
+     (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1))    )\r
+/**\r
+  \brief   LDR Exclusive (8 bit)\r
+  \details Executes a exclusive LDR instruction for 8 bit value.\r
+  \param [in]    ptr  Pointer to data\r
+  \return             value of type uint8_t at (*ptr)\r
+ */\r
+__STATIC_FORCEINLINE uint8_t __LDREXB(volatile uint8_t *addr)\r
+{\r
+    uint32_t result;\r
+\r
+#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)\r
+   __ASM volatile ("ldrexb %0, %1" : "=r" (result) : "Q" (*addr) );\r
+#else\r
+    /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not\r
+       accepted by assembler. So has to use following less efficient pattern.\r
+    */\r
+   __ASM volatile ("ldrexb %0, [%1]" : "=r" (result) : "r" (addr) : "memory" );\r
+#endif\r
+   return ((uint8_t) result);    /* Add explicit type cast here */\r
+}\r
+\r
+\r
+/**\r
+  \brief   LDR Exclusive (16 bit)\r
+  \details Executes a exclusive LDR instruction for 16 bit values.\r
+  \param [in]    ptr  Pointer to data\r
+  \return        value of type uint16_t at (*ptr)\r
+ */\r
+__STATIC_FORCEINLINE uint16_t __LDREXH(volatile uint16_t *addr)\r
+{\r
+    uint32_t result;\r
+\r
+#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)\r
+   __ASM volatile ("ldrexh %0, %1" : "=r" (result) : "Q" (*addr) );\r
+#else\r
+    /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not\r
+       accepted by assembler. So has to use following less efficient pattern.\r
+    */\r
+   __ASM volatile ("ldrexh %0, [%1]" : "=r" (result) : "r" (addr) : "memory" );\r
+#endif\r
+   return ((uint16_t) result);    /* Add explicit type cast here */\r
+}\r
+\r
+\r
+/**\r
+  \brief   LDR Exclusive (32 bit)\r
+  \details Executes a exclusive LDR instruction for 32 bit values.\r
+  \param [in]    ptr  Pointer to data\r
+  \return        value of type uint32_t at (*ptr)\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __LDREXW(volatile uint32_t *addr)\r
+{\r
+    uint32_t result;\r
+\r
+   __ASM volatile ("ldrex %0, %1" : "=r" (result) : "Q" (*addr) );\r
+   return(result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   STR Exclusive (8 bit)\r
+  \details Executes a exclusive STR instruction for 8 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+  \return          0  Function succeeded\r
+  \return          1  Function failed\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __STREXB(uint8_t value, volatile uint8_t *addr)\r
+{\r
+   uint32_t result;\r
+\r
+   __ASM volatile ("strexb %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) );\r
+   return(result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   STR Exclusive (16 bit)\r
+  \details Executes a exclusive STR instruction for 16 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+  \return          0  Function succeeded\r
+  \return          1  Function failed\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __STREXH(uint16_t value, volatile uint16_t *addr)\r
+{\r
+   uint32_t result;\r
+\r
+   __ASM volatile ("strexh %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) );\r
+   return(result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   STR Exclusive (32 bit)\r
+  \details Executes a exclusive STR instruction for 32 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+  \return          0  Function succeeded\r
+  \return          1  Function failed\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __STREXW(uint32_t value, volatile uint32_t *addr)\r
+{\r
+   uint32_t result;\r
+\r
+   __ASM volatile ("strex %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" (value) );\r
+   return(result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Remove the exclusive lock\r
+  \details Removes the exclusive lock which is created by LDREX.\r
+ */\r
+__STATIC_FORCEINLINE void __CLREX(void)\r
+{\r
+  __ASM volatile ("clrex" ::: "memory");\r
+}\r
+\r
+#endif /* ((defined (__ARM_ARCH_7M__      ) && (__ARM_ARCH_7M__      == 1)) || \\r
+           (defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \\r
+           (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \\r
+           (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1))    ) */\r
+\r
+\r
+#if ((defined (__ARM_ARCH_7M__      ) && (__ARM_ARCH_7M__      == 1)) || \\r
+     (defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \\r
+     (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))    )\r
+/**\r
+  \brief   Signed Saturate\r
+  \details Saturates a signed value.\r
+  \param [in]  ARG1  Value to be saturated\r
+  \param [in]  ARG2  Bit position to saturate to (1..32)\r
+  \return             Saturated value\r
+ */\r
+#define __SSAT(ARG1,ARG2) \\r
+__extension__ \\r
+({                          \\r
+  int32_t __RES, __ARG1 = (ARG1); \\r
+  __ASM ("ssat %0, %1, %2" : "=r" (__RES) :  "I" (ARG2), "r" (__ARG1) ); \\r
+  __RES; \\r
+ })\r
+\r
+\r
+/**\r
+  \brief   Unsigned Saturate\r
+  \details Saturates an unsigned value.\r
+  \param [in]  ARG1  Value to be saturated\r
+  \param [in]  ARG2  Bit position to saturate to (0..31)\r
+  \return             Saturated value\r
+ */\r
+#define __USAT(ARG1,ARG2) \\r
+ __extension__ \\r
+({                          \\r
+  uint32_t __RES, __ARG1 = (ARG1); \\r
+  __ASM ("usat %0, %1, %2" : "=r" (__RES) :  "I" (ARG2), "r" (__ARG1) ); \\r
+  __RES; \\r
+ })\r
+\r
+\r
+/**\r
+  \brief   Rotate Right with Extend (32 bit)\r
+  \details Moves each bit of a bitstring right by one bit.\r
+           The carry input is shifted in at the left end of the bitstring.\r
+  \param [in]    value  Value to rotate\r
+  \return               Rotated value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) );\r
+  return(result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   LDRT Unprivileged (8 bit)\r
+  \details Executes a Unprivileged LDRT instruction for 8 bit value.\r
+  \param [in]    ptr  Pointer to data\r
+  \return             value of type uint8_t at (*ptr)\r
+ */\r
+__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr)\r
+{\r
+    uint32_t result;\r
+\r
+#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)\r
+   __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) );\r
+#else\r
+    /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not\r
+       accepted by assembler. So has to use following less efficient pattern.\r
+    */\r
+   __ASM volatile ("ldrbt %0, [%1]" : "=r" (result) : "r" (ptr) : "memory" );\r
+#endif\r
+   return ((uint8_t) result);    /* Add explicit type cast here */\r
+}\r
+\r
+\r
+/**\r
+  \brief   LDRT Unprivileged (16 bit)\r
+  \details Executes a Unprivileged LDRT instruction for 16 bit values.\r
+  \param [in]    ptr  Pointer to data\r
+  \return        value of type uint16_t at (*ptr)\r
+ */\r
+__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr)\r
+{\r
+    uint32_t result;\r
+\r
+#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)\r
+   __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) );\r
+#else\r
+    /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not\r
+       accepted by assembler. So has to use following less efficient pattern.\r
+    */\r
+   __ASM volatile ("ldrht %0, [%1]" : "=r" (result) : "r" (ptr) : "memory" );\r
+#endif\r
+   return ((uint16_t) result);    /* Add explicit type cast here */\r
+}\r
+\r
+\r
+/**\r
+  \brief   LDRT Unprivileged (32 bit)\r
+  \details Executes a Unprivileged LDRT instruction for 32 bit values.\r
+  \param [in]    ptr  Pointer to data\r
+  \return        value of type uint32_t at (*ptr)\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr)\r
+{\r
+    uint32_t result;\r
+\r
+   __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) );\r
+   return(result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   STRT Unprivileged (8 bit)\r
+  \details Executes a Unprivileged STRT instruction for 8 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+ */\r
+__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr)\r
+{\r
+   __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) );\r
+}\r
+\r
+\r
+/**\r
+  \brief   STRT Unprivileged (16 bit)\r
+  \details Executes a Unprivileged STRT instruction for 16 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+ */\r
+__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr)\r
+{\r
+   __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) );\r
+}\r
+\r
+\r
+/**\r
+  \brief   STRT Unprivileged (32 bit)\r
+  \details Executes a Unprivileged STRT instruction for 32 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+ */\r
+__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr)\r
+{\r
+   __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) );\r
+}\r
+\r
+#else  /* ((defined (__ARM_ARCH_7M__      ) && (__ARM_ARCH_7M__      == 1)) || \\r
+           (defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \\r
+           (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))    ) */\r
+\r
+/**\r
+  \brief   Signed Saturate\r
+  \details Saturates a signed value.\r
+  \param [in]  value  Value to be saturated\r
+  \param [in]    sat  Bit position to saturate to (1..32)\r
+  \return             Saturated value\r
+ */\r
+__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat)\r
+{\r
+  if ((sat >= 1U) && (sat <= 32U))\r
+  {\r
+    const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U);\r
+    const int32_t min = -1 - max ;\r
+    if (val > max)\r
+    {\r
+      return max;\r
+    }\r
+    else if (val < min)\r
+    {\r
+      return min;\r
+    }\r
+  }\r
+  return val;\r
+}\r
+\r
+/**\r
+  \brief   Unsigned Saturate\r
+  \details Saturates an unsigned value.\r
+  \param [in]  value  Value to be saturated\r
+  \param [in]    sat  Bit position to saturate to (0..31)\r
+  \return             Saturated value\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat)\r
+{\r
+  if (sat <= 31U)\r
+  {\r
+    const uint32_t max = ((1U << sat) - 1U);\r
+    if (val > (int32_t)max)\r
+    {\r
+      return max;\r
+    }\r
+    else if (val < 0)\r
+    {\r
+      return 0U;\r
+    }\r
+  }\r
+  return (uint32_t)val;\r
+}\r
+\r
+#endif /* ((defined (__ARM_ARCH_7M__      ) && (__ARM_ARCH_7M__      == 1)) || \\r
+           (defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \\r
+           (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))    ) */\r
+\r
+\r
+#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \\r
+     (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1))    )\r
+/**\r
+  \brief   Load-Acquire (8 bit)\r
+  \details Executes a LDAB instruction for 8 bit value.\r
+  \param [in]    ptr  Pointer to data\r
+  \return             value of type uint8_t at (*ptr)\r
+ */\r
+__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr)\r
+{\r
+    uint32_t result;\r
+\r
+   __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) );\r
+   return ((uint8_t) result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Load-Acquire (16 bit)\r
+  \details Executes a LDAH instruction for 16 bit values.\r
+  \param [in]    ptr  Pointer to data\r
+  \return        value of type uint16_t at (*ptr)\r
+ */\r
+__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr)\r
+{\r
+    uint32_t result;\r
+\r
+   __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) );\r
+   return ((uint16_t) result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Load-Acquire (32 bit)\r
+  \details Executes a LDA instruction for 32 bit values.\r
+  \param [in]    ptr  Pointer to data\r
+  \return        value of type uint32_t at (*ptr)\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr)\r
+{\r
+    uint32_t result;\r
+\r
+   __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) );\r
+   return(result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Store-Release (8 bit)\r
+  \details Executes a STLB instruction for 8 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+ */\r
+__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr)\r
+{\r
+   __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) );\r
+}\r
+\r
+\r
+/**\r
+  \brief   Store-Release (16 bit)\r
+  \details Executes a STLH instruction for 16 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+ */\r
+__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr)\r
+{\r
+   __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) );\r
+}\r
+\r
+\r
+/**\r
+  \brief   Store-Release (32 bit)\r
+  \details Executes a STL instruction for 32 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+ */\r
+__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr)\r
+{\r
+   __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) );\r
+}\r
+\r
+\r
+/**\r
+  \brief   Load-Acquire Exclusive (8 bit)\r
+  \details Executes a LDAB exclusive instruction for 8 bit value.\r
+  \param [in]    ptr  Pointer to data\r
+  \return             value of type uint8_t at (*ptr)\r
+ */\r
+__STATIC_FORCEINLINE uint8_t __LDAEXB(volatile uint8_t *ptr)\r
+{\r
+    uint32_t result;\r
+\r
+   __ASM volatile ("ldaexb %0, %1" : "=r" (result) : "Q" (*ptr) );\r
+   return ((uint8_t) result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Load-Acquire Exclusive (16 bit)\r
+  \details Executes a LDAH exclusive instruction for 16 bit values.\r
+  \param [in]    ptr  Pointer to data\r
+  \return        value of type uint16_t at (*ptr)\r
+ */\r
+__STATIC_FORCEINLINE uint16_t __LDAEXH(volatile uint16_t *ptr)\r
+{\r
+    uint32_t result;\r
+\r
+   __ASM volatile ("ldaexh %0, %1" : "=r" (result) : "Q" (*ptr) );\r
+   return ((uint16_t) result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Load-Acquire Exclusive (32 bit)\r
+  \details Executes a LDA exclusive instruction for 32 bit values.\r
+  \param [in]    ptr  Pointer to data\r
+  \return        value of type uint32_t at (*ptr)\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __LDAEX(volatile uint32_t *ptr)\r
+{\r
+    uint32_t result;\r
+\r
+   __ASM volatile ("ldaex %0, %1" : "=r" (result) : "Q" (*ptr) );\r
+   return(result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Store-Release Exclusive (8 bit)\r
+  \details Executes a STLB exclusive instruction for 8 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+  \return          0  Function succeeded\r
+  \return          1  Function failed\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __STLEXB(uint8_t value, volatile uint8_t *ptr)\r
+{\r
+   uint32_t result;\r
+\r
+   __ASM volatile ("stlexb %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) );\r
+   return(result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Store-Release Exclusive (16 bit)\r
+  \details Executes a STLH exclusive instruction for 16 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+  \return          0  Function succeeded\r
+  \return          1  Function failed\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __STLEXH(uint16_t value, volatile uint16_t *ptr)\r
+{\r
+   uint32_t result;\r
+\r
+   __ASM volatile ("stlexh %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) );\r
+   return(result);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Store-Release Exclusive (32 bit)\r
+  \details Executes a STL exclusive instruction for 32 bit values.\r
+  \param [in]  value  Value to store\r
+  \param [in]    ptr  Pointer to location\r
+  \return          0  Function succeeded\r
+  \return          1  Function failed\r
+ */\r
+__STATIC_FORCEINLINE uint32_t __STLEX(uint32_t value, volatile uint32_t *ptr)\r
+{\r
+   uint32_t result;\r
+\r
+   __ASM volatile ("stlex %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) );\r
+   return(result);\r
+}\r
+\r
+#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \\r
+           (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1))    ) */\r
+\r
+/*@}*/ /* end of group CMSIS_Core_InstructionInterface */\r
+\r
+\r
+/* ###################  Compiler specific Intrinsics  ########################### */\r
+/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics\r
+  Access to dedicated SIMD instructions\r
+  @{\r
+*/\r
+\r
+#if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1))\r
+\r
+__STATIC_FORCEINLINE uint32_t __SADD8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __QADD8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UADD8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+\r
+__STATIC_FORCEINLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __USUB8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+\r
+__STATIC_FORCEINLINE uint32_t __SADD16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __QADD16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UADD16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __USUB16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SASX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __QASX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SHASX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UASX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UQASX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UHASX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SSAX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __QSAX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __USAX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __USAD8(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );\r
+  return(result);\r
+}\r
+\r
+#define __SSAT16(ARG1,ARG2) \\r
+({                          \\r
+  int32_t __RES, __ARG1 = (ARG1); \\r
+  __ASM ("ssat16 %0, %1, %2" : "=r" (__RES) :  "I" (ARG2), "r" (__ARG1) ); \\r
+  __RES; \\r
+ })\r
+\r
+#define __USAT16(ARG1,ARG2) \\r
+({                          \\r
+  uint32_t __RES, __ARG1 = (ARG1); \\r
+  __ASM ("usat16 %0, %1, %2" : "=r" (__RES) :  "I" (ARG2), "r" (__ARG1) ); \\r
+  __RES; \\r
+ })\r
+\r
+__STATIC_FORCEINLINE uint32_t __UXTB16(uint32_t op1)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1));\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SXTB16(uint32_t op1)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1));\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SMUAD  (uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint64_t __SMLALD (uint32_t op1, uint32_t op2, uint64_t acc)\r
+{\r
+  union llreg_u{\r
+    uint32_t w32[2];\r
+    uint64_t w64;\r
+  } llr;\r
+  llr.w64 = acc;\r
+\r
+#ifndef __ARMEB__   /* Little endian */\r
+  __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) );\r
+#else               /* Big endian */\r
+  __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) );\r
+#endif\r
+\r
+  return(llr.w64);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint64_t __SMLALDX (uint32_t op1, uint32_t op2, uint64_t acc)\r
+{\r
+  union llreg_u{\r
+    uint32_t w32[2];\r
+    uint64_t w64;\r
+  } llr;\r
+  llr.w64 = acc;\r
+\r
+#ifndef __ARMEB__   /* Little endian */\r
+  __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) );\r
+#else               /* Big endian */\r
+  __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) );\r
+#endif\r
+\r
+  return(llr.w64);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SMUSD  (uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint64_t __SMLSLD (uint32_t op1, uint32_t op2, uint64_t acc)\r
+{\r
+  union llreg_u{\r
+    uint32_t w32[2];\r
+    uint64_t w64;\r
+  } llr;\r
+  llr.w64 = acc;\r
+\r
+#ifndef __ARMEB__   /* Little endian */\r
+  __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) );\r
+#else               /* Big endian */\r
+  __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) );\r
+#endif\r
+\r
+  return(llr.w64);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint64_t __SMLSLDX (uint32_t op1, uint32_t op2, uint64_t acc)\r
+{\r
+  union llreg_u{\r
+    uint32_t w32[2];\r
+    uint64_t w64;\r
+  } llr;\r
+  llr.w64 = acc;\r
+\r
+#ifndef __ARMEB__   /* Little endian */\r
+  __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) );\r
+#else               /* Big endian */\r
+  __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) );\r
+#endif\r
+\r
+  return(llr.w64);\r
+}\r
+\r
+__STATIC_FORCEINLINE uint32_t __SEL  (uint32_t op1, uint32_t op2)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE  int32_t __QADD( int32_t op1,  int32_t op2)\r
+{\r
+  int32_t result;\r
+\r
+  __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+__STATIC_FORCEINLINE  int32_t __QSUB( int32_t op1,  int32_t op2)\r
+{\r
+  int32_t result;\r
+\r
+  __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );\r
+  return(result);\r
+}\r
+\r
+#if 0\r
+#define __PKHBT(ARG1,ARG2,ARG3) \\r
+({                          \\r
+  uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \\r
+  __ASM ("pkhbt %0, %1, %2, lsl %3" : "=r" (__RES) :  "r" (__ARG1), "r" (__ARG2), "I" (ARG3)  ); \\r
+  __RES; \\r
+ })\r
+\r
+#define __PKHTB(ARG1,ARG2,ARG3) \\r
+({                          \\r
+  uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \\r
+  if (ARG3 == 0) \\r
+    __ASM ("pkhtb %0, %1, %2" : "=r" (__RES) :  "r" (__ARG1), "r" (__ARG2)  ); \\r
+  else \\r
+    __ASM ("pkhtb %0, %1, %2, asr %3" : "=r" (__RES) :  "r" (__ARG1), "r" (__ARG2), "I" (ARG3)  ); \\r
+  __RES; \\r
+ })\r
+#endif\r
+\r
+#define __PKHBT(ARG1,ARG2,ARG3)          ( ((((uint32_t)(ARG1))          ) & 0x0000FFFFUL) |  \\r
+                                           ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL)  )\r
+\r
+#define __PKHTB(ARG1,ARG2,ARG3)          ( ((((uint32_t)(ARG1))          ) & 0xFFFF0000UL) |  \\r
+                                           ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL)  )\r
+\r
+__STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3)\r
+{\r
+ int32_t result;\r
+\r
+ __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r"  (op1), "r" (op2), "r" (op3) );\r
+ return(result);\r
+}\r
+\r
+#endif /* (__ARM_FEATURE_DSP == 1) */\r
+/*@} end of group CMSIS_SIMD_intrinsics */\r
+\r
+\r
+#pragma GCC diagnostic pop\r
+\r
+#endif /* __CMSIS_GCC_H */\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/cmsis_iccarm.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/cmsis_iccarm.h
new file mode 100644 (file)
index 0000000..3c90a2c
--- /dev/null
@@ -0,0 +1,935 @@
+/**************************************************************************//**\r
+ * @file     cmsis_iccarm.h\r
+ * @brief    CMSIS compiler ICCARM (IAR Compiler for Arm) header file\r
+ * @version  V5.0.7\r
+ * @date     19. June 2018\r
+ ******************************************************************************/\r
+\r
+//------------------------------------------------------------------------------\r
+//\r
+// Copyright (c) 2017-2018 IAR Systems\r
+//\r
+// Licensed under the Apache License, Version 2.0 (the "License")\r
+// you may not use this file except in compliance with the License.\r
+// You may obtain a copy of the License at\r
+//     http://www.apache.org/licenses/LICENSE-2.0\r
+//\r
+// Unless required by applicable law or agreed to in writing, software\r
+// distributed under the License is distributed on an "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+// See the License for the specific language governing permissions and\r
+// limitations under the License.\r
+//\r
+//------------------------------------------------------------------------------\r
+\r
+\r
+#ifndef __CMSIS_ICCARM_H__\r
+#define __CMSIS_ICCARM_H__\r
+\r
+#ifndef __ICCARM__\r
+  #error This file should only be compiled by ICCARM\r
+#endif\r
+\r
+#pragma system_include\r
+\r
+#define __IAR_FT _Pragma("inline=forced") __intrinsic\r
+\r
+#if (__VER__ >= 8000000)\r
+  #define __ICCARM_V8 1\r
+#else\r
+  #define __ICCARM_V8 0\r
+#endif\r
+\r
+#ifndef __ALIGNED\r
+  #if __ICCARM_V8\r
+    #define __ALIGNED(x) __attribute__((aligned(x)))\r
+  #elif (__VER__ >= 7080000)\r
+    /* Needs IAR language extensions */\r
+    #define __ALIGNED(x) __attribute__((aligned(x)))\r
+  #else\r
+    #warning No compiler specific solution for __ALIGNED.__ALIGNED is ignored.\r
+    #define __ALIGNED(x)\r
+  #endif\r
+#endif\r
+\r
+\r
+/* Define compiler macros for CPU architecture, used in CMSIS 5.\r
+ */\r
+#if __ARM_ARCH_6M__ || __ARM_ARCH_7M__ || __ARM_ARCH_7EM__ || __ARM_ARCH_8M_BASE__ || __ARM_ARCH_8M_MAIN__\r
+/* Macros already defined */\r
+#else\r
+  #if defined(__ARM8M_MAINLINE__) || defined(__ARM8EM_MAINLINE__)\r
+    #define __ARM_ARCH_8M_MAIN__ 1\r
+  #elif defined(__ARM8M_BASELINE__)\r
+    #define __ARM_ARCH_8M_BASE__ 1\r
+  #elif defined(__ARM_ARCH_PROFILE) && __ARM_ARCH_PROFILE == 'M'\r
+    #if __ARM_ARCH == 6\r
+      #define __ARM_ARCH_6M__ 1\r
+    #elif __ARM_ARCH == 7\r
+      #if __ARM_FEATURE_DSP\r
+        #define __ARM_ARCH_7EM__ 1\r
+      #else\r
+        #define __ARM_ARCH_7M__ 1\r
+      #endif\r
+    #endif /* __ARM_ARCH */\r
+  #endif /* __ARM_ARCH_PROFILE == 'M' */\r
+#endif\r
+\r
+/* Alternativ core deduction for older ICCARM's */\r
+#if !defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_7M__) && !defined(__ARM_ARCH_7EM__) && \\r
+    !defined(__ARM_ARCH_8M_BASE__) && !defined(__ARM_ARCH_8M_MAIN__)\r
+  #if defined(__ARM6M__) && (__CORE__ == __ARM6M__)\r
+    #define __ARM_ARCH_6M__ 1\r
+  #elif defined(__ARM7M__) && (__CORE__ == __ARM7M__)\r
+    #define __ARM_ARCH_7M__ 1\r
+  #elif defined(__ARM7EM__) && (__CORE__ == __ARM7EM__)\r
+    #define __ARM_ARCH_7EM__  1\r
+  #elif defined(__ARM8M_BASELINE__) && (__CORE == __ARM8M_BASELINE__)\r
+    #define __ARM_ARCH_8M_BASE__ 1\r
+  #elif defined(__ARM8M_MAINLINE__) && (__CORE == __ARM8M_MAINLINE__)\r
+    #define __ARM_ARCH_8M_MAIN__ 1\r
+  #elif defined(__ARM8EM_MAINLINE__) && (__CORE == __ARM8EM_MAINLINE__)\r
+    #define __ARM_ARCH_8M_MAIN__ 1\r
+  #else\r
+    #error "Unknown target."\r
+  #endif\r
+#endif\r
+\r
+\r
+\r
+#if defined(__ARM_ARCH_6M__) && __ARM_ARCH_6M__==1\r
+  #define __IAR_M0_FAMILY  1\r
+#elif defined(__ARM_ARCH_8M_BASE__) && __ARM_ARCH_8M_BASE__==1\r
+  #define __IAR_M0_FAMILY  1\r
+#else\r
+  #define __IAR_M0_FAMILY  0\r
+#endif\r
+\r
+\r
+#ifndef __ASM\r
+  #define __ASM __asm\r
+#endif\r
+\r
+#ifndef __INLINE\r
+  #define __INLINE inline\r
+#endif\r
+\r
+#ifndef   __NO_RETURN\r
+  #if __ICCARM_V8\r
+    #define __NO_RETURN __attribute__((__noreturn__))\r
+  #else\r
+    #define __NO_RETURN _Pragma("object_attribute=__noreturn")\r
+  #endif\r
+#endif\r
+\r
+#ifndef   __PACKED\r
+  #if __ICCARM_V8\r
+    #define __PACKED __attribute__((packed, aligned(1)))\r
+  #else\r
+    /* Needs IAR language extensions */\r
+    #define __PACKED __packed\r
+  #endif\r
+#endif\r
+\r
+#ifndef   __PACKED_STRUCT\r
+  #if __ICCARM_V8\r
+    #define __PACKED_STRUCT struct __attribute__((packed, aligned(1)))\r
+  #else\r
+    /* Needs IAR language extensions */\r
+    #define __PACKED_STRUCT __packed struct\r
+  #endif\r
+#endif\r
+\r
+#ifndef   __PACKED_UNION\r
+  #if __ICCARM_V8\r
+    #define __PACKED_UNION union __attribute__((packed, aligned(1)))\r
+  #else\r
+    /* Needs IAR language extensions */\r
+    #define __PACKED_UNION __packed union\r
+  #endif\r
+#endif\r
+\r
+#ifndef   __RESTRICT\r
+  #define __RESTRICT            __restrict\r
+#endif\r
+\r
+#ifndef   __STATIC_INLINE\r
+  #define __STATIC_INLINE       static inline\r
+#endif\r
+\r
+#ifndef   __FORCEINLINE\r
+  #define __FORCEINLINE         _Pragma("inline=forced")\r
+#endif\r
+\r
+#ifndef   __STATIC_FORCEINLINE\r
+  #define __STATIC_FORCEINLINE  __FORCEINLINE __STATIC_INLINE\r
+#endif\r
+\r
+#ifndef __UNALIGNED_UINT16_READ\r
+#pragma language=save\r
+#pragma language=extended\r
+__IAR_FT uint16_t __iar_uint16_read(void const *ptr)\r
+{\r
+  return *(__packed uint16_t*)(ptr);\r
+}\r
+#pragma language=restore\r
+#define __UNALIGNED_UINT16_READ(PTR) __iar_uint16_read(PTR)\r
+#endif\r
+\r
+\r
+#ifndef __UNALIGNED_UINT16_WRITE\r
+#pragma language=save\r
+#pragma language=extended\r
+__IAR_FT void __iar_uint16_write(void const *ptr, uint16_t val)\r
+{\r
+  *(__packed uint16_t*)(ptr) = val;;\r
+}\r
+#pragma language=restore\r
+#define __UNALIGNED_UINT16_WRITE(PTR,VAL) __iar_uint16_write(PTR,VAL)\r
+#endif\r
+\r
+#ifndef __UNALIGNED_UINT32_READ\r
+#pragma language=save\r
+#pragma language=extended\r
+__IAR_FT uint32_t __iar_uint32_read(void const *ptr)\r
+{\r
+  return *(__packed uint32_t*)(ptr);\r
+}\r
+#pragma language=restore\r
+#define __UNALIGNED_UINT32_READ(PTR) __iar_uint32_read(PTR)\r
+#endif\r
+\r
+#ifndef __UNALIGNED_UINT32_WRITE\r
+#pragma language=save\r
+#pragma language=extended\r
+__IAR_FT void __iar_uint32_write(void const *ptr, uint32_t val)\r
+{\r
+  *(__packed uint32_t*)(ptr) = val;;\r
+}\r
+#pragma language=restore\r
+#define __UNALIGNED_UINT32_WRITE(PTR,VAL) __iar_uint32_write(PTR,VAL)\r
+#endif\r
+\r
+#ifndef __UNALIGNED_UINT32   /* deprecated */\r
+#pragma language=save\r
+#pragma language=extended\r
+__packed struct  __iar_u32 { uint32_t v; };\r
+#pragma language=restore\r
+#define __UNALIGNED_UINT32(PTR) (((struct __iar_u32 *)(PTR))->v)\r
+#endif\r
+\r
+#ifndef   __USED\r
+  #if __ICCARM_V8\r
+    #define __USED __attribute__((used))\r
+  #else\r
+    #define __USED _Pragma("__root")\r
+  #endif\r
+#endif\r
+\r
+#ifndef   __WEAK\r
+  #if __ICCARM_V8\r
+    #define __WEAK __attribute__((weak))\r
+  #else\r
+    #define __WEAK _Pragma("__weak")\r
+  #endif\r
+#endif\r
+\r
+\r
+#ifndef __ICCARM_INTRINSICS_VERSION__\r
+  #define __ICCARM_INTRINSICS_VERSION__  0\r
+#endif\r
+\r
+#if __ICCARM_INTRINSICS_VERSION__ == 2\r
+\r
+  #if defined(__CLZ)\r
+    #undef __CLZ\r
+  #endif\r
+  #if defined(__REVSH)\r
+    #undef __REVSH\r
+  #endif\r
+  #if defined(__RBIT)\r
+    #undef __RBIT\r
+  #endif\r
+  #if defined(__SSAT)\r
+    #undef __SSAT\r
+  #endif\r
+  #if defined(__USAT)\r
+    #undef __USAT\r
+  #endif\r
+\r
+  #include "iccarm_builtin.h"\r
+\r
+  #define __disable_fault_irq __iar_builtin_disable_fiq\r
+  #define __disable_irq       __iar_builtin_disable_interrupt\r
+  #define __enable_fault_irq  __iar_builtin_enable_fiq\r
+  #define __enable_irq        __iar_builtin_enable_interrupt\r
+  #define __arm_rsr           __iar_builtin_rsr\r
+  #define __arm_wsr           __iar_builtin_wsr\r
+\r
+\r
+  #define __get_APSR()                (__arm_rsr("APSR"))\r
+  #define __get_BASEPRI()             (__arm_rsr("BASEPRI"))\r
+  #define __get_CONTROL()             (__arm_rsr("CONTROL"))\r
+  #define __get_FAULTMASK()           (__arm_rsr("FAULTMASK"))\r
+\r
+  #if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \\r
+       (defined (__FPU_USED   ) && (__FPU_USED    == 1U))     )\r
+    #define __get_FPSCR()             (__arm_rsr("FPSCR"))\r
+    #define __set_FPSCR(VALUE)        (__arm_wsr("FPSCR", (VALUE)))\r
+  #else\r
+    #define __get_FPSCR()             ( 0 )\r
+    #define __set_FPSCR(VALUE)        ((void)VALUE)\r
+  #endif\r
+\r
+  #define __get_IPSR()                (__arm_rsr("IPSR"))\r
+  #define __get_MSP()                 (__arm_rsr("MSP"))\r
+  #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \\r
+       (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))\r
+    // without main extensions, the non-secure MSPLIM is RAZ/WI\r
+    #define __get_MSPLIM()            (0U)\r
+  #else\r
+    #define __get_MSPLIM()            (__arm_rsr("MSPLIM"))\r
+  #endif\r
+  #define __get_PRIMASK()             (__arm_rsr("PRIMASK"))\r
+  #define __get_PSP()                 (__arm_rsr("PSP"))\r
+\r
+  #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \\r
+       (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))\r
+    // without main extensions, the non-secure PSPLIM is RAZ/WI\r
+    #define __get_PSPLIM()            (0U)\r
+  #else\r
+    #define __get_PSPLIM()            (__arm_rsr("PSPLIM"))\r
+  #endif\r
+\r
+  #define __get_xPSR()                (__arm_rsr("xPSR"))\r
+\r
+  #define __set_BASEPRI(VALUE)        (__arm_wsr("BASEPRI", (VALUE)))\r
+  #define __set_BASEPRI_MAX(VALUE)    (__arm_wsr("BASEPRI_MAX", (VALUE)))\r
+  #define __set_CONTROL(VALUE)        (__arm_wsr("CONTROL", (VALUE)))\r
+  #define __set_FAULTMASK(VALUE)      (__arm_wsr("FAULTMASK", (VALUE)))\r
+  #define __set_MSP(VALUE)            (__arm_wsr("MSP", (VALUE)))\r
+\r
+  #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \\r
+       (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))\r
+    // without main extensions, the non-secure MSPLIM is RAZ/WI\r
+    #define __set_MSPLIM(VALUE)       ((void)(VALUE))\r
+  #else\r
+    #define __set_MSPLIM(VALUE)       (__arm_wsr("MSPLIM", (VALUE)))\r
+  #endif\r
+  #define __set_PRIMASK(VALUE)        (__arm_wsr("PRIMASK", (VALUE)))\r
+  #define __set_PSP(VALUE)            (__arm_wsr("PSP", (VALUE)))\r
+  #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \\r
+       (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))\r
+    // without main extensions, the non-secure PSPLIM is RAZ/WI\r
+    #define __set_PSPLIM(VALUE)       ((void)(VALUE))\r
+  #else\r
+    #define __set_PSPLIM(VALUE)       (__arm_wsr("PSPLIM", (VALUE)))\r
+  #endif\r
+\r
+  #define __TZ_get_CONTROL_NS()       (__arm_rsr("CONTROL_NS"))\r
+  #define __TZ_set_CONTROL_NS(VALUE)  (__arm_wsr("CONTROL_NS", (VALUE)))\r
+  #define __TZ_get_PSP_NS()           (__arm_rsr("PSP_NS"))\r
+  #define __TZ_set_PSP_NS(VALUE)      (__arm_wsr("PSP_NS", (VALUE)))\r
+  #define __TZ_get_MSP_NS()           (__arm_rsr("MSP_NS"))\r
+  #define __TZ_set_MSP_NS(VALUE)      (__arm_wsr("MSP_NS", (VALUE)))\r
+  #define __TZ_get_SP_NS()            (__arm_rsr("SP_NS"))\r
+  #define __TZ_set_SP_NS(VALUE)       (__arm_wsr("SP_NS", (VALUE)))\r
+  #define __TZ_get_PRIMASK_NS()       (__arm_rsr("PRIMASK_NS"))\r
+  #define __TZ_set_PRIMASK_NS(VALUE)  (__arm_wsr("PRIMASK_NS", (VALUE)))\r
+  #define __TZ_get_BASEPRI_NS()       (__arm_rsr("BASEPRI_NS"))\r
+  #define __TZ_set_BASEPRI_NS(VALUE)  (__arm_wsr("BASEPRI_NS", (VALUE)))\r
+  #define __TZ_get_FAULTMASK_NS()     (__arm_rsr("FAULTMASK_NS"))\r
+  #define __TZ_set_FAULTMASK_NS(VALUE)(__arm_wsr("FAULTMASK_NS", (VALUE)))\r
+\r
+  #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \\r
+       (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))\r
+    // without main extensions, the non-secure PSPLIM is RAZ/WI\r
+    #define __TZ_get_PSPLIM_NS()      (0U)\r
+    #define __TZ_set_PSPLIM_NS(VALUE) ((void)(VALUE))\r
+  #else\r
+    #define __TZ_get_PSPLIM_NS()      (__arm_rsr("PSPLIM_NS"))\r
+    #define __TZ_set_PSPLIM_NS(VALUE) (__arm_wsr("PSPLIM_NS", (VALUE)))\r
+  #endif\r
+\r
+  #define __TZ_get_MSPLIM_NS()        (__arm_rsr("MSPLIM_NS"))\r
+  #define __TZ_set_MSPLIM_NS(VALUE)   (__arm_wsr("MSPLIM_NS", (VALUE)))\r
+\r
+  #define __NOP     __iar_builtin_no_operation\r
+\r
+  #define __CLZ     __iar_builtin_CLZ\r
+  #define __CLREX   __iar_builtin_CLREX\r
+\r
+  #define __DMB     __iar_builtin_DMB\r
+  #define __DSB     __iar_builtin_DSB\r
+  #define __ISB     __iar_builtin_ISB\r
+\r
+  #define __LDREXB  __iar_builtin_LDREXB\r
+  #define __LDREXH  __iar_builtin_LDREXH\r
+  #define __LDREXW  __iar_builtin_LDREX\r
+\r
+  #define __RBIT    __iar_builtin_RBIT\r
+  #define __REV     __iar_builtin_REV\r
+  #define __REV16   __iar_builtin_REV16\r
+\r
+  __IAR_FT int16_t __REVSH(int16_t val)\r
+  {\r
+    return (int16_t) __iar_builtin_REVSH(val);\r
+  }\r
+\r
+  #define __ROR     __iar_builtin_ROR\r
+  #define __RRX     __iar_builtin_RRX\r
+\r
+  #define __SEV     __iar_builtin_SEV\r
+\r
+  #if !__IAR_M0_FAMILY\r
+    #define __SSAT    __iar_builtin_SSAT\r
+  #endif\r
+\r
+  #define __STREXB  __iar_builtin_STREXB\r
+  #define __STREXH  __iar_builtin_STREXH\r
+  #define __STREXW  __iar_builtin_STREX\r
+\r
+  #if !__IAR_M0_FAMILY\r
+    #define __USAT    __iar_builtin_USAT\r
+  #endif\r
+\r
+  #define __WFE     __iar_builtin_WFE\r
+  #define __WFI     __iar_builtin_WFI\r
+\r
+  #if __ARM_MEDIA__\r
+    #define __SADD8   __iar_builtin_SADD8\r
+    #define __QADD8   __iar_builtin_QADD8\r
+    #define __SHADD8  __iar_builtin_SHADD8\r
+    #define __UADD8   __iar_builtin_UADD8\r
+    #define __UQADD8  __iar_builtin_UQADD8\r
+    #define __UHADD8  __iar_builtin_UHADD8\r
+    #define __SSUB8   __iar_builtin_SSUB8\r
+    #define __QSUB8   __iar_builtin_QSUB8\r
+    #define __SHSUB8  __iar_builtin_SHSUB8\r
+    #define __USUB8   __iar_builtin_USUB8\r
+    #define __UQSUB8  __iar_builtin_UQSUB8\r
+    #define __UHSUB8  __iar_builtin_UHSUB8\r
+    #define __SADD16  __iar_builtin_SADD16\r
+    #define __QADD16  __iar_builtin_QADD16\r
+    #define __SHADD16 __iar_builtin_SHADD16\r
+    #define __UADD16  __iar_builtin_UADD16\r
+    #define __UQADD16 __iar_builtin_UQADD16\r
+    #define __UHADD16 __iar_builtin_UHADD16\r
+    #define __SSUB16  __iar_builtin_SSUB16\r
+    #define __QSUB16  __iar_builtin_QSUB16\r
+    #define __SHSUB16 __iar_builtin_SHSUB16\r
+    #define __USUB16  __iar_builtin_USUB16\r
+    #define __UQSUB16 __iar_builtin_UQSUB16\r
+    #define __UHSUB16 __iar_builtin_UHSUB16\r
+    #define __SASX    __iar_builtin_SASX\r
+    #define __QASX    __iar_builtin_QASX\r
+    #define __SHASX   __iar_builtin_SHASX\r
+    #define __UASX    __iar_builtin_UASX\r
+    #define __UQASX   __iar_builtin_UQASX\r
+    #define __UHASX   __iar_builtin_UHASX\r
+    #define __SSAX    __iar_builtin_SSAX\r
+    #define __QSAX    __iar_builtin_QSAX\r
+    #define __SHSAX   __iar_builtin_SHSAX\r
+    #define __USAX    __iar_builtin_USAX\r
+    #define __UQSAX   __iar_builtin_UQSAX\r
+    #define __UHSAX   __iar_builtin_UHSAX\r
+    #define __USAD8   __iar_builtin_USAD8\r
+    #define __USADA8  __iar_builtin_USADA8\r
+    #define __SSAT16  __iar_builtin_SSAT16\r
+    #define __USAT16  __iar_builtin_USAT16\r
+    #define __UXTB16  __iar_builtin_UXTB16\r
+    #define __UXTAB16 __iar_builtin_UXTAB16\r
+    #define __SXTB16  __iar_builtin_SXTB16\r
+    #define __SXTAB16 __iar_builtin_SXTAB16\r
+    #define __SMUAD   __iar_builtin_SMUAD\r
+    #define __SMUADX  __iar_builtin_SMUADX\r
+    #define __SMMLA   __iar_builtin_SMMLA\r
+    #define __SMLAD   __iar_builtin_SMLAD\r
+    #define __SMLADX  __iar_builtin_SMLADX\r
+    #define __SMLALD  __iar_builtin_SMLALD\r
+    #define __SMLALDX __iar_builtin_SMLALDX\r
+    #define __SMUSD   __iar_builtin_SMUSD\r
+    #define __SMUSDX  __iar_builtin_SMUSDX\r
+    #define __SMLSD   __iar_builtin_SMLSD\r
+    #define __SMLSDX  __iar_builtin_SMLSDX\r
+    #define __SMLSLD  __iar_builtin_SMLSLD\r
+    #define __SMLSLDX __iar_builtin_SMLSLDX\r
+    #define __SEL     __iar_builtin_SEL\r
+    #define __QADD    __iar_builtin_QADD\r
+    #define __QSUB    __iar_builtin_QSUB\r
+    #define __PKHBT   __iar_builtin_PKHBT\r
+    #define __PKHTB   __iar_builtin_PKHTB\r
+  #endif\r
+\r
+#else /* __ICCARM_INTRINSICS_VERSION__ == 2 */\r
+\r
+  #if __IAR_M0_FAMILY\r
+   /* Avoid clash between intrinsics.h and arm_math.h when compiling for Cortex-M0. */\r
+    #define __CLZ  __cmsis_iar_clz_not_active\r
+    #define __SSAT __cmsis_iar_ssat_not_active\r
+    #define __USAT __cmsis_iar_usat_not_active\r
+    #define __RBIT __cmsis_iar_rbit_not_active\r
+    #define __get_APSR  __cmsis_iar_get_APSR_not_active\r
+  #endif\r
+\r
+\r
+  #if (!((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \\r
+         (defined (__FPU_USED   ) && (__FPU_USED    == 1U))     ))\r
+    #define __get_FPSCR __cmsis_iar_get_FPSR_not_active\r
+    #define __set_FPSCR __cmsis_iar_set_FPSR_not_active\r
+  #endif\r
+\r
+  #ifdef __INTRINSICS_INCLUDED\r
+  #error intrinsics.h is already included previously!\r
+  #endif\r
+\r
+  #include <intrinsics.h>\r
+\r
+  #if __IAR_M0_FAMILY\r
+   /* Avoid clash between intrinsics.h and arm_math.h when compiling for Cortex-M0. */\r
+    #undef __CLZ\r
+    #undef __SSAT\r
+    #undef __USAT\r
+    #undef __RBIT\r
+    #undef __get_APSR\r
+\r
+    __STATIC_INLINE uint8_t __CLZ(uint32_t data)\r
+    {\r
+      if (data == 0U) { return 32U; }\r
+\r
+      uint32_t count = 0U;\r
+      uint32_t mask = 0x80000000U;\r
+\r
+      while ((data & mask) == 0U)\r
+      {\r
+        count += 1U;\r
+        mask = mask >> 1U;\r
+      }\r
+      return count;\r
+    }\r
+\r
+    __STATIC_INLINE uint32_t __RBIT(uint32_t v)\r
+    {\r
+      uint8_t sc = 31U;\r
+      uint32_t r = v;\r
+      for (v >>= 1U; v; v >>= 1U)\r
+      {\r
+        r <<= 1U;\r
+        r |= v & 1U;\r
+        sc--;\r
+      }\r
+      return (r << sc);\r
+    }\r
+\r
+    __STATIC_INLINE  uint32_t __get_APSR(void)\r
+    {\r
+      uint32_t res;\r
+      __asm("MRS      %0,APSR" : "=r" (res));\r
+      return res;\r
+    }\r
+\r
+  #endif\r
+\r
+  #if (!((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \\r
+         (defined (__FPU_USED   ) && (__FPU_USED    == 1U))     ))\r
+    #undef __get_FPSCR\r
+    #undef __set_FPSCR\r
+    #define __get_FPSCR()       (0)\r
+    #define __set_FPSCR(VALUE)  ((void)VALUE)\r
+  #endif\r
+\r
+  #pragma diag_suppress=Pe940\r
+  #pragma diag_suppress=Pe177\r
+\r
+  #define __enable_irq    __enable_interrupt\r
+  #define __disable_irq   __disable_interrupt\r
+  #define __NOP           __no_operation\r
+\r
+  #define __get_xPSR      __get_PSR\r
+\r
+  #if (!defined(__ARM_ARCH_6M__) || __ARM_ARCH_6M__==0)\r
+\r
+    __IAR_FT uint32_t __LDREXW(uint32_t volatile *ptr)\r
+    {\r
+      return __LDREX((unsigned long *)ptr);\r
+    }\r
+\r
+    __IAR_FT uint32_t __STREXW(uint32_t value, uint32_t volatile *ptr)\r
+    {\r
+      return __STREX(value, (unsigned long *)ptr);\r
+    }\r
+  #endif\r
+\r
+\r
+  /* __CORTEX_M is defined in core_cm0.h, core_cm3.h and core_cm4.h. */\r
+  #if (__CORTEX_M >= 0x03)\r
+\r
+    __IAR_FT uint32_t __RRX(uint32_t value)\r
+    {\r
+      uint32_t result;\r
+      __ASM("RRX      %0, %1" : "=r"(result) : "r" (value) : "cc");\r
+      return(result);\r
+    }\r
+\r
+    __IAR_FT void __set_BASEPRI_MAX(uint32_t value)\r
+    {\r
+      __asm volatile("MSR      BASEPRI_MAX,%0"::"r" (value));\r
+    }\r
+\r
+\r
+    #define __enable_fault_irq  __enable_fiq\r
+    #define __disable_fault_irq __disable_fiq\r
+\r
+\r
+  #endif /* (__CORTEX_M >= 0x03) */\r
+\r
+  __IAR_FT uint32_t __ROR(uint32_t op1, uint32_t op2)\r
+  {\r
+    return (op1 >> op2) | (op1 << ((sizeof(op1)*8)-op2));\r
+  }\r
+\r
+  #if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \\r
+       (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1))    )\r
+\r
+   __IAR_FT uint32_t __get_MSPLIM(void)\r
+    {\r
+      uint32_t res;\r
+    #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \\r
+         (!defined (__ARM_FEATURE_CMSE  ) || (__ARM_FEATURE_CMSE   < 3)))\r
+      // without main extensions, the non-secure MSPLIM is RAZ/WI\r
+      res = 0U;\r
+    #else\r
+      __asm volatile("MRS      %0,MSPLIM" : "=r" (res));\r
+    #endif\r
+      return res;\r
+    }\r
+\r
+    __IAR_FT void   __set_MSPLIM(uint32_t value)\r
+    {\r
+    #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \\r
+         (!defined (__ARM_FEATURE_CMSE  ) || (__ARM_FEATURE_CMSE   < 3)))\r
+      // without main extensions, the non-secure MSPLIM is RAZ/WI\r
+      (void)value;\r
+    #else\r
+      __asm volatile("MSR      MSPLIM,%0" :: "r" (value));\r
+    #endif\r
+    }\r
+\r
+    __IAR_FT uint32_t __get_PSPLIM(void)\r
+    {\r
+      uint32_t res;\r
+    #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \\r
+         (!defined (__ARM_FEATURE_CMSE  ) || (__ARM_FEATURE_CMSE   < 3)))\r
+      // without main extensions, the non-secure PSPLIM is RAZ/WI\r
+      res = 0U;\r
+    #else\r
+      __asm volatile("MRS      %0,PSPLIM" : "=r" (res));\r
+    #endif\r
+      return res;\r
+    }\r
+\r
+    __IAR_FT void   __set_PSPLIM(uint32_t value)\r
+    {\r
+    #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \\r
+         (!defined (__ARM_FEATURE_CMSE  ) || (__ARM_FEATURE_CMSE   < 3)))\r
+      // without main extensions, the non-secure PSPLIM is RAZ/WI\r
+      (void)value;\r
+    #else\r
+      __asm volatile("MSR      PSPLIM,%0" :: "r" (value));\r
+    #endif\r
+    }\r
+\r
+    __IAR_FT uint32_t __TZ_get_CONTROL_NS(void)\r
+    {\r
+      uint32_t res;\r
+      __asm volatile("MRS      %0,CONTROL_NS" : "=r" (res));\r
+      return res;\r
+    }\r
+\r
+    __IAR_FT void   __TZ_set_CONTROL_NS(uint32_t value)\r
+    {\r
+      __asm volatile("MSR      CONTROL_NS,%0" :: "r" (value));\r
+    }\r
+\r
+    __IAR_FT uint32_t   __TZ_get_PSP_NS(void)\r
+    {\r
+      uint32_t res;\r
+      __asm volatile("MRS      %0,PSP_NS" : "=r" (res));\r
+      return res;\r
+    }\r
+\r
+    __IAR_FT void   __TZ_set_PSP_NS(uint32_t value)\r
+    {\r
+      __asm volatile("MSR      PSP_NS,%0" :: "r" (value));\r
+    }\r
+\r
+    __IAR_FT uint32_t   __TZ_get_MSP_NS(void)\r
+    {\r
+      uint32_t res;\r
+      __asm volatile("MRS      %0,MSP_NS" : "=r" (res));\r
+      return res;\r
+    }\r
+\r
+    __IAR_FT void   __TZ_set_MSP_NS(uint32_t value)\r
+    {\r
+      __asm volatile("MSR      MSP_NS,%0" :: "r" (value));\r
+    }\r
+\r
+    __IAR_FT uint32_t   __TZ_get_SP_NS(void)\r
+    {\r
+      uint32_t res;\r
+      __asm volatile("MRS      %0,SP_NS" : "=r" (res));\r
+      return res;\r
+    }\r
+    __IAR_FT void   __TZ_set_SP_NS(uint32_t value)\r
+    {\r
+      __asm volatile("MSR      SP_NS,%0" :: "r" (value));\r
+    }\r
+\r
+    __IAR_FT uint32_t   __TZ_get_PRIMASK_NS(void)\r
+    {\r
+      uint32_t res;\r
+      __asm volatile("MRS      %0,PRIMASK_NS" : "=r" (res));\r
+      return res;\r
+    }\r
+\r
+    __IAR_FT void   __TZ_set_PRIMASK_NS(uint32_t value)\r
+    {\r
+      __asm volatile("MSR      PRIMASK_NS,%0" :: "r" (value));\r
+    }\r
+\r
+    __IAR_FT uint32_t   __TZ_get_BASEPRI_NS(void)\r
+    {\r
+      uint32_t res;\r
+      __asm volatile("MRS      %0,BASEPRI_NS" : "=r" (res));\r
+      return res;\r
+    }\r
+\r
+    __IAR_FT void   __TZ_set_BASEPRI_NS(uint32_t value)\r
+    {\r
+      __asm volatile("MSR      BASEPRI_NS,%0" :: "r" (value));\r
+    }\r
+\r
+    __IAR_FT uint32_t   __TZ_get_FAULTMASK_NS(void)\r
+    {\r
+      uint32_t res;\r
+      __asm volatile("MRS      %0,FAULTMASK_NS" : "=r" (res));\r
+      return res;\r
+    }\r
+\r
+    __IAR_FT void   __TZ_set_FAULTMASK_NS(uint32_t value)\r
+    {\r
+      __asm volatile("MSR      FAULTMASK_NS,%0" :: "r" (value));\r
+    }\r
+\r
+    __IAR_FT uint32_t   __TZ_get_PSPLIM_NS(void)\r
+    {\r
+      uint32_t res;\r
+    #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \\r
+         (!defined (__ARM_FEATURE_CMSE  ) || (__ARM_FEATURE_CMSE   < 3)))\r
+      // without main extensions, the non-secure PSPLIM is RAZ/WI\r
+      res = 0U;\r
+    #else\r
+      __asm volatile("MRS      %0,PSPLIM_NS" : "=r" (res));\r
+    #endif\r
+      return res;\r
+    }\r
+\r
+    __IAR_FT void   __TZ_set_PSPLIM_NS(uint32_t value)\r
+    {\r
+    #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \\r
+         (!defined (__ARM_FEATURE_CMSE  ) || (__ARM_FEATURE_CMSE   < 3)))\r
+      // without main extensions, the non-secure PSPLIM is RAZ/WI\r
+      (void)value;\r
+    #else\r
+      __asm volatile("MSR      PSPLIM_NS,%0" :: "r" (value));\r
+    #endif\r
+    }\r
+\r
+    __IAR_FT uint32_t   __TZ_get_MSPLIM_NS(void)\r
+    {\r
+      uint32_t res;\r
+      __asm volatile("MRS      %0,MSPLIM_NS" : "=r" (res));\r
+      return res;\r
+    }\r
+\r
+    __IAR_FT void   __TZ_set_MSPLIM_NS(uint32_t value)\r
+    {\r
+      __asm volatile("MSR      MSPLIM_NS,%0" :: "r" (value));\r
+    }\r
+\r
+  #endif /* __ARM_ARCH_8M_MAIN__ or __ARM_ARCH_8M_BASE__ */\r
+\r
+#endif   /* __ICCARM_INTRINSICS_VERSION__ == 2 */\r
+\r
+#define __BKPT(value)    __asm volatile ("BKPT     %0" : : "i"(value))\r
+\r
+#if __IAR_M0_FAMILY\r
+  __STATIC_INLINE int32_t __SSAT(int32_t val, uint32_t sat)\r
+  {\r
+    if ((sat >= 1U) && (sat <= 32U))\r
+    {\r
+      const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U);\r
+      const int32_t min = -1 - max ;\r
+      if (val > max)\r
+      {\r
+        return max;\r
+      }\r
+      else if (val < min)\r
+      {\r
+        return min;\r
+      }\r
+    }\r
+    return val;\r
+  }\r
+\r
+  __STATIC_INLINE uint32_t __USAT(int32_t val, uint32_t sat)\r
+  {\r
+    if (sat <= 31U)\r
+    {\r
+      const uint32_t max = ((1U << sat) - 1U);\r
+      if (val > (int32_t)max)\r
+      {\r
+        return max;\r
+      }\r
+      else if (val < 0)\r
+      {\r
+        return 0U;\r
+      }\r
+    }\r
+    return (uint32_t)val;\r
+  }\r
+#endif\r
+\r
+#if (__CORTEX_M >= 0x03)   /* __CORTEX_M is defined in core_cm0.h, core_cm3.h and core_cm4.h. */\r
+\r
+  __IAR_FT uint8_t __LDRBT(volatile uint8_t *addr)\r
+  {\r
+    uint32_t res;\r
+    __ASM("LDRBT %0, [%1]" : "=r" (res) : "r" (addr) : "memory");\r
+    return ((uint8_t)res);\r
+  }\r
+\r
+  __IAR_FT uint16_t __LDRHT(volatile uint16_t *addr)\r
+  {\r
+    uint32_t res;\r
+    __ASM("LDRHT %0, [%1]" : "=r" (res) : "r" (addr) : "memory");\r
+    return ((uint16_t)res);\r
+  }\r
+\r
+  __IAR_FT uint32_t __LDRT(volatile uint32_t *addr)\r
+  {\r
+    uint32_t res;\r
+    __ASM("LDRT %0, [%1]" : "=r" (res) : "r" (addr) : "memory");\r
+    return res;\r
+  }\r
+\r
+  __IAR_FT void __STRBT(uint8_t value, volatile uint8_t *addr)\r
+  {\r
+    __ASM("STRBT %1, [%0]" : : "r" (addr), "r" ((uint32_t)value) : "memory");\r
+  }\r
+\r
+  __IAR_FT void __STRHT(uint16_t value, volatile uint16_t *addr)\r
+  {\r
+    __ASM("STRHT %1, [%0]" : : "r" (addr), "r" ((uint32_t)value) : "memory");\r
+  }\r
+\r
+  __IAR_FT void __STRT(uint32_t value, volatile uint32_t *addr)\r
+  {\r
+    __ASM("STRT %1, [%0]" : : "r" (addr), "r" (value) : "memory");\r
+  }\r
+\r
+#endif /* (__CORTEX_M >= 0x03) */\r
+\r
+#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \\r
+     (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1))    )\r
+\r
+\r
+  __IAR_FT uint8_t __LDAB(volatile uint8_t *ptr)\r
+  {\r
+    uint32_t res;\r
+    __ASM volatile ("LDAB %0, [%1]" : "=r" (res) : "r" (ptr) : "memory");\r
+    return ((uint8_t)res);\r
+  }\r
+\r
+  __IAR_FT uint16_t __LDAH(volatile uint16_t *ptr)\r
+  {\r
+    uint32_t res;\r
+    __ASM volatile ("LDAH %0, [%1]" : "=r" (res) : "r" (ptr) : "memory");\r
+    return ((uint16_t)res);\r
+  }\r
+\r
+  __IAR_FT uint32_t __LDA(volatile uint32_t *ptr)\r
+  {\r
+    uint32_t res;\r
+    __ASM volatile ("LDA %0, [%1]" : "=r" (res) : "r" (ptr) : "memory");\r
+    return res;\r
+  }\r
+\r
+  __IAR_FT void __STLB(uint8_t value, volatile uint8_t *ptr)\r
+  {\r
+    __ASM volatile ("STLB %1, [%0]" :: "r" (ptr), "r" (value) : "memory");\r
+  }\r
+\r
+  __IAR_FT void __STLH(uint16_t value, volatile uint16_t *ptr)\r
+  {\r
+    __ASM volatile ("STLH %1, [%0]" :: "r" (ptr), "r" (value) : "memory");\r
+  }\r
+\r
+  __IAR_FT void __STL(uint32_t value, volatile uint32_t *ptr)\r
+  {\r
+    __ASM volatile ("STL %1, [%0]" :: "r" (ptr), "r" (value) : "memory");\r
+  }\r
+\r
+  __IAR_FT uint8_t __LDAEXB(volatile uint8_t *ptr)\r
+  {\r
+    uint32_t res;\r
+    __ASM volatile ("LDAEXB %0, [%1]" : "=r" (res) : "r" (ptr) : "memory");\r
+    return ((uint8_t)res);\r
+  }\r
+\r
+  __IAR_FT uint16_t __LDAEXH(volatile uint16_t *ptr)\r
+  {\r
+    uint32_t res;\r
+    __ASM volatile ("LDAEXH %0, [%1]" : "=r" (res) : "r" (ptr) : "memory");\r
+    return ((uint16_t)res);\r
+  }\r
+\r
+  __IAR_FT uint32_t __LDAEX(volatile uint32_t *ptr)\r
+  {\r
+    uint32_t res;\r
+    __ASM volatile ("LDAEX %0, [%1]" : "=r" (res) : "r" (ptr) : "memory");\r
+    return res;\r
+  }\r
+\r
+  __IAR_FT uint32_t __STLEXB(uint8_t value, volatile uint8_t *ptr)\r
+  {\r
+    uint32_t res;\r
+    __ASM volatile ("STLEXB %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory");\r
+    return res;\r
+  }\r
+\r
+  __IAR_FT uint32_t __STLEXH(uint16_t value, volatile uint16_t *ptr)\r
+  {\r
+    uint32_t res;\r
+    __ASM volatile ("STLEXH %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory");\r
+    return res;\r
+  }\r
+\r
+  __IAR_FT uint32_t __STLEX(uint32_t value, volatile uint32_t *ptr)\r
+  {\r
+    uint32_t res;\r
+    __ASM volatile ("STLEX %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory");\r
+    return res;\r
+  }\r
+\r
+#endif /* __ARM_ARCH_8M_MAIN__ or __ARM_ARCH_8M_BASE__ */\r
+\r
+#undef __IAR_FT\r
+#undef __IAR_M0_FAMILY\r
+#undef __ICCARM_V8\r
+\r
+#pragma diag_default=Pe940\r
+#pragma diag_default=Pe177\r
+\r
+#endif /* __CMSIS_ICCARM_H__ */\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/cmsis_version.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/cmsis_version.h
new file mode 100644 (file)
index 0000000..ae3f2e3
--- /dev/null
@@ -0,0 +1,39 @@
+/**************************************************************************//**\r
+ * @file     cmsis_version.h\r
+ * @brief    CMSIS Core(M) Version definitions\r
+ * @version  V5.0.2\r
+ * @date     19. April 2017\r
+ ******************************************************************************/\r
+/*\r
+ * Copyright (c) 2009-2017 ARM Limited. All rights reserved.\r
+ *\r
+ * SPDX-License-Identifier: Apache-2.0\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the License); you may\r
+ * not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#if   defined ( __ICCARM__ )\r
+  #pragma system_include         /* treat file as system include file for MISRA check */\r
+#elif defined (__clang__)\r
+  #pragma clang system_header   /* treat file as system include file */\r
+#endif\r
+\r
+#ifndef __CMSIS_VERSION_H\r
+#define __CMSIS_VERSION_H\r
+\r
+/*  CMSIS Version definitions */\r
+#define __CM_CMSIS_VERSION_MAIN  ( 5U)                                      /*!< [31:16] CMSIS Core(M) main version */\r
+#define __CM_CMSIS_VERSION_SUB   ( 1U)                                      /*!< [15:0]  CMSIS Core(M) sub version */\r
+#define __CM_CMSIS_VERSION       ((__CM_CMSIS_VERSION_MAIN << 16U) | \\r
+                                   __CM_CMSIS_VERSION_SUB           )       /*!< CMSIS Core(M) version number */\r
+#endif\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_armv8mbl.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_armv8mbl.h
new file mode 100644 (file)
index 0000000..ec76ab2
--- /dev/null
@@ -0,0 +1,1918 @@
+/**************************************************************************//**\r
+ * @file     core_armv8mbl.h\r
+ * @brief    CMSIS Armv8-M Baseline Core Peripheral Access Layer Header File\r
+ * @version  V5.0.7\r
+ * @date     22. June 2018\r
+ ******************************************************************************/\r
+/*\r
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.\r
+ *\r
+ * SPDX-License-Identifier: Apache-2.0\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the License); you may\r
+ * not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#if   defined ( __ICCARM__ )\r
+  #pragma system_include         /* treat file as system include file for MISRA check */\r
+#elif defined (__clang__)\r
+  #pragma clang system_header   /* treat file as system include file */\r
+#endif\r
+\r
+#ifndef __CORE_ARMV8MBL_H_GENERIC\r
+#define __CORE_ARMV8MBL_H_GENERIC\r
+\r
+#include <stdint.h>\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/**\r
+  \page CMSIS_MISRA_Exceptions  MISRA-C:2004 Compliance Exceptions\r
+  CMSIS violates the following MISRA-C:2004 rules:\r
+\r
+   \li Required Rule 8.5, object/function definition in header file.<br>\r
+     Function definitions in header files are used to allow 'inlining'.\r
+\r
+   \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>\r
+     Unions are used for effective representation of core registers.\r
+\r
+   \li Advisory Rule 19.7, Function-like macro defined.<br>\r
+     Function-like macros are used to allow more efficient code.\r
+ */\r
+\r
+\r
+/*******************************************************************************\r
+ *                 CMSIS definitions\r
+ ******************************************************************************/\r
+/**\r
+  \ingroup Cortex_ARMv8MBL\r
+  @{\r
+ */\r
+\r
+#include "cmsis_version.h"\r
+\r
+/*  CMSIS definitions */\r
+#define __ARMv8MBL_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                   /*!< \deprecated [31:16] CMSIS HAL main version */\r
+#define __ARMv8MBL_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                    /*!< \deprecated [15:0]  CMSIS HAL sub version */\r
+#define __ARMv8MBL_CMSIS_VERSION       ((__ARMv8MBL_CMSIS_VERSION_MAIN << 16U) | \\r
+                                         __ARMv8MBL_CMSIS_VERSION_SUB           )  /*!< \deprecated CMSIS HAL version number */\r
+\r
+#define __CORTEX_M                     ( 2U)                                            /*!< Cortex-M Core */\r
+\r
+/** __FPU_USED indicates whether an FPU is used or not.\r
+    This core does not support an FPU at all\r
+*/\r
+#define __FPU_USED       0U\r
+\r
+#if defined ( __CC_ARM )\r
+  #if defined __TARGET_FPU_VFP\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)\r
+  #if defined __ARM_PCS_VFP\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __GNUC__ )\r
+  #if defined (__VFP_FP__) && !defined(__SOFTFP__)\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __ICCARM__ )\r
+  #if defined __ARMVFP__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __TI_ARM__ )\r
+  #if defined __TI_VFP_SUPPORT__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __TASKING__ )\r
+  #if defined __FPU_VFP__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __CSMC__ )\r
+  #if ( __CSMC__ & 0x400U)\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#endif\r
+\r
+#include "cmsis_compiler.h"               /* CMSIS compiler specific defines */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_ARMV8MBL_H_GENERIC */\r
+\r
+#ifndef __CMSIS_GENERIC\r
+\r
+#ifndef __CORE_ARMV8MBL_H_DEPENDANT\r
+#define __CORE_ARMV8MBL_H_DEPENDANT\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/* check device defines and use defaults */\r
+#if defined __CHECK_DEVICE_DEFINES\r
+  #ifndef __ARMv8MBL_REV\r
+    #define __ARMv8MBL_REV               0x0000U\r
+    #warning "__ARMv8MBL_REV not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __FPU_PRESENT\r
+    #define __FPU_PRESENT             0U\r
+    #warning "__FPU_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __MPU_PRESENT\r
+    #define __MPU_PRESENT             0U\r
+    #warning "__MPU_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __SAUREGION_PRESENT\r
+    #define __SAUREGION_PRESENT       0U\r
+    #warning "__SAUREGION_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __VTOR_PRESENT\r
+    #define __VTOR_PRESENT            0U\r
+    #warning "__VTOR_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __NVIC_PRIO_BITS\r
+    #define __NVIC_PRIO_BITS          2U\r
+    #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __Vendor_SysTickConfig\r
+    #define __Vendor_SysTickConfig    0U\r
+    #warning "__Vendor_SysTickConfig not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __ETM_PRESENT\r
+    #define __ETM_PRESENT             0U\r
+    #warning "__ETM_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __MTB_PRESENT\r
+    #define __MTB_PRESENT             0U\r
+    #warning "__MTB_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+#endif\r
+\r
+/* IO definitions (access restrictions to peripheral registers) */\r
+/**\r
+    \defgroup CMSIS_glob_defs CMSIS Global Defines\r
+\r
+    <strong>IO Type Qualifiers</strong> are used\r
+    \li to specify the access to peripheral variables.\r
+    \li for automatic generation of peripheral register debug information.\r
+*/\r
+#ifdef __cplusplus\r
+  #define   __I     volatile             /*!< Defines 'read only' permissions */\r
+#else\r
+  #define   __I     volatile const       /*!< Defines 'read only' permissions */\r
+#endif\r
+#define     __O     volatile             /*!< Defines 'write only' permissions */\r
+#define     __IO    volatile             /*!< Defines 'read / write' permissions */\r
+\r
+/* following defines should be used for structure members */\r
+#define     __IM     volatile const      /*! Defines 'read only' structure member permissions */\r
+#define     __OM     volatile            /*! Defines 'write only' structure member permissions */\r
+#define     __IOM    volatile            /*! Defines 'read / write' structure member permissions */\r
+\r
+/*@} end of group ARMv8MBL */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                 Register Abstraction\r
+  Core Register contain:\r
+  - Core Register\r
+  - Core NVIC Register\r
+  - Core SCB Register\r
+  - Core SysTick Register\r
+  - Core Debug Register\r
+  - Core MPU Register\r
+  - Core SAU Register\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_core_register Defines and Type Definitions\r
+  \brief Type definitions and defines for Cortex-M processor based devices.\r
+*/\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_CORE  Status and Control Registers\r
+  \brief      Core Register type definitions.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Union type to access the Application Program Status Register (APSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t _reserved0:28;              /*!< bit:  0..27  Reserved */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} APSR_Type;\r
+\r
+/* APSR Register Definitions */\r
+#define APSR_N_Pos                         31U                                            /*!< APSR: N Position */\r
+#define APSR_N_Msk                         (1UL << APSR_N_Pos)                            /*!< APSR: N Mask */\r
+\r
+#define APSR_Z_Pos                         30U                                            /*!< APSR: Z Position */\r
+#define APSR_Z_Msk                         (1UL << APSR_Z_Pos)                            /*!< APSR: Z Mask */\r
+\r
+#define APSR_C_Pos                         29U                                            /*!< APSR: C Position */\r
+#define APSR_C_Msk                         (1UL << APSR_C_Pos)                            /*!< APSR: C Mask */\r
+\r
+#define APSR_V_Pos                         28U                                            /*!< APSR: V Position */\r
+#define APSR_V_Msk                         (1UL << APSR_V_Pos)                            /*!< APSR: V Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Interrupt Program Status Register (IPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:23;              /*!< bit:  9..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} IPSR_Type;\r
+\r
+/* IPSR Register Definitions */\r
+#define IPSR_ISR_Pos                        0U                                            /*!< IPSR: ISR Position */\r
+#define IPSR_ISR_Msk                       (0x1FFUL /*<< IPSR_ISR_Pos*/)                  /*!< IPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Special-Purpose Program Status Registers (xPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:15;              /*!< bit:  9..23  Reserved */\r
+    uint32_t T:1;                        /*!< bit:     24  Thumb bit        (read 0) */\r
+    uint32_t _reserved1:3;               /*!< bit: 25..27  Reserved */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} xPSR_Type;\r
+\r
+/* xPSR Register Definitions */\r
+#define xPSR_N_Pos                         31U                                            /*!< xPSR: N Position */\r
+#define xPSR_N_Msk                         (1UL << xPSR_N_Pos)                            /*!< xPSR: N Mask */\r
+\r
+#define xPSR_Z_Pos                         30U                                            /*!< xPSR: Z Position */\r
+#define xPSR_Z_Msk                         (1UL << xPSR_Z_Pos)                            /*!< xPSR: Z Mask */\r
+\r
+#define xPSR_C_Pos                         29U                                            /*!< xPSR: C Position */\r
+#define xPSR_C_Msk                         (1UL << xPSR_C_Pos)                            /*!< xPSR: C Mask */\r
+\r
+#define xPSR_V_Pos                         28U                                            /*!< xPSR: V Position */\r
+#define xPSR_V_Msk                         (1UL << xPSR_V_Pos)                            /*!< xPSR: V Mask */\r
+\r
+#define xPSR_T_Pos                         24U                                            /*!< xPSR: T Position */\r
+#define xPSR_T_Msk                         (1UL << xPSR_T_Pos)                            /*!< xPSR: T Mask */\r
+\r
+#define xPSR_ISR_Pos                        0U                                            /*!< xPSR: ISR Position */\r
+#define xPSR_ISR_Msk                       (0x1FFUL /*<< xPSR_ISR_Pos*/)                  /*!< xPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Control Registers (CONTROL).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t nPRIV:1;                    /*!< bit:      0  Execution privilege in Thread mode */\r
+    uint32_t SPSEL:1;                    /*!< bit:      1  Stack-pointer select */\r
+    uint32_t _reserved1:30;              /*!< bit:  2..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} CONTROL_Type;\r
+\r
+/* CONTROL Register Definitions */\r
+#define CONTROL_SPSEL_Pos                   1U                                            /*!< CONTROL: SPSEL Position */\r
+#define CONTROL_SPSEL_Msk                  (1UL << CONTROL_SPSEL_Pos)                     /*!< CONTROL: SPSEL Mask */\r
+\r
+#define CONTROL_nPRIV_Pos                   0U                                            /*!< CONTROL: nPRIV Position */\r
+#define CONTROL_nPRIV_Msk                  (1UL /*<< CONTROL_nPRIV_Pos*/)                 /*!< CONTROL: nPRIV Mask */\r
+\r
+/*@} end of group CMSIS_CORE */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_NVIC  Nested Vectored Interrupt Controller (NVIC)\r
+  \brief      Type definitions for the NVIC Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Nested Vectored Interrupt Controller (NVIC).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t ISER[16U];              /*!< Offset: 0x000 (R/W)  Interrupt Set Enable Register */\r
+        uint32_t RESERVED0[16U];\r
+  __IOM uint32_t ICER[16U];              /*!< Offset: 0x080 (R/W)  Interrupt Clear Enable Register */\r
+        uint32_t RSERVED1[16U];\r
+  __IOM uint32_t ISPR[16U];              /*!< Offset: 0x100 (R/W)  Interrupt Set Pending Register */\r
+        uint32_t RESERVED2[16U];\r
+  __IOM uint32_t ICPR[16U];              /*!< Offset: 0x180 (R/W)  Interrupt Clear Pending Register */\r
+        uint32_t RESERVED3[16U];\r
+  __IOM uint32_t IABR[16U];              /*!< Offset: 0x200 (R/W)  Interrupt Active bit Register */\r
+        uint32_t RESERVED4[16U];\r
+  __IOM uint32_t ITNS[16U];              /*!< Offset: 0x280 (R/W)  Interrupt Non-Secure State Register */\r
+        uint32_t RESERVED5[16U];\r
+  __IOM uint32_t IPR[124U];              /*!< Offset: 0x300 (R/W)  Interrupt Priority Register */\r
+}  NVIC_Type;\r
+\r
+/*@} end of group CMSIS_NVIC */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SCB     System Control Block (SCB)\r
+  \brief    Type definitions for the System Control Block Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Control Block (SCB).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t CPUID;                  /*!< Offset: 0x000 (R/ )  CPUID Base Register */\r
+  __IOM uint32_t ICSR;                   /*!< Offset: 0x004 (R/W)  Interrupt Control and State Register */\r
+#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)\r
+  __IOM uint32_t VTOR;                   /*!< Offset: 0x008 (R/W)  Vector Table Offset Register */\r
+#else\r
+        uint32_t RESERVED0;\r
+#endif\r
+  __IOM uint32_t AIRCR;                  /*!< Offset: 0x00C (R/W)  Application Interrupt and Reset Control Register */\r
+  __IOM uint32_t SCR;                    /*!< Offset: 0x010 (R/W)  System Control Register */\r
+  __IOM uint32_t CCR;                    /*!< Offset: 0x014 (R/W)  Configuration Control Register */\r
+        uint32_t RESERVED1;\r
+  __IOM uint32_t SHPR[2U];               /*!< Offset: 0x01C (R/W)  System Handlers Priority Registers. [0] is RESERVED */\r
+  __IOM uint32_t SHCSR;                  /*!< Offset: 0x024 (R/W)  System Handler Control and State Register */\r
+} SCB_Type;\r
+\r
+/* SCB CPUID Register Definitions */\r
+#define SCB_CPUID_IMPLEMENTER_Pos          24U                                            /*!< SCB CPUID: IMPLEMENTER Position */\r
+#define SCB_CPUID_IMPLEMENTER_Msk          (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos)          /*!< SCB CPUID: IMPLEMENTER Mask */\r
+\r
+#define SCB_CPUID_VARIANT_Pos              20U                                            /*!< SCB CPUID: VARIANT Position */\r
+#define SCB_CPUID_VARIANT_Msk              (0xFUL << SCB_CPUID_VARIANT_Pos)               /*!< SCB CPUID: VARIANT Mask */\r
+\r
+#define SCB_CPUID_ARCHITECTURE_Pos         16U                                            /*!< SCB CPUID: ARCHITECTURE Position */\r
+#define SCB_CPUID_ARCHITECTURE_Msk         (0xFUL << SCB_CPUID_ARCHITECTURE_Pos)          /*!< SCB CPUID: ARCHITECTURE Mask */\r
+\r
+#define SCB_CPUID_PARTNO_Pos                4U                                            /*!< SCB CPUID: PARTNO Position */\r
+#define SCB_CPUID_PARTNO_Msk               (0xFFFUL << SCB_CPUID_PARTNO_Pos)              /*!< SCB CPUID: PARTNO Mask */\r
+\r
+#define SCB_CPUID_REVISION_Pos              0U                                            /*!< SCB CPUID: REVISION Position */\r
+#define SCB_CPUID_REVISION_Msk             (0xFUL /*<< SCB_CPUID_REVISION_Pos*/)          /*!< SCB CPUID: REVISION Mask */\r
+\r
+/* SCB Interrupt Control State Register Definitions */\r
+#define SCB_ICSR_PENDNMISET_Pos            31U                                            /*!< SCB ICSR: PENDNMISET Position */\r
+#define SCB_ICSR_PENDNMISET_Msk            (1UL << SCB_ICSR_PENDNMISET_Pos)               /*!< SCB ICSR: PENDNMISET Mask */\r
+\r
+#define SCB_ICSR_NMIPENDSET_Pos            SCB_ICSR_PENDNMISET_Pos                        /*!< SCB ICSR: NMIPENDSET Position, backward compatibility */\r
+#define SCB_ICSR_NMIPENDSET_Msk            SCB_ICSR_PENDNMISET_Msk                        /*!< SCB ICSR: NMIPENDSET Mask, backward compatibility */\r
+\r
+#define SCB_ICSR_PENDNMICLR_Pos            30U                                            /*!< SCB ICSR: PENDNMICLR Position */\r
+#define SCB_ICSR_PENDNMICLR_Msk            (1UL << SCB_ICSR_PENDNMICLR_Pos)               /*!< SCB ICSR: PENDNMICLR Mask */\r
+\r
+#define SCB_ICSR_PENDSVSET_Pos             28U                                            /*!< SCB ICSR: PENDSVSET Position */\r
+#define SCB_ICSR_PENDSVSET_Msk             (1UL << SCB_ICSR_PENDSVSET_Pos)                /*!< SCB ICSR: PENDSVSET Mask */\r
+\r
+#define SCB_ICSR_PENDSVCLR_Pos             27U                                            /*!< SCB ICSR: PENDSVCLR Position */\r
+#define SCB_ICSR_PENDSVCLR_Msk             (1UL << SCB_ICSR_PENDSVCLR_Pos)                /*!< SCB ICSR: PENDSVCLR Mask */\r
+\r
+#define SCB_ICSR_PENDSTSET_Pos             26U                                            /*!< SCB ICSR: PENDSTSET Position */\r
+#define SCB_ICSR_PENDSTSET_Msk             (1UL << SCB_ICSR_PENDSTSET_Pos)                /*!< SCB ICSR: PENDSTSET Mask */\r
+\r
+#define SCB_ICSR_PENDSTCLR_Pos             25U                                            /*!< SCB ICSR: PENDSTCLR Position */\r
+#define SCB_ICSR_PENDSTCLR_Msk             (1UL << SCB_ICSR_PENDSTCLR_Pos)                /*!< SCB ICSR: PENDSTCLR Mask */\r
+\r
+#define SCB_ICSR_STTNS_Pos                 24U                                            /*!< SCB ICSR: STTNS Position (Security Extension) */\r
+#define SCB_ICSR_STTNS_Msk                 (1UL << SCB_ICSR_STTNS_Pos)                    /*!< SCB ICSR: STTNS Mask (Security Extension) */\r
+\r
+#define SCB_ICSR_ISRPREEMPT_Pos            23U                                            /*!< SCB ICSR: ISRPREEMPT Position */\r
+#define SCB_ICSR_ISRPREEMPT_Msk            (1UL << SCB_ICSR_ISRPREEMPT_Pos)               /*!< SCB ICSR: ISRPREEMPT Mask */\r
+\r
+#define SCB_ICSR_ISRPENDING_Pos            22U                                            /*!< SCB ICSR: ISRPENDING Position */\r
+#define SCB_ICSR_ISRPENDING_Msk            (1UL << SCB_ICSR_ISRPENDING_Pos)               /*!< SCB ICSR: ISRPENDING Mask */\r
+\r
+#define SCB_ICSR_VECTPENDING_Pos           12U                                            /*!< SCB ICSR: VECTPENDING Position */\r
+#define SCB_ICSR_VECTPENDING_Msk           (0x1FFUL << SCB_ICSR_VECTPENDING_Pos)          /*!< SCB ICSR: VECTPENDING Mask */\r
+\r
+#define SCB_ICSR_RETTOBASE_Pos             11U                                            /*!< SCB ICSR: RETTOBASE Position */\r
+#define SCB_ICSR_RETTOBASE_Msk             (1UL << SCB_ICSR_RETTOBASE_Pos)                /*!< SCB ICSR: RETTOBASE Mask */\r
+\r
+#define SCB_ICSR_VECTACTIVE_Pos             0U                                            /*!< SCB ICSR: VECTACTIVE Position */\r
+#define SCB_ICSR_VECTACTIVE_Msk            (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/)       /*!< SCB ICSR: VECTACTIVE Mask */\r
+\r
+#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)\r
+/* SCB Vector Table Offset Register Definitions */\r
+#define SCB_VTOR_TBLOFF_Pos                 7U                                            /*!< SCB VTOR: TBLOFF Position */\r
+#define SCB_VTOR_TBLOFF_Msk                (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos)           /*!< SCB VTOR: TBLOFF Mask */\r
+#endif\r
+\r
+/* SCB Application Interrupt and Reset Control Register Definitions */\r
+#define SCB_AIRCR_VECTKEY_Pos              16U                                            /*!< SCB AIRCR: VECTKEY Position */\r
+#define SCB_AIRCR_VECTKEY_Msk              (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos)            /*!< SCB AIRCR: VECTKEY Mask */\r
+\r
+#define SCB_AIRCR_VECTKEYSTAT_Pos          16U                                            /*!< SCB AIRCR: VECTKEYSTAT Position */\r
+#define SCB_AIRCR_VECTKEYSTAT_Msk          (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos)        /*!< SCB AIRCR: VECTKEYSTAT Mask */\r
+\r
+#define SCB_AIRCR_ENDIANESS_Pos            15U                                            /*!< SCB AIRCR: ENDIANESS Position */\r
+#define SCB_AIRCR_ENDIANESS_Msk            (1UL << SCB_AIRCR_ENDIANESS_Pos)               /*!< SCB AIRCR: ENDIANESS Mask */\r
+\r
+#define SCB_AIRCR_PRIS_Pos                 14U                                            /*!< SCB AIRCR: PRIS Position */\r
+#define SCB_AIRCR_PRIS_Msk                 (1UL << SCB_AIRCR_PRIS_Pos)                    /*!< SCB AIRCR: PRIS Mask */\r
+\r
+#define SCB_AIRCR_BFHFNMINS_Pos            13U                                            /*!< SCB AIRCR: BFHFNMINS Position */\r
+#define SCB_AIRCR_BFHFNMINS_Msk            (1UL << SCB_AIRCR_BFHFNMINS_Pos)               /*!< SCB AIRCR: BFHFNMINS Mask */\r
+\r
+#define SCB_AIRCR_SYSRESETREQS_Pos          3U                                            /*!< SCB AIRCR: SYSRESETREQS Position */\r
+#define SCB_AIRCR_SYSRESETREQS_Msk         (1UL << SCB_AIRCR_SYSRESETREQS_Pos)            /*!< SCB AIRCR: SYSRESETREQS Mask */\r
+\r
+#define SCB_AIRCR_SYSRESETREQ_Pos           2U                                            /*!< SCB AIRCR: SYSRESETREQ Position */\r
+#define SCB_AIRCR_SYSRESETREQ_Msk          (1UL << SCB_AIRCR_SYSRESETREQ_Pos)             /*!< SCB AIRCR: SYSRESETREQ Mask */\r
+\r
+#define SCB_AIRCR_VECTCLRACTIVE_Pos         1U                                            /*!< SCB AIRCR: VECTCLRACTIVE Position */\r
+#define SCB_AIRCR_VECTCLRACTIVE_Msk        (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos)           /*!< SCB AIRCR: VECTCLRACTIVE Mask */\r
+\r
+/* SCB System Control Register Definitions */\r
+#define SCB_SCR_SEVONPEND_Pos               4U                                            /*!< SCB SCR: SEVONPEND Position */\r
+#define SCB_SCR_SEVONPEND_Msk              (1UL << SCB_SCR_SEVONPEND_Pos)                 /*!< SCB SCR: SEVONPEND Mask */\r
+\r
+#define SCB_SCR_SLEEPDEEPS_Pos              3U                                            /*!< SCB SCR: SLEEPDEEPS Position */\r
+#define SCB_SCR_SLEEPDEEPS_Msk             (1UL << SCB_SCR_SLEEPDEEPS_Pos)                /*!< SCB SCR: SLEEPDEEPS Mask */\r
+\r
+#define SCB_SCR_SLEEPDEEP_Pos               2U                                            /*!< SCB SCR: SLEEPDEEP Position */\r
+#define SCB_SCR_SLEEPDEEP_Msk              (1UL << SCB_SCR_SLEEPDEEP_Pos)                 /*!< SCB SCR: SLEEPDEEP Mask */\r
+\r
+#define SCB_SCR_SLEEPONEXIT_Pos             1U                                            /*!< SCB SCR: SLEEPONEXIT Position */\r
+#define SCB_SCR_SLEEPONEXIT_Msk            (1UL << SCB_SCR_SLEEPONEXIT_Pos)               /*!< SCB SCR: SLEEPONEXIT Mask */\r
+\r
+/* SCB Configuration Control Register Definitions */\r
+#define SCB_CCR_BP_Pos                     18U                                            /*!< SCB CCR: BP Position */\r
+#define SCB_CCR_BP_Msk                     (1UL << SCB_CCR_BP_Pos)                        /*!< SCB CCR: BP Mask */\r
+\r
+#define SCB_CCR_IC_Pos                     17U                                            /*!< SCB CCR: IC Position */\r
+#define SCB_CCR_IC_Msk                     (1UL << SCB_CCR_IC_Pos)                        /*!< SCB CCR: IC Mask */\r
+\r
+#define SCB_CCR_DC_Pos                     16U                                            /*!< SCB CCR: DC Position */\r
+#define SCB_CCR_DC_Msk                     (1UL << SCB_CCR_DC_Pos)                        /*!< SCB CCR: DC Mask */\r
+\r
+#define SCB_CCR_STKOFHFNMIGN_Pos           10U                                            /*!< SCB CCR: STKOFHFNMIGN Position */\r
+#define SCB_CCR_STKOFHFNMIGN_Msk           (1UL << SCB_CCR_STKOFHFNMIGN_Pos)              /*!< SCB CCR: STKOFHFNMIGN Mask */\r
+\r
+#define SCB_CCR_BFHFNMIGN_Pos               8U                                            /*!< SCB CCR: BFHFNMIGN Position */\r
+#define SCB_CCR_BFHFNMIGN_Msk              (1UL << SCB_CCR_BFHFNMIGN_Pos)                 /*!< SCB CCR: BFHFNMIGN Mask */\r
+\r
+#define SCB_CCR_DIV_0_TRP_Pos               4U                                            /*!< SCB CCR: DIV_0_TRP Position */\r
+#define SCB_CCR_DIV_0_TRP_Msk              (1UL << SCB_CCR_DIV_0_TRP_Pos)                 /*!< SCB CCR: DIV_0_TRP Mask */\r
+\r
+#define SCB_CCR_UNALIGN_TRP_Pos             3U                                            /*!< SCB CCR: UNALIGN_TRP Position */\r
+#define SCB_CCR_UNALIGN_TRP_Msk            (1UL << SCB_CCR_UNALIGN_TRP_Pos)               /*!< SCB CCR: UNALIGN_TRP Mask */\r
+\r
+#define SCB_CCR_USERSETMPEND_Pos            1U                                            /*!< SCB CCR: USERSETMPEND Position */\r
+#define SCB_CCR_USERSETMPEND_Msk           (1UL << SCB_CCR_USERSETMPEND_Pos)              /*!< SCB CCR: USERSETMPEND Mask */\r
+\r
+/* SCB System Handler Control and State Register Definitions */\r
+#define SCB_SHCSR_HARDFAULTPENDED_Pos      21U                                            /*!< SCB SHCSR: HARDFAULTPENDED Position */\r
+#define SCB_SHCSR_HARDFAULTPENDED_Msk      (1UL << SCB_SHCSR_HARDFAULTPENDED_Pos)         /*!< SCB SHCSR: HARDFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_SVCALLPENDED_Pos         15U                                            /*!< SCB SHCSR: SVCALLPENDED Position */\r
+#define SCB_SHCSR_SVCALLPENDED_Msk         (1UL << SCB_SHCSR_SVCALLPENDED_Pos)            /*!< SCB SHCSR: SVCALLPENDED Mask */\r
+\r
+#define SCB_SHCSR_SYSTICKACT_Pos           11U                                            /*!< SCB SHCSR: SYSTICKACT Position */\r
+#define SCB_SHCSR_SYSTICKACT_Msk           (1UL << SCB_SHCSR_SYSTICKACT_Pos)              /*!< SCB SHCSR: SYSTICKACT Mask */\r
+\r
+#define SCB_SHCSR_PENDSVACT_Pos            10U                                            /*!< SCB SHCSR: PENDSVACT Position */\r
+#define SCB_SHCSR_PENDSVACT_Msk            (1UL << SCB_SHCSR_PENDSVACT_Pos)               /*!< SCB SHCSR: PENDSVACT Mask */\r
+\r
+#define SCB_SHCSR_SVCALLACT_Pos             7U                                            /*!< SCB SHCSR: SVCALLACT Position */\r
+#define SCB_SHCSR_SVCALLACT_Msk            (1UL << SCB_SHCSR_SVCALLACT_Pos)               /*!< SCB SHCSR: SVCALLACT Mask */\r
+\r
+#define SCB_SHCSR_NMIACT_Pos                5U                                            /*!< SCB SHCSR: NMIACT Position */\r
+#define SCB_SHCSR_NMIACT_Msk               (1UL << SCB_SHCSR_NMIACT_Pos)                  /*!< SCB SHCSR: NMIACT Mask */\r
+\r
+#define SCB_SHCSR_HARDFAULTACT_Pos          2U                                            /*!< SCB SHCSR: HARDFAULTACT Position */\r
+#define SCB_SHCSR_HARDFAULTACT_Msk         (1UL << SCB_SHCSR_HARDFAULTACT_Pos)            /*!< SCB SHCSR: HARDFAULTACT Mask */\r
+\r
+/*@} end of group CMSIS_SCB */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SysTick     System Tick Timer (SysTick)\r
+  \brief    Type definitions for the System Timer Registers.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Timer (SysTick).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  SysTick Control and Status Register */\r
+  __IOM uint32_t LOAD;                   /*!< Offset: 0x004 (R/W)  SysTick Reload Value Register */\r
+  __IOM uint32_t VAL;                    /*!< Offset: 0x008 (R/W)  SysTick Current Value Register */\r
+  __IM  uint32_t CALIB;                  /*!< Offset: 0x00C (R/ )  SysTick Calibration Register */\r
+} SysTick_Type;\r
+\r
+/* SysTick Control / Status Register Definitions */\r
+#define SysTick_CTRL_COUNTFLAG_Pos         16U                                            /*!< SysTick CTRL: COUNTFLAG Position */\r
+#define SysTick_CTRL_COUNTFLAG_Msk         (1UL << SysTick_CTRL_COUNTFLAG_Pos)            /*!< SysTick CTRL: COUNTFLAG Mask */\r
+\r
+#define SysTick_CTRL_CLKSOURCE_Pos          2U                                            /*!< SysTick CTRL: CLKSOURCE Position */\r
+#define SysTick_CTRL_CLKSOURCE_Msk         (1UL << SysTick_CTRL_CLKSOURCE_Pos)            /*!< SysTick CTRL: CLKSOURCE Mask */\r
+\r
+#define SysTick_CTRL_TICKINT_Pos            1U                                            /*!< SysTick CTRL: TICKINT Position */\r
+#define SysTick_CTRL_TICKINT_Msk           (1UL << SysTick_CTRL_TICKINT_Pos)              /*!< SysTick CTRL: TICKINT Mask */\r
+\r
+#define SysTick_CTRL_ENABLE_Pos             0U                                            /*!< SysTick CTRL: ENABLE Position */\r
+#define SysTick_CTRL_ENABLE_Msk            (1UL /*<< SysTick_CTRL_ENABLE_Pos*/)           /*!< SysTick CTRL: ENABLE Mask */\r
+\r
+/* SysTick Reload Register Definitions */\r
+#define SysTick_LOAD_RELOAD_Pos             0U                                            /*!< SysTick LOAD: RELOAD Position */\r
+#define SysTick_LOAD_RELOAD_Msk            (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/)    /*!< SysTick LOAD: RELOAD Mask */\r
+\r
+/* SysTick Current Register Definitions */\r
+#define SysTick_VAL_CURRENT_Pos             0U                                            /*!< SysTick VAL: CURRENT Position */\r
+#define SysTick_VAL_CURRENT_Msk            (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/)    /*!< SysTick VAL: CURRENT Mask */\r
+\r
+/* SysTick Calibration Register Definitions */\r
+#define SysTick_CALIB_NOREF_Pos            31U                                            /*!< SysTick CALIB: NOREF Position */\r
+#define SysTick_CALIB_NOREF_Msk            (1UL << SysTick_CALIB_NOREF_Pos)               /*!< SysTick CALIB: NOREF Mask */\r
+\r
+#define SysTick_CALIB_SKEW_Pos             30U                                            /*!< SysTick CALIB: SKEW Position */\r
+#define SysTick_CALIB_SKEW_Msk             (1UL << SysTick_CALIB_SKEW_Pos)                /*!< SysTick CALIB: SKEW Mask */\r
+\r
+#define SysTick_CALIB_TENMS_Pos             0U                                            /*!< SysTick CALIB: TENMS Position */\r
+#define SysTick_CALIB_TENMS_Msk            (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/)    /*!< SysTick CALIB: TENMS Mask */\r
+\r
+/*@} end of group CMSIS_SysTick */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_DWT     Data Watchpoint and Trace (DWT)\r
+  \brief    Type definitions for the Data Watchpoint and Trace (DWT)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Data Watchpoint and Trace Register (DWT).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  Control Register */\r
+        uint32_t RESERVED0[6U];\r
+  __IM  uint32_t PCSR;                   /*!< Offset: 0x01C (R/ )  Program Counter Sample Register */\r
+  __IOM uint32_t COMP0;                  /*!< Offset: 0x020 (R/W)  Comparator Register 0 */\r
+        uint32_t RESERVED1[1U];\r
+  __IOM uint32_t FUNCTION0;              /*!< Offset: 0x028 (R/W)  Function Register 0 */\r
+        uint32_t RESERVED2[1U];\r
+  __IOM uint32_t COMP1;                  /*!< Offset: 0x030 (R/W)  Comparator Register 1 */\r
+        uint32_t RESERVED3[1U];\r
+  __IOM uint32_t FUNCTION1;              /*!< Offset: 0x038 (R/W)  Function Register 1 */\r
+        uint32_t RESERVED4[1U];\r
+  __IOM uint32_t COMP2;                  /*!< Offset: 0x040 (R/W)  Comparator Register 2 */\r
+        uint32_t RESERVED5[1U];\r
+  __IOM uint32_t FUNCTION2;              /*!< Offset: 0x048 (R/W)  Function Register 2 */\r
+        uint32_t RESERVED6[1U];\r
+  __IOM uint32_t COMP3;                  /*!< Offset: 0x050 (R/W)  Comparator Register 3 */\r
+        uint32_t RESERVED7[1U];\r
+  __IOM uint32_t FUNCTION3;              /*!< Offset: 0x058 (R/W)  Function Register 3 */\r
+        uint32_t RESERVED8[1U];\r
+  __IOM uint32_t COMP4;                  /*!< Offset: 0x060 (R/W)  Comparator Register 4 */\r
+        uint32_t RESERVED9[1U];\r
+  __IOM uint32_t FUNCTION4;              /*!< Offset: 0x068 (R/W)  Function Register 4 */\r
+        uint32_t RESERVED10[1U];\r
+  __IOM uint32_t COMP5;                  /*!< Offset: 0x070 (R/W)  Comparator Register 5 */\r
+        uint32_t RESERVED11[1U];\r
+  __IOM uint32_t FUNCTION5;              /*!< Offset: 0x078 (R/W)  Function Register 5 */\r
+        uint32_t RESERVED12[1U];\r
+  __IOM uint32_t COMP6;                  /*!< Offset: 0x080 (R/W)  Comparator Register 6 */\r
+        uint32_t RESERVED13[1U];\r
+  __IOM uint32_t FUNCTION6;              /*!< Offset: 0x088 (R/W)  Function Register 6 */\r
+        uint32_t RESERVED14[1U];\r
+  __IOM uint32_t COMP7;                  /*!< Offset: 0x090 (R/W)  Comparator Register 7 */\r
+        uint32_t RESERVED15[1U];\r
+  __IOM uint32_t FUNCTION7;              /*!< Offset: 0x098 (R/W)  Function Register 7 */\r
+        uint32_t RESERVED16[1U];\r
+  __IOM uint32_t COMP8;                  /*!< Offset: 0x0A0 (R/W)  Comparator Register 8 */\r
+        uint32_t RESERVED17[1U];\r
+  __IOM uint32_t FUNCTION8;              /*!< Offset: 0x0A8 (R/W)  Function Register 8 */\r
+        uint32_t RESERVED18[1U];\r
+  __IOM uint32_t COMP9;                  /*!< Offset: 0x0B0 (R/W)  Comparator Register 9 */\r
+        uint32_t RESERVED19[1U];\r
+  __IOM uint32_t FUNCTION9;              /*!< Offset: 0x0B8 (R/W)  Function Register 9 */\r
+        uint32_t RESERVED20[1U];\r
+  __IOM uint32_t COMP10;                 /*!< Offset: 0x0C0 (R/W)  Comparator Register 10 */\r
+        uint32_t RESERVED21[1U];\r
+  __IOM uint32_t FUNCTION10;             /*!< Offset: 0x0C8 (R/W)  Function Register 10 */\r
+        uint32_t RESERVED22[1U];\r
+  __IOM uint32_t COMP11;                 /*!< Offset: 0x0D0 (R/W)  Comparator Register 11 */\r
+        uint32_t RESERVED23[1U];\r
+  __IOM uint32_t FUNCTION11;             /*!< Offset: 0x0D8 (R/W)  Function Register 11 */\r
+        uint32_t RESERVED24[1U];\r
+  __IOM uint32_t COMP12;                 /*!< Offset: 0x0E0 (R/W)  Comparator Register 12 */\r
+        uint32_t RESERVED25[1U];\r
+  __IOM uint32_t FUNCTION12;             /*!< Offset: 0x0E8 (R/W)  Function Register 12 */\r
+        uint32_t RESERVED26[1U];\r
+  __IOM uint32_t COMP13;                 /*!< Offset: 0x0F0 (R/W)  Comparator Register 13 */\r
+        uint32_t RESERVED27[1U];\r
+  __IOM uint32_t FUNCTION13;             /*!< Offset: 0x0F8 (R/W)  Function Register 13 */\r
+        uint32_t RESERVED28[1U];\r
+  __IOM uint32_t COMP14;                 /*!< Offset: 0x100 (R/W)  Comparator Register 14 */\r
+        uint32_t RESERVED29[1U];\r
+  __IOM uint32_t FUNCTION14;             /*!< Offset: 0x108 (R/W)  Function Register 14 */\r
+        uint32_t RESERVED30[1U];\r
+  __IOM uint32_t COMP15;                 /*!< Offset: 0x110 (R/W)  Comparator Register 15 */\r
+        uint32_t RESERVED31[1U];\r
+  __IOM uint32_t FUNCTION15;             /*!< Offset: 0x118 (R/W)  Function Register 15 */\r
+} DWT_Type;\r
+\r
+/* DWT Control Register Definitions */\r
+#define DWT_CTRL_NUMCOMP_Pos               28U                                         /*!< DWT CTRL: NUMCOMP Position */\r
+#define DWT_CTRL_NUMCOMP_Msk               (0xFUL << DWT_CTRL_NUMCOMP_Pos)             /*!< DWT CTRL: NUMCOMP Mask */\r
+\r
+#define DWT_CTRL_NOTRCPKT_Pos              27U                                         /*!< DWT CTRL: NOTRCPKT Position */\r
+#define DWT_CTRL_NOTRCPKT_Msk              (0x1UL << DWT_CTRL_NOTRCPKT_Pos)            /*!< DWT CTRL: NOTRCPKT Mask */\r
+\r
+#define DWT_CTRL_NOEXTTRIG_Pos             26U                                         /*!< DWT CTRL: NOEXTTRIG Position */\r
+#define DWT_CTRL_NOEXTTRIG_Msk             (0x1UL << DWT_CTRL_NOEXTTRIG_Pos)           /*!< DWT CTRL: NOEXTTRIG Mask */\r
+\r
+#define DWT_CTRL_NOCYCCNT_Pos              25U                                         /*!< DWT CTRL: NOCYCCNT Position */\r
+#define DWT_CTRL_NOCYCCNT_Msk              (0x1UL << DWT_CTRL_NOCYCCNT_Pos)            /*!< DWT CTRL: NOCYCCNT Mask */\r
+\r
+#define DWT_CTRL_NOPRFCNT_Pos              24U                                         /*!< DWT CTRL: NOPRFCNT Position */\r
+#define DWT_CTRL_NOPRFCNT_Msk              (0x1UL << DWT_CTRL_NOPRFCNT_Pos)            /*!< DWT CTRL: NOPRFCNT Mask */\r
+\r
+/* DWT Comparator Function Register Definitions */\r
+#define DWT_FUNCTION_ID_Pos                27U                                         /*!< DWT FUNCTION: ID Position */\r
+#define DWT_FUNCTION_ID_Msk                (0x1FUL << DWT_FUNCTION_ID_Pos)             /*!< DWT FUNCTION: ID Mask */\r
+\r
+#define DWT_FUNCTION_MATCHED_Pos           24U                                         /*!< DWT FUNCTION: MATCHED Position */\r
+#define DWT_FUNCTION_MATCHED_Msk           (0x1UL << DWT_FUNCTION_MATCHED_Pos)         /*!< DWT FUNCTION: MATCHED Mask */\r
+\r
+#define DWT_FUNCTION_DATAVSIZE_Pos         10U                                         /*!< DWT FUNCTION: DATAVSIZE Position */\r
+#define DWT_FUNCTION_DATAVSIZE_Msk         (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos)       /*!< DWT FUNCTION: DATAVSIZE Mask */\r
+\r
+#define DWT_FUNCTION_ACTION_Pos             4U                                         /*!< DWT FUNCTION: ACTION Position */\r
+#define DWT_FUNCTION_ACTION_Msk            (0x3UL << DWT_FUNCTION_ACTION_Pos)          /*!< DWT FUNCTION: ACTION Mask */\r
+\r
+#define DWT_FUNCTION_MATCH_Pos              0U                                         /*!< DWT FUNCTION: MATCH Position */\r
+#define DWT_FUNCTION_MATCH_Msk             (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/)       /*!< DWT FUNCTION: MATCH Mask */\r
+\r
+/*@}*/ /* end of group CMSIS_DWT */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_TPI     Trace Port Interface (TPI)\r
+  \brief    Type definitions for the Trace Port Interface (TPI)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Trace Port Interface Register (TPI).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t SSPSR;                  /*!< Offset: 0x000 (R/ )  Supported Parallel Port Sizes Register */\r
+  __IOM uint32_t CSPSR;                  /*!< Offset: 0x004 (R/W)  Current Parallel Port Sizes Register */\r
+        uint32_t RESERVED0[2U];\r
+  __IOM uint32_t ACPR;                   /*!< Offset: 0x010 (R/W)  Asynchronous Clock Prescaler Register */\r
+        uint32_t RESERVED1[55U];\r
+  __IOM uint32_t SPPR;                   /*!< Offset: 0x0F0 (R/W)  Selected Pin Protocol Register */\r
+        uint32_t RESERVED2[131U];\r
+  __IM  uint32_t FFSR;                   /*!< Offset: 0x300 (R/ )  Formatter and Flush Status Register */\r
+  __IOM uint32_t FFCR;                   /*!< Offset: 0x304 (R/W)  Formatter and Flush Control Register */\r
+  __IOM uint32_t PSCR;                   /*!< Offset: 0x308 (R/W)  Periodic Synchronization Control Register */\r
+        uint32_t RESERVED3[809U];\r
+  __OM  uint32_t LAR;                    /*!< Offset: 0xFB0 ( /W)  Software Lock Access Register */\r
+  __IM  uint32_t LSR;                    /*!< Offset: 0xFB4 (R/ )  Software Lock Status Register */\r
+        uint32_t RESERVED4[4U];\r
+  __IM  uint32_t TYPE;                   /*!< Offset: 0xFC8 (R/ )  Device Identifier Register */\r
+  __IM  uint32_t DEVTYPE;                /*!< Offset: 0xFCC (R/ )  Device Type Register */\r
+} TPI_Type;\r
+\r
+/* TPI Asynchronous Clock Prescaler Register Definitions */\r
+#define TPI_ACPR_SWOSCALER_Pos              0U                                         /*!< TPI ACPR: SWOSCALER Position */\r
+#define TPI_ACPR_SWOSCALER_Msk             (0xFFFFUL /*<< TPI_ACPR_SWOSCALER_Pos*/)    /*!< TPI ACPR: SWOSCALER Mask */\r
+\r
+/* TPI Selected Pin Protocol Register Definitions */\r
+#define TPI_SPPR_TXMODE_Pos                 0U                                         /*!< TPI SPPR: TXMODE Position */\r
+#define TPI_SPPR_TXMODE_Msk                (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/)          /*!< TPI SPPR: TXMODE Mask */\r
+\r
+/* TPI Formatter and Flush Status Register Definitions */\r
+#define TPI_FFSR_FtNonStop_Pos              3U                                         /*!< TPI FFSR: FtNonStop Position */\r
+#define TPI_FFSR_FtNonStop_Msk             (0x1UL << TPI_FFSR_FtNonStop_Pos)           /*!< TPI FFSR: FtNonStop Mask */\r
+\r
+#define TPI_FFSR_TCPresent_Pos              2U                                         /*!< TPI FFSR: TCPresent Position */\r
+#define TPI_FFSR_TCPresent_Msk             (0x1UL << TPI_FFSR_TCPresent_Pos)           /*!< TPI FFSR: TCPresent Mask */\r
+\r
+#define TPI_FFSR_FtStopped_Pos              1U                                         /*!< TPI FFSR: FtStopped Position */\r
+#define TPI_FFSR_FtStopped_Msk             (0x1UL << TPI_FFSR_FtStopped_Pos)           /*!< TPI FFSR: FtStopped Mask */\r
+\r
+#define TPI_FFSR_FlInProg_Pos               0U                                         /*!< TPI FFSR: FlInProg Position */\r
+#define TPI_FFSR_FlInProg_Msk              (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/)        /*!< TPI FFSR: FlInProg Mask */\r
+\r
+/* TPI Formatter and Flush Control Register Definitions */\r
+#define TPI_FFCR_TrigIn_Pos                 8U                                         /*!< TPI FFCR: TrigIn Position */\r
+#define TPI_FFCR_TrigIn_Msk                (0x1UL << TPI_FFCR_TrigIn_Pos)              /*!< TPI FFCR: TrigIn Mask */\r
+\r
+#define TPI_FFCR_FOnMan_Pos                 6U                                         /*!< TPI FFCR: FOnMan Position */\r
+#define TPI_FFCR_FOnMan_Msk                (0x1UL << TPI_FFCR_FOnMan_Pos)              /*!< TPI FFCR: FOnMan Mask */\r
+\r
+#define TPI_FFCR_EnFCont_Pos                1U                                         /*!< TPI FFCR: EnFCont Position */\r
+#define TPI_FFCR_EnFCont_Msk               (0x1UL << TPI_FFCR_EnFCont_Pos)             /*!< TPI FFCR: EnFCont Mask */\r
+\r
+/* TPI Periodic Synchronization Control Register Definitions */\r
+#define TPI_PSCR_PSCount_Pos                0U                                         /*!< TPI PSCR: PSCount Position */\r
+#define TPI_PSCR_PSCount_Msk               (0x1FUL /*<< TPI_PSCR_PSCount_Pos*/)        /*!< TPI PSCR: TPSCount Mask */\r
+\r
+/* TPI Software Lock Status Register Definitions */\r
+#define TPI_LSR_nTT_Pos                     1U                                         /*!< TPI LSR: Not thirty-two bit. Position */\r
+#define TPI_LSR_nTT_Msk                    (0x1UL << TPI_LSR_nTT_Pos)                  /*!< TPI LSR: Not thirty-two bit. Mask */\r
+\r
+#define TPI_LSR_SLK_Pos                     1U                                         /*!< TPI LSR: Software Lock status Position */\r
+#define TPI_LSR_SLK_Msk                    (0x1UL << TPI_LSR_SLK_Pos)                  /*!< TPI LSR: Software Lock status Mask */\r
+\r
+#define TPI_LSR_SLI_Pos                     0U                                         /*!< TPI LSR: Software Lock implemented Position */\r
+#define TPI_LSR_SLI_Msk                    (0x1UL /*<< TPI_LSR_SLI_Pos*/)              /*!< TPI LSR: Software Lock implemented Mask */\r
+\r
+/* TPI DEVID Register Definitions */\r
+#define TPI_DEVID_NRZVALID_Pos             11U                                         /*!< TPI DEVID: NRZVALID Position */\r
+#define TPI_DEVID_NRZVALID_Msk             (0x1UL << TPI_DEVID_NRZVALID_Pos)           /*!< TPI DEVID: NRZVALID Mask */\r
+\r
+#define TPI_DEVID_MANCVALID_Pos            10U                                         /*!< TPI DEVID: MANCVALID Position */\r
+#define TPI_DEVID_MANCVALID_Msk            (0x1UL << TPI_DEVID_MANCVALID_Pos)          /*!< TPI DEVID: MANCVALID Mask */\r
+\r
+#define TPI_DEVID_PTINVALID_Pos             9U                                         /*!< TPI DEVID: PTINVALID Position */\r
+#define TPI_DEVID_PTINVALID_Msk            (0x1UL << TPI_DEVID_PTINVALID_Pos)          /*!< TPI DEVID: PTINVALID Mask */\r
+\r
+#define TPI_DEVID_FIFOSZ_Pos                6U                                         /*!< TPI DEVID: FIFO depth Position */\r
+#define TPI_DEVID_FIFOSZ_Msk               (0x7UL << TPI_DEVID_FIFOSZ_Pos)             /*!< TPI DEVID: FIFO depth Mask */\r
+\r
+/* TPI DEVTYPE Register Definitions */\r
+#define TPI_DEVTYPE_SubType_Pos             4U                                         /*!< TPI DEVTYPE: SubType Position */\r
+#define TPI_DEVTYPE_SubType_Msk            (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/)      /*!< TPI DEVTYPE: SubType Mask */\r
+\r
+#define TPI_DEVTYPE_MajorType_Pos           0U                                         /*!< TPI DEVTYPE: MajorType Position */\r
+#define TPI_DEVTYPE_MajorType_Msk          (0xFUL << TPI_DEVTYPE_MajorType_Pos)        /*!< TPI DEVTYPE: MajorType Mask */\r
+\r
+/*@}*/ /* end of group CMSIS_TPI */\r
+\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_MPU     Memory Protection Unit (MPU)\r
+  \brief    Type definitions for the Memory Protection Unit (MPU)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Memory Protection Unit (MPU).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t TYPE;                   /*!< Offset: 0x000 (R/ )  MPU Type Register */\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x004 (R/W)  MPU Control Register */\r
+  __IOM uint32_t RNR;                    /*!< Offset: 0x008 (R/W)  MPU Region Number Register */\r
+  __IOM uint32_t RBAR;                   /*!< Offset: 0x00C (R/W)  MPU Region Base Address Register */\r
+  __IOM uint32_t RLAR;                   /*!< Offset: 0x010 (R/W)  MPU Region Limit Address Register */\r
+        uint32_t RESERVED0[7U];\r
+  union {\r
+  __IOM uint32_t MAIR[2];\r
+  struct {\r
+  __IOM uint32_t MAIR0;                  /*!< Offset: 0x030 (R/W)  MPU Memory Attribute Indirection Register 0 */\r
+  __IOM uint32_t MAIR1;                  /*!< Offset: 0x034 (R/W)  MPU Memory Attribute Indirection Register 1 */\r
+  };\r
+  };\r
+} MPU_Type;\r
+\r
+#define MPU_TYPE_RALIASES                  1U\r
+\r
+/* MPU Type Register Definitions */\r
+#define MPU_TYPE_IREGION_Pos               16U                                            /*!< MPU TYPE: IREGION Position */\r
+#define MPU_TYPE_IREGION_Msk               (0xFFUL << MPU_TYPE_IREGION_Pos)               /*!< MPU TYPE: IREGION Mask */\r
+\r
+#define MPU_TYPE_DREGION_Pos                8U                                            /*!< MPU TYPE: DREGION Position */\r
+#define MPU_TYPE_DREGION_Msk               (0xFFUL << MPU_TYPE_DREGION_Pos)               /*!< MPU TYPE: DREGION Mask */\r
+\r
+#define MPU_TYPE_SEPARATE_Pos               0U                                            /*!< MPU TYPE: SEPARATE Position */\r
+#define MPU_TYPE_SEPARATE_Msk              (1UL /*<< MPU_TYPE_SEPARATE_Pos*/)             /*!< MPU TYPE: SEPARATE Mask */\r
+\r
+/* MPU Control Register Definitions */\r
+#define MPU_CTRL_PRIVDEFENA_Pos             2U                                            /*!< MPU CTRL: PRIVDEFENA Position */\r
+#define MPU_CTRL_PRIVDEFENA_Msk            (1UL << MPU_CTRL_PRIVDEFENA_Pos)               /*!< MPU CTRL: PRIVDEFENA Mask */\r
+\r
+#define MPU_CTRL_HFNMIENA_Pos               1U                                            /*!< MPU CTRL: HFNMIENA Position */\r
+#define MPU_CTRL_HFNMIENA_Msk              (1UL << MPU_CTRL_HFNMIENA_Pos)                 /*!< MPU CTRL: HFNMIENA Mask */\r
+\r
+#define MPU_CTRL_ENABLE_Pos                 0U                                            /*!< MPU CTRL: ENABLE Position */\r
+#define MPU_CTRL_ENABLE_Msk                (1UL /*<< MPU_CTRL_ENABLE_Pos*/)               /*!< MPU CTRL: ENABLE Mask */\r
+\r
+/* MPU Region Number Register Definitions */\r
+#define MPU_RNR_REGION_Pos                  0U                                            /*!< MPU RNR: REGION Position */\r
+#define MPU_RNR_REGION_Msk                 (0xFFUL /*<< MPU_RNR_REGION_Pos*/)             /*!< MPU RNR: REGION Mask */\r
+\r
+/* MPU Region Base Address Register Definitions */\r
+#define MPU_RBAR_BASE_Pos                   5U                                            /*!< MPU RBAR: BASE Position */\r
+#define MPU_RBAR_BASE_Msk                  (0x7FFFFFFUL << MPU_RBAR_BASE_Pos)             /*!< MPU RBAR: BASE Mask */\r
+\r
+#define MPU_RBAR_SH_Pos                     3U                                            /*!< MPU RBAR: SH Position */\r
+#define MPU_RBAR_SH_Msk                    (0x3UL << MPU_RBAR_SH_Pos)                     /*!< MPU RBAR: SH Mask */\r
+\r
+#define MPU_RBAR_AP_Pos                     1U                                            /*!< MPU RBAR: AP Position */\r
+#define MPU_RBAR_AP_Msk                    (0x3UL << MPU_RBAR_AP_Pos)                     /*!< MPU RBAR: AP Mask */\r
+\r
+#define MPU_RBAR_XN_Pos                     0U                                            /*!< MPU RBAR: XN Position */\r
+#define MPU_RBAR_XN_Msk                    (01UL /*<< MPU_RBAR_XN_Pos*/)                  /*!< MPU RBAR: XN Mask */\r
+\r
+/* MPU Region Limit Address Register Definitions */\r
+#define MPU_RLAR_LIMIT_Pos                  5U                                            /*!< MPU RLAR: LIMIT Position */\r
+#define MPU_RLAR_LIMIT_Msk                 (0x7FFFFFFUL << MPU_RLAR_LIMIT_Pos)            /*!< MPU RLAR: LIMIT Mask */\r
+\r
+#define MPU_RLAR_AttrIndx_Pos               1U                                            /*!< MPU RLAR: AttrIndx Position */\r
+#define MPU_RLAR_AttrIndx_Msk              (0x7UL << MPU_RLAR_AttrIndx_Pos)               /*!< MPU RLAR: AttrIndx Mask */\r
+\r
+#define MPU_RLAR_EN_Pos                     0U                                            /*!< MPU RLAR: EN Position */\r
+#define MPU_RLAR_EN_Msk                    (1UL /*<< MPU_RLAR_EN_Pos*/)                   /*!< MPU RLAR: EN Mask */\r
+\r
+/* MPU Memory Attribute Indirection Register 0 Definitions */\r
+#define MPU_MAIR0_Attr3_Pos                24U                                            /*!< MPU MAIR0: Attr3 Position */\r
+#define MPU_MAIR0_Attr3_Msk                (0xFFUL << MPU_MAIR0_Attr3_Pos)                /*!< MPU MAIR0: Attr3 Mask */\r
+\r
+#define MPU_MAIR0_Attr2_Pos                16U                                            /*!< MPU MAIR0: Attr2 Position */\r
+#define MPU_MAIR0_Attr2_Msk                (0xFFUL << MPU_MAIR0_Attr2_Pos)                /*!< MPU MAIR0: Attr2 Mask */\r
+\r
+#define MPU_MAIR0_Attr1_Pos                 8U                                            /*!< MPU MAIR0: Attr1 Position */\r
+#define MPU_MAIR0_Attr1_Msk                (0xFFUL << MPU_MAIR0_Attr1_Pos)                /*!< MPU MAIR0: Attr1 Mask */\r
+\r
+#define MPU_MAIR0_Attr0_Pos                 0U                                            /*!< MPU MAIR0: Attr0 Position */\r
+#define MPU_MAIR0_Attr0_Msk                (0xFFUL /*<< MPU_MAIR0_Attr0_Pos*/)            /*!< MPU MAIR0: Attr0 Mask */\r
+\r
+/* MPU Memory Attribute Indirection Register 1 Definitions */\r
+#define MPU_MAIR1_Attr7_Pos                24U                                            /*!< MPU MAIR1: Attr7 Position */\r
+#define MPU_MAIR1_Attr7_Msk                (0xFFUL << MPU_MAIR1_Attr7_Pos)                /*!< MPU MAIR1: Attr7 Mask */\r
+\r
+#define MPU_MAIR1_Attr6_Pos                16U                                            /*!< MPU MAIR1: Attr6 Position */\r
+#define MPU_MAIR1_Attr6_Msk                (0xFFUL << MPU_MAIR1_Attr6_Pos)                /*!< MPU MAIR1: Attr6 Mask */\r
+\r
+#define MPU_MAIR1_Attr5_Pos                 8U                                            /*!< MPU MAIR1: Attr5 Position */\r
+#define MPU_MAIR1_Attr5_Msk                (0xFFUL << MPU_MAIR1_Attr5_Pos)                /*!< MPU MAIR1: Attr5 Mask */\r
+\r
+#define MPU_MAIR1_Attr4_Pos                 0U                                            /*!< MPU MAIR1: Attr4 Position */\r
+#define MPU_MAIR1_Attr4_Msk                (0xFFUL /*<< MPU_MAIR1_Attr4_Pos*/)            /*!< MPU MAIR1: Attr4 Mask */\r
+\r
+/*@} end of group CMSIS_MPU */\r
+#endif\r
+\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SAU     Security Attribution Unit (SAU)\r
+  \brief    Type definitions for the Security Attribution Unit (SAU)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Security Attribution Unit (SAU).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  SAU Control Register */\r
+  __IM  uint32_t TYPE;                   /*!< Offset: 0x004 (R/ )  SAU Type Register */\r
+#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U)\r
+  __IOM uint32_t RNR;                    /*!< Offset: 0x008 (R/W)  SAU Region Number Register */\r
+  __IOM uint32_t RBAR;                   /*!< Offset: 0x00C (R/W)  SAU Region Base Address Register */\r
+  __IOM uint32_t RLAR;                   /*!< Offset: 0x010 (R/W)  SAU Region Limit Address Register */\r
+#endif\r
+} SAU_Type;\r
+\r
+/* SAU Control Register Definitions */\r
+#define SAU_CTRL_ALLNS_Pos                  1U                                            /*!< SAU CTRL: ALLNS Position */\r
+#define SAU_CTRL_ALLNS_Msk                 (1UL << SAU_CTRL_ALLNS_Pos)                    /*!< SAU CTRL: ALLNS Mask */\r
+\r
+#define SAU_CTRL_ENABLE_Pos                 0U                                            /*!< SAU CTRL: ENABLE Position */\r
+#define SAU_CTRL_ENABLE_Msk                (1UL /*<< SAU_CTRL_ENABLE_Pos*/)               /*!< SAU CTRL: ENABLE Mask */\r
+\r
+/* SAU Type Register Definitions */\r
+#define SAU_TYPE_SREGION_Pos                0U                                            /*!< SAU TYPE: SREGION Position */\r
+#define SAU_TYPE_SREGION_Msk               (0xFFUL /*<< SAU_TYPE_SREGION_Pos*/)           /*!< SAU TYPE: SREGION Mask */\r
+\r
+#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U)\r
+/* SAU Region Number Register Definitions */\r
+#define SAU_RNR_REGION_Pos                  0U                                            /*!< SAU RNR: REGION Position */\r
+#define SAU_RNR_REGION_Msk                 (0xFFUL /*<< SAU_RNR_REGION_Pos*/)             /*!< SAU RNR: REGION Mask */\r
+\r
+/* SAU Region Base Address Register Definitions */\r
+#define SAU_RBAR_BADDR_Pos                  5U                                            /*!< SAU RBAR: BADDR Position */\r
+#define SAU_RBAR_BADDR_Msk                 (0x7FFFFFFUL << SAU_RBAR_BADDR_Pos)            /*!< SAU RBAR: BADDR Mask */\r
+\r
+/* SAU Region Limit Address Register Definitions */\r
+#define SAU_RLAR_LADDR_Pos                  5U                                            /*!< SAU RLAR: LADDR Position */\r
+#define SAU_RLAR_LADDR_Msk                 (0x7FFFFFFUL << SAU_RLAR_LADDR_Pos)            /*!< SAU RLAR: LADDR Mask */\r
+\r
+#define SAU_RLAR_NSC_Pos                    1U                                            /*!< SAU RLAR: NSC Position */\r
+#define SAU_RLAR_NSC_Msk                   (1UL << SAU_RLAR_NSC_Pos)                      /*!< SAU RLAR: NSC Mask */\r
+\r
+#define SAU_RLAR_ENABLE_Pos                 0U                                            /*!< SAU RLAR: ENABLE Position */\r
+#define SAU_RLAR_ENABLE_Msk                (1UL /*<< SAU_RLAR_ENABLE_Pos*/)               /*!< SAU RLAR: ENABLE Mask */\r
+\r
+#endif /* defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) */\r
+\r
+/*@} end of group CMSIS_SAU */\r
+#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_CoreDebug       Core Debug Registers (CoreDebug)\r
+  \brief    Type definitions for the Core Debug Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Core Debug Register (CoreDebug).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t DHCSR;                  /*!< Offset: 0x000 (R/W)  Debug Halting Control and Status Register */\r
+  __OM  uint32_t DCRSR;                  /*!< Offset: 0x004 ( /W)  Debug Core Register Selector Register */\r
+  __IOM uint32_t DCRDR;                  /*!< Offset: 0x008 (R/W)  Debug Core Register Data Register */\r
+  __IOM uint32_t DEMCR;                  /*!< Offset: 0x00C (R/W)  Debug Exception and Monitor Control Register */\r
+        uint32_t RESERVED4[1U];\r
+  __IOM uint32_t DAUTHCTRL;              /*!< Offset: 0x014 (R/W)  Debug Authentication Control Register */\r
+  __IOM uint32_t DSCSR;                  /*!< Offset: 0x018 (R/W)  Debug Security Control and Status Register */\r
+} CoreDebug_Type;\r
+\r
+/* Debug Halting Control and Status Register Definitions */\r
+#define CoreDebug_DHCSR_DBGKEY_Pos         16U                                            /*!< CoreDebug DHCSR: DBGKEY Position */\r
+#define CoreDebug_DHCSR_DBGKEY_Msk         (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos)       /*!< CoreDebug DHCSR: DBGKEY Mask */\r
+\r
+#define CoreDebug_DHCSR_S_RESTART_ST_Pos   26U                                            /*!< CoreDebug DHCSR: S_RESTART_ST Position */\r
+#define CoreDebug_DHCSR_S_RESTART_ST_Msk   (1UL << CoreDebug_DHCSR_S_RESTART_ST_Pos)      /*!< CoreDebug DHCSR: S_RESTART_ST Mask */\r
+\r
+#define CoreDebug_DHCSR_S_RESET_ST_Pos     25U                                            /*!< CoreDebug DHCSR: S_RESET_ST Position */\r
+#define CoreDebug_DHCSR_S_RESET_ST_Msk     (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos)        /*!< CoreDebug DHCSR: S_RESET_ST Mask */\r
+\r
+#define CoreDebug_DHCSR_S_RETIRE_ST_Pos    24U                                            /*!< CoreDebug DHCSR: S_RETIRE_ST Position */\r
+#define CoreDebug_DHCSR_S_RETIRE_ST_Msk    (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos)       /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */\r
+\r
+#define CoreDebug_DHCSR_S_LOCKUP_Pos       19U                                            /*!< CoreDebug DHCSR: S_LOCKUP Position */\r
+#define CoreDebug_DHCSR_S_LOCKUP_Msk       (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos)          /*!< CoreDebug DHCSR: S_LOCKUP Mask */\r
+\r
+#define CoreDebug_DHCSR_S_SLEEP_Pos        18U                                            /*!< CoreDebug DHCSR: S_SLEEP Position */\r
+#define CoreDebug_DHCSR_S_SLEEP_Msk        (1UL << CoreDebug_DHCSR_S_SLEEP_Pos)           /*!< CoreDebug DHCSR: S_SLEEP Mask */\r
+\r
+#define CoreDebug_DHCSR_S_HALT_Pos         17U                                            /*!< CoreDebug DHCSR: S_HALT Position */\r
+#define CoreDebug_DHCSR_S_HALT_Msk         (1UL << CoreDebug_DHCSR_S_HALT_Pos)            /*!< CoreDebug DHCSR: S_HALT Mask */\r
+\r
+#define CoreDebug_DHCSR_S_REGRDY_Pos       16U                                            /*!< CoreDebug DHCSR: S_REGRDY Position */\r
+#define CoreDebug_DHCSR_S_REGRDY_Msk       (1UL << CoreDebug_DHCSR_S_REGRDY_Pos)          /*!< CoreDebug DHCSR: S_REGRDY Mask */\r
+\r
+#define CoreDebug_DHCSR_C_MASKINTS_Pos      3U                                            /*!< CoreDebug DHCSR: C_MASKINTS Position */\r
+#define CoreDebug_DHCSR_C_MASKINTS_Msk     (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos)        /*!< CoreDebug DHCSR: C_MASKINTS Mask */\r
+\r
+#define CoreDebug_DHCSR_C_STEP_Pos          2U                                            /*!< CoreDebug DHCSR: C_STEP Position */\r
+#define CoreDebug_DHCSR_C_STEP_Msk         (1UL << CoreDebug_DHCSR_C_STEP_Pos)            /*!< CoreDebug DHCSR: C_STEP Mask */\r
+\r
+#define CoreDebug_DHCSR_C_HALT_Pos          1U                                            /*!< CoreDebug DHCSR: C_HALT Position */\r
+#define CoreDebug_DHCSR_C_HALT_Msk         (1UL << CoreDebug_DHCSR_C_HALT_Pos)            /*!< CoreDebug DHCSR: C_HALT Mask */\r
+\r
+#define CoreDebug_DHCSR_C_DEBUGEN_Pos       0U                                            /*!< CoreDebug DHCSR: C_DEBUGEN Position */\r
+#define CoreDebug_DHCSR_C_DEBUGEN_Msk      (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/)     /*!< CoreDebug DHCSR: C_DEBUGEN Mask */\r
+\r
+/* Debug Core Register Selector Register Definitions */\r
+#define CoreDebug_DCRSR_REGWnR_Pos         16U                                            /*!< CoreDebug DCRSR: REGWnR Position */\r
+#define CoreDebug_DCRSR_REGWnR_Msk         (1UL << CoreDebug_DCRSR_REGWnR_Pos)            /*!< CoreDebug DCRSR: REGWnR Mask */\r
+\r
+#define CoreDebug_DCRSR_REGSEL_Pos          0U                                            /*!< CoreDebug DCRSR: REGSEL Position */\r
+#define CoreDebug_DCRSR_REGSEL_Msk         (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/)     /*!< CoreDebug DCRSR: REGSEL Mask */\r
+\r
+/* Debug Exception and Monitor Control Register */\r
+#define CoreDebug_DEMCR_DWTENA_Pos         24U                                            /*!< CoreDebug DEMCR: DWTENA Position */\r
+#define CoreDebug_DEMCR_DWTENA_Msk         (1UL << CoreDebug_DEMCR_DWTENA_Pos)            /*!< CoreDebug DEMCR: DWTENA Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_HARDERR_Pos     10U                                            /*!< CoreDebug DEMCR: VC_HARDERR Position */\r
+#define CoreDebug_DEMCR_VC_HARDERR_Msk     (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos)        /*!< CoreDebug DEMCR: VC_HARDERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_CORERESET_Pos    0U                                            /*!< CoreDebug DEMCR: VC_CORERESET Position */\r
+#define CoreDebug_DEMCR_VC_CORERESET_Msk   (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/)  /*!< CoreDebug DEMCR: VC_CORERESET Mask */\r
+\r
+/* Debug Authentication Control Register Definitions */\r
+#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos  3U                                            /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Position */\r
+#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos)    /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Mask */\r
+\r
+#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos  2U                                            /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Position */\r
+#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Msk (1UL << CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos)    /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Mask */\r
+\r
+#define CoreDebug_DAUTHCTRL_INTSPIDEN_Pos   1U                                            /*!< CoreDebug DAUTHCTRL: INTSPIDEN Position */\r
+#define CoreDebug_DAUTHCTRL_INTSPIDEN_Msk  (1UL << CoreDebug_DAUTHCTRL_INTSPIDEN_Pos)     /*!< CoreDebug DAUTHCTRL: INTSPIDEN Mask */\r
+\r
+#define CoreDebug_DAUTHCTRL_SPIDENSEL_Pos   0U                                            /*!< CoreDebug DAUTHCTRL: SPIDENSEL Position */\r
+#define CoreDebug_DAUTHCTRL_SPIDENSEL_Msk  (1UL /*<< CoreDebug_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< CoreDebug DAUTHCTRL: SPIDENSEL Mask */\r
+\r
+/* Debug Security Control and Status Register Definitions */\r
+#define CoreDebug_DSCSR_CDS_Pos            16U                                            /*!< CoreDebug DSCSR: CDS Position */\r
+#define CoreDebug_DSCSR_CDS_Msk            (1UL << CoreDebug_DSCSR_CDS_Pos)               /*!< CoreDebug DSCSR: CDS Mask */\r
+\r
+#define CoreDebug_DSCSR_SBRSEL_Pos          1U                                            /*!< CoreDebug DSCSR: SBRSEL Position */\r
+#define CoreDebug_DSCSR_SBRSEL_Msk         (1UL << CoreDebug_DSCSR_SBRSEL_Pos)            /*!< CoreDebug DSCSR: SBRSEL Mask */\r
+\r
+#define CoreDebug_DSCSR_SBRSELEN_Pos        0U                                            /*!< CoreDebug DSCSR: SBRSELEN Position */\r
+#define CoreDebug_DSCSR_SBRSELEN_Msk       (1UL /*<< CoreDebug_DSCSR_SBRSELEN_Pos*/)      /*!< CoreDebug DSCSR: SBRSELEN Mask */\r
+\r
+/*@} end of group CMSIS_CoreDebug */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_bitfield     Core register bit field macros\r
+  \brief      Macros for use with bit field definitions (xxx_Pos, xxx_Msk).\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   Mask and shift a bit field value for use in a register bit range.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of the bit field. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted value.\r
+*/\r
+#define _VAL2FLD(field, value)    (((uint32_t)(value) << field ## _Pos) & field ## _Msk)\r
+\r
+/**\r
+  \brief     Mask and shift a register value to extract a bit filed value.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of register. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted bit field value.\r
+*/\r
+#define _FLD2VAL(field, value)    (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)\r
+\r
+/*@} end of group CMSIS_core_bitfield */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_base     Core Definitions\r
+  \brief      Definitions for base addresses, unions, and structures.\r
+  @{\r
+ */\r
+\r
+/* Memory mapping of Core Hardware */\r
+  #define SCS_BASE            (0xE000E000UL)                             /*!< System Control Space Base Address */\r
+  #define DWT_BASE            (0xE0001000UL)                             /*!< DWT Base Address */\r
+  #define TPI_BASE            (0xE0040000UL)                             /*!< TPI Base Address */\r
+  #define CoreDebug_BASE      (0xE000EDF0UL)                             /*!< Core Debug Base Address */\r
+  #define SysTick_BASE        (SCS_BASE +  0x0010UL)                     /*!< SysTick Base Address */\r
+  #define NVIC_BASE           (SCS_BASE +  0x0100UL)                     /*!< NVIC Base Address */\r
+  #define SCB_BASE            (SCS_BASE +  0x0D00UL)                     /*!< System Control Block Base Address */\r
+\r
+\r
+  #define SCB                 ((SCB_Type       *)     SCB_BASE         ) /*!< SCB configuration struct */\r
+  #define SysTick             ((SysTick_Type   *)     SysTick_BASE     ) /*!< SysTick configuration struct */\r
+  #define NVIC                ((NVIC_Type      *)     NVIC_BASE        ) /*!< NVIC configuration struct */\r
+  #define DWT                 ((DWT_Type       *)     DWT_BASE         ) /*!< DWT configuration struct */\r
+  #define TPI                 ((TPI_Type       *)     TPI_BASE         ) /*!< TPI configuration struct */\r
+  #define CoreDebug           ((CoreDebug_Type *)     CoreDebug_BASE   ) /*!< Core Debug configuration struct */\r
+\r
+  #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+    #define MPU_BASE          (SCS_BASE +  0x0D90UL)                     /*!< Memory Protection Unit */\r
+    #define MPU               ((MPU_Type       *)     MPU_BASE         ) /*!< Memory Protection Unit */\r
+  #endif\r
+\r
+  #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+    #define SAU_BASE          (SCS_BASE +  0x0DD0UL)                     /*!< Security Attribution Unit */\r
+    #define SAU               ((SAU_Type       *)     SAU_BASE         ) /*!< Security Attribution Unit */\r
+  #endif\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+  #define SCS_BASE_NS         (0xE002E000UL)                             /*!< System Control Space Base Address (non-secure address space) */\r
+  #define CoreDebug_BASE_NS   (0xE002EDF0UL)                             /*!< Core Debug Base Address           (non-secure address space) */\r
+  #define SysTick_BASE_NS     (SCS_BASE_NS +  0x0010UL)                  /*!< SysTick Base Address              (non-secure address space) */\r
+  #define NVIC_BASE_NS        (SCS_BASE_NS +  0x0100UL)                  /*!< NVIC Base Address                 (non-secure address space) */\r
+  #define SCB_BASE_NS         (SCS_BASE_NS +  0x0D00UL)                  /*!< System Control Block Base Address (non-secure address space) */\r
+\r
+  #define SCB_NS              ((SCB_Type       *)     SCB_BASE_NS      ) /*!< SCB configuration struct          (non-secure address space) */\r
+  #define SysTick_NS          ((SysTick_Type   *)     SysTick_BASE_NS  ) /*!< SysTick configuration struct      (non-secure address space) */\r
+  #define NVIC_NS             ((NVIC_Type      *)     NVIC_BASE_NS     ) /*!< NVIC configuration struct         (non-secure address space) */\r
+  #define CoreDebug_NS        ((CoreDebug_Type *)     CoreDebug_BASE_NS) /*!< Core Debug configuration struct   (non-secure address space) */\r
+\r
+  #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+    #define MPU_BASE_NS       (SCS_BASE_NS +  0x0D90UL)                  /*!< Memory Protection Unit            (non-secure address space) */\r
+    #define MPU_NS            ((MPU_Type       *)     MPU_BASE_NS      ) /*!< Memory Protection Unit            (non-secure address space) */\r
+  #endif\r
+\r
+#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */\r
+/*@} */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                Hardware Abstraction Layer\r
+  Core Function Interface contains:\r
+  - Core NVIC Functions\r
+  - Core SysTick Functions\r
+  - Core Register Access Functions\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference\r
+*/\r
+\r
+\r
+\r
+/* ##########################   NVIC functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_NVICFunctions NVIC Functions\r
+  \brief    Functions that manage interrupts and exceptions via the NVIC.\r
+  @{\r
+ */\r
+\r
+#ifdef CMSIS_NVIC_VIRTUAL\r
+  #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+    #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"\r
+  #endif\r
+  #include CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+#else\r
+  #define NVIC_SetPriorityGrouping    __NVIC_SetPriorityGrouping\r
+  #define NVIC_GetPriorityGrouping    __NVIC_GetPriorityGrouping\r
+  #define NVIC_EnableIRQ              __NVIC_EnableIRQ\r
+  #define NVIC_GetEnableIRQ           __NVIC_GetEnableIRQ\r
+  #define NVIC_DisableIRQ             __NVIC_DisableIRQ\r
+  #define NVIC_GetPendingIRQ          __NVIC_GetPendingIRQ\r
+  #define NVIC_SetPendingIRQ          __NVIC_SetPendingIRQ\r
+  #define NVIC_ClearPendingIRQ        __NVIC_ClearPendingIRQ\r
+  #define NVIC_GetActive              __NVIC_GetActive\r
+  #define NVIC_SetPriority            __NVIC_SetPriority\r
+  #define NVIC_GetPriority            __NVIC_GetPriority\r
+  #define NVIC_SystemReset            __NVIC_SystemReset\r
+#endif /* CMSIS_NVIC_VIRTUAL */\r
+\r
+#ifdef CMSIS_VECTAB_VIRTUAL\r
+  #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+    #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"\r
+  #endif\r
+  #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+#else\r
+  #define NVIC_SetVector              __NVIC_SetVector\r
+  #define NVIC_GetVector              __NVIC_GetVector\r
+#endif  /* (CMSIS_VECTAB_VIRTUAL) */\r
+\r
+#define NVIC_USER_IRQ_OFFSET          16\r
+\r
+\r
+/* Special LR values for Secure/Non-Secure call handling and exception handling                                               */\r
+\r
+/* Function Return Payload (from ARMv8-M Architecture Reference Manual) LR value on entry from Secure BLXNS                   */\r
+#define FNC_RETURN                 (0xFEFFFFFFUL)     /* bit [0] ignored when processing a branch                             */\r
+\r
+/* The following EXC_RETURN mask values are used to evaluate the LR on exception entry */\r
+#define EXC_RETURN_PREFIX          (0xFF000000UL)     /* bits [31:24] set to indicate an EXC_RETURN value                     */\r
+#define EXC_RETURN_S               (0x00000040UL)     /* bit [6] stack used to push registers: 0=Non-secure 1=Secure          */\r
+#define EXC_RETURN_DCRS            (0x00000020UL)     /* bit [5] stacking rules for called registers: 0=skipped 1=saved       */\r
+#define EXC_RETURN_FTYPE           (0x00000010UL)     /* bit [4] allocate stack for floating-point context: 0=done 1=skipped  */\r
+#define EXC_RETURN_MODE            (0x00000008UL)     /* bit [3] processor mode for return: 0=Handler mode 1=Thread mode      */\r
+#define EXC_RETURN_SPSEL           (0x00000002UL)     /* bit [1] stack pointer used to restore context: 0=MSP 1=PSP           */\r
+#define EXC_RETURN_ES              (0x00000001UL)     /* bit [0] security state exception was taken to: 0=Non-secure 1=Secure */\r
+\r
+/* Integrity Signature (from ARMv8-M Architecture Reference Manual) for exception context stacking                            */\r
+#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)  /* Value for processors with floating-point extension:                  */\r
+#define EXC_INTEGRITY_SIGNATURE     (0xFEFA125AUL)     /* bit [0] SFTC must match LR bit[4] EXC_RETURN_FTYPE                   */\r
+#else\r
+#define EXC_INTEGRITY_SIGNATURE     (0xFEFA125BUL)     /* Value for processors without floating-point extension                */\r
+#endif\r
+\r
+\r
+/* Interrupt Priorities are WORD accessible only under Armv6-M                  */\r
+/* The following MACROS handle generation of the register offset and byte masks */\r
+#define _BIT_SHIFT(IRQn)         (  ((((uint32_t)(int32_t)(IRQn))         )      &  0x03UL) * 8UL)\r
+#define _SHP_IDX(IRQn)           ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >>    2UL)      )\r
+#define _IP_IDX(IRQn)            (   (((uint32_t)(int32_t)(IRQn))                >>    2UL)      )\r
+\r
+#define __NVIC_SetPriorityGrouping(X) (void)(X)\r
+#define __NVIC_GetPriorityGrouping()  (0U)\r
+\r
+/**\r
+  \brief   Enable Interrupt\r
+  \details Enables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Enable status\r
+  \details Returns a device specific interrupt enable status from the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt is not enabled.\r
+  \return             1  Interrupt is enabled.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Disable Interrupt\r
+  \details Disables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+    __DSB();\r
+    __ISB();\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Pending Interrupt\r
+  \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not pending.\r
+  \return             1  Interrupt status is pending.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Pending Interrupt\r
+  \details Sets the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Clear Pending Interrupt\r
+  \details Clears the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Active Interrupt\r
+  \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not active.\r
+  \return             1  Interrupt status is active.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+/**\r
+  \brief   Get Interrupt Target State\r
+  \details Reads the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  if interrupt is assigned to Secure\r
+  \return             1  if interrupt is assigned to Non Secure\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t NVIC_GetTargetState(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Target State\r
+  \details Sets the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  if interrupt is assigned to Secure\r
+                      1  if interrupt is assigned to Non Secure\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t NVIC_SetTargetState(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] |=  ((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)));\r
+    return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Clear Interrupt Target State\r
+  \details Clears the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  if interrupt is assigned to Secure\r
+                      1  if interrupt is assigned to Non Secure\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t NVIC_ClearTargetState(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)));\r
+    return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Priority\r
+  \details Sets the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]      IRQn  Interrupt number.\r
+  \param [in]  priority  Priority to set.\r
+  \note    The priority cannot be set for every processor exception.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->IPR[_IP_IDX(IRQn)]  = ((uint32_t)(NVIC->IPR[_IP_IDX(IRQn)]  & ~(0xFFUL << _BIT_SHIFT(IRQn))) |\r
+       (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));\r
+  }\r
+  else\r
+  {\r
+    SCB->SHPR[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHPR[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |\r
+       (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Priority\r
+  \details Reads the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn  Interrupt number.\r
+  \return             Interrupt Priority.\r
+                      Value is aligned automatically to the implemented priority bits of the microcontroller.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)\r
+{\r
+\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->IPR[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+  else\r
+  {\r
+    return((uint32_t)(((SCB->SHPR[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Encode Priority\r
+  \details Encodes the priority for an interrupt with the given priority group,\r
+           preemptive priority value, and subpriority value.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.\r
+  \param [in]     PriorityGroup  Used priority group.\r
+  \param [in]   PreemptPriority  Preemptive priority value (starting from 0).\r
+  \param [in]       SubPriority  Subpriority value (starting from 0).\r
+  \return                        Encoded priority. Value can be used in the function \ref NVIC_SetPriority().\r
+ */\r
+__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);\r
+  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));\r
+\r
+  return (\r
+           ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |\r
+           ((SubPriority     & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL)))\r
+         );\r
+}\r
+\r
+\r
+/**\r
+  \brief   Decode Priority\r
+  \details Decodes an interrupt priority value with a given priority group to\r
+           preemptive priority value and subpriority value.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.\r
+  \param [in]         Priority   Priority value, which can be retrieved with the function \ref NVIC_GetPriority().\r
+  \param [in]     PriorityGroup  Used priority group.\r
+  \param [out] pPreemptPriority  Preemptive priority value (starting from 0).\r
+  \param [out]     pSubPriority  Subpriority value (starting from 0).\r
+ */\r
+__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);\r
+  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));\r
+\r
+  *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);\r
+  *pSubPriority     = (Priority                   ) & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Vector\r
+  \details Sets an interrupt vector in SRAM based interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+           VTOR must been relocated to SRAM before.\r
+           If VTOR is not present address 0 must be mapped to SRAM.\r
+  \param [in]   IRQn      Interrupt number\r
+  \param [in]   vector    Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)\r
+{\r
+#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)\r
+  uint32_t *vectors = (uint32_t *)SCB->VTOR;\r
+#else\r
+  uint32_t *vectors = (uint32_t *)0x0U;\r
+#endif\r
+  vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Vector\r
+  \details Reads an interrupt vector from interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn      Interrupt number.\r
+  \return                 Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)\r
+{\r
+#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)\r
+  uint32_t *vectors = (uint32_t *)SCB->VTOR;\r
+#else\r
+  uint32_t *vectors = (uint32_t *)0x0U;\r
+#endif\r
+  return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];\r
+}\r
+\r
+\r
+/**\r
+  \brief   System Reset\r
+  \details Initiates a system reset request to reset the MCU.\r
+ */\r
+__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)\r
+{\r
+  __DSB();                                                          /* Ensure all outstanding memory accesses included\r
+                                                                       buffered write are completed before reset */\r
+  SCB->AIRCR  = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |\r
+                 SCB_AIRCR_SYSRESETREQ_Msk);\r
+  __DSB();                                                          /* Ensure completion of memory access */\r
+\r
+  for(;;)                                                           /* wait until reset */\r
+  {\r
+    __NOP();\r
+  }\r
+}\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+/**\r
+  \brief   Enable Interrupt (non-secure)\r
+  \details Enables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void TZ_NVIC_EnableIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Enable status (non-secure)\r
+  \details Returns a device specific interrupt enable status from the non-secure NVIC interrupt controller when in secure state.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt is not enabled.\r
+  \return             1  Interrupt is enabled.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t TZ_NVIC_GetEnableIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Disable Interrupt (non-secure)\r
+  \details Disables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void TZ_NVIC_DisableIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC_NS->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Pending Interrupt (non-secure)\r
+  \details Reads the NVIC pending register in the non-secure NVIC when in secure state and returns the pending bit for the specified device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not pending.\r
+  \return             1  Interrupt status is pending.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t TZ_NVIC_GetPendingIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Pending Interrupt (non-secure)\r
+  \details Sets the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void TZ_NVIC_SetPendingIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Clear Pending Interrupt (non-secure)\r
+  \details Clears the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void TZ_NVIC_ClearPendingIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC_NS->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Active Interrupt (non-secure)\r
+  \details Reads the active register in non-secure NVIC when in secure state and returns the active bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not active.\r
+  \return             1  Interrupt status is active.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t TZ_NVIC_GetActive_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC_NS->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Priority (non-secure)\r
+  \details Sets the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]      IRQn  Interrupt number.\r
+  \param [in]  priority  Priority to set.\r
+  \note    The priority cannot be set for every non-secure processor exception.\r
+ */\r
+__STATIC_INLINE void TZ_NVIC_SetPriority_NS(IRQn_Type IRQn, uint32_t priority)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC_NS->IPR[_IP_IDX(IRQn)]  = ((uint32_t)(NVIC_NS->IPR[_IP_IDX(IRQn)]  & ~(0xFFUL << _BIT_SHIFT(IRQn))) |\r
+       (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));\r
+  }\r
+  else\r
+  {\r
+    SCB_NS->SHPR[_SHP_IDX(IRQn)] = ((uint32_t)(SCB_NS->SHPR[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |\r
+       (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Priority (non-secure)\r
+  \details Reads the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn  Interrupt number.\r
+  \return             Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller.\r
+ */\r
+__STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn)\r
+{\r
+\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC_NS->IPR[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+  else\r
+  {\r
+    return((uint32_t)(((SCB_NS->SHPR[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+}\r
+#endif /*  defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */\r
+\r
+/*@} end of CMSIS_Core_NVICFunctions */\r
+\r
+/* ##########################  MPU functions  #################################### */\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+\r
+#include "mpu_armv8.h"\r
+\r
+#endif\r
+\r
+/* ##########################  FPU functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_FpuFunctions FPU Functions\r
+  \brief    Function that provides FPU type.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   get FPU type\r
+  \details returns the FPU type\r
+  \returns\r
+   - \b  0: No FPU\r
+   - \b  1: Single precision FPU\r
+   - \b  2: Double + Single precision FPU\r
+ */\r
+__STATIC_INLINE uint32_t SCB_GetFPUType(void)\r
+{\r
+    return 0U;           /* No FPU */\r
+}\r
+\r
+\r
+/*@} end of CMSIS_Core_FpuFunctions */\r
+\r
+\r
+\r
+/* ##########################   SAU functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_SAUFunctions SAU Functions\r
+  \brief    Functions that configure the SAU.\r
+  @{\r
+ */\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+\r
+/**\r
+  \brief   Enable SAU\r
+  \details Enables the Security Attribution Unit (SAU).\r
+ */\r
+__STATIC_INLINE void TZ_SAU_Enable(void)\r
+{\r
+    SAU->CTRL |=  (SAU_CTRL_ENABLE_Msk);\r
+}\r
+\r
+\r
+\r
+/**\r
+  \brief   Disable SAU\r
+  \details Disables the Security Attribution Unit (SAU).\r
+ */\r
+__STATIC_INLINE void TZ_SAU_Disable(void)\r
+{\r
+    SAU->CTRL &= ~(SAU_CTRL_ENABLE_Msk);\r
+}\r
+\r
+#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */\r
+\r
+/*@} end of CMSIS_Core_SAUFunctions */\r
+\r
+\r
+\r
+\r
+/* ##################################    SysTick function  ############################################ */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_SysTickFunctions SysTick Functions\r
+  \brief    Functions that configure the System.\r
+  @{\r
+ */\r
+\r
+#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)\r
+\r
+/**\r
+  \brief   System Tick Configuration\r
+  \details Initializes the System Timer and its interrupt, and starts the System Tick Timer.\r
+           Counter is in free running mode to generate periodic interrupts.\r
+  \param [in]  ticks  Number of ticks between two interrupts.\r
+  \return          0  Function succeeded.\r
+  \return          1  Function failed.\r
+  \note    When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the\r
+           function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>\r
+           must contain a vendor-specific implementation of this function.\r
+ */\r
+__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)\r
+{\r
+  if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)\r
+  {\r
+    return (1UL);                                                   /* Reload value impossible */\r
+  }\r
+\r
+  SysTick->LOAD  = (uint32_t)(ticks - 1UL);                         /* set reload register */\r
+  NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */\r
+  SysTick->VAL   = 0UL;                                             /* Load the SysTick Counter Value */\r
+  SysTick->CTRL  = SysTick_CTRL_CLKSOURCE_Msk |\r
+                   SysTick_CTRL_TICKINT_Msk   |\r
+                   SysTick_CTRL_ENABLE_Msk;                         /* Enable SysTick IRQ and SysTick Timer */\r
+  return (0UL);                                                     /* Function successful */\r
+}\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+/**\r
+  \brief   System Tick Configuration (non-secure)\r
+  \details Initializes the non-secure System Timer and its interrupt when in secure state, and starts the System Tick Timer.\r
+           Counter is in free running mode to generate periodic interrupts.\r
+  \param [in]  ticks  Number of ticks between two interrupts.\r
+  \return          0  Function succeeded.\r
+  \return          1  Function failed.\r
+  \note    When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the\r
+           function <b>TZ_SysTick_Config_NS</b> is not included. In this case, the file <b><i>device</i>.h</b>\r
+           must contain a vendor-specific implementation of this function.\r
+\r
+ */\r
+__STATIC_INLINE uint32_t TZ_SysTick_Config_NS(uint32_t ticks)\r
+{\r
+  if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)\r
+  {\r
+    return (1UL);                                                         /* Reload value impossible */\r
+  }\r
+\r
+  SysTick_NS->LOAD  = (uint32_t)(ticks - 1UL);                            /* set reload register */\r
+  TZ_NVIC_SetPriority_NS (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */\r
+  SysTick_NS->VAL   = 0UL;                                                /* Load the SysTick Counter Value */\r
+  SysTick_NS->CTRL  = SysTick_CTRL_CLKSOURCE_Msk |\r
+                      SysTick_CTRL_TICKINT_Msk   |\r
+                      SysTick_CTRL_ENABLE_Msk;                            /* Enable SysTick IRQ and SysTick Timer */\r
+  return (0UL);                                                           /* Function successful */\r
+}\r
+#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */\r
+\r
+#endif\r
+\r
+/*@} end of CMSIS_Core_SysTickFunctions */\r
+\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_ARMV8MBL_H_DEPENDANT */\r
+\r
+#endif /* __CMSIS_GENERIC */\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_armv8mml.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_armv8mml.h
new file mode 100644 (file)
index 0000000..2d0f106
--- /dev/null
@@ -0,0 +1,2927 @@
+/**************************************************************************//**\r
+ * @file     core_armv8mml.h\r
+ * @brief    CMSIS Armv8-M Mainline Core Peripheral Access Layer Header File\r
+ * @version  V5.0.7\r
+ * @date     06. July 2018\r
+ ******************************************************************************/\r
+/*\r
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.\r
+ *\r
+ * SPDX-License-Identifier: Apache-2.0\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the License); you may\r
+ * not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#if   defined ( __ICCARM__ )\r
+  #pragma system_include         /* treat file as system include file for MISRA check */\r
+#elif defined (__clang__)\r
+  #pragma clang system_header   /* treat file as system include file */\r
+#endif\r
+\r
+#ifndef __CORE_ARMV8MML_H_GENERIC\r
+#define __CORE_ARMV8MML_H_GENERIC\r
+\r
+#include <stdint.h>\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/**\r
+  \page CMSIS_MISRA_Exceptions  MISRA-C:2004 Compliance Exceptions\r
+  CMSIS violates the following MISRA-C:2004 rules:\r
+\r
+   \li Required Rule 8.5, object/function definition in header file.<br>\r
+     Function definitions in header files are used to allow 'inlining'.\r
+\r
+   \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>\r
+     Unions are used for effective representation of core registers.\r
+\r
+   \li Advisory Rule 19.7, Function-like macro defined.<br>\r
+     Function-like macros are used to allow more efficient code.\r
+ */\r
+\r
+\r
+/*******************************************************************************\r
+ *                 CMSIS definitions\r
+ ******************************************************************************/\r
+/**\r
+  \ingroup Cortex_ARMv8MML\r
+  @{\r
+ */\r
+\r
+#include "cmsis_version.h"\r
+\r
+/*  CMSIS Armv8MML definitions */\r
+#define __ARMv8MML_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                   /*!< \deprecated [31:16] CMSIS HAL main version */\r
+#define __ARMv8MML_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                    /*!< \deprecated [15:0]  CMSIS HAL sub version */\r
+#define __ARMv8MML_CMSIS_VERSION       ((__ARMv8MML_CMSIS_VERSION_MAIN << 16U) | \\r
+                                         __ARMv8MML_CMSIS_VERSION_SUB           )  /*!< \deprecated CMSIS HAL version number */\r
+\r
+#define __CORTEX_M                     (81U)                                       /*!< Cortex-M Core */\r
+\r
+/** __FPU_USED indicates whether an FPU is used or not.\r
+    For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions.\r
+*/\r
+#if defined ( __CC_ARM )\r
+  #if defined __TARGET_FPU_VFP\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+  #if defined(__ARM_FEATURE_DSP)\r
+    #if defined(__DSP_PRESENT) && (__DSP_PRESENT == 1U)\r
+      #define __DSP_USED       1U\r
+    #else\r
+      #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)"\r
+      #define __DSP_USED         0U\r
+    #endif\r
+  #else\r
+    #define __DSP_USED         0U\r
+  #endif\r
+\r
+#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)\r
+  #if defined __ARM_PCS_VFP\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+  #if defined(__ARM_FEATURE_DSP)\r
+    #if defined(__DSP_PRESENT) && (__DSP_PRESENT == 1U)\r
+      #define __DSP_USED       1U\r
+    #else\r
+      #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)"\r
+      #define __DSP_USED         0U\r
+    #endif\r
+  #else\r
+    #define __DSP_USED         0U\r
+  #endif\r
+\r
+#elif defined ( __GNUC__ )\r
+  #if defined (__VFP_FP__) && !defined(__SOFTFP__)\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+  #if defined(__ARM_FEATURE_DSP)\r
+    #if defined(__DSP_PRESENT) && (__DSP_PRESENT == 1U)\r
+      #define __DSP_USED       1U\r
+    #else\r
+      #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)"\r
+      #define __DSP_USED         0U\r
+    #endif\r
+  #else\r
+    #define __DSP_USED         0U\r
+  #endif\r
+\r
+#elif defined ( __ICCARM__ )\r
+  #if defined __ARMVFP__\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+  #if defined(__ARM_FEATURE_DSP)\r
+    #if defined(__DSP_PRESENT) && (__DSP_PRESENT == 1U)\r
+      #define __DSP_USED       1U\r
+    #else\r
+      #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)"\r
+      #define __DSP_USED         0U\r
+    #endif\r
+  #else\r
+    #define __DSP_USED         0U\r
+  #endif\r
+\r
+#elif defined ( __TI_ARM__ )\r
+  #if defined __TI_VFP_SUPPORT__\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+#elif defined ( __TASKING__ )\r
+  #if defined __FPU_VFP__\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+#elif defined ( __CSMC__ )\r
+  #if ( __CSMC__ & 0x400U)\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+#endif\r
+\r
+#include "cmsis_compiler.h"               /* CMSIS compiler specific defines */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_ARMV8MML_H_GENERIC */\r
+\r
+#ifndef __CMSIS_GENERIC\r
+\r
+#ifndef __CORE_ARMV8MML_H_DEPENDANT\r
+#define __CORE_ARMV8MML_H_DEPENDANT\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/* check device defines and use defaults */\r
+#if defined __CHECK_DEVICE_DEFINES\r
+  #ifndef __ARMv8MML_REV\r
+    #define __ARMv8MML_REV               0x0000U\r
+    #warning "__ARMv8MML_REV not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __FPU_PRESENT\r
+    #define __FPU_PRESENT             0U\r
+    #warning "__FPU_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __MPU_PRESENT\r
+    #define __MPU_PRESENT             0U\r
+    #warning "__MPU_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __SAUREGION_PRESENT\r
+    #define __SAUREGION_PRESENT       0U\r
+    #warning "__SAUREGION_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __DSP_PRESENT\r
+    #define __DSP_PRESENT             0U\r
+    #warning "__DSP_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __NVIC_PRIO_BITS\r
+    #define __NVIC_PRIO_BITS          3U\r
+    #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __Vendor_SysTickConfig\r
+    #define __Vendor_SysTickConfig    0U\r
+    #warning "__Vendor_SysTickConfig not defined in device header file; using default!"\r
+  #endif\r
+#endif\r
+\r
+/* IO definitions (access restrictions to peripheral registers) */\r
+/**\r
+    \defgroup CMSIS_glob_defs CMSIS Global Defines\r
+\r
+    <strong>IO Type Qualifiers</strong> are used\r
+    \li to specify the access to peripheral variables.\r
+    \li for automatic generation of peripheral register debug information.\r
+*/\r
+#ifdef __cplusplus\r
+  #define   __I     volatile             /*!< Defines 'read only' permissions */\r
+#else\r
+  #define   __I     volatile const       /*!< Defines 'read only' permissions */\r
+#endif\r
+#define     __O     volatile             /*!< Defines 'write only' permissions */\r
+#define     __IO    volatile             /*!< Defines 'read / write' permissions */\r
+\r
+/* following defines should be used for structure members */\r
+#define     __IM     volatile const      /*! Defines 'read only' structure member permissions */\r
+#define     __OM     volatile            /*! Defines 'write only' structure member permissions */\r
+#define     __IOM    volatile            /*! Defines 'read / write' structure member permissions */\r
+\r
+/*@} end of group ARMv8MML */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                 Register Abstraction\r
+  Core Register contain:\r
+  - Core Register\r
+  - Core NVIC Register\r
+  - Core SCB Register\r
+  - Core SysTick Register\r
+  - Core Debug Register\r
+  - Core MPU Register\r
+  - Core SAU Register\r
+  - Core FPU Register\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_core_register Defines and Type Definitions\r
+  \brief Type definitions and defines for Cortex-M processor based devices.\r
+*/\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_CORE  Status and Control Registers\r
+  \brief      Core Register type definitions.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Union type to access the Application Program Status Register (APSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t _reserved0:16;              /*!< bit:  0..15  Reserved */\r
+    uint32_t GE:4;                       /*!< bit: 16..19  Greater than or Equal flags */\r
+    uint32_t _reserved1:7;               /*!< bit: 20..26  Reserved */\r
+    uint32_t Q:1;                        /*!< bit:     27  Saturation condition flag */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} APSR_Type;\r
+\r
+/* APSR Register Definitions */\r
+#define APSR_N_Pos                         31U                                            /*!< APSR: N Position */\r
+#define APSR_N_Msk                         (1UL << APSR_N_Pos)                            /*!< APSR: N Mask */\r
+\r
+#define APSR_Z_Pos                         30U                                            /*!< APSR: Z Position */\r
+#define APSR_Z_Msk                         (1UL << APSR_Z_Pos)                            /*!< APSR: Z Mask */\r
+\r
+#define APSR_C_Pos                         29U                                            /*!< APSR: C Position */\r
+#define APSR_C_Msk                         (1UL << APSR_C_Pos)                            /*!< APSR: C Mask */\r
+\r
+#define APSR_V_Pos                         28U                                            /*!< APSR: V Position */\r
+#define APSR_V_Msk                         (1UL << APSR_V_Pos)                            /*!< APSR: V Mask */\r
+\r
+#define APSR_Q_Pos                         27U                                            /*!< APSR: Q Position */\r
+#define APSR_Q_Msk                         (1UL << APSR_Q_Pos)                            /*!< APSR: Q Mask */\r
+\r
+#define APSR_GE_Pos                        16U                                            /*!< APSR: GE Position */\r
+#define APSR_GE_Msk                        (0xFUL << APSR_GE_Pos)                         /*!< APSR: GE Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Interrupt Program Status Register (IPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:23;              /*!< bit:  9..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} IPSR_Type;\r
+\r
+/* IPSR Register Definitions */\r
+#define IPSR_ISR_Pos                        0U                                            /*!< IPSR: ISR Position */\r
+#define IPSR_ISR_Msk                       (0x1FFUL /*<< IPSR_ISR_Pos*/)                  /*!< IPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Special-Purpose Program Status Registers (xPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:7;               /*!< bit:  9..15  Reserved */\r
+    uint32_t GE:4;                       /*!< bit: 16..19  Greater than or Equal flags */\r
+    uint32_t _reserved1:4;               /*!< bit: 20..23  Reserved */\r
+    uint32_t T:1;                        /*!< bit:     24  Thumb bit        (read 0) */\r
+    uint32_t IT:2;                       /*!< bit: 25..26  saved IT state   (read 0) */\r
+    uint32_t Q:1;                        /*!< bit:     27  Saturation condition flag */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} xPSR_Type;\r
+\r
+/* xPSR Register Definitions */\r
+#define xPSR_N_Pos                         31U                                            /*!< xPSR: N Position */\r
+#define xPSR_N_Msk                         (1UL << xPSR_N_Pos)                            /*!< xPSR: N Mask */\r
+\r
+#define xPSR_Z_Pos                         30U                                            /*!< xPSR: Z Position */\r
+#define xPSR_Z_Msk                         (1UL << xPSR_Z_Pos)                            /*!< xPSR: Z Mask */\r
+\r
+#define xPSR_C_Pos                         29U                                            /*!< xPSR: C Position */\r
+#define xPSR_C_Msk                         (1UL << xPSR_C_Pos)                            /*!< xPSR: C Mask */\r
+\r
+#define xPSR_V_Pos                         28U                                            /*!< xPSR: V Position */\r
+#define xPSR_V_Msk                         (1UL << xPSR_V_Pos)                            /*!< xPSR: V Mask */\r
+\r
+#define xPSR_Q_Pos                         27U                                            /*!< xPSR: Q Position */\r
+#define xPSR_Q_Msk                         (1UL << xPSR_Q_Pos)                            /*!< xPSR: Q Mask */\r
+\r
+#define xPSR_IT_Pos                        25U                                            /*!< xPSR: IT Position */\r
+#define xPSR_IT_Msk                        (3UL << xPSR_IT_Pos)                           /*!< xPSR: IT Mask */\r
+\r
+#define xPSR_T_Pos                         24U                                            /*!< xPSR: T Position */\r
+#define xPSR_T_Msk                         (1UL << xPSR_T_Pos)                            /*!< xPSR: T Mask */\r
+\r
+#define xPSR_GE_Pos                        16U                                            /*!< xPSR: GE Position */\r
+#define xPSR_GE_Msk                        (0xFUL << xPSR_GE_Pos)                         /*!< xPSR: GE Mask */\r
+\r
+#define xPSR_ISR_Pos                        0U                                            /*!< xPSR: ISR Position */\r
+#define xPSR_ISR_Msk                       (0x1FFUL /*<< xPSR_ISR_Pos*/)                  /*!< xPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Control Registers (CONTROL).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t nPRIV:1;                    /*!< bit:      0  Execution privilege in Thread mode */\r
+    uint32_t SPSEL:1;                    /*!< bit:      1  Stack-pointer select */\r
+    uint32_t FPCA:1;                     /*!< bit:      2  Floating-point context active */\r
+    uint32_t SFPA:1;                     /*!< bit:      3  Secure floating-point active */\r
+    uint32_t _reserved1:28;              /*!< bit:  4..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} CONTROL_Type;\r
+\r
+/* CONTROL Register Definitions */\r
+#define CONTROL_SFPA_Pos                    3U                                            /*!< CONTROL: SFPA Position */\r
+#define CONTROL_SFPA_Msk                   (1UL << CONTROL_SFPA_Pos)                      /*!< CONTROL: SFPA Mask */\r
+\r
+#define CONTROL_FPCA_Pos                    2U                                            /*!< CONTROL: FPCA Position */\r
+#define CONTROL_FPCA_Msk                   (1UL << CONTROL_FPCA_Pos)                      /*!< CONTROL: FPCA Mask */\r
+\r
+#define CONTROL_SPSEL_Pos                   1U                                            /*!< CONTROL: SPSEL Position */\r
+#define CONTROL_SPSEL_Msk                  (1UL << CONTROL_SPSEL_Pos)                     /*!< CONTROL: SPSEL Mask */\r
+\r
+#define CONTROL_nPRIV_Pos                   0U                                            /*!< CONTROL: nPRIV Position */\r
+#define CONTROL_nPRIV_Msk                  (1UL /*<< CONTROL_nPRIV_Pos*/)                 /*!< CONTROL: nPRIV Mask */\r
+\r
+/*@} end of group CMSIS_CORE */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_NVIC  Nested Vectored Interrupt Controller (NVIC)\r
+  \brief      Type definitions for the NVIC Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Nested Vectored Interrupt Controller (NVIC).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t ISER[16U];              /*!< Offset: 0x000 (R/W)  Interrupt Set Enable Register */\r
+        uint32_t RESERVED0[16U];\r
+  __IOM uint32_t ICER[16U];              /*!< Offset: 0x080 (R/W)  Interrupt Clear Enable Register */\r
+        uint32_t RSERVED1[16U];\r
+  __IOM uint32_t ISPR[16U];              /*!< Offset: 0x100 (R/W)  Interrupt Set Pending Register */\r
+        uint32_t RESERVED2[16U];\r
+  __IOM uint32_t ICPR[16U];              /*!< Offset: 0x180 (R/W)  Interrupt Clear Pending Register */\r
+        uint32_t RESERVED3[16U];\r
+  __IOM uint32_t IABR[16U];              /*!< Offset: 0x200 (R/W)  Interrupt Active bit Register */\r
+        uint32_t RESERVED4[16U];\r
+  __IOM uint32_t ITNS[16U];              /*!< Offset: 0x280 (R/W)  Interrupt Non-Secure State Register */\r
+        uint32_t RESERVED5[16U];\r
+  __IOM uint8_t  IPR[496U];              /*!< Offset: 0x300 (R/W)  Interrupt Priority Register (8Bit wide) */\r
+        uint32_t RESERVED6[580U];\r
+  __OM  uint32_t STIR;                   /*!< Offset: 0xE00 ( /W)  Software Trigger Interrupt Register */\r
+}  NVIC_Type;\r
+\r
+/* Software Triggered Interrupt Register Definitions */\r
+#define NVIC_STIR_INTID_Pos                 0U                                         /*!< STIR: INTLINESNUM Position */\r
+#define NVIC_STIR_INTID_Msk                (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/)        /*!< STIR: INTLINESNUM Mask */\r
+\r
+/*@} end of group CMSIS_NVIC */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SCB     System Control Block (SCB)\r
+  \brief    Type definitions for the System Control Block Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Control Block (SCB).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t CPUID;                  /*!< Offset: 0x000 (R/ )  CPUID Base Register */\r
+  __IOM uint32_t ICSR;                   /*!< Offset: 0x004 (R/W)  Interrupt Control and State Register */\r
+  __IOM uint32_t VTOR;                   /*!< Offset: 0x008 (R/W)  Vector Table Offset Register */\r
+  __IOM uint32_t AIRCR;                  /*!< Offset: 0x00C (R/W)  Application Interrupt and Reset Control Register */\r
+  __IOM uint32_t SCR;                    /*!< Offset: 0x010 (R/W)  System Control Register */\r
+  __IOM uint32_t CCR;                    /*!< Offset: 0x014 (R/W)  Configuration Control Register */\r
+  __IOM uint8_t  SHPR[12U];              /*!< Offset: 0x018 (R/W)  System Handlers Priority Registers (4-7, 8-11, 12-15) */\r
+  __IOM uint32_t SHCSR;                  /*!< Offset: 0x024 (R/W)  System Handler Control and State Register */\r
+  __IOM uint32_t CFSR;                   /*!< Offset: 0x028 (R/W)  Configurable Fault Status Register */\r
+  __IOM uint32_t HFSR;                   /*!< Offset: 0x02C (R/W)  HardFault Status Register */\r
+  __IOM uint32_t DFSR;                   /*!< Offset: 0x030 (R/W)  Debug Fault Status Register */\r
+  __IOM uint32_t MMFAR;                  /*!< Offset: 0x034 (R/W)  MemManage Fault Address Register */\r
+  __IOM uint32_t BFAR;                   /*!< Offset: 0x038 (R/W)  BusFault Address Register */\r
+  __IOM uint32_t AFSR;                   /*!< Offset: 0x03C (R/W)  Auxiliary Fault Status Register */\r
+  __IM  uint32_t ID_PFR[2U];             /*!< Offset: 0x040 (R/ )  Processor Feature Register */\r
+  __IM  uint32_t ID_DFR;                 /*!< Offset: 0x048 (R/ )  Debug Feature Register */\r
+  __IM  uint32_t ID_ADR;                 /*!< Offset: 0x04C (R/ )  Auxiliary Feature Register */\r
+  __IM  uint32_t ID_MMFR[4U];            /*!< Offset: 0x050 (R/ )  Memory Model Feature Register */\r
+  __IM  uint32_t ID_ISAR[6U];            /*!< Offset: 0x060 (R/ )  Instruction Set Attributes Register */\r
+  __IM  uint32_t CLIDR;                  /*!< Offset: 0x078 (R/ )  Cache Level ID register */\r
+  __IM  uint32_t CTR;                    /*!< Offset: 0x07C (R/ )  Cache Type register */\r
+  __IM  uint32_t CCSIDR;                 /*!< Offset: 0x080 (R/ )  Cache Size ID Register */\r
+  __IOM uint32_t CSSELR;                 /*!< Offset: 0x084 (R/W)  Cache Size Selection Register */\r
+  __IOM uint32_t CPACR;                  /*!< Offset: 0x088 (R/W)  Coprocessor Access Control Register */\r
+  __IOM uint32_t NSACR;                  /*!< Offset: 0x08C (R/W)  Non-Secure Access Control Register */\r
+        uint32_t RESERVED3[92U];\r
+  __OM  uint32_t STIR;                   /*!< Offset: 0x200 ( /W)  Software Triggered Interrupt Register */\r
+        uint32_t RESERVED4[15U];\r
+  __IM  uint32_t MVFR0;                  /*!< Offset: 0x240 (R/ )  Media and VFP Feature Register 0 */\r
+  __IM  uint32_t MVFR1;                  /*!< Offset: 0x244 (R/ )  Media and VFP Feature Register 1 */\r
+  __IM  uint32_t MVFR2;                  /*!< Offset: 0x248 (R/ )  Media and VFP Feature Register 2 */\r
+        uint32_t RESERVED5[1U];\r
+  __OM  uint32_t ICIALLU;                /*!< Offset: 0x250 ( /W)  I-Cache Invalidate All to PoU */\r
+        uint32_t RESERVED6[1U];\r
+  __OM  uint32_t ICIMVAU;                /*!< Offset: 0x258 ( /W)  I-Cache Invalidate by MVA to PoU */\r
+  __OM  uint32_t DCIMVAC;                /*!< Offset: 0x25C ( /W)  D-Cache Invalidate by MVA to PoC */\r
+  __OM  uint32_t DCISW;                  /*!< Offset: 0x260 ( /W)  D-Cache Invalidate by Set-way */\r
+  __OM  uint32_t DCCMVAU;                /*!< Offset: 0x264 ( /W)  D-Cache Clean by MVA to PoU */\r
+  __OM  uint32_t DCCMVAC;                /*!< Offset: 0x268 ( /W)  D-Cache Clean by MVA to PoC */\r
+  __OM  uint32_t DCCSW;                  /*!< Offset: 0x26C ( /W)  D-Cache Clean by Set-way */\r
+  __OM  uint32_t DCCIMVAC;               /*!< Offset: 0x270 ( /W)  D-Cache Clean and Invalidate by MVA to PoC */\r
+  __OM  uint32_t DCCISW;                 /*!< Offset: 0x274 ( /W)  D-Cache Clean and Invalidate by Set-way */\r
+        uint32_t RESERVED7[6U];\r
+  __IOM uint32_t ITCMCR;                 /*!< Offset: 0x290 (R/W)  Instruction Tightly-Coupled Memory Control Register */\r
+  __IOM uint32_t DTCMCR;                 /*!< Offset: 0x294 (R/W)  Data Tightly-Coupled Memory Control Registers */\r
+  __IOM uint32_t AHBPCR;                 /*!< Offset: 0x298 (R/W)  AHBP Control Register */\r
+  __IOM uint32_t CACR;                   /*!< Offset: 0x29C (R/W)  L1 Cache Control Register */\r
+  __IOM uint32_t AHBSCR;                 /*!< Offset: 0x2A0 (R/W)  AHB Slave Control Register */\r
+        uint32_t RESERVED8[1U];\r
+  __IOM uint32_t ABFSR;                  /*!< Offset: 0x2A8 (R/W)  Auxiliary Bus Fault Status Register */\r
+} SCB_Type;\r
+\r
+/* SCB CPUID Register Definitions */\r
+#define SCB_CPUID_IMPLEMENTER_Pos          24U                                            /*!< SCB CPUID: IMPLEMENTER Position */\r
+#define SCB_CPUID_IMPLEMENTER_Msk          (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos)          /*!< SCB CPUID: IMPLEMENTER Mask */\r
+\r
+#define SCB_CPUID_VARIANT_Pos              20U                                            /*!< SCB CPUID: VARIANT Position */\r
+#define SCB_CPUID_VARIANT_Msk              (0xFUL << SCB_CPUID_VARIANT_Pos)               /*!< SCB CPUID: VARIANT Mask */\r
+\r
+#define SCB_CPUID_ARCHITECTURE_Pos         16U                                            /*!< SCB CPUID: ARCHITECTURE Position */\r
+#define SCB_CPUID_ARCHITECTURE_Msk         (0xFUL << SCB_CPUID_ARCHITECTURE_Pos)          /*!< SCB CPUID: ARCHITECTURE Mask */\r
+\r
+#define SCB_CPUID_PARTNO_Pos                4U                                            /*!< SCB CPUID: PARTNO Position */\r
+#define SCB_CPUID_PARTNO_Msk               (0xFFFUL << SCB_CPUID_PARTNO_Pos)              /*!< SCB CPUID: PARTNO Mask */\r
+\r
+#define SCB_CPUID_REVISION_Pos              0U                                            /*!< SCB CPUID: REVISION Position */\r
+#define SCB_CPUID_REVISION_Msk             (0xFUL /*<< SCB_CPUID_REVISION_Pos*/)          /*!< SCB CPUID: REVISION Mask */\r
+\r
+/* SCB Interrupt Control State Register Definitions */\r
+#define SCB_ICSR_PENDNMISET_Pos            31U                                            /*!< SCB ICSR: PENDNMISET Position */\r
+#define SCB_ICSR_PENDNMISET_Msk            (1UL << SCB_ICSR_PENDNMISET_Pos)               /*!< SCB ICSR: PENDNMISET Mask */\r
+\r
+#define SCB_ICSR_NMIPENDSET_Pos            SCB_ICSR_PENDNMISET_Pos                        /*!< SCB ICSR: NMIPENDSET Position, backward compatibility */\r
+#define SCB_ICSR_NMIPENDSET_Msk            SCB_ICSR_PENDNMISET_Msk                        /*!< SCB ICSR: NMIPENDSET Mask, backward compatibility */\r
+\r
+#define SCB_ICSR_PENDNMICLR_Pos            30U                                            /*!< SCB ICSR: PENDNMICLR Position */\r
+#define SCB_ICSR_PENDNMICLR_Msk            (1UL << SCB_ICSR_PENDNMICLR_Pos)               /*!< SCB ICSR: PENDNMICLR Mask */\r
+\r
+#define SCB_ICSR_PENDSVSET_Pos             28U                                            /*!< SCB ICSR: PENDSVSET Position */\r
+#define SCB_ICSR_PENDSVSET_Msk             (1UL << SCB_ICSR_PENDSVSET_Pos)                /*!< SCB ICSR: PENDSVSET Mask */\r
+\r
+#define SCB_ICSR_PENDSVCLR_Pos             27U                                            /*!< SCB ICSR: PENDSVCLR Position */\r
+#define SCB_ICSR_PENDSVCLR_Msk             (1UL << SCB_ICSR_PENDSVCLR_Pos)                /*!< SCB ICSR: PENDSVCLR Mask */\r
+\r
+#define SCB_ICSR_PENDSTSET_Pos             26U                                            /*!< SCB ICSR: PENDSTSET Position */\r
+#define SCB_ICSR_PENDSTSET_Msk             (1UL << SCB_ICSR_PENDSTSET_Pos)                /*!< SCB ICSR: PENDSTSET Mask */\r
+\r
+#define SCB_ICSR_PENDSTCLR_Pos             25U                                            /*!< SCB ICSR: PENDSTCLR Position */\r
+#define SCB_ICSR_PENDSTCLR_Msk             (1UL << SCB_ICSR_PENDSTCLR_Pos)                /*!< SCB ICSR: PENDSTCLR Mask */\r
+\r
+#define SCB_ICSR_STTNS_Pos                 24U                                            /*!< SCB ICSR: STTNS Position (Security Extension) */\r
+#define SCB_ICSR_STTNS_Msk                 (1UL << SCB_ICSR_STTNS_Pos)                    /*!< SCB ICSR: STTNS Mask (Security Extension) */\r
+\r
+#define SCB_ICSR_ISRPREEMPT_Pos            23U                                            /*!< SCB ICSR: ISRPREEMPT Position */\r
+#define SCB_ICSR_ISRPREEMPT_Msk            (1UL << SCB_ICSR_ISRPREEMPT_Pos)               /*!< SCB ICSR: ISRPREEMPT Mask */\r
+\r
+#define SCB_ICSR_ISRPENDING_Pos            22U                                            /*!< SCB ICSR: ISRPENDING Position */\r
+#define SCB_ICSR_ISRPENDING_Msk            (1UL << SCB_ICSR_ISRPENDING_Pos)               /*!< SCB ICSR: ISRPENDING Mask */\r
+\r
+#define SCB_ICSR_VECTPENDING_Pos           12U                                            /*!< SCB ICSR: VECTPENDING Position */\r
+#define SCB_ICSR_VECTPENDING_Msk           (0x1FFUL << SCB_ICSR_VECTPENDING_Pos)          /*!< SCB ICSR: VECTPENDING Mask */\r
+\r
+#define SCB_ICSR_RETTOBASE_Pos             11U                                            /*!< SCB ICSR: RETTOBASE Position */\r
+#define SCB_ICSR_RETTOBASE_Msk             (1UL << SCB_ICSR_RETTOBASE_Pos)                /*!< SCB ICSR: RETTOBASE Mask */\r
+\r
+#define SCB_ICSR_VECTACTIVE_Pos             0U                                            /*!< SCB ICSR: VECTACTIVE Position */\r
+#define SCB_ICSR_VECTACTIVE_Msk            (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/)       /*!< SCB ICSR: VECTACTIVE Mask */\r
+\r
+/* SCB Vector Table Offset Register Definitions */\r
+#define SCB_VTOR_TBLOFF_Pos                 7U                                            /*!< SCB VTOR: TBLOFF Position */\r
+#define SCB_VTOR_TBLOFF_Msk                (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos)           /*!< SCB VTOR: TBLOFF Mask */\r
+\r
+/* SCB Application Interrupt and Reset Control Register Definitions */\r
+#define SCB_AIRCR_VECTKEY_Pos              16U                                            /*!< SCB AIRCR: VECTKEY Position */\r
+#define SCB_AIRCR_VECTKEY_Msk              (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos)            /*!< SCB AIRCR: VECTKEY Mask */\r
+\r
+#define SCB_AIRCR_VECTKEYSTAT_Pos          16U                                            /*!< SCB AIRCR: VECTKEYSTAT Position */\r
+#define SCB_AIRCR_VECTKEYSTAT_Msk          (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos)        /*!< SCB AIRCR: VECTKEYSTAT Mask */\r
+\r
+#define SCB_AIRCR_ENDIANESS_Pos            15U                                            /*!< SCB AIRCR: ENDIANESS Position */\r
+#define SCB_AIRCR_ENDIANESS_Msk            (1UL << SCB_AIRCR_ENDIANESS_Pos)               /*!< SCB AIRCR: ENDIANESS Mask */\r
+\r
+#define SCB_AIRCR_PRIS_Pos                 14U                                            /*!< SCB AIRCR: PRIS Position */\r
+#define SCB_AIRCR_PRIS_Msk                 (1UL << SCB_AIRCR_PRIS_Pos)                    /*!< SCB AIRCR: PRIS Mask */\r
+\r
+#define SCB_AIRCR_BFHFNMINS_Pos            13U                                            /*!< SCB AIRCR: BFHFNMINS Position */\r
+#define SCB_AIRCR_BFHFNMINS_Msk            (1UL << SCB_AIRCR_BFHFNMINS_Pos)               /*!< SCB AIRCR: BFHFNMINS Mask */\r
+\r
+#define SCB_AIRCR_PRIGROUP_Pos              8U                                            /*!< SCB AIRCR: PRIGROUP Position */\r
+#define SCB_AIRCR_PRIGROUP_Msk             (7UL << SCB_AIRCR_PRIGROUP_Pos)                /*!< SCB AIRCR: PRIGROUP Mask */\r
+\r
+#define SCB_AIRCR_SYSRESETREQS_Pos          3U                                            /*!< SCB AIRCR: SYSRESETREQS Position */\r
+#define SCB_AIRCR_SYSRESETREQS_Msk         (1UL << SCB_AIRCR_SYSRESETREQS_Pos)            /*!< SCB AIRCR: SYSRESETREQS Mask */\r
+\r
+#define SCB_AIRCR_SYSRESETREQ_Pos           2U                                            /*!< SCB AIRCR: SYSRESETREQ Position */\r
+#define SCB_AIRCR_SYSRESETREQ_Msk          (1UL << SCB_AIRCR_SYSRESETREQ_Pos)             /*!< SCB AIRCR: SYSRESETREQ Mask */\r
+\r
+#define SCB_AIRCR_VECTCLRACTIVE_Pos         1U                                            /*!< SCB AIRCR: VECTCLRACTIVE Position */\r
+#define SCB_AIRCR_VECTCLRACTIVE_Msk        (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos)           /*!< SCB AIRCR: VECTCLRACTIVE Mask */\r
+\r
+/* SCB System Control Register Definitions */\r
+#define SCB_SCR_SEVONPEND_Pos               4U                                            /*!< SCB SCR: SEVONPEND Position */\r
+#define SCB_SCR_SEVONPEND_Msk              (1UL << SCB_SCR_SEVONPEND_Pos)                 /*!< SCB SCR: SEVONPEND Mask */\r
+\r
+#define SCB_SCR_SLEEPDEEPS_Pos              3U                                            /*!< SCB SCR: SLEEPDEEPS Position */\r
+#define SCB_SCR_SLEEPDEEPS_Msk             (1UL << SCB_SCR_SLEEPDEEPS_Pos)                /*!< SCB SCR: SLEEPDEEPS Mask */\r
+\r
+#define SCB_SCR_SLEEPDEEP_Pos               2U                                            /*!< SCB SCR: SLEEPDEEP Position */\r
+#define SCB_SCR_SLEEPDEEP_Msk              (1UL << SCB_SCR_SLEEPDEEP_Pos)                 /*!< SCB SCR: SLEEPDEEP Mask */\r
+\r
+#define SCB_SCR_SLEEPONEXIT_Pos             1U                                            /*!< SCB SCR: SLEEPONEXIT Position */\r
+#define SCB_SCR_SLEEPONEXIT_Msk            (1UL << SCB_SCR_SLEEPONEXIT_Pos)               /*!< SCB SCR: SLEEPONEXIT Mask */\r
+\r
+/* SCB Configuration Control Register Definitions */\r
+#define SCB_CCR_BP_Pos                     18U                                            /*!< SCB CCR: BP Position */\r
+#define SCB_CCR_BP_Msk                     (1UL << SCB_CCR_BP_Pos)                        /*!< SCB CCR: BP Mask */\r
+\r
+#define SCB_CCR_IC_Pos                     17U                                            /*!< SCB CCR: IC Position */\r
+#define SCB_CCR_IC_Msk                     (1UL << SCB_CCR_IC_Pos)                        /*!< SCB CCR: IC Mask */\r
+\r
+#define SCB_CCR_DC_Pos                     16U                                            /*!< SCB CCR: DC Position */\r
+#define SCB_CCR_DC_Msk                     (1UL << SCB_CCR_DC_Pos)                        /*!< SCB CCR: DC Mask */\r
+\r
+#define SCB_CCR_STKOFHFNMIGN_Pos           10U                                            /*!< SCB CCR: STKOFHFNMIGN Position */\r
+#define SCB_CCR_STKOFHFNMIGN_Msk           (1UL << SCB_CCR_STKOFHFNMIGN_Pos)              /*!< SCB CCR: STKOFHFNMIGN Mask */\r
+\r
+#define SCB_CCR_BFHFNMIGN_Pos               8U                                            /*!< SCB CCR: BFHFNMIGN Position */\r
+#define SCB_CCR_BFHFNMIGN_Msk              (1UL << SCB_CCR_BFHFNMIGN_Pos)                 /*!< SCB CCR: BFHFNMIGN Mask */\r
+\r
+#define SCB_CCR_DIV_0_TRP_Pos               4U                                            /*!< SCB CCR: DIV_0_TRP Position */\r
+#define SCB_CCR_DIV_0_TRP_Msk              (1UL << SCB_CCR_DIV_0_TRP_Pos)                 /*!< SCB CCR: DIV_0_TRP Mask */\r
+\r
+#define SCB_CCR_UNALIGN_TRP_Pos             3U                                            /*!< SCB CCR: UNALIGN_TRP Position */\r
+#define SCB_CCR_UNALIGN_TRP_Msk            (1UL << SCB_CCR_UNALIGN_TRP_Pos)               /*!< SCB CCR: UNALIGN_TRP Mask */\r
+\r
+#define SCB_CCR_USERSETMPEND_Pos            1U                                            /*!< SCB CCR: USERSETMPEND Position */\r
+#define SCB_CCR_USERSETMPEND_Msk           (1UL << SCB_CCR_USERSETMPEND_Pos)              /*!< SCB CCR: USERSETMPEND Mask */\r
+\r
+/* SCB System Handler Control and State Register Definitions */\r
+#define SCB_SHCSR_HARDFAULTPENDED_Pos      21U                                            /*!< SCB SHCSR: HARDFAULTPENDED Position */\r
+#define SCB_SHCSR_HARDFAULTPENDED_Msk      (1UL << SCB_SHCSR_HARDFAULTPENDED_Pos)         /*!< SCB SHCSR: HARDFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_SECUREFAULTPENDED_Pos    20U                                            /*!< SCB SHCSR: SECUREFAULTPENDED Position */\r
+#define SCB_SHCSR_SECUREFAULTPENDED_Msk    (1UL << SCB_SHCSR_SECUREFAULTPENDED_Pos)       /*!< SCB SHCSR: SECUREFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_SECUREFAULTENA_Pos       19U                                            /*!< SCB SHCSR: SECUREFAULTENA Position */\r
+#define SCB_SHCSR_SECUREFAULTENA_Msk       (1UL << SCB_SHCSR_SECUREFAULTENA_Pos)          /*!< SCB SHCSR: SECUREFAULTENA Mask */\r
+\r
+#define SCB_SHCSR_USGFAULTENA_Pos          18U                                            /*!< SCB SHCSR: USGFAULTENA Position */\r
+#define SCB_SHCSR_USGFAULTENA_Msk          (1UL << SCB_SHCSR_USGFAULTENA_Pos)             /*!< SCB SHCSR: USGFAULTENA Mask */\r
+\r
+#define SCB_SHCSR_BUSFAULTENA_Pos          17U                                            /*!< SCB SHCSR: BUSFAULTENA Position */\r
+#define SCB_SHCSR_BUSFAULTENA_Msk          (1UL << SCB_SHCSR_BUSFAULTENA_Pos)             /*!< SCB SHCSR: BUSFAULTENA Mask */\r
+\r
+#define SCB_SHCSR_MEMFAULTENA_Pos          16U                                            /*!< SCB SHCSR: MEMFAULTENA Position */\r
+#define SCB_SHCSR_MEMFAULTENA_Msk          (1UL << SCB_SHCSR_MEMFAULTENA_Pos)             /*!< SCB SHCSR: MEMFAULTENA Mask */\r
+\r
+#define SCB_SHCSR_SVCALLPENDED_Pos         15U                                            /*!< SCB SHCSR: SVCALLPENDED Position */\r
+#define SCB_SHCSR_SVCALLPENDED_Msk         (1UL << SCB_SHCSR_SVCALLPENDED_Pos)            /*!< SCB SHCSR: SVCALLPENDED Mask */\r
+\r
+#define SCB_SHCSR_BUSFAULTPENDED_Pos       14U                                            /*!< SCB SHCSR: BUSFAULTPENDED Position */\r
+#define SCB_SHCSR_BUSFAULTPENDED_Msk       (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos)          /*!< SCB SHCSR: BUSFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_MEMFAULTPENDED_Pos       13U                                            /*!< SCB SHCSR: MEMFAULTPENDED Position */\r
+#define SCB_SHCSR_MEMFAULTPENDED_Msk       (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos)          /*!< SCB SHCSR: MEMFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_USGFAULTPENDED_Pos       12U                                            /*!< SCB SHCSR: USGFAULTPENDED Position */\r
+#define SCB_SHCSR_USGFAULTPENDED_Msk       (1UL << SCB_SHCSR_USGFAULTPENDED_Pos)          /*!< SCB SHCSR: USGFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_SYSTICKACT_Pos           11U                                            /*!< SCB SHCSR: SYSTICKACT Position */\r
+#define SCB_SHCSR_SYSTICKACT_Msk           (1UL << SCB_SHCSR_SYSTICKACT_Pos)              /*!< SCB SHCSR: SYSTICKACT Mask */\r
+\r
+#define SCB_SHCSR_PENDSVACT_Pos            10U                                            /*!< SCB SHCSR: PENDSVACT Position */\r
+#define SCB_SHCSR_PENDSVACT_Msk            (1UL << SCB_SHCSR_PENDSVACT_Pos)               /*!< SCB SHCSR: PENDSVACT Mask */\r
+\r
+#define SCB_SHCSR_MONITORACT_Pos            8U                                            /*!< SCB SHCSR: MONITORACT Position */\r
+#define SCB_SHCSR_MONITORACT_Msk           (1UL << SCB_SHCSR_MONITORACT_Pos)              /*!< SCB SHCSR: MONITORACT Mask */\r
+\r
+#define SCB_SHCSR_SVCALLACT_Pos             7U                                            /*!< SCB SHCSR: SVCALLACT Position */\r
+#define SCB_SHCSR_SVCALLACT_Msk            (1UL << SCB_SHCSR_SVCALLACT_Pos)               /*!< SCB SHCSR: SVCALLACT Mask */\r
+\r
+#define SCB_SHCSR_NMIACT_Pos                5U                                            /*!< SCB SHCSR: NMIACT Position */\r
+#define SCB_SHCSR_NMIACT_Msk               (1UL << SCB_SHCSR_NMIACT_Pos)                  /*!< SCB SHCSR: NMIACT Mask */\r
+\r
+#define SCB_SHCSR_SECUREFAULTACT_Pos        4U                                            /*!< SCB SHCSR: SECUREFAULTACT Position */\r
+#define SCB_SHCSR_SECUREFAULTACT_Msk       (1UL << SCB_SHCSR_SECUREFAULTACT_Pos)          /*!< SCB SHCSR: SECUREFAULTACT Mask */\r
+\r
+#define SCB_SHCSR_USGFAULTACT_Pos           3U                                            /*!< SCB SHCSR: USGFAULTACT Position */\r
+#define SCB_SHCSR_USGFAULTACT_Msk          (1UL << SCB_SHCSR_USGFAULTACT_Pos)             /*!< SCB SHCSR: USGFAULTACT Mask */\r
+\r
+#define SCB_SHCSR_HARDFAULTACT_Pos          2U                                            /*!< SCB SHCSR: HARDFAULTACT Position */\r
+#define SCB_SHCSR_HARDFAULTACT_Msk         (1UL << SCB_SHCSR_HARDFAULTACT_Pos)            /*!< SCB SHCSR: HARDFAULTACT Mask */\r
+\r
+#define SCB_SHCSR_BUSFAULTACT_Pos           1U                                            /*!< SCB SHCSR: BUSFAULTACT Position */\r
+#define SCB_SHCSR_BUSFAULTACT_Msk          (1UL << SCB_SHCSR_BUSFAULTACT_Pos)             /*!< SCB SHCSR: BUSFAULTACT Mask */\r
+\r
+#define SCB_SHCSR_MEMFAULTACT_Pos           0U                                            /*!< SCB SHCSR: MEMFAULTACT Position */\r
+#define SCB_SHCSR_MEMFAULTACT_Msk          (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/)         /*!< SCB SHCSR: MEMFAULTACT Mask */\r
+\r
+/* SCB Configurable Fault Status Register Definitions */\r
+#define SCB_CFSR_USGFAULTSR_Pos            16U                                            /*!< SCB CFSR: Usage Fault Status Register Position */\r
+#define SCB_CFSR_USGFAULTSR_Msk            (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos)          /*!< SCB CFSR: Usage Fault Status Register Mask */\r
+\r
+#define SCB_CFSR_BUSFAULTSR_Pos             8U                                            /*!< SCB CFSR: Bus Fault Status Register Position */\r
+#define SCB_CFSR_BUSFAULTSR_Msk            (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos)            /*!< SCB CFSR: Bus Fault Status Register Mask */\r
+\r
+#define SCB_CFSR_MEMFAULTSR_Pos             0U                                            /*!< SCB CFSR: Memory Manage Fault Status Register Position */\r
+#define SCB_CFSR_MEMFAULTSR_Msk            (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/)        /*!< SCB CFSR: Memory Manage Fault Status Register Mask */\r
+\r
+/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */\r
+#define SCB_CFSR_MMARVALID_Pos             (SCB_SHCSR_MEMFAULTACT_Pos + 7U)               /*!< SCB CFSR (MMFSR): MMARVALID Position */\r
+#define SCB_CFSR_MMARVALID_Msk             (1UL << SCB_CFSR_MMARVALID_Pos)                /*!< SCB CFSR (MMFSR): MMARVALID Mask */\r
+\r
+#define SCB_CFSR_MLSPERR_Pos               (SCB_SHCSR_MEMFAULTACT_Pos + 5U)               /*!< SCB CFSR (MMFSR): MLSPERR Position */\r
+#define SCB_CFSR_MLSPERR_Msk               (1UL << SCB_CFSR_MLSPERR_Pos)                  /*!< SCB CFSR (MMFSR): MLSPERR Mask */\r
+\r
+#define SCB_CFSR_MSTKERR_Pos               (SCB_SHCSR_MEMFAULTACT_Pos + 4U)               /*!< SCB CFSR (MMFSR): MSTKERR Position */\r
+#define SCB_CFSR_MSTKERR_Msk               (1UL << SCB_CFSR_MSTKERR_Pos)                  /*!< SCB CFSR (MMFSR): MSTKERR Mask */\r
+\r
+#define SCB_CFSR_MUNSTKERR_Pos             (SCB_SHCSR_MEMFAULTACT_Pos + 3U)               /*!< SCB CFSR (MMFSR): MUNSTKERR Position */\r
+#define SCB_CFSR_MUNSTKERR_Msk             (1UL << SCB_CFSR_MUNSTKERR_Pos)                /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */\r
+\r
+#define SCB_CFSR_DACCVIOL_Pos              (SCB_SHCSR_MEMFAULTACT_Pos + 1U)               /*!< SCB CFSR (MMFSR): DACCVIOL Position */\r
+#define SCB_CFSR_DACCVIOL_Msk              (1UL << SCB_CFSR_DACCVIOL_Pos)                 /*!< SCB CFSR (MMFSR): DACCVIOL Mask */\r
+\r
+#define SCB_CFSR_IACCVIOL_Pos              (SCB_SHCSR_MEMFAULTACT_Pos + 0U)               /*!< SCB CFSR (MMFSR): IACCVIOL Position */\r
+#define SCB_CFSR_IACCVIOL_Msk              (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/)             /*!< SCB CFSR (MMFSR): IACCVIOL Mask */\r
+\r
+/* BusFault Status Register (part of SCB Configurable Fault Status Register) */\r
+#define SCB_CFSR_BFARVALID_Pos            (SCB_CFSR_BUSFAULTSR_Pos + 7U)                  /*!< SCB CFSR (BFSR): BFARVALID Position */\r
+#define SCB_CFSR_BFARVALID_Msk            (1UL << SCB_CFSR_BFARVALID_Pos)                 /*!< SCB CFSR (BFSR): BFARVALID Mask */\r
+\r
+#define SCB_CFSR_LSPERR_Pos               (SCB_CFSR_BUSFAULTSR_Pos + 5U)                  /*!< SCB CFSR (BFSR): LSPERR Position */\r
+#define SCB_CFSR_LSPERR_Msk               (1UL << SCB_CFSR_LSPERR_Pos)                    /*!< SCB CFSR (BFSR): LSPERR Mask */\r
+\r
+#define SCB_CFSR_STKERR_Pos               (SCB_CFSR_BUSFAULTSR_Pos + 4U)                  /*!< SCB CFSR (BFSR): STKERR Position */\r
+#define SCB_CFSR_STKERR_Msk               (1UL << SCB_CFSR_STKERR_Pos)                    /*!< SCB CFSR (BFSR): STKERR Mask */\r
+\r
+#define SCB_CFSR_UNSTKERR_Pos             (SCB_CFSR_BUSFAULTSR_Pos + 3U)                  /*!< SCB CFSR (BFSR): UNSTKERR Position */\r
+#define SCB_CFSR_UNSTKERR_Msk             (1UL << SCB_CFSR_UNSTKERR_Pos)                  /*!< SCB CFSR (BFSR): UNSTKERR Mask */\r
+\r
+#define SCB_CFSR_IMPRECISERR_Pos          (SCB_CFSR_BUSFAULTSR_Pos + 2U)                  /*!< SCB CFSR (BFSR): IMPRECISERR Position */\r
+#define SCB_CFSR_IMPRECISERR_Msk          (1UL << SCB_CFSR_IMPRECISERR_Pos)               /*!< SCB CFSR (BFSR): IMPRECISERR Mask */\r
+\r
+#define SCB_CFSR_PRECISERR_Pos            (SCB_CFSR_BUSFAULTSR_Pos + 1U)                  /*!< SCB CFSR (BFSR): PRECISERR Position */\r
+#define SCB_CFSR_PRECISERR_Msk            (1UL << SCB_CFSR_PRECISERR_Pos)                 /*!< SCB CFSR (BFSR): PRECISERR Mask */\r
+\r
+#define SCB_CFSR_IBUSERR_Pos              (SCB_CFSR_BUSFAULTSR_Pos + 0U)                  /*!< SCB CFSR (BFSR): IBUSERR Position */\r
+#define SCB_CFSR_IBUSERR_Msk              (1UL << SCB_CFSR_IBUSERR_Pos)                   /*!< SCB CFSR (BFSR): IBUSERR Mask */\r
+\r
+/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */\r
+#define SCB_CFSR_DIVBYZERO_Pos            (SCB_CFSR_USGFAULTSR_Pos + 9U)                  /*!< SCB CFSR (UFSR): DIVBYZERO Position */\r
+#define SCB_CFSR_DIVBYZERO_Msk            (1UL << SCB_CFSR_DIVBYZERO_Pos)                 /*!< SCB CFSR (UFSR): DIVBYZERO Mask */\r
+\r
+#define SCB_CFSR_UNALIGNED_Pos            (SCB_CFSR_USGFAULTSR_Pos + 8U)                  /*!< SCB CFSR (UFSR): UNALIGNED Position */\r
+#define SCB_CFSR_UNALIGNED_Msk            (1UL << SCB_CFSR_UNALIGNED_Pos)                 /*!< SCB CFSR (UFSR): UNALIGNED Mask */\r
+\r
+#define SCB_CFSR_STKOF_Pos                (SCB_CFSR_USGFAULTSR_Pos + 4U)                  /*!< SCB CFSR (UFSR): STKOF Position */\r
+#define SCB_CFSR_STKOF_Msk                (1UL << SCB_CFSR_STKOF_Pos)                     /*!< SCB CFSR (UFSR): STKOF Mask */\r
+\r
+#define SCB_CFSR_NOCP_Pos                 (SCB_CFSR_USGFAULTSR_Pos + 3U)                  /*!< SCB CFSR (UFSR): NOCP Position */\r
+#define SCB_CFSR_NOCP_Msk                 (1UL << SCB_CFSR_NOCP_Pos)                      /*!< SCB CFSR (UFSR): NOCP Mask */\r
+\r
+#define SCB_CFSR_INVPC_Pos                (SCB_CFSR_USGFAULTSR_Pos + 2U)                  /*!< SCB CFSR (UFSR): INVPC Position */\r
+#define SCB_CFSR_INVPC_Msk                (1UL << SCB_CFSR_INVPC_Pos)                     /*!< SCB CFSR (UFSR): INVPC Mask */\r
+\r
+#define SCB_CFSR_INVSTATE_Pos             (SCB_CFSR_USGFAULTSR_Pos + 1U)                  /*!< SCB CFSR (UFSR): INVSTATE Position */\r
+#define SCB_CFSR_INVSTATE_Msk             (1UL << SCB_CFSR_INVSTATE_Pos)                  /*!< SCB CFSR (UFSR): INVSTATE Mask */\r
+\r
+#define SCB_CFSR_UNDEFINSTR_Pos           (SCB_CFSR_USGFAULTSR_Pos + 0U)                  /*!< SCB CFSR (UFSR): UNDEFINSTR Position */\r
+#define SCB_CFSR_UNDEFINSTR_Msk           (1UL << SCB_CFSR_UNDEFINSTR_Pos)                /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */\r
+\r
+/* SCB Hard Fault Status Register Definitions */\r
+#define SCB_HFSR_DEBUGEVT_Pos              31U                                            /*!< SCB HFSR: DEBUGEVT Position */\r
+#define SCB_HFSR_DEBUGEVT_Msk              (1UL << SCB_HFSR_DEBUGEVT_Pos)                 /*!< SCB HFSR: DEBUGEVT Mask */\r
+\r
+#define SCB_HFSR_FORCED_Pos                30U                                            /*!< SCB HFSR: FORCED Position */\r
+#define SCB_HFSR_FORCED_Msk                (1UL << SCB_HFSR_FORCED_Pos)                   /*!< SCB HFSR: FORCED Mask */\r
+\r
+#define SCB_HFSR_VECTTBL_Pos                1U                                            /*!< SCB HFSR: VECTTBL Position */\r
+#define SCB_HFSR_VECTTBL_Msk               (1UL << SCB_HFSR_VECTTBL_Pos)                  /*!< SCB HFSR: VECTTBL Mask */\r
+\r
+/* SCB Debug Fault Status Register Definitions */\r
+#define SCB_DFSR_EXTERNAL_Pos               4U                                            /*!< SCB DFSR: EXTERNAL Position */\r
+#define SCB_DFSR_EXTERNAL_Msk              (1UL << SCB_DFSR_EXTERNAL_Pos)                 /*!< SCB DFSR: EXTERNAL Mask */\r
+\r
+#define SCB_DFSR_VCATCH_Pos                 3U                                            /*!< SCB DFSR: VCATCH Position */\r
+#define SCB_DFSR_VCATCH_Msk                (1UL << SCB_DFSR_VCATCH_Pos)                   /*!< SCB DFSR: VCATCH Mask */\r
+\r
+#define SCB_DFSR_DWTTRAP_Pos                2U                                            /*!< SCB DFSR: DWTTRAP Position */\r
+#define SCB_DFSR_DWTTRAP_Msk               (1UL << SCB_DFSR_DWTTRAP_Pos)                  /*!< SCB DFSR: DWTTRAP Mask */\r
+\r
+#define SCB_DFSR_BKPT_Pos                   1U                                            /*!< SCB DFSR: BKPT Position */\r
+#define SCB_DFSR_BKPT_Msk                  (1UL << SCB_DFSR_BKPT_Pos)                     /*!< SCB DFSR: BKPT Mask */\r
+\r
+#define SCB_DFSR_HALTED_Pos                 0U                                            /*!< SCB DFSR: HALTED Position */\r
+#define SCB_DFSR_HALTED_Msk                (1UL /*<< SCB_DFSR_HALTED_Pos*/)               /*!< SCB DFSR: HALTED Mask */\r
+\r
+/* SCB Non-Secure Access Control Register Definitions */\r
+#define SCB_NSACR_CP11_Pos                 11U                                            /*!< SCB NSACR: CP11 Position */\r
+#define SCB_NSACR_CP11_Msk                 (1UL << SCB_NSACR_CP11_Pos)                    /*!< SCB NSACR: CP11 Mask */\r
+\r
+#define SCB_NSACR_CP10_Pos                 10U                                            /*!< SCB NSACR: CP10 Position */\r
+#define SCB_NSACR_CP10_Msk                 (1UL << SCB_NSACR_CP10_Pos)                    /*!< SCB NSACR: CP10 Mask */\r
+\r
+#define SCB_NSACR_CPn_Pos                   0U                                            /*!< SCB NSACR: CPn Position */\r
+#define SCB_NSACR_CPn_Msk                  (1UL /*<< SCB_NSACR_CPn_Pos*/)                 /*!< SCB NSACR: CPn Mask */\r
+\r
+/* SCB Cache Level ID Register Definitions */\r
+#define SCB_CLIDR_LOUU_Pos                 27U                                            /*!< SCB CLIDR: LoUU Position */\r
+#define SCB_CLIDR_LOUU_Msk                 (7UL << SCB_CLIDR_LOUU_Pos)                    /*!< SCB CLIDR: LoUU Mask */\r
+\r
+#define SCB_CLIDR_LOC_Pos                  24U                                            /*!< SCB CLIDR: LoC Position */\r
+#define SCB_CLIDR_LOC_Msk                  (7UL << SCB_CLIDR_LOC_Pos)                     /*!< SCB CLIDR: LoC Mask */\r
+\r
+/* SCB Cache Type Register Definitions */\r
+#define SCB_CTR_FORMAT_Pos                 29U                                            /*!< SCB CTR: Format Position */\r
+#define SCB_CTR_FORMAT_Msk                 (7UL << SCB_CTR_FORMAT_Pos)                    /*!< SCB CTR: Format Mask */\r
+\r
+#define SCB_CTR_CWG_Pos                    24U                                            /*!< SCB CTR: CWG Position */\r
+#define SCB_CTR_CWG_Msk                    (0xFUL << SCB_CTR_CWG_Pos)                     /*!< SCB CTR: CWG Mask */\r
+\r
+#define SCB_CTR_ERG_Pos                    20U                                            /*!< SCB CTR: ERG Position */\r
+#define SCB_CTR_ERG_Msk                    (0xFUL << SCB_CTR_ERG_Pos)                     /*!< SCB CTR: ERG Mask */\r
+\r
+#define SCB_CTR_DMINLINE_Pos               16U                                            /*!< SCB CTR: DminLine Position */\r
+#define SCB_CTR_DMINLINE_Msk               (0xFUL << SCB_CTR_DMINLINE_Pos)                /*!< SCB CTR: DminLine Mask */\r
+\r
+#define SCB_CTR_IMINLINE_Pos                0U                                            /*!< SCB CTR: ImInLine Position */\r
+#define SCB_CTR_IMINLINE_Msk               (0xFUL /*<< SCB_CTR_IMINLINE_Pos*/)            /*!< SCB CTR: ImInLine Mask */\r
+\r
+/* SCB Cache Size ID Register Definitions */\r
+#define SCB_CCSIDR_WT_Pos                  31U                                            /*!< SCB CCSIDR: WT Position */\r
+#define SCB_CCSIDR_WT_Msk                  (1UL << SCB_CCSIDR_WT_Pos)                     /*!< SCB CCSIDR: WT Mask */\r
+\r
+#define SCB_CCSIDR_WB_Pos                  30U                                            /*!< SCB CCSIDR: WB Position */\r
+#define SCB_CCSIDR_WB_Msk                  (1UL << SCB_CCSIDR_WB_Pos)                     /*!< SCB CCSIDR: WB Mask */\r
+\r
+#define SCB_CCSIDR_RA_Pos                  29U                                            /*!< SCB CCSIDR: RA Position */\r
+#define SCB_CCSIDR_RA_Msk                  (1UL << SCB_CCSIDR_RA_Pos)                     /*!< SCB CCSIDR: RA Mask */\r
+\r
+#define SCB_CCSIDR_WA_Pos                  28U                                            /*!< SCB CCSIDR: WA Position */\r
+#define SCB_CCSIDR_WA_Msk                  (1UL << SCB_CCSIDR_WA_Pos)                     /*!< SCB CCSIDR: WA Mask */\r
+\r
+#define SCB_CCSIDR_NUMSETS_Pos             13U                                            /*!< SCB CCSIDR: NumSets Position */\r
+#define SCB_CCSIDR_NUMSETS_Msk             (0x7FFFUL << SCB_CCSIDR_NUMSETS_Pos)           /*!< SCB CCSIDR: NumSets Mask */\r
+\r
+#define SCB_CCSIDR_ASSOCIATIVITY_Pos        3U                                            /*!< SCB CCSIDR: Associativity Position */\r
+#define SCB_CCSIDR_ASSOCIATIVITY_Msk       (0x3FFUL << SCB_CCSIDR_ASSOCIATIVITY_Pos)      /*!< SCB CCSIDR: Associativity Mask */\r
+\r
+#define SCB_CCSIDR_LINESIZE_Pos             0U                                            /*!< SCB CCSIDR: LineSize Position */\r
+#define SCB_CCSIDR_LINESIZE_Msk            (7UL /*<< SCB_CCSIDR_LINESIZE_Pos*/)           /*!< SCB CCSIDR: LineSize Mask */\r
+\r
+/* SCB Cache Size Selection Register Definitions */\r
+#define SCB_CSSELR_LEVEL_Pos                1U                                            /*!< SCB CSSELR: Level Position */\r
+#define SCB_CSSELR_LEVEL_Msk               (7UL << SCB_CSSELR_LEVEL_Pos)                  /*!< SCB CSSELR: Level Mask */\r
+\r
+#define SCB_CSSELR_IND_Pos                  0U                                            /*!< SCB CSSELR: InD Position */\r
+#define SCB_CSSELR_IND_Msk                 (1UL /*<< SCB_CSSELR_IND_Pos*/)                /*!< SCB CSSELR: InD Mask */\r
+\r
+/* SCB Software Triggered Interrupt Register Definitions */\r
+#define SCB_STIR_INTID_Pos                  0U                                            /*!< SCB STIR: INTID Position */\r
+#define SCB_STIR_INTID_Msk                 (0x1FFUL /*<< SCB_STIR_INTID_Pos*/)            /*!< SCB STIR: INTID Mask */\r
+\r
+/* SCB D-Cache Invalidate by Set-way Register Definitions */\r
+#define SCB_DCISW_WAY_Pos                  30U                                            /*!< SCB DCISW: Way Position */\r
+#define SCB_DCISW_WAY_Msk                  (3UL << SCB_DCISW_WAY_Pos)                     /*!< SCB DCISW: Way Mask */\r
+\r
+#define SCB_DCISW_SET_Pos                   5U                                            /*!< SCB DCISW: Set Position */\r
+#define SCB_DCISW_SET_Msk                  (0x1FFUL << SCB_DCISW_SET_Pos)                 /*!< SCB DCISW: Set Mask */\r
+\r
+/* SCB D-Cache Clean by Set-way Register Definitions */\r
+#define SCB_DCCSW_WAY_Pos                  30U                                            /*!< SCB DCCSW: Way Position */\r
+#define SCB_DCCSW_WAY_Msk                  (3UL << SCB_DCCSW_WAY_Pos)                     /*!< SCB DCCSW: Way Mask */\r
+\r
+#define SCB_DCCSW_SET_Pos                   5U                                            /*!< SCB DCCSW: Set Position */\r
+#define SCB_DCCSW_SET_Msk                  (0x1FFUL << SCB_DCCSW_SET_Pos)                 /*!< SCB DCCSW: Set Mask */\r
+\r
+/* SCB D-Cache Clean and Invalidate by Set-way Register Definitions */\r
+#define SCB_DCCISW_WAY_Pos                 30U                                            /*!< SCB DCCISW: Way Position */\r
+#define SCB_DCCISW_WAY_Msk                 (3UL << SCB_DCCISW_WAY_Pos)                    /*!< SCB DCCISW: Way Mask */\r
+\r
+#define SCB_DCCISW_SET_Pos                  5U                                            /*!< SCB DCCISW: Set Position */\r
+#define SCB_DCCISW_SET_Msk                 (0x1FFUL << SCB_DCCISW_SET_Pos)                /*!< SCB DCCISW: Set Mask */\r
+\r
+/* Instruction Tightly-Coupled Memory Control Register Definitions */\r
+#define SCB_ITCMCR_SZ_Pos                   3U                                            /*!< SCB ITCMCR: SZ Position */\r
+#define SCB_ITCMCR_SZ_Msk                  (0xFUL << SCB_ITCMCR_SZ_Pos)                   /*!< SCB ITCMCR: SZ Mask */\r
+\r
+#define SCB_ITCMCR_RETEN_Pos                2U                                            /*!< SCB ITCMCR: RETEN Position */\r
+#define SCB_ITCMCR_RETEN_Msk               (1UL << SCB_ITCMCR_RETEN_Pos)                  /*!< SCB ITCMCR: RETEN Mask */\r
+\r
+#define SCB_ITCMCR_RMW_Pos                  1U                                            /*!< SCB ITCMCR: RMW Position */\r
+#define SCB_ITCMCR_RMW_Msk                 (1UL << SCB_ITCMCR_RMW_Pos)                    /*!< SCB ITCMCR: RMW Mask */\r
+\r
+#define SCB_ITCMCR_EN_Pos                   0U                                            /*!< SCB ITCMCR: EN Position */\r
+#define SCB_ITCMCR_EN_Msk                  (1UL /*<< SCB_ITCMCR_EN_Pos*/)                 /*!< SCB ITCMCR: EN Mask */\r
+\r
+/* Data Tightly-Coupled Memory Control Register Definitions */\r
+#define SCB_DTCMCR_SZ_Pos                   3U                                            /*!< SCB DTCMCR: SZ Position */\r
+#define SCB_DTCMCR_SZ_Msk                  (0xFUL << SCB_DTCMCR_SZ_Pos)                   /*!< SCB DTCMCR: SZ Mask */\r
+\r
+#define SCB_DTCMCR_RETEN_Pos                2U                                            /*!< SCB DTCMCR: RETEN Position */\r
+#define SCB_DTCMCR_RETEN_Msk               (1UL << SCB_DTCMCR_RETEN_Pos)                   /*!< SCB DTCMCR: RETEN Mask */\r
+\r
+#define SCB_DTCMCR_RMW_Pos                  1U                                            /*!< SCB DTCMCR: RMW Position */\r
+#define SCB_DTCMCR_RMW_Msk                 (1UL << SCB_DTCMCR_RMW_Pos)                    /*!< SCB DTCMCR: RMW Mask */\r
+\r
+#define SCB_DTCMCR_EN_Pos                   0U                                            /*!< SCB DTCMCR: EN Position */\r
+#define SCB_DTCMCR_EN_Msk                  (1UL /*<< SCB_DTCMCR_EN_Pos*/)                 /*!< SCB DTCMCR: EN Mask */\r
+\r
+/* AHBP Control Register Definitions */\r
+#define SCB_AHBPCR_SZ_Pos                   1U                                            /*!< SCB AHBPCR: SZ Position */\r
+#define SCB_AHBPCR_SZ_Msk                  (7UL << SCB_AHBPCR_SZ_Pos)                     /*!< SCB AHBPCR: SZ Mask */\r
+\r
+#define SCB_AHBPCR_EN_Pos                   0U                                            /*!< SCB AHBPCR: EN Position */\r
+#define SCB_AHBPCR_EN_Msk                  (1UL /*<< SCB_AHBPCR_EN_Pos*/)                 /*!< SCB AHBPCR: EN Mask */\r
+\r
+/* L1 Cache Control Register Definitions */\r
+#define SCB_CACR_FORCEWT_Pos                2U                                            /*!< SCB CACR: FORCEWT Position */\r
+#define SCB_CACR_FORCEWT_Msk               (1UL << SCB_CACR_FORCEWT_Pos)                  /*!< SCB CACR: FORCEWT Mask */\r
+\r
+#define SCB_CACR_ECCEN_Pos                  1U                                            /*!< SCB CACR: ECCEN Position */\r
+#define SCB_CACR_ECCEN_Msk                 (1UL << SCB_CACR_ECCEN_Pos)                    /*!< SCB CACR: ECCEN Mask */\r
+\r
+#define SCB_CACR_SIWT_Pos                   0U                                            /*!< SCB CACR: SIWT Position */\r
+#define SCB_CACR_SIWT_Msk                  (1UL /*<< SCB_CACR_SIWT_Pos*/)                 /*!< SCB CACR: SIWT Mask */\r
+\r
+/* AHBS Control Register Definitions */\r
+#define SCB_AHBSCR_INITCOUNT_Pos           11U                                            /*!< SCB AHBSCR: INITCOUNT Position */\r
+#define SCB_AHBSCR_INITCOUNT_Msk           (0x1FUL << SCB_AHBPCR_INITCOUNT_Pos)           /*!< SCB AHBSCR: INITCOUNT Mask */\r
+\r
+#define SCB_AHBSCR_TPRI_Pos                 2U                                            /*!< SCB AHBSCR: TPRI Position */\r
+#define SCB_AHBSCR_TPRI_Msk                (0x1FFUL << SCB_AHBPCR_TPRI_Pos)               /*!< SCB AHBSCR: TPRI Mask */\r
+\r
+#define SCB_AHBSCR_CTL_Pos                  0U                                            /*!< SCB AHBSCR: CTL Position*/\r
+#define SCB_AHBSCR_CTL_Msk                 (3UL /*<< SCB_AHBPCR_CTL_Pos*/)                /*!< SCB AHBSCR: CTL Mask */\r
+\r
+/* Auxiliary Bus Fault Status Register Definitions */\r
+#define SCB_ABFSR_AXIMTYPE_Pos              8U                                            /*!< SCB ABFSR: AXIMTYPE Position*/\r
+#define SCB_ABFSR_AXIMTYPE_Msk             (3UL << SCB_ABFSR_AXIMTYPE_Pos)                /*!< SCB ABFSR: AXIMTYPE Mask */\r
+\r
+#define SCB_ABFSR_EPPB_Pos                  4U                                            /*!< SCB ABFSR: EPPB Position*/\r
+#define SCB_ABFSR_EPPB_Msk                 (1UL << SCB_ABFSR_EPPB_Pos)                    /*!< SCB ABFSR: EPPB Mask */\r
+\r
+#define SCB_ABFSR_AXIM_Pos                  3U                                            /*!< SCB ABFSR: AXIM Position*/\r
+#define SCB_ABFSR_AXIM_Msk                 (1UL << SCB_ABFSR_AXIM_Pos)                    /*!< SCB ABFSR: AXIM Mask */\r
+\r
+#define SCB_ABFSR_AHBP_Pos                  2U                                            /*!< SCB ABFSR: AHBP Position*/\r
+#define SCB_ABFSR_AHBP_Msk                 (1UL << SCB_ABFSR_AHBP_Pos)                    /*!< SCB ABFSR: AHBP Mask */\r
+\r
+#define SCB_ABFSR_DTCM_Pos                  1U                                            /*!< SCB ABFSR: DTCM Position*/\r
+#define SCB_ABFSR_DTCM_Msk                 (1UL << SCB_ABFSR_DTCM_Pos)                    /*!< SCB ABFSR: DTCM Mask */\r
+\r
+#define SCB_ABFSR_ITCM_Pos                  0U                                            /*!< SCB ABFSR: ITCM Position*/\r
+#define SCB_ABFSR_ITCM_Msk                 (1UL /*<< SCB_ABFSR_ITCM_Pos*/)                /*!< SCB ABFSR: ITCM Mask */\r
+\r
+/*@} end of group CMSIS_SCB */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB)\r
+  \brief    Type definitions for the System Control and ID Register not in the SCB\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Control and ID Register not in the SCB.\r
+ */\r
+typedef struct\r
+{\r
+        uint32_t RESERVED0[1U];\r
+  __IM  uint32_t ICTR;                   /*!< Offset: 0x004 (R/ )  Interrupt Controller Type Register */\r
+  __IOM uint32_t ACTLR;                  /*!< Offset: 0x008 (R/W)  Auxiliary Control Register */\r
+  __IOM uint32_t CPPWR;                  /*!< Offset: 0x00C (R/W)  Coprocessor Power Control  Register */\r
+} SCnSCB_Type;\r
+\r
+/* Interrupt Controller Type Register Definitions */\r
+#define SCnSCB_ICTR_INTLINESNUM_Pos         0U                                         /*!< ICTR: INTLINESNUM Position */\r
+#define SCnSCB_ICTR_INTLINESNUM_Msk        (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/)  /*!< ICTR: INTLINESNUM Mask */\r
+\r
+/*@} end of group CMSIS_SCnotSCB */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SysTick     System Tick Timer (SysTick)\r
+  \brief    Type definitions for the System Timer Registers.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Timer (SysTick).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  SysTick Control and Status Register */\r
+  __IOM uint32_t LOAD;                   /*!< Offset: 0x004 (R/W)  SysTick Reload Value Register */\r
+  __IOM uint32_t VAL;                    /*!< Offset: 0x008 (R/W)  SysTick Current Value Register */\r
+  __IM  uint32_t CALIB;                  /*!< Offset: 0x00C (R/ )  SysTick Calibration Register */\r
+} SysTick_Type;\r
+\r
+/* SysTick Control / Status Register Definitions */\r
+#define SysTick_CTRL_COUNTFLAG_Pos         16U                                            /*!< SysTick CTRL: COUNTFLAG Position */\r
+#define SysTick_CTRL_COUNTFLAG_Msk         (1UL << SysTick_CTRL_COUNTFLAG_Pos)            /*!< SysTick CTRL: COUNTFLAG Mask */\r
+\r
+#define SysTick_CTRL_CLKSOURCE_Pos          2U                                            /*!< SysTick CTRL: CLKSOURCE Position */\r
+#define SysTick_CTRL_CLKSOURCE_Msk         (1UL << SysTick_CTRL_CLKSOURCE_Pos)            /*!< SysTick CTRL: CLKSOURCE Mask */\r
+\r
+#define SysTick_CTRL_TICKINT_Pos            1U                                            /*!< SysTick CTRL: TICKINT Position */\r
+#define SysTick_CTRL_TICKINT_Msk           (1UL << SysTick_CTRL_TICKINT_Pos)              /*!< SysTick CTRL: TICKINT Mask */\r
+\r
+#define SysTick_CTRL_ENABLE_Pos             0U                                            /*!< SysTick CTRL: ENABLE Position */\r
+#define SysTick_CTRL_ENABLE_Msk            (1UL /*<< SysTick_CTRL_ENABLE_Pos*/)           /*!< SysTick CTRL: ENABLE Mask */\r
+\r
+/* SysTick Reload Register Definitions */\r
+#define SysTick_LOAD_RELOAD_Pos             0U                                            /*!< SysTick LOAD: RELOAD Position */\r
+#define SysTick_LOAD_RELOAD_Msk            (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/)    /*!< SysTick LOAD: RELOAD Mask */\r
+\r
+/* SysTick Current Register Definitions */\r
+#define SysTick_VAL_CURRENT_Pos             0U                                            /*!< SysTick VAL: CURRENT Position */\r
+#define SysTick_VAL_CURRENT_Msk            (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/)    /*!< SysTick VAL: CURRENT Mask */\r
+\r
+/* SysTick Calibration Register Definitions */\r
+#define SysTick_CALIB_NOREF_Pos            31U                                            /*!< SysTick CALIB: NOREF Position */\r
+#define SysTick_CALIB_NOREF_Msk            (1UL << SysTick_CALIB_NOREF_Pos)               /*!< SysTick CALIB: NOREF Mask */\r
+\r
+#define SysTick_CALIB_SKEW_Pos             30U                                            /*!< SysTick CALIB: SKEW Position */\r
+#define SysTick_CALIB_SKEW_Msk             (1UL << SysTick_CALIB_SKEW_Pos)                /*!< SysTick CALIB: SKEW Mask */\r
+\r
+#define SysTick_CALIB_TENMS_Pos             0U                                            /*!< SysTick CALIB: TENMS Position */\r
+#define SysTick_CALIB_TENMS_Msk            (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/)    /*!< SysTick CALIB: TENMS Mask */\r
+\r
+/*@} end of group CMSIS_SysTick */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_ITM     Instrumentation Trace Macrocell (ITM)\r
+  \brief    Type definitions for the Instrumentation Trace Macrocell (ITM)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Instrumentation Trace Macrocell Register (ITM).\r
+ */\r
+typedef struct\r
+{\r
+  __OM  union\r
+  {\r
+    __OM  uint8_t    u8;                 /*!< Offset: 0x000 ( /W)  ITM Stimulus Port 8-bit */\r
+    __OM  uint16_t   u16;                /*!< Offset: 0x000 ( /W)  ITM Stimulus Port 16-bit */\r
+    __OM  uint32_t   u32;                /*!< Offset: 0x000 ( /W)  ITM Stimulus Port 32-bit */\r
+  }  PORT [32U];                         /*!< Offset: 0x000 ( /W)  ITM Stimulus Port Registers */\r
+        uint32_t RESERVED0[864U];\r
+  __IOM uint32_t TER;                    /*!< Offset: 0xE00 (R/W)  ITM Trace Enable Register */\r
+        uint32_t RESERVED1[15U];\r
+  __IOM uint32_t TPR;                    /*!< Offset: 0xE40 (R/W)  ITM Trace Privilege Register */\r
+        uint32_t RESERVED2[15U];\r
+  __IOM uint32_t TCR;                    /*!< Offset: 0xE80 (R/W)  ITM Trace Control Register */\r
+        uint32_t RESERVED3[29U];\r
+  __OM  uint32_t IWR;                    /*!< Offset: 0xEF8 ( /W)  ITM Integration Write Register */\r
+  __IM  uint32_t IRR;                    /*!< Offset: 0xEFC (R/ )  ITM Integration Read Register */\r
+  __IOM uint32_t IMCR;                   /*!< Offset: 0xF00 (R/W)  ITM Integration Mode Control Register */\r
+        uint32_t RESERVED4[43U];\r
+  __OM  uint32_t LAR;                    /*!< Offset: 0xFB0 ( /W)  ITM Lock Access Register */\r
+  __IM  uint32_t LSR;                    /*!< Offset: 0xFB4 (R/ )  ITM Lock Status Register */\r
+        uint32_t RESERVED5[1U];\r
+  __IM  uint32_t DEVARCH;                /*!< Offset: 0xFBC (R/ )  ITM Device Architecture Register */\r
+        uint32_t RESERVED6[4U];\r
+  __IM  uint32_t PID4;                   /*!< Offset: 0xFD0 (R/ )  ITM Peripheral Identification Register #4 */\r
+  __IM  uint32_t PID5;                   /*!< Offset: 0xFD4 (R/ )  ITM Peripheral Identification Register #5 */\r
+  __IM  uint32_t PID6;                   /*!< Offset: 0xFD8 (R/ )  ITM Peripheral Identification Register #6 */\r
+  __IM  uint32_t PID7;                   /*!< Offset: 0xFDC (R/ )  ITM Peripheral Identification Register #7 */\r
+  __IM  uint32_t PID0;                   /*!< Offset: 0xFE0 (R/ )  ITM Peripheral Identification Register #0 */\r
+  __IM  uint32_t PID1;                   /*!< Offset: 0xFE4 (R/ )  ITM Peripheral Identification Register #1 */\r
+  __IM  uint32_t PID2;                   /*!< Offset: 0xFE8 (R/ )  ITM Peripheral Identification Register #2 */\r
+  __IM  uint32_t PID3;                   /*!< Offset: 0xFEC (R/ )  ITM Peripheral Identification Register #3 */\r
+  __IM  uint32_t CID0;                   /*!< Offset: 0xFF0 (R/ )  ITM Component  Identification Register #0 */\r
+  __IM  uint32_t CID1;                   /*!< Offset: 0xFF4 (R/ )  ITM Component  Identification Register #1 */\r
+  __IM  uint32_t CID2;                   /*!< Offset: 0xFF8 (R/ )  ITM Component  Identification Register #2 */\r
+  __IM  uint32_t CID3;                   /*!< Offset: 0xFFC (R/ )  ITM Component  Identification Register #3 */\r
+} ITM_Type;\r
+\r
+/* ITM Stimulus Port Register Definitions */\r
+#define ITM_STIM_DISABLED_Pos               1U                                            /*!< ITM STIM: DISABLED Position */\r
+#define ITM_STIM_DISABLED_Msk              (0x1UL << ITM_STIM_DISABLED_Pos)               /*!< ITM STIM: DISABLED Mask */\r
+\r
+#define ITM_STIM_FIFOREADY_Pos              0U                                            /*!< ITM STIM: FIFOREADY Position */\r
+#define ITM_STIM_FIFOREADY_Msk             (0x1UL /*<< ITM_STIM_FIFOREADY_Pos*/)          /*!< ITM STIM: FIFOREADY Mask */\r
+\r
+/* ITM Trace Privilege Register Definitions */\r
+#define ITM_TPR_PRIVMASK_Pos                0U                                            /*!< ITM TPR: PRIVMASK Position */\r
+#define ITM_TPR_PRIVMASK_Msk               (0xFUL /*<< ITM_TPR_PRIVMASK_Pos*/)            /*!< ITM TPR: PRIVMASK Mask */\r
+\r
+/* ITM Trace Control Register Definitions */\r
+#define ITM_TCR_BUSY_Pos                   23U                                            /*!< ITM TCR: BUSY Position */\r
+#define ITM_TCR_BUSY_Msk                   (1UL << ITM_TCR_BUSY_Pos)                      /*!< ITM TCR: BUSY Mask */\r
+\r
+#define ITM_TCR_TRACEBUSID_Pos             16U                                            /*!< ITM TCR: ATBID Position */\r
+#define ITM_TCR_TRACEBUSID_Msk             (0x7FUL << ITM_TCR_TRACEBUSID_Pos)             /*!< ITM TCR: ATBID Mask */\r
+\r
+#define ITM_TCR_GTSFREQ_Pos                10U                                            /*!< ITM TCR: Global timestamp frequency Position */\r
+#define ITM_TCR_GTSFREQ_Msk                (3UL << ITM_TCR_GTSFREQ_Pos)                   /*!< ITM TCR: Global timestamp frequency Mask */\r
+\r
+#define ITM_TCR_TSPRESCALE_Pos              8U                                            /*!< ITM TCR: TSPRESCALE Position */\r
+#define ITM_TCR_TSPRESCALE_Msk             (3UL << ITM_TCR_TSPRESCALE_Pos)                /*!< ITM TCR: TSPRESCALE Mask */\r
+\r
+#define ITM_TCR_STALLENA_Pos                5U                                            /*!< ITM TCR: STALLENA Position */\r
+#define ITM_TCR_STALLENA_Msk               (1UL << ITM_TCR_STALLENA_Pos)                  /*!< ITM TCR: STALLENA Mask */\r
+\r
+#define ITM_TCR_SWOENA_Pos                  4U                                            /*!< ITM TCR: SWOENA Position */\r
+#define ITM_TCR_SWOENA_Msk                 (1UL << ITM_TCR_SWOENA_Pos)                    /*!< ITM TCR: SWOENA Mask */\r
+\r
+#define ITM_TCR_DWTENA_Pos                  3U                                            /*!< ITM TCR: DWTENA Position */\r
+#define ITM_TCR_DWTENA_Msk                 (1UL << ITM_TCR_DWTENA_Pos)                    /*!< ITM TCR: DWTENA Mask */\r
+\r
+#define ITM_TCR_SYNCENA_Pos                 2U                                            /*!< ITM TCR: SYNCENA Position */\r
+#define ITM_TCR_SYNCENA_Msk                (1UL << ITM_TCR_SYNCENA_Pos)                   /*!< ITM TCR: SYNCENA Mask */\r
+\r
+#define ITM_TCR_TSENA_Pos                   1U                                            /*!< ITM TCR: TSENA Position */\r
+#define ITM_TCR_TSENA_Msk                  (1UL << ITM_TCR_TSENA_Pos)                     /*!< ITM TCR: TSENA Mask */\r
+\r
+#define ITM_TCR_ITMENA_Pos                  0U                                            /*!< ITM TCR: ITM Enable bit Position */\r
+#define ITM_TCR_ITMENA_Msk                 (1UL /*<< ITM_TCR_ITMENA_Pos*/)                /*!< ITM TCR: ITM Enable bit Mask */\r
+\r
+/* ITM Integration Write Register Definitions */\r
+#define ITM_IWR_ATVALIDM_Pos                0U                                            /*!< ITM IWR: ATVALIDM Position */\r
+#define ITM_IWR_ATVALIDM_Msk               (1UL /*<< ITM_IWR_ATVALIDM_Pos*/)              /*!< ITM IWR: ATVALIDM Mask */\r
+\r
+/* ITM Integration Read Register Definitions */\r
+#define ITM_IRR_ATREADYM_Pos                0U                                            /*!< ITM IRR: ATREADYM Position */\r
+#define ITM_IRR_ATREADYM_Msk               (1UL /*<< ITM_IRR_ATREADYM_Pos*/)              /*!< ITM IRR: ATREADYM Mask */\r
+\r
+/* ITM Integration Mode Control Register Definitions */\r
+#define ITM_IMCR_INTEGRATION_Pos            0U                                            /*!< ITM IMCR: INTEGRATION Position */\r
+#define ITM_IMCR_INTEGRATION_Msk           (1UL /*<< ITM_IMCR_INTEGRATION_Pos*/)          /*!< ITM IMCR: INTEGRATION Mask */\r
+\r
+/* ITM Lock Status Register Definitions */\r
+#define ITM_LSR_ByteAcc_Pos                 2U                                            /*!< ITM LSR: ByteAcc Position */\r
+#define ITM_LSR_ByteAcc_Msk                (1UL << ITM_LSR_ByteAcc_Pos)                   /*!< ITM LSR: ByteAcc Mask */\r
+\r
+#define ITM_LSR_Access_Pos                  1U                                            /*!< ITM LSR: Access Position */\r
+#define ITM_LSR_Access_Msk                 (1UL << ITM_LSR_Access_Pos)                    /*!< ITM LSR: Access Mask */\r
+\r
+#define ITM_LSR_Present_Pos                 0U                                            /*!< ITM LSR: Present Position */\r
+#define ITM_LSR_Present_Msk                (1UL /*<< ITM_LSR_Present_Pos*/)               /*!< ITM LSR: Present Mask */\r
+\r
+/*@}*/ /* end of group CMSIS_ITM */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_DWT     Data Watchpoint and Trace (DWT)\r
+  \brief    Type definitions for the Data Watchpoint and Trace (DWT)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Data Watchpoint and Trace Register (DWT).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  Control Register */\r
+  __IOM uint32_t CYCCNT;                 /*!< Offset: 0x004 (R/W)  Cycle Count Register */\r
+  __IOM uint32_t CPICNT;                 /*!< Offset: 0x008 (R/W)  CPI Count Register */\r
+  __IOM uint32_t EXCCNT;                 /*!< Offset: 0x00C (R/W)  Exception Overhead Count Register */\r
+  __IOM uint32_t SLEEPCNT;               /*!< Offset: 0x010 (R/W)  Sleep Count Register */\r
+  __IOM uint32_t LSUCNT;                 /*!< Offset: 0x014 (R/W)  LSU Count Register */\r
+  __IOM uint32_t FOLDCNT;                /*!< Offset: 0x018 (R/W)  Folded-instruction Count Register */\r
+  __IM  uint32_t PCSR;                   /*!< Offset: 0x01C (R/ )  Program Counter Sample Register */\r
+  __IOM uint32_t COMP0;                  /*!< Offset: 0x020 (R/W)  Comparator Register 0 */\r
+        uint32_t RESERVED1[1U];\r
+  __IOM uint32_t FUNCTION0;              /*!< Offset: 0x028 (R/W)  Function Register 0 */\r
+        uint32_t RESERVED2[1U];\r
+  __IOM uint32_t COMP1;                  /*!< Offset: 0x030 (R/W)  Comparator Register 1 */\r
+        uint32_t RESERVED3[1U];\r
+  __IOM uint32_t FUNCTION1;              /*!< Offset: 0x038 (R/W)  Function Register 1 */\r
+        uint32_t RESERVED4[1U];\r
+  __IOM uint32_t COMP2;                  /*!< Offset: 0x040 (R/W)  Comparator Register 2 */\r
+        uint32_t RESERVED5[1U];\r
+  __IOM uint32_t FUNCTION2;              /*!< Offset: 0x048 (R/W)  Function Register 2 */\r
+        uint32_t RESERVED6[1U];\r
+  __IOM uint32_t COMP3;                  /*!< Offset: 0x050 (R/W)  Comparator Register 3 */\r
+        uint32_t RESERVED7[1U];\r
+  __IOM uint32_t FUNCTION3;              /*!< Offset: 0x058 (R/W)  Function Register 3 */\r
+        uint32_t RESERVED8[1U];\r
+  __IOM uint32_t COMP4;                  /*!< Offset: 0x060 (R/W)  Comparator Register 4 */\r
+        uint32_t RESERVED9[1U];\r
+  __IOM uint32_t FUNCTION4;              /*!< Offset: 0x068 (R/W)  Function Register 4 */\r
+        uint32_t RESERVED10[1U];\r
+  __IOM uint32_t COMP5;                  /*!< Offset: 0x070 (R/W)  Comparator Register 5 */\r
+        uint32_t RESERVED11[1U];\r
+  __IOM uint32_t FUNCTION5;              /*!< Offset: 0x078 (R/W)  Function Register 5 */\r
+        uint32_t RESERVED12[1U];\r
+  __IOM uint32_t COMP6;                  /*!< Offset: 0x080 (R/W)  Comparator Register 6 */\r
+        uint32_t RESERVED13[1U];\r
+  __IOM uint32_t FUNCTION6;              /*!< Offset: 0x088 (R/W)  Function Register 6 */\r
+        uint32_t RESERVED14[1U];\r
+  __IOM uint32_t COMP7;                  /*!< Offset: 0x090 (R/W)  Comparator Register 7 */\r
+        uint32_t RESERVED15[1U];\r
+  __IOM uint32_t FUNCTION7;              /*!< Offset: 0x098 (R/W)  Function Register 7 */\r
+        uint32_t RESERVED16[1U];\r
+  __IOM uint32_t COMP8;                  /*!< Offset: 0x0A0 (R/W)  Comparator Register 8 */\r
+        uint32_t RESERVED17[1U];\r
+  __IOM uint32_t FUNCTION8;              /*!< Offset: 0x0A8 (R/W)  Function Register 8 */\r
+        uint32_t RESERVED18[1U];\r
+  __IOM uint32_t COMP9;                  /*!< Offset: 0x0B0 (R/W)  Comparator Register 9 */\r
+        uint32_t RESERVED19[1U];\r
+  __IOM uint32_t FUNCTION9;              /*!< Offset: 0x0B8 (R/W)  Function Register 9 */\r
+        uint32_t RESERVED20[1U];\r
+  __IOM uint32_t COMP10;                 /*!< Offset: 0x0C0 (R/W)  Comparator Register 10 */\r
+        uint32_t RESERVED21[1U];\r
+  __IOM uint32_t FUNCTION10;             /*!< Offset: 0x0C8 (R/W)  Function Register 10 */\r
+        uint32_t RESERVED22[1U];\r
+  __IOM uint32_t COMP11;                 /*!< Offset: 0x0D0 (R/W)  Comparator Register 11 */\r
+        uint32_t RESERVED23[1U];\r
+  __IOM uint32_t FUNCTION11;             /*!< Offset: 0x0D8 (R/W)  Function Register 11 */\r
+        uint32_t RESERVED24[1U];\r
+  __IOM uint32_t COMP12;                 /*!< Offset: 0x0E0 (R/W)  Comparator Register 12 */\r
+        uint32_t RESERVED25[1U];\r
+  __IOM uint32_t FUNCTION12;             /*!< Offset: 0x0E8 (R/W)  Function Register 12 */\r
+        uint32_t RESERVED26[1U];\r
+  __IOM uint32_t COMP13;                 /*!< Offset: 0x0F0 (R/W)  Comparator Register 13 */\r
+        uint32_t RESERVED27[1U];\r
+  __IOM uint32_t FUNCTION13;             /*!< Offset: 0x0F8 (R/W)  Function Register 13 */\r
+        uint32_t RESERVED28[1U];\r
+  __IOM uint32_t COMP14;                 /*!< Offset: 0x100 (R/W)  Comparator Register 14 */\r
+        uint32_t RESERVED29[1U];\r
+  __IOM uint32_t FUNCTION14;             /*!< Offset: 0x108 (R/W)  Function Register 14 */\r
+        uint32_t RESERVED30[1U];\r
+  __IOM uint32_t COMP15;                 /*!< Offset: 0x110 (R/W)  Comparator Register 15 */\r
+        uint32_t RESERVED31[1U];\r
+  __IOM uint32_t FUNCTION15;             /*!< Offset: 0x118 (R/W)  Function Register 15 */\r
+        uint32_t RESERVED32[934U];\r
+  __IM  uint32_t LSR;                    /*!< Offset: 0xFB4 (R  )  Lock Status Register */\r
+        uint32_t RESERVED33[1U];\r
+  __IM  uint32_t DEVARCH;                /*!< Offset: 0xFBC (R/ )  Device Architecture Register */\r
+} DWT_Type;\r
+\r
+/* DWT Control Register Definitions */\r
+#define DWT_CTRL_NUMCOMP_Pos               28U                                         /*!< DWT CTRL: NUMCOMP Position */\r
+#define DWT_CTRL_NUMCOMP_Msk               (0xFUL << DWT_CTRL_NUMCOMP_Pos)             /*!< DWT CTRL: NUMCOMP Mask */\r
+\r
+#define DWT_CTRL_NOTRCPKT_Pos              27U                                         /*!< DWT CTRL: NOTRCPKT Position */\r
+#define DWT_CTRL_NOTRCPKT_Msk              (0x1UL << DWT_CTRL_NOTRCPKT_Pos)            /*!< DWT CTRL: NOTRCPKT Mask */\r
+\r
+#define DWT_CTRL_NOEXTTRIG_Pos             26U                                         /*!< DWT CTRL: NOEXTTRIG Position */\r
+#define DWT_CTRL_NOEXTTRIG_Msk             (0x1UL << DWT_CTRL_NOEXTTRIG_Pos)           /*!< DWT CTRL: NOEXTTRIG Mask */\r
+\r
+#define DWT_CTRL_NOCYCCNT_Pos              25U                                         /*!< DWT CTRL: NOCYCCNT Position */\r
+#define DWT_CTRL_NOCYCCNT_Msk              (0x1UL << DWT_CTRL_NOCYCCNT_Pos)            /*!< DWT CTRL: NOCYCCNT Mask */\r
+\r
+#define DWT_CTRL_NOPRFCNT_Pos              24U                                         /*!< DWT CTRL: NOPRFCNT Position */\r
+#define DWT_CTRL_NOPRFCNT_Msk              (0x1UL << DWT_CTRL_NOPRFCNT_Pos)            /*!< DWT CTRL: NOPRFCNT Mask */\r
+\r
+#define DWT_CTRL_CYCDISS_Pos               23U                                         /*!< DWT CTRL: CYCDISS Position */\r
+#define DWT_CTRL_CYCDISS_Msk               (0x1UL << DWT_CTRL_CYCDISS_Pos)             /*!< DWT CTRL: CYCDISS Mask */\r
+\r
+#define DWT_CTRL_CYCEVTENA_Pos             22U                                         /*!< DWT CTRL: CYCEVTENA Position */\r
+#define DWT_CTRL_CYCEVTENA_Msk             (0x1UL << DWT_CTRL_CYCEVTENA_Pos)           /*!< DWT CTRL: CYCEVTENA Mask */\r
+\r
+#define DWT_CTRL_FOLDEVTENA_Pos            21U                                         /*!< DWT CTRL: FOLDEVTENA Position */\r
+#define DWT_CTRL_FOLDEVTENA_Msk            (0x1UL << DWT_CTRL_FOLDEVTENA_Pos)          /*!< DWT CTRL: FOLDEVTENA Mask */\r
+\r
+#define DWT_CTRL_LSUEVTENA_Pos             20U                                         /*!< DWT CTRL: LSUEVTENA Position */\r
+#define DWT_CTRL_LSUEVTENA_Msk             (0x1UL << DWT_CTRL_LSUEVTENA_Pos)           /*!< DWT CTRL: LSUEVTENA Mask */\r
+\r
+#define DWT_CTRL_SLEEPEVTENA_Pos           19U                                         /*!< DWT CTRL: SLEEPEVTENA Position */\r
+#define DWT_CTRL_SLEEPEVTENA_Msk           (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos)         /*!< DWT CTRL: SLEEPEVTENA Mask */\r
+\r
+#define DWT_CTRL_EXCEVTENA_Pos             18U                                         /*!< DWT CTRL: EXCEVTENA Position */\r
+#define DWT_CTRL_EXCEVTENA_Msk             (0x1UL << DWT_CTRL_EXCEVTENA_Pos)           /*!< DWT CTRL: EXCEVTENA Mask */\r
+\r
+#define DWT_CTRL_CPIEVTENA_Pos             17U                                         /*!< DWT CTRL: CPIEVTENA Position */\r
+#define DWT_CTRL_CPIEVTENA_Msk             (0x1UL << DWT_CTRL_CPIEVTENA_Pos)           /*!< DWT CTRL: CPIEVTENA Mask */\r
+\r
+#define DWT_CTRL_EXCTRCENA_Pos             16U                                         /*!< DWT CTRL: EXCTRCENA Position */\r
+#define DWT_CTRL_EXCTRCENA_Msk             (0x1UL << DWT_CTRL_EXCTRCENA_Pos)           /*!< DWT CTRL: EXCTRCENA Mask */\r
+\r
+#define DWT_CTRL_PCSAMPLENA_Pos            12U                                         /*!< DWT CTRL: PCSAMPLENA Position */\r
+#define DWT_CTRL_PCSAMPLENA_Msk            (0x1UL << DWT_CTRL_PCSAMPLENA_Pos)          /*!< DWT CTRL: PCSAMPLENA Mask */\r
+\r
+#define DWT_CTRL_SYNCTAP_Pos               10U                                         /*!< DWT CTRL: SYNCTAP Position */\r
+#define DWT_CTRL_SYNCTAP_Msk               (0x3UL << DWT_CTRL_SYNCTAP_Pos)             /*!< DWT CTRL: SYNCTAP Mask */\r
+\r
+#define DWT_CTRL_CYCTAP_Pos                 9U                                         /*!< DWT CTRL: CYCTAP Position */\r
+#define DWT_CTRL_CYCTAP_Msk                (0x1UL << DWT_CTRL_CYCTAP_Pos)              /*!< DWT CTRL: CYCTAP Mask */\r
+\r
+#define DWT_CTRL_POSTINIT_Pos               5U                                         /*!< DWT CTRL: POSTINIT Position */\r
+#define DWT_CTRL_POSTINIT_Msk              (0xFUL << DWT_CTRL_POSTINIT_Pos)            /*!< DWT CTRL: POSTINIT Mask */\r
+\r
+#define DWT_CTRL_POSTPRESET_Pos             1U                                         /*!< DWT CTRL: POSTPRESET Position */\r
+#define DWT_CTRL_POSTPRESET_Msk            (0xFUL << DWT_CTRL_POSTPRESET_Pos)          /*!< DWT CTRL: POSTPRESET Mask */\r
+\r
+#define DWT_CTRL_CYCCNTENA_Pos              0U                                         /*!< DWT CTRL: CYCCNTENA Position */\r
+#define DWT_CTRL_CYCCNTENA_Msk             (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/)       /*!< DWT CTRL: CYCCNTENA Mask */\r
+\r
+/* DWT CPI Count Register Definitions */\r
+#define DWT_CPICNT_CPICNT_Pos               0U                                         /*!< DWT CPICNT: CPICNT Position */\r
+#define DWT_CPICNT_CPICNT_Msk              (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/)       /*!< DWT CPICNT: CPICNT Mask */\r
+\r
+/* DWT Exception Overhead Count Register Definitions */\r
+#define DWT_EXCCNT_EXCCNT_Pos               0U                                         /*!< DWT EXCCNT: EXCCNT Position */\r
+#define DWT_EXCCNT_EXCCNT_Msk              (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/)       /*!< DWT EXCCNT: EXCCNT Mask */\r
+\r
+/* DWT Sleep Count Register Definitions */\r
+#define DWT_SLEEPCNT_SLEEPCNT_Pos           0U                                         /*!< DWT SLEEPCNT: SLEEPCNT Position */\r
+#define DWT_SLEEPCNT_SLEEPCNT_Msk          (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/)   /*!< DWT SLEEPCNT: SLEEPCNT Mask */\r
+\r
+/* DWT LSU Count Register Definitions */\r
+#define DWT_LSUCNT_LSUCNT_Pos               0U                                         /*!< DWT LSUCNT: LSUCNT Position */\r
+#define DWT_LSUCNT_LSUCNT_Msk              (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/)       /*!< DWT LSUCNT: LSUCNT Mask */\r
+\r
+/* DWT Folded-instruction Count Register Definitions */\r
+#define DWT_FOLDCNT_FOLDCNT_Pos             0U                                         /*!< DWT FOLDCNT: FOLDCNT Position */\r
+#define DWT_FOLDCNT_FOLDCNT_Msk            (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/)     /*!< DWT FOLDCNT: FOLDCNT Mask */\r
+\r
+/* DWT Comparator Function Register Definitions */\r
+#define DWT_FUNCTION_ID_Pos                27U                                         /*!< DWT FUNCTION: ID Position */\r
+#define DWT_FUNCTION_ID_Msk                (0x1FUL << DWT_FUNCTION_ID_Pos)             /*!< DWT FUNCTION: ID Mask */\r
+\r
+#define DWT_FUNCTION_MATCHED_Pos           24U                                         /*!< DWT FUNCTION: MATCHED Position */\r
+#define DWT_FUNCTION_MATCHED_Msk           (0x1UL << DWT_FUNCTION_MATCHED_Pos)         /*!< DWT FUNCTION: MATCHED Mask */\r
+\r
+#define DWT_FUNCTION_DATAVSIZE_Pos         10U                                         /*!< DWT FUNCTION: DATAVSIZE Position */\r
+#define DWT_FUNCTION_DATAVSIZE_Msk         (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos)       /*!< DWT FUNCTION: DATAVSIZE Mask */\r
+\r
+#define DWT_FUNCTION_ACTION_Pos             4U                                         /*!< DWT FUNCTION: ACTION Position */\r
+#define DWT_FUNCTION_ACTION_Msk            (0x1UL << DWT_FUNCTION_ACTION_Pos)          /*!< DWT FUNCTION: ACTION Mask */\r
+\r
+#define DWT_FUNCTION_MATCH_Pos              0U                                         /*!< DWT FUNCTION: MATCH Position */\r
+#define DWT_FUNCTION_MATCH_Msk             (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/)       /*!< DWT FUNCTION: MATCH Mask */\r
+\r
+/*@}*/ /* end of group CMSIS_DWT */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_TPI     Trace Port Interface (TPI)\r
+  \brief    Type definitions for the Trace Port Interface (TPI)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Trace Port Interface Register (TPI).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t SSPSR;                  /*!< Offset: 0x000 (R/ )  Supported Parallel Port Sizes Register */\r
+  __IOM uint32_t CSPSR;                  /*!< Offset: 0x004 (R/W)  Current Parallel Port Sizes Register */\r
+        uint32_t RESERVED0[2U];\r
+  __IOM uint32_t ACPR;                   /*!< Offset: 0x010 (R/W)  Asynchronous Clock Prescaler Register */\r
+        uint32_t RESERVED1[55U];\r
+  __IOM uint32_t SPPR;                   /*!< Offset: 0x0F0 (R/W)  Selected Pin Protocol Register */\r
+        uint32_t RESERVED2[131U];\r
+  __IM  uint32_t FFSR;                   /*!< Offset: 0x300 (R/ )  Formatter and Flush Status Register */\r
+  __IOM uint32_t FFCR;                   /*!< Offset: 0x304 (R/W)  Formatter and Flush Control Register */\r
+  __IOM uint32_t PSCR;                   /*!< Offset: 0x308 (R/W)  Periodic Synchronization Control Register */\r
+        uint32_t RESERVED3[809U];\r
+  __OM  uint32_t LAR;                    /*!< Offset: 0xFB0 ( /W)  Software Lock Access Register */\r
+  __IM  uint32_t LSR;                    /*!< Offset: 0xFB4 (R/ )  Software Lock Status Register */\r
+        uint32_t RESERVED4[4U];\r
+  __IM  uint32_t TYPE;                   /*!< Offset: 0xFC8 (R/ )  Device Identifier Register */\r
+  __IM  uint32_t DEVTYPE;                /*!< Offset: 0xFCC (R/ )  Device Type Register */\r
+} TPI_Type;\r
+\r
+/* TPI Asynchronous Clock Prescaler Register Definitions */\r
+#define TPI_ACPR_SWOSCALER_Pos              0U                                         /*!< TPI ACPR: SWOSCALER Position */\r
+#define TPI_ACPR_SWOSCALER_Msk             (0xFFFFUL /*<< TPI_ACPR_SWOSCALER_Pos*/)    /*!< TPI ACPR: SWOSCALER Mask */\r
+\r
+/* TPI Selected Pin Protocol Register Definitions */\r
+#define TPI_SPPR_TXMODE_Pos                 0U                                         /*!< TPI SPPR: TXMODE Position */\r
+#define TPI_SPPR_TXMODE_Msk                (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/)          /*!< TPI SPPR: TXMODE Mask */\r
+\r
+/* TPI Formatter and Flush Status Register Definitions */\r
+#define TPI_FFSR_FtNonStop_Pos              3U                                         /*!< TPI FFSR: FtNonStop Position */\r
+#define TPI_FFSR_FtNonStop_Msk             (0x1UL << TPI_FFSR_FtNonStop_Pos)           /*!< TPI FFSR: FtNonStop Mask */\r
+\r
+#define TPI_FFSR_TCPresent_Pos              2U                                         /*!< TPI FFSR: TCPresent Position */\r
+#define TPI_FFSR_TCPresent_Msk             (0x1UL << TPI_FFSR_TCPresent_Pos)           /*!< TPI FFSR: TCPresent Mask */\r
+\r
+#define TPI_FFSR_FtStopped_Pos              1U                                         /*!< TPI FFSR: FtStopped Position */\r
+#define TPI_FFSR_FtStopped_Msk             (0x1UL << TPI_FFSR_FtStopped_Pos)           /*!< TPI FFSR: FtStopped Mask */\r
+\r
+#define TPI_FFSR_FlInProg_Pos               0U                                         /*!< TPI FFSR: FlInProg Position */\r
+#define TPI_FFSR_FlInProg_Msk              (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/)        /*!< TPI FFSR: FlInProg Mask */\r
+\r
+/* TPI Formatter and Flush Control Register Definitions */\r
+#define TPI_FFCR_TrigIn_Pos                 8U                                         /*!< TPI FFCR: TrigIn Position */\r
+#define TPI_FFCR_TrigIn_Msk                (0x1UL << TPI_FFCR_TrigIn_Pos)              /*!< TPI FFCR: TrigIn Mask */\r
+\r
+#define TPI_FFCR_FOnMan_Pos                 6U                                         /*!< TPI FFCR: FOnMan Position */\r
+#define TPI_FFCR_FOnMan_Msk                (0x1UL << TPI_FFCR_FOnMan_Pos)              /*!< TPI FFCR: FOnMan Mask */\r
+\r
+#define TPI_FFCR_EnFCont_Pos                1U                                         /*!< TPI FFCR: EnFCont Position */\r
+#define TPI_FFCR_EnFCont_Msk               (0x1UL << TPI_FFCR_EnFCont_Pos)             /*!< TPI FFCR: EnFCont Mask */\r
+\r
+/* TPI Periodic Synchronization Control Register Definitions */\r
+#define TPI_PSCR_PSCount_Pos                0U                                         /*!< TPI PSCR: PSCount Position */\r
+#define TPI_PSCR_PSCount_Msk               (0x1FUL /*<< TPI_PSCR_PSCount_Pos*/)        /*!< TPI PSCR: TPSCount Mask */\r
+\r
+/* TPI Software Lock Status Register Definitions */\r
+#define TPI_LSR_nTT_Pos                     1U                                         /*!< TPI LSR: Not thirty-two bit. Position */\r
+#define TPI_LSR_nTT_Msk                    (0x1UL << TPI_LSR_nTT_Pos)                  /*!< TPI LSR: Not thirty-two bit. Mask */\r
+\r
+#define TPI_LSR_SLK_Pos                     1U                                         /*!< TPI LSR: Software Lock status Position */\r
+#define TPI_LSR_SLK_Msk                    (0x1UL << TPI_LSR_SLK_Pos)                  /*!< TPI LSR: Software Lock status Mask */\r
+\r
+#define TPI_LSR_SLI_Pos                     0U                                         /*!< TPI LSR: Software Lock implemented Position */\r
+#define TPI_LSR_SLI_Msk                    (0x1UL /*<< TPI_LSR_SLI_Pos*/)              /*!< TPI LSR: Software Lock implemented Mask */\r
+\r
+/* TPI DEVID Register Definitions */\r
+#define TPI_DEVID_NRZVALID_Pos             11U                                         /*!< TPI DEVID: NRZVALID Position */\r
+#define TPI_DEVID_NRZVALID_Msk             (0x1UL << TPI_DEVID_NRZVALID_Pos)           /*!< TPI DEVID: NRZVALID Mask */\r
+\r
+#define TPI_DEVID_MANCVALID_Pos            10U                                         /*!< TPI DEVID: MANCVALID Position */\r
+#define TPI_DEVID_MANCVALID_Msk            (0x1UL << TPI_DEVID_MANCVALID_Pos)          /*!< TPI DEVID: MANCVALID Mask */\r
+\r
+#define TPI_DEVID_PTINVALID_Pos             9U                                         /*!< TPI DEVID: PTINVALID Position */\r
+#define TPI_DEVID_PTINVALID_Msk            (0x1UL << TPI_DEVID_PTINVALID_Pos)          /*!< TPI DEVID: PTINVALID Mask */\r
+\r
+#define TPI_DEVID_FIFOSZ_Pos                6U                                         /*!< TPI DEVID: FIFO depth Position */\r
+#define TPI_DEVID_FIFOSZ_Msk               (0x7UL << TPI_DEVID_FIFOSZ_Pos)             /*!< TPI DEVID: FIFO depth Mask */\r
+\r
+/* TPI DEVTYPE Register Definitions */\r
+#define TPI_DEVTYPE_SubType_Pos             4U                                         /*!< TPI DEVTYPE: SubType Position */\r
+#define TPI_DEVTYPE_SubType_Msk            (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/)      /*!< TPI DEVTYPE: SubType Mask */\r
+\r
+#define TPI_DEVTYPE_MajorType_Pos           0U                                         /*!< TPI DEVTYPE: MajorType Position */\r
+#define TPI_DEVTYPE_MajorType_Msk          (0xFUL << TPI_DEVTYPE_MajorType_Pos)        /*!< TPI DEVTYPE: MajorType Mask */\r
+\r
+/*@}*/ /* end of group CMSIS_TPI */\r
+\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_MPU     Memory Protection Unit (MPU)\r
+  \brief    Type definitions for the Memory Protection Unit (MPU)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Memory Protection Unit (MPU).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t TYPE;                   /*!< Offset: 0x000 (R/ )  MPU Type Register */\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x004 (R/W)  MPU Control Register */\r
+  __IOM uint32_t RNR;                    /*!< Offset: 0x008 (R/W)  MPU Region Number Register */\r
+  __IOM uint32_t RBAR;                   /*!< Offset: 0x00C (R/W)  MPU Region Base Address Register */\r
+  __IOM uint32_t RLAR;                   /*!< Offset: 0x010 (R/W)  MPU Region Limit Address Register */\r
+  __IOM uint32_t RBAR_A1;                /*!< Offset: 0x014 (R/W)  MPU Region Base Address Register Alias 1 */\r
+  __IOM uint32_t RLAR_A1;                /*!< Offset: 0x018 (R/W)  MPU Region Limit Address Register Alias 1 */\r
+  __IOM uint32_t RBAR_A2;                /*!< Offset: 0x01C (R/W)  MPU Region Base Address Register Alias 2 */\r
+  __IOM uint32_t RLAR_A2;                /*!< Offset: 0x020 (R/W)  MPU Region Limit Address Register Alias 2 */\r
+  __IOM uint32_t RBAR_A3;                /*!< Offset: 0x024 (R/W)  MPU Region Base Address Register Alias 3 */\r
+  __IOM uint32_t RLAR_A3;                /*!< Offset: 0x028 (R/W)  MPU Region Limit Address Register Alias 3 */\r
+        uint32_t RESERVED0[1];\r
+  union {\r
+  __IOM uint32_t MAIR[2];\r
+  struct {\r
+  __IOM uint32_t MAIR0;                  /*!< Offset: 0x030 (R/W)  MPU Memory Attribute Indirection Register 0 */\r
+  __IOM uint32_t MAIR1;                  /*!< Offset: 0x034 (R/W)  MPU Memory Attribute Indirection Register 1 */\r
+  };\r
+  };\r
+} MPU_Type;\r
+\r
+#define MPU_TYPE_RALIASES                  4U\r
+\r
+/* MPU Type Register Definitions */\r
+#define MPU_TYPE_IREGION_Pos               16U                                            /*!< MPU TYPE: IREGION Position */\r
+#define MPU_TYPE_IREGION_Msk               (0xFFUL << MPU_TYPE_IREGION_Pos)               /*!< MPU TYPE: IREGION Mask */\r
+\r
+#define MPU_TYPE_DREGION_Pos                8U                                            /*!< MPU TYPE: DREGION Position */\r
+#define MPU_TYPE_DREGION_Msk               (0xFFUL << MPU_TYPE_DREGION_Pos)               /*!< MPU TYPE: DREGION Mask */\r
+\r
+#define MPU_TYPE_SEPARATE_Pos               0U                                            /*!< MPU TYPE: SEPARATE Position */\r
+#define MPU_TYPE_SEPARATE_Msk              (1UL /*<< MPU_TYPE_SEPARATE_Pos*/)             /*!< MPU TYPE: SEPARATE Mask */\r
+\r
+/* MPU Control Register Definitions */\r
+#define MPU_CTRL_PRIVDEFENA_Pos             2U                                            /*!< MPU CTRL: PRIVDEFENA Position */\r
+#define MPU_CTRL_PRIVDEFENA_Msk            (1UL << MPU_CTRL_PRIVDEFENA_Pos)               /*!< MPU CTRL: PRIVDEFENA Mask */\r
+\r
+#define MPU_CTRL_HFNMIENA_Pos               1U                                            /*!< MPU CTRL: HFNMIENA Position */\r
+#define MPU_CTRL_HFNMIENA_Msk              (1UL << MPU_CTRL_HFNMIENA_Pos)                 /*!< MPU CTRL: HFNMIENA Mask */\r
+\r
+#define MPU_CTRL_ENABLE_Pos                 0U                                            /*!< MPU CTRL: ENABLE Position */\r
+#define MPU_CTRL_ENABLE_Msk                (1UL /*<< MPU_CTRL_ENABLE_Pos*/)               /*!< MPU CTRL: ENABLE Mask */\r
+\r
+/* MPU Region Number Register Definitions */\r
+#define MPU_RNR_REGION_Pos                  0U                                            /*!< MPU RNR: REGION Position */\r
+#define MPU_RNR_REGION_Msk                 (0xFFUL /*<< MPU_RNR_REGION_Pos*/)             /*!< MPU RNR: REGION Mask */\r
+\r
+/* MPU Region Base Address Register Definitions */\r
+#define MPU_RBAR_BASE_Pos                   5U                                            /*!< MPU RBAR: BASE Position */\r
+#define MPU_RBAR_BASE_Msk                  (0x7FFFFFFUL << MPU_RBAR_BASE_Pos)             /*!< MPU RBAR: BASE Mask */\r
+\r
+#define MPU_RBAR_SH_Pos                     3U                                            /*!< MPU RBAR: SH Position */\r
+#define MPU_RBAR_SH_Msk                    (0x3UL << MPU_RBAR_SH_Pos)                     /*!< MPU RBAR: SH Mask */\r
+\r
+#define MPU_RBAR_AP_Pos                     1U                                            /*!< MPU RBAR: AP Position */\r
+#define MPU_RBAR_AP_Msk                    (0x3UL << MPU_RBAR_AP_Pos)                     /*!< MPU RBAR: AP Mask */\r
+\r
+#define MPU_RBAR_XN_Pos                     0U                                            /*!< MPU RBAR: XN Position */\r
+#define MPU_RBAR_XN_Msk                    (01UL /*<< MPU_RBAR_XN_Pos*/)                  /*!< MPU RBAR: XN Mask */\r
+\r
+/* MPU Region Limit Address Register Definitions */\r
+#define MPU_RLAR_LIMIT_Pos                  5U                                            /*!< MPU RLAR: LIMIT Position */\r
+#define MPU_RLAR_LIMIT_Msk                 (0x7FFFFFFUL << MPU_RLAR_LIMIT_Pos)            /*!< MPU RLAR: LIMIT Mask */\r
+\r
+#define MPU_RLAR_AttrIndx_Pos               1U                                            /*!< MPU RLAR: AttrIndx Position */\r
+#define MPU_RLAR_AttrIndx_Msk              (0x7UL << MPU_RLAR_AttrIndx_Pos)               /*!< MPU RLAR: AttrIndx Mask */\r
+\r
+#define MPU_RLAR_EN_Pos                     0U                                            /*!< MPU RLAR: Region enable bit Position */\r
+#define MPU_RLAR_EN_Msk                    (1UL /*<< MPU_RLAR_EN_Pos*/)                   /*!< MPU RLAR: Region enable bit Disable Mask */\r
+\r
+/* MPU Memory Attribute Indirection Register 0 Definitions */\r
+#define MPU_MAIR0_Attr3_Pos                24U                                            /*!< MPU MAIR0: Attr3 Position */\r
+#define MPU_MAIR0_Attr3_Msk                (0xFFUL << MPU_MAIR0_Attr3_Pos)                /*!< MPU MAIR0: Attr3 Mask */\r
+\r
+#define MPU_MAIR0_Attr2_Pos                16U                                            /*!< MPU MAIR0: Attr2 Position */\r
+#define MPU_MAIR0_Attr2_Msk                (0xFFUL << MPU_MAIR0_Attr2_Pos)                /*!< MPU MAIR0: Attr2 Mask */\r
+\r
+#define MPU_MAIR0_Attr1_Pos                 8U                                            /*!< MPU MAIR0: Attr1 Position */\r
+#define MPU_MAIR0_Attr1_Msk                (0xFFUL << MPU_MAIR0_Attr1_Pos)                /*!< MPU MAIR0: Attr1 Mask */\r
+\r
+#define MPU_MAIR0_Attr0_Pos                 0U                                            /*!< MPU MAIR0: Attr0 Position */\r
+#define MPU_MAIR0_Attr0_Msk                (0xFFUL /*<< MPU_MAIR0_Attr0_Pos*/)            /*!< MPU MAIR0: Attr0 Mask */\r
+\r
+/* MPU Memory Attribute Indirection Register 1 Definitions */\r
+#define MPU_MAIR1_Attr7_Pos                24U                                            /*!< MPU MAIR1: Attr7 Position */\r
+#define MPU_MAIR1_Attr7_Msk                (0xFFUL << MPU_MAIR1_Attr7_Pos)                /*!< MPU MAIR1: Attr7 Mask */\r
+\r
+#define MPU_MAIR1_Attr6_Pos                16U                                            /*!< MPU MAIR1: Attr6 Position */\r
+#define MPU_MAIR1_Attr6_Msk                (0xFFUL << MPU_MAIR1_Attr6_Pos)                /*!< MPU MAIR1: Attr6 Mask */\r
+\r
+#define MPU_MAIR1_Attr5_Pos                 8U                                            /*!< MPU MAIR1: Attr5 Position */\r
+#define MPU_MAIR1_Attr5_Msk                (0xFFUL << MPU_MAIR1_Attr5_Pos)                /*!< MPU MAIR1: Attr5 Mask */\r
+\r
+#define MPU_MAIR1_Attr4_Pos                 0U                                            /*!< MPU MAIR1: Attr4 Position */\r
+#define MPU_MAIR1_Attr4_Msk                (0xFFUL /*<< MPU_MAIR1_Attr4_Pos*/)            /*!< MPU MAIR1: Attr4 Mask */\r
+\r
+/*@} end of group CMSIS_MPU */\r
+#endif\r
+\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SAU     Security Attribution Unit (SAU)\r
+  \brief    Type definitions for the Security Attribution Unit (SAU)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Security Attribution Unit (SAU).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  SAU Control Register */\r
+  __IM  uint32_t TYPE;                   /*!< Offset: 0x004 (R/ )  SAU Type Register */\r
+#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U)\r
+  __IOM uint32_t RNR;                    /*!< Offset: 0x008 (R/W)  SAU Region Number Register */\r
+  __IOM uint32_t RBAR;                   /*!< Offset: 0x00C (R/W)  SAU Region Base Address Register */\r
+  __IOM uint32_t RLAR;                   /*!< Offset: 0x010 (R/W)  SAU Region Limit Address Register */\r
+#else\r
+        uint32_t RESERVED0[3];\r
+#endif\r
+  __IOM uint32_t SFSR;                   /*!< Offset: 0x014 (R/W)  Secure Fault Status Register */\r
+  __IOM uint32_t SFAR;                   /*!< Offset: 0x018 (R/W)  Secure Fault Address Register */\r
+} SAU_Type;\r
+\r
+/* SAU Control Register Definitions */\r
+#define SAU_CTRL_ALLNS_Pos                  1U                                            /*!< SAU CTRL: ALLNS Position */\r
+#define SAU_CTRL_ALLNS_Msk                 (1UL << SAU_CTRL_ALLNS_Pos)                    /*!< SAU CTRL: ALLNS Mask */\r
+\r
+#define SAU_CTRL_ENABLE_Pos                 0U                                            /*!< SAU CTRL: ENABLE Position */\r
+#define SAU_CTRL_ENABLE_Msk                (1UL /*<< SAU_CTRL_ENABLE_Pos*/)               /*!< SAU CTRL: ENABLE Mask */\r
+\r
+/* SAU Type Register Definitions */\r
+#define SAU_TYPE_SREGION_Pos                0U                                            /*!< SAU TYPE: SREGION Position */\r
+#define SAU_TYPE_SREGION_Msk               (0xFFUL /*<< SAU_TYPE_SREGION_Pos*/)           /*!< SAU TYPE: SREGION Mask */\r
+\r
+#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U)\r
+/* SAU Region Number Register Definitions */\r
+#define SAU_RNR_REGION_Pos                  0U                                            /*!< SAU RNR: REGION Position */\r
+#define SAU_RNR_REGION_Msk                 (0xFFUL /*<< SAU_RNR_REGION_Pos*/)             /*!< SAU RNR: REGION Mask */\r
+\r
+/* SAU Region Base Address Register Definitions */\r
+#define SAU_RBAR_BADDR_Pos                  5U                                            /*!< SAU RBAR: BADDR Position */\r
+#define SAU_RBAR_BADDR_Msk                 (0x7FFFFFFUL << SAU_RBAR_BADDR_Pos)            /*!< SAU RBAR: BADDR Mask */\r
+\r
+/* SAU Region Limit Address Register Definitions */\r
+#define SAU_RLAR_LADDR_Pos                  5U                                            /*!< SAU RLAR: LADDR Position */\r
+#define SAU_RLAR_LADDR_Msk                 (0x7FFFFFFUL << SAU_RLAR_LADDR_Pos)            /*!< SAU RLAR: LADDR Mask */\r
+\r
+#define SAU_RLAR_NSC_Pos                    1U                                            /*!< SAU RLAR: NSC Position */\r
+#define SAU_RLAR_NSC_Msk                   (1UL << SAU_RLAR_NSC_Pos)                      /*!< SAU RLAR: NSC Mask */\r
+\r
+#define SAU_RLAR_ENABLE_Pos                 0U                                            /*!< SAU RLAR: ENABLE Position */\r
+#define SAU_RLAR_ENABLE_Msk                (1UL /*<< SAU_RLAR_ENABLE_Pos*/)               /*!< SAU RLAR: ENABLE Mask */\r
+\r
+#endif /* defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) */\r
+\r
+/* Secure Fault Status Register Definitions */\r
+#define SAU_SFSR_LSERR_Pos                  7U                                            /*!< SAU SFSR: LSERR Position */\r
+#define SAU_SFSR_LSERR_Msk                 (1UL << SAU_SFSR_LSERR_Pos)                    /*!< SAU SFSR: LSERR Mask */\r
+\r
+#define SAU_SFSR_SFARVALID_Pos              6U                                            /*!< SAU SFSR: SFARVALID Position */\r
+#define SAU_SFSR_SFARVALID_Msk             (1UL << SAU_SFSR_SFARVALID_Pos)                /*!< SAU SFSR: SFARVALID Mask */\r
+\r
+#define SAU_SFSR_LSPERR_Pos                 5U                                            /*!< SAU SFSR: LSPERR Position */\r
+#define SAU_SFSR_LSPERR_Msk                (1UL << SAU_SFSR_LSPERR_Pos)                   /*!< SAU SFSR: LSPERR Mask */\r
+\r
+#define SAU_SFSR_INVTRAN_Pos                4U                                            /*!< SAU SFSR: INVTRAN Position */\r
+#define SAU_SFSR_INVTRAN_Msk               (1UL << SAU_SFSR_INVTRAN_Pos)                  /*!< SAU SFSR: INVTRAN Mask */\r
+\r
+#define SAU_SFSR_AUVIOL_Pos                 3U                                            /*!< SAU SFSR: AUVIOL Position */\r
+#define SAU_SFSR_AUVIOL_Msk                (1UL << SAU_SFSR_AUVIOL_Pos)                   /*!< SAU SFSR: AUVIOL Mask */\r
+\r
+#define SAU_SFSR_INVER_Pos                  2U                                            /*!< SAU SFSR: INVER Position */\r
+#define SAU_SFSR_INVER_Msk                 (1UL << SAU_SFSR_INVER_Pos)                    /*!< SAU SFSR: INVER Mask */\r
+\r
+#define SAU_SFSR_INVIS_Pos                  1U                                            /*!< SAU SFSR: INVIS Position */\r
+#define SAU_SFSR_INVIS_Msk                 (1UL << SAU_SFSR_INVIS_Pos)                    /*!< SAU SFSR: INVIS Mask */\r
+\r
+#define SAU_SFSR_INVEP_Pos                  0U                                            /*!< SAU SFSR: INVEP Position */\r
+#define SAU_SFSR_INVEP_Msk                 (1UL /*<< SAU_SFSR_INVEP_Pos*/)                /*!< SAU SFSR: INVEP Mask */\r
+\r
+/*@} end of group CMSIS_SAU */\r
+#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_FPU     Floating Point Unit (FPU)\r
+  \brief    Type definitions for the Floating Point Unit (FPU)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Floating Point Unit (FPU).\r
+ */\r
+typedef struct\r
+{\r
+        uint32_t RESERVED0[1U];\r
+  __IOM uint32_t FPCCR;                  /*!< Offset: 0x004 (R/W)  Floating-Point Context Control Register */\r
+  __IOM uint32_t FPCAR;                  /*!< Offset: 0x008 (R/W)  Floating-Point Context Address Register */\r
+  __IOM uint32_t FPDSCR;                 /*!< Offset: 0x00C (R/W)  Floating-Point Default Status Control Register */\r
+  __IM  uint32_t MVFR0;                  /*!< Offset: 0x010 (R/ )  Media and FP Feature Register 0 */\r
+  __IM  uint32_t MVFR1;                  /*!< Offset: 0x014 (R/ )  Media and FP Feature Register 1 */\r
+} FPU_Type;\r
+\r
+/* Floating-Point Context Control Register Definitions */\r
+#define FPU_FPCCR_ASPEN_Pos                31U                                            /*!< FPCCR: ASPEN bit Position */\r
+#define FPU_FPCCR_ASPEN_Msk                (1UL << FPU_FPCCR_ASPEN_Pos)                   /*!< FPCCR: ASPEN bit Mask */\r
+\r
+#define FPU_FPCCR_LSPEN_Pos                30U                                            /*!< FPCCR: LSPEN Position */\r
+#define FPU_FPCCR_LSPEN_Msk                (1UL << FPU_FPCCR_LSPEN_Pos)                   /*!< FPCCR: LSPEN bit Mask */\r
+\r
+#define FPU_FPCCR_LSPENS_Pos               29U                                            /*!< FPCCR: LSPENS Position */\r
+#define FPU_FPCCR_LSPENS_Msk               (1UL << FPU_FPCCR_LSPENS_Pos)                  /*!< FPCCR: LSPENS bit Mask */\r
+\r
+#define FPU_FPCCR_CLRONRET_Pos             28U                                            /*!< FPCCR: CLRONRET Position */\r
+#define FPU_FPCCR_CLRONRET_Msk             (1UL << FPU_FPCCR_CLRONRET_Pos)                /*!< FPCCR: CLRONRET bit Mask */\r
+\r
+#define FPU_FPCCR_CLRONRETS_Pos            27U                                            /*!< FPCCR: CLRONRETS Position */\r
+#define FPU_FPCCR_CLRONRETS_Msk            (1UL << FPU_FPCCR_CLRONRETS_Pos)               /*!< FPCCR: CLRONRETS bit Mask */\r
+\r
+#define FPU_FPCCR_TS_Pos                   26U                                            /*!< FPCCR: TS Position */\r
+#define FPU_FPCCR_TS_Msk                   (1UL << FPU_FPCCR_TS_Pos)                      /*!< FPCCR: TS bit Mask */\r
+\r
+#define FPU_FPCCR_UFRDY_Pos                10U                                            /*!< FPCCR: UFRDY Position */\r
+#define FPU_FPCCR_UFRDY_Msk                (1UL << FPU_FPCCR_UFRDY_Pos)                   /*!< FPCCR: UFRDY bit Mask */\r
+\r
+#define FPU_FPCCR_SPLIMVIOL_Pos             9U                                            /*!< FPCCR: SPLIMVIOL Position */\r
+#define FPU_FPCCR_SPLIMVIOL_Msk            (1UL << FPU_FPCCR_SPLIMVIOL_Pos)               /*!< FPCCR: SPLIMVIOL bit Mask */\r
+\r
+#define FPU_FPCCR_MONRDY_Pos                8U                                            /*!< FPCCR: MONRDY Position */\r
+#define FPU_FPCCR_MONRDY_Msk               (1UL << FPU_FPCCR_MONRDY_Pos)                  /*!< FPCCR: MONRDY bit Mask */\r
+\r
+#define FPU_FPCCR_SFRDY_Pos                 7U                                            /*!< FPCCR: SFRDY Position */\r
+#define FPU_FPCCR_SFRDY_Msk                (1UL << FPU_FPCCR_SFRDY_Pos)                   /*!< FPCCR: SFRDY bit Mask */\r
+\r
+#define FPU_FPCCR_BFRDY_Pos                 6U                                            /*!< FPCCR: BFRDY Position */\r
+#define FPU_FPCCR_BFRDY_Msk                (1UL << FPU_FPCCR_BFRDY_Pos)                   /*!< FPCCR: BFRDY bit Mask */\r
+\r
+#define FPU_FPCCR_MMRDY_Pos                 5U                                            /*!< FPCCR: MMRDY Position */\r
+#define FPU_FPCCR_MMRDY_Msk                (1UL << FPU_FPCCR_MMRDY_Pos)                   /*!< FPCCR: MMRDY bit Mask */\r
+\r
+#define FPU_FPCCR_HFRDY_Pos                 4U                                            /*!< FPCCR: HFRDY Position */\r
+#define FPU_FPCCR_HFRDY_Msk                (1UL << FPU_FPCCR_HFRDY_Pos)                   /*!< FPCCR: HFRDY bit Mask */\r
+\r
+#define FPU_FPCCR_THREAD_Pos                3U                                            /*!< FPCCR: processor mode bit Position */\r
+#define FPU_FPCCR_THREAD_Msk               (1UL << FPU_FPCCR_THREAD_Pos)                  /*!< FPCCR: processor mode active bit Mask */\r
+\r
+#define FPU_FPCCR_S_Pos                     2U                                            /*!< FPCCR: Security status of the FP context bit Position */\r
+#define FPU_FPCCR_S_Msk                    (1UL << FPU_FPCCR_S_Pos)                       /*!< FPCCR: Security status of the FP context bit Mask */\r
+\r
+#define FPU_FPCCR_USER_Pos                  1U                                            /*!< FPCCR: privilege level bit Position */\r
+#define FPU_FPCCR_USER_Msk                 (1UL << FPU_FPCCR_USER_Pos)                    /*!< FPCCR: privilege level bit Mask */\r
+\r
+#define FPU_FPCCR_LSPACT_Pos                0U                                            /*!< FPCCR: Lazy state preservation active bit Position */\r
+#define FPU_FPCCR_LSPACT_Msk               (1UL /*<< FPU_FPCCR_LSPACT_Pos*/)              /*!< FPCCR: Lazy state preservation active bit Mask */\r
+\r
+/* Floating-Point Context Address Register Definitions */\r
+#define FPU_FPCAR_ADDRESS_Pos               3U                                            /*!< FPCAR: ADDRESS bit Position */\r
+#define FPU_FPCAR_ADDRESS_Msk              (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos)        /*!< FPCAR: ADDRESS bit Mask */\r
+\r
+/* Floating-Point Default Status Control Register Definitions */\r
+#define FPU_FPDSCR_AHP_Pos                 26U                                            /*!< FPDSCR: AHP bit Position */\r
+#define FPU_FPDSCR_AHP_Msk                 (1UL << FPU_FPDSCR_AHP_Pos)                    /*!< FPDSCR: AHP bit Mask */\r
+\r
+#define FPU_FPDSCR_DN_Pos                  25U                                            /*!< FPDSCR: DN bit Position */\r
+#define FPU_FPDSCR_DN_Msk                  (1UL << FPU_FPDSCR_DN_Pos)                     /*!< FPDSCR: DN bit Mask */\r
+\r
+#define FPU_FPDSCR_FZ_Pos                  24U                                            /*!< FPDSCR: FZ bit Position */\r
+#define FPU_FPDSCR_FZ_Msk                  (1UL << FPU_FPDSCR_FZ_Pos)                     /*!< FPDSCR: FZ bit Mask */\r
+\r
+#define FPU_FPDSCR_RMode_Pos               22U                                            /*!< FPDSCR: RMode bit Position */\r
+#define FPU_FPDSCR_RMode_Msk               (3UL << FPU_FPDSCR_RMode_Pos)                  /*!< FPDSCR: RMode bit Mask */\r
+\r
+/* Media and FP Feature Register 0 Definitions */\r
+#define FPU_MVFR0_FP_rounding_modes_Pos    28U                                            /*!< MVFR0: FP rounding modes bits Position */\r
+#define FPU_MVFR0_FP_rounding_modes_Msk    (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos)     /*!< MVFR0: FP rounding modes bits Mask */\r
+\r
+#define FPU_MVFR0_Short_vectors_Pos        24U                                            /*!< MVFR0: Short vectors bits Position */\r
+#define FPU_MVFR0_Short_vectors_Msk        (0xFUL << FPU_MVFR0_Short_vectors_Pos)         /*!< MVFR0: Short vectors bits Mask */\r
+\r
+#define FPU_MVFR0_Square_root_Pos          20U                                            /*!< MVFR0: Square root bits Position */\r
+#define FPU_MVFR0_Square_root_Msk          (0xFUL << FPU_MVFR0_Square_root_Pos)           /*!< MVFR0: Square root bits Mask */\r
+\r
+#define FPU_MVFR0_Divide_Pos               16U                                            /*!< MVFR0: Divide bits Position */\r
+#define FPU_MVFR0_Divide_Msk               (0xFUL << FPU_MVFR0_Divide_Pos)                /*!< MVFR0: Divide bits Mask */\r
+\r
+#define FPU_MVFR0_FP_excep_trapping_Pos    12U                                            /*!< MVFR0: FP exception trapping bits Position */\r
+#define FPU_MVFR0_FP_excep_trapping_Msk    (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos)     /*!< MVFR0: FP exception trapping bits Mask */\r
+\r
+#define FPU_MVFR0_Double_precision_Pos      8U                                            /*!< MVFR0: Double-precision bits Position */\r
+#define FPU_MVFR0_Double_precision_Msk     (0xFUL << FPU_MVFR0_Double_precision_Pos)      /*!< MVFR0: Double-precision bits Mask */\r
+\r
+#define FPU_MVFR0_Single_precision_Pos      4U                                            /*!< MVFR0: Single-precision bits Position */\r
+#define FPU_MVFR0_Single_precision_Msk     (0xFUL << FPU_MVFR0_Single_precision_Pos)      /*!< MVFR0: Single-precision bits Mask */\r
+\r
+#define FPU_MVFR0_A_SIMD_registers_Pos      0U                                            /*!< MVFR0: A_SIMD registers bits Position */\r
+#define FPU_MVFR0_A_SIMD_registers_Msk     (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/)  /*!< MVFR0: A_SIMD registers bits Mask */\r
+\r
+/* Media and FP Feature Register 1 Definitions */\r
+#define FPU_MVFR1_FP_fused_MAC_Pos         28U                                            /*!< MVFR1: FP fused MAC bits Position */\r
+#define FPU_MVFR1_FP_fused_MAC_Msk         (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos)          /*!< MVFR1: FP fused MAC bits Mask */\r
+\r
+#define FPU_MVFR1_FP_HPFP_Pos              24U                                            /*!< MVFR1: FP HPFP bits Position */\r
+#define FPU_MVFR1_FP_HPFP_Msk              (0xFUL << FPU_MVFR1_FP_HPFP_Pos)               /*!< MVFR1: FP HPFP bits Mask */\r
+\r
+#define FPU_MVFR1_D_NaN_mode_Pos            4U                                            /*!< MVFR1: D_NaN mode bits Position */\r
+#define FPU_MVFR1_D_NaN_mode_Msk           (0xFUL << FPU_MVFR1_D_NaN_mode_Pos)            /*!< MVFR1: D_NaN mode bits Mask */\r
+\r
+#define FPU_MVFR1_FtZ_mode_Pos              0U                                            /*!< MVFR1: FtZ mode bits Position */\r
+#define FPU_MVFR1_FtZ_mode_Msk             (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/)          /*!< MVFR1: FtZ mode bits Mask */\r
+\r
+/*@} end of group CMSIS_FPU */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_CoreDebug       Core Debug Registers (CoreDebug)\r
+  \brief    Type definitions for the Core Debug Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Core Debug Register (CoreDebug).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t DHCSR;                  /*!< Offset: 0x000 (R/W)  Debug Halting Control and Status Register */\r
+  __OM  uint32_t DCRSR;                  /*!< Offset: 0x004 ( /W)  Debug Core Register Selector Register */\r
+  __IOM uint32_t DCRDR;                  /*!< Offset: 0x008 (R/W)  Debug Core Register Data Register */\r
+  __IOM uint32_t DEMCR;                  /*!< Offset: 0x00C (R/W)  Debug Exception and Monitor Control Register */\r
+        uint32_t RESERVED4[1U];\r
+  __IOM uint32_t DAUTHCTRL;              /*!< Offset: 0x014 (R/W)  Debug Authentication Control Register */\r
+  __IOM uint32_t DSCSR;                  /*!< Offset: 0x018 (R/W)  Debug Security Control and Status Register */\r
+} CoreDebug_Type;\r
+\r
+/* Debug Halting Control and Status Register Definitions */\r
+#define CoreDebug_DHCSR_DBGKEY_Pos         16U                                            /*!< CoreDebug DHCSR: DBGKEY Position */\r
+#define CoreDebug_DHCSR_DBGKEY_Msk         (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos)       /*!< CoreDebug DHCSR: DBGKEY Mask */\r
+\r
+#define CoreDebug_DHCSR_S_RESTART_ST_Pos   26U                                            /*!< CoreDebug DHCSR: S_RESTART_ST Position */\r
+#define CoreDebug_DHCSR_S_RESTART_ST_Msk   (1UL << CoreDebug_DHCSR_S_RESTART_ST_Pos)      /*!< CoreDebug DHCSR: S_RESTART_ST Mask */\r
+\r
+#define CoreDebug_DHCSR_S_RESET_ST_Pos     25U                                            /*!< CoreDebug DHCSR: S_RESET_ST Position */\r
+#define CoreDebug_DHCSR_S_RESET_ST_Msk     (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos)        /*!< CoreDebug DHCSR: S_RESET_ST Mask */\r
+\r
+#define CoreDebug_DHCSR_S_RETIRE_ST_Pos    24U                                            /*!< CoreDebug DHCSR: S_RETIRE_ST Position */\r
+#define CoreDebug_DHCSR_S_RETIRE_ST_Msk    (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos)       /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */\r
+\r
+#define CoreDebug_DHCSR_S_LOCKUP_Pos       19U                                            /*!< CoreDebug DHCSR: S_LOCKUP Position */\r
+#define CoreDebug_DHCSR_S_LOCKUP_Msk       (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos)          /*!< CoreDebug DHCSR: S_LOCKUP Mask */\r
+\r
+#define CoreDebug_DHCSR_S_SLEEP_Pos        18U                                            /*!< CoreDebug DHCSR: S_SLEEP Position */\r
+#define CoreDebug_DHCSR_S_SLEEP_Msk        (1UL << CoreDebug_DHCSR_S_SLEEP_Pos)           /*!< CoreDebug DHCSR: S_SLEEP Mask */\r
+\r
+#define CoreDebug_DHCSR_S_HALT_Pos         17U                                            /*!< CoreDebug DHCSR: S_HALT Position */\r
+#define CoreDebug_DHCSR_S_HALT_Msk         (1UL << CoreDebug_DHCSR_S_HALT_Pos)            /*!< CoreDebug DHCSR: S_HALT Mask */\r
+\r
+#define CoreDebug_DHCSR_S_REGRDY_Pos       16U                                            /*!< CoreDebug DHCSR: S_REGRDY Position */\r
+#define CoreDebug_DHCSR_S_REGRDY_Msk       (1UL << CoreDebug_DHCSR_S_REGRDY_Pos)          /*!< CoreDebug DHCSR: S_REGRDY Mask */\r
+\r
+#define CoreDebug_DHCSR_C_SNAPSTALL_Pos     5U                                            /*!< CoreDebug DHCSR: C_SNAPSTALL Position */\r
+#define CoreDebug_DHCSR_C_SNAPSTALL_Msk    (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos)       /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */\r
+\r
+#define CoreDebug_DHCSR_C_MASKINTS_Pos      3U                                            /*!< CoreDebug DHCSR: C_MASKINTS Position */\r
+#define CoreDebug_DHCSR_C_MASKINTS_Msk     (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos)        /*!< CoreDebug DHCSR: C_MASKINTS Mask */\r
+\r
+#define CoreDebug_DHCSR_C_STEP_Pos          2U                                            /*!< CoreDebug DHCSR: C_STEP Position */\r
+#define CoreDebug_DHCSR_C_STEP_Msk         (1UL << CoreDebug_DHCSR_C_STEP_Pos)            /*!< CoreDebug DHCSR: C_STEP Mask */\r
+\r
+#define CoreDebug_DHCSR_C_HALT_Pos          1U                                            /*!< CoreDebug DHCSR: C_HALT Position */\r
+#define CoreDebug_DHCSR_C_HALT_Msk         (1UL << CoreDebug_DHCSR_C_HALT_Pos)            /*!< CoreDebug DHCSR: C_HALT Mask */\r
+\r
+#define CoreDebug_DHCSR_C_DEBUGEN_Pos       0U                                            /*!< CoreDebug DHCSR: C_DEBUGEN Position */\r
+#define CoreDebug_DHCSR_C_DEBUGEN_Msk      (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/)     /*!< CoreDebug DHCSR: C_DEBUGEN Mask */\r
+\r
+/* Debug Core Register Selector Register Definitions */\r
+#define CoreDebug_DCRSR_REGWnR_Pos         16U                                            /*!< CoreDebug DCRSR: REGWnR Position */\r
+#define CoreDebug_DCRSR_REGWnR_Msk         (1UL << CoreDebug_DCRSR_REGWnR_Pos)            /*!< CoreDebug DCRSR: REGWnR Mask */\r
+\r
+#define CoreDebug_DCRSR_REGSEL_Pos          0U                                            /*!< CoreDebug DCRSR: REGSEL Position */\r
+#define CoreDebug_DCRSR_REGSEL_Msk         (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/)     /*!< CoreDebug DCRSR: REGSEL Mask */\r
+\r
+/* Debug Exception and Monitor Control Register Definitions */\r
+#define CoreDebug_DEMCR_TRCENA_Pos         24U                                            /*!< CoreDebug DEMCR: TRCENA Position */\r
+#define CoreDebug_DEMCR_TRCENA_Msk         (1UL << CoreDebug_DEMCR_TRCENA_Pos)            /*!< CoreDebug DEMCR: TRCENA Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_REQ_Pos        19U                                            /*!< CoreDebug DEMCR: MON_REQ Position */\r
+#define CoreDebug_DEMCR_MON_REQ_Msk        (1UL << CoreDebug_DEMCR_MON_REQ_Pos)           /*!< CoreDebug DEMCR: MON_REQ Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_STEP_Pos       18U                                            /*!< CoreDebug DEMCR: MON_STEP Position */\r
+#define CoreDebug_DEMCR_MON_STEP_Msk       (1UL << CoreDebug_DEMCR_MON_STEP_Pos)          /*!< CoreDebug DEMCR: MON_STEP Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_PEND_Pos       17U                                            /*!< CoreDebug DEMCR: MON_PEND Position */\r
+#define CoreDebug_DEMCR_MON_PEND_Msk       (1UL << CoreDebug_DEMCR_MON_PEND_Pos)          /*!< CoreDebug DEMCR: MON_PEND Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_EN_Pos         16U                                            /*!< CoreDebug DEMCR: MON_EN Position */\r
+#define CoreDebug_DEMCR_MON_EN_Msk         (1UL << CoreDebug_DEMCR_MON_EN_Pos)            /*!< CoreDebug DEMCR: MON_EN Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_HARDERR_Pos     10U                                            /*!< CoreDebug DEMCR: VC_HARDERR Position */\r
+#define CoreDebug_DEMCR_VC_HARDERR_Msk     (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos)        /*!< CoreDebug DEMCR: VC_HARDERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_INTERR_Pos       9U                                            /*!< CoreDebug DEMCR: VC_INTERR Position */\r
+#define CoreDebug_DEMCR_VC_INTERR_Msk      (1UL << CoreDebug_DEMCR_VC_INTERR_Pos)         /*!< CoreDebug DEMCR: VC_INTERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_BUSERR_Pos       8U                                            /*!< CoreDebug DEMCR: VC_BUSERR Position */\r
+#define CoreDebug_DEMCR_VC_BUSERR_Msk      (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos)         /*!< CoreDebug DEMCR: VC_BUSERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_STATERR_Pos      7U                                            /*!< CoreDebug DEMCR: VC_STATERR Position */\r
+#define CoreDebug_DEMCR_VC_STATERR_Msk     (1UL << CoreDebug_DEMCR_VC_STATERR_Pos)        /*!< CoreDebug DEMCR: VC_STATERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_CHKERR_Pos       6U                                            /*!< CoreDebug DEMCR: VC_CHKERR Position */\r
+#define CoreDebug_DEMCR_VC_CHKERR_Msk      (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos)         /*!< CoreDebug DEMCR: VC_CHKERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_NOCPERR_Pos      5U                                            /*!< CoreDebug DEMCR: VC_NOCPERR Position */\r
+#define CoreDebug_DEMCR_VC_NOCPERR_Msk     (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos)        /*!< CoreDebug DEMCR: VC_NOCPERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_MMERR_Pos        4U                                            /*!< CoreDebug DEMCR: VC_MMERR Position */\r
+#define CoreDebug_DEMCR_VC_MMERR_Msk       (1UL << CoreDebug_DEMCR_VC_MMERR_Pos)          /*!< CoreDebug DEMCR: VC_MMERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_CORERESET_Pos    0U                                            /*!< CoreDebug DEMCR: VC_CORERESET Position */\r
+#define CoreDebug_DEMCR_VC_CORERESET_Msk   (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/)  /*!< CoreDebug DEMCR: VC_CORERESET Mask */\r
+\r
+/* Debug Authentication Control Register Definitions */\r
+#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos  3U                                            /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Position */\r
+#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos)    /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Mask */\r
+\r
+#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos  2U                                            /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Position */\r
+#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Msk (1UL << CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos)    /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Mask */\r
+\r
+#define CoreDebug_DAUTHCTRL_INTSPIDEN_Pos   1U                                            /*!< CoreDebug DAUTHCTRL: INTSPIDEN Position */\r
+#define CoreDebug_DAUTHCTRL_INTSPIDEN_Msk  (1UL << CoreDebug_DAUTHCTRL_INTSPIDEN_Pos)     /*!< CoreDebug DAUTHCTRL: INTSPIDEN Mask */\r
+\r
+#define CoreDebug_DAUTHCTRL_SPIDENSEL_Pos   0U                                            /*!< CoreDebug DAUTHCTRL: SPIDENSEL Position */\r
+#define CoreDebug_DAUTHCTRL_SPIDENSEL_Msk  (1UL /*<< CoreDebug_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< CoreDebug DAUTHCTRL: SPIDENSEL Mask */\r
+\r
+/* Debug Security Control and Status Register Definitions */\r
+#define CoreDebug_DSCSR_CDS_Pos            16U                                            /*!< CoreDebug DSCSR: CDS Position */\r
+#define CoreDebug_DSCSR_CDS_Msk            (1UL << CoreDebug_DSCSR_CDS_Pos)               /*!< CoreDebug DSCSR: CDS Mask */\r
+\r
+#define CoreDebug_DSCSR_SBRSEL_Pos          1U                                            /*!< CoreDebug DSCSR: SBRSEL Position */\r
+#define CoreDebug_DSCSR_SBRSEL_Msk         (1UL << CoreDebug_DSCSR_SBRSEL_Pos)            /*!< CoreDebug DSCSR: SBRSEL Mask */\r
+\r
+#define CoreDebug_DSCSR_SBRSELEN_Pos        0U                                            /*!< CoreDebug DSCSR: SBRSELEN Position */\r
+#define CoreDebug_DSCSR_SBRSELEN_Msk       (1UL /*<< CoreDebug_DSCSR_SBRSELEN_Pos*/)      /*!< CoreDebug DSCSR: SBRSELEN Mask */\r
+\r
+/*@} end of group CMSIS_CoreDebug */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_bitfield     Core register bit field macros\r
+  \brief      Macros for use with bit field definitions (xxx_Pos, xxx_Msk).\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   Mask and shift a bit field value for use in a register bit range.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of the bit field. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted value.\r
+*/\r
+#define _VAL2FLD(field, value)    (((uint32_t)(value) << field ## _Pos) & field ## _Msk)\r
+\r
+/**\r
+  \brief     Mask and shift a register value to extract a bit filed value.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of register. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted bit field value.\r
+*/\r
+#define _FLD2VAL(field, value)    (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)\r
+\r
+/*@} end of group CMSIS_core_bitfield */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_base     Core Definitions\r
+  \brief      Definitions for base addresses, unions, and structures.\r
+  @{\r
+ */\r
+\r
+/* Memory mapping of Core Hardware */\r
+  #define SCS_BASE            (0xE000E000UL)                             /*!< System Control Space Base Address */\r
+  #define ITM_BASE            (0xE0000000UL)                             /*!< ITM Base Address */\r
+  #define DWT_BASE            (0xE0001000UL)                             /*!< DWT Base Address */\r
+  #define TPI_BASE            (0xE0040000UL)                             /*!< TPI Base Address */\r
+  #define CoreDebug_BASE      (0xE000EDF0UL)                             /*!< Core Debug Base Address */\r
+  #define SysTick_BASE        (SCS_BASE +  0x0010UL)                     /*!< SysTick Base Address */\r
+  #define NVIC_BASE           (SCS_BASE +  0x0100UL)                     /*!< NVIC Base Address */\r
+  #define SCB_BASE            (SCS_BASE +  0x0D00UL)                     /*!< System Control Block Base Address */\r
+\r
+  #define SCnSCB              ((SCnSCB_Type    *)     SCS_BASE         ) /*!< System control Register not in SCB */\r
+  #define SCB                 ((SCB_Type       *)     SCB_BASE         ) /*!< SCB configuration struct */\r
+  #define SysTick             ((SysTick_Type   *)     SysTick_BASE     ) /*!< SysTick configuration struct */\r
+  #define NVIC                ((NVIC_Type      *)     NVIC_BASE        ) /*!< NVIC configuration struct */\r
+  #define ITM                 ((ITM_Type       *)     ITM_BASE         ) /*!< ITM configuration struct */\r
+  #define DWT                 ((DWT_Type       *)     DWT_BASE         ) /*!< DWT configuration struct */\r
+  #define TPI                 ((TPI_Type       *)     TPI_BASE         ) /*!< TPI configuration struct */\r
+  #define CoreDebug           ((CoreDebug_Type *)     CoreDebug_BASE   ) /*!< Core Debug configuration struct */\r
+\r
+  #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+    #define MPU_BASE          (SCS_BASE +  0x0D90UL)                     /*!< Memory Protection Unit */\r
+    #define MPU               ((MPU_Type       *)     MPU_BASE         ) /*!< Memory Protection Unit */\r
+  #endif\r
+\r
+  #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+    #define SAU_BASE          (SCS_BASE +  0x0DD0UL)                     /*!< Security Attribution Unit */\r
+    #define SAU               ((SAU_Type       *)     SAU_BASE         ) /*!< Security Attribution Unit */\r
+  #endif\r
+\r
+  #define FPU_BASE            (SCS_BASE +  0x0F30UL)                     /*!< Floating Point Unit */\r
+  #define FPU                 ((FPU_Type       *)     FPU_BASE         ) /*!< Floating Point Unit */\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+  #define SCS_BASE_NS         (0xE002E000UL)                             /*!< System Control Space Base Address (non-secure address space) */\r
+  #define CoreDebug_BASE_NS   (0xE002EDF0UL)                             /*!< Core Debug Base Address           (non-secure address space) */\r
+  #define SysTick_BASE_NS     (SCS_BASE_NS +  0x0010UL)                  /*!< SysTick Base Address              (non-secure address space) */\r
+  #define NVIC_BASE_NS        (SCS_BASE_NS +  0x0100UL)                  /*!< NVIC Base Address                 (non-secure address space) */\r
+  #define SCB_BASE_NS         (SCS_BASE_NS +  0x0D00UL)                  /*!< System Control Block Base Address (non-secure address space) */\r
+\r
+  #define SCnSCB_NS           ((SCnSCB_Type    *)     SCS_BASE_NS      ) /*!< System control Register not in SCB(non-secure address space) */\r
+  #define SCB_NS              ((SCB_Type       *)     SCB_BASE_NS      ) /*!< SCB configuration struct          (non-secure address space) */\r
+  #define SysTick_NS          ((SysTick_Type   *)     SysTick_BASE_NS  ) /*!< SysTick configuration struct      (non-secure address space) */\r
+  #define NVIC_NS             ((NVIC_Type      *)     NVIC_BASE_NS     ) /*!< NVIC configuration struct         (non-secure address space) */\r
+  #define CoreDebug_NS        ((CoreDebug_Type *)     CoreDebug_BASE_NS) /*!< Core Debug configuration struct   (non-secure address space) */\r
+\r
+  #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+    #define MPU_BASE_NS       (SCS_BASE_NS +  0x0D90UL)                  /*!< Memory Protection Unit            (non-secure address space) */\r
+    #define MPU_NS            ((MPU_Type       *)     MPU_BASE_NS      ) /*!< Memory Protection Unit            (non-secure address space) */\r
+  #endif\r
+\r
+  #define FPU_BASE_NS         (SCS_BASE_NS +  0x0F30UL)                  /*!< Floating Point Unit               (non-secure address space) */\r
+  #define FPU_NS              ((FPU_Type       *)     FPU_BASE_NS      ) /*!< Floating Point Unit               (non-secure address space) */\r
+\r
+#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */\r
+/*@} */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                Hardware Abstraction Layer\r
+  Core Function Interface contains:\r
+  - Core NVIC Functions\r
+  - Core SysTick Functions\r
+  - Core Debug Functions\r
+  - Core Register Access Functions\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference\r
+*/\r
+\r
+\r
+\r
+/* ##########################   NVIC functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_NVICFunctions NVIC Functions\r
+  \brief    Functions that manage interrupts and exceptions via the NVIC.\r
+  @{\r
+ */\r
+\r
+#ifdef CMSIS_NVIC_VIRTUAL\r
+  #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+    #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"\r
+  #endif\r
+  #include CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+#else\r
+  #define NVIC_SetPriorityGrouping    __NVIC_SetPriorityGrouping\r
+  #define NVIC_GetPriorityGrouping    __NVIC_GetPriorityGrouping\r
+  #define NVIC_EnableIRQ              __NVIC_EnableIRQ\r
+  #define NVIC_GetEnableIRQ           __NVIC_GetEnableIRQ\r
+  #define NVIC_DisableIRQ             __NVIC_DisableIRQ\r
+  #define NVIC_GetPendingIRQ          __NVIC_GetPendingIRQ\r
+  #define NVIC_SetPendingIRQ          __NVIC_SetPendingIRQ\r
+  #define NVIC_ClearPendingIRQ        __NVIC_ClearPendingIRQ\r
+  #define NVIC_GetActive              __NVIC_GetActive\r
+  #define NVIC_SetPriority            __NVIC_SetPriority\r
+  #define NVIC_GetPriority            __NVIC_GetPriority\r
+  #define NVIC_SystemReset            __NVIC_SystemReset\r
+#endif /* CMSIS_NVIC_VIRTUAL */\r
+\r
+#ifdef CMSIS_VECTAB_VIRTUAL\r
+  #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+    #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"\r
+  #endif\r
+  #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+#else\r
+  #define NVIC_SetVector              __NVIC_SetVector\r
+  #define NVIC_GetVector              __NVIC_GetVector\r
+#endif  /* (CMSIS_VECTAB_VIRTUAL) */\r
+\r
+#define NVIC_USER_IRQ_OFFSET          16\r
+\r
+\r
+/* Special LR values for Secure/Non-Secure call handling and exception handling                                               */\r
+\r
+/* Function Return Payload (from ARMv8-M Architecture Reference Manual) LR value on entry from Secure BLXNS                   */\r
+#define FNC_RETURN                 (0xFEFFFFFFUL)     /* bit [0] ignored when processing a branch                             */\r
+\r
+/* The following EXC_RETURN mask values are used to evaluate the LR on exception entry */\r
+#define EXC_RETURN_PREFIX          (0xFF000000UL)     /* bits [31:24] set to indicate an EXC_RETURN value                     */\r
+#define EXC_RETURN_S               (0x00000040UL)     /* bit [6] stack used to push registers: 0=Non-secure 1=Secure          */\r
+#define EXC_RETURN_DCRS            (0x00000020UL)     /* bit [5] stacking rules for called registers: 0=skipped 1=saved       */\r
+#define EXC_RETURN_FTYPE           (0x00000010UL)     /* bit [4] allocate stack for floating-point context: 0=done 1=skipped  */\r
+#define EXC_RETURN_MODE            (0x00000008UL)     /* bit [3] processor mode for return: 0=Handler mode 1=Thread mode      */\r
+#define EXC_RETURN_SPSEL           (0x00000002UL)     /* bit [1] stack pointer used to restore context: 0=MSP 1=PSP           */\r
+#define EXC_RETURN_ES              (0x00000001UL)     /* bit [0] security state exception was taken to: 0=Non-secure 1=Secure */\r
+\r
+/* Integrity Signature (from ARMv8-M Architecture Reference Manual) for exception context stacking                            */\r
+#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)  /* Value for processors with floating-point extension:                  */\r
+#define EXC_INTEGRITY_SIGNATURE     (0xFEFA125AUL)     /* bit [0] SFTC must match LR bit[4] EXC_RETURN_FTYPE                   */\r
+#else\r
+#define EXC_INTEGRITY_SIGNATURE     (0xFEFA125BUL)     /* Value for processors without floating-point extension                */\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Set Priority Grouping\r
+  \details Sets the priority grouping field using the required unlock sequence.\r
+           The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field.\r
+           Only values from 0..7 are used.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.\r
+  \param [in]      PriorityGroup  Priority grouping field.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup)\r
+{\r
+  uint32_t reg_value;\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);             /* only values 0..7 are used          */\r
+\r
+  reg_value  =  SCB->AIRCR;                                                   /* read old register configuration    */\r
+  reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change               */\r
+  reg_value  =  (reg_value                                   |\r
+                ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |\r
+                (PriorityGroupTmp << 8U)                      );              /* Insert write key and priorty group */\r
+  SCB->AIRCR =  reg_value;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Priority Grouping\r
+  \details Reads the priority grouping field from the NVIC Interrupt Controller.\r
+  \return                Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field).\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void)\r
+{\r
+  return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos));\r
+}\r
+\r
+\r
+/**\r
+  \brief   Enable Interrupt\r
+  \details Enables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Enable status\r
+  \details Returns a device specific interrupt enable status from the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt is not enabled.\r
+  \return             1  Interrupt is enabled.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Disable Interrupt\r
+  \details Disables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+    __DSB();\r
+    __ISB();\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Pending Interrupt\r
+  \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not pending.\r
+  \return             1  Interrupt status is pending.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Pending Interrupt\r
+  \details Sets the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Clear Pending Interrupt\r
+  \details Clears the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Active Interrupt\r
+  \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not active.\r
+  \return             1  Interrupt status is active.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+/**\r
+  \brief   Get Interrupt Target State\r
+  \details Reads the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  if interrupt is assigned to Secure\r
+  \return             1  if interrupt is assigned to Non Secure\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t NVIC_GetTargetState(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Target State\r
+  \details Sets the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  if interrupt is assigned to Secure\r
+                      1  if interrupt is assigned to Non Secure\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t NVIC_SetTargetState(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] |=  ((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)));\r
+    return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Clear Interrupt Target State\r
+  \details Clears the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  if interrupt is assigned to Secure\r
+                      1  if interrupt is assigned to Non Secure\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t NVIC_ClearTargetState(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)));\r
+    return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Priority\r
+  \details Sets the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]      IRQn  Interrupt number.\r
+  \param [in]  priority  Priority to set.\r
+  \note    The priority cannot be set for every processor exception.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->IPR[((uint32_t)IRQn)]               = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);\r
+  }\r
+  else\r
+  {\r
+    SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Priority\r
+  \details Reads the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn  Interrupt number.\r
+  \return             Interrupt Priority.\r
+                      Value is aligned automatically to the implemented priority bits of the microcontroller.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)\r
+{\r
+\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return(((uint32_t)NVIC->IPR[((uint32_t)IRQn)]               >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+  else\r
+  {\r
+    return(((uint32_t)SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Encode Priority\r
+  \details Encodes the priority for an interrupt with the given priority group,\r
+           preemptive priority value, and subpriority value.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.\r
+  \param [in]     PriorityGroup  Used priority group.\r
+  \param [in]   PreemptPriority  Preemptive priority value (starting from 0).\r
+  \param [in]       SubPriority  Subpriority value (starting from 0).\r
+  \return                        Encoded priority. Value can be used in the function \ref NVIC_SetPriority().\r
+ */\r
+__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);\r
+  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));\r
+\r
+  return (\r
+           ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |\r
+           ((SubPriority     & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL)))\r
+         );\r
+}\r
+\r
+\r
+/**\r
+  \brief   Decode Priority\r
+  \details Decodes an interrupt priority value with a given priority group to\r
+           preemptive priority value and subpriority value.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.\r
+  \param [in]         Priority   Priority value, which can be retrieved with the function \ref NVIC_GetPriority().\r
+  \param [in]     PriorityGroup  Used priority group.\r
+  \param [out] pPreemptPriority  Preemptive priority value (starting from 0).\r
+  \param [out]     pSubPriority  Subpriority value (starting from 0).\r
+ */\r
+__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);\r
+  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));\r
+\r
+  *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);\r
+  *pSubPriority     = (Priority                   ) & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Vector\r
+  \details Sets an interrupt vector in SRAM based interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+           VTOR must been relocated to SRAM before.\r
+  \param [in]   IRQn      Interrupt number\r
+  \param [in]   vector    Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)\r
+{\r
+  uint32_t *vectors = (uint32_t *)SCB->VTOR;\r
+  vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Vector\r
+  \details Reads an interrupt vector from interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn      Interrupt number.\r
+  \return                 Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)\r
+{\r
+  uint32_t *vectors = (uint32_t *)SCB->VTOR;\r
+  return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];\r
+}\r
+\r
+\r
+/**\r
+  \brief   System Reset\r
+  \details Initiates a system reset request to reset the MCU.\r
+ */\r
+__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)\r
+{\r
+  __DSB();                                                          /* Ensure all outstanding memory accesses included\r
+                                                                       buffered write are completed before reset */\r
+  SCB->AIRCR  = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos)    |\r
+                           (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |\r
+                            SCB_AIRCR_SYSRESETREQ_Msk    );         /* Keep priority group unchanged */\r
+  __DSB();                                                          /* Ensure completion of memory access */\r
+\r
+  for(;;)                                                           /* wait until reset */\r
+  {\r
+    __NOP();\r
+  }\r
+}\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+/**\r
+  \brief   Set Priority Grouping (non-secure)\r
+  \details Sets the non-secure priority grouping field when in secure state using the required unlock sequence.\r
+           The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field.\r
+           Only values from 0..7 are used.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.\r
+  \param [in]      PriorityGroup  Priority grouping field.\r
+ */\r
+__STATIC_INLINE void TZ_NVIC_SetPriorityGrouping_NS(uint32_t PriorityGroup)\r
+{\r
+  uint32_t reg_value;\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);             /* only values 0..7 are used          */\r
+\r
+  reg_value  =  SCB_NS->AIRCR;                                                   /* read old register configuration    */\r
+  reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk));             /* clear bits to change               */\r
+  reg_value  =  (reg_value                                   |\r
+                ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |\r
+                (PriorityGroupTmp << 8U)                      );              /* Insert write key and priorty group */\r
+  SCB_NS->AIRCR =  reg_value;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Priority Grouping (non-secure)\r
+  \details Reads the priority grouping field from the non-secure NVIC when in secure state.\r
+  \return                Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field).\r
+ */\r
+__STATIC_INLINE uint32_t TZ_NVIC_GetPriorityGrouping_NS(void)\r
+{\r
+  return ((uint32_t)((SCB_NS->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos));\r
+}\r
+\r
+\r
+/**\r
+  \brief   Enable Interrupt (non-secure)\r
+  \details Enables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void TZ_NVIC_EnableIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Enable status (non-secure)\r
+  \details Returns a device specific interrupt enable status from the non-secure NVIC interrupt controller when in secure state.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt is not enabled.\r
+  \return             1  Interrupt is enabled.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t TZ_NVIC_GetEnableIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Disable Interrupt (non-secure)\r
+  \details Disables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void TZ_NVIC_DisableIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC_NS->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Pending Interrupt (non-secure)\r
+  \details Reads the NVIC pending register in the non-secure NVIC when in secure state and returns the pending bit for the specified device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not pending.\r
+  \return             1  Interrupt status is pending.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t TZ_NVIC_GetPendingIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Pending Interrupt (non-secure)\r
+  \details Sets the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void TZ_NVIC_SetPendingIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Clear Pending Interrupt (non-secure)\r
+  \details Clears the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void TZ_NVIC_ClearPendingIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC_NS->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Active Interrupt (non-secure)\r
+  \details Reads the active register in non-secure NVIC when in secure state and returns the active bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not active.\r
+  \return             1  Interrupt status is active.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t TZ_NVIC_GetActive_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC_NS->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Priority (non-secure)\r
+  \details Sets the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]      IRQn  Interrupt number.\r
+  \param [in]  priority  Priority to set.\r
+  \note    The priority cannot be set for every non-secure processor exception.\r
+ */\r
+__STATIC_INLINE void TZ_NVIC_SetPriority_NS(IRQn_Type IRQn, uint32_t priority)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC_NS->IPR[((uint32_t)IRQn)]               = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);\r
+  }\r
+  else\r
+  {\r
+    SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Priority (non-secure)\r
+  \details Reads the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn  Interrupt number.\r
+  \return             Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller.\r
+ */\r
+__STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn)\r
+{\r
+\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return(((uint32_t)NVIC_NS->IPR[((uint32_t)IRQn)]               >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+  else\r
+  {\r
+    return(((uint32_t)SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+}\r
+#endif /*  defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */\r
+\r
+/*@} end of CMSIS_Core_NVICFunctions */\r
+\r
+/* ##########################  MPU functions  #################################### */\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+\r
+#include "mpu_armv8.h"\r
+\r
+#endif\r
+\r
+/* ##########################  FPU functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_FpuFunctions FPU Functions\r
+  \brief    Function that provides FPU type.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   get FPU type\r
+  \details returns the FPU type\r
+  \returns\r
+   - \b  0: No FPU\r
+   - \b  1: Single precision FPU\r
+   - \b  2: Double + Single precision FPU\r
+ */\r
+__STATIC_INLINE uint32_t SCB_GetFPUType(void)\r
+{\r
+  uint32_t mvfr0;\r
+\r
+  mvfr0 = FPU->MVFR0;\r
+  if      ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x220U)\r
+  {\r
+    return 2U;           /* Double + Single precision FPU */\r
+  }\r
+  else if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x020U)\r
+  {\r
+    return 1U;           /* Single precision FPU */\r
+  }\r
+  else\r
+  {\r
+    return 0U;           /* No FPU */\r
+  }\r
+}\r
+\r
+\r
+/*@} end of CMSIS_Core_FpuFunctions */\r
+\r
+\r
+\r
+/* ##########################   SAU functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_SAUFunctions SAU Functions\r
+  \brief    Functions that configure the SAU.\r
+  @{\r
+ */\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+\r
+/**\r
+  \brief   Enable SAU\r
+  \details Enables the Security Attribution Unit (SAU).\r
+ */\r
+__STATIC_INLINE void TZ_SAU_Enable(void)\r
+{\r
+    SAU->CTRL |=  (SAU_CTRL_ENABLE_Msk);\r
+}\r
+\r
+\r
+\r
+/**\r
+  \brief   Disable SAU\r
+  \details Disables the Security Attribution Unit (SAU).\r
+ */\r
+__STATIC_INLINE void TZ_SAU_Disable(void)\r
+{\r
+    SAU->CTRL &= ~(SAU_CTRL_ENABLE_Msk);\r
+}\r
+\r
+#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */\r
+\r
+/*@} end of CMSIS_Core_SAUFunctions */\r
+\r
+\r
+\r
+\r
+/* ##################################    SysTick function  ############################################ */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_SysTickFunctions SysTick Functions\r
+  \brief    Functions that configure the System.\r
+  @{\r
+ */\r
+\r
+#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)\r
+\r
+/**\r
+  \brief   System Tick Configuration\r
+  \details Initializes the System Timer and its interrupt, and starts the System Tick Timer.\r
+           Counter is in free running mode to generate periodic interrupts.\r
+  \param [in]  ticks  Number of ticks between two interrupts.\r
+  \return          0  Function succeeded.\r
+  \return          1  Function failed.\r
+  \note    When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the\r
+           function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>\r
+           must contain a vendor-specific implementation of this function.\r
+ */\r
+__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)\r
+{\r
+  if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)\r
+  {\r
+    return (1UL);                                                   /* Reload value impossible */\r
+  }\r
+\r
+  SysTick->LOAD  = (uint32_t)(ticks - 1UL);                         /* set reload register */\r
+  NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */\r
+  SysTick->VAL   = 0UL;                                             /* Load the SysTick Counter Value */\r
+  SysTick->CTRL  = SysTick_CTRL_CLKSOURCE_Msk |\r
+                   SysTick_CTRL_TICKINT_Msk   |\r
+                   SysTick_CTRL_ENABLE_Msk;                         /* Enable SysTick IRQ and SysTick Timer */\r
+  return (0UL);                                                     /* Function successful */\r
+}\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+/**\r
+  \brief   System Tick Configuration (non-secure)\r
+  \details Initializes the non-secure System Timer and its interrupt when in secure state, and starts the System Tick Timer.\r
+           Counter is in free running mode to generate periodic interrupts.\r
+  \param [in]  ticks  Number of ticks between two interrupts.\r
+  \return          0  Function succeeded.\r
+  \return          1  Function failed.\r
+  \note    When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the\r
+           function <b>TZ_SysTick_Config_NS</b> is not included. In this case, the file <b><i>device</i>.h</b>\r
+           must contain a vendor-specific implementation of this function.\r
+\r
+ */\r
+__STATIC_INLINE uint32_t TZ_SysTick_Config_NS(uint32_t ticks)\r
+{\r
+  if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)\r
+  {\r
+    return (1UL);                                                         /* Reload value impossible */\r
+  }\r
+\r
+  SysTick_NS->LOAD  = (uint32_t)(ticks - 1UL);                            /* set reload register */\r
+  TZ_NVIC_SetPriority_NS (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */\r
+  SysTick_NS->VAL   = 0UL;                                                /* Load the SysTick Counter Value */\r
+  SysTick_NS->CTRL  = SysTick_CTRL_CLKSOURCE_Msk |\r
+                      SysTick_CTRL_TICKINT_Msk   |\r
+                      SysTick_CTRL_ENABLE_Msk;                            /* Enable SysTick IRQ and SysTick Timer */\r
+  return (0UL);                                                           /* Function successful */\r
+}\r
+#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */\r
+\r
+#endif\r
+\r
+/*@} end of CMSIS_Core_SysTickFunctions */\r
+\r
+\r
+\r
+/* ##################################### Debug In/Output function ########################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_core_DebugFunctions ITM Functions\r
+  \brief    Functions that access the ITM debug interface.\r
+  @{\r
+ */\r
+\r
+extern volatile int32_t ITM_RxBuffer;                              /*!< External variable to receive characters. */\r
+#define                 ITM_RXBUFFER_EMPTY  ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */\r
+\r
+\r
+/**\r
+  \brief   ITM Send Character\r
+  \details Transmits a character via the ITM channel 0, and\r
+           \li Just returns when no debugger is connected that has booked the output.\r
+           \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted.\r
+  \param [in]     ch  Character to transmit.\r
+  \returns            Character to transmit.\r
+ */\r
+__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch)\r
+{\r
+  if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) &&      /* ITM enabled */\r
+      ((ITM->TER & 1UL               ) != 0UL)   )     /* ITM Port #0 enabled */\r
+  {\r
+    while (ITM->PORT[0U].u32 == 0UL)\r
+    {\r
+      __NOP();\r
+    }\r
+    ITM->PORT[0U].u8 = (uint8_t)ch;\r
+  }\r
+  return (ch);\r
+}\r
+\r
+\r
+/**\r
+  \brief   ITM Receive Character\r
+  \details Inputs a character via the external variable \ref ITM_RxBuffer.\r
+  \return             Received character.\r
+  \return         -1  No character pending.\r
+ */\r
+__STATIC_INLINE int32_t ITM_ReceiveChar (void)\r
+{\r
+  int32_t ch = -1;                           /* no character available */\r
+\r
+  if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY)\r
+  {\r
+    ch = ITM_RxBuffer;\r
+    ITM_RxBuffer = ITM_RXBUFFER_EMPTY;       /* ready for next character */\r
+  }\r
+\r
+  return (ch);\r
+}\r
+\r
+\r
+/**\r
+  \brief   ITM Check Character\r
+  \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer.\r
+  \return          0  No character available.\r
+  \return          1  Character available.\r
+ */\r
+__STATIC_INLINE int32_t ITM_CheckChar (void)\r
+{\r
+\r
+  if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY)\r
+  {\r
+    return (0);                              /* no character available */\r
+  }\r
+  else\r
+  {\r
+    return (1);                              /*    character available */\r
+  }\r
+}\r
+\r
+/*@} end of CMSIS_core_DebugFunctions */\r
+\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_ARMV8MML_H_DEPENDANT */\r
+\r
+#endif /* __CMSIS_GENERIC */\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm0.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm0.h
new file mode 100644 (file)
index 0000000..6f82227
--- /dev/null
@@ -0,0 +1,949 @@
+/**************************************************************************//**\r
+ * @file     core_cm0.h\r
+ * @brief    CMSIS Cortex-M0 Core Peripheral Access Layer Header File\r
+ * @version  V5.0.5\r
+ * @date     28. May 2018\r
+ ******************************************************************************/\r
+/*\r
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.\r
+ *\r
+ * SPDX-License-Identifier: Apache-2.0\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the License); you may\r
+ * not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#if   defined ( __ICCARM__ )\r
+  #pragma system_include         /* treat file as system include file for MISRA check */\r
+#elif defined (__clang__)\r
+  #pragma clang system_header   /* treat file as system include file */\r
+#endif\r
+\r
+#ifndef __CORE_CM0_H_GENERIC\r
+#define __CORE_CM0_H_GENERIC\r
+\r
+#include <stdint.h>\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/**\r
+  \page CMSIS_MISRA_Exceptions  MISRA-C:2004 Compliance Exceptions\r
+  CMSIS violates the following MISRA-C:2004 rules:\r
+\r
+   \li Required Rule 8.5, object/function definition in header file.<br>\r
+     Function definitions in header files are used to allow 'inlining'.\r
+\r
+   \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>\r
+     Unions are used for effective representation of core registers.\r
+\r
+   \li Advisory Rule 19.7, Function-like macro defined.<br>\r
+     Function-like macros are used to allow more efficient code.\r
+ */\r
+\r
+\r
+/*******************************************************************************\r
+ *                 CMSIS definitions\r
+ ******************************************************************************/\r
+/**\r
+  \ingroup Cortex_M0\r
+  @{\r
+ */\r
+\r
+#include "cmsis_version.h"\r
\r
+/*  CMSIS CM0 definitions */\r
+#define __CM0_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)              /*!< \deprecated [31:16] CMSIS HAL main version */\r
+#define __CM0_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)               /*!< \deprecated [15:0]  CMSIS HAL sub version */\r
+#define __CM0_CMSIS_VERSION       ((__CM0_CMSIS_VERSION_MAIN << 16U) | \\r
+                                    __CM0_CMSIS_VERSION_SUB           )  /*!< \deprecated CMSIS HAL version number */\r
+\r
+#define __CORTEX_M                (0U)                                   /*!< Cortex-M Core */\r
+\r
+/** __FPU_USED indicates whether an FPU is used or not.\r
+    This core does not support an FPU at all\r
+*/\r
+#define __FPU_USED       0U\r
+\r
+#if defined ( __CC_ARM )\r
+  #if defined __TARGET_FPU_VFP\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)\r
+  #if defined __ARM_PCS_VFP\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __GNUC__ )\r
+  #if defined (__VFP_FP__) && !defined(__SOFTFP__)\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __ICCARM__ )\r
+  #if defined __ARMVFP__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __TI_ARM__ )\r
+  #if defined __TI_VFP_SUPPORT__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __TASKING__ )\r
+  #if defined __FPU_VFP__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __CSMC__ )\r
+  #if ( __CSMC__ & 0x400U)\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#endif\r
+\r
+#include "cmsis_compiler.h"               /* CMSIS compiler specific defines */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_CM0_H_GENERIC */\r
+\r
+#ifndef __CMSIS_GENERIC\r
+\r
+#ifndef __CORE_CM0_H_DEPENDANT\r
+#define __CORE_CM0_H_DEPENDANT\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/* check device defines and use defaults */\r
+#if defined __CHECK_DEVICE_DEFINES\r
+  #ifndef __CM0_REV\r
+    #define __CM0_REV               0x0000U\r
+    #warning "__CM0_REV not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __NVIC_PRIO_BITS\r
+    #define __NVIC_PRIO_BITS          2U\r
+    #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __Vendor_SysTickConfig\r
+    #define __Vendor_SysTickConfig    0U\r
+    #warning "__Vendor_SysTickConfig not defined in device header file; using default!"\r
+  #endif\r
+#endif\r
+\r
+/* IO definitions (access restrictions to peripheral registers) */\r
+/**\r
+    \defgroup CMSIS_glob_defs CMSIS Global Defines\r
+\r
+    <strong>IO Type Qualifiers</strong> are used\r
+    \li to specify the access to peripheral variables.\r
+    \li for automatic generation of peripheral register debug information.\r
+*/\r
+#ifdef __cplusplus\r
+  #define   __I     volatile             /*!< Defines 'read only' permissions */\r
+#else\r
+  #define   __I     volatile const       /*!< Defines 'read only' permissions */\r
+#endif\r
+#define     __O     volatile             /*!< Defines 'write only' permissions */\r
+#define     __IO    volatile             /*!< Defines 'read / write' permissions */\r
+\r
+/* following defines should be used for structure members */\r
+#define     __IM     volatile const      /*! Defines 'read only' structure member permissions */\r
+#define     __OM     volatile            /*! Defines 'write only' structure member permissions */\r
+#define     __IOM    volatile            /*! Defines 'read / write' structure member permissions */\r
+\r
+/*@} end of group Cortex_M0 */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                 Register Abstraction\r
+  Core Register contain:\r
+  - Core Register\r
+  - Core NVIC Register\r
+  - Core SCB Register\r
+  - Core SysTick Register\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_core_register Defines and Type Definitions\r
+  \brief Type definitions and defines for Cortex-M processor based devices.\r
+*/\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_CORE  Status and Control Registers\r
+  \brief      Core Register type definitions.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Union type to access the Application Program Status Register (APSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t _reserved0:28;              /*!< bit:  0..27  Reserved */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} APSR_Type;\r
+\r
+/* APSR Register Definitions */\r
+#define APSR_N_Pos                         31U                                            /*!< APSR: N Position */\r
+#define APSR_N_Msk                         (1UL << APSR_N_Pos)                            /*!< APSR: N Mask */\r
+\r
+#define APSR_Z_Pos                         30U                                            /*!< APSR: Z Position */\r
+#define APSR_Z_Msk                         (1UL << APSR_Z_Pos)                            /*!< APSR: Z Mask */\r
+\r
+#define APSR_C_Pos                         29U                                            /*!< APSR: C Position */\r
+#define APSR_C_Msk                         (1UL << APSR_C_Pos)                            /*!< APSR: C Mask */\r
+\r
+#define APSR_V_Pos                         28U                                            /*!< APSR: V Position */\r
+#define APSR_V_Msk                         (1UL << APSR_V_Pos)                            /*!< APSR: V Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Interrupt Program Status Register (IPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:23;              /*!< bit:  9..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} IPSR_Type;\r
+\r
+/* IPSR Register Definitions */\r
+#define IPSR_ISR_Pos                        0U                                            /*!< IPSR: ISR Position */\r
+#define IPSR_ISR_Msk                       (0x1FFUL /*<< IPSR_ISR_Pos*/)                  /*!< IPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Special-Purpose Program Status Registers (xPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:15;              /*!< bit:  9..23  Reserved */\r
+    uint32_t T:1;                        /*!< bit:     24  Thumb bit        (read 0) */\r
+    uint32_t _reserved1:3;               /*!< bit: 25..27  Reserved */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} xPSR_Type;\r
+\r
+/* xPSR Register Definitions */\r
+#define xPSR_N_Pos                         31U                                            /*!< xPSR: N Position */\r
+#define xPSR_N_Msk                         (1UL << xPSR_N_Pos)                            /*!< xPSR: N Mask */\r
+\r
+#define xPSR_Z_Pos                         30U                                            /*!< xPSR: Z Position */\r
+#define xPSR_Z_Msk                         (1UL << xPSR_Z_Pos)                            /*!< xPSR: Z Mask */\r
+\r
+#define xPSR_C_Pos                         29U                                            /*!< xPSR: C Position */\r
+#define xPSR_C_Msk                         (1UL << xPSR_C_Pos)                            /*!< xPSR: C Mask */\r
+\r
+#define xPSR_V_Pos                         28U                                            /*!< xPSR: V Position */\r
+#define xPSR_V_Msk                         (1UL << xPSR_V_Pos)                            /*!< xPSR: V Mask */\r
+\r
+#define xPSR_T_Pos                         24U                                            /*!< xPSR: T Position */\r
+#define xPSR_T_Msk                         (1UL << xPSR_T_Pos)                            /*!< xPSR: T Mask */\r
+\r
+#define xPSR_ISR_Pos                        0U                                            /*!< xPSR: ISR Position */\r
+#define xPSR_ISR_Msk                       (0x1FFUL /*<< xPSR_ISR_Pos*/)                  /*!< xPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Control Registers (CONTROL).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t _reserved0:1;               /*!< bit:      0  Reserved */\r
+    uint32_t SPSEL:1;                    /*!< bit:      1  Stack to be used */\r
+    uint32_t _reserved1:30;              /*!< bit:  2..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} CONTROL_Type;\r
+\r
+/* CONTROL Register Definitions */\r
+#define CONTROL_SPSEL_Pos                   1U                                            /*!< CONTROL: SPSEL Position */\r
+#define CONTROL_SPSEL_Msk                  (1UL << CONTROL_SPSEL_Pos)                     /*!< CONTROL: SPSEL Mask */\r
+\r
+/*@} end of group CMSIS_CORE */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_NVIC  Nested Vectored Interrupt Controller (NVIC)\r
+  \brief      Type definitions for the NVIC Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Nested Vectored Interrupt Controller (NVIC).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t ISER[1U];               /*!< Offset: 0x000 (R/W)  Interrupt Set Enable Register */\r
+        uint32_t RESERVED0[31U];\r
+  __IOM uint32_t ICER[1U];               /*!< Offset: 0x080 (R/W)  Interrupt Clear Enable Register */\r
+        uint32_t RSERVED1[31U];\r
+  __IOM uint32_t ISPR[1U];               /*!< Offset: 0x100 (R/W)  Interrupt Set Pending Register */\r
+        uint32_t RESERVED2[31U];\r
+  __IOM uint32_t ICPR[1U];               /*!< Offset: 0x180 (R/W)  Interrupt Clear Pending Register */\r
+        uint32_t RESERVED3[31U];\r
+        uint32_t RESERVED4[64U];\r
+  __IOM uint32_t IP[8U];                 /*!< Offset: 0x300 (R/W)  Interrupt Priority Register */\r
+}  NVIC_Type;\r
+\r
+/*@} end of group CMSIS_NVIC */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SCB     System Control Block (SCB)\r
+  \brief    Type definitions for the System Control Block Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Control Block (SCB).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t CPUID;                  /*!< Offset: 0x000 (R/ )  CPUID Base Register */\r
+  __IOM uint32_t ICSR;                   /*!< Offset: 0x004 (R/W)  Interrupt Control and State Register */\r
+        uint32_t RESERVED0;\r
+  __IOM uint32_t AIRCR;                  /*!< Offset: 0x00C (R/W)  Application Interrupt and Reset Control Register */\r
+  __IOM uint32_t SCR;                    /*!< Offset: 0x010 (R/W)  System Control Register */\r
+  __IOM uint32_t CCR;                    /*!< Offset: 0x014 (R/W)  Configuration Control Register */\r
+        uint32_t RESERVED1;\r
+  __IOM uint32_t SHP[2U];                /*!< Offset: 0x01C (R/W)  System Handlers Priority Registers. [0] is RESERVED */\r
+  __IOM uint32_t SHCSR;                  /*!< Offset: 0x024 (R/W)  System Handler Control and State Register */\r
+} SCB_Type;\r
+\r
+/* SCB CPUID Register Definitions */\r
+#define SCB_CPUID_IMPLEMENTER_Pos          24U                                            /*!< SCB CPUID: IMPLEMENTER Position */\r
+#define SCB_CPUID_IMPLEMENTER_Msk          (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos)          /*!< SCB CPUID: IMPLEMENTER Mask */\r
+\r
+#define SCB_CPUID_VARIANT_Pos              20U                                            /*!< SCB CPUID: VARIANT Position */\r
+#define SCB_CPUID_VARIANT_Msk              (0xFUL << SCB_CPUID_VARIANT_Pos)               /*!< SCB CPUID: VARIANT Mask */\r
+\r
+#define SCB_CPUID_ARCHITECTURE_Pos         16U                                            /*!< SCB CPUID: ARCHITECTURE Position */\r
+#define SCB_CPUID_ARCHITECTURE_Msk         (0xFUL << SCB_CPUID_ARCHITECTURE_Pos)          /*!< SCB CPUID: ARCHITECTURE Mask */\r
+\r
+#define SCB_CPUID_PARTNO_Pos                4U                                            /*!< SCB CPUID: PARTNO Position */\r
+#define SCB_CPUID_PARTNO_Msk               (0xFFFUL << SCB_CPUID_PARTNO_Pos)              /*!< SCB CPUID: PARTNO Mask */\r
+\r
+#define SCB_CPUID_REVISION_Pos              0U                                            /*!< SCB CPUID: REVISION Position */\r
+#define SCB_CPUID_REVISION_Msk             (0xFUL /*<< SCB_CPUID_REVISION_Pos*/)          /*!< SCB CPUID: REVISION Mask */\r
+\r
+/* SCB Interrupt Control State Register Definitions */\r
+#define SCB_ICSR_NMIPENDSET_Pos            31U                                            /*!< SCB ICSR: NMIPENDSET Position */\r
+#define SCB_ICSR_NMIPENDSET_Msk            (1UL << SCB_ICSR_NMIPENDSET_Pos)               /*!< SCB ICSR: NMIPENDSET Mask */\r
+\r
+#define SCB_ICSR_PENDSVSET_Pos             28U                                            /*!< SCB ICSR: PENDSVSET Position */\r
+#define SCB_ICSR_PENDSVSET_Msk             (1UL << SCB_ICSR_PENDSVSET_Pos)                /*!< SCB ICSR: PENDSVSET Mask */\r
+\r
+#define SCB_ICSR_PENDSVCLR_Pos             27U                                            /*!< SCB ICSR: PENDSVCLR Position */\r
+#define SCB_ICSR_PENDSVCLR_Msk             (1UL << SCB_ICSR_PENDSVCLR_Pos)                /*!< SCB ICSR: PENDSVCLR Mask */\r
+\r
+#define SCB_ICSR_PENDSTSET_Pos             26U                                            /*!< SCB ICSR: PENDSTSET Position */\r
+#define SCB_ICSR_PENDSTSET_Msk             (1UL << SCB_ICSR_PENDSTSET_Pos)                /*!< SCB ICSR: PENDSTSET Mask */\r
+\r
+#define SCB_ICSR_PENDSTCLR_Pos             25U                                            /*!< SCB ICSR: PENDSTCLR Position */\r
+#define SCB_ICSR_PENDSTCLR_Msk             (1UL << SCB_ICSR_PENDSTCLR_Pos)                /*!< SCB ICSR: PENDSTCLR Mask */\r
+\r
+#define SCB_ICSR_ISRPREEMPT_Pos            23U                                            /*!< SCB ICSR: ISRPREEMPT Position */\r
+#define SCB_ICSR_ISRPREEMPT_Msk            (1UL << SCB_ICSR_ISRPREEMPT_Pos)               /*!< SCB ICSR: ISRPREEMPT Mask */\r
+\r
+#define SCB_ICSR_ISRPENDING_Pos            22U                                            /*!< SCB ICSR: ISRPENDING Position */\r
+#define SCB_ICSR_ISRPENDING_Msk            (1UL << SCB_ICSR_ISRPENDING_Pos)               /*!< SCB ICSR: ISRPENDING Mask */\r
+\r
+#define SCB_ICSR_VECTPENDING_Pos           12U                                            /*!< SCB ICSR: VECTPENDING Position */\r
+#define SCB_ICSR_VECTPENDING_Msk           (0x1FFUL << SCB_ICSR_VECTPENDING_Pos)          /*!< SCB ICSR: VECTPENDING Mask */\r
+\r
+#define SCB_ICSR_VECTACTIVE_Pos             0U                                            /*!< SCB ICSR: VECTACTIVE Position */\r
+#define SCB_ICSR_VECTACTIVE_Msk            (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/)       /*!< SCB ICSR: VECTACTIVE Mask */\r
+\r
+/* SCB Application Interrupt and Reset Control Register Definitions */\r
+#define SCB_AIRCR_VECTKEY_Pos              16U                                            /*!< SCB AIRCR: VECTKEY Position */\r
+#define SCB_AIRCR_VECTKEY_Msk              (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos)            /*!< SCB AIRCR: VECTKEY Mask */\r
+\r
+#define SCB_AIRCR_VECTKEYSTAT_Pos          16U                                            /*!< SCB AIRCR: VECTKEYSTAT Position */\r
+#define SCB_AIRCR_VECTKEYSTAT_Msk          (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos)        /*!< SCB AIRCR: VECTKEYSTAT Mask */\r
+\r
+#define SCB_AIRCR_ENDIANESS_Pos            15U                                            /*!< SCB AIRCR: ENDIANESS Position */\r
+#define SCB_AIRCR_ENDIANESS_Msk            (1UL << SCB_AIRCR_ENDIANESS_Pos)               /*!< SCB AIRCR: ENDIANESS Mask */\r
+\r
+#define SCB_AIRCR_SYSRESETREQ_Pos           2U                                            /*!< SCB AIRCR: SYSRESETREQ Position */\r
+#define SCB_AIRCR_SYSRESETREQ_Msk          (1UL << SCB_AIRCR_SYSRESETREQ_Pos)             /*!< SCB AIRCR: SYSRESETREQ Mask */\r
+\r
+#define SCB_AIRCR_VECTCLRACTIVE_Pos         1U                                            /*!< SCB AIRCR: VECTCLRACTIVE Position */\r
+#define SCB_AIRCR_VECTCLRACTIVE_Msk        (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos)           /*!< SCB AIRCR: VECTCLRACTIVE Mask */\r
+\r
+/* SCB System Control Register Definitions */\r
+#define SCB_SCR_SEVONPEND_Pos               4U                                            /*!< SCB SCR: SEVONPEND Position */\r
+#define SCB_SCR_SEVONPEND_Msk              (1UL << SCB_SCR_SEVONPEND_Pos)                 /*!< SCB SCR: SEVONPEND Mask */\r
+\r
+#define SCB_SCR_SLEEPDEEP_Pos               2U                                            /*!< SCB SCR: SLEEPDEEP Position */\r
+#define SCB_SCR_SLEEPDEEP_Msk              (1UL << SCB_SCR_SLEEPDEEP_Pos)                 /*!< SCB SCR: SLEEPDEEP Mask */\r
+\r
+#define SCB_SCR_SLEEPONEXIT_Pos             1U                                            /*!< SCB SCR: SLEEPONEXIT Position */\r
+#define SCB_SCR_SLEEPONEXIT_Msk            (1UL << SCB_SCR_SLEEPONEXIT_Pos)               /*!< SCB SCR: SLEEPONEXIT Mask */\r
+\r
+/* SCB Configuration Control Register Definitions */\r
+#define SCB_CCR_STKALIGN_Pos                9U                                            /*!< SCB CCR: STKALIGN Position */\r
+#define SCB_CCR_STKALIGN_Msk               (1UL << SCB_CCR_STKALIGN_Pos)                  /*!< SCB CCR: STKALIGN Mask */\r
+\r
+#define SCB_CCR_UNALIGN_TRP_Pos             3U                                            /*!< SCB CCR: UNALIGN_TRP Position */\r
+#define SCB_CCR_UNALIGN_TRP_Msk            (1UL << SCB_CCR_UNALIGN_TRP_Pos)               /*!< SCB CCR: UNALIGN_TRP Mask */\r
+\r
+/* SCB System Handler Control and State Register Definitions */\r
+#define SCB_SHCSR_SVCALLPENDED_Pos         15U                                            /*!< SCB SHCSR: SVCALLPENDED Position */\r
+#define SCB_SHCSR_SVCALLPENDED_Msk         (1UL << SCB_SHCSR_SVCALLPENDED_Pos)            /*!< SCB SHCSR: SVCALLPENDED Mask */\r
+\r
+/*@} end of group CMSIS_SCB */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SysTick     System Tick Timer (SysTick)\r
+  \brief    Type definitions for the System Timer Registers.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Timer (SysTick).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  SysTick Control and Status Register */\r
+  __IOM uint32_t LOAD;                   /*!< Offset: 0x004 (R/W)  SysTick Reload Value Register */\r
+  __IOM uint32_t VAL;                    /*!< Offset: 0x008 (R/W)  SysTick Current Value Register */\r
+  __IM  uint32_t CALIB;                  /*!< Offset: 0x00C (R/ )  SysTick Calibration Register */\r
+} SysTick_Type;\r
+\r
+/* SysTick Control / Status Register Definitions */\r
+#define SysTick_CTRL_COUNTFLAG_Pos         16U                                            /*!< SysTick CTRL: COUNTFLAG Position */\r
+#define SysTick_CTRL_COUNTFLAG_Msk         (1UL << SysTick_CTRL_COUNTFLAG_Pos)            /*!< SysTick CTRL: COUNTFLAG Mask */\r
+\r
+#define SysTick_CTRL_CLKSOURCE_Pos          2U                                            /*!< SysTick CTRL: CLKSOURCE Position */\r
+#define SysTick_CTRL_CLKSOURCE_Msk         (1UL << SysTick_CTRL_CLKSOURCE_Pos)            /*!< SysTick CTRL: CLKSOURCE Mask */\r
+\r
+#define SysTick_CTRL_TICKINT_Pos            1U                                            /*!< SysTick CTRL: TICKINT Position */\r
+#define SysTick_CTRL_TICKINT_Msk           (1UL << SysTick_CTRL_TICKINT_Pos)              /*!< SysTick CTRL: TICKINT Mask */\r
+\r
+#define SysTick_CTRL_ENABLE_Pos             0U                                            /*!< SysTick CTRL: ENABLE Position */\r
+#define SysTick_CTRL_ENABLE_Msk            (1UL /*<< SysTick_CTRL_ENABLE_Pos*/)           /*!< SysTick CTRL: ENABLE Mask */\r
+\r
+/* SysTick Reload Register Definitions */\r
+#define SysTick_LOAD_RELOAD_Pos             0U                                            /*!< SysTick LOAD: RELOAD Position */\r
+#define SysTick_LOAD_RELOAD_Msk            (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/)    /*!< SysTick LOAD: RELOAD Mask */\r
+\r
+/* SysTick Current Register Definitions */\r
+#define SysTick_VAL_CURRENT_Pos             0U                                            /*!< SysTick VAL: CURRENT Position */\r
+#define SysTick_VAL_CURRENT_Msk            (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/)    /*!< SysTick VAL: CURRENT Mask */\r
+\r
+/* SysTick Calibration Register Definitions */\r
+#define SysTick_CALIB_NOREF_Pos            31U                                            /*!< SysTick CALIB: NOREF Position */\r
+#define SysTick_CALIB_NOREF_Msk            (1UL << SysTick_CALIB_NOREF_Pos)               /*!< SysTick CALIB: NOREF Mask */\r
+\r
+#define SysTick_CALIB_SKEW_Pos             30U                                            /*!< SysTick CALIB: SKEW Position */\r
+#define SysTick_CALIB_SKEW_Msk             (1UL << SysTick_CALIB_SKEW_Pos)                /*!< SysTick CALIB: SKEW Mask */\r
+\r
+#define SysTick_CALIB_TENMS_Pos             0U                                            /*!< SysTick CALIB: TENMS Position */\r
+#define SysTick_CALIB_TENMS_Msk            (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/)    /*!< SysTick CALIB: TENMS Mask */\r
+\r
+/*@} end of group CMSIS_SysTick */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_CoreDebug       Core Debug Registers (CoreDebug)\r
+  \brief    Cortex-M0 Core Debug Registers (DCB registers, SHCSR, and DFSR) are only accessible over DAP and not via processor.\r
+            Therefore they are not covered by the Cortex-M0 header file.\r
+  @{\r
+ */\r
+/*@} end of group CMSIS_CoreDebug */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_bitfield     Core register bit field macros\r
+  \brief      Macros for use with bit field definitions (xxx_Pos, xxx_Msk).\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   Mask and shift a bit field value for use in a register bit range.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of the bit field. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted value.\r
+*/\r
+#define _VAL2FLD(field, value)    (((uint32_t)(value) << field ## _Pos) & field ## _Msk)\r
+\r
+/**\r
+  \brief     Mask and shift a register value to extract a bit filed value.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of register. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted bit field value.\r
+*/\r
+#define _FLD2VAL(field, value)    (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)\r
+\r
+/*@} end of group CMSIS_core_bitfield */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_base     Core Definitions\r
+  \brief      Definitions for base addresses, unions, and structures.\r
+  @{\r
+ */\r
+\r
+/* Memory mapping of Core Hardware */\r
+#define SCS_BASE            (0xE000E000UL)                            /*!< System Control Space Base Address */\r
+#define SysTick_BASE        (SCS_BASE +  0x0010UL)                    /*!< SysTick Base Address */\r
+#define NVIC_BASE           (SCS_BASE +  0x0100UL)                    /*!< NVIC Base Address */\r
+#define SCB_BASE            (SCS_BASE +  0x0D00UL)                    /*!< System Control Block Base Address */\r
+\r
+#define SCB                 ((SCB_Type       *)     SCB_BASE      )   /*!< SCB configuration struct */\r
+#define SysTick             ((SysTick_Type   *)     SysTick_BASE  )   /*!< SysTick configuration struct */\r
+#define NVIC                ((NVIC_Type      *)     NVIC_BASE     )   /*!< NVIC configuration struct */\r
+\r
+\r
+/*@} */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                Hardware Abstraction Layer\r
+  Core Function Interface contains:\r
+  - Core NVIC Functions\r
+  - Core SysTick Functions\r
+  - Core Register Access Functions\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference\r
+*/\r
+\r
+\r
+\r
+/* ##########################   NVIC functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_NVICFunctions NVIC Functions\r
+  \brief    Functions that manage interrupts and exceptions via the NVIC.\r
+  @{\r
+ */\r
+\r
+#ifdef CMSIS_NVIC_VIRTUAL\r
+  #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+    #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"\r
+  #endif\r
+  #include CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+#else\r
+  #define NVIC_SetPriorityGrouping    __NVIC_SetPriorityGrouping\r
+  #define NVIC_GetPriorityGrouping    __NVIC_GetPriorityGrouping\r
+  #define NVIC_EnableIRQ              __NVIC_EnableIRQ\r
+  #define NVIC_GetEnableIRQ           __NVIC_GetEnableIRQ\r
+  #define NVIC_DisableIRQ             __NVIC_DisableIRQ\r
+  #define NVIC_GetPendingIRQ          __NVIC_GetPendingIRQ\r
+  #define NVIC_SetPendingIRQ          __NVIC_SetPendingIRQ\r
+  #define NVIC_ClearPendingIRQ        __NVIC_ClearPendingIRQ\r
+/*#define NVIC_GetActive              __NVIC_GetActive             not available for Cortex-M0 */\r
+  #define NVIC_SetPriority            __NVIC_SetPriority\r
+  #define NVIC_GetPriority            __NVIC_GetPriority\r
+  #define NVIC_SystemReset            __NVIC_SystemReset\r
+#endif /* CMSIS_NVIC_VIRTUAL */\r
+\r
+#ifdef CMSIS_VECTAB_VIRTUAL\r
+  #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+    #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"\r
+  #endif\r
+  #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+#else\r
+  #define NVIC_SetVector              __NVIC_SetVector\r
+  #define NVIC_GetVector              __NVIC_GetVector\r
+#endif  /* (CMSIS_VECTAB_VIRTUAL) */\r
+\r
+#define NVIC_USER_IRQ_OFFSET          16\r
+\r
+\r
+/* The following EXC_RETURN values are saved the LR on exception entry */\r
+#define EXC_RETURN_HANDLER         (0xFFFFFFF1UL)     /* return to Handler mode, uses MSP after return                               */\r
+#define EXC_RETURN_THREAD_MSP      (0xFFFFFFF9UL)     /* return to Thread mode, uses MSP after return                                */\r
+#define EXC_RETURN_THREAD_PSP      (0xFFFFFFFDUL)     /* return to Thread mode, uses PSP after return                                */\r
+\r
+\r
+/* Interrupt Priorities are WORD accessible only under Armv6-M                  */\r
+/* The following MACROS handle generation of the register offset and byte masks */\r
+#define _BIT_SHIFT(IRQn)         (  ((((uint32_t)(int32_t)(IRQn))         )      &  0x03UL) * 8UL)\r
+#define _SHP_IDX(IRQn)           ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >>    2UL)      )\r
+#define _IP_IDX(IRQn)            (   (((uint32_t)(int32_t)(IRQn))                >>    2UL)      )\r
+\r
+#define __NVIC_SetPriorityGrouping(X) (void)(X)\r
+#define __NVIC_GetPriorityGrouping()  (0U)\r
+\r
+/**\r
+  \brief   Enable Interrupt\r
+  \details Enables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Enable status\r
+  \details Returns a device specific interrupt enable status from the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt is not enabled.\r
+  \return             1  Interrupt is enabled.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISER[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Disable Interrupt\r
+  \details Disables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+    __DSB();\r
+    __ISB();\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Pending Interrupt\r
+  \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not pending.\r
+  \return             1  Interrupt status is pending.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Pending Interrupt\r
+  \details Sets the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Clear Pending Interrupt\r
+  \details Clears the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Priority\r
+  \details Sets the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]      IRQn  Interrupt number.\r
+  \param [in]  priority  Priority to set.\r
+  \note    The priority cannot be set for every processor exception.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->IP[_IP_IDX(IRQn)]  = ((uint32_t)(NVIC->IP[_IP_IDX(IRQn)]  & ~(0xFFUL << _BIT_SHIFT(IRQn))) |\r
+       (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));\r
+  }\r
+  else\r
+  {\r
+    SCB->SHP[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |\r
+       (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Priority\r
+  \details Reads the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn  Interrupt number.\r
+  \return             Interrupt Priority.\r
+                      Value is aligned automatically to the implemented priority bits of the microcontroller.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)\r
+{\r
+\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+  else\r
+  {\r
+    return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Encode Priority\r
+  \details Encodes the priority for an interrupt with the given priority group,\r
+           preemptive priority value, and subpriority value.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.\r
+  \param [in]     PriorityGroup  Used priority group.\r
+  \param [in]   PreemptPriority  Preemptive priority value (starting from 0).\r
+  \param [in]       SubPriority  Subpriority value (starting from 0).\r
+  \return                        Encoded priority. Value can be used in the function \ref NVIC_SetPriority().\r
+ */\r
+__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);\r
+  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));\r
+\r
+  return (\r
+           ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |\r
+           ((SubPriority     & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL)))\r
+         );\r
+}\r
+\r
+\r
+/**\r
+  \brief   Decode Priority\r
+  \details Decodes an interrupt priority value with a given priority group to\r
+           preemptive priority value and subpriority value.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.\r
+  \param [in]         Priority   Priority value, which can be retrieved with the function \ref NVIC_GetPriority().\r
+  \param [in]     PriorityGroup  Used priority group.\r
+  \param [out] pPreemptPriority  Preemptive priority value (starting from 0).\r
+  \param [out]     pSubPriority  Subpriority value (starting from 0).\r
+ */\r
+__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);\r
+  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));\r
+\r
+  *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);\r
+  *pSubPriority     = (Priority                   ) & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL);\r
+}\r
+\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Vector\r
+  \details Sets an interrupt vector in SRAM based interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+           Address 0 must be mapped to SRAM.\r
+  \param [in]   IRQn      Interrupt number\r
+  \param [in]   vector    Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)\r
+{\r
+  uint32_t *vectors = (uint32_t *)0x0U;\r
+  vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Vector\r
+  \details Reads an interrupt vector from interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn      Interrupt number.\r
+  \return                 Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)\r
+{\r
+  uint32_t *vectors = (uint32_t *)0x0U;\r
+  return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];\r
+}\r
+\r
+\r
+/**\r
+  \brief   System Reset\r
+  \details Initiates a system reset request to reset the MCU.\r
+ */\r
+__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)\r
+{\r
+  __DSB();                                                          /* Ensure all outstanding memory accesses included\r
+                                                                       buffered write are completed before reset */\r
+  SCB->AIRCR  = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |\r
+                 SCB_AIRCR_SYSRESETREQ_Msk);\r
+  __DSB();                                                          /* Ensure completion of memory access */\r
+\r
+  for(;;)                                                           /* wait until reset */\r
+  {\r
+    __NOP();\r
+  }\r
+}\r
+\r
+/*@} end of CMSIS_Core_NVICFunctions */\r
+\r
+\r
+/* ##########################  FPU functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_FpuFunctions FPU Functions\r
+  \brief    Function that provides FPU type.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   get FPU type\r
+  \details returns the FPU type\r
+  \returns\r
+   - \b  0: No FPU\r
+   - \b  1: Single precision FPU\r
+   - \b  2: Double + Single precision FPU\r
+ */\r
+__STATIC_INLINE uint32_t SCB_GetFPUType(void)\r
+{\r
+    return 0U;           /* No FPU */\r
+}\r
+\r
+\r
+/*@} end of CMSIS_Core_FpuFunctions */\r
+\r
+\r
+\r
+/* ##################################    SysTick function  ############################################ */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_SysTickFunctions SysTick Functions\r
+  \brief    Functions that configure the System.\r
+  @{\r
+ */\r
+\r
+#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)\r
+\r
+/**\r
+  \brief   System Tick Configuration\r
+  \details Initializes the System Timer and its interrupt, and starts the System Tick Timer.\r
+           Counter is in free running mode to generate periodic interrupts.\r
+  \param [in]  ticks  Number of ticks between two interrupts.\r
+  \return          0  Function succeeded.\r
+  \return          1  Function failed.\r
+  \note    When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the\r
+           function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>\r
+           must contain a vendor-specific implementation of this function.\r
+ */\r
+__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)\r
+{\r
+  if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)\r
+  {\r
+    return (1UL);                                                   /* Reload value impossible */\r
+  }\r
+\r
+  SysTick->LOAD  = (uint32_t)(ticks - 1UL);                         /* set reload register */\r
+  NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */\r
+  SysTick->VAL   = 0UL;                                             /* Load the SysTick Counter Value */\r
+  SysTick->CTRL  = SysTick_CTRL_CLKSOURCE_Msk |\r
+                   SysTick_CTRL_TICKINT_Msk   |\r
+                   SysTick_CTRL_ENABLE_Msk;                         /* Enable SysTick IRQ and SysTick Timer */\r
+  return (0UL);                                                     /* Function successful */\r
+}\r
+\r
+#endif\r
+\r
+/*@} end of CMSIS_Core_SysTickFunctions */\r
+\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_CM0_H_DEPENDANT */\r
+\r
+#endif /* __CMSIS_GENERIC */\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm0plus.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm0plus.h
new file mode 100644 (file)
index 0000000..b9377e8
--- /dev/null
@@ -0,0 +1,1083 @@
+/**************************************************************************//**\r
+ * @file     core_cm0plus.h\r
+ * @brief    CMSIS Cortex-M0+ Core Peripheral Access Layer Header File\r
+ * @version  V5.0.6\r
+ * @date     28. May 2018\r
+ ******************************************************************************/\r
+/*\r
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.\r
+ *\r
+ * SPDX-License-Identifier: Apache-2.0\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the License); you may\r
+ * not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#if   defined ( __ICCARM__ )\r
+  #pragma system_include         /* treat file as system include file for MISRA check */\r
+#elif defined (__clang__)\r
+  #pragma clang system_header   /* treat file as system include file */\r
+#endif\r
+\r
+#ifndef __CORE_CM0PLUS_H_GENERIC\r
+#define __CORE_CM0PLUS_H_GENERIC\r
+\r
+#include <stdint.h>\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/**\r
+  \page CMSIS_MISRA_Exceptions  MISRA-C:2004 Compliance Exceptions\r
+  CMSIS violates the following MISRA-C:2004 rules:\r
+\r
+   \li Required Rule 8.5, object/function definition in header file.<br>\r
+     Function definitions in header files are used to allow 'inlining'.\r
+\r
+   \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>\r
+     Unions are used for effective representation of core registers.\r
+\r
+   \li Advisory Rule 19.7, Function-like macro defined.<br>\r
+     Function-like macros are used to allow more efficient code.\r
+ */\r
+\r
+\r
+/*******************************************************************************\r
+ *                 CMSIS definitions\r
+ ******************************************************************************/\r
+/**\r
+  \ingroup Cortex-M0+\r
+  @{\r
+ */\r
+\r
+#include "cmsis_version.h"\r
\r
+/*  CMSIS CM0+ definitions */\r
+#define __CM0PLUS_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN)                  /*!< \deprecated [31:16] CMSIS HAL main version */\r
+#define __CM0PLUS_CMSIS_VERSION_SUB  (__CM_CMSIS_VERSION_SUB)                   /*!< \deprecated [15:0]  CMSIS HAL sub version */\r
+#define __CM0PLUS_CMSIS_VERSION      ((__CM0PLUS_CMSIS_VERSION_MAIN << 16U) | \\r
+                                       __CM0PLUS_CMSIS_VERSION_SUB           )  /*!< \deprecated CMSIS HAL version number */\r
+\r
+#define __CORTEX_M                   (0U)                                       /*!< Cortex-M Core */\r
+\r
+/** __FPU_USED indicates whether an FPU is used or not.\r
+    This core does not support an FPU at all\r
+*/\r
+#define __FPU_USED       0U\r
+\r
+#if defined ( __CC_ARM )\r
+  #if defined __TARGET_FPU_VFP\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)\r
+  #if defined __ARM_PCS_VFP\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __GNUC__ )\r
+  #if defined (__VFP_FP__) && !defined(__SOFTFP__)\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __ICCARM__ )\r
+  #if defined __ARMVFP__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __TI_ARM__ )\r
+  #if defined __TI_VFP_SUPPORT__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __TASKING__ )\r
+  #if defined __FPU_VFP__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __CSMC__ )\r
+  #if ( __CSMC__ & 0x400U)\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#endif\r
+\r
+#include "cmsis_compiler.h"               /* CMSIS compiler specific defines */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_CM0PLUS_H_GENERIC */\r
+\r
+#ifndef __CMSIS_GENERIC\r
+\r
+#ifndef __CORE_CM0PLUS_H_DEPENDANT\r
+#define __CORE_CM0PLUS_H_DEPENDANT\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/* check device defines and use defaults */\r
+#if defined __CHECK_DEVICE_DEFINES\r
+  #ifndef __CM0PLUS_REV\r
+    #define __CM0PLUS_REV             0x0000U\r
+    #warning "__CM0PLUS_REV not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __MPU_PRESENT\r
+    #define __MPU_PRESENT             0U\r
+    #warning "__MPU_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __VTOR_PRESENT\r
+    #define __VTOR_PRESENT            0U\r
+    #warning "__VTOR_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __NVIC_PRIO_BITS\r
+    #define __NVIC_PRIO_BITS          2U\r
+    #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __Vendor_SysTickConfig\r
+    #define __Vendor_SysTickConfig    0U\r
+    #warning "__Vendor_SysTickConfig not defined in device header file; using default!"\r
+  #endif\r
+#endif\r
+\r
+/* IO definitions (access restrictions to peripheral registers) */\r
+/**\r
+    \defgroup CMSIS_glob_defs CMSIS Global Defines\r
+\r
+    <strong>IO Type Qualifiers</strong> are used\r
+    \li to specify the access to peripheral variables.\r
+    \li for automatic generation of peripheral register debug information.\r
+*/\r
+#ifdef __cplusplus\r
+  #define   __I     volatile             /*!< Defines 'read only' permissions */\r
+#else\r
+  #define   __I     volatile const       /*!< Defines 'read only' permissions */\r
+#endif\r
+#define     __O     volatile             /*!< Defines 'write only' permissions */\r
+#define     __IO    volatile             /*!< Defines 'read / write' permissions */\r
+\r
+/* following defines should be used for structure members */\r
+#define     __IM     volatile const      /*! Defines 'read only' structure member permissions */\r
+#define     __OM     volatile            /*! Defines 'write only' structure member permissions */\r
+#define     __IOM    volatile            /*! Defines 'read / write' structure member permissions */\r
+\r
+/*@} end of group Cortex-M0+ */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                 Register Abstraction\r
+  Core Register contain:\r
+  - Core Register\r
+  - Core NVIC Register\r
+  - Core SCB Register\r
+  - Core SysTick Register\r
+  - Core MPU Register\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_core_register Defines and Type Definitions\r
+  \brief Type definitions and defines for Cortex-M processor based devices.\r
+*/\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_CORE  Status and Control Registers\r
+  \brief      Core Register type definitions.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Union type to access the Application Program Status Register (APSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t _reserved0:28;              /*!< bit:  0..27  Reserved */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} APSR_Type;\r
+\r
+/* APSR Register Definitions */\r
+#define APSR_N_Pos                         31U                                            /*!< APSR: N Position */\r
+#define APSR_N_Msk                         (1UL << APSR_N_Pos)                            /*!< APSR: N Mask */\r
+\r
+#define APSR_Z_Pos                         30U                                            /*!< APSR: Z Position */\r
+#define APSR_Z_Msk                         (1UL << APSR_Z_Pos)                            /*!< APSR: Z Mask */\r
+\r
+#define APSR_C_Pos                         29U                                            /*!< APSR: C Position */\r
+#define APSR_C_Msk                         (1UL << APSR_C_Pos)                            /*!< APSR: C Mask */\r
+\r
+#define APSR_V_Pos                         28U                                            /*!< APSR: V Position */\r
+#define APSR_V_Msk                         (1UL << APSR_V_Pos)                            /*!< APSR: V Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Interrupt Program Status Register (IPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:23;              /*!< bit:  9..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} IPSR_Type;\r
+\r
+/* IPSR Register Definitions */\r
+#define IPSR_ISR_Pos                        0U                                            /*!< IPSR: ISR Position */\r
+#define IPSR_ISR_Msk                       (0x1FFUL /*<< IPSR_ISR_Pos*/)                  /*!< IPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Special-Purpose Program Status Registers (xPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:15;              /*!< bit:  9..23  Reserved */\r
+    uint32_t T:1;                        /*!< bit:     24  Thumb bit        (read 0) */\r
+    uint32_t _reserved1:3;               /*!< bit: 25..27  Reserved */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} xPSR_Type;\r
+\r
+/* xPSR Register Definitions */\r
+#define xPSR_N_Pos                         31U                                            /*!< xPSR: N Position */\r
+#define xPSR_N_Msk                         (1UL << xPSR_N_Pos)                            /*!< xPSR: N Mask */\r
+\r
+#define xPSR_Z_Pos                         30U                                            /*!< xPSR: Z Position */\r
+#define xPSR_Z_Msk                         (1UL << xPSR_Z_Pos)                            /*!< xPSR: Z Mask */\r
+\r
+#define xPSR_C_Pos                         29U                                            /*!< xPSR: C Position */\r
+#define xPSR_C_Msk                         (1UL << xPSR_C_Pos)                            /*!< xPSR: C Mask */\r
+\r
+#define xPSR_V_Pos                         28U                                            /*!< xPSR: V Position */\r
+#define xPSR_V_Msk                         (1UL << xPSR_V_Pos)                            /*!< xPSR: V Mask */\r
+\r
+#define xPSR_T_Pos                         24U                                            /*!< xPSR: T Position */\r
+#define xPSR_T_Msk                         (1UL << xPSR_T_Pos)                            /*!< xPSR: T Mask */\r
+\r
+#define xPSR_ISR_Pos                        0U                                            /*!< xPSR: ISR Position */\r
+#define xPSR_ISR_Msk                       (0x1FFUL /*<< xPSR_ISR_Pos*/)                  /*!< xPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Control Registers (CONTROL).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t nPRIV:1;                    /*!< bit:      0  Execution privilege in Thread mode */\r
+    uint32_t SPSEL:1;                    /*!< bit:      1  Stack to be used */\r
+    uint32_t _reserved1:30;              /*!< bit:  2..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} CONTROL_Type;\r
+\r
+/* CONTROL Register Definitions */\r
+#define CONTROL_SPSEL_Pos                   1U                                            /*!< CONTROL: SPSEL Position */\r
+#define CONTROL_SPSEL_Msk                  (1UL << CONTROL_SPSEL_Pos)                     /*!< CONTROL: SPSEL Mask */\r
+\r
+#define CONTROL_nPRIV_Pos                   0U                                            /*!< CONTROL: nPRIV Position */\r
+#define CONTROL_nPRIV_Msk                  (1UL /*<< CONTROL_nPRIV_Pos*/)                 /*!< CONTROL: nPRIV Mask */\r
+\r
+/*@} end of group CMSIS_CORE */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_NVIC  Nested Vectored Interrupt Controller (NVIC)\r
+  \brief      Type definitions for the NVIC Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Nested Vectored Interrupt Controller (NVIC).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t ISER[1U];               /*!< Offset: 0x000 (R/W)  Interrupt Set Enable Register */\r
+        uint32_t RESERVED0[31U];\r
+  __IOM uint32_t ICER[1U];               /*!< Offset: 0x080 (R/W)  Interrupt Clear Enable Register */\r
+        uint32_t RSERVED1[31U];\r
+  __IOM uint32_t ISPR[1U];               /*!< Offset: 0x100 (R/W)  Interrupt Set Pending Register */\r
+        uint32_t RESERVED2[31U];\r
+  __IOM uint32_t ICPR[1U];               /*!< Offset: 0x180 (R/W)  Interrupt Clear Pending Register */\r
+        uint32_t RESERVED3[31U];\r
+        uint32_t RESERVED4[64U];\r
+  __IOM uint32_t IP[8U];                 /*!< Offset: 0x300 (R/W)  Interrupt Priority Register */\r
+}  NVIC_Type;\r
+\r
+/*@} end of group CMSIS_NVIC */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SCB     System Control Block (SCB)\r
+  \brief    Type definitions for the System Control Block Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Control Block (SCB).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t CPUID;                  /*!< Offset: 0x000 (R/ )  CPUID Base Register */\r
+  __IOM uint32_t ICSR;                   /*!< Offset: 0x004 (R/W)  Interrupt Control and State Register */\r
+#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)\r
+  __IOM uint32_t VTOR;                   /*!< Offset: 0x008 (R/W)  Vector Table Offset Register */\r
+#else\r
+        uint32_t RESERVED0;\r
+#endif\r
+  __IOM uint32_t AIRCR;                  /*!< Offset: 0x00C (R/W)  Application Interrupt and Reset Control Register */\r
+  __IOM uint32_t SCR;                    /*!< Offset: 0x010 (R/W)  System Control Register */\r
+  __IOM uint32_t CCR;                    /*!< Offset: 0x014 (R/W)  Configuration Control Register */\r
+        uint32_t RESERVED1;\r
+  __IOM uint32_t SHP[2U];                /*!< Offset: 0x01C (R/W)  System Handlers Priority Registers. [0] is RESERVED */\r
+  __IOM uint32_t SHCSR;                  /*!< Offset: 0x024 (R/W)  System Handler Control and State Register */\r
+} SCB_Type;\r
+\r
+/* SCB CPUID Register Definitions */\r
+#define SCB_CPUID_IMPLEMENTER_Pos          24U                                            /*!< SCB CPUID: IMPLEMENTER Position */\r
+#define SCB_CPUID_IMPLEMENTER_Msk          (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos)          /*!< SCB CPUID: IMPLEMENTER Mask */\r
+\r
+#define SCB_CPUID_VARIANT_Pos              20U                                            /*!< SCB CPUID: VARIANT Position */\r
+#define SCB_CPUID_VARIANT_Msk              (0xFUL << SCB_CPUID_VARIANT_Pos)               /*!< SCB CPUID: VARIANT Mask */\r
+\r
+#define SCB_CPUID_ARCHITECTURE_Pos         16U                                            /*!< SCB CPUID: ARCHITECTURE Position */\r
+#define SCB_CPUID_ARCHITECTURE_Msk         (0xFUL << SCB_CPUID_ARCHITECTURE_Pos)          /*!< SCB CPUID: ARCHITECTURE Mask */\r
+\r
+#define SCB_CPUID_PARTNO_Pos                4U                                            /*!< SCB CPUID: PARTNO Position */\r
+#define SCB_CPUID_PARTNO_Msk               (0xFFFUL << SCB_CPUID_PARTNO_Pos)              /*!< SCB CPUID: PARTNO Mask */\r
+\r
+#define SCB_CPUID_REVISION_Pos              0U                                            /*!< SCB CPUID: REVISION Position */\r
+#define SCB_CPUID_REVISION_Msk             (0xFUL /*<< SCB_CPUID_REVISION_Pos*/)          /*!< SCB CPUID: REVISION Mask */\r
+\r
+/* SCB Interrupt Control State Register Definitions */\r
+#define SCB_ICSR_NMIPENDSET_Pos            31U                                            /*!< SCB ICSR: NMIPENDSET Position */\r
+#define SCB_ICSR_NMIPENDSET_Msk            (1UL << SCB_ICSR_NMIPENDSET_Pos)               /*!< SCB ICSR: NMIPENDSET Mask */\r
+\r
+#define SCB_ICSR_PENDSVSET_Pos             28U                                            /*!< SCB ICSR: PENDSVSET Position */\r
+#define SCB_ICSR_PENDSVSET_Msk             (1UL << SCB_ICSR_PENDSVSET_Pos)                /*!< SCB ICSR: PENDSVSET Mask */\r
+\r
+#define SCB_ICSR_PENDSVCLR_Pos             27U                                            /*!< SCB ICSR: PENDSVCLR Position */\r
+#define SCB_ICSR_PENDSVCLR_Msk             (1UL << SCB_ICSR_PENDSVCLR_Pos)                /*!< SCB ICSR: PENDSVCLR Mask */\r
+\r
+#define SCB_ICSR_PENDSTSET_Pos             26U                                            /*!< SCB ICSR: PENDSTSET Position */\r
+#define SCB_ICSR_PENDSTSET_Msk             (1UL << SCB_ICSR_PENDSTSET_Pos)                /*!< SCB ICSR: PENDSTSET Mask */\r
+\r
+#define SCB_ICSR_PENDSTCLR_Pos             25U                                            /*!< SCB ICSR: PENDSTCLR Position */\r
+#define SCB_ICSR_PENDSTCLR_Msk             (1UL << SCB_ICSR_PENDSTCLR_Pos)                /*!< SCB ICSR: PENDSTCLR Mask */\r
+\r
+#define SCB_ICSR_ISRPREEMPT_Pos            23U                                            /*!< SCB ICSR: ISRPREEMPT Position */\r
+#define SCB_ICSR_ISRPREEMPT_Msk            (1UL << SCB_ICSR_ISRPREEMPT_Pos)               /*!< SCB ICSR: ISRPREEMPT Mask */\r
+\r
+#define SCB_ICSR_ISRPENDING_Pos            22U                                            /*!< SCB ICSR: ISRPENDING Position */\r
+#define SCB_ICSR_ISRPENDING_Msk            (1UL << SCB_ICSR_ISRPENDING_Pos)               /*!< SCB ICSR: ISRPENDING Mask */\r
+\r
+#define SCB_ICSR_VECTPENDING_Pos           12U                                            /*!< SCB ICSR: VECTPENDING Position */\r
+#define SCB_ICSR_VECTPENDING_Msk           (0x1FFUL << SCB_ICSR_VECTPENDING_Pos)          /*!< SCB ICSR: VECTPENDING Mask */\r
+\r
+#define SCB_ICSR_VECTACTIVE_Pos             0U                                            /*!< SCB ICSR: VECTACTIVE Position */\r
+#define SCB_ICSR_VECTACTIVE_Msk            (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/)       /*!< SCB ICSR: VECTACTIVE Mask */\r
+\r
+#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)\r
+/* SCB Interrupt Control State Register Definitions */\r
+#define SCB_VTOR_TBLOFF_Pos                 8U                                            /*!< SCB VTOR: TBLOFF Position */\r
+#define SCB_VTOR_TBLOFF_Msk                (0xFFFFFFUL << SCB_VTOR_TBLOFF_Pos)            /*!< SCB VTOR: TBLOFF Mask */\r
+#endif\r
+\r
+/* SCB Application Interrupt and Reset Control Register Definitions */\r
+#define SCB_AIRCR_VECTKEY_Pos              16U                                            /*!< SCB AIRCR: VECTKEY Position */\r
+#define SCB_AIRCR_VECTKEY_Msk              (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos)            /*!< SCB AIRCR: VECTKEY Mask */\r
+\r
+#define SCB_AIRCR_VECTKEYSTAT_Pos          16U                                            /*!< SCB AIRCR: VECTKEYSTAT Position */\r
+#define SCB_AIRCR_VECTKEYSTAT_Msk          (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos)        /*!< SCB AIRCR: VECTKEYSTAT Mask */\r
+\r
+#define SCB_AIRCR_ENDIANESS_Pos            15U                                            /*!< SCB AIRCR: ENDIANESS Position */\r
+#define SCB_AIRCR_ENDIANESS_Msk            (1UL << SCB_AIRCR_ENDIANESS_Pos)               /*!< SCB AIRCR: ENDIANESS Mask */\r
+\r
+#define SCB_AIRCR_SYSRESETREQ_Pos           2U                                            /*!< SCB AIRCR: SYSRESETREQ Position */\r
+#define SCB_AIRCR_SYSRESETREQ_Msk          (1UL << SCB_AIRCR_SYSRESETREQ_Pos)             /*!< SCB AIRCR: SYSRESETREQ Mask */\r
+\r
+#define SCB_AIRCR_VECTCLRACTIVE_Pos         1U                                            /*!< SCB AIRCR: VECTCLRACTIVE Position */\r
+#define SCB_AIRCR_VECTCLRACTIVE_Msk        (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos)           /*!< SCB AIRCR: VECTCLRACTIVE Mask */\r
+\r
+/* SCB System Control Register Definitions */\r
+#define SCB_SCR_SEVONPEND_Pos               4U                                            /*!< SCB SCR: SEVONPEND Position */\r
+#define SCB_SCR_SEVONPEND_Msk              (1UL << SCB_SCR_SEVONPEND_Pos)                 /*!< SCB SCR: SEVONPEND Mask */\r
+\r
+#define SCB_SCR_SLEEPDEEP_Pos               2U                                            /*!< SCB SCR: SLEEPDEEP Position */\r
+#define SCB_SCR_SLEEPDEEP_Msk              (1UL << SCB_SCR_SLEEPDEEP_Pos)                 /*!< SCB SCR: SLEEPDEEP Mask */\r
+\r
+#define SCB_SCR_SLEEPONEXIT_Pos             1U                                            /*!< SCB SCR: SLEEPONEXIT Position */\r
+#define SCB_SCR_SLEEPONEXIT_Msk            (1UL << SCB_SCR_SLEEPONEXIT_Pos)               /*!< SCB SCR: SLEEPONEXIT Mask */\r
+\r
+/* SCB Configuration Control Register Definitions */\r
+#define SCB_CCR_STKALIGN_Pos                9U                                            /*!< SCB CCR: STKALIGN Position */\r
+#define SCB_CCR_STKALIGN_Msk               (1UL << SCB_CCR_STKALIGN_Pos)                  /*!< SCB CCR: STKALIGN Mask */\r
+\r
+#define SCB_CCR_UNALIGN_TRP_Pos             3U                                            /*!< SCB CCR: UNALIGN_TRP Position */\r
+#define SCB_CCR_UNALIGN_TRP_Msk            (1UL << SCB_CCR_UNALIGN_TRP_Pos)               /*!< SCB CCR: UNALIGN_TRP Mask */\r
+\r
+/* SCB System Handler Control and State Register Definitions */\r
+#define SCB_SHCSR_SVCALLPENDED_Pos         15U                                            /*!< SCB SHCSR: SVCALLPENDED Position */\r
+#define SCB_SHCSR_SVCALLPENDED_Msk         (1UL << SCB_SHCSR_SVCALLPENDED_Pos)            /*!< SCB SHCSR: SVCALLPENDED Mask */\r
+\r
+/*@} end of group CMSIS_SCB */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SysTick     System Tick Timer (SysTick)\r
+  \brief    Type definitions for the System Timer Registers.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Timer (SysTick).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  SysTick Control and Status Register */\r
+  __IOM uint32_t LOAD;                   /*!< Offset: 0x004 (R/W)  SysTick Reload Value Register */\r
+  __IOM uint32_t VAL;                    /*!< Offset: 0x008 (R/W)  SysTick Current Value Register */\r
+  __IM  uint32_t CALIB;                  /*!< Offset: 0x00C (R/ )  SysTick Calibration Register */\r
+} SysTick_Type;\r
+\r
+/* SysTick Control / Status Register Definitions */\r
+#define SysTick_CTRL_COUNTFLAG_Pos         16U                                            /*!< SysTick CTRL: COUNTFLAG Position */\r
+#define SysTick_CTRL_COUNTFLAG_Msk         (1UL << SysTick_CTRL_COUNTFLAG_Pos)            /*!< SysTick CTRL: COUNTFLAG Mask */\r
+\r
+#define SysTick_CTRL_CLKSOURCE_Pos          2U                                            /*!< SysTick CTRL: CLKSOURCE Position */\r
+#define SysTick_CTRL_CLKSOURCE_Msk         (1UL << SysTick_CTRL_CLKSOURCE_Pos)            /*!< SysTick CTRL: CLKSOURCE Mask */\r
+\r
+#define SysTick_CTRL_TICKINT_Pos            1U                                            /*!< SysTick CTRL: TICKINT Position */\r
+#define SysTick_CTRL_TICKINT_Msk           (1UL << SysTick_CTRL_TICKINT_Pos)              /*!< SysTick CTRL: TICKINT Mask */\r
+\r
+#define SysTick_CTRL_ENABLE_Pos             0U                                            /*!< SysTick CTRL: ENABLE Position */\r
+#define SysTick_CTRL_ENABLE_Msk            (1UL /*<< SysTick_CTRL_ENABLE_Pos*/)           /*!< SysTick CTRL: ENABLE Mask */\r
+\r
+/* SysTick Reload Register Definitions */\r
+#define SysTick_LOAD_RELOAD_Pos             0U                                            /*!< SysTick LOAD: RELOAD Position */\r
+#define SysTick_LOAD_RELOAD_Msk            (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/)    /*!< SysTick LOAD: RELOAD Mask */\r
+\r
+/* SysTick Current Register Definitions */\r
+#define SysTick_VAL_CURRENT_Pos             0U                                            /*!< SysTick VAL: CURRENT Position */\r
+#define SysTick_VAL_CURRENT_Msk            (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/)    /*!< SysTick VAL: CURRENT Mask */\r
+\r
+/* SysTick Calibration Register Definitions */\r
+#define SysTick_CALIB_NOREF_Pos            31U                                            /*!< SysTick CALIB: NOREF Position */\r
+#define SysTick_CALIB_NOREF_Msk            (1UL << SysTick_CALIB_NOREF_Pos)               /*!< SysTick CALIB: NOREF Mask */\r
+\r
+#define SysTick_CALIB_SKEW_Pos             30U                                            /*!< SysTick CALIB: SKEW Position */\r
+#define SysTick_CALIB_SKEW_Msk             (1UL << SysTick_CALIB_SKEW_Pos)                /*!< SysTick CALIB: SKEW Mask */\r
+\r
+#define SysTick_CALIB_TENMS_Pos             0U                                            /*!< SysTick CALIB: TENMS Position */\r
+#define SysTick_CALIB_TENMS_Msk            (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/)    /*!< SysTick CALIB: TENMS Mask */\r
+\r
+/*@} end of group CMSIS_SysTick */\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_MPU     Memory Protection Unit (MPU)\r
+  \brief    Type definitions for the Memory Protection Unit (MPU)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Memory Protection Unit (MPU).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t TYPE;                   /*!< Offset: 0x000 (R/ )  MPU Type Register */\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x004 (R/W)  MPU Control Register */\r
+  __IOM uint32_t RNR;                    /*!< Offset: 0x008 (R/W)  MPU Region RNRber Register */\r
+  __IOM uint32_t RBAR;                   /*!< Offset: 0x00C (R/W)  MPU Region Base Address Register */\r
+  __IOM uint32_t RASR;                   /*!< Offset: 0x010 (R/W)  MPU Region Attribute and Size Register */\r
+} MPU_Type;\r
+\r
+#define MPU_TYPE_RALIASES                  1U\r
+\r
+/* MPU Type Register Definitions */\r
+#define MPU_TYPE_IREGION_Pos               16U                                            /*!< MPU TYPE: IREGION Position */\r
+#define MPU_TYPE_IREGION_Msk               (0xFFUL << MPU_TYPE_IREGION_Pos)               /*!< MPU TYPE: IREGION Mask */\r
+\r
+#define MPU_TYPE_DREGION_Pos                8U                                            /*!< MPU TYPE: DREGION Position */\r
+#define MPU_TYPE_DREGION_Msk               (0xFFUL << MPU_TYPE_DREGION_Pos)               /*!< MPU TYPE: DREGION Mask */\r
+\r
+#define MPU_TYPE_SEPARATE_Pos               0U                                            /*!< MPU TYPE: SEPARATE Position */\r
+#define MPU_TYPE_SEPARATE_Msk              (1UL /*<< MPU_TYPE_SEPARATE_Pos*/)             /*!< MPU TYPE: SEPARATE Mask */\r
+\r
+/* MPU Control Register Definitions */\r
+#define MPU_CTRL_PRIVDEFENA_Pos             2U                                            /*!< MPU CTRL: PRIVDEFENA Position */\r
+#define MPU_CTRL_PRIVDEFENA_Msk            (1UL << MPU_CTRL_PRIVDEFENA_Pos)               /*!< MPU CTRL: PRIVDEFENA Mask */\r
+\r
+#define MPU_CTRL_HFNMIENA_Pos               1U                                            /*!< MPU CTRL: HFNMIENA Position */\r
+#define MPU_CTRL_HFNMIENA_Msk              (1UL << MPU_CTRL_HFNMIENA_Pos)                 /*!< MPU CTRL: HFNMIENA Mask */\r
+\r
+#define MPU_CTRL_ENABLE_Pos                 0U                                            /*!< MPU CTRL: ENABLE Position */\r
+#define MPU_CTRL_ENABLE_Msk                (1UL /*<< MPU_CTRL_ENABLE_Pos*/)               /*!< MPU CTRL: ENABLE Mask */\r
+\r
+/* MPU Region Number Register Definitions */\r
+#define MPU_RNR_REGION_Pos                  0U                                            /*!< MPU RNR: REGION Position */\r
+#define MPU_RNR_REGION_Msk                 (0xFFUL /*<< MPU_RNR_REGION_Pos*/)             /*!< MPU RNR: REGION Mask */\r
+\r
+/* MPU Region Base Address Register Definitions */\r
+#define MPU_RBAR_ADDR_Pos                   8U                                            /*!< MPU RBAR: ADDR Position */\r
+#define MPU_RBAR_ADDR_Msk                  (0xFFFFFFUL << MPU_RBAR_ADDR_Pos)              /*!< MPU RBAR: ADDR Mask */\r
+\r
+#define MPU_RBAR_VALID_Pos                  4U                                            /*!< MPU RBAR: VALID Position */\r
+#define MPU_RBAR_VALID_Msk                 (1UL << MPU_RBAR_VALID_Pos)                    /*!< MPU RBAR: VALID Mask */\r
+\r
+#define MPU_RBAR_REGION_Pos                 0U                                            /*!< MPU RBAR: REGION Position */\r
+#define MPU_RBAR_REGION_Msk                (0xFUL /*<< MPU_RBAR_REGION_Pos*/)             /*!< MPU RBAR: REGION Mask */\r
+\r
+/* MPU Region Attribute and Size Register Definitions */\r
+#define MPU_RASR_ATTRS_Pos                 16U                                            /*!< MPU RASR: MPU Region Attribute field Position */\r
+#define MPU_RASR_ATTRS_Msk                 (0xFFFFUL << MPU_RASR_ATTRS_Pos)               /*!< MPU RASR: MPU Region Attribute field Mask */\r
+\r
+#define MPU_RASR_XN_Pos                    28U                                            /*!< MPU RASR: ATTRS.XN Position */\r
+#define MPU_RASR_XN_Msk                    (1UL << MPU_RASR_XN_Pos)                       /*!< MPU RASR: ATTRS.XN Mask */\r
+\r
+#define MPU_RASR_AP_Pos                    24U                                            /*!< MPU RASR: ATTRS.AP Position */\r
+#define MPU_RASR_AP_Msk                    (0x7UL << MPU_RASR_AP_Pos)                     /*!< MPU RASR: ATTRS.AP Mask */\r
+\r
+#define MPU_RASR_TEX_Pos                   19U                                            /*!< MPU RASR: ATTRS.TEX Position */\r
+#define MPU_RASR_TEX_Msk                   (0x7UL << MPU_RASR_TEX_Pos)                    /*!< MPU RASR: ATTRS.TEX Mask */\r
+\r
+#define MPU_RASR_S_Pos                     18U                                            /*!< MPU RASR: ATTRS.S Position */\r
+#define MPU_RASR_S_Msk                     (1UL << MPU_RASR_S_Pos)                        /*!< MPU RASR: ATTRS.S Mask */\r
+\r
+#define MPU_RASR_C_Pos                     17U                                            /*!< MPU RASR: ATTRS.C Position */\r
+#define MPU_RASR_C_Msk                     (1UL << MPU_RASR_C_Pos)                        /*!< MPU RASR: ATTRS.C Mask */\r
+\r
+#define MPU_RASR_B_Pos                     16U                                            /*!< MPU RASR: ATTRS.B Position */\r
+#define MPU_RASR_B_Msk                     (1UL << MPU_RASR_B_Pos)                        /*!< MPU RASR: ATTRS.B Mask */\r
+\r
+#define MPU_RASR_SRD_Pos                    8U                                            /*!< MPU RASR: Sub-Region Disable Position */\r
+#define MPU_RASR_SRD_Msk                   (0xFFUL << MPU_RASR_SRD_Pos)                   /*!< MPU RASR: Sub-Region Disable Mask */\r
+\r
+#define MPU_RASR_SIZE_Pos                   1U                                            /*!< MPU RASR: Region Size Field Position */\r
+#define MPU_RASR_SIZE_Msk                  (0x1FUL << MPU_RASR_SIZE_Pos)                  /*!< MPU RASR: Region Size Field Mask */\r
+\r
+#define MPU_RASR_ENABLE_Pos                 0U                                            /*!< MPU RASR: Region enable bit Position */\r
+#define MPU_RASR_ENABLE_Msk                (1UL /*<< MPU_RASR_ENABLE_Pos*/)               /*!< MPU RASR: Region enable bit Disable Mask */\r
+\r
+/*@} end of group CMSIS_MPU */\r
+#endif\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_CoreDebug       Core Debug Registers (CoreDebug)\r
+  \brief    Cortex-M0+ Core Debug Registers (DCB registers, SHCSR, and DFSR) are only accessible over DAP and not via processor.\r
+            Therefore they are not covered by the Cortex-M0+ header file.\r
+  @{\r
+ */\r
+/*@} end of group CMSIS_CoreDebug */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_bitfield     Core register bit field macros\r
+  \brief      Macros for use with bit field definitions (xxx_Pos, xxx_Msk).\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   Mask and shift a bit field value for use in a register bit range.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of the bit field. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted value.\r
+*/\r
+#define _VAL2FLD(field, value)    (((uint32_t)(value) << field ## _Pos) & field ## _Msk)\r
+\r
+/**\r
+  \brief     Mask and shift a register value to extract a bit filed value.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of register. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted bit field value.\r
+*/\r
+#define _FLD2VAL(field, value)    (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)\r
+\r
+/*@} end of group CMSIS_core_bitfield */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_base     Core Definitions\r
+  \brief      Definitions for base addresses, unions, and structures.\r
+  @{\r
+ */\r
+\r
+/* Memory mapping of Core Hardware */\r
+#define SCS_BASE            (0xE000E000UL)                            /*!< System Control Space Base Address */\r
+#define SysTick_BASE        (SCS_BASE +  0x0010UL)                    /*!< SysTick Base Address */\r
+#define NVIC_BASE           (SCS_BASE +  0x0100UL)                    /*!< NVIC Base Address */\r
+#define SCB_BASE            (SCS_BASE +  0x0D00UL)                    /*!< System Control Block Base Address */\r
+\r
+#define SCB                 ((SCB_Type       *)     SCB_BASE      )   /*!< SCB configuration struct */\r
+#define SysTick             ((SysTick_Type   *)     SysTick_BASE  )   /*!< SysTick configuration struct */\r
+#define NVIC                ((NVIC_Type      *)     NVIC_BASE     )   /*!< NVIC configuration struct */\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+  #define MPU_BASE          (SCS_BASE +  0x0D90UL)                    /*!< Memory Protection Unit */\r
+  #define MPU               ((MPU_Type       *)     MPU_BASE      )   /*!< Memory Protection Unit */\r
+#endif\r
+\r
+/*@} */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                Hardware Abstraction Layer\r
+  Core Function Interface contains:\r
+  - Core NVIC Functions\r
+  - Core SysTick Functions\r
+  - Core Register Access Functions\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference\r
+*/\r
+\r
+\r
+\r
+/* ##########################   NVIC functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_NVICFunctions NVIC Functions\r
+  \brief    Functions that manage interrupts and exceptions via the NVIC.\r
+  @{\r
+ */\r
+\r
+#ifdef CMSIS_NVIC_VIRTUAL\r
+  #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+    #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"\r
+  #endif\r
+  #include CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+#else\r
+  #define NVIC_SetPriorityGrouping    __NVIC_SetPriorityGrouping\r
+  #define NVIC_GetPriorityGrouping    __NVIC_GetPriorityGrouping\r
+  #define NVIC_EnableIRQ              __NVIC_EnableIRQ\r
+  #define NVIC_GetEnableIRQ           __NVIC_GetEnableIRQ\r
+  #define NVIC_DisableIRQ             __NVIC_DisableIRQ\r
+  #define NVIC_GetPendingIRQ          __NVIC_GetPendingIRQ\r
+  #define NVIC_SetPendingIRQ          __NVIC_SetPendingIRQ\r
+  #define NVIC_ClearPendingIRQ        __NVIC_ClearPendingIRQ\r
+/*#define NVIC_GetActive              __NVIC_GetActive             not available for Cortex-M0+ */\r
+  #define NVIC_SetPriority            __NVIC_SetPriority\r
+  #define NVIC_GetPriority            __NVIC_GetPriority\r
+  #define NVIC_SystemReset            __NVIC_SystemReset\r
+#endif /* CMSIS_NVIC_VIRTUAL */\r
+\r
+#ifdef CMSIS_VECTAB_VIRTUAL\r
+  #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+    #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"\r
+  #endif\r
+  #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+#else\r
+  #define NVIC_SetVector              __NVIC_SetVector\r
+  #define NVIC_GetVector              __NVIC_GetVector\r
+#endif  /* (CMSIS_VECTAB_VIRTUAL) */\r
+\r
+#define NVIC_USER_IRQ_OFFSET          16\r
+\r
+\r
+/* The following EXC_RETURN values are saved the LR on exception entry */\r
+#define EXC_RETURN_HANDLER         (0xFFFFFFF1UL)     /* return to Handler mode, uses MSP after return                               */\r
+#define EXC_RETURN_THREAD_MSP      (0xFFFFFFF9UL)     /* return to Thread mode, uses MSP after return                                */\r
+#define EXC_RETURN_THREAD_PSP      (0xFFFFFFFDUL)     /* return to Thread mode, uses PSP after return                                */\r
+\r
+\r
+/* Interrupt Priorities are WORD accessible only under Armv6-M                  */\r
+/* The following MACROS handle generation of the register offset and byte masks */\r
+#define _BIT_SHIFT(IRQn)         (  ((((uint32_t)(int32_t)(IRQn))         )      &  0x03UL) * 8UL)\r
+#define _SHP_IDX(IRQn)           ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >>    2UL)      )\r
+#define _IP_IDX(IRQn)            (   (((uint32_t)(int32_t)(IRQn))                >>    2UL)      )\r
+\r
+#define __NVIC_SetPriorityGrouping(X) (void)(X)\r
+#define __NVIC_GetPriorityGrouping()  (0U)\r
+\r
+/**\r
+  \brief   Enable Interrupt\r
+  \details Enables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Enable status\r
+  \details Returns a device specific interrupt enable status from the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt is not enabled.\r
+  \return             1  Interrupt is enabled.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISER[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Disable Interrupt\r
+  \details Disables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+    __DSB();\r
+    __ISB();\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Pending Interrupt\r
+  \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not pending.\r
+  \return             1  Interrupt status is pending.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Pending Interrupt\r
+  \details Sets the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Clear Pending Interrupt\r
+  \details Clears the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Priority\r
+  \details Sets the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]      IRQn  Interrupt number.\r
+  \param [in]  priority  Priority to set.\r
+  \note    The priority cannot be set for every processor exception.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->IP[_IP_IDX(IRQn)]  = ((uint32_t)(NVIC->IP[_IP_IDX(IRQn)]  & ~(0xFFUL << _BIT_SHIFT(IRQn))) |\r
+       (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));\r
+  }\r
+  else\r
+  {\r
+    SCB->SHP[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |\r
+       (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Priority\r
+  \details Reads the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn  Interrupt number.\r
+  \return             Interrupt Priority.\r
+                      Value is aligned automatically to the implemented priority bits of the microcontroller.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)\r
+{\r
+\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+  else\r
+  {\r
+    return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Encode Priority\r
+  \details Encodes the priority for an interrupt with the given priority group,\r
+           preemptive priority value, and subpriority value.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.\r
+  \param [in]     PriorityGroup  Used priority group.\r
+  \param [in]   PreemptPriority  Preemptive priority value (starting from 0).\r
+  \param [in]       SubPriority  Subpriority value (starting from 0).\r
+  \return                        Encoded priority. Value can be used in the function \ref NVIC_SetPriority().\r
+ */\r
+__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);\r
+  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));\r
+\r
+  return (\r
+           ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |\r
+           ((SubPriority     & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL)))\r
+         );\r
+}\r
+\r
+\r
+/**\r
+  \brief   Decode Priority\r
+  \details Decodes an interrupt priority value with a given priority group to\r
+           preemptive priority value and subpriority value.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.\r
+  \param [in]         Priority   Priority value, which can be retrieved with the function \ref NVIC_GetPriority().\r
+  \param [in]     PriorityGroup  Used priority group.\r
+  \param [out] pPreemptPriority  Preemptive priority value (starting from 0).\r
+  \param [out]     pSubPriority  Subpriority value (starting from 0).\r
+ */\r
+__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);\r
+  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));\r
+\r
+  *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);\r
+  *pSubPriority     = (Priority                   ) & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Vector\r
+  \details Sets an interrupt vector in SRAM based interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+           VTOR must been relocated to SRAM before.\r
+           If VTOR is not present address 0 must be mapped to SRAM.\r
+  \param [in]   IRQn      Interrupt number\r
+  \param [in]   vector    Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)\r
+{\r
+#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)\r
+  uint32_t *vectors = (uint32_t *)SCB->VTOR;\r
+#else\r
+    uint32_t *vectors = (uint32_t *)0x0U;\r
+#endif\r
+  vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Vector\r
+  \details Reads an interrupt vector from interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn      Interrupt number.\r
+  \return                 Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)\r
+{\r
+#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)\r
+  uint32_t *vectors = (uint32_t *)SCB->VTOR;\r
+#else\r
+  uint32_t *vectors = (uint32_t *)0x0U;\r
+#endif\r
+  return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];\r
+\r
+}\r
+\r
+\r
+/**\r
+  \brief   System Reset\r
+  \details Initiates a system reset request to reset the MCU.\r
+ */\r
+__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)\r
+{\r
+  __DSB();                                                          /* Ensure all outstanding memory accesses included\r
+                                                                       buffered write are completed before reset */\r
+  SCB->AIRCR  = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |\r
+                 SCB_AIRCR_SYSRESETREQ_Msk);\r
+  __DSB();                                                          /* Ensure completion of memory access */\r
+\r
+  for(;;)                                                           /* wait until reset */\r
+  {\r
+    __NOP();\r
+  }\r
+}\r
+\r
+/*@} end of CMSIS_Core_NVICFunctions */\r
+\r
+/* ##########################  MPU functions  #################################### */\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+\r
+#include "mpu_armv7.h"\r
+\r
+#endif\r
+\r
+/* ##########################  FPU functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_FpuFunctions FPU Functions\r
+  \brief    Function that provides FPU type.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   get FPU type\r
+  \details returns the FPU type\r
+  \returns\r
+   - \b  0: No FPU\r
+   - \b  1: Single precision FPU\r
+   - \b  2: Double + Single precision FPU\r
+ */\r
+__STATIC_INLINE uint32_t SCB_GetFPUType(void)\r
+{\r
+    return 0U;           /* No FPU */\r
+}\r
+\r
+\r
+/*@} end of CMSIS_Core_FpuFunctions */\r
+\r
+\r
+\r
+/* ##################################    SysTick function  ############################################ */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_SysTickFunctions SysTick Functions\r
+  \brief    Functions that configure the System.\r
+  @{\r
+ */\r
+\r
+#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)\r
+\r
+/**\r
+  \brief   System Tick Configuration\r
+  \details Initializes the System Timer and its interrupt, and starts the System Tick Timer.\r
+           Counter is in free running mode to generate periodic interrupts.\r
+  \param [in]  ticks  Number of ticks between two interrupts.\r
+  \return          0  Function succeeded.\r
+  \return          1  Function failed.\r
+  \note    When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the\r
+           function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>\r
+           must contain a vendor-specific implementation of this function.\r
+ */\r
+__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)\r
+{\r
+  if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)\r
+  {\r
+    return (1UL);                                                   /* Reload value impossible */\r
+  }\r
+\r
+  SysTick->LOAD  = (uint32_t)(ticks - 1UL);                         /* set reload register */\r
+  NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */\r
+  SysTick->VAL   = 0UL;                                             /* Load the SysTick Counter Value */\r
+  SysTick->CTRL  = SysTick_CTRL_CLKSOURCE_Msk |\r
+                   SysTick_CTRL_TICKINT_Msk   |\r
+                   SysTick_CTRL_ENABLE_Msk;                         /* Enable SysTick IRQ and SysTick Timer */\r
+  return (0UL);                                                     /* Function successful */\r
+}\r
+\r
+#endif\r
+\r
+/*@} end of CMSIS_Core_SysTickFunctions */\r
+\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_CM0PLUS_H_DEPENDANT */\r
+\r
+#endif /* __CMSIS_GENERIC */\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm1.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm1.h
new file mode 100644 (file)
index 0000000..fd1c407
--- /dev/null
@@ -0,0 +1,976 @@
+/**************************************************************************//**\r
+ * @file     core_cm1.h\r
+ * @brief    CMSIS Cortex-M1 Core Peripheral Access Layer Header File\r
+ * @version  V1.0.0\r
+ * @date     23. July 2018\r
+ ******************************************************************************/\r
+/*\r
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.\r
+ *\r
+ * SPDX-License-Identifier: Apache-2.0\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the License); you may\r
+ * not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#if   defined ( __ICCARM__ )\r
+  #pragma system_include         /* treat file as system include file for MISRA check */\r
+#elif defined (__clang__)\r
+  #pragma clang system_header   /* treat file as system include file */\r
+#endif\r
+\r
+#ifndef __CORE_CM1_H_GENERIC\r
+#define __CORE_CM1_H_GENERIC\r
+\r
+#include <stdint.h>\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/**\r
+  \page CMSIS_MISRA_Exceptions  MISRA-C:2004 Compliance Exceptions\r
+  CMSIS violates the following MISRA-C:2004 rules:\r
+\r
+   \li Required Rule 8.5, object/function definition in header file.<br>\r
+     Function definitions in header files are used to allow 'inlining'.\r
+\r
+   \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>\r
+     Unions are used for effective representation of core registers.\r
+\r
+   \li Advisory Rule 19.7, Function-like macro defined.<br>\r
+     Function-like macros are used to allow more efficient code.\r
+ */\r
+\r
+\r
+/*******************************************************************************\r
+ *                 CMSIS definitions\r
+ ******************************************************************************/\r
+/**\r
+  \ingroup Cortex_M1\r
+  @{\r
+ */\r
+\r
+#include "cmsis_version.h"\r
\r
+/*  CMSIS CM1 definitions */\r
+#define __CM1_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)              /*!< \deprecated [31:16] CMSIS HAL main version */\r
+#define __CM1_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)               /*!< \deprecated [15:0]  CMSIS HAL sub version */\r
+#define __CM1_CMSIS_VERSION       ((__CM1_CMSIS_VERSION_MAIN << 16U) | \\r
+                                    __CM1_CMSIS_VERSION_SUB           )  /*!< \deprecated CMSIS HAL version number */\r
+\r
+#define __CORTEX_M                (1U)                                   /*!< Cortex-M Core */\r
+\r
+/** __FPU_USED indicates whether an FPU is used or not.\r
+    This core does not support an FPU at all\r
+*/\r
+#define __FPU_USED       0U\r
+\r
+#if defined ( __CC_ARM )\r
+  #if defined __TARGET_FPU_VFP\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)\r
+  #if defined __ARM_PCS_VFP\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __GNUC__ )\r
+  #if defined (__VFP_FP__) && !defined(__SOFTFP__)\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __ICCARM__ )\r
+  #if defined __ARMVFP__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __TI_ARM__ )\r
+  #if defined __TI_VFP_SUPPORT__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __TASKING__ )\r
+  #if defined __FPU_VFP__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __CSMC__ )\r
+  #if ( __CSMC__ & 0x400U)\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#endif\r
+\r
+#include "cmsis_compiler.h"               /* CMSIS compiler specific defines */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_CM1_H_GENERIC */\r
+\r
+#ifndef __CMSIS_GENERIC\r
+\r
+#ifndef __CORE_CM1_H_DEPENDANT\r
+#define __CORE_CM1_H_DEPENDANT\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/* check device defines and use defaults */\r
+#if defined __CHECK_DEVICE_DEFINES\r
+  #ifndef __CM1_REV\r
+    #define __CM1_REV               0x0100U\r
+    #warning "__CM1_REV not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __NVIC_PRIO_BITS\r
+    #define __NVIC_PRIO_BITS          2U\r
+    #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __Vendor_SysTickConfig\r
+    #define __Vendor_SysTickConfig    0U\r
+    #warning "__Vendor_SysTickConfig not defined in device header file; using default!"\r
+  #endif\r
+#endif\r
+\r
+/* IO definitions (access restrictions to peripheral registers) */\r
+/**\r
+    \defgroup CMSIS_glob_defs CMSIS Global Defines\r
+\r
+    <strong>IO Type Qualifiers</strong> are used\r
+    \li to specify the access to peripheral variables.\r
+    \li for automatic generation of peripheral register debug information.\r
+*/\r
+#ifdef __cplusplus\r
+  #define   __I     volatile             /*!< Defines 'read only' permissions */\r
+#else\r
+  #define   __I     volatile const       /*!< Defines 'read only' permissions */\r
+#endif\r
+#define     __O     volatile             /*!< Defines 'write only' permissions */\r
+#define     __IO    volatile             /*!< Defines 'read / write' permissions */\r
+\r
+/* following defines should be used for structure members */\r
+#define     __IM     volatile const      /*! Defines 'read only' structure member permissions */\r
+#define     __OM     volatile            /*! Defines 'write only' structure member permissions */\r
+#define     __IOM    volatile            /*! Defines 'read / write' structure member permissions */\r
+\r
+/*@} end of group Cortex_M1 */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                 Register Abstraction\r
+  Core Register contain:\r
+  - Core Register\r
+  - Core NVIC Register\r
+  - Core SCB Register\r
+  - Core SysTick Register\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_core_register Defines and Type Definitions\r
+  \brief Type definitions and defines for Cortex-M processor based devices.\r
+*/\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_CORE  Status and Control Registers\r
+  \brief      Core Register type definitions.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Union type to access the Application Program Status Register (APSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t _reserved0:28;              /*!< bit:  0..27  Reserved */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} APSR_Type;\r
+\r
+/* APSR Register Definitions */\r
+#define APSR_N_Pos                         31U                                            /*!< APSR: N Position */\r
+#define APSR_N_Msk                         (1UL << APSR_N_Pos)                            /*!< APSR: N Mask */\r
+\r
+#define APSR_Z_Pos                         30U                                            /*!< APSR: Z Position */\r
+#define APSR_Z_Msk                         (1UL << APSR_Z_Pos)                            /*!< APSR: Z Mask */\r
+\r
+#define APSR_C_Pos                         29U                                            /*!< APSR: C Position */\r
+#define APSR_C_Msk                         (1UL << APSR_C_Pos)                            /*!< APSR: C Mask */\r
+\r
+#define APSR_V_Pos                         28U                                            /*!< APSR: V Position */\r
+#define APSR_V_Msk                         (1UL << APSR_V_Pos)                            /*!< APSR: V Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Interrupt Program Status Register (IPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:23;              /*!< bit:  9..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} IPSR_Type;\r
+\r
+/* IPSR Register Definitions */\r
+#define IPSR_ISR_Pos                        0U                                            /*!< IPSR: ISR Position */\r
+#define IPSR_ISR_Msk                       (0x1FFUL /*<< IPSR_ISR_Pos*/)                  /*!< IPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Special-Purpose Program Status Registers (xPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:15;              /*!< bit:  9..23  Reserved */\r
+    uint32_t T:1;                        /*!< bit:     24  Thumb bit        (read 0) */\r
+    uint32_t _reserved1:3;               /*!< bit: 25..27  Reserved */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} xPSR_Type;\r
+\r
+/* xPSR Register Definitions */\r
+#define xPSR_N_Pos                         31U                                            /*!< xPSR: N Position */\r
+#define xPSR_N_Msk                         (1UL << xPSR_N_Pos)                            /*!< xPSR: N Mask */\r
+\r
+#define xPSR_Z_Pos                         30U                                            /*!< xPSR: Z Position */\r
+#define xPSR_Z_Msk                         (1UL << xPSR_Z_Pos)                            /*!< xPSR: Z Mask */\r
+\r
+#define xPSR_C_Pos                         29U                                            /*!< xPSR: C Position */\r
+#define xPSR_C_Msk                         (1UL << xPSR_C_Pos)                            /*!< xPSR: C Mask */\r
+\r
+#define xPSR_V_Pos                         28U                                            /*!< xPSR: V Position */\r
+#define xPSR_V_Msk                         (1UL << xPSR_V_Pos)                            /*!< xPSR: V Mask */\r
+\r
+#define xPSR_T_Pos                         24U                                            /*!< xPSR: T Position */\r
+#define xPSR_T_Msk                         (1UL << xPSR_T_Pos)                            /*!< xPSR: T Mask */\r
+\r
+#define xPSR_ISR_Pos                        0U                                            /*!< xPSR: ISR Position */\r
+#define xPSR_ISR_Msk                       (0x1FFUL /*<< xPSR_ISR_Pos*/)                  /*!< xPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Control Registers (CONTROL).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t _reserved0:1;               /*!< bit:      0  Reserved */\r
+    uint32_t SPSEL:1;                    /*!< bit:      1  Stack to be used */\r
+    uint32_t _reserved1:30;              /*!< bit:  2..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} CONTROL_Type;\r
+\r
+/* CONTROL Register Definitions */\r
+#define CONTROL_SPSEL_Pos                   1U                                            /*!< CONTROL: SPSEL Position */\r
+#define CONTROL_SPSEL_Msk                  (1UL << CONTROL_SPSEL_Pos)                     /*!< CONTROL: SPSEL Mask */\r
+\r
+/*@} end of group CMSIS_CORE */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_NVIC  Nested Vectored Interrupt Controller (NVIC)\r
+  \brief      Type definitions for the NVIC Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Nested Vectored Interrupt Controller (NVIC).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t ISER[1U];               /*!< Offset: 0x000 (R/W)  Interrupt Set Enable Register */\r
+        uint32_t RESERVED0[31U];\r
+  __IOM uint32_t ICER[1U];               /*!< Offset: 0x080 (R/W)  Interrupt Clear Enable Register */\r
+        uint32_t RSERVED1[31U];\r
+  __IOM uint32_t ISPR[1U];               /*!< Offset: 0x100 (R/W)  Interrupt Set Pending Register */\r
+        uint32_t RESERVED2[31U];\r
+  __IOM uint32_t ICPR[1U];               /*!< Offset: 0x180 (R/W)  Interrupt Clear Pending Register */\r
+        uint32_t RESERVED3[31U];\r
+        uint32_t RESERVED4[64U];\r
+  __IOM uint32_t IP[8U];                 /*!< Offset: 0x300 (R/W)  Interrupt Priority Register */\r
+}  NVIC_Type;\r
+\r
+/*@} end of group CMSIS_NVIC */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SCB     System Control Block (SCB)\r
+  \brief    Type definitions for the System Control Block Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Control Block (SCB).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t CPUID;                  /*!< Offset: 0x000 (R/ )  CPUID Base Register */\r
+  __IOM uint32_t ICSR;                   /*!< Offset: 0x004 (R/W)  Interrupt Control and State Register */\r
+        uint32_t RESERVED0;\r
+  __IOM uint32_t AIRCR;                  /*!< Offset: 0x00C (R/W)  Application Interrupt and Reset Control Register */\r
+  __IOM uint32_t SCR;                    /*!< Offset: 0x010 (R/W)  System Control Register */\r
+  __IOM uint32_t CCR;                    /*!< Offset: 0x014 (R/W)  Configuration Control Register */\r
+        uint32_t RESERVED1;\r
+  __IOM uint32_t SHP[2U];                /*!< Offset: 0x01C (R/W)  System Handlers Priority Registers. [0] is RESERVED */\r
+  __IOM uint32_t SHCSR;                  /*!< Offset: 0x024 (R/W)  System Handler Control and State Register */\r
+} SCB_Type;\r
+\r
+/* SCB CPUID Register Definitions */\r
+#define SCB_CPUID_IMPLEMENTER_Pos          24U                                            /*!< SCB CPUID: IMPLEMENTER Position */\r
+#define SCB_CPUID_IMPLEMENTER_Msk          (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos)          /*!< SCB CPUID: IMPLEMENTER Mask */\r
+\r
+#define SCB_CPUID_VARIANT_Pos              20U                                            /*!< SCB CPUID: VARIANT Position */\r
+#define SCB_CPUID_VARIANT_Msk              (0xFUL << SCB_CPUID_VARIANT_Pos)               /*!< SCB CPUID: VARIANT Mask */\r
+\r
+#define SCB_CPUID_ARCHITECTURE_Pos         16U                                            /*!< SCB CPUID: ARCHITECTURE Position */\r
+#define SCB_CPUID_ARCHITECTURE_Msk         (0xFUL << SCB_CPUID_ARCHITECTURE_Pos)          /*!< SCB CPUID: ARCHITECTURE Mask */\r
+\r
+#define SCB_CPUID_PARTNO_Pos                4U                                            /*!< SCB CPUID: PARTNO Position */\r
+#define SCB_CPUID_PARTNO_Msk               (0xFFFUL << SCB_CPUID_PARTNO_Pos)              /*!< SCB CPUID: PARTNO Mask */\r
+\r
+#define SCB_CPUID_REVISION_Pos              0U                                            /*!< SCB CPUID: REVISION Position */\r
+#define SCB_CPUID_REVISION_Msk             (0xFUL /*<< SCB_CPUID_REVISION_Pos*/)          /*!< SCB CPUID: REVISION Mask */\r
+\r
+/* SCB Interrupt Control State Register Definitions */\r
+#define SCB_ICSR_NMIPENDSET_Pos            31U                                            /*!< SCB ICSR: NMIPENDSET Position */\r
+#define SCB_ICSR_NMIPENDSET_Msk            (1UL << SCB_ICSR_NMIPENDSET_Pos)               /*!< SCB ICSR: NMIPENDSET Mask */\r
+\r
+#define SCB_ICSR_PENDSVSET_Pos             28U                                            /*!< SCB ICSR: PENDSVSET Position */\r
+#define SCB_ICSR_PENDSVSET_Msk             (1UL << SCB_ICSR_PENDSVSET_Pos)                /*!< SCB ICSR: PENDSVSET Mask */\r
+\r
+#define SCB_ICSR_PENDSVCLR_Pos             27U                                            /*!< SCB ICSR: PENDSVCLR Position */\r
+#define SCB_ICSR_PENDSVCLR_Msk             (1UL << SCB_ICSR_PENDSVCLR_Pos)                /*!< SCB ICSR: PENDSVCLR Mask */\r
+\r
+#define SCB_ICSR_PENDSTSET_Pos             26U                                            /*!< SCB ICSR: PENDSTSET Position */\r
+#define SCB_ICSR_PENDSTSET_Msk             (1UL << SCB_ICSR_PENDSTSET_Pos)                /*!< SCB ICSR: PENDSTSET Mask */\r
+\r
+#define SCB_ICSR_PENDSTCLR_Pos             25U                                            /*!< SCB ICSR: PENDSTCLR Position */\r
+#define SCB_ICSR_PENDSTCLR_Msk             (1UL << SCB_ICSR_PENDSTCLR_Pos)                /*!< SCB ICSR: PENDSTCLR Mask */\r
+\r
+#define SCB_ICSR_ISRPREEMPT_Pos            23U                                            /*!< SCB ICSR: ISRPREEMPT Position */\r
+#define SCB_ICSR_ISRPREEMPT_Msk            (1UL << SCB_ICSR_ISRPREEMPT_Pos)               /*!< SCB ICSR: ISRPREEMPT Mask */\r
+\r
+#define SCB_ICSR_ISRPENDING_Pos            22U                                            /*!< SCB ICSR: ISRPENDING Position */\r
+#define SCB_ICSR_ISRPENDING_Msk            (1UL << SCB_ICSR_ISRPENDING_Pos)               /*!< SCB ICSR: ISRPENDING Mask */\r
+\r
+#define SCB_ICSR_VECTPENDING_Pos           12U                                            /*!< SCB ICSR: VECTPENDING Position */\r
+#define SCB_ICSR_VECTPENDING_Msk           (0x1FFUL << SCB_ICSR_VECTPENDING_Pos)          /*!< SCB ICSR: VECTPENDING Mask */\r
+\r
+#define SCB_ICSR_VECTACTIVE_Pos             0U                                            /*!< SCB ICSR: VECTACTIVE Position */\r
+#define SCB_ICSR_VECTACTIVE_Msk            (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/)       /*!< SCB ICSR: VECTACTIVE Mask */\r
+\r
+/* SCB Application Interrupt and Reset Control Register Definitions */\r
+#define SCB_AIRCR_VECTKEY_Pos              16U                                            /*!< SCB AIRCR: VECTKEY Position */\r
+#define SCB_AIRCR_VECTKEY_Msk              (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos)            /*!< SCB AIRCR: VECTKEY Mask */\r
+\r
+#define SCB_AIRCR_VECTKEYSTAT_Pos          16U                                            /*!< SCB AIRCR: VECTKEYSTAT Position */\r
+#define SCB_AIRCR_VECTKEYSTAT_Msk          (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos)        /*!< SCB AIRCR: VECTKEYSTAT Mask */\r
+\r
+#define SCB_AIRCR_ENDIANESS_Pos            15U                                            /*!< SCB AIRCR: ENDIANESS Position */\r
+#define SCB_AIRCR_ENDIANESS_Msk            (1UL << SCB_AIRCR_ENDIANESS_Pos)               /*!< SCB AIRCR: ENDIANESS Mask */\r
+\r
+#define SCB_AIRCR_SYSRESETREQ_Pos           2U                                            /*!< SCB AIRCR: SYSRESETREQ Position */\r
+#define SCB_AIRCR_SYSRESETREQ_Msk          (1UL << SCB_AIRCR_SYSRESETREQ_Pos)             /*!< SCB AIRCR: SYSRESETREQ Mask */\r
+\r
+#define SCB_AIRCR_VECTCLRACTIVE_Pos         1U                                            /*!< SCB AIRCR: VECTCLRACTIVE Position */\r
+#define SCB_AIRCR_VECTCLRACTIVE_Msk        (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos)           /*!< SCB AIRCR: VECTCLRACTIVE Mask */\r
+\r
+/* SCB System Control Register Definitions */\r
+#define SCB_SCR_SEVONPEND_Pos               4U                                            /*!< SCB SCR: SEVONPEND Position */\r
+#define SCB_SCR_SEVONPEND_Msk              (1UL << SCB_SCR_SEVONPEND_Pos)                 /*!< SCB SCR: SEVONPEND Mask */\r
+\r
+#define SCB_SCR_SLEEPDEEP_Pos               2U                                            /*!< SCB SCR: SLEEPDEEP Position */\r
+#define SCB_SCR_SLEEPDEEP_Msk              (1UL << SCB_SCR_SLEEPDEEP_Pos)                 /*!< SCB SCR: SLEEPDEEP Mask */\r
+\r
+#define SCB_SCR_SLEEPONEXIT_Pos             1U                                            /*!< SCB SCR: SLEEPONEXIT Position */\r
+#define SCB_SCR_SLEEPONEXIT_Msk            (1UL << SCB_SCR_SLEEPONEXIT_Pos)               /*!< SCB SCR: SLEEPONEXIT Mask */\r
+\r
+/* SCB Configuration Control Register Definitions */\r
+#define SCB_CCR_STKALIGN_Pos                9U                                            /*!< SCB CCR: STKALIGN Position */\r
+#define SCB_CCR_STKALIGN_Msk               (1UL << SCB_CCR_STKALIGN_Pos)                  /*!< SCB CCR: STKALIGN Mask */\r
+\r
+#define SCB_CCR_UNALIGN_TRP_Pos             3U                                            /*!< SCB CCR: UNALIGN_TRP Position */\r
+#define SCB_CCR_UNALIGN_TRP_Msk            (1UL << SCB_CCR_UNALIGN_TRP_Pos)               /*!< SCB CCR: UNALIGN_TRP Mask */\r
+\r
+/* SCB System Handler Control and State Register Definitions */\r
+#define SCB_SHCSR_SVCALLPENDED_Pos         15U                                            /*!< SCB SHCSR: SVCALLPENDED Position */\r
+#define SCB_SHCSR_SVCALLPENDED_Msk         (1UL << SCB_SHCSR_SVCALLPENDED_Pos)            /*!< SCB SHCSR: SVCALLPENDED Mask */\r
+\r
+/*@} end of group CMSIS_SCB */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB)\r
+  \brief    Type definitions for the System Control and ID Register not in the SCB\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Control and ID Register not in the SCB.\r
+ */\r
+typedef struct\r
+{\r
+        uint32_t RESERVED0[2U];\r
+  __IOM uint32_t ACTLR;                  /*!< Offset: 0x008 (R/W)  Auxiliary Control Register */\r
+} SCnSCB_Type;\r
+\r
+/* Auxiliary Control Register Definitions */\r
+#define SCnSCB_ACTLR_ITCMUAEN_Pos            4U                                        /*!< ACTLR: Instruction TCM Upper Alias Enable Position */\r
+#define SCnSCB_ACTLR_ITCMUAEN_Msk           (1UL << SCnSCB_ACTLR_ITCMUAEN_Pos)         /*!< ACTLR: Instruction TCM Upper Alias Enable Mask */\r
+\r
+#define SCnSCB_ACTLR_ITCMLAEN_Pos            3U                                        /*!< ACTLR: Instruction TCM Lower Alias Enable Position */\r
+#define SCnSCB_ACTLR_ITCMLAEN_Msk           (1UL << SCnSCB_ACTLR_ITCMLAEN_Pos)         /*!< ACTLR: Instruction TCM Lower Alias Enable Mask */\r
+\r
+/*@} end of group CMSIS_SCnotSCB */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SysTick     System Tick Timer (SysTick)\r
+  \brief    Type definitions for the System Timer Registers.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Timer (SysTick).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  SysTick Control and Status Register */\r
+  __IOM uint32_t LOAD;                   /*!< Offset: 0x004 (R/W)  SysTick Reload Value Register */\r
+  __IOM uint32_t VAL;                    /*!< Offset: 0x008 (R/W)  SysTick Current Value Register */\r
+  __IM  uint32_t CALIB;                  /*!< Offset: 0x00C (R/ )  SysTick Calibration Register */\r
+} SysTick_Type;\r
+\r
+/* SysTick Control / Status Register Definitions */\r
+#define SysTick_CTRL_COUNTFLAG_Pos         16U                                            /*!< SysTick CTRL: COUNTFLAG Position */\r
+#define SysTick_CTRL_COUNTFLAG_Msk         (1UL << SysTick_CTRL_COUNTFLAG_Pos)            /*!< SysTick CTRL: COUNTFLAG Mask */\r
+\r
+#define SysTick_CTRL_CLKSOURCE_Pos          2U                                            /*!< SysTick CTRL: CLKSOURCE Position */\r
+#define SysTick_CTRL_CLKSOURCE_Msk         (1UL << SysTick_CTRL_CLKSOURCE_Pos)            /*!< SysTick CTRL: CLKSOURCE Mask */\r
+\r
+#define SysTick_CTRL_TICKINT_Pos            1U                                            /*!< SysTick CTRL: TICKINT Position */\r
+#define SysTick_CTRL_TICKINT_Msk           (1UL << SysTick_CTRL_TICKINT_Pos)              /*!< SysTick CTRL: TICKINT Mask */\r
+\r
+#define SysTick_CTRL_ENABLE_Pos             0U                                            /*!< SysTick CTRL: ENABLE Position */\r
+#define SysTick_CTRL_ENABLE_Msk            (1UL /*<< SysTick_CTRL_ENABLE_Pos*/)           /*!< SysTick CTRL: ENABLE Mask */\r
+\r
+/* SysTick Reload Register Definitions */\r
+#define SysTick_LOAD_RELOAD_Pos             0U                                            /*!< SysTick LOAD: RELOAD Position */\r
+#define SysTick_LOAD_RELOAD_Msk            (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/)    /*!< SysTick LOAD: RELOAD Mask */\r
+\r
+/* SysTick Current Register Definitions */\r
+#define SysTick_VAL_CURRENT_Pos             0U                                            /*!< SysTick VAL: CURRENT Position */\r
+#define SysTick_VAL_CURRENT_Msk            (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/)    /*!< SysTick VAL: CURRENT Mask */\r
+\r
+/* SysTick Calibration Register Definitions */\r
+#define SysTick_CALIB_NOREF_Pos            31U                                            /*!< SysTick CALIB: NOREF Position */\r
+#define SysTick_CALIB_NOREF_Msk            (1UL << SysTick_CALIB_NOREF_Pos)               /*!< SysTick CALIB: NOREF Mask */\r
+\r
+#define SysTick_CALIB_SKEW_Pos             30U                                            /*!< SysTick CALIB: SKEW Position */\r
+#define SysTick_CALIB_SKEW_Msk             (1UL << SysTick_CALIB_SKEW_Pos)                /*!< SysTick CALIB: SKEW Mask */\r
+\r
+#define SysTick_CALIB_TENMS_Pos             0U                                            /*!< SysTick CALIB: TENMS Position */\r
+#define SysTick_CALIB_TENMS_Msk            (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/)    /*!< SysTick CALIB: TENMS Mask */\r
+\r
+/*@} end of group CMSIS_SysTick */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_CoreDebug       Core Debug Registers (CoreDebug)\r
+  \brief    Cortex-M1 Core Debug Registers (DCB registers, SHCSR, and DFSR) are only accessible over DAP and not via processor.\r
+            Therefore they are not covered by the Cortex-M1 header file.\r
+  @{\r
+ */\r
+/*@} end of group CMSIS_CoreDebug */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_bitfield     Core register bit field macros\r
+  \brief      Macros for use with bit field definitions (xxx_Pos, xxx_Msk).\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   Mask and shift a bit field value for use in a register bit range.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of the bit field. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted value.\r
+*/\r
+#define _VAL2FLD(field, value)    (((uint32_t)(value) << field ## _Pos) & field ## _Msk)\r
+\r
+/**\r
+  \brief     Mask and shift a register value to extract a bit filed value.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of register. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted bit field value.\r
+*/\r
+#define _FLD2VAL(field, value)    (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)\r
+\r
+/*@} end of group CMSIS_core_bitfield */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_base     Core Definitions\r
+  \brief      Definitions for base addresses, unions, and structures.\r
+  @{\r
+ */\r
+\r
+/* Memory mapping of Core Hardware */\r
+#define SCS_BASE            (0xE000E000UL)                            /*!< System Control Space Base Address */\r
+#define SysTick_BASE        (SCS_BASE +  0x0010UL)                    /*!< SysTick Base Address */\r
+#define NVIC_BASE           (SCS_BASE +  0x0100UL)                    /*!< NVIC Base Address */\r
+#define SCB_BASE            (SCS_BASE +  0x0D00UL)                    /*!< System Control Block Base Address */\r
+\r
+#define SCnSCB              ((SCnSCB_Type    *)     SCS_BASE      )   /*!< System control Register not in SCB */\r
+#define SCB                 ((SCB_Type       *)     SCB_BASE      )   /*!< SCB configuration struct */\r
+#define SysTick             ((SysTick_Type   *)     SysTick_BASE  )   /*!< SysTick configuration struct */\r
+#define NVIC                ((NVIC_Type      *)     NVIC_BASE     )   /*!< NVIC configuration struct */\r
+\r
+\r
+/*@} */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                Hardware Abstraction Layer\r
+  Core Function Interface contains:\r
+  - Core NVIC Functions\r
+  - Core SysTick Functions\r
+  - Core Register Access Functions\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference\r
+*/\r
+\r
+\r
+\r
+/* ##########################   NVIC functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_NVICFunctions NVIC Functions\r
+  \brief    Functions that manage interrupts and exceptions via the NVIC.\r
+  @{\r
+ */\r
+\r
+#ifdef CMSIS_NVIC_VIRTUAL\r
+  #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+    #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"\r
+  #endif\r
+  #include CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+#else\r
+  #define NVIC_SetPriorityGrouping    __NVIC_SetPriorityGrouping\r
+  #define NVIC_GetPriorityGrouping    __NVIC_GetPriorityGrouping\r
+  #define NVIC_EnableIRQ              __NVIC_EnableIRQ\r
+  #define NVIC_GetEnableIRQ           __NVIC_GetEnableIRQ\r
+  #define NVIC_DisableIRQ             __NVIC_DisableIRQ\r
+  #define NVIC_GetPendingIRQ          __NVIC_GetPendingIRQ\r
+  #define NVIC_SetPendingIRQ          __NVIC_SetPendingIRQ\r
+  #define NVIC_ClearPendingIRQ        __NVIC_ClearPendingIRQ\r
+/*#define NVIC_GetActive              __NVIC_GetActive             not available for Cortex-M1 */\r
+  #define NVIC_SetPriority            __NVIC_SetPriority\r
+  #define NVIC_GetPriority            __NVIC_GetPriority\r
+  #define NVIC_SystemReset            __NVIC_SystemReset\r
+#endif /* CMSIS_NVIC_VIRTUAL */\r
+\r
+#ifdef CMSIS_VECTAB_VIRTUAL\r
+  #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+    #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"\r
+  #endif\r
+  #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+#else\r
+  #define NVIC_SetVector              __NVIC_SetVector\r
+  #define NVIC_GetVector              __NVIC_GetVector\r
+#endif  /* (CMSIS_VECTAB_VIRTUAL) */\r
+\r
+#define NVIC_USER_IRQ_OFFSET          16\r
+\r
+\r
+/* The following EXC_RETURN values are saved the LR on exception entry */\r
+#define EXC_RETURN_HANDLER         (0xFFFFFFF1UL)     /* return to Handler mode, uses MSP after return                               */\r
+#define EXC_RETURN_THREAD_MSP      (0xFFFFFFF9UL)     /* return to Thread mode, uses MSP after return                                */\r
+#define EXC_RETURN_THREAD_PSP      (0xFFFFFFFDUL)     /* return to Thread mode, uses PSP after return                                */\r
+\r
+\r
+/* Interrupt Priorities are WORD accessible only under Armv6-M                  */\r
+/* The following MACROS handle generation of the register offset and byte masks */\r
+#define _BIT_SHIFT(IRQn)         (  ((((uint32_t)(int32_t)(IRQn))         )      &  0x03UL) * 8UL)\r
+#define _SHP_IDX(IRQn)           ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >>    2UL)      )\r
+#define _IP_IDX(IRQn)            (   (((uint32_t)(int32_t)(IRQn))                >>    2UL)      )\r
+\r
+#define __NVIC_SetPriorityGrouping(X) (void)(X)\r
+#define __NVIC_GetPriorityGrouping()  (0U)\r
+\r
+/**\r
+  \brief   Enable Interrupt\r
+  \details Enables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Enable status\r
+  \details Returns a device specific interrupt enable status from the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt is not enabled.\r
+  \return             1  Interrupt is enabled.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISER[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Disable Interrupt\r
+  \details Disables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+    __DSB();\r
+    __ISB();\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Pending Interrupt\r
+  \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not pending.\r
+  \return             1  Interrupt status is pending.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Pending Interrupt\r
+  \details Sets the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Clear Pending Interrupt\r
+  \details Clears the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Priority\r
+  \details Sets the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]      IRQn  Interrupt number.\r
+  \param [in]  priority  Priority to set.\r
+  \note    The priority cannot be set for every processor exception.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->IP[_IP_IDX(IRQn)]  = ((uint32_t)(NVIC->IP[_IP_IDX(IRQn)]  & ~(0xFFUL << _BIT_SHIFT(IRQn))) |\r
+       (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));\r
+  }\r
+  else\r
+  {\r
+    SCB->SHP[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |\r
+       (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Priority\r
+  \details Reads the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn  Interrupt number.\r
+  \return             Interrupt Priority.\r
+                      Value is aligned automatically to the implemented priority bits of the microcontroller.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)\r
+{\r
+\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+  else\r
+  {\r
+    return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Encode Priority\r
+  \details Encodes the priority for an interrupt with the given priority group,\r
+           preemptive priority value, and subpriority value.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.\r
+  \param [in]     PriorityGroup  Used priority group.\r
+  \param [in]   PreemptPriority  Preemptive priority value (starting from 0).\r
+  \param [in]       SubPriority  Subpriority value (starting from 0).\r
+  \return                        Encoded priority. Value can be used in the function \ref NVIC_SetPriority().\r
+ */\r
+__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);\r
+  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));\r
+\r
+  return (\r
+           ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |\r
+           ((SubPriority     & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL)))\r
+         );\r
+}\r
+\r
+\r
+/**\r
+  \brief   Decode Priority\r
+  \details Decodes an interrupt priority value with a given priority group to\r
+           preemptive priority value and subpriority value.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.\r
+  \param [in]         Priority   Priority value, which can be retrieved with the function \ref NVIC_GetPriority().\r
+  \param [in]     PriorityGroup  Used priority group.\r
+  \param [out] pPreemptPriority  Preemptive priority value (starting from 0).\r
+  \param [out]     pSubPriority  Subpriority value (starting from 0).\r
+ */\r
+__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);\r
+  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));\r
+\r
+  *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);\r
+  *pSubPriority     = (Priority                   ) & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL);\r
+}\r
+\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Vector\r
+  \details Sets an interrupt vector in SRAM based interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+           Address 0 must be mapped to SRAM.\r
+  \param [in]   IRQn      Interrupt number\r
+  \param [in]   vector    Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)\r
+{\r
+  uint32_t *vectors = (uint32_t *)0x0U;\r
+  vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Vector\r
+  \details Reads an interrupt vector from interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn      Interrupt number.\r
+  \return                 Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)\r
+{\r
+  uint32_t *vectors = (uint32_t *)0x0U;\r
+  return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];\r
+}\r
+\r
+\r
+/**\r
+  \brief   System Reset\r
+  \details Initiates a system reset request to reset the MCU.\r
+ */\r
+__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)\r
+{\r
+  __DSB();                                                          /* Ensure all outstanding memory accesses included\r
+                                                                       buffered write are completed before reset */\r
+  SCB->AIRCR  = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |\r
+                 SCB_AIRCR_SYSRESETREQ_Msk);\r
+  __DSB();                                                          /* Ensure completion of memory access */\r
+\r
+  for(;;)                                                           /* wait until reset */\r
+  {\r
+    __NOP();\r
+  }\r
+}\r
+\r
+/*@} end of CMSIS_Core_NVICFunctions */\r
+\r
+\r
+/* ##########################  FPU functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_FpuFunctions FPU Functions\r
+  \brief    Function that provides FPU type.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   get FPU type\r
+  \details returns the FPU type\r
+  \returns\r
+   - \b  0: No FPU\r
+   - \b  1: Single precision FPU\r
+   - \b  2: Double + Single precision FPU\r
+ */\r
+__STATIC_INLINE uint32_t SCB_GetFPUType(void)\r
+{\r
+    return 0U;           /* No FPU */\r
+}\r
+\r
+\r
+/*@} end of CMSIS_Core_FpuFunctions */\r
+\r
+\r
+\r
+/* ##################################    SysTick function  ############################################ */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_SysTickFunctions SysTick Functions\r
+  \brief    Functions that configure the System.\r
+  @{\r
+ */\r
+\r
+#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)\r
+\r
+/**\r
+  \brief   System Tick Configuration\r
+  \details Initializes the System Timer and its interrupt, and starts the System Tick Timer.\r
+           Counter is in free running mode to generate periodic interrupts.\r
+  \param [in]  ticks  Number of ticks between two interrupts.\r
+  \return          0  Function succeeded.\r
+  \return          1  Function failed.\r
+  \note    When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the\r
+           function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>\r
+           must contain a vendor-specific implementation of this function.\r
+ */\r
+__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)\r
+{\r
+  if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)\r
+  {\r
+    return (1UL);                                                   /* Reload value impossible */\r
+  }\r
+\r
+  SysTick->LOAD  = (uint32_t)(ticks - 1UL);                         /* set reload register */\r
+  NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */\r
+  SysTick->VAL   = 0UL;                                             /* Load the SysTick Counter Value */\r
+  SysTick->CTRL  = SysTick_CTRL_CLKSOURCE_Msk |\r
+                   SysTick_CTRL_TICKINT_Msk   |\r
+                   SysTick_CTRL_ENABLE_Msk;                         /* Enable SysTick IRQ and SysTick Timer */\r
+  return (0UL);                                                     /* Function successful */\r
+}\r
+\r
+#endif\r
+\r
+/*@} end of CMSIS_Core_SysTickFunctions */\r
+\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_CM1_H_DEPENDANT */\r
+\r
+#endif /* __CMSIS_GENERIC */\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm23.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm23.h
new file mode 100644 (file)
index 0000000..8202a8d
--- /dev/null
@@ -0,0 +1,1993 @@
+/**************************************************************************//**\r
+ * @file     core_cm23.h\r
+ * @brief    CMSIS Cortex-M23 Core Peripheral Access Layer Header File\r
+ * @version  V5.0.7\r
+ * @date     22. June 2018\r
+ ******************************************************************************/\r
+/*\r
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.\r
+ *\r
+ * SPDX-License-Identifier: Apache-2.0\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the License); you may\r
+ * not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#if   defined ( __ICCARM__ )\r
+  #pragma system_include         /* treat file as system include file for MISRA check */\r
+#elif defined (__clang__)\r
+  #pragma clang system_header   /* treat file as system include file */\r
+#endif\r
+\r
+#ifndef __CORE_CM23_H_GENERIC\r
+#define __CORE_CM23_H_GENERIC\r
+\r
+#include <stdint.h>\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/**\r
+  \page CMSIS_MISRA_Exceptions  MISRA-C:2004 Compliance Exceptions\r
+  CMSIS violates the following MISRA-C:2004 rules:\r
+\r
+   \li Required Rule 8.5, object/function definition in header file.<br>\r
+     Function definitions in header files are used to allow 'inlining'.\r
+\r
+   \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>\r
+     Unions are used for effective representation of core registers.\r
+\r
+   \li Advisory Rule 19.7, Function-like macro defined.<br>\r
+     Function-like macros are used to allow more efficient code.\r
+ */\r
+\r
+\r
+/*******************************************************************************\r
+ *                 CMSIS definitions\r
+ ******************************************************************************/\r
+/**\r
+  \ingroup Cortex_M23\r
+  @{\r
+ */\r
+\r
+#include "cmsis_version.h"\r
+\r
+/*  CMSIS definitions */\r
+#define __CM23_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                   /*!< \deprecated [31:16] CMSIS HAL main version */\r
+#define __CM23_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                    /*!< \deprecated [15:0]  CMSIS HAL sub version */\r
+#define __CM23_CMSIS_VERSION       ((__CM23_CMSIS_VERSION_MAIN << 16U) | \\r
+                                     __CM23_CMSIS_VERSION_SUB           )      /*!< \deprecated CMSIS HAL version number */\r
+\r
+#define __CORTEX_M                 (23U)                                       /*!< Cortex-M Core */\r
+\r
+/** __FPU_USED indicates whether an FPU is used or not.\r
+    This core does not support an FPU at all\r
+*/\r
+#define __FPU_USED       0U\r
+\r
+#if defined ( __CC_ARM )\r
+  #if defined __TARGET_FPU_VFP\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)\r
+  #if defined __ARM_PCS_VFP\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __GNUC__ )\r
+  #if defined (__VFP_FP__) && !defined(__SOFTFP__)\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __ICCARM__ )\r
+  #if defined __ARMVFP__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __TI_ARM__ )\r
+  #if defined __TI_VFP_SUPPORT__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __TASKING__ )\r
+  #if defined __FPU_VFP__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __CSMC__ )\r
+  #if ( __CSMC__ & 0x400U)\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#endif\r
+\r
+#include "cmsis_compiler.h"               /* CMSIS compiler specific defines */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_CM23_H_GENERIC */\r
+\r
+#ifndef __CMSIS_GENERIC\r
+\r
+#ifndef __CORE_CM23_H_DEPENDANT\r
+#define __CORE_CM23_H_DEPENDANT\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/* check device defines and use defaults */\r
+#if defined __CHECK_DEVICE_DEFINES\r
+  #ifndef __CM23_REV\r
+    #define __CM23_REV                0x0000U\r
+    #warning "__CM23_REV not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __FPU_PRESENT\r
+    #define __FPU_PRESENT             0U\r
+    #warning "__FPU_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __MPU_PRESENT\r
+    #define __MPU_PRESENT             0U\r
+    #warning "__MPU_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __SAUREGION_PRESENT\r
+    #define __SAUREGION_PRESENT       0U\r
+    #warning "__SAUREGION_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __VTOR_PRESENT\r
+    #define __VTOR_PRESENT            0U\r
+    #warning "__VTOR_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __NVIC_PRIO_BITS\r
+    #define __NVIC_PRIO_BITS          2U\r
+    #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __Vendor_SysTickConfig\r
+    #define __Vendor_SysTickConfig    0U\r
+    #warning "__Vendor_SysTickConfig not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __ETM_PRESENT\r
+    #define __ETM_PRESENT             0U\r
+    #warning "__ETM_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __MTB_PRESENT\r
+    #define __MTB_PRESENT             0U\r
+    #warning "__MTB_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+#endif\r
+\r
+/* IO definitions (access restrictions to peripheral registers) */\r
+/**\r
+    \defgroup CMSIS_glob_defs CMSIS Global Defines\r
+\r
+    <strong>IO Type Qualifiers</strong> are used\r
+    \li to specify the access to peripheral variables.\r
+    \li for automatic generation of peripheral register debug information.\r
+*/\r
+#ifdef __cplusplus\r
+  #define   __I     volatile             /*!< Defines 'read only' permissions */\r
+#else\r
+  #define   __I     volatile const       /*!< Defines 'read only' permissions */\r
+#endif\r
+#define     __O     volatile             /*!< Defines 'write only' permissions */\r
+#define     __IO    volatile             /*!< Defines 'read / write' permissions */\r
+\r
+/* following defines should be used for structure members */\r
+#define     __IM     volatile const      /*! Defines 'read only' structure member permissions */\r
+#define     __OM     volatile            /*! Defines 'write only' structure member permissions */\r
+#define     __IOM    volatile            /*! Defines 'read / write' structure member permissions */\r
+\r
+/*@} end of group Cortex_M23 */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                 Register Abstraction\r
+  Core Register contain:\r
+  - Core Register\r
+  - Core NVIC Register\r
+  - Core SCB Register\r
+  - Core SysTick Register\r
+  - Core Debug Register\r
+  - Core MPU Register\r
+  - Core SAU Register\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_core_register Defines and Type Definitions\r
+  \brief Type definitions and defines for Cortex-M processor based devices.\r
+*/\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_CORE  Status and Control Registers\r
+  \brief      Core Register type definitions.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Union type to access the Application Program Status Register (APSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t _reserved0:28;              /*!< bit:  0..27  Reserved */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} APSR_Type;\r
+\r
+/* APSR Register Definitions */\r
+#define APSR_N_Pos                         31U                                            /*!< APSR: N Position */\r
+#define APSR_N_Msk                         (1UL << APSR_N_Pos)                            /*!< APSR: N Mask */\r
+\r
+#define APSR_Z_Pos                         30U                                            /*!< APSR: Z Position */\r
+#define APSR_Z_Msk                         (1UL << APSR_Z_Pos)                            /*!< APSR: Z Mask */\r
+\r
+#define APSR_C_Pos                         29U                                            /*!< APSR: C Position */\r
+#define APSR_C_Msk                         (1UL << APSR_C_Pos)                            /*!< APSR: C Mask */\r
+\r
+#define APSR_V_Pos                         28U                                            /*!< APSR: V Position */\r
+#define APSR_V_Msk                         (1UL << APSR_V_Pos)                            /*!< APSR: V Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Interrupt Program Status Register (IPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:23;              /*!< bit:  9..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} IPSR_Type;\r
+\r
+/* IPSR Register Definitions */\r
+#define IPSR_ISR_Pos                        0U                                            /*!< IPSR: ISR Position */\r
+#define IPSR_ISR_Msk                       (0x1FFUL /*<< IPSR_ISR_Pos*/)                  /*!< IPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Special-Purpose Program Status Registers (xPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:15;              /*!< bit:  9..23  Reserved */\r
+    uint32_t T:1;                        /*!< bit:     24  Thumb bit        (read 0) */\r
+    uint32_t _reserved1:3;               /*!< bit: 25..27  Reserved */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} xPSR_Type;\r
+\r
+/* xPSR Register Definitions */\r
+#define xPSR_N_Pos                         31U                                            /*!< xPSR: N Position */\r
+#define xPSR_N_Msk                         (1UL << xPSR_N_Pos)                            /*!< xPSR: N Mask */\r
+\r
+#define xPSR_Z_Pos                         30U                                            /*!< xPSR: Z Position */\r
+#define xPSR_Z_Msk                         (1UL << xPSR_Z_Pos)                            /*!< xPSR: Z Mask */\r
+\r
+#define xPSR_C_Pos                         29U                                            /*!< xPSR: C Position */\r
+#define xPSR_C_Msk                         (1UL << xPSR_C_Pos)                            /*!< xPSR: C Mask */\r
+\r
+#define xPSR_V_Pos                         28U                                            /*!< xPSR: V Position */\r
+#define xPSR_V_Msk                         (1UL << xPSR_V_Pos)                            /*!< xPSR: V Mask */\r
+\r
+#define xPSR_T_Pos                         24U                                            /*!< xPSR: T Position */\r
+#define xPSR_T_Msk                         (1UL << xPSR_T_Pos)                            /*!< xPSR: T Mask */\r
+\r
+#define xPSR_ISR_Pos                        0U                                            /*!< xPSR: ISR Position */\r
+#define xPSR_ISR_Msk                       (0x1FFUL /*<< xPSR_ISR_Pos*/)                  /*!< xPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Control Registers (CONTROL).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t nPRIV:1;                    /*!< bit:      0  Execution privilege in Thread mode */\r
+    uint32_t SPSEL:1;                    /*!< bit:      1  Stack-pointer select */\r
+    uint32_t _reserved1:30;              /*!< bit:  2..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} CONTROL_Type;\r
+\r
+/* CONTROL Register Definitions */\r
+#define CONTROL_SPSEL_Pos                   1U                                            /*!< CONTROL: SPSEL Position */\r
+#define CONTROL_SPSEL_Msk                  (1UL << CONTROL_SPSEL_Pos)                     /*!< CONTROL: SPSEL Mask */\r
+\r
+#define CONTROL_nPRIV_Pos                   0U                                            /*!< CONTROL: nPRIV Position */\r
+#define CONTROL_nPRIV_Msk                  (1UL /*<< CONTROL_nPRIV_Pos*/)                 /*!< CONTROL: nPRIV Mask */\r
+\r
+/*@} end of group CMSIS_CORE */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_NVIC  Nested Vectored Interrupt Controller (NVIC)\r
+  \brief      Type definitions for the NVIC Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Nested Vectored Interrupt Controller (NVIC).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t ISER[16U];              /*!< Offset: 0x000 (R/W)  Interrupt Set Enable Register */\r
+        uint32_t RESERVED0[16U];\r
+  __IOM uint32_t ICER[16U];              /*!< Offset: 0x080 (R/W)  Interrupt Clear Enable Register */\r
+        uint32_t RSERVED1[16U];\r
+  __IOM uint32_t ISPR[16U];              /*!< Offset: 0x100 (R/W)  Interrupt Set Pending Register */\r
+        uint32_t RESERVED2[16U];\r
+  __IOM uint32_t ICPR[16U];              /*!< Offset: 0x180 (R/W)  Interrupt Clear Pending Register */\r
+        uint32_t RESERVED3[16U];\r
+  __IOM uint32_t IABR[16U];              /*!< Offset: 0x200 (R/W)  Interrupt Active bit Register */\r
+        uint32_t RESERVED4[16U];\r
+  __IOM uint32_t ITNS[16U];              /*!< Offset: 0x280 (R/W)  Interrupt Non-Secure State Register */\r
+        uint32_t RESERVED5[16U];\r
+  __IOM uint32_t IPR[124U];              /*!< Offset: 0x300 (R/W)  Interrupt Priority Register */\r
+}  NVIC_Type;\r
+\r
+/*@} end of group CMSIS_NVIC */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SCB     System Control Block (SCB)\r
+  \brief    Type definitions for the System Control Block Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Control Block (SCB).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t CPUID;                  /*!< Offset: 0x000 (R/ )  CPUID Base Register */\r
+  __IOM uint32_t ICSR;                   /*!< Offset: 0x004 (R/W)  Interrupt Control and State Register */\r
+#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)\r
+  __IOM uint32_t VTOR;                   /*!< Offset: 0x008 (R/W)  Vector Table Offset Register */\r
+#else\r
+        uint32_t RESERVED0;\r
+#endif\r
+  __IOM uint32_t AIRCR;                  /*!< Offset: 0x00C (R/W)  Application Interrupt and Reset Control Register */\r
+  __IOM uint32_t SCR;                    /*!< Offset: 0x010 (R/W)  System Control Register */\r
+  __IOM uint32_t CCR;                    /*!< Offset: 0x014 (R/W)  Configuration Control Register */\r
+        uint32_t RESERVED1;\r
+  __IOM uint32_t SHPR[2U];               /*!< Offset: 0x01C (R/W)  System Handlers Priority Registers. [0] is RESERVED */\r
+  __IOM uint32_t SHCSR;                  /*!< Offset: 0x024 (R/W)  System Handler Control and State Register */\r
+} SCB_Type;\r
+\r
+/* SCB CPUID Register Definitions */\r
+#define SCB_CPUID_IMPLEMENTER_Pos          24U                                            /*!< SCB CPUID: IMPLEMENTER Position */\r
+#define SCB_CPUID_IMPLEMENTER_Msk          (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos)          /*!< SCB CPUID: IMPLEMENTER Mask */\r
+\r
+#define SCB_CPUID_VARIANT_Pos              20U                                            /*!< SCB CPUID: VARIANT Position */\r
+#define SCB_CPUID_VARIANT_Msk              (0xFUL << SCB_CPUID_VARIANT_Pos)               /*!< SCB CPUID: VARIANT Mask */\r
+\r
+#define SCB_CPUID_ARCHITECTURE_Pos         16U                                            /*!< SCB CPUID: ARCHITECTURE Position */\r
+#define SCB_CPUID_ARCHITECTURE_Msk         (0xFUL << SCB_CPUID_ARCHITECTURE_Pos)          /*!< SCB CPUID: ARCHITECTURE Mask */\r
+\r
+#define SCB_CPUID_PARTNO_Pos                4U                                            /*!< SCB CPUID: PARTNO Position */\r
+#define SCB_CPUID_PARTNO_Msk               (0xFFFUL << SCB_CPUID_PARTNO_Pos)              /*!< SCB CPUID: PARTNO Mask */\r
+\r
+#define SCB_CPUID_REVISION_Pos              0U                                            /*!< SCB CPUID: REVISION Position */\r
+#define SCB_CPUID_REVISION_Msk             (0xFUL /*<< SCB_CPUID_REVISION_Pos*/)          /*!< SCB CPUID: REVISION Mask */\r
+\r
+/* SCB Interrupt Control State Register Definitions */\r
+#define SCB_ICSR_PENDNMISET_Pos            31U                                            /*!< SCB ICSR: PENDNMISET Position */\r
+#define SCB_ICSR_PENDNMISET_Msk            (1UL << SCB_ICSR_PENDNMISET_Pos)               /*!< SCB ICSR: PENDNMISET Mask */\r
+\r
+#define SCB_ICSR_NMIPENDSET_Pos            SCB_ICSR_PENDNMISET_Pos                        /*!< SCB ICSR: NMIPENDSET Position, backward compatibility */\r
+#define SCB_ICSR_NMIPENDSET_Msk            SCB_ICSR_PENDNMISET_Msk                        /*!< SCB ICSR: NMIPENDSET Mask, backward compatibility */\r
+\r
+#define SCB_ICSR_PENDNMICLR_Pos            30U                                            /*!< SCB ICSR: PENDNMICLR Position */\r
+#define SCB_ICSR_PENDNMICLR_Msk            (1UL << SCB_ICSR_PENDNMICLR_Pos)               /*!< SCB ICSR: PENDNMICLR Mask */\r
+\r
+#define SCB_ICSR_PENDSVSET_Pos             28U                                            /*!< SCB ICSR: PENDSVSET Position */\r
+#define SCB_ICSR_PENDSVSET_Msk             (1UL << SCB_ICSR_PENDSVSET_Pos)                /*!< SCB ICSR: PENDSVSET Mask */\r
+\r
+#define SCB_ICSR_PENDSVCLR_Pos             27U                                            /*!< SCB ICSR: PENDSVCLR Position */\r
+#define SCB_ICSR_PENDSVCLR_Msk             (1UL << SCB_ICSR_PENDSVCLR_Pos)                /*!< SCB ICSR: PENDSVCLR Mask */\r
+\r
+#define SCB_ICSR_PENDSTSET_Pos             26U                                            /*!< SCB ICSR: PENDSTSET Position */\r
+#define SCB_ICSR_PENDSTSET_Msk             (1UL << SCB_ICSR_PENDSTSET_Pos)                /*!< SCB ICSR: PENDSTSET Mask */\r
+\r
+#define SCB_ICSR_PENDSTCLR_Pos             25U                                            /*!< SCB ICSR: PENDSTCLR Position */\r
+#define SCB_ICSR_PENDSTCLR_Msk             (1UL << SCB_ICSR_PENDSTCLR_Pos)                /*!< SCB ICSR: PENDSTCLR Mask */\r
+\r
+#define SCB_ICSR_STTNS_Pos                 24U                                            /*!< SCB ICSR: STTNS Position (Security Extension) */\r
+#define SCB_ICSR_STTNS_Msk                 (1UL << SCB_ICSR_STTNS_Pos)                    /*!< SCB ICSR: STTNS Mask (Security Extension) */\r
+\r
+#define SCB_ICSR_ISRPREEMPT_Pos            23U                                            /*!< SCB ICSR: ISRPREEMPT Position */\r
+#define SCB_ICSR_ISRPREEMPT_Msk            (1UL << SCB_ICSR_ISRPREEMPT_Pos)               /*!< SCB ICSR: ISRPREEMPT Mask */\r
+\r
+#define SCB_ICSR_ISRPENDING_Pos            22U                                            /*!< SCB ICSR: ISRPENDING Position */\r
+#define SCB_ICSR_ISRPENDING_Msk            (1UL << SCB_ICSR_ISRPENDING_Pos)               /*!< SCB ICSR: ISRPENDING Mask */\r
+\r
+#define SCB_ICSR_VECTPENDING_Pos           12U                                            /*!< SCB ICSR: VECTPENDING Position */\r
+#define SCB_ICSR_VECTPENDING_Msk           (0x1FFUL << SCB_ICSR_VECTPENDING_Pos)          /*!< SCB ICSR: VECTPENDING Mask */\r
+\r
+#define SCB_ICSR_RETTOBASE_Pos             11U                                            /*!< SCB ICSR: RETTOBASE Position */\r
+#define SCB_ICSR_RETTOBASE_Msk             (1UL << SCB_ICSR_RETTOBASE_Pos)                /*!< SCB ICSR: RETTOBASE Mask */\r
+\r
+#define SCB_ICSR_VECTACTIVE_Pos             0U                                            /*!< SCB ICSR: VECTACTIVE Position */\r
+#define SCB_ICSR_VECTACTIVE_Msk            (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/)       /*!< SCB ICSR: VECTACTIVE Mask */\r
+\r
+#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)\r
+/* SCB Vector Table Offset Register Definitions */\r
+#define SCB_VTOR_TBLOFF_Pos                 7U                                            /*!< SCB VTOR: TBLOFF Position */\r
+#define SCB_VTOR_TBLOFF_Msk                (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos)           /*!< SCB VTOR: TBLOFF Mask */\r
+#endif\r
+\r
+/* SCB Application Interrupt and Reset Control Register Definitions */\r
+#define SCB_AIRCR_VECTKEY_Pos              16U                                            /*!< SCB AIRCR: VECTKEY Position */\r
+#define SCB_AIRCR_VECTKEY_Msk              (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos)            /*!< SCB AIRCR: VECTKEY Mask */\r
+\r
+#define SCB_AIRCR_VECTKEYSTAT_Pos          16U                                            /*!< SCB AIRCR: VECTKEYSTAT Position */\r
+#define SCB_AIRCR_VECTKEYSTAT_Msk          (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos)        /*!< SCB AIRCR: VECTKEYSTAT Mask */\r
+\r
+#define SCB_AIRCR_ENDIANESS_Pos            15U                                            /*!< SCB AIRCR: ENDIANESS Position */\r
+#define SCB_AIRCR_ENDIANESS_Msk            (1UL << SCB_AIRCR_ENDIANESS_Pos)               /*!< SCB AIRCR: ENDIANESS Mask */\r
+\r
+#define SCB_AIRCR_PRIS_Pos                 14U                                            /*!< SCB AIRCR: PRIS Position */\r
+#define SCB_AIRCR_PRIS_Msk                 (1UL << SCB_AIRCR_PRIS_Pos)                    /*!< SCB AIRCR: PRIS Mask */\r
+\r
+#define SCB_AIRCR_BFHFNMINS_Pos            13U                                            /*!< SCB AIRCR: BFHFNMINS Position */\r
+#define SCB_AIRCR_BFHFNMINS_Msk            (1UL << SCB_AIRCR_BFHFNMINS_Pos)               /*!< SCB AIRCR: BFHFNMINS Mask */\r
+\r
+#define SCB_AIRCR_SYSRESETREQS_Pos          3U                                            /*!< SCB AIRCR: SYSRESETREQS Position */\r
+#define SCB_AIRCR_SYSRESETREQS_Msk         (1UL << SCB_AIRCR_SYSRESETREQS_Pos)            /*!< SCB AIRCR: SYSRESETREQS Mask */\r
+\r
+#define SCB_AIRCR_SYSRESETREQ_Pos           2U                                            /*!< SCB AIRCR: SYSRESETREQ Position */\r
+#define SCB_AIRCR_SYSRESETREQ_Msk          (1UL << SCB_AIRCR_SYSRESETREQ_Pos)             /*!< SCB AIRCR: SYSRESETREQ Mask */\r
+\r
+#define SCB_AIRCR_VECTCLRACTIVE_Pos         1U                                            /*!< SCB AIRCR: VECTCLRACTIVE Position */\r
+#define SCB_AIRCR_VECTCLRACTIVE_Msk        (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos)           /*!< SCB AIRCR: VECTCLRACTIVE Mask */\r
+\r
+/* SCB System Control Register Definitions */\r
+#define SCB_SCR_SEVONPEND_Pos               4U                                            /*!< SCB SCR: SEVONPEND Position */\r
+#define SCB_SCR_SEVONPEND_Msk              (1UL << SCB_SCR_SEVONPEND_Pos)                 /*!< SCB SCR: SEVONPEND Mask */\r
+\r
+#define SCB_SCR_SLEEPDEEPS_Pos              3U                                            /*!< SCB SCR: SLEEPDEEPS Position */\r
+#define SCB_SCR_SLEEPDEEPS_Msk             (1UL << SCB_SCR_SLEEPDEEPS_Pos)                /*!< SCB SCR: SLEEPDEEPS Mask */\r
+\r
+#define SCB_SCR_SLEEPDEEP_Pos               2U                                            /*!< SCB SCR: SLEEPDEEP Position */\r
+#define SCB_SCR_SLEEPDEEP_Msk              (1UL << SCB_SCR_SLEEPDEEP_Pos)                 /*!< SCB SCR: SLEEPDEEP Mask */\r
+\r
+#define SCB_SCR_SLEEPONEXIT_Pos             1U                                            /*!< SCB SCR: SLEEPONEXIT Position */\r
+#define SCB_SCR_SLEEPONEXIT_Msk            (1UL << SCB_SCR_SLEEPONEXIT_Pos)               /*!< SCB SCR: SLEEPONEXIT Mask */\r
+\r
+/* SCB Configuration Control Register Definitions */\r
+#define SCB_CCR_BP_Pos                     18U                                            /*!< SCB CCR: BP Position */\r
+#define SCB_CCR_BP_Msk                     (1UL << SCB_CCR_BP_Pos)                        /*!< SCB CCR: BP Mask */\r
+\r
+#define SCB_CCR_IC_Pos                     17U                                            /*!< SCB CCR: IC Position */\r
+#define SCB_CCR_IC_Msk                     (1UL << SCB_CCR_IC_Pos)                        /*!< SCB CCR: IC Mask */\r
+\r
+#define SCB_CCR_DC_Pos                     16U                                            /*!< SCB CCR: DC Position */\r
+#define SCB_CCR_DC_Msk                     (1UL << SCB_CCR_DC_Pos)                        /*!< SCB CCR: DC Mask */\r
+\r
+#define SCB_CCR_STKOFHFNMIGN_Pos           10U                                            /*!< SCB CCR: STKOFHFNMIGN Position */\r
+#define SCB_CCR_STKOFHFNMIGN_Msk           (1UL << SCB_CCR_STKOFHFNMIGN_Pos)              /*!< SCB CCR: STKOFHFNMIGN Mask */\r
+\r
+#define SCB_CCR_BFHFNMIGN_Pos               8U                                            /*!< SCB CCR: BFHFNMIGN Position */\r
+#define SCB_CCR_BFHFNMIGN_Msk              (1UL << SCB_CCR_BFHFNMIGN_Pos)                 /*!< SCB CCR: BFHFNMIGN Mask */\r
+\r
+#define SCB_CCR_DIV_0_TRP_Pos               4U                                            /*!< SCB CCR: DIV_0_TRP Position */\r
+#define SCB_CCR_DIV_0_TRP_Msk              (1UL << SCB_CCR_DIV_0_TRP_Pos)                 /*!< SCB CCR: DIV_0_TRP Mask */\r
+\r
+#define SCB_CCR_UNALIGN_TRP_Pos             3U                                            /*!< SCB CCR: UNALIGN_TRP Position */\r
+#define SCB_CCR_UNALIGN_TRP_Msk            (1UL << SCB_CCR_UNALIGN_TRP_Pos)               /*!< SCB CCR: UNALIGN_TRP Mask */\r
+\r
+#define SCB_CCR_USERSETMPEND_Pos            1U                                            /*!< SCB CCR: USERSETMPEND Position */\r
+#define SCB_CCR_USERSETMPEND_Msk           (1UL << SCB_CCR_USERSETMPEND_Pos)              /*!< SCB CCR: USERSETMPEND Mask */\r
+\r
+/* SCB System Handler Control and State Register Definitions */\r
+#define SCB_SHCSR_HARDFAULTPENDED_Pos      21U                                            /*!< SCB SHCSR: HARDFAULTPENDED Position */\r
+#define SCB_SHCSR_HARDFAULTPENDED_Msk      (1UL << SCB_SHCSR_HARDFAULTPENDED_Pos)         /*!< SCB SHCSR: HARDFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_SVCALLPENDED_Pos         15U                                            /*!< SCB SHCSR: SVCALLPENDED Position */\r
+#define SCB_SHCSR_SVCALLPENDED_Msk         (1UL << SCB_SHCSR_SVCALLPENDED_Pos)            /*!< SCB SHCSR: SVCALLPENDED Mask */\r
+\r
+#define SCB_SHCSR_SYSTICKACT_Pos           11U                                            /*!< SCB SHCSR: SYSTICKACT Position */\r
+#define SCB_SHCSR_SYSTICKACT_Msk           (1UL << SCB_SHCSR_SYSTICKACT_Pos)              /*!< SCB SHCSR: SYSTICKACT Mask */\r
+\r
+#define SCB_SHCSR_PENDSVACT_Pos            10U                                            /*!< SCB SHCSR: PENDSVACT Position */\r
+#define SCB_SHCSR_PENDSVACT_Msk            (1UL << SCB_SHCSR_PENDSVACT_Pos)               /*!< SCB SHCSR: PENDSVACT Mask */\r
+\r
+#define SCB_SHCSR_SVCALLACT_Pos             7U                                            /*!< SCB SHCSR: SVCALLACT Position */\r
+#define SCB_SHCSR_SVCALLACT_Msk            (1UL << SCB_SHCSR_SVCALLACT_Pos)               /*!< SCB SHCSR: SVCALLACT Mask */\r
+\r
+#define SCB_SHCSR_NMIACT_Pos                5U                                            /*!< SCB SHCSR: NMIACT Position */\r
+#define SCB_SHCSR_NMIACT_Msk               (1UL << SCB_SHCSR_NMIACT_Pos)                  /*!< SCB SHCSR: NMIACT Mask */\r
+\r
+#define SCB_SHCSR_HARDFAULTACT_Pos          2U                                            /*!< SCB SHCSR: HARDFAULTACT Position */\r
+#define SCB_SHCSR_HARDFAULTACT_Msk         (1UL << SCB_SHCSR_HARDFAULTACT_Pos)            /*!< SCB SHCSR: HARDFAULTACT Mask */\r
+\r
+/*@} end of group CMSIS_SCB */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SysTick     System Tick Timer (SysTick)\r
+  \brief    Type definitions for the System Timer Registers.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Timer (SysTick).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  SysTick Control and Status Register */\r
+  __IOM uint32_t LOAD;                   /*!< Offset: 0x004 (R/W)  SysTick Reload Value Register */\r
+  __IOM uint32_t VAL;                    /*!< Offset: 0x008 (R/W)  SysTick Current Value Register */\r
+  __IM  uint32_t CALIB;                  /*!< Offset: 0x00C (R/ )  SysTick Calibration Register */\r
+} SysTick_Type;\r
+\r
+/* SysTick Control / Status Register Definitions */\r
+#define SysTick_CTRL_COUNTFLAG_Pos         16U                                            /*!< SysTick CTRL: COUNTFLAG Position */\r
+#define SysTick_CTRL_COUNTFLAG_Msk         (1UL << SysTick_CTRL_COUNTFLAG_Pos)            /*!< SysTick CTRL: COUNTFLAG Mask */\r
+\r
+#define SysTick_CTRL_CLKSOURCE_Pos          2U                                            /*!< SysTick CTRL: CLKSOURCE Position */\r
+#define SysTick_CTRL_CLKSOURCE_Msk         (1UL << SysTick_CTRL_CLKSOURCE_Pos)            /*!< SysTick CTRL: CLKSOURCE Mask */\r
+\r
+#define SysTick_CTRL_TICKINT_Pos            1U                                            /*!< SysTick CTRL: TICKINT Position */\r
+#define SysTick_CTRL_TICKINT_Msk           (1UL << SysTick_CTRL_TICKINT_Pos)              /*!< SysTick CTRL: TICKINT Mask */\r
+\r
+#define SysTick_CTRL_ENABLE_Pos             0U                                            /*!< SysTick CTRL: ENABLE Position */\r
+#define SysTick_CTRL_ENABLE_Msk            (1UL /*<< SysTick_CTRL_ENABLE_Pos*/)           /*!< SysTick CTRL: ENABLE Mask */\r
+\r
+/* SysTick Reload Register Definitions */\r
+#define SysTick_LOAD_RELOAD_Pos             0U                                            /*!< SysTick LOAD: RELOAD Position */\r
+#define SysTick_LOAD_RELOAD_Msk            (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/)    /*!< SysTick LOAD: RELOAD Mask */\r
+\r
+/* SysTick Current Register Definitions */\r
+#define SysTick_VAL_CURRENT_Pos             0U                                            /*!< SysTick VAL: CURRENT Position */\r
+#define SysTick_VAL_CURRENT_Msk            (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/)    /*!< SysTick VAL: CURRENT Mask */\r
+\r
+/* SysTick Calibration Register Definitions */\r
+#define SysTick_CALIB_NOREF_Pos            31U                                            /*!< SysTick CALIB: NOREF Position */\r
+#define SysTick_CALIB_NOREF_Msk            (1UL << SysTick_CALIB_NOREF_Pos)               /*!< SysTick CALIB: NOREF Mask */\r
+\r
+#define SysTick_CALIB_SKEW_Pos             30U                                            /*!< SysTick CALIB: SKEW Position */\r
+#define SysTick_CALIB_SKEW_Msk             (1UL << SysTick_CALIB_SKEW_Pos)                /*!< SysTick CALIB: SKEW Mask */\r
+\r
+#define SysTick_CALIB_TENMS_Pos             0U                                            /*!< SysTick CALIB: TENMS Position */\r
+#define SysTick_CALIB_TENMS_Msk            (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/)    /*!< SysTick CALIB: TENMS Mask */\r
+\r
+/*@} end of group CMSIS_SysTick */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_DWT     Data Watchpoint and Trace (DWT)\r
+  \brief    Type definitions for the Data Watchpoint and Trace (DWT)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Data Watchpoint and Trace Register (DWT).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  Control Register */\r
+        uint32_t RESERVED0[6U];\r
+  __IM  uint32_t PCSR;                   /*!< Offset: 0x01C (R/ )  Program Counter Sample Register */\r
+  __IOM uint32_t COMP0;                  /*!< Offset: 0x020 (R/W)  Comparator Register 0 */\r
+        uint32_t RESERVED1[1U];\r
+  __IOM uint32_t FUNCTION0;              /*!< Offset: 0x028 (R/W)  Function Register 0 */\r
+        uint32_t RESERVED2[1U];\r
+  __IOM uint32_t COMP1;                  /*!< Offset: 0x030 (R/W)  Comparator Register 1 */\r
+        uint32_t RESERVED3[1U];\r
+  __IOM uint32_t FUNCTION1;              /*!< Offset: 0x038 (R/W)  Function Register 1 */\r
+        uint32_t RESERVED4[1U];\r
+  __IOM uint32_t COMP2;                  /*!< Offset: 0x040 (R/W)  Comparator Register 2 */\r
+        uint32_t RESERVED5[1U];\r
+  __IOM uint32_t FUNCTION2;              /*!< Offset: 0x048 (R/W)  Function Register 2 */\r
+        uint32_t RESERVED6[1U];\r
+  __IOM uint32_t COMP3;                  /*!< Offset: 0x050 (R/W)  Comparator Register 3 */\r
+        uint32_t RESERVED7[1U];\r
+  __IOM uint32_t FUNCTION3;              /*!< Offset: 0x058 (R/W)  Function Register 3 */\r
+        uint32_t RESERVED8[1U];\r
+  __IOM uint32_t COMP4;                  /*!< Offset: 0x060 (R/W)  Comparator Register 4 */\r
+        uint32_t RESERVED9[1U];\r
+  __IOM uint32_t FUNCTION4;              /*!< Offset: 0x068 (R/W)  Function Register 4 */\r
+        uint32_t RESERVED10[1U];\r
+  __IOM uint32_t COMP5;                  /*!< Offset: 0x070 (R/W)  Comparator Register 5 */\r
+        uint32_t RESERVED11[1U];\r
+  __IOM uint32_t FUNCTION5;              /*!< Offset: 0x078 (R/W)  Function Register 5 */\r
+        uint32_t RESERVED12[1U];\r
+  __IOM uint32_t COMP6;                  /*!< Offset: 0x080 (R/W)  Comparator Register 6 */\r
+        uint32_t RESERVED13[1U];\r
+  __IOM uint32_t FUNCTION6;              /*!< Offset: 0x088 (R/W)  Function Register 6 */\r
+        uint32_t RESERVED14[1U];\r
+  __IOM uint32_t COMP7;                  /*!< Offset: 0x090 (R/W)  Comparator Register 7 */\r
+        uint32_t RESERVED15[1U];\r
+  __IOM uint32_t FUNCTION7;              /*!< Offset: 0x098 (R/W)  Function Register 7 */\r
+        uint32_t RESERVED16[1U];\r
+  __IOM uint32_t COMP8;                  /*!< Offset: 0x0A0 (R/W)  Comparator Register 8 */\r
+        uint32_t RESERVED17[1U];\r
+  __IOM uint32_t FUNCTION8;              /*!< Offset: 0x0A8 (R/W)  Function Register 8 */\r
+        uint32_t RESERVED18[1U];\r
+  __IOM uint32_t COMP9;                  /*!< Offset: 0x0B0 (R/W)  Comparator Register 9 */\r
+        uint32_t RESERVED19[1U];\r
+  __IOM uint32_t FUNCTION9;              /*!< Offset: 0x0B8 (R/W)  Function Register 9 */\r
+        uint32_t RESERVED20[1U];\r
+  __IOM uint32_t COMP10;                 /*!< Offset: 0x0C0 (R/W)  Comparator Register 10 */\r
+        uint32_t RESERVED21[1U];\r
+  __IOM uint32_t FUNCTION10;             /*!< Offset: 0x0C8 (R/W)  Function Register 10 */\r
+        uint32_t RESERVED22[1U];\r
+  __IOM uint32_t COMP11;                 /*!< Offset: 0x0D0 (R/W)  Comparator Register 11 */\r
+        uint32_t RESERVED23[1U];\r
+  __IOM uint32_t FUNCTION11;             /*!< Offset: 0x0D8 (R/W)  Function Register 11 */\r
+        uint32_t RESERVED24[1U];\r
+  __IOM uint32_t COMP12;                 /*!< Offset: 0x0E0 (R/W)  Comparator Register 12 */\r
+        uint32_t RESERVED25[1U];\r
+  __IOM uint32_t FUNCTION12;             /*!< Offset: 0x0E8 (R/W)  Function Register 12 */\r
+        uint32_t RESERVED26[1U];\r
+  __IOM uint32_t COMP13;                 /*!< Offset: 0x0F0 (R/W)  Comparator Register 13 */\r
+        uint32_t RESERVED27[1U];\r
+  __IOM uint32_t FUNCTION13;             /*!< Offset: 0x0F8 (R/W)  Function Register 13 */\r
+        uint32_t RESERVED28[1U];\r
+  __IOM uint32_t COMP14;                 /*!< Offset: 0x100 (R/W)  Comparator Register 14 */\r
+        uint32_t RESERVED29[1U];\r
+  __IOM uint32_t FUNCTION14;             /*!< Offset: 0x108 (R/W)  Function Register 14 */\r
+        uint32_t RESERVED30[1U];\r
+  __IOM uint32_t COMP15;                 /*!< Offset: 0x110 (R/W)  Comparator Register 15 */\r
+        uint32_t RESERVED31[1U];\r
+  __IOM uint32_t FUNCTION15;             /*!< Offset: 0x118 (R/W)  Function Register 15 */\r
+} DWT_Type;\r
+\r
+/* DWT Control Register Definitions */\r
+#define DWT_CTRL_NUMCOMP_Pos               28U                                         /*!< DWT CTRL: NUMCOMP Position */\r
+#define DWT_CTRL_NUMCOMP_Msk               (0xFUL << DWT_CTRL_NUMCOMP_Pos)             /*!< DWT CTRL: NUMCOMP Mask */\r
+\r
+#define DWT_CTRL_NOTRCPKT_Pos              27U                                         /*!< DWT CTRL: NOTRCPKT Position */\r
+#define DWT_CTRL_NOTRCPKT_Msk              (0x1UL << DWT_CTRL_NOTRCPKT_Pos)            /*!< DWT CTRL: NOTRCPKT Mask */\r
+\r
+#define DWT_CTRL_NOEXTTRIG_Pos             26U                                         /*!< DWT CTRL: NOEXTTRIG Position */\r
+#define DWT_CTRL_NOEXTTRIG_Msk             (0x1UL << DWT_CTRL_NOEXTTRIG_Pos)           /*!< DWT CTRL: NOEXTTRIG Mask */\r
+\r
+#define DWT_CTRL_NOCYCCNT_Pos              25U                                         /*!< DWT CTRL: NOCYCCNT Position */\r
+#define DWT_CTRL_NOCYCCNT_Msk              (0x1UL << DWT_CTRL_NOCYCCNT_Pos)            /*!< DWT CTRL: NOCYCCNT Mask */\r
+\r
+#define DWT_CTRL_NOPRFCNT_Pos              24U                                         /*!< DWT CTRL: NOPRFCNT Position */\r
+#define DWT_CTRL_NOPRFCNT_Msk              (0x1UL << DWT_CTRL_NOPRFCNT_Pos)            /*!< DWT CTRL: NOPRFCNT Mask */\r
+\r
+/* DWT Comparator Function Register Definitions */\r
+#define DWT_FUNCTION_ID_Pos                27U                                         /*!< DWT FUNCTION: ID Position */\r
+#define DWT_FUNCTION_ID_Msk                (0x1FUL << DWT_FUNCTION_ID_Pos)             /*!< DWT FUNCTION: ID Mask */\r
+\r
+#define DWT_FUNCTION_MATCHED_Pos           24U                                         /*!< DWT FUNCTION: MATCHED Position */\r
+#define DWT_FUNCTION_MATCHED_Msk           (0x1UL << DWT_FUNCTION_MATCHED_Pos)         /*!< DWT FUNCTION: MATCHED Mask */\r
+\r
+#define DWT_FUNCTION_DATAVSIZE_Pos         10U                                         /*!< DWT FUNCTION: DATAVSIZE Position */\r
+#define DWT_FUNCTION_DATAVSIZE_Msk         (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos)       /*!< DWT FUNCTION: DATAVSIZE Mask */\r
+\r
+#define DWT_FUNCTION_ACTION_Pos             4U                                         /*!< DWT FUNCTION: ACTION Position */\r
+#define DWT_FUNCTION_ACTION_Msk            (0x3UL << DWT_FUNCTION_ACTION_Pos)          /*!< DWT FUNCTION: ACTION Mask */\r
+\r
+#define DWT_FUNCTION_MATCH_Pos              0U                                         /*!< DWT FUNCTION: MATCH Position */\r
+#define DWT_FUNCTION_MATCH_Msk             (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/)       /*!< DWT FUNCTION: MATCH Mask */\r
+\r
+/*@}*/ /* end of group CMSIS_DWT */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_TPI     Trace Port Interface (TPI)\r
+  \brief    Type definitions for the Trace Port Interface (TPI)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Trace Port Interface Register (TPI).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t SSPSR;                  /*!< Offset: 0x000 (R/ )  Supported Parallel Port Size Register */\r
+  __IOM uint32_t CSPSR;                  /*!< Offset: 0x004 (R/W)  Current Parallel Port Size Register */\r
+        uint32_t RESERVED0[2U];\r
+  __IOM uint32_t ACPR;                   /*!< Offset: 0x010 (R/W)  Asynchronous Clock Prescaler Register */\r
+        uint32_t RESERVED1[55U];\r
+  __IOM uint32_t SPPR;                   /*!< Offset: 0x0F0 (R/W)  Selected Pin Protocol Register */\r
+        uint32_t RESERVED2[131U];\r
+  __IM  uint32_t FFSR;                   /*!< Offset: 0x300 (R/ )  Formatter and Flush Status Register */\r
+  __IOM uint32_t FFCR;                   /*!< Offset: 0x304 (R/W)  Formatter and Flush Control Register */\r
+  __IOM uint32_t PSCR;                   /*!< Offset: 0x308 (R/W)  Periodic Synchronization Control Register */\r
+        uint32_t RESERVED3[759U];\r
+  __IM  uint32_t TRIGGER;                /*!< Offset: 0xEE8 (R/ )  TRIGGER Register */\r
+  __IM  uint32_t ITFTTD0;                /*!< Offset: 0xEEC (R/ )  Integration Test FIFO Test Data 0 Register */\r
+  __IOM uint32_t ITATBCTR2;              /*!< Offset: 0xEF0 (R/W)  Integration Test ATB Control Register 2 */\r
+        uint32_t RESERVED4[1U];\r
+  __IM  uint32_t ITATBCTR0;              /*!< Offset: 0xEF8 (R/ )  Integration Test ATB Control Register 0 */\r
+  __IM  uint32_t ITFTTD1;                /*!< Offset: 0xEFC (R/ )  Integration Test FIFO Test Data 1 Register */\r
+  __IOM uint32_t ITCTRL;                 /*!< Offset: 0xF00 (R/W)  Integration Mode Control */\r
+        uint32_t RESERVED5[39U];\r
+  __IOM uint32_t CLAIMSET;               /*!< Offset: 0xFA0 (R/W)  Claim tag set */\r
+  __IOM uint32_t CLAIMCLR;               /*!< Offset: 0xFA4 (R/W)  Claim tag clear */\r
+        uint32_t RESERVED7[8U];\r
+  __IM  uint32_t DEVID;                  /*!< Offset: 0xFC8 (R/ )  Device Configuration Register */\r
+  __IM  uint32_t DEVTYPE;                /*!< Offset: 0xFCC (R/ )  Device Type Identifier Register */\r
+} TPI_Type;\r
+\r
+/* TPI Asynchronous Clock Prescaler Register Definitions */\r
+#define TPI_ACPR_PRESCALER_Pos              0U                                         /*!< TPI ACPR: PRESCALER Position */\r
+#define TPI_ACPR_PRESCALER_Msk             (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/)    /*!< TPI ACPR: PRESCALER Mask */\r
+\r
+/* TPI Selected Pin Protocol Register Definitions */\r
+#define TPI_SPPR_TXMODE_Pos                 0U                                         /*!< TPI SPPR: TXMODE Position */\r
+#define TPI_SPPR_TXMODE_Msk                (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/)          /*!< TPI SPPR: TXMODE Mask */\r
+\r
+/* TPI Formatter and Flush Status Register Definitions */\r
+#define TPI_FFSR_FtNonStop_Pos              3U                                         /*!< TPI FFSR: FtNonStop Position */\r
+#define TPI_FFSR_FtNonStop_Msk             (0x1UL << TPI_FFSR_FtNonStop_Pos)           /*!< TPI FFSR: FtNonStop Mask */\r
+\r
+#define TPI_FFSR_TCPresent_Pos              2U                                         /*!< TPI FFSR: TCPresent Position */\r
+#define TPI_FFSR_TCPresent_Msk             (0x1UL << TPI_FFSR_TCPresent_Pos)           /*!< TPI FFSR: TCPresent Mask */\r
+\r
+#define TPI_FFSR_FtStopped_Pos              1U                                         /*!< TPI FFSR: FtStopped Position */\r
+#define TPI_FFSR_FtStopped_Msk             (0x1UL << TPI_FFSR_FtStopped_Pos)           /*!< TPI FFSR: FtStopped Mask */\r
+\r
+#define TPI_FFSR_FlInProg_Pos               0U                                         /*!< TPI FFSR: FlInProg Position */\r
+#define TPI_FFSR_FlInProg_Msk              (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/)        /*!< TPI FFSR: FlInProg Mask */\r
+\r
+/* TPI Formatter and Flush Control Register Definitions */\r
+#define TPI_FFCR_TrigIn_Pos                 8U                                         /*!< TPI FFCR: TrigIn Position */\r
+#define TPI_FFCR_TrigIn_Msk                (0x1UL << TPI_FFCR_TrigIn_Pos)              /*!< TPI FFCR: TrigIn Mask */\r
+\r
+#define TPI_FFCR_FOnMan_Pos                 6U                                         /*!< TPI FFCR: FOnMan Position */\r
+#define TPI_FFCR_FOnMan_Msk                (0x1UL << TPI_FFCR_FOnMan_Pos)              /*!< TPI FFCR: FOnMan Mask */\r
+\r
+#define TPI_FFCR_EnFCont_Pos                1U                                         /*!< TPI FFCR: EnFCont Position */\r
+#define TPI_FFCR_EnFCont_Msk               (0x1UL << TPI_FFCR_EnFCont_Pos)             /*!< TPI FFCR: EnFCont Mask */\r
+\r
+/* TPI TRIGGER Register Definitions */\r
+#define TPI_TRIGGER_TRIGGER_Pos             0U                                         /*!< TPI TRIGGER: TRIGGER Position */\r
+#define TPI_TRIGGER_TRIGGER_Msk            (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/)      /*!< TPI TRIGGER: TRIGGER Mask */\r
+\r
+/* TPI Integration Test FIFO Test Data 0 Register Definitions */\r
+#define TPI_ITFTTD0_ATB_IF2_ATVALID_Pos    29U                                         /*!< TPI ITFTTD0: ATB Interface 2 ATVALIDPosition */\r
+#define TPI_ITFTTD0_ATB_IF2_ATVALID_Msk    (0x3UL << TPI_ITFTTD0_ATB_IF2_ATVALID_Pos)  /*!< TPI ITFTTD0: ATB Interface 2 ATVALID Mask */\r
+\r
+#define TPI_ITFTTD0_ATB_IF2_bytecount_Pos  27U                                         /*!< TPI ITFTTD0: ATB Interface 2 byte count Position */\r
+#define TPI_ITFTTD0_ATB_IF2_bytecount_Msk  (0x3UL << TPI_ITFTTD0_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 2 byte count Mask */\r
+\r
+#define TPI_ITFTTD0_ATB_IF1_ATVALID_Pos    26U                                         /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Position */\r
+#define TPI_ITFTTD0_ATB_IF1_ATVALID_Msk    (0x3UL << TPI_ITFTTD0_ATB_IF1_ATVALID_Pos)  /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Mask */\r
+\r
+#define TPI_ITFTTD0_ATB_IF1_bytecount_Pos  24U                                         /*!< TPI ITFTTD0: ATB Interface 1 byte count Position */\r
+#define TPI_ITFTTD0_ATB_IF1_bytecount_Msk  (0x3UL << TPI_ITFTTD0_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 1 byte countt Mask */\r
+\r
+#define TPI_ITFTTD0_ATB_IF1_data2_Pos      16U                                         /*!< TPI ITFTTD0: ATB Interface 1 data2 Position */\r
+#define TPI_ITFTTD0_ATB_IF1_data2_Msk      (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos)   /*!< TPI ITFTTD0: ATB Interface 1 data2 Mask */\r
+\r
+#define TPI_ITFTTD0_ATB_IF1_data1_Pos       8U                                         /*!< TPI ITFTTD0: ATB Interface 1 data1 Position */\r
+#define TPI_ITFTTD0_ATB_IF1_data1_Msk      (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos)   /*!< TPI ITFTTD0: ATB Interface 1 data1 Mask */\r
+\r
+#define TPI_ITFTTD0_ATB_IF1_data0_Pos       0U                                          /*!< TPI ITFTTD0: ATB Interface 1 data0 Position */\r
+#define TPI_ITFTTD0_ATB_IF1_data0_Msk      (0xFFUL /*<< TPI_ITFTTD0_ATB_IF1_data0_Pos*/) /*!< TPI ITFTTD0: ATB Interface 1 data0 Mask */\r
+\r
+/* TPI Integration Test ATB Control Register 2 Register Definitions */\r
+#define TPI_ITATBCTR2_AFVALID2S_Pos         1U                                         /*!< TPI ITATBCTR2: AFVALID2S Position */\r
+#define TPI_ITATBCTR2_AFVALID2S_Msk        (0x1UL << TPI_ITATBCTR2_AFVALID2S_Pos)      /*!< TPI ITATBCTR2: AFVALID2SS Mask */\r
+\r
+#define TPI_ITATBCTR2_AFVALID1S_Pos         1U                                         /*!< TPI ITATBCTR2: AFVALID1S Position */\r
+#define TPI_ITATBCTR2_AFVALID1S_Msk        (0x1UL << TPI_ITATBCTR2_AFVALID1S_Pos)      /*!< TPI ITATBCTR2: AFVALID1SS Mask */\r
+\r
+#define TPI_ITATBCTR2_ATREADY2S_Pos         0U                                         /*!< TPI ITATBCTR2: ATREADY2S Position */\r
+#define TPI_ITATBCTR2_ATREADY2S_Msk        (0x1UL /*<< TPI_ITATBCTR2_ATREADY2S_Pos*/)  /*!< TPI ITATBCTR2: ATREADY2S Mask */\r
+\r
+#define TPI_ITATBCTR2_ATREADY1S_Pos         0U                                         /*!< TPI ITATBCTR2: ATREADY1S Position */\r
+#define TPI_ITATBCTR2_ATREADY1S_Msk        (0x1UL /*<< TPI_ITATBCTR2_ATREADY1S_Pos*/)  /*!< TPI ITATBCTR2: ATREADY1S Mask */\r
+\r
+/* TPI Integration Test FIFO Test Data 1 Register Definitions */\r
+#define TPI_ITFTTD1_ATB_IF2_ATVALID_Pos    29U                                         /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Position */\r
+#define TPI_ITFTTD1_ATB_IF2_ATVALID_Msk    (0x3UL << TPI_ITFTTD1_ATB_IF2_ATVALID_Pos)  /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Mask */\r
+\r
+#define TPI_ITFTTD1_ATB_IF2_bytecount_Pos  27U                                         /*!< TPI ITFTTD1: ATB Interface 2 byte count Position */\r
+#define TPI_ITFTTD1_ATB_IF2_bytecount_Msk  (0x3UL << TPI_ITFTTD1_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 2 byte count Mask */\r
+\r
+#define TPI_ITFTTD1_ATB_IF1_ATVALID_Pos    26U                                         /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Position */\r
+#define TPI_ITFTTD1_ATB_IF1_ATVALID_Msk    (0x3UL << TPI_ITFTTD1_ATB_IF1_ATVALID_Pos)  /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Mask */\r
+\r
+#define TPI_ITFTTD1_ATB_IF1_bytecount_Pos  24U                                         /*!< TPI ITFTTD1: ATB Interface 1 byte count Position */\r
+#define TPI_ITFTTD1_ATB_IF1_bytecount_Msk  (0x3UL << TPI_ITFTTD1_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 1 byte countt Mask */\r
+\r
+#define TPI_ITFTTD1_ATB_IF2_data2_Pos      16U                                         /*!< TPI ITFTTD1: ATB Interface 2 data2 Position */\r
+#define TPI_ITFTTD1_ATB_IF2_data2_Msk      (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos)   /*!< TPI ITFTTD1: ATB Interface 2 data2 Mask */\r
+\r
+#define TPI_ITFTTD1_ATB_IF2_data1_Pos       8U                                         /*!< TPI ITFTTD1: ATB Interface 2 data1 Position */\r
+#define TPI_ITFTTD1_ATB_IF2_data1_Msk      (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos)   /*!< TPI ITFTTD1: ATB Interface 2 data1 Mask */\r
+\r
+#define TPI_ITFTTD1_ATB_IF2_data0_Pos       0U                                          /*!< TPI ITFTTD1: ATB Interface 2 data0 Position */\r
+#define TPI_ITFTTD1_ATB_IF2_data0_Msk      (0xFFUL /*<< TPI_ITFTTD1_ATB_IF2_data0_Pos*/) /*!< TPI ITFTTD1: ATB Interface 2 data0 Mask */\r
+\r
+/* TPI Integration Test ATB Control Register 0 Definitions */\r
+#define TPI_ITATBCTR0_AFVALID2S_Pos         1U                                         /*!< TPI ITATBCTR0: AFVALID2S Position */\r
+#define TPI_ITATBCTR0_AFVALID2S_Msk        (0x1UL << TPI_ITATBCTR0_AFVALID2S_Pos)      /*!< TPI ITATBCTR0: AFVALID2SS Mask */\r
+\r
+#define TPI_ITATBCTR0_AFVALID1S_Pos         1U                                         /*!< TPI ITATBCTR0: AFVALID1S Position */\r
+#define TPI_ITATBCTR0_AFVALID1S_Msk        (0x1UL << TPI_ITATBCTR0_AFVALID1S_Pos)      /*!< TPI ITATBCTR0: AFVALID1SS Mask */\r
+\r
+#define TPI_ITATBCTR0_ATREADY2S_Pos         0U                                         /*!< TPI ITATBCTR0: ATREADY2S Position */\r
+#define TPI_ITATBCTR0_ATREADY2S_Msk        (0x1UL /*<< TPI_ITATBCTR0_ATREADY2S_Pos*/)  /*!< TPI ITATBCTR0: ATREADY2S Mask */\r
+\r
+#define TPI_ITATBCTR0_ATREADY1S_Pos         0U                                         /*!< TPI ITATBCTR0: ATREADY1S Position */\r
+#define TPI_ITATBCTR0_ATREADY1S_Msk        (0x1UL /*<< TPI_ITATBCTR0_ATREADY1S_Pos*/)  /*!< TPI ITATBCTR0: ATREADY1S Mask */\r
+\r
+/* TPI Integration Mode Control Register Definitions */\r
+#define TPI_ITCTRL_Mode_Pos                 0U                                         /*!< TPI ITCTRL: Mode Position */\r
+#define TPI_ITCTRL_Mode_Msk                (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/)          /*!< TPI ITCTRL: Mode Mask */\r
+\r
+/* TPI DEVID Register Definitions */\r
+#define TPI_DEVID_NRZVALID_Pos             11U                                         /*!< TPI DEVID: NRZVALID Position */\r
+#define TPI_DEVID_NRZVALID_Msk             (0x1UL << TPI_DEVID_NRZVALID_Pos)           /*!< TPI DEVID: NRZVALID Mask */\r
+\r
+#define TPI_DEVID_MANCVALID_Pos            10U                                         /*!< TPI DEVID: MANCVALID Position */\r
+#define TPI_DEVID_MANCVALID_Msk            (0x1UL << TPI_DEVID_MANCVALID_Pos)          /*!< TPI DEVID: MANCVALID Mask */\r
+\r
+#define TPI_DEVID_PTINVALID_Pos             9U                                         /*!< TPI DEVID: PTINVALID Position */\r
+#define TPI_DEVID_PTINVALID_Msk            (0x1UL << TPI_DEVID_PTINVALID_Pos)          /*!< TPI DEVID: PTINVALID Mask */\r
+\r
+#define TPI_DEVID_FIFOSZ_Pos                6U                                         /*!< TPI DEVID: FIFOSZ Position */\r
+#define TPI_DEVID_FIFOSZ_Msk               (0x7UL << TPI_DEVID_FIFOSZ_Pos)             /*!< TPI DEVID: FIFOSZ Mask */\r
+\r
+#define TPI_DEVID_NrTraceInput_Pos          0U                                         /*!< TPI DEVID: NrTraceInput Position */\r
+#define TPI_DEVID_NrTraceInput_Msk         (0x3FUL /*<< TPI_DEVID_NrTraceInput_Pos*/)  /*!< TPI DEVID: NrTraceInput Mask */\r
+\r
+/* TPI DEVTYPE Register Definitions */\r
+#define TPI_DEVTYPE_SubType_Pos             4U                                         /*!< TPI DEVTYPE: SubType Position */\r
+#define TPI_DEVTYPE_SubType_Msk            (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/)      /*!< TPI DEVTYPE: SubType Mask */\r
+\r
+#define TPI_DEVTYPE_MajorType_Pos           0U                                         /*!< TPI DEVTYPE: MajorType Position */\r
+#define TPI_DEVTYPE_MajorType_Msk          (0xFUL << TPI_DEVTYPE_MajorType_Pos)        /*!< TPI DEVTYPE: MajorType Mask */\r
+\r
+/*@}*/ /* end of group CMSIS_TPI */\r
+\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_MPU     Memory Protection Unit (MPU)\r
+  \brief    Type definitions for the Memory Protection Unit (MPU)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Memory Protection Unit (MPU).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t TYPE;                   /*!< Offset: 0x000 (R/ )  MPU Type Register */\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x004 (R/W)  MPU Control Register */\r
+  __IOM uint32_t RNR;                    /*!< Offset: 0x008 (R/W)  MPU Region Number Register */\r
+  __IOM uint32_t RBAR;                   /*!< Offset: 0x00C (R/W)  MPU Region Base Address Register */\r
+  __IOM uint32_t RLAR;                   /*!< Offset: 0x010 (R/W)  MPU Region Limit Address Register */\r
+        uint32_t RESERVED0[7U];\r
+  union {\r
+  __IOM uint32_t MAIR[2];\r
+  struct {\r
+  __IOM uint32_t MAIR0;                  /*!< Offset: 0x030 (R/W)  MPU Memory Attribute Indirection Register 0 */\r
+  __IOM uint32_t MAIR1;                  /*!< Offset: 0x034 (R/W)  MPU Memory Attribute Indirection Register 1 */\r
+  };\r
+  };\r
+} MPU_Type;\r
+\r
+#define MPU_TYPE_RALIASES                  1U\r
+\r
+/* MPU Type Register Definitions */\r
+#define MPU_TYPE_IREGION_Pos               16U                                            /*!< MPU TYPE: IREGION Position */\r
+#define MPU_TYPE_IREGION_Msk               (0xFFUL << MPU_TYPE_IREGION_Pos)               /*!< MPU TYPE: IREGION Mask */\r
+\r
+#define MPU_TYPE_DREGION_Pos                8U                                            /*!< MPU TYPE: DREGION Position */\r
+#define MPU_TYPE_DREGION_Msk               (0xFFUL << MPU_TYPE_DREGION_Pos)               /*!< MPU TYPE: DREGION Mask */\r
+\r
+#define MPU_TYPE_SEPARATE_Pos               0U                                            /*!< MPU TYPE: SEPARATE Position */\r
+#define MPU_TYPE_SEPARATE_Msk              (1UL /*<< MPU_TYPE_SEPARATE_Pos*/)             /*!< MPU TYPE: SEPARATE Mask */\r
+\r
+/* MPU Control Register Definitions */\r
+#define MPU_CTRL_PRIVDEFENA_Pos             2U                                            /*!< MPU CTRL: PRIVDEFENA Position */\r
+#define MPU_CTRL_PRIVDEFENA_Msk            (1UL << MPU_CTRL_PRIVDEFENA_Pos)               /*!< MPU CTRL: PRIVDEFENA Mask */\r
+\r
+#define MPU_CTRL_HFNMIENA_Pos               1U                                            /*!< MPU CTRL: HFNMIENA Position */\r
+#define MPU_CTRL_HFNMIENA_Msk              (1UL << MPU_CTRL_HFNMIENA_Pos)                 /*!< MPU CTRL: HFNMIENA Mask */\r
+\r
+#define MPU_CTRL_ENABLE_Pos                 0U                                            /*!< MPU CTRL: ENABLE Position */\r
+#define MPU_CTRL_ENABLE_Msk                (1UL /*<< MPU_CTRL_ENABLE_Pos*/)               /*!< MPU CTRL: ENABLE Mask */\r
+\r
+/* MPU Region Number Register Definitions */\r
+#define MPU_RNR_REGION_Pos                  0U                                            /*!< MPU RNR: REGION Position */\r
+#define MPU_RNR_REGION_Msk                 (0xFFUL /*<< MPU_RNR_REGION_Pos*/)             /*!< MPU RNR: REGION Mask */\r
+\r
+/* MPU Region Base Address Register Definitions */\r
+#define MPU_RBAR_BASE_Pos                   5U                                            /*!< MPU RBAR: BASE Position */\r
+#define MPU_RBAR_BASE_Msk                  (0x7FFFFFFUL << MPU_RBAR_BASE_Pos)             /*!< MPU RBAR: BASE Mask */\r
+\r
+#define MPU_RBAR_SH_Pos                     3U                                            /*!< MPU RBAR: SH Position */\r
+#define MPU_RBAR_SH_Msk                    (0x3UL << MPU_RBAR_SH_Pos)                     /*!< MPU RBAR: SH Mask */\r
+\r
+#define MPU_RBAR_AP_Pos                     1U                                            /*!< MPU RBAR: AP Position */\r
+#define MPU_RBAR_AP_Msk                    (0x3UL << MPU_RBAR_AP_Pos)                     /*!< MPU RBAR: AP Mask */\r
+\r
+#define MPU_RBAR_XN_Pos                     0U                                            /*!< MPU RBAR: XN Position */\r
+#define MPU_RBAR_XN_Msk                    (01UL /*<< MPU_RBAR_XN_Pos*/)                  /*!< MPU RBAR: XN Mask */\r
+\r
+/* MPU Region Limit Address Register Definitions */\r
+#define MPU_RLAR_LIMIT_Pos                  5U                                            /*!< MPU RLAR: LIMIT Position */\r
+#define MPU_RLAR_LIMIT_Msk                 (0x7FFFFFFUL << MPU_RLAR_LIMIT_Pos)            /*!< MPU RLAR: LIMIT Mask */\r
+\r
+#define MPU_RLAR_AttrIndx_Pos               1U                                            /*!< MPU RLAR: AttrIndx Position */\r
+#define MPU_RLAR_AttrIndx_Msk              (0x7UL << MPU_RLAR_AttrIndx_Pos)               /*!< MPU RLAR: AttrIndx Mask */\r
+\r
+#define MPU_RLAR_EN_Pos                     0U                                            /*!< MPU RLAR: EN Position */\r
+#define MPU_RLAR_EN_Msk                    (1UL /*<< MPU_RLAR_EN_Pos*/)                   /*!< MPU RLAR: EN Mask */\r
+\r
+/* MPU Memory Attribute Indirection Register 0 Definitions */\r
+#define MPU_MAIR0_Attr3_Pos                24U                                            /*!< MPU MAIR0: Attr3 Position */\r
+#define MPU_MAIR0_Attr3_Msk                (0xFFUL << MPU_MAIR0_Attr3_Pos)                /*!< MPU MAIR0: Attr3 Mask */\r
+\r
+#define MPU_MAIR0_Attr2_Pos                16U                                            /*!< MPU MAIR0: Attr2 Position */\r
+#define MPU_MAIR0_Attr2_Msk                (0xFFUL << MPU_MAIR0_Attr2_Pos)                /*!< MPU MAIR0: Attr2 Mask */\r
+\r
+#define MPU_MAIR0_Attr1_Pos                 8U                                            /*!< MPU MAIR0: Attr1 Position */\r
+#define MPU_MAIR0_Attr1_Msk                (0xFFUL << MPU_MAIR0_Attr1_Pos)                /*!< MPU MAIR0: Attr1 Mask */\r
+\r
+#define MPU_MAIR0_Attr0_Pos                 0U                                            /*!< MPU MAIR0: Attr0 Position */\r
+#define MPU_MAIR0_Attr0_Msk                (0xFFUL /*<< MPU_MAIR0_Attr0_Pos*/)            /*!< MPU MAIR0: Attr0 Mask */\r
+\r
+/* MPU Memory Attribute Indirection Register 1 Definitions */\r
+#define MPU_MAIR1_Attr7_Pos                24U                                            /*!< MPU MAIR1: Attr7 Position */\r
+#define MPU_MAIR1_Attr7_Msk                (0xFFUL << MPU_MAIR1_Attr7_Pos)                /*!< MPU MAIR1: Attr7 Mask */\r
+\r
+#define MPU_MAIR1_Attr6_Pos                16U                                            /*!< MPU MAIR1: Attr6 Position */\r
+#define MPU_MAIR1_Attr6_Msk                (0xFFUL << MPU_MAIR1_Attr6_Pos)                /*!< MPU MAIR1: Attr6 Mask */\r
+\r
+#define MPU_MAIR1_Attr5_Pos                 8U                                            /*!< MPU MAIR1: Attr5 Position */\r
+#define MPU_MAIR1_Attr5_Msk                (0xFFUL << MPU_MAIR1_Attr5_Pos)                /*!< MPU MAIR1: Attr5 Mask */\r
+\r
+#define MPU_MAIR1_Attr4_Pos                 0U                                            /*!< MPU MAIR1: Attr4 Position */\r
+#define MPU_MAIR1_Attr4_Msk                (0xFFUL /*<< MPU_MAIR1_Attr4_Pos*/)            /*!< MPU MAIR1: Attr4 Mask */\r
+\r
+/*@} end of group CMSIS_MPU */\r
+#endif\r
+\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SAU     Security Attribution Unit (SAU)\r
+  \brief    Type definitions for the Security Attribution Unit (SAU)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Security Attribution Unit (SAU).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  SAU Control Register */\r
+  __IM  uint32_t TYPE;                   /*!< Offset: 0x004 (R/ )  SAU Type Register */\r
+#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U)\r
+  __IOM uint32_t RNR;                    /*!< Offset: 0x008 (R/W)  SAU Region Number Register */\r
+  __IOM uint32_t RBAR;                   /*!< Offset: 0x00C (R/W)  SAU Region Base Address Register */\r
+  __IOM uint32_t RLAR;                   /*!< Offset: 0x010 (R/W)  SAU Region Limit Address Register */\r
+#endif\r
+} SAU_Type;\r
+\r
+/* SAU Control Register Definitions */\r
+#define SAU_CTRL_ALLNS_Pos                  1U                                            /*!< SAU CTRL: ALLNS Position */\r
+#define SAU_CTRL_ALLNS_Msk                 (1UL << SAU_CTRL_ALLNS_Pos)                    /*!< SAU CTRL: ALLNS Mask */\r
+\r
+#define SAU_CTRL_ENABLE_Pos                 0U                                            /*!< SAU CTRL: ENABLE Position */\r
+#define SAU_CTRL_ENABLE_Msk                (1UL /*<< SAU_CTRL_ENABLE_Pos*/)               /*!< SAU CTRL: ENABLE Mask */\r
+\r
+/* SAU Type Register Definitions */\r
+#define SAU_TYPE_SREGION_Pos                0U                                            /*!< SAU TYPE: SREGION Position */\r
+#define SAU_TYPE_SREGION_Msk               (0xFFUL /*<< SAU_TYPE_SREGION_Pos*/)           /*!< SAU TYPE: SREGION Mask */\r
+\r
+#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U)\r
+/* SAU Region Number Register Definitions */\r
+#define SAU_RNR_REGION_Pos                  0U                                            /*!< SAU RNR: REGION Position */\r
+#define SAU_RNR_REGION_Msk                 (0xFFUL /*<< SAU_RNR_REGION_Pos*/)             /*!< SAU RNR: REGION Mask */\r
+\r
+/* SAU Region Base Address Register Definitions */\r
+#define SAU_RBAR_BADDR_Pos                  5U                                            /*!< SAU RBAR: BADDR Position */\r
+#define SAU_RBAR_BADDR_Msk                 (0x7FFFFFFUL << SAU_RBAR_BADDR_Pos)            /*!< SAU RBAR: BADDR Mask */\r
+\r
+/* SAU Region Limit Address Register Definitions */\r
+#define SAU_RLAR_LADDR_Pos                  5U                                            /*!< SAU RLAR: LADDR Position */\r
+#define SAU_RLAR_LADDR_Msk                 (0x7FFFFFFUL << SAU_RLAR_LADDR_Pos)            /*!< SAU RLAR: LADDR Mask */\r
+\r
+#define SAU_RLAR_NSC_Pos                    1U                                            /*!< SAU RLAR: NSC Position */\r
+#define SAU_RLAR_NSC_Msk                   (1UL << SAU_RLAR_NSC_Pos)                      /*!< SAU RLAR: NSC Mask */\r
+\r
+#define SAU_RLAR_ENABLE_Pos                 0U                                            /*!< SAU RLAR: ENABLE Position */\r
+#define SAU_RLAR_ENABLE_Msk                (1UL /*<< SAU_RLAR_ENABLE_Pos*/)               /*!< SAU RLAR: ENABLE Mask */\r
+\r
+#endif /* defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) */\r
+\r
+/*@} end of group CMSIS_SAU */\r
+#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_CoreDebug       Core Debug Registers (CoreDebug)\r
+  \brief    Type definitions for the Core Debug Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Core Debug Register (CoreDebug).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t DHCSR;                  /*!< Offset: 0x000 (R/W)  Debug Halting Control and Status Register */\r
+  __OM  uint32_t DCRSR;                  /*!< Offset: 0x004 ( /W)  Debug Core Register Selector Register */\r
+  __IOM uint32_t DCRDR;                  /*!< Offset: 0x008 (R/W)  Debug Core Register Data Register */\r
+  __IOM uint32_t DEMCR;                  /*!< Offset: 0x00C (R/W)  Debug Exception and Monitor Control Register */\r
+        uint32_t RESERVED4[1U];\r
+  __IOM uint32_t DAUTHCTRL;              /*!< Offset: 0x014 (R/W)  Debug Authentication Control Register */\r
+  __IOM uint32_t DSCSR;                  /*!< Offset: 0x018 (R/W)  Debug Security Control and Status Register */\r
+} CoreDebug_Type;\r
+\r
+/* Debug Halting Control and Status Register Definitions */\r
+#define CoreDebug_DHCSR_DBGKEY_Pos         16U                                            /*!< CoreDebug DHCSR: DBGKEY Position */\r
+#define CoreDebug_DHCSR_DBGKEY_Msk         (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos)       /*!< CoreDebug DHCSR: DBGKEY Mask */\r
+\r
+#define CoreDebug_DHCSR_S_RESTART_ST_Pos   26U                                            /*!< CoreDebug DHCSR: S_RESTART_ST Position */\r
+#define CoreDebug_DHCSR_S_RESTART_ST_Msk   (1UL << CoreDebug_DHCSR_S_RESTART_ST_Pos)      /*!< CoreDebug DHCSR: S_RESTART_ST Mask */\r
+\r
+#define CoreDebug_DHCSR_S_RESET_ST_Pos     25U                                            /*!< CoreDebug DHCSR: S_RESET_ST Position */\r
+#define CoreDebug_DHCSR_S_RESET_ST_Msk     (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos)        /*!< CoreDebug DHCSR: S_RESET_ST Mask */\r
+\r
+#define CoreDebug_DHCSR_S_RETIRE_ST_Pos    24U                                            /*!< CoreDebug DHCSR: S_RETIRE_ST Position */\r
+#define CoreDebug_DHCSR_S_RETIRE_ST_Msk    (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos)       /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */\r
+\r
+#define CoreDebug_DHCSR_S_LOCKUP_Pos       19U                                            /*!< CoreDebug DHCSR: S_LOCKUP Position */\r
+#define CoreDebug_DHCSR_S_LOCKUP_Msk       (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos)          /*!< CoreDebug DHCSR: S_LOCKUP Mask */\r
+\r
+#define CoreDebug_DHCSR_S_SLEEP_Pos        18U                                            /*!< CoreDebug DHCSR: S_SLEEP Position */\r
+#define CoreDebug_DHCSR_S_SLEEP_Msk        (1UL << CoreDebug_DHCSR_S_SLEEP_Pos)           /*!< CoreDebug DHCSR: S_SLEEP Mask */\r
+\r
+#define CoreDebug_DHCSR_S_HALT_Pos         17U                                            /*!< CoreDebug DHCSR: S_HALT Position */\r
+#define CoreDebug_DHCSR_S_HALT_Msk         (1UL << CoreDebug_DHCSR_S_HALT_Pos)            /*!< CoreDebug DHCSR: S_HALT Mask */\r
+\r
+#define CoreDebug_DHCSR_S_REGRDY_Pos       16U                                            /*!< CoreDebug DHCSR: S_REGRDY Position */\r
+#define CoreDebug_DHCSR_S_REGRDY_Msk       (1UL << CoreDebug_DHCSR_S_REGRDY_Pos)          /*!< CoreDebug DHCSR: S_REGRDY Mask */\r
+\r
+#define CoreDebug_DHCSR_C_MASKINTS_Pos      3U                                            /*!< CoreDebug DHCSR: C_MASKINTS Position */\r
+#define CoreDebug_DHCSR_C_MASKINTS_Msk     (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos)        /*!< CoreDebug DHCSR: C_MASKINTS Mask */\r
+\r
+#define CoreDebug_DHCSR_C_STEP_Pos          2U                                            /*!< CoreDebug DHCSR: C_STEP Position */\r
+#define CoreDebug_DHCSR_C_STEP_Msk         (1UL << CoreDebug_DHCSR_C_STEP_Pos)            /*!< CoreDebug DHCSR: C_STEP Mask */\r
+\r
+#define CoreDebug_DHCSR_C_HALT_Pos          1U                                            /*!< CoreDebug DHCSR: C_HALT Position */\r
+#define CoreDebug_DHCSR_C_HALT_Msk         (1UL << CoreDebug_DHCSR_C_HALT_Pos)            /*!< CoreDebug DHCSR: C_HALT Mask */\r
+\r
+#define CoreDebug_DHCSR_C_DEBUGEN_Pos       0U                                            /*!< CoreDebug DHCSR: C_DEBUGEN Position */\r
+#define CoreDebug_DHCSR_C_DEBUGEN_Msk      (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/)     /*!< CoreDebug DHCSR: C_DEBUGEN Mask */\r
+\r
+/* Debug Core Register Selector Register Definitions */\r
+#define CoreDebug_DCRSR_REGWnR_Pos         16U                                            /*!< CoreDebug DCRSR: REGWnR Position */\r
+#define CoreDebug_DCRSR_REGWnR_Msk         (1UL << CoreDebug_DCRSR_REGWnR_Pos)            /*!< CoreDebug DCRSR: REGWnR Mask */\r
+\r
+#define CoreDebug_DCRSR_REGSEL_Pos          0U                                            /*!< CoreDebug DCRSR: REGSEL Position */\r
+#define CoreDebug_DCRSR_REGSEL_Msk         (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/)     /*!< CoreDebug DCRSR: REGSEL Mask */\r
+\r
+/* Debug Exception and Monitor Control Register */\r
+#define CoreDebug_DEMCR_DWTENA_Pos         24U                                            /*!< CoreDebug DEMCR: DWTENA Position */\r
+#define CoreDebug_DEMCR_DWTENA_Msk         (1UL << CoreDebug_DEMCR_DWTENA_Pos)            /*!< CoreDebug DEMCR: DWTENA Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_HARDERR_Pos     10U                                            /*!< CoreDebug DEMCR: VC_HARDERR Position */\r
+#define CoreDebug_DEMCR_VC_HARDERR_Msk     (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos)        /*!< CoreDebug DEMCR: VC_HARDERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_CORERESET_Pos    0U                                            /*!< CoreDebug DEMCR: VC_CORERESET Position */\r
+#define CoreDebug_DEMCR_VC_CORERESET_Msk   (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/)  /*!< CoreDebug DEMCR: VC_CORERESET Mask */\r
+\r
+/* Debug Authentication Control Register Definitions */\r
+#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos  3U                                            /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Position */\r
+#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos)    /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Mask */\r
+\r
+#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos  2U                                            /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Position */\r
+#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Msk (1UL << CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos)    /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Mask */\r
+\r
+#define CoreDebug_DAUTHCTRL_INTSPIDEN_Pos   1U                                            /*!< CoreDebug DAUTHCTRL: INTSPIDEN Position */\r
+#define CoreDebug_DAUTHCTRL_INTSPIDEN_Msk  (1UL << CoreDebug_DAUTHCTRL_INTSPIDEN_Pos)     /*!< CoreDebug DAUTHCTRL: INTSPIDEN Mask */\r
+\r
+#define CoreDebug_DAUTHCTRL_SPIDENSEL_Pos   0U                                            /*!< CoreDebug DAUTHCTRL: SPIDENSEL Position */\r
+#define CoreDebug_DAUTHCTRL_SPIDENSEL_Msk  (1UL /*<< CoreDebug_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< CoreDebug DAUTHCTRL: SPIDENSEL Mask */\r
+\r
+/* Debug Security Control and Status Register Definitions */\r
+#define CoreDebug_DSCSR_CDS_Pos            16U                                            /*!< CoreDebug DSCSR: CDS Position */\r
+#define CoreDebug_DSCSR_CDS_Msk            (1UL << CoreDebug_DSCSR_CDS_Pos)               /*!< CoreDebug DSCSR: CDS Mask */\r
+\r
+#define CoreDebug_DSCSR_SBRSEL_Pos          1U                                            /*!< CoreDebug DSCSR: SBRSEL Position */\r
+#define CoreDebug_DSCSR_SBRSEL_Msk         (1UL << CoreDebug_DSCSR_SBRSEL_Pos)            /*!< CoreDebug DSCSR: SBRSEL Mask */\r
+\r
+#define CoreDebug_DSCSR_SBRSELEN_Pos        0U                                            /*!< CoreDebug DSCSR: SBRSELEN Position */\r
+#define CoreDebug_DSCSR_SBRSELEN_Msk       (1UL /*<< CoreDebug_DSCSR_SBRSELEN_Pos*/)      /*!< CoreDebug DSCSR: SBRSELEN Mask */\r
+\r
+/*@} end of group CMSIS_CoreDebug */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_bitfield     Core register bit field macros\r
+  \brief      Macros for use with bit field definitions (xxx_Pos, xxx_Msk).\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   Mask and shift a bit field value for use in a register bit range.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of the bit field. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted value.\r
+*/\r
+#define _VAL2FLD(field, value)    (((uint32_t)(value) << field ## _Pos) & field ## _Msk)\r
+\r
+/**\r
+  \brief     Mask and shift a register value to extract a bit filed value.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of register. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted bit field value.\r
+*/\r
+#define _FLD2VAL(field, value)    (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)\r
+\r
+/*@} end of group CMSIS_core_bitfield */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_base     Core Definitions\r
+  \brief      Definitions for base addresses, unions, and structures.\r
+  @{\r
+ */\r
+\r
+/* Memory mapping of Core Hardware */\r
+  #define SCS_BASE            (0xE000E000UL)                             /*!< System Control Space Base Address */\r
+  #define DWT_BASE            (0xE0001000UL)                             /*!< DWT Base Address */\r
+  #define TPI_BASE            (0xE0040000UL)                             /*!< TPI Base Address */\r
+  #define CoreDebug_BASE      (0xE000EDF0UL)                             /*!< Core Debug Base Address */\r
+  #define SysTick_BASE        (SCS_BASE +  0x0010UL)                     /*!< SysTick Base Address */\r
+  #define NVIC_BASE           (SCS_BASE +  0x0100UL)                     /*!< NVIC Base Address */\r
+  #define SCB_BASE            (SCS_BASE +  0x0D00UL)                     /*!< System Control Block Base Address */\r
+\r
+\r
+  #define SCB                 ((SCB_Type       *)     SCB_BASE         ) /*!< SCB configuration struct */\r
+  #define SysTick             ((SysTick_Type   *)     SysTick_BASE     ) /*!< SysTick configuration struct */\r
+  #define NVIC                ((NVIC_Type      *)     NVIC_BASE        ) /*!< NVIC configuration struct */\r
+  #define DWT                 ((DWT_Type       *)     DWT_BASE         ) /*!< DWT configuration struct */\r
+  #define TPI                 ((TPI_Type       *)     TPI_BASE         ) /*!< TPI configuration struct */\r
+  #define CoreDebug           ((CoreDebug_Type *)     CoreDebug_BASE   ) /*!< Core Debug configuration struct */\r
+\r
+  #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+    #define MPU_BASE          (SCS_BASE +  0x0D90UL)                     /*!< Memory Protection Unit */\r
+    #define MPU               ((MPU_Type       *)     MPU_BASE         ) /*!< Memory Protection Unit */\r
+  #endif\r
+\r
+  #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+    #define SAU_BASE          (SCS_BASE +  0x0DD0UL)                     /*!< Security Attribution Unit */\r
+    #define SAU               ((SAU_Type       *)     SAU_BASE         ) /*!< Security Attribution Unit */\r
+  #endif\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+  #define SCS_BASE_NS         (0xE002E000UL)                             /*!< System Control Space Base Address (non-secure address space) */\r
+  #define CoreDebug_BASE_NS   (0xE002EDF0UL)                             /*!< Core Debug Base Address           (non-secure address space) */\r
+  #define SysTick_BASE_NS     (SCS_BASE_NS +  0x0010UL)                  /*!< SysTick Base Address              (non-secure address space) */\r
+  #define NVIC_BASE_NS        (SCS_BASE_NS +  0x0100UL)                  /*!< NVIC Base Address                 (non-secure address space) */\r
+  #define SCB_BASE_NS         (SCS_BASE_NS +  0x0D00UL)                  /*!< System Control Block Base Address (non-secure address space) */\r
+\r
+  #define SCB_NS              ((SCB_Type       *)     SCB_BASE_NS      ) /*!< SCB configuration struct          (non-secure address space) */\r
+  #define SysTick_NS          ((SysTick_Type   *)     SysTick_BASE_NS  ) /*!< SysTick configuration struct      (non-secure address space) */\r
+  #define NVIC_NS             ((NVIC_Type      *)     NVIC_BASE_NS     ) /*!< NVIC configuration struct         (non-secure address space) */\r
+  #define CoreDebug_NS        ((CoreDebug_Type *)     CoreDebug_BASE_NS) /*!< Core Debug configuration struct   (non-secure address space) */\r
+\r
+  #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+    #define MPU_BASE_NS       (SCS_BASE_NS +  0x0D90UL)                  /*!< Memory Protection Unit            (non-secure address space) */\r
+    #define MPU_NS            ((MPU_Type       *)     MPU_BASE_NS      ) /*!< Memory Protection Unit            (non-secure address space) */\r
+  #endif\r
+\r
+#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */\r
+/*@} */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                Hardware Abstraction Layer\r
+  Core Function Interface contains:\r
+  - Core NVIC Functions\r
+  - Core SysTick Functions\r
+  - Core Register Access Functions\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference\r
+*/\r
+\r
+\r
+\r
+/* ##########################   NVIC functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_NVICFunctions NVIC Functions\r
+  \brief    Functions that manage interrupts and exceptions via the NVIC.\r
+  @{\r
+ */\r
+\r
+#ifdef CMSIS_NVIC_VIRTUAL\r
+  #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+    #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"\r
+  #endif\r
+  #include CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+#else\r
+/*#define NVIC_SetPriorityGrouping    __NVIC_SetPriorityGrouping   not available for Cortex-M23 */\r
+/*#define NVIC_GetPriorityGrouping    __NVIC_GetPriorityGrouping   not available for Cortex-M23 */\r
+  #define NVIC_EnableIRQ              __NVIC_EnableIRQ\r
+  #define NVIC_GetEnableIRQ           __NVIC_GetEnableIRQ\r
+  #define NVIC_DisableIRQ             __NVIC_DisableIRQ\r
+  #define NVIC_GetPendingIRQ          __NVIC_GetPendingIRQ\r
+  #define NVIC_SetPendingIRQ          __NVIC_SetPendingIRQ\r
+  #define NVIC_ClearPendingIRQ        __NVIC_ClearPendingIRQ\r
+  #define NVIC_GetActive              __NVIC_GetActive\r
+  #define NVIC_SetPriority            __NVIC_SetPriority\r
+  #define NVIC_GetPriority            __NVIC_GetPriority\r
+  #define NVIC_SystemReset            __NVIC_SystemReset\r
+#endif /* CMSIS_NVIC_VIRTUAL */\r
+\r
+#ifdef CMSIS_VECTAB_VIRTUAL\r
+  #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+    #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"\r
+  #endif\r
+  #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+#else\r
+  #define NVIC_SetVector              __NVIC_SetVector\r
+  #define NVIC_GetVector              __NVIC_GetVector\r
+#endif  /* (CMSIS_VECTAB_VIRTUAL) */\r
+\r
+#define NVIC_USER_IRQ_OFFSET          16\r
+\r
+\r
+/* Special LR values for Secure/Non-Secure call handling and exception handling                                               */\r
+\r
+/* Function Return Payload (from ARMv8-M Architecture Reference Manual) LR value on entry from Secure BLXNS                   */ \r
+#define FNC_RETURN                 (0xFEFFFFFFUL)     /* bit [0] ignored when processing a branch                             */\r
+\r
+/* The following EXC_RETURN mask values are used to evaluate the LR on exception entry */\r
+#define EXC_RETURN_PREFIX          (0xFF000000UL)     /* bits [31:24] set to indicate an EXC_RETURN value                     */\r
+#define EXC_RETURN_S               (0x00000040UL)     /* bit [6] stack used to push registers: 0=Non-secure 1=Secure          */\r
+#define EXC_RETURN_DCRS            (0x00000020UL)     /* bit [5] stacking rules for called registers: 0=skipped 1=saved       */\r
+#define EXC_RETURN_FTYPE           (0x00000010UL)     /* bit [4] allocate stack for floating-point context: 0=done 1=skipped  */\r
+#define EXC_RETURN_MODE            (0x00000008UL)     /* bit [3] processor mode for return: 0=Handler mode 1=Thread mode      */\r
+#define EXC_RETURN_SPSEL           (0x00000002UL)     /* bit [1] stack pointer used to restore context: 0=MSP 1=PSP           */\r
+#define EXC_RETURN_ES              (0x00000001UL)     /* bit [0] security state exception was taken to: 0=Non-secure 1=Secure */\r
+\r
+/* Integrity Signature (from ARMv8-M Architecture Reference Manual) for exception context stacking                            */\r
+#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)  /* Value for processors with floating-point extension:                  */\r
+#define EXC_INTEGRITY_SIGNATURE     (0xFEFA125AUL)     /* bit [0] SFTC must match LR bit[4] EXC_RETURN_FTYPE                   */\r
+#else \r
+#define EXC_INTEGRITY_SIGNATURE     (0xFEFA125BUL)     /* Value for processors without floating-point extension                */\r
+#endif\r
+\r
+       \r
+/* Interrupt Priorities are WORD accessible only under Armv6-M                  */\r
+/* The following MACROS handle generation of the register offset and byte masks */\r
+#define _BIT_SHIFT(IRQn)         (  ((((uint32_t)(int32_t)(IRQn))         )      &  0x03UL) * 8UL)\r
+#define _SHP_IDX(IRQn)           ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >>    2UL)      )\r
+#define _IP_IDX(IRQn)            (   (((uint32_t)(int32_t)(IRQn))                >>    2UL)      )\r
+\r
+#define __NVIC_SetPriorityGrouping(X) (void)(X)\r
+#define __NVIC_GetPriorityGrouping()  (0U)\r
+\r
+/**\r
+  \brief   Enable Interrupt\r
+  \details Enables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Enable status\r
+  \details Returns a device specific interrupt enable status from the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt is not enabled.\r
+  \return             1  Interrupt is enabled.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Disable Interrupt\r
+  \details Disables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+    __DSB();\r
+    __ISB();\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Pending Interrupt\r
+  \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not pending.\r
+  \return             1  Interrupt status is pending.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Pending Interrupt\r
+  \details Sets the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Clear Pending Interrupt\r
+  \details Clears the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Active Interrupt\r
+  \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not active.\r
+  \return             1  Interrupt status is active.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+/**\r
+  \brief   Get Interrupt Target State\r
+  \details Reads the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  if interrupt is assigned to Secure\r
+  \return             1  if interrupt is assigned to Non Secure\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t NVIC_GetTargetState(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Target State\r
+  \details Sets the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  if interrupt is assigned to Secure\r
+                      1  if interrupt is assigned to Non Secure\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t NVIC_SetTargetState(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] |=  ((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)));\r
+    return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Clear Interrupt Target State\r
+  \details Clears the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  if interrupt is assigned to Secure\r
+                      1  if interrupt is assigned to Non Secure\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t NVIC_ClearTargetState(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)));\r
+    return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Priority\r
+  \details Sets the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]      IRQn  Interrupt number.\r
+  \param [in]  priority  Priority to set.\r
+  \note    The priority cannot be set for every processor exception.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->IPR[_IP_IDX(IRQn)]  = ((uint32_t)(NVIC->IPR[_IP_IDX(IRQn)]  & ~(0xFFUL << _BIT_SHIFT(IRQn))) |\r
+       (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));\r
+  }\r
+  else\r
+  {\r
+    SCB->SHPR[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHPR[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |\r
+       (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Priority\r
+  \details Reads the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn  Interrupt number.\r
+  \return             Interrupt Priority.\r
+                      Value is aligned automatically to the implemented priority bits of the microcontroller.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)\r
+{\r
+\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->IPR[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+  else\r
+  {\r
+    return((uint32_t)(((SCB->SHPR[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Encode Priority\r
+  \details Encodes the priority for an interrupt with the given priority group,\r
+           preemptive priority value, and subpriority value.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.\r
+  \param [in]     PriorityGroup  Used priority group.\r
+  \param [in]   PreemptPriority  Preemptive priority value (starting from 0).\r
+  \param [in]       SubPriority  Subpriority value (starting from 0).\r
+  \return                        Encoded priority. Value can be used in the function \ref NVIC_SetPriority().\r
+ */\r
+__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);\r
+  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));\r
+\r
+  return (\r
+           ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |\r
+           ((SubPriority     & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL)))\r
+         );\r
+}\r
+\r
+\r
+/**\r
+  \brief   Decode Priority\r
+  \details Decodes an interrupt priority value with a given priority group to\r
+           preemptive priority value and subpriority value.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.\r
+  \param [in]         Priority   Priority value, which can be retrieved with the function \ref NVIC_GetPriority().\r
+  \param [in]     PriorityGroup  Used priority group.\r
+  \param [out] pPreemptPriority  Preemptive priority value (starting from 0).\r
+  \param [out]     pSubPriority  Subpriority value (starting from 0).\r
+ */\r
+__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);\r
+  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));\r
+\r
+  *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);\r
+  *pSubPriority     = (Priority                   ) & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Vector\r
+  \details Sets an interrupt vector in SRAM based interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+           VTOR must been relocated to SRAM before.\r
+           If VTOR is not present address 0 must be mapped to SRAM.\r
+  \param [in]   IRQn      Interrupt number\r
+  \param [in]   vector    Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)\r
+{\r
+#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)\r
+  uint32_t *vectors = (uint32_t *)SCB->VTOR;\r
+#else\r
+  uint32_t *vectors = (uint32_t *)0x0U;\r
+#endif\r
+  vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Vector\r
+  \details Reads an interrupt vector from interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn      Interrupt number.\r
+  \return                 Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)\r
+{\r
+#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)\r
+  uint32_t *vectors = (uint32_t *)SCB->VTOR;\r
+#else\r
+  uint32_t *vectors = (uint32_t *)0x0U;\r
+#endif\r
+  return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];\r
+}\r
+\r
+\r
+/**\r
+  \brief   System Reset\r
+  \details Initiates a system reset request to reset the MCU.\r
+ */\r
+__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)\r
+{\r
+  __DSB();                                                          /* Ensure all outstanding memory accesses included\r
+                                                                       buffered write are completed before reset */\r
+  SCB->AIRCR  = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |\r
+                 SCB_AIRCR_SYSRESETREQ_Msk);\r
+  __DSB();                                                          /* Ensure completion of memory access */\r
+\r
+  for(;;)                                                           /* wait until reset */\r
+  {\r
+    __NOP();\r
+  }\r
+}\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+/**\r
+  \brief   Enable Interrupt (non-secure)\r
+  \details Enables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void TZ_NVIC_EnableIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Enable status (non-secure)\r
+  \details Returns a device specific interrupt enable status from the non-secure NVIC interrupt controller when in secure state.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt is not enabled.\r
+  \return             1  Interrupt is enabled.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t TZ_NVIC_GetEnableIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Disable Interrupt (non-secure)\r
+  \details Disables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void TZ_NVIC_DisableIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC_NS->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Pending Interrupt (non-secure)\r
+  \details Reads the NVIC pending register in the non-secure NVIC when in secure state and returns the pending bit for the specified device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not pending.\r
+  \return             1  Interrupt status is pending.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t TZ_NVIC_GetPendingIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Pending Interrupt (non-secure)\r
+  \details Sets the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void TZ_NVIC_SetPendingIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Clear Pending Interrupt (non-secure)\r
+  \details Clears the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void TZ_NVIC_ClearPendingIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC_NS->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Active Interrupt (non-secure)\r
+  \details Reads the active register in non-secure NVIC when in secure state and returns the active bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not active.\r
+  \return             1  Interrupt status is active.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t TZ_NVIC_GetActive_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC_NS->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Priority (non-secure)\r
+  \details Sets the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]      IRQn  Interrupt number.\r
+  \param [in]  priority  Priority to set.\r
+  \note    The priority cannot be set for every non-secure processor exception.\r
+ */\r
+__STATIC_INLINE void TZ_NVIC_SetPriority_NS(IRQn_Type IRQn, uint32_t priority)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC_NS->IPR[_IP_IDX(IRQn)]  = ((uint32_t)(NVIC_NS->IPR[_IP_IDX(IRQn)]  & ~(0xFFUL << _BIT_SHIFT(IRQn))) |\r
+       (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));\r
+  }\r
+  else\r
+  {\r
+    SCB_NS->SHPR[_SHP_IDX(IRQn)] = ((uint32_t)(SCB_NS->SHPR[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |\r
+       (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Priority (non-secure)\r
+  \details Reads the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn  Interrupt number.\r
+  \return             Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller.\r
+ */\r
+__STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn)\r
+{\r
+\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC_NS->IPR[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+  else\r
+  {\r
+    return((uint32_t)(((SCB_NS->SHPR[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+}\r
+#endif /*  defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */\r
+\r
+/*@} end of CMSIS_Core_NVICFunctions */\r
+\r
+/* ##########################  MPU functions  #################################### */\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+\r
+#include "mpu_armv8.h"\r
+\r
+#endif\r
+\r
+/* ##########################  FPU functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_FpuFunctions FPU Functions\r
+  \brief    Function that provides FPU type.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   get FPU type\r
+  \details returns the FPU type\r
+  \returns\r
+   - \b  0: No FPU\r
+   - \b  1: Single precision FPU\r
+   - \b  2: Double + Single precision FPU\r
+ */\r
+__STATIC_INLINE uint32_t SCB_GetFPUType(void)\r
+{\r
+    return 0U;           /* No FPU */\r
+}\r
+\r
+\r
+/*@} end of CMSIS_Core_FpuFunctions */\r
+\r
+\r
+\r
+/* ##########################   SAU functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_SAUFunctions SAU Functions\r
+  \brief    Functions that configure the SAU.\r
+  @{\r
+ */\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+\r
+/**\r
+  \brief   Enable SAU\r
+  \details Enables the Security Attribution Unit (SAU).\r
+ */\r
+__STATIC_INLINE void TZ_SAU_Enable(void)\r
+{\r
+    SAU->CTRL |=  (SAU_CTRL_ENABLE_Msk);\r
+}\r
+\r
+\r
+\r
+/**\r
+  \brief   Disable SAU\r
+  \details Disables the Security Attribution Unit (SAU).\r
+ */\r
+__STATIC_INLINE void TZ_SAU_Disable(void)\r
+{\r
+    SAU->CTRL &= ~(SAU_CTRL_ENABLE_Msk);\r
+}\r
+\r
+#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */\r
+\r
+/*@} end of CMSIS_Core_SAUFunctions */\r
+\r
+\r
+\r
+\r
+/* ##################################    SysTick function  ############################################ */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_SysTickFunctions SysTick Functions\r
+  \brief    Functions that configure the System.\r
+  @{\r
+ */\r
+\r
+#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)\r
+\r
+/**\r
+  \brief   System Tick Configuration\r
+  \details Initializes the System Timer and its interrupt, and starts the System Tick Timer.\r
+           Counter is in free running mode to generate periodic interrupts.\r
+  \param [in]  ticks  Number of ticks between two interrupts.\r
+  \return          0  Function succeeded.\r
+  \return          1  Function failed.\r
+  \note    When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the\r
+           function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>\r
+           must contain a vendor-specific implementation of this function.\r
+ */\r
+__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)\r
+{\r
+  if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)\r
+  {\r
+    return (1UL);                                                   /* Reload value impossible */\r
+  }\r
+\r
+  SysTick->LOAD  = (uint32_t)(ticks - 1UL);                         /* set reload register */\r
+  NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */\r
+  SysTick->VAL   = 0UL;                                             /* Load the SysTick Counter Value */\r
+  SysTick->CTRL  = SysTick_CTRL_CLKSOURCE_Msk |\r
+                   SysTick_CTRL_TICKINT_Msk   |\r
+                   SysTick_CTRL_ENABLE_Msk;                         /* Enable SysTick IRQ and SysTick Timer */\r
+  return (0UL);                                                     /* Function successful */\r
+}\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+/**\r
+  \brief   System Tick Configuration (non-secure)\r
+  \details Initializes the non-secure System Timer and its interrupt when in secure state, and starts the System Tick Timer.\r
+           Counter is in free running mode to generate periodic interrupts.\r
+  \param [in]  ticks  Number of ticks between two interrupts.\r
+  \return          0  Function succeeded.\r
+  \return          1  Function failed.\r
+  \note    When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the\r
+           function <b>TZ_SysTick_Config_NS</b> is not included. In this case, the file <b><i>device</i>.h</b>\r
+           must contain a vendor-specific implementation of this function.\r
+\r
+ */\r
+__STATIC_INLINE uint32_t TZ_SysTick_Config_NS(uint32_t ticks)\r
+{\r
+  if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)\r
+  {\r
+    return (1UL);                                                         /* Reload value impossible */\r
+  }\r
+\r
+  SysTick_NS->LOAD  = (uint32_t)(ticks - 1UL);                            /* set reload register */\r
+  TZ_NVIC_SetPriority_NS (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */\r
+  SysTick_NS->VAL   = 0UL;                                                /* Load the SysTick Counter Value */\r
+  SysTick_NS->CTRL  = SysTick_CTRL_CLKSOURCE_Msk |\r
+                      SysTick_CTRL_TICKINT_Msk   |\r
+                      SysTick_CTRL_ENABLE_Msk;                            /* Enable SysTick IRQ and SysTick Timer */\r
+  return (0UL);                                                           /* Function successful */\r
+}\r
+#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */\r
+\r
+#endif\r
+\r
+/*@} end of CMSIS_Core_SysTickFunctions */\r
+\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_CM23_H_DEPENDANT */\r
+\r
+#endif /* __CMSIS_GENERIC */\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm3.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm3.h
new file mode 100644 (file)
index 0000000..b0dfbd3
--- /dev/null
@@ -0,0 +1,1941 @@
+/**************************************************************************//**\r
+ * @file     core_cm3.h\r
+ * @brief    CMSIS Cortex-M3 Core Peripheral Access Layer Header File\r
+ * @version  V5.0.8\r
+ * @date     04. June 2018\r
+ ******************************************************************************/\r
+/*\r
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.\r
+ *\r
+ * SPDX-License-Identifier: Apache-2.0\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the License); you may\r
+ * not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#if   defined ( __ICCARM__ )\r
+  #pragma system_include         /* treat file as system include file for MISRA check */\r
+#elif defined (__clang__)\r
+  #pragma clang system_header   /* treat file as system include file */\r
+#endif\r
+\r
+#ifndef __CORE_CM3_H_GENERIC\r
+#define __CORE_CM3_H_GENERIC\r
+\r
+#include <stdint.h>\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/**\r
+  \page CMSIS_MISRA_Exceptions  MISRA-C:2004 Compliance Exceptions\r
+  CMSIS violates the following MISRA-C:2004 rules:\r
+\r
+   \li Required Rule 8.5, object/function definition in header file.<br>\r
+     Function definitions in header files are used to allow 'inlining'.\r
+\r
+   \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>\r
+     Unions are used for effective representation of core registers.\r
+\r
+   \li Advisory Rule 19.7, Function-like macro defined.<br>\r
+     Function-like macros are used to allow more efficient code.\r
+ */\r
+\r
+\r
+/*******************************************************************************\r
+ *                 CMSIS definitions\r
+ ******************************************************************************/\r
+/**\r
+  \ingroup Cortex_M3\r
+  @{\r
+ */\r
+\r
+#include "cmsis_version.h"\r
+\r
+/*  CMSIS CM3 definitions */\r
+#define __CM3_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)              /*!< \deprecated [31:16] CMSIS HAL main version */\r
+#define __CM3_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)               /*!< \deprecated [15:0]  CMSIS HAL sub version */\r
+#define __CM3_CMSIS_VERSION       ((__CM3_CMSIS_VERSION_MAIN << 16U) | \\r
+                                    __CM3_CMSIS_VERSION_SUB           )  /*!< \deprecated CMSIS HAL version number */\r
+\r
+#define __CORTEX_M                (3U)                                   /*!< Cortex-M Core */\r
+\r
+/** __FPU_USED indicates whether an FPU is used or not.\r
+    This core does not support an FPU at all\r
+*/\r
+#define __FPU_USED       0U\r
+\r
+#if defined ( __CC_ARM )\r
+  #if defined __TARGET_FPU_VFP\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)\r
+  #if defined __ARM_PCS_VFP\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __GNUC__ )\r
+  #if defined (__VFP_FP__) && !defined(__SOFTFP__)\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __ICCARM__ )\r
+  #if defined __ARMVFP__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __TI_ARM__ )\r
+  #if defined __TI_VFP_SUPPORT__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __TASKING__ )\r
+  #if defined __FPU_VFP__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __CSMC__ )\r
+  #if ( __CSMC__ & 0x400U)\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#endif\r
+\r
+#include "cmsis_compiler.h"               /* CMSIS compiler specific defines */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_CM3_H_GENERIC */\r
+\r
+#ifndef __CMSIS_GENERIC\r
+\r
+#ifndef __CORE_CM3_H_DEPENDANT\r
+#define __CORE_CM3_H_DEPENDANT\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/* check device defines and use defaults */\r
+#if defined __CHECK_DEVICE_DEFINES\r
+  #ifndef __CM3_REV\r
+    #define __CM3_REV               0x0200U\r
+    #warning "__CM3_REV not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __MPU_PRESENT\r
+    #define __MPU_PRESENT             0U\r
+    #warning "__MPU_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __NVIC_PRIO_BITS\r
+    #define __NVIC_PRIO_BITS          3U\r
+    #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __Vendor_SysTickConfig\r
+    #define __Vendor_SysTickConfig    0U\r
+    #warning "__Vendor_SysTickConfig not defined in device header file; using default!"\r
+  #endif\r
+#endif\r
+\r
+/* IO definitions (access restrictions to peripheral registers) */\r
+/**\r
+    \defgroup CMSIS_glob_defs CMSIS Global Defines\r
+\r
+    <strong>IO Type Qualifiers</strong> are used\r
+    \li to specify the access to peripheral variables.\r
+    \li for automatic generation of peripheral register debug information.\r
+*/\r
+#ifdef __cplusplus\r
+  #define   __I     volatile             /*!< Defines 'read only' permissions */\r
+#else\r
+  #define   __I     volatile const       /*!< Defines 'read only' permissions */\r
+#endif\r
+#define     __O     volatile             /*!< Defines 'write only' permissions */\r
+#define     __IO    volatile             /*!< Defines 'read / write' permissions */\r
+\r
+/* following defines should be used for structure members */\r
+#define     __IM     volatile const      /*! Defines 'read only' structure member permissions */\r
+#define     __OM     volatile            /*! Defines 'write only' structure member permissions */\r
+#define     __IOM    volatile            /*! Defines 'read / write' structure member permissions */\r
+\r
+/*@} end of group Cortex_M3 */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                 Register Abstraction\r
+  Core Register contain:\r
+  - Core Register\r
+  - Core NVIC Register\r
+  - Core SCB Register\r
+  - Core SysTick Register\r
+  - Core Debug Register\r
+  - Core MPU Register\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_core_register Defines and Type Definitions\r
+  \brief Type definitions and defines for Cortex-M processor based devices.\r
+*/\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_CORE  Status and Control Registers\r
+  \brief      Core Register type definitions.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Union type to access the Application Program Status Register (APSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t _reserved0:27;              /*!< bit:  0..26  Reserved */\r
+    uint32_t Q:1;                        /*!< bit:     27  Saturation condition flag */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} APSR_Type;\r
+\r
+/* APSR Register Definitions */\r
+#define APSR_N_Pos                         31U                                            /*!< APSR: N Position */\r
+#define APSR_N_Msk                         (1UL << APSR_N_Pos)                            /*!< APSR: N Mask */\r
+\r
+#define APSR_Z_Pos                         30U                                            /*!< APSR: Z Position */\r
+#define APSR_Z_Msk                         (1UL << APSR_Z_Pos)                            /*!< APSR: Z Mask */\r
+\r
+#define APSR_C_Pos                         29U                                            /*!< APSR: C Position */\r
+#define APSR_C_Msk                         (1UL << APSR_C_Pos)                            /*!< APSR: C Mask */\r
+\r
+#define APSR_V_Pos                         28U                                            /*!< APSR: V Position */\r
+#define APSR_V_Msk                         (1UL << APSR_V_Pos)                            /*!< APSR: V Mask */\r
+\r
+#define APSR_Q_Pos                         27U                                            /*!< APSR: Q Position */\r
+#define APSR_Q_Msk                         (1UL << APSR_Q_Pos)                            /*!< APSR: Q Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Interrupt Program Status Register (IPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:23;              /*!< bit:  9..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} IPSR_Type;\r
+\r
+/* IPSR Register Definitions */\r
+#define IPSR_ISR_Pos                        0U                                            /*!< IPSR: ISR Position */\r
+#define IPSR_ISR_Msk                       (0x1FFUL /*<< IPSR_ISR_Pos*/)                  /*!< IPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Special-Purpose Program Status Registers (xPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:1;               /*!< bit:      9  Reserved */\r
+    uint32_t ICI_IT_1:6;                 /*!< bit: 10..15  ICI/IT part 1 */\r
+    uint32_t _reserved1:8;               /*!< bit: 16..23  Reserved */\r
+    uint32_t T:1;                        /*!< bit:     24  Thumb bit */\r
+    uint32_t ICI_IT_2:2;                 /*!< bit: 25..26  ICI/IT part 2 */\r
+    uint32_t Q:1;                        /*!< bit:     27  Saturation condition flag */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} xPSR_Type;\r
+\r
+/* xPSR Register Definitions */\r
+#define xPSR_N_Pos                         31U                                            /*!< xPSR: N Position */\r
+#define xPSR_N_Msk                         (1UL << xPSR_N_Pos)                            /*!< xPSR: N Mask */\r
+\r
+#define xPSR_Z_Pos                         30U                                            /*!< xPSR: Z Position */\r
+#define xPSR_Z_Msk                         (1UL << xPSR_Z_Pos)                            /*!< xPSR: Z Mask */\r
+\r
+#define xPSR_C_Pos                         29U                                            /*!< xPSR: C Position */\r
+#define xPSR_C_Msk                         (1UL << xPSR_C_Pos)                            /*!< xPSR: C Mask */\r
+\r
+#define xPSR_V_Pos                         28U                                            /*!< xPSR: V Position */\r
+#define xPSR_V_Msk                         (1UL << xPSR_V_Pos)                            /*!< xPSR: V Mask */\r
+\r
+#define xPSR_Q_Pos                         27U                                            /*!< xPSR: Q Position */\r
+#define xPSR_Q_Msk                         (1UL << xPSR_Q_Pos)                            /*!< xPSR: Q Mask */\r
+\r
+#define xPSR_ICI_IT_2_Pos                  25U                                            /*!< xPSR: ICI/IT part 2 Position */\r
+#define xPSR_ICI_IT_2_Msk                  (3UL << xPSR_ICI_IT_2_Pos)                     /*!< xPSR: ICI/IT part 2 Mask */\r
+\r
+#define xPSR_T_Pos                         24U                                            /*!< xPSR: T Position */\r
+#define xPSR_T_Msk                         (1UL << xPSR_T_Pos)                            /*!< xPSR: T Mask */\r
+\r
+#define xPSR_ICI_IT_1_Pos                  10U                                            /*!< xPSR: ICI/IT part 1 Position */\r
+#define xPSR_ICI_IT_1_Msk                  (0x3FUL << xPSR_ICI_IT_1_Pos)                  /*!< xPSR: ICI/IT part 1 Mask */\r
+\r
+#define xPSR_ISR_Pos                        0U                                            /*!< xPSR: ISR Position */\r
+#define xPSR_ISR_Msk                       (0x1FFUL /*<< xPSR_ISR_Pos*/)                  /*!< xPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Control Registers (CONTROL).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t nPRIV:1;                    /*!< bit:      0  Execution privilege in Thread mode */\r
+    uint32_t SPSEL:1;                    /*!< bit:      1  Stack to be used */\r
+    uint32_t _reserved1:30;              /*!< bit:  2..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} CONTROL_Type;\r
+\r
+/* CONTROL Register Definitions */\r
+#define CONTROL_SPSEL_Pos                   1U                                            /*!< CONTROL: SPSEL Position */\r
+#define CONTROL_SPSEL_Msk                  (1UL << CONTROL_SPSEL_Pos)                     /*!< CONTROL: SPSEL Mask */\r
+\r
+#define CONTROL_nPRIV_Pos                   0U                                            /*!< CONTROL: nPRIV Position */\r
+#define CONTROL_nPRIV_Msk                  (1UL /*<< CONTROL_nPRIV_Pos*/)                 /*!< CONTROL: nPRIV Mask */\r
+\r
+/*@} end of group CMSIS_CORE */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_NVIC  Nested Vectored Interrupt Controller (NVIC)\r
+  \brief      Type definitions for the NVIC Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Nested Vectored Interrupt Controller (NVIC).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t ISER[8U];               /*!< Offset: 0x000 (R/W)  Interrupt Set Enable Register */\r
+        uint32_t RESERVED0[24U];\r
+  __IOM uint32_t ICER[8U];               /*!< Offset: 0x080 (R/W)  Interrupt Clear Enable Register */\r
+        uint32_t RSERVED1[24U];\r
+  __IOM uint32_t ISPR[8U];               /*!< Offset: 0x100 (R/W)  Interrupt Set Pending Register */\r
+        uint32_t RESERVED2[24U];\r
+  __IOM uint32_t ICPR[8U];               /*!< Offset: 0x180 (R/W)  Interrupt Clear Pending Register */\r
+        uint32_t RESERVED3[24U];\r
+  __IOM uint32_t IABR[8U];               /*!< Offset: 0x200 (R/W)  Interrupt Active bit Register */\r
+        uint32_t RESERVED4[56U];\r
+  __IOM uint8_t  IP[240U];               /*!< Offset: 0x300 (R/W)  Interrupt Priority Register (8Bit wide) */\r
+        uint32_t RESERVED5[644U];\r
+  __OM  uint32_t STIR;                   /*!< Offset: 0xE00 ( /W)  Software Trigger Interrupt Register */\r
+}  NVIC_Type;\r
+\r
+/* Software Triggered Interrupt Register Definitions */\r
+#define NVIC_STIR_INTID_Pos                 0U                                         /*!< STIR: INTLINESNUM Position */\r
+#define NVIC_STIR_INTID_Msk                (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/)        /*!< STIR: INTLINESNUM Mask */\r
+\r
+/*@} end of group CMSIS_NVIC */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SCB     System Control Block (SCB)\r
+  \brief    Type definitions for the System Control Block Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Control Block (SCB).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t CPUID;                  /*!< Offset: 0x000 (R/ )  CPUID Base Register */\r
+  __IOM uint32_t ICSR;                   /*!< Offset: 0x004 (R/W)  Interrupt Control and State Register */\r
+  __IOM uint32_t VTOR;                   /*!< Offset: 0x008 (R/W)  Vector Table Offset Register */\r
+  __IOM uint32_t AIRCR;                  /*!< Offset: 0x00C (R/W)  Application Interrupt and Reset Control Register */\r
+  __IOM uint32_t SCR;                    /*!< Offset: 0x010 (R/W)  System Control Register */\r
+  __IOM uint32_t CCR;                    /*!< Offset: 0x014 (R/W)  Configuration Control Register */\r
+  __IOM uint8_t  SHP[12U];               /*!< Offset: 0x018 (R/W)  System Handlers Priority Registers (4-7, 8-11, 12-15) */\r
+  __IOM uint32_t SHCSR;                  /*!< Offset: 0x024 (R/W)  System Handler Control and State Register */\r
+  __IOM uint32_t CFSR;                   /*!< Offset: 0x028 (R/W)  Configurable Fault Status Register */\r
+  __IOM uint32_t HFSR;                   /*!< Offset: 0x02C (R/W)  HardFault Status Register */\r
+  __IOM uint32_t DFSR;                   /*!< Offset: 0x030 (R/W)  Debug Fault Status Register */\r
+  __IOM uint32_t MMFAR;                  /*!< Offset: 0x034 (R/W)  MemManage Fault Address Register */\r
+  __IOM uint32_t BFAR;                   /*!< Offset: 0x038 (R/W)  BusFault Address Register */\r
+  __IOM uint32_t AFSR;                   /*!< Offset: 0x03C (R/W)  Auxiliary Fault Status Register */\r
+  __IM  uint32_t PFR[2U];                /*!< Offset: 0x040 (R/ )  Processor Feature Register */\r
+  __IM  uint32_t DFR;                    /*!< Offset: 0x048 (R/ )  Debug Feature Register */\r
+  __IM  uint32_t ADR;                    /*!< Offset: 0x04C (R/ )  Auxiliary Feature Register */\r
+  __IM  uint32_t MMFR[4U];               /*!< Offset: 0x050 (R/ )  Memory Model Feature Register */\r
+  __IM  uint32_t ISAR[5U];               /*!< Offset: 0x060 (R/ )  Instruction Set Attributes Register */\r
+        uint32_t RESERVED0[5U];\r
+  __IOM uint32_t CPACR;                  /*!< Offset: 0x088 (R/W)  Coprocessor Access Control Register */\r
+} SCB_Type;\r
+\r
+/* SCB CPUID Register Definitions */\r
+#define SCB_CPUID_IMPLEMENTER_Pos          24U                                            /*!< SCB CPUID: IMPLEMENTER Position */\r
+#define SCB_CPUID_IMPLEMENTER_Msk          (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos)          /*!< SCB CPUID: IMPLEMENTER Mask */\r
+\r
+#define SCB_CPUID_VARIANT_Pos              20U                                            /*!< SCB CPUID: VARIANT Position */\r
+#define SCB_CPUID_VARIANT_Msk              (0xFUL << SCB_CPUID_VARIANT_Pos)               /*!< SCB CPUID: VARIANT Mask */\r
+\r
+#define SCB_CPUID_ARCHITECTURE_Pos         16U                                            /*!< SCB CPUID: ARCHITECTURE Position */\r
+#define SCB_CPUID_ARCHITECTURE_Msk         (0xFUL << SCB_CPUID_ARCHITECTURE_Pos)          /*!< SCB CPUID: ARCHITECTURE Mask */\r
+\r
+#define SCB_CPUID_PARTNO_Pos                4U                                            /*!< SCB CPUID: PARTNO Position */\r
+#define SCB_CPUID_PARTNO_Msk               (0xFFFUL << SCB_CPUID_PARTNO_Pos)              /*!< SCB CPUID: PARTNO Mask */\r
+\r
+#define SCB_CPUID_REVISION_Pos              0U                                            /*!< SCB CPUID: REVISION Position */\r
+#define SCB_CPUID_REVISION_Msk             (0xFUL /*<< SCB_CPUID_REVISION_Pos*/)          /*!< SCB CPUID: REVISION Mask */\r
+\r
+/* SCB Interrupt Control State Register Definitions */\r
+#define SCB_ICSR_NMIPENDSET_Pos            31U                                            /*!< SCB ICSR: NMIPENDSET Position */\r
+#define SCB_ICSR_NMIPENDSET_Msk            (1UL << SCB_ICSR_NMIPENDSET_Pos)               /*!< SCB ICSR: NMIPENDSET Mask */\r
+\r
+#define SCB_ICSR_PENDSVSET_Pos             28U                                            /*!< SCB ICSR: PENDSVSET Position */\r
+#define SCB_ICSR_PENDSVSET_Msk             (1UL << SCB_ICSR_PENDSVSET_Pos)                /*!< SCB ICSR: PENDSVSET Mask */\r
+\r
+#define SCB_ICSR_PENDSVCLR_Pos             27U                                            /*!< SCB ICSR: PENDSVCLR Position */\r
+#define SCB_ICSR_PENDSVCLR_Msk             (1UL << SCB_ICSR_PENDSVCLR_Pos)                /*!< SCB ICSR: PENDSVCLR Mask */\r
+\r
+#define SCB_ICSR_PENDSTSET_Pos             26U                                            /*!< SCB ICSR: PENDSTSET Position */\r
+#define SCB_ICSR_PENDSTSET_Msk             (1UL << SCB_ICSR_PENDSTSET_Pos)                /*!< SCB ICSR: PENDSTSET Mask */\r
+\r
+#define SCB_ICSR_PENDSTCLR_Pos             25U                                            /*!< SCB ICSR: PENDSTCLR Position */\r
+#define SCB_ICSR_PENDSTCLR_Msk             (1UL << SCB_ICSR_PENDSTCLR_Pos)                /*!< SCB ICSR: PENDSTCLR Mask */\r
+\r
+#define SCB_ICSR_ISRPREEMPT_Pos            23U                                            /*!< SCB ICSR: ISRPREEMPT Position */\r
+#define SCB_ICSR_ISRPREEMPT_Msk            (1UL << SCB_ICSR_ISRPREEMPT_Pos)               /*!< SCB ICSR: ISRPREEMPT Mask */\r
+\r
+#define SCB_ICSR_ISRPENDING_Pos            22U                                            /*!< SCB ICSR: ISRPENDING Position */\r
+#define SCB_ICSR_ISRPENDING_Msk            (1UL << SCB_ICSR_ISRPENDING_Pos)               /*!< SCB ICSR: ISRPENDING Mask */\r
+\r
+#define SCB_ICSR_VECTPENDING_Pos           12U                                            /*!< SCB ICSR: VECTPENDING Position */\r
+#define SCB_ICSR_VECTPENDING_Msk           (0x1FFUL << SCB_ICSR_VECTPENDING_Pos)          /*!< SCB ICSR: VECTPENDING Mask */\r
+\r
+#define SCB_ICSR_RETTOBASE_Pos             11U                                            /*!< SCB ICSR: RETTOBASE Position */\r
+#define SCB_ICSR_RETTOBASE_Msk             (1UL << SCB_ICSR_RETTOBASE_Pos)                /*!< SCB ICSR: RETTOBASE Mask */\r
+\r
+#define SCB_ICSR_VECTACTIVE_Pos             0U                                            /*!< SCB ICSR: VECTACTIVE Position */\r
+#define SCB_ICSR_VECTACTIVE_Msk            (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/)       /*!< SCB ICSR: VECTACTIVE Mask */\r
+\r
+/* SCB Vector Table Offset Register Definitions */\r
+#if defined (__CM3_REV) && (__CM3_REV < 0x0201U)                   /* core r2p1 */\r
+#define SCB_VTOR_TBLBASE_Pos               29U                                            /*!< SCB VTOR: TBLBASE Position */\r
+#define SCB_VTOR_TBLBASE_Msk               (1UL << SCB_VTOR_TBLBASE_Pos)                  /*!< SCB VTOR: TBLBASE Mask */\r
+\r
+#define SCB_VTOR_TBLOFF_Pos                 7U                                            /*!< SCB VTOR: TBLOFF Position */\r
+#define SCB_VTOR_TBLOFF_Msk                (0x3FFFFFUL << SCB_VTOR_TBLOFF_Pos)            /*!< SCB VTOR: TBLOFF Mask */\r
+#else\r
+#define SCB_VTOR_TBLOFF_Pos                 7U                                            /*!< SCB VTOR: TBLOFF Position */\r
+#define SCB_VTOR_TBLOFF_Msk                (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos)           /*!< SCB VTOR: TBLOFF Mask */\r
+#endif\r
+\r
+/* SCB Application Interrupt and Reset Control Register Definitions */\r
+#define SCB_AIRCR_VECTKEY_Pos              16U                                            /*!< SCB AIRCR: VECTKEY Position */\r
+#define SCB_AIRCR_VECTKEY_Msk              (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos)            /*!< SCB AIRCR: VECTKEY Mask */\r
+\r
+#define SCB_AIRCR_VECTKEYSTAT_Pos          16U                                            /*!< SCB AIRCR: VECTKEYSTAT Position */\r
+#define SCB_AIRCR_VECTKEYSTAT_Msk          (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos)        /*!< SCB AIRCR: VECTKEYSTAT Mask */\r
+\r
+#define SCB_AIRCR_ENDIANESS_Pos            15U                                            /*!< SCB AIRCR: ENDIANESS Position */\r
+#define SCB_AIRCR_ENDIANESS_Msk            (1UL << SCB_AIRCR_ENDIANESS_Pos)               /*!< SCB AIRCR: ENDIANESS Mask */\r
+\r
+#define SCB_AIRCR_PRIGROUP_Pos              8U                                            /*!< SCB AIRCR: PRIGROUP Position */\r
+#define SCB_AIRCR_PRIGROUP_Msk             (7UL << SCB_AIRCR_PRIGROUP_Pos)                /*!< SCB AIRCR: PRIGROUP Mask */\r
+\r
+#define SCB_AIRCR_SYSRESETREQ_Pos           2U                                            /*!< SCB AIRCR: SYSRESETREQ Position */\r
+#define SCB_AIRCR_SYSRESETREQ_Msk          (1UL << SCB_AIRCR_SYSRESETREQ_Pos)             /*!< SCB AIRCR: SYSRESETREQ Mask */\r
+\r
+#define SCB_AIRCR_VECTCLRACTIVE_Pos         1U                                            /*!< SCB AIRCR: VECTCLRACTIVE Position */\r
+#define SCB_AIRCR_VECTCLRACTIVE_Msk        (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos)           /*!< SCB AIRCR: VECTCLRACTIVE Mask */\r
+\r
+#define SCB_AIRCR_VECTRESET_Pos             0U                                            /*!< SCB AIRCR: VECTRESET Position */\r
+#define SCB_AIRCR_VECTRESET_Msk            (1UL /*<< SCB_AIRCR_VECTRESET_Pos*/)           /*!< SCB AIRCR: VECTRESET Mask */\r
+\r
+/* SCB System Control Register Definitions */\r
+#define SCB_SCR_SEVONPEND_Pos               4U                                            /*!< SCB SCR: SEVONPEND Position */\r
+#define SCB_SCR_SEVONPEND_Msk              (1UL << SCB_SCR_SEVONPEND_Pos)                 /*!< SCB SCR: SEVONPEND Mask */\r
+\r
+#define SCB_SCR_SLEEPDEEP_Pos               2U                                            /*!< SCB SCR: SLEEPDEEP Position */\r
+#define SCB_SCR_SLEEPDEEP_Msk              (1UL << SCB_SCR_SLEEPDEEP_Pos)                 /*!< SCB SCR: SLEEPDEEP Mask */\r
+\r
+#define SCB_SCR_SLEEPONEXIT_Pos             1U                                            /*!< SCB SCR: SLEEPONEXIT Position */\r
+#define SCB_SCR_SLEEPONEXIT_Msk            (1UL << SCB_SCR_SLEEPONEXIT_Pos)               /*!< SCB SCR: SLEEPONEXIT Mask */\r
+\r
+/* SCB Configuration Control Register Definitions */\r
+#define SCB_CCR_STKALIGN_Pos                9U                                            /*!< SCB CCR: STKALIGN Position */\r
+#define SCB_CCR_STKALIGN_Msk               (1UL << SCB_CCR_STKALIGN_Pos)                  /*!< SCB CCR: STKALIGN Mask */\r
+\r
+#define SCB_CCR_BFHFNMIGN_Pos               8U                                            /*!< SCB CCR: BFHFNMIGN Position */\r
+#define SCB_CCR_BFHFNMIGN_Msk              (1UL << SCB_CCR_BFHFNMIGN_Pos)                 /*!< SCB CCR: BFHFNMIGN Mask */\r
+\r
+#define SCB_CCR_DIV_0_TRP_Pos               4U                                            /*!< SCB CCR: DIV_0_TRP Position */\r
+#define SCB_CCR_DIV_0_TRP_Msk              (1UL << SCB_CCR_DIV_0_TRP_Pos)                 /*!< SCB CCR: DIV_0_TRP Mask */\r
+\r
+#define SCB_CCR_UNALIGN_TRP_Pos             3U                                            /*!< SCB CCR: UNALIGN_TRP Position */\r
+#define SCB_CCR_UNALIGN_TRP_Msk            (1UL << SCB_CCR_UNALIGN_TRP_Pos)               /*!< SCB CCR: UNALIGN_TRP Mask */\r
+\r
+#define SCB_CCR_USERSETMPEND_Pos            1U                                            /*!< SCB CCR: USERSETMPEND Position */\r
+#define SCB_CCR_USERSETMPEND_Msk           (1UL << SCB_CCR_USERSETMPEND_Pos)              /*!< SCB CCR: USERSETMPEND Mask */\r
+\r
+#define SCB_CCR_NONBASETHRDENA_Pos          0U                                            /*!< SCB CCR: NONBASETHRDENA Position */\r
+#define SCB_CCR_NONBASETHRDENA_Msk         (1UL /*<< SCB_CCR_NONBASETHRDENA_Pos*/)        /*!< SCB CCR: NONBASETHRDENA Mask */\r
+\r
+/* SCB System Handler Control and State Register Definitions */\r
+#define SCB_SHCSR_USGFAULTENA_Pos          18U                                            /*!< SCB SHCSR: USGFAULTENA Position */\r
+#define SCB_SHCSR_USGFAULTENA_Msk          (1UL << SCB_SHCSR_USGFAULTENA_Pos)             /*!< SCB SHCSR: USGFAULTENA Mask */\r
+\r
+#define SCB_SHCSR_BUSFAULTENA_Pos          17U                                            /*!< SCB SHCSR: BUSFAULTENA Position */\r
+#define SCB_SHCSR_BUSFAULTENA_Msk          (1UL << SCB_SHCSR_BUSFAULTENA_Pos)             /*!< SCB SHCSR: BUSFAULTENA Mask */\r
+\r
+#define SCB_SHCSR_MEMFAULTENA_Pos          16U                                            /*!< SCB SHCSR: MEMFAULTENA Position */\r
+#define SCB_SHCSR_MEMFAULTENA_Msk          (1UL << SCB_SHCSR_MEMFAULTENA_Pos)             /*!< SCB SHCSR: MEMFAULTENA Mask */\r
+\r
+#define SCB_SHCSR_SVCALLPENDED_Pos         15U                                            /*!< SCB SHCSR: SVCALLPENDED Position */\r
+#define SCB_SHCSR_SVCALLPENDED_Msk         (1UL << SCB_SHCSR_SVCALLPENDED_Pos)            /*!< SCB SHCSR: SVCALLPENDED Mask */\r
+\r
+#define SCB_SHCSR_BUSFAULTPENDED_Pos       14U                                            /*!< SCB SHCSR: BUSFAULTPENDED Position */\r
+#define SCB_SHCSR_BUSFAULTPENDED_Msk       (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos)          /*!< SCB SHCSR: BUSFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_MEMFAULTPENDED_Pos       13U                                            /*!< SCB SHCSR: MEMFAULTPENDED Position */\r
+#define SCB_SHCSR_MEMFAULTPENDED_Msk       (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos)          /*!< SCB SHCSR: MEMFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_USGFAULTPENDED_Pos       12U                                            /*!< SCB SHCSR: USGFAULTPENDED Position */\r
+#define SCB_SHCSR_USGFAULTPENDED_Msk       (1UL << SCB_SHCSR_USGFAULTPENDED_Pos)          /*!< SCB SHCSR: USGFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_SYSTICKACT_Pos           11U                                            /*!< SCB SHCSR: SYSTICKACT Position */\r
+#define SCB_SHCSR_SYSTICKACT_Msk           (1UL << SCB_SHCSR_SYSTICKACT_Pos)              /*!< SCB SHCSR: SYSTICKACT Mask */\r
+\r
+#define SCB_SHCSR_PENDSVACT_Pos            10U                                            /*!< SCB SHCSR: PENDSVACT Position */\r
+#define SCB_SHCSR_PENDSVACT_Msk            (1UL << SCB_SHCSR_PENDSVACT_Pos)               /*!< SCB SHCSR: PENDSVACT Mask */\r
+\r
+#define SCB_SHCSR_MONITORACT_Pos            8U                                            /*!< SCB SHCSR: MONITORACT Position */\r
+#define SCB_SHCSR_MONITORACT_Msk           (1UL << SCB_SHCSR_MONITORACT_Pos)              /*!< SCB SHCSR: MONITORACT Mask */\r
+\r
+#define SCB_SHCSR_SVCALLACT_Pos             7U                                            /*!< SCB SHCSR: SVCALLACT Position */\r
+#define SCB_SHCSR_SVCALLACT_Msk            (1UL << SCB_SHCSR_SVCALLACT_Pos)               /*!< SCB SHCSR: SVCALLACT Mask */\r
+\r
+#define SCB_SHCSR_USGFAULTACT_Pos           3U                                            /*!< SCB SHCSR: USGFAULTACT Position */\r
+#define SCB_SHCSR_USGFAULTACT_Msk          (1UL << SCB_SHCSR_USGFAULTACT_Pos)             /*!< SCB SHCSR: USGFAULTACT Mask */\r
+\r
+#define SCB_SHCSR_BUSFAULTACT_Pos           1U                                            /*!< SCB SHCSR: BUSFAULTACT Position */\r
+#define SCB_SHCSR_BUSFAULTACT_Msk          (1UL << SCB_SHCSR_BUSFAULTACT_Pos)             /*!< SCB SHCSR: BUSFAULTACT Mask */\r
+\r
+#define SCB_SHCSR_MEMFAULTACT_Pos           0U                                            /*!< SCB SHCSR: MEMFAULTACT Position */\r
+#define SCB_SHCSR_MEMFAULTACT_Msk          (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/)         /*!< SCB SHCSR: MEMFAULTACT Mask */\r
+\r
+/* SCB Configurable Fault Status Register Definitions */\r
+#define SCB_CFSR_USGFAULTSR_Pos            16U                                            /*!< SCB CFSR: Usage Fault Status Register Position */\r
+#define SCB_CFSR_USGFAULTSR_Msk            (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos)          /*!< SCB CFSR: Usage Fault Status Register Mask */\r
+\r
+#define SCB_CFSR_BUSFAULTSR_Pos             8U                                            /*!< SCB CFSR: Bus Fault Status Register Position */\r
+#define SCB_CFSR_BUSFAULTSR_Msk            (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos)            /*!< SCB CFSR: Bus Fault Status Register Mask */\r
+\r
+#define SCB_CFSR_MEMFAULTSR_Pos             0U                                            /*!< SCB CFSR: Memory Manage Fault Status Register Position */\r
+#define SCB_CFSR_MEMFAULTSR_Msk            (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/)        /*!< SCB CFSR: Memory Manage Fault Status Register Mask */\r
+\r
+/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */\r
+#define SCB_CFSR_MMARVALID_Pos             (SCB_SHCSR_MEMFAULTACT_Pos + 7U)               /*!< SCB CFSR (MMFSR): MMARVALID Position */\r
+#define SCB_CFSR_MMARVALID_Msk             (1UL << SCB_CFSR_MMARVALID_Pos)                /*!< SCB CFSR (MMFSR): MMARVALID Mask */\r
+\r
+#define SCB_CFSR_MSTKERR_Pos               (SCB_SHCSR_MEMFAULTACT_Pos + 4U)               /*!< SCB CFSR (MMFSR): MSTKERR Position */\r
+#define SCB_CFSR_MSTKERR_Msk               (1UL << SCB_CFSR_MSTKERR_Pos)                  /*!< SCB CFSR (MMFSR): MSTKERR Mask */\r
+\r
+#define SCB_CFSR_MUNSTKERR_Pos             (SCB_SHCSR_MEMFAULTACT_Pos + 3U)               /*!< SCB CFSR (MMFSR): MUNSTKERR Position */\r
+#define SCB_CFSR_MUNSTKERR_Msk             (1UL << SCB_CFSR_MUNSTKERR_Pos)                /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */\r
+\r
+#define SCB_CFSR_DACCVIOL_Pos              (SCB_SHCSR_MEMFAULTACT_Pos + 1U)               /*!< SCB CFSR (MMFSR): DACCVIOL Position */\r
+#define SCB_CFSR_DACCVIOL_Msk              (1UL << SCB_CFSR_DACCVIOL_Pos)                 /*!< SCB CFSR (MMFSR): DACCVIOL Mask */\r
+\r
+#define SCB_CFSR_IACCVIOL_Pos              (SCB_SHCSR_MEMFAULTACT_Pos + 0U)               /*!< SCB CFSR (MMFSR): IACCVIOL Position */\r
+#define SCB_CFSR_IACCVIOL_Msk              (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/)             /*!< SCB CFSR (MMFSR): IACCVIOL Mask */\r
+\r
+/* BusFault Status Register (part of SCB Configurable Fault Status Register) */\r
+#define SCB_CFSR_BFARVALID_Pos            (SCB_CFSR_BUSFAULTSR_Pos + 7U)                  /*!< SCB CFSR (BFSR): BFARVALID Position */\r
+#define SCB_CFSR_BFARVALID_Msk            (1UL << SCB_CFSR_BFARVALID_Pos)                 /*!< SCB CFSR (BFSR): BFARVALID Mask */\r
+\r
+#define SCB_CFSR_STKERR_Pos               (SCB_CFSR_BUSFAULTSR_Pos + 4U)                  /*!< SCB CFSR (BFSR): STKERR Position */\r
+#define SCB_CFSR_STKERR_Msk               (1UL << SCB_CFSR_STKERR_Pos)                    /*!< SCB CFSR (BFSR): STKERR Mask */\r
+\r
+#define SCB_CFSR_UNSTKERR_Pos             (SCB_CFSR_BUSFAULTSR_Pos + 3U)                  /*!< SCB CFSR (BFSR): UNSTKERR Position */\r
+#define SCB_CFSR_UNSTKERR_Msk             (1UL << SCB_CFSR_UNSTKERR_Pos)                  /*!< SCB CFSR (BFSR): UNSTKERR Mask */\r
+\r
+#define SCB_CFSR_IMPRECISERR_Pos          (SCB_CFSR_BUSFAULTSR_Pos + 2U)                  /*!< SCB CFSR (BFSR): IMPRECISERR Position */\r
+#define SCB_CFSR_IMPRECISERR_Msk          (1UL << SCB_CFSR_IMPRECISERR_Pos)               /*!< SCB CFSR (BFSR): IMPRECISERR Mask */\r
+\r
+#define SCB_CFSR_PRECISERR_Pos            (SCB_CFSR_BUSFAULTSR_Pos + 1U)                  /*!< SCB CFSR (BFSR): PRECISERR Position */\r
+#define SCB_CFSR_PRECISERR_Msk            (1UL << SCB_CFSR_PRECISERR_Pos)                 /*!< SCB CFSR (BFSR): PRECISERR Mask */\r
+\r
+#define SCB_CFSR_IBUSERR_Pos              (SCB_CFSR_BUSFAULTSR_Pos + 0U)                  /*!< SCB CFSR (BFSR): IBUSERR Position */\r
+#define SCB_CFSR_IBUSERR_Msk              (1UL << SCB_CFSR_IBUSERR_Pos)                   /*!< SCB CFSR (BFSR): IBUSERR Mask */\r
+\r
+/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */\r
+#define SCB_CFSR_DIVBYZERO_Pos            (SCB_CFSR_USGFAULTSR_Pos + 9U)                  /*!< SCB CFSR (UFSR): DIVBYZERO Position */\r
+#define SCB_CFSR_DIVBYZERO_Msk            (1UL << SCB_CFSR_DIVBYZERO_Pos)                 /*!< SCB CFSR (UFSR): DIVBYZERO Mask */\r
+\r
+#define SCB_CFSR_UNALIGNED_Pos            (SCB_CFSR_USGFAULTSR_Pos + 8U)                  /*!< SCB CFSR (UFSR): UNALIGNED Position */\r
+#define SCB_CFSR_UNALIGNED_Msk            (1UL << SCB_CFSR_UNALIGNED_Pos)                 /*!< SCB CFSR (UFSR): UNALIGNED Mask */\r
+\r
+#define SCB_CFSR_NOCP_Pos                 (SCB_CFSR_USGFAULTSR_Pos + 3U)                  /*!< SCB CFSR (UFSR): NOCP Position */\r
+#define SCB_CFSR_NOCP_Msk                 (1UL << SCB_CFSR_NOCP_Pos)                      /*!< SCB CFSR (UFSR): NOCP Mask */\r
+\r
+#define SCB_CFSR_INVPC_Pos                (SCB_CFSR_USGFAULTSR_Pos + 2U)                  /*!< SCB CFSR (UFSR): INVPC Position */\r
+#define SCB_CFSR_INVPC_Msk                (1UL << SCB_CFSR_INVPC_Pos)                     /*!< SCB CFSR (UFSR): INVPC Mask */\r
+\r
+#define SCB_CFSR_INVSTATE_Pos             (SCB_CFSR_USGFAULTSR_Pos + 1U)                  /*!< SCB CFSR (UFSR): INVSTATE Position */\r
+#define SCB_CFSR_INVSTATE_Msk             (1UL << SCB_CFSR_INVSTATE_Pos)                  /*!< SCB CFSR (UFSR): INVSTATE Mask */\r
+\r
+#define SCB_CFSR_UNDEFINSTR_Pos           (SCB_CFSR_USGFAULTSR_Pos + 0U)                  /*!< SCB CFSR (UFSR): UNDEFINSTR Position */\r
+#define SCB_CFSR_UNDEFINSTR_Msk           (1UL << SCB_CFSR_UNDEFINSTR_Pos)                /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */\r
+\r
+/* SCB Hard Fault Status Register Definitions */\r
+#define SCB_HFSR_DEBUGEVT_Pos              31U                                            /*!< SCB HFSR: DEBUGEVT Position */\r
+#define SCB_HFSR_DEBUGEVT_Msk              (1UL << SCB_HFSR_DEBUGEVT_Pos)                 /*!< SCB HFSR: DEBUGEVT Mask */\r
+\r
+#define SCB_HFSR_FORCED_Pos                30U                                            /*!< SCB HFSR: FORCED Position */\r
+#define SCB_HFSR_FORCED_Msk                (1UL << SCB_HFSR_FORCED_Pos)                   /*!< SCB HFSR: FORCED Mask */\r
+\r
+#define SCB_HFSR_VECTTBL_Pos                1U                                            /*!< SCB HFSR: VECTTBL Position */\r
+#define SCB_HFSR_VECTTBL_Msk               (1UL << SCB_HFSR_VECTTBL_Pos)                  /*!< SCB HFSR: VECTTBL Mask */\r
+\r
+/* SCB Debug Fault Status Register Definitions */\r
+#define SCB_DFSR_EXTERNAL_Pos               4U                                            /*!< SCB DFSR: EXTERNAL Position */\r
+#define SCB_DFSR_EXTERNAL_Msk              (1UL << SCB_DFSR_EXTERNAL_Pos)                 /*!< SCB DFSR: EXTERNAL Mask */\r
+\r
+#define SCB_DFSR_VCATCH_Pos                 3U                                            /*!< SCB DFSR: VCATCH Position */\r
+#define SCB_DFSR_VCATCH_Msk                (1UL << SCB_DFSR_VCATCH_Pos)                   /*!< SCB DFSR: VCATCH Mask */\r
+\r
+#define SCB_DFSR_DWTTRAP_Pos                2U                                            /*!< SCB DFSR: DWTTRAP Position */\r
+#define SCB_DFSR_DWTTRAP_Msk               (1UL << SCB_DFSR_DWTTRAP_Pos)                  /*!< SCB DFSR: DWTTRAP Mask */\r
+\r
+#define SCB_DFSR_BKPT_Pos                   1U                                            /*!< SCB DFSR: BKPT Position */\r
+#define SCB_DFSR_BKPT_Msk                  (1UL << SCB_DFSR_BKPT_Pos)                     /*!< SCB DFSR: BKPT Mask */\r
+\r
+#define SCB_DFSR_HALTED_Pos                 0U                                            /*!< SCB DFSR: HALTED Position */\r
+#define SCB_DFSR_HALTED_Msk                (1UL /*<< SCB_DFSR_HALTED_Pos*/)               /*!< SCB DFSR: HALTED Mask */\r
+\r
+/*@} end of group CMSIS_SCB */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB)\r
+  \brief    Type definitions for the System Control and ID Register not in the SCB\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Control and ID Register not in the SCB.\r
+ */\r
+typedef struct\r
+{\r
+        uint32_t RESERVED0[1U];\r
+  __IM  uint32_t ICTR;                   /*!< Offset: 0x004 (R/ )  Interrupt Controller Type Register */\r
+#if defined (__CM3_REV) && (__CM3_REV >= 0x200U)\r
+  __IOM uint32_t ACTLR;                  /*!< Offset: 0x008 (R/W)  Auxiliary Control Register */\r
+#else\r
+        uint32_t RESERVED1[1U];\r
+#endif\r
+} SCnSCB_Type;\r
+\r
+/* Interrupt Controller Type Register Definitions */\r
+#define SCnSCB_ICTR_INTLINESNUM_Pos         0U                                         /*!< ICTR: INTLINESNUM Position */\r
+#define SCnSCB_ICTR_INTLINESNUM_Msk        (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/)  /*!< ICTR: INTLINESNUM Mask */\r
+\r
+/* Auxiliary Control Register Definitions */\r
+\r
+#define SCnSCB_ACTLR_DISFOLD_Pos            2U                                         /*!< ACTLR: DISFOLD Position */\r
+#define SCnSCB_ACTLR_DISFOLD_Msk           (1UL << SCnSCB_ACTLR_DISFOLD_Pos)           /*!< ACTLR: DISFOLD Mask */\r
+\r
+#define SCnSCB_ACTLR_DISDEFWBUF_Pos         1U                                         /*!< ACTLR: DISDEFWBUF Position */\r
+#define SCnSCB_ACTLR_DISDEFWBUF_Msk        (1UL << SCnSCB_ACTLR_DISDEFWBUF_Pos)        /*!< ACTLR: DISDEFWBUF Mask */\r
+\r
+#define SCnSCB_ACTLR_DISMCYCINT_Pos         0U                                         /*!< ACTLR: DISMCYCINT Position */\r
+#define SCnSCB_ACTLR_DISMCYCINT_Msk        (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/)    /*!< ACTLR: DISMCYCINT Mask */\r
+\r
+/*@} end of group CMSIS_SCnotSCB */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SysTick     System Tick Timer (SysTick)\r
+  \brief    Type definitions for the System Timer Registers.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Timer (SysTick).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  SysTick Control and Status Register */\r
+  __IOM uint32_t LOAD;                   /*!< Offset: 0x004 (R/W)  SysTick Reload Value Register */\r
+  __IOM uint32_t VAL;                    /*!< Offset: 0x008 (R/W)  SysTick Current Value Register */\r
+  __IM  uint32_t CALIB;                  /*!< Offset: 0x00C (R/ )  SysTick Calibration Register */\r
+} SysTick_Type;\r
+\r
+/* SysTick Control / Status Register Definitions */\r
+#define SysTick_CTRL_COUNTFLAG_Pos         16U                                            /*!< SysTick CTRL: COUNTFLAG Position */\r
+#define SysTick_CTRL_COUNTFLAG_Msk         (1UL << SysTick_CTRL_COUNTFLAG_Pos)            /*!< SysTick CTRL: COUNTFLAG Mask */\r
+\r
+#define SysTick_CTRL_CLKSOURCE_Pos          2U                                            /*!< SysTick CTRL: CLKSOURCE Position */\r
+#define SysTick_CTRL_CLKSOURCE_Msk         (1UL << SysTick_CTRL_CLKSOURCE_Pos)            /*!< SysTick CTRL: CLKSOURCE Mask */\r
+\r
+#define SysTick_CTRL_TICKINT_Pos            1U                                            /*!< SysTick CTRL: TICKINT Position */\r
+#define SysTick_CTRL_TICKINT_Msk           (1UL << SysTick_CTRL_TICKINT_Pos)              /*!< SysTick CTRL: TICKINT Mask */\r
+\r
+#define SysTick_CTRL_ENABLE_Pos             0U                                            /*!< SysTick CTRL: ENABLE Position */\r
+#define SysTick_CTRL_ENABLE_Msk            (1UL /*<< SysTick_CTRL_ENABLE_Pos*/)           /*!< SysTick CTRL: ENABLE Mask */\r
+\r
+/* SysTick Reload Register Definitions */\r
+#define SysTick_LOAD_RELOAD_Pos             0U                                            /*!< SysTick LOAD: RELOAD Position */\r
+#define SysTick_LOAD_RELOAD_Msk            (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/)    /*!< SysTick LOAD: RELOAD Mask */\r
+\r
+/* SysTick Current Register Definitions */\r
+#define SysTick_VAL_CURRENT_Pos             0U                                            /*!< SysTick VAL: CURRENT Position */\r
+#define SysTick_VAL_CURRENT_Msk            (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/)    /*!< SysTick VAL: CURRENT Mask */\r
+\r
+/* SysTick Calibration Register Definitions */\r
+#define SysTick_CALIB_NOREF_Pos            31U                                            /*!< SysTick CALIB: NOREF Position */\r
+#define SysTick_CALIB_NOREF_Msk            (1UL << SysTick_CALIB_NOREF_Pos)               /*!< SysTick CALIB: NOREF Mask */\r
+\r
+#define SysTick_CALIB_SKEW_Pos             30U                                            /*!< SysTick CALIB: SKEW Position */\r
+#define SysTick_CALIB_SKEW_Msk             (1UL << SysTick_CALIB_SKEW_Pos)                /*!< SysTick CALIB: SKEW Mask */\r
+\r
+#define SysTick_CALIB_TENMS_Pos             0U                                            /*!< SysTick CALIB: TENMS Position */\r
+#define SysTick_CALIB_TENMS_Msk            (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/)    /*!< SysTick CALIB: TENMS Mask */\r
+\r
+/*@} end of group CMSIS_SysTick */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_ITM     Instrumentation Trace Macrocell (ITM)\r
+  \brief    Type definitions for the Instrumentation Trace Macrocell (ITM)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Instrumentation Trace Macrocell Register (ITM).\r
+ */\r
+typedef struct\r
+{\r
+  __OM  union\r
+  {\r
+    __OM  uint8_t    u8;                 /*!< Offset: 0x000 ( /W)  ITM Stimulus Port 8-bit */\r
+    __OM  uint16_t   u16;                /*!< Offset: 0x000 ( /W)  ITM Stimulus Port 16-bit */\r
+    __OM  uint32_t   u32;                /*!< Offset: 0x000 ( /W)  ITM Stimulus Port 32-bit */\r
+  }  PORT [32U];                         /*!< Offset: 0x000 ( /W)  ITM Stimulus Port Registers */\r
+        uint32_t RESERVED0[864U];\r
+  __IOM uint32_t TER;                    /*!< Offset: 0xE00 (R/W)  ITM Trace Enable Register */\r
+        uint32_t RESERVED1[15U];\r
+  __IOM uint32_t TPR;                    /*!< Offset: 0xE40 (R/W)  ITM Trace Privilege Register */\r
+        uint32_t RESERVED2[15U];\r
+  __IOM uint32_t TCR;                    /*!< Offset: 0xE80 (R/W)  ITM Trace Control Register */\r
+        uint32_t RESERVED3[29U];\r
+  __OM  uint32_t IWR;                    /*!< Offset: 0xEF8 ( /W)  ITM Integration Write Register */\r
+  __IM  uint32_t IRR;                    /*!< Offset: 0xEFC (R/ )  ITM Integration Read Register */\r
+  __IOM uint32_t IMCR;                   /*!< Offset: 0xF00 (R/W)  ITM Integration Mode Control Register */\r
+        uint32_t RESERVED4[43U];\r
+  __OM  uint32_t LAR;                    /*!< Offset: 0xFB0 ( /W)  ITM Lock Access Register */\r
+  __IM  uint32_t LSR;                    /*!< Offset: 0xFB4 (R/ )  ITM Lock Status Register */\r
+        uint32_t RESERVED5[6U];\r
+  __IM  uint32_t PID4;                   /*!< Offset: 0xFD0 (R/ )  ITM Peripheral Identification Register #4 */\r
+  __IM  uint32_t PID5;                   /*!< Offset: 0xFD4 (R/ )  ITM Peripheral Identification Register #5 */\r
+  __IM  uint32_t PID6;                   /*!< Offset: 0xFD8 (R/ )  ITM Peripheral Identification Register #6 */\r
+  __IM  uint32_t PID7;                   /*!< Offset: 0xFDC (R/ )  ITM Peripheral Identification Register #7 */\r
+  __IM  uint32_t PID0;                   /*!< Offset: 0xFE0 (R/ )  ITM Peripheral Identification Register #0 */\r
+  __IM  uint32_t PID1;                   /*!< Offset: 0xFE4 (R/ )  ITM Peripheral Identification Register #1 */\r
+  __IM  uint32_t PID2;                   /*!< Offset: 0xFE8 (R/ )  ITM Peripheral Identification Register #2 */\r
+  __IM  uint32_t PID3;                   /*!< Offset: 0xFEC (R/ )  ITM Peripheral Identification Register #3 */\r
+  __IM  uint32_t CID0;                   /*!< Offset: 0xFF0 (R/ )  ITM Component  Identification Register #0 */\r
+  __IM  uint32_t CID1;                   /*!< Offset: 0xFF4 (R/ )  ITM Component  Identification Register #1 */\r
+  __IM  uint32_t CID2;                   /*!< Offset: 0xFF8 (R/ )  ITM Component  Identification Register #2 */\r
+  __IM  uint32_t CID3;                   /*!< Offset: 0xFFC (R/ )  ITM Component  Identification Register #3 */\r
+} ITM_Type;\r
+\r
+/* ITM Trace Privilege Register Definitions */\r
+#define ITM_TPR_PRIVMASK_Pos                0U                                            /*!< ITM TPR: PRIVMASK Position */\r
+#define ITM_TPR_PRIVMASK_Msk               (0xFFFFFFFFUL /*<< ITM_TPR_PRIVMASK_Pos*/)     /*!< ITM TPR: PRIVMASK Mask */\r
+\r
+/* ITM Trace Control Register Definitions */\r
+#define ITM_TCR_BUSY_Pos                   23U                                            /*!< ITM TCR: BUSY Position */\r
+#define ITM_TCR_BUSY_Msk                   (1UL << ITM_TCR_BUSY_Pos)                      /*!< ITM TCR: BUSY Mask */\r
+\r
+#define ITM_TCR_TraceBusID_Pos             16U                                            /*!< ITM TCR: ATBID Position */\r
+#define ITM_TCR_TraceBusID_Msk             (0x7FUL << ITM_TCR_TraceBusID_Pos)             /*!< ITM TCR: ATBID Mask */\r
+\r
+#define ITM_TCR_GTSFREQ_Pos                10U                                            /*!< ITM TCR: Global timestamp frequency Position */\r
+#define ITM_TCR_GTSFREQ_Msk                (3UL << ITM_TCR_GTSFREQ_Pos)                   /*!< ITM TCR: Global timestamp frequency Mask */\r
+\r
+#define ITM_TCR_TSPrescale_Pos              8U                                            /*!< ITM TCR: TSPrescale Position */\r
+#define ITM_TCR_TSPrescale_Msk             (3UL << ITM_TCR_TSPrescale_Pos)                /*!< ITM TCR: TSPrescale Mask */\r
+\r
+#define ITM_TCR_SWOENA_Pos                  4U                                            /*!< ITM TCR: SWOENA Position */\r
+#define ITM_TCR_SWOENA_Msk                 (1UL << ITM_TCR_SWOENA_Pos)                    /*!< ITM TCR: SWOENA Mask */\r
+\r
+#define ITM_TCR_DWTENA_Pos                  3U                                            /*!< ITM TCR: DWTENA Position */\r
+#define ITM_TCR_DWTENA_Msk                 (1UL << ITM_TCR_DWTENA_Pos)                    /*!< ITM TCR: DWTENA Mask */\r
+\r
+#define ITM_TCR_SYNCENA_Pos                 2U                                            /*!< ITM TCR: SYNCENA Position */\r
+#define ITM_TCR_SYNCENA_Msk                (1UL << ITM_TCR_SYNCENA_Pos)                   /*!< ITM TCR: SYNCENA Mask */\r
+\r
+#define ITM_TCR_TSENA_Pos                   1U                                            /*!< ITM TCR: TSENA Position */\r
+#define ITM_TCR_TSENA_Msk                  (1UL << ITM_TCR_TSENA_Pos)                     /*!< ITM TCR: TSENA Mask */\r
+\r
+#define ITM_TCR_ITMENA_Pos                  0U                                            /*!< ITM TCR: ITM Enable bit Position */\r
+#define ITM_TCR_ITMENA_Msk                 (1UL /*<< ITM_TCR_ITMENA_Pos*/)                /*!< ITM TCR: ITM Enable bit Mask */\r
+\r
+/* ITM Integration Write Register Definitions */\r
+#define ITM_IWR_ATVALIDM_Pos                0U                                            /*!< ITM IWR: ATVALIDM Position */\r
+#define ITM_IWR_ATVALIDM_Msk               (1UL /*<< ITM_IWR_ATVALIDM_Pos*/)              /*!< ITM IWR: ATVALIDM Mask */\r
+\r
+/* ITM Integration Read Register Definitions */\r
+#define ITM_IRR_ATREADYM_Pos                0U                                            /*!< ITM IRR: ATREADYM Position */\r
+#define ITM_IRR_ATREADYM_Msk               (1UL /*<< ITM_IRR_ATREADYM_Pos*/)              /*!< ITM IRR: ATREADYM Mask */\r
+\r
+/* ITM Integration Mode Control Register Definitions */\r
+#define ITM_IMCR_INTEGRATION_Pos            0U                                            /*!< ITM IMCR: INTEGRATION Position */\r
+#define ITM_IMCR_INTEGRATION_Msk           (1UL /*<< ITM_IMCR_INTEGRATION_Pos*/)          /*!< ITM IMCR: INTEGRATION Mask */\r
+\r
+/* ITM Lock Status Register Definitions */\r
+#define ITM_LSR_ByteAcc_Pos                 2U                                            /*!< ITM LSR: ByteAcc Position */\r
+#define ITM_LSR_ByteAcc_Msk                (1UL << ITM_LSR_ByteAcc_Pos)                   /*!< ITM LSR: ByteAcc Mask */\r
+\r
+#define ITM_LSR_Access_Pos                  1U                                            /*!< ITM LSR: Access Position */\r
+#define ITM_LSR_Access_Msk                 (1UL << ITM_LSR_Access_Pos)                    /*!< ITM LSR: Access Mask */\r
+\r
+#define ITM_LSR_Present_Pos                 0U                                            /*!< ITM LSR: Present Position */\r
+#define ITM_LSR_Present_Msk                (1UL /*<< ITM_LSR_Present_Pos*/)               /*!< ITM LSR: Present Mask */\r
+\r
+/*@}*/ /* end of group CMSIS_ITM */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_DWT     Data Watchpoint and Trace (DWT)\r
+  \brief    Type definitions for the Data Watchpoint and Trace (DWT)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Data Watchpoint and Trace Register (DWT).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  Control Register */\r
+  __IOM uint32_t CYCCNT;                 /*!< Offset: 0x004 (R/W)  Cycle Count Register */\r
+  __IOM uint32_t CPICNT;                 /*!< Offset: 0x008 (R/W)  CPI Count Register */\r
+  __IOM uint32_t EXCCNT;                 /*!< Offset: 0x00C (R/W)  Exception Overhead Count Register */\r
+  __IOM uint32_t SLEEPCNT;               /*!< Offset: 0x010 (R/W)  Sleep Count Register */\r
+  __IOM uint32_t LSUCNT;                 /*!< Offset: 0x014 (R/W)  LSU Count Register */\r
+  __IOM uint32_t FOLDCNT;                /*!< Offset: 0x018 (R/W)  Folded-instruction Count Register */\r
+  __IM  uint32_t PCSR;                   /*!< Offset: 0x01C (R/ )  Program Counter Sample Register */\r
+  __IOM uint32_t COMP0;                  /*!< Offset: 0x020 (R/W)  Comparator Register 0 */\r
+  __IOM uint32_t MASK0;                  /*!< Offset: 0x024 (R/W)  Mask Register 0 */\r
+  __IOM uint32_t FUNCTION0;              /*!< Offset: 0x028 (R/W)  Function Register 0 */\r
+        uint32_t RESERVED0[1U];\r
+  __IOM uint32_t COMP1;                  /*!< Offset: 0x030 (R/W)  Comparator Register 1 */\r
+  __IOM uint32_t MASK1;                  /*!< Offset: 0x034 (R/W)  Mask Register 1 */\r
+  __IOM uint32_t FUNCTION1;              /*!< Offset: 0x038 (R/W)  Function Register 1 */\r
+        uint32_t RESERVED1[1U];\r
+  __IOM uint32_t COMP2;                  /*!< Offset: 0x040 (R/W)  Comparator Register 2 */\r
+  __IOM uint32_t MASK2;                  /*!< Offset: 0x044 (R/W)  Mask Register 2 */\r
+  __IOM uint32_t FUNCTION2;              /*!< Offset: 0x048 (R/W)  Function Register 2 */\r
+        uint32_t RESERVED2[1U];\r
+  __IOM uint32_t COMP3;                  /*!< Offset: 0x050 (R/W)  Comparator Register 3 */\r
+  __IOM uint32_t MASK3;                  /*!< Offset: 0x054 (R/W)  Mask Register 3 */\r
+  __IOM uint32_t FUNCTION3;              /*!< Offset: 0x058 (R/W)  Function Register 3 */\r
+} DWT_Type;\r
+\r
+/* DWT Control Register Definitions */\r
+#define DWT_CTRL_NUMCOMP_Pos               28U                                         /*!< DWT CTRL: NUMCOMP Position */\r
+#define DWT_CTRL_NUMCOMP_Msk               (0xFUL << DWT_CTRL_NUMCOMP_Pos)             /*!< DWT CTRL: NUMCOMP Mask */\r
+\r
+#define DWT_CTRL_NOTRCPKT_Pos              27U                                         /*!< DWT CTRL: NOTRCPKT Position */\r
+#define DWT_CTRL_NOTRCPKT_Msk              (0x1UL << DWT_CTRL_NOTRCPKT_Pos)            /*!< DWT CTRL: NOTRCPKT Mask */\r
+\r
+#define DWT_CTRL_NOEXTTRIG_Pos             26U                                         /*!< DWT CTRL: NOEXTTRIG Position */\r
+#define DWT_CTRL_NOEXTTRIG_Msk             (0x1UL << DWT_CTRL_NOEXTTRIG_Pos)           /*!< DWT CTRL: NOEXTTRIG Mask */\r
+\r
+#define DWT_CTRL_NOCYCCNT_Pos              25U                                         /*!< DWT CTRL: NOCYCCNT Position */\r
+#define DWT_CTRL_NOCYCCNT_Msk              (0x1UL << DWT_CTRL_NOCYCCNT_Pos)            /*!< DWT CTRL: NOCYCCNT Mask */\r
+\r
+#define DWT_CTRL_NOPRFCNT_Pos              24U                                         /*!< DWT CTRL: NOPRFCNT Position */\r
+#define DWT_CTRL_NOPRFCNT_Msk              (0x1UL << DWT_CTRL_NOPRFCNT_Pos)            /*!< DWT CTRL: NOPRFCNT Mask */\r
+\r
+#define DWT_CTRL_CYCEVTENA_Pos             22U                                         /*!< DWT CTRL: CYCEVTENA Position */\r
+#define DWT_CTRL_CYCEVTENA_Msk             (0x1UL << DWT_CTRL_CYCEVTENA_Pos)           /*!< DWT CTRL: CYCEVTENA Mask */\r
+\r
+#define DWT_CTRL_FOLDEVTENA_Pos            21U                                         /*!< DWT CTRL: FOLDEVTENA Position */\r
+#define DWT_CTRL_FOLDEVTENA_Msk            (0x1UL << DWT_CTRL_FOLDEVTENA_Pos)          /*!< DWT CTRL: FOLDEVTENA Mask */\r
+\r
+#define DWT_CTRL_LSUEVTENA_Pos             20U                                         /*!< DWT CTRL: LSUEVTENA Position */\r
+#define DWT_CTRL_LSUEVTENA_Msk             (0x1UL << DWT_CTRL_LSUEVTENA_Pos)           /*!< DWT CTRL: LSUEVTENA Mask */\r
+\r
+#define DWT_CTRL_SLEEPEVTENA_Pos           19U                                         /*!< DWT CTRL: SLEEPEVTENA Position */\r
+#define DWT_CTRL_SLEEPEVTENA_Msk           (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos)         /*!< DWT CTRL: SLEEPEVTENA Mask */\r
+\r
+#define DWT_CTRL_EXCEVTENA_Pos             18U                                         /*!< DWT CTRL: EXCEVTENA Position */\r
+#define DWT_CTRL_EXCEVTENA_Msk             (0x1UL << DWT_CTRL_EXCEVTENA_Pos)           /*!< DWT CTRL: EXCEVTENA Mask */\r
+\r
+#define DWT_CTRL_CPIEVTENA_Pos             17U                                         /*!< DWT CTRL: CPIEVTENA Position */\r
+#define DWT_CTRL_CPIEVTENA_Msk             (0x1UL << DWT_CTRL_CPIEVTENA_Pos)           /*!< DWT CTRL: CPIEVTENA Mask */\r
+\r
+#define DWT_CTRL_EXCTRCENA_Pos             16U                                         /*!< DWT CTRL: EXCTRCENA Position */\r
+#define DWT_CTRL_EXCTRCENA_Msk             (0x1UL << DWT_CTRL_EXCTRCENA_Pos)           /*!< DWT CTRL: EXCTRCENA Mask */\r
+\r
+#define DWT_CTRL_PCSAMPLENA_Pos            12U                                         /*!< DWT CTRL: PCSAMPLENA Position */\r
+#define DWT_CTRL_PCSAMPLENA_Msk            (0x1UL << DWT_CTRL_PCSAMPLENA_Pos)          /*!< DWT CTRL: PCSAMPLENA Mask */\r
+\r
+#define DWT_CTRL_SYNCTAP_Pos               10U                                         /*!< DWT CTRL: SYNCTAP Position */\r
+#define DWT_CTRL_SYNCTAP_Msk               (0x3UL << DWT_CTRL_SYNCTAP_Pos)             /*!< DWT CTRL: SYNCTAP Mask */\r
+\r
+#define DWT_CTRL_CYCTAP_Pos                 9U                                         /*!< DWT CTRL: CYCTAP Position */\r
+#define DWT_CTRL_CYCTAP_Msk                (0x1UL << DWT_CTRL_CYCTAP_Pos)              /*!< DWT CTRL: CYCTAP Mask */\r
+\r
+#define DWT_CTRL_POSTINIT_Pos               5U                                         /*!< DWT CTRL: POSTINIT Position */\r
+#define DWT_CTRL_POSTINIT_Msk              (0xFUL << DWT_CTRL_POSTINIT_Pos)            /*!< DWT CTRL: POSTINIT Mask */\r
+\r
+#define DWT_CTRL_POSTPRESET_Pos             1U                                         /*!< DWT CTRL: POSTPRESET Position */\r
+#define DWT_CTRL_POSTPRESET_Msk            (0xFUL << DWT_CTRL_POSTPRESET_Pos)          /*!< DWT CTRL: POSTPRESET Mask */\r
+\r
+#define DWT_CTRL_CYCCNTENA_Pos              0U                                         /*!< DWT CTRL: CYCCNTENA Position */\r
+#define DWT_CTRL_CYCCNTENA_Msk             (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/)       /*!< DWT CTRL: CYCCNTENA Mask */\r
+\r
+/* DWT CPI Count Register Definitions */\r
+#define DWT_CPICNT_CPICNT_Pos               0U                                         /*!< DWT CPICNT: CPICNT Position */\r
+#define DWT_CPICNT_CPICNT_Msk              (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/)       /*!< DWT CPICNT: CPICNT Mask */\r
+\r
+/* DWT Exception Overhead Count Register Definitions */\r
+#define DWT_EXCCNT_EXCCNT_Pos               0U                                         /*!< DWT EXCCNT: EXCCNT Position */\r
+#define DWT_EXCCNT_EXCCNT_Msk              (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/)       /*!< DWT EXCCNT: EXCCNT Mask */\r
+\r
+/* DWT Sleep Count Register Definitions */\r
+#define DWT_SLEEPCNT_SLEEPCNT_Pos           0U                                         /*!< DWT SLEEPCNT: SLEEPCNT Position */\r
+#define DWT_SLEEPCNT_SLEEPCNT_Msk          (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/)   /*!< DWT SLEEPCNT: SLEEPCNT Mask */\r
+\r
+/* DWT LSU Count Register Definitions */\r
+#define DWT_LSUCNT_LSUCNT_Pos               0U                                         /*!< DWT LSUCNT: LSUCNT Position */\r
+#define DWT_LSUCNT_LSUCNT_Msk              (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/)       /*!< DWT LSUCNT: LSUCNT Mask */\r
+\r
+/* DWT Folded-instruction Count Register Definitions */\r
+#define DWT_FOLDCNT_FOLDCNT_Pos             0U                                         /*!< DWT FOLDCNT: FOLDCNT Position */\r
+#define DWT_FOLDCNT_FOLDCNT_Msk            (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/)     /*!< DWT FOLDCNT: FOLDCNT Mask */\r
+\r
+/* DWT Comparator Mask Register Definitions */\r
+#define DWT_MASK_MASK_Pos                   0U                                         /*!< DWT MASK: MASK Position */\r
+#define DWT_MASK_MASK_Msk                  (0x1FUL /*<< DWT_MASK_MASK_Pos*/)           /*!< DWT MASK: MASK Mask */\r
+\r
+/* DWT Comparator Function Register Definitions */\r
+#define DWT_FUNCTION_MATCHED_Pos           24U                                         /*!< DWT FUNCTION: MATCHED Position */\r
+#define DWT_FUNCTION_MATCHED_Msk           (0x1UL << DWT_FUNCTION_MATCHED_Pos)         /*!< DWT FUNCTION: MATCHED Mask */\r
+\r
+#define DWT_FUNCTION_DATAVADDR1_Pos        16U                                         /*!< DWT FUNCTION: DATAVADDR1 Position */\r
+#define DWT_FUNCTION_DATAVADDR1_Msk        (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos)      /*!< DWT FUNCTION: DATAVADDR1 Mask */\r
+\r
+#define DWT_FUNCTION_DATAVADDR0_Pos        12U                                         /*!< DWT FUNCTION: DATAVADDR0 Position */\r
+#define DWT_FUNCTION_DATAVADDR0_Msk        (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos)      /*!< DWT FUNCTION: DATAVADDR0 Mask */\r
+\r
+#define DWT_FUNCTION_DATAVSIZE_Pos         10U                                         /*!< DWT FUNCTION: DATAVSIZE Position */\r
+#define DWT_FUNCTION_DATAVSIZE_Msk         (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos)       /*!< DWT FUNCTION: DATAVSIZE Mask */\r
+\r
+#define DWT_FUNCTION_LNK1ENA_Pos            9U                                         /*!< DWT FUNCTION: LNK1ENA Position */\r
+#define DWT_FUNCTION_LNK1ENA_Msk           (0x1UL << DWT_FUNCTION_LNK1ENA_Pos)         /*!< DWT FUNCTION: LNK1ENA Mask */\r
+\r
+#define DWT_FUNCTION_DATAVMATCH_Pos         8U                                         /*!< DWT FUNCTION: DATAVMATCH Position */\r
+#define DWT_FUNCTION_DATAVMATCH_Msk        (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos)      /*!< DWT FUNCTION: DATAVMATCH Mask */\r
+\r
+#define DWT_FUNCTION_CYCMATCH_Pos           7U                                         /*!< DWT FUNCTION: CYCMATCH Position */\r
+#define DWT_FUNCTION_CYCMATCH_Msk          (0x1UL << DWT_FUNCTION_CYCMATCH_Pos)        /*!< DWT FUNCTION: CYCMATCH Mask */\r
+\r
+#define DWT_FUNCTION_EMITRANGE_Pos          5U                                         /*!< DWT FUNCTION: EMITRANGE Position */\r
+#define DWT_FUNCTION_EMITRANGE_Msk         (0x1UL << DWT_FUNCTION_EMITRANGE_Pos)       /*!< DWT FUNCTION: EMITRANGE Mask */\r
+\r
+#define DWT_FUNCTION_FUNCTION_Pos           0U                                         /*!< DWT FUNCTION: FUNCTION Position */\r
+#define DWT_FUNCTION_FUNCTION_Msk          (0xFUL /*<< DWT_FUNCTION_FUNCTION_Pos*/)    /*!< DWT FUNCTION: FUNCTION Mask */\r
+\r
+/*@}*/ /* end of group CMSIS_DWT */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_TPI     Trace Port Interface (TPI)\r
+  \brief    Type definitions for the Trace Port Interface (TPI)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Trace Port Interface Register (TPI).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t SSPSR;                  /*!< Offset: 0x000 (R/ )  Supported Parallel Port Size Register */\r
+  __IOM uint32_t CSPSR;                  /*!< Offset: 0x004 (R/W)  Current Parallel Port Size Register */\r
+        uint32_t RESERVED0[2U];\r
+  __IOM uint32_t ACPR;                   /*!< Offset: 0x010 (R/W)  Asynchronous Clock Prescaler Register */\r
+        uint32_t RESERVED1[55U];\r
+  __IOM uint32_t SPPR;                   /*!< Offset: 0x0F0 (R/W)  Selected Pin Protocol Register */\r
+        uint32_t RESERVED2[131U];\r
+  __IM  uint32_t FFSR;                   /*!< Offset: 0x300 (R/ )  Formatter and Flush Status Register */\r
+  __IOM uint32_t FFCR;                   /*!< Offset: 0x304 (R/W)  Formatter and Flush Control Register */\r
+  __IM  uint32_t FSCR;                   /*!< Offset: 0x308 (R/ )  Formatter Synchronization Counter Register */\r
+        uint32_t RESERVED3[759U];\r
+  __IM  uint32_t TRIGGER;                /*!< Offset: 0xEE8 (R/ )  TRIGGER Register */\r
+  __IM  uint32_t FIFO0;                  /*!< Offset: 0xEEC (R/ )  Integration ETM Data */\r
+  __IM  uint32_t ITATBCTR2;              /*!< Offset: 0xEF0 (R/ )  ITATBCTR2 */\r
+        uint32_t RESERVED4[1U];\r
+  __IM  uint32_t ITATBCTR0;              /*!< Offset: 0xEF8 (R/ )  ITATBCTR0 */\r
+  __IM  uint32_t FIFO1;                  /*!< Offset: 0xEFC (R/ )  Integration ITM Data */\r
+  __IOM uint32_t ITCTRL;                 /*!< Offset: 0xF00 (R/W)  Integration Mode Control */\r
+        uint32_t RESERVED5[39U];\r
+  __IOM uint32_t CLAIMSET;               /*!< Offset: 0xFA0 (R/W)  Claim tag set */\r
+  __IOM uint32_t CLAIMCLR;               /*!< Offset: 0xFA4 (R/W)  Claim tag clear */\r
+        uint32_t RESERVED7[8U];\r
+  __IM  uint32_t DEVID;                  /*!< Offset: 0xFC8 (R/ )  TPIU_DEVID */\r
+  __IM  uint32_t DEVTYPE;                /*!< Offset: 0xFCC (R/ )  TPIU_DEVTYPE */\r
+} TPI_Type;\r
+\r
+/* TPI Asynchronous Clock Prescaler Register Definitions */\r
+#define TPI_ACPR_PRESCALER_Pos              0U                                         /*!< TPI ACPR: PRESCALER Position */\r
+#define TPI_ACPR_PRESCALER_Msk             (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/)    /*!< TPI ACPR: PRESCALER Mask */\r
+\r
+/* TPI Selected Pin Protocol Register Definitions */\r
+#define TPI_SPPR_TXMODE_Pos                 0U                                         /*!< TPI SPPR: TXMODE Position */\r
+#define TPI_SPPR_TXMODE_Msk                (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/)          /*!< TPI SPPR: TXMODE Mask */\r
+\r
+/* TPI Formatter and Flush Status Register Definitions */\r
+#define TPI_FFSR_FtNonStop_Pos              3U                                         /*!< TPI FFSR: FtNonStop Position */\r
+#define TPI_FFSR_FtNonStop_Msk             (0x1UL << TPI_FFSR_FtNonStop_Pos)           /*!< TPI FFSR: FtNonStop Mask */\r
+\r
+#define TPI_FFSR_TCPresent_Pos              2U                                         /*!< TPI FFSR: TCPresent Position */\r
+#define TPI_FFSR_TCPresent_Msk             (0x1UL << TPI_FFSR_TCPresent_Pos)           /*!< TPI FFSR: TCPresent Mask */\r
+\r
+#define TPI_FFSR_FtStopped_Pos              1U                                         /*!< TPI FFSR: FtStopped Position */\r
+#define TPI_FFSR_FtStopped_Msk             (0x1UL << TPI_FFSR_FtStopped_Pos)           /*!< TPI FFSR: FtStopped Mask */\r
+\r
+#define TPI_FFSR_FlInProg_Pos               0U                                         /*!< TPI FFSR: FlInProg Position */\r
+#define TPI_FFSR_FlInProg_Msk              (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/)        /*!< TPI FFSR: FlInProg Mask */\r
+\r
+/* TPI Formatter and Flush Control Register Definitions */\r
+#define TPI_FFCR_TrigIn_Pos                 8U                                         /*!< TPI FFCR: TrigIn Position */\r
+#define TPI_FFCR_TrigIn_Msk                (0x1UL << TPI_FFCR_TrigIn_Pos)              /*!< TPI FFCR: TrigIn Mask */\r
+\r
+#define TPI_FFCR_EnFCont_Pos                1U                                         /*!< TPI FFCR: EnFCont Position */\r
+#define TPI_FFCR_EnFCont_Msk               (0x1UL << TPI_FFCR_EnFCont_Pos)             /*!< TPI FFCR: EnFCont Mask */\r
+\r
+/* TPI TRIGGER Register Definitions */\r
+#define TPI_TRIGGER_TRIGGER_Pos             0U                                         /*!< TPI TRIGGER: TRIGGER Position */\r
+#define TPI_TRIGGER_TRIGGER_Msk            (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/)      /*!< TPI TRIGGER: TRIGGER Mask */\r
+\r
+/* TPI Integration ETM Data Register Definitions (FIFO0) */\r
+#define TPI_FIFO0_ITM_ATVALID_Pos          29U                                         /*!< TPI FIFO0: ITM_ATVALID Position */\r
+#define TPI_FIFO0_ITM_ATVALID_Msk          (0x3UL << TPI_FIFO0_ITM_ATVALID_Pos)        /*!< TPI FIFO0: ITM_ATVALID Mask */\r
+\r
+#define TPI_FIFO0_ITM_bytecount_Pos        27U                                         /*!< TPI FIFO0: ITM_bytecount Position */\r
+#define TPI_FIFO0_ITM_bytecount_Msk        (0x3UL << TPI_FIFO0_ITM_bytecount_Pos)      /*!< TPI FIFO0: ITM_bytecount Mask */\r
+\r
+#define TPI_FIFO0_ETM_ATVALID_Pos          26U                                         /*!< TPI FIFO0: ETM_ATVALID Position */\r
+#define TPI_FIFO0_ETM_ATVALID_Msk          (0x3UL << TPI_FIFO0_ETM_ATVALID_Pos)        /*!< TPI FIFO0: ETM_ATVALID Mask */\r
+\r
+#define TPI_FIFO0_ETM_bytecount_Pos        24U                                         /*!< TPI FIFO0: ETM_bytecount Position */\r
+#define TPI_FIFO0_ETM_bytecount_Msk        (0x3UL << TPI_FIFO0_ETM_bytecount_Pos)      /*!< TPI FIFO0: ETM_bytecount Mask */\r
+\r
+#define TPI_FIFO0_ETM2_Pos                 16U                                         /*!< TPI FIFO0: ETM2 Position */\r
+#define TPI_FIFO0_ETM2_Msk                 (0xFFUL << TPI_FIFO0_ETM2_Pos)              /*!< TPI FIFO0: ETM2 Mask */\r
+\r
+#define TPI_FIFO0_ETM1_Pos                  8U                                         /*!< TPI FIFO0: ETM1 Position */\r
+#define TPI_FIFO0_ETM1_Msk                 (0xFFUL << TPI_FIFO0_ETM1_Pos)              /*!< TPI FIFO0: ETM1 Mask */\r
+\r
+#define TPI_FIFO0_ETM0_Pos                  0U                                         /*!< TPI FIFO0: ETM0 Position */\r
+#define TPI_FIFO0_ETM0_Msk                 (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/)          /*!< TPI FIFO0: ETM0 Mask */\r
+\r
+/* TPI ITATBCTR2 Register Definitions */\r
+#define TPI_ITATBCTR2_ATREADY2_Pos          0U                                         /*!< TPI ITATBCTR2: ATREADY2 Position */\r
+#define TPI_ITATBCTR2_ATREADY2_Msk         (0x1UL /*<< TPI_ITATBCTR2_ATREADY2_Pos*/)   /*!< TPI ITATBCTR2: ATREADY2 Mask */\r
+\r
+#define TPI_ITATBCTR2_ATREADY1_Pos          0U                                         /*!< TPI ITATBCTR2: ATREADY1 Position */\r
+#define TPI_ITATBCTR2_ATREADY1_Msk         (0x1UL /*<< TPI_ITATBCTR2_ATREADY1_Pos*/)   /*!< TPI ITATBCTR2: ATREADY1 Mask */\r
+\r
+/* TPI Integration ITM Data Register Definitions (FIFO1) */\r
+#define TPI_FIFO1_ITM_ATVALID_Pos          29U                                         /*!< TPI FIFO1: ITM_ATVALID Position */\r
+#define TPI_FIFO1_ITM_ATVALID_Msk          (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos)        /*!< TPI FIFO1: ITM_ATVALID Mask */\r
+\r
+#define TPI_FIFO1_ITM_bytecount_Pos        27U                                         /*!< TPI FIFO1: ITM_bytecount Position */\r
+#define TPI_FIFO1_ITM_bytecount_Msk        (0x3UL << TPI_FIFO1_ITM_bytecount_Pos)      /*!< TPI FIFO1: ITM_bytecount Mask */\r
+\r
+#define TPI_FIFO1_ETM_ATVALID_Pos          26U                                         /*!< TPI FIFO1: ETM_ATVALID Position */\r
+#define TPI_FIFO1_ETM_ATVALID_Msk          (0x3UL << TPI_FIFO1_ETM_ATVALID_Pos)        /*!< TPI FIFO1: ETM_ATVALID Mask */\r
+\r
+#define TPI_FIFO1_ETM_bytecount_Pos        24U                                         /*!< TPI FIFO1: ETM_bytecount Position */\r
+#define TPI_FIFO1_ETM_bytecount_Msk        (0x3UL << TPI_FIFO1_ETM_bytecount_Pos)      /*!< TPI FIFO1: ETM_bytecount Mask */\r
+\r
+#define TPI_FIFO1_ITM2_Pos                 16U                                         /*!< TPI FIFO1: ITM2 Position */\r
+#define TPI_FIFO1_ITM2_Msk                 (0xFFUL << TPI_FIFO1_ITM2_Pos)              /*!< TPI FIFO1: ITM2 Mask */\r
+\r
+#define TPI_FIFO1_ITM1_Pos                  8U                                         /*!< TPI FIFO1: ITM1 Position */\r
+#define TPI_FIFO1_ITM1_Msk                 (0xFFUL << TPI_FIFO1_ITM1_Pos)              /*!< TPI FIFO1: ITM1 Mask */\r
+\r
+#define TPI_FIFO1_ITM0_Pos                  0U                                         /*!< TPI FIFO1: ITM0 Position */\r
+#define TPI_FIFO1_ITM0_Msk                 (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/)          /*!< TPI FIFO1: ITM0 Mask */\r
+\r
+/* TPI ITATBCTR0 Register Definitions */\r
+#define TPI_ITATBCTR0_ATREADY2_Pos          0U                                         /*!< TPI ITATBCTR0: ATREADY2 Position */\r
+#define TPI_ITATBCTR0_ATREADY2_Msk         (0x1UL /*<< TPI_ITATBCTR0_ATREADY2_Pos*/)   /*!< TPI ITATBCTR0: ATREADY2 Mask */\r
+\r
+#define TPI_ITATBCTR0_ATREADY1_Pos          0U                                         /*!< TPI ITATBCTR0: ATREADY1 Position */\r
+#define TPI_ITATBCTR0_ATREADY1_Msk         (0x1UL /*<< TPI_ITATBCTR0_ATREADY1_Pos*/)   /*!< TPI ITATBCTR0: ATREADY1 Mask */\r
+\r
+/* TPI Integration Mode Control Register Definitions */\r
+#define TPI_ITCTRL_Mode_Pos                 0U                                         /*!< TPI ITCTRL: Mode Position */\r
+#define TPI_ITCTRL_Mode_Msk                (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/)          /*!< TPI ITCTRL: Mode Mask */\r
+\r
+/* TPI DEVID Register Definitions */\r
+#define TPI_DEVID_NRZVALID_Pos             11U                                         /*!< TPI DEVID: NRZVALID Position */\r
+#define TPI_DEVID_NRZVALID_Msk             (0x1UL << TPI_DEVID_NRZVALID_Pos)           /*!< TPI DEVID: NRZVALID Mask */\r
+\r
+#define TPI_DEVID_MANCVALID_Pos            10U                                         /*!< TPI DEVID: MANCVALID Position */\r
+#define TPI_DEVID_MANCVALID_Msk            (0x1UL << TPI_DEVID_MANCVALID_Pos)          /*!< TPI DEVID: MANCVALID Mask */\r
+\r
+#define TPI_DEVID_PTINVALID_Pos             9U                                         /*!< TPI DEVID: PTINVALID Position */\r
+#define TPI_DEVID_PTINVALID_Msk            (0x1UL << TPI_DEVID_PTINVALID_Pos)          /*!< TPI DEVID: PTINVALID Mask */\r
+\r
+#define TPI_DEVID_MinBufSz_Pos              6U                                         /*!< TPI DEVID: MinBufSz Position */\r
+#define TPI_DEVID_MinBufSz_Msk             (0x7UL << TPI_DEVID_MinBufSz_Pos)           /*!< TPI DEVID: MinBufSz Mask */\r
+\r
+#define TPI_DEVID_AsynClkIn_Pos             5U                                         /*!< TPI DEVID: AsynClkIn Position */\r
+#define TPI_DEVID_AsynClkIn_Msk            (0x1UL << TPI_DEVID_AsynClkIn_Pos)          /*!< TPI DEVID: AsynClkIn Mask */\r
+\r
+#define TPI_DEVID_NrTraceInput_Pos          0U                                         /*!< TPI DEVID: NrTraceInput Position */\r
+#define TPI_DEVID_NrTraceInput_Msk         (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/)  /*!< TPI DEVID: NrTraceInput Mask */\r
+\r
+/* TPI DEVTYPE Register Definitions */\r
+#define TPI_DEVTYPE_SubType_Pos             4U                                         /*!< TPI DEVTYPE: SubType Position */\r
+#define TPI_DEVTYPE_SubType_Msk            (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/)      /*!< TPI DEVTYPE: SubType Mask */\r
+\r
+#define TPI_DEVTYPE_MajorType_Pos           0U                                         /*!< TPI DEVTYPE: MajorType Position */\r
+#define TPI_DEVTYPE_MajorType_Msk          (0xFUL << TPI_DEVTYPE_MajorType_Pos)        /*!< TPI DEVTYPE: MajorType Mask */\r
+\r
+/*@}*/ /* end of group CMSIS_TPI */\r
+\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_MPU     Memory Protection Unit (MPU)\r
+  \brief    Type definitions for the Memory Protection Unit (MPU)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Memory Protection Unit (MPU).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t TYPE;                   /*!< Offset: 0x000 (R/ )  MPU Type Register */\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x004 (R/W)  MPU Control Register */\r
+  __IOM uint32_t RNR;                    /*!< Offset: 0x008 (R/W)  MPU Region RNRber Register */\r
+  __IOM uint32_t RBAR;                   /*!< Offset: 0x00C (R/W)  MPU Region Base Address Register */\r
+  __IOM uint32_t RASR;                   /*!< Offset: 0x010 (R/W)  MPU Region Attribute and Size Register */\r
+  __IOM uint32_t RBAR_A1;                /*!< Offset: 0x014 (R/W)  MPU Alias 1 Region Base Address Register */\r
+  __IOM uint32_t RASR_A1;                /*!< Offset: 0x018 (R/W)  MPU Alias 1 Region Attribute and Size Register */\r
+  __IOM uint32_t RBAR_A2;                /*!< Offset: 0x01C (R/W)  MPU Alias 2 Region Base Address Register */\r
+  __IOM uint32_t RASR_A2;                /*!< Offset: 0x020 (R/W)  MPU Alias 2 Region Attribute and Size Register */\r
+  __IOM uint32_t RBAR_A3;                /*!< Offset: 0x024 (R/W)  MPU Alias 3 Region Base Address Register */\r
+  __IOM uint32_t RASR_A3;                /*!< Offset: 0x028 (R/W)  MPU Alias 3 Region Attribute and Size Register */\r
+} MPU_Type;\r
+\r
+#define MPU_TYPE_RALIASES                  4U\r
+\r
+/* MPU Type Register Definitions */\r
+#define MPU_TYPE_IREGION_Pos               16U                                            /*!< MPU TYPE: IREGION Position */\r
+#define MPU_TYPE_IREGION_Msk               (0xFFUL << MPU_TYPE_IREGION_Pos)               /*!< MPU TYPE: IREGION Mask */\r
+\r
+#define MPU_TYPE_DREGION_Pos                8U                                            /*!< MPU TYPE: DREGION Position */\r
+#define MPU_TYPE_DREGION_Msk               (0xFFUL << MPU_TYPE_DREGION_Pos)               /*!< MPU TYPE: DREGION Mask */\r
+\r
+#define MPU_TYPE_SEPARATE_Pos               0U                                            /*!< MPU TYPE: SEPARATE Position */\r
+#define MPU_TYPE_SEPARATE_Msk              (1UL /*<< MPU_TYPE_SEPARATE_Pos*/)             /*!< MPU TYPE: SEPARATE Mask */\r
+\r
+/* MPU Control Register Definitions */\r
+#define MPU_CTRL_PRIVDEFENA_Pos             2U                                            /*!< MPU CTRL: PRIVDEFENA Position */\r
+#define MPU_CTRL_PRIVDEFENA_Msk            (1UL << MPU_CTRL_PRIVDEFENA_Pos)               /*!< MPU CTRL: PRIVDEFENA Mask */\r
+\r
+#define MPU_CTRL_HFNMIENA_Pos               1U                                            /*!< MPU CTRL: HFNMIENA Position */\r
+#define MPU_CTRL_HFNMIENA_Msk              (1UL << MPU_CTRL_HFNMIENA_Pos)                 /*!< MPU CTRL: HFNMIENA Mask */\r
+\r
+#define MPU_CTRL_ENABLE_Pos                 0U                                            /*!< MPU CTRL: ENABLE Position */\r
+#define MPU_CTRL_ENABLE_Msk                (1UL /*<< MPU_CTRL_ENABLE_Pos*/)               /*!< MPU CTRL: ENABLE Mask */\r
+\r
+/* MPU Region Number Register Definitions */\r
+#define MPU_RNR_REGION_Pos                  0U                                            /*!< MPU RNR: REGION Position */\r
+#define MPU_RNR_REGION_Msk                 (0xFFUL /*<< MPU_RNR_REGION_Pos*/)             /*!< MPU RNR: REGION Mask */\r
+\r
+/* MPU Region Base Address Register Definitions */\r
+#define MPU_RBAR_ADDR_Pos                   5U                                            /*!< MPU RBAR: ADDR Position */\r
+#define MPU_RBAR_ADDR_Msk                  (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos)             /*!< MPU RBAR: ADDR Mask */\r
+\r
+#define MPU_RBAR_VALID_Pos                  4U                                            /*!< MPU RBAR: VALID Position */\r
+#define MPU_RBAR_VALID_Msk                 (1UL << MPU_RBAR_VALID_Pos)                    /*!< MPU RBAR: VALID Mask */\r
+\r
+#define MPU_RBAR_REGION_Pos                 0U                                            /*!< MPU RBAR: REGION Position */\r
+#define MPU_RBAR_REGION_Msk                (0xFUL /*<< MPU_RBAR_REGION_Pos*/)             /*!< MPU RBAR: REGION Mask */\r
+\r
+/* MPU Region Attribute and Size Register Definitions */\r
+#define MPU_RASR_ATTRS_Pos                 16U                                            /*!< MPU RASR: MPU Region Attribute field Position */\r
+#define MPU_RASR_ATTRS_Msk                 (0xFFFFUL << MPU_RASR_ATTRS_Pos)               /*!< MPU RASR: MPU Region Attribute field Mask */\r
+\r
+#define MPU_RASR_XN_Pos                    28U                                            /*!< MPU RASR: ATTRS.XN Position */\r
+#define MPU_RASR_XN_Msk                    (1UL << MPU_RASR_XN_Pos)                       /*!< MPU RASR: ATTRS.XN Mask */\r
+\r
+#define MPU_RASR_AP_Pos                    24U                                            /*!< MPU RASR: ATTRS.AP Position */\r
+#define MPU_RASR_AP_Msk                    (0x7UL << MPU_RASR_AP_Pos)                     /*!< MPU RASR: ATTRS.AP Mask */\r
+\r
+#define MPU_RASR_TEX_Pos                   19U                                            /*!< MPU RASR: ATTRS.TEX Position */\r
+#define MPU_RASR_TEX_Msk                   (0x7UL << MPU_RASR_TEX_Pos)                    /*!< MPU RASR: ATTRS.TEX Mask */\r
+\r
+#define MPU_RASR_S_Pos                     18U                                            /*!< MPU RASR: ATTRS.S Position */\r
+#define MPU_RASR_S_Msk                     (1UL << MPU_RASR_S_Pos)                        /*!< MPU RASR: ATTRS.S Mask */\r
+\r
+#define MPU_RASR_C_Pos                     17U                                            /*!< MPU RASR: ATTRS.C Position */\r
+#define MPU_RASR_C_Msk                     (1UL << MPU_RASR_C_Pos)                        /*!< MPU RASR: ATTRS.C Mask */\r
+\r
+#define MPU_RASR_B_Pos                     16U                                            /*!< MPU RASR: ATTRS.B Position */\r
+#define MPU_RASR_B_Msk                     (1UL << MPU_RASR_B_Pos)                        /*!< MPU RASR: ATTRS.B Mask */\r
+\r
+#define MPU_RASR_SRD_Pos                    8U                                            /*!< MPU RASR: Sub-Region Disable Position */\r
+#define MPU_RASR_SRD_Msk                   (0xFFUL << MPU_RASR_SRD_Pos)                   /*!< MPU RASR: Sub-Region Disable Mask */\r
+\r
+#define MPU_RASR_SIZE_Pos                   1U                                            /*!< MPU RASR: Region Size Field Position */\r
+#define MPU_RASR_SIZE_Msk                  (0x1FUL << MPU_RASR_SIZE_Pos)                  /*!< MPU RASR: Region Size Field Mask */\r
+\r
+#define MPU_RASR_ENABLE_Pos                 0U                                            /*!< MPU RASR: Region enable bit Position */\r
+#define MPU_RASR_ENABLE_Msk                (1UL /*<< MPU_RASR_ENABLE_Pos*/)               /*!< MPU RASR: Region enable bit Disable Mask */\r
+\r
+/*@} end of group CMSIS_MPU */\r
+#endif\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_CoreDebug       Core Debug Registers (CoreDebug)\r
+  \brief    Type definitions for the Core Debug Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Core Debug Register (CoreDebug).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t DHCSR;                  /*!< Offset: 0x000 (R/W)  Debug Halting Control and Status Register */\r
+  __OM  uint32_t DCRSR;                  /*!< Offset: 0x004 ( /W)  Debug Core Register Selector Register */\r
+  __IOM uint32_t DCRDR;                  /*!< Offset: 0x008 (R/W)  Debug Core Register Data Register */\r
+  __IOM uint32_t DEMCR;                  /*!< Offset: 0x00C (R/W)  Debug Exception and Monitor Control Register */\r
+} CoreDebug_Type;\r
+\r
+/* Debug Halting Control and Status Register Definitions */\r
+#define CoreDebug_DHCSR_DBGKEY_Pos         16U                                            /*!< CoreDebug DHCSR: DBGKEY Position */\r
+#define CoreDebug_DHCSR_DBGKEY_Msk         (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos)       /*!< CoreDebug DHCSR: DBGKEY Mask */\r
+\r
+#define CoreDebug_DHCSR_S_RESET_ST_Pos     25U                                            /*!< CoreDebug DHCSR: S_RESET_ST Position */\r
+#define CoreDebug_DHCSR_S_RESET_ST_Msk     (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos)        /*!< CoreDebug DHCSR: S_RESET_ST Mask */\r
+\r
+#define CoreDebug_DHCSR_S_RETIRE_ST_Pos    24U                                            /*!< CoreDebug DHCSR: S_RETIRE_ST Position */\r
+#define CoreDebug_DHCSR_S_RETIRE_ST_Msk    (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos)       /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */\r
+\r
+#define CoreDebug_DHCSR_S_LOCKUP_Pos       19U                                            /*!< CoreDebug DHCSR: S_LOCKUP Position */\r
+#define CoreDebug_DHCSR_S_LOCKUP_Msk       (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos)          /*!< CoreDebug DHCSR: S_LOCKUP Mask */\r
+\r
+#define CoreDebug_DHCSR_S_SLEEP_Pos        18U                                            /*!< CoreDebug DHCSR: S_SLEEP Position */\r
+#define CoreDebug_DHCSR_S_SLEEP_Msk        (1UL << CoreDebug_DHCSR_S_SLEEP_Pos)           /*!< CoreDebug DHCSR: S_SLEEP Mask */\r
+\r
+#define CoreDebug_DHCSR_S_HALT_Pos         17U                                            /*!< CoreDebug DHCSR: S_HALT Position */\r
+#define CoreDebug_DHCSR_S_HALT_Msk         (1UL << CoreDebug_DHCSR_S_HALT_Pos)            /*!< CoreDebug DHCSR: S_HALT Mask */\r
+\r
+#define CoreDebug_DHCSR_S_REGRDY_Pos       16U                                            /*!< CoreDebug DHCSR: S_REGRDY Position */\r
+#define CoreDebug_DHCSR_S_REGRDY_Msk       (1UL << CoreDebug_DHCSR_S_REGRDY_Pos)          /*!< CoreDebug DHCSR: S_REGRDY Mask */\r
+\r
+#define CoreDebug_DHCSR_C_SNAPSTALL_Pos     5U                                            /*!< CoreDebug DHCSR: C_SNAPSTALL Position */\r
+#define CoreDebug_DHCSR_C_SNAPSTALL_Msk    (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos)       /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */\r
+\r
+#define CoreDebug_DHCSR_C_MASKINTS_Pos      3U                                            /*!< CoreDebug DHCSR: C_MASKINTS Position */\r
+#define CoreDebug_DHCSR_C_MASKINTS_Msk     (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos)        /*!< CoreDebug DHCSR: C_MASKINTS Mask */\r
+\r
+#define CoreDebug_DHCSR_C_STEP_Pos          2U                                            /*!< CoreDebug DHCSR: C_STEP Position */\r
+#define CoreDebug_DHCSR_C_STEP_Msk         (1UL << CoreDebug_DHCSR_C_STEP_Pos)            /*!< CoreDebug DHCSR: C_STEP Mask */\r
+\r
+#define CoreDebug_DHCSR_C_HALT_Pos          1U                                            /*!< CoreDebug DHCSR: C_HALT Position */\r
+#define CoreDebug_DHCSR_C_HALT_Msk         (1UL << CoreDebug_DHCSR_C_HALT_Pos)            /*!< CoreDebug DHCSR: C_HALT Mask */\r
+\r
+#define CoreDebug_DHCSR_C_DEBUGEN_Pos       0U                                            /*!< CoreDebug DHCSR: C_DEBUGEN Position */\r
+#define CoreDebug_DHCSR_C_DEBUGEN_Msk      (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/)     /*!< CoreDebug DHCSR: C_DEBUGEN Mask */\r
+\r
+/* Debug Core Register Selector Register Definitions */\r
+#define CoreDebug_DCRSR_REGWnR_Pos         16U                                            /*!< CoreDebug DCRSR: REGWnR Position */\r
+#define CoreDebug_DCRSR_REGWnR_Msk         (1UL << CoreDebug_DCRSR_REGWnR_Pos)            /*!< CoreDebug DCRSR: REGWnR Mask */\r
+\r
+#define CoreDebug_DCRSR_REGSEL_Pos          0U                                            /*!< CoreDebug DCRSR: REGSEL Position */\r
+#define CoreDebug_DCRSR_REGSEL_Msk         (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/)     /*!< CoreDebug DCRSR: REGSEL Mask */\r
+\r
+/* Debug Exception and Monitor Control Register Definitions */\r
+#define CoreDebug_DEMCR_TRCENA_Pos         24U                                            /*!< CoreDebug DEMCR: TRCENA Position */\r
+#define CoreDebug_DEMCR_TRCENA_Msk         (1UL << CoreDebug_DEMCR_TRCENA_Pos)            /*!< CoreDebug DEMCR: TRCENA Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_REQ_Pos        19U                                            /*!< CoreDebug DEMCR: MON_REQ Position */\r
+#define CoreDebug_DEMCR_MON_REQ_Msk        (1UL << CoreDebug_DEMCR_MON_REQ_Pos)           /*!< CoreDebug DEMCR: MON_REQ Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_STEP_Pos       18U                                            /*!< CoreDebug DEMCR: MON_STEP Position */\r
+#define CoreDebug_DEMCR_MON_STEP_Msk       (1UL << CoreDebug_DEMCR_MON_STEP_Pos)          /*!< CoreDebug DEMCR: MON_STEP Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_PEND_Pos       17U                                            /*!< CoreDebug DEMCR: MON_PEND Position */\r
+#define CoreDebug_DEMCR_MON_PEND_Msk       (1UL << CoreDebug_DEMCR_MON_PEND_Pos)          /*!< CoreDebug DEMCR: MON_PEND Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_EN_Pos         16U                                            /*!< CoreDebug DEMCR: MON_EN Position */\r
+#define CoreDebug_DEMCR_MON_EN_Msk         (1UL << CoreDebug_DEMCR_MON_EN_Pos)            /*!< CoreDebug DEMCR: MON_EN Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_HARDERR_Pos     10U                                            /*!< CoreDebug DEMCR: VC_HARDERR Position */\r
+#define CoreDebug_DEMCR_VC_HARDERR_Msk     (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos)        /*!< CoreDebug DEMCR: VC_HARDERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_INTERR_Pos       9U                                            /*!< CoreDebug DEMCR: VC_INTERR Position */\r
+#define CoreDebug_DEMCR_VC_INTERR_Msk      (1UL << CoreDebug_DEMCR_VC_INTERR_Pos)         /*!< CoreDebug DEMCR: VC_INTERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_BUSERR_Pos       8U                                            /*!< CoreDebug DEMCR: VC_BUSERR Position */\r
+#define CoreDebug_DEMCR_VC_BUSERR_Msk      (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos)         /*!< CoreDebug DEMCR: VC_BUSERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_STATERR_Pos      7U                                            /*!< CoreDebug DEMCR: VC_STATERR Position */\r
+#define CoreDebug_DEMCR_VC_STATERR_Msk     (1UL << CoreDebug_DEMCR_VC_STATERR_Pos)        /*!< CoreDebug DEMCR: VC_STATERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_CHKERR_Pos       6U                                            /*!< CoreDebug DEMCR: VC_CHKERR Position */\r
+#define CoreDebug_DEMCR_VC_CHKERR_Msk      (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos)         /*!< CoreDebug DEMCR: VC_CHKERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_NOCPERR_Pos      5U                                            /*!< CoreDebug DEMCR: VC_NOCPERR Position */\r
+#define CoreDebug_DEMCR_VC_NOCPERR_Msk     (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos)        /*!< CoreDebug DEMCR: VC_NOCPERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_MMERR_Pos        4U                                            /*!< CoreDebug DEMCR: VC_MMERR Position */\r
+#define CoreDebug_DEMCR_VC_MMERR_Msk       (1UL << CoreDebug_DEMCR_VC_MMERR_Pos)          /*!< CoreDebug DEMCR: VC_MMERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_CORERESET_Pos    0U                                            /*!< CoreDebug DEMCR: VC_CORERESET Position */\r
+#define CoreDebug_DEMCR_VC_CORERESET_Msk   (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/)  /*!< CoreDebug DEMCR: VC_CORERESET Mask */\r
+\r
+/*@} end of group CMSIS_CoreDebug */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_bitfield     Core register bit field macros\r
+  \brief      Macros for use with bit field definitions (xxx_Pos, xxx_Msk).\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   Mask and shift a bit field value for use in a register bit range.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of the bit field. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted value.\r
+*/\r
+#define _VAL2FLD(field, value)    (((uint32_t)(value) << field ## _Pos) & field ## _Msk)\r
+\r
+/**\r
+  \brief     Mask and shift a register value to extract a bit filed value.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of register. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted bit field value.\r
+*/\r
+#define _FLD2VAL(field, value)    (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)\r
+\r
+/*@} end of group CMSIS_core_bitfield */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_base     Core Definitions\r
+  \brief      Definitions for base addresses, unions, and structures.\r
+  @{\r
+ */\r
+\r
+/* Memory mapping of Core Hardware */\r
+#define SCS_BASE            (0xE000E000UL)                            /*!< System Control Space Base Address */\r
+#define ITM_BASE            (0xE0000000UL)                            /*!< ITM Base Address */\r
+#define DWT_BASE            (0xE0001000UL)                            /*!< DWT Base Address */\r
+#define TPI_BASE            (0xE0040000UL)                            /*!< TPI Base Address */\r
+#define CoreDebug_BASE      (0xE000EDF0UL)                            /*!< Core Debug Base Address */\r
+#define SysTick_BASE        (SCS_BASE +  0x0010UL)                    /*!< SysTick Base Address */\r
+#define NVIC_BASE           (SCS_BASE +  0x0100UL)                    /*!< NVIC Base Address */\r
+#define SCB_BASE            (SCS_BASE +  0x0D00UL)                    /*!< System Control Block Base Address */\r
+\r
+#define SCnSCB              ((SCnSCB_Type    *)     SCS_BASE      )   /*!< System control Register not in SCB */\r
+#define SCB                 ((SCB_Type       *)     SCB_BASE      )   /*!< SCB configuration struct */\r
+#define SysTick             ((SysTick_Type   *)     SysTick_BASE  )   /*!< SysTick configuration struct */\r
+#define NVIC                ((NVIC_Type      *)     NVIC_BASE     )   /*!< NVIC configuration struct */\r
+#define ITM                 ((ITM_Type       *)     ITM_BASE      )   /*!< ITM configuration struct */\r
+#define DWT                 ((DWT_Type       *)     DWT_BASE      )   /*!< DWT configuration struct */\r
+#define TPI                 ((TPI_Type       *)     TPI_BASE      )   /*!< TPI configuration struct */\r
+#define CoreDebug           ((CoreDebug_Type *)     CoreDebug_BASE)   /*!< Core Debug configuration struct */\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+  #define MPU_BASE          (SCS_BASE +  0x0D90UL)                    /*!< Memory Protection Unit */\r
+  #define MPU               ((MPU_Type       *)     MPU_BASE      )   /*!< Memory Protection Unit */\r
+#endif\r
+\r
+/*@} */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                Hardware Abstraction Layer\r
+  Core Function Interface contains:\r
+  - Core NVIC Functions\r
+  - Core SysTick Functions\r
+  - Core Debug Functions\r
+  - Core Register Access Functions\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference\r
+*/\r
+\r
+\r
+\r
+/* ##########################   NVIC functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_NVICFunctions NVIC Functions\r
+  \brief    Functions that manage interrupts and exceptions via the NVIC.\r
+  @{\r
+ */\r
+\r
+#ifdef CMSIS_NVIC_VIRTUAL\r
+  #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+    #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"\r
+  #endif\r
+  #include CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+#else\r
+  #define NVIC_SetPriorityGrouping    __NVIC_SetPriorityGrouping\r
+  #define NVIC_GetPriorityGrouping    __NVIC_GetPriorityGrouping\r
+  #define NVIC_EnableIRQ              __NVIC_EnableIRQ\r
+  #define NVIC_GetEnableIRQ           __NVIC_GetEnableIRQ\r
+  #define NVIC_DisableIRQ             __NVIC_DisableIRQ\r
+  #define NVIC_GetPendingIRQ          __NVIC_GetPendingIRQ\r
+  #define NVIC_SetPendingIRQ          __NVIC_SetPendingIRQ\r
+  #define NVIC_ClearPendingIRQ        __NVIC_ClearPendingIRQ\r
+  #define NVIC_GetActive              __NVIC_GetActive\r
+  #define NVIC_SetPriority            __NVIC_SetPriority\r
+  #define NVIC_GetPriority            __NVIC_GetPriority\r
+  #define NVIC_SystemReset            __NVIC_SystemReset\r
+#endif /* CMSIS_NVIC_VIRTUAL */\r
+\r
+#ifdef CMSIS_VECTAB_VIRTUAL\r
+  #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+   #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"\r
+  #endif\r
+  #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+#else\r
+  #define NVIC_SetVector              __NVIC_SetVector\r
+  #define NVIC_GetVector              __NVIC_GetVector\r
+#endif  /* (CMSIS_VECTAB_VIRTUAL) */\r
+\r
+#define NVIC_USER_IRQ_OFFSET          16\r
+\r
+\r
+/* The following EXC_RETURN values are saved the LR on exception entry */\r
+#define EXC_RETURN_HANDLER         (0xFFFFFFF1UL)     /* return to Handler mode, uses MSP after return                               */\r
+#define EXC_RETURN_THREAD_MSP      (0xFFFFFFF9UL)     /* return to Thread mode, uses MSP after return                                */\r
+#define EXC_RETURN_THREAD_PSP      (0xFFFFFFFDUL)     /* return to Thread mode, uses PSP after return                                */\r
+\r
+\r
+/**\r
+  \brief   Set Priority Grouping\r
+  \details Sets the priority grouping field using the required unlock sequence.\r
+           The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field.\r
+           Only values from 0..7 are used.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.\r
+  \param [in]      PriorityGroup  Priority grouping field.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup)\r
+{\r
+  uint32_t reg_value;\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);             /* only values 0..7 are used          */\r
+\r
+  reg_value  =  SCB->AIRCR;                                                   /* read old register configuration    */\r
+  reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change               */\r
+  reg_value  =  (reg_value                                   |\r
+                ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |\r
+                (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) );               /* Insert write key and priority group */\r
+  SCB->AIRCR =  reg_value;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Priority Grouping\r
+  \details Reads the priority grouping field from the NVIC Interrupt Controller.\r
+  \return                Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field).\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void)\r
+{\r
+  return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos));\r
+}\r
+\r
+\r
+/**\r
+  \brief   Enable Interrupt\r
+  \details Enables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Enable status\r
+  \details Returns a device specific interrupt enable status from the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt is not enabled.\r
+  \return             1  Interrupt is enabled.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Disable Interrupt\r
+  \details Disables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+    __DSB();\r
+    __ISB();\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Pending Interrupt\r
+  \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not pending.\r
+  \return             1  Interrupt status is pending.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Pending Interrupt\r
+  \details Sets the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Clear Pending Interrupt\r
+  \details Clears the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Active Interrupt\r
+  \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not active.\r
+  \return             1  Interrupt status is active.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Priority\r
+  \details Sets the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]      IRQn  Interrupt number.\r
+  \param [in]  priority  Priority to set.\r
+  \note    The priority cannot be set for every processor exception.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->IP[((uint32_t)IRQn)]               = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);\r
+  }\r
+  else\r
+  {\r
+    SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Priority\r
+  \details Reads the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn  Interrupt number.\r
+  \return             Interrupt Priority.\r
+                      Value is aligned automatically to the implemented priority bits of the microcontroller.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)\r
+{\r
+\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return(((uint32_t)NVIC->IP[((uint32_t)IRQn)]               >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+  else\r
+  {\r
+    return(((uint32_t)SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Encode Priority\r
+  \details Encodes the priority for an interrupt with the given priority group,\r
+           preemptive priority value, and subpriority value.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.\r
+  \param [in]     PriorityGroup  Used priority group.\r
+  \param [in]   PreemptPriority  Preemptive priority value (starting from 0).\r
+  \param [in]       SubPriority  Subpriority value (starting from 0).\r
+  \return                        Encoded priority. Value can be used in the function \ref NVIC_SetPriority().\r
+ */\r
+__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);\r
+  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));\r
+\r
+  return (\r
+           ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |\r
+           ((SubPriority     & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL)))\r
+         );\r
+}\r
+\r
+\r
+/**\r
+  \brief   Decode Priority\r
+  \details Decodes an interrupt priority value with a given priority group to\r
+           preemptive priority value and subpriority value.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.\r
+  \param [in]         Priority   Priority value, which can be retrieved with the function \ref NVIC_GetPriority().\r
+  \param [in]     PriorityGroup  Used priority group.\r
+  \param [out] pPreemptPriority  Preemptive priority value (starting from 0).\r
+  \param [out]     pSubPriority  Subpriority value (starting from 0).\r
+ */\r
+__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);\r
+  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));\r
+\r
+  *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);\r
+  *pSubPriority     = (Priority                   ) & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Vector\r
+  \details Sets an interrupt vector in SRAM based interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+           VTOR must been relocated to SRAM before.\r
+  \param [in]   IRQn      Interrupt number\r
+  \param [in]   vector    Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)\r
+{\r
+  uint32_t *vectors = (uint32_t *)SCB->VTOR;\r
+  vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Vector\r
+  \details Reads an interrupt vector from interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn      Interrupt number.\r
+  \return                 Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)\r
+{\r
+  uint32_t *vectors = (uint32_t *)SCB->VTOR;\r
+  return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];\r
+}\r
+\r
+\r
+/**\r
+  \brief   System Reset\r
+  \details Initiates a system reset request to reset the MCU.\r
+ */\r
+__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)\r
+{\r
+  __DSB();                                                          /* Ensure all outstanding memory accesses included\r
+                                                                       buffered write are completed before reset */\r
+  SCB->AIRCR  = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos)    |\r
+                           (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |\r
+                            SCB_AIRCR_SYSRESETREQ_Msk    );         /* Keep priority group unchanged */\r
+  __DSB();                                                          /* Ensure completion of memory access */\r
+\r
+  for(;;)                                                           /* wait until reset */\r
+  {\r
+    __NOP();\r
+  }\r
+}\r
+\r
+/*@} end of CMSIS_Core_NVICFunctions */\r
+\r
+/* ##########################  MPU functions  #################################### */\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+\r
+#include "mpu_armv7.h"\r
+\r
+#endif\r
+\r
+/* ##########################  FPU functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_FpuFunctions FPU Functions\r
+  \brief    Function that provides FPU type.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   get FPU type\r
+  \details returns the FPU type\r
+  \returns\r
+   - \b  0: No FPU\r
+   - \b  1: Single precision FPU\r
+   - \b  2: Double + Single precision FPU\r
+ */\r
+__STATIC_INLINE uint32_t SCB_GetFPUType(void)\r
+{\r
+    return 0U;           /* No FPU */\r
+}\r
+\r
+\r
+/*@} end of CMSIS_Core_FpuFunctions */\r
+\r
+\r
+\r
+/* ##################################    SysTick function  ############################################ */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_SysTickFunctions SysTick Functions\r
+  \brief    Functions that configure the System.\r
+  @{\r
+ */\r
+\r
+#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)\r
+\r
+/**\r
+  \brief   System Tick Configuration\r
+  \details Initializes the System Timer and its interrupt, and starts the System Tick Timer.\r
+           Counter is in free running mode to generate periodic interrupts.\r
+  \param [in]  ticks  Number of ticks between two interrupts.\r
+  \return          0  Function succeeded.\r
+  \return          1  Function failed.\r
+  \note    When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the\r
+           function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>\r
+           must contain a vendor-specific implementation of this function.\r
+ */\r
+__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)\r
+{\r
+  if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)\r
+  {\r
+    return (1UL);                                                   /* Reload value impossible */\r
+  }\r
+\r
+  SysTick->LOAD  = (uint32_t)(ticks - 1UL);                         /* set reload register */\r
+  NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */\r
+  SysTick->VAL   = 0UL;                                             /* Load the SysTick Counter Value */\r
+  SysTick->CTRL  = SysTick_CTRL_CLKSOURCE_Msk |\r
+                   SysTick_CTRL_TICKINT_Msk   |\r
+                   SysTick_CTRL_ENABLE_Msk;                         /* Enable SysTick IRQ and SysTick Timer */\r
+  return (0UL);                                                     /* Function successful */\r
+}\r
+\r
+#endif\r
+\r
+/*@} end of CMSIS_Core_SysTickFunctions */\r
+\r
+\r
+\r
+/* ##################################### Debug In/Output function ########################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_core_DebugFunctions ITM Functions\r
+  \brief    Functions that access the ITM debug interface.\r
+  @{\r
+ */\r
+\r
+extern volatile int32_t ITM_RxBuffer;                              /*!< External variable to receive characters. */\r
+#define                 ITM_RXBUFFER_EMPTY  ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */\r
+\r
+\r
+/**\r
+  \brief   ITM Send Character\r
+  \details Transmits a character via the ITM channel 0, and\r
+           \li Just returns when no debugger is connected that has booked the output.\r
+           \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted.\r
+  \param [in]     ch  Character to transmit.\r
+  \returns            Character to transmit.\r
+ */\r
+__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch)\r
+{\r
+  if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) &&      /* ITM enabled */\r
+      ((ITM->TER & 1UL               ) != 0UL)   )     /* ITM Port #0 enabled */\r
+  {\r
+    while (ITM->PORT[0U].u32 == 0UL)\r
+    {\r
+      __NOP();\r
+    }\r
+    ITM->PORT[0U].u8 = (uint8_t)ch;\r
+  }\r
+  return (ch);\r
+}\r
+\r
+\r
+/**\r
+  \brief   ITM Receive Character\r
+  \details Inputs a character via the external variable \ref ITM_RxBuffer.\r
+  \return             Received character.\r
+  \return         -1  No character pending.\r
+ */\r
+__STATIC_INLINE int32_t ITM_ReceiveChar (void)\r
+{\r
+  int32_t ch = -1;                           /* no character available */\r
+\r
+  if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY)\r
+  {\r
+    ch = ITM_RxBuffer;\r
+    ITM_RxBuffer = ITM_RXBUFFER_EMPTY;       /* ready for next character */\r
+  }\r
+\r
+  return (ch);\r
+}\r
+\r
+\r
+/**\r
+  \brief   ITM Check Character\r
+  \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer.\r
+  \return          0  No character available.\r
+  \return          1  Character available.\r
+ */\r
+__STATIC_INLINE int32_t ITM_CheckChar (void)\r
+{\r
+\r
+  if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY)\r
+  {\r
+    return (0);                              /* no character available */\r
+  }\r
+  else\r
+  {\r
+    return (1);                              /*    character available */\r
+  }\r
+}\r
+\r
+/*@} end of CMSIS_core_DebugFunctions */\r
+\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_CM3_H_DEPENDANT */\r
+\r
+#endif /* __CMSIS_GENERIC */\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm33.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm33.h
new file mode 100644 (file)
index 0000000..02f82e2
--- /dev/null
@@ -0,0 +1,3002 @@
+/**************************************************************************//**\r
+ * @file     core_cm33.h\r
+ * @brief    CMSIS Cortex-M33 Core Peripheral Access Layer Header File\r
+ * @version  V5.0.9\r
+ * @date     06. July 2018\r
+ ******************************************************************************/\r
+/*\r
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.\r
+ *\r
+ * SPDX-License-Identifier: Apache-2.0\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the License); you may\r
+ * not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#if   defined ( __ICCARM__ )\r
+  #pragma system_include         /* treat file as system include file for MISRA check */\r
+#elif defined (__clang__)\r
+  #pragma clang system_header   /* treat file as system include file */\r
+#endif\r
+\r
+#ifndef __CORE_CM33_H_GENERIC\r
+#define __CORE_CM33_H_GENERIC\r
+\r
+#include <stdint.h>\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/**\r
+  \page CMSIS_MISRA_Exceptions  MISRA-C:2004 Compliance Exceptions\r
+  CMSIS violates the following MISRA-C:2004 rules:\r
+\r
+   \li Required Rule 8.5, object/function definition in header file.<br>\r
+     Function definitions in header files are used to allow 'inlining'.\r
+\r
+   \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>\r
+     Unions are used for effective representation of core registers.\r
+\r
+   \li Advisory Rule 19.7, Function-like macro defined.<br>\r
+     Function-like macros are used to allow more efficient code.\r
+ */\r
+\r
+\r
+/*******************************************************************************\r
+ *                 CMSIS definitions\r
+ ******************************************************************************/\r
+/**\r
+  \ingroup Cortex_M33\r
+  @{\r
+ */\r
+\r
+#include "cmsis_version.h"\r
+\r
+/*  CMSIS CM33 definitions */\r
+#define __CM33_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                   /*!< \deprecated [31:16] CMSIS HAL main version */\r
+#define __CM33_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                    /*!< \deprecated [15:0]  CMSIS HAL sub version */\r
+#define __CM33_CMSIS_VERSION       ((__CM33_CMSIS_VERSION_MAIN << 16U) | \\r
+                                     __CM33_CMSIS_VERSION_SUB           )      /*!< \deprecated CMSIS HAL version number */\r
+\r
+#define __CORTEX_M                 (33U)                                       /*!< Cortex-M Core */\r
+\r
+/** __FPU_USED indicates whether an FPU is used or not.\r
+    For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions.\r
+*/\r
+#if defined ( __CC_ARM )\r
+  #if defined (__TARGET_FPU_VFP)\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+  #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U)\r
+    #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U)\r
+      #define __DSP_USED       1U\r
+    #else\r
+      #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)"\r
+      #define __DSP_USED         0U\r
+    #endif\r
+  #else\r
+    #define __DSP_USED         0U\r
+  #endif\r
+\r
+#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)\r
+  #if defined (__ARM_PCS_VFP)\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+  #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U)\r
+    #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U)\r
+      #define __DSP_USED       1U\r
+    #else\r
+      #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)"\r
+      #define __DSP_USED         0U\r
+    #endif\r
+  #else\r
+    #define __DSP_USED         0U\r
+  #endif\r
+\r
+#elif defined ( __GNUC__ )\r
+  #if defined (__VFP_FP__) && !defined(__SOFTFP__)\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+  #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U)\r
+    #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U)\r
+      #define __DSP_USED       1U\r
+    #else\r
+      #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)"\r
+      #define __DSP_USED         0U\r
+    #endif\r
+  #else\r
+    #define __DSP_USED         0U\r
+  #endif\r
+\r
+#elif defined ( __ICCARM__ )\r
+  #if defined (__ARMVFP__)\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+  #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U)\r
+    #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U)\r
+      #define __DSP_USED       1U\r
+    #else\r
+      #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)"\r
+      #define __DSP_USED         0U\r
+    #endif\r
+  #else\r
+    #define __DSP_USED         0U\r
+  #endif\r
+\r
+#elif defined ( __TI_ARM__ )\r
+  #if defined (__TI_VFP_SUPPORT__)\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+#elif defined ( __TASKING__ )\r
+  #if defined (__FPU_VFP__)\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+#elif defined ( __CSMC__ )\r
+  #if ( __CSMC__ & 0x400U)\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+#endif\r
+\r
+#include "cmsis_compiler.h"               /* CMSIS compiler specific defines */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_CM33_H_GENERIC */\r
+\r
+#ifndef __CMSIS_GENERIC\r
+\r
+#ifndef __CORE_CM33_H_DEPENDANT\r
+#define __CORE_CM33_H_DEPENDANT\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/* check device defines and use defaults */\r
+#if defined __CHECK_DEVICE_DEFINES\r
+  #ifndef __CM33_REV\r
+    #define __CM33_REV                0x0000U\r
+    #warning "__CM33_REV not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __FPU_PRESENT\r
+    #define __FPU_PRESENT             0U\r
+    #warning "__FPU_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __MPU_PRESENT\r
+    #define __MPU_PRESENT             0U\r
+    #warning "__MPU_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __SAUREGION_PRESENT\r
+    #define __SAUREGION_PRESENT       0U\r
+    #warning "__SAUREGION_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __DSP_PRESENT\r
+    #define __DSP_PRESENT             0U\r
+    #warning "__DSP_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __NVIC_PRIO_BITS\r
+    #define __NVIC_PRIO_BITS          3U\r
+    #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __Vendor_SysTickConfig\r
+    #define __Vendor_SysTickConfig    0U\r
+    #warning "__Vendor_SysTickConfig not defined in device header file; using default!"\r
+  #endif\r
+#endif\r
+\r
+/* IO definitions (access restrictions to peripheral registers) */\r
+/**\r
+    \defgroup CMSIS_glob_defs CMSIS Global Defines\r
+\r
+    <strong>IO Type Qualifiers</strong> are used\r
+    \li to specify the access to peripheral variables.\r
+    \li for automatic generation of peripheral register debug information.\r
+*/\r
+#ifdef __cplusplus\r
+  #define   __I     volatile             /*!< Defines 'read only' permissions */\r
+#else\r
+  #define   __I     volatile const       /*!< Defines 'read only' permissions */\r
+#endif\r
+#define     __O     volatile             /*!< Defines 'write only' permissions */\r
+#define     __IO    volatile             /*!< Defines 'read / write' permissions */\r
+\r
+/* following defines should be used for structure members */\r
+#define     __IM     volatile const      /*! Defines 'read only' structure member permissions */\r
+#define     __OM     volatile            /*! Defines 'write only' structure member permissions */\r
+#define     __IOM    volatile            /*! Defines 'read / write' structure member permissions */\r
+\r
+/*@} end of group Cortex_M33 */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                 Register Abstraction\r
+  Core Register contain:\r
+  - Core Register\r
+  - Core NVIC Register\r
+  - Core SCB Register\r
+  - Core SysTick Register\r
+  - Core Debug Register\r
+  - Core MPU Register\r
+  - Core SAU Register\r
+  - Core FPU Register\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_core_register Defines and Type Definitions\r
+  \brief Type definitions and defines for Cortex-M processor based devices.\r
+*/\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_CORE  Status and Control Registers\r
+  \brief      Core Register type definitions.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Union type to access the Application Program Status Register (APSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t _reserved0:16;              /*!< bit:  0..15  Reserved */\r
+    uint32_t GE:4;                       /*!< bit: 16..19  Greater than or Equal flags */\r
+    uint32_t _reserved1:7;               /*!< bit: 20..26  Reserved */\r
+    uint32_t Q:1;                        /*!< bit:     27  Saturation condition flag */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} APSR_Type;\r
+\r
+/* APSR Register Definitions */\r
+#define APSR_N_Pos                         31U                                            /*!< APSR: N Position */\r
+#define APSR_N_Msk                         (1UL << APSR_N_Pos)                            /*!< APSR: N Mask */\r
+\r
+#define APSR_Z_Pos                         30U                                            /*!< APSR: Z Position */\r
+#define APSR_Z_Msk                         (1UL << APSR_Z_Pos)                            /*!< APSR: Z Mask */\r
+\r
+#define APSR_C_Pos                         29U                                            /*!< APSR: C Position */\r
+#define APSR_C_Msk                         (1UL << APSR_C_Pos)                            /*!< APSR: C Mask */\r
+\r
+#define APSR_V_Pos                         28U                                            /*!< APSR: V Position */\r
+#define APSR_V_Msk                         (1UL << APSR_V_Pos)                            /*!< APSR: V Mask */\r
+\r
+#define APSR_Q_Pos                         27U                                            /*!< APSR: Q Position */\r
+#define APSR_Q_Msk                         (1UL << APSR_Q_Pos)                            /*!< APSR: Q Mask */\r
+\r
+#define APSR_GE_Pos                        16U                                            /*!< APSR: GE Position */\r
+#define APSR_GE_Msk                        (0xFUL << APSR_GE_Pos)                         /*!< APSR: GE Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Interrupt Program Status Register (IPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:23;              /*!< bit:  9..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} IPSR_Type;\r
+\r
+/* IPSR Register Definitions */\r
+#define IPSR_ISR_Pos                        0U                                            /*!< IPSR: ISR Position */\r
+#define IPSR_ISR_Msk                       (0x1FFUL /*<< IPSR_ISR_Pos*/)                  /*!< IPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Special-Purpose Program Status Registers (xPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:7;               /*!< bit:  9..15  Reserved */\r
+    uint32_t GE:4;                       /*!< bit: 16..19  Greater than or Equal flags */\r
+    uint32_t _reserved1:4;               /*!< bit: 20..23  Reserved */\r
+    uint32_t T:1;                        /*!< bit:     24  Thumb bit        (read 0) */\r
+    uint32_t IT:2;                       /*!< bit: 25..26  saved IT state   (read 0) */\r
+    uint32_t Q:1;                        /*!< bit:     27  Saturation condition flag */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} xPSR_Type;\r
+\r
+/* xPSR Register Definitions */\r
+#define xPSR_N_Pos                         31U                                            /*!< xPSR: N Position */\r
+#define xPSR_N_Msk                         (1UL << xPSR_N_Pos)                            /*!< xPSR: N Mask */\r
+\r
+#define xPSR_Z_Pos                         30U                                            /*!< xPSR: Z Position */\r
+#define xPSR_Z_Msk                         (1UL << xPSR_Z_Pos)                            /*!< xPSR: Z Mask */\r
+\r
+#define xPSR_C_Pos                         29U                                            /*!< xPSR: C Position */\r
+#define xPSR_C_Msk                         (1UL << xPSR_C_Pos)                            /*!< xPSR: C Mask */\r
+\r
+#define xPSR_V_Pos                         28U                                            /*!< xPSR: V Position */\r
+#define xPSR_V_Msk                         (1UL << xPSR_V_Pos)                            /*!< xPSR: V Mask */\r
+\r
+#define xPSR_Q_Pos                         27U                                            /*!< xPSR: Q Position */\r
+#define xPSR_Q_Msk                         (1UL << xPSR_Q_Pos)                            /*!< xPSR: Q Mask */\r
+\r
+#define xPSR_IT_Pos                        25U                                            /*!< xPSR: IT Position */\r
+#define xPSR_IT_Msk                        (3UL << xPSR_IT_Pos)                           /*!< xPSR: IT Mask */\r
+\r
+#define xPSR_T_Pos                         24U                                            /*!< xPSR: T Position */\r
+#define xPSR_T_Msk                         (1UL << xPSR_T_Pos)                            /*!< xPSR: T Mask */\r
+\r
+#define xPSR_GE_Pos                        16U                                            /*!< xPSR: GE Position */\r
+#define xPSR_GE_Msk                        (0xFUL << xPSR_GE_Pos)                         /*!< xPSR: GE Mask */\r
+\r
+#define xPSR_ISR_Pos                        0U                                            /*!< xPSR: ISR Position */\r
+#define xPSR_ISR_Msk                       (0x1FFUL /*<< xPSR_ISR_Pos*/)                  /*!< xPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Control Registers (CONTROL).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t nPRIV:1;                    /*!< bit:      0  Execution privilege in Thread mode */\r
+    uint32_t SPSEL:1;                    /*!< bit:      1  Stack-pointer select */\r
+    uint32_t FPCA:1;                     /*!< bit:      2  Floating-point context active */\r
+    uint32_t SFPA:1;                     /*!< bit:      3  Secure floating-point active */\r
+    uint32_t _reserved1:28;              /*!< bit:  4..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} CONTROL_Type;\r
+\r
+/* CONTROL Register Definitions */\r
+#define CONTROL_SFPA_Pos                    3U                                            /*!< CONTROL: SFPA Position */\r
+#define CONTROL_SFPA_Msk                   (1UL << CONTROL_SFPA_Pos)                      /*!< CONTROL: SFPA Mask */\r
+\r
+#define CONTROL_FPCA_Pos                    2U                                            /*!< CONTROL: FPCA Position */\r
+#define CONTROL_FPCA_Msk                   (1UL << CONTROL_FPCA_Pos)                      /*!< CONTROL: FPCA Mask */\r
+\r
+#define CONTROL_SPSEL_Pos                   1U                                            /*!< CONTROL: SPSEL Position */\r
+#define CONTROL_SPSEL_Msk                  (1UL << CONTROL_SPSEL_Pos)                     /*!< CONTROL: SPSEL Mask */\r
+\r
+#define CONTROL_nPRIV_Pos                   0U                                            /*!< CONTROL: nPRIV Position */\r
+#define CONTROL_nPRIV_Msk                  (1UL /*<< CONTROL_nPRIV_Pos*/)                 /*!< CONTROL: nPRIV Mask */\r
+\r
+/*@} end of group CMSIS_CORE */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_NVIC  Nested Vectored Interrupt Controller (NVIC)\r
+  \brief      Type definitions for the NVIC Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Nested Vectored Interrupt Controller (NVIC).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t ISER[16U];              /*!< Offset: 0x000 (R/W)  Interrupt Set Enable Register */\r
+        uint32_t RESERVED0[16U];\r
+  __IOM uint32_t ICER[16U];              /*!< Offset: 0x080 (R/W)  Interrupt Clear Enable Register */\r
+        uint32_t RSERVED1[16U];\r
+  __IOM uint32_t ISPR[16U];              /*!< Offset: 0x100 (R/W)  Interrupt Set Pending Register */\r
+        uint32_t RESERVED2[16U];\r
+  __IOM uint32_t ICPR[16U];              /*!< Offset: 0x180 (R/W)  Interrupt Clear Pending Register */\r
+        uint32_t RESERVED3[16U];\r
+  __IOM uint32_t IABR[16U];              /*!< Offset: 0x200 (R/W)  Interrupt Active bit Register */\r
+        uint32_t RESERVED4[16U];\r
+  __IOM uint32_t ITNS[16U];              /*!< Offset: 0x280 (R/W)  Interrupt Non-Secure State Register */\r
+        uint32_t RESERVED5[16U];\r
+  __IOM uint8_t  IPR[496U];              /*!< Offset: 0x300 (R/W)  Interrupt Priority Register (8Bit wide) */\r
+        uint32_t RESERVED6[580U];\r
+  __OM  uint32_t STIR;                   /*!< Offset: 0xE00 ( /W)  Software Trigger Interrupt Register */\r
+}  NVIC_Type;\r
+\r
+/* Software Triggered Interrupt Register Definitions */\r
+#define NVIC_STIR_INTID_Pos                 0U                                         /*!< STIR: INTLINESNUM Position */\r
+#define NVIC_STIR_INTID_Msk                (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/)        /*!< STIR: INTLINESNUM Mask */\r
+\r
+/*@} end of group CMSIS_NVIC */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SCB     System Control Block (SCB)\r
+  \brief    Type definitions for the System Control Block Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Control Block (SCB).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t CPUID;                  /*!< Offset: 0x000 (R/ )  CPUID Base Register */\r
+  __IOM uint32_t ICSR;                   /*!< Offset: 0x004 (R/W)  Interrupt Control and State Register */\r
+  __IOM uint32_t VTOR;                   /*!< Offset: 0x008 (R/W)  Vector Table Offset Register */\r
+  __IOM uint32_t AIRCR;                  /*!< Offset: 0x00C (R/W)  Application Interrupt and Reset Control Register */\r
+  __IOM uint32_t SCR;                    /*!< Offset: 0x010 (R/W)  System Control Register */\r
+  __IOM uint32_t CCR;                    /*!< Offset: 0x014 (R/W)  Configuration Control Register */\r
+  __IOM uint8_t  SHPR[12U];              /*!< Offset: 0x018 (R/W)  System Handlers Priority Registers (4-7, 8-11, 12-15) */\r
+  __IOM uint32_t SHCSR;                  /*!< Offset: 0x024 (R/W)  System Handler Control and State Register */\r
+  __IOM uint32_t CFSR;                   /*!< Offset: 0x028 (R/W)  Configurable Fault Status Register */\r
+  __IOM uint32_t HFSR;                   /*!< Offset: 0x02C (R/W)  HardFault Status Register */\r
+  __IOM uint32_t DFSR;                   /*!< Offset: 0x030 (R/W)  Debug Fault Status Register */\r
+  __IOM uint32_t MMFAR;                  /*!< Offset: 0x034 (R/W)  MemManage Fault Address Register */\r
+  __IOM uint32_t BFAR;                   /*!< Offset: 0x038 (R/W)  BusFault Address Register */\r
+  __IOM uint32_t AFSR;                   /*!< Offset: 0x03C (R/W)  Auxiliary Fault Status Register */\r
+  __IM  uint32_t ID_PFR[2U];             /*!< Offset: 0x040 (R/ )  Processor Feature Register */\r
+  __IM  uint32_t ID_DFR;                 /*!< Offset: 0x048 (R/ )  Debug Feature Register */\r
+  __IM  uint32_t ID_ADR;                 /*!< Offset: 0x04C (R/ )  Auxiliary Feature Register */\r
+  __IM  uint32_t ID_MMFR[4U];            /*!< Offset: 0x050 (R/ )  Memory Model Feature Register */\r
+  __IM  uint32_t ID_ISAR[6U];            /*!< Offset: 0x060 (R/ )  Instruction Set Attributes Register */\r
+  __IM  uint32_t CLIDR;                  /*!< Offset: 0x078 (R/ )  Cache Level ID register */\r
+  __IM  uint32_t CTR;                    /*!< Offset: 0x07C (R/ )  Cache Type register */\r
+  __IM  uint32_t CCSIDR;                 /*!< Offset: 0x080 (R/ )  Cache Size ID Register */\r
+  __IOM uint32_t CSSELR;                 /*!< Offset: 0x084 (R/W)  Cache Size Selection Register */\r
+  __IOM uint32_t CPACR;                  /*!< Offset: 0x088 (R/W)  Coprocessor Access Control Register */\r
+  __IOM uint32_t NSACR;                  /*!< Offset: 0x08C (R/W)  Non-Secure Access Control Register */\r
+        uint32_t RESERVED3[92U];\r
+  __OM  uint32_t STIR;                   /*!< Offset: 0x200 ( /W)  Software Triggered Interrupt Register */\r
+        uint32_t RESERVED4[15U];\r
+  __IM  uint32_t MVFR0;                  /*!< Offset: 0x240 (R/ )  Media and VFP Feature Register 0 */\r
+  __IM  uint32_t MVFR1;                  /*!< Offset: 0x244 (R/ )  Media and VFP Feature Register 1 */\r
+  __IM  uint32_t MVFR2;                  /*!< Offset: 0x248 (R/ )  Media and VFP Feature Register 2 */\r
+        uint32_t RESERVED5[1U];\r
+  __OM  uint32_t ICIALLU;                /*!< Offset: 0x250 ( /W)  I-Cache Invalidate All to PoU */\r
+        uint32_t RESERVED6[1U];\r
+  __OM  uint32_t ICIMVAU;                /*!< Offset: 0x258 ( /W)  I-Cache Invalidate by MVA to PoU */\r
+  __OM  uint32_t DCIMVAC;                /*!< Offset: 0x25C ( /W)  D-Cache Invalidate by MVA to PoC */\r
+  __OM  uint32_t DCISW;                  /*!< Offset: 0x260 ( /W)  D-Cache Invalidate by Set-way */\r
+  __OM  uint32_t DCCMVAU;                /*!< Offset: 0x264 ( /W)  D-Cache Clean by MVA to PoU */\r
+  __OM  uint32_t DCCMVAC;                /*!< Offset: 0x268 ( /W)  D-Cache Clean by MVA to PoC */\r
+  __OM  uint32_t DCCSW;                  /*!< Offset: 0x26C ( /W)  D-Cache Clean by Set-way */\r
+  __OM  uint32_t DCCIMVAC;               /*!< Offset: 0x270 ( /W)  D-Cache Clean and Invalidate by MVA to PoC */\r
+  __OM  uint32_t DCCISW;                 /*!< Offset: 0x274 ( /W)  D-Cache Clean and Invalidate by Set-way */\r
+        uint32_t RESERVED7[6U];\r
+  __IOM uint32_t ITCMCR;                 /*!< Offset: 0x290 (R/W)  Instruction Tightly-Coupled Memory Control Register */\r
+  __IOM uint32_t DTCMCR;                 /*!< Offset: 0x294 (R/W)  Data Tightly-Coupled Memory Control Registers */\r
+  __IOM uint32_t AHBPCR;                 /*!< Offset: 0x298 (R/W)  AHBP Control Register */\r
+  __IOM uint32_t CACR;                   /*!< Offset: 0x29C (R/W)  L1 Cache Control Register */\r
+  __IOM uint32_t AHBSCR;                 /*!< Offset: 0x2A0 (R/W)  AHB Slave Control Register */\r
+        uint32_t RESERVED8[1U];\r
+  __IOM uint32_t ABFSR;                  /*!< Offset: 0x2A8 (R/W)  Auxiliary Bus Fault Status Register */\r
+} SCB_Type;\r
+\r
+/* SCB CPUID Register Definitions */\r
+#define SCB_CPUID_IMPLEMENTER_Pos          24U                                            /*!< SCB CPUID: IMPLEMENTER Position */\r
+#define SCB_CPUID_IMPLEMENTER_Msk          (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos)          /*!< SCB CPUID: IMPLEMENTER Mask */\r
+\r
+#define SCB_CPUID_VARIANT_Pos              20U                                            /*!< SCB CPUID: VARIANT Position */\r
+#define SCB_CPUID_VARIANT_Msk              (0xFUL << SCB_CPUID_VARIANT_Pos)               /*!< SCB CPUID: VARIANT Mask */\r
+\r
+#define SCB_CPUID_ARCHITECTURE_Pos         16U                                            /*!< SCB CPUID: ARCHITECTURE Position */\r
+#define SCB_CPUID_ARCHITECTURE_Msk         (0xFUL << SCB_CPUID_ARCHITECTURE_Pos)          /*!< SCB CPUID: ARCHITECTURE Mask */\r
+\r
+#define SCB_CPUID_PARTNO_Pos                4U                                            /*!< SCB CPUID: PARTNO Position */\r
+#define SCB_CPUID_PARTNO_Msk               (0xFFFUL << SCB_CPUID_PARTNO_Pos)              /*!< SCB CPUID: PARTNO Mask */\r
+\r
+#define SCB_CPUID_REVISION_Pos              0U                                            /*!< SCB CPUID: REVISION Position */\r
+#define SCB_CPUID_REVISION_Msk             (0xFUL /*<< SCB_CPUID_REVISION_Pos*/)          /*!< SCB CPUID: REVISION Mask */\r
+\r
+/* SCB Interrupt Control State Register Definitions */\r
+#define SCB_ICSR_PENDNMISET_Pos            31U                                            /*!< SCB ICSR: PENDNMISET Position */\r
+#define SCB_ICSR_PENDNMISET_Msk            (1UL << SCB_ICSR_PENDNMISET_Pos)               /*!< SCB ICSR: PENDNMISET Mask */\r
+\r
+#define SCB_ICSR_NMIPENDSET_Pos            SCB_ICSR_PENDNMISET_Pos                        /*!< SCB ICSR: NMIPENDSET Position, backward compatibility */\r
+#define SCB_ICSR_NMIPENDSET_Msk            SCB_ICSR_PENDNMISET_Msk                        /*!< SCB ICSR: NMIPENDSET Mask, backward compatibility */\r
+\r
+#define SCB_ICSR_PENDNMICLR_Pos            30U                                            /*!< SCB ICSR: PENDNMICLR Position */\r
+#define SCB_ICSR_PENDNMICLR_Msk            (1UL << SCB_ICSR_PENDNMICLR_Pos)               /*!< SCB ICSR: PENDNMICLR Mask */\r
+\r
+#define SCB_ICSR_PENDSVSET_Pos             28U                                            /*!< SCB ICSR: PENDSVSET Position */\r
+#define SCB_ICSR_PENDSVSET_Msk             (1UL << SCB_ICSR_PENDSVSET_Pos)                /*!< SCB ICSR: PENDSVSET Mask */\r
+\r
+#define SCB_ICSR_PENDSVCLR_Pos             27U                                            /*!< SCB ICSR: PENDSVCLR Position */\r
+#define SCB_ICSR_PENDSVCLR_Msk             (1UL << SCB_ICSR_PENDSVCLR_Pos)                /*!< SCB ICSR: PENDSVCLR Mask */\r
+\r
+#define SCB_ICSR_PENDSTSET_Pos             26U                                            /*!< SCB ICSR: PENDSTSET Position */\r
+#define SCB_ICSR_PENDSTSET_Msk             (1UL << SCB_ICSR_PENDSTSET_Pos)                /*!< SCB ICSR: PENDSTSET Mask */\r
+\r
+#define SCB_ICSR_PENDSTCLR_Pos             25U                                            /*!< SCB ICSR: PENDSTCLR Position */\r
+#define SCB_ICSR_PENDSTCLR_Msk             (1UL << SCB_ICSR_PENDSTCLR_Pos)                /*!< SCB ICSR: PENDSTCLR Mask */\r
+\r
+#define SCB_ICSR_STTNS_Pos                 24U                                            /*!< SCB ICSR: STTNS Position (Security Extension) */\r
+#define SCB_ICSR_STTNS_Msk                 (1UL << SCB_ICSR_STTNS_Pos)                    /*!< SCB ICSR: STTNS Mask (Security Extension) */\r
+\r
+#define SCB_ICSR_ISRPREEMPT_Pos            23U                                            /*!< SCB ICSR: ISRPREEMPT Position */\r
+#define SCB_ICSR_ISRPREEMPT_Msk            (1UL << SCB_ICSR_ISRPREEMPT_Pos)               /*!< SCB ICSR: ISRPREEMPT Mask */\r
+\r
+#define SCB_ICSR_ISRPENDING_Pos            22U                                            /*!< SCB ICSR: ISRPENDING Position */\r
+#define SCB_ICSR_ISRPENDING_Msk            (1UL << SCB_ICSR_ISRPENDING_Pos)               /*!< SCB ICSR: ISRPENDING Mask */\r
+\r
+#define SCB_ICSR_VECTPENDING_Pos           12U                                            /*!< SCB ICSR: VECTPENDING Position */\r
+#define SCB_ICSR_VECTPENDING_Msk           (0x1FFUL << SCB_ICSR_VECTPENDING_Pos)          /*!< SCB ICSR: VECTPENDING Mask */\r
+\r
+#define SCB_ICSR_RETTOBASE_Pos             11U                                            /*!< SCB ICSR: RETTOBASE Position */\r
+#define SCB_ICSR_RETTOBASE_Msk             (1UL << SCB_ICSR_RETTOBASE_Pos)                /*!< SCB ICSR: RETTOBASE Mask */\r
+\r
+#define SCB_ICSR_VECTACTIVE_Pos             0U                                            /*!< SCB ICSR: VECTACTIVE Position */\r
+#define SCB_ICSR_VECTACTIVE_Msk            (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/)       /*!< SCB ICSR: VECTACTIVE Mask */\r
+\r
+/* SCB Vector Table Offset Register Definitions */\r
+#define SCB_VTOR_TBLOFF_Pos                 7U                                            /*!< SCB VTOR: TBLOFF Position */\r
+#define SCB_VTOR_TBLOFF_Msk                (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos)           /*!< SCB VTOR: TBLOFF Mask */\r
+\r
+/* SCB Application Interrupt and Reset Control Register Definitions */\r
+#define SCB_AIRCR_VECTKEY_Pos              16U                                            /*!< SCB AIRCR: VECTKEY Position */\r
+#define SCB_AIRCR_VECTKEY_Msk              (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos)            /*!< SCB AIRCR: VECTKEY Mask */\r
+\r
+#define SCB_AIRCR_VECTKEYSTAT_Pos          16U                                            /*!< SCB AIRCR: VECTKEYSTAT Position */\r
+#define SCB_AIRCR_VECTKEYSTAT_Msk          (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos)        /*!< SCB AIRCR: VECTKEYSTAT Mask */\r
+\r
+#define SCB_AIRCR_ENDIANESS_Pos            15U                                            /*!< SCB AIRCR: ENDIANESS Position */\r
+#define SCB_AIRCR_ENDIANESS_Msk            (1UL << SCB_AIRCR_ENDIANESS_Pos)               /*!< SCB AIRCR: ENDIANESS Mask */\r
+\r
+#define SCB_AIRCR_PRIS_Pos                 14U                                            /*!< SCB AIRCR: PRIS Position */\r
+#define SCB_AIRCR_PRIS_Msk                 (1UL << SCB_AIRCR_PRIS_Pos)                    /*!< SCB AIRCR: PRIS Mask */\r
+\r
+#define SCB_AIRCR_BFHFNMINS_Pos            13U                                            /*!< SCB AIRCR: BFHFNMINS Position */\r
+#define SCB_AIRCR_BFHFNMINS_Msk            (1UL << SCB_AIRCR_BFHFNMINS_Pos)               /*!< SCB AIRCR: BFHFNMINS Mask */\r
+\r
+#define SCB_AIRCR_PRIGROUP_Pos              8U                                            /*!< SCB AIRCR: PRIGROUP Position */\r
+#define SCB_AIRCR_PRIGROUP_Msk             (7UL << SCB_AIRCR_PRIGROUP_Pos)                /*!< SCB AIRCR: PRIGROUP Mask */\r
+\r
+#define SCB_AIRCR_SYSRESETREQS_Pos          3U                                            /*!< SCB AIRCR: SYSRESETREQS Position */\r
+#define SCB_AIRCR_SYSRESETREQS_Msk         (1UL << SCB_AIRCR_SYSRESETREQS_Pos)            /*!< SCB AIRCR: SYSRESETREQS Mask */\r
+\r
+#define SCB_AIRCR_SYSRESETREQ_Pos           2U                                            /*!< SCB AIRCR: SYSRESETREQ Position */\r
+#define SCB_AIRCR_SYSRESETREQ_Msk          (1UL << SCB_AIRCR_SYSRESETREQ_Pos)             /*!< SCB AIRCR: SYSRESETREQ Mask */\r
+\r
+#define SCB_AIRCR_VECTCLRACTIVE_Pos         1U                                            /*!< SCB AIRCR: VECTCLRACTIVE Position */\r
+#define SCB_AIRCR_VECTCLRACTIVE_Msk        (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos)           /*!< SCB AIRCR: VECTCLRACTIVE Mask */\r
+\r
+/* SCB System Control Register Definitions */\r
+#define SCB_SCR_SEVONPEND_Pos               4U                                            /*!< SCB SCR: SEVONPEND Position */\r
+#define SCB_SCR_SEVONPEND_Msk              (1UL << SCB_SCR_SEVONPEND_Pos)                 /*!< SCB SCR: SEVONPEND Mask */\r
+\r
+#define SCB_SCR_SLEEPDEEPS_Pos              3U                                            /*!< SCB SCR: SLEEPDEEPS Position */\r
+#define SCB_SCR_SLEEPDEEPS_Msk             (1UL << SCB_SCR_SLEEPDEEPS_Pos)                /*!< SCB SCR: SLEEPDEEPS Mask */\r
+\r
+#define SCB_SCR_SLEEPDEEP_Pos               2U                                            /*!< SCB SCR: SLEEPDEEP Position */\r
+#define SCB_SCR_SLEEPDEEP_Msk              (1UL << SCB_SCR_SLEEPDEEP_Pos)                 /*!< SCB SCR: SLEEPDEEP Mask */\r
+\r
+#define SCB_SCR_SLEEPONEXIT_Pos             1U                                            /*!< SCB SCR: SLEEPONEXIT Position */\r
+#define SCB_SCR_SLEEPONEXIT_Msk            (1UL << SCB_SCR_SLEEPONEXIT_Pos)               /*!< SCB SCR: SLEEPONEXIT Mask */\r
+\r
+/* SCB Configuration Control Register Definitions */\r
+#define SCB_CCR_BP_Pos                     18U                                            /*!< SCB CCR: BP Position */\r
+#define SCB_CCR_BP_Msk                     (1UL << SCB_CCR_BP_Pos)                        /*!< SCB CCR: BP Mask */\r
+\r
+#define SCB_CCR_IC_Pos                     17U                                            /*!< SCB CCR: IC Position */\r
+#define SCB_CCR_IC_Msk                     (1UL << SCB_CCR_IC_Pos)                        /*!< SCB CCR: IC Mask */\r
+\r
+#define SCB_CCR_DC_Pos                     16U                                            /*!< SCB CCR: DC Position */\r
+#define SCB_CCR_DC_Msk                     (1UL << SCB_CCR_DC_Pos)                        /*!< SCB CCR: DC Mask */\r
+\r
+#define SCB_CCR_STKOFHFNMIGN_Pos           10U                                            /*!< SCB CCR: STKOFHFNMIGN Position */\r
+#define SCB_CCR_STKOFHFNMIGN_Msk           (1UL << SCB_CCR_STKOFHFNMIGN_Pos)              /*!< SCB CCR: STKOFHFNMIGN Mask */\r
+\r
+#define SCB_CCR_BFHFNMIGN_Pos               8U                                            /*!< SCB CCR: BFHFNMIGN Position */\r
+#define SCB_CCR_BFHFNMIGN_Msk              (1UL << SCB_CCR_BFHFNMIGN_Pos)                 /*!< SCB CCR: BFHFNMIGN Mask */\r
+\r
+#define SCB_CCR_DIV_0_TRP_Pos               4U                                            /*!< SCB CCR: DIV_0_TRP Position */\r
+#define SCB_CCR_DIV_0_TRP_Msk              (1UL << SCB_CCR_DIV_0_TRP_Pos)                 /*!< SCB CCR: DIV_0_TRP Mask */\r
+\r
+#define SCB_CCR_UNALIGN_TRP_Pos             3U                                            /*!< SCB CCR: UNALIGN_TRP Position */\r
+#define SCB_CCR_UNALIGN_TRP_Msk            (1UL << SCB_CCR_UNALIGN_TRP_Pos)               /*!< SCB CCR: UNALIGN_TRP Mask */\r
+\r
+#define SCB_CCR_USERSETMPEND_Pos            1U                                            /*!< SCB CCR: USERSETMPEND Position */\r
+#define SCB_CCR_USERSETMPEND_Msk           (1UL << SCB_CCR_USERSETMPEND_Pos)              /*!< SCB CCR: USERSETMPEND Mask */\r
+\r
+/* SCB System Handler Control and State Register Definitions */\r
+#define SCB_SHCSR_HARDFAULTPENDED_Pos      21U                                            /*!< SCB SHCSR: HARDFAULTPENDED Position */\r
+#define SCB_SHCSR_HARDFAULTPENDED_Msk      (1UL << SCB_SHCSR_HARDFAULTPENDED_Pos)         /*!< SCB SHCSR: HARDFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_SECUREFAULTPENDED_Pos    20U                                            /*!< SCB SHCSR: SECUREFAULTPENDED Position */\r
+#define SCB_SHCSR_SECUREFAULTPENDED_Msk    (1UL << SCB_SHCSR_SECUREFAULTPENDED_Pos)       /*!< SCB SHCSR: SECUREFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_SECUREFAULTENA_Pos       19U                                            /*!< SCB SHCSR: SECUREFAULTENA Position */\r
+#define SCB_SHCSR_SECUREFAULTENA_Msk       (1UL << SCB_SHCSR_SECUREFAULTENA_Pos)          /*!< SCB SHCSR: SECUREFAULTENA Mask */\r
+\r
+#define SCB_SHCSR_USGFAULTENA_Pos          18U                                            /*!< SCB SHCSR: USGFAULTENA Position */\r
+#define SCB_SHCSR_USGFAULTENA_Msk          (1UL << SCB_SHCSR_USGFAULTENA_Pos)             /*!< SCB SHCSR: USGFAULTENA Mask */\r
+\r
+#define SCB_SHCSR_BUSFAULTENA_Pos          17U                                            /*!< SCB SHCSR: BUSFAULTENA Position */\r
+#define SCB_SHCSR_BUSFAULTENA_Msk          (1UL << SCB_SHCSR_BUSFAULTENA_Pos)             /*!< SCB SHCSR: BUSFAULTENA Mask */\r
+\r
+#define SCB_SHCSR_MEMFAULTENA_Pos          16U                                            /*!< SCB SHCSR: MEMFAULTENA Position */\r
+#define SCB_SHCSR_MEMFAULTENA_Msk          (1UL << SCB_SHCSR_MEMFAULTENA_Pos)             /*!< SCB SHCSR: MEMFAULTENA Mask */\r
+\r
+#define SCB_SHCSR_SVCALLPENDED_Pos         15U                                            /*!< SCB SHCSR: SVCALLPENDED Position */\r
+#define SCB_SHCSR_SVCALLPENDED_Msk         (1UL << SCB_SHCSR_SVCALLPENDED_Pos)            /*!< SCB SHCSR: SVCALLPENDED Mask */\r
+\r
+#define SCB_SHCSR_BUSFAULTPENDED_Pos       14U                                            /*!< SCB SHCSR: BUSFAULTPENDED Position */\r
+#define SCB_SHCSR_BUSFAULTPENDED_Msk       (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos)          /*!< SCB SHCSR: BUSFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_MEMFAULTPENDED_Pos       13U                                            /*!< SCB SHCSR: MEMFAULTPENDED Position */\r
+#define SCB_SHCSR_MEMFAULTPENDED_Msk       (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos)          /*!< SCB SHCSR: MEMFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_USGFAULTPENDED_Pos       12U                                            /*!< SCB SHCSR: USGFAULTPENDED Position */\r
+#define SCB_SHCSR_USGFAULTPENDED_Msk       (1UL << SCB_SHCSR_USGFAULTPENDED_Pos)          /*!< SCB SHCSR: USGFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_SYSTICKACT_Pos           11U                                            /*!< SCB SHCSR: SYSTICKACT Position */\r
+#define SCB_SHCSR_SYSTICKACT_Msk           (1UL << SCB_SHCSR_SYSTICKACT_Pos)              /*!< SCB SHCSR: SYSTICKACT Mask */\r
+\r
+#define SCB_SHCSR_PENDSVACT_Pos            10U                                            /*!< SCB SHCSR: PENDSVACT Position */\r
+#define SCB_SHCSR_PENDSVACT_Msk            (1UL << SCB_SHCSR_PENDSVACT_Pos)               /*!< SCB SHCSR: PENDSVACT Mask */\r
+\r
+#define SCB_SHCSR_MONITORACT_Pos            8U                                            /*!< SCB SHCSR: MONITORACT Position */\r
+#define SCB_SHCSR_MONITORACT_Msk           (1UL << SCB_SHCSR_MONITORACT_Pos)              /*!< SCB SHCSR: MONITORACT Mask */\r
+\r
+#define SCB_SHCSR_SVCALLACT_Pos             7U                                            /*!< SCB SHCSR: SVCALLACT Position */\r
+#define SCB_SHCSR_SVCALLACT_Msk            (1UL << SCB_SHCSR_SVCALLACT_Pos)               /*!< SCB SHCSR: SVCALLACT Mask */\r
+\r
+#define SCB_SHCSR_NMIACT_Pos                5U                                            /*!< SCB SHCSR: NMIACT Position */\r
+#define SCB_SHCSR_NMIACT_Msk               (1UL << SCB_SHCSR_NMIACT_Pos)                  /*!< SCB SHCSR: NMIACT Mask */\r
+\r
+#define SCB_SHCSR_SECUREFAULTACT_Pos        4U                                            /*!< SCB SHCSR: SECUREFAULTACT Position */\r
+#define SCB_SHCSR_SECUREFAULTACT_Msk       (1UL << SCB_SHCSR_SECUREFAULTACT_Pos)          /*!< SCB SHCSR: SECUREFAULTACT Mask */\r
+\r
+#define SCB_SHCSR_USGFAULTACT_Pos           3U                                            /*!< SCB SHCSR: USGFAULTACT Position */\r
+#define SCB_SHCSR_USGFAULTACT_Msk          (1UL << SCB_SHCSR_USGFAULTACT_Pos)             /*!< SCB SHCSR: USGFAULTACT Mask */\r
+\r
+#define SCB_SHCSR_HARDFAULTACT_Pos          2U                                            /*!< SCB SHCSR: HARDFAULTACT Position */\r
+#define SCB_SHCSR_HARDFAULTACT_Msk         (1UL << SCB_SHCSR_HARDFAULTACT_Pos)            /*!< SCB SHCSR: HARDFAULTACT Mask */\r
+\r
+#define SCB_SHCSR_BUSFAULTACT_Pos           1U                                            /*!< SCB SHCSR: BUSFAULTACT Position */\r
+#define SCB_SHCSR_BUSFAULTACT_Msk          (1UL << SCB_SHCSR_BUSFAULTACT_Pos)             /*!< SCB SHCSR: BUSFAULTACT Mask */\r
+\r
+#define SCB_SHCSR_MEMFAULTACT_Pos           0U                                            /*!< SCB SHCSR: MEMFAULTACT Position */\r
+#define SCB_SHCSR_MEMFAULTACT_Msk          (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/)         /*!< SCB SHCSR: MEMFAULTACT Mask */\r
+\r
+/* SCB Configurable Fault Status Register Definitions */\r
+#define SCB_CFSR_USGFAULTSR_Pos            16U                                            /*!< SCB CFSR: Usage Fault Status Register Position */\r
+#define SCB_CFSR_USGFAULTSR_Msk            (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos)          /*!< SCB CFSR: Usage Fault Status Register Mask */\r
+\r
+#define SCB_CFSR_BUSFAULTSR_Pos             8U                                            /*!< SCB CFSR: Bus Fault Status Register Position */\r
+#define SCB_CFSR_BUSFAULTSR_Msk            (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos)            /*!< SCB CFSR: Bus Fault Status Register Mask */\r
+\r
+#define SCB_CFSR_MEMFAULTSR_Pos             0U                                            /*!< SCB CFSR: Memory Manage Fault Status Register Position */\r
+#define SCB_CFSR_MEMFAULTSR_Msk            (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/)        /*!< SCB CFSR: Memory Manage Fault Status Register Mask */\r
+\r
+/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */\r
+#define SCB_CFSR_MMARVALID_Pos             (SCB_SHCSR_MEMFAULTACT_Pos + 7U)               /*!< SCB CFSR (MMFSR): MMARVALID Position */\r
+#define SCB_CFSR_MMARVALID_Msk             (1UL << SCB_CFSR_MMARVALID_Pos)                /*!< SCB CFSR (MMFSR): MMARVALID Mask */\r
+\r
+#define SCB_CFSR_MLSPERR_Pos               (SCB_SHCSR_MEMFAULTACT_Pos + 5U)               /*!< SCB CFSR (MMFSR): MLSPERR Position */\r
+#define SCB_CFSR_MLSPERR_Msk               (1UL << SCB_CFSR_MLSPERR_Pos)                  /*!< SCB CFSR (MMFSR): MLSPERR Mask */\r
+\r
+#define SCB_CFSR_MSTKERR_Pos               (SCB_SHCSR_MEMFAULTACT_Pos + 4U)               /*!< SCB CFSR (MMFSR): MSTKERR Position */\r
+#define SCB_CFSR_MSTKERR_Msk               (1UL << SCB_CFSR_MSTKERR_Pos)                  /*!< SCB CFSR (MMFSR): MSTKERR Mask */\r
+\r
+#define SCB_CFSR_MUNSTKERR_Pos             (SCB_SHCSR_MEMFAULTACT_Pos + 3U)               /*!< SCB CFSR (MMFSR): MUNSTKERR Position */\r
+#define SCB_CFSR_MUNSTKERR_Msk             (1UL << SCB_CFSR_MUNSTKERR_Pos)                /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */\r
+\r
+#define SCB_CFSR_DACCVIOL_Pos              (SCB_SHCSR_MEMFAULTACT_Pos + 1U)               /*!< SCB CFSR (MMFSR): DACCVIOL Position */\r
+#define SCB_CFSR_DACCVIOL_Msk              (1UL << SCB_CFSR_DACCVIOL_Pos)                 /*!< SCB CFSR (MMFSR): DACCVIOL Mask */\r
+\r
+#define SCB_CFSR_IACCVIOL_Pos              (SCB_SHCSR_MEMFAULTACT_Pos + 0U)               /*!< SCB CFSR (MMFSR): IACCVIOL Position */\r
+#define SCB_CFSR_IACCVIOL_Msk              (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/)             /*!< SCB CFSR (MMFSR): IACCVIOL Mask */\r
+\r
+/* BusFault Status Register (part of SCB Configurable Fault Status Register) */\r
+#define SCB_CFSR_BFARVALID_Pos            (SCB_CFSR_BUSFAULTSR_Pos + 7U)                  /*!< SCB CFSR (BFSR): BFARVALID Position */\r
+#define SCB_CFSR_BFARVALID_Msk            (1UL << SCB_CFSR_BFARVALID_Pos)                 /*!< SCB CFSR (BFSR): BFARVALID Mask */\r
+\r
+#define SCB_CFSR_LSPERR_Pos               (SCB_CFSR_BUSFAULTSR_Pos + 5U)                  /*!< SCB CFSR (BFSR): LSPERR Position */\r
+#define SCB_CFSR_LSPERR_Msk               (1UL << SCB_CFSR_LSPERR_Pos)                    /*!< SCB CFSR (BFSR): LSPERR Mask */\r
+\r
+#define SCB_CFSR_STKERR_Pos               (SCB_CFSR_BUSFAULTSR_Pos + 4U)                  /*!< SCB CFSR (BFSR): STKERR Position */\r
+#define SCB_CFSR_STKERR_Msk               (1UL << SCB_CFSR_STKERR_Pos)                    /*!< SCB CFSR (BFSR): STKERR Mask */\r
+\r
+#define SCB_CFSR_UNSTKERR_Pos             (SCB_CFSR_BUSFAULTSR_Pos + 3U)                  /*!< SCB CFSR (BFSR): UNSTKERR Position */\r
+#define SCB_CFSR_UNSTKERR_Msk             (1UL << SCB_CFSR_UNSTKERR_Pos)                  /*!< SCB CFSR (BFSR): UNSTKERR Mask */\r
+\r
+#define SCB_CFSR_IMPRECISERR_Pos          (SCB_CFSR_BUSFAULTSR_Pos + 2U)                  /*!< SCB CFSR (BFSR): IMPRECISERR Position */\r
+#define SCB_CFSR_IMPRECISERR_Msk          (1UL << SCB_CFSR_IMPRECISERR_Pos)               /*!< SCB CFSR (BFSR): IMPRECISERR Mask */\r
+\r
+#define SCB_CFSR_PRECISERR_Pos            (SCB_CFSR_BUSFAULTSR_Pos + 1U)                  /*!< SCB CFSR (BFSR): PRECISERR Position */\r
+#define SCB_CFSR_PRECISERR_Msk            (1UL << SCB_CFSR_PRECISERR_Pos)                 /*!< SCB CFSR (BFSR): PRECISERR Mask */\r
+\r
+#define SCB_CFSR_IBUSERR_Pos              (SCB_CFSR_BUSFAULTSR_Pos + 0U)                  /*!< SCB CFSR (BFSR): IBUSERR Position */\r
+#define SCB_CFSR_IBUSERR_Msk              (1UL << SCB_CFSR_IBUSERR_Pos)                   /*!< SCB CFSR (BFSR): IBUSERR Mask */\r
+\r
+/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */\r
+#define SCB_CFSR_DIVBYZERO_Pos            (SCB_CFSR_USGFAULTSR_Pos + 9U)                  /*!< SCB CFSR (UFSR): DIVBYZERO Position */\r
+#define SCB_CFSR_DIVBYZERO_Msk            (1UL << SCB_CFSR_DIVBYZERO_Pos)                 /*!< SCB CFSR (UFSR): DIVBYZERO Mask */\r
+\r
+#define SCB_CFSR_UNALIGNED_Pos            (SCB_CFSR_USGFAULTSR_Pos + 8U)                  /*!< SCB CFSR (UFSR): UNALIGNED Position */\r
+#define SCB_CFSR_UNALIGNED_Msk            (1UL << SCB_CFSR_UNALIGNED_Pos)                 /*!< SCB CFSR (UFSR): UNALIGNED Mask */\r
+\r
+#define SCB_CFSR_STKOF_Pos                (SCB_CFSR_USGFAULTSR_Pos + 4U)                  /*!< SCB CFSR (UFSR): STKOF Position */\r
+#define SCB_CFSR_STKOF_Msk                (1UL << SCB_CFSR_STKOF_Pos)                     /*!< SCB CFSR (UFSR): STKOF Mask */\r
+\r
+#define SCB_CFSR_NOCP_Pos                 (SCB_CFSR_USGFAULTSR_Pos + 3U)                  /*!< SCB CFSR (UFSR): NOCP Position */\r
+#define SCB_CFSR_NOCP_Msk                 (1UL << SCB_CFSR_NOCP_Pos)                      /*!< SCB CFSR (UFSR): NOCP Mask */\r
+\r
+#define SCB_CFSR_INVPC_Pos                (SCB_CFSR_USGFAULTSR_Pos + 2U)                  /*!< SCB CFSR (UFSR): INVPC Position */\r
+#define SCB_CFSR_INVPC_Msk                (1UL << SCB_CFSR_INVPC_Pos)                     /*!< SCB CFSR (UFSR): INVPC Mask */\r
+\r
+#define SCB_CFSR_INVSTATE_Pos             (SCB_CFSR_USGFAULTSR_Pos + 1U)                  /*!< SCB CFSR (UFSR): INVSTATE Position */\r
+#define SCB_CFSR_INVSTATE_Msk             (1UL << SCB_CFSR_INVSTATE_Pos)                  /*!< SCB CFSR (UFSR): INVSTATE Mask */\r
+\r
+#define SCB_CFSR_UNDEFINSTR_Pos           (SCB_CFSR_USGFAULTSR_Pos + 0U)                  /*!< SCB CFSR (UFSR): UNDEFINSTR Position */\r
+#define SCB_CFSR_UNDEFINSTR_Msk           (1UL << SCB_CFSR_UNDEFINSTR_Pos)                /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */\r
+\r
+/* SCB Hard Fault Status Register Definitions */\r
+#define SCB_HFSR_DEBUGEVT_Pos              31U                                            /*!< SCB HFSR: DEBUGEVT Position */\r
+#define SCB_HFSR_DEBUGEVT_Msk              (1UL << SCB_HFSR_DEBUGEVT_Pos)                 /*!< SCB HFSR: DEBUGEVT Mask */\r
+\r
+#define SCB_HFSR_FORCED_Pos                30U                                            /*!< SCB HFSR: FORCED Position */\r
+#define SCB_HFSR_FORCED_Msk                (1UL << SCB_HFSR_FORCED_Pos)                   /*!< SCB HFSR: FORCED Mask */\r
+\r
+#define SCB_HFSR_VECTTBL_Pos                1U                                            /*!< SCB HFSR: VECTTBL Position */\r
+#define SCB_HFSR_VECTTBL_Msk               (1UL << SCB_HFSR_VECTTBL_Pos)                  /*!< SCB HFSR: VECTTBL Mask */\r
+\r
+/* SCB Debug Fault Status Register Definitions */\r
+#define SCB_DFSR_EXTERNAL_Pos               4U                                            /*!< SCB DFSR: EXTERNAL Position */\r
+#define SCB_DFSR_EXTERNAL_Msk              (1UL << SCB_DFSR_EXTERNAL_Pos)                 /*!< SCB DFSR: EXTERNAL Mask */\r
+\r
+#define SCB_DFSR_VCATCH_Pos                 3U                                            /*!< SCB DFSR: VCATCH Position */\r
+#define SCB_DFSR_VCATCH_Msk                (1UL << SCB_DFSR_VCATCH_Pos)                   /*!< SCB DFSR: VCATCH Mask */\r
+\r
+#define SCB_DFSR_DWTTRAP_Pos                2U                                            /*!< SCB DFSR: DWTTRAP Position */\r
+#define SCB_DFSR_DWTTRAP_Msk               (1UL << SCB_DFSR_DWTTRAP_Pos)                  /*!< SCB DFSR: DWTTRAP Mask */\r
+\r
+#define SCB_DFSR_BKPT_Pos                   1U                                            /*!< SCB DFSR: BKPT Position */\r
+#define SCB_DFSR_BKPT_Msk                  (1UL << SCB_DFSR_BKPT_Pos)                     /*!< SCB DFSR: BKPT Mask */\r
+\r
+#define SCB_DFSR_HALTED_Pos                 0U                                            /*!< SCB DFSR: HALTED Position */\r
+#define SCB_DFSR_HALTED_Msk                (1UL /*<< SCB_DFSR_HALTED_Pos*/)               /*!< SCB DFSR: HALTED Mask */\r
+\r
+/* SCB Non-Secure Access Control Register Definitions */\r
+#define SCB_NSACR_CP11_Pos                 11U                                            /*!< SCB NSACR: CP11 Position */\r
+#define SCB_NSACR_CP11_Msk                 (1UL << SCB_NSACR_CP11_Pos)                    /*!< SCB NSACR: CP11 Mask */\r
+\r
+#define SCB_NSACR_CP10_Pos                 10U                                            /*!< SCB NSACR: CP10 Position */\r
+#define SCB_NSACR_CP10_Msk                 (1UL << SCB_NSACR_CP10_Pos)                    /*!< SCB NSACR: CP10 Mask */\r
+\r
+#define SCB_NSACR_CPn_Pos                   0U                                            /*!< SCB NSACR: CPn Position */\r
+#define SCB_NSACR_CPn_Msk                  (1UL /*<< SCB_NSACR_CPn_Pos*/)                 /*!< SCB NSACR: CPn Mask */\r
+\r
+/* SCB Cache Level ID Register Definitions */\r
+#define SCB_CLIDR_LOUU_Pos                 27U                                            /*!< SCB CLIDR: LoUU Position */\r
+#define SCB_CLIDR_LOUU_Msk                 (7UL << SCB_CLIDR_LOUU_Pos)                    /*!< SCB CLIDR: LoUU Mask */\r
+\r
+#define SCB_CLIDR_LOC_Pos                  24U                                            /*!< SCB CLIDR: LoC Position */\r
+#define SCB_CLIDR_LOC_Msk                  (7UL << SCB_CLIDR_LOC_Pos)                     /*!< SCB CLIDR: LoC Mask */\r
+\r
+/* SCB Cache Type Register Definitions */\r
+#define SCB_CTR_FORMAT_Pos                 29U                                            /*!< SCB CTR: Format Position */\r
+#define SCB_CTR_FORMAT_Msk                 (7UL << SCB_CTR_FORMAT_Pos)                    /*!< SCB CTR: Format Mask */\r
+\r
+#define SCB_CTR_CWG_Pos                    24U                                            /*!< SCB CTR: CWG Position */\r
+#define SCB_CTR_CWG_Msk                    (0xFUL << SCB_CTR_CWG_Pos)                     /*!< SCB CTR: CWG Mask */\r
+\r
+#define SCB_CTR_ERG_Pos                    20U                                            /*!< SCB CTR: ERG Position */\r
+#define SCB_CTR_ERG_Msk                    (0xFUL << SCB_CTR_ERG_Pos)                     /*!< SCB CTR: ERG Mask */\r
+\r
+#define SCB_CTR_DMINLINE_Pos               16U                                            /*!< SCB CTR: DminLine Position */\r
+#define SCB_CTR_DMINLINE_Msk               (0xFUL << SCB_CTR_DMINLINE_Pos)                /*!< SCB CTR: DminLine Mask */\r
+\r
+#define SCB_CTR_IMINLINE_Pos                0U                                            /*!< SCB CTR: ImInLine Position */\r
+#define SCB_CTR_IMINLINE_Msk               (0xFUL /*<< SCB_CTR_IMINLINE_Pos*/)            /*!< SCB CTR: ImInLine Mask */\r
+\r
+/* SCB Cache Size ID Register Definitions */\r
+#define SCB_CCSIDR_WT_Pos                  31U                                            /*!< SCB CCSIDR: WT Position */\r
+#define SCB_CCSIDR_WT_Msk                  (1UL << SCB_CCSIDR_WT_Pos)                     /*!< SCB CCSIDR: WT Mask */\r
+\r
+#define SCB_CCSIDR_WB_Pos                  30U                                            /*!< SCB CCSIDR: WB Position */\r
+#define SCB_CCSIDR_WB_Msk                  (1UL << SCB_CCSIDR_WB_Pos)                     /*!< SCB CCSIDR: WB Mask */\r
+\r
+#define SCB_CCSIDR_RA_Pos                  29U                                            /*!< SCB CCSIDR: RA Position */\r
+#define SCB_CCSIDR_RA_Msk                  (1UL << SCB_CCSIDR_RA_Pos)                     /*!< SCB CCSIDR: RA Mask */\r
+\r
+#define SCB_CCSIDR_WA_Pos                  28U                                            /*!< SCB CCSIDR: WA Position */\r
+#define SCB_CCSIDR_WA_Msk                  (1UL << SCB_CCSIDR_WA_Pos)                     /*!< SCB CCSIDR: WA Mask */\r
+\r
+#define SCB_CCSIDR_NUMSETS_Pos             13U                                            /*!< SCB CCSIDR: NumSets Position */\r
+#define SCB_CCSIDR_NUMSETS_Msk             (0x7FFFUL << SCB_CCSIDR_NUMSETS_Pos)           /*!< SCB CCSIDR: NumSets Mask */\r
+\r
+#define SCB_CCSIDR_ASSOCIATIVITY_Pos        3U                                            /*!< SCB CCSIDR: Associativity Position */\r
+#define SCB_CCSIDR_ASSOCIATIVITY_Msk       (0x3FFUL << SCB_CCSIDR_ASSOCIATIVITY_Pos)      /*!< SCB CCSIDR: Associativity Mask */\r
+\r
+#define SCB_CCSIDR_LINESIZE_Pos             0U                                            /*!< SCB CCSIDR: LineSize Position */\r
+#define SCB_CCSIDR_LINESIZE_Msk            (7UL /*<< SCB_CCSIDR_LINESIZE_Pos*/)           /*!< SCB CCSIDR: LineSize Mask */\r
+\r
+/* SCB Cache Size Selection Register Definitions */\r
+#define SCB_CSSELR_LEVEL_Pos                1U                                            /*!< SCB CSSELR: Level Position */\r
+#define SCB_CSSELR_LEVEL_Msk               (7UL << SCB_CSSELR_LEVEL_Pos)                  /*!< SCB CSSELR: Level Mask */\r
+\r
+#define SCB_CSSELR_IND_Pos                  0U                                            /*!< SCB CSSELR: InD Position */\r
+#define SCB_CSSELR_IND_Msk                 (1UL /*<< SCB_CSSELR_IND_Pos*/)                /*!< SCB CSSELR: InD Mask */\r
+\r
+/* SCB Software Triggered Interrupt Register Definitions */\r
+#define SCB_STIR_INTID_Pos                  0U                                            /*!< SCB STIR: INTID Position */\r
+#define SCB_STIR_INTID_Msk                 (0x1FFUL /*<< SCB_STIR_INTID_Pos*/)            /*!< SCB STIR: INTID Mask */\r
+\r
+/* SCB D-Cache Invalidate by Set-way Register Definitions */\r
+#define SCB_DCISW_WAY_Pos                  30U                                            /*!< SCB DCISW: Way Position */\r
+#define SCB_DCISW_WAY_Msk                  (3UL << SCB_DCISW_WAY_Pos)                     /*!< SCB DCISW: Way Mask */\r
+\r
+#define SCB_DCISW_SET_Pos                   5U                                            /*!< SCB DCISW: Set Position */\r
+#define SCB_DCISW_SET_Msk                  (0x1FFUL << SCB_DCISW_SET_Pos)                 /*!< SCB DCISW: Set Mask */\r
+\r
+/* SCB D-Cache Clean by Set-way Register Definitions */\r
+#define SCB_DCCSW_WAY_Pos                  30U                                            /*!< SCB DCCSW: Way Position */\r
+#define SCB_DCCSW_WAY_Msk                  (3UL << SCB_DCCSW_WAY_Pos)                     /*!< SCB DCCSW: Way Mask */\r
+\r
+#define SCB_DCCSW_SET_Pos                   5U                                            /*!< SCB DCCSW: Set Position */\r
+#define SCB_DCCSW_SET_Msk                  (0x1FFUL << SCB_DCCSW_SET_Pos)                 /*!< SCB DCCSW: Set Mask */\r
+\r
+/* SCB D-Cache Clean and Invalidate by Set-way Register Definitions */\r
+#define SCB_DCCISW_WAY_Pos                 30U                                            /*!< SCB DCCISW: Way Position */\r
+#define SCB_DCCISW_WAY_Msk                 (3UL << SCB_DCCISW_WAY_Pos)                    /*!< SCB DCCISW: Way Mask */\r
+\r
+#define SCB_DCCISW_SET_Pos                  5U                                            /*!< SCB DCCISW: Set Position */\r
+#define SCB_DCCISW_SET_Msk                 (0x1FFUL << SCB_DCCISW_SET_Pos)                /*!< SCB DCCISW: Set Mask */\r
+\r
+/* Instruction Tightly-Coupled Memory Control Register Definitions */\r
+#define SCB_ITCMCR_SZ_Pos                   3U                                            /*!< SCB ITCMCR: SZ Position */\r
+#define SCB_ITCMCR_SZ_Msk                  (0xFUL << SCB_ITCMCR_SZ_Pos)                   /*!< SCB ITCMCR: SZ Mask */\r
+\r
+#define SCB_ITCMCR_RETEN_Pos                2U                                            /*!< SCB ITCMCR: RETEN Position */\r
+#define SCB_ITCMCR_RETEN_Msk               (1UL << SCB_ITCMCR_RETEN_Pos)                  /*!< SCB ITCMCR: RETEN Mask */\r
+\r
+#define SCB_ITCMCR_RMW_Pos                  1U                                            /*!< SCB ITCMCR: RMW Position */\r
+#define SCB_ITCMCR_RMW_Msk                 (1UL << SCB_ITCMCR_RMW_Pos)                    /*!< SCB ITCMCR: RMW Mask */\r
+\r
+#define SCB_ITCMCR_EN_Pos                   0U                                            /*!< SCB ITCMCR: EN Position */\r
+#define SCB_ITCMCR_EN_Msk                  (1UL /*<< SCB_ITCMCR_EN_Pos*/)                 /*!< SCB ITCMCR: EN Mask */\r
+\r
+/* Data Tightly-Coupled Memory Control Register Definitions */\r
+#define SCB_DTCMCR_SZ_Pos                   3U                                            /*!< SCB DTCMCR: SZ Position */\r
+#define SCB_DTCMCR_SZ_Msk                  (0xFUL << SCB_DTCMCR_SZ_Pos)                   /*!< SCB DTCMCR: SZ Mask */\r
+\r
+#define SCB_DTCMCR_RETEN_Pos                2U                                            /*!< SCB DTCMCR: RETEN Position */\r
+#define SCB_DTCMCR_RETEN_Msk               (1UL << SCB_DTCMCR_RETEN_Pos)                   /*!< SCB DTCMCR: RETEN Mask */\r
+\r
+#define SCB_DTCMCR_RMW_Pos                  1U                                            /*!< SCB DTCMCR: RMW Position */\r
+#define SCB_DTCMCR_RMW_Msk                 (1UL << SCB_DTCMCR_RMW_Pos)                    /*!< SCB DTCMCR: RMW Mask */\r
+\r
+#define SCB_DTCMCR_EN_Pos                   0U                                            /*!< SCB DTCMCR: EN Position */\r
+#define SCB_DTCMCR_EN_Msk                  (1UL /*<< SCB_DTCMCR_EN_Pos*/)                 /*!< SCB DTCMCR: EN Mask */\r
+\r
+/* AHBP Control Register Definitions */\r
+#define SCB_AHBPCR_SZ_Pos                   1U                                            /*!< SCB AHBPCR: SZ Position */\r
+#define SCB_AHBPCR_SZ_Msk                  (7UL << SCB_AHBPCR_SZ_Pos)                     /*!< SCB AHBPCR: SZ Mask */\r
+\r
+#define SCB_AHBPCR_EN_Pos                   0U                                            /*!< SCB AHBPCR: EN Position */\r
+#define SCB_AHBPCR_EN_Msk                  (1UL /*<< SCB_AHBPCR_EN_Pos*/)                 /*!< SCB AHBPCR: EN Mask */\r
+\r
+/* L1 Cache Control Register Definitions */\r
+#define SCB_CACR_FORCEWT_Pos                2U                                            /*!< SCB CACR: FORCEWT Position */\r
+#define SCB_CACR_FORCEWT_Msk               (1UL << SCB_CACR_FORCEWT_Pos)                  /*!< SCB CACR: FORCEWT Mask */\r
+\r
+#define SCB_CACR_ECCEN_Pos                  1U                                            /*!< SCB CACR: ECCEN Position */\r
+#define SCB_CACR_ECCEN_Msk                 (1UL << SCB_CACR_ECCEN_Pos)                    /*!< SCB CACR: ECCEN Mask */\r
+\r
+#define SCB_CACR_SIWT_Pos                   0U                                            /*!< SCB CACR: SIWT Position */\r
+#define SCB_CACR_SIWT_Msk                  (1UL /*<< SCB_CACR_SIWT_Pos*/)                 /*!< SCB CACR: SIWT Mask */\r
+\r
+/* AHBS Control Register Definitions */\r
+#define SCB_AHBSCR_INITCOUNT_Pos           11U                                            /*!< SCB AHBSCR: INITCOUNT Position */\r
+#define SCB_AHBSCR_INITCOUNT_Msk           (0x1FUL << SCB_AHBPCR_INITCOUNT_Pos)           /*!< SCB AHBSCR: INITCOUNT Mask */\r
+\r
+#define SCB_AHBSCR_TPRI_Pos                 2U                                            /*!< SCB AHBSCR: TPRI Position */\r
+#define SCB_AHBSCR_TPRI_Msk                (0x1FFUL << SCB_AHBPCR_TPRI_Pos)               /*!< SCB AHBSCR: TPRI Mask */\r
+\r
+#define SCB_AHBSCR_CTL_Pos                  0U                                            /*!< SCB AHBSCR: CTL Position*/\r
+#define SCB_AHBSCR_CTL_Msk                 (3UL /*<< SCB_AHBPCR_CTL_Pos*/)                /*!< SCB AHBSCR: CTL Mask */\r
+\r
+/* Auxiliary Bus Fault Status Register Definitions */\r
+#define SCB_ABFSR_AXIMTYPE_Pos              8U                                            /*!< SCB ABFSR: AXIMTYPE Position*/\r
+#define SCB_ABFSR_AXIMTYPE_Msk             (3UL << SCB_ABFSR_AXIMTYPE_Pos)                /*!< SCB ABFSR: AXIMTYPE Mask */\r
+\r
+#define SCB_ABFSR_EPPB_Pos                  4U                                            /*!< SCB ABFSR: EPPB Position*/\r
+#define SCB_ABFSR_EPPB_Msk                 (1UL << SCB_ABFSR_EPPB_Pos)                    /*!< SCB ABFSR: EPPB Mask */\r
+\r
+#define SCB_ABFSR_AXIM_Pos                  3U                                            /*!< SCB ABFSR: AXIM Position*/\r
+#define SCB_ABFSR_AXIM_Msk                 (1UL << SCB_ABFSR_AXIM_Pos)                    /*!< SCB ABFSR: AXIM Mask */\r
+\r
+#define SCB_ABFSR_AHBP_Pos                  2U                                            /*!< SCB ABFSR: AHBP Position*/\r
+#define SCB_ABFSR_AHBP_Msk                 (1UL << SCB_ABFSR_AHBP_Pos)                    /*!< SCB ABFSR: AHBP Mask */\r
+\r
+#define SCB_ABFSR_DTCM_Pos                  1U                                            /*!< SCB ABFSR: DTCM Position*/\r
+#define SCB_ABFSR_DTCM_Msk                 (1UL << SCB_ABFSR_DTCM_Pos)                    /*!< SCB ABFSR: DTCM Mask */\r
+\r
+#define SCB_ABFSR_ITCM_Pos                  0U                                            /*!< SCB ABFSR: ITCM Position*/\r
+#define SCB_ABFSR_ITCM_Msk                 (1UL /*<< SCB_ABFSR_ITCM_Pos*/)                /*!< SCB ABFSR: ITCM Mask */\r
+\r
+/*@} end of group CMSIS_SCB */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB)\r
+  \brief    Type definitions for the System Control and ID Register not in the SCB\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Control and ID Register not in the SCB.\r
+ */\r
+typedef struct\r
+{\r
+        uint32_t RESERVED0[1U];\r
+  __IM  uint32_t ICTR;                   /*!< Offset: 0x004 (R/ )  Interrupt Controller Type Register */\r
+  __IOM uint32_t ACTLR;                  /*!< Offset: 0x008 (R/W)  Auxiliary Control Register */\r
+  __IOM uint32_t CPPWR;                  /*!< Offset: 0x00C (R/W)  Coprocessor Power Control  Register */\r
+} SCnSCB_Type;\r
+\r
+/* Interrupt Controller Type Register Definitions */\r
+#define SCnSCB_ICTR_INTLINESNUM_Pos         0U                                         /*!< ICTR: INTLINESNUM Position */\r
+#define SCnSCB_ICTR_INTLINESNUM_Msk        (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/)  /*!< ICTR: INTLINESNUM Mask */\r
+\r
+/*@} end of group CMSIS_SCnotSCB */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SysTick     System Tick Timer (SysTick)\r
+  \brief    Type definitions for the System Timer Registers.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Timer (SysTick).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  SysTick Control and Status Register */\r
+  __IOM uint32_t LOAD;                   /*!< Offset: 0x004 (R/W)  SysTick Reload Value Register */\r
+  __IOM uint32_t VAL;                    /*!< Offset: 0x008 (R/W)  SysTick Current Value Register */\r
+  __IM  uint32_t CALIB;                  /*!< Offset: 0x00C (R/ )  SysTick Calibration Register */\r
+} SysTick_Type;\r
+\r
+/* SysTick Control / Status Register Definitions */\r
+#define SysTick_CTRL_COUNTFLAG_Pos         16U                                            /*!< SysTick CTRL: COUNTFLAG Position */\r
+#define SysTick_CTRL_COUNTFLAG_Msk         (1UL << SysTick_CTRL_COUNTFLAG_Pos)            /*!< SysTick CTRL: COUNTFLAG Mask */\r
+\r
+#define SysTick_CTRL_CLKSOURCE_Pos          2U                                            /*!< SysTick CTRL: CLKSOURCE Position */\r
+#define SysTick_CTRL_CLKSOURCE_Msk         (1UL << SysTick_CTRL_CLKSOURCE_Pos)            /*!< SysTick CTRL: CLKSOURCE Mask */\r
+\r
+#define SysTick_CTRL_TICKINT_Pos            1U                                            /*!< SysTick CTRL: TICKINT Position */\r
+#define SysTick_CTRL_TICKINT_Msk           (1UL << SysTick_CTRL_TICKINT_Pos)              /*!< SysTick CTRL: TICKINT Mask */\r
+\r
+#define SysTick_CTRL_ENABLE_Pos             0U                                            /*!< SysTick CTRL: ENABLE Position */\r
+#define SysTick_CTRL_ENABLE_Msk            (1UL /*<< SysTick_CTRL_ENABLE_Pos*/)           /*!< SysTick CTRL: ENABLE Mask */\r
+\r
+/* SysTick Reload Register Definitions */\r
+#define SysTick_LOAD_RELOAD_Pos             0U                                            /*!< SysTick LOAD: RELOAD Position */\r
+#define SysTick_LOAD_RELOAD_Msk            (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/)    /*!< SysTick LOAD: RELOAD Mask */\r
+\r
+/* SysTick Current Register Definitions */\r
+#define SysTick_VAL_CURRENT_Pos             0U                                            /*!< SysTick VAL: CURRENT Position */\r
+#define SysTick_VAL_CURRENT_Msk            (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/)    /*!< SysTick VAL: CURRENT Mask */\r
+\r
+/* SysTick Calibration Register Definitions */\r
+#define SysTick_CALIB_NOREF_Pos            31U                                            /*!< SysTick CALIB: NOREF Position */\r
+#define SysTick_CALIB_NOREF_Msk            (1UL << SysTick_CALIB_NOREF_Pos)               /*!< SysTick CALIB: NOREF Mask */\r
+\r
+#define SysTick_CALIB_SKEW_Pos             30U                                            /*!< SysTick CALIB: SKEW Position */\r
+#define SysTick_CALIB_SKEW_Msk             (1UL << SysTick_CALIB_SKEW_Pos)                /*!< SysTick CALIB: SKEW Mask */\r
+\r
+#define SysTick_CALIB_TENMS_Pos             0U                                            /*!< SysTick CALIB: TENMS Position */\r
+#define SysTick_CALIB_TENMS_Msk            (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/)    /*!< SysTick CALIB: TENMS Mask */\r
+\r
+/*@} end of group CMSIS_SysTick */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_ITM     Instrumentation Trace Macrocell (ITM)\r
+  \brief    Type definitions for the Instrumentation Trace Macrocell (ITM)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Instrumentation Trace Macrocell Register (ITM).\r
+ */\r
+typedef struct\r
+{\r
+  __OM  union\r
+  {\r
+    __OM  uint8_t    u8;                 /*!< Offset: 0x000 ( /W)  ITM Stimulus Port 8-bit */\r
+    __OM  uint16_t   u16;                /*!< Offset: 0x000 ( /W)  ITM Stimulus Port 16-bit */\r
+    __OM  uint32_t   u32;                /*!< Offset: 0x000 ( /W)  ITM Stimulus Port 32-bit */\r
+  }  PORT [32U];                         /*!< Offset: 0x000 ( /W)  ITM Stimulus Port Registers */\r
+        uint32_t RESERVED0[864U];\r
+  __IOM uint32_t TER;                    /*!< Offset: 0xE00 (R/W)  ITM Trace Enable Register */\r
+        uint32_t RESERVED1[15U];\r
+  __IOM uint32_t TPR;                    /*!< Offset: 0xE40 (R/W)  ITM Trace Privilege Register */\r
+        uint32_t RESERVED2[15U];\r
+  __IOM uint32_t TCR;                    /*!< Offset: 0xE80 (R/W)  ITM Trace Control Register */\r
+        uint32_t RESERVED3[29U];\r
+  __OM  uint32_t IWR;                    /*!< Offset: 0xEF8 ( /W)  ITM Integration Write Register */\r
+  __IM  uint32_t IRR;                    /*!< Offset: 0xEFC (R/ )  ITM Integration Read Register */\r
+  __IOM uint32_t IMCR;                   /*!< Offset: 0xF00 (R/W)  ITM Integration Mode Control Register */\r
+        uint32_t RESERVED4[43U];\r
+  __OM  uint32_t LAR;                    /*!< Offset: 0xFB0 ( /W)  ITM Lock Access Register */\r
+  __IM  uint32_t LSR;                    /*!< Offset: 0xFB4 (R/ )  ITM Lock Status Register */\r
+        uint32_t RESERVED5[1U];\r
+  __IM  uint32_t DEVARCH;                /*!< Offset: 0xFBC (R/ )  ITM Device Architecture Register */\r
+        uint32_t RESERVED6[4U];\r
+  __IM  uint32_t PID4;                   /*!< Offset: 0xFD0 (R/ )  ITM Peripheral Identification Register #4 */\r
+  __IM  uint32_t PID5;                   /*!< Offset: 0xFD4 (R/ )  ITM Peripheral Identification Register #5 */\r
+  __IM  uint32_t PID6;                   /*!< Offset: 0xFD8 (R/ )  ITM Peripheral Identification Register #6 */\r
+  __IM  uint32_t PID7;                   /*!< Offset: 0xFDC (R/ )  ITM Peripheral Identification Register #7 */\r
+  __IM  uint32_t PID0;                   /*!< Offset: 0xFE0 (R/ )  ITM Peripheral Identification Register #0 */\r
+  __IM  uint32_t PID1;                   /*!< Offset: 0xFE4 (R/ )  ITM Peripheral Identification Register #1 */\r
+  __IM  uint32_t PID2;                   /*!< Offset: 0xFE8 (R/ )  ITM Peripheral Identification Register #2 */\r
+  __IM  uint32_t PID3;                   /*!< Offset: 0xFEC (R/ )  ITM Peripheral Identification Register #3 */\r
+  __IM  uint32_t CID0;                   /*!< Offset: 0xFF0 (R/ )  ITM Component  Identification Register #0 */\r
+  __IM  uint32_t CID1;                   /*!< Offset: 0xFF4 (R/ )  ITM Component  Identification Register #1 */\r
+  __IM  uint32_t CID2;                   /*!< Offset: 0xFF8 (R/ )  ITM Component  Identification Register #2 */\r
+  __IM  uint32_t CID3;                   /*!< Offset: 0xFFC (R/ )  ITM Component  Identification Register #3 */\r
+} ITM_Type;\r
+\r
+/* ITM Stimulus Port Register Definitions */\r
+#define ITM_STIM_DISABLED_Pos               1U                                            /*!< ITM STIM: DISABLED Position */\r
+#define ITM_STIM_DISABLED_Msk              (0x1UL << ITM_STIM_DISABLED_Pos)               /*!< ITM STIM: DISABLED Mask */\r
+\r
+#define ITM_STIM_FIFOREADY_Pos              0U                                            /*!< ITM STIM: FIFOREADY Position */\r
+#define ITM_STIM_FIFOREADY_Msk             (0x1UL /*<< ITM_STIM_FIFOREADY_Pos*/)          /*!< ITM STIM: FIFOREADY Mask */\r
+\r
+/* ITM Trace Privilege Register Definitions */\r
+#define ITM_TPR_PRIVMASK_Pos                0U                                            /*!< ITM TPR: PRIVMASK Position */\r
+#define ITM_TPR_PRIVMASK_Msk               (0xFFFFFFFFUL /*<< ITM_TPR_PRIVMASK_Pos*/)     /*!< ITM TPR: PRIVMASK Mask */\r
+\r
+/* ITM Trace Control Register Definitions */\r
+#define ITM_TCR_BUSY_Pos                   23U                                            /*!< ITM TCR: BUSY Position */\r
+#define ITM_TCR_BUSY_Msk                   (1UL << ITM_TCR_BUSY_Pos)                      /*!< ITM TCR: BUSY Mask */\r
+\r
+#define ITM_TCR_TRACEBUSID_Pos             16U                                            /*!< ITM TCR: ATBID Position */\r
+#define ITM_TCR_TRACEBUSID_Msk             (0x7FUL << ITM_TCR_TRACEBUSID_Pos)             /*!< ITM TCR: ATBID Mask */\r
+\r
+#define ITM_TCR_GTSFREQ_Pos                10U                                            /*!< ITM TCR: Global timestamp frequency Position */\r
+#define ITM_TCR_GTSFREQ_Msk                (3UL << ITM_TCR_GTSFREQ_Pos)                   /*!< ITM TCR: Global timestamp frequency Mask */\r
+\r
+#define ITM_TCR_TSPRESCALE_Pos              8U                                            /*!< ITM TCR: TSPRESCALE Position */\r
+#define ITM_TCR_TSPRESCALE_Msk             (3UL << ITM_TCR_TSPRESCALE_Pos)                /*!< ITM TCR: TSPRESCALE Mask */\r
+\r
+#define ITM_TCR_STALLENA_Pos                5U                                            /*!< ITM TCR: STALLENA Position */\r
+#define ITM_TCR_STALLENA_Msk               (1UL << ITM_TCR_STALLENA_Pos)                  /*!< ITM TCR: STALLENA Mask */\r
+\r
+#define ITM_TCR_SWOENA_Pos                  4U                                            /*!< ITM TCR: SWOENA Position */\r
+#define ITM_TCR_SWOENA_Msk                 (1UL << ITM_TCR_SWOENA_Pos)                    /*!< ITM TCR: SWOENA Mask */\r
+\r
+#define ITM_TCR_DWTENA_Pos                  3U                                            /*!< ITM TCR: DWTENA Position */\r
+#define ITM_TCR_DWTENA_Msk                 (1UL << ITM_TCR_DWTENA_Pos)                    /*!< ITM TCR: DWTENA Mask */\r
+\r
+#define ITM_TCR_SYNCENA_Pos                 2U                                            /*!< ITM TCR: SYNCENA Position */\r
+#define ITM_TCR_SYNCENA_Msk                (1UL << ITM_TCR_SYNCENA_Pos)                   /*!< ITM TCR: SYNCENA Mask */\r
+\r
+#define ITM_TCR_TSENA_Pos                   1U                                            /*!< ITM TCR: TSENA Position */\r
+#define ITM_TCR_TSENA_Msk                  (1UL << ITM_TCR_TSENA_Pos)                     /*!< ITM TCR: TSENA Mask */\r
+\r
+#define ITM_TCR_ITMENA_Pos                  0U                                            /*!< ITM TCR: ITM Enable bit Position */\r
+#define ITM_TCR_ITMENA_Msk                 (1UL /*<< ITM_TCR_ITMENA_Pos*/)                /*!< ITM TCR: ITM Enable bit Mask */\r
+\r
+/* ITM Integration Write Register Definitions */\r
+#define ITM_IWR_ATVALIDM_Pos                0U                                            /*!< ITM IWR: ATVALIDM Position */\r
+#define ITM_IWR_ATVALIDM_Msk               (1UL /*<< ITM_IWR_ATVALIDM_Pos*/)              /*!< ITM IWR: ATVALIDM Mask */\r
+\r
+/* ITM Integration Read Register Definitions */\r
+#define ITM_IRR_ATREADYM_Pos                0U                                            /*!< ITM IRR: ATREADYM Position */\r
+#define ITM_IRR_ATREADYM_Msk               (1UL /*<< ITM_IRR_ATREADYM_Pos*/)              /*!< ITM IRR: ATREADYM Mask */\r
+\r
+/* ITM Integration Mode Control Register Definitions */\r
+#define ITM_IMCR_INTEGRATION_Pos            0U                                            /*!< ITM IMCR: INTEGRATION Position */\r
+#define ITM_IMCR_INTEGRATION_Msk           (1UL /*<< ITM_IMCR_INTEGRATION_Pos*/)          /*!< ITM IMCR: INTEGRATION Mask */\r
+\r
+/* ITM Lock Status Register Definitions */\r
+#define ITM_LSR_ByteAcc_Pos                 2U                                            /*!< ITM LSR: ByteAcc Position */\r
+#define ITM_LSR_ByteAcc_Msk                (1UL << ITM_LSR_ByteAcc_Pos)                   /*!< ITM LSR: ByteAcc Mask */\r
+\r
+#define ITM_LSR_Access_Pos                  1U                                            /*!< ITM LSR: Access Position */\r
+#define ITM_LSR_Access_Msk                 (1UL << ITM_LSR_Access_Pos)                    /*!< ITM LSR: Access Mask */\r
+\r
+#define ITM_LSR_Present_Pos                 0U                                            /*!< ITM LSR: Present Position */\r
+#define ITM_LSR_Present_Msk                (1UL /*<< ITM_LSR_Present_Pos*/)               /*!< ITM LSR: Present Mask */\r
+\r
+/*@}*/ /* end of group CMSIS_ITM */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_DWT     Data Watchpoint and Trace (DWT)\r
+  \brief    Type definitions for the Data Watchpoint and Trace (DWT)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Data Watchpoint and Trace Register (DWT).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  Control Register */\r
+  __IOM uint32_t CYCCNT;                 /*!< Offset: 0x004 (R/W)  Cycle Count Register */\r
+  __IOM uint32_t CPICNT;                 /*!< Offset: 0x008 (R/W)  CPI Count Register */\r
+  __IOM uint32_t EXCCNT;                 /*!< Offset: 0x00C (R/W)  Exception Overhead Count Register */\r
+  __IOM uint32_t SLEEPCNT;               /*!< Offset: 0x010 (R/W)  Sleep Count Register */\r
+  __IOM uint32_t LSUCNT;                 /*!< Offset: 0x014 (R/W)  LSU Count Register */\r
+  __IOM uint32_t FOLDCNT;                /*!< Offset: 0x018 (R/W)  Folded-instruction Count Register */\r
+  __IM  uint32_t PCSR;                   /*!< Offset: 0x01C (R/ )  Program Counter Sample Register */\r
+  __IOM uint32_t COMP0;                  /*!< Offset: 0x020 (R/W)  Comparator Register 0 */\r
+        uint32_t RESERVED1[1U];\r
+  __IOM uint32_t FUNCTION0;              /*!< Offset: 0x028 (R/W)  Function Register 0 */\r
+        uint32_t RESERVED2[1U];\r
+  __IOM uint32_t COMP1;                  /*!< Offset: 0x030 (R/W)  Comparator Register 1 */\r
+        uint32_t RESERVED3[1U];\r
+  __IOM uint32_t FUNCTION1;              /*!< Offset: 0x038 (R/W)  Function Register 1 */\r
+        uint32_t RESERVED4[1U];\r
+  __IOM uint32_t COMP2;                  /*!< Offset: 0x040 (R/W)  Comparator Register 2 */\r
+        uint32_t RESERVED5[1U];\r
+  __IOM uint32_t FUNCTION2;              /*!< Offset: 0x048 (R/W)  Function Register 2 */\r
+        uint32_t RESERVED6[1U];\r
+  __IOM uint32_t COMP3;                  /*!< Offset: 0x050 (R/W)  Comparator Register 3 */\r
+        uint32_t RESERVED7[1U];\r
+  __IOM uint32_t FUNCTION3;              /*!< Offset: 0x058 (R/W)  Function Register 3 */\r
+        uint32_t RESERVED8[1U];\r
+  __IOM uint32_t COMP4;                  /*!< Offset: 0x060 (R/W)  Comparator Register 4 */\r
+        uint32_t RESERVED9[1U];\r
+  __IOM uint32_t FUNCTION4;              /*!< Offset: 0x068 (R/W)  Function Register 4 */\r
+        uint32_t RESERVED10[1U];\r
+  __IOM uint32_t COMP5;                  /*!< Offset: 0x070 (R/W)  Comparator Register 5 */\r
+        uint32_t RESERVED11[1U];\r
+  __IOM uint32_t FUNCTION5;              /*!< Offset: 0x078 (R/W)  Function Register 5 */\r
+        uint32_t RESERVED12[1U];\r
+  __IOM uint32_t COMP6;                  /*!< Offset: 0x080 (R/W)  Comparator Register 6 */\r
+        uint32_t RESERVED13[1U];\r
+  __IOM uint32_t FUNCTION6;              /*!< Offset: 0x088 (R/W)  Function Register 6 */\r
+        uint32_t RESERVED14[1U];\r
+  __IOM uint32_t COMP7;                  /*!< Offset: 0x090 (R/W)  Comparator Register 7 */\r
+        uint32_t RESERVED15[1U];\r
+  __IOM uint32_t FUNCTION7;              /*!< Offset: 0x098 (R/W)  Function Register 7 */\r
+        uint32_t RESERVED16[1U];\r
+  __IOM uint32_t COMP8;                  /*!< Offset: 0x0A0 (R/W)  Comparator Register 8 */\r
+        uint32_t RESERVED17[1U];\r
+  __IOM uint32_t FUNCTION8;              /*!< Offset: 0x0A8 (R/W)  Function Register 8 */\r
+        uint32_t RESERVED18[1U];\r
+  __IOM uint32_t COMP9;                  /*!< Offset: 0x0B0 (R/W)  Comparator Register 9 */\r
+        uint32_t RESERVED19[1U];\r
+  __IOM uint32_t FUNCTION9;              /*!< Offset: 0x0B8 (R/W)  Function Register 9 */\r
+        uint32_t RESERVED20[1U];\r
+  __IOM uint32_t COMP10;                 /*!< Offset: 0x0C0 (R/W)  Comparator Register 10 */\r
+        uint32_t RESERVED21[1U];\r
+  __IOM uint32_t FUNCTION10;             /*!< Offset: 0x0C8 (R/W)  Function Register 10 */\r
+        uint32_t RESERVED22[1U];\r
+  __IOM uint32_t COMP11;                 /*!< Offset: 0x0D0 (R/W)  Comparator Register 11 */\r
+        uint32_t RESERVED23[1U];\r
+  __IOM uint32_t FUNCTION11;             /*!< Offset: 0x0D8 (R/W)  Function Register 11 */\r
+        uint32_t RESERVED24[1U];\r
+  __IOM uint32_t COMP12;                 /*!< Offset: 0x0E0 (R/W)  Comparator Register 12 */\r
+        uint32_t RESERVED25[1U];\r
+  __IOM uint32_t FUNCTION12;             /*!< Offset: 0x0E8 (R/W)  Function Register 12 */\r
+        uint32_t RESERVED26[1U];\r
+  __IOM uint32_t COMP13;                 /*!< Offset: 0x0F0 (R/W)  Comparator Register 13 */\r
+        uint32_t RESERVED27[1U];\r
+  __IOM uint32_t FUNCTION13;             /*!< Offset: 0x0F8 (R/W)  Function Register 13 */\r
+        uint32_t RESERVED28[1U];\r
+  __IOM uint32_t COMP14;                 /*!< Offset: 0x100 (R/W)  Comparator Register 14 */\r
+        uint32_t RESERVED29[1U];\r
+  __IOM uint32_t FUNCTION14;             /*!< Offset: 0x108 (R/W)  Function Register 14 */\r
+        uint32_t RESERVED30[1U];\r
+  __IOM uint32_t COMP15;                 /*!< Offset: 0x110 (R/W)  Comparator Register 15 */\r
+        uint32_t RESERVED31[1U];\r
+  __IOM uint32_t FUNCTION15;             /*!< Offset: 0x118 (R/W)  Function Register 15 */\r
+        uint32_t RESERVED32[934U];\r
+  __IM  uint32_t LSR;                    /*!< Offset: 0xFB4 (R  )  Lock Status Register */\r
+        uint32_t RESERVED33[1U];\r
+  __IM  uint32_t DEVARCH;                /*!< Offset: 0xFBC (R/ )  Device Architecture Register */\r
+} DWT_Type;\r
+\r
+/* DWT Control Register Definitions */\r
+#define DWT_CTRL_NUMCOMP_Pos               28U                                         /*!< DWT CTRL: NUMCOMP Position */\r
+#define DWT_CTRL_NUMCOMP_Msk               (0xFUL << DWT_CTRL_NUMCOMP_Pos)             /*!< DWT CTRL: NUMCOMP Mask */\r
+\r
+#define DWT_CTRL_NOTRCPKT_Pos              27U                                         /*!< DWT CTRL: NOTRCPKT Position */\r
+#define DWT_CTRL_NOTRCPKT_Msk              (0x1UL << DWT_CTRL_NOTRCPKT_Pos)            /*!< DWT CTRL: NOTRCPKT Mask */\r
+\r
+#define DWT_CTRL_NOEXTTRIG_Pos             26U                                         /*!< DWT CTRL: NOEXTTRIG Position */\r
+#define DWT_CTRL_NOEXTTRIG_Msk             (0x1UL << DWT_CTRL_NOEXTTRIG_Pos)           /*!< DWT CTRL: NOEXTTRIG Mask */\r
+\r
+#define DWT_CTRL_NOCYCCNT_Pos              25U                                         /*!< DWT CTRL: NOCYCCNT Position */\r
+#define DWT_CTRL_NOCYCCNT_Msk              (0x1UL << DWT_CTRL_NOCYCCNT_Pos)            /*!< DWT CTRL: NOCYCCNT Mask */\r
+\r
+#define DWT_CTRL_NOPRFCNT_Pos              24U                                         /*!< DWT CTRL: NOPRFCNT Position */\r
+#define DWT_CTRL_NOPRFCNT_Msk              (0x1UL << DWT_CTRL_NOPRFCNT_Pos)            /*!< DWT CTRL: NOPRFCNT Mask */\r
+\r
+#define DWT_CTRL_CYCDISS_Pos               23U                                         /*!< DWT CTRL: CYCDISS Position */\r
+#define DWT_CTRL_CYCDISS_Msk               (0x1UL << DWT_CTRL_CYCDISS_Pos)             /*!< DWT CTRL: CYCDISS Mask */\r
+\r
+#define DWT_CTRL_CYCEVTENA_Pos             22U                                         /*!< DWT CTRL: CYCEVTENA Position */\r
+#define DWT_CTRL_CYCEVTENA_Msk             (0x1UL << DWT_CTRL_CYCEVTENA_Pos)           /*!< DWT CTRL: CYCEVTENA Mask */\r
+\r
+#define DWT_CTRL_FOLDEVTENA_Pos            21U                                         /*!< DWT CTRL: FOLDEVTENA Position */\r
+#define DWT_CTRL_FOLDEVTENA_Msk            (0x1UL << DWT_CTRL_FOLDEVTENA_Pos)          /*!< DWT CTRL: FOLDEVTENA Mask */\r
+\r
+#define DWT_CTRL_LSUEVTENA_Pos             20U                                         /*!< DWT CTRL: LSUEVTENA Position */\r
+#define DWT_CTRL_LSUEVTENA_Msk             (0x1UL << DWT_CTRL_LSUEVTENA_Pos)           /*!< DWT CTRL: LSUEVTENA Mask */\r
+\r
+#define DWT_CTRL_SLEEPEVTENA_Pos           19U                                         /*!< DWT CTRL: SLEEPEVTENA Position */\r
+#define DWT_CTRL_SLEEPEVTENA_Msk           (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos)         /*!< DWT CTRL: SLEEPEVTENA Mask */\r
+\r
+#define DWT_CTRL_EXCEVTENA_Pos             18U                                         /*!< DWT CTRL: EXCEVTENA Position */\r
+#define DWT_CTRL_EXCEVTENA_Msk             (0x1UL << DWT_CTRL_EXCEVTENA_Pos)           /*!< DWT CTRL: EXCEVTENA Mask */\r
+\r
+#define DWT_CTRL_CPIEVTENA_Pos             17U                                         /*!< DWT CTRL: CPIEVTENA Position */\r
+#define DWT_CTRL_CPIEVTENA_Msk             (0x1UL << DWT_CTRL_CPIEVTENA_Pos)           /*!< DWT CTRL: CPIEVTENA Mask */\r
+\r
+#define DWT_CTRL_EXCTRCENA_Pos             16U                                         /*!< DWT CTRL: EXCTRCENA Position */\r
+#define DWT_CTRL_EXCTRCENA_Msk             (0x1UL << DWT_CTRL_EXCTRCENA_Pos)           /*!< DWT CTRL: EXCTRCENA Mask */\r
+\r
+#define DWT_CTRL_PCSAMPLENA_Pos            12U                                         /*!< DWT CTRL: PCSAMPLENA Position */\r
+#define DWT_CTRL_PCSAMPLENA_Msk            (0x1UL << DWT_CTRL_PCSAMPLENA_Pos)          /*!< DWT CTRL: PCSAMPLENA Mask */\r
+\r
+#define DWT_CTRL_SYNCTAP_Pos               10U                                         /*!< DWT CTRL: SYNCTAP Position */\r
+#define DWT_CTRL_SYNCTAP_Msk               (0x3UL << DWT_CTRL_SYNCTAP_Pos)             /*!< DWT CTRL: SYNCTAP Mask */\r
+\r
+#define DWT_CTRL_CYCTAP_Pos                 9U                                         /*!< DWT CTRL: CYCTAP Position */\r
+#define DWT_CTRL_CYCTAP_Msk                (0x1UL << DWT_CTRL_CYCTAP_Pos)              /*!< DWT CTRL: CYCTAP Mask */\r
+\r
+#define DWT_CTRL_POSTINIT_Pos               5U                                         /*!< DWT CTRL: POSTINIT Position */\r
+#define DWT_CTRL_POSTINIT_Msk              (0xFUL << DWT_CTRL_POSTINIT_Pos)            /*!< DWT CTRL: POSTINIT Mask */\r
+\r
+#define DWT_CTRL_POSTPRESET_Pos             1U                                         /*!< DWT CTRL: POSTPRESET Position */\r
+#define DWT_CTRL_POSTPRESET_Msk            (0xFUL << DWT_CTRL_POSTPRESET_Pos)          /*!< DWT CTRL: POSTPRESET Mask */\r
+\r
+#define DWT_CTRL_CYCCNTENA_Pos              0U                                         /*!< DWT CTRL: CYCCNTENA Position */\r
+#define DWT_CTRL_CYCCNTENA_Msk             (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/)       /*!< DWT CTRL: CYCCNTENA Mask */\r
+\r
+/* DWT CPI Count Register Definitions */\r
+#define DWT_CPICNT_CPICNT_Pos               0U                                         /*!< DWT CPICNT: CPICNT Position */\r
+#define DWT_CPICNT_CPICNT_Msk              (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/)       /*!< DWT CPICNT: CPICNT Mask */\r
+\r
+/* DWT Exception Overhead Count Register Definitions */\r
+#define DWT_EXCCNT_EXCCNT_Pos               0U                                         /*!< DWT EXCCNT: EXCCNT Position */\r
+#define DWT_EXCCNT_EXCCNT_Msk              (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/)       /*!< DWT EXCCNT: EXCCNT Mask */\r
+\r
+/* DWT Sleep Count Register Definitions */\r
+#define DWT_SLEEPCNT_SLEEPCNT_Pos           0U                                         /*!< DWT SLEEPCNT: SLEEPCNT Position */\r
+#define DWT_SLEEPCNT_SLEEPCNT_Msk          (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/)   /*!< DWT SLEEPCNT: SLEEPCNT Mask */\r
+\r
+/* DWT LSU Count Register Definitions */\r
+#define DWT_LSUCNT_LSUCNT_Pos               0U                                         /*!< DWT LSUCNT: LSUCNT Position */\r
+#define DWT_LSUCNT_LSUCNT_Msk              (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/)       /*!< DWT LSUCNT: LSUCNT Mask */\r
+\r
+/* DWT Folded-instruction Count Register Definitions */\r
+#define DWT_FOLDCNT_FOLDCNT_Pos             0U                                         /*!< DWT FOLDCNT: FOLDCNT Position */\r
+#define DWT_FOLDCNT_FOLDCNT_Msk            (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/)     /*!< DWT FOLDCNT: FOLDCNT Mask */\r
+\r
+/* DWT Comparator Function Register Definitions */\r
+#define DWT_FUNCTION_ID_Pos                27U                                         /*!< DWT FUNCTION: ID Position */\r
+#define DWT_FUNCTION_ID_Msk                (0x1FUL << DWT_FUNCTION_ID_Pos)             /*!< DWT FUNCTION: ID Mask */\r
+\r
+#define DWT_FUNCTION_MATCHED_Pos           24U                                         /*!< DWT FUNCTION: MATCHED Position */\r
+#define DWT_FUNCTION_MATCHED_Msk           (0x1UL << DWT_FUNCTION_MATCHED_Pos)         /*!< DWT FUNCTION: MATCHED Mask */\r
+\r
+#define DWT_FUNCTION_DATAVSIZE_Pos         10U                                         /*!< DWT FUNCTION: DATAVSIZE Position */\r
+#define DWT_FUNCTION_DATAVSIZE_Msk         (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos)       /*!< DWT FUNCTION: DATAVSIZE Mask */\r
+\r
+#define DWT_FUNCTION_ACTION_Pos             4U                                         /*!< DWT FUNCTION: ACTION Position */\r
+#define DWT_FUNCTION_ACTION_Msk            (0x1UL << DWT_FUNCTION_ACTION_Pos)          /*!< DWT FUNCTION: ACTION Mask */\r
+\r
+#define DWT_FUNCTION_MATCH_Pos              0U                                         /*!< DWT FUNCTION: MATCH Position */\r
+#define DWT_FUNCTION_MATCH_Msk             (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/)       /*!< DWT FUNCTION: MATCH Mask */\r
+\r
+/*@}*/ /* end of group CMSIS_DWT */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_TPI     Trace Port Interface (TPI)\r
+  \brief    Type definitions for the Trace Port Interface (TPI)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Trace Port Interface Register (TPI).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t SSPSR;                  /*!< Offset: 0x000 (R/ )  Supported Parallel Port Size Register */\r
+  __IOM uint32_t CSPSR;                  /*!< Offset: 0x004 (R/W)  Current Parallel Port Size Register */\r
+        uint32_t RESERVED0[2U];\r
+  __IOM uint32_t ACPR;                   /*!< Offset: 0x010 (R/W)  Asynchronous Clock Prescaler Register */\r
+        uint32_t RESERVED1[55U];\r
+  __IOM uint32_t SPPR;                   /*!< Offset: 0x0F0 (R/W)  Selected Pin Protocol Register */\r
+        uint32_t RESERVED2[131U];\r
+  __IM  uint32_t FFSR;                   /*!< Offset: 0x300 (R/ )  Formatter and Flush Status Register */\r
+  __IOM uint32_t FFCR;                   /*!< Offset: 0x304 (R/W)  Formatter and Flush Control Register */\r
+  __IOM uint32_t PSCR;                   /*!< Offset: 0x308 (R/W)  Periodic Synchronization Control Register */\r
+        uint32_t RESERVED3[759U];\r
+  __IM  uint32_t TRIGGER;                /*!< Offset: 0xEE8 (R/ )  TRIGGER Register */\r
+  __IM  uint32_t ITFTTD0;                /*!< Offset: 0xEEC (R/ )  Integration Test FIFO Test Data 0 Register */\r
+  __IOM uint32_t ITATBCTR2;              /*!< Offset: 0xEF0 (R/W)  Integration Test ATB Control Register 2 */\r
+        uint32_t RESERVED4[1U];\r
+  __IM  uint32_t ITATBCTR0;              /*!< Offset: 0xEF8 (R/ )  Integration Test ATB Control Register 0 */\r
+  __IM  uint32_t ITFTTD1;                /*!< Offset: 0xEFC (R/ )  Integration Test FIFO Test Data 1 Register */\r
+  __IOM uint32_t ITCTRL;                 /*!< Offset: 0xF00 (R/W)  Integration Mode Control */\r
+        uint32_t RESERVED5[39U];\r
+  __IOM uint32_t CLAIMSET;               /*!< Offset: 0xFA0 (R/W)  Claim tag set */\r
+  __IOM uint32_t CLAIMCLR;               /*!< Offset: 0xFA4 (R/W)  Claim tag clear */\r
+        uint32_t RESERVED7[8U];\r
+  __IM  uint32_t DEVID;                  /*!< Offset: 0xFC8 (R/ )  Device Configuration Register */\r
+  __IM  uint32_t DEVTYPE;                /*!< Offset: 0xFCC (R/ )  Device Type Identifier Register */\r
+} TPI_Type;\r
+\r
+/* TPI Asynchronous Clock Prescaler Register Definitions */\r
+#define TPI_ACPR_PRESCALER_Pos              0U                                         /*!< TPI ACPR: PRESCALER Position */\r
+#define TPI_ACPR_PRESCALER_Msk             (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/)    /*!< TPI ACPR: PRESCALER Mask */\r
+\r
+/* TPI Selected Pin Protocol Register Definitions */\r
+#define TPI_SPPR_TXMODE_Pos                 0U                                         /*!< TPI SPPR: TXMODE Position */\r
+#define TPI_SPPR_TXMODE_Msk                (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/)          /*!< TPI SPPR: TXMODE Mask */\r
+\r
+/* TPI Formatter and Flush Status Register Definitions */\r
+#define TPI_FFSR_FtNonStop_Pos              3U                                         /*!< TPI FFSR: FtNonStop Position */\r
+#define TPI_FFSR_FtNonStop_Msk             (0x1UL << TPI_FFSR_FtNonStop_Pos)           /*!< TPI FFSR: FtNonStop Mask */\r
+\r
+#define TPI_FFSR_TCPresent_Pos              2U                                         /*!< TPI FFSR: TCPresent Position */\r
+#define TPI_FFSR_TCPresent_Msk             (0x1UL << TPI_FFSR_TCPresent_Pos)           /*!< TPI FFSR: TCPresent Mask */\r
+\r
+#define TPI_FFSR_FtStopped_Pos              1U                                         /*!< TPI FFSR: FtStopped Position */\r
+#define TPI_FFSR_FtStopped_Msk             (0x1UL << TPI_FFSR_FtStopped_Pos)           /*!< TPI FFSR: FtStopped Mask */\r
+\r
+#define TPI_FFSR_FlInProg_Pos               0U                                         /*!< TPI FFSR: FlInProg Position */\r
+#define TPI_FFSR_FlInProg_Msk              (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/)        /*!< TPI FFSR: FlInProg Mask */\r
+\r
+/* TPI Formatter and Flush Control Register Definitions */\r
+#define TPI_FFCR_TrigIn_Pos                 8U                                         /*!< TPI FFCR: TrigIn Position */\r
+#define TPI_FFCR_TrigIn_Msk                (0x1UL << TPI_FFCR_TrigIn_Pos)              /*!< TPI FFCR: TrigIn Mask */\r
+\r
+#define TPI_FFCR_FOnMan_Pos                 6U                                         /*!< TPI FFCR: FOnMan Position */\r
+#define TPI_FFCR_FOnMan_Msk                (0x1UL << TPI_FFCR_FOnMan_Pos)              /*!< TPI FFCR: FOnMan Mask */\r
+\r
+#define TPI_FFCR_EnFCont_Pos                1U                                         /*!< TPI FFCR: EnFCont Position */\r
+#define TPI_FFCR_EnFCont_Msk               (0x1UL << TPI_FFCR_EnFCont_Pos)             /*!< TPI FFCR: EnFCont Mask */\r
+\r
+/* TPI TRIGGER Register Definitions */\r
+#define TPI_TRIGGER_TRIGGER_Pos             0U                                         /*!< TPI TRIGGER: TRIGGER Position */\r
+#define TPI_TRIGGER_TRIGGER_Msk            (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/)      /*!< TPI TRIGGER: TRIGGER Mask */\r
+\r
+/* TPI Integration Test FIFO Test Data 0 Register Definitions */\r
+#define TPI_ITFTTD0_ATB_IF2_ATVALID_Pos    29U                                         /*!< TPI ITFTTD0: ATB Interface 2 ATVALIDPosition */\r
+#define TPI_ITFTTD0_ATB_IF2_ATVALID_Msk    (0x3UL << TPI_ITFTTD0_ATB_IF2_ATVALID_Pos)  /*!< TPI ITFTTD0: ATB Interface 2 ATVALID Mask */\r
+\r
+#define TPI_ITFTTD0_ATB_IF2_bytecount_Pos  27U                                         /*!< TPI ITFTTD0: ATB Interface 2 byte count Position */\r
+#define TPI_ITFTTD0_ATB_IF2_bytecount_Msk  (0x3UL << TPI_ITFTTD0_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 2 byte count Mask */\r
+\r
+#define TPI_ITFTTD0_ATB_IF1_ATVALID_Pos    26U                                         /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Position */\r
+#define TPI_ITFTTD0_ATB_IF1_ATVALID_Msk    (0x3UL << TPI_ITFTTD0_ATB_IF1_ATVALID_Pos)  /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Mask */\r
+\r
+#define TPI_ITFTTD0_ATB_IF1_bytecount_Pos  24U                                         /*!< TPI ITFTTD0: ATB Interface 1 byte count Position */\r
+#define TPI_ITFTTD0_ATB_IF1_bytecount_Msk  (0x3UL << TPI_ITFTTD0_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 1 byte countt Mask */\r
+\r
+#define TPI_ITFTTD0_ATB_IF1_data2_Pos      16U                                         /*!< TPI ITFTTD0: ATB Interface 1 data2 Position */\r
+#define TPI_ITFTTD0_ATB_IF1_data2_Msk      (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos)   /*!< TPI ITFTTD0: ATB Interface 1 data2 Mask */\r
+\r
+#define TPI_ITFTTD0_ATB_IF1_data1_Pos       8U                                         /*!< TPI ITFTTD0: ATB Interface 1 data1 Position */\r
+#define TPI_ITFTTD0_ATB_IF1_data1_Msk      (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos)   /*!< TPI ITFTTD0: ATB Interface 1 data1 Mask */\r
+\r
+#define TPI_ITFTTD0_ATB_IF1_data0_Pos       0U                                          /*!< TPI ITFTTD0: ATB Interface 1 data0 Position */\r
+#define TPI_ITFTTD0_ATB_IF1_data0_Msk      (0xFFUL /*<< TPI_ITFTTD0_ATB_IF1_data0_Pos*/) /*!< TPI ITFTTD0: ATB Interface 1 data0 Mask */\r
+\r
+/* TPI Integration Test ATB Control Register 2 Register Definitions */\r
+#define TPI_ITATBCTR2_AFVALID2S_Pos         1U                                         /*!< TPI ITATBCTR2: AFVALID2S Position */\r
+#define TPI_ITATBCTR2_AFVALID2S_Msk        (0x1UL << TPI_ITATBCTR2_AFVALID2S_Pos)      /*!< TPI ITATBCTR2: AFVALID2SS Mask */\r
+\r
+#define TPI_ITATBCTR2_AFVALID1S_Pos         1U                                         /*!< TPI ITATBCTR2: AFVALID1S Position */\r
+#define TPI_ITATBCTR2_AFVALID1S_Msk        (0x1UL << TPI_ITATBCTR2_AFVALID1S_Pos)      /*!< TPI ITATBCTR2: AFVALID1SS Mask */\r
+\r
+#define TPI_ITATBCTR2_ATREADY2S_Pos         0U                                         /*!< TPI ITATBCTR2: ATREADY2S Position */\r
+#define TPI_ITATBCTR2_ATREADY2S_Msk        (0x1UL /*<< TPI_ITATBCTR2_ATREADY2S_Pos*/)  /*!< TPI ITATBCTR2: ATREADY2S Mask */\r
+\r
+#define TPI_ITATBCTR2_ATREADY1S_Pos         0U                                         /*!< TPI ITATBCTR2: ATREADY1S Position */\r
+#define TPI_ITATBCTR2_ATREADY1S_Msk        (0x1UL /*<< TPI_ITATBCTR2_ATREADY1S_Pos*/)  /*!< TPI ITATBCTR2: ATREADY1S Mask */\r
+\r
+/* TPI Integration Test FIFO Test Data 1 Register Definitions */\r
+#define TPI_ITFTTD1_ATB_IF2_ATVALID_Pos    29U                                         /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Position */\r
+#define TPI_ITFTTD1_ATB_IF2_ATVALID_Msk    (0x3UL << TPI_ITFTTD1_ATB_IF2_ATVALID_Pos)  /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Mask */\r
+\r
+#define TPI_ITFTTD1_ATB_IF2_bytecount_Pos  27U                                         /*!< TPI ITFTTD1: ATB Interface 2 byte count Position */\r
+#define TPI_ITFTTD1_ATB_IF2_bytecount_Msk  (0x3UL << TPI_ITFTTD1_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 2 byte count Mask */\r
+\r
+#define TPI_ITFTTD1_ATB_IF1_ATVALID_Pos    26U                                         /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Position */\r
+#define TPI_ITFTTD1_ATB_IF1_ATVALID_Msk    (0x3UL << TPI_ITFTTD1_ATB_IF1_ATVALID_Pos)  /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Mask */\r
+\r
+#define TPI_ITFTTD1_ATB_IF1_bytecount_Pos  24U                                         /*!< TPI ITFTTD1: ATB Interface 1 byte count Position */\r
+#define TPI_ITFTTD1_ATB_IF1_bytecount_Msk  (0x3UL << TPI_ITFTTD1_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 1 byte countt Mask */\r
+\r
+#define TPI_ITFTTD1_ATB_IF2_data2_Pos      16U                                         /*!< TPI ITFTTD1: ATB Interface 2 data2 Position */\r
+#define TPI_ITFTTD1_ATB_IF2_data2_Msk      (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos)   /*!< TPI ITFTTD1: ATB Interface 2 data2 Mask */\r
+\r
+#define TPI_ITFTTD1_ATB_IF2_data1_Pos       8U                                         /*!< TPI ITFTTD1: ATB Interface 2 data1 Position */\r
+#define TPI_ITFTTD1_ATB_IF2_data1_Msk      (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos)   /*!< TPI ITFTTD1: ATB Interface 2 data1 Mask */\r
+\r
+#define TPI_ITFTTD1_ATB_IF2_data0_Pos       0U                                          /*!< TPI ITFTTD1: ATB Interface 2 data0 Position */\r
+#define TPI_ITFTTD1_ATB_IF2_data0_Msk      (0xFFUL /*<< TPI_ITFTTD1_ATB_IF2_data0_Pos*/) /*!< TPI ITFTTD1: ATB Interface 2 data0 Mask */\r
+\r
+/* TPI Integration Test ATB Control Register 0 Definitions */\r
+#define TPI_ITATBCTR0_AFVALID2S_Pos         1U                                         /*!< TPI ITATBCTR0: AFVALID2S Position */\r
+#define TPI_ITATBCTR0_AFVALID2S_Msk        (0x1UL << TPI_ITATBCTR0_AFVALID2S_Pos)      /*!< TPI ITATBCTR0: AFVALID2SS Mask */\r
+\r
+#define TPI_ITATBCTR0_AFVALID1S_Pos         1U                                         /*!< TPI ITATBCTR0: AFVALID1S Position */\r
+#define TPI_ITATBCTR0_AFVALID1S_Msk        (0x1UL << TPI_ITATBCTR0_AFVALID1S_Pos)      /*!< TPI ITATBCTR0: AFVALID1SS Mask */\r
+\r
+#define TPI_ITATBCTR0_ATREADY2S_Pos         0U                                         /*!< TPI ITATBCTR0: ATREADY2S Position */\r
+#define TPI_ITATBCTR0_ATREADY2S_Msk        (0x1UL /*<< TPI_ITATBCTR0_ATREADY2S_Pos*/)  /*!< TPI ITATBCTR0: ATREADY2S Mask */\r
+\r
+#define TPI_ITATBCTR0_ATREADY1S_Pos         0U                                         /*!< TPI ITATBCTR0: ATREADY1S Position */\r
+#define TPI_ITATBCTR0_ATREADY1S_Msk        (0x1UL /*<< TPI_ITATBCTR0_ATREADY1S_Pos*/)  /*!< TPI ITATBCTR0: ATREADY1S Mask */\r
+\r
+/* TPI Integration Mode Control Register Definitions */\r
+#define TPI_ITCTRL_Mode_Pos                 0U                                         /*!< TPI ITCTRL: Mode Position */\r
+#define TPI_ITCTRL_Mode_Msk                (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/)          /*!< TPI ITCTRL: Mode Mask */\r
+\r
+/* TPI DEVID Register Definitions */\r
+#define TPI_DEVID_NRZVALID_Pos             11U                                         /*!< TPI DEVID: NRZVALID Position */\r
+#define TPI_DEVID_NRZVALID_Msk             (0x1UL << TPI_DEVID_NRZVALID_Pos)           /*!< TPI DEVID: NRZVALID Mask */\r
+\r
+#define TPI_DEVID_MANCVALID_Pos            10U                                         /*!< TPI DEVID: MANCVALID Position */\r
+#define TPI_DEVID_MANCVALID_Msk            (0x1UL << TPI_DEVID_MANCVALID_Pos)          /*!< TPI DEVID: MANCVALID Mask */\r
+\r
+#define TPI_DEVID_PTINVALID_Pos             9U                                         /*!< TPI DEVID: PTINVALID Position */\r
+#define TPI_DEVID_PTINVALID_Msk            (0x1UL << TPI_DEVID_PTINVALID_Pos)          /*!< TPI DEVID: PTINVALID Mask */\r
+\r
+#define TPI_DEVID_FIFOSZ_Pos                6U                                         /*!< TPI DEVID: FIFOSZ Position */\r
+#define TPI_DEVID_FIFOSZ_Msk               (0x7UL << TPI_DEVID_FIFOSZ_Pos)             /*!< TPI DEVID: FIFOSZ Mask */\r
+\r
+#define TPI_DEVID_NrTraceInput_Pos          0U                                         /*!< TPI DEVID: NrTraceInput Position */\r
+#define TPI_DEVID_NrTraceInput_Msk         (0x3FUL /*<< TPI_DEVID_NrTraceInput_Pos*/)  /*!< TPI DEVID: NrTraceInput Mask */\r
+\r
+/* TPI DEVTYPE Register Definitions */\r
+#define TPI_DEVTYPE_SubType_Pos             4U                                         /*!< TPI DEVTYPE: SubType Position */\r
+#define TPI_DEVTYPE_SubType_Msk            (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/)      /*!< TPI DEVTYPE: SubType Mask */\r
+\r
+#define TPI_DEVTYPE_MajorType_Pos           0U                                         /*!< TPI DEVTYPE: MajorType Position */\r
+#define TPI_DEVTYPE_MajorType_Msk          (0xFUL << TPI_DEVTYPE_MajorType_Pos)        /*!< TPI DEVTYPE: MajorType Mask */\r
+\r
+/*@}*/ /* end of group CMSIS_TPI */\r
+\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_MPU     Memory Protection Unit (MPU)\r
+  \brief    Type definitions for the Memory Protection Unit (MPU)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Memory Protection Unit (MPU).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t TYPE;                   /*!< Offset: 0x000 (R/ )  MPU Type Register */\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x004 (R/W)  MPU Control Register */\r
+  __IOM uint32_t RNR;                    /*!< Offset: 0x008 (R/W)  MPU Region Number Register */\r
+  __IOM uint32_t RBAR;                   /*!< Offset: 0x00C (R/W)  MPU Region Base Address Register */\r
+  __IOM uint32_t RLAR;                   /*!< Offset: 0x010 (R/W)  MPU Region Limit Address Register */\r
+  __IOM uint32_t RBAR_A1;                /*!< Offset: 0x014 (R/W)  MPU Region Base Address Register Alias 1 */\r
+  __IOM uint32_t RLAR_A1;                /*!< Offset: 0x018 (R/W)  MPU Region Limit Address Register Alias 1 */\r
+  __IOM uint32_t RBAR_A2;                /*!< Offset: 0x01C (R/W)  MPU Region Base Address Register Alias 2 */\r
+  __IOM uint32_t RLAR_A2;                /*!< Offset: 0x020 (R/W)  MPU Region Limit Address Register Alias 2 */\r
+  __IOM uint32_t RBAR_A3;                /*!< Offset: 0x024 (R/W)  MPU Region Base Address Register Alias 3 */\r
+  __IOM uint32_t RLAR_A3;                /*!< Offset: 0x028 (R/W)  MPU Region Limit Address Register Alias 3 */\r
+        uint32_t RESERVED0[1];\r
+  union {\r
+  __IOM uint32_t MAIR[2];\r
+  struct {\r
+  __IOM uint32_t MAIR0;                  /*!< Offset: 0x030 (R/W)  MPU Memory Attribute Indirection Register 0 */\r
+  __IOM uint32_t MAIR1;                  /*!< Offset: 0x034 (R/W)  MPU Memory Attribute Indirection Register 1 */\r
+  };\r
+  };\r
+} MPU_Type;\r
+\r
+#define MPU_TYPE_RALIASES                  4U\r
+\r
+/* MPU Type Register Definitions */\r
+#define MPU_TYPE_IREGION_Pos               16U                                            /*!< MPU TYPE: IREGION Position */\r
+#define MPU_TYPE_IREGION_Msk               (0xFFUL << MPU_TYPE_IREGION_Pos)               /*!< MPU TYPE: IREGION Mask */\r
+\r
+#define MPU_TYPE_DREGION_Pos                8U                                            /*!< MPU TYPE: DREGION Position */\r
+#define MPU_TYPE_DREGION_Msk               (0xFFUL << MPU_TYPE_DREGION_Pos)               /*!< MPU TYPE: DREGION Mask */\r
+\r
+#define MPU_TYPE_SEPARATE_Pos               0U                                            /*!< MPU TYPE: SEPARATE Position */\r
+#define MPU_TYPE_SEPARATE_Msk              (1UL /*<< MPU_TYPE_SEPARATE_Pos*/)             /*!< MPU TYPE: SEPARATE Mask */\r
+\r
+/* MPU Control Register Definitions */\r
+#define MPU_CTRL_PRIVDEFENA_Pos             2U                                            /*!< MPU CTRL: PRIVDEFENA Position */\r
+#define MPU_CTRL_PRIVDEFENA_Msk            (1UL << MPU_CTRL_PRIVDEFENA_Pos)               /*!< MPU CTRL: PRIVDEFENA Mask */\r
+\r
+#define MPU_CTRL_HFNMIENA_Pos               1U                                            /*!< MPU CTRL: HFNMIENA Position */\r
+#define MPU_CTRL_HFNMIENA_Msk              (1UL << MPU_CTRL_HFNMIENA_Pos)                 /*!< MPU CTRL: HFNMIENA Mask */\r
+\r
+#define MPU_CTRL_ENABLE_Pos                 0U                                            /*!< MPU CTRL: ENABLE Position */\r
+#define MPU_CTRL_ENABLE_Msk                (1UL /*<< MPU_CTRL_ENABLE_Pos*/)               /*!< MPU CTRL: ENABLE Mask */\r
+\r
+/* MPU Region Number Register Definitions */\r
+#define MPU_RNR_REGION_Pos                  0U                                            /*!< MPU RNR: REGION Position */\r
+#define MPU_RNR_REGION_Msk                 (0xFFUL /*<< MPU_RNR_REGION_Pos*/)             /*!< MPU RNR: REGION Mask */\r
+\r
+/* MPU Region Base Address Register Definitions */\r
+#define MPU_RBAR_BASE_Pos                   5U                                            /*!< MPU RBAR: BASE Position */\r
+#define MPU_RBAR_BASE_Msk                  (0x7FFFFFFUL << MPU_RBAR_BASE_Pos)             /*!< MPU RBAR: BASE Mask */\r
+\r
+#define MPU_RBAR_SH_Pos                     3U                                            /*!< MPU RBAR: SH Position */\r
+#define MPU_RBAR_SH_Msk                    (0x3UL << MPU_RBAR_SH_Pos)                     /*!< MPU RBAR: SH Mask */\r
+\r
+#define MPU_RBAR_AP_Pos                     1U                                            /*!< MPU RBAR: AP Position */\r
+#define MPU_RBAR_AP_Msk                    (0x3UL << MPU_RBAR_AP_Pos)                     /*!< MPU RBAR: AP Mask */\r
+\r
+#define MPU_RBAR_XN_Pos                     0U                                            /*!< MPU RBAR: XN Position */\r
+#define MPU_RBAR_XN_Msk                    (01UL /*<< MPU_RBAR_XN_Pos*/)                  /*!< MPU RBAR: XN Mask */\r
+\r
+/* MPU Region Limit Address Register Definitions */\r
+#define MPU_RLAR_LIMIT_Pos                  5U                                            /*!< MPU RLAR: LIMIT Position */\r
+#define MPU_RLAR_LIMIT_Msk                 (0x7FFFFFFUL << MPU_RLAR_LIMIT_Pos)            /*!< MPU RLAR: LIMIT Mask */\r
+\r
+#define MPU_RLAR_AttrIndx_Pos               1U                                            /*!< MPU RLAR: AttrIndx Position */\r
+#define MPU_RLAR_AttrIndx_Msk              (0x7UL << MPU_RLAR_AttrIndx_Pos)               /*!< MPU RLAR: AttrIndx Mask */\r
+\r
+#define MPU_RLAR_EN_Pos                     0U                                            /*!< MPU RLAR: Region enable bit Position */\r
+#define MPU_RLAR_EN_Msk                    (1UL /*<< MPU_RLAR_EN_Pos*/)                   /*!< MPU RLAR: Region enable bit Disable Mask */\r
+\r
+/* MPU Memory Attribute Indirection Register 0 Definitions */\r
+#define MPU_MAIR0_Attr3_Pos                24U                                            /*!< MPU MAIR0: Attr3 Position */\r
+#define MPU_MAIR0_Attr3_Msk                (0xFFUL << MPU_MAIR0_Attr3_Pos)                /*!< MPU MAIR0: Attr3 Mask */\r
+\r
+#define MPU_MAIR0_Attr2_Pos                16U                                            /*!< MPU MAIR0: Attr2 Position */\r
+#define MPU_MAIR0_Attr2_Msk                (0xFFUL << MPU_MAIR0_Attr2_Pos)                /*!< MPU MAIR0: Attr2 Mask */\r
+\r
+#define MPU_MAIR0_Attr1_Pos                 8U                                            /*!< MPU MAIR0: Attr1 Position */\r
+#define MPU_MAIR0_Attr1_Msk                (0xFFUL << MPU_MAIR0_Attr1_Pos)                /*!< MPU MAIR0: Attr1 Mask */\r
+\r
+#define MPU_MAIR0_Attr0_Pos                 0U                                            /*!< MPU MAIR0: Attr0 Position */\r
+#define MPU_MAIR0_Attr0_Msk                (0xFFUL /*<< MPU_MAIR0_Attr0_Pos*/)            /*!< MPU MAIR0: Attr0 Mask */\r
+\r
+/* MPU Memory Attribute Indirection Register 1 Definitions */\r
+#define MPU_MAIR1_Attr7_Pos                24U                                            /*!< MPU MAIR1: Attr7 Position */\r
+#define MPU_MAIR1_Attr7_Msk                (0xFFUL << MPU_MAIR1_Attr7_Pos)                /*!< MPU MAIR1: Attr7 Mask */\r
+\r
+#define MPU_MAIR1_Attr6_Pos                16U                                            /*!< MPU MAIR1: Attr6 Position */\r
+#define MPU_MAIR1_Attr6_Msk                (0xFFUL << MPU_MAIR1_Attr6_Pos)                /*!< MPU MAIR1: Attr6 Mask */\r
+\r
+#define MPU_MAIR1_Attr5_Pos                 8U                                            /*!< MPU MAIR1: Attr5 Position */\r
+#define MPU_MAIR1_Attr5_Msk                (0xFFUL << MPU_MAIR1_Attr5_Pos)                /*!< MPU MAIR1: Attr5 Mask */\r
+\r
+#define MPU_MAIR1_Attr4_Pos                 0U                                            /*!< MPU MAIR1: Attr4 Position */\r
+#define MPU_MAIR1_Attr4_Msk                (0xFFUL /*<< MPU_MAIR1_Attr4_Pos*/)            /*!< MPU MAIR1: Attr4 Mask */\r
+\r
+/*@} end of group CMSIS_MPU */\r
+#endif\r
+\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SAU     Security Attribution Unit (SAU)\r
+  \brief    Type definitions for the Security Attribution Unit (SAU)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Security Attribution Unit (SAU).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  SAU Control Register */\r
+  __IM  uint32_t TYPE;                   /*!< Offset: 0x004 (R/ )  SAU Type Register */\r
+#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U)\r
+  __IOM uint32_t RNR;                    /*!< Offset: 0x008 (R/W)  SAU Region Number Register */\r
+  __IOM uint32_t RBAR;                   /*!< Offset: 0x00C (R/W)  SAU Region Base Address Register */\r
+  __IOM uint32_t RLAR;                   /*!< Offset: 0x010 (R/W)  SAU Region Limit Address Register */\r
+#else\r
+        uint32_t RESERVED0[3];\r
+#endif\r
+  __IOM uint32_t SFSR;                   /*!< Offset: 0x014 (R/W)  Secure Fault Status Register */\r
+  __IOM uint32_t SFAR;                   /*!< Offset: 0x018 (R/W)  Secure Fault Address Register */\r
+} SAU_Type;\r
+\r
+/* SAU Control Register Definitions */\r
+#define SAU_CTRL_ALLNS_Pos                  1U                                            /*!< SAU CTRL: ALLNS Position */\r
+#define SAU_CTRL_ALLNS_Msk                 (1UL << SAU_CTRL_ALLNS_Pos)                    /*!< SAU CTRL: ALLNS Mask */\r
+\r
+#define SAU_CTRL_ENABLE_Pos                 0U                                            /*!< SAU CTRL: ENABLE Position */\r
+#define SAU_CTRL_ENABLE_Msk                (1UL /*<< SAU_CTRL_ENABLE_Pos*/)               /*!< SAU CTRL: ENABLE Mask */\r
+\r
+/* SAU Type Register Definitions */\r
+#define SAU_TYPE_SREGION_Pos                0U                                            /*!< SAU TYPE: SREGION Position */\r
+#define SAU_TYPE_SREGION_Msk               (0xFFUL /*<< SAU_TYPE_SREGION_Pos*/)           /*!< SAU TYPE: SREGION Mask */\r
+\r
+#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U)\r
+/* SAU Region Number Register Definitions */\r
+#define SAU_RNR_REGION_Pos                  0U                                            /*!< SAU RNR: REGION Position */\r
+#define SAU_RNR_REGION_Msk                 (0xFFUL /*<< SAU_RNR_REGION_Pos*/)             /*!< SAU RNR: REGION Mask */\r
+\r
+/* SAU Region Base Address Register Definitions */\r
+#define SAU_RBAR_BADDR_Pos                  5U                                            /*!< SAU RBAR: BADDR Position */\r
+#define SAU_RBAR_BADDR_Msk                 (0x7FFFFFFUL << SAU_RBAR_BADDR_Pos)            /*!< SAU RBAR: BADDR Mask */\r
+\r
+/* SAU Region Limit Address Register Definitions */\r
+#define SAU_RLAR_LADDR_Pos                  5U                                            /*!< SAU RLAR: LADDR Position */\r
+#define SAU_RLAR_LADDR_Msk                 (0x7FFFFFFUL << SAU_RLAR_LADDR_Pos)            /*!< SAU RLAR: LADDR Mask */\r
+\r
+#define SAU_RLAR_NSC_Pos                    1U                                            /*!< SAU RLAR: NSC Position */\r
+#define SAU_RLAR_NSC_Msk                   (1UL << SAU_RLAR_NSC_Pos)                      /*!< SAU RLAR: NSC Mask */\r
+\r
+#define SAU_RLAR_ENABLE_Pos                 0U                                            /*!< SAU RLAR: ENABLE Position */\r
+#define SAU_RLAR_ENABLE_Msk                (1UL /*<< SAU_RLAR_ENABLE_Pos*/)               /*!< SAU RLAR: ENABLE Mask */\r
+\r
+#endif /* defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) */\r
+\r
+/* Secure Fault Status Register Definitions */\r
+#define SAU_SFSR_LSERR_Pos                  7U                                            /*!< SAU SFSR: LSERR Position */\r
+#define SAU_SFSR_LSERR_Msk                 (1UL << SAU_SFSR_LSERR_Pos)                    /*!< SAU SFSR: LSERR Mask */\r
+\r
+#define SAU_SFSR_SFARVALID_Pos              6U                                            /*!< SAU SFSR: SFARVALID Position */\r
+#define SAU_SFSR_SFARVALID_Msk             (1UL << SAU_SFSR_SFARVALID_Pos)                /*!< SAU SFSR: SFARVALID Mask */\r
+\r
+#define SAU_SFSR_LSPERR_Pos                 5U                                            /*!< SAU SFSR: LSPERR Position */\r
+#define SAU_SFSR_LSPERR_Msk                (1UL << SAU_SFSR_LSPERR_Pos)                   /*!< SAU SFSR: LSPERR Mask */\r
+\r
+#define SAU_SFSR_INVTRAN_Pos                4U                                            /*!< SAU SFSR: INVTRAN Position */\r
+#define SAU_SFSR_INVTRAN_Msk               (1UL << SAU_SFSR_INVTRAN_Pos)                  /*!< SAU SFSR: INVTRAN Mask */\r
+\r
+#define SAU_SFSR_AUVIOL_Pos                 3U                                            /*!< SAU SFSR: AUVIOL Position */\r
+#define SAU_SFSR_AUVIOL_Msk                (1UL << SAU_SFSR_AUVIOL_Pos)                   /*!< SAU SFSR: AUVIOL Mask */\r
+\r
+#define SAU_SFSR_INVER_Pos                  2U                                            /*!< SAU SFSR: INVER Position */\r
+#define SAU_SFSR_INVER_Msk                 (1UL << SAU_SFSR_INVER_Pos)                    /*!< SAU SFSR: INVER Mask */\r
+\r
+#define SAU_SFSR_INVIS_Pos                  1U                                            /*!< SAU SFSR: INVIS Position */\r
+#define SAU_SFSR_INVIS_Msk                 (1UL << SAU_SFSR_INVIS_Pos)                    /*!< SAU SFSR: INVIS Mask */\r
+\r
+#define SAU_SFSR_INVEP_Pos                  0U                                            /*!< SAU SFSR: INVEP Position */\r
+#define SAU_SFSR_INVEP_Msk                 (1UL /*<< SAU_SFSR_INVEP_Pos*/)                /*!< SAU SFSR: INVEP Mask */\r
+\r
+/*@} end of group CMSIS_SAU */\r
+#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_FPU     Floating Point Unit (FPU)\r
+  \brief    Type definitions for the Floating Point Unit (FPU)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Floating Point Unit (FPU).\r
+ */\r
+typedef struct\r
+{\r
+        uint32_t RESERVED0[1U];\r
+  __IOM uint32_t FPCCR;                  /*!< Offset: 0x004 (R/W)  Floating-Point Context Control Register */\r
+  __IOM uint32_t FPCAR;                  /*!< Offset: 0x008 (R/W)  Floating-Point Context Address Register */\r
+  __IOM uint32_t FPDSCR;                 /*!< Offset: 0x00C (R/W)  Floating-Point Default Status Control Register */\r
+  __IM  uint32_t MVFR0;                  /*!< Offset: 0x010 (R/ )  Media and FP Feature Register 0 */\r
+  __IM  uint32_t MVFR1;                  /*!< Offset: 0x014 (R/ )  Media and FP Feature Register 1 */\r
+} FPU_Type;\r
+\r
+/* Floating-Point Context Control Register Definitions */\r
+#define FPU_FPCCR_ASPEN_Pos                31U                                            /*!< FPCCR: ASPEN bit Position */\r
+#define FPU_FPCCR_ASPEN_Msk                (1UL << FPU_FPCCR_ASPEN_Pos)                   /*!< FPCCR: ASPEN bit Mask */\r
+\r
+#define FPU_FPCCR_LSPEN_Pos                30U                                            /*!< FPCCR: LSPEN Position */\r
+#define FPU_FPCCR_LSPEN_Msk                (1UL << FPU_FPCCR_LSPEN_Pos)                   /*!< FPCCR: LSPEN bit Mask */\r
+\r
+#define FPU_FPCCR_LSPENS_Pos               29U                                            /*!< FPCCR: LSPENS Position */\r
+#define FPU_FPCCR_LSPENS_Msk               (1UL << FPU_FPCCR_LSPENS_Pos)                  /*!< FPCCR: LSPENS bit Mask */\r
+\r
+#define FPU_FPCCR_CLRONRET_Pos             28U                                            /*!< FPCCR: CLRONRET Position */\r
+#define FPU_FPCCR_CLRONRET_Msk             (1UL << FPU_FPCCR_CLRONRET_Pos)                /*!< FPCCR: CLRONRET bit Mask */\r
+\r
+#define FPU_FPCCR_CLRONRETS_Pos            27U                                            /*!< FPCCR: CLRONRETS Position */\r
+#define FPU_FPCCR_CLRONRETS_Msk            (1UL << FPU_FPCCR_CLRONRETS_Pos)               /*!< FPCCR: CLRONRETS bit Mask */\r
+\r
+#define FPU_FPCCR_TS_Pos                   26U                                            /*!< FPCCR: TS Position */\r
+#define FPU_FPCCR_TS_Msk                   (1UL << FPU_FPCCR_TS_Pos)                      /*!< FPCCR: TS bit Mask */\r
+\r
+#define FPU_FPCCR_UFRDY_Pos                10U                                            /*!< FPCCR: UFRDY Position */\r
+#define FPU_FPCCR_UFRDY_Msk                (1UL << FPU_FPCCR_UFRDY_Pos)                   /*!< FPCCR: UFRDY bit Mask */\r
+\r
+#define FPU_FPCCR_SPLIMVIOL_Pos             9U                                            /*!< FPCCR: SPLIMVIOL Position */\r
+#define FPU_FPCCR_SPLIMVIOL_Msk            (1UL << FPU_FPCCR_SPLIMVIOL_Pos)               /*!< FPCCR: SPLIMVIOL bit Mask */\r
+\r
+#define FPU_FPCCR_MONRDY_Pos                8U                                            /*!< FPCCR: MONRDY Position */\r
+#define FPU_FPCCR_MONRDY_Msk               (1UL << FPU_FPCCR_MONRDY_Pos)                  /*!< FPCCR: MONRDY bit Mask */\r
+\r
+#define FPU_FPCCR_SFRDY_Pos                 7U                                            /*!< FPCCR: SFRDY Position */\r
+#define FPU_FPCCR_SFRDY_Msk                (1UL << FPU_FPCCR_SFRDY_Pos)                   /*!< FPCCR: SFRDY bit Mask */\r
+\r
+#define FPU_FPCCR_BFRDY_Pos                 6U                                            /*!< FPCCR: BFRDY Position */\r
+#define FPU_FPCCR_BFRDY_Msk                (1UL << FPU_FPCCR_BFRDY_Pos)                   /*!< FPCCR: BFRDY bit Mask */\r
+\r
+#define FPU_FPCCR_MMRDY_Pos                 5U                                            /*!< FPCCR: MMRDY Position */\r
+#define FPU_FPCCR_MMRDY_Msk                (1UL << FPU_FPCCR_MMRDY_Pos)                   /*!< FPCCR: MMRDY bit Mask */\r
+\r
+#define FPU_FPCCR_HFRDY_Pos                 4U                                            /*!< FPCCR: HFRDY Position */\r
+#define FPU_FPCCR_HFRDY_Msk                (1UL << FPU_FPCCR_HFRDY_Pos)                   /*!< FPCCR: HFRDY bit Mask */\r
+\r
+#define FPU_FPCCR_THREAD_Pos                3U                                            /*!< FPCCR: processor mode bit Position */\r
+#define FPU_FPCCR_THREAD_Msk               (1UL << FPU_FPCCR_THREAD_Pos)                  /*!< FPCCR: processor mode active bit Mask */\r
+\r
+#define FPU_FPCCR_S_Pos                     2U                                            /*!< FPCCR: Security status of the FP context bit Position */\r
+#define FPU_FPCCR_S_Msk                    (1UL << FPU_FPCCR_S_Pos)                       /*!< FPCCR: Security status of the FP context bit Mask */\r
+\r
+#define FPU_FPCCR_USER_Pos                  1U                                            /*!< FPCCR: privilege level bit Position */\r
+#define FPU_FPCCR_USER_Msk                 (1UL << FPU_FPCCR_USER_Pos)                    /*!< FPCCR: privilege level bit Mask */\r
+\r
+#define FPU_FPCCR_LSPACT_Pos                0U                                            /*!< FPCCR: Lazy state preservation active bit Position */\r
+#define FPU_FPCCR_LSPACT_Msk               (1UL /*<< FPU_FPCCR_LSPACT_Pos*/)              /*!< FPCCR: Lazy state preservation active bit Mask */\r
+\r
+/* Floating-Point Context Address Register Definitions */\r
+#define FPU_FPCAR_ADDRESS_Pos               3U                                            /*!< FPCAR: ADDRESS bit Position */\r
+#define FPU_FPCAR_ADDRESS_Msk              (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos)        /*!< FPCAR: ADDRESS bit Mask */\r
+\r
+/* Floating-Point Default Status Control Register Definitions */\r
+#define FPU_FPDSCR_AHP_Pos                 26U                                            /*!< FPDSCR: AHP bit Position */\r
+#define FPU_FPDSCR_AHP_Msk                 (1UL << FPU_FPDSCR_AHP_Pos)                    /*!< FPDSCR: AHP bit Mask */\r
+\r
+#define FPU_FPDSCR_DN_Pos                  25U                                            /*!< FPDSCR: DN bit Position */\r
+#define FPU_FPDSCR_DN_Msk                  (1UL << FPU_FPDSCR_DN_Pos)                     /*!< FPDSCR: DN bit Mask */\r
+\r
+#define FPU_FPDSCR_FZ_Pos                  24U                                            /*!< FPDSCR: FZ bit Position */\r
+#define FPU_FPDSCR_FZ_Msk                  (1UL << FPU_FPDSCR_FZ_Pos)                     /*!< FPDSCR: FZ bit Mask */\r
+\r
+#define FPU_FPDSCR_RMode_Pos               22U                                            /*!< FPDSCR: RMode bit Position */\r
+#define FPU_FPDSCR_RMode_Msk               (3UL << FPU_FPDSCR_RMode_Pos)                  /*!< FPDSCR: RMode bit Mask */\r
+\r
+/* Media and FP Feature Register 0 Definitions */\r
+#define FPU_MVFR0_FP_rounding_modes_Pos    28U                                            /*!< MVFR0: FP rounding modes bits Position */\r
+#define FPU_MVFR0_FP_rounding_modes_Msk    (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos)     /*!< MVFR0: FP rounding modes bits Mask */\r
+\r
+#define FPU_MVFR0_Short_vectors_Pos        24U                                            /*!< MVFR0: Short vectors bits Position */\r
+#define FPU_MVFR0_Short_vectors_Msk        (0xFUL << FPU_MVFR0_Short_vectors_Pos)         /*!< MVFR0: Short vectors bits Mask */\r
+\r
+#define FPU_MVFR0_Square_root_Pos          20U                                            /*!< MVFR0: Square root bits Position */\r
+#define FPU_MVFR0_Square_root_Msk          (0xFUL << FPU_MVFR0_Square_root_Pos)           /*!< MVFR0: Square root bits Mask */\r
+\r
+#define FPU_MVFR0_Divide_Pos               16U                                            /*!< MVFR0: Divide bits Position */\r
+#define FPU_MVFR0_Divide_Msk               (0xFUL << FPU_MVFR0_Divide_Pos)                /*!< MVFR0: Divide bits Mask */\r
+\r
+#define FPU_MVFR0_FP_excep_trapping_Pos    12U                                            /*!< MVFR0: FP exception trapping bits Position */\r
+#define FPU_MVFR0_FP_excep_trapping_Msk    (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos)     /*!< MVFR0: FP exception trapping bits Mask */\r
+\r
+#define FPU_MVFR0_Double_precision_Pos      8U                                            /*!< MVFR0: Double-precision bits Position */\r
+#define FPU_MVFR0_Double_precision_Msk     (0xFUL << FPU_MVFR0_Double_precision_Pos)      /*!< MVFR0: Double-precision bits Mask */\r
+\r
+#define FPU_MVFR0_Single_precision_Pos      4U                                            /*!< MVFR0: Single-precision bits Position */\r
+#define FPU_MVFR0_Single_precision_Msk     (0xFUL << FPU_MVFR0_Single_precision_Pos)      /*!< MVFR0: Single-precision bits Mask */\r
+\r
+#define FPU_MVFR0_A_SIMD_registers_Pos      0U                                            /*!< MVFR0: A_SIMD registers bits Position */\r
+#define FPU_MVFR0_A_SIMD_registers_Msk     (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/)  /*!< MVFR0: A_SIMD registers bits Mask */\r
+\r
+/* Media and FP Feature Register 1 Definitions */\r
+#define FPU_MVFR1_FP_fused_MAC_Pos         28U                                            /*!< MVFR1: FP fused MAC bits Position */\r
+#define FPU_MVFR1_FP_fused_MAC_Msk         (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos)          /*!< MVFR1: FP fused MAC bits Mask */\r
+\r
+#define FPU_MVFR1_FP_HPFP_Pos              24U                                            /*!< MVFR1: FP HPFP bits Position */\r
+#define FPU_MVFR1_FP_HPFP_Msk              (0xFUL << FPU_MVFR1_FP_HPFP_Pos)               /*!< MVFR1: FP HPFP bits Mask */\r
+\r
+#define FPU_MVFR1_D_NaN_mode_Pos            4U                                            /*!< MVFR1: D_NaN mode bits Position */\r
+#define FPU_MVFR1_D_NaN_mode_Msk           (0xFUL << FPU_MVFR1_D_NaN_mode_Pos)            /*!< MVFR1: D_NaN mode bits Mask */\r
+\r
+#define FPU_MVFR1_FtZ_mode_Pos              0U                                            /*!< MVFR1: FtZ mode bits Position */\r
+#define FPU_MVFR1_FtZ_mode_Msk             (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/)          /*!< MVFR1: FtZ mode bits Mask */\r
+\r
+/*@} end of group CMSIS_FPU */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_CoreDebug       Core Debug Registers (CoreDebug)\r
+  \brief    Type definitions for the Core Debug Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Core Debug Register (CoreDebug).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t DHCSR;                  /*!< Offset: 0x000 (R/W)  Debug Halting Control and Status Register */\r
+  __OM  uint32_t DCRSR;                  /*!< Offset: 0x004 ( /W)  Debug Core Register Selector Register */\r
+  __IOM uint32_t DCRDR;                  /*!< Offset: 0x008 (R/W)  Debug Core Register Data Register */\r
+  __IOM uint32_t DEMCR;                  /*!< Offset: 0x00C (R/W)  Debug Exception and Monitor Control Register */\r
+        uint32_t RESERVED4[1U];\r
+  __IOM uint32_t DAUTHCTRL;              /*!< Offset: 0x014 (R/W)  Debug Authentication Control Register */\r
+  __IOM uint32_t DSCSR;                  /*!< Offset: 0x018 (R/W)  Debug Security Control and Status Register */\r
+} CoreDebug_Type;\r
+\r
+/* Debug Halting Control and Status Register Definitions */\r
+#define CoreDebug_DHCSR_DBGKEY_Pos         16U                                            /*!< CoreDebug DHCSR: DBGKEY Position */\r
+#define CoreDebug_DHCSR_DBGKEY_Msk         (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos)       /*!< CoreDebug DHCSR: DBGKEY Mask */\r
+\r
+#define CoreDebug_DHCSR_S_RESTART_ST_Pos   26U                                            /*!< CoreDebug DHCSR: S_RESTART_ST Position */\r
+#define CoreDebug_DHCSR_S_RESTART_ST_Msk   (1UL << CoreDebug_DHCSR_S_RESTART_ST_Pos)      /*!< CoreDebug DHCSR: S_RESTART_ST Mask */\r
+\r
+#define CoreDebug_DHCSR_S_RESET_ST_Pos     25U                                            /*!< CoreDebug DHCSR: S_RESET_ST Position */\r
+#define CoreDebug_DHCSR_S_RESET_ST_Msk     (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos)        /*!< CoreDebug DHCSR: S_RESET_ST Mask */\r
+\r
+#define CoreDebug_DHCSR_S_RETIRE_ST_Pos    24U                                            /*!< CoreDebug DHCSR: S_RETIRE_ST Position */\r
+#define CoreDebug_DHCSR_S_RETIRE_ST_Msk    (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos)       /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */\r
+\r
+#define CoreDebug_DHCSR_S_LOCKUP_Pos       19U                                            /*!< CoreDebug DHCSR: S_LOCKUP Position */\r
+#define CoreDebug_DHCSR_S_LOCKUP_Msk       (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos)          /*!< CoreDebug DHCSR: S_LOCKUP Mask */\r
+\r
+#define CoreDebug_DHCSR_S_SLEEP_Pos        18U                                            /*!< CoreDebug DHCSR: S_SLEEP Position */\r
+#define CoreDebug_DHCSR_S_SLEEP_Msk        (1UL << CoreDebug_DHCSR_S_SLEEP_Pos)           /*!< CoreDebug DHCSR: S_SLEEP Mask */\r
+\r
+#define CoreDebug_DHCSR_S_HALT_Pos         17U                                            /*!< CoreDebug DHCSR: S_HALT Position */\r
+#define CoreDebug_DHCSR_S_HALT_Msk         (1UL << CoreDebug_DHCSR_S_HALT_Pos)            /*!< CoreDebug DHCSR: S_HALT Mask */\r
+\r
+#define CoreDebug_DHCSR_S_REGRDY_Pos       16U                                            /*!< CoreDebug DHCSR: S_REGRDY Position */\r
+#define CoreDebug_DHCSR_S_REGRDY_Msk       (1UL << CoreDebug_DHCSR_S_REGRDY_Pos)          /*!< CoreDebug DHCSR: S_REGRDY Mask */\r
+\r
+#define CoreDebug_DHCSR_C_SNAPSTALL_Pos     5U                                            /*!< CoreDebug DHCSR: C_SNAPSTALL Position */\r
+#define CoreDebug_DHCSR_C_SNAPSTALL_Msk    (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos)       /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */\r
+\r
+#define CoreDebug_DHCSR_C_MASKINTS_Pos      3U                                            /*!< CoreDebug DHCSR: C_MASKINTS Position */\r
+#define CoreDebug_DHCSR_C_MASKINTS_Msk     (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos)        /*!< CoreDebug DHCSR: C_MASKINTS Mask */\r
+\r
+#define CoreDebug_DHCSR_C_STEP_Pos          2U                                            /*!< CoreDebug DHCSR: C_STEP Position */\r
+#define CoreDebug_DHCSR_C_STEP_Msk         (1UL << CoreDebug_DHCSR_C_STEP_Pos)            /*!< CoreDebug DHCSR: C_STEP Mask */\r
+\r
+#define CoreDebug_DHCSR_C_HALT_Pos          1U                                            /*!< CoreDebug DHCSR: C_HALT Position */\r
+#define CoreDebug_DHCSR_C_HALT_Msk         (1UL << CoreDebug_DHCSR_C_HALT_Pos)            /*!< CoreDebug DHCSR: C_HALT Mask */\r
+\r
+#define CoreDebug_DHCSR_C_DEBUGEN_Pos       0U                                            /*!< CoreDebug DHCSR: C_DEBUGEN Position */\r
+#define CoreDebug_DHCSR_C_DEBUGEN_Msk      (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/)     /*!< CoreDebug DHCSR: C_DEBUGEN Mask */\r
+\r
+/* Debug Core Register Selector Register Definitions */\r
+#define CoreDebug_DCRSR_REGWnR_Pos         16U                                            /*!< CoreDebug DCRSR: REGWnR Position */\r
+#define CoreDebug_DCRSR_REGWnR_Msk         (1UL << CoreDebug_DCRSR_REGWnR_Pos)            /*!< CoreDebug DCRSR: REGWnR Mask */\r
+\r
+#define CoreDebug_DCRSR_REGSEL_Pos          0U                                            /*!< CoreDebug DCRSR: REGSEL Position */\r
+#define CoreDebug_DCRSR_REGSEL_Msk         (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/)     /*!< CoreDebug DCRSR: REGSEL Mask */\r
+\r
+/* Debug Exception and Monitor Control Register Definitions */\r
+#define CoreDebug_DEMCR_TRCENA_Pos         24U                                            /*!< CoreDebug DEMCR: TRCENA Position */\r
+#define CoreDebug_DEMCR_TRCENA_Msk         (1UL << CoreDebug_DEMCR_TRCENA_Pos)            /*!< CoreDebug DEMCR: TRCENA Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_REQ_Pos        19U                                            /*!< CoreDebug DEMCR: MON_REQ Position */\r
+#define CoreDebug_DEMCR_MON_REQ_Msk        (1UL << CoreDebug_DEMCR_MON_REQ_Pos)           /*!< CoreDebug DEMCR: MON_REQ Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_STEP_Pos       18U                                            /*!< CoreDebug DEMCR: MON_STEP Position */\r
+#define CoreDebug_DEMCR_MON_STEP_Msk       (1UL << CoreDebug_DEMCR_MON_STEP_Pos)          /*!< CoreDebug DEMCR: MON_STEP Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_PEND_Pos       17U                                            /*!< CoreDebug DEMCR: MON_PEND Position */\r
+#define CoreDebug_DEMCR_MON_PEND_Msk       (1UL << CoreDebug_DEMCR_MON_PEND_Pos)          /*!< CoreDebug DEMCR: MON_PEND Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_EN_Pos         16U                                            /*!< CoreDebug DEMCR: MON_EN Position */\r
+#define CoreDebug_DEMCR_MON_EN_Msk         (1UL << CoreDebug_DEMCR_MON_EN_Pos)            /*!< CoreDebug DEMCR: MON_EN Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_HARDERR_Pos     10U                                            /*!< CoreDebug DEMCR: VC_HARDERR Position */\r
+#define CoreDebug_DEMCR_VC_HARDERR_Msk     (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos)        /*!< CoreDebug DEMCR: VC_HARDERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_INTERR_Pos       9U                                            /*!< CoreDebug DEMCR: VC_INTERR Position */\r
+#define CoreDebug_DEMCR_VC_INTERR_Msk      (1UL << CoreDebug_DEMCR_VC_INTERR_Pos)         /*!< CoreDebug DEMCR: VC_INTERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_BUSERR_Pos       8U                                            /*!< CoreDebug DEMCR: VC_BUSERR Position */\r
+#define CoreDebug_DEMCR_VC_BUSERR_Msk      (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos)         /*!< CoreDebug DEMCR: VC_BUSERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_STATERR_Pos      7U                                            /*!< CoreDebug DEMCR: VC_STATERR Position */\r
+#define CoreDebug_DEMCR_VC_STATERR_Msk     (1UL << CoreDebug_DEMCR_VC_STATERR_Pos)        /*!< CoreDebug DEMCR: VC_STATERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_CHKERR_Pos       6U                                            /*!< CoreDebug DEMCR: VC_CHKERR Position */\r
+#define CoreDebug_DEMCR_VC_CHKERR_Msk      (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos)         /*!< CoreDebug DEMCR: VC_CHKERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_NOCPERR_Pos      5U                                            /*!< CoreDebug DEMCR: VC_NOCPERR Position */\r
+#define CoreDebug_DEMCR_VC_NOCPERR_Msk     (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos)        /*!< CoreDebug DEMCR: VC_NOCPERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_MMERR_Pos        4U                                            /*!< CoreDebug DEMCR: VC_MMERR Position */\r
+#define CoreDebug_DEMCR_VC_MMERR_Msk       (1UL << CoreDebug_DEMCR_VC_MMERR_Pos)          /*!< CoreDebug DEMCR: VC_MMERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_CORERESET_Pos    0U                                            /*!< CoreDebug DEMCR: VC_CORERESET Position */\r
+#define CoreDebug_DEMCR_VC_CORERESET_Msk   (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/)  /*!< CoreDebug DEMCR: VC_CORERESET Mask */\r
+\r
+/* Debug Authentication Control Register Definitions */\r
+#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos  3U                                            /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Position */\r
+#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos)    /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Mask */\r
+\r
+#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos  2U                                            /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Position */\r
+#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Msk (1UL << CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos)    /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Mask */\r
+\r
+#define CoreDebug_DAUTHCTRL_INTSPIDEN_Pos   1U                                            /*!< CoreDebug DAUTHCTRL: INTSPIDEN Position */\r
+#define CoreDebug_DAUTHCTRL_INTSPIDEN_Msk  (1UL << CoreDebug_DAUTHCTRL_INTSPIDEN_Pos)     /*!< CoreDebug DAUTHCTRL: INTSPIDEN Mask */\r
+\r
+#define CoreDebug_DAUTHCTRL_SPIDENSEL_Pos   0U                                            /*!< CoreDebug DAUTHCTRL: SPIDENSEL Position */\r
+#define CoreDebug_DAUTHCTRL_SPIDENSEL_Msk  (1UL /*<< CoreDebug_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< CoreDebug DAUTHCTRL: SPIDENSEL Mask */\r
+\r
+/* Debug Security Control and Status Register Definitions */\r
+#define CoreDebug_DSCSR_CDS_Pos            16U                                            /*!< CoreDebug DSCSR: CDS Position */\r
+#define CoreDebug_DSCSR_CDS_Msk            (1UL << CoreDebug_DSCSR_CDS_Pos)               /*!< CoreDebug DSCSR: CDS Mask */\r
+\r
+#define CoreDebug_DSCSR_SBRSEL_Pos          1U                                            /*!< CoreDebug DSCSR: SBRSEL Position */\r
+#define CoreDebug_DSCSR_SBRSEL_Msk         (1UL << CoreDebug_DSCSR_SBRSEL_Pos)            /*!< CoreDebug DSCSR: SBRSEL Mask */\r
+\r
+#define CoreDebug_DSCSR_SBRSELEN_Pos        0U                                            /*!< CoreDebug DSCSR: SBRSELEN Position */\r
+#define CoreDebug_DSCSR_SBRSELEN_Msk       (1UL /*<< CoreDebug_DSCSR_SBRSELEN_Pos*/)      /*!< CoreDebug DSCSR: SBRSELEN Mask */\r
+\r
+/*@} end of group CMSIS_CoreDebug */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_bitfield     Core register bit field macros\r
+  \brief      Macros for use with bit field definitions (xxx_Pos, xxx_Msk).\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   Mask and shift a bit field value for use in a register bit range.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of the bit field. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted value.\r
+*/\r
+#define _VAL2FLD(field, value)    (((uint32_t)(value) << field ## _Pos) & field ## _Msk)\r
+\r
+/**\r
+  \brief     Mask and shift a register value to extract a bit filed value.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of register. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted bit field value.\r
+*/\r
+#define _FLD2VAL(field, value)    (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)\r
+\r
+/*@} end of group CMSIS_core_bitfield */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_base     Core Definitions\r
+  \brief      Definitions for base addresses, unions, and structures.\r
+  @{\r
+ */\r
+\r
+/* Memory mapping of Core Hardware */\r
+  #define SCS_BASE            (0xE000E000UL)                             /*!< System Control Space Base Address */\r
+  #define ITM_BASE            (0xE0000000UL)                             /*!< ITM Base Address */\r
+  #define DWT_BASE            (0xE0001000UL)                             /*!< DWT Base Address */\r
+  #define TPI_BASE            (0xE0040000UL)                             /*!< TPI Base Address */\r
+  #define CoreDebug_BASE      (0xE000EDF0UL)                             /*!< Core Debug Base Address */\r
+  #define SysTick_BASE        (SCS_BASE +  0x0010UL)                     /*!< SysTick Base Address */\r
+  #define NVIC_BASE           (SCS_BASE +  0x0100UL)                     /*!< NVIC Base Address */\r
+  #define SCB_BASE            (SCS_BASE +  0x0D00UL)                     /*!< System Control Block Base Address */\r
+\r
+  #define SCnSCB              ((SCnSCB_Type    *)     SCS_BASE         ) /*!< System control Register not in SCB */\r
+  #define SCB                 ((SCB_Type       *)     SCB_BASE         ) /*!< SCB configuration struct */\r
+  #define SysTick             ((SysTick_Type   *)     SysTick_BASE     ) /*!< SysTick configuration struct */\r
+  #define NVIC                ((NVIC_Type      *)     NVIC_BASE        ) /*!< NVIC configuration struct */\r
+  #define ITM                 ((ITM_Type       *)     ITM_BASE         ) /*!< ITM configuration struct */\r
+  #define DWT                 ((DWT_Type       *)     DWT_BASE         ) /*!< DWT configuration struct */\r
+  #define TPI                 ((TPI_Type       *)     TPI_BASE         ) /*!< TPI configuration struct */\r
+  #define CoreDebug           ((CoreDebug_Type *)     CoreDebug_BASE   ) /*!< Core Debug configuration struct */\r
+\r
+  #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+    #define MPU_BASE          (SCS_BASE +  0x0D90UL)                     /*!< Memory Protection Unit */\r
+    #define MPU               ((MPU_Type       *)     MPU_BASE         ) /*!< Memory Protection Unit */\r
+  #endif\r
+\r
+  #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+    #define SAU_BASE          (SCS_BASE +  0x0DD0UL)                     /*!< Security Attribution Unit */\r
+    #define SAU               ((SAU_Type       *)     SAU_BASE         ) /*!< Security Attribution Unit */\r
+  #endif\r
+\r
+  #define FPU_BASE            (SCS_BASE +  0x0F30UL)                     /*!< Floating Point Unit */\r
+  #define FPU                 ((FPU_Type       *)     FPU_BASE         ) /*!< Floating Point Unit */\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+  #define SCS_BASE_NS         (0xE002E000UL)                             /*!< System Control Space Base Address (non-secure address space) */\r
+  #define CoreDebug_BASE_NS   (0xE002EDF0UL)                             /*!< Core Debug Base Address           (non-secure address space) */\r
+  #define SysTick_BASE_NS     (SCS_BASE_NS +  0x0010UL)                  /*!< SysTick Base Address              (non-secure address space) */\r
+  #define NVIC_BASE_NS        (SCS_BASE_NS +  0x0100UL)                  /*!< NVIC Base Address                 (non-secure address space) */\r
+  #define SCB_BASE_NS         (SCS_BASE_NS +  0x0D00UL)                  /*!< System Control Block Base Address (non-secure address space) */\r
+\r
+  #define SCnSCB_NS           ((SCnSCB_Type    *)     SCS_BASE_NS      ) /*!< System control Register not in SCB(non-secure address space) */\r
+  #define SCB_NS              ((SCB_Type       *)     SCB_BASE_NS      ) /*!< SCB configuration struct          (non-secure address space) */\r
+  #define SysTick_NS          ((SysTick_Type   *)     SysTick_BASE_NS  ) /*!< SysTick configuration struct      (non-secure address space) */\r
+  #define NVIC_NS             ((NVIC_Type      *)     NVIC_BASE_NS     ) /*!< NVIC configuration struct         (non-secure address space) */\r
+  #define CoreDebug_NS        ((CoreDebug_Type *)     CoreDebug_BASE_NS) /*!< Core Debug configuration struct   (non-secure address space) */\r
+\r
+  #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+    #define MPU_BASE_NS       (SCS_BASE_NS +  0x0D90UL)                  /*!< Memory Protection Unit            (non-secure address space) */\r
+    #define MPU_NS            ((MPU_Type       *)     MPU_BASE_NS      ) /*!< Memory Protection Unit            (non-secure address space) */\r
+  #endif\r
+\r
+  #define FPU_BASE_NS         (SCS_BASE_NS +  0x0F30UL)                  /*!< Floating Point Unit               (non-secure address space) */\r
+  #define FPU_NS              ((FPU_Type       *)     FPU_BASE_NS      ) /*!< Floating Point Unit               (non-secure address space) */\r
+\r
+#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */\r
+/*@} */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                Hardware Abstraction Layer\r
+  Core Function Interface contains:\r
+  - Core NVIC Functions\r
+  - Core SysTick Functions\r
+  - Core Debug Functions\r
+  - Core Register Access Functions\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference\r
+*/\r
+\r
+\r
+\r
+/* ##########################   NVIC functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_NVICFunctions NVIC Functions\r
+  \brief    Functions that manage interrupts and exceptions via the NVIC.\r
+  @{\r
+ */\r
+\r
+#ifdef CMSIS_NVIC_VIRTUAL\r
+  #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+    #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"\r
+  #endif\r
+  #include CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+#else\r
+  #define NVIC_SetPriorityGrouping    __NVIC_SetPriorityGrouping\r
+  #define NVIC_GetPriorityGrouping    __NVIC_GetPriorityGrouping\r
+  #define NVIC_EnableIRQ              __NVIC_EnableIRQ\r
+  #define NVIC_GetEnableIRQ           __NVIC_GetEnableIRQ\r
+  #define NVIC_DisableIRQ             __NVIC_DisableIRQ\r
+  #define NVIC_GetPendingIRQ          __NVIC_GetPendingIRQ\r
+  #define NVIC_SetPendingIRQ          __NVIC_SetPendingIRQ\r
+  #define NVIC_ClearPendingIRQ        __NVIC_ClearPendingIRQ\r
+  #define NVIC_GetActive              __NVIC_GetActive\r
+  #define NVIC_SetPriority            __NVIC_SetPriority\r
+  #define NVIC_GetPriority            __NVIC_GetPriority\r
+  #define NVIC_SystemReset            __NVIC_SystemReset\r
+#endif /* CMSIS_NVIC_VIRTUAL */\r
+\r
+#ifdef CMSIS_VECTAB_VIRTUAL\r
+  #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+    #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"\r
+  #endif\r
+  #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+#else\r
+  #define NVIC_SetVector              __NVIC_SetVector\r
+  #define NVIC_GetVector              __NVIC_GetVector\r
+#endif  /* (CMSIS_VECTAB_VIRTUAL) */\r
+\r
+#define NVIC_USER_IRQ_OFFSET          16\r
+\r
+\r
+/* Special LR values for Secure/Non-Secure call handling and exception handling                                               */\r
+\r
+/* Function Return Payload (from ARMv8-M Architecture Reference Manual) LR value on entry from Secure BLXNS                   */ \r
+#define FNC_RETURN                 (0xFEFFFFFFUL)     /* bit [0] ignored when processing a branch                             */\r
+\r
+/* The following EXC_RETURN mask values are used to evaluate the LR on exception entry */\r
+#define EXC_RETURN_PREFIX          (0xFF000000UL)     /* bits [31:24] set to indicate an EXC_RETURN value                     */\r
+#define EXC_RETURN_S               (0x00000040UL)     /* bit [6] stack used to push registers: 0=Non-secure 1=Secure          */\r
+#define EXC_RETURN_DCRS            (0x00000020UL)     /* bit [5] stacking rules for called registers: 0=skipped 1=saved       */\r
+#define EXC_RETURN_FTYPE           (0x00000010UL)     /* bit [4] allocate stack for floating-point context: 0=done 1=skipped  */\r
+#define EXC_RETURN_MODE            (0x00000008UL)     /* bit [3] processor mode for return: 0=Handler mode 1=Thread mode      */\r
+#define EXC_RETURN_SPSEL           (0x00000002UL)     /* bit [1] stack pointer used to restore context: 0=MSP 1=PSP           */\r
+#define EXC_RETURN_ES              (0x00000001UL)     /* bit [0] security state exception was taken to: 0=Non-secure 1=Secure */\r
+\r
+/* Integrity Signature (from ARMv8-M Architecture Reference Manual) for exception context stacking                            */\r
+#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)  /* Value for processors with floating-point extension:                  */\r
+#define EXC_INTEGRITY_SIGNATURE     (0xFEFA125AUL)     /* bit [0] SFTC must match LR bit[4] EXC_RETURN_FTYPE                   */\r
+#else \r
+#define EXC_INTEGRITY_SIGNATURE     (0xFEFA125BUL)     /* Value for processors without floating-point extension                */\r
+#endif\r
+\r
+\r
+/**\r
+  \brief   Set Priority Grouping\r
+  \details Sets the priority grouping field using the required unlock sequence.\r
+           The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field.\r
+           Only values from 0..7 are used.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.\r
+  \param [in]      PriorityGroup  Priority grouping field.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup)\r
+{\r
+  uint32_t reg_value;\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);             /* only values 0..7 are used          */\r
+\r
+  reg_value  =  SCB->AIRCR;                                                   /* read old register configuration    */\r
+  reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change               */\r
+  reg_value  =  (reg_value                                   |\r
+                ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |\r
+                (PriorityGroupTmp << 8U)                      );              /* Insert write key and priority group */\r
+  SCB->AIRCR =  reg_value;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Priority Grouping\r
+  \details Reads the priority grouping field from the NVIC Interrupt Controller.\r
+  \return                Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field).\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void)\r
+{\r
+  return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos));\r
+}\r
+\r
+\r
+/**\r
+  \brief   Enable Interrupt\r
+  \details Enables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Enable status\r
+  \details Returns a device specific interrupt enable status from the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt is not enabled.\r
+  \return             1  Interrupt is enabled.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Disable Interrupt\r
+  \details Disables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+    __DSB();\r
+    __ISB();\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Pending Interrupt\r
+  \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not pending.\r
+  \return             1  Interrupt status is pending.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Pending Interrupt\r
+  \details Sets the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Clear Pending Interrupt\r
+  \details Clears the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Active Interrupt\r
+  \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not active.\r
+  \return             1  Interrupt status is active.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+/**\r
+  \brief   Get Interrupt Target State\r
+  \details Reads the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  if interrupt is assigned to Secure\r
+  \return             1  if interrupt is assigned to Non Secure\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t NVIC_GetTargetState(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Target State\r
+  \details Sets the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  if interrupt is assigned to Secure\r
+                      1  if interrupt is assigned to Non Secure\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t NVIC_SetTargetState(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] |=  ((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)));\r
+    return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Clear Interrupt Target State\r
+  \details Clears the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  if interrupt is assigned to Secure\r
+                      1  if interrupt is assigned to Non Secure\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t NVIC_ClearTargetState(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)));\r
+    return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Priority\r
+  \details Sets the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]      IRQn  Interrupt number.\r
+  \param [in]  priority  Priority to set.\r
+  \note    The priority cannot be set for every processor exception.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->IPR[((uint32_t)IRQn)]               = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);\r
+  }\r
+  else\r
+  {\r
+    SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Priority\r
+  \details Reads the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn  Interrupt number.\r
+  \return             Interrupt Priority.\r
+                      Value is aligned automatically to the implemented priority bits of the microcontroller.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)\r
+{\r
+\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return(((uint32_t)NVIC->IPR[((uint32_t)IRQn)]               >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+  else\r
+  {\r
+    return(((uint32_t)SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Encode Priority\r
+  \details Encodes the priority for an interrupt with the given priority group,\r
+           preemptive priority value, and subpriority value.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.\r
+  \param [in]     PriorityGroup  Used priority group.\r
+  \param [in]   PreemptPriority  Preemptive priority value (starting from 0).\r
+  \param [in]       SubPriority  Subpriority value (starting from 0).\r
+  \return                        Encoded priority. Value can be used in the function \ref NVIC_SetPriority().\r
+ */\r
+__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);\r
+  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));\r
+\r
+  return (\r
+           ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |\r
+           ((SubPriority     & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL)))\r
+         );\r
+}\r
+\r
+\r
+/**\r
+  \brief   Decode Priority\r
+  \details Decodes an interrupt priority value with a given priority group to\r
+           preemptive priority value and subpriority value.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.\r
+  \param [in]         Priority   Priority value, which can be retrieved with the function \ref NVIC_GetPriority().\r
+  \param [in]     PriorityGroup  Used priority group.\r
+  \param [out] pPreemptPriority  Preemptive priority value (starting from 0).\r
+  \param [out]     pSubPriority  Subpriority value (starting from 0).\r
+ */\r
+__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);\r
+  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));\r
+\r
+  *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);\r
+  *pSubPriority     = (Priority                   ) & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Vector\r
+  \details Sets an interrupt vector in SRAM based interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+           VTOR must been relocated to SRAM before.\r
+  \param [in]   IRQn      Interrupt number\r
+  \param [in]   vector    Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)\r
+{\r
+  uint32_t *vectors = (uint32_t *)SCB->VTOR;\r
+  vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Vector\r
+  \details Reads an interrupt vector from interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn      Interrupt number.\r
+  \return                 Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)\r
+{\r
+  uint32_t *vectors = (uint32_t *)SCB->VTOR;\r
+  return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];\r
+}\r
+\r
+\r
+/**\r
+  \brief   System Reset\r
+  \details Initiates a system reset request to reset the MCU.\r
+ */\r
+__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)\r
+{\r
+  __DSB();                                                          /* Ensure all outstanding memory accesses included\r
+                                                                       buffered write are completed before reset */\r
+  SCB->AIRCR  = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos)    |\r
+                           (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |\r
+                            SCB_AIRCR_SYSRESETREQ_Msk    );         /* Keep priority group unchanged */\r
+  __DSB();                                                          /* Ensure completion of memory access */\r
+\r
+  for(;;)                                                           /* wait until reset */\r
+  {\r
+    __NOP();\r
+  }\r
+}\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+/**\r
+  \brief   Set Priority Grouping (non-secure)\r
+  \details Sets the non-secure priority grouping field when in secure state using the required unlock sequence.\r
+           The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field.\r
+           Only values from 0..7 are used.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.\r
+  \param [in]      PriorityGroup  Priority grouping field.\r
+ */\r
+__STATIC_INLINE void TZ_NVIC_SetPriorityGrouping_NS(uint32_t PriorityGroup)\r
+{\r
+  uint32_t reg_value;\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);             /* only values 0..7 are used          */\r
+\r
+  reg_value  =  SCB_NS->AIRCR;                                                /* read old register configuration    */\r
+  reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change               */\r
+  reg_value  =  (reg_value                                   |\r
+                ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |\r
+                (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos)  );              /* Insert write key and priority group */\r
+  SCB_NS->AIRCR =  reg_value;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Priority Grouping (non-secure)\r
+  \details Reads the priority grouping field from the non-secure NVIC when in secure state.\r
+  \return                Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field).\r
+ */\r
+__STATIC_INLINE uint32_t TZ_NVIC_GetPriorityGrouping_NS(void)\r
+{\r
+  return ((uint32_t)((SCB_NS->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos));\r
+}\r
+\r
+\r
+/**\r
+  \brief   Enable Interrupt (non-secure)\r
+  \details Enables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void TZ_NVIC_EnableIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Enable status (non-secure)\r
+  \details Returns a device specific interrupt enable status from the non-secure NVIC interrupt controller when in secure state.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt is not enabled.\r
+  \return             1  Interrupt is enabled.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t TZ_NVIC_GetEnableIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Disable Interrupt (non-secure)\r
+  \details Disables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void TZ_NVIC_DisableIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC_NS->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Pending Interrupt (non-secure)\r
+  \details Reads the NVIC pending register in the non-secure NVIC when in secure state and returns the pending bit for the specified device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not pending.\r
+  \return             1  Interrupt status is pending.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t TZ_NVIC_GetPendingIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Pending Interrupt (non-secure)\r
+  \details Sets the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void TZ_NVIC_SetPendingIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Clear Pending Interrupt (non-secure)\r
+  \details Clears the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void TZ_NVIC_ClearPendingIRQ_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC_NS->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Active Interrupt (non-secure)\r
+  \details Reads the active register in non-secure NVIC when in secure state and returns the active bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not active.\r
+  \return             1  Interrupt status is active.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t TZ_NVIC_GetActive_NS(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC_NS->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Priority (non-secure)\r
+  \details Sets the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]      IRQn  Interrupt number.\r
+  \param [in]  priority  Priority to set.\r
+  \note    The priority cannot be set for every non-secure processor exception.\r
+ */\r
+__STATIC_INLINE void TZ_NVIC_SetPriority_NS(IRQn_Type IRQn, uint32_t priority)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC_NS->IPR[((uint32_t)IRQn)]               = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);\r
+  }\r
+  else\r
+  {\r
+    SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Priority (non-secure)\r
+  \details Reads the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn  Interrupt number.\r
+  \return             Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller.\r
+ */\r
+__STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn)\r
+{\r
+\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return(((uint32_t)NVIC_NS->IPR[((uint32_t)IRQn)]               >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+  else\r
+  {\r
+    return(((uint32_t)SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+}\r
+#endif /*  defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */\r
+\r
+/*@} end of CMSIS_Core_NVICFunctions */\r
+\r
+/* ##########################  MPU functions  #################################### */\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+\r
+#include "mpu_armv8.h"\r
+\r
+#endif\r
+\r
+/* ##########################  FPU functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_FpuFunctions FPU Functions\r
+  \brief    Function that provides FPU type.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   get FPU type\r
+  \details returns the FPU type\r
+  \returns\r
+   - \b  0: No FPU\r
+   - \b  1: Single precision FPU\r
+   - \b  2: Double + Single precision FPU\r
+ */\r
+__STATIC_INLINE uint32_t SCB_GetFPUType(void)\r
+{\r
+  uint32_t mvfr0;\r
+\r
+  mvfr0 = FPU->MVFR0;\r
+  if      ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x220U)\r
+  {\r
+    return 2U;           /* Double + Single precision FPU */\r
+  }\r
+  else if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x020U)\r
+  {\r
+    return 1U;           /* Single precision FPU */\r
+  }\r
+  else\r
+  {\r
+    return 0U;           /* No FPU */\r
+  }\r
+}\r
+\r
+\r
+/*@} end of CMSIS_Core_FpuFunctions */\r
+\r
+\r
+\r
+/* ##########################   SAU functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_SAUFunctions SAU Functions\r
+  \brief    Functions that configure the SAU.\r
+  @{\r
+ */\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+\r
+/**\r
+  \brief   Enable SAU\r
+  \details Enables the Security Attribution Unit (SAU).\r
+ */\r
+__STATIC_INLINE void TZ_SAU_Enable(void)\r
+{\r
+    SAU->CTRL |=  (SAU_CTRL_ENABLE_Msk);\r
+}\r
+\r
+\r
+\r
+/**\r
+  \brief   Disable SAU\r
+  \details Disables the Security Attribution Unit (SAU).\r
+ */\r
+__STATIC_INLINE void TZ_SAU_Disable(void)\r
+{\r
+    SAU->CTRL &= ~(SAU_CTRL_ENABLE_Msk);\r
+}\r
+\r
+#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */\r
+\r
+/*@} end of CMSIS_Core_SAUFunctions */\r
+\r
+\r
+\r
+\r
+/* ##################################    SysTick function  ############################################ */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_SysTickFunctions SysTick Functions\r
+  \brief    Functions that configure the System.\r
+  @{\r
+ */\r
+\r
+#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)\r
+\r
+/**\r
+  \brief   System Tick Configuration\r
+  \details Initializes the System Timer and its interrupt, and starts the System Tick Timer.\r
+           Counter is in free running mode to generate periodic interrupts.\r
+  \param [in]  ticks  Number of ticks between two interrupts.\r
+  \return          0  Function succeeded.\r
+  \return          1  Function failed.\r
+  \note    When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the\r
+           function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>\r
+           must contain a vendor-specific implementation of this function.\r
+ */\r
+__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)\r
+{\r
+  if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)\r
+  {\r
+    return (1UL);                                                   /* Reload value impossible */\r
+  }\r
+\r
+  SysTick->LOAD  = (uint32_t)(ticks - 1UL);                         /* set reload register */\r
+  NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */\r
+  SysTick->VAL   = 0UL;                                             /* Load the SysTick Counter Value */\r
+  SysTick->CTRL  = SysTick_CTRL_CLKSOURCE_Msk |\r
+                   SysTick_CTRL_TICKINT_Msk   |\r
+                   SysTick_CTRL_ENABLE_Msk;                         /* Enable SysTick IRQ and SysTick Timer */\r
+  return (0UL);                                                     /* Function successful */\r
+}\r
+\r
+#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
+/**\r
+  \brief   System Tick Configuration (non-secure)\r
+  \details Initializes the non-secure System Timer and its interrupt when in secure state, and starts the System Tick Timer.\r
+           Counter is in free running mode to generate periodic interrupts.\r
+  \param [in]  ticks  Number of ticks between two interrupts.\r
+  \return          0  Function succeeded.\r
+  \return          1  Function failed.\r
+  \note    When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the\r
+           function <b>TZ_SysTick_Config_NS</b> is not included. In this case, the file <b><i>device</i>.h</b>\r
+           must contain a vendor-specific implementation of this function.\r
+\r
+ */\r
+__STATIC_INLINE uint32_t TZ_SysTick_Config_NS(uint32_t ticks)\r
+{\r
+  if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)\r
+  {\r
+    return (1UL);                                                         /* Reload value impossible */\r
+  }\r
+\r
+  SysTick_NS->LOAD  = (uint32_t)(ticks - 1UL);                            /* set reload register */\r
+  TZ_NVIC_SetPriority_NS (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */\r
+  SysTick_NS->VAL   = 0UL;                                                /* Load the SysTick Counter Value */\r
+  SysTick_NS->CTRL  = SysTick_CTRL_CLKSOURCE_Msk |\r
+                      SysTick_CTRL_TICKINT_Msk   |\r
+                      SysTick_CTRL_ENABLE_Msk;                            /* Enable SysTick IRQ and SysTick Timer */\r
+  return (0UL);                                                           /* Function successful */\r
+}\r
+#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */\r
+\r
+#endif\r
+\r
+/*@} end of CMSIS_Core_SysTickFunctions */\r
+\r
+\r
+\r
+/* ##################################### Debug In/Output function ########################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_core_DebugFunctions ITM Functions\r
+  \brief    Functions that access the ITM debug interface.\r
+  @{\r
+ */\r
+\r
+extern volatile int32_t ITM_RxBuffer;                              /*!< External variable to receive characters. */\r
+#define                 ITM_RXBUFFER_EMPTY  ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */\r
+\r
+\r
+/**\r
+  \brief   ITM Send Character\r
+  \details Transmits a character via the ITM channel 0, and\r
+           \li Just returns when no debugger is connected that has booked the output.\r
+           \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted.\r
+  \param [in]     ch  Character to transmit.\r
+  \returns            Character to transmit.\r
+ */\r
+__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch)\r
+{\r
+  if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) &&      /* ITM enabled */\r
+      ((ITM->TER & 1UL               ) != 0UL)   )     /* ITM Port #0 enabled */\r
+  {\r
+    while (ITM->PORT[0U].u32 == 0UL)\r
+    {\r
+      __NOP();\r
+    }\r
+    ITM->PORT[0U].u8 = (uint8_t)ch;\r
+  }\r
+  return (ch);\r
+}\r
+\r
+\r
+/**\r
+  \brief   ITM Receive Character\r
+  \details Inputs a character via the external variable \ref ITM_RxBuffer.\r
+  \return             Received character.\r
+  \return         -1  No character pending.\r
+ */\r
+__STATIC_INLINE int32_t ITM_ReceiveChar (void)\r
+{\r
+  int32_t ch = -1;                           /* no character available */\r
+\r
+  if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY)\r
+  {\r
+    ch = ITM_RxBuffer;\r
+    ITM_RxBuffer = ITM_RXBUFFER_EMPTY;       /* ready for next character */\r
+  }\r
+\r
+  return (ch);\r
+}\r
+\r
+\r
+/**\r
+  \brief   ITM Check Character\r
+  \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer.\r
+  \return          0  No character available.\r
+  \return          1  Character available.\r
+ */\r
+__STATIC_INLINE int32_t ITM_CheckChar (void)\r
+{\r
+\r
+  if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY)\r
+  {\r
+    return (0);                              /* no character available */\r
+  }\r
+  else\r
+  {\r
+    return (1);                              /*    character available */\r
+  }\r
+}\r
+\r
+/*@} end of CMSIS_core_DebugFunctions */\r
+\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_CM33_H_DEPENDANT */\r
+\r
+#endif /* __CMSIS_GENERIC */\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm4.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm4.h
new file mode 100644 (file)
index 0000000..308b868
--- /dev/null
@@ -0,0 +1,2129 @@
+/**************************************************************************//**\r
+ * @file     core_cm4.h\r
+ * @brief    CMSIS Cortex-M4 Core Peripheral Access Layer Header File\r
+ * @version  V5.0.8\r
+ * @date     04. June 2018\r
+ ******************************************************************************/\r
+/*\r
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.\r
+ *\r
+ * SPDX-License-Identifier: Apache-2.0\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the License); you may\r
+ * not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#if   defined ( __ICCARM__ )\r
+  #pragma system_include         /* treat file as system include file for MISRA check */\r
+#elif defined (__clang__)\r
+  #pragma clang system_header   /* treat file as system include file */\r
+#endif\r
+\r
+#ifndef __CORE_CM4_H_GENERIC\r
+#define __CORE_CM4_H_GENERIC\r
+\r
+#include <stdint.h>\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/**\r
+  \page CMSIS_MISRA_Exceptions  MISRA-C:2004 Compliance Exceptions\r
+  CMSIS violates the following MISRA-C:2004 rules:\r
+\r
+   \li Required Rule 8.5, object/function definition in header file.<br>\r
+     Function definitions in header files are used to allow 'inlining'.\r
+\r
+   \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>\r
+     Unions are used for effective representation of core registers.\r
+\r
+   \li Advisory Rule 19.7, Function-like macro defined.<br>\r
+     Function-like macros are used to allow more efficient code.\r
+ */\r
+\r
+\r
+/*******************************************************************************\r
+ *                 CMSIS definitions\r
+ ******************************************************************************/\r
+/**\r
+  \ingroup Cortex_M4\r
+  @{\r
+ */\r
+\r
+#include "cmsis_version.h"\r
+\r
+/* CMSIS CM4 definitions */\r
+#define __CM4_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)              /*!< \deprecated [31:16] CMSIS HAL main version */\r
+#define __CM4_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)               /*!< \deprecated [15:0]  CMSIS HAL sub version */\r
+#define __CM4_CMSIS_VERSION       ((__CM4_CMSIS_VERSION_MAIN << 16U) | \\r
+                                    __CM4_CMSIS_VERSION_SUB           )  /*!< \deprecated CMSIS HAL version number */\r
+\r
+#define __CORTEX_M                (4U)                                   /*!< Cortex-M Core */\r
+\r
+/** __FPU_USED indicates whether an FPU is used or not.\r
+    For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions.\r
+*/\r
+#if defined ( __CC_ARM )\r
+  #if defined __TARGET_FPU_VFP\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)\r
+  #if defined __ARM_PCS_VFP\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+#elif defined ( __GNUC__ )\r
+  #if defined (__VFP_FP__) && !defined(__SOFTFP__)\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+#elif defined ( __ICCARM__ )\r
+  #if defined __ARMVFP__\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+#elif defined ( __TI_ARM__ )\r
+  #if defined __TI_VFP_SUPPORT__\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+#elif defined ( __TASKING__ )\r
+  #if defined __FPU_VFP__\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+#elif defined ( __CSMC__ )\r
+  #if ( __CSMC__ & 0x400U)\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+#endif\r
+\r
+#include "cmsis_compiler.h"               /* CMSIS compiler specific defines */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_CM4_H_GENERIC */\r
+\r
+#ifndef __CMSIS_GENERIC\r
+\r
+#ifndef __CORE_CM4_H_DEPENDANT\r
+#define __CORE_CM4_H_DEPENDANT\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/* check device defines and use defaults */\r
+#if defined __CHECK_DEVICE_DEFINES\r
+  #ifndef __CM4_REV\r
+    #define __CM4_REV               0x0000U\r
+    #warning "__CM4_REV not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __FPU_PRESENT\r
+    #define __FPU_PRESENT             0U\r
+    #warning "__FPU_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __MPU_PRESENT\r
+    #define __MPU_PRESENT             0U\r
+    #warning "__MPU_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __NVIC_PRIO_BITS\r
+    #define __NVIC_PRIO_BITS          3U\r
+    #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __Vendor_SysTickConfig\r
+    #define __Vendor_SysTickConfig    0U\r
+    #warning "__Vendor_SysTickConfig not defined in device header file; using default!"\r
+  #endif\r
+#endif\r
+\r
+/* IO definitions (access restrictions to peripheral registers) */\r
+/**\r
+    \defgroup CMSIS_glob_defs CMSIS Global Defines\r
+\r
+    <strong>IO Type Qualifiers</strong> are used\r
+    \li to specify the access to peripheral variables.\r
+    \li for automatic generation of peripheral register debug information.\r
+*/\r
+#ifdef __cplusplus\r
+  #define   __I     volatile             /*!< Defines 'read only' permissions */\r
+#else\r
+  #define   __I     volatile const       /*!< Defines 'read only' permissions */\r
+#endif\r
+#define     __O     volatile             /*!< Defines 'write only' permissions */\r
+#define     __IO    volatile             /*!< Defines 'read / write' permissions */\r
+\r
+/* following defines should be used for structure members */\r
+#define     __IM     volatile const      /*! Defines 'read only' structure member permissions */\r
+#define     __OM     volatile            /*! Defines 'write only' structure member permissions */\r
+#define     __IOM    volatile            /*! Defines 'read / write' structure member permissions */\r
+\r
+/*@} end of group Cortex_M4 */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                 Register Abstraction\r
+  Core Register contain:\r
+  - Core Register\r
+  - Core NVIC Register\r
+  - Core SCB Register\r
+  - Core SysTick Register\r
+  - Core Debug Register\r
+  - Core MPU Register\r
+  - Core FPU Register\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_core_register Defines and Type Definitions\r
+  \brief Type definitions and defines for Cortex-M processor based devices.\r
+*/\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_CORE  Status and Control Registers\r
+  \brief      Core Register type definitions.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Union type to access the Application Program Status Register (APSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t _reserved0:16;              /*!< bit:  0..15  Reserved */\r
+    uint32_t GE:4;                       /*!< bit: 16..19  Greater than or Equal flags */\r
+    uint32_t _reserved1:7;               /*!< bit: 20..26  Reserved */\r
+    uint32_t Q:1;                        /*!< bit:     27  Saturation condition flag */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} APSR_Type;\r
+\r
+/* APSR Register Definitions */\r
+#define APSR_N_Pos                         31U                                            /*!< APSR: N Position */\r
+#define APSR_N_Msk                         (1UL << APSR_N_Pos)                            /*!< APSR: N Mask */\r
+\r
+#define APSR_Z_Pos                         30U                                            /*!< APSR: Z Position */\r
+#define APSR_Z_Msk                         (1UL << APSR_Z_Pos)                            /*!< APSR: Z Mask */\r
+\r
+#define APSR_C_Pos                         29U                                            /*!< APSR: C Position */\r
+#define APSR_C_Msk                         (1UL << APSR_C_Pos)                            /*!< APSR: C Mask */\r
+\r
+#define APSR_V_Pos                         28U                                            /*!< APSR: V Position */\r
+#define APSR_V_Msk                         (1UL << APSR_V_Pos)                            /*!< APSR: V Mask */\r
+\r
+#define APSR_Q_Pos                         27U                                            /*!< APSR: Q Position */\r
+#define APSR_Q_Msk                         (1UL << APSR_Q_Pos)                            /*!< APSR: Q Mask */\r
+\r
+#define APSR_GE_Pos                        16U                                            /*!< APSR: GE Position */\r
+#define APSR_GE_Msk                        (0xFUL << APSR_GE_Pos)                         /*!< APSR: GE Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Interrupt Program Status Register (IPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:23;              /*!< bit:  9..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} IPSR_Type;\r
+\r
+/* IPSR Register Definitions */\r
+#define IPSR_ISR_Pos                        0U                                            /*!< IPSR: ISR Position */\r
+#define IPSR_ISR_Msk                       (0x1FFUL /*<< IPSR_ISR_Pos*/)                  /*!< IPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Special-Purpose Program Status Registers (xPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:1;               /*!< bit:      9  Reserved */\r
+    uint32_t ICI_IT_1:6;                 /*!< bit: 10..15  ICI/IT part 1 */\r
+    uint32_t GE:4;                       /*!< bit: 16..19  Greater than or Equal flags */\r
+    uint32_t _reserved1:4;               /*!< bit: 20..23  Reserved */\r
+    uint32_t T:1;                        /*!< bit:     24  Thumb bit */\r
+    uint32_t ICI_IT_2:2;                 /*!< bit: 25..26  ICI/IT part 2 */\r
+    uint32_t Q:1;                        /*!< bit:     27  Saturation condition flag */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} xPSR_Type;\r
+\r
+/* xPSR Register Definitions */\r
+#define xPSR_N_Pos                         31U                                            /*!< xPSR: N Position */\r
+#define xPSR_N_Msk                         (1UL << xPSR_N_Pos)                            /*!< xPSR: N Mask */\r
+\r
+#define xPSR_Z_Pos                         30U                                            /*!< xPSR: Z Position */\r
+#define xPSR_Z_Msk                         (1UL << xPSR_Z_Pos)                            /*!< xPSR: Z Mask */\r
+\r
+#define xPSR_C_Pos                         29U                                            /*!< xPSR: C Position */\r
+#define xPSR_C_Msk                         (1UL << xPSR_C_Pos)                            /*!< xPSR: C Mask */\r
+\r
+#define xPSR_V_Pos                         28U                                            /*!< xPSR: V Position */\r
+#define xPSR_V_Msk                         (1UL << xPSR_V_Pos)                            /*!< xPSR: V Mask */\r
+\r
+#define xPSR_Q_Pos                         27U                                            /*!< xPSR: Q Position */\r
+#define xPSR_Q_Msk                         (1UL << xPSR_Q_Pos)                            /*!< xPSR: Q Mask */\r
+\r
+#define xPSR_ICI_IT_2_Pos                  25U                                            /*!< xPSR: ICI/IT part 2 Position */\r
+#define xPSR_ICI_IT_2_Msk                  (3UL << xPSR_ICI_IT_2_Pos)                     /*!< xPSR: ICI/IT part 2 Mask */\r
+\r
+#define xPSR_T_Pos                         24U                                            /*!< xPSR: T Position */\r
+#define xPSR_T_Msk                         (1UL << xPSR_T_Pos)                            /*!< xPSR: T Mask */\r
+\r
+#define xPSR_GE_Pos                        16U                                            /*!< xPSR: GE Position */\r
+#define xPSR_GE_Msk                        (0xFUL << xPSR_GE_Pos)                         /*!< xPSR: GE Mask */\r
+\r
+#define xPSR_ICI_IT_1_Pos                  10U                                            /*!< xPSR: ICI/IT part 1 Position */\r
+#define xPSR_ICI_IT_1_Msk                  (0x3FUL << xPSR_ICI_IT_1_Pos)                  /*!< xPSR: ICI/IT part 1 Mask */\r
+\r
+#define xPSR_ISR_Pos                        0U                                            /*!< xPSR: ISR Position */\r
+#define xPSR_ISR_Msk                       (0x1FFUL /*<< xPSR_ISR_Pos*/)                  /*!< xPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Control Registers (CONTROL).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t nPRIV:1;                    /*!< bit:      0  Execution privilege in Thread mode */\r
+    uint32_t SPSEL:1;                    /*!< bit:      1  Stack to be used */\r
+    uint32_t FPCA:1;                     /*!< bit:      2  FP extension active flag */\r
+    uint32_t _reserved0:29;              /*!< bit:  3..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} CONTROL_Type;\r
+\r
+/* CONTROL Register Definitions */\r
+#define CONTROL_FPCA_Pos                    2U                                            /*!< CONTROL: FPCA Position */\r
+#define CONTROL_FPCA_Msk                   (1UL << CONTROL_FPCA_Pos)                      /*!< CONTROL: FPCA Mask */\r
+\r
+#define CONTROL_SPSEL_Pos                   1U                                            /*!< CONTROL: SPSEL Position */\r
+#define CONTROL_SPSEL_Msk                  (1UL << CONTROL_SPSEL_Pos)                     /*!< CONTROL: SPSEL Mask */\r
+\r
+#define CONTROL_nPRIV_Pos                   0U                                            /*!< CONTROL: nPRIV Position */\r
+#define CONTROL_nPRIV_Msk                  (1UL /*<< CONTROL_nPRIV_Pos*/)                 /*!< CONTROL: nPRIV Mask */\r
+\r
+/*@} end of group CMSIS_CORE */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_NVIC  Nested Vectored Interrupt Controller (NVIC)\r
+  \brief      Type definitions for the NVIC Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Nested Vectored Interrupt Controller (NVIC).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t ISER[8U];               /*!< Offset: 0x000 (R/W)  Interrupt Set Enable Register */\r
+        uint32_t RESERVED0[24U];\r
+  __IOM uint32_t ICER[8U];               /*!< Offset: 0x080 (R/W)  Interrupt Clear Enable Register */\r
+        uint32_t RSERVED1[24U];\r
+  __IOM uint32_t ISPR[8U];               /*!< Offset: 0x100 (R/W)  Interrupt Set Pending Register */\r
+        uint32_t RESERVED2[24U];\r
+  __IOM uint32_t ICPR[8U];               /*!< Offset: 0x180 (R/W)  Interrupt Clear Pending Register */\r
+        uint32_t RESERVED3[24U];\r
+  __IOM uint32_t IABR[8U];               /*!< Offset: 0x200 (R/W)  Interrupt Active bit Register */\r
+        uint32_t RESERVED4[56U];\r
+  __IOM uint8_t  IP[240U];               /*!< Offset: 0x300 (R/W)  Interrupt Priority Register (8Bit wide) */\r
+        uint32_t RESERVED5[644U];\r
+  __OM  uint32_t STIR;                   /*!< Offset: 0xE00 ( /W)  Software Trigger Interrupt Register */\r
+}  NVIC_Type;\r
+\r
+/* Software Triggered Interrupt Register Definitions */\r
+#define NVIC_STIR_INTID_Pos                 0U                                         /*!< STIR: INTLINESNUM Position */\r
+#define NVIC_STIR_INTID_Msk                (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/)        /*!< STIR: INTLINESNUM Mask */\r
+\r
+/*@} end of group CMSIS_NVIC */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SCB     System Control Block (SCB)\r
+  \brief    Type definitions for the System Control Block Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Control Block (SCB).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t CPUID;                  /*!< Offset: 0x000 (R/ )  CPUID Base Register */\r
+  __IOM uint32_t ICSR;                   /*!< Offset: 0x004 (R/W)  Interrupt Control and State Register */\r
+  __IOM uint32_t VTOR;                   /*!< Offset: 0x008 (R/W)  Vector Table Offset Register */\r
+  __IOM uint32_t AIRCR;                  /*!< Offset: 0x00C (R/W)  Application Interrupt and Reset Control Register */\r
+  __IOM uint32_t SCR;                    /*!< Offset: 0x010 (R/W)  System Control Register */\r
+  __IOM uint32_t CCR;                    /*!< Offset: 0x014 (R/W)  Configuration Control Register */\r
+  __IOM uint8_t  SHP[12U];               /*!< Offset: 0x018 (R/W)  System Handlers Priority Registers (4-7, 8-11, 12-15) */\r
+  __IOM uint32_t SHCSR;                  /*!< Offset: 0x024 (R/W)  System Handler Control and State Register */\r
+  __IOM uint32_t CFSR;                   /*!< Offset: 0x028 (R/W)  Configurable Fault Status Register */\r
+  __IOM uint32_t HFSR;                   /*!< Offset: 0x02C (R/W)  HardFault Status Register */\r
+  __IOM uint32_t DFSR;                   /*!< Offset: 0x030 (R/W)  Debug Fault Status Register */\r
+  __IOM uint32_t MMFAR;                  /*!< Offset: 0x034 (R/W)  MemManage Fault Address Register */\r
+  __IOM uint32_t BFAR;                   /*!< Offset: 0x038 (R/W)  BusFault Address Register */\r
+  __IOM uint32_t AFSR;                   /*!< Offset: 0x03C (R/W)  Auxiliary Fault Status Register */\r
+  __IM  uint32_t PFR[2U];                /*!< Offset: 0x040 (R/ )  Processor Feature Register */\r
+  __IM  uint32_t DFR;                    /*!< Offset: 0x048 (R/ )  Debug Feature Register */\r
+  __IM  uint32_t ADR;                    /*!< Offset: 0x04C (R/ )  Auxiliary Feature Register */\r
+  __IM  uint32_t MMFR[4U];               /*!< Offset: 0x050 (R/ )  Memory Model Feature Register */\r
+  __IM  uint32_t ISAR[5U];               /*!< Offset: 0x060 (R/ )  Instruction Set Attributes Register */\r
+        uint32_t RESERVED0[5U];\r
+  __IOM uint32_t CPACR;                  /*!< Offset: 0x088 (R/W)  Coprocessor Access Control Register */\r
+} SCB_Type;\r
+\r
+/* SCB CPUID Register Definitions */\r
+#define SCB_CPUID_IMPLEMENTER_Pos          24U                                            /*!< SCB CPUID: IMPLEMENTER Position */\r
+#define SCB_CPUID_IMPLEMENTER_Msk          (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos)          /*!< SCB CPUID: IMPLEMENTER Mask */\r
+\r
+#define SCB_CPUID_VARIANT_Pos              20U                                            /*!< SCB CPUID: VARIANT Position */\r
+#define SCB_CPUID_VARIANT_Msk              (0xFUL << SCB_CPUID_VARIANT_Pos)               /*!< SCB CPUID: VARIANT Mask */\r
+\r
+#define SCB_CPUID_ARCHITECTURE_Pos         16U                                            /*!< SCB CPUID: ARCHITECTURE Position */\r
+#define SCB_CPUID_ARCHITECTURE_Msk         (0xFUL << SCB_CPUID_ARCHITECTURE_Pos)          /*!< SCB CPUID: ARCHITECTURE Mask */\r
+\r
+#define SCB_CPUID_PARTNO_Pos                4U                                            /*!< SCB CPUID: PARTNO Position */\r
+#define SCB_CPUID_PARTNO_Msk               (0xFFFUL << SCB_CPUID_PARTNO_Pos)              /*!< SCB CPUID: PARTNO Mask */\r
+\r
+#define SCB_CPUID_REVISION_Pos              0U                                            /*!< SCB CPUID: REVISION Position */\r
+#define SCB_CPUID_REVISION_Msk             (0xFUL /*<< SCB_CPUID_REVISION_Pos*/)          /*!< SCB CPUID: REVISION Mask */\r
+\r
+/* SCB Interrupt Control State Register Definitions */\r
+#define SCB_ICSR_NMIPENDSET_Pos            31U                                            /*!< SCB ICSR: NMIPENDSET Position */\r
+#define SCB_ICSR_NMIPENDSET_Msk            (1UL << SCB_ICSR_NMIPENDSET_Pos)               /*!< SCB ICSR: NMIPENDSET Mask */\r
+\r
+#define SCB_ICSR_PENDSVSET_Pos             28U                                            /*!< SCB ICSR: PENDSVSET Position */\r
+#define SCB_ICSR_PENDSVSET_Msk             (1UL << SCB_ICSR_PENDSVSET_Pos)                /*!< SCB ICSR: PENDSVSET Mask */\r
+\r
+#define SCB_ICSR_PENDSVCLR_Pos             27U                                            /*!< SCB ICSR: PENDSVCLR Position */\r
+#define SCB_ICSR_PENDSVCLR_Msk             (1UL << SCB_ICSR_PENDSVCLR_Pos)                /*!< SCB ICSR: PENDSVCLR Mask */\r
+\r
+#define SCB_ICSR_PENDSTSET_Pos             26U                                            /*!< SCB ICSR: PENDSTSET Position */\r
+#define SCB_ICSR_PENDSTSET_Msk             (1UL << SCB_ICSR_PENDSTSET_Pos)                /*!< SCB ICSR: PENDSTSET Mask */\r
+\r
+#define SCB_ICSR_PENDSTCLR_Pos             25U                                            /*!< SCB ICSR: PENDSTCLR Position */\r
+#define SCB_ICSR_PENDSTCLR_Msk             (1UL << SCB_ICSR_PENDSTCLR_Pos)                /*!< SCB ICSR: PENDSTCLR Mask */\r
+\r
+#define SCB_ICSR_ISRPREEMPT_Pos            23U                                            /*!< SCB ICSR: ISRPREEMPT Position */\r
+#define SCB_ICSR_ISRPREEMPT_Msk            (1UL << SCB_ICSR_ISRPREEMPT_Pos)               /*!< SCB ICSR: ISRPREEMPT Mask */\r
+\r
+#define SCB_ICSR_ISRPENDING_Pos            22U                                            /*!< SCB ICSR: ISRPENDING Position */\r
+#define SCB_ICSR_ISRPENDING_Msk            (1UL << SCB_ICSR_ISRPENDING_Pos)               /*!< SCB ICSR: ISRPENDING Mask */\r
+\r
+#define SCB_ICSR_VECTPENDING_Pos           12U                                            /*!< SCB ICSR: VECTPENDING Position */\r
+#define SCB_ICSR_VECTPENDING_Msk           (0x1FFUL << SCB_ICSR_VECTPENDING_Pos)          /*!< SCB ICSR: VECTPENDING Mask */\r
+\r
+#define SCB_ICSR_RETTOBASE_Pos             11U                                            /*!< SCB ICSR: RETTOBASE Position */\r
+#define SCB_ICSR_RETTOBASE_Msk             (1UL << SCB_ICSR_RETTOBASE_Pos)                /*!< SCB ICSR: RETTOBASE Mask */\r
+\r
+#define SCB_ICSR_VECTACTIVE_Pos             0U                                            /*!< SCB ICSR: VECTACTIVE Position */\r
+#define SCB_ICSR_VECTACTIVE_Msk            (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/)       /*!< SCB ICSR: VECTACTIVE Mask */\r
+\r
+/* SCB Vector Table Offset Register Definitions */\r
+#define SCB_VTOR_TBLOFF_Pos                 7U                                            /*!< SCB VTOR: TBLOFF Position */\r
+#define SCB_VTOR_TBLOFF_Msk                (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos)           /*!< SCB VTOR: TBLOFF Mask */\r
+\r
+/* SCB Application Interrupt and Reset Control Register Definitions */\r
+#define SCB_AIRCR_VECTKEY_Pos              16U                                            /*!< SCB AIRCR: VECTKEY Position */\r
+#define SCB_AIRCR_VECTKEY_Msk              (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos)            /*!< SCB AIRCR: VECTKEY Mask */\r
+\r
+#define SCB_AIRCR_VECTKEYSTAT_Pos          16U                                            /*!< SCB AIRCR: VECTKEYSTAT Position */\r
+#define SCB_AIRCR_VECTKEYSTAT_Msk          (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos)        /*!< SCB AIRCR: VECTKEYSTAT Mask */\r
+\r
+#define SCB_AIRCR_ENDIANESS_Pos            15U                                            /*!< SCB AIRCR: ENDIANESS Position */\r
+#define SCB_AIRCR_ENDIANESS_Msk            (1UL << SCB_AIRCR_ENDIANESS_Pos)               /*!< SCB AIRCR: ENDIANESS Mask */\r
+\r
+#define SCB_AIRCR_PRIGROUP_Pos              8U                                            /*!< SCB AIRCR: PRIGROUP Position */\r
+#define SCB_AIRCR_PRIGROUP_Msk             (7UL << SCB_AIRCR_PRIGROUP_Pos)                /*!< SCB AIRCR: PRIGROUP Mask */\r
+\r
+#define SCB_AIRCR_SYSRESETREQ_Pos           2U                                            /*!< SCB AIRCR: SYSRESETREQ Position */\r
+#define SCB_AIRCR_SYSRESETREQ_Msk          (1UL << SCB_AIRCR_SYSRESETREQ_Pos)             /*!< SCB AIRCR: SYSRESETREQ Mask */\r
+\r
+#define SCB_AIRCR_VECTCLRACTIVE_Pos         1U                                            /*!< SCB AIRCR: VECTCLRACTIVE Position */\r
+#define SCB_AIRCR_VECTCLRACTIVE_Msk        (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos)           /*!< SCB AIRCR: VECTCLRACTIVE Mask */\r
+\r
+#define SCB_AIRCR_VECTRESET_Pos             0U                                            /*!< SCB AIRCR: VECTRESET Position */\r
+#define SCB_AIRCR_VECTRESET_Msk            (1UL /*<< SCB_AIRCR_VECTRESET_Pos*/)           /*!< SCB AIRCR: VECTRESET Mask */\r
+\r
+/* SCB System Control Register Definitions */\r
+#define SCB_SCR_SEVONPEND_Pos               4U                                            /*!< SCB SCR: SEVONPEND Position */\r
+#define SCB_SCR_SEVONPEND_Msk              (1UL << SCB_SCR_SEVONPEND_Pos)                 /*!< SCB SCR: SEVONPEND Mask */\r
+\r
+#define SCB_SCR_SLEEPDEEP_Pos               2U                                            /*!< SCB SCR: SLEEPDEEP Position */\r
+#define SCB_SCR_SLEEPDEEP_Msk              (1UL << SCB_SCR_SLEEPDEEP_Pos)                 /*!< SCB SCR: SLEEPDEEP Mask */\r
+\r
+#define SCB_SCR_SLEEPONEXIT_Pos             1U                                            /*!< SCB SCR: SLEEPONEXIT Position */\r
+#define SCB_SCR_SLEEPONEXIT_Msk            (1UL << SCB_SCR_SLEEPONEXIT_Pos)               /*!< SCB SCR: SLEEPONEXIT Mask */\r
+\r
+/* SCB Configuration Control Register Definitions */\r
+#define SCB_CCR_STKALIGN_Pos                9U                                            /*!< SCB CCR: STKALIGN Position */\r
+#define SCB_CCR_STKALIGN_Msk               (1UL << SCB_CCR_STKALIGN_Pos)                  /*!< SCB CCR: STKALIGN Mask */\r
+\r
+#define SCB_CCR_BFHFNMIGN_Pos               8U                                            /*!< SCB CCR: BFHFNMIGN Position */\r
+#define SCB_CCR_BFHFNMIGN_Msk              (1UL << SCB_CCR_BFHFNMIGN_Pos)                 /*!< SCB CCR: BFHFNMIGN Mask */\r
+\r
+#define SCB_CCR_DIV_0_TRP_Pos               4U                                            /*!< SCB CCR: DIV_0_TRP Position */\r
+#define SCB_CCR_DIV_0_TRP_Msk              (1UL << SCB_CCR_DIV_0_TRP_Pos)                 /*!< SCB CCR: DIV_0_TRP Mask */\r
+\r
+#define SCB_CCR_UNALIGN_TRP_Pos             3U                                            /*!< SCB CCR: UNALIGN_TRP Position */\r
+#define SCB_CCR_UNALIGN_TRP_Msk            (1UL << SCB_CCR_UNALIGN_TRP_Pos)               /*!< SCB CCR: UNALIGN_TRP Mask */\r
+\r
+#define SCB_CCR_USERSETMPEND_Pos            1U                                            /*!< SCB CCR: USERSETMPEND Position */\r
+#define SCB_CCR_USERSETMPEND_Msk           (1UL << SCB_CCR_USERSETMPEND_Pos)              /*!< SCB CCR: USERSETMPEND Mask */\r
+\r
+#define SCB_CCR_NONBASETHRDENA_Pos          0U                                            /*!< SCB CCR: NONBASETHRDENA Position */\r
+#define SCB_CCR_NONBASETHRDENA_Msk         (1UL /*<< SCB_CCR_NONBASETHRDENA_Pos*/)        /*!< SCB CCR: NONBASETHRDENA Mask */\r
+\r
+/* SCB System Handler Control and State Register Definitions */\r
+#define SCB_SHCSR_USGFAULTENA_Pos          18U                                            /*!< SCB SHCSR: USGFAULTENA Position */\r
+#define SCB_SHCSR_USGFAULTENA_Msk          (1UL << SCB_SHCSR_USGFAULTENA_Pos)             /*!< SCB SHCSR: USGFAULTENA Mask */\r
+\r
+#define SCB_SHCSR_BUSFAULTENA_Pos          17U                                            /*!< SCB SHCSR: BUSFAULTENA Position */\r
+#define SCB_SHCSR_BUSFAULTENA_Msk          (1UL << SCB_SHCSR_BUSFAULTENA_Pos)             /*!< SCB SHCSR: BUSFAULTENA Mask */\r
+\r
+#define SCB_SHCSR_MEMFAULTENA_Pos          16U                                            /*!< SCB SHCSR: MEMFAULTENA Position */\r
+#define SCB_SHCSR_MEMFAULTENA_Msk          (1UL << SCB_SHCSR_MEMFAULTENA_Pos)             /*!< SCB SHCSR: MEMFAULTENA Mask */\r
+\r
+#define SCB_SHCSR_SVCALLPENDED_Pos         15U                                            /*!< SCB SHCSR: SVCALLPENDED Position */\r
+#define SCB_SHCSR_SVCALLPENDED_Msk         (1UL << SCB_SHCSR_SVCALLPENDED_Pos)            /*!< SCB SHCSR: SVCALLPENDED Mask */\r
+\r
+#define SCB_SHCSR_BUSFAULTPENDED_Pos       14U                                            /*!< SCB SHCSR: BUSFAULTPENDED Position */\r
+#define SCB_SHCSR_BUSFAULTPENDED_Msk       (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos)          /*!< SCB SHCSR: BUSFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_MEMFAULTPENDED_Pos       13U                                            /*!< SCB SHCSR: MEMFAULTPENDED Position */\r
+#define SCB_SHCSR_MEMFAULTPENDED_Msk       (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos)          /*!< SCB SHCSR: MEMFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_USGFAULTPENDED_Pos       12U                                            /*!< SCB SHCSR: USGFAULTPENDED Position */\r
+#define SCB_SHCSR_USGFAULTPENDED_Msk       (1UL << SCB_SHCSR_USGFAULTPENDED_Pos)          /*!< SCB SHCSR: USGFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_SYSTICKACT_Pos           11U                                            /*!< SCB SHCSR: SYSTICKACT Position */\r
+#define SCB_SHCSR_SYSTICKACT_Msk           (1UL << SCB_SHCSR_SYSTICKACT_Pos)              /*!< SCB SHCSR: SYSTICKACT Mask */\r
+\r
+#define SCB_SHCSR_PENDSVACT_Pos            10U                                            /*!< SCB SHCSR: PENDSVACT Position */\r
+#define SCB_SHCSR_PENDSVACT_Msk            (1UL << SCB_SHCSR_PENDSVACT_Pos)               /*!< SCB SHCSR: PENDSVACT Mask */\r
+\r
+#define SCB_SHCSR_MONITORACT_Pos            8U                                            /*!< SCB SHCSR: MONITORACT Position */\r
+#define SCB_SHCSR_MONITORACT_Msk           (1UL << SCB_SHCSR_MONITORACT_Pos)              /*!< SCB SHCSR: MONITORACT Mask */\r
+\r
+#define SCB_SHCSR_SVCALLACT_Pos             7U                                            /*!< SCB SHCSR: SVCALLACT Position */\r
+#define SCB_SHCSR_SVCALLACT_Msk            (1UL << SCB_SHCSR_SVCALLACT_Pos)               /*!< SCB SHCSR: SVCALLACT Mask */\r
+\r
+#define SCB_SHCSR_USGFAULTACT_Pos           3U                                            /*!< SCB SHCSR: USGFAULTACT Position */\r
+#define SCB_SHCSR_USGFAULTACT_Msk          (1UL << SCB_SHCSR_USGFAULTACT_Pos)             /*!< SCB SHCSR: USGFAULTACT Mask */\r
+\r
+#define SCB_SHCSR_BUSFAULTACT_Pos           1U                                            /*!< SCB SHCSR: BUSFAULTACT Position */\r
+#define SCB_SHCSR_BUSFAULTACT_Msk          (1UL << SCB_SHCSR_BUSFAULTACT_Pos)             /*!< SCB SHCSR: BUSFAULTACT Mask */\r
+\r
+#define SCB_SHCSR_MEMFAULTACT_Pos           0U                                            /*!< SCB SHCSR: MEMFAULTACT Position */\r
+#define SCB_SHCSR_MEMFAULTACT_Msk          (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/)         /*!< SCB SHCSR: MEMFAULTACT Mask */\r
+\r
+/* SCB Configurable Fault Status Register Definitions */\r
+#define SCB_CFSR_USGFAULTSR_Pos            16U                                            /*!< SCB CFSR: Usage Fault Status Register Position */\r
+#define SCB_CFSR_USGFAULTSR_Msk            (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos)          /*!< SCB CFSR: Usage Fault Status Register Mask */\r
+\r
+#define SCB_CFSR_BUSFAULTSR_Pos             8U                                            /*!< SCB CFSR: Bus Fault Status Register Position */\r
+#define SCB_CFSR_BUSFAULTSR_Msk            (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos)            /*!< SCB CFSR: Bus Fault Status Register Mask */\r
+\r
+#define SCB_CFSR_MEMFAULTSR_Pos             0U                                            /*!< SCB CFSR: Memory Manage Fault Status Register Position */\r
+#define SCB_CFSR_MEMFAULTSR_Msk            (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/)        /*!< SCB CFSR: Memory Manage Fault Status Register Mask */\r
+\r
+/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */\r
+#define SCB_CFSR_MMARVALID_Pos             (SCB_SHCSR_MEMFAULTACT_Pos + 7U)               /*!< SCB CFSR (MMFSR): MMARVALID Position */\r
+#define SCB_CFSR_MMARVALID_Msk             (1UL << SCB_CFSR_MMARVALID_Pos)                /*!< SCB CFSR (MMFSR): MMARVALID Mask */\r
+\r
+#define SCB_CFSR_MLSPERR_Pos               (SCB_SHCSR_MEMFAULTACT_Pos + 5U)               /*!< SCB CFSR (MMFSR): MLSPERR Position */\r
+#define SCB_CFSR_MLSPERR_Msk               (1UL << SCB_CFSR_MLSPERR_Pos)                  /*!< SCB CFSR (MMFSR): MLSPERR Mask */\r
+\r
+#define SCB_CFSR_MSTKERR_Pos               (SCB_SHCSR_MEMFAULTACT_Pos + 4U)               /*!< SCB CFSR (MMFSR): MSTKERR Position */\r
+#define SCB_CFSR_MSTKERR_Msk               (1UL << SCB_CFSR_MSTKERR_Pos)                  /*!< SCB CFSR (MMFSR): MSTKERR Mask */\r
+\r
+#define SCB_CFSR_MUNSTKERR_Pos             (SCB_SHCSR_MEMFAULTACT_Pos + 3U)               /*!< SCB CFSR (MMFSR): MUNSTKERR Position */\r
+#define SCB_CFSR_MUNSTKERR_Msk             (1UL << SCB_CFSR_MUNSTKERR_Pos)                /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */\r
+\r
+#define SCB_CFSR_DACCVIOL_Pos              (SCB_SHCSR_MEMFAULTACT_Pos + 1U)               /*!< SCB CFSR (MMFSR): DACCVIOL Position */\r
+#define SCB_CFSR_DACCVIOL_Msk              (1UL << SCB_CFSR_DACCVIOL_Pos)                 /*!< SCB CFSR (MMFSR): DACCVIOL Mask */\r
+\r
+#define SCB_CFSR_IACCVIOL_Pos              (SCB_SHCSR_MEMFAULTACT_Pos + 0U)               /*!< SCB CFSR (MMFSR): IACCVIOL Position */\r
+#define SCB_CFSR_IACCVIOL_Msk              (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/)             /*!< SCB CFSR (MMFSR): IACCVIOL Mask */\r
+\r
+/* BusFault Status Register (part of SCB Configurable Fault Status Register) */\r
+#define SCB_CFSR_BFARVALID_Pos            (SCB_CFSR_BUSFAULTSR_Pos + 7U)                  /*!< SCB CFSR (BFSR): BFARVALID Position */\r
+#define SCB_CFSR_BFARVALID_Msk            (1UL << SCB_CFSR_BFARVALID_Pos)                 /*!< SCB CFSR (BFSR): BFARVALID Mask */\r
+\r
+#define SCB_CFSR_LSPERR_Pos               (SCB_CFSR_BUSFAULTSR_Pos + 5U)                  /*!< SCB CFSR (BFSR): LSPERR Position */\r
+#define SCB_CFSR_LSPERR_Msk               (1UL << SCB_CFSR_LSPERR_Pos)                    /*!< SCB CFSR (BFSR): LSPERR Mask */\r
+\r
+#define SCB_CFSR_STKERR_Pos               (SCB_CFSR_BUSFAULTSR_Pos + 4U)                  /*!< SCB CFSR (BFSR): STKERR Position */\r
+#define SCB_CFSR_STKERR_Msk               (1UL << SCB_CFSR_STKERR_Pos)                    /*!< SCB CFSR (BFSR): STKERR Mask */\r
+\r
+#define SCB_CFSR_UNSTKERR_Pos             (SCB_CFSR_BUSFAULTSR_Pos + 3U)                  /*!< SCB CFSR (BFSR): UNSTKERR Position */\r
+#define SCB_CFSR_UNSTKERR_Msk             (1UL << SCB_CFSR_UNSTKERR_Pos)                  /*!< SCB CFSR (BFSR): UNSTKERR Mask */\r
+\r
+#define SCB_CFSR_IMPRECISERR_Pos          (SCB_CFSR_BUSFAULTSR_Pos + 2U)                  /*!< SCB CFSR (BFSR): IMPRECISERR Position */\r
+#define SCB_CFSR_IMPRECISERR_Msk          (1UL << SCB_CFSR_IMPRECISERR_Pos)               /*!< SCB CFSR (BFSR): IMPRECISERR Mask */\r
+\r
+#define SCB_CFSR_PRECISERR_Pos            (SCB_CFSR_BUSFAULTSR_Pos + 1U)                  /*!< SCB CFSR (BFSR): PRECISERR Position */\r
+#define SCB_CFSR_PRECISERR_Msk            (1UL << SCB_CFSR_PRECISERR_Pos)                 /*!< SCB CFSR (BFSR): PRECISERR Mask */\r
+\r
+#define SCB_CFSR_IBUSERR_Pos              (SCB_CFSR_BUSFAULTSR_Pos + 0U)                  /*!< SCB CFSR (BFSR): IBUSERR Position */\r
+#define SCB_CFSR_IBUSERR_Msk              (1UL << SCB_CFSR_IBUSERR_Pos)                   /*!< SCB CFSR (BFSR): IBUSERR Mask */\r
+\r
+/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */\r
+#define SCB_CFSR_DIVBYZERO_Pos            (SCB_CFSR_USGFAULTSR_Pos + 9U)                  /*!< SCB CFSR (UFSR): DIVBYZERO Position */\r
+#define SCB_CFSR_DIVBYZERO_Msk            (1UL << SCB_CFSR_DIVBYZERO_Pos)                 /*!< SCB CFSR (UFSR): DIVBYZERO Mask */\r
+\r
+#define SCB_CFSR_UNALIGNED_Pos            (SCB_CFSR_USGFAULTSR_Pos + 8U)                  /*!< SCB CFSR (UFSR): UNALIGNED Position */\r
+#define SCB_CFSR_UNALIGNED_Msk            (1UL << SCB_CFSR_UNALIGNED_Pos)                 /*!< SCB CFSR (UFSR): UNALIGNED Mask */\r
+\r
+#define SCB_CFSR_NOCP_Pos                 (SCB_CFSR_USGFAULTSR_Pos + 3U)                  /*!< SCB CFSR (UFSR): NOCP Position */\r
+#define SCB_CFSR_NOCP_Msk                 (1UL << SCB_CFSR_NOCP_Pos)                      /*!< SCB CFSR (UFSR): NOCP Mask */\r
+\r
+#define SCB_CFSR_INVPC_Pos                (SCB_CFSR_USGFAULTSR_Pos + 2U)                  /*!< SCB CFSR (UFSR): INVPC Position */\r
+#define SCB_CFSR_INVPC_Msk                (1UL << SCB_CFSR_INVPC_Pos)                     /*!< SCB CFSR (UFSR): INVPC Mask */\r
+\r
+#define SCB_CFSR_INVSTATE_Pos             (SCB_CFSR_USGFAULTSR_Pos + 1U)                  /*!< SCB CFSR (UFSR): INVSTATE Position */\r
+#define SCB_CFSR_INVSTATE_Msk             (1UL << SCB_CFSR_INVSTATE_Pos)                  /*!< SCB CFSR (UFSR): INVSTATE Mask */\r
+\r
+#define SCB_CFSR_UNDEFINSTR_Pos           (SCB_CFSR_USGFAULTSR_Pos + 0U)                  /*!< SCB CFSR (UFSR): UNDEFINSTR Position */\r
+#define SCB_CFSR_UNDEFINSTR_Msk           (1UL << SCB_CFSR_UNDEFINSTR_Pos)                /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */\r
+\r
+/* SCB Hard Fault Status Register Definitions */\r
+#define SCB_HFSR_DEBUGEVT_Pos              31U                                            /*!< SCB HFSR: DEBUGEVT Position */\r
+#define SCB_HFSR_DEBUGEVT_Msk              (1UL << SCB_HFSR_DEBUGEVT_Pos)                 /*!< SCB HFSR: DEBUGEVT Mask */\r
+\r
+#define SCB_HFSR_FORCED_Pos                30U                                            /*!< SCB HFSR: FORCED Position */\r
+#define SCB_HFSR_FORCED_Msk                (1UL << SCB_HFSR_FORCED_Pos)                   /*!< SCB HFSR: FORCED Mask */\r
+\r
+#define SCB_HFSR_VECTTBL_Pos                1U                                            /*!< SCB HFSR: VECTTBL Position */\r
+#define SCB_HFSR_VECTTBL_Msk               (1UL << SCB_HFSR_VECTTBL_Pos)                  /*!< SCB HFSR: VECTTBL Mask */\r
+\r
+/* SCB Debug Fault Status Register Definitions */\r
+#define SCB_DFSR_EXTERNAL_Pos               4U                                            /*!< SCB DFSR: EXTERNAL Position */\r
+#define SCB_DFSR_EXTERNAL_Msk              (1UL << SCB_DFSR_EXTERNAL_Pos)                 /*!< SCB DFSR: EXTERNAL Mask */\r
+\r
+#define SCB_DFSR_VCATCH_Pos                 3U                                            /*!< SCB DFSR: VCATCH Position */\r
+#define SCB_DFSR_VCATCH_Msk                (1UL << SCB_DFSR_VCATCH_Pos)                   /*!< SCB DFSR: VCATCH Mask */\r
+\r
+#define SCB_DFSR_DWTTRAP_Pos                2U                                            /*!< SCB DFSR: DWTTRAP Position */\r
+#define SCB_DFSR_DWTTRAP_Msk               (1UL << SCB_DFSR_DWTTRAP_Pos)                  /*!< SCB DFSR: DWTTRAP Mask */\r
+\r
+#define SCB_DFSR_BKPT_Pos                   1U                                            /*!< SCB DFSR: BKPT Position */\r
+#define SCB_DFSR_BKPT_Msk                  (1UL << SCB_DFSR_BKPT_Pos)                     /*!< SCB DFSR: BKPT Mask */\r
+\r
+#define SCB_DFSR_HALTED_Pos                 0U                                            /*!< SCB DFSR: HALTED Position */\r
+#define SCB_DFSR_HALTED_Msk                (1UL /*<< SCB_DFSR_HALTED_Pos*/)               /*!< SCB DFSR: HALTED Mask */\r
+\r
+/*@} end of group CMSIS_SCB */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB)\r
+  \brief    Type definitions for the System Control and ID Register not in the SCB\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Control and ID Register not in the SCB.\r
+ */\r
+typedef struct\r
+{\r
+        uint32_t RESERVED0[1U];\r
+  __IM  uint32_t ICTR;                   /*!< Offset: 0x004 (R/ )  Interrupt Controller Type Register */\r
+  __IOM uint32_t ACTLR;                  /*!< Offset: 0x008 (R/W)  Auxiliary Control Register */\r
+} SCnSCB_Type;\r
+\r
+/* Interrupt Controller Type Register Definitions */\r
+#define SCnSCB_ICTR_INTLINESNUM_Pos         0U                                         /*!< ICTR: INTLINESNUM Position */\r
+#define SCnSCB_ICTR_INTLINESNUM_Msk        (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/)  /*!< ICTR: INTLINESNUM Mask */\r
+\r
+/* Auxiliary Control Register Definitions */\r
+#define SCnSCB_ACTLR_DISOOFP_Pos            9U                                         /*!< ACTLR: DISOOFP Position */\r
+#define SCnSCB_ACTLR_DISOOFP_Msk           (1UL << SCnSCB_ACTLR_DISOOFP_Pos)           /*!< ACTLR: DISOOFP Mask */\r
+\r
+#define SCnSCB_ACTLR_DISFPCA_Pos            8U                                         /*!< ACTLR: DISFPCA Position */\r
+#define SCnSCB_ACTLR_DISFPCA_Msk           (1UL << SCnSCB_ACTLR_DISFPCA_Pos)           /*!< ACTLR: DISFPCA Mask */\r
+\r
+#define SCnSCB_ACTLR_DISFOLD_Pos            2U                                         /*!< ACTLR: DISFOLD Position */\r
+#define SCnSCB_ACTLR_DISFOLD_Msk           (1UL << SCnSCB_ACTLR_DISFOLD_Pos)           /*!< ACTLR: DISFOLD Mask */\r
+\r
+#define SCnSCB_ACTLR_DISDEFWBUF_Pos         1U                                         /*!< ACTLR: DISDEFWBUF Position */\r
+#define SCnSCB_ACTLR_DISDEFWBUF_Msk        (1UL << SCnSCB_ACTLR_DISDEFWBUF_Pos)        /*!< ACTLR: DISDEFWBUF Mask */\r
+\r
+#define SCnSCB_ACTLR_DISMCYCINT_Pos         0U                                         /*!< ACTLR: DISMCYCINT Position */\r
+#define SCnSCB_ACTLR_DISMCYCINT_Msk        (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/)    /*!< ACTLR: DISMCYCINT Mask */\r
+\r
+/*@} end of group CMSIS_SCnotSCB */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SysTick     System Tick Timer (SysTick)\r
+  \brief    Type definitions for the System Timer Registers.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Timer (SysTick).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  SysTick Control and Status Register */\r
+  __IOM uint32_t LOAD;                   /*!< Offset: 0x004 (R/W)  SysTick Reload Value Register */\r
+  __IOM uint32_t VAL;                    /*!< Offset: 0x008 (R/W)  SysTick Current Value Register */\r
+  __IM  uint32_t CALIB;                  /*!< Offset: 0x00C (R/ )  SysTick Calibration Register */\r
+} SysTick_Type;\r
+\r
+/* SysTick Control / Status Register Definitions */\r
+#define SysTick_CTRL_COUNTFLAG_Pos         16U                                            /*!< SysTick CTRL: COUNTFLAG Position */\r
+#define SysTick_CTRL_COUNTFLAG_Msk         (1UL << SysTick_CTRL_COUNTFLAG_Pos)            /*!< SysTick CTRL: COUNTFLAG Mask */\r
+\r
+#define SysTick_CTRL_CLKSOURCE_Pos          2U                                            /*!< SysTick CTRL: CLKSOURCE Position */\r
+#define SysTick_CTRL_CLKSOURCE_Msk         (1UL << SysTick_CTRL_CLKSOURCE_Pos)            /*!< SysTick CTRL: CLKSOURCE Mask */\r
+\r
+#define SysTick_CTRL_TICKINT_Pos            1U                                            /*!< SysTick CTRL: TICKINT Position */\r
+#define SysTick_CTRL_TICKINT_Msk           (1UL << SysTick_CTRL_TICKINT_Pos)              /*!< SysTick CTRL: TICKINT Mask */\r
+\r
+#define SysTick_CTRL_ENABLE_Pos             0U                                            /*!< SysTick CTRL: ENABLE Position */\r
+#define SysTick_CTRL_ENABLE_Msk            (1UL /*<< SysTick_CTRL_ENABLE_Pos*/)           /*!< SysTick CTRL: ENABLE Mask */\r
+\r
+/* SysTick Reload Register Definitions */\r
+#define SysTick_LOAD_RELOAD_Pos             0U                                            /*!< SysTick LOAD: RELOAD Position */\r
+#define SysTick_LOAD_RELOAD_Msk            (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/)    /*!< SysTick LOAD: RELOAD Mask */\r
+\r
+/* SysTick Current Register Definitions */\r
+#define SysTick_VAL_CURRENT_Pos             0U                                            /*!< SysTick VAL: CURRENT Position */\r
+#define SysTick_VAL_CURRENT_Msk            (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/)    /*!< SysTick VAL: CURRENT Mask */\r
+\r
+/* SysTick Calibration Register Definitions */\r
+#define SysTick_CALIB_NOREF_Pos            31U                                            /*!< SysTick CALIB: NOREF Position */\r
+#define SysTick_CALIB_NOREF_Msk            (1UL << SysTick_CALIB_NOREF_Pos)               /*!< SysTick CALIB: NOREF Mask */\r
+\r
+#define SysTick_CALIB_SKEW_Pos             30U                                            /*!< SysTick CALIB: SKEW Position */\r
+#define SysTick_CALIB_SKEW_Msk             (1UL << SysTick_CALIB_SKEW_Pos)                /*!< SysTick CALIB: SKEW Mask */\r
+\r
+#define SysTick_CALIB_TENMS_Pos             0U                                            /*!< SysTick CALIB: TENMS Position */\r
+#define SysTick_CALIB_TENMS_Msk            (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/)    /*!< SysTick CALIB: TENMS Mask */\r
+\r
+/*@} end of group CMSIS_SysTick */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_ITM     Instrumentation Trace Macrocell (ITM)\r
+  \brief    Type definitions for the Instrumentation Trace Macrocell (ITM)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Instrumentation Trace Macrocell Register (ITM).\r
+ */\r
+typedef struct\r
+{\r
+  __OM  union\r
+  {\r
+    __OM  uint8_t    u8;                 /*!< Offset: 0x000 ( /W)  ITM Stimulus Port 8-bit */\r
+    __OM  uint16_t   u16;                /*!< Offset: 0x000 ( /W)  ITM Stimulus Port 16-bit */\r
+    __OM  uint32_t   u32;                /*!< Offset: 0x000 ( /W)  ITM Stimulus Port 32-bit */\r
+  }  PORT [32U];                         /*!< Offset: 0x000 ( /W)  ITM Stimulus Port Registers */\r
+        uint32_t RESERVED0[864U];\r
+  __IOM uint32_t TER;                    /*!< Offset: 0xE00 (R/W)  ITM Trace Enable Register */\r
+        uint32_t RESERVED1[15U];\r
+  __IOM uint32_t TPR;                    /*!< Offset: 0xE40 (R/W)  ITM Trace Privilege Register */\r
+        uint32_t RESERVED2[15U];\r
+  __IOM uint32_t TCR;                    /*!< Offset: 0xE80 (R/W)  ITM Trace Control Register */\r
+        uint32_t RESERVED3[29U];\r
+  __OM  uint32_t IWR;                    /*!< Offset: 0xEF8 ( /W)  ITM Integration Write Register */\r
+  __IM  uint32_t IRR;                    /*!< Offset: 0xEFC (R/ )  ITM Integration Read Register */\r
+  __IOM uint32_t IMCR;                   /*!< Offset: 0xF00 (R/W)  ITM Integration Mode Control Register */\r
+        uint32_t RESERVED4[43U];\r
+  __OM  uint32_t LAR;                    /*!< Offset: 0xFB0 ( /W)  ITM Lock Access Register */\r
+  __IM  uint32_t LSR;                    /*!< Offset: 0xFB4 (R/ )  ITM Lock Status Register */\r
+        uint32_t RESERVED5[6U];\r
+  __IM  uint32_t PID4;                   /*!< Offset: 0xFD0 (R/ )  ITM Peripheral Identification Register #4 */\r
+  __IM  uint32_t PID5;                   /*!< Offset: 0xFD4 (R/ )  ITM Peripheral Identification Register #5 */\r
+  __IM  uint32_t PID6;                   /*!< Offset: 0xFD8 (R/ )  ITM Peripheral Identification Register #6 */\r
+  __IM  uint32_t PID7;                   /*!< Offset: 0xFDC (R/ )  ITM Peripheral Identification Register #7 */\r
+  __IM  uint32_t PID0;                   /*!< Offset: 0xFE0 (R/ )  ITM Peripheral Identification Register #0 */\r
+  __IM  uint32_t PID1;                   /*!< Offset: 0xFE4 (R/ )  ITM Peripheral Identification Register #1 */\r
+  __IM  uint32_t PID2;                   /*!< Offset: 0xFE8 (R/ )  ITM Peripheral Identification Register #2 */\r
+  __IM  uint32_t PID3;                   /*!< Offset: 0xFEC (R/ )  ITM Peripheral Identification Register #3 */\r
+  __IM  uint32_t CID0;                   /*!< Offset: 0xFF0 (R/ )  ITM Component  Identification Register #0 */\r
+  __IM  uint32_t CID1;                   /*!< Offset: 0xFF4 (R/ )  ITM Component  Identification Register #1 */\r
+  __IM  uint32_t CID2;                   /*!< Offset: 0xFF8 (R/ )  ITM Component  Identification Register #2 */\r
+  __IM  uint32_t CID3;                   /*!< Offset: 0xFFC (R/ )  ITM Component  Identification Register #3 */\r
+} ITM_Type;\r
+\r
+/* ITM Trace Privilege Register Definitions */\r
+#define ITM_TPR_PRIVMASK_Pos                0U                                            /*!< ITM TPR: PRIVMASK Position */\r
+#define ITM_TPR_PRIVMASK_Msk               (0xFFFFFFFFUL /*<< ITM_TPR_PRIVMASK_Pos*/)     /*!< ITM TPR: PRIVMASK Mask */\r
+\r
+/* ITM Trace Control Register Definitions */\r
+#define ITM_TCR_BUSY_Pos                   23U                                            /*!< ITM TCR: BUSY Position */\r
+#define ITM_TCR_BUSY_Msk                   (1UL << ITM_TCR_BUSY_Pos)                      /*!< ITM TCR: BUSY Mask */\r
+\r
+#define ITM_TCR_TraceBusID_Pos             16U                                            /*!< ITM TCR: ATBID Position */\r
+#define ITM_TCR_TraceBusID_Msk             (0x7FUL << ITM_TCR_TraceBusID_Pos)             /*!< ITM TCR: ATBID Mask */\r
+\r
+#define ITM_TCR_GTSFREQ_Pos                10U                                            /*!< ITM TCR: Global timestamp frequency Position */\r
+#define ITM_TCR_GTSFREQ_Msk                (3UL << ITM_TCR_GTSFREQ_Pos)                   /*!< ITM TCR: Global timestamp frequency Mask */\r
+\r
+#define ITM_TCR_TSPrescale_Pos              8U                                            /*!< ITM TCR: TSPrescale Position */\r
+#define ITM_TCR_TSPrescale_Msk             (3UL << ITM_TCR_TSPrescale_Pos)                /*!< ITM TCR: TSPrescale Mask */\r
+\r
+#define ITM_TCR_SWOENA_Pos                  4U                                            /*!< ITM TCR: SWOENA Position */\r
+#define ITM_TCR_SWOENA_Msk                 (1UL << ITM_TCR_SWOENA_Pos)                    /*!< ITM TCR: SWOENA Mask */\r
+\r
+#define ITM_TCR_DWTENA_Pos                  3U                                            /*!< ITM TCR: DWTENA Position */\r
+#define ITM_TCR_DWTENA_Msk                 (1UL << ITM_TCR_DWTENA_Pos)                    /*!< ITM TCR: DWTENA Mask */\r
+\r
+#define ITM_TCR_SYNCENA_Pos                 2U                                            /*!< ITM TCR: SYNCENA Position */\r
+#define ITM_TCR_SYNCENA_Msk                (1UL << ITM_TCR_SYNCENA_Pos)                   /*!< ITM TCR: SYNCENA Mask */\r
+\r
+#define ITM_TCR_TSENA_Pos                   1U                                            /*!< ITM TCR: TSENA Position */\r
+#define ITM_TCR_TSENA_Msk                  (1UL << ITM_TCR_TSENA_Pos)                     /*!< ITM TCR: TSENA Mask */\r
+\r
+#define ITM_TCR_ITMENA_Pos                  0U                                            /*!< ITM TCR: ITM Enable bit Position */\r
+#define ITM_TCR_ITMENA_Msk                 (1UL /*<< ITM_TCR_ITMENA_Pos*/)                /*!< ITM TCR: ITM Enable bit Mask */\r
+\r
+/* ITM Integration Write Register Definitions */\r
+#define ITM_IWR_ATVALIDM_Pos                0U                                            /*!< ITM IWR: ATVALIDM Position */\r
+#define ITM_IWR_ATVALIDM_Msk               (1UL /*<< ITM_IWR_ATVALIDM_Pos*/)              /*!< ITM IWR: ATVALIDM Mask */\r
+\r
+/* ITM Integration Read Register Definitions */\r
+#define ITM_IRR_ATREADYM_Pos                0U                                            /*!< ITM IRR: ATREADYM Position */\r
+#define ITM_IRR_ATREADYM_Msk               (1UL /*<< ITM_IRR_ATREADYM_Pos*/)              /*!< ITM IRR: ATREADYM Mask */\r
+\r
+/* ITM Integration Mode Control Register Definitions */\r
+#define ITM_IMCR_INTEGRATION_Pos            0U                                            /*!< ITM IMCR: INTEGRATION Position */\r
+#define ITM_IMCR_INTEGRATION_Msk           (1UL /*<< ITM_IMCR_INTEGRATION_Pos*/)          /*!< ITM IMCR: INTEGRATION Mask */\r
+\r
+/* ITM Lock Status Register Definitions */\r
+#define ITM_LSR_ByteAcc_Pos                 2U                                            /*!< ITM LSR: ByteAcc Position */\r
+#define ITM_LSR_ByteAcc_Msk                (1UL << ITM_LSR_ByteAcc_Pos)                   /*!< ITM LSR: ByteAcc Mask */\r
+\r
+#define ITM_LSR_Access_Pos                  1U                                            /*!< ITM LSR: Access Position */\r
+#define ITM_LSR_Access_Msk                 (1UL << ITM_LSR_Access_Pos)                    /*!< ITM LSR: Access Mask */\r
+\r
+#define ITM_LSR_Present_Pos                 0U                                            /*!< ITM LSR: Present Position */\r
+#define ITM_LSR_Present_Msk                (1UL /*<< ITM_LSR_Present_Pos*/)               /*!< ITM LSR: Present Mask */\r
+\r
+/*@}*/ /* end of group CMSIS_ITM */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_DWT     Data Watchpoint and Trace (DWT)\r
+  \brief    Type definitions for the Data Watchpoint and Trace (DWT)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Data Watchpoint and Trace Register (DWT).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  Control Register */\r
+  __IOM uint32_t CYCCNT;                 /*!< Offset: 0x004 (R/W)  Cycle Count Register */\r
+  __IOM uint32_t CPICNT;                 /*!< Offset: 0x008 (R/W)  CPI Count Register */\r
+  __IOM uint32_t EXCCNT;                 /*!< Offset: 0x00C (R/W)  Exception Overhead Count Register */\r
+  __IOM uint32_t SLEEPCNT;               /*!< Offset: 0x010 (R/W)  Sleep Count Register */\r
+  __IOM uint32_t LSUCNT;                 /*!< Offset: 0x014 (R/W)  LSU Count Register */\r
+  __IOM uint32_t FOLDCNT;                /*!< Offset: 0x018 (R/W)  Folded-instruction Count Register */\r
+  __IM  uint32_t PCSR;                   /*!< Offset: 0x01C (R/ )  Program Counter Sample Register */\r
+  __IOM uint32_t COMP0;                  /*!< Offset: 0x020 (R/W)  Comparator Register 0 */\r
+  __IOM uint32_t MASK0;                  /*!< Offset: 0x024 (R/W)  Mask Register 0 */\r
+  __IOM uint32_t FUNCTION0;              /*!< Offset: 0x028 (R/W)  Function Register 0 */\r
+        uint32_t RESERVED0[1U];\r
+  __IOM uint32_t COMP1;                  /*!< Offset: 0x030 (R/W)  Comparator Register 1 */\r
+  __IOM uint32_t MASK1;                  /*!< Offset: 0x034 (R/W)  Mask Register 1 */\r
+  __IOM uint32_t FUNCTION1;              /*!< Offset: 0x038 (R/W)  Function Register 1 */\r
+        uint32_t RESERVED1[1U];\r
+  __IOM uint32_t COMP2;                  /*!< Offset: 0x040 (R/W)  Comparator Register 2 */\r
+  __IOM uint32_t MASK2;                  /*!< Offset: 0x044 (R/W)  Mask Register 2 */\r
+  __IOM uint32_t FUNCTION2;              /*!< Offset: 0x048 (R/W)  Function Register 2 */\r
+        uint32_t RESERVED2[1U];\r
+  __IOM uint32_t COMP3;                  /*!< Offset: 0x050 (R/W)  Comparator Register 3 */\r
+  __IOM uint32_t MASK3;                  /*!< Offset: 0x054 (R/W)  Mask Register 3 */\r
+  __IOM uint32_t FUNCTION3;              /*!< Offset: 0x058 (R/W)  Function Register 3 */\r
+} DWT_Type;\r
+\r
+/* DWT Control Register Definitions */\r
+#define DWT_CTRL_NUMCOMP_Pos               28U                                         /*!< DWT CTRL: NUMCOMP Position */\r
+#define DWT_CTRL_NUMCOMP_Msk               (0xFUL << DWT_CTRL_NUMCOMP_Pos)             /*!< DWT CTRL: NUMCOMP Mask */\r
+\r
+#define DWT_CTRL_NOTRCPKT_Pos              27U                                         /*!< DWT CTRL: NOTRCPKT Position */\r
+#define DWT_CTRL_NOTRCPKT_Msk              (0x1UL << DWT_CTRL_NOTRCPKT_Pos)            /*!< DWT CTRL: NOTRCPKT Mask */\r
+\r
+#define DWT_CTRL_NOEXTTRIG_Pos             26U                                         /*!< DWT CTRL: NOEXTTRIG Position */\r
+#define DWT_CTRL_NOEXTTRIG_Msk             (0x1UL << DWT_CTRL_NOEXTTRIG_Pos)           /*!< DWT CTRL: NOEXTTRIG Mask */\r
+\r
+#define DWT_CTRL_NOCYCCNT_Pos              25U                                         /*!< DWT CTRL: NOCYCCNT Position */\r
+#define DWT_CTRL_NOCYCCNT_Msk              (0x1UL << DWT_CTRL_NOCYCCNT_Pos)            /*!< DWT CTRL: NOCYCCNT Mask */\r
+\r
+#define DWT_CTRL_NOPRFCNT_Pos              24U                                         /*!< DWT CTRL: NOPRFCNT Position */\r
+#define DWT_CTRL_NOPRFCNT_Msk              (0x1UL << DWT_CTRL_NOPRFCNT_Pos)            /*!< DWT CTRL: NOPRFCNT Mask */\r
+\r
+#define DWT_CTRL_CYCEVTENA_Pos             22U                                         /*!< DWT CTRL: CYCEVTENA Position */\r
+#define DWT_CTRL_CYCEVTENA_Msk             (0x1UL << DWT_CTRL_CYCEVTENA_Pos)           /*!< DWT CTRL: CYCEVTENA Mask */\r
+\r
+#define DWT_CTRL_FOLDEVTENA_Pos            21U                                         /*!< DWT CTRL: FOLDEVTENA Position */\r
+#define DWT_CTRL_FOLDEVTENA_Msk            (0x1UL << DWT_CTRL_FOLDEVTENA_Pos)          /*!< DWT CTRL: FOLDEVTENA Mask */\r
+\r
+#define DWT_CTRL_LSUEVTENA_Pos             20U                                         /*!< DWT CTRL: LSUEVTENA Position */\r
+#define DWT_CTRL_LSUEVTENA_Msk             (0x1UL << DWT_CTRL_LSUEVTENA_Pos)           /*!< DWT CTRL: LSUEVTENA Mask */\r
+\r
+#define DWT_CTRL_SLEEPEVTENA_Pos           19U                                         /*!< DWT CTRL: SLEEPEVTENA Position */\r
+#define DWT_CTRL_SLEEPEVTENA_Msk           (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos)         /*!< DWT CTRL: SLEEPEVTENA Mask */\r
+\r
+#define DWT_CTRL_EXCEVTENA_Pos             18U                                         /*!< DWT CTRL: EXCEVTENA Position */\r
+#define DWT_CTRL_EXCEVTENA_Msk             (0x1UL << DWT_CTRL_EXCEVTENA_Pos)           /*!< DWT CTRL: EXCEVTENA Mask */\r
+\r
+#define DWT_CTRL_CPIEVTENA_Pos             17U                                         /*!< DWT CTRL: CPIEVTENA Position */\r
+#define DWT_CTRL_CPIEVTENA_Msk             (0x1UL << DWT_CTRL_CPIEVTENA_Pos)           /*!< DWT CTRL: CPIEVTENA Mask */\r
+\r
+#define DWT_CTRL_EXCTRCENA_Pos             16U                                         /*!< DWT CTRL: EXCTRCENA Position */\r
+#define DWT_CTRL_EXCTRCENA_Msk             (0x1UL << DWT_CTRL_EXCTRCENA_Pos)           /*!< DWT CTRL: EXCTRCENA Mask */\r
+\r
+#define DWT_CTRL_PCSAMPLENA_Pos            12U                                         /*!< DWT CTRL: PCSAMPLENA Position */\r
+#define DWT_CTRL_PCSAMPLENA_Msk            (0x1UL << DWT_CTRL_PCSAMPLENA_Pos)          /*!< DWT CTRL: PCSAMPLENA Mask */\r
+\r
+#define DWT_CTRL_SYNCTAP_Pos               10U                                         /*!< DWT CTRL: SYNCTAP Position */\r
+#define DWT_CTRL_SYNCTAP_Msk               (0x3UL << DWT_CTRL_SYNCTAP_Pos)             /*!< DWT CTRL: SYNCTAP Mask */\r
+\r
+#define DWT_CTRL_CYCTAP_Pos                 9U                                         /*!< DWT CTRL: CYCTAP Position */\r
+#define DWT_CTRL_CYCTAP_Msk                (0x1UL << DWT_CTRL_CYCTAP_Pos)              /*!< DWT CTRL: CYCTAP Mask */\r
+\r
+#define DWT_CTRL_POSTINIT_Pos               5U                                         /*!< DWT CTRL: POSTINIT Position */\r
+#define DWT_CTRL_POSTINIT_Msk              (0xFUL << DWT_CTRL_POSTINIT_Pos)            /*!< DWT CTRL: POSTINIT Mask */\r
+\r
+#define DWT_CTRL_POSTPRESET_Pos             1U                                         /*!< DWT CTRL: POSTPRESET Position */\r
+#define DWT_CTRL_POSTPRESET_Msk            (0xFUL << DWT_CTRL_POSTPRESET_Pos)          /*!< DWT CTRL: POSTPRESET Mask */\r
+\r
+#define DWT_CTRL_CYCCNTENA_Pos              0U                                         /*!< DWT CTRL: CYCCNTENA Position */\r
+#define DWT_CTRL_CYCCNTENA_Msk             (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/)       /*!< DWT CTRL: CYCCNTENA Mask */\r
+\r
+/* DWT CPI Count Register Definitions */\r
+#define DWT_CPICNT_CPICNT_Pos               0U                                         /*!< DWT CPICNT: CPICNT Position */\r
+#define DWT_CPICNT_CPICNT_Msk              (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/)       /*!< DWT CPICNT: CPICNT Mask */\r
+\r
+/* DWT Exception Overhead Count Register Definitions */\r
+#define DWT_EXCCNT_EXCCNT_Pos               0U                                         /*!< DWT EXCCNT: EXCCNT Position */\r
+#define DWT_EXCCNT_EXCCNT_Msk              (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/)       /*!< DWT EXCCNT: EXCCNT Mask */\r
+\r
+/* DWT Sleep Count Register Definitions */\r
+#define DWT_SLEEPCNT_SLEEPCNT_Pos           0U                                         /*!< DWT SLEEPCNT: SLEEPCNT Position */\r
+#define DWT_SLEEPCNT_SLEEPCNT_Msk          (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/)   /*!< DWT SLEEPCNT: SLEEPCNT Mask */\r
+\r
+/* DWT LSU Count Register Definitions */\r
+#define DWT_LSUCNT_LSUCNT_Pos               0U                                         /*!< DWT LSUCNT: LSUCNT Position */\r
+#define DWT_LSUCNT_LSUCNT_Msk              (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/)       /*!< DWT LSUCNT: LSUCNT Mask */\r
+\r
+/* DWT Folded-instruction Count Register Definitions */\r
+#define DWT_FOLDCNT_FOLDCNT_Pos             0U                                         /*!< DWT FOLDCNT: FOLDCNT Position */\r
+#define DWT_FOLDCNT_FOLDCNT_Msk            (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/)     /*!< DWT FOLDCNT: FOLDCNT Mask */\r
+\r
+/* DWT Comparator Mask Register Definitions */\r
+#define DWT_MASK_MASK_Pos                   0U                                         /*!< DWT MASK: MASK Position */\r
+#define DWT_MASK_MASK_Msk                  (0x1FUL /*<< DWT_MASK_MASK_Pos*/)           /*!< DWT MASK: MASK Mask */\r
+\r
+/* DWT Comparator Function Register Definitions */\r
+#define DWT_FUNCTION_MATCHED_Pos           24U                                         /*!< DWT FUNCTION: MATCHED Position */\r
+#define DWT_FUNCTION_MATCHED_Msk           (0x1UL << DWT_FUNCTION_MATCHED_Pos)         /*!< DWT FUNCTION: MATCHED Mask */\r
+\r
+#define DWT_FUNCTION_DATAVADDR1_Pos        16U                                         /*!< DWT FUNCTION: DATAVADDR1 Position */\r
+#define DWT_FUNCTION_DATAVADDR1_Msk        (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos)      /*!< DWT FUNCTION: DATAVADDR1 Mask */\r
+\r
+#define DWT_FUNCTION_DATAVADDR0_Pos        12U                                         /*!< DWT FUNCTION: DATAVADDR0 Position */\r
+#define DWT_FUNCTION_DATAVADDR0_Msk        (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos)      /*!< DWT FUNCTION: DATAVADDR0 Mask */\r
+\r
+#define DWT_FUNCTION_DATAVSIZE_Pos         10U                                         /*!< DWT FUNCTION: DATAVSIZE Position */\r
+#define DWT_FUNCTION_DATAVSIZE_Msk         (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos)       /*!< DWT FUNCTION: DATAVSIZE Mask */\r
+\r
+#define DWT_FUNCTION_LNK1ENA_Pos            9U                                         /*!< DWT FUNCTION: LNK1ENA Position */\r
+#define DWT_FUNCTION_LNK1ENA_Msk           (0x1UL << DWT_FUNCTION_LNK1ENA_Pos)         /*!< DWT FUNCTION: LNK1ENA Mask */\r
+\r
+#define DWT_FUNCTION_DATAVMATCH_Pos         8U                                         /*!< DWT FUNCTION: DATAVMATCH Position */\r
+#define DWT_FUNCTION_DATAVMATCH_Msk        (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos)      /*!< DWT FUNCTION: DATAVMATCH Mask */\r
+\r
+#define DWT_FUNCTION_CYCMATCH_Pos           7U                                         /*!< DWT FUNCTION: CYCMATCH Position */\r
+#define DWT_FUNCTION_CYCMATCH_Msk          (0x1UL << DWT_FUNCTION_CYCMATCH_Pos)        /*!< DWT FUNCTION: CYCMATCH Mask */\r
+\r
+#define DWT_FUNCTION_EMITRANGE_Pos          5U                                         /*!< DWT FUNCTION: EMITRANGE Position */\r
+#define DWT_FUNCTION_EMITRANGE_Msk         (0x1UL << DWT_FUNCTION_EMITRANGE_Pos)       /*!< DWT FUNCTION: EMITRANGE Mask */\r
+\r
+#define DWT_FUNCTION_FUNCTION_Pos           0U                                         /*!< DWT FUNCTION: FUNCTION Position */\r
+#define DWT_FUNCTION_FUNCTION_Msk          (0xFUL /*<< DWT_FUNCTION_FUNCTION_Pos*/)    /*!< DWT FUNCTION: FUNCTION Mask */\r
+\r
+/*@}*/ /* end of group CMSIS_DWT */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_TPI     Trace Port Interface (TPI)\r
+  \brief    Type definitions for the Trace Port Interface (TPI)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Trace Port Interface Register (TPI).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t SSPSR;                  /*!< Offset: 0x000 (R/ )  Supported Parallel Port Size Register */\r
+  __IOM uint32_t CSPSR;                  /*!< Offset: 0x004 (R/W)  Current Parallel Port Size Register */\r
+        uint32_t RESERVED0[2U];\r
+  __IOM uint32_t ACPR;                   /*!< Offset: 0x010 (R/W)  Asynchronous Clock Prescaler Register */\r
+        uint32_t RESERVED1[55U];\r
+  __IOM uint32_t SPPR;                   /*!< Offset: 0x0F0 (R/W)  Selected Pin Protocol Register */\r
+        uint32_t RESERVED2[131U];\r
+  __IM  uint32_t FFSR;                   /*!< Offset: 0x300 (R/ )  Formatter and Flush Status Register */\r
+  __IOM uint32_t FFCR;                   /*!< Offset: 0x304 (R/W)  Formatter and Flush Control Register */\r
+  __IM  uint32_t FSCR;                   /*!< Offset: 0x308 (R/ )  Formatter Synchronization Counter Register */\r
+        uint32_t RESERVED3[759U];\r
+  __IM  uint32_t TRIGGER;                /*!< Offset: 0xEE8 (R/ )  TRIGGER Register */\r
+  __IM  uint32_t FIFO0;                  /*!< Offset: 0xEEC (R/ )  Integration ETM Data */\r
+  __IM  uint32_t ITATBCTR2;              /*!< Offset: 0xEF0 (R/ )  ITATBCTR2 */\r
+        uint32_t RESERVED4[1U];\r
+  __IM  uint32_t ITATBCTR0;              /*!< Offset: 0xEF8 (R/ )  ITATBCTR0 */\r
+  __IM  uint32_t FIFO1;                  /*!< Offset: 0xEFC (R/ )  Integration ITM Data */\r
+  __IOM uint32_t ITCTRL;                 /*!< Offset: 0xF00 (R/W)  Integration Mode Control */\r
+        uint32_t RESERVED5[39U];\r
+  __IOM uint32_t CLAIMSET;               /*!< Offset: 0xFA0 (R/W)  Claim tag set */\r
+  __IOM uint32_t CLAIMCLR;               /*!< Offset: 0xFA4 (R/W)  Claim tag clear */\r
+        uint32_t RESERVED7[8U];\r
+  __IM  uint32_t DEVID;                  /*!< Offset: 0xFC8 (R/ )  TPIU_DEVID */\r
+  __IM  uint32_t DEVTYPE;                /*!< Offset: 0xFCC (R/ )  TPIU_DEVTYPE */\r
+} TPI_Type;\r
+\r
+/* TPI Asynchronous Clock Prescaler Register Definitions */\r
+#define TPI_ACPR_PRESCALER_Pos              0U                                         /*!< TPI ACPR: PRESCALER Position */\r
+#define TPI_ACPR_PRESCALER_Msk             (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/)    /*!< TPI ACPR: PRESCALER Mask */\r
+\r
+/* TPI Selected Pin Protocol Register Definitions */\r
+#define TPI_SPPR_TXMODE_Pos                 0U                                         /*!< TPI SPPR: TXMODE Position */\r
+#define TPI_SPPR_TXMODE_Msk                (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/)          /*!< TPI SPPR: TXMODE Mask */\r
+\r
+/* TPI Formatter and Flush Status Register Definitions */\r
+#define TPI_FFSR_FtNonStop_Pos              3U                                         /*!< TPI FFSR: FtNonStop Position */\r
+#define TPI_FFSR_FtNonStop_Msk             (0x1UL << TPI_FFSR_FtNonStop_Pos)           /*!< TPI FFSR: FtNonStop Mask */\r
+\r
+#define TPI_FFSR_TCPresent_Pos              2U                                         /*!< TPI FFSR: TCPresent Position */\r
+#define TPI_FFSR_TCPresent_Msk             (0x1UL << TPI_FFSR_TCPresent_Pos)           /*!< TPI FFSR: TCPresent Mask */\r
+\r
+#define TPI_FFSR_FtStopped_Pos              1U                                         /*!< TPI FFSR: FtStopped Position */\r
+#define TPI_FFSR_FtStopped_Msk             (0x1UL << TPI_FFSR_FtStopped_Pos)           /*!< TPI FFSR: FtStopped Mask */\r
+\r
+#define TPI_FFSR_FlInProg_Pos               0U                                         /*!< TPI FFSR: FlInProg Position */\r
+#define TPI_FFSR_FlInProg_Msk              (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/)        /*!< TPI FFSR: FlInProg Mask */\r
+\r
+/* TPI Formatter and Flush Control Register Definitions */\r
+#define TPI_FFCR_TrigIn_Pos                 8U                                         /*!< TPI FFCR: TrigIn Position */\r
+#define TPI_FFCR_TrigIn_Msk                (0x1UL << TPI_FFCR_TrigIn_Pos)              /*!< TPI FFCR: TrigIn Mask */\r
+\r
+#define TPI_FFCR_EnFCont_Pos                1U                                         /*!< TPI FFCR: EnFCont Position */\r
+#define TPI_FFCR_EnFCont_Msk               (0x1UL << TPI_FFCR_EnFCont_Pos)             /*!< TPI FFCR: EnFCont Mask */\r
+\r
+/* TPI TRIGGER Register Definitions */\r
+#define TPI_TRIGGER_TRIGGER_Pos             0U                                         /*!< TPI TRIGGER: TRIGGER Position */\r
+#define TPI_TRIGGER_TRIGGER_Msk            (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/)      /*!< TPI TRIGGER: TRIGGER Mask */\r
+\r
+/* TPI Integration ETM Data Register Definitions (FIFO0) */\r
+#define TPI_FIFO0_ITM_ATVALID_Pos          29U                                         /*!< TPI FIFO0: ITM_ATVALID Position */\r
+#define TPI_FIFO0_ITM_ATVALID_Msk          (0x3UL << TPI_FIFO0_ITM_ATVALID_Pos)        /*!< TPI FIFO0: ITM_ATVALID Mask */\r
+\r
+#define TPI_FIFO0_ITM_bytecount_Pos        27U                                         /*!< TPI FIFO0: ITM_bytecount Position */\r
+#define TPI_FIFO0_ITM_bytecount_Msk        (0x3UL << TPI_FIFO0_ITM_bytecount_Pos)      /*!< TPI FIFO0: ITM_bytecount Mask */\r
+\r
+#define TPI_FIFO0_ETM_ATVALID_Pos          26U                                         /*!< TPI FIFO0: ETM_ATVALID Position */\r
+#define TPI_FIFO0_ETM_ATVALID_Msk          (0x3UL << TPI_FIFO0_ETM_ATVALID_Pos)        /*!< TPI FIFO0: ETM_ATVALID Mask */\r
+\r
+#define TPI_FIFO0_ETM_bytecount_Pos        24U                                         /*!< TPI FIFO0: ETM_bytecount Position */\r
+#define TPI_FIFO0_ETM_bytecount_Msk        (0x3UL << TPI_FIFO0_ETM_bytecount_Pos)      /*!< TPI FIFO0: ETM_bytecount Mask */\r
+\r
+#define TPI_FIFO0_ETM2_Pos                 16U                                         /*!< TPI FIFO0: ETM2 Position */\r
+#define TPI_FIFO0_ETM2_Msk                 (0xFFUL << TPI_FIFO0_ETM2_Pos)              /*!< TPI FIFO0: ETM2 Mask */\r
+\r
+#define TPI_FIFO0_ETM1_Pos                  8U                                         /*!< TPI FIFO0: ETM1 Position */\r
+#define TPI_FIFO0_ETM1_Msk                 (0xFFUL << TPI_FIFO0_ETM1_Pos)              /*!< TPI FIFO0: ETM1 Mask */\r
+\r
+#define TPI_FIFO0_ETM0_Pos                  0U                                         /*!< TPI FIFO0: ETM0 Position */\r
+#define TPI_FIFO0_ETM0_Msk                 (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/)          /*!< TPI FIFO0: ETM0 Mask */\r
+\r
+/* TPI ITATBCTR2 Register Definitions */\r
+#define TPI_ITATBCTR2_ATREADY2_Pos          0U                                         /*!< TPI ITATBCTR2: ATREADY2 Position */\r
+#define TPI_ITATBCTR2_ATREADY2_Msk         (0x1UL /*<< TPI_ITATBCTR2_ATREADY2_Pos*/)   /*!< TPI ITATBCTR2: ATREADY2 Mask */\r
+\r
+#define TPI_ITATBCTR2_ATREADY1_Pos          0U                                         /*!< TPI ITATBCTR2: ATREADY1 Position */\r
+#define TPI_ITATBCTR2_ATREADY1_Msk         (0x1UL /*<< TPI_ITATBCTR2_ATREADY1_Pos*/)   /*!< TPI ITATBCTR2: ATREADY1 Mask */\r
+\r
+/* TPI Integration ITM Data Register Definitions (FIFO1) */\r
+#define TPI_FIFO1_ITM_ATVALID_Pos          29U                                         /*!< TPI FIFO1: ITM_ATVALID Position */\r
+#define TPI_FIFO1_ITM_ATVALID_Msk          (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos)        /*!< TPI FIFO1: ITM_ATVALID Mask */\r
+\r
+#define TPI_FIFO1_ITM_bytecount_Pos        27U                                         /*!< TPI FIFO1: ITM_bytecount Position */\r
+#define TPI_FIFO1_ITM_bytecount_Msk        (0x3UL << TPI_FIFO1_ITM_bytecount_Pos)      /*!< TPI FIFO1: ITM_bytecount Mask */\r
+\r
+#define TPI_FIFO1_ETM_ATVALID_Pos          26U                                         /*!< TPI FIFO1: ETM_ATVALID Position */\r
+#define TPI_FIFO1_ETM_ATVALID_Msk          (0x3UL << TPI_FIFO1_ETM_ATVALID_Pos)        /*!< TPI FIFO1: ETM_ATVALID Mask */\r
+\r
+#define TPI_FIFO1_ETM_bytecount_Pos        24U                                         /*!< TPI FIFO1: ETM_bytecount Position */\r
+#define TPI_FIFO1_ETM_bytecount_Msk        (0x3UL << TPI_FIFO1_ETM_bytecount_Pos)      /*!< TPI FIFO1: ETM_bytecount Mask */\r
+\r
+#define TPI_FIFO1_ITM2_Pos                 16U                                         /*!< TPI FIFO1: ITM2 Position */\r
+#define TPI_FIFO1_ITM2_Msk                 (0xFFUL << TPI_FIFO1_ITM2_Pos)              /*!< TPI FIFO1: ITM2 Mask */\r
+\r
+#define TPI_FIFO1_ITM1_Pos                  8U                                         /*!< TPI FIFO1: ITM1 Position */\r
+#define TPI_FIFO1_ITM1_Msk                 (0xFFUL << TPI_FIFO1_ITM1_Pos)              /*!< TPI FIFO1: ITM1 Mask */\r
+\r
+#define TPI_FIFO1_ITM0_Pos                  0U                                         /*!< TPI FIFO1: ITM0 Position */\r
+#define TPI_FIFO1_ITM0_Msk                 (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/)          /*!< TPI FIFO1: ITM0 Mask */\r
+\r
+/* TPI ITATBCTR0 Register Definitions */\r
+#define TPI_ITATBCTR0_ATREADY2_Pos          0U                                         /*!< TPI ITATBCTR0: ATREADY2 Position */\r
+#define TPI_ITATBCTR0_ATREADY2_Msk         (0x1UL /*<< TPI_ITATBCTR0_ATREADY2_Pos*/)   /*!< TPI ITATBCTR0: ATREADY2 Mask */\r
+\r
+#define TPI_ITATBCTR0_ATREADY1_Pos          0U                                         /*!< TPI ITATBCTR0: ATREADY1 Position */\r
+#define TPI_ITATBCTR0_ATREADY1_Msk         (0x1UL /*<< TPI_ITATBCTR0_ATREADY1_Pos*/)   /*!< TPI ITATBCTR0: ATREADY1 Mask */\r
+\r
+/* TPI Integration Mode Control Register Definitions */\r
+#define TPI_ITCTRL_Mode_Pos                 0U                                         /*!< TPI ITCTRL: Mode Position */\r
+#define TPI_ITCTRL_Mode_Msk                (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/)          /*!< TPI ITCTRL: Mode Mask */\r
+\r
+/* TPI DEVID Register Definitions */\r
+#define TPI_DEVID_NRZVALID_Pos             11U                                         /*!< TPI DEVID: NRZVALID Position */\r
+#define TPI_DEVID_NRZVALID_Msk             (0x1UL << TPI_DEVID_NRZVALID_Pos)           /*!< TPI DEVID: NRZVALID Mask */\r
+\r
+#define TPI_DEVID_MANCVALID_Pos            10U                                         /*!< TPI DEVID: MANCVALID Position */\r
+#define TPI_DEVID_MANCVALID_Msk            (0x1UL << TPI_DEVID_MANCVALID_Pos)          /*!< TPI DEVID: MANCVALID Mask */\r
+\r
+#define TPI_DEVID_PTINVALID_Pos             9U                                         /*!< TPI DEVID: PTINVALID Position */\r
+#define TPI_DEVID_PTINVALID_Msk            (0x1UL << TPI_DEVID_PTINVALID_Pos)          /*!< TPI DEVID: PTINVALID Mask */\r
+\r
+#define TPI_DEVID_MinBufSz_Pos              6U                                         /*!< TPI DEVID: MinBufSz Position */\r
+#define TPI_DEVID_MinBufSz_Msk             (0x7UL << TPI_DEVID_MinBufSz_Pos)           /*!< TPI DEVID: MinBufSz Mask */\r
+\r
+#define TPI_DEVID_AsynClkIn_Pos             5U                                         /*!< TPI DEVID: AsynClkIn Position */\r
+#define TPI_DEVID_AsynClkIn_Msk            (0x1UL << TPI_DEVID_AsynClkIn_Pos)          /*!< TPI DEVID: AsynClkIn Mask */\r
+\r
+#define TPI_DEVID_NrTraceInput_Pos          0U                                         /*!< TPI DEVID: NrTraceInput Position */\r
+#define TPI_DEVID_NrTraceInput_Msk         (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/)  /*!< TPI DEVID: NrTraceInput Mask */\r
+\r
+/* TPI DEVTYPE Register Definitions */\r
+#define TPI_DEVTYPE_SubType_Pos             4U                                         /*!< TPI DEVTYPE: SubType Position */\r
+#define TPI_DEVTYPE_SubType_Msk            (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/)      /*!< TPI DEVTYPE: SubType Mask */\r
+\r
+#define TPI_DEVTYPE_MajorType_Pos           0U                                         /*!< TPI DEVTYPE: MajorType Position */\r
+#define TPI_DEVTYPE_MajorType_Msk          (0xFUL << TPI_DEVTYPE_MajorType_Pos)        /*!< TPI DEVTYPE: MajorType Mask */\r
+\r
+/*@}*/ /* end of group CMSIS_TPI */\r
+\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_MPU     Memory Protection Unit (MPU)\r
+  \brief    Type definitions for the Memory Protection Unit (MPU)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Memory Protection Unit (MPU).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t TYPE;                   /*!< Offset: 0x000 (R/ )  MPU Type Register */\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x004 (R/W)  MPU Control Register */\r
+  __IOM uint32_t RNR;                    /*!< Offset: 0x008 (R/W)  MPU Region RNRber Register */\r
+  __IOM uint32_t RBAR;                   /*!< Offset: 0x00C (R/W)  MPU Region Base Address Register */\r
+  __IOM uint32_t RASR;                   /*!< Offset: 0x010 (R/W)  MPU Region Attribute and Size Register */\r
+  __IOM uint32_t RBAR_A1;                /*!< Offset: 0x014 (R/W)  MPU Alias 1 Region Base Address Register */\r
+  __IOM uint32_t RASR_A1;                /*!< Offset: 0x018 (R/W)  MPU Alias 1 Region Attribute and Size Register */\r
+  __IOM uint32_t RBAR_A2;                /*!< Offset: 0x01C (R/W)  MPU Alias 2 Region Base Address Register */\r
+  __IOM uint32_t RASR_A2;                /*!< Offset: 0x020 (R/W)  MPU Alias 2 Region Attribute and Size Register */\r
+  __IOM uint32_t RBAR_A3;                /*!< Offset: 0x024 (R/W)  MPU Alias 3 Region Base Address Register */\r
+  __IOM uint32_t RASR_A3;                /*!< Offset: 0x028 (R/W)  MPU Alias 3 Region Attribute and Size Register */\r
+} MPU_Type;\r
+\r
+#define MPU_TYPE_RALIASES                  4U\r
+\r
+/* MPU Type Register Definitions */\r
+#define MPU_TYPE_IREGION_Pos               16U                                            /*!< MPU TYPE: IREGION Position */\r
+#define MPU_TYPE_IREGION_Msk               (0xFFUL << MPU_TYPE_IREGION_Pos)               /*!< MPU TYPE: IREGION Mask */\r
+\r
+#define MPU_TYPE_DREGION_Pos                8U                                            /*!< MPU TYPE: DREGION Position */\r
+#define MPU_TYPE_DREGION_Msk               (0xFFUL << MPU_TYPE_DREGION_Pos)               /*!< MPU TYPE: DREGION Mask */\r
+\r
+#define MPU_TYPE_SEPARATE_Pos               0U                                            /*!< MPU TYPE: SEPARATE Position */\r
+#define MPU_TYPE_SEPARATE_Msk              (1UL /*<< MPU_TYPE_SEPARATE_Pos*/)             /*!< MPU TYPE: SEPARATE Mask */\r
+\r
+/* MPU Control Register Definitions */\r
+#define MPU_CTRL_PRIVDEFENA_Pos             2U                                            /*!< MPU CTRL: PRIVDEFENA Position */\r
+#define MPU_CTRL_PRIVDEFENA_Msk            (1UL << MPU_CTRL_PRIVDEFENA_Pos)               /*!< MPU CTRL: PRIVDEFENA Mask */\r
+\r
+#define MPU_CTRL_HFNMIENA_Pos               1U                                            /*!< MPU CTRL: HFNMIENA Position */\r
+#define MPU_CTRL_HFNMIENA_Msk              (1UL << MPU_CTRL_HFNMIENA_Pos)                 /*!< MPU CTRL: HFNMIENA Mask */\r
+\r
+#define MPU_CTRL_ENABLE_Pos                 0U                                            /*!< MPU CTRL: ENABLE Position */\r
+#define MPU_CTRL_ENABLE_Msk                (1UL /*<< MPU_CTRL_ENABLE_Pos*/)               /*!< MPU CTRL: ENABLE Mask */\r
+\r
+/* MPU Region Number Register Definitions */\r
+#define MPU_RNR_REGION_Pos                  0U                                            /*!< MPU RNR: REGION Position */\r
+#define MPU_RNR_REGION_Msk                 (0xFFUL /*<< MPU_RNR_REGION_Pos*/)             /*!< MPU RNR: REGION Mask */\r
+\r
+/* MPU Region Base Address Register Definitions */\r
+#define MPU_RBAR_ADDR_Pos                   5U                                            /*!< MPU RBAR: ADDR Position */\r
+#define MPU_RBAR_ADDR_Msk                  (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos)             /*!< MPU RBAR: ADDR Mask */\r
+\r
+#define MPU_RBAR_VALID_Pos                  4U                                            /*!< MPU RBAR: VALID Position */\r
+#define MPU_RBAR_VALID_Msk                 (1UL << MPU_RBAR_VALID_Pos)                    /*!< MPU RBAR: VALID Mask */\r
+\r
+#define MPU_RBAR_REGION_Pos                 0U                                            /*!< MPU RBAR: REGION Position */\r
+#define MPU_RBAR_REGION_Msk                (0xFUL /*<< MPU_RBAR_REGION_Pos*/)             /*!< MPU RBAR: REGION Mask */\r
+\r
+/* MPU Region Attribute and Size Register Definitions */\r
+#define MPU_RASR_ATTRS_Pos                 16U                                            /*!< MPU RASR: MPU Region Attribute field Position */\r
+#define MPU_RASR_ATTRS_Msk                 (0xFFFFUL << MPU_RASR_ATTRS_Pos)               /*!< MPU RASR: MPU Region Attribute field Mask */\r
+\r
+#define MPU_RASR_XN_Pos                    28U                                            /*!< MPU RASR: ATTRS.XN Position */\r
+#define MPU_RASR_XN_Msk                    (1UL << MPU_RASR_XN_Pos)                       /*!< MPU RASR: ATTRS.XN Mask */\r
+\r
+#define MPU_RASR_AP_Pos                    24U                                            /*!< MPU RASR: ATTRS.AP Position */\r
+#define MPU_RASR_AP_Msk                    (0x7UL << MPU_RASR_AP_Pos)                     /*!< MPU RASR: ATTRS.AP Mask */\r
+\r
+#define MPU_RASR_TEX_Pos                   19U                                            /*!< MPU RASR: ATTRS.TEX Position */\r
+#define MPU_RASR_TEX_Msk                   (0x7UL << MPU_RASR_TEX_Pos)                    /*!< MPU RASR: ATTRS.TEX Mask */\r
+\r
+#define MPU_RASR_S_Pos                     18U                                            /*!< MPU RASR: ATTRS.S Position */\r
+#define MPU_RASR_S_Msk                     (1UL << MPU_RASR_S_Pos)                        /*!< MPU RASR: ATTRS.S Mask */\r
+\r
+#define MPU_RASR_C_Pos                     17U                                            /*!< MPU RASR: ATTRS.C Position */\r
+#define MPU_RASR_C_Msk                     (1UL << MPU_RASR_C_Pos)                        /*!< MPU RASR: ATTRS.C Mask */\r
+\r
+#define MPU_RASR_B_Pos                     16U                                            /*!< MPU RASR: ATTRS.B Position */\r
+#define MPU_RASR_B_Msk                     (1UL << MPU_RASR_B_Pos)                        /*!< MPU RASR: ATTRS.B Mask */\r
+\r
+#define MPU_RASR_SRD_Pos                    8U                                            /*!< MPU RASR: Sub-Region Disable Position */\r
+#define MPU_RASR_SRD_Msk                   (0xFFUL << MPU_RASR_SRD_Pos)                   /*!< MPU RASR: Sub-Region Disable Mask */\r
+\r
+#define MPU_RASR_SIZE_Pos                   1U                                            /*!< MPU RASR: Region Size Field Position */\r
+#define MPU_RASR_SIZE_Msk                  (0x1FUL << MPU_RASR_SIZE_Pos)                  /*!< MPU RASR: Region Size Field Mask */\r
+\r
+#define MPU_RASR_ENABLE_Pos                 0U                                            /*!< MPU RASR: Region enable bit Position */\r
+#define MPU_RASR_ENABLE_Msk                (1UL /*<< MPU_RASR_ENABLE_Pos*/)               /*!< MPU RASR: Region enable bit Disable Mask */\r
+\r
+/*@} end of group CMSIS_MPU */\r
+#endif /* defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_FPU     Floating Point Unit (FPU)\r
+  \brief    Type definitions for the Floating Point Unit (FPU)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Floating Point Unit (FPU).\r
+ */\r
+typedef struct\r
+{\r
+        uint32_t RESERVED0[1U];\r
+  __IOM uint32_t FPCCR;                  /*!< Offset: 0x004 (R/W)  Floating-Point Context Control Register */\r
+  __IOM uint32_t FPCAR;                  /*!< Offset: 0x008 (R/W)  Floating-Point Context Address Register */\r
+  __IOM uint32_t FPDSCR;                 /*!< Offset: 0x00C (R/W)  Floating-Point Default Status Control Register */\r
+  __IM  uint32_t MVFR0;                  /*!< Offset: 0x010 (R/ )  Media and FP Feature Register 0 */\r
+  __IM  uint32_t MVFR1;                  /*!< Offset: 0x014 (R/ )  Media and FP Feature Register 1 */\r
+} FPU_Type;\r
+\r
+/* Floating-Point Context Control Register Definitions */\r
+#define FPU_FPCCR_ASPEN_Pos                31U                                            /*!< FPCCR: ASPEN bit Position */\r
+#define FPU_FPCCR_ASPEN_Msk                (1UL << FPU_FPCCR_ASPEN_Pos)                   /*!< FPCCR: ASPEN bit Mask */\r
+\r
+#define FPU_FPCCR_LSPEN_Pos                30U                                            /*!< FPCCR: LSPEN Position */\r
+#define FPU_FPCCR_LSPEN_Msk                (1UL << FPU_FPCCR_LSPEN_Pos)                   /*!< FPCCR: LSPEN bit Mask */\r
+\r
+#define FPU_FPCCR_MONRDY_Pos                8U                                            /*!< FPCCR: MONRDY Position */\r
+#define FPU_FPCCR_MONRDY_Msk               (1UL << FPU_FPCCR_MONRDY_Pos)                  /*!< FPCCR: MONRDY bit Mask */\r
+\r
+#define FPU_FPCCR_BFRDY_Pos                 6U                                            /*!< FPCCR: BFRDY Position */\r
+#define FPU_FPCCR_BFRDY_Msk                (1UL << FPU_FPCCR_BFRDY_Pos)                   /*!< FPCCR: BFRDY bit Mask */\r
+\r
+#define FPU_FPCCR_MMRDY_Pos                 5U                                            /*!< FPCCR: MMRDY Position */\r
+#define FPU_FPCCR_MMRDY_Msk                (1UL << FPU_FPCCR_MMRDY_Pos)                   /*!< FPCCR: MMRDY bit Mask */\r
+\r
+#define FPU_FPCCR_HFRDY_Pos                 4U                                            /*!< FPCCR: HFRDY Position */\r
+#define FPU_FPCCR_HFRDY_Msk                (1UL << FPU_FPCCR_HFRDY_Pos)                   /*!< FPCCR: HFRDY bit Mask */\r
+\r
+#define FPU_FPCCR_THREAD_Pos                3U                                            /*!< FPCCR: processor mode bit Position */\r
+#define FPU_FPCCR_THREAD_Msk               (1UL << FPU_FPCCR_THREAD_Pos)                  /*!< FPCCR: processor mode active bit Mask */\r
+\r
+#define FPU_FPCCR_USER_Pos                  1U                                            /*!< FPCCR: privilege level bit Position */\r
+#define FPU_FPCCR_USER_Msk                 (1UL << FPU_FPCCR_USER_Pos)                    /*!< FPCCR: privilege level bit Mask */\r
+\r
+#define FPU_FPCCR_LSPACT_Pos                0U                                            /*!< FPCCR: Lazy state preservation active bit Position */\r
+#define FPU_FPCCR_LSPACT_Msk               (1UL /*<< FPU_FPCCR_LSPACT_Pos*/)              /*!< FPCCR: Lazy state preservation active bit Mask */\r
+\r
+/* Floating-Point Context Address Register Definitions */\r
+#define FPU_FPCAR_ADDRESS_Pos               3U                                            /*!< FPCAR: ADDRESS bit Position */\r
+#define FPU_FPCAR_ADDRESS_Msk              (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos)        /*!< FPCAR: ADDRESS bit Mask */\r
+\r
+/* Floating-Point Default Status Control Register Definitions */\r
+#define FPU_FPDSCR_AHP_Pos                 26U                                            /*!< FPDSCR: AHP bit Position */\r
+#define FPU_FPDSCR_AHP_Msk                 (1UL << FPU_FPDSCR_AHP_Pos)                    /*!< FPDSCR: AHP bit Mask */\r
+\r
+#define FPU_FPDSCR_DN_Pos                  25U                                            /*!< FPDSCR: DN bit Position */\r
+#define FPU_FPDSCR_DN_Msk                  (1UL << FPU_FPDSCR_DN_Pos)                     /*!< FPDSCR: DN bit Mask */\r
+\r
+#define FPU_FPDSCR_FZ_Pos                  24U                                            /*!< FPDSCR: FZ bit Position */\r
+#define FPU_FPDSCR_FZ_Msk                  (1UL << FPU_FPDSCR_FZ_Pos)                     /*!< FPDSCR: FZ bit Mask */\r
+\r
+#define FPU_FPDSCR_RMode_Pos               22U                                            /*!< FPDSCR: RMode bit Position */\r
+#define FPU_FPDSCR_RMode_Msk               (3UL << FPU_FPDSCR_RMode_Pos)                  /*!< FPDSCR: RMode bit Mask */\r
+\r
+/* Media and FP Feature Register 0 Definitions */\r
+#define FPU_MVFR0_FP_rounding_modes_Pos    28U                                            /*!< MVFR0: FP rounding modes bits Position */\r
+#define FPU_MVFR0_FP_rounding_modes_Msk    (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos)     /*!< MVFR0: FP rounding modes bits Mask */\r
+\r
+#define FPU_MVFR0_Short_vectors_Pos        24U                                            /*!< MVFR0: Short vectors bits Position */\r
+#define FPU_MVFR0_Short_vectors_Msk        (0xFUL << FPU_MVFR0_Short_vectors_Pos)         /*!< MVFR0: Short vectors bits Mask */\r
+\r
+#define FPU_MVFR0_Square_root_Pos          20U                                            /*!< MVFR0: Square root bits Position */\r
+#define FPU_MVFR0_Square_root_Msk          (0xFUL << FPU_MVFR0_Square_root_Pos)           /*!< MVFR0: Square root bits Mask */\r
+\r
+#define FPU_MVFR0_Divide_Pos               16U                                            /*!< MVFR0: Divide bits Position */\r
+#define FPU_MVFR0_Divide_Msk               (0xFUL << FPU_MVFR0_Divide_Pos)                /*!< MVFR0: Divide bits Mask */\r
+\r
+#define FPU_MVFR0_FP_excep_trapping_Pos    12U                                            /*!< MVFR0: FP exception trapping bits Position */\r
+#define FPU_MVFR0_FP_excep_trapping_Msk    (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos)     /*!< MVFR0: FP exception trapping bits Mask */\r
+\r
+#define FPU_MVFR0_Double_precision_Pos      8U                                            /*!< MVFR0: Double-precision bits Position */\r
+#define FPU_MVFR0_Double_precision_Msk     (0xFUL << FPU_MVFR0_Double_precision_Pos)      /*!< MVFR0: Double-precision bits Mask */\r
+\r
+#define FPU_MVFR0_Single_precision_Pos      4U                                            /*!< MVFR0: Single-precision bits Position */\r
+#define FPU_MVFR0_Single_precision_Msk     (0xFUL << FPU_MVFR0_Single_precision_Pos)      /*!< MVFR0: Single-precision bits Mask */\r
+\r
+#define FPU_MVFR0_A_SIMD_registers_Pos      0U                                            /*!< MVFR0: A_SIMD registers bits Position */\r
+#define FPU_MVFR0_A_SIMD_registers_Msk     (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/)  /*!< MVFR0: A_SIMD registers bits Mask */\r
+\r
+/* Media and FP Feature Register 1 Definitions */\r
+#define FPU_MVFR1_FP_fused_MAC_Pos         28U                                            /*!< MVFR1: FP fused MAC bits Position */\r
+#define FPU_MVFR1_FP_fused_MAC_Msk         (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos)          /*!< MVFR1: FP fused MAC bits Mask */\r
+\r
+#define FPU_MVFR1_FP_HPFP_Pos              24U                                            /*!< MVFR1: FP HPFP bits Position */\r
+#define FPU_MVFR1_FP_HPFP_Msk              (0xFUL << FPU_MVFR1_FP_HPFP_Pos)               /*!< MVFR1: FP HPFP bits Mask */\r
+\r
+#define FPU_MVFR1_D_NaN_mode_Pos            4U                                            /*!< MVFR1: D_NaN mode bits Position */\r
+#define FPU_MVFR1_D_NaN_mode_Msk           (0xFUL << FPU_MVFR1_D_NaN_mode_Pos)            /*!< MVFR1: D_NaN mode bits Mask */\r
+\r
+#define FPU_MVFR1_FtZ_mode_Pos              0U                                            /*!< MVFR1: FtZ mode bits Position */\r
+#define FPU_MVFR1_FtZ_mode_Msk             (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/)          /*!< MVFR1: FtZ mode bits Mask */\r
+\r
+/*@} end of group CMSIS_FPU */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_CoreDebug       Core Debug Registers (CoreDebug)\r
+  \brief    Type definitions for the Core Debug Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Core Debug Register (CoreDebug).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t DHCSR;                  /*!< Offset: 0x000 (R/W)  Debug Halting Control and Status Register */\r
+  __OM  uint32_t DCRSR;                  /*!< Offset: 0x004 ( /W)  Debug Core Register Selector Register */\r
+  __IOM uint32_t DCRDR;                  /*!< Offset: 0x008 (R/W)  Debug Core Register Data Register */\r
+  __IOM uint32_t DEMCR;                  /*!< Offset: 0x00C (R/W)  Debug Exception and Monitor Control Register */\r
+} CoreDebug_Type;\r
+\r
+/* Debug Halting Control and Status Register Definitions */\r
+#define CoreDebug_DHCSR_DBGKEY_Pos         16U                                            /*!< CoreDebug DHCSR: DBGKEY Position */\r
+#define CoreDebug_DHCSR_DBGKEY_Msk         (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos)       /*!< CoreDebug DHCSR: DBGKEY Mask */\r
+\r
+#define CoreDebug_DHCSR_S_RESET_ST_Pos     25U                                            /*!< CoreDebug DHCSR: S_RESET_ST Position */\r
+#define CoreDebug_DHCSR_S_RESET_ST_Msk     (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos)        /*!< CoreDebug DHCSR: S_RESET_ST Mask */\r
+\r
+#define CoreDebug_DHCSR_S_RETIRE_ST_Pos    24U                                            /*!< CoreDebug DHCSR: S_RETIRE_ST Position */\r
+#define CoreDebug_DHCSR_S_RETIRE_ST_Msk    (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos)       /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */\r
+\r
+#define CoreDebug_DHCSR_S_LOCKUP_Pos       19U                                            /*!< CoreDebug DHCSR: S_LOCKUP Position */\r
+#define CoreDebug_DHCSR_S_LOCKUP_Msk       (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos)          /*!< CoreDebug DHCSR: S_LOCKUP Mask */\r
+\r
+#define CoreDebug_DHCSR_S_SLEEP_Pos        18U                                            /*!< CoreDebug DHCSR: S_SLEEP Position */\r
+#define CoreDebug_DHCSR_S_SLEEP_Msk        (1UL << CoreDebug_DHCSR_S_SLEEP_Pos)           /*!< CoreDebug DHCSR: S_SLEEP Mask */\r
+\r
+#define CoreDebug_DHCSR_S_HALT_Pos         17U                                            /*!< CoreDebug DHCSR: S_HALT Position */\r
+#define CoreDebug_DHCSR_S_HALT_Msk         (1UL << CoreDebug_DHCSR_S_HALT_Pos)            /*!< CoreDebug DHCSR: S_HALT Mask */\r
+\r
+#define CoreDebug_DHCSR_S_REGRDY_Pos       16U                                            /*!< CoreDebug DHCSR: S_REGRDY Position */\r
+#define CoreDebug_DHCSR_S_REGRDY_Msk       (1UL << CoreDebug_DHCSR_S_REGRDY_Pos)          /*!< CoreDebug DHCSR: S_REGRDY Mask */\r
+\r
+#define CoreDebug_DHCSR_C_SNAPSTALL_Pos     5U                                            /*!< CoreDebug DHCSR: C_SNAPSTALL Position */\r
+#define CoreDebug_DHCSR_C_SNAPSTALL_Msk    (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos)       /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */\r
+\r
+#define CoreDebug_DHCSR_C_MASKINTS_Pos      3U                                            /*!< CoreDebug DHCSR: C_MASKINTS Position */\r
+#define CoreDebug_DHCSR_C_MASKINTS_Msk     (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos)        /*!< CoreDebug DHCSR: C_MASKINTS Mask */\r
+\r
+#define CoreDebug_DHCSR_C_STEP_Pos          2U                                            /*!< CoreDebug DHCSR: C_STEP Position */\r
+#define CoreDebug_DHCSR_C_STEP_Msk         (1UL << CoreDebug_DHCSR_C_STEP_Pos)            /*!< CoreDebug DHCSR: C_STEP Mask */\r
+\r
+#define CoreDebug_DHCSR_C_HALT_Pos          1U                                            /*!< CoreDebug DHCSR: C_HALT Position */\r
+#define CoreDebug_DHCSR_C_HALT_Msk         (1UL << CoreDebug_DHCSR_C_HALT_Pos)            /*!< CoreDebug DHCSR: C_HALT Mask */\r
+\r
+#define CoreDebug_DHCSR_C_DEBUGEN_Pos       0U                                            /*!< CoreDebug DHCSR: C_DEBUGEN Position */\r
+#define CoreDebug_DHCSR_C_DEBUGEN_Msk      (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/)     /*!< CoreDebug DHCSR: C_DEBUGEN Mask */\r
+\r
+/* Debug Core Register Selector Register Definitions */\r
+#define CoreDebug_DCRSR_REGWnR_Pos         16U                                            /*!< CoreDebug DCRSR: REGWnR Position */\r
+#define CoreDebug_DCRSR_REGWnR_Msk         (1UL << CoreDebug_DCRSR_REGWnR_Pos)            /*!< CoreDebug DCRSR: REGWnR Mask */\r
+\r
+#define CoreDebug_DCRSR_REGSEL_Pos          0U                                            /*!< CoreDebug DCRSR: REGSEL Position */\r
+#define CoreDebug_DCRSR_REGSEL_Msk         (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/)     /*!< CoreDebug DCRSR: REGSEL Mask */\r
+\r
+/* Debug Exception and Monitor Control Register Definitions */\r
+#define CoreDebug_DEMCR_TRCENA_Pos         24U                                            /*!< CoreDebug DEMCR: TRCENA Position */\r
+#define CoreDebug_DEMCR_TRCENA_Msk         (1UL << CoreDebug_DEMCR_TRCENA_Pos)            /*!< CoreDebug DEMCR: TRCENA Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_REQ_Pos        19U                                            /*!< CoreDebug DEMCR: MON_REQ Position */\r
+#define CoreDebug_DEMCR_MON_REQ_Msk        (1UL << CoreDebug_DEMCR_MON_REQ_Pos)           /*!< CoreDebug DEMCR: MON_REQ Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_STEP_Pos       18U                                            /*!< CoreDebug DEMCR: MON_STEP Position */\r
+#define CoreDebug_DEMCR_MON_STEP_Msk       (1UL << CoreDebug_DEMCR_MON_STEP_Pos)          /*!< CoreDebug DEMCR: MON_STEP Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_PEND_Pos       17U                                            /*!< CoreDebug DEMCR: MON_PEND Position */\r
+#define CoreDebug_DEMCR_MON_PEND_Msk       (1UL << CoreDebug_DEMCR_MON_PEND_Pos)          /*!< CoreDebug DEMCR: MON_PEND Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_EN_Pos         16U                                            /*!< CoreDebug DEMCR: MON_EN Position */\r
+#define CoreDebug_DEMCR_MON_EN_Msk         (1UL << CoreDebug_DEMCR_MON_EN_Pos)            /*!< CoreDebug DEMCR: MON_EN Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_HARDERR_Pos     10U                                            /*!< CoreDebug DEMCR: VC_HARDERR Position */\r
+#define CoreDebug_DEMCR_VC_HARDERR_Msk     (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos)        /*!< CoreDebug DEMCR: VC_HARDERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_INTERR_Pos       9U                                            /*!< CoreDebug DEMCR: VC_INTERR Position */\r
+#define CoreDebug_DEMCR_VC_INTERR_Msk      (1UL << CoreDebug_DEMCR_VC_INTERR_Pos)         /*!< CoreDebug DEMCR: VC_INTERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_BUSERR_Pos       8U                                            /*!< CoreDebug DEMCR: VC_BUSERR Position */\r
+#define CoreDebug_DEMCR_VC_BUSERR_Msk      (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos)         /*!< CoreDebug DEMCR: VC_BUSERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_STATERR_Pos      7U                                            /*!< CoreDebug DEMCR: VC_STATERR Position */\r
+#define CoreDebug_DEMCR_VC_STATERR_Msk     (1UL << CoreDebug_DEMCR_VC_STATERR_Pos)        /*!< CoreDebug DEMCR: VC_STATERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_CHKERR_Pos       6U                                            /*!< CoreDebug DEMCR: VC_CHKERR Position */\r
+#define CoreDebug_DEMCR_VC_CHKERR_Msk      (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos)         /*!< CoreDebug DEMCR: VC_CHKERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_NOCPERR_Pos      5U                                            /*!< CoreDebug DEMCR: VC_NOCPERR Position */\r
+#define CoreDebug_DEMCR_VC_NOCPERR_Msk     (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos)        /*!< CoreDebug DEMCR: VC_NOCPERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_MMERR_Pos        4U                                            /*!< CoreDebug DEMCR: VC_MMERR Position */\r
+#define CoreDebug_DEMCR_VC_MMERR_Msk       (1UL << CoreDebug_DEMCR_VC_MMERR_Pos)          /*!< CoreDebug DEMCR: VC_MMERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_CORERESET_Pos    0U                                            /*!< CoreDebug DEMCR: VC_CORERESET Position */\r
+#define CoreDebug_DEMCR_VC_CORERESET_Msk   (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/)  /*!< CoreDebug DEMCR: VC_CORERESET Mask */\r
+\r
+/*@} end of group CMSIS_CoreDebug */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_bitfield     Core register bit field macros\r
+  \brief      Macros for use with bit field definitions (xxx_Pos, xxx_Msk).\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   Mask and shift a bit field value for use in a register bit range.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of the bit field. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted value.\r
+*/\r
+#define _VAL2FLD(field, value)    (((uint32_t)(value) << field ## _Pos) & field ## _Msk)\r
+\r
+/**\r
+  \brief     Mask and shift a register value to extract a bit filed value.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of register. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted bit field value.\r
+*/\r
+#define _FLD2VAL(field, value)    (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)\r
+\r
+/*@} end of group CMSIS_core_bitfield */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_base     Core Definitions\r
+  \brief      Definitions for base addresses, unions, and structures.\r
+  @{\r
+ */\r
+\r
+/* Memory mapping of Core Hardware */\r
+#define SCS_BASE            (0xE000E000UL)                            /*!< System Control Space Base Address */\r
+#define ITM_BASE            (0xE0000000UL)                            /*!< ITM Base Address */\r
+#define DWT_BASE            (0xE0001000UL)                            /*!< DWT Base Address */\r
+#define TPI_BASE            (0xE0040000UL)                            /*!< TPI Base Address */\r
+#define CoreDebug_BASE      (0xE000EDF0UL)                            /*!< Core Debug Base Address */\r
+#define SysTick_BASE        (SCS_BASE +  0x0010UL)                    /*!< SysTick Base Address */\r
+#define NVIC_BASE           (SCS_BASE +  0x0100UL)                    /*!< NVIC Base Address */\r
+#define SCB_BASE            (SCS_BASE +  0x0D00UL)                    /*!< System Control Block Base Address */\r
+\r
+#define SCnSCB              ((SCnSCB_Type    *)     SCS_BASE      )   /*!< System control Register not in SCB */\r
+#define SCB                 ((SCB_Type       *)     SCB_BASE      )   /*!< SCB configuration struct */\r
+#define SysTick             ((SysTick_Type   *)     SysTick_BASE  )   /*!< SysTick configuration struct */\r
+#define NVIC                ((NVIC_Type      *)     NVIC_BASE     )   /*!< NVIC configuration struct */\r
+#define ITM                 ((ITM_Type       *)     ITM_BASE      )   /*!< ITM configuration struct */\r
+#define DWT                 ((DWT_Type       *)     DWT_BASE      )   /*!< DWT configuration struct */\r
+#define TPI                 ((TPI_Type       *)     TPI_BASE      )   /*!< TPI configuration struct */\r
+#define CoreDebug           ((CoreDebug_Type *)     CoreDebug_BASE)   /*!< Core Debug configuration struct */\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+  #define MPU_BASE          (SCS_BASE +  0x0D90UL)                    /*!< Memory Protection Unit */\r
+  #define MPU               ((MPU_Type       *)     MPU_BASE      )   /*!< Memory Protection Unit */\r
+#endif\r
+\r
+#define FPU_BASE            (SCS_BASE +  0x0F30UL)                    /*!< Floating Point Unit */\r
+#define FPU                 ((FPU_Type       *)     FPU_BASE      )   /*!< Floating Point Unit */\r
+\r
+/*@} */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                Hardware Abstraction Layer\r
+  Core Function Interface contains:\r
+  - Core NVIC Functions\r
+  - Core SysTick Functions\r
+  - Core Debug Functions\r
+  - Core Register Access Functions\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference\r
+*/\r
+\r
+\r
+\r
+/* ##########################   NVIC functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_NVICFunctions NVIC Functions\r
+  \brief    Functions that manage interrupts and exceptions via the NVIC.\r
+  @{\r
+ */\r
+\r
+#ifdef CMSIS_NVIC_VIRTUAL\r
+  #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+    #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"\r
+  #endif\r
+  #include CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+#else\r
+  #define NVIC_SetPriorityGrouping    __NVIC_SetPriorityGrouping\r
+  #define NVIC_GetPriorityGrouping    __NVIC_GetPriorityGrouping\r
+  #define NVIC_EnableIRQ              __NVIC_EnableIRQ\r
+  #define NVIC_GetEnableIRQ           __NVIC_GetEnableIRQ\r
+  #define NVIC_DisableIRQ             __NVIC_DisableIRQ\r
+  #define NVIC_GetPendingIRQ          __NVIC_GetPendingIRQ\r
+  #define NVIC_SetPendingIRQ          __NVIC_SetPendingIRQ\r
+  #define NVIC_ClearPendingIRQ        __NVIC_ClearPendingIRQ\r
+  #define NVIC_GetActive              __NVIC_GetActive\r
+  #define NVIC_SetPriority            __NVIC_SetPriority\r
+  #define NVIC_GetPriority            __NVIC_GetPriority\r
+  #define NVIC_SystemReset            __NVIC_SystemReset\r
+#endif /* CMSIS_NVIC_VIRTUAL */\r
+\r
+#ifdef CMSIS_VECTAB_VIRTUAL\r
+  #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+   #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"\r
+  #endif\r
+  #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+#else\r
+  #define NVIC_SetVector              __NVIC_SetVector\r
+  #define NVIC_GetVector              __NVIC_GetVector\r
+#endif  /* (CMSIS_VECTAB_VIRTUAL) */\r
+\r
+#define NVIC_USER_IRQ_OFFSET          16\r
+\r
+\r
+/* The following EXC_RETURN values are saved the LR on exception entry */\r
+#define EXC_RETURN_HANDLER         (0xFFFFFFF1UL)     /* return to Handler mode, uses MSP after return                               */\r
+#define EXC_RETURN_THREAD_MSP      (0xFFFFFFF9UL)     /* return to Thread mode, uses MSP after return                                */\r
+#define EXC_RETURN_THREAD_PSP      (0xFFFFFFFDUL)     /* return to Thread mode, uses PSP after return                                */\r
+#define EXC_RETURN_HANDLER_FPU     (0xFFFFFFE1UL)     /* return to Handler mode, uses MSP after return, restore floating-point state */\r
+#define EXC_RETURN_THREAD_MSP_FPU  (0xFFFFFFE9UL)     /* return to Thread mode, uses MSP after return, restore floating-point state  */\r
+#define EXC_RETURN_THREAD_PSP_FPU  (0xFFFFFFEDUL)     /* return to Thread mode, uses PSP after return, restore floating-point state  */\r
+\r
+\r
+/**\r
+  \brief   Set Priority Grouping\r
+  \details Sets the priority grouping field using the required unlock sequence.\r
+           The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field.\r
+           Only values from 0..7 are used.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.\r
+  \param [in]      PriorityGroup  Priority grouping field.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup)\r
+{\r
+  uint32_t reg_value;\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);             /* only values 0..7 are used          */\r
+\r
+  reg_value  =  SCB->AIRCR;                                                   /* read old register configuration    */\r
+  reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change               */\r
+  reg_value  =  (reg_value                                   |\r
+                ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |\r
+                (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos)  );              /* Insert write key and priority group */\r
+  SCB->AIRCR =  reg_value;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Priority Grouping\r
+  \details Reads the priority grouping field from the NVIC Interrupt Controller.\r
+  \return                Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field).\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void)\r
+{\r
+  return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos));\r
+}\r
+\r
+\r
+/**\r
+  \brief   Enable Interrupt\r
+  \details Enables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Enable status\r
+  \details Returns a device specific interrupt enable status from the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt is not enabled.\r
+  \return             1  Interrupt is enabled.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Disable Interrupt\r
+  \details Disables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+    __DSB();\r
+    __ISB();\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Pending Interrupt\r
+  \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not pending.\r
+  \return             1  Interrupt status is pending.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Pending Interrupt\r
+  \details Sets the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Clear Pending Interrupt\r
+  \details Clears the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Active Interrupt\r
+  \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not active.\r
+  \return             1  Interrupt status is active.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Priority\r
+  \details Sets the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]      IRQn  Interrupt number.\r
+  \param [in]  priority  Priority to set.\r
+  \note    The priority cannot be set for every processor exception.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->IP[((uint32_t)IRQn)]               = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);\r
+  }\r
+  else\r
+  {\r
+    SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Priority\r
+  \details Reads the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn  Interrupt number.\r
+  \return             Interrupt Priority.\r
+                      Value is aligned automatically to the implemented priority bits of the microcontroller.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)\r
+{\r
+\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return(((uint32_t)NVIC->IP[((uint32_t)IRQn)]               >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+  else\r
+  {\r
+    return(((uint32_t)SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Encode Priority\r
+  \details Encodes the priority for an interrupt with the given priority group,\r
+           preemptive priority value, and subpriority value.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.\r
+  \param [in]     PriorityGroup  Used priority group.\r
+  \param [in]   PreemptPriority  Preemptive priority value (starting from 0).\r
+  \param [in]       SubPriority  Subpriority value (starting from 0).\r
+  \return                        Encoded priority. Value can be used in the function \ref NVIC_SetPriority().\r
+ */\r
+__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);\r
+  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));\r
+\r
+  return (\r
+           ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |\r
+           ((SubPriority     & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL)))\r
+         );\r
+}\r
+\r
+\r
+/**\r
+  \brief   Decode Priority\r
+  \details Decodes an interrupt priority value with a given priority group to\r
+           preemptive priority value and subpriority value.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.\r
+  \param [in]         Priority   Priority value, which can be retrieved with the function \ref NVIC_GetPriority().\r
+  \param [in]     PriorityGroup  Used priority group.\r
+  \param [out] pPreemptPriority  Preemptive priority value (starting from 0).\r
+  \param [out]     pSubPriority  Subpriority value (starting from 0).\r
+ */\r
+__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);\r
+  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));\r
+\r
+  *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);\r
+  *pSubPriority     = (Priority                   ) & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Vector\r
+  \details Sets an interrupt vector in SRAM based interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+           VTOR must been relocated to SRAM before.\r
+  \param [in]   IRQn      Interrupt number\r
+  \param [in]   vector    Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)\r
+{\r
+  uint32_t *vectors = (uint32_t *)SCB->VTOR;\r
+  vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Vector\r
+  \details Reads an interrupt vector from interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn      Interrupt number.\r
+  \return                 Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)\r
+{\r
+  uint32_t *vectors = (uint32_t *)SCB->VTOR;\r
+  return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];\r
+}\r
+\r
+\r
+/**\r
+  \brief   System Reset\r
+  \details Initiates a system reset request to reset the MCU.\r
+ */\r
+__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)\r
+{\r
+  __DSB();                                                          /* Ensure all outstanding memory accesses included\r
+                                                                       buffered write are completed before reset */\r
+  SCB->AIRCR  = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos)    |\r
+                           (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |\r
+                            SCB_AIRCR_SYSRESETREQ_Msk    );         /* Keep priority group unchanged */\r
+  __DSB();                                                          /* Ensure completion of memory access */\r
+\r
+  for(;;)                                                           /* wait until reset */\r
+  {\r
+    __NOP();\r
+  }\r
+}\r
+\r
+/*@} end of CMSIS_Core_NVICFunctions */\r
+\r
+/* ##########################  MPU functions  #################################### */\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+\r
+#include "mpu_armv7.h"\r
+\r
+#endif\r
+\r
+\r
+/* ##########################  FPU functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_FpuFunctions FPU Functions\r
+  \brief    Function that provides FPU type.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   get FPU type\r
+  \details returns the FPU type\r
+  \returns\r
+   - \b  0: No FPU\r
+   - \b  1: Single precision FPU\r
+   - \b  2: Double + Single precision FPU\r
+ */\r
+__STATIC_INLINE uint32_t SCB_GetFPUType(void)\r
+{\r
+  uint32_t mvfr0;\r
+\r
+  mvfr0 = FPU->MVFR0;\r
+  if      ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x020U)\r
+  {\r
+    return 1U;           /* Single precision FPU */\r
+  }\r
+  else\r
+  {\r
+    return 0U;           /* No FPU */\r
+  }\r
+}\r
+\r
+\r
+/*@} end of CMSIS_Core_FpuFunctions */\r
+\r
+\r
+\r
+/* ##################################    SysTick function  ############################################ */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_SysTickFunctions SysTick Functions\r
+  \brief    Functions that configure the System.\r
+  @{\r
+ */\r
+\r
+#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)\r
+\r
+/**\r
+  \brief   System Tick Configuration\r
+  \details Initializes the System Timer and its interrupt, and starts the System Tick Timer.\r
+           Counter is in free running mode to generate periodic interrupts.\r
+  \param [in]  ticks  Number of ticks between two interrupts.\r
+  \return          0  Function succeeded.\r
+  \return          1  Function failed.\r
+  \note    When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the\r
+           function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>\r
+           must contain a vendor-specific implementation of this function.\r
+ */\r
+__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)\r
+{\r
+  if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)\r
+  {\r
+    return (1UL);                                                   /* Reload value impossible */\r
+  }\r
+\r
+  SysTick->LOAD  = (uint32_t)(ticks - 1UL);                         /* set reload register */\r
+  NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */\r
+  SysTick->VAL   = 0UL;                                             /* Load the SysTick Counter Value */\r
+  SysTick->CTRL  = SysTick_CTRL_CLKSOURCE_Msk |\r
+                   SysTick_CTRL_TICKINT_Msk   |\r
+                   SysTick_CTRL_ENABLE_Msk;                         /* Enable SysTick IRQ and SysTick Timer */\r
+  return (0UL);                                                     /* Function successful */\r
+}\r
+\r
+#endif\r
+\r
+/*@} end of CMSIS_Core_SysTickFunctions */\r
+\r
+\r
+\r
+/* ##################################### Debug In/Output function ########################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_core_DebugFunctions ITM Functions\r
+  \brief    Functions that access the ITM debug interface.\r
+  @{\r
+ */\r
+\r
+extern volatile int32_t ITM_RxBuffer;                              /*!< External variable to receive characters. */\r
+#define                 ITM_RXBUFFER_EMPTY  ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */\r
+\r
+\r
+/**\r
+  \brief   ITM Send Character\r
+  \details Transmits a character via the ITM channel 0, and\r
+           \li Just returns when no debugger is connected that has booked the output.\r
+           \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted.\r
+  \param [in]     ch  Character to transmit.\r
+  \returns            Character to transmit.\r
+ */\r
+__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch)\r
+{\r
+  if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) &&      /* ITM enabled */\r
+      ((ITM->TER & 1UL               ) != 0UL)   )     /* ITM Port #0 enabled */\r
+  {\r
+    while (ITM->PORT[0U].u32 == 0UL)\r
+    {\r
+      __NOP();\r
+    }\r
+    ITM->PORT[0U].u8 = (uint8_t)ch;\r
+  }\r
+  return (ch);\r
+}\r
+\r
+\r
+/**\r
+  \brief   ITM Receive Character\r
+  \details Inputs a character via the external variable \ref ITM_RxBuffer.\r
+  \return             Received character.\r
+  \return         -1  No character pending.\r
+ */\r
+__STATIC_INLINE int32_t ITM_ReceiveChar (void)\r
+{\r
+  int32_t ch = -1;                           /* no character available */\r
+\r
+  if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY)\r
+  {\r
+    ch = ITM_RxBuffer;\r
+    ITM_RxBuffer = ITM_RXBUFFER_EMPTY;       /* ready for next character */\r
+  }\r
+\r
+  return (ch);\r
+}\r
+\r
+\r
+/**\r
+  \brief   ITM Check Character\r
+  \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer.\r
+  \return          0  No character available.\r
+  \return          1  Character available.\r
+ */\r
+__STATIC_INLINE int32_t ITM_CheckChar (void)\r
+{\r
+\r
+  if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY)\r
+  {\r
+    return (0);                              /* no character available */\r
+  }\r
+  else\r
+  {\r
+    return (1);                              /*    character available */\r
+  }\r
+}\r
+\r
+/*@} end of CMSIS_core_DebugFunctions */\r
+\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_CM4_H_DEPENDANT */\r
+\r
+#endif /* __CMSIS_GENERIC */\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm7.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_cm7.h
new file mode 100644 (file)
index 0000000..ada6c2a
--- /dev/null
@@ -0,0 +1,2671 @@
+/**************************************************************************//**\r
+ * @file     core_cm7.h\r
+ * @brief    CMSIS Cortex-M7 Core Peripheral Access Layer Header File\r
+ * @version  V5.0.8\r
+ * @date     04. June 2018\r
+ ******************************************************************************/\r
+/*\r
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.\r
+ *\r
+ * SPDX-License-Identifier: Apache-2.0\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the License); you may\r
+ * not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#if   defined ( __ICCARM__ )\r
+  #pragma system_include         /* treat file as system include file for MISRA check */\r
+#elif defined (__clang__)\r
+  #pragma clang system_header   /* treat file as system include file */\r
+#endif\r
+\r
+#ifndef __CORE_CM7_H_GENERIC\r
+#define __CORE_CM7_H_GENERIC\r
+\r
+#include <stdint.h>\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/**\r
+  \page CMSIS_MISRA_Exceptions  MISRA-C:2004 Compliance Exceptions\r
+  CMSIS violates the following MISRA-C:2004 rules:\r
+\r
+   \li Required Rule 8.5, object/function definition in header file.<br>\r
+     Function definitions in header files are used to allow 'inlining'.\r
+\r
+   \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>\r
+     Unions are used for effective representation of core registers.\r
+\r
+   \li Advisory Rule 19.7, Function-like macro defined.<br>\r
+     Function-like macros are used to allow more efficient code.\r
+ */\r
+\r
+\r
+/*******************************************************************************\r
+ *                 CMSIS definitions\r
+ ******************************************************************************/\r
+/**\r
+  \ingroup Cortex_M7\r
+  @{\r
+ */\r
+\r
+#include "cmsis_version.h"\r
+\r
+/* CMSIS CM7 definitions */\r
+#define __CM7_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                  /*!< \deprecated [31:16] CMSIS HAL main version */\r
+#define __CM7_CMSIS_VERSION_SUB   ( __CM_CMSIS_VERSION_SUB)                  /*!< \deprecated [15:0]  CMSIS HAL sub version */\r
+#define __CM7_CMSIS_VERSION       ((__CM7_CMSIS_VERSION_MAIN << 16U) | \\r
+                                    __CM7_CMSIS_VERSION_SUB           )      /*!< \deprecated CMSIS HAL version number */\r
+\r
+#define __CORTEX_M                (7U)                                       /*!< Cortex-M Core */\r
+\r
+/** __FPU_USED indicates whether an FPU is used or not.\r
+    For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions.\r
+*/\r
+#if defined ( __CC_ARM )\r
+  #if defined __TARGET_FPU_VFP\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)\r
+  #if defined __ARM_PCS_VFP\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+#elif defined ( __GNUC__ )\r
+  #if defined (__VFP_FP__) && !defined(__SOFTFP__)\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+#elif defined ( __ICCARM__ )\r
+  #if defined __ARMVFP__\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+#elif defined ( __TI_ARM__ )\r
+  #if defined __TI_VFP_SUPPORT__\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+#elif defined ( __TASKING__ )\r
+  #if defined __FPU_VFP__\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+#elif defined ( __CSMC__ )\r
+  #if ( __CSMC__ & 0x400U)\r
+    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)\r
+      #define __FPU_USED       1U\r
+    #else\r
+      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+      #define __FPU_USED       0U\r
+    #endif\r
+  #else\r
+    #define __FPU_USED         0U\r
+  #endif\r
+\r
+#endif\r
+\r
+#include "cmsis_compiler.h"               /* CMSIS compiler specific defines */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_CM7_H_GENERIC */\r
+\r
+#ifndef __CMSIS_GENERIC\r
+\r
+#ifndef __CORE_CM7_H_DEPENDANT\r
+#define __CORE_CM7_H_DEPENDANT\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/* check device defines and use defaults */\r
+#if defined __CHECK_DEVICE_DEFINES\r
+  #ifndef __CM7_REV\r
+    #define __CM7_REV               0x0000U\r
+    #warning "__CM7_REV not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __FPU_PRESENT\r
+    #define __FPU_PRESENT             0U\r
+    #warning "__FPU_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __MPU_PRESENT\r
+    #define __MPU_PRESENT             0U\r
+    #warning "__MPU_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __ICACHE_PRESENT\r
+    #define __ICACHE_PRESENT          0U\r
+    #warning "__ICACHE_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __DCACHE_PRESENT\r
+    #define __DCACHE_PRESENT          0U\r
+    #warning "__DCACHE_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __DTCM_PRESENT\r
+    #define __DTCM_PRESENT            0U\r
+    #warning "__DTCM_PRESENT        not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __NVIC_PRIO_BITS\r
+    #define __NVIC_PRIO_BITS          3U\r
+    #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __Vendor_SysTickConfig\r
+    #define __Vendor_SysTickConfig    0U\r
+    #warning "__Vendor_SysTickConfig not defined in device header file; using default!"\r
+  #endif\r
+#endif\r
+\r
+/* IO definitions (access restrictions to peripheral registers) */\r
+/**\r
+    \defgroup CMSIS_glob_defs CMSIS Global Defines\r
+\r
+    <strong>IO Type Qualifiers</strong> are used\r
+    \li to specify the access to peripheral variables.\r
+    \li for automatic generation of peripheral register debug information.\r
+*/\r
+#ifdef __cplusplus\r
+  #define   __I     volatile             /*!< Defines 'read only' permissions */\r
+#else\r
+  #define   __I     volatile const       /*!< Defines 'read only' permissions */\r
+#endif\r
+#define     __O     volatile             /*!< Defines 'write only' permissions */\r
+#define     __IO    volatile             /*!< Defines 'read / write' permissions */\r
+\r
+/* following defines should be used for structure members */\r
+#define     __IM     volatile const      /*! Defines 'read only' structure member permissions */\r
+#define     __OM     volatile            /*! Defines 'write only' structure member permissions */\r
+#define     __IOM    volatile            /*! Defines 'read / write' structure member permissions */\r
+\r
+/*@} end of group Cortex_M7 */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                 Register Abstraction\r
+  Core Register contain:\r
+  - Core Register\r
+  - Core NVIC Register\r
+  - Core SCB Register\r
+  - Core SysTick Register\r
+  - Core Debug Register\r
+  - Core MPU Register\r
+  - Core FPU Register\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_core_register Defines and Type Definitions\r
+  \brief Type definitions and defines for Cortex-M processor based devices.\r
+*/\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_CORE  Status and Control Registers\r
+  \brief      Core Register type definitions.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Union type to access the Application Program Status Register (APSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t _reserved0:16;              /*!< bit:  0..15  Reserved */\r
+    uint32_t GE:4;                       /*!< bit: 16..19  Greater than or Equal flags */\r
+    uint32_t _reserved1:7;               /*!< bit: 20..26  Reserved */\r
+    uint32_t Q:1;                        /*!< bit:     27  Saturation condition flag */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} APSR_Type;\r
+\r
+/* APSR Register Definitions */\r
+#define APSR_N_Pos                         31U                                            /*!< APSR: N Position */\r
+#define APSR_N_Msk                         (1UL << APSR_N_Pos)                            /*!< APSR: N Mask */\r
+\r
+#define APSR_Z_Pos                         30U                                            /*!< APSR: Z Position */\r
+#define APSR_Z_Msk                         (1UL << APSR_Z_Pos)                            /*!< APSR: Z Mask */\r
+\r
+#define APSR_C_Pos                         29U                                            /*!< APSR: C Position */\r
+#define APSR_C_Msk                         (1UL << APSR_C_Pos)                            /*!< APSR: C Mask */\r
+\r
+#define APSR_V_Pos                         28U                                            /*!< APSR: V Position */\r
+#define APSR_V_Msk                         (1UL << APSR_V_Pos)                            /*!< APSR: V Mask */\r
+\r
+#define APSR_Q_Pos                         27U                                            /*!< APSR: Q Position */\r
+#define APSR_Q_Msk                         (1UL << APSR_Q_Pos)                            /*!< APSR: Q Mask */\r
+\r
+#define APSR_GE_Pos                        16U                                            /*!< APSR: GE Position */\r
+#define APSR_GE_Msk                        (0xFUL << APSR_GE_Pos)                         /*!< APSR: GE Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Interrupt Program Status Register (IPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:23;              /*!< bit:  9..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} IPSR_Type;\r
+\r
+/* IPSR Register Definitions */\r
+#define IPSR_ISR_Pos                        0U                                            /*!< IPSR: ISR Position */\r
+#define IPSR_ISR_Msk                       (0x1FFUL /*<< IPSR_ISR_Pos*/)                  /*!< IPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Special-Purpose Program Status Registers (xPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:1;               /*!< bit:      9  Reserved */\r
+    uint32_t ICI_IT_1:6;                 /*!< bit: 10..15  ICI/IT part 1 */\r
+    uint32_t GE:4;                       /*!< bit: 16..19  Greater than or Equal flags */\r
+    uint32_t _reserved1:4;               /*!< bit: 20..23  Reserved */\r
+    uint32_t T:1;                        /*!< bit:     24  Thumb bit */\r
+    uint32_t ICI_IT_2:2;                 /*!< bit: 25..26  ICI/IT part 2 */\r
+    uint32_t Q:1;                        /*!< bit:     27  Saturation condition flag */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} xPSR_Type;\r
+\r
+/* xPSR Register Definitions */\r
+#define xPSR_N_Pos                         31U                                            /*!< xPSR: N Position */\r
+#define xPSR_N_Msk                         (1UL << xPSR_N_Pos)                            /*!< xPSR: N Mask */\r
+\r
+#define xPSR_Z_Pos                         30U                                            /*!< xPSR: Z Position */\r
+#define xPSR_Z_Msk                         (1UL << xPSR_Z_Pos)                            /*!< xPSR: Z Mask */\r
+\r
+#define xPSR_C_Pos                         29U                                            /*!< xPSR: C Position */\r
+#define xPSR_C_Msk                         (1UL << xPSR_C_Pos)                            /*!< xPSR: C Mask */\r
+\r
+#define xPSR_V_Pos                         28U                                            /*!< xPSR: V Position */\r
+#define xPSR_V_Msk                         (1UL << xPSR_V_Pos)                            /*!< xPSR: V Mask */\r
+\r
+#define xPSR_Q_Pos                         27U                                            /*!< xPSR: Q Position */\r
+#define xPSR_Q_Msk                         (1UL << xPSR_Q_Pos)                            /*!< xPSR: Q Mask */\r
+\r
+#define xPSR_ICI_IT_2_Pos                  25U                                            /*!< xPSR: ICI/IT part 2 Position */\r
+#define xPSR_ICI_IT_2_Msk                  (3UL << xPSR_ICI_IT_2_Pos)                     /*!< xPSR: ICI/IT part 2 Mask */\r
+\r
+#define xPSR_T_Pos                         24U                                            /*!< xPSR: T Position */\r
+#define xPSR_T_Msk                         (1UL << xPSR_T_Pos)                            /*!< xPSR: T Mask */\r
+\r
+#define xPSR_GE_Pos                        16U                                            /*!< xPSR: GE Position */\r
+#define xPSR_GE_Msk                        (0xFUL << xPSR_GE_Pos)                         /*!< xPSR: GE Mask */\r
+\r
+#define xPSR_ICI_IT_1_Pos                  10U                                            /*!< xPSR: ICI/IT part 1 Position */\r
+#define xPSR_ICI_IT_1_Msk                  (0x3FUL << xPSR_ICI_IT_1_Pos)                  /*!< xPSR: ICI/IT part 1 Mask */\r
+\r
+#define xPSR_ISR_Pos                        0U                                            /*!< xPSR: ISR Position */\r
+#define xPSR_ISR_Msk                       (0x1FFUL /*<< xPSR_ISR_Pos*/)                  /*!< xPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Control Registers (CONTROL).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t nPRIV:1;                    /*!< bit:      0  Execution privilege in Thread mode */\r
+    uint32_t SPSEL:1;                    /*!< bit:      1  Stack to be used */\r
+    uint32_t FPCA:1;                     /*!< bit:      2  FP extension active flag */\r
+    uint32_t _reserved0:29;              /*!< bit:  3..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} CONTROL_Type;\r
+\r
+/* CONTROL Register Definitions */\r
+#define CONTROL_FPCA_Pos                    2U                                            /*!< CONTROL: FPCA Position */\r
+#define CONTROL_FPCA_Msk                   (1UL << CONTROL_FPCA_Pos)                      /*!< CONTROL: FPCA Mask */\r
+\r
+#define CONTROL_SPSEL_Pos                   1U                                            /*!< CONTROL: SPSEL Position */\r
+#define CONTROL_SPSEL_Msk                  (1UL << CONTROL_SPSEL_Pos)                     /*!< CONTROL: SPSEL Mask */\r
+\r
+#define CONTROL_nPRIV_Pos                   0U                                            /*!< CONTROL: nPRIV Position */\r
+#define CONTROL_nPRIV_Msk                  (1UL /*<< CONTROL_nPRIV_Pos*/)                 /*!< CONTROL: nPRIV Mask */\r
+\r
+/*@} end of group CMSIS_CORE */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_NVIC  Nested Vectored Interrupt Controller (NVIC)\r
+  \brief      Type definitions for the NVIC Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Nested Vectored Interrupt Controller (NVIC).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t ISER[8U];               /*!< Offset: 0x000 (R/W)  Interrupt Set Enable Register */\r
+        uint32_t RESERVED0[24U];\r
+  __IOM uint32_t ICER[8U];               /*!< Offset: 0x080 (R/W)  Interrupt Clear Enable Register */\r
+        uint32_t RSERVED1[24U];\r
+  __IOM uint32_t ISPR[8U];               /*!< Offset: 0x100 (R/W)  Interrupt Set Pending Register */\r
+        uint32_t RESERVED2[24U];\r
+  __IOM uint32_t ICPR[8U];               /*!< Offset: 0x180 (R/W)  Interrupt Clear Pending Register */\r
+        uint32_t RESERVED3[24U];\r
+  __IOM uint32_t IABR[8U];               /*!< Offset: 0x200 (R/W)  Interrupt Active bit Register */\r
+        uint32_t RESERVED4[56U];\r
+  __IOM uint8_t  IP[240U];               /*!< Offset: 0x300 (R/W)  Interrupt Priority Register (8Bit wide) */\r
+        uint32_t RESERVED5[644U];\r
+  __OM  uint32_t STIR;                   /*!< Offset: 0xE00 ( /W)  Software Trigger Interrupt Register */\r
+}  NVIC_Type;\r
+\r
+/* Software Triggered Interrupt Register Definitions */\r
+#define NVIC_STIR_INTID_Pos                 0U                                         /*!< STIR: INTLINESNUM Position */\r
+#define NVIC_STIR_INTID_Msk                (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/)        /*!< STIR: INTLINESNUM Mask */\r
+\r
+/*@} end of group CMSIS_NVIC */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SCB     System Control Block (SCB)\r
+  \brief    Type definitions for the System Control Block Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Control Block (SCB).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t CPUID;                  /*!< Offset: 0x000 (R/ )  CPUID Base Register */\r
+  __IOM uint32_t ICSR;                   /*!< Offset: 0x004 (R/W)  Interrupt Control and State Register */\r
+  __IOM uint32_t VTOR;                   /*!< Offset: 0x008 (R/W)  Vector Table Offset Register */\r
+  __IOM uint32_t AIRCR;                  /*!< Offset: 0x00C (R/W)  Application Interrupt and Reset Control Register */\r
+  __IOM uint32_t SCR;                    /*!< Offset: 0x010 (R/W)  System Control Register */\r
+  __IOM uint32_t CCR;                    /*!< Offset: 0x014 (R/W)  Configuration Control Register */\r
+  __IOM uint8_t  SHPR[12U];              /*!< Offset: 0x018 (R/W)  System Handlers Priority Registers (4-7, 8-11, 12-15) */\r
+  __IOM uint32_t SHCSR;                  /*!< Offset: 0x024 (R/W)  System Handler Control and State Register */\r
+  __IOM uint32_t CFSR;                   /*!< Offset: 0x028 (R/W)  Configurable Fault Status Register */\r
+  __IOM uint32_t HFSR;                   /*!< Offset: 0x02C (R/W)  HardFault Status Register */\r
+  __IOM uint32_t DFSR;                   /*!< Offset: 0x030 (R/W)  Debug Fault Status Register */\r
+  __IOM uint32_t MMFAR;                  /*!< Offset: 0x034 (R/W)  MemManage Fault Address Register */\r
+  __IOM uint32_t BFAR;                   /*!< Offset: 0x038 (R/W)  BusFault Address Register */\r
+  __IOM uint32_t AFSR;                   /*!< Offset: 0x03C (R/W)  Auxiliary Fault Status Register */\r
+  __IM  uint32_t ID_PFR[2U];             /*!< Offset: 0x040 (R/ )  Processor Feature Register */\r
+  __IM  uint32_t ID_DFR;                 /*!< Offset: 0x048 (R/ )  Debug Feature Register */\r
+  __IM  uint32_t ID_AFR;                 /*!< Offset: 0x04C (R/ )  Auxiliary Feature Register */\r
+  __IM  uint32_t ID_MFR[4U];             /*!< Offset: 0x050 (R/ )  Memory Model Feature Register */\r
+  __IM  uint32_t ID_ISAR[5U];            /*!< Offset: 0x060 (R/ )  Instruction Set Attributes Register */\r
+        uint32_t RESERVED0[1U];\r
+  __IM  uint32_t CLIDR;                  /*!< Offset: 0x078 (R/ )  Cache Level ID register */\r
+  __IM  uint32_t CTR;                    /*!< Offset: 0x07C (R/ )  Cache Type register */\r
+  __IM  uint32_t CCSIDR;                 /*!< Offset: 0x080 (R/ )  Cache Size ID Register */\r
+  __IOM uint32_t CSSELR;                 /*!< Offset: 0x084 (R/W)  Cache Size Selection Register */\r
+  __IOM uint32_t CPACR;                  /*!< Offset: 0x088 (R/W)  Coprocessor Access Control Register */\r
+        uint32_t RESERVED3[93U];\r
+  __OM  uint32_t STIR;                   /*!< Offset: 0x200 ( /W)  Software Triggered Interrupt Register */\r
+        uint32_t RESERVED4[15U];\r
+  __IM  uint32_t MVFR0;                  /*!< Offset: 0x240 (R/ )  Media and VFP Feature Register 0 */\r
+  __IM  uint32_t MVFR1;                  /*!< Offset: 0x244 (R/ )  Media and VFP Feature Register 1 */\r
+  __IM  uint32_t MVFR2;                  /*!< Offset: 0x248 (R/ )  Media and VFP Feature Register 2 */\r
+        uint32_t RESERVED5[1U];\r
+  __OM  uint32_t ICIALLU;                /*!< Offset: 0x250 ( /W)  I-Cache Invalidate All to PoU */\r
+        uint32_t RESERVED6[1U];\r
+  __OM  uint32_t ICIMVAU;                /*!< Offset: 0x258 ( /W)  I-Cache Invalidate by MVA to PoU */\r
+  __OM  uint32_t DCIMVAC;                /*!< Offset: 0x25C ( /W)  D-Cache Invalidate by MVA to PoC */\r
+  __OM  uint32_t DCISW;                  /*!< Offset: 0x260 ( /W)  D-Cache Invalidate by Set-way */\r
+  __OM  uint32_t DCCMVAU;                /*!< Offset: 0x264 ( /W)  D-Cache Clean by MVA to PoU */\r
+  __OM  uint32_t DCCMVAC;                /*!< Offset: 0x268 ( /W)  D-Cache Clean by MVA to PoC */\r
+  __OM  uint32_t DCCSW;                  /*!< Offset: 0x26C ( /W)  D-Cache Clean by Set-way */\r
+  __OM  uint32_t DCCIMVAC;               /*!< Offset: 0x270 ( /W)  D-Cache Clean and Invalidate by MVA to PoC */\r
+  __OM  uint32_t DCCISW;                 /*!< Offset: 0x274 ( /W)  D-Cache Clean and Invalidate by Set-way */\r
+        uint32_t RESERVED7[6U];\r
+  __IOM uint32_t ITCMCR;                 /*!< Offset: 0x290 (R/W)  Instruction Tightly-Coupled Memory Control Register */\r
+  __IOM uint32_t DTCMCR;                 /*!< Offset: 0x294 (R/W)  Data Tightly-Coupled Memory Control Registers */\r
+  __IOM uint32_t AHBPCR;                 /*!< Offset: 0x298 (R/W)  AHBP Control Register */\r
+  __IOM uint32_t CACR;                   /*!< Offset: 0x29C (R/W)  L1 Cache Control Register */\r
+  __IOM uint32_t AHBSCR;                 /*!< Offset: 0x2A0 (R/W)  AHB Slave Control Register */\r
+        uint32_t RESERVED8[1U];\r
+  __IOM uint32_t ABFSR;                  /*!< Offset: 0x2A8 (R/W)  Auxiliary Bus Fault Status Register */\r
+} SCB_Type;\r
+\r
+/* SCB CPUID Register Definitions */\r
+#define SCB_CPUID_IMPLEMENTER_Pos          24U                                            /*!< SCB CPUID: IMPLEMENTER Position */\r
+#define SCB_CPUID_IMPLEMENTER_Msk          (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos)          /*!< SCB CPUID: IMPLEMENTER Mask */\r
+\r
+#define SCB_CPUID_VARIANT_Pos              20U                                            /*!< SCB CPUID: VARIANT Position */\r
+#define SCB_CPUID_VARIANT_Msk              (0xFUL << SCB_CPUID_VARIANT_Pos)               /*!< SCB CPUID: VARIANT Mask */\r
+\r
+#define SCB_CPUID_ARCHITECTURE_Pos         16U                                            /*!< SCB CPUID: ARCHITECTURE Position */\r
+#define SCB_CPUID_ARCHITECTURE_Msk         (0xFUL << SCB_CPUID_ARCHITECTURE_Pos)          /*!< SCB CPUID: ARCHITECTURE Mask */\r
+\r
+#define SCB_CPUID_PARTNO_Pos                4U                                            /*!< SCB CPUID: PARTNO Position */\r
+#define SCB_CPUID_PARTNO_Msk               (0xFFFUL << SCB_CPUID_PARTNO_Pos)              /*!< SCB CPUID: PARTNO Mask */\r
+\r
+#define SCB_CPUID_REVISION_Pos              0U                                            /*!< SCB CPUID: REVISION Position */\r
+#define SCB_CPUID_REVISION_Msk             (0xFUL /*<< SCB_CPUID_REVISION_Pos*/)          /*!< SCB CPUID: REVISION Mask */\r
+\r
+/* SCB Interrupt Control State Register Definitions */\r
+#define SCB_ICSR_NMIPENDSET_Pos            31U                                            /*!< SCB ICSR: NMIPENDSET Position */\r
+#define SCB_ICSR_NMIPENDSET_Msk            (1UL << SCB_ICSR_NMIPENDSET_Pos)               /*!< SCB ICSR: NMIPENDSET Mask */\r
+\r
+#define SCB_ICSR_PENDSVSET_Pos             28U                                            /*!< SCB ICSR: PENDSVSET Position */\r
+#define SCB_ICSR_PENDSVSET_Msk             (1UL << SCB_ICSR_PENDSVSET_Pos)                /*!< SCB ICSR: PENDSVSET Mask */\r
+\r
+#define SCB_ICSR_PENDSVCLR_Pos             27U                                            /*!< SCB ICSR: PENDSVCLR Position */\r
+#define SCB_ICSR_PENDSVCLR_Msk             (1UL << SCB_ICSR_PENDSVCLR_Pos)                /*!< SCB ICSR: PENDSVCLR Mask */\r
+\r
+#define SCB_ICSR_PENDSTSET_Pos             26U                                            /*!< SCB ICSR: PENDSTSET Position */\r
+#define SCB_ICSR_PENDSTSET_Msk             (1UL << SCB_ICSR_PENDSTSET_Pos)                /*!< SCB ICSR: PENDSTSET Mask */\r
+\r
+#define SCB_ICSR_PENDSTCLR_Pos             25U                                            /*!< SCB ICSR: PENDSTCLR Position */\r
+#define SCB_ICSR_PENDSTCLR_Msk             (1UL << SCB_ICSR_PENDSTCLR_Pos)                /*!< SCB ICSR: PENDSTCLR Mask */\r
+\r
+#define SCB_ICSR_ISRPREEMPT_Pos            23U                                            /*!< SCB ICSR: ISRPREEMPT Position */\r
+#define SCB_ICSR_ISRPREEMPT_Msk            (1UL << SCB_ICSR_ISRPREEMPT_Pos)               /*!< SCB ICSR: ISRPREEMPT Mask */\r
+\r
+#define SCB_ICSR_ISRPENDING_Pos            22U                                            /*!< SCB ICSR: ISRPENDING Position */\r
+#define SCB_ICSR_ISRPENDING_Msk            (1UL << SCB_ICSR_ISRPENDING_Pos)               /*!< SCB ICSR: ISRPENDING Mask */\r
+\r
+#define SCB_ICSR_VECTPENDING_Pos           12U                                            /*!< SCB ICSR: VECTPENDING Position */\r
+#define SCB_ICSR_VECTPENDING_Msk           (0x1FFUL << SCB_ICSR_VECTPENDING_Pos)          /*!< SCB ICSR: VECTPENDING Mask */\r
+\r
+#define SCB_ICSR_RETTOBASE_Pos             11U                                            /*!< SCB ICSR: RETTOBASE Position */\r
+#define SCB_ICSR_RETTOBASE_Msk             (1UL << SCB_ICSR_RETTOBASE_Pos)                /*!< SCB ICSR: RETTOBASE Mask */\r
+\r
+#define SCB_ICSR_VECTACTIVE_Pos             0U                                            /*!< SCB ICSR: VECTACTIVE Position */\r
+#define SCB_ICSR_VECTACTIVE_Msk            (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/)       /*!< SCB ICSR: VECTACTIVE Mask */\r
+\r
+/* SCB Vector Table Offset Register Definitions */\r
+#define SCB_VTOR_TBLOFF_Pos                 7U                                            /*!< SCB VTOR: TBLOFF Position */\r
+#define SCB_VTOR_TBLOFF_Msk                (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos)           /*!< SCB VTOR: TBLOFF Mask */\r
+\r
+/* SCB Application Interrupt and Reset Control Register Definitions */\r
+#define SCB_AIRCR_VECTKEY_Pos              16U                                            /*!< SCB AIRCR: VECTKEY Position */\r
+#define SCB_AIRCR_VECTKEY_Msk              (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos)            /*!< SCB AIRCR: VECTKEY Mask */\r
+\r
+#define SCB_AIRCR_VECTKEYSTAT_Pos          16U                                            /*!< SCB AIRCR: VECTKEYSTAT Position */\r
+#define SCB_AIRCR_VECTKEYSTAT_Msk          (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos)        /*!< SCB AIRCR: VECTKEYSTAT Mask */\r
+\r
+#define SCB_AIRCR_ENDIANESS_Pos            15U                                            /*!< SCB AIRCR: ENDIANESS Position */\r
+#define SCB_AIRCR_ENDIANESS_Msk            (1UL << SCB_AIRCR_ENDIANESS_Pos)               /*!< SCB AIRCR: ENDIANESS Mask */\r
+\r
+#define SCB_AIRCR_PRIGROUP_Pos              8U                                            /*!< SCB AIRCR: PRIGROUP Position */\r
+#define SCB_AIRCR_PRIGROUP_Msk             (7UL << SCB_AIRCR_PRIGROUP_Pos)                /*!< SCB AIRCR: PRIGROUP Mask */\r
+\r
+#define SCB_AIRCR_SYSRESETREQ_Pos           2U                                            /*!< SCB AIRCR: SYSRESETREQ Position */\r
+#define SCB_AIRCR_SYSRESETREQ_Msk          (1UL << SCB_AIRCR_SYSRESETREQ_Pos)             /*!< SCB AIRCR: SYSRESETREQ Mask */\r
+\r
+#define SCB_AIRCR_VECTCLRACTIVE_Pos         1U                                            /*!< SCB AIRCR: VECTCLRACTIVE Position */\r
+#define SCB_AIRCR_VECTCLRACTIVE_Msk        (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos)           /*!< SCB AIRCR: VECTCLRACTIVE Mask */\r
+\r
+#define SCB_AIRCR_VECTRESET_Pos             0U                                            /*!< SCB AIRCR: VECTRESET Position */\r
+#define SCB_AIRCR_VECTRESET_Msk            (1UL /*<< SCB_AIRCR_VECTRESET_Pos*/)           /*!< SCB AIRCR: VECTRESET Mask */\r
+\r
+/* SCB System Control Register Definitions */\r
+#define SCB_SCR_SEVONPEND_Pos               4U                                            /*!< SCB SCR: SEVONPEND Position */\r
+#define SCB_SCR_SEVONPEND_Msk              (1UL << SCB_SCR_SEVONPEND_Pos)                 /*!< SCB SCR: SEVONPEND Mask */\r
+\r
+#define SCB_SCR_SLEEPDEEP_Pos               2U                                            /*!< SCB SCR: SLEEPDEEP Position */\r
+#define SCB_SCR_SLEEPDEEP_Msk              (1UL << SCB_SCR_SLEEPDEEP_Pos)                 /*!< SCB SCR: SLEEPDEEP Mask */\r
+\r
+#define SCB_SCR_SLEEPONEXIT_Pos             1U                                            /*!< SCB SCR: SLEEPONEXIT Position */\r
+#define SCB_SCR_SLEEPONEXIT_Msk            (1UL << SCB_SCR_SLEEPONEXIT_Pos)               /*!< SCB SCR: SLEEPONEXIT Mask */\r
+\r
+/* SCB Configuration Control Register Definitions */\r
+#define SCB_CCR_BP_Pos                      18U                                           /*!< SCB CCR: Branch prediction enable bit Position */\r
+#define SCB_CCR_BP_Msk                     (1UL << SCB_CCR_BP_Pos)                        /*!< SCB CCR: Branch prediction enable bit Mask */\r
+\r
+#define SCB_CCR_IC_Pos                      17U                                           /*!< SCB CCR: Instruction cache enable bit Position */\r
+#define SCB_CCR_IC_Msk                     (1UL << SCB_CCR_IC_Pos)                        /*!< SCB CCR: Instruction cache enable bit Mask */\r
+\r
+#define SCB_CCR_DC_Pos                      16U                                           /*!< SCB CCR: Cache enable bit Position */\r
+#define SCB_CCR_DC_Msk                     (1UL << SCB_CCR_DC_Pos)                        /*!< SCB CCR: Cache enable bit Mask */\r
+\r
+#define SCB_CCR_STKALIGN_Pos                9U                                            /*!< SCB CCR: STKALIGN Position */\r
+#define SCB_CCR_STKALIGN_Msk               (1UL << SCB_CCR_STKALIGN_Pos)                  /*!< SCB CCR: STKALIGN Mask */\r
+\r
+#define SCB_CCR_BFHFNMIGN_Pos               8U                                            /*!< SCB CCR: BFHFNMIGN Position */\r
+#define SCB_CCR_BFHFNMIGN_Msk              (1UL << SCB_CCR_BFHFNMIGN_Pos)                 /*!< SCB CCR: BFHFNMIGN Mask */\r
+\r
+#define SCB_CCR_DIV_0_TRP_Pos               4U                                            /*!< SCB CCR: DIV_0_TRP Position */\r
+#define SCB_CCR_DIV_0_TRP_Msk              (1UL << SCB_CCR_DIV_0_TRP_Pos)                 /*!< SCB CCR: DIV_0_TRP Mask */\r
+\r
+#define SCB_CCR_UNALIGN_TRP_Pos             3U                                            /*!< SCB CCR: UNALIGN_TRP Position */\r
+#define SCB_CCR_UNALIGN_TRP_Msk            (1UL << SCB_CCR_UNALIGN_TRP_Pos)               /*!< SCB CCR: UNALIGN_TRP Mask */\r
+\r
+#define SCB_CCR_USERSETMPEND_Pos            1U                                            /*!< SCB CCR: USERSETMPEND Position */\r
+#define SCB_CCR_USERSETMPEND_Msk           (1UL << SCB_CCR_USERSETMPEND_Pos)              /*!< SCB CCR: USERSETMPEND Mask */\r
+\r
+#define SCB_CCR_NONBASETHRDENA_Pos          0U                                            /*!< SCB CCR: NONBASETHRDENA Position */\r
+#define SCB_CCR_NONBASETHRDENA_Msk         (1UL /*<< SCB_CCR_NONBASETHRDENA_Pos*/)        /*!< SCB CCR: NONBASETHRDENA Mask */\r
+\r
+/* SCB System Handler Control and State Register Definitions */\r
+#define SCB_SHCSR_USGFAULTENA_Pos          18U                                            /*!< SCB SHCSR: USGFAULTENA Position */\r
+#define SCB_SHCSR_USGFAULTENA_Msk          (1UL << SCB_SHCSR_USGFAULTENA_Pos)             /*!< SCB SHCSR: USGFAULTENA Mask */\r
+\r
+#define SCB_SHCSR_BUSFAULTENA_Pos          17U                                            /*!< SCB SHCSR: BUSFAULTENA Position */\r
+#define SCB_SHCSR_BUSFAULTENA_Msk          (1UL << SCB_SHCSR_BUSFAULTENA_Pos)             /*!< SCB SHCSR: BUSFAULTENA Mask */\r
+\r
+#define SCB_SHCSR_MEMFAULTENA_Pos          16U                                            /*!< SCB SHCSR: MEMFAULTENA Position */\r
+#define SCB_SHCSR_MEMFAULTENA_Msk          (1UL << SCB_SHCSR_MEMFAULTENA_Pos)             /*!< SCB SHCSR: MEMFAULTENA Mask */\r
+\r
+#define SCB_SHCSR_SVCALLPENDED_Pos         15U                                            /*!< SCB SHCSR: SVCALLPENDED Position */\r
+#define SCB_SHCSR_SVCALLPENDED_Msk         (1UL << SCB_SHCSR_SVCALLPENDED_Pos)            /*!< SCB SHCSR: SVCALLPENDED Mask */\r
+\r
+#define SCB_SHCSR_BUSFAULTPENDED_Pos       14U                                            /*!< SCB SHCSR: BUSFAULTPENDED Position */\r
+#define SCB_SHCSR_BUSFAULTPENDED_Msk       (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos)          /*!< SCB SHCSR: BUSFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_MEMFAULTPENDED_Pos       13U                                            /*!< SCB SHCSR: MEMFAULTPENDED Position */\r
+#define SCB_SHCSR_MEMFAULTPENDED_Msk       (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos)          /*!< SCB SHCSR: MEMFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_USGFAULTPENDED_Pos       12U                                            /*!< SCB SHCSR: USGFAULTPENDED Position */\r
+#define SCB_SHCSR_USGFAULTPENDED_Msk       (1UL << SCB_SHCSR_USGFAULTPENDED_Pos)          /*!< SCB SHCSR: USGFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_SYSTICKACT_Pos           11U                                            /*!< SCB SHCSR: SYSTICKACT Position */\r
+#define SCB_SHCSR_SYSTICKACT_Msk           (1UL << SCB_SHCSR_SYSTICKACT_Pos)              /*!< SCB SHCSR: SYSTICKACT Mask */\r
+\r
+#define SCB_SHCSR_PENDSVACT_Pos            10U                                            /*!< SCB SHCSR: PENDSVACT Position */\r
+#define SCB_SHCSR_PENDSVACT_Msk            (1UL << SCB_SHCSR_PENDSVACT_Pos)               /*!< SCB SHCSR: PENDSVACT Mask */\r
+\r
+#define SCB_SHCSR_MONITORACT_Pos            8U                                            /*!< SCB SHCSR: MONITORACT Position */\r
+#define SCB_SHCSR_MONITORACT_Msk           (1UL << SCB_SHCSR_MONITORACT_Pos)              /*!< SCB SHCSR: MONITORACT Mask */\r
+\r
+#define SCB_SHCSR_SVCALLACT_Pos             7U                                            /*!< SCB SHCSR: SVCALLACT Position */\r
+#define SCB_SHCSR_SVCALLACT_Msk            (1UL << SCB_SHCSR_SVCALLACT_Pos)               /*!< SCB SHCSR: SVCALLACT Mask */\r
+\r
+#define SCB_SHCSR_USGFAULTACT_Pos           3U                                            /*!< SCB SHCSR: USGFAULTACT Position */\r
+#define SCB_SHCSR_USGFAULTACT_Msk          (1UL << SCB_SHCSR_USGFAULTACT_Pos)             /*!< SCB SHCSR: USGFAULTACT Mask */\r
+\r
+#define SCB_SHCSR_BUSFAULTACT_Pos           1U                                            /*!< SCB SHCSR: BUSFAULTACT Position */\r
+#define SCB_SHCSR_BUSFAULTACT_Msk          (1UL << SCB_SHCSR_BUSFAULTACT_Pos)             /*!< SCB SHCSR: BUSFAULTACT Mask */\r
+\r
+#define SCB_SHCSR_MEMFAULTACT_Pos           0U                                            /*!< SCB SHCSR: MEMFAULTACT Position */\r
+#define SCB_SHCSR_MEMFAULTACT_Msk          (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/)         /*!< SCB SHCSR: MEMFAULTACT Mask */\r
+\r
+/* SCB Configurable Fault Status Register Definitions */\r
+#define SCB_CFSR_USGFAULTSR_Pos            16U                                            /*!< SCB CFSR: Usage Fault Status Register Position */\r
+#define SCB_CFSR_USGFAULTSR_Msk            (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos)          /*!< SCB CFSR: Usage Fault Status Register Mask */\r
+\r
+#define SCB_CFSR_BUSFAULTSR_Pos             8U                                            /*!< SCB CFSR: Bus Fault Status Register Position */\r
+#define SCB_CFSR_BUSFAULTSR_Msk            (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos)            /*!< SCB CFSR: Bus Fault Status Register Mask */\r
+\r
+#define SCB_CFSR_MEMFAULTSR_Pos             0U                                            /*!< SCB CFSR: Memory Manage Fault Status Register Position */\r
+#define SCB_CFSR_MEMFAULTSR_Msk            (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/)        /*!< SCB CFSR: Memory Manage Fault Status Register Mask */\r
+\r
+/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */\r
+#define SCB_CFSR_MMARVALID_Pos             (SCB_SHCSR_MEMFAULTACT_Pos + 7U)               /*!< SCB CFSR (MMFSR): MMARVALID Position */\r
+#define SCB_CFSR_MMARVALID_Msk             (1UL << SCB_CFSR_MMARVALID_Pos)                /*!< SCB CFSR (MMFSR): MMARVALID Mask */\r
+\r
+#define SCB_CFSR_MLSPERR_Pos               (SCB_SHCSR_MEMFAULTACT_Pos + 5U)               /*!< SCB CFSR (MMFSR): MLSPERR Position */\r
+#define SCB_CFSR_MLSPERR_Msk               (1UL << SCB_CFSR_MLSPERR_Pos)                  /*!< SCB CFSR (MMFSR): MLSPERR Mask */\r
+\r
+#define SCB_CFSR_MSTKERR_Pos               (SCB_SHCSR_MEMFAULTACT_Pos + 4U)               /*!< SCB CFSR (MMFSR): MSTKERR Position */\r
+#define SCB_CFSR_MSTKERR_Msk               (1UL << SCB_CFSR_MSTKERR_Pos)                  /*!< SCB CFSR (MMFSR): MSTKERR Mask */\r
+\r
+#define SCB_CFSR_MUNSTKERR_Pos             (SCB_SHCSR_MEMFAULTACT_Pos + 3U)               /*!< SCB CFSR (MMFSR): MUNSTKERR Position */\r
+#define SCB_CFSR_MUNSTKERR_Msk             (1UL << SCB_CFSR_MUNSTKERR_Pos)                /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */\r
+\r
+#define SCB_CFSR_DACCVIOL_Pos              (SCB_SHCSR_MEMFAULTACT_Pos + 1U)               /*!< SCB CFSR (MMFSR): DACCVIOL Position */\r
+#define SCB_CFSR_DACCVIOL_Msk              (1UL << SCB_CFSR_DACCVIOL_Pos)                 /*!< SCB CFSR (MMFSR): DACCVIOL Mask */\r
+\r
+#define SCB_CFSR_IACCVIOL_Pos              (SCB_SHCSR_MEMFAULTACT_Pos + 0U)               /*!< SCB CFSR (MMFSR): IACCVIOL Position */\r
+#define SCB_CFSR_IACCVIOL_Msk              (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/)             /*!< SCB CFSR (MMFSR): IACCVIOL Mask */\r
+\r
+/* BusFault Status Register (part of SCB Configurable Fault Status Register) */\r
+#define SCB_CFSR_BFARVALID_Pos            (SCB_CFSR_BUSFAULTSR_Pos + 7U)                  /*!< SCB CFSR (BFSR): BFARVALID Position */\r
+#define SCB_CFSR_BFARVALID_Msk            (1UL << SCB_CFSR_BFARVALID_Pos)                 /*!< SCB CFSR (BFSR): BFARVALID Mask */\r
+\r
+#define SCB_CFSR_LSPERR_Pos               (SCB_CFSR_BUSFAULTSR_Pos + 5U)                  /*!< SCB CFSR (BFSR): LSPERR Position */\r
+#define SCB_CFSR_LSPERR_Msk               (1UL << SCB_CFSR_LSPERR_Pos)                    /*!< SCB CFSR (BFSR): LSPERR Mask */\r
+\r
+#define SCB_CFSR_STKERR_Pos               (SCB_CFSR_BUSFAULTSR_Pos + 4U)                  /*!< SCB CFSR (BFSR): STKERR Position */\r
+#define SCB_CFSR_STKERR_Msk               (1UL << SCB_CFSR_STKERR_Pos)                    /*!< SCB CFSR (BFSR): STKERR Mask */\r
+\r
+#define SCB_CFSR_UNSTKERR_Pos             (SCB_CFSR_BUSFAULTSR_Pos + 3U)                  /*!< SCB CFSR (BFSR): UNSTKERR Position */\r
+#define SCB_CFSR_UNSTKERR_Msk             (1UL << SCB_CFSR_UNSTKERR_Pos)                  /*!< SCB CFSR (BFSR): UNSTKERR Mask */\r
+\r
+#define SCB_CFSR_IMPRECISERR_Pos          (SCB_CFSR_BUSFAULTSR_Pos + 2U)                  /*!< SCB CFSR (BFSR): IMPRECISERR Position */\r
+#define SCB_CFSR_IMPRECISERR_Msk          (1UL << SCB_CFSR_IMPRECISERR_Pos)               /*!< SCB CFSR (BFSR): IMPRECISERR Mask */\r
+\r
+#define SCB_CFSR_PRECISERR_Pos            (SCB_CFSR_BUSFAULTSR_Pos + 1U)                  /*!< SCB CFSR (BFSR): PRECISERR Position */\r
+#define SCB_CFSR_PRECISERR_Msk            (1UL << SCB_CFSR_PRECISERR_Pos)                 /*!< SCB CFSR (BFSR): PRECISERR Mask */\r
+\r
+#define SCB_CFSR_IBUSERR_Pos              (SCB_CFSR_BUSFAULTSR_Pos + 0U)                  /*!< SCB CFSR (BFSR): IBUSERR Position */\r
+#define SCB_CFSR_IBUSERR_Msk              (1UL << SCB_CFSR_IBUSERR_Pos)                   /*!< SCB CFSR (BFSR): IBUSERR Mask */\r
+\r
+/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */\r
+#define SCB_CFSR_DIVBYZERO_Pos            (SCB_CFSR_USGFAULTSR_Pos + 9U)                  /*!< SCB CFSR (UFSR): DIVBYZERO Position */\r
+#define SCB_CFSR_DIVBYZERO_Msk            (1UL << SCB_CFSR_DIVBYZERO_Pos)                 /*!< SCB CFSR (UFSR): DIVBYZERO Mask */\r
+\r
+#define SCB_CFSR_UNALIGNED_Pos            (SCB_CFSR_USGFAULTSR_Pos + 8U)                  /*!< SCB CFSR (UFSR): UNALIGNED Position */\r
+#define SCB_CFSR_UNALIGNED_Msk            (1UL << SCB_CFSR_UNALIGNED_Pos)                 /*!< SCB CFSR (UFSR): UNALIGNED Mask */\r
+\r
+#define SCB_CFSR_NOCP_Pos                 (SCB_CFSR_USGFAULTSR_Pos + 3U)                  /*!< SCB CFSR (UFSR): NOCP Position */\r
+#define SCB_CFSR_NOCP_Msk                 (1UL << SCB_CFSR_NOCP_Pos)                      /*!< SCB CFSR (UFSR): NOCP Mask */\r
+\r
+#define SCB_CFSR_INVPC_Pos                (SCB_CFSR_USGFAULTSR_Pos + 2U)                  /*!< SCB CFSR (UFSR): INVPC Position */\r
+#define SCB_CFSR_INVPC_Msk                (1UL << SCB_CFSR_INVPC_Pos)                     /*!< SCB CFSR (UFSR): INVPC Mask */\r
+\r
+#define SCB_CFSR_INVSTATE_Pos             (SCB_CFSR_USGFAULTSR_Pos + 1U)                  /*!< SCB CFSR (UFSR): INVSTATE Position */\r
+#define SCB_CFSR_INVSTATE_Msk             (1UL << SCB_CFSR_INVSTATE_Pos)                  /*!< SCB CFSR (UFSR): INVSTATE Mask */\r
+\r
+#define SCB_CFSR_UNDEFINSTR_Pos           (SCB_CFSR_USGFAULTSR_Pos + 0U)                  /*!< SCB CFSR (UFSR): UNDEFINSTR Position */\r
+#define SCB_CFSR_UNDEFINSTR_Msk           (1UL << SCB_CFSR_UNDEFINSTR_Pos)                /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */\r
+\r
+/* SCB Hard Fault Status Register Definitions */\r
+#define SCB_HFSR_DEBUGEVT_Pos              31U                                            /*!< SCB HFSR: DEBUGEVT Position */\r
+#define SCB_HFSR_DEBUGEVT_Msk              (1UL << SCB_HFSR_DEBUGEVT_Pos)                 /*!< SCB HFSR: DEBUGEVT Mask */\r
+\r
+#define SCB_HFSR_FORCED_Pos                30U                                            /*!< SCB HFSR: FORCED Position */\r
+#define SCB_HFSR_FORCED_Msk                (1UL << SCB_HFSR_FORCED_Pos)                   /*!< SCB HFSR: FORCED Mask */\r
+\r
+#define SCB_HFSR_VECTTBL_Pos                1U                                            /*!< SCB HFSR: VECTTBL Position */\r
+#define SCB_HFSR_VECTTBL_Msk               (1UL << SCB_HFSR_VECTTBL_Pos)                  /*!< SCB HFSR: VECTTBL Mask */\r
+\r
+/* SCB Debug Fault Status Register Definitions */\r
+#define SCB_DFSR_EXTERNAL_Pos               4U                                            /*!< SCB DFSR: EXTERNAL Position */\r
+#define SCB_DFSR_EXTERNAL_Msk              (1UL << SCB_DFSR_EXTERNAL_Pos)                 /*!< SCB DFSR: EXTERNAL Mask */\r
+\r
+#define SCB_DFSR_VCATCH_Pos                 3U                                            /*!< SCB DFSR: VCATCH Position */\r
+#define SCB_DFSR_VCATCH_Msk                (1UL << SCB_DFSR_VCATCH_Pos)                   /*!< SCB DFSR: VCATCH Mask */\r
+\r
+#define SCB_DFSR_DWTTRAP_Pos                2U                                            /*!< SCB DFSR: DWTTRAP Position */\r
+#define SCB_DFSR_DWTTRAP_Msk               (1UL << SCB_DFSR_DWTTRAP_Pos)                  /*!< SCB DFSR: DWTTRAP Mask */\r
+\r
+#define SCB_DFSR_BKPT_Pos                   1U                                            /*!< SCB DFSR: BKPT Position */\r
+#define SCB_DFSR_BKPT_Msk                  (1UL << SCB_DFSR_BKPT_Pos)                     /*!< SCB DFSR: BKPT Mask */\r
+\r
+#define SCB_DFSR_HALTED_Pos                 0U                                            /*!< SCB DFSR: HALTED Position */\r
+#define SCB_DFSR_HALTED_Msk                (1UL /*<< SCB_DFSR_HALTED_Pos*/)               /*!< SCB DFSR: HALTED Mask */\r
+\r
+/* SCB Cache Level ID Register Definitions */\r
+#define SCB_CLIDR_LOUU_Pos                 27U                                            /*!< SCB CLIDR: LoUU Position */\r
+#define SCB_CLIDR_LOUU_Msk                 (7UL << SCB_CLIDR_LOUU_Pos)                    /*!< SCB CLIDR: LoUU Mask */\r
+\r
+#define SCB_CLIDR_LOC_Pos                  24U                                            /*!< SCB CLIDR: LoC Position */\r
+#define SCB_CLIDR_LOC_Msk                  (7UL << SCB_CLIDR_LOC_Pos)                     /*!< SCB CLIDR: LoC Mask */\r
+\r
+/* SCB Cache Type Register Definitions */\r
+#define SCB_CTR_FORMAT_Pos                 29U                                            /*!< SCB CTR: Format Position */\r
+#define SCB_CTR_FORMAT_Msk                 (7UL << SCB_CTR_FORMAT_Pos)                    /*!< SCB CTR: Format Mask */\r
+\r
+#define SCB_CTR_CWG_Pos                    24U                                            /*!< SCB CTR: CWG Position */\r
+#define SCB_CTR_CWG_Msk                    (0xFUL << SCB_CTR_CWG_Pos)                     /*!< SCB CTR: CWG Mask */\r
+\r
+#define SCB_CTR_ERG_Pos                    20U                                            /*!< SCB CTR: ERG Position */\r
+#define SCB_CTR_ERG_Msk                    (0xFUL << SCB_CTR_ERG_Pos)                     /*!< SCB CTR: ERG Mask */\r
+\r
+#define SCB_CTR_DMINLINE_Pos               16U                                            /*!< SCB CTR: DminLine Position */\r
+#define SCB_CTR_DMINLINE_Msk               (0xFUL << SCB_CTR_DMINLINE_Pos)                /*!< SCB CTR: DminLine Mask */\r
+\r
+#define SCB_CTR_IMINLINE_Pos                0U                                            /*!< SCB CTR: ImInLine Position */\r
+#define SCB_CTR_IMINLINE_Msk               (0xFUL /*<< SCB_CTR_IMINLINE_Pos*/)            /*!< SCB CTR: ImInLine Mask */\r
+\r
+/* SCB Cache Size ID Register Definitions */\r
+#define SCB_CCSIDR_WT_Pos                  31U                                            /*!< SCB CCSIDR: WT Position */\r
+#define SCB_CCSIDR_WT_Msk                  (1UL << SCB_CCSIDR_WT_Pos)                     /*!< SCB CCSIDR: WT Mask */\r
+\r
+#define SCB_CCSIDR_WB_Pos                  30U                                            /*!< SCB CCSIDR: WB Position */\r
+#define SCB_CCSIDR_WB_Msk                  (1UL << SCB_CCSIDR_WB_Pos)                     /*!< SCB CCSIDR: WB Mask */\r
+\r
+#define SCB_CCSIDR_RA_Pos                  29U                                            /*!< SCB CCSIDR: RA Position */\r
+#define SCB_CCSIDR_RA_Msk                  (1UL << SCB_CCSIDR_RA_Pos)                     /*!< SCB CCSIDR: RA Mask */\r
+\r
+#define SCB_CCSIDR_WA_Pos                  28U                                            /*!< SCB CCSIDR: WA Position */\r
+#define SCB_CCSIDR_WA_Msk                  (1UL << SCB_CCSIDR_WA_Pos)                     /*!< SCB CCSIDR: WA Mask */\r
+\r
+#define SCB_CCSIDR_NUMSETS_Pos             13U                                            /*!< SCB CCSIDR: NumSets Position */\r
+#define SCB_CCSIDR_NUMSETS_Msk             (0x7FFFUL << SCB_CCSIDR_NUMSETS_Pos)           /*!< SCB CCSIDR: NumSets Mask */\r
+\r
+#define SCB_CCSIDR_ASSOCIATIVITY_Pos        3U                                            /*!< SCB CCSIDR: Associativity Position */\r
+#define SCB_CCSIDR_ASSOCIATIVITY_Msk       (0x3FFUL << SCB_CCSIDR_ASSOCIATIVITY_Pos)      /*!< SCB CCSIDR: Associativity Mask */\r
+\r
+#define SCB_CCSIDR_LINESIZE_Pos             0U                                            /*!< SCB CCSIDR: LineSize Position */\r
+#define SCB_CCSIDR_LINESIZE_Msk            (7UL /*<< SCB_CCSIDR_LINESIZE_Pos*/)           /*!< SCB CCSIDR: LineSize Mask */\r
+\r
+/* SCB Cache Size Selection Register Definitions */\r
+#define SCB_CSSELR_LEVEL_Pos                1U                                            /*!< SCB CSSELR: Level Position */\r
+#define SCB_CSSELR_LEVEL_Msk               (7UL << SCB_CSSELR_LEVEL_Pos)                  /*!< SCB CSSELR: Level Mask */\r
+\r
+#define SCB_CSSELR_IND_Pos                  0U                                            /*!< SCB CSSELR: InD Position */\r
+#define SCB_CSSELR_IND_Msk                 (1UL /*<< SCB_CSSELR_IND_Pos*/)                /*!< SCB CSSELR: InD Mask */\r
+\r
+/* SCB Software Triggered Interrupt Register Definitions */\r
+#define SCB_STIR_INTID_Pos                  0U                                            /*!< SCB STIR: INTID Position */\r
+#define SCB_STIR_INTID_Msk                 (0x1FFUL /*<< SCB_STIR_INTID_Pos*/)            /*!< SCB STIR: INTID Mask */\r
+\r
+/* SCB D-Cache Invalidate by Set-way Register Definitions */\r
+#define SCB_DCISW_WAY_Pos                  30U                                            /*!< SCB DCISW: Way Position */\r
+#define SCB_DCISW_WAY_Msk                  (3UL << SCB_DCISW_WAY_Pos)                     /*!< SCB DCISW: Way Mask */\r
+\r
+#define SCB_DCISW_SET_Pos                   5U                                            /*!< SCB DCISW: Set Position */\r
+#define SCB_DCISW_SET_Msk                  (0x1FFUL << SCB_DCISW_SET_Pos)                 /*!< SCB DCISW: Set Mask */\r
+\r
+/* SCB D-Cache Clean by Set-way Register Definitions */\r
+#define SCB_DCCSW_WAY_Pos                  30U                                            /*!< SCB DCCSW: Way Position */\r
+#define SCB_DCCSW_WAY_Msk                  (3UL << SCB_DCCSW_WAY_Pos)                     /*!< SCB DCCSW: Way Mask */\r
+\r
+#define SCB_DCCSW_SET_Pos                   5U                                            /*!< SCB DCCSW: Set Position */\r
+#define SCB_DCCSW_SET_Msk                  (0x1FFUL << SCB_DCCSW_SET_Pos)                 /*!< SCB DCCSW: Set Mask */\r
+\r
+/* SCB D-Cache Clean and Invalidate by Set-way Register Definitions */\r
+#define SCB_DCCISW_WAY_Pos                 30U                                            /*!< SCB DCCISW: Way Position */\r
+#define SCB_DCCISW_WAY_Msk                 (3UL << SCB_DCCISW_WAY_Pos)                    /*!< SCB DCCISW: Way Mask */\r
+\r
+#define SCB_DCCISW_SET_Pos                  5U                                            /*!< SCB DCCISW: Set Position */\r
+#define SCB_DCCISW_SET_Msk                 (0x1FFUL << SCB_DCCISW_SET_Pos)                /*!< SCB DCCISW: Set Mask */\r
+\r
+/* Instruction Tightly-Coupled Memory Control Register Definitions */\r
+#define SCB_ITCMCR_SZ_Pos                   3U                                            /*!< SCB ITCMCR: SZ Position */\r
+#define SCB_ITCMCR_SZ_Msk                  (0xFUL << SCB_ITCMCR_SZ_Pos)                   /*!< SCB ITCMCR: SZ Mask */\r
+\r
+#define SCB_ITCMCR_RETEN_Pos                2U                                            /*!< SCB ITCMCR: RETEN Position */\r
+#define SCB_ITCMCR_RETEN_Msk               (1UL << SCB_ITCMCR_RETEN_Pos)                  /*!< SCB ITCMCR: RETEN Mask */\r
+\r
+#define SCB_ITCMCR_RMW_Pos                  1U                                            /*!< SCB ITCMCR: RMW Position */\r
+#define SCB_ITCMCR_RMW_Msk                 (1UL << SCB_ITCMCR_RMW_Pos)                    /*!< SCB ITCMCR: RMW Mask */\r
+\r
+#define SCB_ITCMCR_EN_Pos                   0U                                            /*!< SCB ITCMCR: EN Position */\r
+#define SCB_ITCMCR_EN_Msk                  (1UL /*<< SCB_ITCMCR_EN_Pos*/)                 /*!< SCB ITCMCR: EN Mask */\r
+\r
+/* Data Tightly-Coupled Memory Control Register Definitions */\r
+#define SCB_DTCMCR_SZ_Pos                   3U                                            /*!< SCB DTCMCR: SZ Position */\r
+#define SCB_DTCMCR_SZ_Msk                  (0xFUL << SCB_DTCMCR_SZ_Pos)                   /*!< SCB DTCMCR: SZ Mask */\r
+\r
+#define SCB_DTCMCR_RETEN_Pos                2U                                            /*!< SCB DTCMCR: RETEN Position */\r
+#define SCB_DTCMCR_RETEN_Msk               (1UL << SCB_DTCMCR_RETEN_Pos)                   /*!< SCB DTCMCR: RETEN Mask */\r
+\r
+#define SCB_DTCMCR_RMW_Pos                  1U                                            /*!< SCB DTCMCR: RMW Position */\r
+#define SCB_DTCMCR_RMW_Msk                 (1UL << SCB_DTCMCR_RMW_Pos)                    /*!< SCB DTCMCR: RMW Mask */\r
+\r
+#define SCB_DTCMCR_EN_Pos                   0U                                            /*!< SCB DTCMCR: EN Position */\r
+#define SCB_DTCMCR_EN_Msk                  (1UL /*<< SCB_DTCMCR_EN_Pos*/)                 /*!< SCB DTCMCR: EN Mask */\r
+\r
+/* AHBP Control Register Definitions */\r
+#define SCB_AHBPCR_SZ_Pos                   1U                                            /*!< SCB AHBPCR: SZ Position */\r
+#define SCB_AHBPCR_SZ_Msk                  (7UL << SCB_AHBPCR_SZ_Pos)                     /*!< SCB AHBPCR: SZ Mask */\r
+\r
+#define SCB_AHBPCR_EN_Pos                   0U                                            /*!< SCB AHBPCR: EN Position */\r
+#define SCB_AHBPCR_EN_Msk                  (1UL /*<< SCB_AHBPCR_EN_Pos*/)                 /*!< SCB AHBPCR: EN Mask */\r
+\r
+/* L1 Cache Control Register Definitions */\r
+#define SCB_CACR_FORCEWT_Pos                2U                                            /*!< SCB CACR: FORCEWT Position */\r
+#define SCB_CACR_FORCEWT_Msk               (1UL << SCB_CACR_FORCEWT_Pos)                  /*!< SCB CACR: FORCEWT Mask */\r
+\r
+#define SCB_CACR_ECCEN_Pos                  1U                                            /*!< SCB CACR: ECCEN Position */\r
+#define SCB_CACR_ECCEN_Msk                 (1UL << SCB_CACR_ECCEN_Pos)                    /*!< SCB CACR: ECCEN Mask */\r
+\r
+#define SCB_CACR_SIWT_Pos                   0U                                            /*!< SCB CACR: SIWT Position */\r
+#define SCB_CACR_SIWT_Msk                  (1UL /*<< SCB_CACR_SIWT_Pos*/)                 /*!< SCB CACR: SIWT Mask */\r
+\r
+/* AHBS Control Register Definitions */\r
+#define SCB_AHBSCR_INITCOUNT_Pos           11U                                            /*!< SCB AHBSCR: INITCOUNT Position */\r
+#define SCB_AHBSCR_INITCOUNT_Msk           (0x1FUL << SCB_AHBPCR_INITCOUNT_Pos)           /*!< SCB AHBSCR: INITCOUNT Mask */\r
+\r
+#define SCB_AHBSCR_TPRI_Pos                 2U                                            /*!< SCB AHBSCR: TPRI Position */\r
+#define SCB_AHBSCR_TPRI_Msk                (0x1FFUL << SCB_AHBPCR_TPRI_Pos)               /*!< SCB AHBSCR: TPRI Mask */\r
+\r
+#define SCB_AHBSCR_CTL_Pos                  0U                                            /*!< SCB AHBSCR: CTL Position*/\r
+#define SCB_AHBSCR_CTL_Msk                 (3UL /*<< SCB_AHBPCR_CTL_Pos*/)                /*!< SCB AHBSCR: CTL Mask */\r
+\r
+/* Auxiliary Bus Fault Status Register Definitions */\r
+#define SCB_ABFSR_AXIMTYPE_Pos              8U                                            /*!< SCB ABFSR: AXIMTYPE Position*/\r
+#define SCB_ABFSR_AXIMTYPE_Msk             (3UL << SCB_ABFSR_AXIMTYPE_Pos)                /*!< SCB ABFSR: AXIMTYPE Mask */\r
+\r
+#define SCB_ABFSR_EPPB_Pos                  4U                                            /*!< SCB ABFSR: EPPB Position*/\r
+#define SCB_ABFSR_EPPB_Msk                 (1UL << SCB_ABFSR_EPPB_Pos)                    /*!< SCB ABFSR: EPPB Mask */\r
+\r
+#define SCB_ABFSR_AXIM_Pos                  3U                                            /*!< SCB ABFSR: AXIM Position*/\r
+#define SCB_ABFSR_AXIM_Msk                 (1UL << SCB_ABFSR_AXIM_Pos)                    /*!< SCB ABFSR: AXIM Mask */\r
+\r
+#define SCB_ABFSR_AHBP_Pos                  2U                                            /*!< SCB ABFSR: AHBP Position*/\r
+#define SCB_ABFSR_AHBP_Msk                 (1UL << SCB_ABFSR_AHBP_Pos)                    /*!< SCB ABFSR: AHBP Mask */\r
+\r
+#define SCB_ABFSR_DTCM_Pos                  1U                                            /*!< SCB ABFSR: DTCM Position*/\r
+#define SCB_ABFSR_DTCM_Msk                 (1UL << SCB_ABFSR_DTCM_Pos)                    /*!< SCB ABFSR: DTCM Mask */\r
+\r
+#define SCB_ABFSR_ITCM_Pos                  0U                                            /*!< SCB ABFSR: ITCM Position*/\r
+#define SCB_ABFSR_ITCM_Msk                 (1UL /*<< SCB_ABFSR_ITCM_Pos*/)                /*!< SCB ABFSR: ITCM Mask */\r
+\r
+/*@} end of group CMSIS_SCB */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB)\r
+  \brief    Type definitions for the System Control and ID Register not in the SCB\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Control and ID Register not in the SCB.\r
+ */\r
+typedef struct\r
+{\r
+        uint32_t RESERVED0[1U];\r
+  __IM  uint32_t ICTR;                   /*!< Offset: 0x004 (R/ )  Interrupt Controller Type Register */\r
+  __IOM uint32_t ACTLR;                  /*!< Offset: 0x008 (R/W)  Auxiliary Control Register */\r
+} SCnSCB_Type;\r
+\r
+/* Interrupt Controller Type Register Definitions */\r
+#define SCnSCB_ICTR_INTLINESNUM_Pos         0U                                         /*!< ICTR: INTLINESNUM Position */\r
+#define SCnSCB_ICTR_INTLINESNUM_Msk        (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/)  /*!< ICTR: INTLINESNUM Mask */\r
+\r
+/* Auxiliary Control Register Definitions */\r
+#define SCnSCB_ACTLR_DISITMATBFLUSH_Pos    12U                                         /*!< ACTLR: DISITMATBFLUSH Position */\r
+#define SCnSCB_ACTLR_DISITMATBFLUSH_Msk    (1UL << SCnSCB_ACTLR_DISITMATBFLUSH_Pos)    /*!< ACTLR: DISITMATBFLUSH Mask */\r
+\r
+#define SCnSCB_ACTLR_DISRAMODE_Pos         11U                                         /*!< ACTLR: DISRAMODE Position */\r
+#define SCnSCB_ACTLR_DISRAMODE_Msk         (1UL << SCnSCB_ACTLR_DISRAMODE_Pos)         /*!< ACTLR: DISRAMODE Mask */\r
+\r
+#define SCnSCB_ACTLR_FPEXCODIS_Pos         10U                                         /*!< ACTLR: FPEXCODIS Position */\r
+#define SCnSCB_ACTLR_FPEXCODIS_Msk         (1UL << SCnSCB_ACTLR_FPEXCODIS_Pos)         /*!< ACTLR: FPEXCODIS Mask */\r
+\r
+#define SCnSCB_ACTLR_DISFOLD_Pos            2U                                         /*!< ACTLR: DISFOLD Position */\r
+#define SCnSCB_ACTLR_DISFOLD_Msk           (1UL << SCnSCB_ACTLR_DISFOLD_Pos)           /*!< ACTLR: DISFOLD Mask */\r
+\r
+#define SCnSCB_ACTLR_DISMCYCINT_Pos         0U                                         /*!< ACTLR: DISMCYCINT Position */\r
+#define SCnSCB_ACTLR_DISMCYCINT_Msk        (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/)    /*!< ACTLR: DISMCYCINT Mask */\r
+\r
+/*@} end of group CMSIS_SCnotSCB */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SysTick     System Tick Timer (SysTick)\r
+  \brief    Type definitions for the System Timer Registers.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Timer (SysTick).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  SysTick Control and Status Register */\r
+  __IOM uint32_t LOAD;                   /*!< Offset: 0x004 (R/W)  SysTick Reload Value Register */\r
+  __IOM uint32_t VAL;                    /*!< Offset: 0x008 (R/W)  SysTick Current Value Register */\r
+  __IM  uint32_t CALIB;                  /*!< Offset: 0x00C (R/ )  SysTick Calibration Register */\r
+} SysTick_Type;\r
+\r
+/* SysTick Control / Status Register Definitions */\r
+#define SysTick_CTRL_COUNTFLAG_Pos         16U                                            /*!< SysTick CTRL: COUNTFLAG Position */\r
+#define SysTick_CTRL_COUNTFLAG_Msk         (1UL << SysTick_CTRL_COUNTFLAG_Pos)            /*!< SysTick CTRL: COUNTFLAG Mask */\r
+\r
+#define SysTick_CTRL_CLKSOURCE_Pos          2U                                            /*!< SysTick CTRL: CLKSOURCE Position */\r
+#define SysTick_CTRL_CLKSOURCE_Msk         (1UL << SysTick_CTRL_CLKSOURCE_Pos)            /*!< SysTick CTRL: CLKSOURCE Mask */\r
+\r
+#define SysTick_CTRL_TICKINT_Pos            1U                                            /*!< SysTick CTRL: TICKINT Position */\r
+#define SysTick_CTRL_TICKINT_Msk           (1UL << SysTick_CTRL_TICKINT_Pos)              /*!< SysTick CTRL: TICKINT Mask */\r
+\r
+#define SysTick_CTRL_ENABLE_Pos             0U                                            /*!< SysTick CTRL: ENABLE Position */\r
+#define SysTick_CTRL_ENABLE_Msk            (1UL /*<< SysTick_CTRL_ENABLE_Pos*/)           /*!< SysTick CTRL: ENABLE Mask */\r
+\r
+/* SysTick Reload Register Definitions */\r
+#define SysTick_LOAD_RELOAD_Pos             0U                                            /*!< SysTick LOAD: RELOAD Position */\r
+#define SysTick_LOAD_RELOAD_Msk            (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/)    /*!< SysTick LOAD: RELOAD Mask */\r
+\r
+/* SysTick Current Register Definitions */\r
+#define SysTick_VAL_CURRENT_Pos             0U                                            /*!< SysTick VAL: CURRENT Position */\r
+#define SysTick_VAL_CURRENT_Msk            (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/)    /*!< SysTick VAL: CURRENT Mask */\r
+\r
+/* SysTick Calibration Register Definitions */\r
+#define SysTick_CALIB_NOREF_Pos            31U                                            /*!< SysTick CALIB: NOREF Position */\r
+#define SysTick_CALIB_NOREF_Msk            (1UL << SysTick_CALIB_NOREF_Pos)               /*!< SysTick CALIB: NOREF Mask */\r
+\r
+#define SysTick_CALIB_SKEW_Pos             30U                                            /*!< SysTick CALIB: SKEW Position */\r
+#define SysTick_CALIB_SKEW_Msk             (1UL << SysTick_CALIB_SKEW_Pos)                /*!< SysTick CALIB: SKEW Mask */\r
+\r
+#define SysTick_CALIB_TENMS_Pos             0U                                            /*!< SysTick CALIB: TENMS Position */\r
+#define SysTick_CALIB_TENMS_Msk            (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/)    /*!< SysTick CALIB: TENMS Mask */\r
+\r
+/*@} end of group CMSIS_SysTick */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_ITM     Instrumentation Trace Macrocell (ITM)\r
+  \brief    Type definitions for the Instrumentation Trace Macrocell (ITM)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Instrumentation Trace Macrocell Register (ITM).\r
+ */\r
+typedef struct\r
+{\r
+  __OM  union\r
+  {\r
+    __OM  uint8_t    u8;                 /*!< Offset: 0x000 ( /W)  ITM Stimulus Port 8-bit */\r
+    __OM  uint16_t   u16;                /*!< Offset: 0x000 ( /W)  ITM Stimulus Port 16-bit */\r
+    __OM  uint32_t   u32;                /*!< Offset: 0x000 ( /W)  ITM Stimulus Port 32-bit */\r
+  }  PORT [32U];                         /*!< Offset: 0x000 ( /W)  ITM Stimulus Port Registers */\r
+        uint32_t RESERVED0[864U];\r
+  __IOM uint32_t TER;                    /*!< Offset: 0xE00 (R/W)  ITM Trace Enable Register */\r
+        uint32_t RESERVED1[15U];\r
+  __IOM uint32_t TPR;                    /*!< Offset: 0xE40 (R/W)  ITM Trace Privilege Register */\r
+        uint32_t RESERVED2[15U];\r
+  __IOM uint32_t TCR;                    /*!< Offset: 0xE80 (R/W)  ITM Trace Control Register */\r
+        uint32_t RESERVED3[29U];\r
+  __OM  uint32_t IWR;                    /*!< Offset: 0xEF8 ( /W)  ITM Integration Write Register */\r
+  __IM  uint32_t IRR;                    /*!< Offset: 0xEFC (R/ )  ITM Integration Read Register */\r
+  __IOM uint32_t IMCR;                   /*!< Offset: 0xF00 (R/W)  ITM Integration Mode Control Register */\r
+        uint32_t RESERVED4[43U];\r
+  __OM  uint32_t LAR;                    /*!< Offset: 0xFB0 ( /W)  ITM Lock Access Register */\r
+  __IM  uint32_t LSR;                    /*!< Offset: 0xFB4 (R/ )  ITM Lock Status Register */\r
+        uint32_t RESERVED5[6U];\r
+  __IM  uint32_t PID4;                   /*!< Offset: 0xFD0 (R/ )  ITM Peripheral Identification Register #4 */\r
+  __IM  uint32_t PID5;                   /*!< Offset: 0xFD4 (R/ )  ITM Peripheral Identification Register #5 */\r
+  __IM  uint32_t PID6;                   /*!< Offset: 0xFD8 (R/ )  ITM Peripheral Identification Register #6 */\r
+  __IM  uint32_t PID7;                   /*!< Offset: 0xFDC (R/ )  ITM Peripheral Identification Register #7 */\r
+  __IM  uint32_t PID0;                   /*!< Offset: 0xFE0 (R/ )  ITM Peripheral Identification Register #0 */\r
+  __IM  uint32_t PID1;                   /*!< Offset: 0xFE4 (R/ )  ITM Peripheral Identification Register #1 */\r
+  __IM  uint32_t PID2;                   /*!< Offset: 0xFE8 (R/ )  ITM Peripheral Identification Register #2 */\r
+  __IM  uint32_t PID3;                   /*!< Offset: 0xFEC (R/ )  ITM Peripheral Identification Register #3 */\r
+  __IM  uint32_t CID0;                   /*!< Offset: 0xFF0 (R/ )  ITM Component  Identification Register #0 */\r
+  __IM  uint32_t CID1;                   /*!< Offset: 0xFF4 (R/ )  ITM Component  Identification Register #1 */\r
+  __IM  uint32_t CID2;                   /*!< Offset: 0xFF8 (R/ )  ITM Component  Identification Register #2 */\r
+  __IM  uint32_t CID3;                   /*!< Offset: 0xFFC (R/ )  ITM Component  Identification Register #3 */\r
+} ITM_Type;\r
+\r
+/* ITM Trace Privilege Register Definitions */\r
+#define ITM_TPR_PRIVMASK_Pos                0U                                            /*!< ITM TPR: PRIVMASK Position */\r
+#define ITM_TPR_PRIVMASK_Msk               (0xFFFFFFFFUL /*<< ITM_TPR_PRIVMASK_Pos*/)     /*!< ITM TPR: PRIVMASK Mask */\r
+\r
+/* ITM Trace Control Register Definitions */\r
+#define ITM_TCR_BUSY_Pos                   23U                                            /*!< ITM TCR: BUSY Position */\r
+#define ITM_TCR_BUSY_Msk                   (1UL << ITM_TCR_BUSY_Pos)                      /*!< ITM TCR: BUSY Mask */\r
+\r
+#define ITM_TCR_TraceBusID_Pos             16U                                            /*!< ITM TCR: ATBID Position */\r
+#define ITM_TCR_TraceBusID_Msk             (0x7FUL << ITM_TCR_TraceBusID_Pos)             /*!< ITM TCR: ATBID Mask */\r
+\r
+#define ITM_TCR_GTSFREQ_Pos                10U                                            /*!< ITM TCR: Global timestamp frequency Position */\r
+#define ITM_TCR_GTSFREQ_Msk                (3UL << ITM_TCR_GTSFREQ_Pos)                   /*!< ITM TCR: Global timestamp frequency Mask */\r
+\r
+#define ITM_TCR_TSPrescale_Pos              8U                                            /*!< ITM TCR: TSPrescale Position */\r
+#define ITM_TCR_TSPrescale_Msk             (3UL << ITM_TCR_TSPrescale_Pos)                /*!< ITM TCR: TSPrescale Mask */\r
+\r
+#define ITM_TCR_SWOENA_Pos                  4U                                            /*!< ITM TCR: SWOENA Position */\r
+#define ITM_TCR_SWOENA_Msk                 (1UL << ITM_TCR_SWOENA_Pos)                    /*!< ITM TCR: SWOENA Mask */\r
+\r
+#define ITM_TCR_DWTENA_Pos                  3U                                            /*!< ITM TCR: DWTENA Position */\r
+#define ITM_TCR_DWTENA_Msk                 (1UL << ITM_TCR_DWTENA_Pos)                    /*!< ITM TCR: DWTENA Mask */\r
+\r
+#define ITM_TCR_SYNCENA_Pos                 2U                                            /*!< ITM TCR: SYNCENA Position */\r
+#define ITM_TCR_SYNCENA_Msk                (1UL << ITM_TCR_SYNCENA_Pos)                   /*!< ITM TCR: SYNCENA Mask */\r
+\r
+#define ITM_TCR_TSENA_Pos                   1U                                            /*!< ITM TCR: TSENA Position */\r
+#define ITM_TCR_TSENA_Msk                  (1UL << ITM_TCR_TSENA_Pos)                     /*!< ITM TCR: TSENA Mask */\r
+\r
+#define ITM_TCR_ITMENA_Pos                  0U                                            /*!< ITM TCR: ITM Enable bit Position */\r
+#define ITM_TCR_ITMENA_Msk                 (1UL /*<< ITM_TCR_ITMENA_Pos*/)                /*!< ITM TCR: ITM Enable bit Mask */\r
+\r
+/* ITM Integration Write Register Definitions */\r
+#define ITM_IWR_ATVALIDM_Pos                0U                                            /*!< ITM IWR: ATVALIDM Position */\r
+#define ITM_IWR_ATVALIDM_Msk               (1UL /*<< ITM_IWR_ATVALIDM_Pos*/)              /*!< ITM IWR: ATVALIDM Mask */\r
+\r
+/* ITM Integration Read Register Definitions */\r
+#define ITM_IRR_ATREADYM_Pos                0U                                            /*!< ITM IRR: ATREADYM Position */\r
+#define ITM_IRR_ATREADYM_Msk               (1UL /*<< ITM_IRR_ATREADYM_Pos*/)              /*!< ITM IRR: ATREADYM Mask */\r
+\r
+/* ITM Integration Mode Control Register Definitions */\r
+#define ITM_IMCR_INTEGRATION_Pos            0U                                            /*!< ITM IMCR: INTEGRATION Position */\r
+#define ITM_IMCR_INTEGRATION_Msk           (1UL /*<< ITM_IMCR_INTEGRATION_Pos*/)          /*!< ITM IMCR: INTEGRATION Mask */\r
+\r
+/* ITM Lock Status Register Definitions */\r
+#define ITM_LSR_ByteAcc_Pos                 2U                                            /*!< ITM LSR: ByteAcc Position */\r
+#define ITM_LSR_ByteAcc_Msk                (1UL << ITM_LSR_ByteAcc_Pos)                   /*!< ITM LSR: ByteAcc Mask */\r
+\r
+#define ITM_LSR_Access_Pos                  1U                                            /*!< ITM LSR: Access Position */\r
+#define ITM_LSR_Access_Msk                 (1UL << ITM_LSR_Access_Pos)                    /*!< ITM LSR: Access Mask */\r
+\r
+#define ITM_LSR_Present_Pos                 0U                                            /*!< ITM LSR: Present Position */\r
+#define ITM_LSR_Present_Msk                (1UL /*<< ITM_LSR_Present_Pos*/)               /*!< ITM LSR: Present Mask */\r
+\r
+/*@}*/ /* end of group CMSIS_ITM */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_DWT     Data Watchpoint and Trace (DWT)\r
+  \brief    Type definitions for the Data Watchpoint and Trace (DWT)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Data Watchpoint and Trace Register (DWT).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  Control Register */\r
+  __IOM uint32_t CYCCNT;                 /*!< Offset: 0x004 (R/W)  Cycle Count Register */\r
+  __IOM uint32_t CPICNT;                 /*!< Offset: 0x008 (R/W)  CPI Count Register */\r
+  __IOM uint32_t EXCCNT;                 /*!< Offset: 0x00C (R/W)  Exception Overhead Count Register */\r
+  __IOM uint32_t SLEEPCNT;               /*!< Offset: 0x010 (R/W)  Sleep Count Register */\r
+  __IOM uint32_t LSUCNT;                 /*!< Offset: 0x014 (R/W)  LSU Count Register */\r
+  __IOM uint32_t FOLDCNT;                /*!< Offset: 0x018 (R/W)  Folded-instruction Count Register */\r
+  __IM  uint32_t PCSR;                   /*!< Offset: 0x01C (R/ )  Program Counter Sample Register */\r
+  __IOM uint32_t COMP0;                  /*!< Offset: 0x020 (R/W)  Comparator Register 0 */\r
+  __IOM uint32_t MASK0;                  /*!< Offset: 0x024 (R/W)  Mask Register 0 */\r
+  __IOM uint32_t FUNCTION0;              /*!< Offset: 0x028 (R/W)  Function Register 0 */\r
+        uint32_t RESERVED0[1U];\r
+  __IOM uint32_t COMP1;                  /*!< Offset: 0x030 (R/W)  Comparator Register 1 */\r
+  __IOM uint32_t MASK1;                  /*!< Offset: 0x034 (R/W)  Mask Register 1 */\r
+  __IOM uint32_t FUNCTION1;              /*!< Offset: 0x038 (R/W)  Function Register 1 */\r
+        uint32_t RESERVED1[1U];\r
+  __IOM uint32_t COMP2;                  /*!< Offset: 0x040 (R/W)  Comparator Register 2 */\r
+  __IOM uint32_t MASK2;                  /*!< Offset: 0x044 (R/W)  Mask Register 2 */\r
+  __IOM uint32_t FUNCTION2;              /*!< Offset: 0x048 (R/W)  Function Register 2 */\r
+        uint32_t RESERVED2[1U];\r
+  __IOM uint32_t COMP3;                  /*!< Offset: 0x050 (R/W)  Comparator Register 3 */\r
+  __IOM uint32_t MASK3;                  /*!< Offset: 0x054 (R/W)  Mask Register 3 */\r
+  __IOM uint32_t FUNCTION3;              /*!< Offset: 0x058 (R/W)  Function Register 3 */\r
+        uint32_t RESERVED3[981U];\r
+  __OM  uint32_t LAR;                    /*!< Offset: 0xFB0 (  W)  Lock Access Register */\r
+  __IM  uint32_t LSR;                    /*!< Offset: 0xFB4 (R  )  Lock Status Register */\r
+} DWT_Type;\r
+\r
+/* DWT Control Register Definitions */\r
+#define DWT_CTRL_NUMCOMP_Pos               28U                                         /*!< DWT CTRL: NUMCOMP Position */\r
+#define DWT_CTRL_NUMCOMP_Msk               (0xFUL << DWT_CTRL_NUMCOMP_Pos)             /*!< DWT CTRL: NUMCOMP Mask */\r
+\r
+#define DWT_CTRL_NOTRCPKT_Pos              27U                                         /*!< DWT CTRL: NOTRCPKT Position */\r
+#define DWT_CTRL_NOTRCPKT_Msk              (0x1UL << DWT_CTRL_NOTRCPKT_Pos)            /*!< DWT CTRL: NOTRCPKT Mask */\r
+\r
+#define DWT_CTRL_NOEXTTRIG_Pos             26U                                         /*!< DWT CTRL: NOEXTTRIG Position */\r
+#define DWT_CTRL_NOEXTTRIG_Msk             (0x1UL << DWT_CTRL_NOEXTTRIG_Pos)           /*!< DWT CTRL: NOEXTTRIG Mask */\r
+\r
+#define DWT_CTRL_NOCYCCNT_Pos              25U                                         /*!< DWT CTRL: NOCYCCNT Position */\r
+#define DWT_CTRL_NOCYCCNT_Msk              (0x1UL << DWT_CTRL_NOCYCCNT_Pos)            /*!< DWT CTRL: NOCYCCNT Mask */\r
+\r
+#define DWT_CTRL_NOPRFCNT_Pos              24U                                         /*!< DWT CTRL: NOPRFCNT Position */\r
+#define DWT_CTRL_NOPRFCNT_Msk              (0x1UL << DWT_CTRL_NOPRFCNT_Pos)            /*!< DWT CTRL: NOPRFCNT Mask */\r
+\r
+#define DWT_CTRL_CYCEVTENA_Pos             22U                                         /*!< DWT CTRL: CYCEVTENA Position */\r
+#define DWT_CTRL_CYCEVTENA_Msk             (0x1UL << DWT_CTRL_CYCEVTENA_Pos)           /*!< DWT CTRL: CYCEVTENA Mask */\r
+\r
+#define DWT_CTRL_FOLDEVTENA_Pos            21U                                         /*!< DWT CTRL: FOLDEVTENA Position */\r
+#define DWT_CTRL_FOLDEVTENA_Msk            (0x1UL << DWT_CTRL_FOLDEVTENA_Pos)          /*!< DWT CTRL: FOLDEVTENA Mask */\r
+\r
+#define DWT_CTRL_LSUEVTENA_Pos             20U                                         /*!< DWT CTRL: LSUEVTENA Position */\r
+#define DWT_CTRL_LSUEVTENA_Msk             (0x1UL << DWT_CTRL_LSUEVTENA_Pos)           /*!< DWT CTRL: LSUEVTENA Mask */\r
+\r
+#define DWT_CTRL_SLEEPEVTENA_Pos           19U                                         /*!< DWT CTRL: SLEEPEVTENA Position */\r
+#define DWT_CTRL_SLEEPEVTENA_Msk           (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos)         /*!< DWT CTRL: SLEEPEVTENA Mask */\r
+\r
+#define DWT_CTRL_EXCEVTENA_Pos             18U                                         /*!< DWT CTRL: EXCEVTENA Position */\r
+#define DWT_CTRL_EXCEVTENA_Msk             (0x1UL << DWT_CTRL_EXCEVTENA_Pos)           /*!< DWT CTRL: EXCEVTENA Mask */\r
+\r
+#define DWT_CTRL_CPIEVTENA_Pos             17U                                         /*!< DWT CTRL: CPIEVTENA Position */\r
+#define DWT_CTRL_CPIEVTENA_Msk             (0x1UL << DWT_CTRL_CPIEVTENA_Pos)           /*!< DWT CTRL: CPIEVTENA Mask */\r
+\r
+#define DWT_CTRL_EXCTRCENA_Pos             16U                                         /*!< DWT CTRL: EXCTRCENA Position */\r
+#define DWT_CTRL_EXCTRCENA_Msk             (0x1UL << DWT_CTRL_EXCTRCENA_Pos)           /*!< DWT CTRL: EXCTRCENA Mask */\r
+\r
+#define DWT_CTRL_PCSAMPLENA_Pos            12U                                         /*!< DWT CTRL: PCSAMPLENA Position */\r
+#define DWT_CTRL_PCSAMPLENA_Msk            (0x1UL << DWT_CTRL_PCSAMPLENA_Pos)          /*!< DWT CTRL: PCSAMPLENA Mask */\r
+\r
+#define DWT_CTRL_SYNCTAP_Pos               10U                                         /*!< DWT CTRL: SYNCTAP Position */\r
+#define DWT_CTRL_SYNCTAP_Msk               (0x3UL << DWT_CTRL_SYNCTAP_Pos)             /*!< DWT CTRL: SYNCTAP Mask */\r
+\r
+#define DWT_CTRL_CYCTAP_Pos                 9U                                         /*!< DWT CTRL: CYCTAP Position */\r
+#define DWT_CTRL_CYCTAP_Msk                (0x1UL << DWT_CTRL_CYCTAP_Pos)              /*!< DWT CTRL: CYCTAP Mask */\r
+\r
+#define DWT_CTRL_POSTINIT_Pos               5U                                         /*!< DWT CTRL: POSTINIT Position */\r
+#define DWT_CTRL_POSTINIT_Msk              (0xFUL << DWT_CTRL_POSTINIT_Pos)            /*!< DWT CTRL: POSTINIT Mask */\r
+\r
+#define DWT_CTRL_POSTPRESET_Pos             1U                                         /*!< DWT CTRL: POSTPRESET Position */\r
+#define DWT_CTRL_POSTPRESET_Msk            (0xFUL << DWT_CTRL_POSTPRESET_Pos)          /*!< DWT CTRL: POSTPRESET Mask */\r
+\r
+#define DWT_CTRL_CYCCNTENA_Pos              0U                                         /*!< DWT CTRL: CYCCNTENA Position */\r
+#define DWT_CTRL_CYCCNTENA_Msk             (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/)       /*!< DWT CTRL: CYCCNTENA Mask */\r
+\r
+/* DWT CPI Count Register Definitions */\r
+#define DWT_CPICNT_CPICNT_Pos               0U                                         /*!< DWT CPICNT: CPICNT Position */\r
+#define DWT_CPICNT_CPICNT_Msk              (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/)       /*!< DWT CPICNT: CPICNT Mask */\r
+\r
+/* DWT Exception Overhead Count Register Definitions */\r
+#define DWT_EXCCNT_EXCCNT_Pos               0U                                         /*!< DWT EXCCNT: EXCCNT Position */\r
+#define DWT_EXCCNT_EXCCNT_Msk              (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/)       /*!< DWT EXCCNT: EXCCNT Mask */\r
+\r
+/* DWT Sleep Count Register Definitions */\r
+#define DWT_SLEEPCNT_SLEEPCNT_Pos           0U                                         /*!< DWT SLEEPCNT: SLEEPCNT Position */\r
+#define DWT_SLEEPCNT_SLEEPCNT_Msk          (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/)   /*!< DWT SLEEPCNT: SLEEPCNT Mask */\r
+\r
+/* DWT LSU Count Register Definitions */\r
+#define DWT_LSUCNT_LSUCNT_Pos               0U                                         /*!< DWT LSUCNT: LSUCNT Position */\r
+#define DWT_LSUCNT_LSUCNT_Msk              (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/)       /*!< DWT LSUCNT: LSUCNT Mask */\r
+\r
+/* DWT Folded-instruction Count Register Definitions */\r
+#define DWT_FOLDCNT_FOLDCNT_Pos             0U                                         /*!< DWT FOLDCNT: FOLDCNT Position */\r
+#define DWT_FOLDCNT_FOLDCNT_Msk            (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/)     /*!< DWT FOLDCNT: FOLDCNT Mask */\r
+\r
+/* DWT Comparator Mask Register Definitions */\r
+#define DWT_MASK_MASK_Pos                   0U                                         /*!< DWT MASK: MASK Position */\r
+#define DWT_MASK_MASK_Msk                  (0x1FUL /*<< DWT_MASK_MASK_Pos*/)           /*!< DWT MASK: MASK Mask */\r
+\r
+/* DWT Comparator Function Register Definitions */\r
+#define DWT_FUNCTION_MATCHED_Pos           24U                                         /*!< DWT FUNCTION: MATCHED Position */\r
+#define DWT_FUNCTION_MATCHED_Msk           (0x1UL << DWT_FUNCTION_MATCHED_Pos)         /*!< DWT FUNCTION: MATCHED Mask */\r
+\r
+#define DWT_FUNCTION_DATAVADDR1_Pos        16U                                         /*!< DWT FUNCTION: DATAVADDR1 Position */\r
+#define DWT_FUNCTION_DATAVADDR1_Msk        (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos)      /*!< DWT FUNCTION: DATAVADDR1 Mask */\r
+\r
+#define DWT_FUNCTION_DATAVADDR0_Pos        12U                                         /*!< DWT FUNCTION: DATAVADDR0 Position */\r
+#define DWT_FUNCTION_DATAVADDR0_Msk        (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos)      /*!< DWT FUNCTION: DATAVADDR0 Mask */\r
+\r
+#define DWT_FUNCTION_DATAVSIZE_Pos         10U                                         /*!< DWT FUNCTION: DATAVSIZE Position */\r
+#define DWT_FUNCTION_DATAVSIZE_Msk         (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos)       /*!< DWT FUNCTION: DATAVSIZE Mask */\r
+\r
+#define DWT_FUNCTION_LNK1ENA_Pos            9U                                         /*!< DWT FUNCTION: LNK1ENA Position */\r
+#define DWT_FUNCTION_LNK1ENA_Msk           (0x1UL << DWT_FUNCTION_LNK1ENA_Pos)         /*!< DWT FUNCTION: LNK1ENA Mask */\r
+\r
+#define DWT_FUNCTION_DATAVMATCH_Pos         8U                                         /*!< DWT FUNCTION: DATAVMATCH Position */\r
+#define DWT_FUNCTION_DATAVMATCH_Msk        (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos)      /*!< DWT FUNCTION: DATAVMATCH Mask */\r
+\r
+#define DWT_FUNCTION_CYCMATCH_Pos           7U                                         /*!< DWT FUNCTION: CYCMATCH Position */\r
+#define DWT_FUNCTION_CYCMATCH_Msk          (0x1UL << DWT_FUNCTION_CYCMATCH_Pos)        /*!< DWT FUNCTION: CYCMATCH Mask */\r
+\r
+#define DWT_FUNCTION_EMITRANGE_Pos          5U                                         /*!< DWT FUNCTION: EMITRANGE Position */\r
+#define DWT_FUNCTION_EMITRANGE_Msk         (0x1UL << DWT_FUNCTION_EMITRANGE_Pos)       /*!< DWT FUNCTION: EMITRANGE Mask */\r
+\r
+#define DWT_FUNCTION_FUNCTION_Pos           0U                                         /*!< DWT FUNCTION: FUNCTION Position */\r
+#define DWT_FUNCTION_FUNCTION_Msk          (0xFUL /*<< DWT_FUNCTION_FUNCTION_Pos*/)    /*!< DWT FUNCTION: FUNCTION Mask */\r
+\r
+/*@}*/ /* end of group CMSIS_DWT */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_TPI     Trace Port Interface (TPI)\r
+  \brief    Type definitions for the Trace Port Interface (TPI)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Trace Port Interface Register (TPI).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t SSPSR;                  /*!< Offset: 0x000 (R/ )  Supported Parallel Port Size Register */\r
+  __IOM uint32_t CSPSR;                  /*!< Offset: 0x004 (R/W)  Current Parallel Port Size Register */\r
+        uint32_t RESERVED0[2U];\r
+  __IOM uint32_t ACPR;                   /*!< Offset: 0x010 (R/W)  Asynchronous Clock Prescaler Register */\r
+        uint32_t RESERVED1[55U];\r
+  __IOM uint32_t SPPR;                   /*!< Offset: 0x0F0 (R/W)  Selected Pin Protocol Register */\r
+        uint32_t RESERVED2[131U];\r
+  __IM  uint32_t FFSR;                   /*!< Offset: 0x300 (R/ )  Formatter and Flush Status Register */\r
+  __IOM uint32_t FFCR;                   /*!< Offset: 0x304 (R/W)  Formatter and Flush Control Register */\r
+  __IM  uint32_t FSCR;                   /*!< Offset: 0x308 (R/ )  Formatter Synchronization Counter Register */\r
+        uint32_t RESERVED3[759U];\r
+  __IM  uint32_t TRIGGER;                /*!< Offset: 0xEE8 (R/ )  TRIGGER Register */\r
+  __IM  uint32_t FIFO0;                  /*!< Offset: 0xEEC (R/ )  Integration ETM Data */\r
+  __IM  uint32_t ITATBCTR2;              /*!< Offset: 0xEF0 (R/ )  ITATBCTR2 */\r
+        uint32_t RESERVED4[1U];\r
+  __IM  uint32_t ITATBCTR0;              /*!< Offset: 0xEF8 (R/ )  ITATBCTR0 */\r
+  __IM  uint32_t FIFO1;                  /*!< Offset: 0xEFC (R/ )  Integration ITM Data */\r
+  __IOM uint32_t ITCTRL;                 /*!< Offset: 0xF00 (R/W)  Integration Mode Control */\r
+        uint32_t RESERVED5[39U];\r
+  __IOM uint32_t CLAIMSET;               /*!< Offset: 0xFA0 (R/W)  Claim tag set */\r
+  __IOM uint32_t CLAIMCLR;               /*!< Offset: 0xFA4 (R/W)  Claim tag clear */\r
+        uint32_t RESERVED7[8U];\r
+  __IM  uint32_t DEVID;                  /*!< Offset: 0xFC8 (R/ )  TPIU_DEVID */\r
+  __IM  uint32_t DEVTYPE;                /*!< Offset: 0xFCC (R/ )  TPIU_DEVTYPE */\r
+} TPI_Type;\r
+\r
+/* TPI Asynchronous Clock Prescaler Register Definitions */\r
+#define TPI_ACPR_PRESCALER_Pos              0U                                         /*!< TPI ACPR: PRESCALER Position */\r
+#define TPI_ACPR_PRESCALER_Msk             (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/)    /*!< TPI ACPR: PRESCALER Mask */\r
+\r
+/* TPI Selected Pin Protocol Register Definitions */\r
+#define TPI_SPPR_TXMODE_Pos                 0U                                         /*!< TPI SPPR: TXMODE Position */\r
+#define TPI_SPPR_TXMODE_Msk                (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/)          /*!< TPI SPPR: TXMODE Mask */\r
+\r
+/* TPI Formatter and Flush Status Register Definitions */\r
+#define TPI_FFSR_FtNonStop_Pos              3U                                         /*!< TPI FFSR: FtNonStop Position */\r
+#define TPI_FFSR_FtNonStop_Msk             (0x1UL << TPI_FFSR_FtNonStop_Pos)           /*!< TPI FFSR: FtNonStop Mask */\r
+\r
+#define TPI_FFSR_TCPresent_Pos              2U                                         /*!< TPI FFSR: TCPresent Position */\r
+#define TPI_FFSR_TCPresent_Msk             (0x1UL << TPI_FFSR_TCPresent_Pos)           /*!< TPI FFSR: TCPresent Mask */\r
+\r
+#define TPI_FFSR_FtStopped_Pos              1U                                         /*!< TPI FFSR: FtStopped Position */\r
+#define TPI_FFSR_FtStopped_Msk             (0x1UL << TPI_FFSR_FtStopped_Pos)           /*!< TPI FFSR: FtStopped Mask */\r
+\r
+#define TPI_FFSR_FlInProg_Pos               0U                                         /*!< TPI FFSR: FlInProg Position */\r
+#define TPI_FFSR_FlInProg_Msk              (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/)        /*!< TPI FFSR: FlInProg Mask */\r
+\r
+/* TPI Formatter and Flush Control Register Definitions */\r
+#define TPI_FFCR_TrigIn_Pos                 8U                                         /*!< TPI FFCR: TrigIn Position */\r
+#define TPI_FFCR_TrigIn_Msk                (0x1UL << TPI_FFCR_TrigIn_Pos)              /*!< TPI FFCR: TrigIn Mask */\r
+\r
+#define TPI_FFCR_EnFCont_Pos                1U                                         /*!< TPI FFCR: EnFCont Position */\r
+#define TPI_FFCR_EnFCont_Msk               (0x1UL << TPI_FFCR_EnFCont_Pos)             /*!< TPI FFCR: EnFCont Mask */\r
+\r
+/* TPI TRIGGER Register Definitions */\r
+#define TPI_TRIGGER_TRIGGER_Pos             0U                                         /*!< TPI TRIGGER: TRIGGER Position */\r
+#define TPI_TRIGGER_TRIGGER_Msk            (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/)      /*!< TPI TRIGGER: TRIGGER Mask */\r
+\r
+/* TPI Integration ETM Data Register Definitions (FIFO0) */\r
+#define TPI_FIFO0_ITM_ATVALID_Pos          29U                                         /*!< TPI FIFO0: ITM_ATVALID Position */\r
+#define TPI_FIFO0_ITM_ATVALID_Msk          (0x3UL << TPI_FIFO0_ITM_ATVALID_Pos)        /*!< TPI FIFO0: ITM_ATVALID Mask */\r
+\r
+#define TPI_FIFO0_ITM_bytecount_Pos        27U                                         /*!< TPI FIFO0: ITM_bytecount Position */\r
+#define TPI_FIFO0_ITM_bytecount_Msk        (0x3UL << TPI_FIFO0_ITM_bytecount_Pos)      /*!< TPI FIFO0: ITM_bytecount Mask */\r
+\r
+#define TPI_FIFO0_ETM_ATVALID_Pos          26U                                         /*!< TPI FIFO0: ETM_ATVALID Position */\r
+#define TPI_FIFO0_ETM_ATVALID_Msk          (0x3UL << TPI_FIFO0_ETM_ATVALID_Pos)        /*!< TPI FIFO0: ETM_ATVALID Mask */\r
+\r
+#define TPI_FIFO0_ETM_bytecount_Pos        24U                                         /*!< TPI FIFO0: ETM_bytecount Position */\r
+#define TPI_FIFO0_ETM_bytecount_Msk        (0x3UL << TPI_FIFO0_ETM_bytecount_Pos)      /*!< TPI FIFO0: ETM_bytecount Mask */\r
+\r
+#define TPI_FIFO0_ETM2_Pos                 16U                                         /*!< TPI FIFO0: ETM2 Position */\r
+#define TPI_FIFO0_ETM2_Msk                 (0xFFUL << TPI_FIFO0_ETM2_Pos)              /*!< TPI FIFO0: ETM2 Mask */\r
+\r
+#define TPI_FIFO0_ETM1_Pos                  8U                                         /*!< TPI FIFO0: ETM1 Position */\r
+#define TPI_FIFO0_ETM1_Msk                 (0xFFUL << TPI_FIFO0_ETM1_Pos)              /*!< TPI FIFO0: ETM1 Mask */\r
+\r
+#define TPI_FIFO0_ETM0_Pos                  0U                                         /*!< TPI FIFO0: ETM0 Position */\r
+#define TPI_FIFO0_ETM0_Msk                 (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/)          /*!< TPI FIFO0: ETM0 Mask */\r
+\r
+/* TPI ITATBCTR2 Register Definitions */\r
+#define TPI_ITATBCTR2_ATREADY2_Pos          0U                                         /*!< TPI ITATBCTR2: ATREADY2 Position */\r
+#define TPI_ITATBCTR2_ATREADY2_Msk         (0x1UL /*<< TPI_ITATBCTR2_ATREADY2_Pos*/)   /*!< TPI ITATBCTR2: ATREADY2 Mask */\r
+\r
+#define TPI_ITATBCTR2_ATREADY1_Pos          0U                                         /*!< TPI ITATBCTR2: ATREADY1 Position */\r
+#define TPI_ITATBCTR2_ATREADY1_Msk         (0x1UL /*<< TPI_ITATBCTR2_ATREADY1_Pos*/)   /*!< TPI ITATBCTR2: ATREADY1 Mask */\r
+\r
+/* TPI Integration ITM Data Register Definitions (FIFO1) */\r
+#define TPI_FIFO1_ITM_ATVALID_Pos          29U                                         /*!< TPI FIFO1: ITM_ATVALID Position */\r
+#define TPI_FIFO1_ITM_ATVALID_Msk          (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos)        /*!< TPI FIFO1: ITM_ATVALID Mask */\r
+\r
+#define TPI_FIFO1_ITM_bytecount_Pos        27U                                         /*!< TPI FIFO1: ITM_bytecount Position */\r
+#define TPI_FIFO1_ITM_bytecount_Msk        (0x3UL << TPI_FIFO1_ITM_bytecount_Pos)      /*!< TPI FIFO1: ITM_bytecount Mask */\r
+\r
+#define TPI_FIFO1_ETM_ATVALID_Pos          26U                                         /*!< TPI FIFO1: ETM_ATVALID Position */\r
+#define TPI_FIFO1_ETM_ATVALID_Msk          (0x3UL << TPI_FIFO1_ETM_ATVALID_Pos)        /*!< TPI FIFO1: ETM_ATVALID Mask */\r
+\r
+#define TPI_FIFO1_ETM_bytecount_Pos        24U                                         /*!< TPI FIFO1: ETM_bytecount Position */\r
+#define TPI_FIFO1_ETM_bytecount_Msk        (0x3UL << TPI_FIFO1_ETM_bytecount_Pos)      /*!< TPI FIFO1: ETM_bytecount Mask */\r
+\r
+#define TPI_FIFO1_ITM2_Pos                 16U                                         /*!< TPI FIFO1: ITM2 Position */\r
+#define TPI_FIFO1_ITM2_Msk                 (0xFFUL << TPI_FIFO1_ITM2_Pos)              /*!< TPI FIFO1: ITM2 Mask */\r
+\r
+#define TPI_FIFO1_ITM1_Pos                  8U                                         /*!< TPI FIFO1: ITM1 Position */\r
+#define TPI_FIFO1_ITM1_Msk                 (0xFFUL << TPI_FIFO1_ITM1_Pos)              /*!< TPI FIFO1: ITM1 Mask */\r
+\r
+#define TPI_FIFO1_ITM0_Pos                  0U                                         /*!< TPI FIFO1: ITM0 Position */\r
+#define TPI_FIFO1_ITM0_Msk                 (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/)          /*!< TPI FIFO1: ITM0 Mask */\r
+\r
+/* TPI ITATBCTR0 Register Definitions */\r
+#define TPI_ITATBCTR0_ATREADY2_Pos          0U                                         /*!< TPI ITATBCTR0: ATREADY2 Position */\r
+#define TPI_ITATBCTR0_ATREADY2_Msk         (0x1UL /*<< TPI_ITATBCTR0_ATREADY2_Pos*/)   /*!< TPI ITATBCTR0: ATREADY2 Mask */\r
+\r
+#define TPI_ITATBCTR0_ATREADY1_Pos          0U                                         /*!< TPI ITATBCTR0: ATREADY1 Position */\r
+#define TPI_ITATBCTR0_ATREADY1_Msk         (0x1UL /*<< TPI_ITATBCTR0_ATREADY1_Pos*/)   /*!< TPI ITATBCTR0: ATREADY1 Mask */\r
+\r
+/* TPI Integration Mode Control Register Definitions */\r
+#define TPI_ITCTRL_Mode_Pos                 0U                                         /*!< TPI ITCTRL: Mode Position */\r
+#define TPI_ITCTRL_Mode_Msk                (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/)          /*!< TPI ITCTRL: Mode Mask */\r
+\r
+/* TPI DEVID Register Definitions */\r
+#define TPI_DEVID_NRZVALID_Pos             11U                                         /*!< TPI DEVID: NRZVALID Position */\r
+#define TPI_DEVID_NRZVALID_Msk             (0x1UL << TPI_DEVID_NRZVALID_Pos)           /*!< TPI DEVID: NRZVALID Mask */\r
+\r
+#define TPI_DEVID_MANCVALID_Pos            10U                                         /*!< TPI DEVID: MANCVALID Position */\r
+#define TPI_DEVID_MANCVALID_Msk            (0x1UL << TPI_DEVID_MANCVALID_Pos)          /*!< TPI DEVID: MANCVALID Mask */\r
+\r
+#define TPI_DEVID_PTINVALID_Pos             9U                                         /*!< TPI DEVID: PTINVALID Position */\r
+#define TPI_DEVID_PTINVALID_Msk            (0x1UL << TPI_DEVID_PTINVALID_Pos)          /*!< TPI DEVID: PTINVALID Mask */\r
+\r
+#define TPI_DEVID_MinBufSz_Pos              6U                                         /*!< TPI DEVID: MinBufSz Position */\r
+#define TPI_DEVID_MinBufSz_Msk             (0x7UL << TPI_DEVID_MinBufSz_Pos)           /*!< TPI DEVID: MinBufSz Mask */\r
+\r
+#define TPI_DEVID_AsynClkIn_Pos             5U                                         /*!< TPI DEVID: AsynClkIn Position */\r
+#define TPI_DEVID_AsynClkIn_Msk            (0x1UL << TPI_DEVID_AsynClkIn_Pos)          /*!< TPI DEVID: AsynClkIn Mask */\r
+\r
+#define TPI_DEVID_NrTraceInput_Pos          0U                                         /*!< TPI DEVID: NrTraceInput Position */\r
+#define TPI_DEVID_NrTraceInput_Msk         (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/)  /*!< TPI DEVID: NrTraceInput Mask */\r
+\r
+/* TPI DEVTYPE Register Definitions */\r
+#define TPI_DEVTYPE_SubType_Pos             4U                                         /*!< TPI DEVTYPE: SubType Position */\r
+#define TPI_DEVTYPE_SubType_Msk            (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/)      /*!< TPI DEVTYPE: SubType Mask */\r
+\r
+#define TPI_DEVTYPE_MajorType_Pos           0U                                         /*!< TPI DEVTYPE: MajorType Position */\r
+#define TPI_DEVTYPE_MajorType_Msk          (0xFUL << TPI_DEVTYPE_MajorType_Pos)        /*!< TPI DEVTYPE: MajorType Mask */\r
+\r
+/*@}*/ /* end of group CMSIS_TPI */\r
+\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_MPU     Memory Protection Unit (MPU)\r
+  \brief    Type definitions for the Memory Protection Unit (MPU)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Memory Protection Unit (MPU).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t TYPE;                   /*!< Offset: 0x000 (R/ )  MPU Type Register */\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x004 (R/W)  MPU Control Register */\r
+  __IOM uint32_t RNR;                    /*!< Offset: 0x008 (R/W)  MPU Region RNRber Register */\r
+  __IOM uint32_t RBAR;                   /*!< Offset: 0x00C (R/W)  MPU Region Base Address Register */\r
+  __IOM uint32_t RASR;                   /*!< Offset: 0x010 (R/W)  MPU Region Attribute and Size Register */\r
+  __IOM uint32_t RBAR_A1;                /*!< Offset: 0x014 (R/W)  MPU Alias 1 Region Base Address Register */\r
+  __IOM uint32_t RASR_A1;                /*!< Offset: 0x018 (R/W)  MPU Alias 1 Region Attribute and Size Register */\r
+  __IOM uint32_t RBAR_A2;                /*!< Offset: 0x01C (R/W)  MPU Alias 2 Region Base Address Register */\r
+  __IOM uint32_t RASR_A2;                /*!< Offset: 0x020 (R/W)  MPU Alias 2 Region Attribute and Size Register */\r
+  __IOM uint32_t RBAR_A3;                /*!< Offset: 0x024 (R/W)  MPU Alias 3 Region Base Address Register */\r
+  __IOM uint32_t RASR_A3;                /*!< Offset: 0x028 (R/W)  MPU Alias 3 Region Attribute and Size Register */\r
+} MPU_Type;\r
+\r
+#define MPU_TYPE_RALIASES                  4U\r
+\r
+/* MPU Type Register Definitions */\r
+#define MPU_TYPE_IREGION_Pos               16U                                            /*!< MPU TYPE: IREGION Position */\r
+#define MPU_TYPE_IREGION_Msk               (0xFFUL << MPU_TYPE_IREGION_Pos)               /*!< MPU TYPE: IREGION Mask */\r
+\r
+#define MPU_TYPE_DREGION_Pos                8U                                            /*!< MPU TYPE: DREGION Position */\r
+#define MPU_TYPE_DREGION_Msk               (0xFFUL << MPU_TYPE_DREGION_Pos)               /*!< MPU TYPE: DREGION Mask */\r
+\r
+#define MPU_TYPE_SEPARATE_Pos               0U                                            /*!< MPU TYPE: SEPARATE Position */\r
+#define MPU_TYPE_SEPARATE_Msk              (1UL /*<< MPU_TYPE_SEPARATE_Pos*/)             /*!< MPU TYPE: SEPARATE Mask */\r
+\r
+/* MPU Control Register Definitions */\r
+#define MPU_CTRL_PRIVDEFENA_Pos             2U                                            /*!< MPU CTRL: PRIVDEFENA Position */\r
+#define MPU_CTRL_PRIVDEFENA_Msk            (1UL << MPU_CTRL_PRIVDEFENA_Pos)               /*!< MPU CTRL: PRIVDEFENA Mask */\r
+\r
+#define MPU_CTRL_HFNMIENA_Pos               1U                                            /*!< MPU CTRL: HFNMIENA Position */\r
+#define MPU_CTRL_HFNMIENA_Msk              (1UL << MPU_CTRL_HFNMIENA_Pos)                 /*!< MPU CTRL: HFNMIENA Mask */\r
+\r
+#define MPU_CTRL_ENABLE_Pos                 0U                                            /*!< MPU CTRL: ENABLE Position */\r
+#define MPU_CTRL_ENABLE_Msk                (1UL /*<< MPU_CTRL_ENABLE_Pos*/)               /*!< MPU CTRL: ENABLE Mask */\r
+\r
+/* MPU Region Number Register Definitions */\r
+#define MPU_RNR_REGION_Pos                  0U                                            /*!< MPU RNR: REGION Position */\r
+#define MPU_RNR_REGION_Msk                 (0xFFUL /*<< MPU_RNR_REGION_Pos*/)             /*!< MPU RNR: REGION Mask */\r
+\r
+/* MPU Region Base Address Register Definitions */\r
+#define MPU_RBAR_ADDR_Pos                   5U                                            /*!< MPU RBAR: ADDR Position */\r
+#define MPU_RBAR_ADDR_Msk                  (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos)             /*!< MPU RBAR: ADDR Mask */\r
+\r
+#define MPU_RBAR_VALID_Pos                  4U                                            /*!< MPU RBAR: VALID Position */\r
+#define MPU_RBAR_VALID_Msk                 (1UL << MPU_RBAR_VALID_Pos)                    /*!< MPU RBAR: VALID Mask */\r
+\r
+#define MPU_RBAR_REGION_Pos                 0U                                            /*!< MPU RBAR: REGION Position */\r
+#define MPU_RBAR_REGION_Msk                (0xFUL /*<< MPU_RBAR_REGION_Pos*/)             /*!< MPU RBAR: REGION Mask */\r
+\r
+/* MPU Region Attribute and Size Register Definitions */\r
+#define MPU_RASR_ATTRS_Pos                 16U                                            /*!< MPU RASR: MPU Region Attribute field Position */\r
+#define MPU_RASR_ATTRS_Msk                 (0xFFFFUL << MPU_RASR_ATTRS_Pos)               /*!< MPU RASR: MPU Region Attribute field Mask */\r
+\r
+#define MPU_RASR_XN_Pos                    28U                                            /*!< MPU RASR: ATTRS.XN Position */\r
+#define MPU_RASR_XN_Msk                    (1UL << MPU_RASR_XN_Pos)                       /*!< MPU RASR: ATTRS.XN Mask */\r
+\r
+#define MPU_RASR_AP_Pos                    24U                                            /*!< MPU RASR: ATTRS.AP Position */\r
+#define MPU_RASR_AP_Msk                    (0x7UL << MPU_RASR_AP_Pos)                     /*!< MPU RASR: ATTRS.AP Mask */\r
+\r
+#define MPU_RASR_TEX_Pos                   19U                                            /*!< MPU RASR: ATTRS.TEX Position */\r
+#define MPU_RASR_TEX_Msk                   (0x7UL << MPU_RASR_TEX_Pos)                    /*!< MPU RASR: ATTRS.TEX Mask */\r
+\r
+#define MPU_RASR_S_Pos                     18U                                            /*!< MPU RASR: ATTRS.S Position */\r
+#define MPU_RASR_S_Msk                     (1UL << MPU_RASR_S_Pos)                        /*!< MPU RASR: ATTRS.S Mask */\r
+\r
+#define MPU_RASR_C_Pos                     17U                                            /*!< MPU RASR: ATTRS.C Position */\r
+#define MPU_RASR_C_Msk                     (1UL << MPU_RASR_C_Pos)                        /*!< MPU RASR: ATTRS.C Mask */\r
+\r
+#define MPU_RASR_B_Pos                     16U                                            /*!< MPU RASR: ATTRS.B Position */\r
+#define MPU_RASR_B_Msk                     (1UL << MPU_RASR_B_Pos)                        /*!< MPU RASR: ATTRS.B Mask */\r
+\r
+#define MPU_RASR_SRD_Pos                    8U                                            /*!< MPU RASR: Sub-Region Disable Position */\r
+#define MPU_RASR_SRD_Msk                   (0xFFUL << MPU_RASR_SRD_Pos)                   /*!< MPU RASR: Sub-Region Disable Mask */\r
+\r
+#define MPU_RASR_SIZE_Pos                   1U                                            /*!< MPU RASR: Region Size Field Position */\r
+#define MPU_RASR_SIZE_Msk                  (0x1FUL << MPU_RASR_SIZE_Pos)                  /*!< MPU RASR: Region Size Field Mask */\r
+\r
+#define MPU_RASR_ENABLE_Pos                 0U                                            /*!< MPU RASR: Region enable bit Position */\r
+#define MPU_RASR_ENABLE_Msk                (1UL /*<< MPU_RASR_ENABLE_Pos*/)               /*!< MPU RASR: Region enable bit Disable Mask */\r
+\r
+/*@} end of group CMSIS_MPU */\r
+#endif /* defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_FPU     Floating Point Unit (FPU)\r
+  \brief    Type definitions for the Floating Point Unit (FPU)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Floating Point Unit (FPU).\r
+ */\r
+typedef struct\r
+{\r
+        uint32_t RESERVED0[1U];\r
+  __IOM uint32_t FPCCR;                  /*!< Offset: 0x004 (R/W)  Floating-Point Context Control Register */\r
+  __IOM uint32_t FPCAR;                  /*!< Offset: 0x008 (R/W)  Floating-Point Context Address Register */\r
+  __IOM uint32_t FPDSCR;                 /*!< Offset: 0x00C (R/W)  Floating-Point Default Status Control Register */\r
+  __IM  uint32_t MVFR0;                  /*!< Offset: 0x010 (R/ )  Media and FP Feature Register 0 */\r
+  __IM  uint32_t MVFR1;                  /*!< Offset: 0x014 (R/ )  Media and FP Feature Register 1 */\r
+  __IM  uint32_t MVFR2;                  /*!< Offset: 0x018 (R/ )  Media and FP Feature Register 2 */\r
+} FPU_Type;\r
+\r
+/* Floating-Point Context Control Register Definitions */\r
+#define FPU_FPCCR_ASPEN_Pos                31U                                            /*!< FPCCR: ASPEN bit Position */\r
+#define FPU_FPCCR_ASPEN_Msk                (1UL << FPU_FPCCR_ASPEN_Pos)                   /*!< FPCCR: ASPEN bit Mask */\r
+\r
+#define FPU_FPCCR_LSPEN_Pos                30U                                            /*!< FPCCR: LSPEN Position */\r
+#define FPU_FPCCR_LSPEN_Msk                (1UL << FPU_FPCCR_LSPEN_Pos)                   /*!< FPCCR: LSPEN bit Mask */\r
+\r
+#define FPU_FPCCR_MONRDY_Pos                8U                                            /*!< FPCCR: MONRDY Position */\r
+#define FPU_FPCCR_MONRDY_Msk               (1UL << FPU_FPCCR_MONRDY_Pos)                  /*!< FPCCR: MONRDY bit Mask */\r
+\r
+#define FPU_FPCCR_BFRDY_Pos                 6U                                            /*!< FPCCR: BFRDY Position */\r
+#define FPU_FPCCR_BFRDY_Msk                (1UL << FPU_FPCCR_BFRDY_Pos)                   /*!< FPCCR: BFRDY bit Mask */\r
+\r
+#define FPU_FPCCR_MMRDY_Pos                 5U                                            /*!< FPCCR: MMRDY Position */\r
+#define FPU_FPCCR_MMRDY_Msk                (1UL << FPU_FPCCR_MMRDY_Pos)                   /*!< FPCCR: MMRDY bit Mask */\r
+\r
+#define FPU_FPCCR_HFRDY_Pos                 4U                                            /*!< FPCCR: HFRDY Position */\r
+#define FPU_FPCCR_HFRDY_Msk                (1UL << FPU_FPCCR_HFRDY_Pos)                   /*!< FPCCR: HFRDY bit Mask */\r
+\r
+#define FPU_FPCCR_THREAD_Pos                3U                                            /*!< FPCCR: processor mode bit Position */\r
+#define FPU_FPCCR_THREAD_Msk               (1UL << FPU_FPCCR_THREAD_Pos)                  /*!< FPCCR: processor mode active bit Mask */\r
+\r
+#define FPU_FPCCR_USER_Pos                  1U                                            /*!< FPCCR: privilege level bit Position */\r
+#define FPU_FPCCR_USER_Msk                 (1UL << FPU_FPCCR_USER_Pos)                    /*!< FPCCR: privilege level bit Mask */\r
+\r
+#define FPU_FPCCR_LSPACT_Pos                0U                                            /*!< FPCCR: Lazy state preservation active bit Position */\r
+#define FPU_FPCCR_LSPACT_Msk               (1UL /*<< FPU_FPCCR_LSPACT_Pos*/)              /*!< FPCCR: Lazy state preservation active bit Mask */\r
+\r
+/* Floating-Point Context Address Register Definitions */\r
+#define FPU_FPCAR_ADDRESS_Pos               3U                                            /*!< FPCAR: ADDRESS bit Position */\r
+#define FPU_FPCAR_ADDRESS_Msk              (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos)        /*!< FPCAR: ADDRESS bit Mask */\r
+\r
+/* Floating-Point Default Status Control Register Definitions */\r
+#define FPU_FPDSCR_AHP_Pos                 26U                                            /*!< FPDSCR: AHP bit Position */\r
+#define FPU_FPDSCR_AHP_Msk                 (1UL << FPU_FPDSCR_AHP_Pos)                    /*!< FPDSCR: AHP bit Mask */\r
+\r
+#define FPU_FPDSCR_DN_Pos                  25U                                            /*!< FPDSCR: DN bit Position */\r
+#define FPU_FPDSCR_DN_Msk                  (1UL << FPU_FPDSCR_DN_Pos)                     /*!< FPDSCR: DN bit Mask */\r
+\r
+#define FPU_FPDSCR_FZ_Pos                  24U                                            /*!< FPDSCR: FZ bit Position */\r
+#define FPU_FPDSCR_FZ_Msk                  (1UL << FPU_FPDSCR_FZ_Pos)                     /*!< FPDSCR: FZ bit Mask */\r
+\r
+#define FPU_FPDSCR_RMode_Pos               22U                                            /*!< FPDSCR: RMode bit Position */\r
+#define FPU_FPDSCR_RMode_Msk               (3UL << FPU_FPDSCR_RMode_Pos)                  /*!< FPDSCR: RMode bit Mask */\r
+\r
+/* Media and FP Feature Register 0 Definitions */\r
+#define FPU_MVFR0_FP_rounding_modes_Pos    28U                                            /*!< MVFR0: FP rounding modes bits Position */\r
+#define FPU_MVFR0_FP_rounding_modes_Msk    (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos)     /*!< MVFR0: FP rounding modes bits Mask */\r
+\r
+#define FPU_MVFR0_Short_vectors_Pos        24U                                            /*!< MVFR0: Short vectors bits Position */\r
+#define FPU_MVFR0_Short_vectors_Msk        (0xFUL << FPU_MVFR0_Short_vectors_Pos)         /*!< MVFR0: Short vectors bits Mask */\r
+\r
+#define FPU_MVFR0_Square_root_Pos          20U                                            /*!< MVFR0: Square root bits Position */\r
+#define FPU_MVFR0_Square_root_Msk          (0xFUL << FPU_MVFR0_Square_root_Pos)           /*!< MVFR0: Square root bits Mask */\r
+\r
+#define FPU_MVFR0_Divide_Pos               16U                                            /*!< MVFR0: Divide bits Position */\r
+#define FPU_MVFR0_Divide_Msk               (0xFUL << FPU_MVFR0_Divide_Pos)                /*!< MVFR0: Divide bits Mask */\r
+\r
+#define FPU_MVFR0_FP_excep_trapping_Pos    12U                                            /*!< MVFR0: FP exception trapping bits Position */\r
+#define FPU_MVFR0_FP_excep_trapping_Msk    (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos)     /*!< MVFR0: FP exception trapping bits Mask */\r
+\r
+#define FPU_MVFR0_Double_precision_Pos      8U                                            /*!< MVFR0: Double-precision bits Position */\r
+#define FPU_MVFR0_Double_precision_Msk     (0xFUL << FPU_MVFR0_Double_precision_Pos)      /*!< MVFR0: Double-precision bits Mask */\r
+\r
+#define FPU_MVFR0_Single_precision_Pos      4U                                            /*!< MVFR0: Single-precision bits Position */\r
+#define FPU_MVFR0_Single_precision_Msk     (0xFUL << FPU_MVFR0_Single_precision_Pos)      /*!< MVFR0: Single-precision bits Mask */\r
+\r
+#define FPU_MVFR0_A_SIMD_registers_Pos      0U                                            /*!< MVFR0: A_SIMD registers bits Position */\r
+#define FPU_MVFR0_A_SIMD_registers_Msk     (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/)  /*!< MVFR0: A_SIMD registers bits Mask */\r
+\r
+/* Media and FP Feature Register 1 Definitions */\r
+#define FPU_MVFR1_FP_fused_MAC_Pos         28U                                            /*!< MVFR1: FP fused MAC bits Position */\r
+#define FPU_MVFR1_FP_fused_MAC_Msk         (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos)          /*!< MVFR1: FP fused MAC bits Mask */\r
+\r
+#define FPU_MVFR1_FP_HPFP_Pos              24U                                            /*!< MVFR1: FP HPFP bits Position */\r
+#define FPU_MVFR1_FP_HPFP_Msk              (0xFUL << FPU_MVFR1_FP_HPFP_Pos)               /*!< MVFR1: FP HPFP bits Mask */\r
+\r
+#define FPU_MVFR1_D_NaN_mode_Pos            4U                                            /*!< MVFR1: D_NaN mode bits Position */\r
+#define FPU_MVFR1_D_NaN_mode_Msk           (0xFUL << FPU_MVFR1_D_NaN_mode_Pos)            /*!< MVFR1: D_NaN mode bits Mask */\r
+\r
+#define FPU_MVFR1_FtZ_mode_Pos              0U                                            /*!< MVFR1: FtZ mode bits Position */\r
+#define FPU_MVFR1_FtZ_mode_Msk             (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/)          /*!< MVFR1: FtZ mode bits Mask */\r
+\r
+/* Media and FP Feature Register 2 Definitions */\r
+\r
+/*@} end of group CMSIS_FPU */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_CoreDebug       Core Debug Registers (CoreDebug)\r
+  \brief    Type definitions for the Core Debug Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Core Debug Register (CoreDebug).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t DHCSR;                  /*!< Offset: 0x000 (R/W)  Debug Halting Control and Status Register */\r
+  __OM  uint32_t DCRSR;                  /*!< Offset: 0x004 ( /W)  Debug Core Register Selector Register */\r
+  __IOM uint32_t DCRDR;                  /*!< Offset: 0x008 (R/W)  Debug Core Register Data Register */\r
+  __IOM uint32_t DEMCR;                  /*!< Offset: 0x00C (R/W)  Debug Exception and Monitor Control Register */\r
+} CoreDebug_Type;\r
+\r
+/* Debug Halting Control and Status Register Definitions */\r
+#define CoreDebug_DHCSR_DBGKEY_Pos         16U                                            /*!< CoreDebug DHCSR: DBGKEY Position */\r
+#define CoreDebug_DHCSR_DBGKEY_Msk         (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos)       /*!< CoreDebug DHCSR: DBGKEY Mask */\r
+\r
+#define CoreDebug_DHCSR_S_RESET_ST_Pos     25U                                            /*!< CoreDebug DHCSR: S_RESET_ST Position */\r
+#define CoreDebug_DHCSR_S_RESET_ST_Msk     (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos)        /*!< CoreDebug DHCSR: S_RESET_ST Mask */\r
+\r
+#define CoreDebug_DHCSR_S_RETIRE_ST_Pos    24U                                            /*!< CoreDebug DHCSR: S_RETIRE_ST Position */\r
+#define CoreDebug_DHCSR_S_RETIRE_ST_Msk    (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos)       /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */\r
+\r
+#define CoreDebug_DHCSR_S_LOCKUP_Pos       19U                                            /*!< CoreDebug DHCSR: S_LOCKUP Position */\r
+#define CoreDebug_DHCSR_S_LOCKUP_Msk       (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos)          /*!< CoreDebug DHCSR: S_LOCKUP Mask */\r
+\r
+#define CoreDebug_DHCSR_S_SLEEP_Pos        18U                                            /*!< CoreDebug DHCSR: S_SLEEP Position */\r
+#define CoreDebug_DHCSR_S_SLEEP_Msk        (1UL << CoreDebug_DHCSR_S_SLEEP_Pos)           /*!< CoreDebug DHCSR: S_SLEEP Mask */\r
+\r
+#define CoreDebug_DHCSR_S_HALT_Pos         17U                                            /*!< CoreDebug DHCSR: S_HALT Position */\r
+#define CoreDebug_DHCSR_S_HALT_Msk         (1UL << CoreDebug_DHCSR_S_HALT_Pos)            /*!< CoreDebug DHCSR: S_HALT Mask */\r
+\r
+#define CoreDebug_DHCSR_S_REGRDY_Pos       16U                                            /*!< CoreDebug DHCSR: S_REGRDY Position */\r
+#define CoreDebug_DHCSR_S_REGRDY_Msk       (1UL << CoreDebug_DHCSR_S_REGRDY_Pos)          /*!< CoreDebug DHCSR: S_REGRDY Mask */\r
+\r
+#define CoreDebug_DHCSR_C_SNAPSTALL_Pos     5U                                            /*!< CoreDebug DHCSR: C_SNAPSTALL Position */\r
+#define CoreDebug_DHCSR_C_SNAPSTALL_Msk    (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos)       /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */\r
+\r
+#define CoreDebug_DHCSR_C_MASKINTS_Pos      3U                                            /*!< CoreDebug DHCSR: C_MASKINTS Position */\r
+#define CoreDebug_DHCSR_C_MASKINTS_Msk     (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos)        /*!< CoreDebug DHCSR: C_MASKINTS Mask */\r
+\r
+#define CoreDebug_DHCSR_C_STEP_Pos          2U                                            /*!< CoreDebug DHCSR: C_STEP Position */\r
+#define CoreDebug_DHCSR_C_STEP_Msk         (1UL << CoreDebug_DHCSR_C_STEP_Pos)            /*!< CoreDebug DHCSR: C_STEP Mask */\r
+\r
+#define CoreDebug_DHCSR_C_HALT_Pos          1U                                            /*!< CoreDebug DHCSR: C_HALT Position */\r
+#define CoreDebug_DHCSR_C_HALT_Msk         (1UL << CoreDebug_DHCSR_C_HALT_Pos)            /*!< CoreDebug DHCSR: C_HALT Mask */\r
+\r
+#define CoreDebug_DHCSR_C_DEBUGEN_Pos       0U                                            /*!< CoreDebug DHCSR: C_DEBUGEN Position */\r
+#define CoreDebug_DHCSR_C_DEBUGEN_Msk      (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/)     /*!< CoreDebug DHCSR: C_DEBUGEN Mask */\r
+\r
+/* Debug Core Register Selector Register Definitions */\r
+#define CoreDebug_DCRSR_REGWnR_Pos         16U                                            /*!< CoreDebug DCRSR: REGWnR Position */\r
+#define CoreDebug_DCRSR_REGWnR_Msk         (1UL << CoreDebug_DCRSR_REGWnR_Pos)            /*!< CoreDebug DCRSR: REGWnR Mask */\r
+\r
+#define CoreDebug_DCRSR_REGSEL_Pos          0U                                            /*!< CoreDebug DCRSR: REGSEL Position */\r
+#define CoreDebug_DCRSR_REGSEL_Msk         (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/)     /*!< CoreDebug DCRSR: REGSEL Mask */\r
+\r
+/* Debug Exception and Monitor Control Register Definitions */\r
+#define CoreDebug_DEMCR_TRCENA_Pos         24U                                            /*!< CoreDebug DEMCR: TRCENA Position */\r
+#define CoreDebug_DEMCR_TRCENA_Msk         (1UL << CoreDebug_DEMCR_TRCENA_Pos)            /*!< CoreDebug DEMCR: TRCENA Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_REQ_Pos        19U                                            /*!< CoreDebug DEMCR: MON_REQ Position */\r
+#define CoreDebug_DEMCR_MON_REQ_Msk        (1UL << CoreDebug_DEMCR_MON_REQ_Pos)           /*!< CoreDebug DEMCR: MON_REQ Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_STEP_Pos       18U                                            /*!< CoreDebug DEMCR: MON_STEP Position */\r
+#define CoreDebug_DEMCR_MON_STEP_Msk       (1UL << CoreDebug_DEMCR_MON_STEP_Pos)          /*!< CoreDebug DEMCR: MON_STEP Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_PEND_Pos       17U                                            /*!< CoreDebug DEMCR: MON_PEND Position */\r
+#define CoreDebug_DEMCR_MON_PEND_Msk       (1UL << CoreDebug_DEMCR_MON_PEND_Pos)          /*!< CoreDebug DEMCR: MON_PEND Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_EN_Pos         16U                                            /*!< CoreDebug DEMCR: MON_EN Position */\r
+#define CoreDebug_DEMCR_MON_EN_Msk         (1UL << CoreDebug_DEMCR_MON_EN_Pos)            /*!< CoreDebug DEMCR: MON_EN Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_HARDERR_Pos     10U                                            /*!< CoreDebug DEMCR: VC_HARDERR Position */\r
+#define CoreDebug_DEMCR_VC_HARDERR_Msk     (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos)        /*!< CoreDebug DEMCR: VC_HARDERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_INTERR_Pos       9U                                            /*!< CoreDebug DEMCR: VC_INTERR Position */\r
+#define CoreDebug_DEMCR_VC_INTERR_Msk      (1UL << CoreDebug_DEMCR_VC_INTERR_Pos)         /*!< CoreDebug DEMCR: VC_INTERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_BUSERR_Pos       8U                                            /*!< CoreDebug DEMCR: VC_BUSERR Position */\r
+#define CoreDebug_DEMCR_VC_BUSERR_Msk      (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos)         /*!< CoreDebug DEMCR: VC_BUSERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_STATERR_Pos      7U                                            /*!< CoreDebug DEMCR: VC_STATERR Position */\r
+#define CoreDebug_DEMCR_VC_STATERR_Msk     (1UL << CoreDebug_DEMCR_VC_STATERR_Pos)        /*!< CoreDebug DEMCR: VC_STATERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_CHKERR_Pos       6U                                            /*!< CoreDebug DEMCR: VC_CHKERR Position */\r
+#define CoreDebug_DEMCR_VC_CHKERR_Msk      (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos)         /*!< CoreDebug DEMCR: VC_CHKERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_NOCPERR_Pos      5U                                            /*!< CoreDebug DEMCR: VC_NOCPERR Position */\r
+#define CoreDebug_DEMCR_VC_NOCPERR_Msk     (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos)        /*!< CoreDebug DEMCR: VC_NOCPERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_MMERR_Pos        4U                                            /*!< CoreDebug DEMCR: VC_MMERR Position */\r
+#define CoreDebug_DEMCR_VC_MMERR_Msk       (1UL << CoreDebug_DEMCR_VC_MMERR_Pos)          /*!< CoreDebug DEMCR: VC_MMERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_CORERESET_Pos    0U                                            /*!< CoreDebug DEMCR: VC_CORERESET Position */\r
+#define CoreDebug_DEMCR_VC_CORERESET_Msk   (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/)  /*!< CoreDebug DEMCR: VC_CORERESET Mask */\r
+\r
+/*@} end of group CMSIS_CoreDebug */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_bitfield     Core register bit field macros\r
+  \brief      Macros for use with bit field definitions (xxx_Pos, xxx_Msk).\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   Mask and shift a bit field value for use in a register bit range.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of the bit field. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted value.\r
+*/\r
+#define _VAL2FLD(field, value)    (((uint32_t)(value) << field ## _Pos) & field ## _Msk)\r
+\r
+/**\r
+  \brief     Mask and shift a register value to extract a bit filed value.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of register. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted bit field value.\r
+*/\r
+#define _FLD2VAL(field, value)    (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)\r
+\r
+/*@} end of group CMSIS_core_bitfield */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_base     Core Definitions\r
+  \brief      Definitions for base addresses, unions, and structures.\r
+  @{\r
+ */\r
+\r
+/* Memory mapping of Core Hardware */\r
+#define SCS_BASE            (0xE000E000UL)                            /*!< System Control Space Base Address */\r
+#define ITM_BASE            (0xE0000000UL)                            /*!< ITM Base Address */\r
+#define DWT_BASE            (0xE0001000UL)                            /*!< DWT Base Address */\r
+#define TPI_BASE            (0xE0040000UL)                            /*!< TPI Base Address */\r
+#define CoreDebug_BASE      (0xE000EDF0UL)                            /*!< Core Debug Base Address */\r
+#define SysTick_BASE        (SCS_BASE +  0x0010UL)                    /*!< SysTick Base Address */\r
+#define NVIC_BASE           (SCS_BASE +  0x0100UL)                    /*!< NVIC Base Address */\r
+#define SCB_BASE            (SCS_BASE +  0x0D00UL)                    /*!< System Control Block Base Address */\r
+\r
+#define SCnSCB              ((SCnSCB_Type    *)     SCS_BASE      )   /*!< System control Register not in SCB */\r
+#define SCB                 ((SCB_Type       *)     SCB_BASE      )   /*!< SCB configuration struct */\r
+#define SysTick             ((SysTick_Type   *)     SysTick_BASE  )   /*!< SysTick configuration struct */\r
+#define NVIC                ((NVIC_Type      *)     NVIC_BASE     )   /*!< NVIC configuration struct */\r
+#define ITM                 ((ITM_Type       *)     ITM_BASE      )   /*!< ITM configuration struct */\r
+#define DWT                 ((DWT_Type       *)     DWT_BASE      )   /*!< DWT configuration struct */\r
+#define TPI                 ((TPI_Type       *)     TPI_BASE      )   /*!< TPI configuration struct */\r
+#define CoreDebug           ((CoreDebug_Type *)     CoreDebug_BASE)   /*!< Core Debug configuration struct */\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+  #define MPU_BASE          (SCS_BASE +  0x0D90UL)                    /*!< Memory Protection Unit */\r
+  #define MPU               ((MPU_Type       *)     MPU_BASE      )   /*!< Memory Protection Unit */\r
+#endif\r
+\r
+#define FPU_BASE            (SCS_BASE +  0x0F30UL)                    /*!< Floating Point Unit */\r
+#define FPU                 ((FPU_Type       *)     FPU_BASE      )   /*!< Floating Point Unit */\r
+\r
+/*@} */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                Hardware Abstraction Layer\r
+  Core Function Interface contains:\r
+  - Core NVIC Functions\r
+  - Core SysTick Functions\r
+  - Core Debug Functions\r
+  - Core Register Access Functions\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference\r
+*/\r
+\r
+\r
+\r
+/* ##########################   NVIC functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_NVICFunctions NVIC Functions\r
+  \brief    Functions that manage interrupts and exceptions via the NVIC.\r
+  @{\r
+ */\r
+\r
+#ifdef CMSIS_NVIC_VIRTUAL\r
+  #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+    #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"\r
+  #endif\r
+  #include CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+#else\r
+  #define NVIC_SetPriorityGrouping    __NVIC_SetPriorityGrouping\r
+  #define NVIC_GetPriorityGrouping    __NVIC_GetPriorityGrouping\r
+  #define NVIC_EnableIRQ              __NVIC_EnableIRQ\r
+  #define NVIC_GetEnableIRQ           __NVIC_GetEnableIRQ\r
+  #define NVIC_DisableIRQ             __NVIC_DisableIRQ\r
+  #define NVIC_GetPendingIRQ          __NVIC_GetPendingIRQ\r
+  #define NVIC_SetPendingIRQ          __NVIC_SetPendingIRQ\r
+  #define NVIC_ClearPendingIRQ        __NVIC_ClearPendingIRQ\r
+  #define NVIC_GetActive              __NVIC_GetActive\r
+  #define NVIC_SetPriority            __NVIC_SetPriority\r
+  #define NVIC_GetPriority            __NVIC_GetPriority\r
+  #define NVIC_SystemReset            __NVIC_SystemReset\r
+#endif /* CMSIS_NVIC_VIRTUAL */\r
+\r
+#ifdef CMSIS_VECTAB_VIRTUAL\r
+  #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+    #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"\r
+  #endif\r
+  #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+#else\r
+  #define NVIC_SetVector              __NVIC_SetVector\r
+  #define NVIC_GetVector              __NVIC_GetVector\r
+#endif  /* (CMSIS_VECTAB_VIRTUAL) */\r
+\r
+#define NVIC_USER_IRQ_OFFSET          16\r
+\r
+\r
+/* The following EXC_RETURN values are saved the LR on exception entry */\r
+#define EXC_RETURN_HANDLER         (0xFFFFFFF1UL)     /* return to Handler mode, uses MSP after return                               */\r
+#define EXC_RETURN_THREAD_MSP      (0xFFFFFFF9UL)     /* return to Thread mode, uses MSP after return                                */\r
+#define EXC_RETURN_THREAD_PSP      (0xFFFFFFFDUL)     /* return to Thread mode, uses PSP after return                                */\r
+#define EXC_RETURN_HANDLER_FPU     (0xFFFFFFE1UL)     /* return to Handler mode, uses MSP after return, restore floating-point state */\r
+#define EXC_RETURN_THREAD_MSP_FPU  (0xFFFFFFE9UL)     /* return to Thread mode, uses MSP after return, restore floating-point state  */\r
+#define EXC_RETURN_THREAD_PSP_FPU  (0xFFFFFFEDUL)     /* return to Thread mode, uses PSP after return, restore floating-point state  */\r
+\r
+\r
+/**\r
+  \brief   Set Priority Grouping\r
+  \details Sets the priority grouping field using the required unlock sequence.\r
+           The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field.\r
+           Only values from 0..7 are used.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.\r
+  \param [in]      PriorityGroup  Priority grouping field.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup)\r
+{\r
+  uint32_t reg_value;\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);             /* only values 0..7 are used          */\r
+\r
+  reg_value  =  SCB->AIRCR;                                                   /* read old register configuration    */\r
+  reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change               */\r
+  reg_value  =  (reg_value                                   |\r
+                ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |\r
+                (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos)  );              /* Insert write key and priority group */\r
+  SCB->AIRCR =  reg_value;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Priority Grouping\r
+  \details Reads the priority grouping field from the NVIC Interrupt Controller.\r
+  \return                Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field).\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void)\r
+{\r
+  return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos));\r
+}\r
+\r
+\r
+/**\r
+  \brief   Enable Interrupt\r
+  \details Enables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Enable status\r
+  \details Returns a device specific interrupt enable status from the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt is not enabled.\r
+  \return             1  Interrupt is enabled.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Disable Interrupt\r
+  \details Disables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+    __DSB();\r
+    __ISB();\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Pending Interrupt\r
+  \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not pending.\r
+  \return             1  Interrupt status is pending.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Pending Interrupt\r
+  \details Sets the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Clear Pending Interrupt\r
+  \details Clears the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Active Interrupt\r
+  \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not active.\r
+  \return             1  Interrupt status is active.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Priority\r
+  \details Sets the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]      IRQn  Interrupt number.\r
+  \param [in]  priority  Priority to set.\r
+  \note    The priority cannot be set for every processor exception.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->IP[((uint32_t)IRQn)]                = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);\r
+  }\r
+  else\r
+  {\r
+    SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Priority\r
+  \details Reads the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn  Interrupt number.\r
+  \return             Interrupt Priority.\r
+                      Value is aligned automatically to the implemented priority bits of the microcontroller.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)\r
+{\r
+\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return(((uint32_t)NVIC->IP[((uint32_t)IRQn)]                >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+  else\r
+  {\r
+    return(((uint32_t)SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Encode Priority\r
+  \details Encodes the priority for an interrupt with the given priority group,\r
+           preemptive priority value, and subpriority value.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.\r
+  \param [in]     PriorityGroup  Used priority group.\r
+  \param [in]   PreemptPriority  Preemptive priority value (starting from 0).\r
+  \param [in]       SubPriority  Subpriority value (starting from 0).\r
+  \return                        Encoded priority. Value can be used in the function \ref NVIC_SetPriority().\r
+ */\r
+__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);\r
+  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));\r
+\r
+  return (\r
+           ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |\r
+           ((SubPriority     & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL)))\r
+         );\r
+}\r
+\r
+\r
+/**\r
+  \brief   Decode Priority\r
+  \details Decodes an interrupt priority value with a given priority group to\r
+           preemptive priority value and subpriority value.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.\r
+  \param [in]         Priority   Priority value, which can be retrieved with the function \ref NVIC_GetPriority().\r
+  \param [in]     PriorityGroup  Used priority group.\r
+  \param [out] pPreemptPriority  Preemptive priority value (starting from 0).\r
+  \param [out]     pSubPriority  Subpriority value (starting from 0).\r
+ */\r
+__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);\r
+  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));\r
+\r
+  *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);\r
+  *pSubPriority     = (Priority                   ) & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Vector\r
+  \details Sets an interrupt vector in SRAM based interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+           VTOR must been relocated to SRAM before.\r
+  \param [in]   IRQn      Interrupt number\r
+  \param [in]   vector    Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)\r
+{\r
+  uint32_t *vectors = (uint32_t *)SCB->VTOR;\r
+  vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Vector\r
+  \details Reads an interrupt vector from interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn      Interrupt number.\r
+  \return                 Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)\r
+{\r
+  uint32_t *vectors = (uint32_t *)SCB->VTOR;\r
+  return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];\r
+}\r
+\r
+\r
+/**\r
+  \brief   System Reset\r
+  \details Initiates a system reset request to reset the MCU.\r
+ */\r
+__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)\r
+{\r
+  __DSB();                                                          /* Ensure all outstanding memory accesses included\r
+                                                                       buffered write are completed before reset */\r
+  SCB->AIRCR  = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos)    |\r
+                           (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |\r
+                            SCB_AIRCR_SYSRESETREQ_Msk    );         /* Keep priority group unchanged */\r
+  __DSB();                                                          /* Ensure completion of memory access */\r
+\r
+  for(;;)                                                           /* wait until reset */\r
+  {\r
+    __NOP();\r
+  }\r
+}\r
+\r
+/*@} end of CMSIS_Core_NVICFunctions */\r
+\r
+/* ##########################  MPU functions  #################################### */\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+\r
+#include "mpu_armv7.h"\r
+\r
+#endif\r
+\r
+/* ##########################  FPU functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_FpuFunctions FPU Functions\r
+  \brief    Function that provides FPU type.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   get FPU type\r
+  \details returns the FPU type\r
+  \returns\r
+   - \b  0: No FPU\r
+   - \b  1: Single precision FPU\r
+   - \b  2: Double + Single precision FPU\r
+ */\r
+__STATIC_INLINE uint32_t SCB_GetFPUType(void)\r
+{\r
+  uint32_t mvfr0;\r
+\r
+  mvfr0 = SCB->MVFR0;\r
+  if      ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x220U)\r
+  {\r
+    return 2U;           /* Double + Single precision FPU */\r
+  }\r
+  else if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x020U)\r
+  {\r
+    return 1U;           /* Single precision FPU */\r
+  }\r
+  else\r
+  {\r
+    return 0U;           /* No FPU */\r
+  }\r
+}\r
+\r
+\r
+/*@} end of CMSIS_Core_FpuFunctions */\r
+\r
+\r
+\r
+/* ##########################  Cache functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_CacheFunctions Cache Functions\r
+  \brief    Functions that configure Instruction and Data cache.\r
+  @{\r
+ */\r
+\r
+/* Cache Size ID Register Macros */\r
+#define CCSIDR_WAYS(x)         (((x) & SCB_CCSIDR_ASSOCIATIVITY_Msk) >> SCB_CCSIDR_ASSOCIATIVITY_Pos)\r
+#define CCSIDR_SETS(x)         (((x) & SCB_CCSIDR_NUMSETS_Msk      ) >> SCB_CCSIDR_NUMSETS_Pos      )\r
+\r
+\r
+/**\r
+  \brief   Enable I-Cache\r
+  \details Turns on I-Cache\r
+  */\r
+__STATIC_INLINE void SCB_EnableICache (void)\r
+{\r
+  #if defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U)\r
+    __DSB();\r
+    __ISB();\r
+    SCB->ICIALLU = 0UL;                     /* invalidate I-Cache */\r
+    __DSB();\r
+    __ISB();\r
+    SCB->CCR |=  (uint32_t)SCB_CCR_IC_Msk;  /* enable I-Cache */\r
+    __DSB();\r
+    __ISB();\r
+  #endif\r
+}\r
+\r
+\r
+/**\r
+  \brief   Disable I-Cache\r
+  \details Turns off I-Cache\r
+  */\r
+__STATIC_INLINE void SCB_DisableICache (void)\r
+{\r
+  #if defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U)\r
+    __DSB();\r
+    __ISB();\r
+    SCB->CCR &= ~(uint32_t)SCB_CCR_IC_Msk;  /* disable I-Cache */\r
+    SCB->ICIALLU = 0UL;                     /* invalidate I-Cache */\r
+    __DSB();\r
+    __ISB();\r
+  #endif\r
+}\r
+\r
+\r
+/**\r
+  \brief   Invalidate I-Cache\r
+  \details Invalidates I-Cache\r
+  */\r
+__STATIC_INLINE void SCB_InvalidateICache (void)\r
+{\r
+  #if defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U)\r
+    __DSB();\r
+    __ISB();\r
+    SCB->ICIALLU = 0UL;\r
+    __DSB();\r
+    __ISB();\r
+  #endif\r
+}\r
+\r
+\r
+/**\r
+  \brief   Enable D-Cache\r
+  \details Turns on D-Cache\r
+  */\r
+__STATIC_INLINE void SCB_EnableDCache (void)\r
+{\r
+  #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U)\r
+    uint32_t ccsidr;\r
+    uint32_t sets;\r
+    uint32_t ways;\r
+\r
+    SCB->CSSELR = 0U; /*(0U << 1U) | 0U;*/  /* Level 1 data cache */\r
+    __DSB();\r
+\r
+    ccsidr = SCB->CCSIDR;\r
+\r
+                                            /* invalidate D-Cache */\r
+    sets = (uint32_t)(CCSIDR_SETS(ccsidr));\r
+    do {\r
+      ways = (uint32_t)(CCSIDR_WAYS(ccsidr));\r
+      do {\r
+        SCB->DCISW = (((sets << SCB_DCISW_SET_Pos) & SCB_DCISW_SET_Msk) |\r
+                      ((ways << SCB_DCISW_WAY_Pos) & SCB_DCISW_WAY_Msk)  );\r
+        #if defined ( __CC_ARM )\r
+          __schedule_barrier();\r
+        #endif\r
+      } while (ways-- != 0U);\r
+    } while(sets-- != 0U);\r
+    __DSB();\r
+\r
+    SCB->CCR |=  (uint32_t)SCB_CCR_DC_Msk;  /* enable D-Cache */\r
+\r
+    __DSB();\r
+    __ISB();\r
+  #endif\r
+}\r
+\r
+\r
+/**\r
+  \brief   Disable D-Cache\r
+  \details Turns off D-Cache\r
+  */\r
+__STATIC_INLINE void SCB_DisableDCache (void)\r
+{\r
+  #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U)\r
+    uint32_t ccsidr;\r
+    uint32_t sets;\r
+    uint32_t ways;\r
+\r
+    SCB->CSSELR = 0U; /*(0U << 1U) | 0U;*/  /* Level 1 data cache */\r
+    __DSB();\r
+\r
+    SCB->CCR &= ~(uint32_t)SCB_CCR_DC_Msk;  /* disable D-Cache */\r
+    __DSB();\r
+\r
+    ccsidr = SCB->CCSIDR;\r
+\r
+                                            /* clean & invalidate D-Cache */\r
+    sets = (uint32_t)(CCSIDR_SETS(ccsidr));\r
+    do {\r
+      ways = (uint32_t)(CCSIDR_WAYS(ccsidr));\r
+      do {\r
+        SCB->DCCISW = (((sets << SCB_DCCISW_SET_Pos) & SCB_DCCISW_SET_Msk) |\r
+                       ((ways << SCB_DCCISW_WAY_Pos) & SCB_DCCISW_WAY_Msk)  );\r
+        #if defined ( __CC_ARM )\r
+          __schedule_barrier();\r
+        #endif\r
+      } while (ways-- != 0U);\r
+    } while(sets-- != 0U);\r
+\r
+    __DSB();\r
+    __ISB();\r
+  #endif\r
+}\r
+\r
+\r
+/**\r
+  \brief   Invalidate D-Cache\r
+  \details Invalidates D-Cache\r
+  */\r
+__STATIC_INLINE void SCB_InvalidateDCache (void)\r
+{\r
+  #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U)\r
+    uint32_t ccsidr;\r
+    uint32_t sets;\r
+    uint32_t ways;\r
+\r
+    SCB->CSSELR = 0U; /*(0U << 1U) | 0U;*/  /* Level 1 data cache */\r
+    __DSB();\r
+\r
+    ccsidr = SCB->CCSIDR;\r
+\r
+                                            /* invalidate D-Cache */\r
+    sets = (uint32_t)(CCSIDR_SETS(ccsidr));\r
+    do {\r
+      ways = (uint32_t)(CCSIDR_WAYS(ccsidr));\r
+      do {\r
+        SCB->DCISW = (((sets << SCB_DCISW_SET_Pos) & SCB_DCISW_SET_Msk) |\r
+                      ((ways << SCB_DCISW_WAY_Pos) & SCB_DCISW_WAY_Msk)  );\r
+        #if defined ( __CC_ARM )\r
+          __schedule_barrier();\r
+        #endif\r
+      } while (ways-- != 0U);\r
+    } while(sets-- != 0U);\r
+\r
+    __DSB();\r
+    __ISB();\r
+  #endif\r
+}\r
+\r
+\r
+/**\r
+  \brief   Clean D-Cache\r
+  \details Cleans D-Cache\r
+  */\r
+__STATIC_INLINE void SCB_CleanDCache (void)\r
+{\r
+  #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U)\r
+    uint32_t ccsidr;\r
+    uint32_t sets;\r
+    uint32_t ways;\r
+\r
+     SCB->CSSELR = 0U; /*(0U << 1U) | 0U;*/  /* Level 1 data cache */\r
+   __DSB();\r
+\r
+    ccsidr = SCB->CCSIDR;\r
+\r
+                                            /* clean D-Cache */\r
+    sets = (uint32_t)(CCSIDR_SETS(ccsidr));\r
+    do {\r
+      ways = (uint32_t)(CCSIDR_WAYS(ccsidr));\r
+      do {\r
+        SCB->DCCSW = (((sets << SCB_DCCSW_SET_Pos) & SCB_DCCSW_SET_Msk) |\r
+                      ((ways << SCB_DCCSW_WAY_Pos) & SCB_DCCSW_WAY_Msk)  );\r
+        #if defined ( __CC_ARM )\r
+          __schedule_barrier();\r
+        #endif\r
+      } while (ways-- != 0U);\r
+    } while(sets-- != 0U);\r
+\r
+    __DSB();\r
+    __ISB();\r
+  #endif\r
+}\r
+\r
+\r
+/**\r
+  \brief   Clean & Invalidate D-Cache\r
+  \details Cleans and Invalidates D-Cache\r
+  */\r
+__STATIC_INLINE void SCB_CleanInvalidateDCache (void)\r
+{\r
+  #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U)\r
+    uint32_t ccsidr;\r
+    uint32_t sets;\r
+    uint32_t ways;\r
+\r
+    SCB->CSSELR = 0U; /*(0U << 1U) | 0U;*/  /* Level 1 data cache */\r
+    __DSB();\r
+\r
+    ccsidr = SCB->CCSIDR;\r
+\r
+                                            /* clean & invalidate D-Cache */\r
+    sets = (uint32_t)(CCSIDR_SETS(ccsidr));\r
+    do {\r
+      ways = (uint32_t)(CCSIDR_WAYS(ccsidr));\r
+      do {\r
+        SCB->DCCISW = (((sets << SCB_DCCISW_SET_Pos) & SCB_DCCISW_SET_Msk) |\r
+                       ((ways << SCB_DCCISW_WAY_Pos) & SCB_DCCISW_WAY_Msk)  );\r
+        #if defined ( __CC_ARM )\r
+          __schedule_barrier();\r
+        #endif\r
+      } while (ways-- != 0U);\r
+    } while(sets-- != 0U);\r
+\r
+    __DSB();\r
+    __ISB();\r
+  #endif\r
+}\r
+\r
+\r
+/**\r
+  \brief   D-Cache Invalidate by address\r
+  \details Invalidates D-Cache for the given address\r
+  \param[in]   addr    address (aligned to 32-byte boundary)\r
+  \param[in]   dsize   size of memory block (in number of bytes)\r
+*/\r
+__STATIC_INLINE void SCB_InvalidateDCache_by_Addr (uint32_t *addr, int32_t dsize)\r
+{\r
+  #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U)\r
+     int32_t op_size = dsize;\r
+    uint32_t op_addr = (uint32_t)addr;\r
+     int32_t linesize = 32;                /* in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) */\r
+\r
+    __DSB();\r
+\r
+    while (op_size > 0) {\r
+      SCB->DCIMVAC = op_addr;\r
+      op_addr += (uint32_t)linesize;\r
+      op_size -=           linesize;\r
+    }\r
+\r
+    __DSB();\r
+    __ISB();\r
+  #endif\r
+}\r
+\r
+\r
+/**\r
+  \brief   D-Cache Clean by address\r
+  \details Cleans D-Cache for the given address\r
+  \param[in]   addr    address (aligned to 32-byte boundary)\r
+  \param[in]   dsize   size of memory block (in number of bytes)\r
+*/\r
+__STATIC_INLINE void SCB_CleanDCache_by_Addr (uint32_t *addr, int32_t dsize)\r
+{\r
+  #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U)\r
+     int32_t op_size = dsize;\r
+    uint32_t op_addr = (uint32_t) addr;\r
+     int32_t linesize = 32;                /* in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) */\r
+\r
+    __DSB();\r
+\r
+    while (op_size > 0) {\r
+      SCB->DCCMVAC = op_addr;\r
+      op_addr += (uint32_t)linesize;\r
+      op_size -=           linesize;\r
+    }\r
+\r
+    __DSB();\r
+    __ISB();\r
+  #endif\r
+}\r
+\r
+\r
+/**\r
+  \brief   D-Cache Clean and Invalidate by address\r
+  \details Cleans and invalidates D_Cache for the given address\r
+  \param[in]   addr    address (aligned to 32-byte boundary)\r
+  \param[in]   dsize   size of memory block (in number of bytes)\r
+*/\r
+__STATIC_INLINE void SCB_CleanInvalidateDCache_by_Addr (uint32_t *addr, int32_t dsize)\r
+{\r
+  #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U)\r
+     int32_t op_size = dsize;\r
+    uint32_t op_addr = (uint32_t) addr;\r
+     int32_t linesize = 32;                /* in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) */\r
+\r
+    __DSB();\r
+\r
+    while (op_size > 0) {\r
+      SCB->DCCIMVAC = op_addr;\r
+      op_addr += (uint32_t)linesize;\r
+      op_size -=           linesize;\r
+    }\r
+\r
+    __DSB();\r
+    __ISB();\r
+  #endif\r
+}\r
+\r
+\r
+/*@} end of CMSIS_Core_CacheFunctions */\r
+\r
+\r
+\r
+/* ##################################    SysTick function  ############################################ */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_SysTickFunctions SysTick Functions\r
+  \brief    Functions that configure the System.\r
+  @{\r
+ */\r
+\r
+#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)\r
+\r
+/**\r
+  \brief   System Tick Configuration\r
+  \details Initializes the System Timer and its interrupt, and starts the System Tick Timer.\r
+           Counter is in free running mode to generate periodic interrupts.\r
+  \param [in]  ticks  Number of ticks between two interrupts.\r
+  \return          0  Function succeeded.\r
+  \return          1  Function failed.\r
+  \note    When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the\r
+           function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>\r
+           must contain a vendor-specific implementation of this function.\r
+ */\r
+__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)\r
+{\r
+  if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)\r
+  {\r
+    return (1UL);                                                   /* Reload value impossible */\r
+  }\r
+\r
+  SysTick->LOAD  = (uint32_t)(ticks - 1UL);                         /* set reload register */\r
+  NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */\r
+  SysTick->VAL   = 0UL;                                             /* Load the SysTick Counter Value */\r
+  SysTick->CTRL  = SysTick_CTRL_CLKSOURCE_Msk |\r
+                   SysTick_CTRL_TICKINT_Msk   |\r
+                   SysTick_CTRL_ENABLE_Msk;                         /* Enable SysTick IRQ and SysTick Timer */\r
+  return (0UL);                                                     /* Function successful */\r
+}\r
+\r
+#endif\r
+\r
+/*@} end of CMSIS_Core_SysTickFunctions */\r
+\r
+\r
+\r
+/* ##################################### Debug In/Output function ########################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_core_DebugFunctions ITM Functions\r
+  \brief    Functions that access the ITM debug interface.\r
+  @{\r
+ */\r
+\r
+extern volatile int32_t ITM_RxBuffer;                              /*!< External variable to receive characters. */\r
+#define                 ITM_RXBUFFER_EMPTY  ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */\r
+\r
+\r
+/**\r
+  \brief   ITM Send Character\r
+  \details Transmits a character via the ITM channel 0, and\r
+           \li Just returns when no debugger is connected that has booked the output.\r
+           \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted.\r
+  \param [in]     ch  Character to transmit.\r
+  \returns            Character to transmit.\r
+ */\r
+__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch)\r
+{\r
+  if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) &&      /* ITM enabled */\r
+      ((ITM->TER & 1UL               ) != 0UL)   )     /* ITM Port #0 enabled */\r
+  {\r
+    while (ITM->PORT[0U].u32 == 0UL)\r
+    {\r
+      __NOP();\r
+    }\r
+    ITM->PORT[0U].u8 = (uint8_t)ch;\r
+  }\r
+  return (ch);\r
+}\r
+\r
+\r
+/**\r
+  \brief   ITM Receive Character\r
+  \details Inputs a character via the external variable \ref ITM_RxBuffer.\r
+  \return             Received character.\r
+  \return         -1  No character pending.\r
+ */\r
+__STATIC_INLINE int32_t ITM_ReceiveChar (void)\r
+{\r
+  int32_t ch = -1;                           /* no character available */\r
+\r
+  if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY)\r
+  {\r
+    ch = ITM_RxBuffer;\r
+    ITM_RxBuffer = ITM_RXBUFFER_EMPTY;       /* ready for next character */\r
+  }\r
+\r
+  return (ch);\r
+}\r
+\r
+\r
+/**\r
+  \brief   ITM Check Character\r
+  \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer.\r
+  \return          0  No character available.\r
+  \return          1  Character available.\r
+ */\r
+__STATIC_INLINE int32_t ITM_CheckChar (void)\r
+{\r
+\r
+  if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY)\r
+  {\r
+    return (0);                              /* no character available */\r
+  }\r
+  else\r
+  {\r
+    return (1);                              /*    character available */\r
+  }\r
+}\r
+\r
+/*@} end of CMSIS_core_DebugFunctions */\r
+\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_CM7_H_DEPENDANT */\r
+\r
+#endif /* __CMSIS_GENERIC */\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_sc000.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_sc000.h
new file mode 100644 (file)
index 0000000..9086c64
--- /dev/null
@@ -0,0 +1,1022 @@
+/**************************************************************************//**\r
+ * @file     core_sc000.h\r
+ * @brief    CMSIS SC000 Core Peripheral Access Layer Header File\r
+ * @version  V5.0.5\r
+ * @date     28. May 2018\r
+ ******************************************************************************/\r
+/*\r
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.\r
+ *\r
+ * SPDX-License-Identifier: Apache-2.0\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the License); you may\r
+ * not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#if   defined ( __ICCARM__ )\r
+  #pragma system_include         /* treat file as system include file for MISRA check */\r
+#elif defined (__clang__)\r
+  #pragma clang system_header   /* treat file as system include file */\r
+#endif\r
+\r
+#ifndef __CORE_SC000_H_GENERIC\r
+#define __CORE_SC000_H_GENERIC\r
+\r
+#include <stdint.h>\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/**\r
+  \page CMSIS_MISRA_Exceptions  MISRA-C:2004 Compliance Exceptions\r
+  CMSIS violates the following MISRA-C:2004 rules:\r
+\r
+   \li Required Rule 8.5, object/function definition in header file.<br>\r
+     Function definitions in header files are used to allow 'inlining'.\r
+\r
+   \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>\r
+     Unions are used for effective representation of core registers.\r
+\r
+   \li Advisory Rule 19.7, Function-like macro defined.<br>\r
+     Function-like macros are used to allow more efficient code.\r
+ */\r
+\r
+\r
+/*******************************************************************************\r
+ *                 CMSIS definitions\r
+ ******************************************************************************/\r
+/**\r
+  \ingroup SC000\r
+  @{\r
+ */\r
+\r
+#include "cmsis_version.h"\r
+\r
+/*  CMSIS SC000 definitions */\r
+#define __SC000_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                /*!< \deprecated [31:16] CMSIS HAL main version */\r
+#define __SC000_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                 /*!< \deprecated [15:0]  CMSIS HAL sub version */\r
+#define __SC000_CMSIS_VERSION       ((__SC000_CMSIS_VERSION_MAIN << 16U) | \\r
+                                      __SC000_CMSIS_VERSION_SUB           )  /*!< \deprecated CMSIS HAL version number */\r
+\r
+#define __CORTEX_SC                 (000U)                                   /*!< Cortex secure core */\r
+\r
+/** __FPU_USED indicates whether an FPU is used or not.\r
+    This core does not support an FPU at all\r
+*/\r
+#define __FPU_USED       0U\r
+\r
+#if defined ( __CC_ARM )\r
+  #if defined __TARGET_FPU_VFP\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)\r
+  #if defined __ARM_PCS_VFP\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __GNUC__ )\r
+  #if defined (__VFP_FP__) && !defined(__SOFTFP__)\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __ICCARM__ )\r
+  #if defined __ARMVFP__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __TI_ARM__ )\r
+  #if defined __TI_VFP_SUPPORT__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __TASKING__ )\r
+  #if defined __FPU_VFP__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __CSMC__ )\r
+  #if ( __CSMC__ & 0x400U)\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#endif\r
+\r
+#include "cmsis_compiler.h"               /* CMSIS compiler specific defines */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_SC000_H_GENERIC */\r
+\r
+#ifndef __CMSIS_GENERIC\r
+\r
+#ifndef __CORE_SC000_H_DEPENDANT\r
+#define __CORE_SC000_H_DEPENDANT\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/* check device defines and use defaults */\r
+#if defined __CHECK_DEVICE_DEFINES\r
+  #ifndef __SC000_REV\r
+    #define __SC000_REV             0x0000U\r
+    #warning "__SC000_REV not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __MPU_PRESENT\r
+    #define __MPU_PRESENT             0U\r
+    #warning "__MPU_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __NVIC_PRIO_BITS\r
+    #define __NVIC_PRIO_BITS          2U\r
+    #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __Vendor_SysTickConfig\r
+    #define __Vendor_SysTickConfig    0U\r
+    #warning "__Vendor_SysTickConfig not defined in device header file; using default!"\r
+  #endif\r
+#endif\r
+\r
+/* IO definitions (access restrictions to peripheral registers) */\r
+/**\r
+    \defgroup CMSIS_glob_defs CMSIS Global Defines\r
+\r
+    <strong>IO Type Qualifiers</strong> are used\r
+    \li to specify the access to peripheral variables.\r
+    \li for automatic generation of peripheral register debug information.\r
+*/\r
+#ifdef __cplusplus\r
+  #define   __I     volatile             /*!< Defines 'read only' permissions */\r
+#else\r
+  #define   __I     volatile const       /*!< Defines 'read only' permissions */\r
+#endif\r
+#define     __O     volatile             /*!< Defines 'write only' permissions */\r
+#define     __IO    volatile             /*!< Defines 'read / write' permissions */\r
+\r
+/* following defines should be used for structure members */\r
+#define     __IM     volatile const      /*! Defines 'read only' structure member permissions */\r
+#define     __OM     volatile            /*! Defines 'write only' structure member permissions */\r
+#define     __IOM    volatile            /*! Defines 'read / write' structure member permissions */\r
+\r
+/*@} end of group SC000 */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                 Register Abstraction\r
+  Core Register contain:\r
+  - Core Register\r
+  - Core NVIC Register\r
+  - Core SCB Register\r
+  - Core SysTick Register\r
+  - Core MPU Register\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_core_register Defines and Type Definitions\r
+  \brief Type definitions and defines for Cortex-M processor based devices.\r
+*/\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_CORE  Status and Control Registers\r
+  \brief      Core Register type definitions.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Union type to access the Application Program Status Register (APSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t _reserved0:28;              /*!< bit:  0..27  Reserved */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} APSR_Type;\r
+\r
+/* APSR Register Definitions */\r
+#define APSR_N_Pos                         31U                                            /*!< APSR: N Position */\r
+#define APSR_N_Msk                         (1UL << APSR_N_Pos)                            /*!< APSR: N Mask */\r
+\r
+#define APSR_Z_Pos                         30U                                            /*!< APSR: Z Position */\r
+#define APSR_Z_Msk                         (1UL << APSR_Z_Pos)                            /*!< APSR: Z Mask */\r
+\r
+#define APSR_C_Pos                         29U                                            /*!< APSR: C Position */\r
+#define APSR_C_Msk                         (1UL << APSR_C_Pos)                            /*!< APSR: C Mask */\r
+\r
+#define APSR_V_Pos                         28U                                            /*!< APSR: V Position */\r
+#define APSR_V_Msk                         (1UL << APSR_V_Pos)                            /*!< APSR: V Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Interrupt Program Status Register (IPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:23;              /*!< bit:  9..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} IPSR_Type;\r
+\r
+/* IPSR Register Definitions */\r
+#define IPSR_ISR_Pos                        0U                                            /*!< IPSR: ISR Position */\r
+#define IPSR_ISR_Msk                       (0x1FFUL /*<< IPSR_ISR_Pos*/)                  /*!< IPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Special-Purpose Program Status Registers (xPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:15;              /*!< bit:  9..23  Reserved */\r
+    uint32_t T:1;                        /*!< bit:     24  Thumb bit        (read 0) */\r
+    uint32_t _reserved1:3;               /*!< bit: 25..27  Reserved */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} xPSR_Type;\r
+\r
+/* xPSR Register Definitions */\r
+#define xPSR_N_Pos                         31U                                            /*!< xPSR: N Position */\r
+#define xPSR_N_Msk                         (1UL << xPSR_N_Pos)                            /*!< xPSR: N Mask */\r
+\r
+#define xPSR_Z_Pos                         30U                                            /*!< xPSR: Z Position */\r
+#define xPSR_Z_Msk                         (1UL << xPSR_Z_Pos)                            /*!< xPSR: Z Mask */\r
+\r
+#define xPSR_C_Pos                         29U                                            /*!< xPSR: C Position */\r
+#define xPSR_C_Msk                         (1UL << xPSR_C_Pos)                            /*!< xPSR: C Mask */\r
+\r
+#define xPSR_V_Pos                         28U                                            /*!< xPSR: V Position */\r
+#define xPSR_V_Msk                         (1UL << xPSR_V_Pos)                            /*!< xPSR: V Mask */\r
+\r
+#define xPSR_T_Pos                         24U                                            /*!< xPSR: T Position */\r
+#define xPSR_T_Msk                         (1UL << xPSR_T_Pos)                            /*!< xPSR: T Mask */\r
+\r
+#define xPSR_ISR_Pos                        0U                                            /*!< xPSR: ISR Position */\r
+#define xPSR_ISR_Msk                       (0x1FFUL /*<< xPSR_ISR_Pos*/)                  /*!< xPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Control Registers (CONTROL).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t _reserved0:1;               /*!< bit:      0  Reserved */\r
+    uint32_t SPSEL:1;                    /*!< bit:      1  Stack to be used */\r
+    uint32_t _reserved1:30;              /*!< bit:  2..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} CONTROL_Type;\r
+\r
+/* CONTROL Register Definitions */\r
+#define CONTROL_SPSEL_Pos                   1U                                            /*!< CONTROL: SPSEL Position */\r
+#define CONTROL_SPSEL_Msk                  (1UL << CONTROL_SPSEL_Pos)                     /*!< CONTROL: SPSEL Mask */\r
+\r
+/*@} end of group CMSIS_CORE */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_NVIC  Nested Vectored Interrupt Controller (NVIC)\r
+  \brief      Type definitions for the NVIC Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Nested Vectored Interrupt Controller (NVIC).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t ISER[1U];               /*!< Offset: 0x000 (R/W)  Interrupt Set Enable Register */\r
+        uint32_t RESERVED0[31U];\r
+  __IOM uint32_t ICER[1U];               /*!< Offset: 0x080 (R/W)  Interrupt Clear Enable Register */\r
+        uint32_t RSERVED1[31U];\r
+  __IOM uint32_t ISPR[1U];               /*!< Offset: 0x100 (R/W)  Interrupt Set Pending Register */\r
+        uint32_t RESERVED2[31U];\r
+  __IOM uint32_t ICPR[1U];               /*!< Offset: 0x180 (R/W)  Interrupt Clear Pending Register */\r
+        uint32_t RESERVED3[31U];\r
+        uint32_t RESERVED4[64U];\r
+  __IOM uint32_t IP[8U];                 /*!< Offset: 0x300 (R/W)  Interrupt Priority Register */\r
+}  NVIC_Type;\r
+\r
+/*@} end of group CMSIS_NVIC */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SCB     System Control Block (SCB)\r
+  \brief    Type definitions for the System Control Block Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Control Block (SCB).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t CPUID;                  /*!< Offset: 0x000 (R/ )  CPUID Base Register */\r
+  __IOM uint32_t ICSR;                   /*!< Offset: 0x004 (R/W)  Interrupt Control and State Register */\r
+  __IOM uint32_t VTOR;                   /*!< Offset: 0x008 (R/W)  Vector Table Offset Register */\r
+  __IOM uint32_t AIRCR;                  /*!< Offset: 0x00C (R/W)  Application Interrupt and Reset Control Register */\r
+  __IOM uint32_t SCR;                    /*!< Offset: 0x010 (R/W)  System Control Register */\r
+  __IOM uint32_t CCR;                    /*!< Offset: 0x014 (R/W)  Configuration Control Register */\r
+        uint32_t RESERVED0[1U];\r
+  __IOM uint32_t SHP[2U];                /*!< Offset: 0x01C (R/W)  System Handlers Priority Registers. [0] is RESERVED */\r
+  __IOM uint32_t SHCSR;                  /*!< Offset: 0x024 (R/W)  System Handler Control and State Register */\r
+        uint32_t RESERVED1[154U];\r
+  __IOM uint32_t SFCR;                   /*!< Offset: 0x290 (R/W)  Security Features Control Register */\r
+} SCB_Type;\r
+\r
+/* SCB CPUID Register Definitions */\r
+#define SCB_CPUID_IMPLEMENTER_Pos          24U                                            /*!< SCB CPUID: IMPLEMENTER Position */\r
+#define SCB_CPUID_IMPLEMENTER_Msk          (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos)          /*!< SCB CPUID: IMPLEMENTER Mask */\r
+\r
+#define SCB_CPUID_VARIANT_Pos              20U                                            /*!< SCB CPUID: VARIANT Position */\r
+#define SCB_CPUID_VARIANT_Msk              (0xFUL << SCB_CPUID_VARIANT_Pos)               /*!< SCB CPUID: VARIANT Mask */\r
+\r
+#define SCB_CPUID_ARCHITECTURE_Pos         16U                                            /*!< SCB CPUID: ARCHITECTURE Position */\r
+#define SCB_CPUID_ARCHITECTURE_Msk         (0xFUL << SCB_CPUID_ARCHITECTURE_Pos)          /*!< SCB CPUID: ARCHITECTURE Mask */\r
+\r
+#define SCB_CPUID_PARTNO_Pos                4U                                            /*!< SCB CPUID: PARTNO Position */\r
+#define SCB_CPUID_PARTNO_Msk               (0xFFFUL << SCB_CPUID_PARTNO_Pos)              /*!< SCB CPUID: PARTNO Mask */\r
+\r
+#define SCB_CPUID_REVISION_Pos              0U                                            /*!< SCB CPUID: REVISION Position */\r
+#define SCB_CPUID_REVISION_Msk             (0xFUL /*<< SCB_CPUID_REVISION_Pos*/)          /*!< SCB CPUID: REVISION Mask */\r
+\r
+/* SCB Interrupt Control State Register Definitions */\r
+#define SCB_ICSR_NMIPENDSET_Pos            31U                                            /*!< SCB ICSR: NMIPENDSET Position */\r
+#define SCB_ICSR_NMIPENDSET_Msk            (1UL << SCB_ICSR_NMIPENDSET_Pos)               /*!< SCB ICSR: NMIPENDSET Mask */\r
+\r
+#define SCB_ICSR_PENDSVSET_Pos             28U                                            /*!< SCB ICSR: PENDSVSET Position */\r
+#define SCB_ICSR_PENDSVSET_Msk             (1UL << SCB_ICSR_PENDSVSET_Pos)                /*!< SCB ICSR: PENDSVSET Mask */\r
+\r
+#define SCB_ICSR_PENDSVCLR_Pos             27U                                            /*!< SCB ICSR: PENDSVCLR Position */\r
+#define SCB_ICSR_PENDSVCLR_Msk             (1UL << SCB_ICSR_PENDSVCLR_Pos)                /*!< SCB ICSR: PENDSVCLR Mask */\r
+\r
+#define SCB_ICSR_PENDSTSET_Pos             26U                                            /*!< SCB ICSR: PENDSTSET Position */\r
+#define SCB_ICSR_PENDSTSET_Msk             (1UL << SCB_ICSR_PENDSTSET_Pos)                /*!< SCB ICSR: PENDSTSET Mask */\r
+\r
+#define SCB_ICSR_PENDSTCLR_Pos             25U                                            /*!< SCB ICSR: PENDSTCLR Position */\r
+#define SCB_ICSR_PENDSTCLR_Msk             (1UL << SCB_ICSR_PENDSTCLR_Pos)                /*!< SCB ICSR: PENDSTCLR Mask */\r
+\r
+#define SCB_ICSR_ISRPREEMPT_Pos            23U                                            /*!< SCB ICSR: ISRPREEMPT Position */\r
+#define SCB_ICSR_ISRPREEMPT_Msk            (1UL << SCB_ICSR_ISRPREEMPT_Pos)               /*!< SCB ICSR: ISRPREEMPT Mask */\r
+\r
+#define SCB_ICSR_ISRPENDING_Pos            22U                                            /*!< SCB ICSR: ISRPENDING Position */\r
+#define SCB_ICSR_ISRPENDING_Msk            (1UL << SCB_ICSR_ISRPENDING_Pos)               /*!< SCB ICSR: ISRPENDING Mask */\r
+\r
+#define SCB_ICSR_VECTPENDING_Pos           12U                                            /*!< SCB ICSR: VECTPENDING Position */\r
+#define SCB_ICSR_VECTPENDING_Msk           (0x1FFUL << SCB_ICSR_VECTPENDING_Pos)          /*!< SCB ICSR: VECTPENDING Mask */\r
+\r
+#define SCB_ICSR_VECTACTIVE_Pos             0U                                            /*!< SCB ICSR: VECTACTIVE Position */\r
+#define SCB_ICSR_VECTACTIVE_Msk            (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/)       /*!< SCB ICSR: VECTACTIVE Mask */\r
+\r
+/* SCB Interrupt Control State Register Definitions */\r
+#define SCB_VTOR_TBLOFF_Pos                 7U                                            /*!< SCB VTOR: TBLOFF Position */\r
+#define SCB_VTOR_TBLOFF_Msk                (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos)           /*!< SCB VTOR: TBLOFF Mask */\r
+\r
+/* SCB Application Interrupt and Reset Control Register Definitions */\r
+#define SCB_AIRCR_VECTKEY_Pos              16U                                            /*!< SCB AIRCR: VECTKEY Position */\r
+#define SCB_AIRCR_VECTKEY_Msk              (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos)            /*!< SCB AIRCR: VECTKEY Mask */\r
+\r
+#define SCB_AIRCR_VECTKEYSTAT_Pos          16U                                            /*!< SCB AIRCR: VECTKEYSTAT Position */\r
+#define SCB_AIRCR_VECTKEYSTAT_Msk          (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos)        /*!< SCB AIRCR: VECTKEYSTAT Mask */\r
+\r
+#define SCB_AIRCR_ENDIANESS_Pos            15U                                            /*!< SCB AIRCR: ENDIANESS Position */\r
+#define SCB_AIRCR_ENDIANESS_Msk            (1UL << SCB_AIRCR_ENDIANESS_Pos)               /*!< SCB AIRCR: ENDIANESS Mask */\r
+\r
+#define SCB_AIRCR_SYSRESETREQ_Pos           2U                                            /*!< SCB AIRCR: SYSRESETREQ Position */\r
+#define SCB_AIRCR_SYSRESETREQ_Msk          (1UL << SCB_AIRCR_SYSRESETREQ_Pos)             /*!< SCB AIRCR: SYSRESETREQ Mask */\r
+\r
+#define SCB_AIRCR_VECTCLRACTIVE_Pos         1U                                            /*!< SCB AIRCR: VECTCLRACTIVE Position */\r
+#define SCB_AIRCR_VECTCLRACTIVE_Msk        (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos)           /*!< SCB AIRCR: VECTCLRACTIVE Mask */\r
+\r
+/* SCB System Control Register Definitions */\r
+#define SCB_SCR_SEVONPEND_Pos               4U                                            /*!< SCB SCR: SEVONPEND Position */\r
+#define SCB_SCR_SEVONPEND_Msk              (1UL << SCB_SCR_SEVONPEND_Pos)                 /*!< SCB SCR: SEVONPEND Mask */\r
+\r
+#define SCB_SCR_SLEEPDEEP_Pos               2U                                            /*!< SCB SCR: SLEEPDEEP Position */\r
+#define SCB_SCR_SLEEPDEEP_Msk              (1UL << SCB_SCR_SLEEPDEEP_Pos)                 /*!< SCB SCR: SLEEPDEEP Mask */\r
+\r
+#define SCB_SCR_SLEEPONEXIT_Pos             1U                                            /*!< SCB SCR: SLEEPONEXIT Position */\r
+#define SCB_SCR_SLEEPONEXIT_Msk            (1UL << SCB_SCR_SLEEPONEXIT_Pos)               /*!< SCB SCR: SLEEPONEXIT Mask */\r
+\r
+/* SCB Configuration Control Register Definitions */\r
+#define SCB_CCR_STKALIGN_Pos                9U                                            /*!< SCB CCR: STKALIGN Position */\r
+#define SCB_CCR_STKALIGN_Msk               (1UL << SCB_CCR_STKALIGN_Pos)                  /*!< SCB CCR: STKALIGN Mask */\r
+\r
+#define SCB_CCR_UNALIGN_TRP_Pos             3U                                            /*!< SCB CCR: UNALIGN_TRP Position */\r
+#define SCB_CCR_UNALIGN_TRP_Msk            (1UL << SCB_CCR_UNALIGN_TRP_Pos)               /*!< SCB CCR: UNALIGN_TRP Mask */\r
+\r
+/* SCB System Handler Control and State Register Definitions */\r
+#define SCB_SHCSR_SVCALLPENDED_Pos         15U                                            /*!< SCB SHCSR: SVCALLPENDED Position */\r
+#define SCB_SHCSR_SVCALLPENDED_Msk         (1UL << SCB_SHCSR_SVCALLPENDED_Pos)            /*!< SCB SHCSR: SVCALLPENDED Mask */\r
+\r
+/*@} end of group CMSIS_SCB */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB)\r
+  \brief    Type definitions for the System Control and ID Register not in the SCB\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Control and ID Register not in the SCB.\r
+ */\r
+typedef struct\r
+{\r
+        uint32_t RESERVED0[2U];\r
+  __IOM uint32_t ACTLR;                  /*!< Offset: 0x008 (R/W)  Auxiliary Control Register */\r
+} SCnSCB_Type;\r
+\r
+/* Auxiliary Control Register Definitions */\r
+#define SCnSCB_ACTLR_DISMCYCINT_Pos         0U                                         /*!< ACTLR: DISMCYCINT Position */\r
+#define SCnSCB_ACTLR_DISMCYCINT_Msk        (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/)    /*!< ACTLR: DISMCYCINT Mask */\r
+\r
+/*@} end of group CMSIS_SCnotSCB */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SysTick     System Tick Timer (SysTick)\r
+  \brief    Type definitions for the System Timer Registers.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Timer (SysTick).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  SysTick Control and Status Register */\r
+  __IOM uint32_t LOAD;                   /*!< Offset: 0x004 (R/W)  SysTick Reload Value Register */\r
+  __IOM uint32_t VAL;                    /*!< Offset: 0x008 (R/W)  SysTick Current Value Register */\r
+  __IM  uint32_t CALIB;                  /*!< Offset: 0x00C (R/ )  SysTick Calibration Register */\r
+} SysTick_Type;\r
+\r
+/* SysTick Control / Status Register Definitions */\r
+#define SysTick_CTRL_COUNTFLAG_Pos         16U                                            /*!< SysTick CTRL: COUNTFLAG Position */\r
+#define SysTick_CTRL_COUNTFLAG_Msk         (1UL << SysTick_CTRL_COUNTFLAG_Pos)            /*!< SysTick CTRL: COUNTFLAG Mask */\r
+\r
+#define SysTick_CTRL_CLKSOURCE_Pos          2U                                            /*!< SysTick CTRL: CLKSOURCE Position */\r
+#define SysTick_CTRL_CLKSOURCE_Msk         (1UL << SysTick_CTRL_CLKSOURCE_Pos)            /*!< SysTick CTRL: CLKSOURCE Mask */\r
+\r
+#define SysTick_CTRL_TICKINT_Pos            1U                                            /*!< SysTick CTRL: TICKINT Position */\r
+#define SysTick_CTRL_TICKINT_Msk           (1UL << SysTick_CTRL_TICKINT_Pos)              /*!< SysTick CTRL: TICKINT Mask */\r
+\r
+#define SysTick_CTRL_ENABLE_Pos             0U                                            /*!< SysTick CTRL: ENABLE Position */\r
+#define SysTick_CTRL_ENABLE_Msk            (1UL /*<< SysTick_CTRL_ENABLE_Pos*/)           /*!< SysTick CTRL: ENABLE Mask */\r
+\r
+/* SysTick Reload Register Definitions */\r
+#define SysTick_LOAD_RELOAD_Pos             0U                                            /*!< SysTick LOAD: RELOAD Position */\r
+#define SysTick_LOAD_RELOAD_Msk            (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/)    /*!< SysTick LOAD: RELOAD Mask */\r
+\r
+/* SysTick Current Register Definitions */\r
+#define SysTick_VAL_CURRENT_Pos             0U                                            /*!< SysTick VAL: CURRENT Position */\r
+#define SysTick_VAL_CURRENT_Msk            (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/)    /*!< SysTick VAL: CURRENT Mask */\r
+\r
+/* SysTick Calibration Register Definitions */\r
+#define SysTick_CALIB_NOREF_Pos            31U                                            /*!< SysTick CALIB: NOREF Position */\r
+#define SysTick_CALIB_NOREF_Msk            (1UL << SysTick_CALIB_NOREF_Pos)               /*!< SysTick CALIB: NOREF Mask */\r
+\r
+#define SysTick_CALIB_SKEW_Pos             30U                                            /*!< SysTick CALIB: SKEW Position */\r
+#define SysTick_CALIB_SKEW_Msk             (1UL << SysTick_CALIB_SKEW_Pos)                /*!< SysTick CALIB: SKEW Mask */\r
+\r
+#define SysTick_CALIB_TENMS_Pos             0U                                            /*!< SysTick CALIB: TENMS Position */\r
+#define SysTick_CALIB_TENMS_Msk            (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/)    /*!< SysTick CALIB: TENMS Mask */\r
+\r
+/*@} end of group CMSIS_SysTick */\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_MPU     Memory Protection Unit (MPU)\r
+  \brief    Type definitions for the Memory Protection Unit (MPU)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Memory Protection Unit (MPU).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t TYPE;                   /*!< Offset: 0x000 (R/ )  MPU Type Register */\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x004 (R/W)  MPU Control Register */\r
+  __IOM uint32_t RNR;                    /*!< Offset: 0x008 (R/W)  MPU Region RNRber Register */\r
+  __IOM uint32_t RBAR;                   /*!< Offset: 0x00C (R/W)  MPU Region Base Address Register */\r
+  __IOM uint32_t RASR;                   /*!< Offset: 0x010 (R/W)  MPU Region Attribute and Size Register */\r
+} MPU_Type;\r
+\r
+/* MPU Type Register Definitions */\r
+#define MPU_TYPE_IREGION_Pos               16U                                            /*!< MPU TYPE: IREGION Position */\r
+#define MPU_TYPE_IREGION_Msk               (0xFFUL << MPU_TYPE_IREGION_Pos)               /*!< MPU TYPE: IREGION Mask */\r
+\r
+#define MPU_TYPE_DREGION_Pos                8U                                            /*!< MPU TYPE: DREGION Position */\r
+#define MPU_TYPE_DREGION_Msk               (0xFFUL << MPU_TYPE_DREGION_Pos)               /*!< MPU TYPE: DREGION Mask */\r
+\r
+#define MPU_TYPE_SEPARATE_Pos               0U                                            /*!< MPU TYPE: SEPARATE Position */\r
+#define MPU_TYPE_SEPARATE_Msk              (1UL /*<< MPU_TYPE_SEPARATE_Pos*/)             /*!< MPU TYPE: SEPARATE Mask */\r
+\r
+/* MPU Control Register Definitions */\r
+#define MPU_CTRL_PRIVDEFENA_Pos             2U                                            /*!< MPU CTRL: PRIVDEFENA Position */\r
+#define MPU_CTRL_PRIVDEFENA_Msk            (1UL << MPU_CTRL_PRIVDEFENA_Pos)               /*!< MPU CTRL: PRIVDEFENA Mask */\r
+\r
+#define MPU_CTRL_HFNMIENA_Pos               1U                                            /*!< MPU CTRL: HFNMIENA Position */\r
+#define MPU_CTRL_HFNMIENA_Msk              (1UL << MPU_CTRL_HFNMIENA_Pos)                 /*!< MPU CTRL: HFNMIENA Mask */\r
+\r
+#define MPU_CTRL_ENABLE_Pos                 0U                                            /*!< MPU CTRL: ENABLE Position */\r
+#define MPU_CTRL_ENABLE_Msk                (1UL /*<< MPU_CTRL_ENABLE_Pos*/)               /*!< MPU CTRL: ENABLE Mask */\r
+\r
+/* MPU Region Number Register Definitions */\r
+#define MPU_RNR_REGION_Pos                  0U                                            /*!< MPU RNR: REGION Position */\r
+#define MPU_RNR_REGION_Msk                 (0xFFUL /*<< MPU_RNR_REGION_Pos*/)             /*!< MPU RNR: REGION Mask */\r
+\r
+/* MPU Region Base Address Register Definitions */\r
+#define MPU_RBAR_ADDR_Pos                   8U                                            /*!< MPU RBAR: ADDR Position */\r
+#define MPU_RBAR_ADDR_Msk                  (0xFFFFFFUL << MPU_RBAR_ADDR_Pos)              /*!< MPU RBAR: ADDR Mask */\r
+\r
+#define MPU_RBAR_VALID_Pos                  4U                                            /*!< MPU RBAR: VALID Position */\r
+#define MPU_RBAR_VALID_Msk                 (1UL << MPU_RBAR_VALID_Pos)                    /*!< MPU RBAR: VALID Mask */\r
+\r
+#define MPU_RBAR_REGION_Pos                 0U                                            /*!< MPU RBAR: REGION Position */\r
+#define MPU_RBAR_REGION_Msk                (0xFUL /*<< MPU_RBAR_REGION_Pos*/)             /*!< MPU RBAR: REGION Mask */\r
+\r
+/* MPU Region Attribute and Size Register Definitions */\r
+#define MPU_RASR_ATTRS_Pos                 16U                                            /*!< MPU RASR: MPU Region Attribute field Position */\r
+#define MPU_RASR_ATTRS_Msk                 (0xFFFFUL << MPU_RASR_ATTRS_Pos)               /*!< MPU RASR: MPU Region Attribute field Mask */\r
+\r
+#define MPU_RASR_XN_Pos                    28U                                            /*!< MPU RASR: ATTRS.XN Position */\r
+#define MPU_RASR_XN_Msk                    (1UL << MPU_RASR_XN_Pos)                       /*!< MPU RASR: ATTRS.XN Mask */\r
+\r
+#define MPU_RASR_AP_Pos                    24U                                            /*!< MPU RASR: ATTRS.AP Position */\r
+#define MPU_RASR_AP_Msk                    (0x7UL << MPU_RASR_AP_Pos)                     /*!< MPU RASR: ATTRS.AP Mask */\r
+\r
+#define MPU_RASR_TEX_Pos                   19U                                            /*!< MPU RASR: ATTRS.TEX Position */\r
+#define MPU_RASR_TEX_Msk                   (0x7UL << MPU_RASR_TEX_Pos)                    /*!< MPU RASR: ATTRS.TEX Mask */\r
+\r
+#define MPU_RASR_S_Pos                     18U                                            /*!< MPU RASR: ATTRS.S Position */\r
+#define MPU_RASR_S_Msk                     (1UL << MPU_RASR_S_Pos)                        /*!< MPU RASR: ATTRS.S Mask */\r
+\r
+#define MPU_RASR_C_Pos                     17U                                            /*!< MPU RASR: ATTRS.C Position */\r
+#define MPU_RASR_C_Msk                     (1UL << MPU_RASR_C_Pos)                        /*!< MPU RASR: ATTRS.C Mask */\r
+\r
+#define MPU_RASR_B_Pos                     16U                                            /*!< MPU RASR: ATTRS.B Position */\r
+#define MPU_RASR_B_Msk                     (1UL << MPU_RASR_B_Pos)                        /*!< MPU RASR: ATTRS.B Mask */\r
+\r
+#define MPU_RASR_SRD_Pos                    8U                                            /*!< MPU RASR: Sub-Region Disable Position */\r
+#define MPU_RASR_SRD_Msk                   (0xFFUL << MPU_RASR_SRD_Pos)                   /*!< MPU RASR: Sub-Region Disable Mask */\r
+\r
+#define MPU_RASR_SIZE_Pos                   1U                                            /*!< MPU RASR: Region Size Field Position */\r
+#define MPU_RASR_SIZE_Msk                  (0x1FUL << MPU_RASR_SIZE_Pos)                  /*!< MPU RASR: Region Size Field Mask */\r
+\r
+#define MPU_RASR_ENABLE_Pos                 0U                                            /*!< MPU RASR: Region enable bit Position */\r
+#define MPU_RASR_ENABLE_Msk                (1UL /*<< MPU_RASR_ENABLE_Pos*/)               /*!< MPU RASR: Region enable bit Disable Mask */\r
+\r
+/*@} end of group CMSIS_MPU */\r
+#endif\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_CoreDebug       Core Debug Registers (CoreDebug)\r
+  \brief    SC000 Core Debug Registers (DCB registers, SHCSR, and DFSR) are only accessible over DAP and not via processor.\r
+            Therefore they are not covered by the SC000 header file.\r
+  @{\r
+ */\r
+/*@} end of group CMSIS_CoreDebug */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_bitfield     Core register bit field macros\r
+  \brief      Macros for use with bit field definitions (xxx_Pos, xxx_Msk).\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   Mask and shift a bit field value for use in a register bit range.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of the bit field. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted value.\r
+*/\r
+#define _VAL2FLD(field, value)    (((uint32_t)(value) << field ## _Pos) & field ## _Msk)\r
+\r
+/**\r
+  \brief     Mask and shift a register value to extract a bit filed value.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of register. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted bit field value.\r
+*/\r
+#define _FLD2VAL(field, value)    (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)\r
+\r
+/*@} end of group CMSIS_core_bitfield */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_base     Core Definitions\r
+  \brief      Definitions for base addresses, unions, and structures.\r
+  @{\r
+ */\r
+\r
+/* Memory mapping of Core Hardware */\r
+#define SCS_BASE            (0xE000E000UL)                            /*!< System Control Space Base Address */\r
+#define SysTick_BASE        (SCS_BASE +  0x0010UL)                    /*!< SysTick Base Address */\r
+#define NVIC_BASE           (SCS_BASE +  0x0100UL)                    /*!< NVIC Base Address */\r
+#define SCB_BASE            (SCS_BASE +  0x0D00UL)                    /*!< System Control Block Base Address */\r
+\r
+#define SCnSCB              ((SCnSCB_Type    *)     SCS_BASE      )   /*!< System control Register not in SCB */\r
+#define SCB                 ((SCB_Type       *)     SCB_BASE      )   /*!< SCB configuration struct */\r
+#define SysTick             ((SysTick_Type   *)     SysTick_BASE  )   /*!< SysTick configuration struct */\r
+#define NVIC                ((NVIC_Type      *)     NVIC_BASE     )   /*!< NVIC configuration struct */\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+  #define MPU_BASE          (SCS_BASE +  0x0D90UL)                    /*!< Memory Protection Unit */\r
+  #define MPU               ((MPU_Type       *)     MPU_BASE      )   /*!< Memory Protection Unit */\r
+#endif\r
+\r
+/*@} */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                Hardware Abstraction Layer\r
+  Core Function Interface contains:\r
+  - Core NVIC Functions\r
+  - Core SysTick Functions\r
+  - Core Register Access Functions\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference\r
+*/\r
+\r
+\r
+\r
+/* ##########################   NVIC functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_NVICFunctions NVIC Functions\r
+  \brief    Functions that manage interrupts and exceptions via the NVIC.\r
+  @{\r
+ */\r
+\r
+#ifdef CMSIS_NVIC_VIRTUAL\r
+  #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+    #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"\r
+  #endif\r
+  #include CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+#else\r
+/*#define NVIC_SetPriorityGrouping    __NVIC_SetPriorityGrouping   not available for SC000 */\r
+/*#define NVIC_GetPriorityGrouping    __NVIC_GetPriorityGrouping   not available for SC000 */\r
+  #define NVIC_EnableIRQ              __NVIC_EnableIRQ\r
+  #define NVIC_GetEnableIRQ           __NVIC_GetEnableIRQ\r
+  #define NVIC_DisableIRQ             __NVIC_DisableIRQ\r
+  #define NVIC_GetPendingIRQ          __NVIC_GetPendingIRQ\r
+  #define NVIC_SetPendingIRQ          __NVIC_SetPendingIRQ\r
+  #define NVIC_ClearPendingIRQ        __NVIC_ClearPendingIRQ\r
+/*#define NVIC_GetActive              __NVIC_GetActive             not available for SC000 */\r
+  #define NVIC_SetPriority            __NVIC_SetPriority\r
+  #define NVIC_GetPriority            __NVIC_GetPriority\r
+  #define NVIC_SystemReset            __NVIC_SystemReset\r
+#endif /* CMSIS_NVIC_VIRTUAL */\r
+\r
+#ifdef CMSIS_VECTAB_VIRTUAL\r
+  #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+    #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"\r
+  #endif\r
+  #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+#else\r
+  #define NVIC_SetVector              __NVIC_SetVector\r
+  #define NVIC_GetVector              __NVIC_GetVector\r
+#endif  /* (CMSIS_VECTAB_VIRTUAL) */\r
+\r
+#define NVIC_USER_IRQ_OFFSET          16\r
+\r
+\r
+/* The following EXC_RETURN values are saved the LR on exception entry */\r
+#define EXC_RETURN_HANDLER         (0xFFFFFFF1UL)     /* return to Handler mode, uses MSP after return                               */\r
+#define EXC_RETURN_THREAD_MSP      (0xFFFFFFF9UL)     /* return to Thread mode, uses MSP after return                                */\r
+#define EXC_RETURN_THREAD_PSP      (0xFFFFFFFDUL)     /* return to Thread mode, uses PSP after return                                */\r
+\r
+\r
+/* Interrupt Priorities are WORD accessible only under Armv6-M                  */\r
+/* The following MACROS handle generation of the register offset and byte masks */\r
+#define _BIT_SHIFT(IRQn)         (  ((((uint32_t)(int32_t)(IRQn))         )      &  0x03UL) * 8UL)\r
+#define _SHP_IDX(IRQn)           ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >>    2UL)      )\r
+#define _IP_IDX(IRQn)            (   (((uint32_t)(int32_t)(IRQn))                >>    2UL)      )\r
+\r
+\r
+/**\r
+  \brief   Enable Interrupt\r
+  \details Enables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Enable status\r
+  \details Returns a device specific interrupt enable status from the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt is not enabled.\r
+  \return             1  Interrupt is enabled.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISER[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Disable Interrupt\r
+  \details Disables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+    __DSB();\r
+    __ISB();\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Pending Interrupt\r
+  \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not pending.\r
+  \return             1  Interrupt status is pending.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Pending Interrupt\r
+  \details Sets the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Clear Pending Interrupt\r
+  \details Clears the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Priority\r
+  \details Sets the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]      IRQn  Interrupt number.\r
+  \param [in]  priority  Priority to set.\r
+  \note    The priority cannot be set for every processor exception.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->IP[_IP_IDX(IRQn)]  = ((uint32_t)(NVIC->IP[_IP_IDX(IRQn)]  & ~(0xFFUL << _BIT_SHIFT(IRQn))) |\r
+       (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));\r
+  }\r
+  else\r
+  {\r
+    SCB->SHP[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |\r
+       (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Priority\r
+  \details Reads the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn  Interrupt number.\r
+  \return             Interrupt Priority.\r
+                      Value is aligned automatically to the implemented priority bits of the microcontroller.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)\r
+{\r
+\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+  else\r
+  {\r
+    return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Vector\r
+  \details Sets an interrupt vector in SRAM based interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+           VTOR must been relocated to SRAM before.\r
+  \param [in]   IRQn      Interrupt number\r
+  \param [in]   vector    Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)\r
+{\r
+  uint32_t *vectors = (uint32_t *)SCB->VTOR;\r
+  vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Vector\r
+  \details Reads an interrupt vector from interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn      Interrupt number.\r
+  \return                 Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)\r
+{\r
+  uint32_t *vectors = (uint32_t *)SCB->VTOR;\r
+  return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];\r
+}\r
+\r
+\r
+/**\r
+  \brief   System Reset\r
+  \details Initiates a system reset request to reset the MCU.\r
+ */\r
+__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)\r
+{\r
+  __DSB();                                                          /* Ensure all outstanding memory accesses included\r
+                                                                       buffered write are completed before reset */\r
+  SCB->AIRCR  = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |\r
+                 SCB_AIRCR_SYSRESETREQ_Msk);\r
+  __DSB();                                                          /* Ensure completion of memory access */\r
+\r
+  for(;;)                                                           /* wait until reset */\r
+  {\r
+    __NOP();\r
+  }\r
+}\r
+\r
+/*@} end of CMSIS_Core_NVICFunctions */\r
+\r
+\r
+/* ##########################  FPU functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_FpuFunctions FPU Functions\r
+  \brief    Function that provides FPU type.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   get FPU type\r
+  \details returns the FPU type\r
+  \returns\r
+   - \b  0: No FPU\r
+   - \b  1: Single precision FPU\r
+   - \b  2: Double + Single precision FPU\r
+ */\r
+__STATIC_INLINE uint32_t SCB_GetFPUType(void)\r
+{\r
+    return 0U;           /* No FPU */\r
+}\r
+\r
+\r
+/*@} end of CMSIS_Core_FpuFunctions */\r
+\r
+\r
+\r
+/* ##################################    SysTick function  ############################################ */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_SysTickFunctions SysTick Functions\r
+  \brief    Functions that configure the System.\r
+  @{\r
+ */\r
+\r
+#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)\r
+\r
+/**\r
+  \brief   System Tick Configuration\r
+  \details Initializes the System Timer and its interrupt, and starts the System Tick Timer.\r
+           Counter is in free running mode to generate periodic interrupts.\r
+  \param [in]  ticks  Number of ticks between two interrupts.\r
+  \return          0  Function succeeded.\r
+  \return          1  Function failed.\r
+  \note    When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the\r
+           function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>\r
+           must contain a vendor-specific implementation of this function.\r
+ */\r
+__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)\r
+{\r
+  if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)\r
+  {\r
+    return (1UL);                                                   /* Reload value impossible */\r
+  }\r
+\r
+  SysTick->LOAD  = (uint32_t)(ticks - 1UL);                         /* set reload register */\r
+  NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */\r
+  SysTick->VAL   = 0UL;                                             /* Load the SysTick Counter Value */\r
+  SysTick->CTRL  = SysTick_CTRL_CLKSOURCE_Msk |\r
+                   SysTick_CTRL_TICKINT_Msk   |\r
+                   SysTick_CTRL_ENABLE_Msk;                         /* Enable SysTick IRQ and SysTick Timer */\r
+  return (0UL);                                                     /* Function successful */\r
+}\r
+\r
+#endif\r
+\r
+/*@} end of CMSIS_Core_SysTickFunctions */\r
+\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_SC000_H_DEPENDANT */\r
+\r
+#endif /* __CMSIS_GENERIC */\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_sc300.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/core_sc300.h
new file mode 100644 (file)
index 0000000..665822d
--- /dev/null
@@ -0,0 +1,1915 @@
+/**************************************************************************//**\r
+ * @file     core_sc300.h\r
+ * @brief    CMSIS SC300 Core Peripheral Access Layer Header File\r
+ * @version  V5.0.6\r
+ * @date     04. June 2018\r
+ ******************************************************************************/\r
+/*\r
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.\r
+ *\r
+ * SPDX-License-Identifier: Apache-2.0\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the License); you may\r
+ * not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#if   defined ( __ICCARM__ )\r
+  #pragma system_include         /* treat file as system include file for MISRA check */\r
+#elif defined (__clang__)\r
+  #pragma clang system_header   /* treat file as system include file */\r
+#endif\r
+\r
+#ifndef __CORE_SC300_H_GENERIC\r
+#define __CORE_SC300_H_GENERIC\r
+\r
+#include <stdint.h>\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/**\r
+  \page CMSIS_MISRA_Exceptions  MISRA-C:2004 Compliance Exceptions\r
+  CMSIS violates the following MISRA-C:2004 rules:\r
+\r
+   \li Required Rule 8.5, object/function definition in header file.<br>\r
+     Function definitions in header files are used to allow 'inlining'.\r
+\r
+   \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>\r
+     Unions are used for effective representation of core registers.\r
+\r
+   \li Advisory Rule 19.7, Function-like macro defined.<br>\r
+     Function-like macros are used to allow more efficient code.\r
+ */\r
+\r
+\r
+/*******************************************************************************\r
+ *                 CMSIS definitions\r
+ ******************************************************************************/\r
+/**\r
+  \ingroup SC3000\r
+  @{\r
+ */\r
+\r
+#include "cmsis_version.h"\r
+\r
+/*  CMSIS SC300 definitions */\r
+#define __SC300_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                /*!< \deprecated [31:16] CMSIS HAL main version */\r
+#define __SC300_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                 /*!< \deprecated [15:0]  CMSIS HAL sub version */\r
+#define __SC300_CMSIS_VERSION       ((__SC300_CMSIS_VERSION_MAIN << 16U) | \\r
+                                      __SC300_CMSIS_VERSION_SUB           )  /*!< \deprecated CMSIS HAL version number */\r
+\r
+#define __CORTEX_SC                 (300U)                                   /*!< Cortex secure core */\r
+\r
+/** __FPU_USED indicates whether an FPU is used or not.\r
+    This core does not support an FPU at all\r
+*/\r
+#define __FPU_USED       0U\r
+\r
+#if defined ( __CC_ARM )\r
+  #if defined __TARGET_FPU_VFP\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)\r
+  #if defined __ARM_PCS_VFP\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __GNUC__ )\r
+  #if defined (__VFP_FP__) && !defined(__SOFTFP__)\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __ICCARM__ )\r
+  #if defined __ARMVFP__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __TI_ARM__ )\r
+  #if defined __TI_VFP_SUPPORT__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __TASKING__ )\r
+  #if defined __FPU_VFP__\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __CSMC__ )\r
+  #if ( __CSMC__ & 0x400U)\r
+    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#endif\r
+\r
+#include "cmsis_compiler.h"               /* CMSIS compiler specific defines */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_SC300_H_GENERIC */\r
+\r
+#ifndef __CMSIS_GENERIC\r
+\r
+#ifndef __CORE_SC300_H_DEPENDANT\r
+#define __CORE_SC300_H_DEPENDANT\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/* check device defines and use defaults */\r
+#if defined __CHECK_DEVICE_DEFINES\r
+  #ifndef __SC300_REV\r
+    #define __SC300_REV               0x0000U\r
+    #warning "__SC300_REV not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __MPU_PRESENT\r
+    #define __MPU_PRESENT             0U\r
+    #warning "__MPU_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __NVIC_PRIO_BITS\r
+    #define __NVIC_PRIO_BITS          3U\r
+    #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __Vendor_SysTickConfig\r
+    #define __Vendor_SysTickConfig    0U\r
+    #warning "__Vendor_SysTickConfig not defined in device header file; using default!"\r
+  #endif\r
+#endif\r
+\r
+/* IO definitions (access restrictions to peripheral registers) */\r
+/**\r
+    \defgroup CMSIS_glob_defs CMSIS Global Defines\r
+\r
+    <strong>IO Type Qualifiers</strong> are used\r
+    \li to specify the access to peripheral variables.\r
+    \li for automatic generation of peripheral register debug information.\r
+*/\r
+#ifdef __cplusplus\r
+  #define   __I     volatile             /*!< Defines 'read only' permissions */\r
+#else\r
+  #define   __I     volatile const       /*!< Defines 'read only' permissions */\r
+#endif\r
+#define     __O     volatile             /*!< Defines 'write only' permissions */\r
+#define     __IO    volatile             /*!< Defines 'read / write' permissions */\r
+\r
+/* following defines should be used for structure members */\r
+#define     __IM     volatile const      /*! Defines 'read only' structure member permissions */\r
+#define     __OM     volatile            /*! Defines 'write only' structure member permissions */\r
+#define     __IOM    volatile            /*! Defines 'read / write' structure member permissions */\r
+\r
+/*@} end of group SC300 */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                 Register Abstraction\r
+  Core Register contain:\r
+  - Core Register\r
+  - Core NVIC Register\r
+  - Core SCB Register\r
+  - Core SysTick Register\r
+  - Core Debug Register\r
+  - Core MPU Register\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_core_register Defines and Type Definitions\r
+  \brief Type definitions and defines for Cortex-M processor based devices.\r
+*/\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_CORE  Status and Control Registers\r
+  \brief      Core Register type definitions.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Union type to access the Application Program Status Register (APSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t _reserved0:27;              /*!< bit:  0..26  Reserved */\r
+    uint32_t Q:1;                        /*!< bit:     27  Saturation condition flag */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} APSR_Type;\r
+\r
+/* APSR Register Definitions */\r
+#define APSR_N_Pos                         31U                                            /*!< APSR: N Position */\r
+#define APSR_N_Msk                         (1UL << APSR_N_Pos)                            /*!< APSR: N Mask */\r
+\r
+#define APSR_Z_Pos                         30U                                            /*!< APSR: Z Position */\r
+#define APSR_Z_Msk                         (1UL << APSR_Z_Pos)                            /*!< APSR: Z Mask */\r
+\r
+#define APSR_C_Pos                         29U                                            /*!< APSR: C Position */\r
+#define APSR_C_Msk                         (1UL << APSR_C_Pos)                            /*!< APSR: C Mask */\r
+\r
+#define APSR_V_Pos                         28U                                            /*!< APSR: V Position */\r
+#define APSR_V_Msk                         (1UL << APSR_V_Pos)                            /*!< APSR: V Mask */\r
+\r
+#define APSR_Q_Pos                         27U                                            /*!< APSR: Q Position */\r
+#define APSR_Q_Msk                         (1UL << APSR_Q_Pos)                            /*!< APSR: Q Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Interrupt Program Status Register (IPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:23;              /*!< bit:  9..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} IPSR_Type;\r
+\r
+/* IPSR Register Definitions */\r
+#define IPSR_ISR_Pos                        0U                                            /*!< IPSR: ISR Position */\r
+#define IPSR_ISR_Msk                       (0x1FFUL /*<< IPSR_ISR_Pos*/)                  /*!< IPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Special-Purpose Program Status Registers (xPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */\r
+    uint32_t _reserved0:1;               /*!< bit:      9  Reserved */\r
+    uint32_t ICI_IT_1:6;                 /*!< bit: 10..15  ICI/IT part 1 */\r
+    uint32_t _reserved1:8;               /*!< bit: 16..23  Reserved */\r
+    uint32_t T:1;                        /*!< bit:     24  Thumb bit */\r
+    uint32_t ICI_IT_2:2;                 /*!< bit: 25..26  ICI/IT part 2 */\r
+    uint32_t Q:1;                        /*!< bit:     27  Saturation condition flag */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} xPSR_Type;\r
+\r
+/* xPSR Register Definitions */\r
+#define xPSR_N_Pos                         31U                                            /*!< xPSR: N Position */\r
+#define xPSR_N_Msk                         (1UL << xPSR_N_Pos)                            /*!< xPSR: N Mask */\r
+\r
+#define xPSR_Z_Pos                         30U                                            /*!< xPSR: Z Position */\r
+#define xPSR_Z_Msk                         (1UL << xPSR_Z_Pos)                            /*!< xPSR: Z Mask */\r
+\r
+#define xPSR_C_Pos                         29U                                            /*!< xPSR: C Position */\r
+#define xPSR_C_Msk                         (1UL << xPSR_C_Pos)                            /*!< xPSR: C Mask */\r
+\r
+#define xPSR_V_Pos                         28U                                            /*!< xPSR: V Position */\r
+#define xPSR_V_Msk                         (1UL << xPSR_V_Pos)                            /*!< xPSR: V Mask */\r
+\r
+#define xPSR_Q_Pos                         27U                                            /*!< xPSR: Q Position */\r
+#define xPSR_Q_Msk                         (1UL << xPSR_Q_Pos)                            /*!< xPSR: Q Mask */\r
+\r
+#define xPSR_ICI_IT_2_Pos                  25U                                            /*!< xPSR: ICI/IT part 2 Position */\r
+#define xPSR_ICI_IT_2_Msk                  (3UL << xPSR_ICI_IT_2_Pos)                     /*!< xPSR: ICI/IT part 2 Mask */\r
+\r
+#define xPSR_T_Pos                         24U                                            /*!< xPSR: T Position */\r
+#define xPSR_T_Msk                         (1UL << xPSR_T_Pos)                            /*!< xPSR: T Mask */\r
+\r
+#define xPSR_ICI_IT_1_Pos                  10U                                            /*!< xPSR: ICI/IT part 1 Position */\r
+#define xPSR_ICI_IT_1_Msk                  (0x3FUL << xPSR_ICI_IT_1_Pos)                  /*!< xPSR: ICI/IT part 1 Mask */\r
+\r
+#define xPSR_ISR_Pos                        0U                                            /*!< xPSR: ISR Position */\r
+#define xPSR_ISR_Msk                       (0x1FFUL /*<< xPSR_ISR_Pos*/)                  /*!< xPSR: ISR Mask */\r
+\r
+\r
+/**\r
+  \brief  Union type to access the Control Registers (CONTROL).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t nPRIV:1;                    /*!< bit:      0  Execution privilege in Thread mode */\r
+    uint32_t SPSEL:1;                    /*!< bit:      1  Stack to be used */\r
+    uint32_t _reserved1:30;              /*!< bit:  2..31  Reserved */\r
+  } b;                                   /*!< Structure used for bit  access */\r
+  uint32_t w;                            /*!< Type      used for word access */\r
+} CONTROL_Type;\r
+\r
+/* CONTROL Register Definitions */\r
+#define CONTROL_SPSEL_Pos                   1U                                            /*!< CONTROL: SPSEL Position */\r
+#define CONTROL_SPSEL_Msk                  (1UL << CONTROL_SPSEL_Pos)                     /*!< CONTROL: SPSEL Mask */\r
+\r
+#define CONTROL_nPRIV_Pos                   0U                                            /*!< CONTROL: nPRIV Position */\r
+#define CONTROL_nPRIV_Msk                  (1UL /*<< CONTROL_nPRIV_Pos*/)                 /*!< CONTROL: nPRIV Mask */\r
+\r
+/*@} end of group CMSIS_CORE */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_NVIC  Nested Vectored Interrupt Controller (NVIC)\r
+  \brief      Type definitions for the NVIC Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Nested Vectored Interrupt Controller (NVIC).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t ISER[8U];               /*!< Offset: 0x000 (R/W)  Interrupt Set Enable Register */\r
+        uint32_t RESERVED0[24U];\r
+  __IOM uint32_t ICER[8U];               /*!< Offset: 0x080 (R/W)  Interrupt Clear Enable Register */\r
+        uint32_t RSERVED1[24U];\r
+  __IOM uint32_t ISPR[8U];               /*!< Offset: 0x100 (R/W)  Interrupt Set Pending Register */\r
+        uint32_t RESERVED2[24U];\r
+  __IOM uint32_t ICPR[8U];               /*!< Offset: 0x180 (R/W)  Interrupt Clear Pending Register */\r
+        uint32_t RESERVED3[24U];\r
+  __IOM uint32_t IABR[8U];               /*!< Offset: 0x200 (R/W)  Interrupt Active bit Register */\r
+        uint32_t RESERVED4[56U];\r
+  __IOM uint8_t  IP[240U];               /*!< Offset: 0x300 (R/W)  Interrupt Priority Register (8Bit wide) */\r
+        uint32_t RESERVED5[644U];\r
+  __OM  uint32_t STIR;                   /*!< Offset: 0xE00 ( /W)  Software Trigger Interrupt Register */\r
+}  NVIC_Type;\r
+\r
+/* Software Triggered Interrupt Register Definitions */\r
+#define NVIC_STIR_INTID_Pos                 0U                                         /*!< STIR: INTLINESNUM Position */\r
+#define NVIC_STIR_INTID_Msk                (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/)        /*!< STIR: INTLINESNUM Mask */\r
+\r
+/*@} end of group CMSIS_NVIC */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SCB     System Control Block (SCB)\r
+  \brief    Type definitions for the System Control Block Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Control Block (SCB).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t CPUID;                  /*!< Offset: 0x000 (R/ )  CPUID Base Register */\r
+  __IOM uint32_t ICSR;                   /*!< Offset: 0x004 (R/W)  Interrupt Control and State Register */\r
+  __IOM uint32_t VTOR;                   /*!< Offset: 0x008 (R/W)  Vector Table Offset Register */\r
+  __IOM uint32_t AIRCR;                  /*!< Offset: 0x00C (R/W)  Application Interrupt and Reset Control Register */\r
+  __IOM uint32_t SCR;                    /*!< Offset: 0x010 (R/W)  System Control Register */\r
+  __IOM uint32_t CCR;                    /*!< Offset: 0x014 (R/W)  Configuration Control Register */\r
+  __IOM uint8_t  SHP[12U];               /*!< Offset: 0x018 (R/W)  System Handlers Priority Registers (4-7, 8-11, 12-15) */\r
+  __IOM uint32_t SHCSR;                  /*!< Offset: 0x024 (R/W)  System Handler Control and State Register */\r
+  __IOM uint32_t CFSR;                   /*!< Offset: 0x028 (R/W)  Configurable Fault Status Register */\r
+  __IOM uint32_t HFSR;                   /*!< Offset: 0x02C (R/W)  HardFault Status Register */\r
+  __IOM uint32_t DFSR;                   /*!< Offset: 0x030 (R/W)  Debug Fault Status Register */\r
+  __IOM uint32_t MMFAR;                  /*!< Offset: 0x034 (R/W)  MemManage Fault Address Register */\r
+  __IOM uint32_t BFAR;                   /*!< Offset: 0x038 (R/W)  BusFault Address Register */\r
+  __IOM uint32_t AFSR;                   /*!< Offset: 0x03C (R/W)  Auxiliary Fault Status Register */\r
+  __IM  uint32_t PFR[2U];                /*!< Offset: 0x040 (R/ )  Processor Feature Register */\r
+  __IM  uint32_t DFR;                    /*!< Offset: 0x048 (R/ )  Debug Feature Register */\r
+  __IM  uint32_t ADR;                    /*!< Offset: 0x04C (R/ )  Auxiliary Feature Register */\r
+  __IM  uint32_t MMFR[4U];               /*!< Offset: 0x050 (R/ )  Memory Model Feature Register */\r
+  __IM  uint32_t ISAR[5U];               /*!< Offset: 0x060 (R/ )  Instruction Set Attributes Register */\r
+        uint32_t RESERVED0[5U];\r
+  __IOM uint32_t CPACR;                  /*!< Offset: 0x088 (R/W)  Coprocessor Access Control Register */\r
+        uint32_t RESERVED1[129U];\r
+  __IOM uint32_t SFCR;                   /*!< Offset: 0x290 (R/W)  Security Features Control Register */\r
+} SCB_Type;\r
+\r
+/* SCB CPUID Register Definitions */\r
+#define SCB_CPUID_IMPLEMENTER_Pos          24U                                            /*!< SCB CPUID: IMPLEMENTER Position */\r
+#define SCB_CPUID_IMPLEMENTER_Msk          (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos)          /*!< SCB CPUID: IMPLEMENTER Mask */\r
+\r
+#define SCB_CPUID_VARIANT_Pos              20U                                            /*!< SCB CPUID: VARIANT Position */\r
+#define SCB_CPUID_VARIANT_Msk              (0xFUL << SCB_CPUID_VARIANT_Pos)               /*!< SCB CPUID: VARIANT Mask */\r
+\r
+#define SCB_CPUID_ARCHITECTURE_Pos         16U                                            /*!< SCB CPUID: ARCHITECTURE Position */\r
+#define SCB_CPUID_ARCHITECTURE_Msk         (0xFUL << SCB_CPUID_ARCHITECTURE_Pos)          /*!< SCB CPUID: ARCHITECTURE Mask */\r
+\r
+#define SCB_CPUID_PARTNO_Pos                4U                                            /*!< SCB CPUID: PARTNO Position */\r
+#define SCB_CPUID_PARTNO_Msk               (0xFFFUL << SCB_CPUID_PARTNO_Pos)              /*!< SCB CPUID: PARTNO Mask */\r
+\r
+#define SCB_CPUID_REVISION_Pos              0U                                            /*!< SCB CPUID: REVISION Position */\r
+#define SCB_CPUID_REVISION_Msk             (0xFUL /*<< SCB_CPUID_REVISION_Pos*/)          /*!< SCB CPUID: REVISION Mask */\r
+\r
+/* SCB Interrupt Control State Register Definitions */\r
+#define SCB_ICSR_NMIPENDSET_Pos            31U                                            /*!< SCB ICSR: NMIPENDSET Position */\r
+#define SCB_ICSR_NMIPENDSET_Msk            (1UL << SCB_ICSR_NMIPENDSET_Pos)               /*!< SCB ICSR: NMIPENDSET Mask */\r
+\r
+#define SCB_ICSR_PENDSVSET_Pos             28U                                            /*!< SCB ICSR: PENDSVSET Position */\r
+#define SCB_ICSR_PENDSVSET_Msk             (1UL << SCB_ICSR_PENDSVSET_Pos)                /*!< SCB ICSR: PENDSVSET Mask */\r
+\r
+#define SCB_ICSR_PENDSVCLR_Pos             27U                                            /*!< SCB ICSR: PENDSVCLR Position */\r
+#define SCB_ICSR_PENDSVCLR_Msk             (1UL << SCB_ICSR_PENDSVCLR_Pos)                /*!< SCB ICSR: PENDSVCLR Mask */\r
+\r
+#define SCB_ICSR_PENDSTSET_Pos             26U                                            /*!< SCB ICSR: PENDSTSET Position */\r
+#define SCB_ICSR_PENDSTSET_Msk             (1UL << SCB_ICSR_PENDSTSET_Pos)                /*!< SCB ICSR: PENDSTSET Mask */\r
+\r
+#define SCB_ICSR_PENDSTCLR_Pos             25U                                            /*!< SCB ICSR: PENDSTCLR Position */\r
+#define SCB_ICSR_PENDSTCLR_Msk             (1UL << SCB_ICSR_PENDSTCLR_Pos)                /*!< SCB ICSR: PENDSTCLR Mask */\r
+\r
+#define SCB_ICSR_ISRPREEMPT_Pos            23U                                            /*!< SCB ICSR: ISRPREEMPT Position */\r
+#define SCB_ICSR_ISRPREEMPT_Msk            (1UL << SCB_ICSR_ISRPREEMPT_Pos)               /*!< SCB ICSR: ISRPREEMPT Mask */\r
+\r
+#define SCB_ICSR_ISRPENDING_Pos            22U                                            /*!< SCB ICSR: ISRPENDING Position */\r
+#define SCB_ICSR_ISRPENDING_Msk            (1UL << SCB_ICSR_ISRPENDING_Pos)               /*!< SCB ICSR: ISRPENDING Mask */\r
+\r
+#define SCB_ICSR_VECTPENDING_Pos           12U                                            /*!< SCB ICSR: VECTPENDING Position */\r
+#define SCB_ICSR_VECTPENDING_Msk           (0x1FFUL << SCB_ICSR_VECTPENDING_Pos)          /*!< SCB ICSR: VECTPENDING Mask */\r
+\r
+#define SCB_ICSR_RETTOBASE_Pos             11U                                            /*!< SCB ICSR: RETTOBASE Position */\r
+#define SCB_ICSR_RETTOBASE_Msk             (1UL << SCB_ICSR_RETTOBASE_Pos)                /*!< SCB ICSR: RETTOBASE Mask */\r
+\r
+#define SCB_ICSR_VECTACTIVE_Pos             0U                                            /*!< SCB ICSR: VECTACTIVE Position */\r
+#define SCB_ICSR_VECTACTIVE_Msk            (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/)       /*!< SCB ICSR: VECTACTIVE Mask */\r
+\r
+/* SCB Vector Table Offset Register Definitions */\r
+#define SCB_VTOR_TBLBASE_Pos               29U                                            /*!< SCB VTOR: TBLBASE Position */\r
+#define SCB_VTOR_TBLBASE_Msk               (1UL << SCB_VTOR_TBLBASE_Pos)                  /*!< SCB VTOR: TBLBASE Mask */\r
+\r
+#define SCB_VTOR_TBLOFF_Pos                 7U                                            /*!< SCB VTOR: TBLOFF Position */\r
+#define SCB_VTOR_TBLOFF_Msk                (0x3FFFFFUL << SCB_VTOR_TBLOFF_Pos)            /*!< SCB VTOR: TBLOFF Mask */\r
+\r
+/* SCB Application Interrupt and Reset Control Register Definitions */\r
+#define SCB_AIRCR_VECTKEY_Pos              16U                                            /*!< SCB AIRCR: VECTKEY Position */\r
+#define SCB_AIRCR_VECTKEY_Msk              (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos)            /*!< SCB AIRCR: VECTKEY Mask */\r
+\r
+#define SCB_AIRCR_VECTKEYSTAT_Pos          16U                                            /*!< SCB AIRCR: VECTKEYSTAT Position */\r
+#define SCB_AIRCR_VECTKEYSTAT_Msk          (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos)        /*!< SCB AIRCR: VECTKEYSTAT Mask */\r
+\r
+#define SCB_AIRCR_ENDIANESS_Pos            15U                                            /*!< SCB AIRCR: ENDIANESS Position */\r
+#define SCB_AIRCR_ENDIANESS_Msk            (1UL << SCB_AIRCR_ENDIANESS_Pos)               /*!< SCB AIRCR: ENDIANESS Mask */\r
+\r
+#define SCB_AIRCR_PRIGROUP_Pos              8U                                            /*!< SCB AIRCR: PRIGROUP Position */\r
+#define SCB_AIRCR_PRIGROUP_Msk             (7UL << SCB_AIRCR_PRIGROUP_Pos)                /*!< SCB AIRCR: PRIGROUP Mask */\r
+\r
+#define SCB_AIRCR_SYSRESETREQ_Pos           2U                                            /*!< SCB AIRCR: SYSRESETREQ Position */\r
+#define SCB_AIRCR_SYSRESETREQ_Msk          (1UL << SCB_AIRCR_SYSRESETREQ_Pos)             /*!< SCB AIRCR: SYSRESETREQ Mask */\r
+\r
+#define SCB_AIRCR_VECTCLRACTIVE_Pos         1U                                            /*!< SCB AIRCR: VECTCLRACTIVE Position */\r
+#define SCB_AIRCR_VECTCLRACTIVE_Msk        (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos)           /*!< SCB AIRCR: VECTCLRACTIVE Mask */\r
+\r
+#define SCB_AIRCR_VECTRESET_Pos             0U                                            /*!< SCB AIRCR: VECTRESET Position */\r
+#define SCB_AIRCR_VECTRESET_Msk            (1UL /*<< SCB_AIRCR_VECTRESET_Pos*/)           /*!< SCB AIRCR: VECTRESET Mask */\r
+\r
+/* SCB System Control Register Definitions */\r
+#define SCB_SCR_SEVONPEND_Pos               4U                                            /*!< SCB SCR: SEVONPEND Position */\r
+#define SCB_SCR_SEVONPEND_Msk              (1UL << SCB_SCR_SEVONPEND_Pos)                 /*!< SCB SCR: SEVONPEND Mask */\r
+\r
+#define SCB_SCR_SLEEPDEEP_Pos               2U                                            /*!< SCB SCR: SLEEPDEEP Position */\r
+#define SCB_SCR_SLEEPDEEP_Msk              (1UL << SCB_SCR_SLEEPDEEP_Pos)                 /*!< SCB SCR: SLEEPDEEP Mask */\r
+\r
+#define SCB_SCR_SLEEPONEXIT_Pos             1U                                            /*!< SCB SCR: SLEEPONEXIT Position */\r
+#define SCB_SCR_SLEEPONEXIT_Msk            (1UL << SCB_SCR_SLEEPONEXIT_Pos)               /*!< SCB SCR: SLEEPONEXIT Mask */\r
+\r
+/* SCB Configuration Control Register Definitions */\r
+#define SCB_CCR_STKALIGN_Pos                9U                                            /*!< SCB CCR: STKALIGN Position */\r
+#define SCB_CCR_STKALIGN_Msk               (1UL << SCB_CCR_STKALIGN_Pos)                  /*!< SCB CCR: STKALIGN Mask */\r
+\r
+#define SCB_CCR_BFHFNMIGN_Pos               8U                                            /*!< SCB CCR: BFHFNMIGN Position */\r
+#define SCB_CCR_BFHFNMIGN_Msk              (1UL << SCB_CCR_BFHFNMIGN_Pos)                 /*!< SCB CCR: BFHFNMIGN Mask */\r
+\r
+#define SCB_CCR_DIV_0_TRP_Pos               4U                                            /*!< SCB CCR: DIV_0_TRP Position */\r
+#define SCB_CCR_DIV_0_TRP_Msk              (1UL << SCB_CCR_DIV_0_TRP_Pos)                 /*!< SCB CCR: DIV_0_TRP Mask */\r
+\r
+#define SCB_CCR_UNALIGN_TRP_Pos             3U                                            /*!< SCB CCR: UNALIGN_TRP Position */\r
+#define SCB_CCR_UNALIGN_TRP_Msk            (1UL << SCB_CCR_UNALIGN_TRP_Pos)               /*!< SCB CCR: UNALIGN_TRP Mask */\r
+\r
+#define SCB_CCR_USERSETMPEND_Pos            1U                                            /*!< SCB CCR: USERSETMPEND Position */\r
+#define SCB_CCR_USERSETMPEND_Msk           (1UL << SCB_CCR_USERSETMPEND_Pos)              /*!< SCB CCR: USERSETMPEND Mask */\r
+\r
+#define SCB_CCR_NONBASETHRDENA_Pos          0U                                            /*!< SCB CCR: NONBASETHRDENA Position */\r
+#define SCB_CCR_NONBASETHRDENA_Msk         (1UL /*<< SCB_CCR_NONBASETHRDENA_Pos*/)        /*!< SCB CCR: NONBASETHRDENA Mask */\r
+\r
+/* SCB System Handler Control and State Register Definitions */\r
+#define SCB_SHCSR_USGFAULTENA_Pos          18U                                            /*!< SCB SHCSR: USGFAULTENA Position */\r
+#define SCB_SHCSR_USGFAULTENA_Msk          (1UL << SCB_SHCSR_USGFAULTENA_Pos)             /*!< SCB SHCSR: USGFAULTENA Mask */\r
+\r
+#define SCB_SHCSR_BUSFAULTENA_Pos          17U                                            /*!< SCB SHCSR: BUSFAULTENA Position */\r
+#define SCB_SHCSR_BUSFAULTENA_Msk          (1UL << SCB_SHCSR_BUSFAULTENA_Pos)             /*!< SCB SHCSR: BUSFAULTENA Mask */\r
+\r
+#define SCB_SHCSR_MEMFAULTENA_Pos          16U                                            /*!< SCB SHCSR: MEMFAULTENA Position */\r
+#define SCB_SHCSR_MEMFAULTENA_Msk          (1UL << SCB_SHCSR_MEMFAULTENA_Pos)             /*!< SCB SHCSR: MEMFAULTENA Mask */\r
+\r
+#define SCB_SHCSR_SVCALLPENDED_Pos         15U                                            /*!< SCB SHCSR: SVCALLPENDED Position */\r
+#define SCB_SHCSR_SVCALLPENDED_Msk         (1UL << SCB_SHCSR_SVCALLPENDED_Pos)            /*!< SCB SHCSR: SVCALLPENDED Mask */\r
+\r
+#define SCB_SHCSR_BUSFAULTPENDED_Pos       14U                                            /*!< SCB SHCSR: BUSFAULTPENDED Position */\r
+#define SCB_SHCSR_BUSFAULTPENDED_Msk       (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos)          /*!< SCB SHCSR: BUSFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_MEMFAULTPENDED_Pos       13U                                            /*!< SCB SHCSR: MEMFAULTPENDED Position */\r
+#define SCB_SHCSR_MEMFAULTPENDED_Msk       (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos)          /*!< SCB SHCSR: MEMFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_USGFAULTPENDED_Pos       12U                                            /*!< SCB SHCSR: USGFAULTPENDED Position */\r
+#define SCB_SHCSR_USGFAULTPENDED_Msk       (1UL << SCB_SHCSR_USGFAULTPENDED_Pos)          /*!< SCB SHCSR: USGFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_SYSTICKACT_Pos           11U                                            /*!< SCB SHCSR: SYSTICKACT Position */\r
+#define SCB_SHCSR_SYSTICKACT_Msk           (1UL << SCB_SHCSR_SYSTICKACT_Pos)              /*!< SCB SHCSR: SYSTICKACT Mask */\r
+\r
+#define SCB_SHCSR_PENDSVACT_Pos            10U                                            /*!< SCB SHCSR: PENDSVACT Position */\r
+#define SCB_SHCSR_PENDSVACT_Msk            (1UL << SCB_SHCSR_PENDSVACT_Pos)               /*!< SCB SHCSR: PENDSVACT Mask */\r
+\r
+#define SCB_SHCSR_MONITORACT_Pos            8U                                            /*!< SCB SHCSR: MONITORACT Position */\r
+#define SCB_SHCSR_MONITORACT_Msk           (1UL << SCB_SHCSR_MONITORACT_Pos)              /*!< SCB SHCSR: MONITORACT Mask */\r
+\r
+#define SCB_SHCSR_SVCALLACT_Pos             7U                                            /*!< SCB SHCSR: SVCALLACT Position */\r
+#define SCB_SHCSR_SVCALLACT_Msk            (1UL << SCB_SHCSR_SVCALLACT_Pos)               /*!< SCB SHCSR: SVCALLACT Mask */\r
+\r
+#define SCB_SHCSR_USGFAULTACT_Pos           3U                                            /*!< SCB SHCSR: USGFAULTACT Position */\r
+#define SCB_SHCSR_USGFAULTACT_Msk          (1UL << SCB_SHCSR_USGFAULTACT_Pos)             /*!< SCB SHCSR: USGFAULTACT Mask */\r
+\r
+#define SCB_SHCSR_BUSFAULTACT_Pos           1U                                            /*!< SCB SHCSR: BUSFAULTACT Position */\r
+#define SCB_SHCSR_BUSFAULTACT_Msk          (1UL << SCB_SHCSR_BUSFAULTACT_Pos)             /*!< SCB SHCSR: BUSFAULTACT Mask */\r
+\r
+#define SCB_SHCSR_MEMFAULTACT_Pos           0U                                            /*!< SCB SHCSR: MEMFAULTACT Position */\r
+#define SCB_SHCSR_MEMFAULTACT_Msk          (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/)         /*!< SCB SHCSR: MEMFAULTACT Mask */\r
+\r
+/* SCB Configurable Fault Status Register Definitions */\r
+#define SCB_CFSR_USGFAULTSR_Pos            16U                                            /*!< SCB CFSR: Usage Fault Status Register Position */\r
+#define SCB_CFSR_USGFAULTSR_Msk            (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos)          /*!< SCB CFSR: Usage Fault Status Register Mask */\r
+\r
+#define SCB_CFSR_BUSFAULTSR_Pos             8U                                            /*!< SCB CFSR: Bus Fault Status Register Position */\r
+#define SCB_CFSR_BUSFAULTSR_Msk            (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos)            /*!< SCB CFSR: Bus Fault Status Register Mask */\r
+\r
+#define SCB_CFSR_MEMFAULTSR_Pos             0U                                            /*!< SCB CFSR: Memory Manage Fault Status Register Position */\r
+#define SCB_CFSR_MEMFAULTSR_Msk            (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/)        /*!< SCB CFSR: Memory Manage Fault Status Register Mask */\r
+\r
+/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */\r
+#define SCB_CFSR_MMARVALID_Pos             (SCB_SHCSR_MEMFAULTACT_Pos + 7U)               /*!< SCB CFSR (MMFSR): MMARVALID Position */\r
+#define SCB_CFSR_MMARVALID_Msk             (1UL << SCB_CFSR_MMARVALID_Pos)                /*!< SCB CFSR (MMFSR): MMARVALID Mask */\r
+\r
+#define SCB_CFSR_MSTKERR_Pos               (SCB_SHCSR_MEMFAULTACT_Pos + 4U)               /*!< SCB CFSR (MMFSR): MSTKERR Position */\r
+#define SCB_CFSR_MSTKERR_Msk               (1UL << SCB_CFSR_MSTKERR_Pos)                  /*!< SCB CFSR (MMFSR): MSTKERR Mask */\r
+\r
+#define SCB_CFSR_MUNSTKERR_Pos             (SCB_SHCSR_MEMFAULTACT_Pos + 3U)               /*!< SCB CFSR (MMFSR): MUNSTKERR Position */\r
+#define SCB_CFSR_MUNSTKERR_Msk             (1UL << SCB_CFSR_MUNSTKERR_Pos)                /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */\r
+\r
+#define SCB_CFSR_DACCVIOL_Pos              (SCB_SHCSR_MEMFAULTACT_Pos + 1U)               /*!< SCB CFSR (MMFSR): DACCVIOL Position */\r
+#define SCB_CFSR_DACCVIOL_Msk              (1UL << SCB_CFSR_DACCVIOL_Pos)                 /*!< SCB CFSR (MMFSR): DACCVIOL Mask */\r
+\r
+#define SCB_CFSR_IACCVIOL_Pos              (SCB_SHCSR_MEMFAULTACT_Pos + 0U)               /*!< SCB CFSR (MMFSR): IACCVIOL Position */\r
+#define SCB_CFSR_IACCVIOL_Msk              (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/)             /*!< SCB CFSR (MMFSR): IACCVIOL Mask */\r
+\r
+/* BusFault Status Register (part of SCB Configurable Fault Status Register) */\r
+#define SCB_CFSR_BFARVALID_Pos            (SCB_CFSR_BUSFAULTSR_Pos + 7U)                  /*!< SCB CFSR (BFSR): BFARVALID Position */\r
+#define SCB_CFSR_BFARVALID_Msk            (1UL << SCB_CFSR_BFARVALID_Pos)                 /*!< SCB CFSR (BFSR): BFARVALID Mask */\r
+\r
+#define SCB_CFSR_STKERR_Pos               (SCB_CFSR_BUSFAULTSR_Pos + 4U)                  /*!< SCB CFSR (BFSR): STKERR Position */\r
+#define SCB_CFSR_STKERR_Msk               (1UL << SCB_CFSR_STKERR_Pos)                    /*!< SCB CFSR (BFSR): STKERR Mask */\r
+\r
+#define SCB_CFSR_UNSTKERR_Pos             (SCB_CFSR_BUSFAULTSR_Pos + 3U)                  /*!< SCB CFSR (BFSR): UNSTKERR Position */\r
+#define SCB_CFSR_UNSTKERR_Msk             (1UL << SCB_CFSR_UNSTKERR_Pos)                  /*!< SCB CFSR (BFSR): UNSTKERR Mask */\r
+\r
+#define SCB_CFSR_IMPRECISERR_Pos          (SCB_CFSR_BUSFAULTSR_Pos + 2U)                  /*!< SCB CFSR (BFSR): IMPRECISERR Position */\r
+#define SCB_CFSR_IMPRECISERR_Msk          (1UL << SCB_CFSR_IMPRECISERR_Pos)               /*!< SCB CFSR (BFSR): IMPRECISERR Mask */\r
+\r
+#define SCB_CFSR_PRECISERR_Pos            (SCB_CFSR_BUSFAULTSR_Pos + 1U)                  /*!< SCB CFSR (BFSR): PRECISERR Position */\r
+#define SCB_CFSR_PRECISERR_Msk            (1UL << SCB_CFSR_PRECISERR_Pos)                 /*!< SCB CFSR (BFSR): PRECISERR Mask */\r
+\r
+#define SCB_CFSR_IBUSERR_Pos              (SCB_CFSR_BUSFAULTSR_Pos + 0U)                  /*!< SCB CFSR (BFSR): IBUSERR Position */\r
+#define SCB_CFSR_IBUSERR_Msk              (1UL << SCB_CFSR_IBUSERR_Pos)                   /*!< SCB CFSR (BFSR): IBUSERR Mask */\r
+\r
+/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */\r
+#define SCB_CFSR_DIVBYZERO_Pos            (SCB_CFSR_USGFAULTSR_Pos + 9U)                  /*!< SCB CFSR (UFSR): DIVBYZERO Position */\r
+#define SCB_CFSR_DIVBYZERO_Msk            (1UL << SCB_CFSR_DIVBYZERO_Pos)                 /*!< SCB CFSR (UFSR): DIVBYZERO Mask */\r
+\r
+#define SCB_CFSR_UNALIGNED_Pos            (SCB_CFSR_USGFAULTSR_Pos + 8U)                  /*!< SCB CFSR (UFSR): UNALIGNED Position */\r
+#define SCB_CFSR_UNALIGNED_Msk            (1UL << SCB_CFSR_UNALIGNED_Pos)                 /*!< SCB CFSR (UFSR): UNALIGNED Mask */\r
+\r
+#define SCB_CFSR_NOCP_Pos                 (SCB_CFSR_USGFAULTSR_Pos + 3U)                  /*!< SCB CFSR (UFSR): NOCP Position */\r
+#define SCB_CFSR_NOCP_Msk                 (1UL << SCB_CFSR_NOCP_Pos)                      /*!< SCB CFSR (UFSR): NOCP Mask */\r
+\r
+#define SCB_CFSR_INVPC_Pos                (SCB_CFSR_USGFAULTSR_Pos + 2U)                  /*!< SCB CFSR (UFSR): INVPC Position */\r
+#define SCB_CFSR_INVPC_Msk                (1UL << SCB_CFSR_INVPC_Pos)                     /*!< SCB CFSR (UFSR): INVPC Mask */\r
+\r
+#define SCB_CFSR_INVSTATE_Pos             (SCB_CFSR_USGFAULTSR_Pos + 1U)                  /*!< SCB CFSR (UFSR): INVSTATE Position */\r
+#define SCB_CFSR_INVSTATE_Msk             (1UL << SCB_CFSR_INVSTATE_Pos)                  /*!< SCB CFSR (UFSR): INVSTATE Mask */\r
+\r
+#define SCB_CFSR_UNDEFINSTR_Pos           (SCB_CFSR_USGFAULTSR_Pos + 0U)                  /*!< SCB CFSR (UFSR): UNDEFINSTR Position */\r
+#define SCB_CFSR_UNDEFINSTR_Msk           (1UL << SCB_CFSR_UNDEFINSTR_Pos)                /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */\r
+\r
+/* SCB Hard Fault Status Register Definitions */\r
+#define SCB_HFSR_DEBUGEVT_Pos              31U                                            /*!< SCB HFSR: DEBUGEVT Position */\r
+#define SCB_HFSR_DEBUGEVT_Msk              (1UL << SCB_HFSR_DEBUGEVT_Pos)                 /*!< SCB HFSR: DEBUGEVT Mask */\r
+\r
+#define SCB_HFSR_FORCED_Pos                30U                                            /*!< SCB HFSR: FORCED Position */\r
+#define SCB_HFSR_FORCED_Msk                (1UL << SCB_HFSR_FORCED_Pos)                   /*!< SCB HFSR: FORCED Mask */\r
+\r
+#define SCB_HFSR_VECTTBL_Pos                1U                                            /*!< SCB HFSR: VECTTBL Position */\r
+#define SCB_HFSR_VECTTBL_Msk               (1UL << SCB_HFSR_VECTTBL_Pos)                  /*!< SCB HFSR: VECTTBL Mask */\r
+\r
+/* SCB Debug Fault Status Register Definitions */\r
+#define SCB_DFSR_EXTERNAL_Pos               4U                                            /*!< SCB DFSR: EXTERNAL Position */\r
+#define SCB_DFSR_EXTERNAL_Msk              (1UL << SCB_DFSR_EXTERNAL_Pos)                 /*!< SCB DFSR: EXTERNAL Mask */\r
+\r
+#define SCB_DFSR_VCATCH_Pos                 3U                                            /*!< SCB DFSR: VCATCH Position */\r
+#define SCB_DFSR_VCATCH_Msk                (1UL << SCB_DFSR_VCATCH_Pos)                   /*!< SCB DFSR: VCATCH Mask */\r
+\r
+#define SCB_DFSR_DWTTRAP_Pos                2U                                            /*!< SCB DFSR: DWTTRAP Position */\r
+#define SCB_DFSR_DWTTRAP_Msk               (1UL << SCB_DFSR_DWTTRAP_Pos)                  /*!< SCB DFSR: DWTTRAP Mask */\r
+\r
+#define SCB_DFSR_BKPT_Pos                   1U                                            /*!< SCB DFSR: BKPT Position */\r
+#define SCB_DFSR_BKPT_Msk                  (1UL << SCB_DFSR_BKPT_Pos)                     /*!< SCB DFSR: BKPT Mask */\r
+\r
+#define SCB_DFSR_HALTED_Pos                 0U                                            /*!< SCB DFSR: HALTED Position */\r
+#define SCB_DFSR_HALTED_Msk                (1UL /*<< SCB_DFSR_HALTED_Pos*/)               /*!< SCB DFSR: HALTED Mask */\r
+\r
+/*@} end of group CMSIS_SCB */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB)\r
+  \brief    Type definitions for the System Control and ID Register not in the SCB\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Control and ID Register not in the SCB.\r
+ */\r
+typedef struct\r
+{\r
+        uint32_t RESERVED0[1U];\r
+  __IM  uint32_t ICTR;                   /*!< Offset: 0x004 (R/ )  Interrupt Controller Type Register */\r
+        uint32_t RESERVED1[1U];\r
+} SCnSCB_Type;\r
+\r
+/* Interrupt Controller Type Register Definitions */\r
+#define SCnSCB_ICTR_INTLINESNUM_Pos         0U                                         /*!< ICTR: INTLINESNUM Position */\r
+#define SCnSCB_ICTR_INTLINESNUM_Msk        (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/)  /*!< ICTR: INTLINESNUM Mask */\r
+\r
+/*@} end of group CMSIS_SCnotSCB */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_SysTick     System Tick Timer (SysTick)\r
+  \brief    Type definitions for the System Timer Registers.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the System Timer (SysTick).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  SysTick Control and Status Register */\r
+  __IOM uint32_t LOAD;                   /*!< Offset: 0x004 (R/W)  SysTick Reload Value Register */\r
+  __IOM uint32_t VAL;                    /*!< Offset: 0x008 (R/W)  SysTick Current Value Register */\r
+  __IM  uint32_t CALIB;                  /*!< Offset: 0x00C (R/ )  SysTick Calibration Register */\r
+} SysTick_Type;\r
+\r
+/* SysTick Control / Status Register Definitions */\r
+#define SysTick_CTRL_COUNTFLAG_Pos         16U                                            /*!< SysTick CTRL: COUNTFLAG Position */\r
+#define SysTick_CTRL_COUNTFLAG_Msk         (1UL << SysTick_CTRL_COUNTFLAG_Pos)            /*!< SysTick CTRL: COUNTFLAG Mask */\r
+\r
+#define SysTick_CTRL_CLKSOURCE_Pos          2U                                            /*!< SysTick CTRL: CLKSOURCE Position */\r
+#define SysTick_CTRL_CLKSOURCE_Msk         (1UL << SysTick_CTRL_CLKSOURCE_Pos)            /*!< SysTick CTRL: CLKSOURCE Mask */\r
+\r
+#define SysTick_CTRL_TICKINT_Pos            1U                                            /*!< SysTick CTRL: TICKINT Position */\r
+#define SysTick_CTRL_TICKINT_Msk           (1UL << SysTick_CTRL_TICKINT_Pos)              /*!< SysTick CTRL: TICKINT Mask */\r
+\r
+#define SysTick_CTRL_ENABLE_Pos             0U                                            /*!< SysTick CTRL: ENABLE Position */\r
+#define SysTick_CTRL_ENABLE_Msk            (1UL /*<< SysTick_CTRL_ENABLE_Pos*/)           /*!< SysTick CTRL: ENABLE Mask */\r
+\r
+/* SysTick Reload Register Definitions */\r
+#define SysTick_LOAD_RELOAD_Pos             0U                                            /*!< SysTick LOAD: RELOAD Position */\r
+#define SysTick_LOAD_RELOAD_Msk            (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/)    /*!< SysTick LOAD: RELOAD Mask */\r
+\r
+/* SysTick Current Register Definitions */\r
+#define SysTick_VAL_CURRENT_Pos             0U                                            /*!< SysTick VAL: CURRENT Position */\r
+#define SysTick_VAL_CURRENT_Msk            (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/)    /*!< SysTick VAL: CURRENT Mask */\r
+\r
+/* SysTick Calibration Register Definitions */\r
+#define SysTick_CALIB_NOREF_Pos            31U                                            /*!< SysTick CALIB: NOREF Position */\r
+#define SysTick_CALIB_NOREF_Msk            (1UL << SysTick_CALIB_NOREF_Pos)               /*!< SysTick CALIB: NOREF Mask */\r
+\r
+#define SysTick_CALIB_SKEW_Pos             30U                                            /*!< SysTick CALIB: SKEW Position */\r
+#define SysTick_CALIB_SKEW_Msk             (1UL << SysTick_CALIB_SKEW_Pos)                /*!< SysTick CALIB: SKEW Mask */\r
+\r
+#define SysTick_CALIB_TENMS_Pos             0U                                            /*!< SysTick CALIB: TENMS Position */\r
+#define SysTick_CALIB_TENMS_Msk            (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/)    /*!< SysTick CALIB: TENMS Mask */\r
+\r
+/*@} end of group CMSIS_SysTick */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_ITM     Instrumentation Trace Macrocell (ITM)\r
+  \brief    Type definitions for the Instrumentation Trace Macrocell (ITM)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Instrumentation Trace Macrocell Register (ITM).\r
+ */\r
+typedef struct\r
+{\r
+  __OM  union\r
+  {\r
+    __OM  uint8_t    u8;                 /*!< Offset: 0x000 ( /W)  ITM Stimulus Port 8-bit */\r
+    __OM  uint16_t   u16;                /*!< Offset: 0x000 ( /W)  ITM Stimulus Port 16-bit */\r
+    __OM  uint32_t   u32;                /*!< Offset: 0x000 ( /W)  ITM Stimulus Port 32-bit */\r
+  }  PORT [32U];                         /*!< Offset: 0x000 ( /W)  ITM Stimulus Port Registers */\r
+        uint32_t RESERVED0[864U];\r
+  __IOM uint32_t TER;                    /*!< Offset: 0xE00 (R/W)  ITM Trace Enable Register */\r
+        uint32_t RESERVED1[15U];\r
+  __IOM uint32_t TPR;                    /*!< Offset: 0xE40 (R/W)  ITM Trace Privilege Register */\r
+        uint32_t RESERVED2[15U];\r
+  __IOM uint32_t TCR;                    /*!< Offset: 0xE80 (R/W)  ITM Trace Control Register */\r
+        uint32_t RESERVED3[29U];\r
+  __OM  uint32_t IWR;                    /*!< Offset: 0xEF8 ( /W)  ITM Integration Write Register */\r
+  __IM  uint32_t IRR;                    /*!< Offset: 0xEFC (R/ )  ITM Integration Read Register */\r
+  __IOM uint32_t IMCR;                   /*!< Offset: 0xF00 (R/W)  ITM Integration Mode Control Register */\r
+        uint32_t RESERVED4[43U];\r
+  __OM  uint32_t LAR;                    /*!< Offset: 0xFB0 ( /W)  ITM Lock Access Register */\r
+  __IM  uint32_t LSR;                    /*!< Offset: 0xFB4 (R/ )  ITM Lock Status Register */\r
+        uint32_t RESERVED5[6U];\r
+  __IM  uint32_t PID4;                   /*!< Offset: 0xFD0 (R/ )  ITM Peripheral Identification Register #4 */\r
+  __IM  uint32_t PID5;                   /*!< Offset: 0xFD4 (R/ )  ITM Peripheral Identification Register #5 */\r
+  __IM  uint32_t PID6;                   /*!< Offset: 0xFD8 (R/ )  ITM Peripheral Identification Register #6 */\r
+  __IM  uint32_t PID7;                   /*!< Offset: 0xFDC (R/ )  ITM Peripheral Identification Register #7 */\r
+  __IM  uint32_t PID0;                   /*!< Offset: 0xFE0 (R/ )  ITM Peripheral Identification Register #0 */\r
+  __IM  uint32_t PID1;                   /*!< Offset: 0xFE4 (R/ )  ITM Peripheral Identification Register #1 */\r
+  __IM  uint32_t PID2;                   /*!< Offset: 0xFE8 (R/ )  ITM Peripheral Identification Register #2 */\r
+  __IM  uint32_t PID3;                   /*!< Offset: 0xFEC (R/ )  ITM Peripheral Identification Register #3 */\r
+  __IM  uint32_t CID0;                   /*!< Offset: 0xFF0 (R/ )  ITM Component  Identification Register #0 */\r
+  __IM  uint32_t CID1;                   /*!< Offset: 0xFF4 (R/ )  ITM Component  Identification Register #1 */\r
+  __IM  uint32_t CID2;                   /*!< Offset: 0xFF8 (R/ )  ITM Component  Identification Register #2 */\r
+  __IM  uint32_t CID3;                   /*!< Offset: 0xFFC (R/ )  ITM Component  Identification Register #3 */\r
+} ITM_Type;\r
+\r
+/* ITM Trace Privilege Register Definitions */\r
+#define ITM_TPR_PRIVMASK_Pos                0U                                            /*!< ITM TPR: PRIVMASK Position */\r
+#define ITM_TPR_PRIVMASK_Msk               (0xFUL /*<< ITM_TPR_PRIVMASK_Pos*/)            /*!< ITM TPR: PRIVMASK Mask */\r
+\r
+/* ITM Trace Control Register Definitions */\r
+#define ITM_TCR_BUSY_Pos                   23U                                            /*!< ITM TCR: BUSY Position */\r
+#define ITM_TCR_BUSY_Msk                   (1UL << ITM_TCR_BUSY_Pos)                      /*!< ITM TCR: BUSY Mask */\r
+\r
+#define ITM_TCR_TraceBusID_Pos             16U                                            /*!< ITM TCR: ATBID Position */\r
+#define ITM_TCR_TraceBusID_Msk             (0x7FUL << ITM_TCR_TraceBusID_Pos)             /*!< ITM TCR: ATBID Mask */\r
+\r
+#define ITM_TCR_GTSFREQ_Pos                10U                                            /*!< ITM TCR: Global timestamp frequency Position */\r
+#define ITM_TCR_GTSFREQ_Msk                (3UL << ITM_TCR_GTSFREQ_Pos)                   /*!< ITM TCR: Global timestamp frequency Mask */\r
+\r
+#define ITM_TCR_TSPrescale_Pos              8U                                            /*!< ITM TCR: TSPrescale Position */\r
+#define ITM_TCR_TSPrescale_Msk             (3UL << ITM_TCR_TSPrescale_Pos)                /*!< ITM TCR: TSPrescale Mask */\r
+\r
+#define ITM_TCR_SWOENA_Pos                  4U                                            /*!< ITM TCR: SWOENA Position */\r
+#define ITM_TCR_SWOENA_Msk                 (1UL << ITM_TCR_SWOENA_Pos)                    /*!< ITM TCR: SWOENA Mask */\r
+\r
+#define ITM_TCR_DWTENA_Pos                  3U                                            /*!< ITM TCR: DWTENA Position */\r
+#define ITM_TCR_DWTENA_Msk                 (1UL << ITM_TCR_DWTENA_Pos)                    /*!< ITM TCR: DWTENA Mask */\r
+\r
+#define ITM_TCR_SYNCENA_Pos                 2U                                            /*!< ITM TCR: SYNCENA Position */\r
+#define ITM_TCR_SYNCENA_Msk                (1UL << ITM_TCR_SYNCENA_Pos)                   /*!< ITM TCR: SYNCENA Mask */\r
+\r
+#define ITM_TCR_TSENA_Pos                   1U                                            /*!< ITM TCR: TSENA Position */\r
+#define ITM_TCR_TSENA_Msk                  (1UL << ITM_TCR_TSENA_Pos)                     /*!< ITM TCR: TSENA Mask */\r
+\r
+#define ITM_TCR_ITMENA_Pos                  0U                                            /*!< ITM TCR: ITM Enable bit Position */\r
+#define ITM_TCR_ITMENA_Msk                 (1UL /*<< ITM_TCR_ITMENA_Pos*/)                /*!< ITM TCR: ITM Enable bit Mask */\r
+\r
+/* ITM Integration Write Register Definitions */\r
+#define ITM_IWR_ATVALIDM_Pos                0U                                            /*!< ITM IWR: ATVALIDM Position */\r
+#define ITM_IWR_ATVALIDM_Msk               (1UL /*<< ITM_IWR_ATVALIDM_Pos*/)              /*!< ITM IWR: ATVALIDM Mask */\r
+\r
+/* ITM Integration Read Register Definitions */\r
+#define ITM_IRR_ATREADYM_Pos                0U                                            /*!< ITM IRR: ATREADYM Position */\r
+#define ITM_IRR_ATREADYM_Msk               (1UL /*<< ITM_IRR_ATREADYM_Pos*/)              /*!< ITM IRR: ATREADYM Mask */\r
+\r
+/* ITM Integration Mode Control Register Definitions */\r
+#define ITM_IMCR_INTEGRATION_Pos            0U                                            /*!< ITM IMCR: INTEGRATION Position */\r
+#define ITM_IMCR_INTEGRATION_Msk           (1UL /*<< ITM_IMCR_INTEGRATION_Pos*/)          /*!< ITM IMCR: INTEGRATION Mask */\r
+\r
+/* ITM Lock Status Register Definitions */\r
+#define ITM_LSR_ByteAcc_Pos                 2U                                            /*!< ITM LSR: ByteAcc Position */\r
+#define ITM_LSR_ByteAcc_Msk                (1UL << ITM_LSR_ByteAcc_Pos)                   /*!< ITM LSR: ByteAcc Mask */\r
+\r
+#define ITM_LSR_Access_Pos                  1U                                            /*!< ITM LSR: Access Position */\r
+#define ITM_LSR_Access_Msk                 (1UL << ITM_LSR_Access_Pos)                    /*!< ITM LSR: Access Mask */\r
+\r
+#define ITM_LSR_Present_Pos                 0U                                            /*!< ITM LSR: Present Position */\r
+#define ITM_LSR_Present_Msk                (1UL /*<< ITM_LSR_Present_Pos*/)               /*!< ITM LSR: Present Mask */\r
+\r
+/*@}*/ /* end of group CMSIS_ITM */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_DWT     Data Watchpoint and Trace (DWT)\r
+  \brief    Type definitions for the Data Watchpoint and Trace (DWT)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Data Watchpoint and Trace Register (DWT).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  Control Register */\r
+  __IOM uint32_t CYCCNT;                 /*!< Offset: 0x004 (R/W)  Cycle Count Register */\r
+  __IOM uint32_t CPICNT;                 /*!< Offset: 0x008 (R/W)  CPI Count Register */\r
+  __IOM uint32_t EXCCNT;                 /*!< Offset: 0x00C (R/W)  Exception Overhead Count Register */\r
+  __IOM uint32_t SLEEPCNT;               /*!< Offset: 0x010 (R/W)  Sleep Count Register */\r
+  __IOM uint32_t LSUCNT;                 /*!< Offset: 0x014 (R/W)  LSU Count Register */\r
+  __IOM uint32_t FOLDCNT;                /*!< Offset: 0x018 (R/W)  Folded-instruction Count Register */\r
+  __IM  uint32_t PCSR;                   /*!< Offset: 0x01C (R/ )  Program Counter Sample Register */\r
+  __IOM uint32_t COMP0;                  /*!< Offset: 0x020 (R/W)  Comparator Register 0 */\r
+  __IOM uint32_t MASK0;                  /*!< Offset: 0x024 (R/W)  Mask Register 0 */\r
+  __IOM uint32_t FUNCTION0;              /*!< Offset: 0x028 (R/W)  Function Register 0 */\r
+        uint32_t RESERVED0[1U];\r
+  __IOM uint32_t COMP1;                  /*!< Offset: 0x030 (R/W)  Comparator Register 1 */\r
+  __IOM uint32_t MASK1;                  /*!< Offset: 0x034 (R/W)  Mask Register 1 */\r
+  __IOM uint32_t FUNCTION1;              /*!< Offset: 0x038 (R/W)  Function Register 1 */\r
+        uint32_t RESERVED1[1U];\r
+  __IOM uint32_t COMP2;                  /*!< Offset: 0x040 (R/W)  Comparator Register 2 */\r
+  __IOM uint32_t MASK2;                  /*!< Offset: 0x044 (R/W)  Mask Register 2 */\r
+  __IOM uint32_t FUNCTION2;              /*!< Offset: 0x048 (R/W)  Function Register 2 */\r
+        uint32_t RESERVED2[1U];\r
+  __IOM uint32_t COMP3;                  /*!< Offset: 0x050 (R/W)  Comparator Register 3 */\r
+  __IOM uint32_t MASK3;                  /*!< Offset: 0x054 (R/W)  Mask Register 3 */\r
+  __IOM uint32_t FUNCTION3;              /*!< Offset: 0x058 (R/W)  Function Register 3 */\r
+} DWT_Type;\r
+\r
+/* DWT Control Register Definitions */\r
+#define DWT_CTRL_NUMCOMP_Pos               28U                                         /*!< DWT CTRL: NUMCOMP Position */\r
+#define DWT_CTRL_NUMCOMP_Msk               (0xFUL << DWT_CTRL_NUMCOMP_Pos)             /*!< DWT CTRL: NUMCOMP Mask */\r
+\r
+#define DWT_CTRL_NOTRCPKT_Pos              27U                                         /*!< DWT CTRL: NOTRCPKT Position */\r
+#define DWT_CTRL_NOTRCPKT_Msk              (0x1UL << DWT_CTRL_NOTRCPKT_Pos)            /*!< DWT CTRL: NOTRCPKT Mask */\r
+\r
+#define DWT_CTRL_NOEXTTRIG_Pos             26U                                         /*!< DWT CTRL: NOEXTTRIG Position */\r
+#define DWT_CTRL_NOEXTTRIG_Msk             (0x1UL << DWT_CTRL_NOEXTTRIG_Pos)           /*!< DWT CTRL: NOEXTTRIG Mask */\r
+\r
+#define DWT_CTRL_NOCYCCNT_Pos              25U                                         /*!< DWT CTRL: NOCYCCNT Position */\r
+#define DWT_CTRL_NOCYCCNT_Msk              (0x1UL << DWT_CTRL_NOCYCCNT_Pos)            /*!< DWT CTRL: NOCYCCNT Mask */\r
+\r
+#define DWT_CTRL_NOPRFCNT_Pos              24U                                         /*!< DWT CTRL: NOPRFCNT Position */\r
+#define DWT_CTRL_NOPRFCNT_Msk              (0x1UL << DWT_CTRL_NOPRFCNT_Pos)            /*!< DWT CTRL: NOPRFCNT Mask */\r
+\r
+#define DWT_CTRL_CYCEVTENA_Pos             22U                                         /*!< DWT CTRL: CYCEVTENA Position */\r
+#define DWT_CTRL_CYCEVTENA_Msk             (0x1UL << DWT_CTRL_CYCEVTENA_Pos)           /*!< DWT CTRL: CYCEVTENA Mask */\r
+\r
+#define DWT_CTRL_FOLDEVTENA_Pos            21U                                         /*!< DWT CTRL: FOLDEVTENA Position */\r
+#define DWT_CTRL_FOLDEVTENA_Msk            (0x1UL << DWT_CTRL_FOLDEVTENA_Pos)          /*!< DWT CTRL: FOLDEVTENA Mask */\r
+\r
+#define DWT_CTRL_LSUEVTENA_Pos             20U                                         /*!< DWT CTRL: LSUEVTENA Position */\r
+#define DWT_CTRL_LSUEVTENA_Msk             (0x1UL << DWT_CTRL_LSUEVTENA_Pos)           /*!< DWT CTRL: LSUEVTENA Mask */\r
+\r
+#define DWT_CTRL_SLEEPEVTENA_Pos           19U                                         /*!< DWT CTRL: SLEEPEVTENA Position */\r
+#define DWT_CTRL_SLEEPEVTENA_Msk           (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos)         /*!< DWT CTRL: SLEEPEVTENA Mask */\r
+\r
+#define DWT_CTRL_EXCEVTENA_Pos             18U                                         /*!< DWT CTRL: EXCEVTENA Position */\r
+#define DWT_CTRL_EXCEVTENA_Msk             (0x1UL << DWT_CTRL_EXCEVTENA_Pos)           /*!< DWT CTRL: EXCEVTENA Mask */\r
+\r
+#define DWT_CTRL_CPIEVTENA_Pos             17U                                         /*!< DWT CTRL: CPIEVTENA Position */\r
+#define DWT_CTRL_CPIEVTENA_Msk             (0x1UL << DWT_CTRL_CPIEVTENA_Pos)           /*!< DWT CTRL: CPIEVTENA Mask */\r
+\r
+#define DWT_CTRL_EXCTRCENA_Pos             16U                                         /*!< DWT CTRL: EXCTRCENA Position */\r
+#define DWT_CTRL_EXCTRCENA_Msk             (0x1UL << DWT_CTRL_EXCTRCENA_Pos)           /*!< DWT CTRL: EXCTRCENA Mask */\r
+\r
+#define DWT_CTRL_PCSAMPLENA_Pos            12U                                         /*!< DWT CTRL: PCSAMPLENA Position */\r
+#define DWT_CTRL_PCSAMPLENA_Msk            (0x1UL << DWT_CTRL_PCSAMPLENA_Pos)          /*!< DWT CTRL: PCSAMPLENA Mask */\r
+\r
+#define DWT_CTRL_SYNCTAP_Pos               10U                                         /*!< DWT CTRL: SYNCTAP Position */\r
+#define DWT_CTRL_SYNCTAP_Msk               (0x3UL << DWT_CTRL_SYNCTAP_Pos)             /*!< DWT CTRL: SYNCTAP Mask */\r
+\r
+#define DWT_CTRL_CYCTAP_Pos                 9U                                         /*!< DWT CTRL: CYCTAP Position */\r
+#define DWT_CTRL_CYCTAP_Msk                (0x1UL << DWT_CTRL_CYCTAP_Pos)              /*!< DWT CTRL: CYCTAP Mask */\r
+\r
+#define DWT_CTRL_POSTINIT_Pos               5U                                         /*!< DWT CTRL: POSTINIT Position */\r
+#define DWT_CTRL_POSTINIT_Msk              (0xFUL << DWT_CTRL_POSTINIT_Pos)            /*!< DWT CTRL: POSTINIT Mask */\r
+\r
+#define DWT_CTRL_POSTPRESET_Pos             1U                                         /*!< DWT CTRL: POSTPRESET Position */\r
+#define DWT_CTRL_POSTPRESET_Msk            (0xFUL << DWT_CTRL_POSTPRESET_Pos)          /*!< DWT CTRL: POSTPRESET Mask */\r
+\r
+#define DWT_CTRL_CYCCNTENA_Pos              0U                                         /*!< DWT CTRL: CYCCNTENA Position */\r
+#define DWT_CTRL_CYCCNTENA_Msk             (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/)       /*!< DWT CTRL: CYCCNTENA Mask */\r
+\r
+/* DWT CPI Count Register Definitions */\r
+#define DWT_CPICNT_CPICNT_Pos               0U                                         /*!< DWT CPICNT: CPICNT Position */\r
+#define DWT_CPICNT_CPICNT_Msk              (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/)       /*!< DWT CPICNT: CPICNT Mask */\r
+\r
+/* DWT Exception Overhead Count Register Definitions */\r
+#define DWT_EXCCNT_EXCCNT_Pos               0U                                         /*!< DWT EXCCNT: EXCCNT Position */\r
+#define DWT_EXCCNT_EXCCNT_Msk              (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/)       /*!< DWT EXCCNT: EXCCNT Mask */\r
+\r
+/* DWT Sleep Count Register Definitions */\r
+#define DWT_SLEEPCNT_SLEEPCNT_Pos           0U                                         /*!< DWT SLEEPCNT: SLEEPCNT Position */\r
+#define DWT_SLEEPCNT_SLEEPCNT_Msk          (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/)   /*!< DWT SLEEPCNT: SLEEPCNT Mask */\r
+\r
+/* DWT LSU Count Register Definitions */\r
+#define DWT_LSUCNT_LSUCNT_Pos               0U                                         /*!< DWT LSUCNT: LSUCNT Position */\r
+#define DWT_LSUCNT_LSUCNT_Msk              (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/)       /*!< DWT LSUCNT: LSUCNT Mask */\r
+\r
+/* DWT Folded-instruction Count Register Definitions */\r
+#define DWT_FOLDCNT_FOLDCNT_Pos             0U                                         /*!< DWT FOLDCNT: FOLDCNT Position */\r
+#define DWT_FOLDCNT_FOLDCNT_Msk            (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/)     /*!< DWT FOLDCNT: FOLDCNT Mask */\r
+\r
+/* DWT Comparator Mask Register Definitions */\r
+#define DWT_MASK_MASK_Pos                   0U                                         /*!< DWT MASK: MASK Position */\r
+#define DWT_MASK_MASK_Msk                  (0x1FUL /*<< DWT_MASK_MASK_Pos*/)           /*!< DWT MASK: MASK Mask */\r
+\r
+/* DWT Comparator Function Register Definitions */\r
+#define DWT_FUNCTION_MATCHED_Pos           24U                                         /*!< DWT FUNCTION: MATCHED Position */\r
+#define DWT_FUNCTION_MATCHED_Msk           (0x1UL << DWT_FUNCTION_MATCHED_Pos)         /*!< DWT FUNCTION: MATCHED Mask */\r
+\r
+#define DWT_FUNCTION_DATAVADDR1_Pos        16U                                         /*!< DWT FUNCTION: DATAVADDR1 Position */\r
+#define DWT_FUNCTION_DATAVADDR1_Msk        (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos)      /*!< DWT FUNCTION: DATAVADDR1 Mask */\r
+\r
+#define DWT_FUNCTION_DATAVADDR0_Pos        12U                                         /*!< DWT FUNCTION: DATAVADDR0 Position */\r
+#define DWT_FUNCTION_DATAVADDR0_Msk        (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos)      /*!< DWT FUNCTION: DATAVADDR0 Mask */\r
+\r
+#define DWT_FUNCTION_DATAVSIZE_Pos         10U                                         /*!< DWT FUNCTION: DATAVSIZE Position */\r
+#define DWT_FUNCTION_DATAVSIZE_Msk         (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos)       /*!< DWT FUNCTION: DATAVSIZE Mask */\r
+\r
+#define DWT_FUNCTION_LNK1ENA_Pos            9U                                         /*!< DWT FUNCTION: LNK1ENA Position */\r
+#define DWT_FUNCTION_LNK1ENA_Msk           (0x1UL << DWT_FUNCTION_LNK1ENA_Pos)         /*!< DWT FUNCTION: LNK1ENA Mask */\r
+\r
+#define DWT_FUNCTION_DATAVMATCH_Pos         8U                                         /*!< DWT FUNCTION: DATAVMATCH Position */\r
+#define DWT_FUNCTION_DATAVMATCH_Msk        (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos)      /*!< DWT FUNCTION: DATAVMATCH Mask */\r
+\r
+#define DWT_FUNCTION_CYCMATCH_Pos           7U                                         /*!< DWT FUNCTION: CYCMATCH Position */\r
+#define DWT_FUNCTION_CYCMATCH_Msk          (0x1UL << DWT_FUNCTION_CYCMATCH_Pos)        /*!< DWT FUNCTION: CYCMATCH Mask */\r
+\r
+#define DWT_FUNCTION_EMITRANGE_Pos          5U                                         /*!< DWT FUNCTION: EMITRANGE Position */\r
+#define DWT_FUNCTION_EMITRANGE_Msk         (0x1UL << DWT_FUNCTION_EMITRANGE_Pos)       /*!< DWT FUNCTION: EMITRANGE Mask */\r
+\r
+#define DWT_FUNCTION_FUNCTION_Pos           0U                                         /*!< DWT FUNCTION: FUNCTION Position */\r
+#define DWT_FUNCTION_FUNCTION_Msk          (0xFUL /*<< DWT_FUNCTION_FUNCTION_Pos*/)    /*!< DWT FUNCTION: FUNCTION Mask */\r
+\r
+/*@}*/ /* end of group CMSIS_DWT */\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_TPI     Trace Port Interface (TPI)\r
+  \brief    Type definitions for the Trace Port Interface (TPI)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Trace Port Interface Register (TPI).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t SSPSR;                  /*!< Offset: 0x000 (R/ )  Supported Parallel Port Size Register */\r
+  __IOM uint32_t CSPSR;                  /*!< Offset: 0x004 (R/W)  Current Parallel Port Size Register */\r
+        uint32_t RESERVED0[2U];\r
+  __IOM uint32_t ACPR;                   /*!< Offset: 0x010 (R/W)  Asynchronous Clock Prescaler Register */\r
+        uint32_t RESERVED1[55U];\r
+  __IOM uint32_t SPPR;                   /*!< Offset: 0x0F0 (R/W)  Selected Pin Protocol Register */\r
+        uint32_t RESERVED2[131U];\r
+  __IM  uint32_t FFSR;                   /*!< Offset: 0x300 (R/ )  Formatter and Flush Status Register */\r
+  __IOM uint32_t FFCR;                   /*!< Offset: 0x304 (R/W)  Formatter and Flush Control Register */\r
+  __IM  uint32_t FSCR;                   /*!< Offset: 0x308 (R/ )  Formatter Synchronization Counter Register */\r
+        uint32_t RESERVED3[759U];\r
+  __IM  uint32_t TRIGGER;                /*!< Offset: 0xEE8 (R/ )  TRIGGER Register */\r
+  __IM  uint32_t FIFO0;                  /*!< Offset: 0xEEC (R/ )  Integration ETM Data */\r
+  __IM  uint32_t ITATBCTR2;              /*!< Offset: 0xEF0 (R/ )  ITATBCTR2 */\r
+        uint32_t RESERVED4[1U];\r
+  __IM  uint32_t ITATBCTR0;              /*!< Offset: 0xEF8 (R/ )  ITATBCTR0 */\r
+  __IM  uint32_t FIFO1;                  /*!< Offset: 0xEFC (R/ )  Integration ITM Data */\r
+  __IOM uint32_t ITCTRL;                 /*!< Offset: 0xF00 (R/W)  Integration Mode Control */\r
+        uint32_t RESERVED5[39U];\r
+  __IOM uint32_t CLAIMSET;               /*!< Offset: 0xFA0 (R/W)  Claim tag set */\r
+  __IOM uint32_t CLAIMCLR;               /*!< Offset: 0xFA4 (R/W)  Claim tag clear */\r
+        uint32_t RESERVED7[8U];\r
+  __IM  uint32_t DEVID;                  /*!< Offset: 0xFC8 (R/ )  TPIU_DEVID */\r
+  __IM  uint32_t DEVTYPE;                /*!< Offset: 0xFCC (R/ )  TPIU_DEVTYPE */\r
+} TPI_Type;\r
+\r
+/* TPI Asynchronous Clock Prescaler Register Definitions */\r
+#define TPI_ACPR_PRESCALER_Pos              0U                                         /*!< TPI ACPR: PRESCALER Position */\r
+#define TPI_ACPR_PRESCALER_Msk             (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/)    /*!< TPI ACPR: PRESCALER Mask */\r
+\r
+/* TPI Selected Pin Protocol Register Definitions */\r
+#define TPI_SPPR_TXMODE_Pos                 0U                                         /*!< TPI SPPR: TXMODE Position */\r
+#define TPI_SPPR_TXMODE_Msk                (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/)          /*!< TPI SPPR: TXMODE Mask */\r
+\r
+/* TPI Formatter and Flush Status Register Definitions */\r
+#define TPI_FFSR_FtNonStop_Pos              3U                                         /*!< TPI FFSR: FtNonStop Position */\r
+#define TPI_FFSR_FtNonStop_Msk             (0x1UL << TPI_FFSR_FtNonStop_Pos)           /*!< TPI FFSR: FtNonStop Mask */\r
+\r
+#define TPI_FFSR_TCPresent_Pos              2U                                         /*!< TPI FFSR: TCPresent Position */\r
+#define TPI_FFSR_TCPresent_Msk             (0x1UL << TPI_FFSR_TCPresent_Pos)           /*!< TPI FFSR: TCPresent Mask */\r
+\r
+#define TPI_FFSR_FtStopped_Pos              1U                                         /*!< TPI FFSR: FtStopped Position */\r
+#define TPI_FFSR_FtStopped_Msk             (0x1UL << TPI_FFSR_FtStopped_Pos)           /*!< TPI FFSR: FtStopped Mask */\r
+\r
+#define TPI_FFSR_FlInProg_Pos               0U                                         /*!< TPI FFSR: FlInProg Position */\r
+#define TPI_FFSR_FlInProg_Msk              (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/)        /*!< TPI FFSR: FlInProg Mask */\r
+\r
+/* TPI Formatter and Flush Control Register Definitions */\r
+#define TPI_FFCR_TrigIn_Pos                 8U                                         /*!< TPI FFCR: TrigIn Position */\r
+#define TPI_FFCR_TrigIn_Msk                (0x1UL << TPI_FFCR_TrigIn_Pos)              /*!< TPI FFCR: TrigIn Mask */\r
+\r
+#define TPI_FFCR_EnFCont_Pos                1U                                         /*!< TPI FFCR: EnFCont Position */\r
+#define TPI_FFCR_EnFCont_Msk               (0x1UL << TPI_FFCR_EnFCont_Pos)             /*!< TPI FFCR: EnFCont Mask */\r
+\r
+/* TPI TRIGGER Register Definitions */\r
+#define TPI_TRIGGER_TRIGGER_Pos             0U                                         /*!< TPI TRIGGER: TRIGGER Position */\r
+#define TPI_TRIGGER_TRIGGER_Msk            (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/)      /*!< TPI TRIGGER: TRIGGER Mask */\r
+\r
+/* TPI Integration ETM Data Register Definitions (FIFO0) */\r
+#define TPI_FIFO0_ITM_ATVALID_Pos          29U                                         /*!< TPI FIFO0: ITM_ATVALID Position */\r
+#define TPI_FIFO0_ITM_ATVALID_Msk          (0x3UL << TPI_FIFO0_ITM_ATVALID_Pos)        /*!< TPI FIFO0: ITM_ATVALID Mask */\r
+\r
+#define TPI_FIFO0_ITM_bytecount_Pos        27U                                         /*!< TPI FIFO0: ITM_bytecount Position */\r
+#define TPI_FIFO0_ITM_bytecount_Msk        (0x3UL << TPI_FIFO0_ITM_bytecount_Pos)      /*!< TPI FIFO0: ITM_bytecount Mask */\r
+\r
+#define TPI_FIFO0_ETM_ATVALID_Pos          26U                                         /*!< TPI FIFO0: ETM_ATVALID Position */\r
+#define TPI_FIFO0_ETM_ATVALID_Msk          (0x3UL << TPI_FIFO0_ETM_ATVALID_Pos)        /*!< TPI FIFO0: ETM_ATVALID Mask */\r
+\r
+#define TPI_FIFO0_ETM_bytecount_Pos        24U                                         /*!< TPI FIFO0: ETM_bytecount Position */\r
+#define TPI_FIFO0_ETM_bytecount_Msk        (0x3UL << TPI_FIFO0_ETM_bytecount_Pos)      /*!< TPI FIFO0: ETM_bytecount Mask */\r
+\r
+#define TPI_FIFO0_ETM2_Pos                 16U                                         /*!< TPI FIFO0: ETM2 Position */\r
+#define TPI_FIFO0_ETM2_Msk                 (0xFFUL << TPI_FIFO0_ETM2_Pos)              /*!< TPI FIFO0: ETM2 Mask */\r
+\r
+#define TPI_FIFO0_ETM1_Pos                  8U                                         /*!< TPI FIFO0: ETM1 Position */\r
+#define TPI_FIFO0_ETM1_Msk                 (0xFFUL << TPI_FIFO0_ETM1_Pos)              /*!< TPI FIFO0: ETM1 Mask */\r
+\r
+#define TPI_FIFO0_ETM0_Pos                  0U                                         /*!< TPI FIFO0: ETM0 Position */\r
+#define TPI_FIFO0_ETM0_Msk                 (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/)          /*!< TPI FIFO0: ETM0 Mask */\r
+\r
+/* TPI ITATBCTR2 Register Definitions */\r
+#define TPI_ITATBCTR2_ATREADY2_Pos          0U                                         /*!< TPI ITATBCTR2: ATREADY2 Position */\r
+#define TPI_ITATBCTR2_ATREADY2_Msk         (0x1UL /*<< TPI_ITATBCTR2_ATREADY2_Pos*/)   /*!< TPI ITATBCTR2: ATREADY2 Mask */\r
+\r
+#define TPI_ITATBCTR2_ATREADY1_Pos          0U                                         /*!< TPI ITATBCTR2: ATREADY1 Position */\r
+#define TPI_ITATBCTR2_ATREADY1_Msk         (0x1UL /*<< TPI_ITATBCTR2_ATREADY1_Pos*/)   /*!< TPI ITATBCTR2: ATREADY1 Mask */\r
+\r
+/* TPI Integration ITM Data Register Definitions (FIFO1) */\r
+#define TPI_FIFO1_ITM_ATVALID_Pos          29U                                         /*!< TPI FIFO1: ITM_ATVALID Position */\r
+#define TPI_FIFO1_ITM_ATVALID_Msk          (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos)        /*!< TPI FIFO1: ITM_ATVALID Mask */\r
+\r
+#define TPI_FIFO1_ITM_bytecount_Pos        27U                                         /*!< TPI FIFO1: ITM_bytecount Position */\r
+#define TPI_FIFO1_ITM_bytecount_Msk        (0x3UL << TPI_FIFO1_ITM_bytecount_Pos)      /*!< TPI FIFO1: ITM_bytecount Mask */\r
+\r
+#define TPI_FIFO1_ETM_ATVALID_Pos          26U                                         /*!< TPI FIFO1: ETM_ATVALID Position */\r
+#define TPI_FIFO1_ETM_ATVALID_Msk          (0x3UL << TPI_FIFO1_ETM_ATVALID_Pos)        /*!< TPI FIFO1: ETM_ATVALID Mask */\r
+\r
+#define TPI_FIFO1_ETM_bytecount_Pos        24U                                         /*!< TPI FIFO1: ETM_bytecount Position */\r
+#define TPI_FIFO1_ETM_bytecount_Msk        (0x3UL << TPI_FIFO1_ETM_bytecount_Pos)      /*!< TPI FIFO1: ETM_bytecount Mask */\r
+\r
+#define TPI_FIFO1_ITM2_Pos                 16U                                         /*!< TPI FIFO1: ITM2 Position */\r
+#define TPI_FIFO1_ITM2_Msk                 (0xFFUL << TPI_FIFO1_ITM2_Pos)              /*!< TPI FIFO1: ITM2 Mask */\r
+\r
+#define TPI_FIFO1_ITM1_Pos                  8U                                         /*!< TPI FIFO1: ITM1 Position */\r
+#define TPI_FIFO1_ITM1_Msk                 (0xFFUL << TPI_FIFO1_ITM1_Pos)              /*!< TPI FIFO1: ITM1 Mask */\r
+\r
+#define TPI_FIFO1_ITM0_Pos                  0U                                         /*!< TPI FIFO1: ITM0 Position */\r
+#define TPI_FIFO1_ITM0_Msk                 (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/)          /*!< TPI FIFO1: ITM0 Mask */\r
+\r
+/* TPI ITATBCTR0 Register Definitions */\r
+#define TPI_ITATBCTR0_ATREADY2_Pos          0U                                         /*!< TPI ITATBCTR0: ATREADY2 Position */\r
+#define TPI_ITATBCTR0_ATREADY2_Msk         (0x1UL /*<< TPI_ITATBCTR0_ATREADY2_Pos*/)   /*!< TPI ITATBCTR0: ATREADY2 Mask */\r
+\r
+#define TPI_ITATBCTR0_ATREADY1_Pos          0U                                         /*!< TPI ITATBCTR0: ATREADY1 Position */\r
+#define TPI_ITATBCTR0_ATREADY1_Msk         (0x1UL /*<< TPI_ITATBCTR0_ATREADY1_Pos*/)   /*!< TPI ITATBCTR0: ATREADY1 Mask */\r
+\r
+/* TPI Integration Mode Control Register Definitions */\r
+#define TPI_ITCTRL_Mode_Pos                 0U                                         /*!< TPI ITCTRL: Mode Position */\r
+#define TPI_ITCTRL_Mode_Msk                (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/)          /*!< TPI ITCTRL: Mode Mask */\r
+\r
+/* TPI DEVID Register Definitions */\r
+#define TPI_DEVID_NRZVALID_Pos             11U                                         /*!< TPI DEVID: NRZVALID Position */\r
+#define TPI_DEVID_NRZVALID_Msk             (0x1UL << TPI_DEVID_NRZVALID_Pos)           /*!< TPI DEVID: NRZVALID Mask */\r
+\r
+#define TPI_DEVID_MANCVALID_Pos            10U                                         /*!< TPI DEVID: MANCVALID Position */\r
+#define TPI_DEVID_MANCVALID_Msk            (0x1UL << TPI_DEVID_MANCVALID_Pos)          /*!< TPI DEVID: MANCVALID Mask */\r
+\r
+#define TPI_DEVID_PTINVALID_Pos             9U                                         /*!< TPI DEVID: PTINVALID Position */\r
+#define TPI_DEVID_PTINVALID_Msk            (0x1UL << TPI_DEVID_PTINVALID_Pos)          /*!< TPI DEVID: PTINVALID Mask */\r
+\r
+#define TPI_DEVID_MinBufSz_Pos              6U                                         /*!< TPI DEVID: MinBufSz Position */\r
+#define TPI_DEVID_MinBufSz_Msk             (0x7UL << TPI_DEVID_MinBufSz_Pos)           /*!< TPI DEVID: MinBufSz Mask */\r
+\r
+#define TPI_DEVID_AsynClkIn_Pos             5U                                         /*!< TPI DEVID: AsynClkIn Position */\r
+#define TPI_DEVID_AsynClkIn_Msk            (0x1UL << TPI_DEVID_AsynClkIn_Pos)          /*!< TPI DEVID: AsynClkIn Mask */\r
+\r
+#define TPI_DEVID_NrTraceInput_Pos          0U                                         /*!< TPI DEVID: NrTraceInput Position */\r
+#define TPI_DEVID_NrTraceInput_Msk         (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/)  /*!< TPI DEVID: NrTraceInput Mask */\r
+\r
+/* TPI DEVTYPE Register Definitions */\r
+#define TPI_DEVTYPE_SubType_Pos             4U                                         /*!< TPI DEVTYPE: SubType Position */\r
+#define TPI_DEVTYPE_SubType_Msk            (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/)      /*!< TPI DEVTYPE: SubType Mask */\r
+\r
+#define TPI_DEVTYPE_MajorType_Pos           0U                                         /*!< TPI DEVTYPE: MajorType Position */\r
+#define TPI_DEVTYPE_MajorType_Msk          (0xFUL << TPI_DEVTYPE_MajorType_Pos)        /*!< TPI DEVTYPE: MajorType Mask */\r
+\r
+/*@}*/ /* end of group CMSIS_TPI */\r
+\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_MPU     Memory Protection Unit (MPU)\r
+  \brief    Type definitions for the Memory Protection Unit (MPU)\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Memory Protection Unit (MPU).\r
+ */\r
+typedef struct\r
+{\r
+  __IM  uint32_t TYPE;                   /*!< Offset: 0x000 (R/ )  MPU Type Register */\r
+  __IOM uint32_t CTRL;                   /*!< Offset: 0x004 (R/W)  MPU Control Register */\r
+  __IOM uint32_t RNR;                    /*!< Offset: 0x008 (R/W)  MPU Region RNRber Register */\r
+  __IOM uint32_t RBAR;                   /*!< Offset: 0x00C (R/W)  MPU Region Base Address Register */\r
+  __IOM uint32_t RASR;                   /*!< Offset: 0x010 (R/W)  MPU Region Attribute and Size Register */\r
+  __IOM uint32_t RBAR_A1;                /*!< Offset: 0x014 (R/W)  MPU Alias 1 Region Base Address Register */\r
+  __IOM uint32_t RASR_A1;                /*!< Offset: 0x018 (R/W)  MPU Alias 1 Region Attribute and Size Register */\r
+  __IOM uint32_t RBAR_A2;                /*!< Offset: 0x01C (R/W)  MPU Alias 2 Region Base Address Register */\r
+  __IOM uint32_t RASR_A2;                /*!< Offset: 0x020 (R/W)  MPU Alias 2 Region Attribute and Size Register */\r
+  __IOM uint32_t RBAR_A3;                /*!< Offset: 0x024 (R/W)  MPU Alias 3 Region Base Address Register */\r
+  __IOM uint32_t RASR_A3;                /*!< Offset: 0x028 (R/W)  MPU Alias 3 Region Attribute and Size Register */\r
+} MPU_Type;\r
+\r
+/* MPU Type Register Definitions */\r
+#define MPU_TYPE_IREGION_Pos               16U                                            /*!< MPU TYPE: IREGION Position */\r
+#define MPU_TYPE_IREGION_Msk               (0xFFUL << MPU_TYPE_IREGION_Pos)               /*!< MPU TYPE: IREGION Mask */\r
+\r
+#define MPU_TYPE_DREGION_Pos                8U                                            /*!< MPU TYPE: DREGION Position */\r
+#define MPU_TYPE_DREGION_Msk               (0xFFUL << MPU_TYPE_DREGION_Pos)               /*!< MPU TYPE: DREGION Mask */\r
+\r
+#define MPU_TYPE_SEPARATE_Pos               0U                                            /*!< MPU TYPE: SEPARATE Position */\r
+#define MPU_TYPE_SEPARATE_Msk              (1UL /*<< MPU_TYPE_SEPARATE_Pos*/)             /*!< MPU TYPE: SEPARATE Mask */\r
+\r
+/* MPU Control Register Definitions */\r
+#define MPU_CTRL_PRIVDEFENA_Pos             2U                                            /*!< MPU CTRL: PRIVDEFENA Position */\r
+#define MPU_CTRL_PRIVDEFENA_Msk            (1UL << MPU_CTRL_PRIVDEFENA_Pos)               /*!< MPU CTRL: PRIVDEFENA Mask */\r
+\r
+#define MPU_CTRL_HFNMIENA_Pos               1U                                            /*!< MPU CTRL: HFNMIENA Position */\r
+#define MPU_CTRL_HFNMIENA_Msk              (1UL << MPU_CTRL_HFNMIENA_Pos)                 /*!< MPU CTRL: HFNMIENA Mask */\r
+\r
+#define MPU_CTRL_ENABLE_Pos                 0U                                            /*!< MPU CTRL: ENABLE Position */\r
+#define MPU_CTRL_ENABLE_Msk                (1UL /*<< MPU_CTRL_ENABLE_Pos*/)               /*!< MPU CTRL: ENABLE Mask */\r
+\r
+/* MPU Region Number Register Definitions */\r
+#define MPU_RNR_REGION_Pos                  0U                                            /*!< MPU RNR: REGION Position */\r
+#define MPU_RNR_REGION_Msk                 (0xFFUL /*<< MPU_RNR_REGION_Pos*/)             /*!< MPU RNR: REGION Mask */\r
+\r
+/* MPU Region Base Address Register Definitions */\r
+#define MPU_RBAR_ADDR_Pos                   5U                                            /*!< MPU RBAR: ADDR Position */\r
+#define MPU_RBAR_ADDR_Msk                  (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos)             /*!< MPU RBAR: ADDR Mask */\r
+\r
+#define MPU_RBAR_VALID_Pos                  4U                                            /*!< MPU RBAR: VALID Position */\r
+#define MPU_RBAR_VALID_Msk                 (1UL << MPU_RBAR_VALID_Pos)                    /*!< MPU RBAR: VALID Mask */\r
+\r
+#define MPU_RBAR_REGION_Pos                 0U                                            /*!< MPU RBAR: REGION Position */\r
+#define MPU_RBAR_REGION_Msk                (0xFUL /*<< MPU_RBAR_REGION_Pos*/)             /*!< MPU RBAR: REGION Mask */\r
+\r
+/* MPU Region Attribute and Size Register Definitions */\r
+#define MPU_RASR_ATTRS_Pos                 16U                                            /*!< MPU RASR: MPU Region Attribute field Position */\r
+#define MPU_RASR_ATTRS_Msk                 (0xFFFFUL << MPU_RASR_ATTRS_Pos)               /*!< MPU RASR: MPU Region Attribute field Mask */\r
+\r
+#define MPU_RASR_XN_Pos                    28U                                            /*!< MPU RASR: ATTRS.XN Position */\r
+#define MPU_RASR_XN_Msk                    (1UL << MPU_RASR_XN_Pos)                       /*!< MPU RASR: ATTRS.XN Mask */\r
+\r
+#define MPU_RASR_AP_Pos                    24U                                            /*!< MPU RASR: ATTRS.AP Position */\r
+#define MPU_RASR_AP_Msk                    (0x7UL << MPU_RASR_AP_Pos)                     /*!< MPU RASR: ATTRS.AP Mask */\r
+\r
+#define MPU_RASR_TEX_Pos                   19U                                            /*!< MPU RASR: ATTRS.TEX Position */\r
+#define MPU_RASR_TEX_Msk                   (0x7UL << MPU_RASR_TEX_Pos)                    /*!< MPU RASR: ATTRS.TEX Mask */\r
+\r
+#define MPU_RASR_S_Pos                     18U                                            /*!< MPU RASR: ATTRS.S Position */\r
+#define MPU_RASR_S_Msk                     (1UL << MPU_RASR_S_Pos)                        /*!< MPU RASR: ATTRS.S Mask */\r
+\r
+#define MPU_RASR_C_Pos                     17U                                            /*!< MPU RASR: ATTRS.C Position */\r
+#define MPU_RASR_C_Msk                     (1UL << MPU_RASR_C_Pos)                        /*!< MPU RASR: ATTRS.C Mask */\r
+\r
+#define MPU_RASR_B_Pos                     16U                                            /*!< MPU RASR: ATTRS.B Position */\r
+#define MPU_RASR_B_Msk                     (1UL << MPU_RASR_B_Pos)                        /*!< MPU RASR: ATTRS.B Mask */\r
+\r
+#define MPU_RASR_SRD_Pos                    8U                                            /*!< MPU RASR: Sub-Region Disable Position */\r
+#define MPU_RASR_SRD_Msk                   (0xFFUL << MPU_RASR_SRD_Pos)                   /*!< MPU RASR: Sub-Region Disable Mask */\r
+\r
+#define MPU_RASR_SIZE_Pos                   1U                                            /*!< MPU RASR: Region Size Field Position */\r
+#define MPU_RASR_SIZE_Msk                  (0x1FUL << MPU_RASR_SIZE_Pos)                  /*!< MPU RASR: Region Size Field Mask */\r
+\r
+#define MPU_RASR_ENABLE_Pos                 0U                                            /*!< MPU RASR: Region enable bit Position */\r
+#define MPU_RASR_ENABLE_Msk                (1UL /*<< MPU_RASR_ENABLE_Pos*/)               /*!< MPU RASR: Region enable bit Disable Mask */\r
+\r
+/*@} end of group CMSIS_MPU */\r
+#endif\r
+\r
+\r
+/**\r
+  \ingroup  CMSIS_core_register\r
+  \defgroup CMSIS_CoreDebug       Core Debug Registers (CoreDebug)\r
+  \brief    Type definitions for the Core Debug Registers\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief  Structure type to access the Core Debug Register (CoreDebug).\r
+ */\r
+typedef struct\r
+{\r
+  __IOM uint32_t DHCSR;                  /*!< Offset: 0x000 (R/W)  Debug Halting Control and Status Register */\r
+  __OM  uint32_t DCRSR;                  /*!< Offset: 0x004 ( /W)  Debug Core Register Selector Register */\r
+  __IOM uint32_t DCRDR;                  /*!< Offset: 0x008 (R/W)  Debug Core Register Data Register */\r
+  __IOM uint32_t DEMCR;                  /*!< Offset: 0x00C (R/W)  Debug Exception and Monitor Control Register */\r
+} CoreDebug_Type;\r
+\r
+/* Debug Halting Control and Status Register Definitions */\r
+#define CoreDebug_DHCSR_DBGKEY_Pos         16U                                            /*!< CoreDebug DHCSR: DBGKEY Position */\r
+#define CoreDebug_DHCSR_DBGKEY_Msk         (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos)       /*!< CoreDebug DHCSR: DBGKEY Mask */\r
+\r
+#define CoreDebug_DHCSR_S_RESET_ST_Pos     25U                                            /*!< CoreDebug DHCSR: S_RESET_ST Position */\r
+#define CoreDebug_DHCSR_S_RESET_ST_Msk     (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos)        /*!< CoreDebug DHCSR: S_RESET_ST Mask */\r
+\r
+#define CoreDebug_DHCSR_S_RETIRE_ST_Pos    24U                                            /*!< CoreDebug DHCSR: S_RETIRE_ST Position */\r
+#define CoreDebug_DHCSR_S_RETIRE_ST_Msk    (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos)       /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */\r
+\r
+#define CoreDebug_DHCSR_S_LOCKUP_Pos       19U                                            /*!< CoreDebug DHCSR: S_LOCKUP Position */\r
+#define CoreDebug_DHCSR_S_LOCKUP_Msk       (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos)          /*!< CoreDebug DHCSR: S_LOCKUP Mask */\r
+\r
+#define CoreDebug_DHCSR_S_SLEEP_Pos        18U                                            /*!< CoreDebug DHCSR: S_SLEEP Position */\r
+#define CoreDebug_DHCSR_S_SLEEP_Msk        (1UL << CoreDebug_DHCSR_S_SLEEP_Pos)           /*!< CoreDebug DHCSR: S_SLEEP Mask */\r
+\r
+#define CoreDebug_DHCSR_S_HALT_Pos         17U                                            /*!< CoreDebug DHCSR: S_HALT Position */\r
+#define CoreDebug_DHCSR_S_HALT_Msk         (1UL << CoreDebug_DHCSR_S_HALT_Pos)            /*!< CoreDebug DHCSR: S_HALT Mask */\r
+\r
+#define CoreDebug_DHCSR_S_REGRDY_Pos       16U                                            /*!< CoreDebug DHCSR: S_REGRDY Position */\r
+#define CoreDebug_DHCSR_S_REGRDY_Msk       (1UL << CoreDebug_DHCSR_S_REGRDY_Pos)          /*!< CoreDebug DHCSR: S_REGRDY Mask */\r
+\r
+#define CoreDebug_DHCSR_C_SNAPSTALL_Pos     5U                                            /*!< CoreDebug DHCSR: C_SNAPSTALL Position */\r
+#define CoreDebug_DHCSR_C_SNAPSTALL_Msk    (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos)       /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */\r
+\r
+#define CoreDebug_DHCSR_C_MASKINTS_Pos      3U                                            /*!< CoreDebug DHCSR: C_MASKINTS Position */\r
+#define CoreDebug_DHCSR_C_MASKINTS_Msk     (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos)        /*!< CoreDebug DHCSR: C_MASKINTS Mask */\r
+\r
+#define CoreDebug_DHCSR_C_STEP_Pos          2U                                            /*!< CoreDebug DHCSR: C_STEP Position */\r
+#define CoreDebug_DHCSR_C_STEP_Msk         (1UL << CoreDebug_DHCSR_C_STEP_Pos)            /*!< CoreDebug DHCSR: C_STEP Mask */\r
+\r
+#define CoreDebug_DHCSR_C_HALT_Pos          1U                                            /*!< CoreDebug DHCSR: C_HALT Position */\r
+#define CoreDebug_DHCSR_C_HALT_Msk         (1UL << CoreDebug_DHCSR_C_HALT_Pos)            /*!< CoreDebug DHCSR: C_HALT Mask */\r
+\r
+#define CoreDebug_DHCSR_C_DEBUGEN_Pos       0U                                            /*!< CoreDebug DHCSR: C_DEBUGEN Position */\r
+#define CoreDebug_DHCSR_C_DEBUGEN_Msk      (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/)     /*!< CoreDebug DHCSR: C_DEBUGEN Mask */\r
+\r
+/* Debug Core Register Selector Register Definitions */\r
+#define CoreDebug_DCRSR_REGWnR_Pos         16U                                            /*!< CoreDebug DCRSR: REGWnR Position */\r
+#define CoreDebug_DCRSR_REGWnR_Msk         (1UL << CoreDebug_DCRSR_REGWnR_Pos)            /*!< CoreDebug DCRSR: REGWnR Mask */\r
+\r
+#define CoreDebug_DCRSR_REGSEL_Pos          0U                                            /*!< CoreDebug DCRSR: REGSEL Position */\r
+#define CoreDebug_DCRSR_REGSEL_Msk         (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/)     /*!< CoreDebug DCRSR: REGSEL Mask */\r
+\r
+/* Debug Exception and Monitor Control Register Definitions */\r
+#define CoreDebug_DEMCR_TRCENA_Pos         24U                                            /*!< CoreDebug DEMCR: TRCENA Position */\r
+#define CoreDebug_DEMCR_TRCENA_Msk         (1UL << CoreDebug_DEMCR_TRCENA_Pos)            /*!< CoreDebug DEMCR: TRCENA Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_REQ_Pos        19U                                            /*!< CoreDebug DEMCR: MON_REQ Position */\r
+#define CoreDebug_DEMCR_MON_REQ_Msk        (1UL << CoreDebug_DEMCR_MON_REQ_Pos)           /*!< CoreDebug DEMCR: MON_REQ Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_STEP_Pos       18U                                            /*!< CoreDebug DEMCR: MON_STEP Position */\r
+#define CoreDebug_DEMCR_MON_STEP_Msk       (1UL << CoreDebug_DEMCR_MON_STEP_Pos)          /*!< CoreDebug DEMCR: MON_STEP Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_PEND_Pos       17U                                            /*!< CoreDebug DEMCR: MON_PEND Position */\r
+#define CoreDebug_DEMCR_MON_PEND_Msk       (1UL << CoreDebug_DEMCR_MON_PEND_Pos)          /*!< CoreDebug DEMCR: MON_PEND Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_EN_Pos         16U                                            /*!< CoreDebug DEMCR: MON_EN Position */\r
+#define CoreDebug_DEMCR_MON_EN_Msk         (1UL << CoreDebug_DEMCR_MON_EN_Pos)            /*!< CoreDebug DEMCR: MON_EN Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_HARDERR_Pos     10U                                            /*!< CoreDebug DEMCR: VC_HARDERR Position */\r
+#define CoreDebug_DEMCR_VC_HARDERR_Msk     (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos)        /*!< CoreDebug DEMCR: VC_HARDERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_INTERR_Pos       9U                                            /*!< CoreDebug DEMCR: VC_INTERR Position */\r
+#define CoreDebug_DEMCR_VC_INTERR_Msk      (1UL << CoreDebug_DEMCR_VC_INTERR_Pos)         /*!< CoreDebug DEMCR: VC_INTERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_BUSERR_Pos       8U                                            /*!< CoreDebug DEMCR: VC_BUSERR Position */\r
+#define CoreDebug_DEMCR_VC_BUSERR_Msk      (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos)         /*!< CoreDebug DEMCR: VC_BUSERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_STATERR_Pos      7U                                            /*!< CoreDebug DEMCR: VC_STATERR Position */\r
+#define CoreDebug_DEMCR_VC_STATERR_Msk     (1UL << CoreDebug_DEMCR_VC_STATERR_Pos)        /*!< CoreDebug DEMCR: VC_STATERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_CHKERR_Pos       6U                                            /*!< CoreDebug DEMCR: VC_CHKERR Position */\r
+#define CoreDebug_DEMCR_VC_CHKERR_Msk      (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos)         /*!< CoreDebug DEMCR: VC_CHKERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_NOCPERR_Pos      5U                                            /*!< CoreDebug DEMCR: VC_NOCPERR Position */\r
+#define CoreDebug_DEMCR_VC_NOCPERR_Msk     (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos)        /*!< CoreDebug DEMCR: VC_NOCPERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_MMERR_Pos        4U                                            /*!< CoreDebug DEMCR: VC_MMERR Position */\r
+#define CoreDebug_DEMCR_VC_MMERR_Msk       (1UL << CoreDebug_DEMCR_VC_MMERR_Pos)          /*!< CoreDebug DEMCR: VC_MMERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_CORERESET_Pos    0U                                            /*!< CoreDebug DEMCR: VC_CORERESET Position */\r
+#define CoreDebug_DEMCR_VC_CORERESET_Msk   (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/)  /*!< CoreDebug DEMCR: VC_CORERESET Mask */\r
+\r
+/*@} end of group CMSIS_CoreDebug */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_bitfield     Core register bit field macros\r
+  \brief      Macros for use with bit field definitions (xxx_Pos, xxx_Msk).\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   Mask and shift a bit field value for use in a register bit range.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of the bit field. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted value.\r
+*/\r
+#define _VAL2FLD(field, value)    (((uint32_t)(value) << field ## _Pos) & field ## _Msk)\r
+\r
+/**\r
+  \brief     Mask and shift a register value to extract a bit filed value.\r
+  \param[in] field  Name of the register bit field.\r
+  \param[in] value  Value of register. This parameter is interpreted as an uint32_t type.\r
+  \return           Masked and shifted bit field value.\r
+*/\r
+#define _FLD2VAL(field, value)    (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)\r
+\r
+/*@} end of group CMSIS_core_bitfield */\r
+\r
+\r
+/**\r
+  \ingroup    CMSIS_core_register\r
+  \defgroup   CMSIS_core_base     Core Definitions\r
+  \brief      Definitions for base addresses, unions, and structures.\r
+  @{\r
+ */\r
+\r
+/* Memory mapping of Core Hardware */\r
+#define SCS_BASE            (0xE000E000UL)                            /*!< System Control Space Base Address */\r
+#define ITM_BASE            (0xE0000000UL)                            /*!< ITM Base Address */\r
+#define DWT_BASE            (0xE0001000UL)                            /*!< DWT Base Address */\r
+#define TPI_BASE            (0xE0040000UL)                            /*!< TPI Base Address */\r
+#define CoreDebug_BASE      (0xE000EDF0UL)                            /*!< Core Debug Base Address */\r
+#define SysTick_BASE        (SCS_BASE +  0x0010UL)                    /*!< SysTick Base Address */\r
+#define NVIC_BASE           (SCS_BASE +  0x0100UL)                    /*!< NVIC Base Address */\r
+#define SCB_BASE            (SCS_BASE +  0x0D00UL)                    /*!< System Control Block Base Address */\r
+\r
+#define SCnSCB              ((SCnSCB_Type    *)     SCS_BASE      )   /*!< System control Register not in SCB */\r
+#define SCB                 ((SCB_Type       *)     SCB_BASE      )   /*!< SCB configuration struct */\r
+#define SysTick             ((SysTick_Type   *)     SysTick_BASE  )   /*!< SysTick configuration struct */\r
+#define NVIC                ((NVIC_Type      *)     NVIC_BASE     )   /*!< NVIC configuration struct */\r
+#define ITM                 ((ITM_Type       *)     ITM_BASE      )   /*!< ITM configuration struct */\r
+#define DWT                 ((DWT_Type       *)     DWT_BASE      )   /*!< DWT configuration struct */\r
+#define TPI                 ((TPI_Type       *)     TPI_BASE      )   /*!< TPI configuration struct */\r
+#define CoreDebug           ((CoreDebug_Type *)     CoreDebug_BASE)   /*!< Core Debug configuration struct */\r
+\r
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)\r
+  #define MPU_BASE          (SCS_BASE +  0x0D90UL)                    /*!< Memory Protection Unit */\r
+  #define MPU               ((MPU_Type       *)     MPU_BASE      )   /*!< Memory Protection Unit */\r
+#endif\r
+\r
+/*@} */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                Hardware Abstraction Layer\r
+  Core Function Interface contains:\r
+  - Core NVIC Functions\r
+  - Core SysTick Functions\r
+  - Core Debug Functions\r
+  - Core Register Access Functions\r
+ ******************************************************************************/\r
+/**\r
+  \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference\r
+*/\r
+\r
+\r
+\r
+/* ##########################   NVIC functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_NVICFunctions NVIC Functions\r
+  \brief    Functions that manage interrupts and exceptions via the NVIC.\r
+  @{\r
+ */\r
+\r
+#ifdef CMSIS_NVIC_VIRTUAL\r
+  #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+    #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"\r
+  #endif\r
+  #include CMSIS_NVIC_VIRTUAL_HEADER_FILE\r
+#else\r
+  #define NVIC_SetPriorityGrouping    __NVIC_SetPriorityGrouping\r
+  #define NVIC_GetPriorityGrouping    __NVIC_GetPriorityGrouping\r
+  #define NVIC_EnableIRQ              __NVIC_EnableIRQ\r
+  #define NVIC_GetEnableIRQ           __NVIC_GetEnableIRQ\r
+  #define NVIC_DisableIRQ             __NVIC_DisableIRQ\r
+  #define NVIC_GetPendingIRQ          __NVIC_GetPendingIRQ\r
+  #define NVIC_SetPendingIRQ          __NVIC_SetPendingIRQ\r
+  #define NVIC_ClearPendingIRQ        __NVIC_ClearPendingIRQ\r
+  #define NVIC_GetActive              __NVIC_GetActive\r
+  #define NVIC_SetPriority            __NVIC_SetPriority\r
+  #define NVIC_GetPriority            __NVIC_GetPriority\r
+  #define NVIC_SystemReset            __NVIC_SystemReset\r
+#endif /* CMSIS_NVIC_VIRTUAL */\r
+\r
+#ifdef CMSIS_VECTAB_VIRTUAL\r
+  #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+    #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"\r
+  #endif\r
+  #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE\r
+#else\r
+  #define NVIC_SetVector              __NVIC_SetVector\r
+  #define NVIC_GetVector              __NVIC_GetVector\r
+#endif  /* (CMSIS_VECTAB_VIRTUAL) */\r
+\r
+#define NVIC_USER_IRQ_OFFSET          16\r
+\r
+\r
+/* The following EXC_RETURN values are saved the LR on exception entry */\r
+#define EXC_RETURN_HANDLER         (0xFFFFFFF1UL)     /* return to Handler mode, uses MSP after return                               */\r
+#define EXC_RETURN_THREAD_MSP      (0xFFFFFFF9UL)     /* return to Thread mode, uses MSP after return                                */\r
+#define EXC_RETURN_THREAD_PSP      (0xFFFFFFFDUL)     /* return to Thread mode, uses PSP after return                                */\r
+\r
+\r
+\r
+/**\r
+  \brief   Set Priority Grouping\r
+  \details Sets the priority grouping field using the required unlock sequence.\r
+           The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field.\r
+           Only values from 0..7 are used.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.\r
+  \param [in]      PriorityGroup  Priority grouping field.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup)\r
+{\r
+  uint32_t reg_value;\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);             /* only values 0..7 are used          */\r
+\r
+  reg_value  =  SCB->AIRCR;                                                   /* read old register configuration    */\r
+  reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change               */\r
+  reg_value  =  (reg_value                                   |\r
+                ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |\r
+                (PriorityGroupTmp << 8U)                      );              /* Insert write key and priorty group */\r
+  SCB->AIRCR =  reg_value;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Priority Grouping\r
+  \details Reads the priority grouping field from the NVIC Interrupt Controller.\r
+  \return                Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field).\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void)\r
+{\r
+  return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos));\r
+}\r
+\r
+\r
+/**\r
+  \brief   Enable Interrupt\r
+  \details Enables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Enable status\r
+  \details Returns a device specific interrupt enable status from the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt is not enabled.\r
+  \return             1  Interrupt is enabled.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Disable Interrupt\r
+  \details Disables a device specific interrupt in the NVIC interrupt controller.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+    __DSB();\r
+    __ISB();\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Pending Interrupt\r
+  \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not pending.\r
+  \return             1  Interrupt status is pending.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Pending Interrupt\r
+  \details Sets the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Clear Pending Interrupt\r
+  \details Clears the pending bit of a device specific interrupt in the NVIC pending register.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Active Interrupt\r
+  \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt.\r
+  \param [in]      IRQn  Device specific interrupt number.\r
+  \return             0  Interrupt status is not active.\r
+  \return             1  Interrupt status is active.\r
+  \note    IRQn must not be negative.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));\r
+  }\r
+  else\r
+  {\r
+    return(0U);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Priority\r
+  \details Sets the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]      IRQn  Interrupt number.\r
+  \param [in]  priority  Priority to set.\r
+  \note    The priority cannot be set for every processor exception.\r
+ */\r
+__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)\r
+{\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    NVIC->IP[((uint32_t)IRQn)]               = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);\r
+  }\r
+  else\r
+  {\r
+    SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Priority\r
+  \details Reads the priority of a device specific interrupt or a processor exception.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn  Interrupt number.\r
+  \return             Interrupt Priority.\r
+                      Value is aligned automatically to the implemented priority bits of the microcontroller.\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)\r
+{\r
+\r
+  if ((int32_t)(IRQn) >= 0)\r
+  {\r
+    return(((uint32_t)NVIC->IP[((uint32_t)IRQn)]               >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+  else\r
+  {\r
+    return(((uint32_t)SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS)));\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  \brief   Encode Priority\r
+  \details Encodes the priority for an interrupt with the given priority group,\r
+           preemptive priority value, and subpriority value.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.\r
+  \param [in]     PriorityGroup  Used priority group.\r
+  \param [in]   PreemptPriority  Preemptive priority value (starting from 0).\r
+  \param [in]       SubPriority  Subpriority value (starting from 0).\r
+  \return                        Encoded priority. Value can be used in the function \ref NVIC_SetPriority().\r
+ */\r
+__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);\r
+  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));\r
+\r
+  return (\r
+           ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |\r
+           ((SubPriority     & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL)))\r
+         );\r
+}\r
+\r
+\r
+/**\r
+  \brief   Decode Priority\r
+  \details Decodes an interrupt priority value with a given priority group to\r
+           preemptive priority value and subpriority value.\r
+           In case of a conflict between priority grouping and available\r
+           priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.\r
+  \param [in]         Priority   Priority value, which can be retrieved with the function \ref NVIC_GetPriority().\r
+  \param [in]     PriorityGroup  Used priority group.\r
+  \param [out] pPreemptPriority  Preemptive priority value (starting from 0).\r
+  \param [out]     pSubPriority  Subpriority value (starting from 0).\r
+ */\r
+__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);\r
+  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));\r
+\r
+  *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);\r
+  *pSubPriority     = (Priority                   ) & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL);\r
+}\r
+\r
+\r
+/**\r
+  \brief   Set Interrupt Vector\r
+  \details Sets an interrupt vector in SRAM based interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+           VTOR must been relocated to SRAM before.\r
+  \param [in]   IRQn      Interrupt number\r
+  \param [in]   vector    Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)\r
+{\r
+  uint32_t *vectors = (uint32_t *)SCB->VTOR;\r
+  vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;\r
+}\r
+\r
+\r
+/**\r
+  \brief   Get Interrupt Vector\r
+  \details Reads an interrupt vector from interrupt vector table.\r
+           The interrupt number can be positive to specify a device specific interrupt,\r
+           or negative to specify a processor exception.\r
+  \param [in]   IRQn      Interrupt number.\r
+  \return                 Address of interrupt handler function\r
+ */\r
+__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)\r
+{\r
+  uint32_t *vectors = (uint32_t *)SCB->VTOR;\r
+  return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];\r
+}\r
+\r
+\r
+/**\r
+  \brief   System Reset\r
+  \details Initiates a system reset request to reset the MCU.\r
+ */\r
+__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)\r
+{\r
+  __DSB();                                                          /* Ensure all outstanding memory accesses included\r
+                                                                       buffered write are completed before reset */\r
+  SCB->AIRCR  = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos)    |\r
+                           (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |\r
+                            SCB_AIRCR_SYSRESETREQ_Msk    );         /* Keep priority group unchanged */\r
+  __DSB();                                                          /* Ensure completion of memory access */\r
+\r
+  for(;;)                                                           /* wait until reset */\r
+  {\r
+    __NOP();\r
+  }\r
+}\r
+\r
+/*@} end of CMSIS_Core_NVICFunctions */\r
+\r
+\r
+/* ##########################  FPU functions  #################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_FpuFunctions FPU Functions\r
+  \brief    Function that provides FPU type.\r
+  @{\r
+ */\r
+\r
+/**\r
+  \brief   get FPU type\r
+  \details returns the FPU type\r
+  \returns\r
+   - \b  0: No FPU\r
+   - \b  1: Single precision FPU\r
+   - \b  2: Double + Single precision FPU\r
+ */\r
+__STATIC_INLINE uint32_t SCB_GetFPUType(void)\r
+{\r
+    return 0U;           /* No FPU */\r
+}\r
+\r
+\r
+/*@} end of CMSIS_Core_FpuFunctions */\r
+\r
+\r
+\r
+/* ##################################    SysTick function  ############################################ */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_Core_SysTickFunctions SysTick Functions\r
+  \brief    Functions that configure the System.\r
+  @{\r
+ */\r
+\r
+#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)\r
+\r
+/**\r
+  \brief   System Tick Configuration\r
+  \details Initializes the System Timer and its interrupt, and starts the System Tick Timer.\r
+           Counter is in free running mode to generate periodic interrupts.\r
+  \param [in]  ticks  Number of ticks between two interrupts.\r
+  \return          0  Function succeeded.\r
+  \return          1  Function failed.\r
+  \note    When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the\r
+           function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>\r
+           must contain a vendor-specific implementation of this function.\r
+ */\r
+__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)\r
+{\r
+  if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)\r
+  {\r
+    return (1UL);                                                   /* Reload value impossible */\r
+  }\r
+\r
+  SysTick->LOAD  = (uint32_t)(ticks - 1UL);                         /* set reload register */\r
+  NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */\r
+  SysTick->VAL   = 0UL;                                             /* Load the SysTick Counter Value */\r
+  SysTick->CTRL  = SysTick_CTRL_CLKSOURCE_Msk |\r
+                   SysTick_CTRL_TICKINT_Msk   |\r
+                   SysTick_CTRL_ENABLE_Msk;                         /* Enable SysTick IRQ and SysTick Timer */\r
+  return (0UL);                                                     /* Function successful */\r
+}\r
+\r
+#endif\r
+\r
+/*@} end of CMSIS_Core_SysTickFunctions */\r
+\r
+\r
+\r
+/* ##################################### Debug In/Output function ########################################### */\r
+/**\r
+  \ingroup  CMSIS_Core_FunctionInterface\r
+  \defgroup CMSIS_core_DebugFunctions ITM Functions\r
+  \brief    Functions that access the ITM debug interface.\r
+  @{\r
+ */\r
+\r
+extern volatile int32_t ITM_RxBuffer;                              /*!< External variable to receive characters. */\r
+#define                 ITM_RXBUFFER_EMPTY  ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */\r
+\r
+\r
+/**\r
+  \brief   ITM Send Character\r
+  \details Transmits a character via the ITM channel 0, and\r
+           \li Just returns when no debugger is connected that has booked the output.\r
+           \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted.\r
+  \param [in]     ch  Character to transmit.\r
+  \returns            Character to transmit.\r
+ */\r
+__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch)\r
+{\r
+  if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) &&      /* ITM enabled */\r
+      ((ITM->TER & 1UL               ) != 0UL)   )     /* ITM Port #0 enabled */\r
+  {\r
+    while (ITM->PORT[0U].u32 == 0UL)\r
+    {\r
+      __NOP();\r
+    }\r
+    ITM->PORT[0U].u8 = (uint8_t)ch;\r
+  }\r
+  return (ch);\r
+}\r
+\r
+\r
+/**\r
+  \brief   ITM Receive Character\r
+  \details Inputs a character via the external variable \ref ITM_RxBuffer.\r
+  \return             Received character.\r
+  \return         -1  No character pending.\r
+ */\r
+__STATIC_INLINE int32_t ITM_ReceiveChar (void)\r
+{\r
+  int32_t ch = -1;                           /* no character available */\r
+\r
+  if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY)\r
+  {\r
+    ch = ITM_RxBuffer;\r
+    ITM_RxBuffer = ITM_RXBUFFER_EMPTY;       /* ready for next character */\r
+  }\r
+\r
+  return (ch);\r
+}\r
+\r
+\r
+/**\r
+  \brief   ITM Check Character\r
+  \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer.\r
+  \return          0  No character available.\r
+  \return          1  Character available.\r
+ */\r
+__STATIC_INLINE int32_t ITM_CheckChar (void)\r
+{\r
+\r
+  if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY)\r
+  {\r
+    return (0);                              /* no character available */\r
+  }\r
+  else\r
+  {\r
+    return (1);                              /*    character available */\r
+  }\r
+}\r
+\r
+/*@} end of CMSIS_core_DebugFunctions */\r
+\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __CORE_SC300_H_DEPENDANT */\r
+\r
+#endif /* __CMSIS_GENERIC */\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/mpu_armv7.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/mpu_armv7.h
new file mode 100644 (file)
index 0000000..7d4b600
--- /dev/null
@@ -0,0 +1,270 @@
+/******************************************************************************\r
+ * @file     mpu_armv7.h\r
+ * @brief    CMSIS MPU API for Armv7-M MPU\r
+ * @version  V5.0.4\r
+ * @date     10. January 2018\r
+ ******************************************************************************/\r
+/*\r
+ * Copyright (c) 2017-2018 Arm Limited. All rights reserved.\r
+ *\r
+ * SPDX-License-Identifier: Apache-2.0\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the License); you may\r
+ * not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
\r
+#if   defined ( __ICCARM__ )\r
+  #pragma system_include         /* treat file as system include file for MISRA check */\r
+#elif defined (__clang__)\r
+  #pragma clang system_header    /* treat file as system include file */\r
+#endif\r
\r
+#ifndef ARM_MPU_ARMV7_H\r
+#define ARM_MPU_ARMV7_H\r
+\r
+#define ARM_MPU_REGION_SIZE_32B      ((uint8_t)0x04U) ///!< MPU Region Size 32 Bytes\r
+#define ARM_MPU_REGION_SIZE_64B      ((uint8_t)0x05U) ///!< MPU Region Size 64 Bytes\r
+#define ARM_MPU_REGION_SIZE_128B     ((uint8_t)0x06U) ///!< MPU Region Size 128 Bytes\r
+#define ARM_MPU_REGION_SIZE_256B     ((uint8_t)0x07U) ///!< MPU Region Size 256 Bytes\r
+#define ARM_MPU_REGION_SIZE_512B     ((uint8_t)0x08U) ///!< MPU Region Size 512 Bytes\r
+#define ARM_MPU_REGION_SIZE_1KB      ((uint8_t)0x09U) ///!< MPU Region Size 1 KByte\r
+#define ARM_MPU_REGION_SIZE_2KB      ((uint8_t)0x0AU) ///!< MPU Region Size 2 KBytes\r
+#define ARM_MPU_REGION_SIZE_4KB      ((uint8_t)0x0BU) ///!< MPU Region Size 4 KBytes\r
+#define ARM_MPU_REGION_SIZE_8KB      ((uint8_t)0x0CU) ///!< MPU Region Size 8 KBytes\r
+#define ARM_MPU_REGION_SIZE_16KB     ((uint8_t)0x0DU) ///!< MPU Region Size 16 KBytes\r
+#define ARM_MPU_REGION_SIZE_32KB     ((uint8_t)0x0EU) ///!< MPU Region Size 32 KBytes\r
+#define ARM_MPU_REGION_SIZE_64KB     ((uint8_t)0x0FU) ///!< MPU Region Size 64 KBytes\r
+#define ARM_MPU_REGION_SIZE_128KB    ((uint8_t)0x10U) ///!< MPU Region Size 128 KBytes\r
+#define ARM_MPU_REGION_SIZE_256KB    ((uint8_t)0x11U) ///!< MPU Region Size 256 KBytes\r
+#define ARM_MPU_REGION_SIZE_512KB    ((uint8_t)0x12U) ///!< MPU Region Size 512 KBytes\r
+#define ARM_MPU_REGION_SIZE_1MB      ((uint8_t)0x13U) ///!< MPU Region Size 1 MByte\r
+#define ARM_MPU_REGION_SIZE_2MB      ((uint8_t)0x14U) ///!< MPU Region Size 2 MBytes\r
+#define ARM_MPU_REGION_SIZE_4MB      ((uint8_t)0x15U) ///!< MPU Region Size 4 MBytes\r
+#define ARM_MPU_REGION_SIZE_8MB      ((uint8_t)0x16U) ///!< MPU Region Size 8 MBytes\r
+#define ARM_MPU_REGION_SIZE_16MB     ((uint8_t)0x17U) ///!< MPU Region Size 16 MBytes\r
+#define ARM_MPU_REGION_SIZE_32MB     ((uint8_t)0x18U) ///!< MPU Region Size 32 MBytes\r
+#define ARM_MPU_REGION_SIZE_64MB     ((uint8_t)0x19U) ///!< MPU Region Size 64 MBytes\r
+#define ARM_MPU_REGION_SIZE_128MB    ((uint8_t)0x1AU) ///!< MPU Region Size 128 MBytes\r
+#define ARM_MPU_REGION_SIZE_256MB    ((uint8_t)0x1BU) ///!< MPU Region Size 256 MBytes\r
+#define ARM_MPU_REGION_SIZE_512MB    ((uint8_t)0x1CU) ///!< MPU Region Size 512 MBytes\r
+#define ARM_MPU_REGION_SIZE_1GB      ((uint8_t)0x1DU) ///!< MPU Region Size 1 GByte\r
+#define ARM_MPU_REGION_SIZE_2GB      ((uint8_t)0x1EU) ///!< MPU Region Size 2 GBytes\r
+#define ARM_MPU_REGION_SIZE_4GB      ((uint8_t)0x1FU) ///!< MPU Region Size 4 GBytes\r
+\r
+#define ARM_MPU_AP_NONE 0U ///!< MPU Access Permission no access\r
+#define ARM_MPU_AP_PRIV 1U ///!< MPU Access Permission privileged access only\r
+#define ARM_MPU_AP_URO  2U ///!< MPU Access Permission unprivileged access read-only\r
+#define ARM_MPU_AP_FULL 3U ///!< MPU Access Permission full access\r
+#define ARM_MPU_AP_PRO  5U ///!< MPU Access Permission privileged access read-only\r
+#define ARM_MPU_AP_RO   6U ///!< MPU Access Permission read-only access\r
+\r
+/** MPU Region Base Address Register Value\r
+*\r
+* \param Region The region to be configured, number 0 to 15.\r
+* \param BaseAddress The base address for the region.\r
+*/\r
+#define ARM_MPU_RBAR(Region, BaseAddress) \\r
+  (((BaseAddress) & MPU_RBAR_ADDR_Msk) |  \\r
+   ((Region) & MPU_RBAR_REGION_Msk)    |  \\r
+   (MPU_RBAR_VALID_Msk))\r
+\r
+/**\r
+* MPU Memory Access Attributes\r
+* \r
+* \param TypeExtField      Type extension field, allows you to configure memory access type, for example strongly ordered, peripheral.\r
+* \param IsShareable       Region is shareable between multiple bus masters.\r
+* \param IsCacheable       Region is cacheable, i.e. its value may be kept in cache.\r
+* \param IsBufferable      Region is bufferable, i.e. using write-back caching. Cacheable but non-bufferable regions use write-through policy.\r
+*/  \r
+#define ARM_MPU_ACCESS_(TypeExtField, IsShareable, IsCacheable, IsBufferable)   \\r
+  ((((TypeExtField ) << MPU_RASR_TEX_Pos) & MPU_RASR_TEX_Msk)                 | \\r
+   (((IsShareable ) << MPU_RASR_S_Pos) & MPU_RASR_S_Msk)                      | \\r
+   (((IsCacheable ) << MPU_RASR_C_Pos) & MPU_RASR_C_Msk)                      | \\r
+   (((IsBufferable ) << MPU_RASR_B_Pos) & MPU_RASR_B_Msk))\r
+\r
+/**\r
+* MPU Region Attribute and Size Register Value\r
+* \r
+* \param DisableExec       Instruction access disable bit, 1= disable instruction fetches.\r
+* \param AccessPermission  Data access permissions, allows you to configure read/write access for User and Privileged mode.\r
+* \param AccessAttributes  Memory access attribution, see \ref ARM_MPU_ACCESS_.\r
+* \param SubRegionDisable  Sub-region disable field.\r
+* \param Size              Region size of the region to be configured, for example 4K, 8K.\r
+*/\r
+#define ARM_MPU_RASR_EX(DisableExec, AccessPermission, AccessAttributes, SubRegionDisable, Size)      \\r
+  ((((DisableExec ) << MPU_RASR_XN_Pos) & MPU_RASR_XN_Msk)                                          | \\r
+   (((AccessPermission) << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk)                                      | \\r
+   (((AccessAttributes) ) & (MPU_RASR_TEX_Msk | MPU_RASR_S_Msk | MPU_RASR_C_Msk | MPU_RASR_B_Msk)))\r
+  \r
+/**\r
+* MPU Region Attribute and Size Register Value\r
+* \r
+* \param DisableExec       Instruction access disable bit, 1= disable instruction fetches.\r
+* \param AccessPermission  Data access permissions, allows you to configure read/write access for User and Privileged mode.\r
+* \param TypeExtField      Type extension field, allows you to configure memory access type, for example strongly ordered, peripheral.\r
+* \param IsShareable       Region is shareable between multiple bus masters.\r
+* \param IsCacheable       Region is cacheable, i.e. its value may be kept in cache.\r
+* \param IsBufferable      Region is bufferable, i.e. using write-back caching. Cacheable but non-bufferable regions use write-through policy.\r
+* \param SubRegionDisable  Sub-region disable field.\r
+* \param Size              Region size of the region to be configured, for example 4K, 8K.\r
+*/                         \r
+#define ARM_MPU_RASR(DisableExec, AccessPermission, TypeExtField, IsShareable, IsCacheable, IsBufferable, SubRegionDisable, Size) \\r
+  ARM_MPU_RASR_EX(DisableExec, AccessPermission, ARM_MPU_ACCESS_(TypeExtField, IsShareable, IsCacheable, IsBufferable), SubRegionDisable, Size)\r
+\r
+/**\r
+* MPU Memory Access Attribute for strongly ordered memory.\r
+*  - TEX: 000b\r
+*  - Shareable\r
+*  - Non-cacheable\r
+*  - Non-bufferable\r
+*/ \r
+#define ARM_MPU_ACCESS_ORDERED ARM_MPU_ACCESS_(0U, 1U, 0U, 0U)\r
+\r
+/**\r
+* MPU Memory Access Attribute for device memory.\r
+*  - TEX: 000b (if non-shareable) or 010b (if shareable)\r
+*  - Shareable or non-shareable\r
+*  - Non-cacheable\r
+*  - Bufferable (if shareable) or non-bufferable (if non-shareable)\r
+*\r
+* \param IsShareable Configures the device memory as shareable or non-shareable.\r
+*/ \r
+#define ARM_MPU_ACCESS_DEVICE(IsShareable) ((IsShareable) ? ARM_MPU_ACCESS_(0U, 1U, 0U, 1U) : ARM_MPU_ACCESS_(2U, 0U, 0U, 0U))\r
+\r
+/**\r
+* MPU Memory Access Attribute for normal memory.\r
+*  - TEX: 1BBb (reflecting outer cacheability rules)\r
+*  - Shareable or non-shareable\r
+*  - Cacheable or non-cacheable (reflecting inner cacheability rules)\r
+*  - Bufferable or non-bufferable (reflecting inner cacheability rules)\r
+*\r
+* \param OuterCp Configures the outer cache policy.\r
+* \param InnerCp Configures the inner cache policy.\r
+* \param IsShareable Configures the memory as shareable or non-shareable.\r
+*/ \r
+#define ARM_MPU_ACCESS_NORMAL(OuterCp, InnerCp, IsShareable) ARM_MPU_ACCESS_((4U | (OuterCp)), IsShareable, ((InnerCp) & 2U), ((InnerCp) & 1U))\r
+\r
+/**\r
+* MPU Memory Access Attribute non-cacheable policy.\r
+*/\r
+#define ARM_MPU_CACHEP_NOCACHE 0U\r
+\r
+/**\r
+* MPU Memory Access Attribute write-back, write and read allocate policy.\r
+*/\r
+#define ARM_MPU_CACHEP_WB_WRA 1U\r
+\r
+/**\r
+* MPU Memory Access Attribute write-through, no write allocate policy.\r
+*/\r
+#define ARM_MPU_CACHEP_WT_NWA 2U\r
+\r
+/**\r
+* MPU Memory Access Attribute write-back, no write allocate policy.\r
+*/\r
+#define ARM_MPU_CACHEP_WB_NWA 3U\r
+\r
+\r
+/**\r
+* Struct for a single MPU Region\r
+*/\r
+typedef struct {\r
+  uint32_t RBAR; //!< The region base address register value (RBAR)\r
+  uint32_t RASR; //!< The region attribute and size register value (RASR) \ref MPU_RASR\r
+} ARM_MPU_Region_t;\r
+    \r
+/** Enable the MPU.\r
+* \param MPU_Control Default access permissions for unconfigured regions.\r
+*/\r
+__STATIC_INLINE void ARM_MPU_Enable(uint32_t MPU_Control)\r
+{\r
+  __DSB();\r
+  __ISB();\r
+  MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk;\r
+#ifdef SCB_SHCSR_MEMFAULTENA_Msk\r
+  SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk;\r
+#endif\r
+}\r
+\r
+/** Disable the MPU.\r
+*/\r
+__STATIC_INLINE void ARM_MPU_Disable(void)\r
+{\r
+  __DSB();\r
+  __ISB();\r
+#ifdef SCB_SHCSR_MEMFAULTENA_Msk\r
+  SCB->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk;\r
+#endif\r
+  MPU->CTRL  &= ~MPU_CTRL_ENABLE_Msk;\r
+}\r
+\r
+/** Clear and disable the given MPU region.\r
+* \param rnr Region number to be cleared.\r
+*/\r
+__STATIC_INLINE void ARM_MPU_ClrRegion(uint32_t rnr)\r
+{\r
+  MPU->RNR = rnr;\r
+  MPU->RASR = 0U;\r
+}\r
+\r
+/** Configure an MPU region.\r
+* \param rbar Value for RBAR register.\r
+* \param rsar Value for RSAR register.\r
+*/   \r
+__STATIC_INLINE void ARM_MPU_SetRegion(uint32_t rbar, uint32_t rasr)\r
+{\r
+  MPU->RBAR = rbar;\r
+  MPU->RASR = rasr;\r
+}\r
+\r
+/** Configure the given MPU region.\r
+* \param rnr Region number to be configured.\r
+* \param rbar Value for RBAR register.\r
+* \param rsar Value for RSAR register.\r
+*/   \r
+__STATIC_INLINE void ARM_MPU_SetRegionEx(uint32_t rnr, uint32_t rbar, uint32_t rasr)\r
+{\r
+  MPU->RNR = rnr;\r
+  MPU->RBAR = rbar;\r
+  MPU->RASR = rasr;\r
+}\r
+\r
+/** Memcopy with strictly ordered memory access, e.g. for register targets.\r
+* \param dst Destination data is copied to.\r
+* \param src Source data is copied from.\r
+* \param len Amount of data words to be copied.\r
+*/\r
+__STATIC_INLINE void orderedCpy(volatile uint32_t* dst, const uint32_t* __RESTRICT src, uint32_t len)\r
+{\r
+  uint32_t i;\r
+  for (i = 0U; i < len; ++i) \r
+  {\r
+    dst[i] = src[i];\r
+  }\r
+}\r
+\r
+/** Load the given number of MPU regions from a table.\r
+* \param table Pointer to the MPU configuration table.\r
+* \param cnt Amount of regions to be configured.\r
+*/\r
+__STATIC_INLINE void ARM_MPU_Load(ARM_MPU_Region_t const* table, uint32_t cnt) \r
+{\r
+  const uint32_t rowWordSize = sizeof(ARM_MPU_Region_t)/4U;\r
+  while (cnt > MPU_TYPE_RALIASES) {\r
+    orderedCpy(&(MPU->RBAR), &(table->RBAR), MPU_TYPE_RALIASES*rowWordSize);\r
+    table += MPU_TYPE_RALIASES;\r
+    cnt -= MPU_TYPE_RALIASES;\r
+  }\r
+  orderedCpy(&(MPU->RBAR), &(table->RBAR), cnt*rowWordSize);\r
+}\r
+\r
+#endif\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/mpu_armv8.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/mpu_armv8.h
new file mode 100644 (file)
index 0000000..99ee9f9
--- /dev/null
@@ -0,0 +1,333 @@
+/******************************************************************************\r
+ * @file     mpu_armv8.h\r
+ * @brief    CMSIS MPU API for Armv8-M MPU\r
+ * @version  V5.0.4\r
+ * @date     10. January 2018\r
+ ******************************************************************************/\r
+/*\r
+ * Copyright (c) 2017-2018 Arm Limited. All rights reserved.\r
+ *\r
+ * SPDX-License-Identifier: Apache-2.0\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the License); you may\r
+ * not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#if   defined ( __ICCARM__ )\r
+  #pragma system_include         /* treat file as system include file for MISRA check */\r
+#elif defined (__clang__)\r
+  #pragma clang system_header    /* treat file as system include file */\r
+#endif\r
+\r
+#ifndef ARM_MPU_ARMV8_H\r
+#define ARM_MPU_ARMV8_H\r
+\r
+/** \brief Attribute for device memory (outer only) */\r
+#define ARM_MPU_ATTR_DEVICE                           ( 0U )\r
+\r
+/** \brief Attribute for non-cacheable, normal memory */\r
+#define ARM_MPU_ATTR_NON_CACHEABLE                    ( 4U )\r
+\r
+/** \brief Attribute for normal memory (outer and inner)\r
+* \param NT Non-Transient: Set to 1 for non-transient data.\r
+* \param WB Write-Back: Set to 1 to use write-back update policy.\r
+* \param RA Read Allocation: Set to 1 to use cache allocation on read miss.\r
+* \param WA Write Allocation: Set to 1 to use cache allocation on write miss.\r
+*/\r
+#define ARM_MPU_ATTR_MEMORY_(NT, WB, RA, WA) \\r
+  (((NT & 1U) << 3U) | ((WB & 1U) << 2U) | ((RA & 1U) << 1U) | (WA & 1U))\r
+\r
+/** \brief Device memory type non Gathering, non Re-ordering, non Early Write Acknowledgement */\r
+#define ARM_MPU_ATTR_DEVICE_nGnRnE (0U)\r
+\r
+/** \brief Device memory type non Gathering, non Re-ordering, Early Write Acknowledgement */\r
+#define ARM_MPU_ATTR_DEVICE_nGnRE  (1U)\r
+\r
+/** \brief Device memory type non Gathering, Re-ordering, Early Write Acknowledgement */\r
+#define ARM_MPU_ATTR_DEVICE_nGRE   (2U)\r
+\r
+/** \brief Device memory type Gathering, Re-ordering, Early Write Acknowledgement */\r
+#define ARM_MPU_ATTR_DEVICE_GRE    (3U)\r
+\r
+/** \brief Memory Attribute\r
+* \param O Outer memory attributes\r
+* \param I O == ARM_MPU_ATTR_DEVICE: Device memory attributes, else: Inner memory attributes\r
+*/\r
+#define ARM_MPU_ATTR(O, I) (((O & 0xFU) << 4U) | (((O & 0xFU) != 0U) ? (I & 0xFU) : ((I & 0x3U) << 2U)))\r
+\r
+/** \brief Normal memory non-shareable  */\r
+#define ARM_MPU_SH_NON   (0U)\r
+\r
+/** \brief Normal memory outer shareable  */\r
+#define ARM_MPU_SH_OUTER (2U)\r
+\r
+/** \brief Normal memory inner shareable  */\r
+#define ARM_MPU_SH_INNER (3U)\r
+\r
+/** \brief Memory access permissions\r
+* \param RO Read-Only: Set to 1 for read-only memory.\r
+* \param NP Non-Privileged: Set to 1 for non-privileged memory.\r
+*/\r
+#define ARM_MPU_AP_(RO, NP) (((RO & 1U) << 1U) | (NP & 1U))\r
+\r
+/** \brief Region Base Address Register value\r
+* \param BASE The base address bits [31:5] of a memory region. The value is zero extended. Effective address gets 32 byte aligned.\r
+* \param SH Defines the Shareability domain for this memory region.\r
+* \param RO Read-Only: Set to 1 for a read-only memory region.\r
+* \param NP Non-Privileged: Set to 1 for a non-privileged memory region.\r
+* \oaram XN eXecute Never: Set to 1 for a non-executable memory region.\r
+*/\r
+#define ARM_MPU_RBAR(BASE, SH, RO, NP, XN) \\r
+  ((BASE & MPU_RBAR_BASE_Msk) | \\r
+  ((SH << MPU_RBAR_SH_Pos) & MPU_RBAR_SH_Msk) | \\r
+  ((ARM_MPU_AP_(RO, NP) << MPU_RBAR_AP_Pos) & MPU_RBAR_AP_Msk) | \\r
+  ((XN << MPU_RBAR_XN_Pos) & MPU_RBAR_XN_Msk))\r
+\r
+/** \brief Region Limit Address Register value\r
+* \param LIMIT The limit address bits [31:5] for this memory region. The value is one extended.\r
+* \param IDX The attribute index to be associated with this memory region.\r
+*/\r
+#define ARM_MPU_RLAR(LIMIT, IDX) \\r
+  ((LIMIT & MPU_RLAR_LIMIT_Msk) | \\r
+  ((IDX << MPU_RLAR_AttrIndx_Pos) & MPU_RLAR_AttrIndx_Msk) | \\r
+  (MPU_RLAR_EN_Msk))\r
+\r
+/**\r
+* Struct for a single MPU Region\r
+*/\r
+typedef struct {\r
+  uint32_t RBAR;                   /*!< Region Base Address Register value */\r
+  uint32_t RLAR;                   /*!< Region Limit Address Register value */\r
+} ARM_MPU_Region_t;\r
+    \r
+/** Enable the MPU.\r
+* \param MPU_Control Default access permissions for unconfigured regions.\r
+*/\r
+__STATIC_INLINE void ARM_MPU_Enable(uint32_t MPU_Control)\r
+{\r
+  __DSB();\r
+  __ISB();\r
+  MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk;\r
+#ifdef SCB_SHCSR_MEMFAULTENA_Msk\r
+  SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk;\r
+#endif\r
+}\r
+\r
+/** Disable the MPU.\r
+*/\r
+__STATIC_INLINE void ARM_MPU_Disable(void)\r
+{\r
+  __DSB();\r
+  __ISB();\r
+#ifdef SCB_SHCSR_MEMFAULTENA_Msk\r
+  SCB->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk;\r
+#endif\r
+  MPU->CTRL  &= ~MPU_CTRL_ENABLE_Msk;\r
+}\r
+\r
+#ifdef MPU_NS\r
+/** Enable the Non-secure MPU.\r
+* \param MPU_Control Default access permissions for unconfigured regions.\r
+*/\r
+__STATIC_INLINE void ARM_MPU_Enable_NS(uint32_t MPU_Control)\r
+{\r
+  __DSB();\r
+  __ISB();\r
+  MPU_NS->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk;\r
+#ifdef SCB_SHCSR_MEMFAULTENA_Msk\r
+  SCB_NS->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk;\r
+#endif\r
+}\r
+\r
+/** Disable the Non-secure MPU.\r
+*/\r
+__STATIC_INLINE void ARM_MPU_Disable_NS(void)\r
+{\r
+  __DSB();\r
+  __ISB();\r
+#ifdef SCB_SHCSR_MEMFAULTENA_Msk\r
+  SCB_NS->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk;\r
+#endif\r
+  MPU_NS->CTRL  &= ~MPU_CTRL_ENABLE_Msk;\r
+}\r
+#endif\r
+\r
+/** Set the memory attribute encoding to the given MPU.\r
+* \param mpu Pointer to the MPU to be configured.\r
+* \param idx The attribute index to be set [0-7]\r
+* \param attr The attribute value to be set.\r
+*/\r
+__STATIC_INLINE void ARM_MPU_SetMemAttrEx(MPU_Type* mpu, uint8_t idx, uint8_t attr)\r
+{\r
+  const uint8_t reg = idx / 4U;\r
+  const uint32_t pos = ((idx % 4U) * 8U);\r
+  const uint32_t mask = 0xFFU << pos;\r
+  \r
+  if (reg >= (sizeof(mpu->MAIR) / sizeof(mpu->MAIR[0]))) {\r
+    return; // invalid index\r
+  }\r
+  \r
+  mpu->MAIR[reg] = ((mpu->MAIR[reg] & ~mask) | ((attr << pos) & mask));\r
+}\r
+\r
+/** Set the memory attribute encoding.\r
+* \param idx The attribute index to be set [0-7]\r
+* \param attr The attribute value to be set.\r
+*/\r
+__STATIC_INLINE void ARM_MPU_SetMemAttr(uint8_t idx, uint8_t attr)\r
+{\r
+  ARM_MPU_SetMemAttrEx(MPU, idx, attr);\r
+}\r
+\r
+#ifdef MPU_NS\r
+/** Set the memory attribute encoding to the Non-secure MPU.\r
+* \param idx The attribute index to be set [0-7]\r
+* \param attr The attribute value to be set.\r
+*/\r
+__STATIC_INLINE void ARM_MPU_SetMemAttr_NS(uint8_t idx, uint8_t attr)\r
+{\r
+  ARM_MPU_SetMemAttrEx(MPU_NS, idx, attr);\r
+}\r
+#endif\r
+\r
+/** Clear and disable the given MPU region of the given MPU.\r
+* \param mpu Pointer to MPU to be used.\r
+* \param rnr Region number to be cleared.\r
+*/\r
+__STATIC_INLINE void ARM_MPU_ClrRegionEx(MPU_Type* mpu, uint32_t rnr)\r
+{\r
+  mpu->RNR = rnr;\r
+  mpu->RLAR = 0U;\r
+}\r
+\r
+/** Clear and disable the given MPU region.\r
+* \param rnr Region number to be cleared.\r
+*/\r
+__STATIC_INLINE void ARM_MPU_ClrRegion(uint32_t rnr)\r
+{\r
+  ARM_MPU_ClrRegionEx(MPU, rnr);\r
+}\r
+\r
+#ifdef MPU_NS\r
+/** Clear and disable the given Non-secure MPU region.\r
+* \param rnr Region number to be cleared.\r
+*/\r
+__STATIC_INLINE void ARM_MPU_ClrRegion_NS(uint32_t rnr)\r
+{  \r
+  ARM_MPU_ClrRegionEx(MPU_NS, rnr);\r
+}\r
+#endif\r
+\r
+/** Configure the given MPU region of the given MPU.\r
+* \param mpu Pointer to MPU to be used.\r
+* \param rnr Region number to be configured.\r
+* \param rbar Value for RBAR register.\r
+* \param rlar Value for RLAR register.\r
+*/   \r
+__STATIC_INLINE void ARM_MPU_SetRegionEx(MPU_Type* mpu, uint32_t rnr, uint32_t rbar, uint32_t rlar)\r
+{\r
+  mpu->RNR = rnr;\r
+  mpu->RBAR = rbar;\r
+  mpu->RLAR = rlar;\r
+}\r
+\r
+/** Configure the given MPU region.\r
+* \param rnr Region number to be configured.\r
+* \param rbar Value for RBAR register.\r
+* \param rlar Value for RLAR register.\r
+*/   \r
+__STATIC_INLINE void ARM_MPU_SetRegion(uint32_t rnr, uint32_t rbar, uint32_t rlar)\r
+{\r
+  ARM_MPU_SetRegionEx(MPU, rnr, rbar, rlar);\r
+}\r
+\r
+#ifdef MPU_NS\r
+/** Configure the given Non-secure MPU region.\r
+* \param rnr Region number to be configured.\r
+* \param rbar Value for RBAR register.\r
+* \param rlar Value for RLAR register.\r
+*/   \r
+__STATIC_INLINE void ARM_MPU_SetRegion_NS(uint32_t rnr, uint32_t rbar, uint32_t rlar)\r
+{\r
+  ARM_MPU_SetRegionEx(MPU_NS, rnr, rbar, rlar);  \r
+}\r
+#endif\r
+\r
+/** Memcopy with strictly ordered memory access, e.g. for register targets.\r
+* \param dst Destination data is copied to.\r
+* \param src Source data is copied from.\r
+* \param len Amount of data words to be copied.\r
+*/\r
+__STATIC_INLINE void orderedCpy(volatile uint32_t* dst, const uint32_t* __RESTRICT src, uint32_t len)\r
+{\r
+  uint32_t i;\r
+  for (i = 0U; i < len; ++i) \r
+  {\r
+    dst[i] = src[i];\r
+  }\r
+}\r
+\r
+/** Load the given number of MPU regions from a table to the given MPU.\r
+* \param mpu Pointer to the MPU registers to be used.\r
+* \param rnr First region number to be configured.\r
+* \param table Pointer to the MPU configuration table.\r
+* \param cnt Amount of regions to be configured.\r
+*/\r
+__STATIC_INLINE void ARM_MPU_LoadEx(MPU_Type* mpu, uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt) \r
+{\r
+  const uint32_t rowWordSize = sizeof(ARM_MPU_Region_t)/4U;\r
+  if (cnt == 1U) {\r
+    mpu->RNR = rnr;\r
+    orderedCpy(&(mpu->RBAR), &(table->RBAR), rowWordSize);\r
+  } else {\r
+    uint32_t rnrBase   = rnr & ~(MPU_TYPE_RALIASES-1U);\r
+    uint32_t rnrOffset = rnr % MPU_TYPE_RALIASES;\r
+    \r
+    mpu->RNR = rnrBase;\r
+    while ((rnrOffset + cnt) > MPU_TYPE_RALIASES) {\r
+      uint32_t c = MPU_TYPE_RALIASES - rnrOffset;\r
+      orderedCpy(&(mpu->RBAR)+(rnrOffset*2U), &(table->RBAR), c*rowWordSize);\r
+      table += c;\r
+      cnt -= c;\r
+      rnrOffset = 0U;\r
+      rnrBase += MPU_TYPE_RALIASES;\r
+      mpu->RNR = rnrBase;\r
+    }\r
+    \r
+    orderedCpy(&(mpu->RBAR)+(rnrOffset*2U), &(table->RBAR), cnt*rowWordSize);\r
+  }\r
+}\r
+\r
+/** Load the given number of MPU regions from a table.\r
+* \param rnr First region number to be configured.\r
+* \param table Pointer to the MPU configuration table.\r
+* \param cnt Amount of regions to be configured.\r
+*/\r
+__STATIC_INLINE void ARM_MPU_Load(uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt) \r
+{\r
+  ARM_MPU_LoadEx(MPU, rnr, table, cnt);\r
+}\r
+\r
+#ifdef MPU_NS\r
+/** Load the given number of MPU regions from a table to the Non-secure MPU.\r
+* \param rnr First region number to be configured.\r
+* \param table Pointer to the MPU configuration table.\r
+* \param cnt Amount of regions to be configured.\r
+*/\r
+__STATIC_INLINE void ARM_MPU_Load_NS(uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt) \r
+{\r
+  ARM_MPU_LoadEx(MPU_NS, rnr, table, cnt);\r
+}\r
+#endif\r
+\r
+#endif\r
+\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/tz_context.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/CMSIS/Include/tz_context.h
new file mode 100644 (file)
index 0000000..d4c1474
--- /dev/null
@@ -0,0 +1,70 @@
+/******************************************************************************\r
+ * @file     tz_context.h\r
+ * @brief    Context Management for Armv8-M TrustZone\r
+ * @version  V1.0.1\r
+ * @date     10. January 2018\r
+ ******************************************************************************/\r
+/*\r
+ * Copyright (c) 2017-2018 Arm Limited. All rights reserved.\r
+ *\r
+ * SPDX-License-Identifier: Apache-2.0\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the License); you may\r
+ * not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#if   defined ( __ICCARM__ )\r
+  #pragma system_include         /* treat file as system include file for MISRA check */\r
+#elif defined (__clang__)\r
+  #pragma clang system_header   /* treat file as system include file */\r
+#endif\r
+\r
+#ifndef TZ_CONTEXT_H\r
+#define TZ_CONTEXT_H\r
\r
+#include <stdint.h>\r
\r
+#ifndef TZ_MODULEID_T\r
+#define TZ_MODULEID_T\r
+/// \details Data type that identifies secure software modules called by a process.\r
+typedef uint32_t TZ_ModuleId_t;\r
+#endif\r
\r
+/// \details TZ Memory ID identifies an allocated memory slot.\r
+typedef uint32_t TZ_MemoryId_t;\r
+  \r
+/// Initialize secure context memory system\r
+/// \return execution status (1: success, 0: error)\r
+uint32_t TZ_InitContextSystem_S (void);\r
\r
+/// Allocate context memory for calling secure software modules in TrustZone\r
+/// \param[in]  module   identifies software modules called from non-secure mode\r
+/// \return value != 0 id TrustZone memory slot identifier\r
+/// \return value 0    no memory available or internal error\r
+TZ_MemoryId_t TZ_AllocModuleContext_S (TZ_ModuleId_t module);\r
\r
+/// Free context memory that was previously allocated with \ref TZ_AllocModuleContext_S\r
+/// \param[in]  id  TrustZone memory slot identifier\r
+/// \return execution status (1: success, 0: error)\r
+uint32_t TZ_FreeModuleContext_S (TZ_MemoryId_t id);\r
\r
+/// Load secure context (called on RTOS thread context switch)\r
+/// \param[in]  id  TrustZone memory slot identifier\r
+/// \return execution status (1: success, 0: error)\r
+uint32_t TZ_LoadContext_S (TZ_MemoryId_t id);\r
\r
+/// Store secure context (called on RTOS thread context switch)\r
+/// \param[in]  id  TrustZone memory slot identifier\r
+/// \return execution status (1: success, 0: error)\r
+uint32_t TZ_StoreContext_S (TZ_MemoryId_t id);\r
\r
+#endif  // TZ_CONTEXT_H\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_bus.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_bus.h
new file mode 100644 (file)
index 0000000..e17f1af
--- /dev/null
@@ -0,0 +1,1015 @@
+/**\r
+  ******************************************************************************\r
+  * @file    stm32f1xx_ll_bus.h\r
+  * @author  MCD Application Team\r
+  * @brief   Header file of BUS LL module.\r
+\r
+  @verbatim\r
+                      ##### RCC Limitations #####\r
+  ==============================================================================\r
+    [..]\r
+      A delay between an RCC peripheral clock enable and the effective peripheral\r
+      enabling should be taken into account in order to manage the peripheral read/write\r
+      from/to registers.\r
+      (+) This delay depends on the peripheral mapping.\r
+        (++) AHB & APB peripherals, 1 dummy read is necessary\r
+\r
+    [..]\r
+      Workarounds:\r
+      (#) For AHB & APB peripherals, a dummy read to the peripheral register has been\r
+          inserted in each LL_{BUS}_GRP{x}_EnableClock() function.\r
+\r
+  @endverbatim\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+\r
+/* Define to prevent recursive inclusion -------------------------------------*/\r
+#ifndef __STM32F1xx_LL_BUS_H\r
+#define __STM32F1xx_LL_BUS_H\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/* Includes ------------------------------------------------------------------*/\r
+#include "stm32f1xx.h"\r
+\r
+/** @addtogroup STM32F1xx_LL_Driver\r
+  * @{\r
+  */\r
+\r
+#if defined(RCC)\r
+\r
+/** @defgroup BUS_LL BUS\r
+  * @{\r
+  */\r
+\r
+/* Private types -------------------------------------------------------------*/\r
+/* Private variables ---------------------------------------------------------*/\r
+\r
+/* Private constants ---------------------------------------------------------*/\r
+#if defined(RCC_AHBRSTR_OTGFSRST) || defined(RCC_AHBRSTR_ETHMACRST)\r
+#define RCC_AHBRSTR_SUPPORT\r
+#endif /* RCC_AHBRSTR_OTGFSRST || RCC_AHBRSTR_ETHMACRST */\r
+\r
+/* Private macros ------------------------------------------------------------*/\r
+\r
+/* Exported types ------------------------------------------------------------*/\r
+/* Exported constants --------------------------------------------------------*/\r
+/** @defgroup BUS_LL_Exported_Constants BUS Exported Constants\r
+  * @{\r
+  */\r
+\r
+/** @defgroup BUS_LL_EC_AHB1_GRP1_PERIPH  AHB1 GRP1 PERIPH\r
+  * @{\r
+  */\r
+#define LL_AHB1_GRP1_PERIPH_ALL            (uint32_t)0xFFFFFFFFU\r
+#define LL_AHB1_GRP1_PERIPH_CRC            RCC_AHBENR_CRCEN\r
+#define LL_AHB1_GRP1_PERIPH_DMA1           RCC_AHBENR_DMA1EN\r
+#if defined(DMA2)\r
+#define LL_AHB1_GRP1_PERIPH_DMA2           RCC_AHBENR_DMA2EN\r
+#endif /*DMA2*/\r
+#if defined(ETH)\r
+#define LL_AHB1_GRP1_PERIPH_ETHMAC         RCC_AHBENR_ETHMACEN\r
+#define LL_AHB1_GRP1_PERIPH_ETHMACRX       RCC_AHBENR_ETHMACRXEN\r
+#define LL_AHB1_GRP1_PERIPH_ETHMACTX       RCC_AHBENR_ETHMACTXEN\r
+#endif /*ETH*/\r
+#define LL_AHB1_GRP1_PERIPH_FLASH          RCC_AHBENR_FLITFEN\r
+#if defined(FSMC_Bank1)\r
+#define LL_AHB1_GRP1_PERIPH_FSMC           RCC_AHBENR_FSMCEN\r
+#endif /*FSMC_Bank1*/\r
+#if defined(USB_OTG_FS)\r
+#define LL_AHB1_GRP1_PERIPH_OTGFS          RCC_AHBENR_OTGFSEN\r
+#endif /*USB_OTG_FS*/\r
+#if defined(SDIO)\r
+#define LL_AHB1_GRP1_PERIPH_SDIO           RCC_AHBENR_SDIOEN\r
+#endif /*SDIO*/\r
+#define LL_AHB1_GRP1_PERIPH_SRAM           RCC_AHBENR_SRAMEN\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup BUS_LL_EC_APB1_GRP1_PERIPH  APB1 GRP1 PERIPH\r
+  * @{\r
+  */\r
+#define LL_APB1_GRP1_PERIPH_ALL            (uint32_t)0xFFFFFFFFU\r
+#define LL_APB1_GRP1_PERIPH_BKP            RCC_APB1ENR_BKPEN\r
+#if defined(CAN1)\r
+#define LL_APB1_GRP1_PERIPH_CAN1           RCC_APB1ENR_CAN1EN\r
+#endif /*CAN1*/\r
+#if defined(CAN2)\r
+#define LL_APB1_GRP1_PERIPH_CAN2           RCC_APB1ENR_CAN2EN\r
+#endif /*CAN2*/\r
+#if defined(CEC)\r
+#define LL_APB1_GRP1_PERIPH_CEC            RCC_APB1ENR_CECEN\r
+#endif /*CEC*/\r
+#if defined(DAC)\r
+#define LL_APB1_GRP1_PERIPH_DAC1           RCC_APB1ENR_DACEN\r
+#endif /*DAC*/\r
+#define LL_APB1_GRP1_PERIPH_I2C1           RCC_APB1ENR_I2C1EN\r
+#if defined(I2C2)\r
+#define LL_APB1_GRP1_PERIPH_I2C2           RCC_APB1ENR_I2C2EN\r
+#endif /*I2C2*/\r
+#define LL_APB1_GRP1_PERIPH_PWR            RCC_APB1ENR_PWREN\r
+#if defined(SPI2)\r
+#define LL_APB1_GRP1_PERIPH_SPI2           RCC_APB1ENR_SPI2EN\r
+#endif /*SPI2*/\r
+#if defined(SPI3)\r
+#define LL_APB1_GRP1_PERIPH_SPI3           RCC_APB1ENR_SPI3EN\r
+#endif /*SPI3*/\r
+#if defined(TIM12)\r
+#define LL_APB1_GRP1_PERIPH_TIM12          RCC_APB1ENR_TIM12EN\r
+#endif /*TIM12*/\r
+#if defined(TIM13)\r
+#define LL_APB1_GRP1_PERIPH_TIM13          RCC_APB1ENR_TIM13EN\r
+#endif /*TIM13*/\r
+#if defined(TIM14)\r
+#define LL_APB1_GRP1_PERIPH_TIM14          RCC_APB1ENR_TIM14EN\r
+#endif /*TIM14*/\r
+#define LL_APB1_GRP1_PERIPH_TIM2           RCC_APB1ENR_TIM2EN\r
+#define LL_APB1_GRP1_PERIPH_TIM3           RCC_APB1ENR_TIM3EN\r
+#if defined(TIM4)\r
+#define LL_APB1_GRP1_PERIPH_TIM4           RCC_APB1ENR_TIM4EN\r
+#endif /*TIM4*/\r
+#if defined(TIM5)\r
+#define LL_APB1_GRP1_PERIPH_TIM5           RCC_APB1ENR_TIM5EN\r
+#endif /*TIM5*/\r
+#if defined(TIM6)\r
+#define LL_APB1_GRP1_PERIPH_TIM6           RCC_APB1ENR_TIM6EN\r
+#endif /*TIM6*/\r
+#if defined(TIM7)\r
+#define LL_APB1_GRP1_PERIPH_TIM7           RCC_APB1ENR_TIM7EN\r
+#endif /*TIM7*/\r
+#if defined(UART4)\r
+#define LL_APB1_GRP1_PERIPH_UART4          RCC_APB1ENR_UART4EN\r
+#endif /*UART4*/\r
+#if defined(UART5)\r
+#define LL_APB1_GRP1_PERIPH_UART5          RCC_APB1ENR_UART5EN\r
+#endif /*UART5*/\r
+#define LL_APB1_GRP1_PERIPH_USART2         RCC_APB1ENR_USART2EN\r
+#if defined(USART3)\r
+#define LL_APB1_GRP1_PERIPH_USART3         RCC_APB1ENR_USART3EN\r
+#endif /*USART3*/\r
+#if defined(USB)\r
+#define LL_APB1_GRP1_PERIPH_USB            RCC_APB1ENR_USBEN\r
+#endif /*USB*/\r
+#define LL_APB1_GRP1_PERIPH_WWDG           RCC_APB1ENR_WWDGEN\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup BUS_LL_EC_APB2_GRP1_PERIPH  APB2 GRP1 PERIPH\r
+  * @{\r
+  */\r
+#define LL_APB2_GRP1_PERIPH_ALL            (uint32_t)0xFFFFFFFFU\r
+#define LL_APB2_GRP1_PERIPH_ADC1           RCC_APB2ENR_ADC1EN\r
+#if defined(ADC2)\r
+#define LL_APB2_GRP1_PERIPH_ADC2           RCC_APB2ENR_ADC2EN\r
+#endif /*ADC2*/\r
+#if defined(ADC3)\r
+#define LL_APB2_GRP1_PERIPH_ADC3           RCC_APB2ENR_ADC3EN\r
+#endif /*ADC3*/\r
+#define LL_APB2_GRP1_PERIPH_AFIO           RCC_APB2ENR_AFIOEN\r
+#define LL_APB2_GRP1_PERIPH_GPIOA          RCC_APB2ENR_IOPAEN\r
+#define LL_APB2_GRP1_PERIPH_GPIOB          RCC_APB2ENR_IOPBEN\r
+#define LL_APB2_GRP1_PERIPH_GPIOC          RCC_APB2ENR_IOPCEN\r
+#define LL_APB2_GRP1_PERIPH_GPIOD          RCC_APB2ENR_IOPDEN\r
+#if defined(GPIOE)\r
+#define LL_APB2_GRP1_PERIPH_GPIOE          RCC_APB2ENR_IOPEEN\r
+#endif /*GPIOE*/\r
+#if defined(GPIOF)\r
+#define LL_APB2_GRP1_PERIPH_GPIOF          RCC_APB2ENR_IOPFEN\r
+#endif /*GPIOF*/\r
+#if defined(GPIOG)\r
+#define LL_APB2_GRP1_PERIPH_GPIOG          RCC_APB2ENR_IOPGEN\r
+#endif /*GPIOG*/\r
+#define LL_APB2_GRP1_PERIPH_SPI1           RCC_APB2ENR_SPI1EN\r
+#if defined(TIM10)\r
+#define LL_APB2_GRP1_PERIPH_TIM10          RCC_APB2ENR_TIM10EN\r
+#endif /*TIM10*/\r
+#if defined(TIM11)\r
+#define LL_APB2_GRP1_PERIPH_TIM11          RCC_APB2ENR_TIM11EN\r
+#endif /*TIM11*/\r
+#if defined(TIM15)\r
+#define LL_APB2_GRP1_PERIPH_TIM15          RCC_APB2ENR_TIM15EN\r
+#endif /*TIM15*/\r
+#if defined(TIM16)\r
+#define LL_APB2_GRP1_PERIPH_TIM16          RCC_APB2ENR_TIM16EN\r
+#endif /*TIM16*/\r
+#if defined(TIM17)\r
+#define LL_APB2_GRP1_PERIPH_TIM17          RCC_APB2ENR_TIM17EN\r
+#endif /*TIM17*/\r
+#define LL_APB2_GRP1_PERIPH_TIM1           RCC_APB2ENR_TIM1EN\r
+#if defined(TIM8)\r
+#define LL_APB2_GRP1_PERIPH_TIM8           RCC_APB2ENR_TIM8EN\r
+#endif /*TIM8*/\r
+#if defined(TIM9)\r
+#define LL_APB2_GRP1_PERIPH_TIM9           RCC_APB2ENR_TIM9EN\r
+#endif /*TIM9*/\r
+#define LL_APB2_GRP1_PERIPH_USART1         RCC_APB2ENR_USART1EN\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Exported macro ------------------------------------------------------------*/\r
+\r
+/* Exported functions --------------------------------------------------------*/\r
+/** @defgroup BUS_LL_Exported_Functions BUS Exported Functions\r
+  * @{\r
+  */\r
+\r
+/** @defgroup BUS_LL_EF_AHB1 AHB1\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable AHB1 peripherals clock.\r
+  * @rmtoll AHBENR       CRCEN         LL_AHB1_GRP1_EnableClock\n\r
+  *         AHBENR       DMA1EN        LL_AHB1_GRP1_EnableClock\n\r
+  *         AHBENR       DMA2EN        LL_AHB1_GRP1_EnableClock\n\r
+  *         AHBENR       ETHMACEN      LL_AHB1_GRP1_EnableClock\n\r
+  *         AHBENR       ETHMACRXEN    LL_AHB1_GRP1_EnableClock\n\r
+  *         AHBENR       ETHMACTXEN    LL_AHB1_GRP1_EnableClock\n\r
+  *         AHBENR       FLITFEN       LL_AHB1_GRP1_EnableClock\n\r
+  *         AHBENR       FSMCEN        LL_AHB1_GRP1_EnableClock\n\r
+  *         AHBENR       OTGFSEN       LL_AHB1_GRP1_EnableClock\n\r
+  *         AHBENR       SDIOEN        LL_AHB1_GRP1_EnableClock\n\r
+  *         AHBENR       SRAMEN        LL_AHB1_GRP1_EnableClock\r
+  * @param  Periphs This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_CRC\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_DMA1\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_DMA2 (*)\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_ETHMAC (*)\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_ETHMACRX (*)\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_ETHMACTX (*)\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_FLASH\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_FSMC (*)\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_OTGFS (*)\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_SDIO (*)\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_SRAM\r
+  *\r
+  *         (*) value not defined in all devices.\r
+  * @retval None\r
+*/\r
+__STATIC_INLINE void LL_AHB1_GRP1_EnableClock(uint32_t Periphs)\r
+{\r
+  __IO uint32_t tmpreg;\r
+  SET_BIT(RCC->AHBENR, Periphs);\r
+  /* Delay after an RCC peripheral clock enabling */\r
+  tmpreg = READ_BIT(RCC->AHBENR, Periphs);\r
+  (void)tmpreg;\r
+}\r
+\r
+/**\r
+  * @brief  Check if AHB1 peripheral clock is enabled or not\r
+  * @rmtoll AHBENR       CRCEN         LL_AHB1_GRP1_IsEnabledClock\n\r
+  *         AHBENR       DMA1EN        LL_AHB1_GRP1_IsEnabledClock\n\r
+  *         AHBENR       DMA2EN        LL_AHB1_GRP1_IsEnabledClock\n\r
+  *         AHBENR       ETHMACEN      LL_AHB1_GRP1_IsEnabledClock\n\r
+  *         AHBENR       ETHMACRXEN    LL_AHB1_GRP1_IsEnabledClock\n\r
+  *         AHBENR       ETHMACTXEN    LL_AHB1_GRP1_IsEnabledClock\n\r
+  *         AHBENR       FLITFEN       LL_AHB1_GRP1_IsEnabledClock\n\r
+  *         AHBENR       FSMCEN        LL_AHB1_GRP1_IsEnabledClock\n\r
+  *         AHBENR       OTGFSEN       LL_AHB1_GRP1_IsEnabledClock\n\r
+  *         AHBENR       SDIOEN        LL_AHB1_GRP1_IsEnabledClock\n\r
+  *         AHBENR       SRAMEN        LL_AHB1_GRP1_IsEnabledClock\r
+  * @param  Periphs This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_CRC\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_DMA1\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_DMA2 (*)\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_ETHMAC (*)\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_ETHMACRX (*)\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_ETHMACTX (*)\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_FLASH\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_FSMC (*)\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_OTGFS (*)\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_SDIO (*)\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_SRAM\r
+  *\r
+  *         (*) value not defined in all devices.\r
+  * @retval State of Periphs (1 or 0).\r
+*/\r
+__STATIC_INLINE uint32_t LL_AHB1_GRP1_IsEnabledClock(uint32_t Periphs)\r
+{\r
+  return (READ_BIT(RCC->AHBENR, Periphs) == Periphs);\r
+}\r
+\r
+/**\r
+  * @brief  Disable AHB1 peripherals clock.\r
+  * @rmtoll AHBENR       CRCEN         LL_AHB1_GRP1_DisableClock\n\r
+  *         AHBENR       DMA1EN        LL_AHB1_GRP1_DisableClock\n\r
+  *         AHBENR       DMA2EN        LL_AHB1_GRP1_DisableClock\n\r
+  *         AHBENR       ETHMACEN      LL_AHB1_GRP1_DisableClock\n\r
+  *         AHBENR       ETHMACRXEN    LL_AHB1_GRP1_DisableClock\n\r
+  *         AHBENR       ETHMACTXEN    LL_AHB1_GRP1_DisableClock\n\r
+  *         AHBENR       FLITFEN       LL_AHB1_GRP1_DisableClock\n\r
+  *         AHBENR       FSMCEN        LL_AHB1_GRP1_DisableClock\n\r
+  *         AHBENR       OTGFSEN       LL_AHB1_GRP1_DisableClock\n\r
+  *         AHBENR       SDIOEN        LL_AHB1_GRP1_DisableClock\n\r
+  *         AHBENR       SRAMEN        LL_AHB1_GRP1_DisableClock\r
+  * @param  Periphs This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_CRC\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_DMA1\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_DMA2 (*)\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_ETHMAC (*)\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_ETHMACRX (*)\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_ETHMACTX (*)\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_FLASH\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_FSMC (*)\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_OTGFS (*)\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_SDIO (*)\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_SRAM\r
+  *\r
+  *         (*) value not defined in all devices.\r
+  * @retval None\r
+*/\r
+__STATIC_INLINE void LL_AHB1_GRP1_DisableClock(uint32_t Periphs)\r
+{\r
+  CLEAR_BIT(RCC->AHBENR, Periphs);\r
+}\r
+\r
+#if defined(RCC_AHBRSTR_SUPPORT)\r
+/**\r
+  * @brief  Force AHB1 peripherals reset.\r
+  * @rmtoll AHBRSTR      ETHMACRST     LL_AHB1_GRP1_ForceReset\n\r
+  *         AHBRSTR      OTGFSRST      LL_AHB1_GRP1_ForceReset\r
+  * @param  Periphs This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_ALL\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_ETHMAC (*)\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_OTGFS (*)\r
+  *\r
+  *         (*) value not defined in all devices.\r
+  * @retval None\r
+*/\r
+__STATIC_INLINE void LL_AHB1_GRP1_ForceReset(uint32_t Periphs)\r
+{\r
+  SET_BIT(RCC->AHBRSTR, Periphs);\r
+}\r
+\r
+/**\r
+  * @brief  Release AHB1 peripherals reset.\r
+  * @rmtoll AHBRSTR      ETHMACRST     LL_AHB1_GRP1_ReleaseReset\n\r
+  *         AHBRSTR      OTGFSRST      LL_AHB1_GRP1_ReleaseReset\r
+  * @param  Periphs This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_ALL\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_ETHMAC (*)\r
+  *         @arg @ref LL_AHB1_GRP1_PERIPH_OTGFS (*)\r
+  *\r
+  *         (*) value not defined in all devices.\r
+  * @retval None\r
+*/\r
+__STATIC_INLINE void LL_AHB1_GRP1_ReleaseReset(uint32_t Periphs)\r
+{\r
+  CLEAR_BIT(RCC->AHBRSTR, Periphs);\r
+}\r
+#endif /* RCC_AHBRSTR_SUPPORT */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup BUS_LL_EF_APB1 APB1\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable APB1 peripherals clock.\r
+  * @rmtoll APB1ENR      BKPEN         LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      CAN1EN        LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      CAN2EN        LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      CECEN         LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      DACEN         LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      I2C1EN        LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      I2C2EN        LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      PWREN         LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      SPI2EN        LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      SPI3EN        LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      TIM12EN       LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      TIM13EN       LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      TIM14EN       LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      TIM2EN        LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      TIM3EN        LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      TIM4EN        LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      TIM5EN        LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      TIM6EN        LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      TIM7EN        LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      UART4EN       LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      UART5EN       LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      USART2EN      LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      USART3EN      LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      USBEN         LL_APB1_GRP1_EnableClock\n\r
+  *         APB1ENR      WWDGEN        LL_APB1_GRP1_EnableClock\r
+  * @param  Periphs This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_BKP\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_CAN1 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_CAN2 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_CEC (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_I2C1\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_PWR\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_SPI3 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM12 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM13 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM14 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM2\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM3\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM5 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_UART4 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_UART5 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_USART2\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_USART3 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_USB (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_WWDG\r
+  *\r
+  *         (*) value not defined in all devices.\r
+  * @retval None\r
+*/\r
+__STATIC_INLINE void LL_APB1_GRP1_EnableClock(uint32_t Periphs)\r
+{\r
+  __IO uint32_t tmpreg;\r
+  SET_BIT(RCC->APB1ENR, Periphs);\r
+  /* Delay after an RCC peripheral clock enabling */\r
+  tmpreg = READ_BIT(RCC->APB1ENR, Periphs);\r
+  (void)tmpreg;\r
+}\r
+\r
+/**\r
+  * @brief  Check if APB1 peripheral clock is enabled or not\r
+  * @rmtoll APB1ENR      BKPEN         LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      CAN1EN        LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      CAN2EN        LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      CECEN         LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      DACEN         LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      I2C1EN        LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      I2C2EN        LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      PWREN         LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      SPI2EN        LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      SPI3EN        LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      TIM12EN       LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      TIM13EN       LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      TIM14EN       LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      TIM2EN        LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      TIM3EN        LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      TIM4EN        LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      TIM5EN        LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      TIM6EN        LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      TIM7EN        LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      UART4EN       LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      UART5EN       LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      USART2EN      LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      USART3EN      LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      USBEN         LL_APB1_GRP1_IsEnabledClock\n\r
+  *         APB1ENR      WWDGEN        LL_APB1_GRP1_IsEnabledClock\r
+  * @param  Periphs This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_BKP\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_CAN1 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_CAN2 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_CEC (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_I2C1\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_PWR\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_SPI3 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM12 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM13 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM14 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM2\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM3\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM5 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_UART4 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_UART5 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_USART2\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_USART3 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_USB (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_WWDG\r
+  *\r
+  *         (*) value not defined in all devices.\r
+  * @retval State of Periphs (1 or 0).\r
+*/\r
+__STATIC_INLINE uint32_t LL_APB1_GRP1_IsEnabledClock(uint32_t Periphs)\r
+{\r
+  return (READ_BIT(RCC->APB1ENR, Periphs) == Periphs);\r
+}\r
+\r
+/**\r
+  * @brief  Disable APB1 peripherals clock.\r
+  * @rmtoll APB1ENR      BKPEN         LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      CAN1EN        LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      CAN2EN        LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      CECEN         LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      DACEN         LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      I2C1EN        LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      I2C2EN        LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      PWREN         LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      SPI2EN        LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      SPI3EN        LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      TIM12EN       LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      TIM13EN       LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      TIM14EN       LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      TIM2EN        LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      TIM3EN        LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      TIM4EN        LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      TIM5EN        LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      TIM6EN        LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      TIM7EN        LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      UART4EN       LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      UART5EN       LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      USART2EN      LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      USART3EN      LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      USBEN         LL_APB1_GRP1_DisableClock\n\r
+  *         APB1ENR      WWDGEN        LL_APB1_GRP1_DisableClock\r
+  * @param  Periphs This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_BKP\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_CAN1 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_CAN2 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_CEC (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_I2C1\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_PWR\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_SPI3 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM12 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM13 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM14 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM2\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM3\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM5 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_UART4 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_UART5 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_USART2\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_USART3 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_USB (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_WWDG\r
+  *\r
+  *         (*) value not defined in all devices.\r
+  * @retval None\r
+*/\r
+__STATIC_INLINE void LL_APB1_GRP1_DisableClock(uint32_t Periphs)\r
+{\r
+  CLEAR_BIT(RCC->APB1ENR, Periphs);\r
+}\r
+\r
+/**\r
+  * @brief  Force APB1 peripherals reset.\r
+  * @rmtoll APB1RSTR     BKPRST        LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     CAN1RST       LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     CAN2RST       LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     CECRST        LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     DACRST        LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     I2C1RST       LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     I2C2RST       LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     PWRRST        LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     SPI2RST       LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     SPI3RST       LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     TIM12RST      LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     TIM13RST      LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     TIM14RST      LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     TIM2RST       LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     TIM3RST       LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     TIM4RST       LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     TIM5RST       LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     TIM6RST       LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     TIM7RST       LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     UART4RST      LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     UART5RST      LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     USART2RST     LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     USART3RST     LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     USBRST        LL_APB1_GRP1_ForceReset\n\r
+  *         APB1RSTR     WWDGRST       LL_APB1_GRP1_ForceReset\r
+  * @param  Periphs This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_ALL\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_BKP\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_CAN1 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_CAN2 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_CEC (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_I2C1\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_PWR\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_SPI3 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM12 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM13 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM14 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM2\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM3\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM5 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_UART4 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_UART5 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_USART2\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_USART3 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_USB (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_WWDG\r
+  *\r
+  *         (*) value not defined in all devices.\r
+  * @retval None\r
+*/\r
+__STATIC_INLINE void LL_APB1_GRP1_ForceReset(uint32_t Periphs)\r
+{\r
+  SET_BIT(RCC->APB1RSTR, Periphs);\r
+}\r
+\r
+/**\r
+  * @brief  Release APB1 peripherals reset.\r
+  * @rmtoll APB1RSTR     BKPRST        LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     CAN1RST       LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     CAN2RST       LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     CECRST        LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     DACRST        LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     I2C1RST       LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     I2C2RST       LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     PWRRST        LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     SPI2RST       LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     SPI3RST       LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     TIM12RST      LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     TIM13RST      LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     TIM14RST      LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     TIM2RST       LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     TIM3RST       LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     TIM4RST       LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     TIM5RST       LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     TIM6RST       LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     TIM7RST       LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     UART4RST      LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     UART5RST      LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     USART2RST     LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     USART3RST     LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     USBRST        LL_APB1_GRP1_ReleaseReset\n\r
+  *         APB1RSTR     WWDGRST       LL_APB1_GRP1_ReleaseReset\r
+  * @param  Periphs This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_ALL\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_BKP\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_CAN1 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_CAN2 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_CEC (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_DAC1 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_I2C1\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_PWR\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_SPI3 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM12 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM13 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM14 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM2\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM3\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM5 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM6 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_UART4 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_UART5 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_USART2\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_USART3 (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_USB (*)\r
+  *         @arg @ref LL_APB1_GRP1_PERIPH_WWDG\r
+  *\r
+  *         (*) value not defined in all devices.\r
+  * @retval None\r
+*/\r
+__STATIC_INLINE void LL_APB1_GRP1_ReleaseReset(uint32_t Periphs)\r
+{\r
+  CLEAR_BIT(RCC->APB1RSTR, Periphs);\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup BUS_LL_EF_APB2 APB2\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable APB2 peripherals clock.\r
+  * @rmtoll APB2ENR      ADC1EN        LL_APB2_GRP1_EnableClock\n\r
+  *         APB2ENR      ADC2EN        LL_APB2_GRP1_EnableClock\n\r
+  *         APB2ENR      ADC3EN        LL_APB2_GRP1_EnableClock\n\r
+  *         APB2ENR      AFIOEN        LL_APB2_GRP1_EnableClock\n\r
+  *         APB2ENR      IOPAEN        LL_APB2_GRP1_EnableClock\n\r
+  *         APB2ENR      IOPBEN        LL_APB2_GRP1_EnableClock\n\r
+  *         APB2ENR      IOPCEN        LL_APB2_GRP1_EnableClock\n\r
+  *         APB2ENR      IOPDEN        LL_APB2_GRP1_EnableClock\n\r
+  *         APB2ENR      IOPEEN        LL_APB2_GRP1_EnableClock\n\r
+  *         APB2ENR      IOPFEN        LL_APB2_GRP1_EnableClock\n\r
+  *         APB2ENR      IOPGEN        LL_APB2_GRP1_EnableClock\n\r
+  *         APB2ENR      SPI1EN        LL_APB2_GRP1_EnableClock\n\r
+  *         APB2ENR      TIM10EN       LL_APB2_GRP1_EnableClock\n\r
+  *         APB2ENR      TIM11EN       LL_APB2_GRP1_EnableClock\n\r
+  *         APB2ENR      TIM15EN       LL_APB2_GRP1_EnableClock\n\r
+  *         APB2ENR      TIM16EN       LL_APB2_GRP1_EnableClock\n\r
+  *         APB2ENR      TIM17EN       LL_APB2_GRP1_EnableClock\n\r
+  *         APB2ENR      TIM1EN        LL_APB2_GRP1_EnableClock\n\r
+  *         APB2ENR      TIM8EN        LL_APB2_GRP1_EnableClock\n\r
+  *         APB2ENR      TIM9EN        LL_APB2_GRP1_EnableClock\n\r
+  *         APB2ENR      USART1EN      LL_APB2_GRP1_EnableClock\r
+  * @param  Periphs This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_ADC1\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_ADC2 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_ADC3 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_AFIO\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOA\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOB\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOC\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOD\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOE (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOF (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOG (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_SPI1\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM10 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM11 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM15 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM16 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM17 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM1\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM8 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM9 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_USART1\r
+  *\r
+  *         (*) value not defined in all devices.\r
+  * @retval None\r
+*/\r
+__STATIC_INLINE void LL_APB2_GRP1_EnableClock(uint32_t Periphs)\r
+{\r
+  __IO uint32_t tmpreg;\r
+  SET_BIT(RCC->APB2ENR, Periphs);\r
+  /* Delay after an RCC peripheral clock enabling */\r
+  tmpreg = READ_BIT(RCC->APB2ENR, Periphs);\r
+  (void)tmpreg;\r
+}\r
+\r
+/**\r
+  * @brief  Check if APB2 peripheral clock is enabled or not\r
+  * @rmtoll APB2ENR      ADC1EN        LL_APB2_GRP1_IsEnabledClock\n\r
+  *         APB2ENR      ADC2EN        LL_APB2_GRP1_IsEnabledClock\n\r
+  *         APB2ENR      ADC3EN        LL_APB2_GRP1_IsEnabledClock\n\r
+  *         APB2ENR      AFIOEN        LL_APB2_GRP1_IsEnabledClock\n\r
+  *         APB2ENR      IOPAEN        LL_APB2_GRP1_IsEnabledClock\n\r
+  *         APB2ENR      IOPBEN        LL_APB2_GRP1_IsEnabledClock\n\r
+  *         APB2ENR      IOPCEN        LL_APB2_GRP1_IsEnabledClock\n\r
+  *         APB2ENR      IOPDEN        LL_APB2_GRP1_IsEnabledClock\n\r
+  *         APB2ENR      IOPEEN        LL_APB2_GRP1_IsEnabledClock\n\r
+  *         APB2ENR      IOPFEN        LL_APB2_GRP1_IsEnabledClock\n\r
+  *         APB2ENR      IOPGEN        LL_APB2_GRP1_IsEnabledClock\n\r
+  *         APB2ENR      SPI1EN        LL_APB2_GRP1_IsEnabledClock\n\r
+  *         APB2ENR      TIM10EN       LL_APB2_GRP1_IsEnabledClock\n\r
+  *         APB2ENR      TIM11EN       LL_APB2_GRP1_IsEnabledClock\n\r
+  *         APB2ENR      TIM15EN       LL_APB2_GRP1_IsEnabledClock\n\r
+  *         APB2ENR      TIM16EN       LL_APB2_GRP1_IsEnabledClock\n\r
+  *         APB2ENR      TIM17EN       LL_APB2_GRP1_IsEnabledClock\n\r
+  *         APB2ENR      TIM1EN        LL_APB2_GRP1_IsEnabledClock\n\r
+  *         APB2ENR      TIM8EN        LL_APB2_GRP1_IsEnabledClock\n\r
+  *         APB2ENR      TIM9EN        LL_APB2_GRP1_IsEnabledClock\n\r
+  *         APB2ENR      USART1EN      LL_APB2_GRP1_IsEnabledClock\r
+  * @param  Periphs This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_ADC1\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_ADC2 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_ADC3 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_AFIO\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOA\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOB\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOC\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOD\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOE (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOF (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOG (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_SPI1\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM10 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM11 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM15 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM16 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM17 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM1\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM8 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM9 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_USART1\r
+  *\r
+  *         (*) value not defined in all devices.\r
+  * @retval State of Periphs (1 or 0).\r
+*/\r
+__STATIC_INLINE uint32_t LL_APB2_GRP1_IsEnabledClock(uint32_t Periphs)\r
+{\r
+  return (READ_BIT(RCC->APB2ENR, Periphs) == Periphs);\r
+}\r
+\r
+/**\r
+  * @brief  Disable APB2 peripherals clock.\r
+  * @rmtoll APB2ENR      ADC1EN        LL_APB2_GRP1_DisableClock\n\r
+  *         APB2ENR      ADC2EN        LL_APB2_GRP1_DisableClock\n\r
+  *         APB2ENR      ADC3EN        LL_APB2_GRP1_DisableClock\n\r
+  *         APB2ENR      AFIOEN        LL_APB2_GRP1_DisableClock\n\r
+  *         APB2ENR      IOPAEN        LL_APB2_GRP1_DisableClock\n\r
+  *         APB2ENR      IOPBEN        LL_APB2_GRP1_DisableClock\n\r
+  *         APB2ENR      IOPCEN        LL_APB2_GRP1_DisableClock\n\r
+  *         APB2ENR      IOPDEN        LL_APB2_GRP1_DisableClock\n\r
+  *         APB2ENR      IOPEEN        LL_APB2_GRP1_DisableClock\n\r
+  *         APB2ENR      IOPFEN        LL_APB2_GRP1_DisableClock\n\r
+  *         APB2ENR      IOPGEN        LL_APB2_GRP1_DisableClock\n\r
+  *         APB2ENR      SPI1EN        LL_APB2_GRP1_DisableClock\n\r
+  *         APB2ENR      TIM10EN       LL_APB2_GRP1_DisableClock\n\r
+  *         APB2ENR      TIM11EN       LL_APB2_GRP1_DisableClock\n\r
+  *         APB2ENR      TIM15EN       LL_APB2_GRP1_DisableClock\n\r
+  *         APB2ENR      TIM16EN       LL_APB2_GRP1_DisableClock\n\r
+  *         APB2ENR      TIM17EN       LL_APB2_GRP1_DisableClock\n\r
+  *         APB2ENR      TIM1EN        LL_APB2_GRP1_DisableClock\n\r
+  *         APB2ENR      TIM8EN        LL_APB2_GRP1_DisableClock\n\r
+  *         APB2ENR      TIM9EN        LL_APB2_GRP1_DisableClock\n\r
+  *         APB2ENR      USART1EN      LL_APB2_GRP1_DisableClock\r
+  * @param  Periphs This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_ADC1\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_ADC2 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_ADC3 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_AFIO\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOA\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOB\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOC\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOD\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOE (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOF (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOG (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_SPI1\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM10 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM11 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM15 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM16 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM17 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM1\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM8 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM9 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_USART1\r
+  *\r
+  *         (*) value not defined in all devices.\r
+  * @retval None\r
+*/\r
+__STATIC_INLINE void LL_APB2_GRP1_DisableClock(uint32_t Periphs)\r
+{\r
+  CLEAR_BIT(RCC->APB2ENR, Periphs);\r
+}\r
+\r
+/**\r
+  * @brief  Force APB2 peripherals reset.\r
+  * @rmtoll APB2RSTR     ADC1RST       LL_APB2_GRP1_ForceReset\n\r
+  *         APB2RSTR     ADC2RST       LL_APB2_GRP1_ForceReset\n\r
+  *         APB2RSTR     ADC3RST       LL_APB2_GRP1_ForceReset\n\r
+  *         APB2RSTR     AFIORST       LL_APB2_GRP1_ForceReset\n\r
+  *         APB2RSTR     IOPARST       LL_APB2_GRP1_ForceReset\n\r
+  *         APB2RSTR     IOPBRST       LL_APB2_GRP1_ForceReset\n\r
+  *         APB2RSTR     IOPCRST       LL_APB2_GRP1_ForceReset\n\r
+  *         APB2RSTR     IOPDRST       LL_APB2_GRP1_ForceReset\n\r
+  *         APB2RSTR     IOPERST       LL_APB2_GRP1_ForceReset\n\r
+  *         APB2RSTR     IOPFRST       LL_APB2_GRP1_ForceReset\n\r
+  *         APB2RSTR     IOPGRST       LL_APB2_GRP1_ForceReset\n\r
+  *         APB2RSTR     SPI1RST       LL_APB2_GRP1_ForceReset\n\r
+  *         APB2RSTR     TIM10RST      LL_APB2_GRP1_ForceReset\n\r
+  *         APB2RSTR     TIM11RST      LL_APB2_GRP1_ForceReset\n\r
+  *         APB2RSTR     TIM15RST      LL_APB2_GRP1_ForceReset\n\r
+  *         APB2RSTR     TIM16RST      LL_APB2_GRP1_ForceReset\n\r
+  *         APB2RSTR     TIM17RST      LL_APB2_GRP1_ForceReset\n\r
+  *         APB2RSTR     TIM1RST       LL_APB2_GRP1_ForceReset\n\r
+  *         APB2RSTR     TIM8RST       LL_APB2_GRP1_ForceReset\n\r
+  *         APB2RSTR     TIM9RST       LL_APB2_GRP1_ForceReset\n\r
+  *         APB2RSTR     USART1RST     LL_APB2_GRP1_ForceReset\r
+  * @param  Periphs This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_ALL\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_ADC1\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_ADC2 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_ADC3 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_AFIO\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOA\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOB\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOC\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOD\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOE (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOF (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOG (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_SPI1\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM10 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM11 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM15 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM16 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM17 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM1\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM8 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM9 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_USART1\r
+  *\r
+  *         (*) value not defined in all devices.\r
+  * @retval None\r
+*/\r
+__STATIC_INLINE void LL_APB2_GRP1_ForceReset(uint32_t Periphs)\r
+{\r
+  SET_BIT(RCC->APB2RSTR, Periphs);\r
+}\r
+\r
+/**\r
+  * @brief  Release APB2 peripherals reset.\r
+  * @rmtoll APB2RSTR     ADC1RST       LL_APB2_GRP1_ReleaseReset\n\r
+  *         APB2RSTR     ADC2RST       LL_APB2_GRP1_ReleaseReset\n\r
+  *         APB2RSTR     ADC3RST       LL_APB2_GRP1_ReleaseReset\n\r
+  *         APB2RSTR     AFIORST       LL_APB2_GRP1_ReleaseReset\n\r
+  *         APB2RSTR     IOPARST       LL_APB2_GRP1_ReleaseReset\n\r
+  *         APB2RSTR     IOPBRST       LL_APB2_GRP1_ReleaseReset\n\r
+  *         APB2RSTR     IOPCRST       LL_APB2_GRP1_ReleaseReset\n\r
+  *         APB2RSTR     IOPDRST       LL_APB2_GRP1_ReleaseReset\n\r
+  *         APB2RSTR     IOPERST       LL_APB2_GRP1_ReleaseReset\n\r
+  *         APB2RSTR     IOPFRST       LL_APB2_GRP1_ReleaseReset\n\r
+  *         APB2RSTR     IOPGRST       LL_APB2_GRP1_ReleaseReset\n\r
+  *         APB2RSTR     SPI1RST       LL_APB2_GRP1_ReleaseReset\n\r
+  *         APB2RSTR     TIM10RST      LL_APB2_GRP1_ReleaseReset\n\r
+  *         APB2RSTR     TIM11RST      LL_APB2_GRP1_ReleaseReset\n\r
+  *         APB2RSTR     TIM15RST      LL_APB2_GRP1_ReleaseReset\n\r
+  *         APB2RSTR     TIM16RST      LL_APB2_GRP1_ReleaseReset\n\r
+  *         APB2RSTR     TIM17RST      LL_APB2_GRP1_ReleaseReset\n\r
+  *         APB2RSTR     TIM1RST       LL_APB2_GRP1_ReleaseReset\n\r
+  *         APB2RSTR     TIM8RST       LL_APB2_GRP1_ReleaseReset\n\r
+  *         APB2RSTR     TIM9RST       LL_APB2_GRP1_ReleaseReset\n\r
+  *         APB2RSTR     USART1RST     LL_APB2_GRP1_ReleaseReset\r
+  * @param  Periphs This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_ALL\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_ADC1\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_ADC2 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_ADC3 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_AFIO\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOA\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOB\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOC\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOD\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOE (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOF (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_GPIOG (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_SPI1\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM10 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM11 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM15 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM16 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM17 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM1\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM8 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_TIM9 (*)\r
+  *         @arg @ref LL_APB2_GRP1_PERIPH_USART1\r
+  *\r
+  *         (*) value not defined in all devices.\r
+  * @retval None\r
+*/\r
+__STATIC_INLINE void LL_APB2_GRP1_ReleaseReset(uint32_t Periphs)\r
+{\r
+  CLEAR_BIT(RCC->APB2RSTR, Periphs);\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* defined(RCC) */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __STM32F1xx_LL_BUS_H */\r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_cortex.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_cortex.h
new file mode 100644 (file)
index 0000000..7baf2ac
--- /dev/null
@@ -0,0 +1,640 @@
+/**\r
+  ******************************************************************************\r
+  * @file    stm32f1xx_ll_cortex.h\r
+  * @author  MCD Application Team\r
+  * @brief   Header file of CORTEX LL module.\r
+  @verbatim\r
+  ==============================================================================\r
+                     ##### How to use this driver #####\r
+  ==============================================================================\r
+    [..]\r
+    The LL CORTEX driver contains a set of generic APIs that can be\r
+    used by user:\r
+      (+) SYSTICK configuration used by @ref LL_mDelay and @ref LL_Init1msTick\r
+          functions\r
+      (+) Low power mode configuration (SCB register of Cortex-MCU)\r
+      (+) MPU API to configure and enable regions\r
+          (MPU services provided only on some devices)\r
+      (+) API to access to MCU info (CPUID register)\r
+      (+) API to enable fault handler (SHCSR accesses)\r
+\r
+  @endverbatim\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+\r
+/* Define to prevent recursive inclusion -------------------------------------*/\r
+#ifndef __STM32F1xx_LL_CORTEX_H\r
+#define __STM32F1xx_LL_CORTEX_H\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/* Includes ------------------------------------------------------------------*/\r
+#include "stm32f1xx.h"\r
+\r
+/** @addtogroup STM32F1xx_LL_Driver\r
+  * @{\r
+  */\r
+\r
+/** @defgroup CORTEX_LL CORTEX\r
+  * @{\r
+  */\r
+\r
+/* Private types -------------------------------------------------------------*/\r
+/* Private variables ---------------------------------------------------------*/\r
+\r
+/* Private constants ---------------------------------------------------------*/\r
+\r
+/* Private macros ------------------------------------------------------------*/\r
+\r
+/* Exported types ------------------------------------------------------------*/\r
+/* Exported constants --------------------------------------------------------*/\r
+/** @defgroup CORTEX_LL_Exported_Constants CORTEX Exported Constants\r
+  * @{\r
+  */\r
+\r
+/** @defgroup CORTEX_LL_EC_CLKSOURCE_HCLK SYSTICK Clock Source\r
+  * @{\r
+  */\r
+#define LL_SYSTICK_CLKSOURCE_HCLK_DIV8     0x00000000U                 /*!< AHB clock divided by 8 selected as SysTick clock source.*/\r
+#define LL_SYSTICK_CLKSOURCE_HCLK          SysTick_CTRL_CLKSOURCE_Msk  /*!< AHB clock selected as SysTick clock source. */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup CORTEX_LL_EC_FAULT Handler Fault type\r
+  * @{\r
+  */\r
+#define LL_HANDLER_FAULT_USG               SCB_SHCSR_USGFAULTENA_Msk              /*!< Usage fault */\r
+#define LL_HANDLER_FAULT_BUS               SCB_SHCSR_BUSFAULTENA_Msk              /*!< Bus fault */\r
+#define LL_HANDLER_FAULT_MEM               SCB_SHCSR_MEMFAULTENA_Msk              /*!< Memory management fault */\r
+/**\r
+  * @}\r
+  */\r
+\r
+#if __MPU_PRESENT\r
+\r
+/** @defgroup CORTEX_LL_EC_CTRL_HFNMI_PRIVDEF MPU Control\r
+  * @{\r
+  */\r
+#define LL_MPU_CTRL_HFNMI_PRIVDEF_NONE     0x00000000U                                       /*!< Disable NMI and privileged SW access */\r
+#define LL_MPU_CTRL_HARDFAULT_NMI          MPU_CTRL_HFNMIENA_Msk                             /*!< Enables the operation of MPU during hard fault, NMI, and FAULTMASK handlers */\r
+#define LL_MPU_CTRL_PRIVILEGED_DEFAULT     MPU_CTRL_PRIVDEFENA_Msk                           /*!< Enable privileged software access to default memory map */\r
+#define LL_MPU_CTRL_HFNMI_PRIVDEF          (MPU_CTRL_HFNMIENA_Msk | MPU_CTRL_PRIVDEFENA_Msk) /*!< Enable NMI and privileged SW access */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup CORTEX_LL_EC_REGION MPU Region Number\r
+  * @{\r
+  */\r
+#define LL_MPU_REGION_NUMBER0              0x00U /*!< REGION Number 0 */\r
+#define LL_MPU_REGION_NUMBER1              0x01U /*!< REGION Number 1 */\r
+#define LL_MPU_REGION_NUMBER2              0x02U /*!< REGION Number 2 */\r
+#define LL_MPU_REGION_NUMBER3              0x03U /*!< REGION Number 3 */\r
+#define LL_MPU_REGION_NUMBER4              0x04U /*!< REGION Number 4 */\r
+#define LL_MPU_REGION_NUMBER5              0x05U /*!< REGION Number 5 */\r
+#define LL_MPU_REGION_NUMBER6              0x06U /*!< REGION Number 6 */\r
+#define LL_MPU_REGION_NUMBER7              0x07U /*!< REGION Number 7 */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup CORTEX_LL_EC_REGION_SIZE MPU Region Size\r
+  * @{\r
+  */\r
+#define LL_MPU_REGION_SIZE_32B             (0x04U << MPU_RASR_SIZE_Pos) /*!< 32B Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_64B             (0x05U << MPU_RASR_SIZE_Pos) /*!< 64B Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_128B            (0x06U << MPU_RASR_SIZE_Pos) /*!< 128B Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_256B            (0x07U << MPU_RASR_SIZE_Pos) /*!< 256B Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_512B            (0x08U << MPU_RASR_SIZE_Pos) /*!< 512B Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_1KB             (0x09U << MPU_RASR_SIZE_Pos) /*!< 1KB Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_2KB             (0x0AU << MPU_RASR_SIZE_Pos) /*!< 2KB Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_4KB             (0x0BU << MPU_RASR_SIZE_Pos) /*!< 4KB Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_8KB             (0x0CU << MPU_RASR_SIZE_Pos) /*!< 8KB Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_16KB            (0x0DU << MPU_RASR_SIZE_Pos) /*!< 16KB Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_32KB            (0x0EU << MPU_RASR_SIZE_Pos) /*!< 32KB Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_64KB            (0x0FU << MPU_RASR_SIZE_Pos) /*!< 64KB Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_128KB           (0x10U << MPU_RASR_SIZE_Pos) /*!< 128KB Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_256KB           (0x11U << MPU_RASR_SIZE_Pos) /*!< 256KB Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_512KB           (0x12U << MPU_RASR_SIZE_Pos) /*!< 512KB Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_1MB             (0x13U << MPU_RASR_SIZE_Pos) /*!< 1MB Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_2MB             (0x14U << MPU_RASR_SIZE_Pos) /*!< 2MB Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_4MB             (0x15U << MPU_RASR_SIZE_Pos) /*!< 4MB Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_8MB             (0x16U << MPU_RASR_SIZE_Pos) /*!< 8MB Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_16MB            (0x17U << MPU_RASR_SIZE_Pos) /*!< 16MB Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_32MB            (0x18U << MPU_RASR_SIZE_Pos) /*!< 32MB Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_64MB            (0x19U << MPU_RASR_SIZE_Pos) /*!< 64MB Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_128MB           (0x1AU << MPU_RASR_SIZE_Pos) /*!< 128MB Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_256MB           (0x1BU << MPU_RASR_SIZE_Pos) /*!< 256MB Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_512MB           (0x1CU << MPU_RASR_SIZE_Pos) /*!< 512MB Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_1GB             (0x1DU << MPU_RASR_SIZE_Pos) /*!< 1GB Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_2GB             (0x1EU << MPU_RASR_SIZE_Pos) /*!< 2GB Size of the MPU protection region */\r
+#define LL_MPU_REGION_SIZE_4GB             (0x1FU << MPU_RASR_SIZE_Pos) /*!< 4GB Size of the MPU protection region */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup CORTEX_LL_EC_REGION_PRIVILEDGES MPU Region Privileges\r
+  * @{\r
+  */\r
+#define LL_MPU_REGION_NO_ACCESS            (0x00U << MPU_RASR_AP_Pos) /*!< No access*/\r
+#define LL_MPU_REGION_PRIV_RW              (0x01U << MPU_RASR_AP_Pos) /*!< RW privileged (privileged access only)*/\r
+#define LL_MPU_REGION_PRIV_RW_URO          (0x02U << MPU_RASR_AP_Pos) /*!< RW privileged - RO user (Write in a user program generates a fault) */\r
+#define LL_MPU_REGION_FULL_ACCESS          (0x03U << MPU_RASR_AP_Pos) /*!< RW privileged & user (Full access) */\r
+#define LL_MPU_REGION_PRIV_RO              (0x05U << MPU_RASR_AP_Pos) /*!< RO privileged (privileged read only)*/\r
+#define LL_MPU_REGION_PRIV_RO_URO          (0x06U << MPU_RASR_AP_Pos) /*!< RO privileged & user (read only) */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup CORTEX_LL_EC_TEX MPU TEX Level\r
+  * @{\r
+  */\r
+#define LL_MPU_TEX_LEVEL0                  (0x00U << MPU_RASR_TEX_Pos) /*!< b000 for TEX bits */\r
+#define LL_MPU_TEX_LEVEL1                  (0x01U << MPU_RASR_TEX_Pos) /*!< b001 for TEX bits */\r
+#define LL_MPU_TEX_LEVEL2                  (0x02U << MPU_RASR_TEX_Pos) /*!< b010 for TEX bits */\r
+#define LL_MPU_TEX_LEVEL4                  (0x04U << MPU_RASR_TEX_Pos) /*!< b100 for TEX bits */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup CORTEX_LL_EC_INSTRUCTION_ACCESS MPU Instruction Access\r
+  * @{\r
+  */\r
+#define LL_MPU_INSTRUCTION_ACCESS_ENABLE   0x00U            /*!< Instruction fetches enabled */\r
+#define LL_MPU_INSTRUCTION_ACCESS_DISABLE  MPU_RASR_XN_Msk  /*!< Instruction fetches disabled*/\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup CORTEX_LL_EC_SHAREABLE_ACCESS MPU Shareable Access\r
+  * @{\r
+  */\r
+#define LL_MPU_ACCESS_SHAREABLE            MPU_RASR_S_Msk   /*!< Shareable memory attribute */\r
+#define LL_MPU_ACCESS_NOT_SHAREABLE        0x00U            /*!< Not Shareable memory attribute */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup CORTEX_LL_EC_CACHEABLE_ACCESS MPU Cacheable Access\r
+  * @{\r
+  */\r
+#define LL_MPU_ACCESS_CACHEABLE            MPU_RASR_C_Msk   /*!< Cacheable memory attribute */\r
+#define LL_MPU_ACCESS_NOT_CACHEABLE        0x00U            /*!< Not Cacheable memory attribute */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup CORTEX_LL_EC_BUFFERABLE_ACCESS MPU Bufferable Access\r
+  * @{\r
+  */\r
+#define LL_MPU_ACCESS_BUFFERABLE           MPU_RASR_B_Msk   /*!< Bufferable memory attribute */\r
+#define LL_MPU_ACCESS_NOT_BUFFERABLE       0x00U            /*!< Not Bufferable memory attribute */\r
+/**\r
+  * @}\r
+  */\r
+#endif /* __MPU_PRESENT */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Exported macro ------------------------------------------------------------*/\r
+\r
+/* Exported functions --------------------------------------------------------*/\r
+/** @defgroup CORTEX_LL_Exported_Functions CORTEX Exported Functions\r
+  * @{\r
+  */\r
+\r
+/** @defgroup CORTEX_LL_EF_SYSTICK SYSTICK\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  This function checks if the Systick counter flag is active or not.\r
+  * @note   It can be used in timeout function on application side.\r
+  * @rmtoll STK_CTRL     COUNTFLAG     LL_SYSTICK_IsActiveCounterFlag\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_SYSTICK_IsActiveCounterFlag(void)\r
+{\r
+  return ((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == (SysTick_CTRL_COUNTFLAG_Msk));\r
+}\r
+\r
+/**\r
+  * @brief  Configures the SysTick clock source\r
+  * @rmtoll STK_CTRL     CLKSOURCE     LL_SYSTICK_SetClkSource\r
+  * @param  Source This parameter can be one of the following values:\r
+  *         @arg @ref LL_SYSTICK_CLKSOURCE_HCLK_DIV8\r
+  *         @arg @ref LL_SYSTICK_CLKSOURCE_HCLK\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_SYSTICK_SetClkSource(uint32_t Source)\r
+{\r
+  if (Source == LL_SYSTICK_CLKSOURCE_HCLK)\r
+  {\r
+    SET_BIT(SysTick->CTRL, LL_SYSTICK_CLKSOURCE_HCLK);\r
+  }\r
+  else\r
+  {\r
+    CLEAR_BIT(SysTick->CTRL, LL_SYSTICK_CLKSOURCE_HCLK);\r
+  }\r
+}\r
+\r
+/**\r
+  * @brief  Get the SysTick clock source\r
+  * @rmtoll STK_CTRL     CLKSOURCE     LL_SYSTICK_GetClkSource\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_SYSTICK_CLKSOURCE_HCLK_DIV8\r
+  *         @arg @ref LL_SYSTICK_CLKSOURCE_HCLK\r
+  */\r
+__STATIC_INLINE uint32_t LL_SYSTICK_GetClkSource(void)\r
+{\r
+  return READ_BIT(SysTick->CTRL, LL_SYSTICK_CLKSOURCE_HCLK);\r
+}\r
+\r
+/**\r
+  * @brief  Enable SysTick exception request\r
+  * @rmtoll STK_CTRL     TICKINT       LL_SYSTICK_EnableIT\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_SYSTICK_EnableIT(void)\r
+{\r
+  SET_BIT(SysTick->CTRL, SysTick_CTRL_TICKINT_Msk);\r
+}\r
+\r
+/**\r
+  * @brief  Disable SysTick exception request\r
+  * @rmtoll STK_CTRL     TICKINT       LL_SYSTICK_DisableIT\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_SYSTICK_DisableIT(void)\r
+{\r
+  CLEAR_BIT(SysTick->CTRL, SysTick_CTRL_TICKINT_Msk);\r
+}\r
+\r
+/**\r
+  * @brief  Checks if the SYSTICK interrupt is enabled or disabled.\r
+  * @rmtoll STK_CTRL     TICKINT       LL_SYSTICK_IsEnabledIT\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_SYSTICK_IsEnabledIT(void)\r
+{\r
+  return (READ_BIT(SysTick->CTRL, SysTick_CTRL_TICKINT_Msk) == (SysTick_CTRL_TICKINT_Msk));\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup CORTEX_LL_EF_LOW_POWER_MODE LOW POWER MODE\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Processor uses sleep as its low power mode\r
+  * @rmtoll SCB_SCR      SLEEPDEEP     LL_LPM_EnableSleep\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_LPM_EnableSleep(void)\r
+{\r
+  /* Clear SLEEPDEEP bit of Cortex System Control Register */\r
+  CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk));\r
+}\r
+\r
+/**\r
+  * @brief  Processor uses deep sleep as its low power mode\r
+  * @rmtoll SCB_SCR      SLEEPDEEP     LL_LPM_EnableDeepSleep\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_LPM_EnableDeepSleep(void)\r
+{\r
+  /* Set SLEEPDEEP bit of Cortex System Control Register */\r
+  SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk));\r
+}\r
+\r
+/**\r
+  * @brief  Configures sleep-on-exit when returning from Handler mode to Thread mode.\r
+  * @note   Setting this bit to 1 enables an interrupt-driven application to avoid returning to an\r
+  *         empty main application.\r
+  * @rmtoll SCB_SCR      SLEEPONEXIT   LL_LPM_EnableSleepOnExit\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_LPM_EnableSleepOnExit(void)\r
+{\r
+  /* Set SLEEPONEXIT bit of Cortex System Control Register */\r
+  SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPONEXIT_Msk));\r
+}\r
+\r
+/**\r
+  * @brief  Do not sleep when returning to Thread mode.\r
+  * @rmtoll SCB_SCR      SLEEPONEXIT   LL_LPM_DisableSleepOnExit\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_LPM_DisableSleepOnExit(void)\r
+{\r
+  /* Clear SLEEPONEXIT bit of Cortex System Control Register */\r
+  CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPONEXIT_Msk));\r
+}\r
+\r
+/**\r
+  * @brief  Enabled events and all interrupts, including disabled interrupts, can wakeup the\r
+  *         processor.\r
+  * @rmtoll SCB_SCR      SEVEONPEND    LL_LPM_EnableEventOnPend\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_LPM_EnableEventOnPend(void)\r
+{\r
+  /* Set SEVEONPEND bit of Cortex System Control Register */\r
+  SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SEVONPEND_Msk));\r
+}\r
+\r
+/**\r
+  * @brief  Only enabled interrupts or events can wakeup the processor, disabled interrupts are\r
+  *         excluded\r
+  * @rmtoll SCB_SCR      SEVEONPEND    LL_LPM_DisableEventOnPend\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_LPM_DisableEventOnPend(void)\r
+{\r
+  /* Clear SEVEONPEND bit of Cortex System Control Register */\r
+  CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SEVONPEND_Msk));\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup CORTEX_LL_EF_HANDLER HANDLER\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable a fault in System handler control register (SHCSR)\r
+  * @rmtoll SCB_SHCSR    MEMFAULTENA   LL_HANDLER_EnableFault\r
+  * @param  Fault This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_HANDLER_FAULT_USG\r
+  *         @arg @ref LL_HANDLER_FAULT_BUS\r
+  *         @arg @ref LL_HANDLER_FAULT_MEM\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_HANDLER_EnableFault(uint32_t Fault)\r
+{\r
+  /* Enable the system handler fault */\r
+  SET_BIT(SCB->SHCSR, Fault);\r
+}\r
+\r
+/**\r
+  * @brief  Disable a fault in System handler control register (SHCSR)\r
+  * @rmtoll SCB_SHCSR    MEMFAULTENA   LL_HANDLER_DisableFault\r
+  * @param  Fault This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_HANDLER_FAULT_USG\r
+  *         @arg @ref LL_HANDLER_FAULT_BUS\r
+  *         @arg @ref LL_HANDLER_FAULT_MEM\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_HANDLER_DisableFault(uint32_t Fault)\r
+{\r
+  /* Disable the system handler fault */\r
+  CLEAR_BIT(SCB->SHCSR, Fault);\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup CORTEX_LL_EF_MCU_INFO MCU INFO\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Get Implementer code\r
+  * @rmtoll SCB_CPUID    IMPLEMENTER   LL_CPUID_GetImplementer\r
+  * @retval Value should be equal to 0x41 for ARM\r
+  */\r
+__STATIC_INLINE uint32_t LL_CPUID_GetImplementer(void)\r
+{\r
+  return (uint32_t)(READ_BIT(SCB->CPUID, SCB_CPUID_IMPLEMENTER_Msk) >> SCB_CPUID_IMPLEMENTER_Pos);\r
+}\r
+\r
+/**\r
+  * @brief  Get Variant number (The r value in the rnpn product revision identifier)\r
+  * @rmtoll SCB_CPUID    VARIANT       LL_CPUID_GetVariant\r
+  * @retval Value between 0 and 255 (0x1: revision 1, 0x2: revision 2)\r
+  */\r
+__STATIC_INLINE uint32_t LL_CPUID_GetVariant(void)\r
+{\r
+  return (uint32_t)(READ_BIT(SCB->CPUID, SCB_CPUID_VARIANT_Msk) >> SCB_CPUID_VARIANT_Pos);\r
+}\r
+\r
+/**\r
+  * @brief  Get Constant number\r
+  * @rmtoll SCB_CPUID    ARCHITECTURE  LL_CPUID_GetConstant\r
+  * @retval Value should be equal to 0xF for Cortex-M3 devices\r
+  */\r
+__STATIC_INLINE uint32_t LL_CPUID_GetConstant(void)\r
+{\r
+  return (uint32_t)(READ_BIT(SCB->CPUID, SCB_CPUID_ARCHITECTURE_Msk) >> SCB_CPUID_ARCHITECTURE_Pos);\r
+}\r
+\r
+/**\r
+  * @brief  Get Part number\r
+  * @rmtoll SCB_CPUID    PARTNO        LL_CPUID_GetParNo\r
+  * @retval Value should be equal to 0xC23 for Cortex-M3\r
+  */\r
+__STATIC_INLINE uint32_t LL_CPUID_GetParNo(void)\r
+{\r
+  return (uint32_t)(READ_BIT(SCB->CPUID, SCB_CPUID_PARTNO_Msk) >> SCB_CPUID_PARTNO_Pos);\r
+}\r
+\r
+/**\r
+  * @brief  Get Revision number (The p value in the rnpn product revision identifier, indicates patch release)\r
+  * @rmtoll SCB_CPUID    REVISION      LL_CPUID_GetRevision\r
+  * @retval Value between 0 and 255 (0x0: patch 0, 0x1: patch 1)\r
+  */\r
+__STATIC_INLINE uint32_t LL_CPUID_GetRevision(void)\r
+{\r
+  return (uint32_t)(READ_BIT(SCB->CPUID, SCB_CPUID_REVISION_Msk) >> SCB_CPUID_REVISION_Pos);\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#if __MPU_PRESENT\r
+/** @defgroup CORTEX_LL_EF_MPU MPU\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable MPU with input options\r
+  * @rmtoll MPU_CTRL     ENABLE        LL_MPU_Enable\r
+  * @param  Options This parameter can be one of the following values:\r
+  *         @arg @ref LL_MPU_CTRL_HFNMI_PRIVDEF_NONE\r
+  *         @arg @ref LL_MPU_CTRL_HARDFAULT_NMI\r
+  *         @arg @ref LL_MPU_CTRL_PRIVILEGED_DEFAULT\r
+  *         @arg @ref LL_MPU_CTRL_HFNMI_PRIVDEF\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_MPU_Enable(uint32_t Options)\r
+{\r
+  /* Enable the MPU*/\r
+  WRITE_REG(MPU->CTRL, (MPU_CTRL_ENABLE_Msk | Options));\r
+  /* Ensure MPU settings take effects */\r
+  __DSB();\r
+  /* Sequence instruction fetches using update settings */\r
+  __ISB();\r
+}\r
+\r
+/**\r
+  * @brief  Disable MPU\r
+  * @rmtoll MPU_CTRL     ENABLE        LL_MPU_Disable\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_MPU_Disable(void)\r
+{\r
+  /* Make sure outstanding transfers are done */\r
+  __DMB();\r
+  /* Disable MPU*/\r
+  WRITE_REG(MPU->CTRL, 0U);\r
+}\r
+\r
+/**\r
+  * @brief  Check if MPU is enabled or not\r
+  * @rmtoll MPU_CTRL     ENABLE        LL_MPU_IsEnabled\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_MPU_IsEnabled(void)\r
+{\r
+  return (READ_BIT(MPU->CTRL, MPU_CTRL_ENABLE_Msk) == (MPU_CTRL_ENABLE_Msk));\r
+}\r
+\r
+/**\r
+  * @brief  Enable a MPU region\r
+  * @rmtoll MPU_RASR     ENABLE        LL_MPU_EnableRegion\r
+  * @param  Region This parameter can be one of the following values:\r
+  *         @arg @ref LL_MPU_REGION_NUMBER0\r
+  *         @arg @ref LL_MPU_REGION_NUMBER1\r
+  *         @arg @ref LL_MPU_REGION_NUMBER2\r
+  *         @arg @ref LL_MPU_REGION_NUMBER3\r
+  *         @arg @ref LL_MPU_REGION_NUMBER4\r
+  *         @arg @ref LL_MPU_REGION_NUMBER5\r
+  *         @arg @ref LL_MPU_REGION_NUMBER6\r
+  *         @arg @ref LL_MPU_REGION_NUMBER7\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_MPU_EnableRegion(uint32_t Region)\r
+{\r
+  /* Set Region number */\r
+  WRITE_REG(MPU->RNR, Region);\r
+  /* Enable the MPU region */\r
+  SET_BIT(MPU->RASR, MPU_RASR_ENABLE_Msk);\r
+}\r
+\r
+/**\r
+  * @brief  Configure and enable a region\r
+  * @rmtoll MPU_RNR      REGION        LL_MPU_ConfigRegion\n\r
+  *         MPU_RBAR     REGION        LL_MPU_ConfigRegion\n\r
+  *         MPU_RBAR     ADDR          LL_MPU_ConfigRegion\n\r
+  *         MPU_RASR     XN            LL_MPU_ConfigRegion\n\r
+  *         MPU_RASR     AP            LL_MPU_ConfigRegion\n\r
+  *         MPU_RASR     S             LL_MPU_ConfigRegion\n\r
+  *         MPU_RASR     C             LL_MPU_ConfigRegion\n\r
+  *         MPU_RASR     B             LL_MPU_ConfigRegion\n\r
+  *         MPU_RASR     SIZE          LL_MPU_ConfigRegion\r
+  * @param  Region This parameter can be one of the following values:\r
+  *         @arg @ref LL_MPU_REGION_NUMBER0\r
+  *         @arg @ref LL_MPU_REGION_NUMBER1\r
+  *         @arg @ref LL_MPU_REGION_NUMBER2\r
+  *         @arg @ref LL_MPU_REGION_NUMBER3\r
+  *         @arg @ref LL_MPU_REGION_NUMBER4\r
+  *         @arg @ref LL_MPU_REGION_NUMBER5\r
+  *         @arg @ref LL_MPU_REGION_NUMBER6\r
+  *         @arg @ref LL_MPU_REGION_NUMBER7\r
+  * @param  Address Value of region base address\r
+  * @param  SubRegionDisable Sub-region disable value between Min_Data = 0x00 and Max_Data = 0xFF\r
+  * @param  Attributes This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_MPU_REGION_SIZE_32B or @ref LL_MPU_REGION_SIZE_64B or @ref LL_MPU_REGION_SIZE_128B or @ref LL_MPU_REGION_SIZE_256B or @ref LL_MPU_REGION_SIZE_512B\r
+  *           or @ref LL_MPU_REGION_SIZE_1KB or @ref LL_MPU_REGION_SIZE_2KB or @ref LL_MPU_REGION_SIZE_4KB or @ref LL_MPU_REGION_SIZE_8KB or @ref LL_MPU_REGION_SIZE_16KB\r
+  *           or @ref LL_MPU_REGION_SIZE_32KB or @ref LL_MPU_REGION_SIZE_64KB or @ref LL_MPU_REGION_SIZE_128KB or @ref LL_MPU_REGION_SIZE_256KB or @ref LL_MPU_REGION_SIZE_512KB\r
+  *           or @ref LL_MPU_REGION_SIZE_1MB or @ref LL_MPU_REGION_SIZE_2MB or @ref LL_MPU_REGION_SIZE_4MB or @ref LL_MPU_REGION_SIZE_8MB or @ref LL_MPU_REGION_SIZE_16MB\r
+  *           or @ref LL_MPU_REGION_SIZE_32MB or @ref LL_MPU_REGION_SIZE_64MB or @ref LL_MPU_REGION_SIZE_128MB or @ref LL_MPU_REGION_SIZE_256MB or @ref LL_MPU_REGION_SIZE_512MB\r
+  *           or @ref LL_MPU_REGION_SIZE_1GB or @ref LL_MPU_REGION_SIZE_2GB or @ref LL_MPU_REGION_SIZE_4GB\r
+  *         @arg @ref LL_MPU_REGION_NO_ACCESS or @ref LL_MPU_REGION_PRIV_RW or @ref LL_MPU_REGION_PRIV_RW_URO or @ref LL_MPU_REGION_FULL_ACCESS\r
+  *           or @ref LL_MPU_REGION_PRIV_RO or @ref LL_MPU_REGION_PRIV_RO_URO\r
+  *         @arg @ref LL_MPU_TEX_LEVEL0 or @ref LL_MPU_TEX_LEVEL1 or @ref LL_MPU_TEX_LEVEL2 or @ref LL_MPU_TEX_LEVEL4\r
+  *         @arg @ref LL_MPU_INSTRUCTION_ACCESS_ENABLE or  @ref LL_MPU_INSTRUCTION_ACCESS_DISABLE\r
+  *         @arg @ref LL_MPU_ACCESS_SHAREABLE or @ref LL_MPU_ACCESS_NOT_SHAREABLE\r
+  *         @arg @ref LL_MPU_ACCESS_CACHEABLE or @ref LL_MPU_ACCESS_NOT_CACHEABLE\r
+  *         @arg @ref LL_MPU_ACCESS_BUFFERABLE or @ref LL_MPU_ACCESS_NOT_BUFFERABLE\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_MPU_ConfigRegion(uint32_t Region, uint32_t SubRegionDisable, uint32_t Address, uint32_t Attributes)\r
+{\r
+  /* Set Region number */\r
+  WRITE_REG(MPU->RNR, Region);\r
+  /* Set base address */\r
+  WRITE_REG(MPU->RBAR, (Address & 0xFFFFFFE0U));\r
+  /* Configure MPU */\r
+  WRITE_REG(MPU->RASR, (MPU_RASR_ENABLE_Msk | Attributes | SubRegionDisable << MPU_RASR_SRD_Pos));\r
+}\r
+\r
+/**\r
+  * @brief  Disable a region\r
+  * @rmtoll MPU_RNR      REGION        LL_MPU_DisableRegion\n\r
+  *         MPU_RASR     ENABLE        LL_MPU_DisableRegion\r
+  * @param  Region This parameter can be one of the following values:\r
+  *         @arg @ref LL_MPU_REGION_NUMBER0\r
+  *         @arg @ref LL_MPU_REGION_NUMBER1\r
+  *         @arg @ref LL_MPU_REGION_NUMBER2\r
+  *         @arg @ref LL_MPU_REGION_NUMBER3\r
+  *         @arg @ref LL_MPU_REGION_NUMBER4\r
+  *         @arg @ref LL_MPU_REGION_NUMBER5\r
+  *         @arg @ref LL_MPU_REGION_NUMBER6\r
+  *         @arg @ref LL_MPU_REGION_NUMBER7\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_MPU_DisableRegion(uint32_t Region)\r
+{\r
+  /* Set Region number */\r
+  WRITE_REG(MPU->RNR, Region);\r
+  /* Disable the MPU region */\r
+  CLEAR_BIT(MPU->RASR, MPU_RASR_ENABLE_Msk);\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* __MPU_PRESENT */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __STM32F1xx_LL_CORTEX_H */\r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_dma.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_dma.h
new file mode 100644 (file)
index 0000000..9ebff4e
--- /dev/null
@@ -0,0 +1,1960 @@
+/**\r
+  ******************************************************************************\r
+  * @file    stm32f1xx_ll_dma.h\r
+  * @author  MCD Application Team\r
+  * @brief   Header file of DMA LL module.\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+\r
+/* Define to prevent recursive inclusion -------------------------------------*/\r
+#ifndef __STM32F1xx_LL_DMA_H\r
+#define __STM32F1xx_LL_DMA_H\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/* Includes ------------------------------------------------------------------*/\r
+#include "stm32f1xx.h"\r
+\r
+/** @addtogroup STM32F1xx_LL_Driver\r
+  * @{\r
+  */\r
+\r
+#if defined (DMA1) || defined (DMA2)\r
+\r
+/** @defgroup DMA_LL DMA\r
+  * @{\r
+  */\r
+\r
+/* Private types -------------------------------------------------------------*/\r
+/* Private variables ---------------------------------------------------------*/\r
+/** @defgroup DMA_LL_Private_Variables DMA Private Variables\r
+  * @{\r
+  */\r
+/* Array used to get the DMA channel register offset versus channel index LL_DMA_CHANNEL_x */\r
+static const uint8_t CHANNEL_OFFSET_TAB[] =\r
+{\r
+  (uint8_t)(DMA1_Channel1_BASE - DMA1_BASE),\r
+  (uint8_t)(DMA1_Channel2_BASE - DMA1_BASE),\r
+  (uint8_t)(DMA1_Channel3_BASE - DMA1_BASE),\r
+  (uint8_t)(DMA1_Channel4_BASE - DMA1_BASE),\r
+  (uint8_t)(DMA1_Channel5_BASE - DMA1_BASE),\r
+  (uint8_t)(DMA1_Channel6_BASE - DMA1_BASE),\r
+  (uint8_t)(DMA1_Channel7_BASE - DMA1_BASE)\r
+};\r
+/**\r
+  * @}\r
+  */\r
+/* Private constants ---------------------------------------------------------*/\r
+/* Private macros ------------------------------------------------------------*/\r
+#if defined(USE_FULL_LL_DRIVER)\r
+/** @defgroup DMA_LL_Private_Macros DMA Private Macros\r
+  * @{\r
+  */\r
+/**\r
+  * @}\r
+  */\r
+#endif /*USE_FULL_LL_DRIVER*/\r
+\r
+/* Exported types ------------------------------------------------------------*/\r
+#if defined(USE_FULL_LL_DRIVER)\r
+/** @defgroup DMA_LL_ES_INIT DMA Exported Init structure\r
+  * @{\r
+  */\r
+typedef struct\r
+{\r
+  uint32_t PeriphOrM2MSrcAddress;  /*!< Specifies the peripheral base address for DMA transfer\r
+                                        or as Source base address in case of memory to memory transfer direction.\r
+\r
+                                        This parameter must be a value between Min_Data = 0 and Max_Data = 0xFFFFFFFF. */\r
+\r
+  uint32_t MemoryOrM2MDstAddress;  /*!< Specifies the memory base address for DMA transfer\r
+                                        or as Destination base address in case of memory to memory transfer direction.\r
+\r
+                                        This parameter must be a value between Min_Data = 0 and Max_Data = 0xFFFFFFFF. */\r
+\r
+  uint32_t Direction;              /*!< Specifies if the data will be transferred from memory to peripheral,\r
+                                        from memory to memory or from peripheral to memory.\r
+                                        This parameter can be a value of @ref DMA_LL_EC_DIRECTION\r
+\r
+                                        This feature can be modified afterwards using unitary function @ref LL_DMA_SetDataTransferDirection(). */\r
+\r
+  uint32_t Mode;                   /*!< Specifies the normal or circular operation mode.\r
+                                        This parameter can be a value of @ref DMA_LL_EC_MODE\r
+                                        @note: The circular buffer mode cannot be used if the memory to memory\r
+                                               data transfer direction is configured on the selected Channel\r
+\r
+                                        This feature can be modified afterwards using unitary function @ref LL_DMA_SetMode(). */\r
+\r
+  uint32_t PeriphOrM2MSrcIncMode;  /*!< Specifies whether the Peripheral address or Source address in case of memory to memory transfer direction\r
+                                        is incremented or not.\r
+                                        This parameter can be a value of @ref DMA_LL_EC_PERIPH\r
+\r
+                                        This feature can be modified afterwards using unitary function @ref LL_DMA_SetPeriphIncMode(). */\r
+\r
+  uint32_t MemoryOrM2MDstIncMode;  /*!< Specifies whether the Memory address or Destination address in case of memory to memory transfer direction\r
+                                        is incremented or not.\r
+                                        This parameter can be a value of @ref DMA_LL_EC_MEMORY\r
+\r
+                                        This feature can be modified afterwards using unitary function @ref LL_DMA_SetMemoryIncMode(). */\r
+\r
+  uint32_t PeriphOrM2MSrcDataSize; /*!< Specifies the Peripheral data size alignment or Source data size alignment (byte, half word, word)\r
+                                        in case of memory to memory transfer direction.\r
+                                        This parameter can be a value of @ref DMA_LL_EC_PDATAALIGN\r
+\r
+                                        This feature can be modified afterwards using unitary function @ref LL_DMA_SetPeriphSize(). */\r
+\r
+  uint32_t MemoryOrM2MDstDataSize; /*!< Specifies the Memory data size alignment or Destination data size alignment (byte, half word, word)\r
+                                        in case of memory to memory transfer direction.\r
+                                        This parameter can be a value of @ref DMA_LL_EC_MDATAALIGN\r
+\r
+                                        This feature can be modified afterwards using unitary function @ref LL_DMA_SetMemorySize(). */\r
+\r
+  uint32_t NbData;                 /*!< Specifies the number of data to transfer, in data unit.\r
+                                        The data unit is equal to the source buffer configuration set in PeripheralSize\r
+                                        or MemorySize parameters depending in the transfer direction.\r
+                                        This parameter must be a value between Min_Data = 0 and Max_Data = 0x0000FFFF\r
+\r
+                                        This feature can be modified afterwards using unitary function @ref LL_DMA_SetDataLength(). */\r
+\r
+  uint32_t Priority;               /*!< Specifies the channel priority level.\r
+                                        This parameter can be a value of @ref DMA_LL_EC_PRIORITY\r
+\r
+                                        This feature can be modified afterwards using unitary function @ref LL_DMA_SetChannelPriorityLevel(). */\r
+\r
+} LL_DMA_InitTypeDef;\r
+/**\r
+  * @}\r
+  */\r
+#endif /*USE_FULL_LL_DRIVER*/\r
+\r
+/* Exported constants --------------------------------------------------------*/\r
+/** @defgroup DMA_LL_Exported_Constants DMA Exported Constants\r
+  * @{\r
+  */\r
+/** @defgroup DMA_LL_EC_CLEAR_FLAG Clear Flags Defines\r
+  * @brief    Flags defines which can be used with LL_DMA_WriteReg function\r
+  * @{\r
+  */\r
+#define LL_DMA_IFCR_CGIF1                 DMA_IFCR_CGIF1        /*!< Channel 1 global flag            */\r
+#define LL_DMA_IFCR_CTCIF1                DMA_IFCR_CTCIF1       /*!< Channel 1 transfer complete flag */\r
+#define LL_DMA_IFCR_CHTIF1                DMA_IFCR_CHTIF1       /*!< Channel 1 half transfer flag     */\r
+#define LL_DMA_IFCR_CTEIF1                DMA_IFCR_CTEIF1       /*!< Channel 1 transfer error flag    */\r
+#define LL_DMA_IFCR_CGIF2                 DMA_IFCR_CGIF2        /*!< Channel 2 global flag            */\r
+#define LL_DMA_IFCR_CTCIF2                DMA_IFCR_CTCIF2       /*!< Channel 2 transfer complete flag */\r
+#define LL_DMA_IFCR_CHTIF2                DMA_IFCR_CHTIF2       /*!< Channel 2 half transfer flag     */\r
+#define LL_DMA_IFCR_CTEIF2                DMA_IFCR_CTEIF2       /*!< Channel 2 transfer error flag    */\r
+#define LL_DMA_IFCR_CGIF3                 DMA_IFCR_CGIF3        /*!< Channel 3 global flag            */\r
+#define LL_DMA_IFCR_CTCIF3                DMA_IFCR_CTCIF3       /*!< Channel 3 transfer complete flag */\r
+#define LL_DMA_IFCR_CHTIF3                DMA_IFCR_CHTIF3       /*!< Channel 3 half transfer flag     */\r
+#define LL_DMA_IFCR_CTEIF3                DMA_IFCR_CTEIF3       /*!< Channel 3 transfer error flag    */\r
+#define LL_DMA_IFCR_CGIF4                 DMA_IFCR_CGIF4        /*!< Channel 4 global flag            */\r
+#define LL_DMA_IFCR_CTCIF4                DMA_IFCR_CTCIF4       /*!< Channel 4 transfer complete flag */\r
+#define LL_DMA_IFCR_CHTIF4                DMA_IFCR_CHTIF4       /*!< Channel 4 half transfer flag     */\r
+#define LL_DMA_IFCR_CTEIF4                DMA_IFCR_CTEIF4       /*!< Channel 4 transfer error flag    */\r
+#define LL_DMA_IFCR_CGIF5                 DMA_IFCR_CGIF5        /*!< Channel 5 global flag            */\r
+#define LL_DMA_IFCR_CTCIF5                DMA_IFCR_CTCIF5       /*!< Channel 5 transfer complete flag */\r
+#define LL_DMA_IFCR_CHTIF5                DMA_IFCR_CHTIF5       /*!< Channel 5 half transfer flag     */\r
+#define LL_DMA_IFCR_CTEIF5                DMA_IFCR_CTEIF5       /*!< Channel 5 transfer error flag    */\r
+#define LL_DMA_IFCR_CGIF6                 DMA_IFCR_CGIF6        /*!< Channel 6 global flag            */\r
+#define LL_DMA_IFCR_CTCIF6                DMA_IFCR_CTCIF6       /*!< Channel 6 transfer complete flag */\r
+#define LL_DMA_IFCR_CHTIF6                DMA_IFCR_CHTIF6       /*!< Channel 6 half transfer flag     */\r
+#define LL_DMA_IFCR_CTEIF6                DMA_IFCR_CTEIF6       /*!< Channel 6 transfer error flag    */\r
+#define LL_DMA_IFCR_CGIF7                 DMA_IFCR_CGIF7        /*!< Channel 7 global flag            */\r
+#define LL_DMA_IFCR_CTCIF7                DMA_IFCR_CTCIF7       /*!< Channel 7 transfer complete flag */\r
+#define LL_DMA_IFCR_CHTIF7                DMA_IFCR_CHTIF7       /*!< Channel 7 half transfer flag     */\r
+#define LL_DMA_IFCR_CTEIF7                DMA_IFCR_CTEIF7       /*!< Channel 7 transfer error flag    */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup DMA_LL_EC_GET_FLAG Get Flags Defines\r
+  * @brief    Flags defines which can be used with LL_DMA_ReadReg function\r
+  * @{\r
+  */\r
+#define LL_DMA_ISR_GIF1                   DMA_ISR_GIF1          /*!< Channel 1 global flag            */\r
+#define LL_DMA_ISR_TCIF1                  DMA_ISR_TCIF1         /*!< Channel 1 transfer complete flag */\r
+#define LL_DMA_ISR_HTIF1                  DMA_ISR_HTIF1         /*!< Channel 1 half transfer flag     */\r
+#define LL_DMA_ISR_TEIF1                  DMA_ISR_TEIF1         /*!< Channel 1 transfer error flag    */\r
+#define LL_DMA_ISR_GIF2                   DMA_ISR_GIF2          /*!< Channel 2 global flag            */\r
+#define LL_DMA_ISR_TCIF2                  DMA_ISR_TCIF2         /*!< Channel 2 transfer complete flag */\r
+#define LL_DMA_ISR_HTIF2                  DMA_ISR_HTIF2         /*!< Channel 2 half transfer flag     */\r
+#define LL_DMA_ISR_TEIF2                  DMA_ISR_TEIF2         /*!< Channel 2 transfer error flag    */\r
+#define LL_DMA_ISR_GIF3                   DMA_ISR_GIF3          /*!< Channel 3 global flag            */\r
+#define LL_DMA_ISR_TCIF3                  DMA_ISR_TCIF3         /*!< Channel 3 transfer complete flag */\r
+#define LL_DMA_ISR_HTIF3                  DMA_ISR_HTIF3         /*!< Channel 3 half transfer flag     */\r
+#define LL_DMA_ISR_TEIF3                  DMA_ISR_TEIF3         /*!< Channel 3 transfer error flag    */\r
+#define LL_DMA_ISR_GIF4                   DMA_ISR_GIF4          /*!< Channel 4 global flag            */\r
+#define LL_DMA_ISR_TCIF4                  DMA_ISR_TCIF4         /*!< Channel 4 transfer complete flag */\r
+#define LL_DMA_ISR_HTIF4                  DMA_ISR_HTIF4         /*!< Channel 4 half transfer flag     */\r
+#define LL_DMA_ISR_TEIF4                  DMA_ISR_TEIF4         /*!< Channel 4 transfer error flag    */\r
+#define LL_DMA_ISR_GIF5                   DMA_ISR_GIF5          /*!< Channel 5 global flag            */\r
+#define LL_DMA_ISR_TCIF5                  DMA_ISR_TCIF5         /*!< Channel 5 transfer complete flag */\r
+#define LL_DMA_ISR_HTIF5                  DMA_ISR_HTIF5         /*!< Channel 5 half transfer flag     */\r
+#define LL_DMA_ISR_TEIF5                  DMA_ISR_TEIF5         /*!< Channel 5 transfer error flag    */\r
+#define LL_DMA_ISR_GIF6                   DMA_ISR_GIF6          /*!< Channel 6 global flag            */\r
+#define LL_DMA_ISR_TCIF6                  DMA_ISR_TCIF6         /*!< Channel 6 transfer complete flag */\r
+#define LL_DMA_ISR_HTIF6                  DMA_ISR_HTIF6         /*!< Channel 6 half transfer flag     */\r
+#define LL_DMA_ISR_TEIF6                  DMA_ISR_TEIF6         /*!< Channel 6 transfer error flag    */\r
+#define LL_DMA_ISR_GIF7                   DMA_ISR_GIF7          /*!< Channel 7 global flag            */\r
+#define LL_DMA_ISR_TCIF7                  DMA_ISR_TCIF7         /*!< Channel 7 transfer complete flag */\r
+#define LL_DMA_ISR_HTIF7                  DMA_ISR_HTIF7         /*!< Channel 7 half transfer flag     */\r
+#define LL_DMA_ISR_TEIF7                  DMA_ISR_TEIF7         /*!< Channel 7 transfer error flag    */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup DMA_LL_EC_IT IT Defines\r
+  * @brief    IT defines which can be used with LL_DMA_ReadReg and  LL_DMA_WriteReg functions\r
+  * @{\r
+  */\r
+#define LL_DMA_CCR_TCIE                   DMA_CCR_TCIE          /*!< Transfer complete interrupt */\r
+#define LL_DMA_CCR_HTIE                   DMA_CCR_HTIE          /*!< Half Transfer interrupt     */\r
+#define LL_DMA_CCR_TEIE                   DMA_CCR_TEIE          /*!< Transfer error interrupt    */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup DMA_LL_EC_CHANNEL CHANNEL\r
+  * @{\r
+  */\r
+#define LL_DMA_CHANNEL_1                  0x00000001U /*!< DMA Channel 1 */\r
+#define LL_DMA_CHANNEL_2                  0x00000002U /*!< DMA Channel 2 */\r
+#define LL_DMA_CHANNEL_3                  0x00000003U /*!< DMA Channel 3 */\r
+#define LL_DMA_CHANNEL_4                  0x00000004U /*!< DMA Channel 4 */\r
+#define LL_DMA_CHANNEL_5                  0x00000005U /*!< DMA Channel 5 */\r
+#define LL_DMA_CHANNEL_6                  0x00000006U /*!< DMA Channel 6 */\r
+#define LL_DMA_CHANNEL_7                  0x00000007U /*!< DMA Channel 7 */\r
+#if defined(USE_FULL_LL_DRIVER)\r
+#define LL_DMA_CHANNEL_ALL                0xFFFF0000U /*!< DMA Channel all (used only for function @ref LL_DMA_DeInit(). */\r
+#endif /*USE_FULL_LL_DRIVER*/\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup DMA_LL_EC_DIRECTION Transfer Direction\r
+  * @{\r
+  */\r
+#define LL_DMA_DIRECTION_PERIPH_TO_MEMORY 0x00000000U             /*!< Peripheral to memory direction */\r
+#define LL_DMA_DIRECTION_MEMORY_TO_PERIPH DMA_CCR_DIR             /*!< Memory to peripheral direction */\r
+#define LL_DMA_DIRECTION_MEMORY_TO_MEMORY DMA_CCR_MEM2MEM         /*!< Memory to memory direction     */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup DMA_LL_EC_MODE Transfer mode\r
+  * @{\r
+  */\r
+#define LL_DMA_MODE_NORMAL                0x00000000U             /*!< Normal Mode                  */\r
+#define LL_DMA_MODE_CIRCULAR              DMA_CCR_CIRC            /*!< Circular Mode                */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup DMA_LL_EC_PERIPH Peripheral increment mode\r
+  * @{\r
+  */\r
+#define LL_DMA_PERIPH_INCREMENT           DMA_CCR_PINC            /*!< Peripheral increment mode Enable */\r
+#define LL_DMA_PERIPH_NOINCREMENT         0x00000000U             /*!< Peripheral increment mode Disable */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup DMA_LL_EC_MEMORY Memory increment mode\r
+  * @{\r
+  */\r
+#define LL_DMA_MEMORY_INCREMENT           DMA_CCR_MINC            /*!< Memory increment mode Enable  */\r
+#define LL_DMA_MEMORY_NOINCREMENT         0x00000000U             /*!< Memory increment mode Disable */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup DMA_LL_EC_PDATAALIGN Peripheral data alignment\r
+  * @{\r
+  */\r
+#define LL_DMA_PDATAALIGN_BYTE            0x00000000U             /*!< Peripheral data alignment : Byte     */\r
+#define LL_DMA_PDATAALIGN_HALFWORD        DMA_CCR_PSIZE_0         /*!< Peripheral data alignment : HalfWord */\r
+#define LL_DMA_PDATAALIGN_WORD            DMA_CCR_PSIZE_1         /*!< Peripheral data alignment : Word     */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup DMA_LL_EC_MDATAALIGN Memory data alignment\r
+  * @{\r
+  */\r
+#define LL_DMA_MDATAALIGN_BYTE            0x00000000U             /*!< Memory data alignment : Byte     */\r
+#define LL_DMA_MDATAALIGN_HALFWORD        DMA_CCR_MSIZE_0         /*!< Memory data alignment : HalfWord */\r
+#define LL_DMA_MDATAALIGN_WORD            DMA_CCR_MSIZE_1         /*!< Memory data alignment : Word     */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup DMA_LL_EC_PRIORITY Transfer Priority level\r
+  * @{\r
+  */\r
+#define LL_DMA_PRIORITY_LOW               0x00000000U             /*!< Priority level : Low       */\r
+#define LL_DMA_PRIORITY_MEDIUM            DMA_CCR_PL_0            /*!< Priority level : Medium    */\r
+#define LL_DMA_PRIORITY_HIGH              DMA_CCR_PL_1            /*!< Priority level : High      */\r
+#define LL_DMA_PRIORITY_VERYHIGH          DMA_CCR_PL              /*!< Priority level : Very_High */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Exported macro ------------------------------------------------------------*/\r
+/** @defgroup DMA_LL_Exported_Macros DMA Exported Macros\r
+  * @{\r
+  */\r
+\r
+/** @defgroup DMA_LL_EM_WRITE_READ Common Write and read registers macros\r
+  * @{\r
+  */\r
+/**\r
+  * @brief  Write a value in DMA register\r
+  * @param  __INSTANCE__ DMA Instance\r
+  * @param  __REG__ Register to be written\r
+  * @param  __VALUE__ Value to be written in the register\r
+  * @retval None\r
+  */\r
+#define LL_DMA_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))\r
+\r
+/**\r
+  * @brief  Read a value in DMA register\r
+  * @param  __INSTANCE__ DMA Instance\r
+  * @param  __REG__ Register to be read\r
+  * @retval Register value\r
+  */\r
+#define LL_DMA_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup DMA_LL_EM_CONVERT_DMAxCHANNELy Convert DMAxChannely\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Convert DMAx_Channely into DMAx\r
+  * @param  __CHANNEL_INSTANCE__ DMAx_Channely\r
+  * @retval DMAx\r
+  */\r
+#if defined(DMA2)\r
+#define __LL_DMA_GET_INSTANCE(__CHANNEL_INSTANCE__)   \\r
+(((uint32_t)(__CHANNEL_INSTANCE__) > ((uint32_t)DMA1_Channel7)) ?  DMA2 : DMA1)\r
+#else\r
+#define __LL_DMA_GET_INSTANCE(__CHANNEL_INSTANCE__)  (DMA1)\r
+#endif\r
+\r
+/**\r
+  * @brief  Convert DMAx_Channely into LL_DMA_CHANNEL_y\r
+  * @param  __CHANNEL_INSTANCE__ DMAx_Channely\r
+  * @retval LL_DMA_CHANNEL_y\r
+  */\r
+#if defined (DMA2)\r
+#define __LL_DMA_GET_CHANNEL(__CHANNEL_INSTANCE__)   \\r
+(((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel1)) ? LL_DMA_CHANNEL_1 : \\r
+ ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA2_Channel1)) ? LL_DMA_CHANNEL_1 : \\r
+ ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel2)) ? LL_DMA_CHANNEL_2 : \\r
+ ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA2_Channel2)) ? LL_DMA_CHANNEL_2 : \\r
+ ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel3)) ? LL_DMA_CHANNEL_3 : \\r
+ ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA2_Channel3)) ? LL_DMA_CHANNEL_3 : \\r
+ ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel4)) ? LL_DMA_CHANNEL_4 : \\r
+ ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA2_Channel4)) ? LL_DMA_CHANNEL_4 : \\r
+ ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel5)) ? LL_DMA_CHANNEL_5 : \\r
+ ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA2_Channel5)) ? LL_DMA_CHANNEL_5 : \\r
+ ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel6)) ? LL_DMA_CHANNEL_6 : \\r
+ LL_DMA_CHANNEL_7)\r
+#else\r
+#define __LL_DMA_GET_CHANNEL(__CHANNEL_INSTANCE__)   \\r
+(((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel1)) ? LL_DMA_CHANNEL_1 : \\r
+ ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel2)) ? LL_DMA_CHANNEL_2 : \\r
+ ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel3)) ? LL_DMA_CHANNEL_3 : \\r
+ ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel4)) ? LL_DMA_CHANNEL_4 : \\r
+ ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel5)) ? LL_DMA_CHANNEL_5 : \\r
+ ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel6)) ? LL_DMA_CHANNEL_6 : \\r
+ LL_DMA_CHANNEL_7)\r
+#endif\r
+\r
+/**\r
+  * @brief  Convert DMA Instance DMAx and LL_DMA_CHANNEL_y into DMAx_Channely\r
+  * @param  __DMA_INSTANCE__ DMAx\r
+  * @param  __CHANNEL__ LL_DMA_CHANNEL_y\r
+  * @retval DMAx_Channely\r
+  */\r
+#if defined (DMA2)\r
+#define __LL_DMA_GET_CHANNEL_INSTANCE(__DMA_INSTANCE__, __CHANNEL__)   \\r
+((((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_1))) ? DMA1_Channel1 : \\r
+ (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA2)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_1))) ? DMA2_Channel1 : \\r
+ (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_2))) ? DMA1_Channel2 : \\r
+ (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA2)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_2))) ? DMA2_Channel2 : \\r
+ (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_3))) ? DMA1_Channel3 : \\r
+ (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA2)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_3))) ? DMA2_Channel3 : \\r
+ (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_4))) ? DMA1_Channel4 : \\r
+ (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA2)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_4))) ? DMA2_Channel4 : \\r
+ (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_5))) ? DMA1_Channel5 : \\r
+ (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA2)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_5))) ? DMA2_Channel5 : \\r
+ (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_6))) ? DMA1_Channel6 : \\r
+ DMA1_Channel7)\r
+#else\r
+#define __LL_DMA_GET_CHANNEL_INSTANCE(__DMA_INSTANCE__, __CHANNEL__)   \\r
+((((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_1))) ? DMA1_Channel1 : \\r
+ (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_2))) ? DMA1_Channel2 : \\r
+ (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_3))) ? DMA1_Channel3 : \\r
+ (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_4))) ? DMA1_Channel4 : \\r
+ (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_5))) ? DMA1_Channel5 : \\r
+ (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_6))) ? DMA1_Channel6 : \\r
+ DMA1_Channel7)\r
+#endif\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Exported functions --------------------------------------------------------*/\r
+/** @defgroup DMA_LL_Exported_Functions DMA Exported Functions\r
+ * @{\r
+ */\r
+\r
+/** @defgroup DMA_LL_EF_Configuration Configuration\r
+  * @{\r
+  */\r
+/**\r
+  * @brief  Enable DMA channel.\r
+  * @rmtoll CCR          EN            LL_DMA_EnableChannel\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_EnableChannel(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  SET_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_EN);\r
+}\r
+\r
+/**\r
+  * @brief  Disable DMA channel.\r
+  * @rmtoll CCR          EN            LL_DMA_DisableChannel\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_DisableChannel(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  CLEAR_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_EN);\r
+}\r
+\r
+/**\r
+  * @brief  Check if DMA channel is enabled or disabled.\r
+  * @rmtoll CCR          EN            LL_DMA_IsEnabledChannel\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsEnabledChannel(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR,\r
+                   DMA_CCR_EN) == (DMA_CCR_EN));\r
+}\r
+\r
+/**\r
+  * @brief  Configure all parameters link to DMA transfer.\r
+  * @rmtoll CCR          DIR           LL_DMA_ConfigTransfer\n\r
+  *         CCR          MEM2MEM       LL_DMA_ConfigTransfer\n\r
+  *         CCR          CIRC          LL_DMA_ConfigTransfer\n\r
+  *         CCR          PINC          LL_DMA_ConfigTransfer\n\r
+  *         CCR          MINC          LL_DMA_ConfigTransfer\n\r
+  *         CCR          PSIZE         LL_DMA_ConfigTransfer\n\r
+  *         CCR          MSIZE         LL_DMA_ConfigTransfer\n\r
+  *         CCR          PL            LL_DMA_ConfigTransfer\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @param  Configuration This parameter must be a combination of all the following values:\r
+  *         @arg @ref LL_DMA_DIRECTION_PERIPH_TO_MEMORY or @ref LL_DMA_DIRECTION_MEMORY_TO_PERIPH or @ref LL_DMA_DIRECTION_MEMORY_TO_MEMORY\r
+  *         @arg @ref LL_DMA_MODE_NORMAL or @ref LL_DMA_MODE_CIRCULAR\r
+  *         @arg @ref LL_DMA_PERIPH_INCREMENT or @ref LL_DMA_PERIPH_NOINCREMENT\r
+  *         @arg @ref LL_DMA_MEMORY_INCREMENT or @ref LL_DMA_MEMORY_NOINCREMENT\r
+  *         @arg @ref LL_DMA_PDATAALIGN_BYTE or @ref LL_DMA_PDATAALIGN_HALFWORD or @ref LL_DMA_PDATAALIGN_WORD\r
+  *         @arg @ref LL_DMA_MDATAALIGN_BYTE or @ref LL_DMA_MDATAALIGN_HALFWORD or @ref LL_DMA_MDATAALIGN_WORD\r
+  *         @arg @ref LL_DMA_PRIORITY_LOW or @ref LL_DMA_PRIORITY_MEDIUM or @ref LL_DMA_PRIORITY_HIGH or @ref LL_DMA_PRIORITY_VERYHIGH\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ConfigTransfer(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t Configuration)\r
+{\r
+  MODIFY_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR,\r
+             DMA_CCR_DIR | DMA_CCR_MEM2MEM | DMA_CCR_CIRC | DMA_CCR_PINC | DMA_CCR_MINC | DMA_CCR_PSIZE | DMA_CCR_MSIZE | DMA_CCR_PL,\r
+             Configuration);\r
+}\r
+\r
+/**\r
+  * @brief  Set Data transfer direction (read from peripheral or from memory).\r
+  * @rmtoll CCR          DIR           LL_DMA_SetDataTransferDirection\n\r
+  *         CCR          MEM2MEM       LL_DMA_SetDataTransferDirection\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @param  Direction This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_DIRECTION_PERIPH_TO_MEMORY\r
+  *         @arg @ref LL_DMA_DIRECTION_MEMORY_TO_PERIPH\r
+  *         @arg @ref LL_DMA_DIRECTION_MEMORY_TO_MEMORY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_SetDataTransferDirection(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t Direction)\r
+{\r
+  MODIFY_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR,\r
+             DMA_CCR_DIR | DMA_CCR_MEM2MEM, Direction);\r
+}\r
+\r
+/**\r
+  * @brief  Get Data transfer direction (read from peripheral or from memory).\r
+  * @rmtoll CCR          DIR           LL_DMA_GetDataTransferDirection\n\r
+  *         CCR          MEM2MEM       LL_DMA_GetDataTransferDirection\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_DMA_DIRECTION_PERIPH_TO_MEMORY\r
+  *         @arg @ref LL_DMA_DIRECTION_MEMORY_TO_PERIPH\r
+  *         @arg @ref LL_DMA_DIRECTION_MEMORY_TO_MEMORY\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_GetDataTransferDirection(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR,\r
+                   DMA_CCR_DIR | DMA_CCR_MEM2MEM));\r
+}\r
+\r
+/**\r
+  * @brief  Set DMA mode circular or normal.\r
+  * @note The circular buffer mode cannot be used if the memory-to-memory\r
+  * data transfer is configured on the selected Channel.\r
+  * @rmtoll CCR          CIRC          LL_DMA_SetMode\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @param  Mode This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_MODE_NORMAL\r
+  *         @arg @ref LL_DMA_MODE_CIRCULAR\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_SetMode(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t Mode)\r
+{\r
+  MODIFY_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_CIRC,\r
+             Mode);\r
+}\r
+\r
+/**\r
+  * @brief  Get DMA mode circular or normal.\r
+  * @rmtoll CCR          CIRC          LL_DMA_GetMode\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_DMA_MODE_NORMAL\r
+  *         @arg @ref LL_DMA_MODE_CIRCULAR\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_GetMode(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR,\r
+                   DMA_CCR_CIRC));\r
+}\r
+\r
+/**\r
+  * @brief  Set Peripheral increment mode.\r
+  * @rmtoll CCR          PINC          LL_DMA_SetPeriphIncMode\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @param  PeriphOrM2MSrcIncMode This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_PERIPH_INCREMENT\r
+  *         @arg @ref LL_DMA_PERIPH_NOINCREMENT\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_SetPeriphIncMode(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t PeriphOrM2MSrcIncMode)\r
+{\r
+  MODIFY_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_PINC,\r
+             PeriphOrM2MSrcIncMode);\r
+}\r
+\r
+/**\r
+  * @brief  Get Peripheral increment mode.\r
+  * @rmtoll CCR          PINC          LL_DMA_GetPeriphIncMode\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_DMA_PERIPH_INCREMENT\r
+  *         @arg @ref LL_DMA_PERIPH_NOINCREMENT\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_GetPeriphIncMode(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR,\r
+                   DMA_CCR_PINC));\r
+}\r
+\r
+/**\r
+  * @brief  Set Memory increment mode.\r
+  * @rmtoll CCR          MINC          LL_DMA_SetMemoryIncMode\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @param  MemoryOrM2MDstIncMode This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_MEMORY_INCREMENT\r
+  *         @arg @ref LL_DMA_MEMORY_NOINCREMENT\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_SetMemoryIncMode(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t MemoryOrM2MDstIncMode)\r
+{\r
+  MODIFY_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_MINC,\r
+             MemoryOrM2MDstIncMode);\r
+}\r
+\r
+/**\r
+  * @brief  Get Memory increment mode.\r
+  * @rmtoll CCR          MINC          LL_DMA_GetMemoryIncMode\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_DMA_MEMORY_INCREMENT\r
+  *         @arg @ref LL_DMA_MEMORY_NOINCREMENT\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_GetMemoryIncMode(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR,\r
+                   DMA_CCR_MINC));\r
+}\r
+\r
+/**\r
+  * @brief  Set Peripheral size.\r
+  * @rmtoll CCR          PSIZE         LL_DMA_SetPeriphSize\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @param  PeriphOrM2MSrcDataSize This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_PDATAALIGN_BYTE\r
+  *         @arg @ref LL_DMA_PDATAALIGN_HALFWORD\r
+  *         @arg @ref LL_DMA_PDATAALIGN_WORD\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_SetPeriphSize(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t PeriphOrM2MSrcDataSize)\r
+{\r
+  MODIFY_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_PSIZE,\r
+             PeriphOrM2MSrcDataSize);\r
+}\r
+\r
+/**\r
+  * @brief  Get Peripheral size.\r
+  * @rmtoll CCR          PSIZE         LL_DMA_GetPeriphSize\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_DMA_PDATAALIGN_BYTE\r
+  *         @arg @ref LL_DMA_PDATAALIGN_HALFWORD\r
+  *         @arg @ref LL_DMA_PDATAALIGN_WORD\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_GetPeriphSize(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR,\r
+                   DMA_CCR_PSIZE));\r
+}\r
+\r
+/**\r
+  * @brief  Set Memory size.\r
+  * @rmtoll CCR          MSIZE         LL_DMA_SetMemorySize\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @param  MemoryOrM2MDstDataSize This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_MDATAALIGN_BYTE\r
+  *         @arg @ref LL_DMA_MDATAALIGN_HALFWORD\r
+  *         @arg @ref LL_DMA_MDATAALIGN_WORD\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_SetMemorySize(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t MemoryOrM2MDstDataSize)\r
+{\r
+  MODIFY_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_MSIZE,\r
+             MemoryOrM2MDstDataSize);\r
+}\r
+\r
+/**\r
+  * @brief  Get Memory size.\r
+  * @rmtoll CCR          MSIZE         LL_DMA_GetMemorySize\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_DMA_MDATAALIGN_BYTE\r
+  *         @arg @ref LL_DMA_MDATAALIGN_HALFWORD\r
+  *         @arg @ref LL_DMA_MDATAALIGN_WORD\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_GetMemorySize(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR,\r
+                   DMA_CCR_MSIZE));\r
+}\r
+\r
+/**\r
+  * @brief  Set Channel priority level.\r
+  * @rmtoll CCR          PL            LL_DMA_SetChannelPriorityLevel\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @param  Priority This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_PRIORITY_LOW\r
+  *         @arg @ref LL_DMA_PRIORITY_MEDIUM\r
+  *         @arg @ref LL_DMA_PRIORITY_HIGH\r
+  *         @arg @ref LL_DMA_PRIORITY_VERYHIGH\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_SetChannelPriorityLevel(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t Priority)\r
+{\r
+  MODIFY_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_PL,\r
+             Priority);\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel priority level.\r
+  * @rmtoll CCR          PL            LL_DMA_GetChannelPriorityLevel\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_DMA_PRIORITY_LOW\r
+  *         @arg @ref LL_DMA_PRIORITY_MEDIUM\r
+  *         @arg @ref LL_DMA_PRIORITY_HIGH\r
+  *         @arg @ref LL_DMA_PRIORITY_VERYHIGH\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_GetChannelPriorityLevel(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR,\r
+                   DMA_CCR_PL));\r
+}\r
+\r
+/**\r
+  * @brief  Set Number of data to transfer.\r
+  * @note   This action has no effect if\r
+  *         channel is enabled.\r
+  * @rmtoll CNDTR        NDT           LL_DMA_SetDataLength\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @param  NbData Between Min_Data = 0 and Max_Data = 0x0000FFFF\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_SetDataLength(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t NbData)\r
+{\r
+  MODIFY_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CNDTR,\r
+             DMA_CNDTR_NDT, NbData);\r
+}\r
+\r
+/**\r
+  * @brief  Get Number of data to transfer.\r
+  * @note   Once the channel is enabled, the return value indicate the\r
+  *         remaining bytes to be transmitted.\r
+  * @rmtoll CNDTR        NDT           LL_DMA_GetDataLength\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval Between Min_Data = 0 and Max_Data = 0xFFFFFFFF\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_GetDataLength(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CNDTR,\r
+                   DMA_CNDTR_NDT));\r
+}\r
+\r
+/**\r
+  * @brief  Configure the Source and Destination addresses.\r
+  * @note   This API must not be called when the DMA channel is enabled.\r
+  * @note   Each IP using DMA provides an API to get directly the register adress (LL_PPP_DMA_GetRegAddr).\r
+  * @rmtoll CPAR         PA            LL_DMA_ConfigAddresses\n\r
+  *         CMAR         MA            LL_DMA_ConfigAddresses\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @param  SrcAddress Between Min_Data = 0 and Max_Data = 0xFFFFFFFF\r
+  * @param  DstAddress Between Min_Data = 0 and Max_Data = 0xFFFFFFFF\r
+  * @param  Direction This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_DIRECTION_PERIPH_TO_MEMORY\r
+  *         @arg @ref LL_DMA_DIRECTION_MEMORY_TO_PERIPH\r
+  *         @arg @ref LL_DMA_DIRECTION_MEMORY_TO_MEMORY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ConfigAddresses(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t SrcAddress,\r
+                                            uint32_t DstAddress, uint32_t Direction)\r
+{\r
+  /* Direction Memory to Periph */\r
+  if (Direction == LL_DMA_DIRECTION_MEMORY_TO_PERIPH)\r
+  {\r
+    WRITE_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CMAR, SrcAddress);\r
+    WRITE_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CPAR, DstAddress);\r
+  }\r
+  /* Direction Periph to Memory and Memory to Memory */\r
+  else\r
+  {\r
+    WRITE_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CPAR, SrcAddress);\r
+    WRITE_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CMAR, DstAddress);\r
+  }\r
+}\r
+\r
+/**\r
+  * @brief  Set the Memory address.\r
+  * @note   Interface used for direction LL_DMA_DIRECTION_PERIPH_TO_MEMORY or LL_DMA_DIRECTION_MEMORY_TO_PERIPH only.\r
+  * @note   This API must not be called when the DMA channel is enabled.\r
+  * @rmtoll CMAR         MA            LL_DMA_SetMemoryAddress\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @param  MemoryAddress Between Min_Data = 0 and Max_Data = 0xFFFFFFFF\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_SetMemoryAddress(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t MemoryAddress)\r
+{\r
+  WRITE_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CMAR, MemoryAddress);\r
+}\r
+\r
+/**\r
+  * @brief  Set the Peripheral address.\r
+  * @note   Interface used for direction LL_DMA_DIRECTION_PERIPH_TO_MEMORY or LL_DMA_DIRECTION_MEMORY_TO_PERIPH only.\r
+  * @note   This API must not be called when the DMA channel is enabled.\r
+  * @rmtoll CPAR         PA            LL_DMA_SetPeriphAddress\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @param  PeriphAddress Between Min_Data = 0 and Max_Data = 0xFFFFFFFF\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_SetPeriphAddress(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t PeriphAddress)\r
+{\r
+  WRITE_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CPAR, PeriphAddress);\r
+}\r
+\r
+/**\r
+  * @brief  Get Memory address.\r
+  * @note   Interface used for direction LL_DMA_DIRECTION_PERIPH_TO_MEMORY or LL_DMA_DIRECTION_MEMORY_TO_PERIPH only.\r
+  * @rmtoll CMAR         MA            LL_DMA_GetMemoryAddress\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval Between Min_Data = 0 and Max_Data = 0xFFFFFFFF\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_GetMemoryAddress(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  return (READ_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CMAR));\r
+}\r
+\r
+/**\r
+  * @brief  Get Peripheral address.\r
+  * @note   Interface used for direction LL_DMA_DIRECTION_PERIPH_TO_MEMORY or LL_DMA_DIRECTION_MEMORY_TO_PERIPH only.\r
+  * @rmtoll CPAR         PA            LL_DMA_GetPeriphAddress\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval Between Min_Data = 0 and Max_Data = 0xFFFFFFFF\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_GetPeriphAddress(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  return (READ_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CPAR));\r
+}\r
+\r
+/**\r
+  * @brief  Set the Memory to Memory Source address.\r
+  * @note   Interface used for direction LL_DMA_DIRECTION_MEMORY_TO_MEMORY only.\r
+  * @note   This API must not be called when the DMA channel is enabled.\r
+  * @rmtoll CPAR         PA            LL_DMA_SetM2MSrcAddress\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @param  MemoryAddress Between Min_Data = 0 and Max_Data = 0xFFFFFFFF\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_SetM2MSrcAddress(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t MemoryAddress)\r
+{\r
+  WRITE_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CPAR, MemoryAddress);\r
+}\r
+\r
+/**\r
+  * @brief  Set the Memory to Memory Destination address.\r
+  * @note   Interface used for direction LL_DMA_DIRECTION_MEMORY_TO_MEMORY only.\r
+  * @note   This API must not be called when the DMA channel is enabled.\r
+  * @rmtoll CMAR         MA            LL_DMA_SetM2MDstAddress\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @param  MemoryAddress Between Min_Data = 0 and Max_Data = 0xFFFFFFFF\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_SetM2MDstAddress(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t MemoryAddress)\r
+{\r
+  WRITE_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CMAR, MemoryAddress);\r
+}\r
+\r
+/**\r
+  * @brief  Get the Memory to Memory Source address.\r
+  * @note   Interface used for direction LL_DMA_DIRECTION_MEMORY_TO_MEMORY only.\r
+  * @rmtoll CPAR         PA            LL_DMA_GetM2MSrcAddress\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval Between Min_Data = 0 and Max_Data = 0xFFFFFFFF\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_GetM2MSrcAddress(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  return (READ_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CPAR));\r
+}\r
+\r
+/**\r
+  * @brief  Get the Memory to Memory Destination address.\r
+  * @note   Interface used for direction LL_DMA_DIRECTION_MEMORY_TO_MEMORY only.\r
+  * @rmtoll CMAR         MA            LL_DMA_GetM2MDstAddress\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval Between Min_Data = 0 and Max_Data = 0xFFFFFFFF\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_GetM2MDstAddress(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  return (READ_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CMAR));\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup DMA_LL_EF_FLAG_Management FLAG_Management\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Get Channel 1 global interrupt flag.\r
+  * @rmtoll ISR          GIF1          LL_DMA_IsActiveFlag_GI1\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_GI1(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_GIF1) == (DMA_ISR_GIF1));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 2 global interrupt flag.\r
+  * @rmtoll ISR          GIF2          LL_DMA_IsActiveFlag_GI2\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_GI2(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_GIF2) == (DMA_ISR_GIF2));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 3 global interrupt flag.\r
+  * @rmtoll ISR          GIF3          LL_DMA_IsActiveFlag_GI3\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_GI3(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_GIF3) == (DMA_ISR_GIF3));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 4 global interrupt flag.\r
+  * @rmtoll ISR          GIF4          LL_DMA_IsActiveFlag_GI4\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_GI4(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_GIF4) == (DMA_ISR_GIF4));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 5 global interrupt flag.\r
+  * @rmtoll ISR          GIF5          LL_DMA_IsActiveFlag_GI5\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_GI5(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_GIF5) == (DMA_ISR_GIF5));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 6 global interrupt flag.\r
+  * @rmtoll ISR          GIF6          LL_DMA_IsActiveFlag_GI6\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_GI6(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_GIF6) == (DMA_ISR_GIF6));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 7 global interrupt flag.\r
+  * @rmtoll ISR          GIF7          LL_DMA_IsActiveFlag_GI7\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_GI7(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_GIF7) == (DMA_ISR_GIF7));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 1 transfer complete flag.\r
+  * @rmtoll ISR          TCIF1         LL_DMA_IsActiveFlag_TC1\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TC1(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_TCIF1) == (DMA_ISR_TCIF1));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 2 transfer complete flag.\r
+  * @rmtoll ISR          TCIF2         LL_DMA_IsActiveFlag_TC2\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TC2(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_TCIF2) == (DMA_ISR_TCIF2));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 3 transfer complete flag.\r
+  * @rmtoll ISR          TCIF3         LL_DMA_IsActiveFlag_TC3\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TC3(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_TCIF3) == (DMA_ISR_TCIF3));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 4 transfer complete flag.\r
+  * @rmtoll ISR          TCIF4         LL_DMA_IsActiveFlag_TC4\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TC4(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_TCIF4) == (DMA_ISR_TCIF4));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 5 transfer complete flag.\r
+  * @rmtoll ISR          TCIF5         LL_DMA_IsActiveFlag_TC5\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TC5(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_TCIF5) == (DMA_ISR_TCIF5));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 6 transfer complete flag.\r
+  * @rmtoll ISR          TCIF6         LL_DMA_IsActiveFlag_TC6\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TC6(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_TCIF6) == (DMA_ISR_TCIF6));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 7 transfer complete flag.\r
+  * @rmtoll ISR          TCIF7         LL_DMA_IsActiveFlag_TC7\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TC7(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_TCIF7) == (DMA_ISR_TCIF7));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 1 half transfer flag.\r
+  * @rmtoll ISR          HTIF1         LL_DMA_IsActiveFlag_HT1\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_HT1(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_HTIF1) == (DMA_ISR_HTIF1));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 2 half transfer flag.\r
+  * @rmtoll ISR          HTIF2         LL_DMA_IsActiveFlag_HT2\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_HT2(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_HTIF2) == (DMA_ISR_HTIF2));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 3 half transfer flag.\r
+  * @rmtoll ISR          HTIF3         LL_DMA_IsActiveFlag_HT3\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_HT3(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_HTIF3) == (DMA_ISR_HTIF3));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 4 half transfer flag.\r
+  * @rmtoll ISR          HTIF4         LL_DMA_IsActiveFlag_HT4\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_HT4(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_HTIF4) == (DMA_ISR_HTIF4));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 5 half transfer flag.\r
+  * @rmtoll ISR          HTIF5         LL_DMA_IsActiveFlag_HT5\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_HT5(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_HTIF5) == (DMA_ISR_HTIF5));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 6 half transfer flag.\r
+  * @rmtoll ISR          HTIF6         LL_DMA_IsActiveFlag_HT6\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_HT6(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_HTIF6) == (DMA_ISR_HTIF6));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 7 half transfer flag.\r
+  * @rmtoll ISR          HTIF7         LL_DMA_IsActiveFlag_HT7\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_HT7(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_HTIF7) == (DMA_ISR_HTIF7));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 1 transfer error flag.\r
+  * @rmtoll ISR          TEIF1         LL_DMA_IsActiveFlag_TE1\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TE1(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_TEIF1) == (DMA_ISR_TEIF1));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 2 transfer error flag.\r
+  * @rmtoll ISR          TEIF2         LL_DMA_IsActiveFlag_TE2\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TE2(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_TEIF2) == (DMA_ISR_TEIF2));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 3 transfer error flag.\r
+  * @rmtoll ISR          TEIF3         LL_DMA_IsActiveFlag_TE3\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TE3(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_TEIF3) == (DMA_ISR_TEIF3));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 4 transfer error flag.\r
+  * @rmtoll ISR          TEIF4         LL_DMA_IsActiveFlag_TE4\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TE4(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_TEIF4) == (DMA_ISR_TEIF4));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 5 transfer error flag.\r
+  * @rmtoll ISR          TEIF5         LL_DMA_IsActiveFlag_TE5\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TE5(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_TEIF5) == (DMA_ISR_TEIF5));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 6 transfer error flag.\r
+  * @rmtoll ISR          TEIF6         LL_DMA_IsActiveFlag_TE6\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TE6(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_TEIF6) == (DMA_ISR_TEIF6));\r
+}\r
+\r
+/**\r
+  * @brief  Get Channel 7 transfer error flag.\r
+  * @rmtoll ISR          TEIF7         LL_DMA_IsActiveFlag_TE7\r
+  * @param  DMAx DMAx Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TE7(DMA_TypeDef *DMAx)\r
+{\r
+  return (READ_BIT(DMAx->ISR, DMA_ISR_TEIF7) == (DMA_ISR_TEIF7));\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 1 global interrupt flag.\r
+  * @rmtoll IFCR         CGIF1         LL_DMA_ClearFlag_GI1\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_GI1(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CGIF1);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 2 global interrupt flag.\r
+  * @rmtoll IFCR         CGIF2         LL_DMA_ClearFlag_GI2\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_GI2(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CGIF2);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 3 global interrupt flag.\r
+  * @rmtoll IFCR         CGIF3         LL_DMA_ClearFlag_GI3\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_GI3(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CGIF3);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 4 global interrupt flag.\r
+  * @rmtoll IFCR         CGIF4         LL_DMA_ClearFlag_GI4\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_GI4(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CGIF4);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 5 global interrupt flag.\r
+  * @rmtoll IFCR         CGIF5         LL_DMA_ClearFlag_GI5\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_GI5(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CGIF5);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 6 global interrupt flag.\r
+  * @rmtoll IFCR         CGIF6         LL_DMA_ClearFlag_GI6\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_GI6(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CGIF6);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 7 global interrupt flag.\r
+  * @rmtoll IFCR         CGIF7         LL_DMA_ClearFlag_GI7\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_GI7(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CGIF7);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 1  transfer complete flag.\r
+  * @rmtoll IFCR         CTCIF1        LL_DMA_ClearFlag_TC1\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_TC1(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CTCIF1);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 2  transfer complete flag.\r
+  * @rmtoll IFCR         CTCIF2        LL_DMA_ClearFlag_TC2\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_TC2(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CTCIF2);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 3  transfer complete flag.\r
+  * @rmtoll IFCR         CTCIF3        LL_DMA_ClearFlag_TC3\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_TC3(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CTCIF3);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 4  transfer complete flag.\r
+  * @rmtoll IFCR         CTCIF4        LL_DMA_ClearFlag_TC4\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_TC4(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CTCIF4);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 5  transfer complete flag.\r
+  * @rmtoll IFCR         CTCIF5        LL_DMA_ClearFlag_TC5\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_TC5(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CTCIF5);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 6  transfer complete flag.\r
+  * @rmtoll IFCR         CTCIF6        LL_DMA_ClearFlag_TC6\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_TC6(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CTCIF6);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 7  transfer complete flag.\r
+  * @rmtoll IFCR         CTCIF7        LL_DMA_ClearFlag_TC7\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_TC7(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CTCIF7);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 1  half transfer flag.\r
+  * @rmtoll IFCR         CHTIF1        LL_DMA_ClearFlag_HT1\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_HT1(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CHTIF1);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 2  half transfer flag.\r
+  * @rmtoll IFCR         CHTIF2        LL_DMA_ClearFlag_HT2\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_HT2(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CHTIF2);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 3  half transfer flag.\r
+  * @rmtoll IFCR         CHTIF3        LL_DMA_ClearFlag_HT3\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_HT3(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CHTIF3);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 4  half transfer flag.\r
+  * @rmtoll IFCR         CHTIF4        LL_DMA_ClearFlag_HT4\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_HT4(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CHTIF4);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 5  half transfer flag.\r
+  * @rmtoll IFCR         CHTIF5        LL_DMA_ClearFlag_HT5\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_HT5(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CHTIF5);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 6  half transfer flag.\r
+  * @rmtoll IFCR         CHTIF6        LL_DMA_ClearFlag_HT6\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_HT6(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CHTIF6);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 7  half transfer flag.\r
+  * @rmtoll IFCR         CHTIF7        LL_DMA_ClearFlag_HT7\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_HT7(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CHTIF7);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 1 transfer error flag.\r
+  * @rmtoll IFCR         CTEIF1        LL_DMA_ClearFlag_TE1\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_TE1(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CTEIF1);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 2 transfer error flag.\r
+  * @rmtoll IFCR         CTEIF2        LL_DMA_ClearFlag_TE2\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_TE2(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CTEIF2);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 3 transfer error flag.\r
+  * @rmtoll IFCR         CTEIF3        LL_DMA_ClearFlag_TE3\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_TE3(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CTEIF3);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 4 transfer error flag.\r
+  * @rmtoll IFCR         CTEIF4        LL_DMA_ClearFlag_TE4\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_TE4(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CTEIF4);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 5 transfer error flag.\r
+  * @rmtoll IFCR         CTEIF5        LL_DMA_ClearFlag_TE5\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_TE5(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CTEIF5);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 6 transfer error flag.\r
+  * @rmtoll IFCR         CTEIF6        LL_DMA_ClearFlag_TE6\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_TE6(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CTEIF6);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Channel 7 transfer error flag.\r
+  * @rmtoll IFCR         CTEIF7        LL_DMA_ClearFlag_TE7\r
+  * @param  DMAx DMAx Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_ClearFlag_TE7(DMA_TypeDef *DMAx)\r
+{\r
+  WRITE_REG(DMAx->IFCR, DMA_IFCR_CTEIF7);\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup DMA_LL_EF_IT_Management IT_Management\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable Transfer complete interrupt.\r
+  * @rmtoll CCR          TCIE          LL_DMA_EnableIT_TC\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_EnableIT_TC(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  SET_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_TCIE);\r
+}\r
+\r
+/**\r
+  * @brief  Enable Half transfer interrupt.\r
+  * @rmtoll CCR          HTIE          LL_DMA_EnableIT_HT\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_EnableIT_HT(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  SET_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_HTIE);\r
+}\r
+\r
+/**\r
+  * @brief  Enable Transfer error interrupt.\r
+  * @rmtoll CCR          TEIE          LL_DMA_EnableIT_TE\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_EnableIT_TE(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  SET_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_TEIE);\r
+}\r
+\r
+/**\r
+  * @brief  Disable Transfer complete interrupt.\r
+  * @rmtoll CCR          TCIE          LL_DMA_DisableIT_TC\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_DisableIT_TC(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  CLEAR_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_TCIE);\r
+}\r
+\r
+/**\r
+  * @brief  Disable Half transfer interrupt.\r
+  * @rmtoll CCR          HTIE          LL_DMA_DisableIT_HT\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_DisableIT_HT(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  CLEAR_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_HTIE);\r
+}\r
+\r
+/**\r
+  * @brief  Disable Transfer error interrupt.\r
+  * @rmtoll CCR          TEIE          LL_DMA_DisableIT_TE\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DMA_DisableIT_TE(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  CLEAR_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_TEIE);\r
+}\r
+\r
+/**\r
+  * @brief  Check if Transfer complete Interrupt is enabled.\r
+  * @rmtoll CCR          TCIE          LL_DMA_IsEnabledIT_TC\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsEnabledIT_TC(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR,\r
+                   DMA_CCR_TCIE) == (DMA_CCR_TCIE));\r
+}\r
+\r
+/**\r
+  * @brief  Check if Half transfer Interrupt is enabled.\r
+  * @rmtoll CCR          HTIE          LL_DMA_IsEnabledIT_HT\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsEnabledIT_HT(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR,\r
+                   DMA_CCR_HTIE) == (DMA_CCR_HTIE));\r
+}\r
+\r
+/**\r
+  * @brief  Check if Transfer error Interrupt is enabled.\r
+  * @rmtoll CCR          TEIE          LL_DMA_IsEnabledIT_TE\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_DMA_IsEnabledIT_TE(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR,\r
+                   DMA_CCR_TEIE) == (DMA_CCR_TEIE));\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#if defined(USE_FULL_LL_DRIVER)\r
+/** @defgroup DMA_LL_EF_Init Initialization and de-initialization functions\r
+  * @{\r
+  */\r
+\r
+uint32_t LL_DMA_Init(DMA_TypeDef *DMAx, uint32_t Channel, LL_DMA_InitTypeDef *DMA_InitStruct);\r
+uint32_t LL_DMA_DeInit(DMA_TypeDef *DMAx, uint32_t Channel);\r
+void LL_DMA_StructInit(LL_DMA_InitTypeDef *DMA_InitStruct);\r
+\r
+/**\r
+  * @}\r
+  */\r
+#endif /* USE_FULL_LL_DRIVER */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* DMA1 || DMA2 */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __STM32F1xx_LL_DMA_H */\r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_exti.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_exti.h
new file mode 100644 (file)
index 0000000..612e005
--- /dev/null
@@ -0,0 +1,888 @@
+/**\r
+  ******************************************************************************\r
+  * @file    stm32f1xx_ll_exti.h\r
+  * @author  MCD Application Team\r
+  * @brief   Header file of EXTI LL module.\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+\r
+/* Define to prevent recursive inclusion -------------------------------------*/\r
+#ifndef STM32F1xx_LL_EXTI_H\r
+#define STM32F1xx_LL_EXTI_H\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/* Includes ------------------------------------------------------------------*/\r
+#include "stm32f1xx.h"\r
+\r
+/** @addtogroup STM32F1xx_LL_Driver\r
+  * @{\r
+  */\r
+\r
+#if defined (EXTI)\r
+\r
+/** @defgroup EXTI_LL EXTI\r
+  * @{\r
+  */\r
+\r
+/* Private types -------------------------------------------------------------*/\r
+/* Private variables ---------------------------------------------------------*/\r
+/* Private constants ---------------------------------------------------------*/\r
+/* Private Macros ------------------------------------------------------------*/\r
+#if defined(USE_FULL_LL_DRIVER)\r
+/** @defgroup EXTI_LL_Private_Macros EXTI Private Macros\r
+  * @{\r
+  */\r
+/**\r
+  * @}\r
+  */\r
+#endif /*USE_FULL_LL_DRIVER*/\r
+/* Exported types ------------------------------------------------------------*/\r
+#if defined(USE_FULL_LL_DRIVER)\r
+/** @defgroup EXTI_LL_ES_INIT EXTI Exported Init structure\r
+  * @{\r
+  */\r
+typedef struct\r
+{\r
+\r
+  uint32_t Line_0_31;           /*!< Specifies the EXTI lines to be enabled or disabled for Lines in range 0 to 31\r
+                                     This parameter can be any combination of @ref EXTI_LL_EC_LINE */\r
+\r
+  FunctionalState LineCommand;  /*!< Specifies the new state of the selected EXTI lines.\r
+                                     This parameter can be set either to ENABLE or DISABLE */\r
+\r
+  uint8_t Mode;                 /*!< Specifies the mode for the EXTI lines.\r
+                                     This parameter can be a value of @ref EXTI_LL_EC_MODE. */\r
+\r
+  uint8_t Trigger;              /*!< Specifies the trigger signal active edge for the EXTI lines.\r
+                                     This parameter can be a value of @ref EXTI_LL_EC_TRIGGER. */\r
+} LL_EXTI_InitTypeDef;\r
+\r
+/**\r
+  * @}\r
+  */\r
+#endif /*USE_FULL_LL_DRIVER*/\r
+\r
+/* Exported constants --------------------------------------------------------*/\r
+/** @defgroup EXTI_LL_Exported_Constants EXTI Exported Constants\r
+  * @{\r
+  */\r
+\r
+/** @defgroup EXTI_LL_EC_LINE LINE\r
+  * @{\r
+  */\r
+#define LL_EXTI_LINE_0                 EXTI_IMR_IM0           /*!< Extended line 0 */\r
+#define LL_EXTI_LINE_1                 EXTI_IMR_IM1           /*!< Extended line 1 */\r
+#define LL_EXTI_LINE_2                 EXTI_IMR_IM2           /*!< Extended line 2 */\r
+#define LL_EXTI_LINE_3                 EXTI_IMR_IM3           /*!< Extended line 3 */\r
+#define LL_EXTI_LINE_4                 EXTI_IMR_IM4           /*!< Extended line 4 */\r
+#define LL_EXTI_LINE_5                 EXTI_IMR_IM5           /*!< Extended line 5 */\r
+#define LL_EXTI_LINE_6                 EXTI_IMR_IM6           /*!< Extended line 6 */\r
+#define LL_EXTI_LINE_7                 EXTI_IMR_IM7           /*!< Extended line 7 */\r
+#define LL_EXTI_LINE_8                 EXTI_IMR_IM8           /*!< Extended line 8 */\r
+#define LL_EXTI_LINE_9                 EXTI_IMR_IM9           /*!< Extended line 9 */\r
+#define LL_EXTI_LINE_10                EXTI_IMR_IM10          /*!< Extended line 10 */\r
+#define LL_EXTI_LINE_11                EXTI_IMR_IM11          /*!< Extended line 11 */\r
+#define LL_EXTI_LINE_12                EXTI_IMR_IM12          /*!< Extended line 12 */\r
+#define LL_EXTI_LINE_13                EXTI_IMR_IM13          /*!< Extended line 13 */\r
+#define LL_EXTI_LINE_14                EXTI_IMR_IM14          /*!< Extended line 14 */\r
+#define LL_EXTI_LINE_15                EXTI_IMR_IM15          /*!< Extended line 15 */\r
+#if defined(EXTI_IMR_IM16)\r
+#define LL_EXTI_LINE_16                EXTI_IMR_IM16          /*!< Extended line 16 */\r
+#endif\r
+#define LL_EXTI_LINE_17                EXTI_IMR_IM17          /*!< Extended line 17 */\r
+#if defined(EXTI_IMR_IM18)\r
+#define LL_EXTI_LINE_18                EXTI_IMR_IM18          /*!< Extended line 18 */\r
+#endif\r
+#if defined(EXTI_IMR_IM19)\r
+#define LL_EXTI_LINE_19                EXTI_IMR_IM19          /*!< Extended line 19 */\r
+#endif\r
+#if defined(EXTI_IMR_IM20)\r
+#define LL_EXTI_LINE_20                EXTI_IMR_IM20          /*!< Extended line 20 */\r
+#endif\r
+#if defined(EXTI_IMR_IM21)\r
+#define LL_EXTI_LINE_21                EXTI_IMR_IM21          /*!< Extended line 21 */\r
+#endif\r
+#if defined(EXTI_IMR_IM22)\r
+#define LL_EXTI_LINE_22                EXTI_IMR_IM22          /*!< Extended line 22 */\r
+#endif\r
+#if defined(EXTI_IMR_IM23)\r
+#define LL_EXTI_LINE_23                EXTI_IMR_IM23          /*!< Extended line 23 */\r
+#endif\r
+#if defined(EXTI_IMR_IM24)\r
+#define LL_EXTI_LINE_24                EXTI_IMR_IM24          /*!< Extended line 24 */\r
+#endif\r
+#if defined(EXTI_IMR_IM25)\r
+#define LL_EXTI_LINE_25                EXTI_IMR_IM25          /*!< Extended line 25 */\r
+#endif\r
+#if defined(EXTI_IMR_IM26)\r
+#define LL_EXTI_LINE_26                EXTI_IMR_IM26          /*!< Extended line 26 */\r
+#endif\r
+#if defined(EXTI_IMR_IM27)\r
+#define LL_EXTI_LINE_27                EXTI_IMR_IM27          /*!< Extended line 27 */\r
+#endif\r
+#if defined(EXTI_IMR_IM28)\r
+#define LL_EXTI_LINE_28                EXTI_IMR_IM28          /*!< Extended line 28 */\r
+#endif\r
+#if defined(EXTI_IMR_IM29)\r
+#define LL_EXTI_LINE_29                EXTI_IMR_IM29          /*!< Extended line 29 */\r
+#endif\r
+#if defined(EXTI_IMR_IM30)\r
+#define LL_EXTI_LINE_30                EXTI_IMR_IM30          /*!< Extended line 30 */\r
+#endif\r
+#if defined(EXTI_IMR_IM31)\r
+#define LL_EXTI_LINE_31                EXTI_IMR_IM31          /*!< Extended line 31 */\r
+#endif\r
+#define LL_EXTI_LINE_ALL_0_31          EXTI_IMR_IM            /*!< All Extended line not reserved*/\r
+\r
+\r
+#define LL_EXTI_LINE_ALL               (0xFFFFFFFFU)  /*!< All Extended line */\r
+\r
+#if defined(USE_FULL_LL_DRIVER)\r
+#define LL_EXTI_LINE_NONE              (0x00000000U)  /*!< None Extended line */\r
+#endif /*USE_FULL_LL_DRIVER*/\r
+\r
+/**\r
+  * @}\r
+  */\r
+#if defined(USE_FULL_LL_DRIVER)\r
+\r
+/** @defgroup EXTI_LL_EC_MODE Mode\r
+  * @{\r
+  */\r
+#define LL_EXTI_MODE_IT                 ((uint8_t)0x00) /*!< Interrupt Mode */\r
+#define LL_EXTI_MODE_EVENT              ((uint8_t)0x01) /*!< Event Mode */\r
+#define LL_EXTI_MODE_IT_EVENT           ((uint8_t)0x02) /*!< Interrupt & Event Mode */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup EXTI_LL_EC_TRIGGER Edge Trigger\r
+  * @{\r
+  */\r
+#define LL_EXTI_TRIGGER_NONE            ((uint8_t)0x00) /*!< No Trigger Mode */\r
+#define LL_EXTI_TRIGGER_RISING          ((uint8_t)0x01) /*!< Trigger Rising Mode */\r
+#define LL_EXTI_TRIGGER_FALLING         ((uint8_t)0x02) /*!< Trigger Falling Mode */\r
+#define LL_EXTI_TRIGGER_RISING_FALLING  ((uint8_t)0x03) /*!< Trigger Rising & Falling Mode */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+\r
+#endif /*USE_FULL_LL_DRIVER*/\r
+\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Exported macro ------------------------------------------------------------*/\r
+/** @defgroup EXTI_LL_Exported_Macros EXTI Exported Macros\r
+  * @{\r
+  */\r
+\r
+/** @defgroup EXTI_LL_EM_WRITE_READ Common Write and read registers Macros\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Write a value in EXTI register\r
+  * @param  __REG__ Register to be written\r
+  * @param  __VALUE__ Value to be written in the register\r
+  * @retval None\r
+  */\r
+#define LL_EXTI_WriteReg(__REG__, __VALUE__) WRITE_REG(EXTI->__REG__, (__VALUE__))\r
+\r
+/**\r
+  * @brief  Read a value in EXTI register\r
+  * @param  __REG__ Register to be read\r
+  * @retval Register value\r
+  */\r
+#define LL_EXTI_ReadReg(__REG__) READ_REG(EXTI->__REG__)\r
+/**\r
+  * @}\r
+  */\r
+\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+\r
+\r
+/* Exported functions --------------------------------------------------------*/\r
+/** @defgroup EXTI_LL_Exported_Functions EXTI Exported Functions\r
+ * @{\r
+ */\r
+/** @defgroup EXTI_LL_EF_IT_Management IT_Management\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable ExtiLine Interrupt request for Lines in range 0 to 31\r
+  * @note The reset value for the direct or internal lines (see RM)\r
+  *       is set to 1 in order to enable the interrupt by default.\r
+  *       Bits are set automatically at Power on.\r
+  * @rmtoll IMR         IMx           LL_EXTI_EnableIT_0_31\r
+  * @param  ExtiLine This parameter can be one of the following values:\r
+  *         @arg @ref LL_EXTI_LINE_0\r
+  *         @arg @ref LL_EXTI_LINE_1\r
+  *         @arg @ref LL_EXTI_LINE_2\r
+  *         @arg @ref LL_EXTI_LINE_3\r
+  *         @arg @ref LL_EXTI_LINE_4\r
+  *         @arg @ref LL_EXTI_LINE_5\r
+  *         @arg @ref LL_EXTI_LINE_6\r
+  *         @arg @ref LL_EXTI_LINE_7\r
+  *         @arg @ref LL_EXTI_LINE_8\r
+  *         @arg @ref LL_EXTI_LINE_9\r
+  *         @arg @ref LL_EXTI_LINE_10\r
+  *         @arg @ref LL_EXTI_LINE_11\r
+  *         @arg @ref LL_EXTI_LINE_12\r
+  *         @arg @ref LL_EXTI_LINE_13\r
+  *         @arg @ref LL_EXTI_LINE_14\r
+  *         @arg @ref LL_EXTI_LINE_15\r
+  *         @arg @ref LL_EXTI_LINE_16\r
+  *         @arg @ref LL_EXTI_LINE_17\r
+  *         @arg @ref LL_EXTI_LINE_18\r
+  *         @arg @ref LL_EXTI_LINE_19\r
+  *         @arg @ref LL_EXTI_LINE_ALL_0_31\r
+  * @note   Please check each device line mapping for EXTI Line availability\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_EXTI_EnableIT_0_31(uint32_t ExtiLine)\r
+{\r
+  SET_BIT(EXTI->IMR, ExtiLine);\r
+}\r
+\r
+/**\r
+  * @brief  Disable ExtiLine Interrupt request for Lines in range 0 to 31\r
+  * @note The reset value for the direct or internal lines (see RM)\r
+  *       is set to 1 in order to enable the interrupt by default.\r
+  *       Bits are set automatically at Power on.\r
+  * @rmtoll IMR         IMx           LL_EXTI_DisableIT_0_31\r
+  * @param  ExtiLine This parameter can be one of the following values:\r
+  *         @arg @ref LL_EXTI_LINE_0\r
+  *         @arg @ref LL_EXTI_LINE_1\r
+  *         @arg @ref LL_EXTI_LINE_2\r
+  *         @arg @ref LL_EXTI_LINE_3\r
+  *         @arg @ref LL_EXTI_LINE_4\r
+  *         @arg @ref LL_EXTI_LINE_5\r
+  *         @arg @ref LL_EXTI_LINE_6\r
+  *         @arg @ref LL_EXTI_LINE_7\r
+  *         @arg @ref LL_EXTI_LINE_8\r
+  *         @arg @ref LL_EXTI_LINE_9\r
+  *         @arg @ref LL_EXTI_LINE_10\r
+  *         @arg @ref LL_EXTI_LINE_11\r
+  *         @arg @ref LL_EXTI_LINE_12\r
+  *         @arg @ref LL_EXTI_LINE_13\r
+  *         @arg @ref LL_EXTI_LINE_14\r
+  *         @arg @ref LL_EXTI_LINE_15\r
+  *         @arg @ref LL_EXTI_LINE_16\r
+  *         @arg @ref LL_EXTI_LINE_17\r
+  *         @arg @ref LL_EXTI_LINE_18\r
+  *         @arg @ref LL_EXTI_LINE_19\r
+  *         @arg @ref LL_EXTI_LINE_ALL_0_31\r
+  * @note   Please check each device line mapping for EXTI Line availability\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_EXTI_DisableIT_0_31(uint32_t ExtiLine)\r
+{\r
+  CLEAR_BIT(EXTI->IMR, ExtiLine);\r
+}\r
+\r
+\r
+/**\r
+  * @brief  Indicate if ExtiLine Interrupt request is enabled for Lines in range 0 to 31\r
+  * @note The reset value for the direct or internal lines (see RM)\r
+  *       is set to 1 in order to enable the interrupt by default.\r
+  *       Bits are set automatically at Power on.\r
+  * @rmtoll IMR         IMx           LL_EXTI_IsEnabledIT_0_31\r
+  * @param  ExtiLine This parameter can be one of the following values:\r
+  *         @arg @ref LL_EXTI_LINE_0\r
+  *         @arg @ref LL_EXTI_LINE_1\r
+  *         @arg @ref LL_EXTI_LINE_2\r
+  *         @arg @ref LL_EXTI_LINE_3\r
+  *         @arg @ref LL_EXTI_LINE_4\r
+  *         @arg @ref LL_EXTI_LINE_5\r
+  *         @arg @ref LL_EXTI_LINE_6\r
+  *         @arg @ref LL_EXTI_LINE_7\r
+  *         @arg @ref LL_EXTI_LINE_8\r
+  *         @arg @ref LL_EXTI_LINE_9\r
+  *         @arg @ref LL_EXTI_LINE_10\r
+  *         @arg @ref LL_EXTI_LINE_11\r
+  *         @arg @ref LL_EXTI_LINE_12\r
+  *         @arg @ref LL_EXTI_LINE_13\r
+  *         @arg @ref LL_EXTI_LINE_14\r
+  *         @arg @ref LL_EXTI_LINE_15\r
+  *         @arg @ref LL_EXTI_LINE_16\r
+  *         @arg @ref LL_EXTI_LINE_17\r
+  *         @arg @ref LL_EXTI_LINE_18\r
+  *         @arg @ref LL_EXTI_LINE_19\r
+  *         @arg @ref LL_EXTI_LINE_ALL_0_31\r
+  * @note   Please check each device line mapping for EXTI Line availability\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_EXTI_IsEnabledIT_0_31(uint32_t ExtiLine)\r
+{\r
+  return (READ_BIT(EXTI->IMR, ExtiLine) == (ExtiLine));\r
+}\r
+\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup EXTI_LL_EF_Event_Management Event_Management\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable ExtiLine Event request for Lines in range 0 to 31\r
+  * @rmtoll EMR         EMx           LL_EXTI_EnableEvent_0_31\r
+  * @param  ExtiLine This parameter can be one of the following values:\r
+  *         @arg @ref LL_EXTI_LINE_0\r
+  *         @arg @ref LL_EXTI_LINE_1\r
+  *         @arg @ref LL_EXTI_LINE_2\r
+  *         @arg @ref LL_EXTI_LINE_3\r
+  *         @arg @ref LL_EXTI_LINE_4\r
+  *         @arg @ref LL_EXTI_LINE_5\r
+  *         @arg @ref LL_EXTI_LINE_6\r
+  *         @arg @ref LL_EXTI_LINE_7\r
+  *         @arg @ref LL_EXTI_LINE_8\r
+  *         @arg @ref LL_EXTI_LINE_9\r
+  *         @arg @ref LL_EXTI_LINE_10\r
+  *         @arg @ref LL_EXTI_LINE_11\r
+  *         @arg @ref LL_EXTI_LINE_12\r
+  *         @arg @ref LL_EXTI_LINE_13\r
+  *         @arg @ref LL_EXTI_LINE_14\r
+  *         @arg @ref LL_EXTI_LINE_15\r
+  *         @arg @ref LL_EXTI_LINE_16\r
+  *         @arg @ref LL_EXTI_LINE_17\r
+  *         @arg @ref LL_EXTI_LINE_18\r
+  *         @arg @ref LL_EXTI_LINE_19\r
+  *         @arg @ref LL_EXTI_LINE_ALL_0_31\r
+  * @note   Please check each device line mapping for EXTI Line availability\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_EXTI_EnableEvent_0_31(uint32_t ExtiLine)\r
+{\r
+  SET_BIT(EXTI->EMR, ExtiLine);\r
+\r
+}\r
+\r
+\r
+/**\r
+  * @brief  Disable ExtiLine Event request for Lines in range 0 to 31\r
+  * @rmtoll EMR         EMx           LL_EXTI_DisableEvent_0_31\r
+  * @param  ExtiLine This parameter can be one of the following values:\r
+  *         @arg @ref LL_EXTI_LINE_0\r
+  *         @arg @ref LL_EXTI_LINE_1\r
+  *         @arg @ref LL_EXTI_LINE_2\r
+  *         @arg @ref LL_EXTI_LINE_3\r
+  *         @arg @ref LL_EXTI_LINE_4\r
+  *         @arg @ref LL_EXTI_LINE_5\r
+  *         @arg @ref LL_EXTI_LINE_6\r
+  *         @arg @ref LL_EXTI_LINE_7\r
+  *         @arg @ref LL_EXTI_LINE_8\r
+  *         @arg @ref LL_EXTI_LINE_9\r
+  *         @arg @ref LL_EXTI_LINE_10\r
+  *         @arg @ref LL_EXTI_LINE_11\r
+  *         @arg @ref LL_EXTI_LINE_12\r
+  *         @arg @ref LL_EXTI_LINE_13\r
+  *         @arg @ref LL_EXTI_LINE_14\r
+  *         @arg @ref LL_EXTI_LINE_15\r
+  *         @arg @ref LL_EXTI_LINE_16\r
+  *         @arg @ref LL_EXTI_LINE_17\r
+  *         @arg @ref LL_EXTI_LINE_18\r
+  *         @arg @ref LL_EXTI_LINE_19\r
+  *         @arg @ref LL_EXTI_LINE_ALL_0_31\r
+  * @note   Please check each device line mapping for EXTI Line availability\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_EXTI_DisableEvent_0_31(uint32_t ExtiLine)\r
+{\r
+  CLEAR_BIT(EXTI->EMR, ExtiLine);\r
+}\r
+\r
+\r
+/**\r
+  * @brief  Indicate if ExtiLine Event request is enabled for Lines in range 0 to 31\r
+  * @rmtoll EMR         EMx           LL_EXTI_IsEnabledEvent_0_31\r
+  * @param  ExtiLine This parameter can be one of the following values:\r
+  *         @arg @ref LL_EXTI_LINE_0\r
+  *         @arg @ref LL_EXTI_LINE_1\r
+  *         @arg @ref LL_EXTI_LINE_2\r
+  *         @arg @ref LL_EXTI_LINE_3\r
+  *         @arg @ref LL_EXTI_LINE_4\r
+  *         @arg @ref LL_EXTI_LINE_5\r
+  *         @arg @ref LL_EXTI_LINE_6\r
+  *         @arg @ref LL_EXTI_LINE_7\r
+  *         @arg @ref LL_EXTI_LINE_8\r
+  *         @arg @ref LL_EXTI_LINE_9\r
+  *         @arg @ref LL_EXTI_LINE_10\r
+  *         @arg @ref LL_EXTI_LINE_11\r
+  *         @arg @ref LL_EXTI_LINE_12\r
+  *         @arg @ref LL_EXTI_LINE_13\r
+  *         @arg @ref LL_EXTI_LINE_14\r
+  *         @arg @ref LL_EXTI_LINE_15\r
+  *         @arg @ref LL_EXTI_LINE_16\r
+  *         @arg @ref LL_EXTI_LINE_17\r
+  *         @arg @ref LL_EXTI_LINE_18\r
+  *         @arg @ref LL_EXTI_LINE_19\r
+  *         @arg @ref LL_EXTI_LINE_ALL_0_31\r
+  * @note   Please check each device line mapping for EXTI Line availability\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_EXTI_IsEnabledEvent_0_31(uint32_t ExtiLine)\r
+{\r
+  return (READ_BIT(EXTI->EMR, ExtiLine) == (ExtiLine));\r
+\r
+}\r
+\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup EXTI_LL_EF_Rising_Trigger_Management Rising_Trigger_Management\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable ExtiLine Rising Edge Trigger for Lines in range 0 to 31\r
+  * @note The configurable wakeup lines are edge-triggered. No glitch must be\r
+  *       generated on these lines. If a rising edge on a configurable interrupt\r
+  *       line occurs during a write operation in the EXTI_RTSR register, the\r
+  *       pending bit is not set.\r
+  *       Rising and falling edge triggers can be set for\r
+  *       the same interrupt line. In this case, both generate a trigger\r
+  *       condition.\r
+  * @rmtoll RTSR        RTx           LL_EXTI_EnableRisingTrig_0_31\r
+  * @param  ExtiLine This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_EXTI_LINE_0\r
+  *         @arg @ref LL_EXTI_LINE_1\r
+  *         @arg @ref LL_EXTI_LINE_2\r
+  *         @arg @ref LL_EXTI_LINE_3\r
+  *         @arg @ref LL_EXTI_LINE_4\r
+  *         @arg @ref LL_EXTI_LINE_5\r
+  *         @arg @ref LL_EXTI_LINE_6\r
+  *         @arg @ref LL_EXTI_LINE_7\r
+  *         @arg @ref LL_EXTI_LINE_8\r
+  *         @arg @ref LL_EXTI_LINE_9\r
+  *         @arg @ref LL_EXTI_LINE_10\r
+  *         @arg @ref LL_EXTI_LINE_11\r
+  *         @arg @ref LL_EXTI_LINE_12\r
+  *         @arg @ref LL_EXTI_LINE_13\r
+  *         @arg @ref LL_EXTI_LINE_14\r
+  *         @arg @ref LL_EXTI_LINE_15\r
+  *         @arg @ref LL_EXTI_LINE_16\r
+  *         @arg @ref LL_EXTI_LINE_18\r
+  *         @arg @ref LL_EXTI_LINE_19\r
+  * @note   Please check each device line mapping for EXTI Line availability\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_EXTI_EnableRisingTrig_0_31(uint32_t ExtiLine)\r
+{\r
+  SET_BIT(EXTI->RTSR, ExtiLine);\r
+\r
+}\r
+\r
+\r
+/**\r
+  * @brief  Disable ExtiLine Rising Edge Trigger for Lines in range 0 to 31\r
+  * @note The configurable wakeup lines are edge-triggered. No glitch must be\r
+  *       generated on these lines. If a rising edge on a configurable interrupt\r
+  *       line occurs during a write operation in the EXTI_RTSR register, the\r
+  *       pending bit is not set.\r
+  *       Rising and falling edge triggers can be set for\r
+  *       the same interrupt line. In this case, both generate a trigger\r
+  *       condition.\r
+  * @rmtoll RTSR        RTx           LL_EXTI_DisableRisingTrig_0_31\r
+  * @param  ExtiLine This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_EXTI_LINE_0\r
+  *         @arg @ref LL_EXTI_LINE_1\r
+  *         @arg @ref LL_EXTI_LINE_2\r
+  *         @arg @ref LL_EXTI_LINE_3\r
+  *         @arg @ref LL_EXTI_LINE_4\r
+  *         @arg @ref LL_EXTI_LINE_5\r
+  *         @arg @ref LL_EXTI_LINE_6\r
+  *         @arg @ref LL_EXTI_LINE_7\r
+  *         @arg @ref LL_EXTI_LINE_8\r
+  *         @arg @ref LL_EXTI_LINE_9\r
+  *         @arg @ref LL_EXTI_LINE_10\r
+  *         @arg @ref LL_EXTI_LINE_11\r
+  *         @arg @ref LL_EXTI_LINE_12\r
+  *         @arg @ref LL_EXTI_LINE_13\r
+  *         @arg @ref LL_EXTI_LINE_14\r
+  *         @arg @ref LL_EXTI_LINE_15\r
+  *         @arg @ref LL_EXTI_LINE_16\r
+  *         @arg @ref LL_EXTI_LINE_18\r
+  *         @arg @ref LL_EXTI_LINE_19\r
+  * @note   Please check each device line mapping for EXTI Line availability\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_EXTI_DisableRisingTrig_0_31(uint32_t ExtiLine)\r
+{\r
+  CLEAR_BIT(EXTI->RTSR, ExtiLine);\r
+\r
+}\r
+\r
+\r
+/**\r
+  * @brief  Check if rising edge trigger is enabled for Lines in range 0 to 31\r
+  * @rmtoll RTSR        RTx           LL_EXTI_IsEnabledRisingTrig_0_31\r
+  * @param  ExtiLine This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_EXTI_LINE_0\r
+  *         @arg @ref LL_EXTI_LINE_1\r
+  *         @arg @ref LL_EXTI_LINE_2\r
+  *         @arg @ref LL_EXTI_LINE_3\r
+  *         @arg @ref LL_EXTI_LINE_4\r
+  *         @arg @ref LL_EXTI_LINE_5\r
+  *         @arg @ref LL_EXTI_LINE_6\r
+  *         @arg @ref LL_EXTI_LINE_7\r
+  *         @arg @ref LL_EXTI_LINE_8\r
+  *         @arg @ref LL_EXTI_LINE_9\r
+  *         @arg @ref LL_EXTI_LINE_10\r
+  *         @arg @ref LL_EXTI_LINE_11\r
+  *         @arg @ref LL_EXTI_LINE_12\r
+  *         @arg @ref LL_EXTI_LINE_13\r
+  *         @arg @ref LL_EXTI_LINE_14\r
+  *         @arg @ref LL_EXTI_LINE_15\r
+  *         @arg @ref LL_EXTI_LINE_16\r
+  *         @arg @ref LL_EXTI_LINE_18\r
+  *         @arg @ref LL_EXTI_LINE_19\r
+  * @note   Please check each device line mapping for EXTI Line availability\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_EXTI_IsEnabledRisingTrig_0_31(uint32_t ExtiLine)\r
+{\r
+  return (READ_BIT(EXTI->RTSR, ExtiLine) == (ExtiLine));\r
+}\r
+\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup EXTI_LL_EF_Falling_Trigger_Management Falling_Trigger_Management\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable ExtiLine Falling Edge Trigger for Lines in range 0 to 31\r
+  * @note The configurable wakeup lines are edge-triggered. No glitch must be\r
+  *       generated on these lines. If a falling edge on a configurable interrupt\r
+  *       line occurs during a write operation in the EXTI_FTSR register, the\r
+  *       pending bit is not set.\r
+  *       Rising and falling edge triggers can be set for\r
+  *       the same interrupt line. In this case, both generate a trigger\r
+  *       condition.\r
+  * @rmtoll FTSR        FTx           LL_EXTI_EnableFallingTrig_0_31\r
+  * @param  ExtiLine This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_EXTI_LINE_0\r
+  *         @arg @ref LL_EXTI_LINE_1\r
+  *         @arg @ref LL_EXTI_LINE_2\r
+  *         @arg @ref LL_EXTI_LINE_3\r
+  *         @arg @ref LL_EXTI_LINE_4\r
+  *         @arg @ref LL_EXTI_LINE_5\r
+  *         @arg @ref LL_EXTI_LINE_6\r
+  *         @arg @ref LL_EXTI_LINE_7\r
+  *         @arg @ref LL_EXTI_LINE_8\r
+  *         @arg @ref LL_EXTI_LINE_9\r
+  *         @arg @ref LL_EXTI_LINE_10\r
+  *         @arg @ref LL_EXTI_LINE_11\r
+  *         @arg @ref LL_EXTI_LINE_12\r
+  *         @arg @ref LL_EXTI_LINE_13\r
+  *         @arg @ref LL_EXTI_LINE_14\r
+  *         @arg @ref LL_EXTI_LINE_15\r
+  *         @arg @ref LL_EXTI_LINE_16\r
+  *         @arg @ref LL_EXTI_LINE_18\r
+  *         @arg @ref LL_EXTI_LINE_19\r
+  * @note   Please check each device line mapping for EXTI Line availability\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_EXTI_EnableFallingTrig_0_31(uint32_t ExtiLine)\r
+{\r
+  SET_BIT(EXTI->FTSR, ExtiLine);\r
+}\r
+\r
+\r
+/**\r
+  * @brief  Disable ExtiLine Falling Edge Trigger for Lines in range 0 to 31\r
+  * @note The configurable wakeup lines are edge-triggered. No glitch must be\r
+  *       generated on these lines. If a Falling edge on a configurable interrupt\r
+  *       line occurs during a write operation in the EXTI_FTSR register, the\r
+  *       pending bit is not set.\r
+  *       Rising and falling edge triggers can be set for the same interrupt line.\r
+  *       In this case, both generate a trigger condition.\r
+  * @rmtoll FTSR        FTx           LL_EXTI_DisableFallingTrig_0_31\r
+  * @param  ExtiLine This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_EXTI_LINE_0\r
+  *         @arg @ref LL_EXTI_LINE_1\r
+  *         @arg @ref LL_EXTI_LINE_2\r
+  *         @arg @ref LL_EXTI_LINE_3\r
+  *         @arg @ref LL_EXTI_LINE_4\r
+  *         @arg @ref LL_EXTI_LINE_5\r
+  *         @arg @ref LL_EXTI_LINE_6\r
+  *         @arg @ref LL_EXTI_LINE_7\r
+  *         @arg @ref LL_EXTI_LINE_8\r
+  *         @arg @ref LL_EXTI_LINE_9\r
+  *         @arg @ref LL_EXTI_LINE_10\r
+  *         @arg @ref LL_EXTI_LINE_11\r
+  *         @arg @ref LL_EXTI_LINE_12\r
+  *         @arg @ref LL_EXTI_LINE_13\r
+  *         @arg @ref LL_EXTI_LINE_14\r
+  *         @arg @ref LL_EXTI_LINE_15\r
+  *         @arg @ref LL_EXTI_LINE_16\r
+  *         @arg @ref LL_EXTI_LINE_18\r
+  *         @arg @ref LL_EXTI_LINE_19\r
+  * @note   Please check each device line mapping for EXTI Line availability\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_EXTI_DisableFallingTrig_0_31(uint32_t ExtiLine)\r
+{\r
+  CLEAR_BIT(EXTI->FTSR, ExtiLine);\r
+}\r
+\r
+\r
+/**\r
+  * @brief  Check if falling edge trigger is enabled for Lines in range 0 to 31\r
+  * @rmtoll FTSR        FTx           LL_EXTI_IsEnabledFallingTrig_0_31\r
+  * @param  ExtiLine This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_EXTI_LINE_0\r
+  *         @arg @ref LL_EXTI_LINE_1\r
+  *         @arg @ref LL_EXTI_LINE_2\r
+  *         @arg @ref LL_EXTI_LINE_3\r
+  *         @arg @ref LL_EXTI_LINE_4\r
+  *         @arg @ref LL_EXTI_LINE_5\r
+  *         @arg @ref LL_EXTI_LINE_6\r
+  *         @arg @ref LL_EXTI_LINE_7\r
+  *         @arg @ref LL_EXTI_LINE_8\r
+  *         @arg @ref LL_EXTI_LINE_9\r
+  *         @arg @ref LL_EXTI_LINE_10\r
+  *         @arg @ref LL_EXTI_LINE_11\r
+  *         @arg @ref LL_EXTI_LINE_12\r
+  *         @arg @ref LL_EXTI_LINE_13\r
+  *         @arg @ref LL_EXTI_LINE_14\r
+  *         @arg @ref LL_EXTI_LINE_15\r
+  *         @arg @ref LL_EXTI_LINE_16\r
+  *         @arg @ref LL_EXTI_LINE_18\r
+  *         @arg @ref LL_EXTI_LINE_19\r
+  * @note   Please check each device line mapping for EXTI Line availability\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_EXTI_IsEnabledFallingTrig_0_31(uint32_t ExtiLine)\r
+{\r
+  return (READ_BIT(EXTI->FTSR, ExtiLine) == (ExtiLine));\r
+}\r
+\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup EXTI_LL_EF_Software_Interrupt_Management Software_Interrupt_Management\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Generate a software Interrupt Event for Lines in range 0 to 31\r
+  * @note If the interrupt is enabled on this line in the EXTI_IMR, writing a 1 to\r
+  *       this bit when it is at '0' sets the corresponding pending bit in EXTI_PR\r
+  *       resulting in an interrupt request generation.\r
+  *       This bit is cleared by clearing the corresponding bit in the EXTI_PR\r
+  *       register (by writing a 1 into the bit)\r
+  * @rmtoll SWIER       SWIx          LL_EXTI_GenerateSWI_0_31\r
+  * @param  ExtiLine This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_EXTI_LINE_0\r
+  *         @arg @ref LL_EXTI_LINE_1\r
+  *         @arg @ref LL_EXTI_LINE_2\r
+  *         @arg @ref LL_EXTI_LINE_3\r
+  *         @arg @ref LL_EXTI_LINE_4\r
+  *         @arg @ref LL_EXTI_LINE_5\r
+  *         @arg @ref LL_EXTI_LINE_6\r
+  *         @arg @ref LL_EXTI_LINE_7\r
+  *         @arg @ref LL_EXTI_LINE_8\r
+  *         @arg @ref LL_EXTI_LINE_9\r
+  *         @arg @ref LL_EXTI_LINE_10\r
+  *         @arg @ref LL_EXTI_LINE_11\r
+  *         @arg @ref LL_EXTI_LINE_12\r
+  *         @arg @ref LL_EXTI_LINE_13\r
+  *         @arg @ref LL_EXTI_LINE_14\r
+  *         @arg @ref LL_EXTI_LINE_15\r
+  *         @arg @ref LL_EXTI_LINE_16\r
+  *         @arg @ref LL_EXTI_LINE_18\r
+  *         @arg @ref LL_EXTI_LINE_19\r
+  * @note   Please check each device line mapping for EXTI Line availability\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_EXTI_GenerateSWI_0_31(uint32_t ExtiLine)\r
+{\r
+  SET_BIT(EXTI->SWIER, ExtiLine);\r
+}\r
+\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup EXTI_LL_EF_Flag_Management Flag_Management\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Check if the ExtLine Flag is set or not for Lines in range 0 to 31\r
+  * @note This bit is set when the selected edge event arrives on the interrupt\r
+  *       line. This bit is cleared by writing a 1 to the bit.\r
+  * @rmtoll PR          PIFx           LL_EXTI_IsActiveFlag_0_31\r
+  * @param  ExtiLine This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_EXTI_LINE_0\r
+  *         @arg @ref LL_EXTI_LINE_1\r
+  *         @arg @ref LL_EXTI_LINE_2\r
+  *         @arg @ref LL_EXTI_LINE_3\r
+  *         @arg @ref LL_EXTI_LINE_4\r
+  *         @arg @ref LL_EXTI_LINE_5\r
+  *         @arg @ref LL_EXTI_LINE_6\r
+  *         @arg @ref LL_EXTI_LINE_7\r
+  *         @arg @ref LL_EXTI_LINE_8\r
+  *         @arg @ref LL_EXTI_LINE_9\r
+  *         @arg @ref LL_EXTI_LINE_10\r
+  *         @arg @ref LL_EXTI_LINE_11\r
+  *         @arg @ref LL_EXTI_LINE_12\r
+  *         @arg @ref LL_EXTI_LINE_13\r
+  *         @arg @ref LL_EXTI_LINE_14\r
+  *         @arg @ref LL_EXTI_LINE_15\r
+  *         @arg @ref LL_EXTI_LINE_16\r
+  *         @arg @ref LL_EXTI_LINE_18\r
+  *         @arg @ref LL_EXTI_LINE_19\r
+  * @note   Please check each device line mapping for EXTI Line availability\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_EXTI_IsActiveFlag_0_31(uint32_t ExtiLine)\r
+{\r
+  return (READ_BIT(EXTI->PR, ExtiLine) == (ExtiLine));\r
+}\r
+\r
+\r
+/**\r
+  * @brief  Read ExtLine Combination Flag for Lines in range 0 to 31\r
+  * @note This bit is set when the selected edge event arrives on the interrupt\r
+  *       line. This bit is cleared by writing a 1 to the bit.\r
+  * @rmtoll PR          PIFx           LL_EXTI_ReadFlag_0_31\r
+  * @param  ExtiLine This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_EXTI_LINE_0\r
+  *         @arg @ref LL_EXTI_LINE_1\r
+  *         @arg @ref LL_EXTI_LINE_2\r
+  *         @arg @ref LL_EXTI_LINE_3\r
+  *         @arg @ref LL_EXTI_LINE_4\r
+  *         @arg @ref LL_EXTI_LINE_5\r
+  *         @arg @ref LL_EXTI_LINE_6\r
+  *         @arg @ref LL_EXTI_LINE_7\r
+  *         @arg @ref LL_EXTI_LINE_8\r
+  *         @arg @ref LL_EXTI_LINE_9\r
+  *         @arg @ref LL_EXTI_LINE_10\r
+  *         @arg @ref LL_EXTI_LINE_11\r
+  *         @arg @ref LL_EXTI_LINE_12\r
+  *         @arg @ref LL_EXTI_LINE_13\r
+  *         @arg @ref LL_EXTI_LINE_14\r
+  *         @arg @ref LL_EXTI_LINE_15\r
+  *         @arg @ref LL_EXTI_LINE_16\r
+  *         @arg @ref LL_EXTI_LINE_18\r
+  *         @arg @ref LL_EXTI_LINE_19\r
+  * @note   Please check each device line mapping for EXTI Line availability\r
+  * @retval @note This bit is set when the selected edge event arrives on the interrupt\r
+  */\r
+__STATIC_INLINE uint32_t LL_EXTI_ReadFlag_0_31(uint32_t ExtiLine)\r
+{\r
+  return (uint32_t)(READ_BIT(EXTI->PR, ExtiLine));\r
+}\r
+\r
+\r
+/**\r
+  * @brief  Clear ExtLine Flags  for Lines in range 0 to 31\r
+  * @note This bit is set when the selected edge event arrives on the interrupt\r
+  *       line. This bit is cleared by writing a 1 to the bit.\r
+  * @rmtoll PR          PIFx           LL_EXTI_ClearFlag_0_31\r
+  * @param  ExtiLine This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_EXTI_LINE_0\r
+  *         @arg @ref LL_EXTI_LINE_1\r
+  *         @arg @ref LL_EXTI_LINE_2\r
+  *         @arg @ref LL_EXTI_LINE_3\r
+  *         @arg @ref LL_EXTI_LINE_4\r
+  *         @arg @ref LL_EXTI_LINE_5\r
+  *         @arg @ref LL_EXTI_LINE_6\r
+  *         @arg @ref LL_EXTI_LINE_7\r
+  *         @arg @ref LL_EXTI_LINE_8\r
+  *         @arg @ref LL_EXTI_LINE_9\r
+  *         @arg @ref LL_EXTI_LINE_10\r
+  *         @arg @ref LL_EXTI_LINE_11\r
+  *         @arg @ref LL_EXTI_LINE_12\r
+  *         @arg @ref LL_EXTI_LINE_13\r
+  *         @arg @ref LL_EXTI_LINE_14\r
+  *         @arg @ref LL_EXTI_LINE_15\r
+  *         @arg @ref LL_EXTI_LINE_16\r
+  *         @arg @ref LL_EXTI_LINE_18\r
+  *         @arg @ref LL_EXTI_LINE_19\r
+  * @note   Please check each device line mapping for EXTI Line availability\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_EXTI_ClearFlag_0_31(uint32_t ExtiLine)\r
+{\r
+  WRITE_REG(EXTI->PR, ExtiLine);\r
+}\r
+\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#if defined(USE_FULL_LL_DRIVER)\r
+/** @defgroup EXTI_LL_EF_Init Initialization and de-initialization functions\r
+  * @{\r
+  */\r
+\r
+uint32_t LL_EXTI_Init(LL_EXTI_InitTypeDef *EXTI_InitStruct);\r
+uint32_t LL_EXTI_DeInit(void);\r
+void LL_EXTI_StructInit(LL_EXTI_InitTypeDef *EXTI_InitStruct);\r
+\r
+\r
+/**\r
+  * @}\r
+  */\r
+#endif /* USE_FULL_LL_DRIVER */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* EXTI */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* STM32F1xx_LL_EXTI_H */\r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_gpio.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_gpio.h
new file mode 100644 (file)
index 0000000..8cc7832
--- /dev/null
@@ -0,0 +1,2347 @@
+/**\r
+  ******************************************************************************\r
+  * @file    stm32f1xx_ll_gpio.h\r
+  * @author  MCD Application Team\r
+  * @brief   Header file of GPIO LL module.\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+\r
+/* Define to prevent recursive inclusion -------------------------------------*/\r
+#ifndef STM32F1xx_LL_GPIO_H\r
+#define STM32F1xx_LL_GPIO_H\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/* Includes ------------------------------------------------------------------*/\r
+#include "stm32f1xx.h"\r
+\r
+/** @addtogroup STM32F1xx_LL_Driver\r
+  * @{\r
+  */\r
+\r
+#if defined (GPIOA) || defined (GPIOB) || defined (GPIOC) || defined (GPIOD) || defined (GPIOE) || defined (GPIOF) || defined (GPIOG)\r
+\r
+/** @defgroup GPIO_LL GPIO\r
+  * @{\r
+  */\r
+\r
+/* Private types -------------------------------------------------------------*/\r
+/* Private variables ---------------------------------------------------------*/\r
+/* Private constants ---------------------------------------------------------*/\r
+\r
+/** @defgroup GPIO_LL_Private_Constants GPIO Private Constants\r
+  * @{\r
+  */\r
+/* Defines used for Pin Mask Initialization */\r
+#define GPIO_PIN_MASK_POS   8U\r
+#define GPIO_PIN_NB         16U\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Private macros ------------------------------------------------------------*/\r
+#if defined(USE_FULL_LL_DRIVER)\r
+/** @defgroup GPIO_LL_Private_Macros GPIO Private Macros\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+#endif /*USE_FULL_LL_DRIVER*/\r
+\r
+/* Exported types ------------------------------------------------------------*/\r
+#if defined(USE_FULL_LL_DRIVER)\r
+/** @defgroup GPIO_LL_ES_INIT GPIO Exported Init structures\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief LL GPIO Init Structure definition\r
+  */\r
+typedef struct\r
+{\r
+  uint32_t Pin;          /*!< Specifies the GPIO pins to be configured.\r
+                              This parameter can be any value of @ref GPIO_LL_EC_PIN */\r
+\r
+  uint32_t Mode;         /*!< Specifies the operating mode for the selected pins.\r
+                              This parameter can be a value of @ref GPIO_LL_EC_MODE.\r
+\r
+                              GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinMode().*/\r
+\r
+  uint32_t Speed;        /*!< Specifies the speed for the selected pins.\r
+                              This parameter can be a value of @ref GPIO_LL_EC_SPEED.\r
+\r
+                              GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinSpeed().*/\r
+\r
+  uint32_t OutputType;   /*!< Specifies the operating output type for the selected pins.\r
+                              This parameter can be a value of @ref GPIO_LL_EC_OUTPUT.\r
+\r
+                              GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinOutputType().*/\r
+\r
+  uint32_t Pull;         /*!< Specifies the operating Pull-up/Pull down for the selected pins.\r
+                              This parameter can be a value of @ref GPIO_LL_EC_PULL.\r
+\r
+                              GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinPull().*/\r
+} LL_GPIO_InitTypeDef;\r
+\r
+/**\r
+  * @}\r
+  */\r
+#endif /* USE_FULL_LL_DRIVER */\r
+\r
+/* Exported constants --------------------------------------------------------*/\r
+/** @defgroup GPIO_LL_Exported_Constants GPIO Exported Constants\r
+  * @{\r
+  */\r
+\r
+/** @defgroup GPIO_LL_EC_PIN PIN\r
+  * @{\r
+  */\r
+#define LL_GPIO_PIN_0                    ((GPIO_BSRR_BS0  << GPIO_PIN_MASK_POS) | 0x00000001U)  /*!< Select pin 0  */\r
+#define LL_GPIO_PIN_1                    ((GPIO_BSRR_BS1  << GPIO_PIN_MASK_POS) | 0x00000002U)  /*!< Select pin 1  */\r
+#define LL_GPIO_PIN_2                    ((GPIO_BSRR_BS2  << GPIO_PIN_MASK_POS) | 0x00000004U)  /*!< Select pin 2  */\r
+#define LL_GPIO_PIN_3                    ((GPIO_BSRR_BS3  << GPIO_PIN_MASK_POS) | 0x00000008U)  /*!< Select pin 3  */\r
+#define LL_GPIO_PIN_4                    ((GPIO_BSRR_BS4  << GPIO_PIN_MASK_POS) | 0x00000010U)  /*!< Select pin 4  */\r
+#define LL_GPIO_PIN_5                    ((GPIO_BSRR_BS5  << GPIO_PIN_MASK_POS) | 0x00000020U)  /*!< Select pin 5  */\r
+#define LL_GPIO_PIN_6                    ((GPIO_BSRR_BS6  << GPIO_PIN_MASK_POS) | 0x00000040U)  /*!< Select pin 6  */\r
+#define LL_GPIO_PIN_7                    ((GPIO_BSRR_BS7  << GPIO_PIN_MASK_POS) | 0x00000080U)  /*!< Select pin 7  */\r
+#define LL_GPIO_PIN_8                    ((GPIO_BSRR_BS8  << GPIO_PIN_MASK_POS) | 0x04000001U)  /*!< Select pin 8  */\r
+#define LL_GPIO_PIN_9                    ((GPIO_BSRR_BS9  << GPIO_PIN_MASK_POS) | 0x04000002U)  /*!< Select pin 9  */\r
+#define LL_GPIO_PIN_10                   ((GPIO_BSRR_BS10 << GPIO_PIN_MASK_POS) | 0x04000004U)  /*!< Select pin 10 */\r
+#define LL_GPIO_PIN_11                   ((GPIO_BSRR_BS11 << GPIO_PIN_MASK_POS) | 0x04000008U)  /*!< Select pin 11 */\r
+#define LL_GPIO_PIN_12                   ((GPIO_BSRR_BS12 << GPIO_PIN_MASK_POS) | 0x04000010U)  /*!< Select pin 12 */\r
+#define LL_GPIO_PIN_13                   ((GPIO_BSRR_BS13 << GPIO_PIN_MASK_POS) | 0x04000020U)  /*!< Select pin 13 */\r
+#define LL_GPIO_PIN_14                   ((GPIO_BSRR_BS14 << GPIO_PIN_MASK_POS) | 0x04000040U)  /*!< Select pin 14 */\r
+#define LL_GPIO_PIN_15                   ((GPIO_BSRR_BS15 << GPIO_PIN_MASK_POS) | 0x04000080U)  /*!< Select pin 15 */\r
+#define LL_GPIO_PIN_ALL                  (LL_GPIO_PIN_0  | LL_GPIO_PIN_1  | LL_GPIO_PIN_2  | \\r
+                                          LL_GPIO_PIN_3  | LL_GPIO_PIN_4  | LL_GPIO_PIN_5  | \\r
+                                          LL_GPIO_PIN_6  | LL_GPIO_PIN_7  | LL_GPIO_PIN_8  | \\r
+                                          LL_GPIO_PIN_9  | LL_GPIO_PIN_10 | LL_GPIO_PIN_11 | \\r
+                                          LL_GPIO_PIN_12 | LL_GPIO_PIN_13 | LL_GPIO_PIN_14 | \\r
+                                          LL_GPIO_PIN_15)                                      /*!< Select all pins */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup GPIO_LL_EC_MODE Mode\r
+  * @{\r
+  */\r
+#define LL_GPIO_MODE_ANALOG              0x00000000U       /*!< Select analog mode */\r
+#define LL_GPIO_MODE_FLOATING            GPIO_CRL_CNF0_0   /*!< Select floating mode */\r
+#define LL_GPIO_MODE_INPUT               GPIO_CRL_CNF0_1   /*!< Select input mode */\r
+#define LL_GPIO_MODE_OUTPUT              GPIO_CRL_MODE0_0  /*!< Select general purpose output mode */\r
+#define LL_GPIO_MODE_ALTERNATE           (GPIO_CRL_CNF0_1 | GPIO_CRL_MODE0_0) /*!< Select alternate function mode */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup GPIO_LL_EC_OUTPUT Output Type\r
+  * @{\r
+  */\r
+#define LL_GPIO_OUTPUT_PUSHPULL          0x00000000U                /*!< Select push-pull as output type */\r
+#define LL_GPIO_OUTPUT_OPENDRAIN         GPIO_CRL_CNF0_0            /*!< Select open-drain as output type */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup GPIO_LL_EC_SPEED Output Speed\r
+  * @{\r
+  */\r
+#define LL_GPIO_MODE_OUTPUT_10MHz        GPIO_CRL_MODE0_0            /*!< Select Output mode, max speed 10 MHz */\r
+#define LL_GPIO_MODE_OUTPUT_2MHz         GPIO_CRL_MODE0_1            /*!< Select Output mode, max speed 20 MHz */\r
+#define LL_GPIO_MODE_OUTPUT_50MHz        GPIO_CRL_MODE0              /*!< Select Output mode, max speed 50 MHz */\r
+/**\r
+  * @}\r
+  */\r
+\r
+#define LL_GPIO_SPEED_FREQ_LOW           LL_GPIO_MODE_OUTPUT_2MHz    /*!< Select I/O low output speed    */\r
+#define LL_GPIO_SPEED_FREQ_MEDIUM        LL_GPIO_MODE_OUTPUT_10MHz   /*!< Select I/O medium output speed */\r
+#define LL_GPIO_SPEED_FREQ_HIGH          LL_GPIO_MODE_OUTPUT_50MHz   /*!< Select I/O high output speed   */\r
+\r
+/** @defgroup GPIO_LL_EC_PULL Pull Up Pull Down\r
+  * @{\r
+  */\r
+#define LL_GPIO_PULL_DOWN                0x00000000U    /*!< Select I/O pull down */\r
+#define LL_GPIO_PULL_UP                  GPIO_ODR_ODR0  /*!< Select I/O pull up */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup GPIO_LL_EVENTOUT_PIN EVENTOUT Pin\r
+  * @{\r
+  */\r
+\r
+#define LL_GPIO_AF_EVENTOUT_PIN_0        AFIO_EVCR_PIN_PX0   /*!< EVENTOUT on pin 0 */\r
+#define LL_GPIO_AF_EVENTOUT_PIN_1        AFIO_EVCR_PIN_PX1   /*!< EVENTOUT on pin 1 */\r
+#define LL_GPIO_AF_EVENTOUT_PIN_2        AFIO_EVCR_PIN_PX2   /*!< EVENTOUT on pin 2 */\r
+#define LL_GPIO_AF_EVENTOUT_PIN_3        AFIO_EVCR_PIN_PX3   /*!< EVENTOUT on pin 3 */\r
+#define LL_GPIO_AF_EVENTOUT_PIN_4        AFIO_EVCR_PIN_PX4   /*!< EVENTOUT on pin 4 */\r
+#define LL_GPIO_AF_EVENTOUT_PIN_5        AFIO_EVCR_PIN_PX5   /*!< EVENTOUT on pin 5 */\r
+#define LL_GPIO_AF_EVENTOUT_PIN_6        AFIO_EVCR_PIN_PX6   /*!< EVENTOUT on pin 6 */\r
+#define LL_GPIO_AF_EVENTOUT_PIN_7        AFIO_EVCR_PIN_PX7   /*!< EVENTOUT on pin 7 */\r
+#define LL_GPIO_AF_EVENTOUT_PIN_8        AFIO_EVCR_PIN_PX8   /*!< EVENTOUT on pin 8 */\r
+#define LL_GPIO_AF_EVENTOUT_PIN_9        AFIO_EVCR_PIN_PX9   /*!< EVENTOUT on pin 9 */\r
+#define LL_GPIO_AF_EVENTOUT_PIN_10       AFIO_EVCR_PIN_PX10  /*!< EVENTOUT on pin 10 */\r
+#define LL_GPIO_AF_EVENTOUT_PIN_11       AFIO_EVCR_PIN_PX11  /*!< EVENTOUT on pin 11 */\r
+#define LL_GPIO_AF_EVENTOUT_PIN_12       AFIO_EVCR_PIN_PX12  /*!< EVENTOUT on pin 12 */\r
+#define LL_GPIO_AF_EVENTOUT_PIN_13       AFIO_EVCR_PIN_PX13  /*!< EVENTOUT on pin 13 */\r
+#define LL_GPIO_AF_EVENTOUT_PIN_14       AFIO_EVCR_PIN_PX14  /*!< EVENTOUT on pin 14 */\r
+#define LL_GPIO_AF_EVENTOUT_PIN_15       AFIO_EVCR_PIN_PX15  /*!< EVENTOUT on pin 15 */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup GPIO_LL_EVENTOUT_PORT EVENTOUT Port\r
+  * @{\r
+  */\r
+\r
+#define LL_GPIO_AF_EVENTOUT_PORT_A       AFIO_EVCR_PORT_PA  /*!< EVENTOUT on port A */\r
+#define LL_GPIO_AF_EVENTOUT_PORT_B       AFIO_EVCR_PORT_PB  /*!< EVENTOUT on port B */\r
+#define LL_GPIO_AF_EVENTOUT_PORT_C       AFIO_EVCR_PORT_PC  /*!< EVENTOUT on port C */\r
+#define LL_GPIO_AF_EVENTOUT_PORT_D       AFIO_EVCR_PORT_PD  /*!< EVENTOUT on port D */\r
+#define LL_GPIO_AF_EVENTOUT_PORT_E       AFIO_EVCR_PORT_PE  /*!< EVENTOUT on port E */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup GPIO_LL_EC_EXTI_PORT GPIO EXTI PORT\r
+  * @{\r
+  */\r
+#define LL_GPIO_AF_EXTI_PORTA            0U   /*!< EXTI PORT A */\r
+#define LL_GPIO_AF_EXTI_PORTB            1U   /*!< EXTI PORT B */\r
+#define LL_GPIO_AF_EXTI_PORTC            2U   /*!< EXTI PORT C */\r
+#define LL_GPIO_AF_EXTI_PORTD            3U   /*!< EXTI PORT D */\r
+#define LL_GPIO_AF_EXTI_PORTE            4U   /*!< EXTI PORT E */\r
+#define LL_GPIO_AF_EXTI_PORTF            5U   /*!< EXTI PORT F */\r
+#define LL_GPIO_AF_EXTI_PORTG            6U   /*!< EXTI PORT G */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup GPIO_LL_EC_EXTI_LINE GPIO EXTI LINE\r
+  * @{\r
+  */\r
+#define LL_GPIO_AF_EXTI_LINE0            (0x000FU << 16U | 0U)  /*!< EXTI_POSITION_0  | EXTICR[0] */\r
+#define LL_GPIO_AF_EXTI_LINE1            (0x00F0U << 16U | 0U)  /*!< EXTI_POSITION_4  | EXTICR[0] */\r
+#define LL_GPIO_AF_EXTI_LINE2            (0x0F00U << 16U | 0U)  /*!< EXTI_POSITION_8  | EXTICR[0] */\r
+#define LL_GPIO_AF_EXTI_LINE3            (0xF000U << 16U | 0U)  /*!< EXTI_POSITION_12 | EXTICR[0] */\r
+#define LL_GPIO_AF_EXTI_LINE4            (0x000FU << 16U | 1U)  /*!< EXTI_POSITION_0  | EXTICR[1] */\r
+#define LL_GPIO_AF_EXTI_LINE5            (0x00F0U << 16U | 1U)  /*!< EXTI_POSITION_4  | EXTICR[1] */\r
+#define LL_GPIO_AF_EXTI_LINE6            (0x0F00U << 16U | 1U)  /*!< EXTI_POSITION_8  | EXTICR[1] */\r
+#define LL_GPIO_AF_EXTI_LINE7            (0xF000U << 16U | 1U)  /*!< EXTI_POSITION_12 | EXTICR[1] */\r
+#define LL_GPIO_AF_EXTI_LINE8            (0x000FU << 16U | 2U)  /*!< EXTI_POSITION_0  | EXTICR[2] */\r
+#define LL_GPIO_AF_EXTI_LINE9            (0x00F0U << 16U | 2U)  /*!< EXTI_POSITION_4  | EXTICR[2] */\r
+#define LL_GPIO_AF_EXTI_LINE10           (0x0F00U << 16U | 2U)  /*!< EXTI_POSITION_8  | EXTICR[2] */\r
+#define LL_GPIO_AF_EXTI_LINE11           (0xF000U << 16U | 2U)  /*!< EXTI_POSITION_12 | EXTICR[2] */\r
+#define LL_GPIO_AF_EXTI_LINE12           (0x000FU << 16U | 3U)  /*!< EXTI_POSITION_0  | EXTICR[3] */\r
+#define LL_GPIO_AF_EXTI_LINE13           (0x00F0U << 16U | 3U)  /*!< EXTI_POSITION_4  | EXTICR[3] */\r
+#define LL_GPIO_AF_EXTI_LINE14           (0x0F00U << 16U | 3U)  /*!< EXTI_POSITION_8  | EXTICR[3] */\r
+#define LL_GPIO_AF_EXTI_LINE15           (0xF000U << 16U | 3U)  /*!< EXTI_POSITION_12 | EXTICR[3] */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Exported macro ------------------------------------------------------------*/\r
+/** @defgroup GPIO_LL_Exported_Macros GPIO Exported Macros\r
+  * @{\r
+  */\r
+\r
+/** @defgroup GPIO_LL_EM_WRITE_READ Common Write and read registers Macros\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Write a value in GPIO register\r
+  * @param  __INSTANCE__ GPIO Instance\r
+  * @param  __REG__ Register to be written\r
+  * @param  __VALUE__ Value to be written in the register\r
+  * @retval None\r
+  */\r
+#define LL_GPIO_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))\r
+\r
+/**\r
+  * @brief  Read a value in GPIO register\r
+  * @param  __INSTANCE__ GPIO Instance\r
+  * @param  __REG__ Register to be read\r
+  * @retval Register value\r
+  */\r
+#define LL_GPIO_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Exported functions --------------------------------------------------------*/\r
+/** @defgroup GPIO_LL_Exported_Functions GPIO Exported Functions\r
+  * @{\r
+  */\r
+\r
+/** @defgroup GPIO_LL_EF_Port_Configuration Port Configuration\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Configure gpio mode for a dedicated pin on dedicated port.\r
+  * @note   I/O mode can be Analog, Floating input, Input with pull-up/pull-down, General purpose Output,\r
+  *         Alternate function Output.\r
+  * @note   Warning: only one pin can be passed as parameter.\r
+  * @rmtoll CRL        CNFy         LL_GPIO_SetPinMode\r
+  * @rmtoll CRL        MODEy        LL_GPIO_SetPinMode\r
+  * @rmtoll CRH        CNFy         LL_GPIO_SetPinMode\r
+  * @rmtoll CRH        MODEy        LL_GPIO_SetPinMode\r
+  * @param  GPIOx GPIO Port\r
+  * @param  Pin This parameter can be one of the following values:\r
+  *         @arg @ref LL_GPIO_PIN_0\r
+  *         @arg @ref LL_GPIO_PIN_1\r
+  *         @arg @ref LL_GPIO_PIN_2\r
+  *         @arg @ref LL_GPIO_PIN_3\r
+  *         @arg @ref LL_GPIO_PIN_4\r
+  *         @arg @ref LL_GPIO_PIN_5\r
+  *         @arg @ref LL_GPIO_PIN_6\r
+  *         @arg @ref LL_GPIO_PIN_7\r
+  *         @arg @ref LL_GPIO_PIN_8\r
+  *         @arg @ref LL_GPIO_PIN_9\r
+  *         @arg @ref LL_GPIO_PIN_10\r
+  *         @arg @ref LL_GPIO_PIN_11\r
+  *         @arg @ref LL_GPIO_PIN_12\r
+  *         @arg @ref LL_GPIO_PIN_13\r
+  *         @arg @ref LL_GPIO_PIN_14\r
+  *         @arg @ref LL_GPIO_PIN_15\r
+  * @param  Mode This parameter can be one of the following values:\r
+  *         @arg @ref LL_GPIO_MODE_ANALOG\r
+  *         @arg @ref LL_GPIO_MODE_FLOATING\r
+  *         @arg @ref LL_GPIO_MODE_INPUT\r
+  *         @arg @ref LL_GPIO_MODE_OUTPUT\r
+  *         @arg @ref LL_GPIO_MODE_ALTERNATE\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_SetPinMode(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Mode)\r
+{\r
+  register uint32_t *pReg = (uint32_t *)((uint32_t)((uint32_t)(&GPIOx->CRL) + (Pin >> 24)));\r
+  MODIFY_REG(*pReg, ((GPIO_CRL_CNF0 | GPIO_CRL_MODE0) << (POSITION_VAL(Pin) * 4U)), (Mode << (POSITION_VAL(Pin) * 4U)));\r
+}\r
+\r
+/**\r
+  * @brief  Return gpio mode for a dedicated pin on dedicated port.\r
+  * @note   I/O mode can be Analog, Floating input, Input with pull-up/pull-down, General purpose Output,\r
+  *         Alternate function Output.\r
+  * @note   Warning: only one pin can be passed as parameter.\r
+  * @rmtoll CRL        CNFy         LL_GPIO_GetPinMode\r
+  * @rmtoll CRL        MODEy        LL_GPIO_GetPinMode\r
+  * @rmtoll CRH        CNFy         LL_GPIO_GetPinMode\r
+  * @rmtoll CRH        MODEy        LL_GPIO_GetPinMode\r
+  * @param  GPIOx GPIO Port\r
+  * @param  Pin This parameter can be one of the following values:\r
+  *         @arg @ref LL_GPIO_PIN_0\r
+  *         @arg @ref LL_GPIO_PIN_1\r
+  *         @arg @ref LL_GPIO_PIN_2\r
+  *         @arg @ref LL_GPIO_PIN_3\r
+  *         @arg @ref LL_GPIO_PIN_4\r
+  *         @arg @ref LL_GPIO_PIN_5\r
+  *         @arg @ref LL_GPIO_PIN_6\r
+  *         @arg @ref LL_GPIO_PIN_7\r
+  *         @arg @ref LL_GPIO_PIN_8\r
+  *         @arg @ref LL_GPIO_PIN_9\r
+  *         @arg @ref LL_GPIO_PIN_10\r
+  *         @arg @ref LL_GPIO_PIN_11\r
+  *         @arg @ref LL_GPIO_PIN_12\r
+  *         @arg @ref LL_GPIO_PIN_13\r
+  *         @arg @ref LL_GPIO_PIN_14\r
+  *         @arg @ref LL_GPIO_PIN_15\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_GPIO_MODE_ANALOG\r
+  *         @arg @ref LL_GPIO_MODE_FLOATING\r
+  *         @arg @ref LL_GPIO_MODE_INPUT\r
+  *         @arg @ref LL_GPIO_MODE_OUTPUT\r
+  *         @arg @ref LL_GPIO_MODE_ALTERNATE\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_GetPinMode(GPIO_TypeDef *GPIOx, uint32_t Pin)\r
+{\r
+  register uint32_t *pReg = (uint32_t *)((uint32_t)((uint32_t)(&GPIOx->CRL) + (Pin >> 24)));\r
+  return (READ_BIT(*pReg, ((GPIO_CRL_CNF0 | GPIO_CRL_MODE0) << (POSITION_VAL(Pin) * 4U))) >> (POSITION_VAL(Pin) * 4U));\r
+}\r
+\r
+/**\r
+  * @brief  Configure gpio speed for a dedicated pin on dedicated port.\r
+  * @note   I/O speed can be Low, Medium or Fast speed.\r
+  * @note   Warning: only one pin can be passed as parameter.\r
+  * @note   Refer to datasheet for frequency specifications and the power\r
+  *         supply and load conditions for each speed.\r
+  * @rmtoll CRL      MODEy       LL_GPIO_SetPinSpeed\r
+  * @rmtoll CRH      MODEy       LL_GPIO_SetPinSpeed\r
+  * @param  GPIOx GPIO Port\r
+  * @param  Pin This parameter can be one of the following values:\r
+  *         @arg @ref LL_GPIO_PIN_0\r
+  *         @arg @ref LL_GPIO_PIN_1\r
+  *         @arg @ref LL_GPIO_PIN_2\r
+  *         @arg @ref LL_GPIO_PIN_3\r
+  *         @arg @ref LL_GPIO_PIN_4\r
+  *         @arg @ref LL_GPIO_PIN_5\r
+  *         @arg @ref LL_GPIO_PIN_6\r
+  *         @arg @ref LL_GPIO_PIN_7\r
+  *         @arg @ref LL_GPIO_PIN_8\r
+  *         @arg @ref LL_GPIO_PIN_9\r
+  *         @arg @ref LL_GPIO_PIN_10\r
+  *         @arg @ref LL_GPIO_PIN_11\r
+  *         @arg @ref LL_GPIO_PIN_12\r
+  *         @arg @ref LL_GPIO_PIN_13\r
+  *         @arg @ref LL_GPIO_PIN_14\r
+  *         @arg @ref LL_GPIO_PIN_15\r
+  * @param  Speed This parameter can be one of the following values:\r
+  *         @arg @ref LL_GPIO_SPEED_FREQ_LOW\r
+  *         @arg @ref LL_GPIO_SPEED_FREQ_MEDIUM\r
+  *         @arg @ref LL_GPIO_SPEED_FREQ_HIGH\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_SetPinSpeed(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t  Speed)\r
+{\r
+  register uint32_t *pReg = (uint32_t *)((uint32_t)((uint32_t)(&GPIOx->CRL) + (Pin >> 24)));\r
+  MODIFY_REG(*pReg, (GPIO_CRL_MODE0 << (POSITION_VAL(Pin) * 4U)),\r
+             (Speed << (POSITION_VAL(Pin) * 4U)));\r
+}\r
+\r
+/**\r
+  * @brief  Return gpio speed for a dedicated pin on dedicated port.\r
+  * @note   I/O speed can be Low, Medium, Fast or High speed.\r
+  * @note   Warning: only one pin can be passed as parameter.\r
+  * @note   Refer to datasheet for frequency specifications and the power\r
+  *         supply and load conditions for each speed.\r
+  * @rmtoll CRL      MODEy       LL_GPIO_GetPinSpeed\r
+  * @rmtoll CRH      MODEy       LL_GPIO_GetPinSpeed\r
+  * @param  GPIOx GPIO Port\r
+  * @param  Pin This parameter can be one of the following values:\r
+  *         @arg @ref LL_GPIO_PIN_0\r
+  *         @arg @ref LL_GPIO_PIN_1\r
+  *         @arg @ref LL_GPIO_PIN_2\r
+  *         @arg @ref LL_GPIO_PIN_3\r
+  *         @arg @ref LL_GPIO_PIN_4\r
+  *         @arg @ref LL_GPIO_PIN_5\r
+  *         @arg @ref LL_GPIO_PIN_6\r
+  *         @arg @ref LL_GPIO_PIN_7\r
+  *         @arg @ref LL_GPIO_PIN_8\r
+  *         @arg @ref LL_GPIO_PIN_9\r
+  *         @arg @ref LL_GPIO_PIN_10\r
+  *         @arg @ref LL_GPIO_PIN_11\r
+  *         @arg @ref LL_GPIO_PIN_12\r
+  *         @arg @ref LL_GPIO_PIN_13\r
+  *         @arg @ref LL_GPIO_PIN_14\r
+  *         @arg @ref LL_GPIO_PIN_15\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_GPIO_SPEED_FREQ_LOW\r
+  *         @arg @ref LL_GPIO_SPEED_FREQ_MEDIUM\r
+  *         @arg @ref LL_GPIO_SPEED_FREQ_HIGH\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_GetPinSpeed(GPIO_TypeDef *GPIOx, uint32_t Pin)\r
+{\r
+  register uint32_t *pReg = (uint32_t *)((uint32_t)((uint32_t)(&GPIOx->CRL) + (Pin >> 24)));\r
+  return (READ_BIT(*pReg, (GPIO_CRL_MODE0 << (POSITION_VAL(Pin) * 4U))) >> (POSITION_VAL(Pin) * 4U));\r
+}\r
+\r
+/**\r
+  * @brief  Configure gpio output type for several pins on dedicated port.\r
+  * @note   Output type as to be set when gpio pin is in output or\r
+  *         alternate modes. Possible type are Push-pull or Open-drain.\r
+  * @rmtoll CRL       MODEy           LL_GPIO_SetPinOutputType\r
+  * @rmtoll CRH       MODEy           LL_GPIO_SetPinOutputType\r
+  * @param  GPIOx GPIO Port\r
+  * @param  Pin This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_GPIO_PIN_0\r
+  *         @arg @ref LL_GPIO_PIN_1\r
+  *         @arg @ref LL_GPIO_PIN_2\r
+  *         @arg @ref LL_GPIO_PIN_3\r
+  *         @arg @ref LL_GPIO_PIN_4\r
+  *         @arg @ref LL_GPIO_PIN_5\r
+  *         @arg @ref LL_GPIO_PIN_6\r
+  *         @arg @ref LL_GPIO_PIN_7\r
+  *         @arg @ref LL_GPIO_PIN_8\r
+  *         @arg @ref LL_GPIO_PIN_9\r
+  *         @arg @ref LL_GPIO_PIN_10\r
+  *         @arg @ref LL_GPIO_PIN_11\r
+  *         @arg @ref LL_GPIO_PIN_12\r
+  *         @arg @ref LL_GPIO_PIN_13\r
+  *         @arg @ref LL_GPIO_PIN_14\r
+  *         @arg @ref LL_GPIO_PIN_15\r
+  *         @arg @ref LL_GPIO_PIN_ALL\r
+  * @param  OutputType This parameter can be one of the following values:\r
+  *         @arg @ref LL_GPIO_OUTPUT_PUSHPULL\r
+  *         @arg @ref LL_GPIO_OUTPUT_OPENDRAIN\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_SetPinOutputType(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t OutputType)\r
+{\r
+  register uint32_t *pReg = (uint32_t *)((uint32_t)((uint32_t)(&GPIOx->CRL) + (Pin >> 24)));\r
+  MODIFY_REG(*pReg, (GPIO_CRL_CNF0_0 << (POSITION_VAL(Pin) * 4U)),\r
+             (OutputType << (POSITION_VAL(Pin) * 4U)));\r
+}\r
+\r
+/**\r
+  * @brief  Return gpio output type for several pins on dedicated port.\r
+  * @note   Output type as to be set when gpio pin is in output or\r
+  *         alternate modes. Possible type are Push-pull or Open-drain.\r
+  * @note   Warning: only one pin can be passed as parameter.\r
+  * @rmtoll CRL       MODEy       LL_GPIO_GetPinOutputType\r
+  * @rmtoll CRH       MODEy       LL_GPIO_GetPinOutputType\r
+  * @param  GPIOx GPIO Port\r
+  * @param  Pin This parameter can be one of the following values:\r
+  *         @arg @ref LL_GPIO_PIN_0\r
+  *         @arg @ref LL_GPIO_PIN_1\r
+  *         @arg @ref LL_GPIO_PIN_2\r
+  *         @arg @ref LL_GPIO_PIN_3\r
+  *         @arg @ref LL_GPIO_PIN_4\r
+  *         @arg @ref LL_GPIO_PIN_5\r
+  *         @arg @ref LL_GPIO_PIN_6\r
+  *         @arg @ref LL_GPIO_PIN_7\r
+  *         @arg @ref LL_GPIO_PIN_8\r
+  *         @arg @ref LL_GPIO_PIN_9\r
+  *         @arg @ref LL_GPIO_PIN_10\r
+  *         @arg @ref LL_GPIO_PIN_11\r
+  *         @arg @ref LL_GPIO_PIN_12\r
+  *         @arg @ref LL_GPIO_PIN_13\r
+  *         @arg @ref LL_GPIO_PIN_14\r
+  *         @arg @ref LL_GPIO_PIN_15\r
+  *         @arg @ref LL_GPIO_PIN_ALL\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_GPIO_OUTPUT_PUSHPULL\r
+  *         @arg @ref LL_GPIO_OUTPUT_OPENDRAIN\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_GetPinOutputType(GPIO_TypeDef *GPIOx, uint32_t Pin)\r
+{\r
+  register uint32_t *pReg = (uint32_t *)((uint32_t)((uint32_t)(&GPIOx->CRL) + (Pin >> 24)));\r
+  return (READ_BIT(*pReg, (GPIO_CRL_CNF0_0 << (POSITION_VAL(Pin) * 4U))) >> (POSITION_VAL(Pin) * 4U));\r
+\r
+}\r
+\r
+/**\r
+  * @brief  Configure gpio pull-up or pull-down for a dedicated pin on a dedicated port.\r
+  * @note   Warning: only one pin can be passed as parameter.\r
+  * @rmtoll ODR        ODR         LL_GPIO_SetPinPull\r
+  * @param  GPIOx GPIO Port\r
+  * @param  Pin This parameter can be one of the following values:\r
+  *         @arg @ref LL_GPIO_PIN_0\r
+  *         @arg @ref LL_GPIO_PIN_1\r
+  *         @arg @ref LL_GPIO_PIN_2\r
+  *         @arg @ref LL_GPIO_PIN_3\r
+  *         @arg @ref LL_GPIO_PIN_4\r
+  *         @arg @ref LL_GPIO_PIN_5\r
+  *         @arg @ref LL_GPIO_PIN_6\r
+  *         @arg @ref LL_GPIO_PIN_7\r
+  *         @arg @ref LL_GPIO_PIN_8\r
+  *         @arg @ref LL_GPIO_PIN_9\r
+  *         @arg @ref LL_GPIO_PIN_10\r
+  *         @arg @ref LL_GPIO_PIN_11\r
+  *         @arg @ref LL_GPIO_PIN_12\r
+  *         @arg @ref LL_GPIO_PIN_13\r
+  *         @arg @ref LL_GPIO_PIN_14\r
+  *         @arg @ref LL_GPIO_PIN_15\r
+  * @param  Pull This parameter can be one of the following values:\r
+  *         @arg @ref LL_GPIO_PULL_DOWN\r
+  *         @arg @ref LL_GPIO_PULL_UP\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_SetPinPull(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Pull)\r
+{\r
+  MODIFY_REG(GPIOx->ODR, (Pin >> GPIO_PIN_MASK_POS), Pull << (POSITION_VAL(Pin >> GPIO_PIN_MASK_POS)));\r
+}\r
+\r
+/**\r
+  * @brief  Return gpio pull-up or pull-down for a dedicated pin on a dedicated port\r
+  * @note   Warning: only one pin can be passed as parameter.\r
+  * @rmtoll ODR        ODR         LL_GPIO_GetPinPull\r
+  * @param  GPIOx GPIO Port\r
+  * @param  Pin This parameter can be one of the following values:\r
+  *         @arg @ref LL_GPIO_PIN_0\r
+  *         @arg @ref LL_GPIO_PIN_1\r
+  *         @arg @ref LL_GPIO_PIN_2\r
+  *         @arg @ref LL_GPIO_PIN_3\r
+  *         @arg @ref LL_GPIO_PIN_4\r
+  *         @arg @ref LL_GPIO_PIN_5\r
+  *         @arg @ref LL_GPIO_PIN_6\r
+  *         @arg @ref LL_GPIO_PIN_7\r
+  *         @arg @ref LL_GPIO_PIN_8\r
+  *         @arg @ref LL_GPIO_PIN_9\r
+  *         @arg @ref LL_GPIO_PIN_10\r
+  *         @arg @ref LL_GPIO_PIN_11\r
+  *         @arg @ref LL_GPIO_PIN_12\r
+  *         @arg @ref LL_GPIO_PIN_13\r
+  *         @arg @ref LL_GPIO_PIN_14\r
+  *         @arg @ref LL_GPIO_PIN_15\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_GPIO_PULL_DOWN\r
+  *         @arg @ref LL_GPIO_PULL_UP\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_GetPinPull(GPIO_TypeDef *GPIOx, uint32_t Pin)\r
+{\r
+  return (READ_BIT(GPIOx->ODR, (GPIO_ODR_ODR0 << (POSITION_VAL(Pin >> GPIO_PIN_MASK_POS)))) >> (POSITION_VAL(Pin >> GPIO_PIN_MASK_POS)));\r
+}\r
+\r
+/**\r
+  * @brief  Lock configuration of several pins for a dedicated port.\r
+  * @note   When the lock sequence has been applied on a port bit, the\r
+  *         value of this port bit can no longer be modified until the\r
+  *         next reset.\r
+  * @note   Each lock bit freezes a specific configuration register\r
+  *         (control and alternate function registers).\r
+  * @rmtoll LCKR         LCKK          LL_GPIO_LockPin\r
+  * @param  GPIOx GPIO Port\r
+  * @param  PinMask This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_GPIO_PIN_0\r
+  *         @arg @ref LL_GPIO_PIN_1\r
+  *         @arg @ref LL_GPIO_PIN_2\r
+  *         @arg @ref LL_GPIO_PIN_3\r
+  *         @arg @ref LL_GPIO_PIN_4\r
+  *         @arg @ref LL_GPIO_PIN_5\r
+  *         @arg @ref LL_GPIO_PIN_6\r
+  *         @arg @ref LL_GPIO_PIN_7\r
+  *         @arg @ref LL_GPIO_PIN_8\r
+  *         @arg @ref LL_GPIO_PIN_9\r
+  *         @arg @ref LL_GPIO_PIN_10\r
+  *         @arg @ref LL_GPIO_PIN_11\r
+  *         @arg @ref LL_GPIO_PIN_12\r
+  *         @arg @ref LL_GPIO_PIN_13\r
+  *         @arg @ref LL_GPIO_PIN_14\r
+  *         @arg @ref LL_GPIO_PIN_15\r
+  *         @arg @ref LL_GPIO_PIN_ALL\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_LockPin(GPIO_TypeDef *GPIOx, uint32_t PinMask)\r
+{\r
+  __IO uint32_t temp;\r
+  WRITE_REG(GPIOx->LCKR, GPIO_LCKR_LCKK | ((PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU));\r
+  WRITE_REG(GPIOx->LCKR, ((PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU));\r
+  WRITE_REG(GPIOx->LCKR, GPIO_LCKR_LCKK | ((PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU));\r
+  temp = READ_REG(GPIOx->LCKR);\r
+  (void) temp;\r
+}\r
+\r
+/**\r
+  * @brief  Return 1 if all pins passed as parameter, of a dedicated port, are locked. else Return 0.\r
+  * @rmtoll LCKR         LCKy          LL_GPIO_IsPinLocked\r
+  * @param  GPIOx GPIO Port\r
+  * @param  PinMask This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_GPIO_PIN_0\r
+  *         @arg @ref LL_GPIO_PIN_1\r
+  *         @arg @ref LL_GPIO_PIN_2\r
+  *         @arg @ref LL_GPIO_PIN_3\r
+  *         @arg @ref LL_GPIO_PIN_4\r
+  *         @arg @ref LL_GPIO_PIN_5\r
+  *         @arg @ref LL_GPIO_PIN_6\r
+  *         @arg @ref LL_GPIO_PIN_7\r
+  *         @arg @ref LL_GPIO_PIN_8\r
+  *         @arg @ref LL_GPIO_PIN_9\r
+  *         @arg @ref LL_GPIO_PIN_10\r
+  *         @arg @ref LL_GPIO_PIN_11\r
+  *         @arg @ref LL_GPIO_PIN_12\r
+  *         @arg @ref LL_GPIO_PIN_13\r
+  *         @arg @ref LL_GPIO_PIN_14\r
+  *         @arg @ref LL_GPIO_PIN_15\r
+  *         @arg @ref LL_GPIO_PIN_ALL\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_IsPinLocked(GPIO_TypeDef *GPIOx, uint32_t PinMask)\r
+{\r
+  return (READ_BIT(GPIOx->LCKR, ((PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU)) == ((PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU));\r
+}\r
+\r
+/**\r
+  * @brief  Return 1 if one of the pin of a dedicated port is locked. else return 0.\r
+  * @rmtoll LCKR         LCKK          LL_GPIO_IsAnyPinLocked\r
+  * @param  GPIOx GPIO Port\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_IsAnyPinLocked(GPIO_TypeDef *GPIOx)\r
+{\r
+  return (READ_BIT(GPIOx->LCKR, GPIO_LCKR_LCKK) == (GPIO_LCKR_LCKK));\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup GPIO_LL_EF_Data_Access Data Access\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Return full input data register value for a dedicated port.\r
+  * @rmtoll IDR          IDy           LL_GPIO_ReadInputPort\r
+  * @param  GPIOx GPIO Port\r
+  * @retval Input data register value of port\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_ReadInputPort(GPIO_TypeDef *GPIOx)\r
+{\r
+  return (READ_REG(GPIOx->IDR));\r
+}\r
+\r
+/**\r
+  * @brief  Return if input data level for several pins of dedicated port is high or low.\r
+  * @rmtoll IDR          IDy           LL_GPIO_IsInputPinSet\r
+  * @param  GPIOx GPIO Port\r
+  * @param  PinMask This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_GPIO_PIN_0\r
+  *         @arg @ref LL_GPIO_PIN_1\r
+  *         @arg @ref LL_GPIO_PIN_2\r
+  *         @arg @ref LL_GPIO_PIN_3\r
+  *         @arg @ref LL_GPIO_PIN_4\r
+  *         @arg @ref LL_GPIO_PIN_5\r
+  *         @arg @ref LL_GPIO_PIN_6\r
+  *         @arg @ref LL_GPIO_PIN_7\r
+  *         @arg @ref LL_GPIO_PIN_8\r
+  *         @arg @ref LL_GPIO_PIN_9\r
+  *         @arg @ref LL_GPIO_PIN_10\r
+  *         @arg @ref LL_GPIO_PIN_11\r
+  *         @arg @ref LL_GPIO_PIN_12\r
+  *         @arg @ref LL_GPIO_PIN_13\r
+  *         @arg @ref LL_GPIO_PIN_14\r
+  *         @arg @ref LL_GPIO_PIN_15\r
+  *         @arg @ref LL_GPIO_PIN_ALL\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_IsInputPinSet(GPIO_TypeDef *GPIOx, uint32_t PinMask)\r
+{\r
+  return (READ_BIT(GPIOx->IDR, (PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU) == ((PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU));\r
+}\r
+\r
+/**\r
+  * @brief  Write output data register for the port.\r
+  * @rmtoll ODR          ODy           LL_GPIO_WriteOutputPort\r
+  * @param  GPIOx GPIO Port\r
+  * @param  PortValue Level value for each pin of the port\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_WriteOutputPort(GPIO_TypeDef *GPIOx, uint32_t PortValue)\r
+{\r
+  WRITE_REG(GPIOx->ODR, PortValue);\r
+}\r
+\r
+/**\r
+  * @brief  Return full output data register value for a dedicated port.\r
+  * @rmtoll ODR          ODy           LL_GPIO_ReadOutputPort\r
+  * @param  GPIOx GPIO Port\r
+  * @retval Output data register value of port\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_ReadOutputPort(GPIO_TypeDef *GPIOx)\r
+{\r
+  return (uint32_t)(READ_REG(GPIOx->ODR));\r
+}\r
+\r
+/**\r
+  * @brief  Return if input data level for several pins of dedicated port is high or low.\r
+  * @rmtoll ODR          ODy           LL_GPIO_IsOutputPinSet\r
+  * @param  GPIOx GPIO Port\r
+  * @param  PinMask This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_GPIO_PIN_0\r
+  *         @arg @ref LL_GPIO_PIN_1\r
+  *         @arg @ref LL_GPIO_PIN_2\r
+  *         @arg @ref LL_GPIO_PIN_3\r
+  *         @arg @ref LL_GPIO_PIN_4\r
+  *         @arg @ref LL_GPIO_PIN_5\r
+  *         @arg @ref LL_GPIO_PIN_6\r
+  *         @arg @ref LL_GPIO_PIN_7\r
+  *         @arg @ref LL_GPIO_PIN_8\r
+  *         @arg @ref LL_GPIO_PIN_9\r
+  *         @arg @ref LL_GPIO_PIN_10\r
+  *         @arg @ref LL_GPIO_PIN_11\r
+  *         @arg @ref LL_GPIO_PIN_12\r
+  *         @arg @ref LL_GPIO_PIN_13\r
+  *         @arg @ref LL_GPIO_PIN_14\r
+  *         @arg @ref LL_GPIO_PIN_15\r
+  *         @arg @ref LL_GPIO_PIN_ALL\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_IsOutputPinSet(GPIO_TypeDef *GPIOx, uint32_t PinMask)\r
+{\r
+  return (READ_BIT(GPIOx->ODR, (PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU) == ((PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU));\r
+}\r
+\r
+/**\r
+  * @brief  Set several pins to high level on dedicated gpio port.\r
+  * @rmtoll BSRR         BSy           LL_GPIO_SetOutputPin\r
+  * @param  GPIOx GPIO Port\r
+  * @param  PinMask This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_GPIO_PIN_0\r
+  *         @arg @ref LL_GPIO_PIN_1\r
+  *         @arg @ref LL_GPIO_PIN_2\r
+  *         @arg @ref LL_GPIO_PIN_3\r
+  *         @arg @ref LL_GPIO_PIN_4\r
+  *         @arg @ref LL_GPIO_PIN_5\r
+  *         @arg @ref LL_GPIO_PIN_6\r
+  *         @arg @ref LL_GPIO_PIN_7\r
+  *         @arg @ref LL_GPIO_PIN_8\r
+  *         @arg @ref LL_GPIO_PIN_9\r
+  *         @arg @ref LL_GPIO_PIN_10\r
+  *         @arg @ref LL_GPIO_PIN_11\r
+  *         @arg @ref LL_GPIO_PIN_12\r
+  *         @arg @ref LL_GPIO_PIN_13\r
+  *         @arg @ref LL_GPIO_PIN_14\r
+  *         @arg @ref LL_GPIO_PIN_15\r
+  *         @arg @ref LL_GPIO_PIN_ALL\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_SetOutputPin(GPIO_TypeDef *GPIOx, uint32_t PinMask)\r
+{\r
+  WRITE_REG(GPIOx->BSRR, (PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU);\r
+}\r
+\r
+/**\r
+  * @brief  Set several pins to low level on dedicated gpio port.\r
+  * @rmtoll BRR          BRy           LL_GPIO_ResetOutputPin\r
+  * @param  GPIOx GPIO Port\r
+  * @param  PinMask This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_GPIO_PIN_0\r
+  *         @arg @ref LL_GPIO_PIN_1\r
+  *         @arg @ref LL_GPIO_PIN_2\r
+  *         @arg @ref LL_GPIO_PIN_3\r
+  *         @arg @ref LL_GPIO_PIN_4\r
+  *         @arg @ref LL_GPIO_PIN_5\r
+  *         @arg @ref LL_GPIO_PIN_6\r
+  *         @arg @ref LL_GPIO_PIN_7\r
+  *         @arg @ref LL_GPIO_PIN_8\r
+  *         @arg @ref LL_GPIO_PIN_9\r
+  *         @arg @ref LL_GPIO_PIN_10\r
+  *         @arg @ref LL_GPIO_PIN_11\r
+  *         @arg @ref LL_GPIO_PIN_12\r
+  *         @arg @ref LL_GPIO_PIN_13\r
+  *         @arg @ref LL_GPIO_PIN_14\r
+  *         @arg @ref LL_GPIO_PIN_15\r
+  *         @arg @ref LL_GPIO_PIN_ALL\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_ResetOutputPin(GPIO_TypeDef *GPIOx, uint32_t PinMask)\r
+{\r
+  WRITE_REG(GPIOx->BRR, (PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU);\r
+}\r
+\r
+/**\r
+  * @brief  Toggle data value for several pin of dedicated port.\r
+  * @rmtoll ODR          ODy           LL_GPIO_TogglePin\r
+  * @param  GPIOx GPIO Port\r
+  * @param  PinMask This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_GPIO_PIN_0\r
+  *         @arg @ref LL_GPIO_PIN_1\r
+  *         @arg @ref LL_GPIO_PIN_2\r
+  *         @arg @ref LL_GPIO_PIN_3\r
+  *         @arg @ref LL_GPIO_PIN_4\r
+  *         @arg @ref LL_GPIO_PIN_5\r
+  *         @arg @ref LL_GPIO_PIN_6\r
+  *         @arg @ref LL_GPIO_PIN_7\r
+  *         @arg @ref LL_GPIO_PIN_8\r
+  *         @arg @ref LL_GPIO_PIN_9\r
+  *         @arg @ref LL_GPIO_PIN_10\r
+  *         @arg @ref LL_GPIO_PIN_11\r
+  *         @arg @ref LL_GPIO_PIN_12\r
+  *         @arg @ref LL_GPIO_PIN_13\r
+  *         @arg @ref LL_GPIO_PIN_14\r
+  *         @arg @ref LL_GPIO_PIN_15\r
+  *         @arg @ref LL_GPIO_PIN_ALL\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_TogglePin(GPIO_TypeDef *GPIOx, uint32_t PinMask)\r
+{\r
+  uint32_t odr = READ_REG(GPIOx->ODR);\r
+  uint32_t pinmask = ((PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU);\r
+  WRITE_REG(GPIOx->BSRR, ((odr & pinmask) << 16u) | (~odr & pinmask));\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup GPIO_AF_REMAPPING Alternate Function Remapping\r
+  * @brief This section propose definition to remap the alternate function to some other port/pins.\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable the remapping of SPI1 alternate function NSS, SCK, MISO and MOSI.\r
+  * @rmtoll MAPR          SPI1_REMAP           LL_GPIO_AF_EnableRemap_SPI1\r
+  * @note   ENABLE: Remap (NSS/PA15, SCK/PB3, MISO/PB4, MOSI/PB5)\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_SPI1(void)\r
+{\r
+  SET_BIT(AFIO->MAPR, AFIO_MAPR_SPI1_REMAP | AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of SPI1 alternate function NSS, SCK, MISO and MOSI.\r
+  * @rmtoll MAPR          SPI1_REMAP           LL_GPIO_AF_DisableRemap_SPI1\r
+  * @note  DISABLE: No remap (NSS/PA4,  SCK/PA5, MISO/PA6, MOSI/PA7)\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_SPI1(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_SPI1_REMAP | AFIO_MAPR_SWJ_CFG), AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief  Check if SPI1 has been remaped or not\r
+  * @rmtoll MAPR         SPI1_REMAP         LL_GPIO_AF_IsEnabledRemap_SPI1\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_SPI1(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR, AFIO_MAPR_SPI1_REMAP) == (AFIO_MAPR_SPI1_REMAP));\r
+}\r
+\r
+/**\r
+  * @brief Enable the remapping of I2C1 alternate function SCL and SDA.\r
+  * @rmtoll MAPR          I2C1_REMAP           LL_GPIO_AF_EnableRemap_I2C1\r
+  * @note  ENABLE: Remap     (SCL/PB8, SDA/PB9)\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_I2C1(void)\r
+{\r
+  SET_BIT(AFIO->MAPR, AFIO_MAPR_I2C1_REMAP | AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of I2C1 alternate function SCL and SDA.\r
+  * @rmtoll MAPR          I2C1_REMAP           LL_GPIO_AF_DisableRemap_I2C1\r
+  * @note  DISABLE: No remap (SCL/PB6, SDA/PB7)\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_I2C1(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_I2C1_REMAP | AFIO_MAPR_SWJ_CFG), AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief  Check if I2C1 has been remaped or not\r
+  * @rmtoll MAPR         I2C1_REMAP         LL_GPIO_AF_IsEnabledRemap_I2C1\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_I2C1(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR, AFIO_MAPR_I2C1_REMAP) == (AFIO_MAPR_I2C1_REMAP));\r
+}\r
+\r
+/**\r
+  * @brief Enable the remapping of USART1 alternate function TX and RX.\r
+  * @rmtoll MAPR          USART1_REMAP           LL_GPIO_AF_EnableRemap_USART1\r
+  * @note  ENABLE: Remap     (TX/PB6, RX/PB7)\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_USART1(void)\r
+{\r
+  SET_BIT(AFIO->MAPR, AFIO_MAPR_USART1_REMAP | AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of USART1 alternate function TX and RX.\r
+  * @rmtoll MAPR          USART1_REMAP           LL_GPIO_AF_DisableRemap_USART1\r
+  * @note  DISABLE: No remap (TX/PA9, RX/PA10)\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_USART1(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_USART1_REMAP | AFIO_MAPR_SWJ_CFG), AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief  Check if USART1 has been remaped or not\r
+  * @rmtoll MAPR         USART1_REMAP         LL_GPIO_AF_IsEnabledRemap_USART1\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_USART1(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR, AFIO_MAPR_USART1_REMAP) == (AFIO_MAPR_USART1_REMAP));\r
+}\r
+\r
+/**\r
+  * @brief Enable the remapping of USART2 alternate function CTS, RTS, CK, TX and RX.\r
+  * @rmtoll MAPR          USART2_REMAP           LL_GPIO_AF_EnableRemap_USART2\r
+  * @note  ENABLE: Remap     (CTS/PD3, RTS/PD4, TX/PD5, RX/PD6, CK/PD7)\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_USART2(void)\r
+{\r
+  SET_BIT(AFIO->MAPR, AFIO_MAPR_USART2_REMAP | AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of USART2 alternate function CTS, RTS, CK, TX and RX.\r
+  * @rmtoll MAPR          USART2_REMAP           LL_GPIO_AF_DisableRemap_USART2\r
+  * @note  DISABLE: No remap (CTS/PA0, RTS/PA1, TX/PA2, RX/PA3, CK/PA4)\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_USART2(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_USART2_REMAP | AFIO_MAPR_SWJ_CFG), AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief  Check if USART2 has been remaped or not\r
+  * @rmtoll MAPR         USART2_REMAP         LL_GPIO_AF_IsEnabledRemap_USART2\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_USART2(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR, AFIO_MAPR_USART2_REMAP) == (AFIO_MAPR_USART2_REMAP));\r
+}\r
+\r
+#if defined (AFIO_MAPR_USART3_REMAP)\r
+/**\r
+  * @brief Enable the remapping of USART3 alternate function CTS, RTS, CK, TX and RX.\r
+  * @rmtoll MAPR          USART3_REMAP           LL_GPIO_AF_EnableRemap_USART3\r
+  * @note  ENABLE: Full remap     (TX/PD8,  RX/PD9,  CK/PD10, CTS/PD11, RTS/PD12)\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_USART3(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_USART3_REMAP | AFIO_MAPR_SWJ_CFG), (AFIO_MAPR_USART3_REMAP_FULLREMAP | AFIO_MAPR_SWJ_CFG));\r
+}\r
+\r
+/**\r
+  * @brief Enable the remapping of USART3 alternate function CTS, RTS, CK, TX and RX.\r
+  * @rmtoll MAPR          USART3_REMAP           LL_GPIO_AF_RemapPartial_USART3\r
+  * @note  PARTIAL: Partial remap (TX/PC10, RX/PC11, CK/PC12, CTS/PB13, RTS/PB14)\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_RemapPartial_USART3(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_USART3_REMAP | AFIO_MAPR_SWJ_CFG), (AFIO_MAPR_USART3_REMAP_PARTIALREMAP | AFIO_MAPR_SWJ_CFG));\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of USART3 alternate function CTS, RTS, CK, TX and RX.\r
+  * @rmtoll MAPR          USART3_REMAP           LL_GPIO_AF_DisableRemap_USART3\r
+  * @note  DISABLE: No remap      (TX/PB10, RX/PB11, CK/PB12, CTS/PB13, RTS/PB14)\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_USART3(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_USART3_REMAP | AFIO_MAPR_SWJ_CFG), (AFIO_MAPR_USART3_REMAP_NOREMAP | AFIO_MAPR_SWJ_CFG));\r
+}\r
+#endif\r
+\r
+/**\r
+  * @brief Enable the remapping of TIM1 alternate function channels 1 to 4, 1N to 3N, external trigger (ETR) and Break input (BKIN)\r
+  * @rmtoll MAPR          TIM1_REMAP           LL_GPIO_AF_EnableRemap_TIM1\r
+  * @note  ENABLE: Full remap     (ETR/PE7,  CH1/PE9, CH2/PE11, CH3/PE13, CH4/PE14, BKIN/PE15, CH1N/PE8,  CH2N/PE10, CH3N/PE12)\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_TIM1(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_TIM1_REMAP | AFIO_MAPR_SWJ_CFG), (AFIO_MAPR_TIM1_REMAP_FULLREMAP | AFIO_MAPR_SWJ_CFG));\r
+}\r
+\r
+/**\r
+  * @brief Enable the remapping of TIM1 alternate function channels 1 to 4, 1N to 3N, external trigger (ETR) and Break input (BKIN)\r
+  * @rmtoll MAPR          TIM1_REMAP           LL_GPIO_AF_RemapPartial_TIM1\r
+  * @note  PARTIAL: Partial remap (ETR/PA12, CH1/PA8, CH2/PA9,  CH3/PA10, CH4/PA11, BKIN/PA6,  CH1N/PA7,  CH2N/PB0,  CH3N/PB1)\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_RemapPartial_TIM1(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_TIM1_REMAP | AFIO_MAPR_SWJ_CFG), (AFIO_MAPR_TIM1_REMAP_PARTIALREMAP | AFIO_MAPR_SWJ_CFG));\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of TIM1 alternate function channels 1 to 4, 1N to 3N, external trigger (ETR) and Break input (BKIN)\r
+  * @rmtoll MAPR          TIM1_REMAP           LL_GPIO_AF_DisableRemap_TIM1\r
+  * @note  DISABLE: No remap      (ETR/PA12, CH1/PA8, CH2/PA9,  CH3/PA10, CH4/PA11, BKIN/PB12, CH1N/PB13, CH2N/PB14, CH3N/PB15)\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM1(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_TIM1_REMAP | AFIO_MAPR_SWJ_CFG), (AFIO_MAPR_TIM1_REMAP_NOREMAP | AFIO_MAPR_SWJ_CFG));\r
+}\r
+\r
+/**\r
+  * @brief Enable the remapping of TIM2 alternate function channels 1 to 4 and external trigger (ETR)\r
+  * @rmtoll MAPR          TIM2_REMAP           LL_GPIO_AF_EnableRemap_TIM2\r
+  * @note  ENABLE: Full remap       (CH1/ETR/PA15, CH2/PB3, CH3/PB10, CH4/PB11)\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_TIM2(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_TIM2_REMAP | AFIO_MAPR_SWJ_CFG), (AFIO_MAPR_TIM2_REMAP_FULLREMAP | AFIO_MAPR_SWJ_CFG));\r
+}\r
+\r
+/**\r
+  * @brief Enable the remapping of TIM2 alternate function channels 1 to 4 and external trigger (ETR)\r
+  * @rmtoll MAPR          TIM2_REMAP           LL_GPIO_AF_RemapPartial2_TIM2\r
+  * @note  PARTIAL_2: Partial remap (CH1/ETR/PA0,  CH2/PA1, CH3/PB10, CH4/PB11)\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_RemapPartial2_TIM2(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_TIM2_REMAP | AFIO_MAPR_SWJ_CFG), (AFIO_MAPR_TIM2_REMAP_PARTIALREMAP2 | AFIO_MAPR_SWJ_CFG));\r
+}\r
+\r
+/**\r
+  * @brief Enable the remapping of TIM2 alternate function channels 1 to 4 and external trigger (ETR)\r
+  * @rmtoll MAPR          TIM2_REMAP           LL_GPIO_AF_RemapPartial1_TIM2\r
+  * @note  PARTIAL_1: Partial remap (CH1/ETR/PA15, CH2/PB3, CH3/PA2,  CH4/PA3)\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_RemapPartial1_TIM2(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_TIM2_REMAP | AFIO_MAPR_SWJ_CFG), (AFIO_MAPR_TIM2_REMAP_PARTIALREMAP1 | AFIO_MAPR_SWJ_CFG));\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of TIM2 alternate function channels 1 to 4 and external trigger (ETR)\r
+  * @rmtoll MAPR          TIM2_REMAP           LL_GPIO_AF_DisableRemap_TIM2\r
+  * @note  DISABLE: No remap        (CH1/ETR/PA0,  CH2/PA1, CH3/PA2,  CH4/PA3)\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM2(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_TIM2_REMAP | AFIO_MAPR_SWJ_CFG), (AFIO_MAPR_TIM2_REMAP_NOREMAP | AFIO_MAPR_SWJ_CFG));\r
+}\r
+\r
+/**\r
+  * @brief Enable the remapping of TIM3 alternate function channels 1 to 4\r
+  * @rmtoll MAPR          TIM3_REMAP           LL_GPIO_AF_EnableRemap_TIM3\r
+  * @note  ENABLE: Full remap     (CH1/PC6, CH2/PC7, CH3/PC8, CH4/PC9)\r
+  * @note  TIM3_ETR on PE0 is not re-mapped.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_TIM3(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_TIM3_REMAP | AFIO_MAPR_SWJ_CFG), (AFIO_MAPR_TIM3_REMAP_FULLREMAP | AFIO_MAPR_SWJ_CFG));\r
+}\r
+\r
+/**\r
+  * @brief Enable the remapping of TIM3 alternate function channels 1 to 4\r
+  * @rmtoll MAPR          TIM3_REMAP           LL_GPIO_AF_RemapPartial_TIM3\r
+  * @note  PARTIAL: Partial remap (CH1/PB4, CH2/PB5, CH3/PB0, CH4/PB1)\r
+  * @note  TIM3_ETR on PE0 is not re-mapped.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_RemapPartial_TIM3(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_TIM3_REMAP | AFIO_MAPR_SWJ_CFG), (AFIO_MAPR_TIM3_REMAP_PARTIALREMAP | AFIO_MAPR_SWJ_CFG));\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of TIM3 alternate function channels 1 to 4\r
+  * @rmtoll MAPR          TIM3_REMAP           LL_GPIO_AF_DisableRemap_TIM3\r
+  * @note  DISABLE: No remap      (CH1/PA6, CH2/PA7, CH3/PB0, CH4/PB1)\r
+  * @note  TIM3_ETR on PE0 is not re-mapped.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM3(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_TIM3_REMAP | AFIO_MAPR_SWJ_CFG), (AFIO_MAPR_TIM3_REMAP_NOREMAP | AFIO_MAPR_SWJ_CFG));\r
+}\r
+\r
+#if defined(AFIO_MAPR_TIM4_REMAP)\r
+/**\r
+  * @brief Enable the remapping of TIM4 alternate function channels 1 to 4.\r
+  * @rmtoll MAPR          TIM4_REMAP           LL_GPIO_AF_EnableRemap_TIM4\r
+  * @note  ENABLE: Full remap (TIM4_CH1/PD12, TIM4_CH2/PD13, TIM4_CH3/PD14, TIM4_CH4/PD15)\r
+  * @note  TIM4_ETR on PE0 is not re-mapped.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_TIM4(void)\r
+{\r
+  SET_BIT(AFIO->MAPR, AFIO_MAPR_TIM4_REMAP | AFIO_MAPR_SWJ_CFG);\r
+}\r
+/**\r
+  * @brief Disable the remapping of TIM4 alternate function channels 1 to 4.\r
+  * @rmtoll MAPR          TIM4_REMAP           LL_GPIO_AF_DisableRemap_TIM4\r
+  * @note  DISABLE: No remap  (TIM4_CH1/PB6,  TIM4_CH2/PB7,  TIM4_CH3/PB8,  TIM4_CH4/PB9)\r
+  * @note  TIM4_ETR on PE0 is not re-mapped.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM4(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_TIM4_REMAP | AFIO_MAPR_SWJ_CFG), AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief  Check if TIM4 has been remaped or not\r
+  * @rmtoll MAPR         TIM4_REMAP         LL_GPIO_AF_IsEnabledRemap_TIM4\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_TIM4(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR, AFIO_MAPR_TIM4_REMAP) == (AFIO_MAPR_TIM4_REMAP));\r
+}\r
+#endif\r
+\r
+#if defined(AFIO_MAPR_CAN_REMAP_REMAP1)\r
+\r
+/**\r
+  * @brief Enable or disable the remapping of CAN alternate function CAN_RX and CAN_TX in devices with a single CAN interface.\r
+  * @rmtoll MAPR          CAN_REMAP           LL_GPIO_AF_RemapPartial1_CAN1\r
+  * @note  CASE 1: CAN_RX mapped to PA11, CAN_TX mapped to PA12\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_RemapPartial1_CAN1(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_CAN_REMAP | AFIO_MAPR_SWJ_CFG), (AFIO_MAPR_CAN_REMAP_REMAP1 | AFIO_MAPR_SWJ_CFG));\r
+}\r
+\r
+/**\r
+  * @brief Enable or disable the remapping of CAN alternate function CAN_RX and CAN_TX in devices with a single CAN interface.\r
+  * @rmtoll MAPR          CAN_REMAP           LL_GPIO_AF_RemapPartial2_CAN1\r
+  * @note  CASE 2: CAN_RX mapped to PB8,  CAN_TX mapped to PB9 (not available on 36-pin package)\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_RemapPartial2_CAN1(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_CAN_REMAP | AFIO_MAPR_SWJ_CFG), (AFIO_MAPR_CAN_REMAP_REMAP2 | AFIO_MAPR_SWJ_CFG));\r
+}\r
+\r
+/**\r
+  * @brief Enable or disable the remapping of CAN alternate function CAN_RX and CAN_TX in devices with a single CAN interface.\r
+  * @rmtoll MAPR          CAN_REMAP           LL_GPIO_AF_RemapPartial3_CAN1\r
+  * @note  CASE 3: CAN_RX mapped to PD0,  CAN_TX mapped to PD1\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_RemapPartial3_CAN1(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_CAN_REMAP | AFIO_MAPR_SWJ_CFG), (AFIO_MAPR_CAN_REMAP_REMAP3 | AFIO_MAPR_SWJ_CFG));\r
+}\r
+#endif\r
+\r
+/**\r
+  * @brief Enable the remapping of PD0 and PD1. When the HSE oscillator is not used\r
+  *        (application running on internal 8 MHz RC) PD0 and PD1 can be mapped on OSC_IN and\r
+  *        OSC_OUT. This is available only on 36, 48 and 64 pins packages (PD0 and PD1 are available\r
+  *        on 100-pin and 144-pin packages, no need for remapping).\r
+  * @rmtoll MAPR          PD01_REMAP           LL_GPIO_AF_EnableRemap_PD01\r
+  * @note  ENABLE: PD0 remapped on OSC_IN, PD1 remapped on OSC_OUT.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_PD01(void)\r
+{\r
+  SET_BIT(AFIO->MAPR, AFIO_MAPR_PD01_REMAP | AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of PD0 and PD1. When the HSE oscillator is not used\r
+  *        (application running on internal 8 MHz RC) PD0 and PD1 can be mapped on OSC_IN and\r
+  *        OSC_OUT. This is available only on 36, 48 and 64 pins packages (PD0 and PD1 are available\r
+  *        on 100-pin and 144-pin packages, no need for remapping).\r
+  * @rmtoll MAPR          PD01_REMAP           LL_GPIO_AF_DisableRemap_PD01\r
+  * @note  DISABLE: No remapping of PD0 and PD1\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_PD01(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_PD01_REMAP | AFIO_MAPR_SWJ_CFG), AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief  Check if PD01 has been remaped or not\r
+  * @rmtoll MAPR         PD01_REMAP         LL_GPIO_AF_IsEnabledRemap_PD01\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_PD01(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR, AFIO_MAPR_PD01_REMAP) == (AFIO_MAPR_PD01_REMAP));\r
+}\r
+\r
+#if defined(AFIO_MAPR_TIM5CH4_IREMAP)\r
+/**\r
+  * @brief Enable the remapping of TIM5CH4.\r
+  * @rmtoll MAPR          TIM5CH4_IREMAP           LL_GPIO_AF_EnableRemap_TIM5CH4\r
+  * @note  ENABLE: LSI internal clock is connected to TIM5_CH4 input for calibration purpose.\r
+  * @note  This function is available only in high density value line devices.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_TIM5CH4(void)\r
+{\r
+  SET_BIT(AFIO->MAPR, AFIO_MAPR_TIM5CH4_IREMAP | AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of TIM5CH4.\r
+  * @rmtoll MAPR          TIM5CH4_IREMAP           LL_GPIO_AF_DisableRemap_TIM5CH4\r
+  * @note  DISABLE: TIM5_CH4 is connected to PA3\r
+  * @note  This function is available only in high density value line devices.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM5CH4(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_TIM5CH4_IREMAP | AFIO_MAPR_SWJ_CFG), AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief  Check if TIM5CH4 has been remaped or not\r
+  * @rmtoll MAPR         TIM5CH4_IREMAP         LL_GPIO_AF_IsEnabledRemap_TIM5CH4\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_TIM5CH4(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR, AFIO_MAPR_TIM5CH4_IREMAP) == (AFIO_MAPR_TIM5CH4_IREMAP));\r
+}\r
+#endif\r
+\r
+#if defined(AFIO_MAPR_ETH_REMAP)\r
+/**\r
+  * @brief Enable the remapping of Ethernet MAC connections with the PHY.\r
+  * @rmtoll MAPR          ETH_REMAP           LL_GPIO_AF_EnableRemap_ETH\r
+  * @note  ENABLE: Remap     (RX_DV-CRS_DV/PD8, RXD0/PD9, RXD1/PD10, RXD2/PD11, RXD3/PD12)\r
+  * @note  This bit is available only in connectivity line devices and is reserved otherwise.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_ETH(void)\r
+{\r
+  SET_BIT(AFIO->MAPR, AFIO_MAPR_ETH_REMAP | AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of Ethernet MAC connections with the PHY.\r
+  * @rmtoll MAPR          ETH_REMAP           LL_GPIO_AF_DisableRemap_ETH\r
+  * @note  DISABLE: No remap (RX_DV-CRS_DV/PA7, RXD0/PC4, RXD1/PC5,  RXD2/PB0,  RXD3/PB1)\r
+  * @note  This bit is available only in connectivity line devices and is reserved otherwise.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_ETH(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_ETH_REMAP | AFIO_MAPR_SWJ_CFG), AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief  Check if ETH has been remaped or not\r
+  * @rmtoll MAPR         ETH_REMAP         LL_GPIO_AF_IsEnabledRemap_ETH\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_ETH(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR, AFIO_MAPR_ETH_REMAP) == (AFIO_MAPR_ETH_REMAP));\r
+}\r
+#endif\r
+\r
+#if defined(AFIO_MAPR_CAN2_REMAP)\r
+\r
+/**\r
+  * @brief Enable the remapping of CAN2 alternate function CAN2_RX and CAN2_TX.\r
+  * @rmtoll MAPR          CAN2_REMAP           LL_GPIO_AF_EnableRemap_CAN2\r
+  * @note  ENABLE: Remap     (CAN2_RX/PB5,  CAN2_TX/PB6)\r
+  * @note  This bit is available only in connectivity line devices and is reserved otherwise.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_CAN2(void)\r
+{\r
+  SET_BIT(AFIO->MAPR, AFIO_MAPR_CAN2_REMAP | AFIO_MAPR_SWJ_CFG);\r
+}\r
+/**\r
+  * @brief Disable the remapping of CAN2 alternate function CAN2_RX and CAN2_TX.\r
+  * @rmtoll MAPR          CAN2_REMAP           LL_GPIO_AF_DisableRemap_CAN2\r
+  * @note  DISABLE: No remap (CAN2_RX/PB12, CAN2_TX/PB13)\r
+  * @note  This bit is available only in connectivity line devices and is reserved otherwise.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_CAN2(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_CAN2_REMAP | AFIO_MAPR_SWJ_CFG), AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief  Check if CAN2 has been remaped or not\r
+  * @rmtoll MAPR         CAN2_REMAP         LL_GPIO_AF_IsEnabledRemap_CAN2\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_CAN2(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR, AFIO_MAPR_CAN2_REMAP) == (AFIO_MAPR_CAN2_REMAP));\r
+}\r
+#endif\r
+\r
+#if defined(AFIO_MAPR_MII_RMII_SEL)\r
+/**\r
+  * @brief Configures the Ethernet MAC internally for use with an external MII or RMII PHY.\r
+  * @rmtoll MAPR          MII_RMII_SEL           LL_GPIO_AF_Select_ETH_RMII\r
+  * @note  ETH_RMII: Configure Ethernet MAC for connection with an RMII PHY\r
+  * @note  This bit is available only in connectivity line devices and is reserved otherwise.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_Select_ETH_RMII(void)\r
+{\r
+  SET_BIT(AFIO->MAPR, AFIO_MAPR_MII_RMII_SEL | AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief Configures the Ethernet MAC internally for use with an external MII or RMII PHY.\r
+  * @rmtoll MAPR          MII_RMII_SEL           LL_GPIO_AF_Select_ETH_MII\r
+  * @note  ETH_MII: Configure Ethernet MAC for connection with an MII PHY\r
+  * @note  This bit is available only in connectivity line devices and is reserved otherwise.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_Select_ETH_MII(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_MII_RMII_SEL | AFIO_MAPR_SWJ_CFG), AFIO_MAPR_SWJ_CFG);\r
+}\r
+#endif\r
+\r
+#if defined(AFIO_MAPR_ADC1_ETRGINJ_REMAP)\r
+/**\r
+  * @brief Enable the remapping of ADC1_ETRGINJ (ADC 1 External trigger injected conversion).\r
+  * @rmtoll MAPR          ADC1_ETRGINJ_REMAP           LL_GPIO_AF_EnableRemap_ADC1_ETRGINJ\r
+  * @note  ENABLE: ADC1 External Event injected conversion is connected to TIM8 Channel4.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_ADC1_ETRGINJ(void)\r
+{\r
+  SET_BIT(AFIO->MAPR, AFIO_MAPR_ADC1_ETRGINJ_REMAP | AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of ADC1_ETRGINJ (ADC 1 External trigger injected conversion).\r
+  * @rmtoll MAPR          ADC1_ETRGINJ_REMAP           LL_GPIO_AF_DisableRemap_ADC1_ETRGINJ\r
+  * @note  DISABLE: ADC1 External trigger injected conversion is connected to EXTI15\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_ADC1_ETRGINJ(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_ADC1_ETRGINJ_REMAP | AFIO_MAPR_SWJ_CFG), AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief  Check if ADC1_ETRGINJ has been remaped or not\r
+  * @rmtoll MAPR         ADC1_ETRGINJ_REMAP         LL_GPIO_AF_IsEnabledRemap_ADC1_ETRGINJ\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_ADC1_ETRGINJ(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR, AFIO_MAPR_ADC1_ETRGINJ_REMAP) == (AFIO_MAPR_ADC1_ETRGINJ_REMAP));\r
+}\r
+#endif\r
+\r
+#if defined(AFIO_MAPR_ADC1_ETRGREG_REMAP)\r
+/**\r
+  * @brief Enable the remapping of ADC1_ETRGREG (ADC 1 External trigger regular conversion).\r
+  * @rmtoll MAPR          ADC1_ETRGREG_REMAP           LL_GPIO_AF_EnableRemap_ADC1_ETRGREG\r
+  * @note  ENABLE: ADC1 External Event regular conversion is connected to TIM8 TRG0.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_ADC1_ETRGREG(void)\r
+{\r
+  SET_BIT(AFIO->MAPR, AFIO_MAPR_ADC1_ETRGREG_REMAP | AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of ADC1_ETRGREG (ADC 1 External trigger regular conversion).\r
+  * @rmtoll MAPR          ADC1_ETRGREG_REMAP           LL_GPIO_AF_DisableRemap_ADC1_ETRGREG\r
+  * @note  DISABLE: ADC1 External trigger regular conversion is connected to EXTI11\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_ADC1_ETRGREG(void)\r
+{\r
+   MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_ADC1_ETRGREG_REMAP | AFIO_MAPR_SWJ_CFG), AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief  Check if ADC1_ETRGREG has been remaped or not\r
+  * @rmtoll MAPR         ADC1_ETRGREG_REMAP         LL_GPIO_AF_IsEnabledRemap_ADC1_ETRGREG\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_ADC1_ETRGREG(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR, AFIO_MAPR_ADC1_ETRGREG_REMAP) == (AFIO_MAPR_ADC1_ETRGREG_REMAP));\r
+}\r
+#endif\r
+\r
+#if defined(AFIO_MAPR_ADC2_ETRGINJ_REMAP)\r
+\r
+/**\r
+  * @brief Enable the remapping of ADC2_ETRGREG (ADC 2 External trigger injected conversion).\r
+  * @rmtoll MAPR          ADC2_ETRGINJ_REMAP           LL_GPIO_AF_EnableRemap_ADC2_ETRGINJ\r
+  * @note  ENABLE: ADC2 External Event injected conversion is connected to TIM8 Channel4.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_ADC2_ETRGINJ(void)\r
+{\r
+  SET_BIT(AFIO->MAPR, AFIO_MAPR_ADC2_ETRGINJ_REMAP | AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of ADC2_ETRGREG (ADC 2 External trigger injected conversion).\r
+  * @rmtoll MAPR          ADC2_ETRGINJ_REMAP           LL_GPIO_AF_DisableRemap_ADC2_ETRGINJ\r
+  * @note  DISABLE: ADC2 External trigger injected conversion is connected to EXTI15\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_ADC2_ETRGINJ(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_ADC2_ETRGINJ_REMAP | AFIO_MAPR_SWJ_CFG), AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief  Check if ADC2_ETRGINJ has been remaped or not\r
+  * @rmtoll MAPR         ADC2_ETRGINJ_REMAP         LL_GPIO_AF_IsEnabledRemap_ADC2_ETRGINJ\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_ADC2_ETRGINJ(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR, AFIO_MAPR_ADC2_ETRGINJ_REMAP) == (AFIO_MAPR_ADC2_ETRGINJ_REMAP));\r
+}\r
+#endif\r
+\r
+#if defined (AFIO_MAPR_ADC2_ETRGREG_REMAP)\r
+\r
+/**\r
+  * @brief Enable the remapping of ADC2_ETRGREG (ADC 2 External trigger regular conversion).\r
+  * @rmtoll MAPR          ADC2_ETRGREG_REMAP           LL_GPIO_AF_EnableRemap_ADC2_ETRGREG\r
+  * @note  ENABLE: ADC2 External Event regular conversion is connected to TIM8 TRG0.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_ADC2_ETRGREG(void)\r
+{\r
+  SET_BIT(AFIO->MAPR, AFIO_MAPR_ADC2_ETRGREG_REMAP | AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of ADC2_ETRGREG (ADC 2 External trigger regular conversion).\r
+  * @rmtoll MAPR          ADC2_ETRGREG_REMAP           LL_GPIO_AF_DisableRemap_ADC2_ETRGREG\r
+  * @note  DISABLE: ADC2 External trigger regular conversion is connected to EXTI11\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_ADC2_ETRGREG(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_ADC2_ETRGREG_REMAP | AFIO_MAPR_SWJ_CFG), AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief  Check if ADC2_ETRGREG has been remaped or not\r
+  * @rmtoll MAPR         ADC2_ETRGREG_REMAP         LL_GPIO_AF_IsEnabledRemap_ADC2_ETRGREG\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_ADC2_ETRGREG(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR, AFIO_MAPR_ADC2_ETRGREG_REMAP) == (AFIO_MAPR_ADC2_ETRGREG_REMAP));\r
+}\r
+#endif\r
+\r
+/**\r
+  * @brief Enable the Serial wire JTAG configuration\r
+  * @rmtoll MAPR          SWJ_CFG           LL_GPIO_AF_EnableRemap_SWJ\r
+  * @note  ENABLE: Full SWJ (JTAG-DP + SW-DP): Reset State\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_SWJ(void)\r
+{\r
+  CLEAR_BIT(AFIO->MAPR,AFIO_MAPR_SWJ_CFG);\r
+  SET_BIT(AFIO->MAPR, AFIO_MAPR_SWJ_CFG_RESET);\r
+}\r
+\r
+/**\r
+  * @brief Enable the Serial wire JTAG configuration\r
+  * @rmtoll MAPR          SWJ_CFG           LL_GPIO_AF_Remap_SWJ_NONJTRST\r
+  * @note  NONJTRST: Full SWJ (JTAG-DP + SW-DP) but without NJTRST\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_Remap_SWJ_NONJTRST(void)\r
+{\r
+  CLEAR_BIT(AFIO->MAPR,AFIO_MAPR_SWJ_CFG);\r
+  SET_BIT(AFIO->MAPR, AFIO_MAPR_SWJ_CFG_NOJNTRST);\r
+}\r
+\r
+/**\r
+  * @brief Enable the Serial wire JTAG configuration\r
+  * @rmtoll MAPR          SWJ_CFG           LL_GPIO_AF_Remap_SWJ_NOJTAG\r
+  * @note  NOJTAG: JTAG-DP Disabled and SW-DP Enabled\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_Remap_SWJ_NOJTAG(void)\r
+{\r
+  CLEAR_BIT(AFIO->MAPR,AFIO_MAPR_SWJ_CFG);\r
+  SET_BIT(AFIO->MAPR, AFIO_MAPR_SWJ_CFG_JTAGDISABLE);\r
+}\r
+\r
+/**\r
+  * @brief Disable the Serial wire JTAG configuration\r
+  * @rmtoll MAPR          SWJ_CFG           LL_GPIO_AF_DisableRemap_SWJ\r
+  * @note  DISABLE: JTAG-DP Disabled and SW-DP Disabled\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_SWJ(void)\r
+{\r
+  CLEAR_BIT(AFIO->MAPR,AFIO_MAPR_SWJ_CFG);\r
+  SET_BIT(AFIO->MAPR, AFIO_MAPR_SWJ_CFG_DISABLE);\r
+}\r
+\r
+#if defined(AFIO_MAPR_SPI3_REMAP)\r
+\r
+/**\r
+  * @brief Enable the remapping of SPI3 alternate functions SPI3_NSS/I2S3_WS, SPI3_SCK/I2S3_CK, SPI3_MISO, SPI3_MOSI/I2S3_SD.\r
+  * @rmtoll MAPR          SPI3_REMAP           LL_GPIO_AF_EnableRemap_SPI3\r
+  * @note  ENABLE: Remap     (SPI3_NSS-I2S3_WS/PA4,  SPI3_SCK-I2S3_CK/PC10, SPI3_MISO/PC11, SPI3_MOSI-I2S3_SD/PC12)\r
+  * @note  This bit is available only in connectivity line devices and is reserved otherwise.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_SPI3(void)\r
+{\r
+  SET_BIT(AFIO->MAPR, AFIO_MAPR_SPI3_REMAP | AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of SPI3 alternate functions SPI3_NSS/I2S3_WS, SPI3_SCK/I2S3_CK, SPI3_MISO, SPI3_MOSI/I2S3_SD.\r
+  * @rmtoll MAPR          SPI3_REMAP           LL_GPIO_AF_DisableRemap_SPI3\r
+  * @note  DISABLE: No remap (SPI3_NSS-I2S3_WS/PA15, SPI3_SCK-I2S3_CK/PB3,  SPI3_MISO/PB4,  SPI3_MOSI-I2S3_SD/PB5).\r
+  * @note  This bit is available only in connectivity line devices and is reserved otherwise.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_SPI3(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_SPI3_REMAP | AFIO_MAPR_SWJ_CFG), AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief  Check if SPI3 has been remaped or not\r
+  * @rmtoll MAPR         SPI3_REMAP         LL_GPIO_AF_IsEnabledRemap_SPI3_REMAP\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_SPI3(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR, AFIO_MAPR_SPI3_REMAP) == (AFIO_MAPR_SPI3_REMAP));\r
+}\r
+#endif\r
+\r
+#if defined(AFIO_MAPR_TIM2ITR1_IREMAP)\r
+\r
+/**\r
+  * @brief Control of TIM2_ITR1 internal mapping.\r
+  * @rmtoll MAPR          TIM2ITR1_IREMAP           LL_GPIO_AF_Remap_TIM2ITR1_TO_USB\r
+  * @note  TO_USB: Connect USB OTG SOF (Start of Frame) output to TIM2_ITR1 for calibration purposes.\r
+  * @note  This bit is available only in connectivity line devices and is reserved otherwise.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_Remap_TIM2ITR1_TO_USB(void)\r
+{\r
+  SET_BIT(AFIO->MAPR, AFIO_MAPR_TIM2ITR1_IREMAP | AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief Control of TIM2_ITR1 internal mapping.\r
+  * @rmtoll MAPR          TIM2ITR1_IREMAP           LL_GPIO_AF_Remap_TIM2ITR1_TO_ETH\r
+  * @note  TO_ETH: Connect TIM2_ITR1 internally to the Ethernet PTP output for calibration purposes.\r
+  * @note  This bit is available only in connectivity line devices and is reserved otherwise.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_Remap_TIM2ITR1_TO_ETH(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_TIM2ITR1_IREMAP | AFIO_MAPR_SWJ_CFG), AFIO_MAPR_SWJ_CFG);\r
+}\r
+#endif\r
+\r
+#if defined(AFIO_MAPR_PTP_PPS_REMAP)\r
+\r
+/**\r
+  * @brief Enable the remapping of ADC2_ETRGREG (ADC 2 External trigger regular conversion).\r
+  * @rmtoll MAPR          PTP_PPS_REMAP           LL_GPIO_AF_EnableRemap_ETH_PTP_PPS\r
+  * @note  ENABLE: PTP_PPS is output on PB5 pin.\r
+  * @note  This bit is available only in connectivity line devices and is reserved otherwise.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_ETH_PTP_PPS(void)\r
+{\r
+  SET_BIT(AFIO->MAPR, AFIO_MAPR_PTP_PPS_REMAP | AFIO_MAPR_SWJ_CFG);\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of ADC2_ETRGREG (ADC 2 External trigger regular conversion).\r
+  * @rmtoll MAPR          PTP_PPS_REMAP           LL_GPIO_AF_DisableRemap_ETH_PTP_PPS\r
+  * @note  DISABLE: PTP_PPS not output on PB5 pin.\r
+  * @note  This bit is available only in connectivity line devices and is reserved otherwise.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_ETH_PTP_PPS(void)\r
+{\r
+  MODIFY_REG(AFIO->MAPR, (AFIO_MAPR_PTP_PPS_REMAP | AFIO_MAPR_SWJ_CFG), AFIO_MAPR_SWJ_CFG);\r
+}\r
+#endif\r
+\r
+#if defined(AFIO_MAPR2_TIM9_REMAP)\r
+\r
+/**\r
+  * @brief Enable the remapping of TIM9_CH1 and TIM9_CH2.\r
+  * @rmtoll MAPR2          TIM9_REMAP           LL_GPIO_AF_EnableRemap_TIM9\r
+  * @note  ENABLE: Remap     (TIM9_CH1 on PE5 and TIM9_CH2 on PE6).\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_TIM9(void)\r
+{\r
+  SET_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM9_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of TIM9_CH1 and TIM9_CH2.\r
+  * @rmtoll MAPR2          TIM9_REMAP           LL_GPIO_AF_DisableRemap_TIM9\r
+  * @note  DISABLE: No remap (TIM9_CH1 on PA2 and TIM9_CH2 on PA3).\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM9(void)\r
+{\r
+  CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM9_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief  Check if TIM9_CH1 and TIM9_CH2 have been remaped or not\r
+  * @rmtoll MAPR2         TIM9_REMAP         LL_GPIO_AF_IsEnabledRemap_TIM9\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_TIM9(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM9_REMAP) == (AFIO_MAPR2_TIM9_REMAP));\r
+}\r
+#endif\r
+\r
+#if defined(AFIO_MAPR2_TIM10_REMAP)\r
+\r
+/**\r
+  * @brief Enable the remapping of TIM10_CH1.\r
+  * @rmtoll MAPR2          TIM10_REMAP           LL_GPIO_AF_EnableRemap_TIM10\r
+  * @note  ENABLE: Remap     (TIM10_CH1 on PF6).\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_TIM10(void)\r
+{\r
+  SET_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM10_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of TIM10_CH1.\r
+  * @rmtoll MAPR2          TIM10_REMAP           LL_GPIO_AF_DisableRemap_TIM10\r
+  * @note  DISABLE: No remap (TIM10_CH1 on PB8).\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM10(void)\r
+{\r
+  CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM10_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief  Check if TIM10_CH1 has been remaped or not\r
+  * @rmtoll MAPR2         TIM10_REMAP         LL_GPIO_AF_IsEnabledRemap_TIM10\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_TIM10(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM10_REMAP) == (AFIO_MAPR2_TIM10_REMAP));\r
+}\r
+#endif\r
+\r
+#if defined(AFIO_MAPR2_TIM11_REMAP)\r
+/**\r
+  * @brief Enable the remapping of TIM11_CH1.\r
+  * @rmtoll MAPR2          TIM11_REMAP           LL_GPIO_AF_EnableRemap_TIM11\r
+  * @note  ENABLE: Remap     (TIM11_CH1 on PF7).\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_TIM11(void)\r
+{\r
+  SET_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM11_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of TIM11_CH1.\r
+  * @rmtoll MAPR2          TIM11_REMAP           LL_GPIO_AF_DisableRemap_TIM11\r
+  * @note  DISABLE: No remap (TIM11_CH1 on PB9).\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM11(void)\r
+{\r
+  CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM11_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief  Check if TIM11_CH1 has been remaped or not\r
+  * @rmtoll MAPR2         TIM11_REMAP         LL_GPIO_AF_IsEnabledRemap_TIM11\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_TIM11(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM11_REMAP) == (AFIO_MAPR2_TIM11_REMAP));\r
+}\r
+#endif\r
+\r
+#if defined(AFIO_MAPR2_TIM13_REMAP)\r
+\r
+/**\r
+  * @brief Enable the remapping of TIM13_CH1.\r
+  * @rmtoll MAPR2          TIM13_REMAP           LL_GPIO_AF_EnableRemap_TIM13\r
+  * @note  ENABLE: Remap     STM32F100:(TIM13_CH1 on PF8). Others:(TIM13_CH1 on PB0).\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_TIM13(void)\r
+{\r
+  SET_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM13_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of TIM13_CH1.\r
+  * @rmtoll MAPR2          TIM13_REMAP           LL_GPIO_AF_DisableRemap_TIM13\r
+  * @note  DISABLE: No remap STM32F100:(TIM13_CH1 on PA6). Others:(TIM13_CH1 on PC8).\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM13(void)\r
+{\r
+  CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM13_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief  Check if TIM13_CH1 has been remaped or not\r
+  * @rmtoll MAPR2         TIM13_REMAP         LL_GPIO_AF_IsEnabledRemap_TIM13\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_TIM13(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM13_REMAP) == (AFIO_MAPR2_TIM13_REMAP));\r
+}\r
+#endif\r
+\r
+#if defined(AFIO_MAPR2_TIM14_REMAP)\r
+\r
+/**\r
+  * @brief Enable the remapping of TIM14_CH1.\r
+  * @rmtoll MAPR2          TIM14_REMAP           LL_GPIO_AF_EnableRemap_TIM14\r
+  * @note  ENABLE: Remap     STM32F100:(TIM14_CH1 on PB1). Others:(TIM14_CH1 on PF9).\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_TIM14(void)\r
+{\r
+  SET_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM14_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of TIM14_CH1.\r
+  * @rmtoll MAPR2          TIM14_REMAP           LL_GPIO_AF_DisableRemap_TIM14\r
+  * @note  DISABLE: No remap STM32F100:(TIM14_CH1 on PC9). Others:(TIM14_CH1 on PA7).\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM14(void)\r
+{\r
+  CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM14_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief  Check if TIM14_CH1 has been remaped or not\r
+  * @rmtoll MAPR2         TIM14_REMAP         LL_GPIO_AF_IsEnabledRemap_TIM14\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_TIM14(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM14_REMAP) == (AFIO_MAPR2_TIM14_REMAP));\r
+}\r
+#endif\r
+\r
+#if defined(AFIO_MAPR2_FSMC_NADV_REMAP)\r
+\r
+/**\r
+  * @brief Controls the use of the optional FSMC_NADV signal.\r
+  * @rmtoll MAPR2          FSMC_NADV           LL_GPIO_AF_Disconnect_FSMCNADV\r
+  * @note  DISCONNECTED: The NADV signal is not connected. The I/O pin can be used by another peripheral.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_Disconnect_FSMCNADV(void)\r
+{\r
+  SET_BIT(AFIO->MAPR2, AFIO_MAPR2_FSMC_NADV_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief Controls the use of the optional FSMC_NADV signal.\r
+  * @rmtoll MAPR2          FSMC_NADV           LL_GPIO_AF_Connect_FSMCNADV\r
+  * @note  CONNECTED: The NADV signal is connected to the output (default).\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_Connect_FSMCNADV(void)\r
+{\r
+  CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_FSMC_NADV_REMAP);\r
+}\r
+#endif\r
+\r
+#if defined(AFIO_MAPR2_TIM15_REMAP)\r
+\r
+/**\r
+  * @brief Enable the remapping of TIM15_CH1 and TIM15_CH2.\r
+  * @rmtoll MAPR2          TIM15_REMAP           LL_GPIO_AF_EnableRemap_TIM15\r
+  * @note  ENABLE: Remap     (TIM15_CH1 on PB14 and TIM15_CH2 on PB15).\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_TIM15(void)\r
+{\r
+  SET_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM15_REMAP);\r
+}\r
+/**\r
+  * @brief Disable the remapping of TIM15_CH1 and TIM15_CH2.\r
+  * @rmtoll MAPR2          TIM15_REMAP           LL_GPIO_AF_DisableRemap_TIM15\r
+  * @note  DISABLE: No remap (TIM15_CH1 on PA2  and TIM15_CH2 on PA3).\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM15(void)\r
+{\r
+  CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM15_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief  Check if TIM15_CH1 has been remaped or not\r
+  * @rmtoll MAPR2         TIM15_REMAP         LL_GPIO_AF_IsEnabledRemap_TIM15\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_TIM15(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM15_REMAP) == (AFIO_MAPR2_TIM15_REMAP));\r
+}\r
+#endif\r
+\r
+#if defined(AFIO_MAPR2_TIM16_REMAP)\r
+\r
+/**\r
+  * @brief Enable the remapping of TIM16_CH1.\r
+  * @rmtoll MAPR2          TIM16_REMAP           LL_GPIO_AF_EnableRemap_TIM16\r
+  * @note  ENABLE: Remap     (TIM16_CH1 on PA6).\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_TIM16(void)\r
+{\r
+  SET_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM16_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of TIM16_CH1.\r
+  * @rmtoll MAPR2          TIM16_REMAP           LL_GPIO_AF_DisableRemap_TIM16\r
+  * @note  DISABLE: No remap (TIM16_CH1 on PB8).\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM16(void)\r
+{\r
+  CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM16_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief  Check if TIM16_CH1 has been remaped or not\r
+  * @rmtoll MAPR2         TIM16_REMAP         LL_GPIO_AF_IsEnabledRemap_TIM16\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_TIM16(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM16_REMAP) == (AFIO_MAPR2_TIM16_REMAP));\r
+}\r
+#endif\r
+\r
+#if defined(AFIO_MAPR2_TIM17_REMAP)\r
+\r
+/**\r
+  * @brief Enable the remapping of TIM17_CH1.\r
+  * @rmtoll MAPR2          TIM17_REMAP           LL_GPIO_AF_EnableRemap_TIM17\r
+  * @note  ENABLE: Remap     (TIM17_CH1 on PA7).\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_TIM17(void)\r
+{\r
+  SET_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM17_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of TIM17_CH1.\r
+  * @rmtoll MAPR2          TIM17_REMAP           LL_GPIO_AF_DisableRemap_TIM17\r
+  * @note  DISABLE: No remap (TIM17_CH1 on PB9).\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM17(void)\r
+{\r
+  CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM17_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief  Check if TIM17_CH1 has been remaped or not\r
+  * @rmtoll MAPR2         TIM17_REMAP         LL_GPIO_AF_IsEnabledRemap_TIM17\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_TIM17(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM17_REMAP) == (AFIO_MAPR2_TIM17_REMAP));\r
+}\r
+#endif\r
+\r
+#if defined(AFIO_MAPR2_CEC_REMAP)\r
+\r
+/**\r
+  * @brief Enable the remapping of CEC.\r
+  * @rmtoll MAPR2          CEC_REMAP           LL_GPIO_AF_EnableRemap_CEC\r
+  * @note  ENABLE: Remap     (CEC on PB10).\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_CEC(void)\r
+{\r
+  SET_BIT(AFIO->MAPR2, AFIO_MAPR2_CEC_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of CEC.\r
+  * @rmtoll MAPR2          CEC_REMAP           LL_GPIO_AF_DisableRemap_CEC\r
+  * @note  DISABLE: No remap (CEC on PB8).\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_CEC(void)\r
+{\r
+  CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_CEC_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief  Check if CEC has been remaped or not\r
+  * @rmtoll MAPR2         CEC_REMAP         LL_GPIO_AF_IsEnabledRemap_CEC\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_CEC(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR2, AFIO_MAPR2_CEC_REMAP) == (AFIO_MAPR2_CEC_REMAP));\r
+}\r
+#endif\r
+\r
+#if defined(AFIO_MAPR2_TIM1_DMA_REMAP)\r
+\r
+/**\r
+  * @brief Controls the mapping of the TIM1_CH1 TIM1_CH2 DMA requests onto the DMA1 channels.\r
+  * @rmtoll MAPR2          TIM1_DMA_REMAP           LL_GPIO_AF_EnableRemap_TIM1DMA\r
+  * @note  ENABLE: Remap (TIM1_CH1 DMA request/DMA1 Channel6, TIM1_CH2 DMA request/DMA1 Channel6)\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_TIM1DMA(void)\r
+{\r
+  SET_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM1_DMA_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief Controls the mapping of the TIM1_CH1 TIM1_CH2 DMA requests onto the DMA1 channels.\r
+  * @rmtoll MAPR2          TIM1_DMA_REMAP           LL_GPIO_AF_DisableRemap_TIM1DMA\r
+  * @note  DISABLE: No remap (TIM1_CH1 DMA request/DMA1 Channel2, TIM1_CH2 DMA request/DMA1 Channel3).\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM1DMA(void)\r
+{\r
+  CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM1_DMA_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief  Check if TIM1DMA has been remaped or not\r
+  * @rmtoll MAPR2         TIM1_DMA_REMAP         LL_GPIO_AF_IsEnabledRemap_TIM1DMA\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_TIM1DMA(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM1_DMA_REMAP) == (AFIO_MAPR2_TIM1_DMA_REMAP));\r
+}\r
+#endif\r
+\r
+#if defined(AFIO_MAPR2_TIM67_DAC_DMA_REMAP)\r
+\r
+/**\r
+  * @brief Controls the mapping of the TIM6_DAC1 and TIM7_DAC2 DMA requests onto the DMA1 channels.\r
+  * @rmtoll MAPR2          TIM76_DAC_DMA_REMAP           LL_GPIO_AF_EnableRemap_TIM67DACDMA\r
+  * @note  ENABLE: Remap (TIM6_DAC1 DMA request/DMA1 Channel3, TIM7_DAC2 DMA request/DMA1 Channel4)\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_TIM67DACDMA(void)\r
+{\r
+  SET_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM67_DAC_DMA_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief Controls the mapping of the TIM6_DAC1 and TIM7_DAC2 DMA requests onto the DMA1 channels.\r
+  * @rmtoll MAPR2          TIM76_DAC_DMA_REMAP           LL_GPIO_AF_DisableRemap_TIM67DACDMA\r
+  * @note  DISABLE: No remap (TIM6_DAC1 DMA request/DMA2 Channel3, TIM7_DAC2 DMA request/DMA2 Channel4)\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM67DACDMA(void)\r
+{\r
+  CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM67_DAC_DMA_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief  Check if TIM67DACDMA has been remaped or not\r
+  * @rmtoll MAPR2         TIM76_DAC_DMA_REMAP         LL_GPIO_AF_IsEnabledRemap_TIM67DACDMA\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_TIM67DACDMA(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM67_DAC_DMA_REMAP) == (AFIO_MAPR2_TIM67_DAC_DMA_REMAP));\r
+}\r
+#endif\r
+\r
+#if defined(AFIO_MAPR2_TIM12_REMAP)\r
+\r
+/**\r
+  * @brief Enable the remapping of TIM12_CH1 and TIM12_CH2.\r
+  * @rmtoll MAPR2          TIM12_REMAP           LL_GPIO_AF_EnableRemap_TIM12\r
+  * @note  ENABLE: Remap     (TIM12_CH1 on PB12 and TIM12_CH2 on PB13).\r
+  * @note  This bit is available only in high density value line devices.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_TIM12(void)\r
+{\r
+  SET_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM12_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief Disable the remapping of TIM12_CH1 and TIM12_CH2.\r
+  * @rmtoll MAPR2          TIM12_REMAP           LL_GPIO_AF_DisableRemap_TIM12\r
+  * @note  DISABLE: No remap (TIM12_CH1 on PC4  and TIM12_CH2 on PC5).\r
+  * @note  This bit is available only in high density value line devices.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM12(void)\r
+{\r
+  CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM12_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief  Check if TIM12_CH1 has been remaped or not\r
+  * @rmtoll MAPR2         TIM12_REMAP         LL_GPIO_AF_IsEnabledRemap_TIM12\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_TIM12(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM12_REMAP) == (AFIO_MAPR2_TIM12_REMAP));\r
+}\r
+#endif\r
+\r
+#if defined(AFIO_MAPR2_MISC_REMAP)\r
+\r
+/**\r
+  * @brief Miscellaneous features remapping.\r
+  *        This bit is set and cleared by software. It controls miscellaneous features.\r
+  *        The DMA2 channel 5 interrupt position in the vector table.\r
+  *        The timer selection for DAC trigger 3 (TSEL[2:0] = 011, for more details refer to the DAC_CR register).\r
+  * @rmtoll MAPR2          MISC_REMAP           LL_GPIO_AF_EnableRemap_MISC\r
+  * @note  ENABLE: DMA2 channel 5 interrupt is mapped separately at position 60 and TIM15 TRGO event is\r
+  *        selected as DAC Trigger 3, TIM15 triggers TIM1/3.\r
+  * @note  This bit is available only in high density value line devices.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableRemap_MISC(void)\r
+{\r
+  SET_BIT(AFIO->MAPR2, AFIO_MAPR2_MISC_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief Miscellaneous features remapping.\r
+  *        This bit is set and cleared by software. It controls miscellaneous features.\r
+  *        The DMA2 channel 5 interrupt position in the vector table.\r
+  *        The timer selection for DAC trigger 3 (TSEL[2:0] = 011, for more details refer to the DAC_CR register).\r
+  * @rmtoll MAPR2          MISC_REMAP           LL_GPIO_AF_DisableRemap_MISC\r
+  * @note  DISABLE: DMA2 channel 5 interrupt is mapped with DMA2 channel 4 at position 59, TIM5 TRGO\r
+  *        event is selected as DAC Trigger 3, TIM5 triggers TIM1/3.\r
+  * @note  This bit is available only in high density value line devices.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableRemap_MISC(void)\r
+{\r
+  CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_MISC_REMAP);\r
+}\r
+\r
+/**\r
+  * @brief  Check if MISC has been remaped or not\r
+  * @rmtoll MAPR2         MISC_REMAP         LL_GPIO_AF_IsEnabledRemap_MISC\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_MISC(void)\r
+{\r
+  return (READ_BIT(AFIO->MAPR2, AFIO_MAPR2_MISC_REMAP) == (AFIO_MAPR2_MISC_REMAP));\r
+}\r
+#endif\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup GPIO_AF_LL_EVENTOUT Output Event configuration\r
+  * @brief This section propose definition to Configure EVENTOUT Cortex feature .\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Configures the port and pin on which the EVENTOUT Cortex signal will be connected.\r
+  * @rmtoll EVCR          PORT           LL_GPIO_AF_ConfigEventout\n\r
+  *         EVCR          PIN            LL_GPIO_AF_ConfigEventout\r
+  * @param  LL_GPIO_PortSource This parameter can be one of the following values:\r
+  *      @arg @ref LL_GPIO_AF_EVENTOUT_PORT_A\r
+  *      @arg @ref LL_GPIO_AF_EVENTOUT_PORT_B\r
+  *      @arg @ref LL_GPIO_AF_EVENTOUT_PORT_C\r
+  *      @arg @ref LL_GPIO_AF_EVENTOUT_PORT_D\r
+  *      @arg @ref LL_GPIO_AF_EVENTOUT_PORT_E\r
+  * @param  LL_GPIO_PinSource This parameter can be one of the following values:\r
+  *      @arg @ref LL_GPIO_AF_EVENTOUT_PIN_0\r
+  *      @arg @ref LL_GPIO_AF_EVENTOUT_PIN_1\r
+  *      @arg @ref LL_GPIO_AF_EVENTOUT_PIN_2\r
+  *      @arg @ref LL_GPIO_AF_EVENTOUT_PIN_3\r
+  *      @arg @ref LL_GPIO_AF_EVENTOUT_PIN_4\r
+  *      @arg @ref LL_GPIO_AF_EVENTOUT_PIN_5\r
+  *      @arg @ref LL_GPIO_AF_EVENTOUT_PIN_6\r
+  *      @arg @ref LL_GPIO_AF_EVENTOUT_PIN_7\r
+  *      @arg @ref LL_GPIO_AF_EVENTOUT_PIN_8\r
+  *      @arg @ref LL_GPIO_AF_EVENTOUT_PIN_9\r
+  *      @arg @ref LL_GPIO_AF_EVENTOUT_PIN_10\r
+  *      @arg @ref LL_GPIO_AF_EVENTOUT_PIN_11\r
+  *      @arg @ref LL_GPIO_AF_EVENTOUT_PIN_12\r
+  *      @arg @ref LL_GPIO_AF_EVENTOUT_PIN_13\r
+  *      @arg @ref LL_GPIO_AF_EVENTOUT_PIN_14\r
+  *      @arg @ref LL_GPIO_AF_EVENTOUT_PIN_15\r
+  * @retval None\r
+*/\r
+__STATIC_INLINE void LL_GPIO_AF_ConfigEventout(uint32_t LL_GPIO_PortSource, uint32_t LL_GPIO_PinSource)\r
+{\r
+  MODIFY_REG(AFIO->EVCR, (AFIO_EVCR_PORT) | (AFIO_EVCR_PIN), (LL_GPIO_PortSource) | (LL_GPIO_PinSource));\r
+}\r
+\r
+/**\r
+  * @brief  Enables the Event Output.\r
+  * @rmtoll EVCR          EVOE           LL_GPIO_AF_EnableEventout\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_EnableEventout(void)\r
+{\r
+  SET_BIT(AFIO->EVCR, AFIO_EVCR_EVOE);\r
+}\r
+\r
+/**\r
+  * @brief  Disables the Event Output.\r
+  * @rmtoll EVCR          EVOE           LL_GPIO_AF_DisableEventout\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_DisableEventout(void)\r
+{\r
+  CLEAR_BIT(AFIO->EVCR, AFIO_EVCR_EVOE);\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+/** @defgroup GPIO_AF_LL_EXTI EXTI external interrupt\r
+  * @brief This section Configure source input for the EXTI external interrupt .\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Configure source input for the EXTI external interrupt.\r
+  * @rmtoll AFIO_EXTICR1      EXTIx         LL_GPIO_AF_SetEXTISource\n\r
+  *         AFIO_EXTICR2      EXTIx         LL_GPIO_AF_SetEXTISource\n\r
+  *         AFIO_EXTICR3      EXTIx         LL_GPIO_AF_SetEXTISource\n\r
+  *         AFIO_EXTICR4      EXTIx         LL_GPIO_AF_SetEXTISource\r
+  * @param  Port This parameter can be one of the following values:\r
+  *         @arg @ref LL_GPIO_AF_EXTI_PORTA\r
+  *         @arg @ref LL_GPIO_AF_EXTI_PORTB\r
+  *         @arg @ref LL_GPIO_AF_EXTI_PORTC\r
+  *         @arg @ref LL_GPIO_AF_EXTI_PORTD\r
+  *         @arg @ref LL_GPIO_AF_EXTI_PORTE\r
+  *         @arg @ref LL_GPIO_AF_EXTI_PORTF\r
+  *         @arg @ref LL_GPIO_AF_EXTI_PORTG\r
+  * @param  Line This parameter can be one of the following values:\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE0\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE1\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE2\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE3\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE4\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE5\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE6\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE7\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE8\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE9\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE10\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE11\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE12\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE13\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE14\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE15\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_GPIO_AF_SetEXTISource(uint32_t Port, uint32_t Line)\r
+{\r
+  MODIFY_REG(AFIO->EXTICR[Line & 0xFF], (Line >> 16), Port << POSITION_VAL((Line >> 16)));\r
+}\r
+\r
+/**\r
+  * @brief  Get the configured defined for specific EXTI Line\r
+  * @rmtoll AFIO_EXTICR1      EXTIx         LL_GPIO_AF_GetEXTISource\n\r
+  *         AFIO_EXTICR2      EXTIx         LL_GPIO_AF_GetEXTISource\n\r
+  *         AFIO_EXTICR3      EXTIx         LL_GPIO_AF_GetEXTISource\n\r
+  *         AFIO_EXTICR4      EXTIx         LL_GPIO_AF_GetEXTISource\r
+  * @param  Line This parameter can be one of the following values:\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE0\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE1\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE2\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE3\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE4\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE5\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE6\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE7\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE8\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE9\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE10\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE11\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE12\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE13\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE14\r
+  *         @arg @ref LL_GPIO_AF_EXTI_LINE15\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_GPIO_AF_EXTI_PORTA\r
+  *         @arg @ref LL_GPIO_AF_EXTI_PORTB\r
+  *         @arg @ref LL_GPIO_AF_EXTI_PORTC\r
+  *         @arg @ref LL_GPIO_AF_EXTI_PORTD\r
+  *         @arg @ref LL_GPIO_AF_EXTI_PORTE\r
+  *         @arg @ref LL_GPIO_AF_EXTI_PORTF\r
+  *         @arg @ref LL_GPIO_AF_EXTI_PORTG\r
+  */\r
+__STATIC_INLINE uint32_t LL_GPIO_AF_GetEXTISource(uint32_t Line)\r
+{\r
+  return (uint32_t)(READ_BIT(AFIO->EXTICR[Line & 0xFF], (Line >> 16)) >> POSITION_VAL(Line >> 16));\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#if defined(USE_FULL_LL_DRIVER)\r
+/** @defgroup GPIO_LL_EF_Init Initialization and de-initialization functions\r
+  * @{\r
+  */\r
+\r
+ErrorStatus LL_GPIO_DeInit(GPIO_TypeDef *GPIOx);\r
+ErrorStatus LL_GPIO_Init(GPIO_TypeDef *GPIOx, LL_GPIO_InitTypeDef *GPIO_InitStruct);\r
+void        LL_GPIO_StructInit(LL_GPIO_InitTypeDef *GPIO_InitStruct);\r
+\r
+/**\r
+  * @}\r
+  */\r
+#endif /* USE_FULL_LL_DRIVER */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* defined (GPIOA) || defined (GPIOB) || defined (GPIOC) || defined (GPIOD) || defined (GPIOE) || defined (GPIOF) || defined (GPIOG) */\r
+/**\r
+  * @}\r
+  */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* STM32F1xx_LL_GPIO_H */\r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_pwr.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_pwr.h
new file mode 100644 (file)
index 0000000..cd75914
--- /dev/null
@@ -0,0 +1,440 @@
+/**\r
+  ******************************************************************************\r
+  * @file    stm32f1xx_ll_pwr.h\r
+  * @author  MCD Application Team\r
+  * @brief   Header file of PWR LL module.\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+\r
+/* Define to prevent recursive inclusion -------------------------------------*/\r
+#ifndef __STM32F1xx_LL_PWR_H\r
+#define __STM32F1xx_LL_PWR_H\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/* Includes ------------------------------------------------------------------*/\r
+#include "stm32f1xx.h"\r
+\r
+/** @addtogroup STM32F1xx_LL_Driver\r
+  * @{\r
+  */\r
+\r
+#if defined(PWR)\r
+\r
+/** @defgroup PWR_LL PWR\r
+  * @{\r
+  */\r
+\r
+/* Private types -------------------------------------------------------------*/\r
+/* Private variables ---------------------------------------------------------*/\r
+/* Private constants ---------------------------------------------------------*/\r
+/* Private macros ------------------------------------------------------------*/\r
+/* Exported types ------------------------------------------------------------*/\r
+/* Exported constants --------------------------------------------------------*/\r
+/** @defgroup PWR_LL_Exported_Constants PWR Exported Constants\r
+  * @{\r
+  */\r
+\r
+/** @defgroup PWR_LL_EC_CLEAR_FLAG Clear Flags Defines\r
+  * @brief    Flags defines which can be used with LL_PWR_WriteReg function\r
+  * @{\r
+  */\r
+#define LL_PWR_CR_CSBF                     PWR_CR_CSBF            /*!< Clear standby flag */\r
+#define LL_PWR_CR_CWUF                     PWR_CR_CWUF            /*!< Clear wakeup flag */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup PWR_LL_EC_GET_FLAG Get Flags Defines\r
+  * @brief    Flags defines which can be used with LL_PWR_ReadReg function\r
+  * @{\r
+  */\r
+#define LL_PWR_CSR_WUF                     PWR_CSR_WUF            /*!< Wakeup flag */\r
+#define LL_PWR_CSR_SBF                     PWR_CSR_SBF            /*!< Standby flag */\r
+#define LL_PWR_CSR_PVDO                    PWR_CSR_PVDO           /*!< Power voltage detector output flag */\r
+#define LL_PWR_CSR_EWUP1                   PWR_CSR_EWUP           /*!< Enable WKUP pin 1 */\r
+/**\r
+  * @}\r
+  */\r
+\r
+\r
+/** @defgroup PWR_LL_EC_MODE_PWR Mode Power\r
+  * @{\r
+  */\r
+#define LL_PWR_MODE_STOP_MAINREGU             0x00000000U                    /*!< Enter Stop mode when the CPU enters deepsleep */\r
+#define LL_PWR_MODE_STOP_LPREGU               (PWR_CR_LPDS)                  /*!< Enter Stop mode (with low power Regulator ON) when the CPU enters deepsleep */\r
+#define LL_PWR_MODE_STANDBY                   (PWR_CR_PDDS)                  /*!< Enter Standby mode when the CPU enters deepsleep */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup PWR_LL_EC_REGU_MODE_DS_MODE  Regulator Mode In Deep Sleep Mode\r
+ * @{\r
+ */\r
+#define LL_PWR_REGU_DSMODE_MAIN        0x00000000U           /*!< Voltage Regulator in main mode during deepsleep mode */\r
+#define LL_PWR_REGU_DSMODE_LOW_POWER   (PWR_CR_LPDS)         /*!< Voltage Regulator in low-power mode during deepsleep mode */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup PWR_LL_EC_PVDLEVEL Power Voltage Detector Level\r
+  * @{\r
+  */\r
+#define LL_PWR_PVDLEVEL_0                  (PWR_CR_PLS_LEV0)      /*!< Voltage threshold detected by PVD 2.2 V */\r
+#define LL_PWR_PVDLEVEL_1                  (PWR_CR_PLS_LEV1)      /*!< Voltage threshold detected by PVD 2.3 V */\r
+#define LL_PWR_PVDLEVEL_2                  (PWR_CR_PLS_LEV2)      /*!< Voltage threshold detected by PVD 2.4 V */\r
+#define LL_PWR_PVDLEVEL_3                  (PWR_CR_PLS_LEV3)      /*!< Voltage threshold detected by PVD 2.5 V */\r
+#define LL_PWR_PVDLEVEL_4                  (PWR_CR_PLS_LEV4)      /*!< Voltage threshold detected by PVD 2.6 V */\r
+#define LL_PWR_PVDLEVEL_5                  (PWR_CR_PLS_LEV5)      /*!< Voltage threshold detected by PVD 2.7 V */\r
+#define LL_PWR_PVDLEVEL_6                  (PWR_CR_PLS_LEV6)      /*!< Voltage threshold detected by PVD 2.8 V */\r
+#define LL_PWR_PVDLEVEL_7                  (PWR_CR_PLS_LEV7)      /*!< Voltage threshold detected by PVD 2.9 V */\r
+/**\r
+  * @}\r
+  */\r
+/** @defgroup PWR_LL_EC_WAKEUP_PIN  Wakeup Pins\r
+  * @{\r
+  */\r
+#define LL_PWR_WAKEUP_PIN1                 (PWR_CSR_EWUP)         /*!< WKUP pin 1 : PA0 */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+\r
+/* Exported macro ------------------------------------------------------------*/\r
+/** @defgroup PWR_LL_Exported_Macros PWR Exported Macros\r
+  * @{\r
+  */\r
+\r
+/** @defgroup PWR_LL_EM_WRITE_READ Common write and read registers Macros\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Write a value in PWR register\r
+  * @param  __REG__ Register to be written\r
+  * @param  __VALUE__ Value to be written in the register\r
+  * @retval None\r
+  */\r
+#define LL_PWR_WriteReg(__REG__, __VALUE__) WRITE_REG(PWR->__REG__, (__VALUE__))\r
+\r
+/**\r
+  * @brief  Read a value in PWR register\r
+  * @param  __REG__ Register to be read\r
+  * @retval Register value\r
+  */\r
+#define LL_PWR_ReadReg(__REG__) READ_REG(PWR->__REG__)\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Exported functions --------------------------------------------------------*/\r
+/** @defgroup PWR_LL_Exported_Functions PWR Exported Functions\r
+  * @{\r
+  */\r
+\r
+/** @defgroup PWR_LL_EF_Configuration Configuration\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable access to the backup domain\r
+  * @rmtoll CR    DBP       LL_PWR_EnableBkUpAccess\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_PWR_EnableBkUpAccess(void)\r
+{\r
+  SET_BIT(PWR->CR, PWR_CR_DBP);\r
+}\r
+\r
+/**\r
+  * @brief  Disable access to the backup domain\r
+  * @rmtoll CR    DBP       LL_PWR_DisableBkUpAccess\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_PWR_DisableBkUpAccess(void)\r
+{\r
+  CLEAR_BIT(PWR->CR, PWR_CR_DBP);\r
+}\r
+\r
+/**\r
+  * @brief  Check if the backup domain is enabled\r
+  * @rmtoll CR    DBP       LL_PWR_IsEnabledBkUpAccess\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_PWR_IsEnabledBkUpAccess(void)\r
+{\r
+  return (READ_BIT(PWR->CR, PWR_CR_DBP) == (PWR_CR_DBP));\r
+}\r
+\r
+/**\r
+  * @brief  Set voltage Regulator mode during deep sleep mode\r
+  * @rmtoll CR    LPDS         LL_PWR_SetRegulModeDS\r
+  * @param  RegulMode This parameter can be one of the following values:\r
+  *         @arg @ref LL_PWR_REGU_DSMODE_MAIN\r
+  *         @arg @ref LL_PWR_REGU_DSMODE_LOW_POWER\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_PWR_SetRegulModeDS(uint32_t RegulMode)\r
+{\r
+  MODIFY_REG(PWR->CR, PWR_CR_LPDS, RegulMode);\r
+}\r
+\r
+/**\r
+  * @brief  Get voltage Regulator mode during deep sleep mode\r
+  * @rmtoll CR    LPDS         LL_PWR_GetRegulModeDS\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_PWR_REGU_DSMODE_MAIN\r
+  *         @arg @ref LL_PWR_REGU_DSMODE_LOW_POWER\r
+  */\r
+__STATIC_INLINE uint32_t LL_PWR_GetRegulModeDS(void)\r
+{\r
+  return (uint32_t)(READ_BIT(PWR->CR, PWR_CR_LPDS));\r
+}\r
+\r
+/**\r
+  * @brief  Set Power Down mode when CPU enters deepsleep\r
+  * @rmtoll CR    PDDS         LL_PWR_SetPowerMode\n\r
+  * @rmtoll CR    LPDS         LL_PWR_SetPowerMode\r
+  * @param  PDMode This parameter can be one of the following values:\r
+  *         @arg @ref LL_PWR_MODE_STOP_MAINREGU\r
+  *         @arg @ref LL_PWR_MODE_STOP_LPREGU\r
+  *         @arg @ref LL_PWR_MODE_STANDBY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_PWR_SetPowerMode(uint32_t PDMode)\r
+{\r
+  MODIFY_REG(PWR->CR, (PWR_CR_PDDS| PWR_CR_LPDS), PDMode);\r
+}\r
+\r
+/**\r
+  * @brief  Get Power Down mode when CPU enters deepsleep\r
+  * @rmtoll CR    PDDS         LL_PWR_GetPowerMode\n\r
+  * @rmtoll CR    LPDS         LL_PWR_GetPowerMode\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_PWR_MODE_STOP_MAINREGU\r
+  *         @arg @ref LL_PWR_MODE_STOP_LPREGU\r
+  *         @arg @ref LL_PWR_MODE_STANDBY\r
+  */\r
+__STATIC_INLINE uint32_t LL_PWR_GetPowerMode(void)\r
+{\r
+  return (uint32_t)(READ_BIT(PWR->CR, (PWR_CR_PDDS| PWR_CR_LPDS)));\r
+}\r
+\r
+/**\r
+  * @brief  Configure the voltage threshold detected by the Power Voltage Detector\r
+  * @rmtoll CR    PLS       LL_PWR_SetPVDLevel\r
+  * @param  PVDLevel This parameter can be one of the following values:\r
+  *         @arg @ref LL_PWR_PVDLEVEL_0\r
+  *         @arg @ref LL_PWR_PVDLEVEL_1\r
+  *         @arg @ref LL_PWR_PVDLEVEL_2\r
+  *         @arg @ref LL_PWR_PVDLEVEL_3\r
+  *         @arg @ref LL_PWR_PVDLEVEL_4\r
+  *         @arg @ref LL_PWR_PVDLEVEL_5\r
+  *         @arg @ref LL_PWR_PVDLEVEL_6\r
+  *         @arg @ref LL_PWR_PVDLEVEL_7\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_PWR_SetPVDLevel(uint32_t PVDLevel)\r
+{\r
+  MODIFY_REG(PWR->CR, PWR_CR_PLS, PVDLevel);\r
+}\r
+\r
+/**\r
+  * @brief  Get the voltage threshold detection\r
+  * @rmtoll CR    PLS       LL_PWR_GetPVDLevel\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_PWR_PVDLEVEL_0\r
+  *         @arg @ref LL_PWR_PVDLEVEL_1\r
+  *         @arg @ref LL_PWR_PVDLEVEL_2\r
+  *         @arg @ref LL_PWR_PVDLEVEL_3\r
+  *         @arg @ref LL_PWR_PVDLEVEL_4\r
+  *         @arg @ref LL_PWR_PVDLEVEL_5\r
+  *         @arg @ref LL_PWR_PVDLEVEL_6\r
+  *         @arg @ref LL_PWR_PVDLEVEL_7\r
+  */\r
+__STATIC_INLINE uint32_t LL_PWR_GetPVDLevel(void)\r
+{\r
+  return (uint32_t)(READ_BIT(PWR->CR, PWR_CR_PLS));\r
+}\r
+\r
+/**\r
+  * @brief  Enable Power Voltage Detector\r
+  * @rmtoll CR    PVDE       LL_PWR_EnablePVD\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_PWR_EnablePVD(void)\r
+{\r
+  SET_BIT(PWR->CR, PWR_CR_PVDE);\r
+}\r
+\r
+/**\r
+  * @brief  Disable Power Voltage Detector\r
+  * @rmtoll CR    PVDE       LL_PWR_DisablePVD\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_PWR_DisablePVD(void)\r
+{\r
+  CLEAR_BIT(PWR->CR, PWR_CR_PVDE);\r
+}\r
+\r
+/**\r
+  * @brief  Check if Power Voltage Detector is enabled\r
+  * @rmtoll CR    PVDE       LL_PWR_IsEnabledPVD\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_PWR_IsEnabledPVD(void)\r
+{\r
+  return (READ_BIT(PWR->CR, PWR_CR_PVDE) == (PWR_CR_PVDE));\r
+}\r
+\r
+/**\r
+  * @brief  Enable the WakeUp PINx functionality\r
+  * @rmtoll CSR   EWUP       LL_PWR_EnableWakeUpPin\r
+  * @param  WakeUpPin This parameter can be one of the following values:\r
+  *         @arg @ref LL_PWR_WAKEUP_PIN1\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_PWR_EnableWakeUpPin(uint32_t WakeUpPin)\r
+{\r
+  SET_BIT(PWR->CSR, WakeUpPin);\r
+}\r
+\r
+/**\r
+  * @brief  Disable the WakeUp PINx functionality\r
+  * @rmtoll CSR   EWUP       LL_PWR_DisableWakeUpPin\r
+  * @param  WakeUpPin This parameter can be one of the following values:\r
+  *         @arg @ref LL_PWR_WAKEUP_PIN1\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_PWR_DisableWakeUpPin(uint32_t WakeUpPin)\r
+{\r
+  CLEAR_BIT(PWR->CSR, WakeUpPin);\r
+}\r
+\r
+/**\r
+  * @brief  Check if the WakeUp PINx functionality is enabled\r
+  * @rmtoll CSR   EWUP       LL_PWR_IsEnabledWakeUpPin\r
+  * @param  WakeUpPin This parameter can be one of the following values:\r
+  *         @arg @ref LL_PWR_WAKEUP_PIN1\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_PWR_IsEnabledWakeUpPin(uint32_t WakeUpPin)\r
+{\r
+  return (READ_BIT(PWR->CSR, WakeUpPin) == (WakeUpPin));\r
+}\r
+\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup PWR_LL_EF_FLAG_Management FLAG_Management\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Get Wake-up Flag\r
+  * @rmtoll CSR   WUF       LL_PWR_IsActiveFlag_WU\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU(void)\r
+{\r
+  return (READ_BIT(PWR->CSR, PWR_CSR_WUF) == (PWR_CSR_WUF));\r
+}\r
+\r
+/**\r
+  * @brief  Get Standby Flag\r
+  * @rmtoll CSR   SBF       LL_PWR_IsActiveFlag_SB\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_SB(void)\r
+{\r
+  return (READ_BIT(PWR->CSR, PWR_CSR_SBF) == (PWR_CSR_SBF));\r
+}\r
+\r
+/**\r
+  * @brief  Indicate whether VDD voltage is below the selected PVD threshold\r
+  * @rmtoll CSR   PVDO       LL_PWR_IsActiveFlag_PVDO\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_PVDO(void)\r
+{\r
+  return (READ_BIT(PWR->CSR, PWR_CSR_PVDO) == (PWR_CSR_PVDO));\r
+}\r
+\r
+/**\r
+  * @brief  Clear Standby Flag\r
+  * @rmtoll CR   CSBF       LL_PWR_ClearFlag_SB\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_PWR_ClearFlag_SB(void)\r
+{\r
+  SET_BIT(PWR->CR, PWR_CR_CSBF);\r
+}\r
+\r
+/**\r
+  * @brief  Clear Wake-up Flags\r
+  * @rmtoll CR   CWUF       LL_PWR_ClearFlag_WU\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_PWR_ClearFlag_WU(void)\r
+{\r
+  SET_BIT(PWR->CR, PWR_CR_CWUF);\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#if defined(USE_FULL_LL_DRIVER)\r
+/** @defgroup PWR_LL_EF_Init De-initialization function\r
+  * @{\r
+  */\r
+ErrorStatus LL_PWR_DeInit(void);\r
+/**\r
+  * @}\r
+  */\r
+#endif /* USE_FULL_LL_DRIVER */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* defined(PWR) */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __STM32F1xx_LL_PWR_H */\r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_rcc.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_rcc.h
new file mode 100644 (file)
index 0000000..3ca73fe
--- /dev/null
@@ -0,0 +1,2312 @@
+/**\r
+  ******************************************************************************\r
+  * @file    stm32f1xx_ll_rcc.h\r
+  * @author  MCD Application Team\r
+  * @brief   Header file of RCC LL module.\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+\r
+/* Define to prevent recursive inclusion -------------------------------------*/\r
+#ifndef __STM32F1xx_LL_RCC_H\r
+#define __STM32F1xx_LL_RCC_H\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/* Includes ------------------------------------------------------------------*/\r
+#include "stm32f1xx.h"\r
+\r
+/** @addtogroup STM32F1xx_LL_Driver\r
+  * @{\r
+  */\r
+\r
+#if defined(RCC)\r
+\r
+/** @defgroup RCC_LL RCC\r
+  * @{\r
+  */\r
+\r
+/* Private types -------------------------------------------------------------*/\r
+/* Private variables ---------------------------------------------------------*/\r
+/* Private constants ---------------------------------------------------------*/\r
+/* Private macros ------------------------------------------------------------*/\r
+#if defined(USE_FULL_LL_DRIVER)\r
+/** @defgroup RCC_LL_Private_Macros RCC Private Macros\r
+  * @{\r
+  */\r
+/**\r
+  * @}\r
+  */\r
+#endif /*USE_FULL_LL_DRIVER*/\r
+/* Exported types ------------------------------------------------------------*/\r
+#if defined(USE_FULL_LL_DRIVER)\r
+/** @defgroup RCC_LL_Exported_Types RCC Exported Types\r
+  * @{\r
+  */\r
+\r
+/** @defgroup LL_ES_CLOCK_FREQ Clocks Frequency Structure\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  RCC Clocks Frequency Structure\r
+  */\r
+typedef struct\r
+{\r
+  uint32_t SYSCLK_Frequency;        /*!< SYSCLK clock frequency */\r
+  uint32_t HCLK_Frequency;          /*!< HCLK clock frequency */\r
+  uint32_t PCLK1_Frequency;         /*!< PCLK1 clock frequency */\r
+  uint32_t PCLK2_Frequency;         /*!< PCLK2 clock frequency */\r
+} LL_RCC_ClocksTypeDef;\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+#endif /* USE_FULL_LL_DRIVER */\r
+\r
+/* Exported constants --------------------------------------------------------*/\r
+/** @defgroup RCC_LL_Exported_Constants RCC Exported Constants\r
+  * @{\r
+  */\r
+\r
+/** @defgroup RCC_LL_EC_OSC_VALUES Oscillator Values adaptation\r
+  * @brief    Defines used to adapt values of different oscillators\r
+  * @note     These values could be modified in the user environment according to\r
+  *           HW set-up.\r
+  * @{\r
+  */\r
+#if !defined  (HSE_VALUE)\r
+#define HSE_VALUE    8000000U  /*!< Value of the HSE oscillator in Hz */\r
+#endif /* HSE_VALUE */\r
+\r
+#if !defined  (HSI_VALUE)\r
+#define HSI_VALUE    8000000U  /*!< Value of the HSI oscillator in Hz */\r
+#endif /* HSI_VALUE */\r
+\r
+#if !defined  (LSE_VALUE)\r
+#define LSE_VALUE    32768U    /*!< Value of the LSE oscillator in Hz */\r
+#endif /* LSE_VALUE */\r
+\r
+#if !defined  (LSI_VALUE)\r
+#define LSI_VALUE    40000U    /*!< Value of the LSI oscillator in Hz */\r
+#endif /* LSI_VALUE */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup RCC_LL_EC_CLEAR_FLAG Clear Flags Defines\r
+  * @brief    Flags defines which can be used with LL_RCC_WriteReg function\r
+  * @{\r
+  */\r
+#define LL_RCC_CIR_LSIRDYC                RCC_CIR_LSIRDYC     /*!< LSI Ready Interrupt Clear */\r
+#define LL_RCC_CIR_LSERDYC                RCC_CIR_LSERDYC     /*!< LSE Ready Interrupt Clear */\r
+#define LL_RCC_CIR_HSIRDYC                RCC_CIR_HSIRDYC     /*!< HSI Ready Interrupt Clear */\r
+#define LL_RCC_CIR_HSERDYC                RCC_CIR_HSERDYC     /*!< HSE Ready Interrupt Clear */\r
+#define LL_RCC_CIR_PLLRDYC                RCC_CIR_PLLRDYC     /*!< PLL Ready Interrupt Clear */\r
+#define LL_RCC_CIR_PLL3RDYC               RCC_CIR_PLL3RDYC    /*!< PLL3(PLLI2S) Ready Interrupt Clear */\r
+#define LL_RCC_CIR_PLL2RDYC               RCC_CIR_PLL2RDYC    /*!< PLL2 Ready Interrupt Clear */\r
+#define LL_RCC_CIR_CSSC                   RCC_CIR_CSSC        /*!< Clock Security System Interrupt Clear */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup RCC_LL_EC_GET_FLAG Get Flags Defines\r
+  * @brief    Flags defines which can be used with LL_RCC_ReadReg function\r
+  * @{\r
+  */\r
+#define LL_RCC_CIR_LSIRDYF                RCC_CIR_LSIRDYF     /*!< LSI Ready Interrupt flag */\r
+#define LL_RCC_CIR_LSERDYF                RCC_CIR_LSERDYF     /*!< LSE Ready Interrupt flag */\r
+#define LL_RCC_CIR_HSIRDYF                RCC_CIR_HSIRDYF     /*!< HSI Ready Interrupt flag */\r
+#define LL_RCC_CIR_HSERDYF                RCC_CIR_HSERDYF     /*!< HSE Ready Interrupt flag */\r
+#define LL_RCC_CIR_PLLRDYF                RCC_CIR_PLLRDYF     /*!< PLL Ready Interrupt flag */\r
+#define LL_RCC_CIR_PLL3RDYF               RCC_CIR_PLL3RDYF    /*!< PLL3(PLLI2S) Ready Interrupt flag */\r
+#define LL_RCC_CIR_PLL2RDYF               RCC_CIR_PLL2RDYF    /*!< PLL2 Ready Interrupt flag */\r
+#define LL_RCC_CIR_CSSF                   RCC_CIR_CSSF        /*!< Clock Security System Interrupt flag */\r
+#define LL_RCC_CSR_PINRSTF                RCC_CSR_PINRSTF     /*!< PIN reset flag */\r
+#define LL_RCC_CSR_PORRSTF                RCC_CSR_PORRSTF     /*!< POR/PDR reset flag */\r
+#define LL_RCC_CSR_SFTRSTF                RCC_CSR_SFTRSTF     /*!< Software Reset flag */\r
+#define LL_RCC_CSR_IWDGRSTF               RCC_CSR_IWDGRSTF    /*!< Independent Watchdog reset flag */\r
+#define LL_RCC_CSR_WWDGRSTF               RCC_CSR_WWDGRSTF    /*!< Window watchdog reset flag */\r
+#define LL_RCC_CSR_LPWRRSTF               RCC_CSR_LPWRRSTF    /*!< Low-Power reset flag */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup RCC_LL_EC_IT IT Defines\r
+  * @brief    IT defines which can be used with LL_RCC_ReadReg and  LL_RCC_WriteReg functions\r
+  * @{\r
+  */\r
+#define LL_RCC_CIR_LSIRDYIE               RCC_CIR_LSIRDYIE      /*!< LSI Ready Interrupt Enable */\r
+#define LL_RCC_CIR_LSERDYIE               RCC_CIR_LSERDYIE      /*!< LSE Ready Interrupt Enable */\r
+#define LL_RCC_CIR_HSIRDYIE               RCC_CIR_HSIRDYIE      /*!< HSI Ready Interrupt Enable */\r
+#define LL_RCC_CIR_HSERDYIE               RCC_CIR_HSERDYIE      /*!< HSE Ready Interrupt Enable */\r
+#define LL_RCC_CIR_PLLRDYIE               RCC_CIR_PLLRDYIE      /*!< PLL Ready Interrupt Enable */\r
+#define LL_RCC_CIR_PLL3RDYIE              RCC_CIR_PLL3RDYIE     /*!< PLL3(PLLI2S) Ready Interrupt Enable */\r
+#define LL_RCC_CIR_PLL2RDYIE              RCC_CIR_PLL2RDYIE     /*!< PLL2 Ready Interrupt Enable */\r
+/**\r
+  * @}\r
+  */\r
+\r
+#if defined(RCC_CFGR2_PREDIV2)\r
+/** @defgroup RCC_LL_EC_HSE_PREDIV2_DIV HSE PREDIV2 Division factor\r
+  * @{\r
+  */\r
+#define LL_RCC_HSE_PREDIV2_DIV_1           RCC_CFGR2_PREDIV2_DIV1   /*!< PREDIV2 input clock not divided */\r
+#define LL_RCC_HSE_PREDIV2_DIV_2           RCC_CFGR2_PREDIV2_DIV2   /*!< PREDIV2 input clock divided by 2 */\r
+#define LL_RCC_HSE_PREDIV2_DIV_3           RCC_CFGR2_PREDIV2_DIV3   /*!< PREDIV2 input clock divided by 3 */\r
+#define LL_RCC_HSE_PREDIV2_DIV_4           RCC_CFGR2_PREDIV2_DIV4   /*!< PREDIV2 input clock divided by 4 */\r
+#define LL_RCC_HSE_PREDIV2_DIV_5           RCC_CFGR2_PREDIV2_DIV5   /*!< PREDIV2 input clock divided by 5 */\r
+#define LL_RCC_HSE_PREDIV2_DIV_6           RCC_CFGR2_PREDIV2_DIV6   /*!< PREDIV2 input clock divided by 6 */\r
+#define LL_RCC_HSE_PREDIV2_DIV_7           RCC_CFGR2_PREDIV2_DIV7   /*!< PREDIV2 input clock divided by 7 */\r
+#define LL_RCC_HSE_PREDIV2_DIV_8           RCC_CFGR2_PREDIV2_DIV8   /*!< PREDIV2 input clock divided by 8 */\r
+#define LL_RCC_HSE_PREDIV2_DIV_9           RCC_CFGR2_PREDIV2_DIV9   /*!< PREDIV2 input clock divided by 9 */\r
+#define LL_RCC_HSE_PREDIV2_DIV_10          RCC_CFGR2_PREDIV2_DIV10  /*!< PREDIV2 input clock divided by 10 */\r
+#define LL_RCC_HSE_PREDIV2_DIV_11          RCC_CFGR2_PREDIV2_DIV11  /*!< PREDIV2 input clock divided by 11 */\r
+#define LL_RCC_HSE_PREDIV2_DIV_12          RCC_CFGR2_PREDIV2_DIV12  /*!< PREDIV2 input clock divided by 12 */\r
+#define LL_RCC_HSE_PREDIV2_DIV_13          RCC_CFGR2_PREDIV2_DIV13  /*!< PREDIV2 input clock divided by 13 */\r
+#define LL_RCC_HSE_PREDIV2_DIV_14          RCC_CFGR2_PREDIV2_DIV14  /*!< PREDIV2 input clock divided by 14 */\r
+#define LL_RCC_HSE_PREDIV2_DIV_15          RCC_CFGR2_PREDIV2_DIV15  /*!< PREDIV2 input clock divided by 15 */\r
+#define LL_RCC_HSE_PREDIV2_DIV_16          RCC_CFGR2_PREDIV2_DIV16  /*!< PREDIV2 input clock divided by 16 */\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* RCC_CFGR2_PREDIV2 */\r
+\r
+/** @defgroup RCC_LL_EC_SYS_CLKSOURCE  System clock switch\r
+  * @{\r
+  */\r
+#define LL_RCC_SYS_CLKSOURCE_HSI           RCC_CFGR_SW_HSI    /*!< HSI selection as system clock */\r
+#define LL_RCC_SYS_CLKSOURCE_HSE           RCC_CFGR_SW_HSE    /*!< HSE selection as system clock */\r
+#define LL_RCC_SYS_CLKSOURCE_PLL           RCC_CFGR_SW_PLL    /*!< PLL selection as system clock */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup RCC_LL_EC_SYS_CLKSOURCE_STATUS  System clock switch status\r
+  * @{\r
+  */\r
+#define LL_RCC_SYS_CLKSOURCE_STATUS_HSI    RCC_CFGR_SWS_HSI   /*!< HSI used as system clock */\r
+#define LL_RCC_SYS_CLKSOURCE_STATUS_HSE    RCC_CFGR_SWS_HSE   /*!< HSE used as system clock */\r
+#define LL_RCC_SYS_CLKSOURCE_STATUS_PLL    RCC_CFGR_SWS_PLL   /*!< PLL used as system clock */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup RCC_LL_EC_SYSCLK_DIV  AHB prescaler\r
+  * @{\r
+  */\r
+#define LL_RCC_SYSCLK_DIV_1                RCC_CFGR_HPRE_DIV1   /*!< SYSCLK not divided */\r
+#define LL_RCC_SYSCLK_DIV_2                RCC_CFGR_HPRE_DIV2   /*!< SYSCLK divided by 2 */\r
+#define LL_RCC_SYSCLK_DIV_4                RCC_CFGR_HPRE_DIV4   /*!< SYSCLK divided by 4 */\r
+#define LL_RCC_SYSCLK_DIV_8                RCC_CFGR_HPRE_DIV8   /*!< SYSCLK divided by 8 */\r
+#define LL_RCC_SYSCLK_DIV_16               RCC_CFGR_HPRE_DIV16  /*!< SYSCLK divided by 16 */\r
+#define LL_RCC_SYSCLK_DIV_64               RCC_CFGR_HPRE_DIV64  /*!< SYSCLK divided by 64 */\r
+#define LL_RCC_SYSCLK_DIV_128              RCC_CFGR_HPRE_DIV128 /*!< SYSCLK divided by 128 */\r
+#define LL_RCC_SYSCLK_DIV_256              RCC_CFGR_HPRE_DIV256 /*!< SYSCLK divided by 256 */\r
+#define LL_RCC_SYSCLK_DIV_512              RCC_CFGR_HPRE_DIV512 /*!< SYSCLK divided by 512 */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup RCC_LL_EC_APB1_DIV  APB low-speed prescaler (APB1)\r
+  * @{\r
+  */\r
+#define LL_RCC_APB1_DIV_1                  RCC_CFGR_PPRE1_DIV1  /*!< HCLK not divided */\r
+#define LL_RCC_APB1_DIV_2                  RCC_CFGR_PPRE1_DIV2  /*!< HCLK divided by 2 */\r
+#define LL_RCC_APB1_DIV_4                  RCC_CFGR_PPRE1_DIV4  /*!< HCLK divided by 4 */\r
+#define LL_RCC_APB1_DIV_8                  RCC_CFGR_PPRE1_DIV8  /*!< HCLK divided by 8 */\r
+#define LL_RCC_APB1_DIV_16                 RCC_CFGR_PPRE1_DIV16 /*!< HCLK divided by 16 */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup RCC_LL_EC_APB2_DIV  APB high-speed prescaler (APB2)\r
+  * @{\r
+  */\r
+#define LL_RCC_APB2_DIV_1                  RCC_CFGR_PPRE2_DIV1  /*!< HCLK not divided */\r
+#define LL_RCC_APB2_DIV_2                  RCC_CFGR_PPRE2_DIV2  /*!< HCLK divided by 2 */\r
+#define LL_RCC_APB2_DIV_4                  RCC_CFGR_PPRE2_DIV4  /*!< HCLK divided by 4 */\r
+#define LL_RCC_APB2_DIV_8                  RCC_CFGR_PPRE2_DIV8  /*!< HCLK divided by 8 */\r
+#define LL_RCC_APB2_DIV_16                 RCC_CFGR_PPRE2_DIV16 /*!< HCLK divided by 16 */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup RCC_LL_EC_MCO1SOURCE  MCO1 SOURCE selection\r
+  * @{\r
+  */\r
+#define LL_RCC_MCO1SOURCE_NOCLOCK          RCC_CFGR_MCO_NOCLOCK      /*!< MCO output disabled, no clock on MCO */\r
+#define LL_RCC_MCO1SOURCE_SYSCLK           RCC_CFGR_MCO_SYSCLK       /*!< SYSCLK selection as MCO source */\r
+#define LL_RCC_MCO1SOURCE_HSI              RCC_CFGR_MCO_HSI          /*!< HSI selection as MCO source */\r
+#define LL_RCC_MCO1SOURCE_HSE              RCC_CFGR_MCO_HSE          /*!< HSE selection as MCO source */\r
+#define LL_RCC_MCO1SOURCE_PLLCLK_DIV_2     RCC_CFGR_MCO_PLLCLK_DIV2  /*!< PLL clock divided by 2*/\r
+#if defined(RCC_CFGR_MCO_PLL2CLK)\r
+#define LL_RCC_MCO1SOURCE_PLL2CLK          RCC_CFGR_MCO_PLL2CLK      /*!< PLL2 clock selected as MCO source*/\r
+#endif /* RCC_CFGR_MCO_PLL2CLK */\r
+#if defined(RCC_CFGR_MCO_PLL3CLK_DIV2)\r
+#define LL_RCC_MCO1SOURCE_PLLI2SCLK_DIV2   RCC_CFGR_MCO_PLL3CLK_DIV2 /*!< PLLI2S clock divided by 2 selected as MCO source*/\r
+#endif /* RCC_CFGR_MCO_PLL3CLK_DIV2 */\r
+#if defined(RCC_CFGR_MCO_EXT_HSE)\r
+#define LL_RCC_MCO1SOURCE_EXT_HSE          RCC_CFGR_MCO_EXT_HSE      /*!< XT1 external 3-25 MHz oscillator clock selected as MCO source */\r
+#endif /* RCC_CFGR_MCO_EXT_HSE */\r
+#if defined(RCC_CFGR_MCO_PLL3CLK)\r
+#define LL_RCC_MCO1SOURCE_PLLI2SCLK        RCC_CFGR_MCO_PLL3CLK      /*!< PLLI2S clock selected as MCO source */\r
+#endif /* RCC_CFGR_MCO_PLL3CLK */\r
+/**\r
+  * @}\r
+  */\r
+\r
+#if defined(USE_FULL_LL_DRIVER)\r
+/** @defgroup RCC_LL_EC_PERIPH_FREQUENCY Peripheral clock frequency\r
+  * @{\r
+  */\r
+#define LL_RCC_PERIPH_FREQUENCY_NO         0x00000000U      /*!< No clock enabled for the peripheral            */\r
+#define LL_RCC_PERIPH_FREQUENCY_NA         0xFFFFFFFFU      /*!< Frequency cannot be provided as external clock */\r
+/**\r
+  * @}\r
+  */\r
+#endif /* USE_FULL_LL_DRIVER */\r
+\r
+#if defined(RCC_CFGR2_I2S2SRC)\r
+/** @defgroup RCC_LL_EC_I2S2CLKSOURCE Peripheral I2S clock source selection\r
+  * @{\r
+  */\r
+#define LL_RCC_I2S2_CLKSOURCE_SYSCLK        RCC_CFGR2_I2S2SRC                                          /*!< System clock (SYSCLK) selected as I2S2 clock entry */\r
+#define LL_RCC_I2S2_CLKSOURCE_PLLI2S_VCO    (uint32_t)(RCC_CFGR2_I2S2SRC | (RCC_CFGR2_I2S2SRC >> 16U)) /*!< PLLI2S VCO clock selected as I2S2 clock entry */\r
+#define LL_RCC_I2S3_CLKSOURCE_SYSCLK        RCC_CFGR2_I2S3SRC                                          /*!< System clock (SYSCLK) selected as I2S3 clock entry */\r
+#define LL_RCC_I2S3_CLKSOURCE_PLLI2S_VCO    (uint32_t)(RCC_CFGR2_I2S3SRC | (RCC_CFGR2_I2S3SRC >> 16U)) /*!< PLLI2S VCO clock selected as I2S3 clock entry */\r
+/**\r
+  * @}\r
+  */\r
+#endif /* RCC_CFGR2_I2S2SRC */\r
+\r
+#if defined(USB_OTG_FS) || defined(USB)\r
+/** @defgroup RCC_LL_EC_USB_CLKSOURCE Peripheral USB clock source selection\r
+  * @{\r
+  */\r
+#if defined(RCC_CFGR_USBPRE)\r
+#define LL_RCC_USB_CLKSOURCE_PLL             RCC_CFGR_USBPRE        /*!< PLL clock is not divided */\r
+#define LL_RCC_USB_CLKSOURCE_PLL_DIV_1_5     0x00000000U            /*!< PLL clock is divided by 1.5 */\r
+#endif /*RCC_CFGR_USBPRE*/\r
+#if defined(RCC_CFGR_OTGFSPRE)\r
+#define LL_RCC_USB_CLKSOURCE_PLL_DIV_2       RCC_CFGR_OTGFSPRE      /*!< PLL clock is divided by 2 */\r
+#define LL_RCC_USB_CLKSOURCE_PLL_DIV_3       0x00000000U            /*!< PLL clock is divided by 3 */\r
+#endif /*RCC_CFGR_OTGFSPRE*/\r
+/**\r
+  * @}\r
+  */\r
+#endif /* USB_OTG_FS || USB */\r
+\r
+/** @defgroup RCC_LL_EC_ADC_CLKSOURCE_PCLK2 Peripheral ADC clock source selection\r
+  * @{\r
+  */\r
+#define LL_RCC_ADC_CLKSRC_PCLK2_DIV_2    RCC_CFGR_ADCPRE_DIV2 /*ADC prescaler PCLK2 divided by 2*/\r
+#define LL_RCC_ADC_CLKSRC_PCLK2_DIV_4    RCC_CFGR_ADCPRE_DIV4 /*ADC prescaler PCLK2 divided by 4*/\r
+#define LL_RCC_ADC_CLKSRC_PCLK2_DIV_6    RCC_CFGR_ADCPRE_DIV6 /*ADC prescaler PCLK2 divided by 6*/\r
+#define LL_RCC_ADC_CLKSRC_PCLK2_DIV_8    RCC_CFGR_ADCPRE_DIV8 /*ADC prescaler PCLK2 divided by 8*/\r
+/**\r
+  * @}\r
+  */\r
+\r
+#if defined(RCC_CFGR2_I2S2SRC)\r
+/** @defgroup RCC_LL_EC_I2S2 Peripheral I2S get clock source\r
+  * @{\r
+  */\r
+#define LL_RCC_I2S2_CLKSOURCE              RCC_CFGR2_I2S2SRC       /*!< I2S2 Clock source selection */\r
+#define LL_RCC_I2S3_CLKSOURCE              RCC_CFGR2_I2S3SRC       /*!< I2S3 Clock source selection */\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* RCC_CFGR2_I2S2SRC */\r
+\r
+#if defined(USB_OTG_FS) || defined(USB)\r
+/** @defgroup RCC_LL_EC_USB Peripheral USB get clock source\r
+  * @{\r
+  */\r
+#define LL_RCC_USB_CLKSOURCE               0x00400000U     /*!< USB Clock source selection */\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* USB_OTG_FS || USB */\r
+\r
+/** @defgroup RCC_LL_EC_ADC Peripheral ADC get clock source\r
+  * @{\r
+  */\r
+#define LL_RCC_ADC_CLKSOURCE               RCC_CFGR_ADCPRE /*!< ADC Clock source selection */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup RCC_LL_EC_RTC_CLKSOURCE  RTC clock source selection\r
+  * @{\r
+  */\r
+#define LL_RCC_RTC_CLKSOURCE_NONE          0x00000000U             /*!< No clock used as RTC clock */\r
+#define LL_RCC_RTC_CLKSOURCE_LSE           RCC_BDCR_RTCSEL_0       /*!< LSE oscillator clock used as RTC clock */\r
+#define LL_RCC_RTC_CLKSOURCE_LSI           RCC_BDCR_RTCSEL_1       /*!< LSI oscillator clock used as RTC clock */\r
+#define LL_RCC_RTC_CLKSOURCE_HSE_DIV128    RCC_BDCR_RTCSEL         /*!< HSE oscillator clock divided by 128 used as RTC clock */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup RCC_LL_EC_PLL_MUL PLL Multiplicator factor\r
+  * @{\r
+  */\r
+#if defined(RCC_CFGR_PLLMULL2)\r
+#define LL_RCC_PLL_MUL_2                   RCC_CFGR_PLLMULL2  /*!< PLL input clock*2 */\r
+#endif /*RCC_CFGR_PLLMULL2*/\r
+#if defined(RCC_CFGR_PLLMULL3)\r
+#define LL_RCC_PLL_MUL_3                   RCC_CFGR_PLLMULL3  /*!< PLL input clock*3 */\r
+#endif /*RCC_CFGR_PLLMULL3*/\r
+#define LL_RCC_PLL_MUL_4                   RCC_CFGR_PLLMULL4  /*!< PLL input clock*4 */\r
+#define LL_RCC_PLL_MUL_5                   RCC_CFGR_PLLMULL5  /*!< PLL input clock*5 */\r
+#define LL_RCC_PLL_MUL_6                   RCC_CFGR_PLLMULL6  /*!< PLL input clock*6 */\r
+#define LL_RCC_PLL_MUL_7                   RCC_CFGR_PLLMULL7  /*!< PLL input clock*7 */\r
+#define LL_RCC_PLL_MUL_8                   RCC_CFGR_PLLMULL8  /*!< PLL input clock*8 */\r
+#define LL_RCC_PLL_MUL_9                   RCC_CFGR_PLLMULL9  /*!< PLL input clock*9 */\r
+#if defined(RCC_CFGR_PLLMULL6_5)\r
+#define LL_RCC_PLL_MUL_6_5                 RCC_CFGR_PLLMULL6_5 /*!< PLL input clock*6 */\r
+#else\r
+#define LL_RCC_PLL_MUL_10                  RCC_CFGR_PLLMULL10  /*!< PLL input clock*10 */\r
+#define LL_RCC_PLL_MUL_11                  RCC_CFGR_PLLMULL11  /*!< PLL input clock*11 */\r
+#define LL_RCC_PLL_MUL_12                  RCC_CFGR_PLLMULL12  /*!< PLL input clock*12 */\r
+#define LL_RCC_PLL_MUL_13                  RCC_CFGR_PLLMULL13  /*!< PLL input clock*13 */\r
+#define LL_RCC_PLL_MUL_14                  RCC_CFGR_PLLMULL14  /*!< PLL input clock*14 */\r
+#define LL_RCC_PLL_MUL_15                  RCC_CFGR_PLLMULL15  /*!< PLL input clock*15 */\r
+#define LL_RCC_PLL_MUL_16                  RCC_CFGR_PLLMULL16  /*!< PLL input clock*16 */\r
+#endif /*RCC_CFGR_PLLMULL6_5*/\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup RCC_LL_EC_PLLSOURCE PLL SOURCE\r
+  * @{\r
+  */\r
+#define LL_RCC_PLLSOURCE_HSI_DIV_2         0x00000000U                                    /*!< HSI clock divided by 2 selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_HSE               RCC_CFGR_PLLSRC                                /*!< HSE/PREDIV1 clock selected as PLL entry clock source */\r
+#if defined(RCC_CFGR2_PREDIV1SRC)\r
+#define LL_RCC_PLLSOURCE_PLL2              (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/PREDIV1 clock selected as PLL entry clock source */\r
+#endif /*RCC_CFGR2_PREDIV1SRC*/\r
+\r
+#if defined(RCC_CFGR2_PREDIV1)\r
+#define LL_RCC_PLLSOURCE_HSE_DIV_1         (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV1)    /*!< HSE/1 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_HSE_DIV_2         (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV2)    /*!< HSE/2 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_HSE_DIV_3         (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV3)    /*!< HSE/3 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_HSE_DIV_4         (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV4)    /*!< HSE/4 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_HSE_DIV_5         (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV5)    /*!< HSE/5 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_HSE_DIV_6         (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV6)    /*!< HSE/6 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_HSE_DIV_7         (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV7)    /*!< HSE/7 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_HSE_DIV_8         (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV8)    /*!< HSE/8 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_HSE_DIV_9         (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV9)    /*!< HSE/9 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_HSE_DIV_10        (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV10)   /*!< HSE/10 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_HSE_DIV_11        (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV11)   /*!< HSE/11 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_HSE_DIV_12        (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV12)   /*!< HSE/12 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_HSE_DIV_13        (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV13)   /*!< HSE/13 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_HSE_DIV_14        (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV14)   /*!< HSE/14 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_HSE_DIV_15        (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV15)   /*!< HSE/15 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_HSE_DIV_16        (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV16)   /*!< HSE/16 clock selected as PLL entry clock source */\r
+#if defined(RCC_CFGR2_PREDIV1SRC)\r
+#define LL_RCC_PLLSOURCE_PLL2_DIV_1        (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV1 | RCC_CFGR2_PREDIV1SRC << 4U)    /*!< PLL2/1 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_PLL2_DIV_2        (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV2 | RCC_CFGR2_PREDIV1SRC << 4U)    /*!< PLL2/2 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_PLL2_DIV_3        (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV3 | RCC_CFGR2_PREDIV1SRC << 4U)    /*!< PLL2/3 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_PLL2_DIV_4        (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV4 | RCC_CFGR2_PREDIV1SRC << 4U)    /*!< PLL2/4 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_PLL2_DIV_5        (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV5 | RCC_CFGR2_PREDIV1SRC << 4U)    /*!< PLL2/5 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_PLL2_DIV_6        (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV6 | RCC_CFGR2_PREDIV1SRC << 4U)    /*!< PLL2/6 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_PLL2_DIV_7        (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV7 | RCC_CFGR2_PREDIV1SRC << 4U)    /*!< PLL2/7 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_PLL2_DIV_8        (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV8 | RCC_CFGR2_PREDIV1SRC << 4U)    /*!< PLL2/8 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_PLL2_DIV_9        (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV9 | RCC_CFGR2_PREDIV1SRC << 4U)    /*!< PLL2/9 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_PLL2_DIV_10       (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV10 | RCC_CFGR2_PREDIV1SRC << 4U)   /*!< PLL2/10 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_PLL2_DIV_11       (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV11 | RCC_CFGR2_PREDIV1SRC << 4U)   /*!< PLL2/11 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_PLL2_DIV_12       (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV12 | RCC_CFGR2_PREDIV1SRC << 4U)   /*!< PLL2/12 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_PLL2_DIV_13       (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV13 | RCC_CFGR2_PREDIV1SRC << 4U)   /*!< PLL2/13 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_PLL2_DIV_14       (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV14 | RCC_CFGR2_PREDIV1SRC << 4U)   /*!< PLL2/14 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_PLL2_DIV_15       (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV15 | RCC_CFGR2_PREDIV1SRC << 4U)   /*!< PLL2/15 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_PLL2_DIV_16       (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV16 | RCC_CFGR2_PREDIV1SRC << 4U)   /*!< PLL2/16 clock selected as PLL entry clock source */\r
+#endif /*RCC_CFGR2_PREDIV1SRC*/\r
+#else\r
+#define LL_RCC_PLLSOURCE_HSE_DIV_1         (RCC_CFGR_PLLSRC | 0x00000000U)               /*!< HSE/1 clock selected as PLL entry clock source */\r
+#define LL_RCC_PLLSOURCE_HSE_DIV_2         (RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE)         /*!< HSE/2 clock selected as PLL entry clock source */\r
+#endif /*RCC_CFGR2_PREDIV1*/\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup RCC_LL_EC_PREDIV_DIV PREDIV Division factor\r
+  * @{\r
+  */\r
+#if defined(RCC_CFGR2_PREDIV1)\r
+#define LL_RCC_PREDIV_DIV_1                RCC_CFGR2_PREDIV1_DIV1   /*!< PREDIV1 input clock not divided */\r
+#define LL_RCC_PREDIV_DIV_2                RCC_CFGR2_PREDIV1_DIV2   /*!< PREDIV1 input clock divided by 2 */\r
+#define LL_RCC_PREDIV_DIV_3                RCC_CFGR2_PREDIV1_DIV3   /*!< PREDIV1 input clock divided by 3 */\r
+#define LL_RCC_PREDIV_DIV_4                RCC_CFGR2_PREDIV1_DIV4   /*!< PREDIV1 input clock divided by 4 */\r
+#define LL_RCC_PREDIV_DIV_5                RCC_CFGR2_PREDIV1_DIV5   /*!< PREDIV1 input clock divided by 5 */\r
+#define LL_RCC_PREDIV_DIV_6                RCC_CFGR2_PREDIV1_DIV6   /*!< PREDIV1 input clock divided by 6 */\r
+#define LL_RCC_PREDIV_DIV_7                RCC_CFGR2_PREDIV1_DIV7   /*!< PREDIV1 input clock divided by 7 */\r
+#define LL_RCC_PREDIV_DIV_8                RCC_CFGR2_PREDIV1_DIV8   /*!< PREDIV1 input clock divided by 8 */\r
+#define LL_RCC_PREDIV_DIV_9                RCC_CFGR2_PREDIV1_DIV9   /*!< PREDIV1 input clock divided by 9 */\r
+#define LL_RCC_PREDIV_DIV_10               RCC_CFGR2_PREDIV1_DIV10  /*!< PREDIV1 input clock divided by 10 */\r
+#define LL_RCC_PREDIV_DIV_11               RCC_CFGR2_PREDIV1_DIV11  /*!< PREDIV1 input clock divided by 11 */\r
+#define LL_RCC_PREDIV_DIV_12               RCC_CFGR2_PREDIV1_DIV12  /*!< PREDIV1 input clock divided by 12 */\r
+#define LL_RCC_PREDIV_DIV_13               RCC_CFGR2_PREDIV1_DIV13  /*!< PREDIV1 input clock divided by 13 */\r
+#define LL_RCC_PREDIV_DIV_14               RCC_CFGR2_PREDIV1_DIV14  /*!< PREDIV1 input clock divided by 14 */\r
+#define LL_RCC_PREDIV_DIV_15               RCC_CFGR2_PREDIV1_DIV15  /*!< PREDIV1 input clock divided by 15 */\r
+#define LL_RCC_PREDIV_DIV_16               RCC_CFGR2_PREDIV1_DIV16  /*!< PREDIV1 input clock divided by 16 */\r
+#else\r
+#define LL_RCC_PREDIV_DIV_1                0x00000000U              /*!< HSE divider clock clock not divided */\r
+#define LL_RCC_PREDIV_DIV_2                RCC_CFGR_PLLXTPRE        /*!< HSE divider clock divided by 2 for PLL entry */\r
+#endif /*RCC_CFGR2_PREDIV1*/\r
+/**\r
+  * @}\r
+  */\r
+\r
+#if defined(RCC_PLLI2S_SUPPORT)\r
+/** @defgroup RCC_LL_EC_PLLI2S_MUL PLLI2S MUL\r
+  * @{\r
+  */\r
+#define LL_RCC_PLLI2S_MUL_8                RCC_CFGR2_PLL3MUL8   /*!< PLLI2S input clock * 8 */\r
+#define LL_RCC_PLLI2S_MUL_9                RCC_CFGR2_PLL3MUL9   /*!< PLLI2S input clock * 9 */\r
+#define LL_RCC_PLLI2S_MUL_10               RCC_CFGR2_PLL3MUL10  /*!< PLLI2S input clock * 10 */\r
+#define LL_RCC_PLLI2S_MUL_11               RCC_CFGR2_PLL3MUL11  /*!< PLLI2S input clock * 11 */\r
+#define LL_RCC_PLLI2S_MUL_12               RCC_CFGR2_PLL3MUL12  /*!< PLLI2S input clock * 12 */\r
+#define LL_RCC_PLLI2S_MUL_13               RCC_CFGR2_PLL3MUL13  /*!< PLLI2S input clock * 13 */\r
+#define LL_RCC_PLLI2S_MUL_14               RCC_CFGR2_PLL3MUL14  /*!< PLLI2S input clock * 14 */\r
+#define LL_RCC_PLLI2S_MUL_16               RCC_CFGR2_PLL3MUL16  /*!< PLLI2S input clock * 16 */\r
+#define LL_RCC_PLLI2S_MUL_20               RCC_CFGR2_PLL3MUL20  /*!< PLLI2S input clock * 20 */\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* RCC_PLLI2S_SUPPORT */\r
+\r
+#if defined(RCC_PLL2_SUPPORT)\r
+/** @defgroup RCC_LL_EC_PLL2_MUL PLL2 MUL\r
+  * @{\r
+  */\r
+#define LL_RCC_PLL2_MUL_8                  RCC_CFGR2_PLL2MUL8   /*!< PLL2 input clock * 8 */\r
+#define LL_RCC_PLL2_MUL_9                  RCC_CFGR2_PLL2MUL9   /*!< PLL2 input clock * 9 */\r
+#define LL_RCC_PLL2_MUL_10                 RCC_CFGR2_PLL2MUL10  /*!< PLL2 input clock * 10 */\r
+#define LL_RCC_PLL2_MUL_11                 RCC_CFGR2_PLL2MUL11  /*!< PLL2 input clock * 11 */\r
+#define LL_RCC_PLL2_MUL_12                 RCC_CFGR2_PLL2MUL12  /*!< PLL2 input clock * 12 */\r
+#define LL_RCC_PLL2_MUL_13                 RCC_CFGR2_PLL2MUL13  /*!< PLL2 input clock * 13 */\r
+#define LL_RCC_PLL2_MUL_14                 RCC_CFGR2_PLL2MUL14  /*!< PLL2 input clock * 14 */\r
+#define LL_RCC_PLL2_MUL_16                 RCC_CFGR2_PLL2MUL16  /*!< PLL2 input clock * 16 */\r
+#define LL_RCC_PLL2_MUL_20                 RCC_CFGR2_PLL2MUL20  /*!< PLL2 input clock * 20 */\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* RCC_PLL2_SUPPORT */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Exported macro ------------------------------------------------------------*/\r
+/** @defgroup RCC_LL_Exported_Macros RCC Exported Macros\r
+  * @{\r
+  */\r
+\r
+/** @defgroup RCC_LL_EM_WRITE_READ Common Write and read registers Macros\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Write a value in RCC register\r
+  * @param  __REG__ Register to be written\r
+  * @param  __VALUE__ Value to be written in the register\r
+  * @retval None\r
+  */\r
+#define LL_RCC_WriteReg(__REG__, __VALUE__) WRITE_REG(RCC->__REG__, (__VALUE__))\r
+\r
+/**\r
+  * @brief  Read a value in RCC register\r
+  * @param  __REG__ Register to be read\r
+  * @retval Register value\r
+  */\r
+#define LL_RCC_ReadReg(__REG__) READ_REG(RCC->__REG__)\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup RCC_LL_EM_CALC_FREQ Calculate frequencies\r
+  * @{\r
+  */\r
+\r
+#if defined(RCC_CFGR_PLLMULL6_5)\r
+/**\r
+  * @brief  Helper macro to calculate the PLLCLK frequency\r
+  * @note ex: @ref __LL_RCC_CALC_PLLCLK_FREQ (HSE_VALUE / (@ref LL_RCC_PLL_GetPrediv () + 1), @ref LL_RCC_PLL_GetMultiplicator());\r
+  * @param  __INPUTFREQ__ PLL Input frequency (based on HSE div Prediv1 / HSI div 2 / PLL2 div Prediv1)\r
+  * @param  __PLLMUL__: This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_PLL_MUL_4\r
+  *         @arg @ref LL_RCC_PLL_MUL_5\r
+  *         @arg @ref LL_RCC_PLL_MUL_6\r
+  *         @arg @ref LL_RCC_PLL_MUL_7\r
+  *         @arg @ref LL_RCC_PLL_MUL_8\r
+  *         @arg @ref LL_RCC_PLL_MUL_9\r
+  *         @arg @ref LL_RCC_PLL_MUL_6_5\r
+  * @retval PLL clock frequency (in Hz)\r
+  */\r
+#define __LL_RCC_CALC_PLLCLK_FREQ(__INPUTFREQ__, __PLLMUL__) \\r
+          (((__PLLMUL__) != RCC_CFGR_PLLMULL6_5) ? \\r
+              ((__INPUTFREQ__) * ((((__PLLMUL__) & RCC_CFGR_PLLMULL) >> RCC_CFGR_PLLMULL_Pos) + 2U)) :\\r
+              (((__INPUTFREQ__) * 13U) / 2U))\r
+\r
+#else\r
+/**\r
+  * @brief  Helper macro to calculate the PLLCLK frequency\r
+  * @note ex: @ref __LL_RCC_CALC_PLLCLK_FREQ (HSE_VALUE / (@ref LL_RCC_PLL_GetPrediv () + 1), @ref LL_RCC_PLL_GetMultiplicator ());\r
+  * @param  __INPUTFREQ__ PLL Input frequency (based on HSE div Prediv1 or div 2 / HSI div 2)\r
+  * @param  __PLLMUL__: This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_PLL_MUL_2\r
+  *         @arg @ref LL_RCC_PLL_MUL_3\r
+  *         @arg @ref LL_RCC_PLL_MUL_4\r
+  *         @arg @ref LL_RCC_PLL_MUL_5\r
+  *         @arg @ref LL_RCC_PLL_MUL_6\r
+  *         @arg @ref LL_RCC_PLL_MUL_7\r
+  *         @arg @ref LL_RCC_PLL_MUL_8\r
+  *         @arg @ref LL_RCC_PLL_MUL_9\r
+  *         @arg @ref LL_RCC_PLL_MUL_10\r
+  *         @arg @ref LL_RCC_PLL_MUL_11\r
+  *         @arg @ref LL_RCC_PLL_MUL_12\r
+  *         @arg @ref LL_RCC_PLL_MUL_13\r
+  *         @arg @ref LL_RCC_PLL_MUL_14\r
+  *         @arg @ref LL_RCC_PLL_MUL_15\r
+  *         @arg @ref LL_RCC_PLL_MUL_16\r
+  * @retval PLL clock frequency (in Hz)\r
+  */\r
+#define __LL_RCC_CALC_PLLCLK_FREQ(__INPUTFREQ__, __PLLMUL__) ((__INPUTFREQ__) * (((__PLLMUL__) >> RCC_CFGR_PLLMULL_Pos) + 2U))\r
+#endif /* RCC_CFGR_PLLMULL6_5 */\r
+\r
+#if defined(RCC_PLLI2S_SUPPORT)\r
+/**\r
+  * @brief  Helper macro to calculate the PLLI2S frequency\r
+  * @note ex: @ref __LL_RCC_CALC_PLLI2SCLK_FREQ (HSE_VALUE, @ref LL_RCC_PLLI2S_GetMultiplicator (), @ref LL_RCC_HSE_GetPrediv2 ());\r
+  * @param  __INPUTFREQ__ PLLI2S Input frequency (based on HSE value)\r
+  * @param  __PLLI2SMUL__: This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_8\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_9\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_10\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_11\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_12\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_13\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_14\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_16\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_20\r
+  * @param  __PLLI2SDIV__: This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_1\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_2\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_3\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_4\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_5\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_6\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_7\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_8\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_9\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_10\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_11\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_12\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_13\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_14\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_15\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_16\r
+  * @retval PLLI2S clock frequency (in Hz)\r
+  */\r
+#define __LL_RCC_CALC_PLLI2SCLK_FREQ(__INPUTFREQ__, __PLLI2SMUL__, __PLLI2SDIV__) (((__INPUTFREQ__) * (((__PLLI2SMUL__) >> RCC_CFGR2_PLL3MUL_Pos) + 2U)) / (((__PLLI2SDIV__) >> RCC_CFGR2_PREDIV2_Pos) + 1U))\r
+#endif /* RCC_PLLI2S_SUPPORT */\r
+\r
+#if defined(RCC_PLL2_SUPPORT)\r
+/**\r
+  * @brief  Helper macro to calculate the PLL2 frequency\r
+  * @note ex: @ref __LL_RCC_CALC_PLL2CLK_FREQ (HSE_VALUE, @ref LL_RCC_PLL2_GetMultiplicator (), @ref LL_RCC_HSE_GetPrediv2 ());\r
+  * @param  __INPUTFREQ__ PLL2 Input frequency (based on HSE value)\r
+  * @param  __PLL2MUL__: This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_PLL2_MUL_8\r
+  *         @arg @ref LL_RCC_PLL2_MUL_9\r
+  *         @arg @ref LL_RCC_PLL2_MUL_10\r
+  *         @arg @ref LL_RCC_PLL2_MUL_11\r
+  *         @arg @ref LL_RCC_PLL2_MUL_12\r
+  *         @arg @ref LL_RCC_PLL2_MUL_13\r
+  *         @arg @ref LL_RCC_PLL2_MUL_14\r
+  *         @arg @ref LL_RCC_PLL2_MUL_16\r
+  *         @arg @ref LL_RCC_PLL2_MUL_20\r
+  * @param  __PLL2DIV__: This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_1\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_2\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_3\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_4\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_5\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_6\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_7\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_8\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_9\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_10\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_11\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_12\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_13\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_14\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_15\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_16\r
+  * @retval PLL2 clock frequency (in Hz)\r
+  */\r
+#define __LL_RCC_CALC_PLL2CLK_FREQ(__INPUTFREQ__, __PLL2MUL__, __PLL2DIV__) (((__INPUTFREQ__) * (((__PLL2MUL__) >> RCC_CFGR2_PLL2MUL_Pos) + 2U)) / (((__PLL2DIV__) >> RCC_CFGR2_PREDIV2_Pos) + 1U))\r
+#endif /* RCC_PLL2_SUPPORT */\r
+\r
+/**\r
+  * @brief  Helper macro to calculate the HCLK frequency\r
+  * @note: __AHBPRESCALER__ be retrieved by @ref LL_RCC_GetAHBPrescaler\r
+  *        ex: __LL_RCC_CALC_HCLK_FREQ(LL_RCC_GetAHBPrescaler())\r
+  * @param  __SYSCLKFREQ__ SYSCLK frequency (based on HSE/HSI/PLLCLK)\r
+  * @param  __AHBPRESCALER__: This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_1\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_2\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_4\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_8\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_16\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_64\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_128\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_256\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_512\r
+  * @retval HCLK clock frequency (in Hz)\r
+  */\r
+#define __LL_RCC_CALC_HCLK_FREQ(__SYSCLKFREQ__, __AHBPRESCALER__) ((__SYSCLKFREQ__) >> AHBPrescTable[((__AHBPRESCALER__) & RCC_CFGR_HPRE) >>  RCC_CFGR_HPRE_Pos])\r
+\r
+/**\r
+  * @brief  Helper macro to calculate the PCLK1 frequency (ABP1)\r
+  * @note: __APB1PRESCALER__ be retrieved by @ref LL_RCC_GetAPB1Prescaler\r
+  *        ex: __LL_RCC_CALC_PCLK1_FREQ(LL_RCC_GetAPB1Prescaler())\r
+  * @param  __HCLKFREQ__ HCLK frequency\r
+  * @param  __APB1PRESCALER__: This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_APB1_DIV_1\r
+  *         @arg @ref LL_RCC_APB1_DIV_2\r
+  *         @arg @ref LL_RCC_APB1_DIV_4\r
+  *         @arg @ref LL_RCC_APB1_DIV_8\r
+  *         @arg @ref LL_RCC_APB1_DIV_16\r
+  * @retval PCLK1 clock frequency (in Hz)\r
+  */\r
+#define __LL_RCC_CALC_PCLK1_FREQ(__HCLKFREQ__, __APB1PRESCALER__) ((__HCLKFREQ__) >> APBPrescTable[(__APB1PRESCALER__) >>  RCC_CFGR_PPRE1_Pos])\r
+\r
+/**\r
+  * @brief  Helper macro to calculate the PCLK2 frequency (ABP2)\r
+  * @note: __APB2PRESCALER__ be retrieved by @ref LL_RCC_GetAPB2Prescaler\r
+  *        ex: __LL_RCC_CALC_PCLK2_FREQ(LL_RCC_GetAPB2Prescaler())\r
+  * @param  __HCLKFREQ__ HCLK frequency\r
+  * @param  __APB2PRESCALER__: This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_APB2_DIV_1\r
+  *         @arg @ref LL_RCC_APB2_DIV_2\r
+  *         @arg @ref LL_RCC_APB2_DIV_4\r
+  *         @arg @ref LL_RCC_APB2_DIV_8\r
+  *         @arg @ref LL_RCC_APB2_DIV_16\r
+  * @retval PCLK2 clock frequency (in Hz)\r
+  */\r
+#define __LL_RCC_CALC_PCLK2_FREQ(__HCLKFREQ__, __APB2PRESCALER__) ((__HCLKFREQ__) >> APBPrescTable[(__APB2PRESCALER__) >>  RCC_CFGR_PPRE2_Pos])\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Exported functions --------------------------------------------------------*/\r
+/** @defgroup RCC_LL_Exported_Functions RCC Exported Functions\r
+  * @{\r
+  */\r
+\r
+/** @defgroup RCC_LL_EF_HSE HSE\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable the Clock Security System.\r
+  * @rmtoll CR           CSSON         LL_RCC_HSE_EnableCSS\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_HSE_EnableCSS(void)\r
+{\r
+  SET_BIT(RCC->CR, RCC_CR_CSSON);\r
+}\r
+\r
+/**\r
+  * @brief  Enable HSE external oscillator (HSE Bypass)\r
+  * @rmtoll CR           HSEBYP        LL_RCC_HSE_EnableBypass\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_HSE_EnableBypass(void)\r
+{\r
+  SET_BIT(RCC->CR, RCC_CR_HSEBYP);\r
+}\r
+\r
+/**\r
+  * @brief  Disable HSE external oscillator (HSE Bypass)\r
+  * @rmtoll CR           HSEBYP        LL_RCC_HSE_DisableBypass\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_HSE_DisableBypass(void)\r
+{\r
+  CLEAR_BIT(RCC->CR, RCC_CR_HSEBYP);\r
+}\r
+\r
+/**\r
+  * @brief  Enable HSE crystal oscillator (HSE ON)\r
+  * @rmtoll CR           HSEON         LL_RCC_HSE_Enable\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_HSE_Enable(void)\r
+{\r
+  SET_BIT(RCC->CR, RCC_CR_HSEON);\r
+}\r
+\r
+/**\r
+  * @brief  Disable HSE crystal oscillator (HSE ON)\r
+  * @rmtoll CR           HSEON         LL_RCC_HSE_Disable\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_HSE_Disable(void)\r
+{\r
+  CLEAR_BIT(RCC->CR, RCC_CR_HSEON);\r
+}\r
+\r
+/**\r
+  * @brief  Check if HSE oscillator Ready\r
+  * @rmtoll CR           HSERDY        LL_RCC_HSE_IsReady\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_HSE_IsReady(void)\r
+{\r
+  return (READ_BIT(RCC->CR, RCC_CR_HSERDY) == (RCC_CR_HSERDY));\r
+}\r
+\r
+#if defined(RCC_CFGR2_PREDIV2)\r
+/**\r
+  * @brief  Get PREDIV2 division factor\r
+  * @rmtoll CFGR2        PREDIV2       LL_RCC_HSE_GetPrediv2\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_1\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_2\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_3\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_4\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_5\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_6\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_7\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_8\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_9\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_10\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_11\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_12\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_13\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_14\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_15\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_16\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_HSE_GetPrediv2(void)\r
+{\r
+  return (uint32_t)(READ_BIT(RCC->CFGR2, RCC_CFGR2_PREDIV2));\r
+}\r
+#endif /* RCC_CFGR2_PREDIV2 */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup RCC_LL_EF_HSI HSI\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable HSI oscillator\r
+  * @rmtoll CR           HSION         LL_RCC_HSI_Enable\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_HSI_Enable(void)\r
+{\r
+  SET_BIT(RCC->CR, RCC_CR_HSION);\r
+}\r
+\r
+/**\r
+  * @brief  Disable HSI oscillator\r
+  * @rmtoll CR           HSION         LL_RCC_HSI_Disable\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_HSI_Disable(void)\r
+{\r
+  CLEAR_BIT(RCC->CR, RCC_CR_HSION);\r
+}\r
+\r
+/**\r
+  * @brief  Check if HSI clock is ready\r
+  * @rmtoll CR           HSIRDY        LL_RCC_HSI_IsReady\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_HSI_IsReady(void)\r
+{\r
+  return (READ_BIT(RCC->CR, RCC_CR_HSIRDY) == (RCC_CR_HSIRDY));\r
+}\r
+\r
+/**\r
+  * @brief  Get HSI Calibration value\r
+  * @note When HSITRIM is written, HSICAL is updated with the sum of\r
+  *       HSITRIM and the factory trim value\r
+  * @rmtoll CR        HSICAL        LL_RCC_HSI_GetCalibration\r
+  * @retval Between Min_Data = 0x00 and Max_Data = 0xFF\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_HSI_GetCalibration(void)\r
+{\r
+  return (uint32_t)(READ_BIT(RCC->CR, RCC_CR_HSICAL) >> RCC_CR_HSICAL_Pos);\r
+}\r
+\r
+/**\r
+  * @brief  Set HSI Calibration trimming\r
+  * @note user-programmable trimming value that is added to the HSICAL\r
+  * @note Default value is 16, which, when added to the HSICAL value,\r
+  *       should trim the HSI to 16 MHz +/- 1 %\r
+  * @rmtoll CR        HSITRIM       LL_RCC_HSI_SetCalibTrimming\r
+  * @param  Value between Min_Data = 0x00 and Max_Data = 0x1F\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_HSI_SetCalibTrimming(uint32_t Value)\r
+{\r
+  MODIFY_REG(RCC->CR, RCC_CR_HSITRIM, Value << RCC_CR_HSITRIM_Pos);\r
+}\r
+\r
+/**\r
+  * @brief  Get HSI Calibration trimming\r
+  * @rmtoll CR        HSITRIM       LL_RCC_HSI_GetCalibTrimming\r
+  * @retval Between Min_Data = 0x00 and Max_Data = 0x1F\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_HSI_GetCalibTrimming(void)\r
+{\r
+  return (uint32_t)(READ_BIT(RCC->CR, RCC_CR_HSITRIM) >> RCC_CR_HSITRIM_Pos);\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup RCC_LL_EF_LSE LSE\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable  Low Speed External (LSE) crystal.\r
+  * @rmtoll BDCR         LSEON         LL_RCC_LSE_Enable\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_LSE_Enable(void)\r
+{\r
+  SET_BIT(RCC->BDCR, RCC_BDCR_LSEON);\r
+}\r
+\r
+/**\r
+  * @brief  Disable  Low Speed External (LSE) crystal.\r
+  * @rmtoll BDCR         LSEON         LL_RCC_LSE_Disable\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_LSE_Disable(void)\r
+{\r
+  CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEON);\r
+}\r
+\r
+/**\r
+  * @brief  Enable external clock source (LSE bypass).\r
+  * @rmtoll BDCR         LSEBYP        LL_RCC_LSE_EnableBypass\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_LSE_EnableBypass(void)\r
+{\r
+  SET_BIT(RCC->BDCR, RCC_BDCR_LSEBYP);\r
+}\r
+\r
+/**\r
+  * @brief  Disable external clock source (LSE bypass).\r
+  * @rmtoll BDCR         LSEBYP        LL_RCC_LSE_DisableBypass\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_LSE_DisableBypass(void)\r
+{\r
+  CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEBYP);\r
+}\r
+\r
+/**\r
+  * @brief  Check if LSE oscillator Ready\r
+  * @rmtoll BDCR         LSERDY        LL_RCC_LSE_IsReady\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_LSE_IsReady(void)\r
+{\r
+  return (READ_BIT(RCC->BDCR, RCC_BDCR_LSERDY) == (RCC_BDCR_LSERDY));\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup RCC_LL_EF_LSI LSI\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable LSI Oscillator\r
+  * @rmtoll CSR          LSION         LL_RCC_LSI_Enable\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_LSI_Enable(void)\r
+{\r
+  SET_BIT(RCC->CSR, RCC_CSR_LSION);\r
+}\r
+\r
+/**\r
+  * @brief  Disable LSI Oscillator\r
+  * @rmtoll CSR          LSION         LL_RCC_LSI_Disable\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_LSI_Disable(void)\r
+{\r
+  CLEAR_BIT(RCC->CSR, RCC_CSR_LSION);\r
+}\r
+\r
+/**\r
+  * @brief  Check if LSI is Ready\r
+  * @rmtoll CSR          LSIRDY        LL_RCC_LSI_IsReady\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_LSI_IsReady(void)\r
+{\r
+  return (READ_BIT(RCC->CSR, RCC_CSR_LSIRDY) == (RCC_CSR_LSIRDY));\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup RCC_LL_EF_System System\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Configure the system clock source\r
+  * @rmtoll CFGR         SW            LL_RCC_SetSysClkSource\r
+  * @param  Source This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_SYS_CLKSOURCE_HSI\r
+  *         @arg @ref LL_RCC_SYS_CLKSOURCE_HSE\r
+  *         @arg @ref LL_RCC_SYS_CLKSOURCE_PLL\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_SetSysClkSource(uint32_t Source)\r
+{\r
+  MODIFY_REG(RCC->CFGR, RCC_CFGR_SW, Source);\r
+}\r
+\r
+/**\r
+  * @brief  Get the system clock source\r
+  * @rmtoll CFGR         SWS           LL_RCC_GetSysClkSource\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_RCC_SYS_CLKSOURCE_STATUS_HSI\r
+  *         @arg @ref LL_RCC_SYS_CLKSOURCE_STATUS_HSE\r
+  *         @arg @ref LL_RCC_SYS_CLKSOURCE_STATUS_PLL\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_GetSysClkSource(void)\r
+{\r
+  return (uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_SWS));\r
+}\r
+\r
+/**\r
+  * @brief  Set AHB prescaler\r
+  * @rmtoll CFGR         HPRE          LL_RCC_SetAHBPrescaler\r
+  * @param  Prescaler This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_1\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_2\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_4\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_8\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_16\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_64\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_128\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_256\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_512\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_SetAHBPrescaler(uint32_t Prescaler)\r
+{\r
+  MODIFY_REG(RCC->CFGR, RCC_CFGR_HPRE, Prescaler);\r
+}\r
+\r
+/**\r
+  * @brief  Set APB1 prescaler\r
+  * @rmtoll CFGR         PPRE1         LL_RCC_SetAPB1Prescaler\r
+  * @param  Prescaler This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_APB1_DIV_1\r
+  *         @arg @ref LL_RCC_APB1_DIV_2\r
+  *         @arg @ref LL_RCC_APB1_DIV_4\r
+  *         @arg @ref LL_RCC_APB1_DIV_8\r
+  *         @arg @ref LL_RCC_APB1_DIV_16\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_SetAPB1Prescaler(uint32_t Prescaler)\r
+{\r
+  MODIFY_REG(RCC->CFGR, RCC_CFGR_PPRE1, Prescaler);\r
+}\r
+\r
+/**\r
+  * @brief  Set APB2 prescaler\r
+  * @rmtoll CFGR         PPRE2         LL_RCC_SetAPB2Prescaler\r
+  * @param  Prescaler This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_APB2_DIV_1\r
+  *         @arg @ref LL_RCC_APB2_DIV_2\r
+  *         @arg @ref LL_RCC_APB2_DIV_4\r
+  *         @arg @ref LL_RCC_APB2_DIV_8\r
+  *         @arg @ref LL_RCC_APB2_DIV_16\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_SetAPB2Prescaler(uint32_t Prescaler)\r
+{\r
+  MODIFY_REG(RCC->CFGR, RCC_CFGR_PPRE2, Prescaler);\r
+}\r
+\r
+/**\r
+  * @brief  Get AHB prescaler\r
+  * @rmtoll CFGR         HPRE          LL_RCC_GetAHBPrescaler\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_1\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_2\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_4\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_8\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_16\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_64\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_128\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_256\r
+  *         @arg @ref LL_RCC_SYSCLK_DIV_512\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_GetAHBPrescaler(void)\r
+{\r
+  return (uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_HPRE));\r
+}\r
+\r
+/**\r
+  * @brief  Get APB1 prescaler\r
+  * @rmtoll CFGR         PPRE1         LL_RCC_GetAPB1Prescaler\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_RCC_APB1_DIV_1\r
+  *         @arg @ref LL_RCC_APB1_DIV_2\r
+  *         @arg @ref LL_RCC_APB1_DIV_4\r
+  *         @arg @ref LL_RCC_APB1_DIV_8\r
+  *         @arg @ref LL_RCC_APB1_DIV_16\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_GetAPB1Prescaler(void)\r
+{\r
+  return (uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_PPRE1));\r
+}\r
+\r
+/**\r
+  * @brief  Get APB2 prescaler\r
+  * @rmtoll CFGR         PPRE2         LL_RCC_GetAPB2Prescaler\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_RCC_APB2_DIV_1\r
+  *         @arg @ref LL_RCC_APB2_DIV_2\r
+  *         @arg @ref LL_RCC_APB2_DIV_4\r
+  *         @arg @ref LL_RCC_APB2_DIV_8\r
+  *         @arg @ref LL_RCC_APB2_DIV_16\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_GetAPB2Prescaler(void)\r
+{\r
+  return (uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_PPRE2));\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup RCC_LL_EF_MCO MCO\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Configure MCOx\r
+  * @rmtoll CFGR         MCO           LL_RCC_ConfigMCO\r
+  * @param  MCOxSource This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_MCO1SOURCE_NOCLOCK\r
+  *         @arg @ref LL_RCC_MCO1SOURCE_SYSCLK\r
+  *         @arg @ref LL_RCC_MCO1SOURCE_HSI\r
+  *         @arg @ref LL_RCC_MCO1SOURCE_HSE\r
+  *         @arg @ref LL_RCC_MCO1SOURCE_PLLCLK_DIV_2\r
+  *         @arg @ref LL_RCC_MCO1SOURCE_PLL2CLK (*)\r
+  *         @arg @ref LL_RCC_MCO1SOURCE_PLLI2SCLK_DIV2 (*)\r
+  *         @arg @ref LL_RCC_MCO1SOURCE_EXT_HSE (*)\r
+  *         @arg @ref LL_RCC_MCO1SOURCE_PLLI2SCLK (*)\r
+  *\r
+  *         (*) value not defined in all devices\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_ConfigMCO(uint32_t MCOxSource)\r
+{\r
+  MODIFY_REG(RCC->CFGR, RCC_CFGR_MCOSEL, MCOxSource);\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup RCC_LL_EF_Peripheral_Clock_Source Peripheral Clock Source\r
+  * @{\r
+  */\r
+\r
+#if defined(RCC_CFGR2_I2S2SRC)\r
+/**\r
+  * @brief  Configure I2Sx clock source\r
+  * @rmtoll CFGR2        I2S2SRC       LL_RCC_SetI2SClockSource\n\r
+  *         CFGR2        I2S3SRC       LL_RCC_SetI2SClockSource\r
+  * @param  I2SxSource This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_I2S2_CLKSOURCE_SYSCLK\r
+  *         @arg @ref LL_RCC_I2S2_CLKSOURCE_PLLI2S_VCO\r
+  *         @arg @ref LL_RCC_I2S3_CLKSOURCE_SYSCLK\r
+  *         @arg @ref LL_RCC_I2S3_CLKSOURCE_PLLI2S_VCO\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_SetI2SClockSource(uint32_t I2SxSource)\r
+{\r
+  MODIFY_REG(RCC->CFGR2, (I2SxSource & 0xFFFF0000U), (I2SxSource << 16U));\r
+}\r
+#endif /* RCC_CFGR2_I2S2SRC */\r
+\r
+#if defined(USB_OTG_FS) || defined(USB)\r
+/**\r
+  * @brief  Configure USB clock source\r
+  * @rmtoll CFGR         OTGFSPRE      LL_RCC_SetUSBClockSource\n\r
+  *         CFGR         USBPRE        LL_RCC_SetUSBClockSource\r
+  * @param  USBxSource This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_USB_CLKSOURCE_PLL (*)\r
+  *         @arg @ref LL_RCC_USB_CLKSOURCE_PLL_DIV_1_5 (*)\r
+  *         @arg @ref LL_RCC_USB_CLKSOURCE_PLL_DIV_2 (*)\r
+  *         @arg @ref LL_RCC_USB_CLKSOURCE_PLL_DIV_3 (*)\r
+  *\r
+  *         (*) value not defined in all devices\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_SetUSBClockSource(uint32_t USBxSource)\r
+{\r
+#if defined(RCC_CFGR_USBPRE)\r
+  MODIFY_REG(RCC->CFGR, RCC_CFGR_USBPRE, USBxSource);\r
+#else /*RCC_CFGR_OTGFSPRE*/\r
+  MODIFY_REG(RCC->CFGR, RCC_CFGR_OTGFSPRE, USBxSource);\r
+#endif /*RCC_CFGR_USBPRE*/\r
+}\r
+#endif /* USB_OTG_FS || USB */\r
+\r
+/**\r
+  * @brief  Configure ADC clock source\r
+  * @rmtoll CFGR         ADCPRE        LL_RCC_SetADCClockSource\r
+  * @param  ADCxSource This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_2\r
+  *         @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_4\r
+  *         @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_6\r
+  *         @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_8\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_SetADCClockSource(uint32_t ADCxSource)\r
+{\r
+  MODIFY_REG(RCC->CFGR, RCC_CFGR_ADCPRE, ADCxSource);\r
+}\r
+\r
+#if defined(RCC_CFGR2_I2S2SRC)\r
+/**\r
+  * @brief  Get I2Sx clock source\r
+  * @rmtoll CFGR2        I2S2SRC       LL_RCC_GetI2SClockSource\n\r
+  *         CFGR2        I2S3SRC       LL_RCC_GetI2SClockSource\r
+  * @param  I2Sx This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_I2S2_CLKSOURCE\r
+  *         @arg @ref LL_RCC_I2S3_CLKSOURCE\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_RCC_I2S2_CLKSOURCE_SYSCLK\r
+  *         @arg @ref LL_RCC_I2S2_CLKSOURCE_PLLI2S_VCO\r
+  *         @arg @ref LL_RCC_I2S3_CLKSOURCE_SYSCLK\r
+  *         @arg @ref LL_RCC_I2S3_CLKSOURCE_PLLI2S_VCO\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_GetI2SClockSource(uint32_t I2Sx)\r
+{\r
+  return (uint32_t)(READ_BIT(RCC->CFGR2, I2Sx) >> 16U | I2Sx);\r
+}\r
+#endif /* RCC_CFGR2_I2S2SRC */\r
+\r
+#if defined(USB_OTG_FS) || defined(USB)\r
+/**\r
+  * @brief  Get USBx clock source\r
+  * @rmtoll CFGR         OTGFSPRE      LL_RCC_GetUSBClockSource\n\r
+  *         CFGR         USBPRE        LL_RCC_GetUSBClockSource\r
+  * @param  USBx This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_USB_CLKSOURCE\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_RCC_USB_CLKSOURCE_PLL (*)\r
+  *         @arg @ref LL_RCC_USB_CLKSOURCE_PLL_DIV_1_5 (*)\r
+  *         @arg @ref LL_RCC_USB_CLKSOURCE_PLL_DIV_2 (*)\r
+  *         @arg @ref LL_RCC_USB_CLKSOURCE_PLL_DIV_3 (*)\r
+  *\r
+  *         (*) value not defined in all devices\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_GetUSBClockSource(uint32_t USBx)\r
+{\r
+  return (uint32_t)(READ_BIT(RCC->CFGR, USBx));\r
+}\r
+#endif /* USB_OTG_FS || USB */\r
+\r
+/**\r
+  * @brief  Get ADCx clock source\r
+  * @rmtoll CFGR         ADCPRE        LL_RCC_GetADCClockSource\r
+  * @param  ADCx This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_ADC_CLKSOURCE\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_2\r
+  *         @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_4\r
+  *         @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_6\r
+  *         @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_8\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_GetADCClockSource(uint32_t ADCx)\r
+{\r
+  return (uint32_t)(READ_BIT(RCC->CFGR, ADCx));\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup RCC_LL_EF_RTC RTC\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Set RTC Clock Source\r
+  * @note Once the RTC clock source has been selected, it cannot be changed any more unless\r
+  *       the Backup domain is reset. The BDRST bit can be used to reset them.\r
+  * @rmtoll BDCR         RTCSEL        LL_RCC_SetRTCClockSource\r
+  * @param  Source This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_RTC_CLKSOURCE_NONE\r
+  *         @arg @ref LL_RCC_RTC_CLKSOURCE_LSE\r
+  *         @arg @ref LL_RCC_RTC_CLKSOURCE_LSI\r
+  *         @arg @ref LL_RCC_RTC_CLKSOURCE_HSE_DIV128\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_SetRTCClockSource(uint32_t Source)\r
+{\r
+  MODIFY_REG(RCC->BDCR, RCC_BDCR_RTCSEL, Source);\r
+}\r
+\r
+/**\r
+  * @brief  Get RTC Clock Source\r
+  * @rmtoll BDCR         RTCSEL        LL_RCC_GetRTCClockSource\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_RCC_RTC_CLKSOURCE_NONE\r
+  *         @arg @ref LL_RCC_RTC_CLKSOURCE_LSE\r
+  *         @arg @ref LL_RCC_RTC_CLKSOURCE_LSI\r
+  *         @arg @ref LL_RCC_RTC_CLKSOURCE_HSE_DIV128\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_GetRTCClockSource(void)\r
+{\r
+  return (uint32_t)(READ_BIT(RCC->BDCR, RCC_BDCR_RTCSEL));\r
+}\r
+\r
+/**\r
+  * @brief  Enable RTC\r
+  * @rmtoll BDCR         RTCEN         LL_RCC_EnableRTC\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_EnableRTC(void)\r
+{\r
+  SET_BIT(RCC->BDCR, RCC_BDCR_RTCEN);\r
+}\r
+\r
+/**\r
+  * @brief  Disable RTC\r
+  * @rmtoll BDCR         RTCEN         LL_RCC_DisableRTC\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_DisableRTC(void)\r
+{\r
+  CLEAR_BIT(RCC->BDCR, RCC_BDCR_RTCEN);\r
+}\r
+\r
+/**\r
+  * @brief  Check if RTC has been enabled or not\r
+  * @rmtoll BDCR         RTCEN         LL_RCC_IsEnabledRTC\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_IsEnabledRTC(void)\r
+{\r
+  return (READ_BIT(RCC->BDCR, RCC_BDCR_RTCEN) == (RCC_BDCR_RTCEN));\r
+}\r
+\r
+/**\r
+  * @brief  Force the Backup domain reset\r
+  * @rmtoll BDCR         BDRST         LL_RCC_ForceBackupDomainReset\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_ForceBackupDomainReset(void)\r
+{\r
+  SET_BIT(RCC->BDCR, RCC_BDCR_BDRST);\r
+}\r
+\r
+/**\r
+  * @brief  Release the Backup domain reset\r
+  * @rmtoll BDCR         BDRST         LL_RCC_ReleaseBackupDomainReset\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_ReleaseBackupDomainReset(void)\r
+{\r
+  CLEAR_BIT(RCC->BDCR, RCC_BDCR_BDRST);\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup RCC_LL_EF_PLL PLL\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable PLL\r
+  * @rmtoll CR           PLLON         LL_RCC_PLL_Enable\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_PLL_Enable(void)\r
+{\r
+  SET_BIT(RCC->CR, RCC_CR_PLLON);\r
+}\r
+\r
+/**\r
+  * @brief  Disable PLL\r
+  * @note Cannot be disabled if the PLL clock is used as the system clock\r
+  * @rmtoll CR           PLLON         LL_RCC_PLL_Disable\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_PLL_Disable(void)\r
+{\r
+  CLEAR_BIT(RCC->CR, RCC_CR_PLLON);\r
+}\r
+\r
+/**\r
+  * @brief  Check if PLL Ready\r
+  * @rmtoll CR           PLLRDY        LL_RCC_PLL_IsReady\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_PLL_IsReady(void)\r
+{\r
+  return (READ_BIT(RCC->CR, RCC_CR_PLLRDY) == (RCC_CR_PLLRDY));\r
+}\r
+\r
+/**\r
+  * @brief  Configure PLL used for SYSCLK Domain\r
+  * @rmtoll CFGR         PLLSRC        LL_RCC_PLL_ConfigDomain_SYS\n\r
+  *         CFGR         PLLXTPRE      LL_RCC_PLL_ConfigDomain_SYS\n\r
+  *         CFGR         PLLMULL       LL_RCC_PLL_ConfigDomain_SYS\n\r
+  *         CFGR2        PREDIV1       LL_RCC_PLL_ConfigDomain_SYS\n\r
+  *         CFGR2        PREDIV1SRC    LL_RCC_PLL_ConfigDomain_SYS\r
+  * @param  Source This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_PLLSOURCE_HSI_DIV_2\r
+  *         @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_1\r
+  *         @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_2 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_3 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_4 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_5 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_6 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_7 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_8 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_9 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_10 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_11 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_12 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_13 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_14 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_15 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_16 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_1 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_2 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_3 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_4 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_5 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_6 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_7 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_8 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_9 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_10 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_11 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_12 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_13 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_14 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_15 (*)\r
+  *         @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_16 (*)\r
+  *\r
+  *         (*) value not defined in all devices\r
+  * @param  PLLMul This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_PLL_MUL_2 (*)\r
+  *         @arg @ref LL_RCC_PLL_MUL_3 (*)\r
+  *         @arg @ref LL_RCC_PLL_MUL_4\r
+  *         @arg @ref LL_RCC_PLL_MUL_5\r
+  *         @arg @ref LL_RCC_PLL_MUL_6\r
+  *         @arg @ref LL_RCC_PLL_MUL_7\r
+  *         @arg @ref LL_RCC_PLL_MUL_8\r
+  *         @arg @ref LL_RCC_PLL_MUL_9\r
+  *         @arg @ref LL_RCC_PLL_MUL_6_5 (*)\r
+  *         @arg @ref LL_RCC_PLL_MUL_10 (*)\r
+  *         @arg @ref LL_RCC_PLL_MUL_11 (*)\r
+  *         @arg @ref LL_RCC_PLL_MUL_12 (*)\r
+  *         @arg @ref LL_RCC_PLL_MUL_13 (*)\r
+  *         @arg @ref LL_RCC_PLL_MUL_14 (*)\r
+  *         @arg @ref LL_RCC_PLL_MUL_15 (*)\r
+  *         @arg @ref LL_RCC_PLL_MUL_16 (*)\r
+  *\r
+  *         (*) value not defined in all devices\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_PLL_ConfigDomain_SYS(uint32_t Source, uint32_t PLLMul)\r
+{\r
+  MODIFY_REG(RCC->CFGR, RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLMULL,\r
+             (Source & (RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE)) | PLLMul);\r
+#if defined(RCC_CFGR2_PREDIV1)\r
+#if defined(RCC_CFGR2_PREDIV1SRC)\r
+  MODIFY_REG(RCC->CFGR2, (RCC_CFGR2_PREDIV1 | RCC_CFGR2_PREDIV1SRC),\r
+             (Source & RCC_CFGR2_PREDIV1) | ((Source & (RCC_CFGR2_PREDIV1SRC << 4U)) >> 4U));\r
+#else\r
+  MODIFY_REG(RCC->CFGR2, RCC_CFGR2_PREDIV1, (Source & RCC_CFGR2_PREDIV1));\r
+#endif /*RCC_CFGR2_PREDIV1SRC*/\r
+#endif /*RCC_CFGR2_PREDIV1*/\r
+}\r
+\r
+/**\r
+  * @brief  Configure PLL clock source\r
+  * @rmtoll CFGR      PLLSRC        LL_RCC_PLL_SetMainSource\n\r
+  *         CFGR2     PREDIV1SRC    LL_RCC_PLL_SetMainSource\r
+  * @param PLLSource This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_PLLSOURCE_HSI_DIV_2\r
+  *         @arg @ref LL_RCC_PLLSOURCE_HSE\r
+  *         @arg @ref LL_RCC_PLLSOURCE_PLL2 (*)\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_PLL_SetMainSource(uint32_t PLLSource)\r
+{\r
+#if defined(RCC_CFGR2_PREDIV1SRC)\r
+  MODIFY_REG(RCC->CFGR2, RCC_CFGR2_PREDIV1SRC, ((PLLSource & (RCC_CFGR2_PREDIV1SRC << 4U)) >> 4U));\r
+#endif /* RCC_CFGR2_PREDIV1SRC */\r
+  MODIFY_REG(RCC->CFGR, RCC_CFGR_PLLSRC, PLLSource);\r
+}\r
+\r
+/**\r
+  * @brief  Get the oscillator used as PLL clock source.\r
+  * @rmtoll CFGR         PLLSRC        LL_RCC_PLL_GetMainSource\n\r
+  *         CFGR2        PREDIV1SRC    LL_RCC_PLL_GetMainSource\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_RCC_PLLSOURCE_HSI_DIV_2\r
+  *         @arg @ref LL_RCC_PLLSOURCE_HSE\r
+  *         @arg @ref LL_RCC_PLLSOURCE_PLL2 (*)\r
+  *\r
+  *         (*) value not defined in all devices\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_PLL_GetMainSource(void)\r
+{\r
+#if defined(RCC_CFGR2_PREDIV1SRC)\r
+  uint32_t pllsrc = READ_BIT(RCC->CFGR, RCC_CFGR_PLLSRC);\r
+  uint32_t predivsrc = (uint32_t)(READ_BIT(RCC->CFGR2, RCC_CFGR2_PREDIV1SRC) << 4U);\r
+  return (uint32_t)(pllsrc | predivsrc);\r
+#else\r
+  return (uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_PLLSRC));\r
+#endif /*RCC_CFGR2_PREDIV1SRC*/\r
+}\r
+\r
+/**\r
+  * @brief  Get PLL multiplication Factor\r
+  * @rmtoll CFGR         PLLMULL       LL_RCC_PLL_GetMultiplicator\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_RCC_PLL_MUL_2 (*)\r
+  *         @arg @ref LL_RCC_PLL_MUL_3 (*)\r
+  *         @arg @ref LL_RCC_PLL_MUL_4\r
+  *         @arg @ref LL_RCC_PLL_MUL_5\r
+  *         @arg @ref LL_RCC_PLL_MUL_6\r
+  *         @arg @ref LL_RCC_PLL_MUL_7\r
+  *         @arg @ref LL_RCC_PLL_MUL_8\r
+  *         @arg @ref LL_RCC_PLL_MUL_9\r
+  *         @arg @ref LL_RCC_PLL_MUL_6_5 (*)\r
+  *         @arg @ref LL_RCC_PLL_MUL_10 (*)\r
+  *         @arg @ref LL_RCC_PLL_MUL_11 (*)\r
+  *         @arg @ref LL_RCC_PLL_MUL_12 (*)\r
+  *         @arg @ref LL_RCC_PLL_MUL_13 (*)\r
+  *         @arg @ref LL_RCC_PLL_MUL_14 (*)\r
+  *         @arg @ref LL_RCC_PLL_MUL_15 (*)\r
+  *         @arg @ref LL_RCC_PLL_MUL_16 (*)\r
+  *\r
+  *         (*) value not defined in all devices\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_PLL_GetMultiplicator(void)\r
+{\r
+  return (uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_PLLMULL));\r
+}\r
+\r
+/**\r
+  * @brief  Get PREDIV1 division factor for the main PLL\r
+  * @note They can be written only when the PLL is disabled\r
+  * @rmtoll CFGR2        PREDIV1       LL_RCC_PLL_GetPrediv\n\r
+  *         CFGR2        PLLXTPRE      LL_RCC_PLL_GetPrediv\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_RCC_PREDIV_DIV_1\r
+  *         @arg @ref LL_RCC_PREDIV_DIV_2\r
+  *         @arg @ref LL_RCC_PREDIV_DIV_3 (*)\r
+  *         @arg @ref LL_RCC_PREDIV_DIV_4 (*)\r
+  *         @arg @ref LL_RCC_PREDIV_DIV_5 (*)\r
+  *         @arg @ref LL_RCC_PREDIV_DIV_6 (*)\r
+  *         @arg @ref LL_RCC_PREDIV_DIV_7 (*)\r
+  *         @arg @ref LL_RCC_PREDIV_DIV_8 (*)\r
+  *         @arg @ref LL_RCC_PREDIV_DIV_9 (*)\r
+  *         @arg @ref LL_RCC_PREDIV_DIV_10 (*)\r
+  *         @arg @ref LL_RCC_PREDIV_DIV_11 (*)\r
+  *         @arg @ref LL_RCC_PREDIV_DIV_12 (*)\r
+  *         @arg @ref LL_RCC_PREDIV_DIV_13 (*)\r
+  *         @arg @ref LL_RCC_PREDIV_DIV_14 (*)\r
+  *         @arg @ref LL_RCC_PREDIV_DIV_15 (*)\r
+  *         @arg @ref LL_RCC_PREDIV_DIV_16 (*)\r
+  *\r
+  *         (*) value not defined in all devices\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_PLL_GetPrediv(void)\r
+{\r
+#if defined(RCC_CFGR2_PREDIV1)\r
+  return (uint32_t)(READ_BIT(RCC->CFGR2, RCC_CFGR2_PREDIV1));\r
+#else\r
+  return (uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_PLLXTPRE) >> RCC_CFGR_PLLXTPRE_Pos);\r
+#endif /*RCC_CFGR2_PREDIV1*/\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#if defined(RCC_PLLI2S_SUPPORT)\r
+/** @defgroup RCC_LL_EF_PLLI2S PLLI2S\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable PLLI2S\r
+  * @rmtoll CR           PLL3ON        LL_RCC_PLLI2S_Enable\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_PLLI2S_Enable(void)\r
+{\r
+  SET_BIT(RCC->CR, RCC_CR_PLL3ON);\r
+}\r
+\r
+/**\r
+  * @brief  Disable PLLI2S\r
+  * @rmtoll CR           PLL3ON        LL_RCC_PLLI2S_Disable\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_PLLI2S_Disable(void)\r
+{\r
+  CLEAR_BIT(RCC->CR, RCC_CR_PLL3ON);\r
+}\r
+\r
+/**\r
+  * @brief  Check if PLLI2S Ready\r
+  * @rmtoll CR           PLL3RDY       LL_RCC_PLLI2S_IsReady\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_PLLI2S_IsReady(void)\r
+{\r
+  return (READ_BIT(RCC->CR, RCC_CR_PLL3RDY) == (RCC_CR_PLL3RDY));\r
+}\r
+\r
+/**\r
+  * @brief  Configure PLLI2S used for I2S Domain\r
+  * @rmtoll CFGR2        PREDIV2       LL_RCC_PLL_ConfigDomain_PLLI2S\n\r
+  *         CFGR2        PLL3MUL       LL_RCC_PLL_ConfigDomain_PLLI2S\r
+  * @param  Divider This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_1\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_2\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_3\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_4\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_5\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_6\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_7\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_8\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_9\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_10\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_11\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_12\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_13\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_14\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_15\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_16\r
+  * @param  Multiplicator This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_8\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_9\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_10\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_11\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_12\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_13\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_14\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_16\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_20\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_PLL_ConfigDomain_PLLI2S(uint32_t Divider, uint32_t Multiplicator)\r
+{\r
+  MODIFY_REG(RCC->CFGR2, RCC_CFGR2_PREDIV2 | RCC_CFGR2_PLL3MUL, Divider | Multiplicator);\r
+}\r
+\r
+/**\r
+  * @brief  Get PLLI2S Multiplication Factor\r
+  * @rmtoll CFGR2        PLL3MUL       LL_RCC_PLLI2S_GetMultiplicator\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_8\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_9\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_10\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_11\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_12\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_13\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_14\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_16\r
+  *         @arg @ref LL_RCC_PLLI2S_MUL_20\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_PLLI2S_GetMultiplicator(void)\r
+{\r
+  return (uint32_t)(READ_BIT(RCC->CFGR2, RCC_CFGR2_PLL3MUL));\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+#endif /* RCC_PLLI2S_SUPPORT */\r
+\r
+#if defined(RCC_PLL2_SUPPORT)\r
+/** @defgroup RCC_LL_EF_PLL2 PLL2\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable PLL2\r
+  * @rmtoll CR           PLL2ON        LL_RCC_PLL2_Enable\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_PLL2_Enable(void)\r
+{\r
+  SET_BIT(RCC->CR, RCC_CR_PLL2ON);\r
+}\r
+\r
+/**\r
+  * @brief  Disable PLL2\r
+  * @rmtoll CR           PLL2ON        LL_RCC_PLL2_Disable\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_PLL2_Disable(void)\r
+{\r
+  CLEAR_BIT(RCC->CR, RCC_CR_PLL2ON);\r
+}\r
+\r
+/**\r
+  * @brief  Check if PLL2 Ready\r
+  * @rmtoll CR           PLL2RDY       LL_RCC_PLL2_IsReady\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_PLL2_IsReady(void)\r
+{\r
+  return (READ_BIT(RCC->CR, RCC_CR_PLL2RDY) == (RCC_CR_PLL2RDY));\r
+}\r
+\r
+/**\r
+  * @brief  Configure PLL2 used for PLL2 Domain\r
+  * @rmtoll CFGR2        PREDIV2       LL_RCC_PLL_ConfigDomain_PLL2\n\r
+  *         CFGR2        PLL2MUL       LL_RCC_PLL_ConfigDomain_PLL2\r
+  * @param  Divider This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_1\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_2\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_3\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_4\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_5\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_6\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_7\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_8\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_9\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_10\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_11\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_12\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_13\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_14\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_15\r
+  *         @arg @ref LL_RCC_HSE_PREDIV2_DIV_16\r
+  * @param  Multiplicator This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_PLL2_MUL_8\r
+  *         @arg @ref LL_RCC_PLL2_MUL_9\r
+  *         @arg @ref LL_RCC_PLL2_MUL_10\r
+  *         @arg @ref LL_RCC_PLL2_MUL_11\r
+  *         @arg @ref LL_RCC_PLL2_MUL_12\r
+  *         @arg @ref LL_RCC_PLL2_MUL_13\r
+  *         @arg @ref LL_RCC_PLL2_MUL_14\r
+  *         @arg @ref LL_RCC_PLL2_MUL_16\r
+  *         @arg @ref LL_RCC_PLL2_MUL_20\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_PLL_ConfigDomain_PLL2(uint32_t Divider, uint32_t Multiplicator)\r
+{\r
+  MODIFY_REG(RCC->CFGR2, RCC_CFGR2_PREDIV2 | RCC_CFGR2_PLL2MUL, Divider | Multiplicator);\r
+}\r
+\r
+/**\r
+  * @brief  Get PLL2 Multiplication Factor\r
+  * @rmtoll CFGR2        PLL2MUL       LL_RCC_PLL2_GetMultiplicator\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_RCC_PLL2_MUL_8\r
+  *         @arg @ref LL_RCC_PLL2_MUL_9\r
+  *         @arg @ref LL_RCC_PLL2_MUL_10\r
+  *         @arg @ref LL_RCC_PLL2_MUL_11\r
+  *         @arg @ref LL_RCC_PLL2_MUL_12\r
+  *         @arg @ref LL_RCC_PLL2_MUL_13\r
+  *         @arg @ref LL_RCC_PLL2_MUL_14\r
+  *         @arg @ref LL_RCC_PLL2_MUL_16\r
+  *         @arg @ref LL_RCC_PLL2_MUL_20\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_PLL2_GetMultiplicator(void)\r
+{\r
+  return (uint32_t)(READ_BIT(RCC->CFGR2, RCC_CFGR2_PLL2MUL));\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+#endif /* RCC_PLL2_SUPPORT */\r
+\r
+/** @defgroup RCC_LL_EF_FLAG_Management FLAG Management\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Clear LSI ready interrupt flag\r
+  * @rmtoll CIR         LSIRDYC       LL_RCC_ClearFlag_LSIRDY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_ClearFlag_LSIRDY(void)\r
+{\r
+  SET_BIT(RCC->CIR, RCC_CIR_LSIRDYC);\r
+}\r
+\r
+/**\r
+  * @brief  Clear LSE ready interrupt flag\r
+  * @rmtoll CIR         LSERDYC       LL_RCC_ClearFlag_LSERDY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_ClearFlag_LSERDY(void)\r
+{\r
+  SET_BIT(RCC->CIR, RCC_CIR_LSERDYC);\r
+}\r
+\r
+/**\r
+  * @brief  Clear HSI ready interrupt flag\r
+  * @rmtoll CIR         HSIRDYC       LL_RCC_ClearFlag_HSIRDY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_ClearFlag_HSIRDY(void)\r
+{\r
+  SET_BIT(RCC->CIR, RCC_CIR_HSIRDYC);\r
+}\r
+\r
+/**\r
+  * @brief  Clear HSE ready interrupt flag\r
+  * @rmtoll CIR         HSERDYC       LL_RCC_ClearFlag_HSERDY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_ClearFlag_HSERDY(void)\r
+{\r
+  SET_BIT(RCC->CIR, RCC_CIR_HSERDYC);\r
+}\r
+\r
+/**\r
+  * @brief  Clear PLL ready interrupt flag\r
+  * @rmtoll CIR         PLLRDYC       LL_RCC_ClearFlag_PLLRDY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_ClearFlag_PLLRDY(void)\r
+{\r
+  SET_BIT(RCC->CIR, RCC_CIR_PLLRDYC);\r
+}\r
+\r
+#if defined(RCC_PLLI2S_SUPPORT)\r
+/**\r
+  * @brief  Clear PLLI2S ready interrupt flag\r
+  * @rmtoll CIR          PLL3RDYC      LL_RCC_ClearFlag_PLLI2SRDY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_ClearFlag_PLLI2SRDY(void)\r
+{\r
+  SET_BIT(RCC->CIR, RCC_CIR_PLL3RDYC);\r
+}\r
+#endif /* RCC_PLLI2S_SUPPORT */\r
+\r
+#if defined(RCC_PLL2_SUPPORT)\r
+/**\r
+  * @brief  Clear PLL2 ready interrupt flag\r
+  * @rmtoll CIR          PLL2RDYC      LL_RCC_ClearFlag_PLL2RDY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_ClearFlag_PLL2RDY(void)\r
+{\r
+  SET_BIT(RCC->CIR, RCC_CIR_PLL2RDYC);\r
+}\r
+#endif /* RCC_PLL2_SUPPORT */\r
+\r
+/**\r
+  * @brief  Clear Clock security system interrupt flag\r
+  * @rmtoll CIR         CSSC          LL_RCC_ClearFlag_HSECSS\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_ClearFlag_HSECSS(void)\r
+{\r
+  SET_BIT(RCC->CIR, RCC_CIR_CSSC);\r
+}\r
+\r
+/**\r
+  * @brief  Check if LSI ready interrupt occurred or not\r
+  * @rmtoll CIR         LSIRDYF       LL_RCC_IsActiveFlag_LSIRDY\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_LSIRDY(void)\r
+{\r
+  return (READ_BIT(RCC->CIR, RCC_CIR_LSIRDYF) == (RCC_CIR_LSIRDYF));\r
+}\r
+\r
+/**\r
+  * @brief  Check if LSE ready interrupt occurred or not\r
+  * @rmtoll CIR         LSERDYF       LL_RCC_IsActiveFlag_LSERDY\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_LSERDY(void)\r
+{\r
+  return (READ_BIT(RCC->CIR, RCC_CIR_LSERDYF) == (RCC_CIR_LSERDYF));\r
+}\r
+\r
+/**\r
+  * @brief  Check if HSI ready interrupt occurred or not\r
+  * @rmtoll CIR         HSIRDYF       LL_RCC_IsActiveFlag_HSIRDY\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_HSIRDY(void)\r
+{\r
+  return (READ_BIT(RCC->CIR, RCC_CIR_HSIRDYF) == (RCC_CIR_HSIRDYF));\r
+}\r
+\r
+/**\r
+  * @brief  Check if HSE ready interrupt occurred or not\r
+  * @rmtoll CIR         HSERDYF       LL_RCC_IsActiveFlag_HSERDY\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_HSERDY(void)\r
+{\r
+  return (READ_BIT(RCC->CIR, RCC_CIR_HSERDYF) == (RCC_CIR_HSERDYF));\r
+}\r
+\r
+/**\r
+  * @brief  Check if PLL ready interrupt occurred or not\r
+  * @rmtoll CIR         PLLRDYF       LL_RCC_IsActiveFlag_PLLRDY\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_PLLRDY(void)\r
+{\r
+  return (READ_BIT(RCC->CIR, RCC_CIR_PLLRDYF) == (RCC_CIR_PLLRDYF));\r
+}\r
+\r
+#if defined(RCC_PLLI2S_SUPPORT)\r
+/**\r
+  * @brief  Check if PLLI2S ready interrupt occurred or not\r
+  * @rmtoll CIR          PLL3RDYF      LL_RCC_IsActiveFlag_PLLI2SRDY\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_PLLI2SRDY(void)\r
+{\r
+  return (READ_BIT(RCC->CIR, RCC_CIR_PLL3RDYF) == (RCC_CIR_PLL3RDYF));\r
+}\r
+#endif /* RCC_PLLI2S_SUPPORT */\r
+\r
+#if defined(RCC_PLL2_SUPPORT)\r
+/**\r
+  * @brief  Check if PLL2 ready interrupt occurred or not\r
+  * @rmtoll CIR          PLL2RDYF      LL_RCC_IsActiveFlag_PLL2RDY\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_PLL2RDY(void)\r
+{\r
+  return (READ_BIT(RCC->CIR, RCC_CIR_PLL2RDYF) == (RCC_CIR_PLL2RDYF));\r
+}\r
+#endif /* RCC_PLL2_SUPPORT */\r
+\r
+/**\r
+  * @brief  Check if Clock security system interrupt occurred or not\r
+  * @rmtoll CIR         CSSF          LL_RCC_IsActiveFlag_HSECSS\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_HSECSS(void)\r
+{\r
+  return (READ_BIT(RCC->CIR, RCC_CIR_CSSF) == (RCC_CIR_CSSF));\r
+}\r
+\r
+/**\r
+  * @brief  Check if RCC flag Independent Watchdog reset is set or not.\r
+  * @rmtoll CSR          IWDGRSTF      LL_RCC_IsActiveFlag_IWDGRST\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_IWDGRST(void)\r
+{\r
+  return (READ_BIT(RCC->CSR, RCC_CSR_IWDGRSTF) == (RCC_CSR_IWDGRSTF));\r
+}\r
+\r
+/**\r
+  * @brief  Check if RCC flag Low Power reset is set or not.\r
+  * @rmtoll CSR          LPWRRSTF      LL_RCC_IsActiveFlag_LPWRRST\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_LPWRRST(void)\r
+{\r
+  return (READ_BIT(RCC->CSR, RCC_CSR_LPWRRSTF) == (RCC_CSR_LPWRRSTF));\r
+}\r
+\r
+/**\r
+  * @brief  Check if RCC flag Pin reset is set or not.\r
+  * @rmtoll CSR          PINRSTF       LL_RCC_IsActiveFlag_PINRST\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_PINRST(void)\r
+{\r
+  return (READ_BIT(RCC->CSR, RCC_CSR_PINRSTF) == (RCC_CSR_PINRSTF));\r
+}\r
+\r
+/**\r
+  * @brief  Check if RCC flag POR/PDR reset is set or not.\r
+  * @rmtoll CSR          PORRSTF       LL_RCC_IsActiveFlag_PORRST\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_PORRST(void)\r
+{\r
+  return (READ_BIT(RCC->CSR, RCC_CSR_PORRSTF) == (RCC_CSR_PORRSTF));\r
+}\r
+\r
+/**\r
+  * @brief  Check if RCC flag Software reset is set or not.\r
+  * @rmtoll CSR          SFTRSTF       LL_RCC_IsActiveFlag_SFTRST\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_SFTRST(void)\r
+{\r
+  return (READ_BIT(RCC->CSR, RCC_CSR_SFTRSTF) == (RCC_CSR_SFTRSTF));\r
+}\r
+\r
+/**\r
+  * @brief  Check if RCC flag Window Watchdog reset is set or not.\r
+  * @rmtoll CSR          WWDGRSTF      LL_RCC_IsActiveFlag_WWDGRST\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_WWDGRST(void)\r
+{\r
+  return (READ_BIT(RCC->CSR, RCC_CSR_WWDGRSTF) == (RCC_CSR_WWDGRSTF));\r
+}\r
+\r
+/**\r
+  * @brief  Set RMVF bit to clear the reset flags.\r
+  * @rmtoll CSR          RMVF          LL_RCC_ClearResetFlags\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_ClearResetFlags(void)\r
+{\r
+  SET_BIT(RCC->CSR, RCC_CSR_RMVF);\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup RCC_LL_EF_IT_Management IT Management\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable LSI ready interrupt\r
+  * @rmtoll CIR         LSIRDYIE      LL_RCC_EnableIT_LSIRDY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_EnableIT_LSIRDY(void)\r
+{\r
+  SET_BIT(RCC->CIR, RCC_CIR_LSIRDYIE);\r
+}\r
+\r
+/**\r
+  * @brief  Enable LSE ready interrupt\r
+  * @rmtoll CIR         LSERDYIE      LL_RCC_EnableIT_LSERDY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_EnableIT_LSERDY(void)\r
+{\r
+  SET_BIT(RCC->CIR, RCC_CIR_LSERDYIE);\r
+}\r
+\r
+/**\r
+  * @brief  Enable HSI ready interrupt\r
+  * @rmtoll CIR         HSIRDYIE      LL_RCC_EnableIT_HSIRDY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_EnableIT_HSIRDY(void)\r
+{\r
+  SET_BIT(RCC->CIR, RCC_CIR_HSIRDYIE);\r
+}\r
+\r
+/**\r
+  * @brief  Enable HSE ready interrupt\r
+  * @rmtoll CIR         HSERDYIE      LL_RCC_EnableIT_HSERDY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_EnableIT_HSERDY(void)\r
+{\r
+  SET_BIT(RCC->CIR, RCC_CIR_HSERDYIE);\r
+}\r
+\r
+/**\r
+  * @brief  Enable PLL ready interrupt\r
+  * @rmtoll CIR         PLLRDYIE      LL_RCC_EnableIT_PLLRDY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_EnableIT_PLLRDY(void)\r
+{\r
+  SET_BIT(RCC->CIR, RCC_CIR_PLLRDYIE);\r
+}\r
+\r
+#if defined(RCC_PLLI2S_SUPPORT)\r
+/**\r
+  * @brief  Enable PLLI2S ready interrupt\r
+  * @rmtoll CIR          PLL3RDYIE     LL_RCC_EnableIT_PLLI2SRDY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_EnableIT_PLLI2SRDY(void)\r
+{\r
+  SET_BIT(RCC->CIR, RCC_CIR_PLL3RDYIE);\r
+}\r
+#endif /* RCC_PLLI2S_SUPPORT */\r
+\r
+#if defined(RCC_PLL2_SUPPORT)\r
+/**\r
+  * @brief  Enable PLL2 ready interrupt\r
+  * @rmtoll CIR          PLL2RDYIE     LL_RCC_EnableIT_PLL2RDY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_EnableIT_PLL2RDY(void)\r
+{\r
+  SET_BIT(RCC->CIR, RCC_CIR_PLL2RDYIE);\r
+}\r
+#endif /* RCC_PLL2_SUPPORT */\r
+\r
+/**\r
+  * @brief  Disable LSI ready interrupt\r
+  * @rmtoll CIR         LSIRDYIE      LL_RCC_DisableIT_LSIRDY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_DisableIT_LSIRDY(void)\r
+{\r
+  CLEAR_BIT(RCC->CIR, RCC_CIR_LSIRDYIE);\r
+}\r
+\r
+/**\r
+  * @brief  Disable LSE ready interrupt\r
+  * @rmtoll CIR         LSERDYIE      LL_RCC_DisableIT_LSERDY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_DisableIT_LSERDY(void)\r
+{\r
+  CLEAR_BIT(RCC->CIR, RCC_CIR_LSERDYIE);\r
+}\r
+\r
+/**\r
+  * @brief  Disable HSI ready interrupt\r
+  * @rmtoll CIR         HSIRDYIE      LL_RCC_DisableIT_HSIRDY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_DisableIT_HSIRDY(void)\r
+{\r
+  CLEAR_BIT(RCC->CIR, RCC_CIR_HSIRDYIE);\r
+}\r
+\r
+/**\r
+  * @brief  Disable HSE ready interrupt\r
+  * @rmtoll CIR         HSERDYIE      LL_RCC_DisableIT_HSERDY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_DisableIT_HSERDY(void)\r
+{\r
+  CLEAR_BIT(RCC->CIR, RCC_CIR_HSERDYIE);\r
+}\r
+\r
+/**\r
+  * @brief  Disable PLL ready interrupt\r
+  * @rmtoll CIR         PLLRDYIE      LL_RCC_DisableIT_PLLRDY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_DisableIT_PLLRDY(void)\r
+{\r
+  CLEAR_BIT(RCC->CIR, RCC_CIR_PLLRDYIE);\r
+}\r
+\r
+#if defined(RCC_PLLI2S_SUPPORT)\r
+/**\r
+  * @brief  Disable PLLI2S ready interrupt\r
+  * @rmtoll CIR          PLL3RDYIE     LL_RCC_DisableIT_PLLI2SRDY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_DisableIT_PLLI2SRDY(void)\r
+{\r
+  CLEAR_BIT(RCC->CIR, RCC_CIR_PLL3RDYIE);\r
+}\r
+#endif /* RCC_PLLI2S_SUPPORT */\r
+\r
+#if defined(RCC_PLL2_SUPPORT)\r
+/**\r
+  * @brief  Disable PLL2 ready interrupt\r
+  * @rmtoll CIR          PLL2RDYIE     LL_RCC_DisableIT_PLL2RDY\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_RCC_DisableIT_PLL2RDY(void)\r
+{\r
+  CLEAR_BIT(RCC->CIR, RCC_CIR_PLL2RDYIE);\r
+}\r
+#endif /* RCC_PLL2_SUPPORT */\r
+\r
+/**\r
+  * @brief  Checks if LSI ready interrupt source is enabled or disabled.\r
+  * @rmtoll CIR         LSIRDYIE      LL_RCC_IsEnabledIT_LSIRDY\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_LSIRDY(void)\r
+{\r
+  return (READ_BIT(RCC->CIR, RCC_CIR_LSIRDYIE) == (RCC_CIR_LSIRDYIE));\r
+}\r
+\r
+/**\r
+  * @brief  Checks if LSE ready interrupt source is enabled or disabled.\r
+  * @rmtoll CIR         LSERDYIE      LL_RCC_IsEnabledIT_LSERDY\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_LSERDY(void)\r
+{\r
+  return (READ_BIT(RCC->CIR, RCC_CIR_LSERDYIE) == (RCC_CIR_LSERDYIE));\r
+}\r
+\r
+/**\r
+  * @brief  Checks if HSI ready interrupt source is enabled or disabled.\r
+  * @rmtoll CIR         HSIRDYIE      LL_RCC_IsEnabledIT_HSIRDY\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_HSIRDY(void)\r
+{\r
+  return (READ_BIT(RCC->CIR, RCC_CIR_HSIRDYIE) == (RCC_CIR_HSIRDYIE));\r
+}\r
+\r
+/**\r
+  * @brief  Checks if HSE ready interrupt source is enabled or disabled.\r
+  * @rmtoll CIR         HSERDYIE      LL_RCC_IsEnabledIT_HSERDY\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_HSERDY(void)\r
+{\r
+  return (READ_BIT(RCC->CIR, RCC_CIR_HSERDYIE) == (RCC_CIR_HSERDYIE));\r
+}\r
+\r
+/**\r
+  * @brief  Checks if PLL ready interrupt source is enabled or disabled.\r
+  * @rmtoll CIR         PLLRDYIE      LL_RCC_IsEnabledIT_PLLRDY\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_PLLRDY(void)\r
+{\r
+  return (READ_BIT(RCC->CIR, RCC_CIR_PLLRDYIE) == (RCC_CIR_PLLRDYIE));\r
+}\r
+\r
+#if defined(RCC_PLLI2S_SUPPORT)\r
+/**\r
+  * @brief  Checks if PLLI2S ready interrupt source is enabled or disabled.\r
+  * @rmtoll CIR          PLL3RDYIE     LL_RCC_IsEnabledIT_PLLI2SRDY\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_PLLI2SRDY(void)\r
+{\r
+  return (READ_BIT(RCC->CIR, RCC_CIR_PLL3RDYIE) == (RCC_CIR_PLL3RDYIE));\r
+}\r
+#endif /* RCC_PLLI2S_SUPPORT */\r
+\r
+#if defined(RCC_PLL2_SUPPORT)\r
+/**\r
+  * @brief  Checks if PLL2 ready interrupt source is enabled or disabled.\r
+  * @rmtoll CIR          PLL2RDYIE     LL_RCC_IsEnabledIT_PLL2RDY\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_PLL2RDY(void)\r
+{\r
+  return (READ_BIT(RCC->CIR, RCC_CIR_PLL2RDYIE) == (RCC_CIR_PLL2RDYIE));\r
+}\r
+#endif /* RCC_PLL2_SUPPORT */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#if defined(USE_FULL_LL_DRIVER)\r
+/** @defgroup RCC_LL_EF_Init De-initialization function\r
+  * @{\r
+  */\r
+ErrorStatus LL_RCC_DeInit(void);\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup RCC_LL_EF_Get_Freq Get system and peripherals clocks frequency functions\r
+  * @{\r
+  */\r
+void        LL_RCC_GetSystemClocksFreq(LL_RCC_ClocksTypeDef *RCC_Clocks);\r
+#if defined(RCC_CFGR2_I2S2SRC)\r
+uint32_t    LL_RCC_GetI2SClockFreq(uint32_t I2SxSource);\r
+#endif /* RCC_CFGR2_I2S2SRC */\r
+#if defined(USB_OTG_FS) || defined(USB)\r
+uint32_t    LL_RCC_GetUSBClockFreq(uint32_t USBxSource);\r
+#endif /* USB_OTG_FS || USB */\r
+uint32_t    LL_RCC_GetADCClockFreq(uint32_t ADCxSource);\r
+/**\r
+  * @}\r
+  */\r
+#endif /* USE_FULL_LL_DRIVER */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* RCC */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __STM32F1xx_LL_RCC_H */\r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_system.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_system.h
new file mode 100644 (file)
index 0000000..b22f8df
--- /dev/null
@@ -0,0 +1,574 @@
+/**\r
+  ******************************************************************************\r
+  * @file    stm32f1xx_ll_system.h\r
+  * @author  MCD Application Team\r
+  * @brief   Header file of SYSTEM LL module.\r
+  @verbatim\r
+  ==============================================================================\r
+                     ##### How to use this driver #####\r
+  ==============================================================================\r
+    [..]\r
+    The LL SYSTEM driver contains a set of generic APIs that can be\r
+    used by user:\r
+      (+) Some of the FLASH features need to be handled in the SYSTEM file.\r
+      (+) Access to DBGCMU registers\r
+      (+) Access to SYSCFG registers\r
+\r
+  @endverbatim\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+\r
+/* Define to prevent recursive inclusion -------------------------------------*/\r
+#ifndef __STM32F1xx_LL_SYSTEM_H\r
+#define __STM32F1xx_LL_SYSTEM_H\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/* Includes ------------------------------------------------------------------*/\r
+#include "stm32f1xx.h"\r
+\r
+/** @addtogroup STM32F1xx_LL_Driver\r
+  * @{\r
+  */\r
+\r
+#if defined (FLASH) || defined (DBGMCU)\r
+\r
+/** @defgroup SYSTEM_LL SYSTEM\r
+  * @{\r
+  */\r
+\r
+/* Private types -------------------------------------------------------------*/\r
+/* Private variables ---------------------------------------------------------*/\r
+\r
+/* Private constants ---------------------------------------------------------*/\r
+/** @defgroup SYSTEM_LL_Private_Constants SYSTEM Private Constants\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Private macros ------------------------------------------------------------*/\r
+\r
+/* Exported types ------------------------------------------------------------*/\r
+/* Exported constants --------------------------------------------------------*/\r
+/** @defgroup SYSTEM_LL_Exported_Constants SYSTEM Exported Constants\r
+  * @{\r
+  */\r
+\r
+\r
+\r
+/** @defgroup SYSTEM_LL_EC_TRACE DBGMCU TRACE Pin Assignment\r
+  * @{\r
+  */\r
+#define LL_DBGMCU_TRACE_NONE               0x00000000U                                     /*!< TRACE pins not assigned (default state) */\r
+#define LL_DBGMCU_TRACE_ASYNCH             DBGMCU_CR_TRACE_IOEN                            /*!< TRACE pin assignment for Asynchronous Mode */\r
+#define LL_DBGMCU_TRACE_SYNCH_SIZE1        (DBGMCU_CR_TRACE_IOEN | DBGMCU_CR_TRACE_MODE_0) /*!< TRACE pin assignment for Synchronous Mode with a TRACEDATA size of 1 */\r
+#define LL_DBGMCU_TRACE_SYNCH_SIZE2        (DBGMCU_CR_TRACE_IOEN | DBGMCU_CR_TRACE_MODE_1) /*!< TRACE pin assignment for Synchronous Mode with a TRACEDATA size of 2 */\r
+#define LL_DBGMCU_TRACE_SYNCH_SIZE4        (DBGMCU_CR_TRACE_IOEN | DBGMCU_CR_TRACE_MODE)   /*!< TRACE pin assignment for Synchronous Mode with a TRACEDATA size of 4 */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup SYSTEM_LL_EC_APB1_GRP1_STOP_IP DBGMCU APB1 GRP1 STOP IP\r
+  * @{\r
+  */\r
+#define LL_DBGMCU_APB1_GRP1_TIM2_STOP      DBGMCU_CR_DBG_TIM2_STOP          /*!< TIM2 counter stopped when core is halted */\r
+#define LL_DBGMCU_APB1_GRP1_TIM3_STOP      DBGMCU_CR_DBG_TIM3_STOP          /*!< TIM3 counter stopped when core is halted */\r
+#define LL_DBGMCU_APB1_GRP1_TIM4_STOP      DBGMCU_CR_DBG_TIM4_STOP          /*!< TIM4 counter stopped when core is halted */\r
+#if defined(DBGMCU_CR_DBG_TIM5_STOP)\r
+#define LL_DBGMCU_APB1_GRP1_TIM5_STOP      DBGMCU_CR_DBG_TIM5_STOP          /*!< TIM5 counter stopped when core is halted */\r
+#endif /* DBGMCU_CR_DBG_TIM5_STOP */\r
+#if defined(DBGMCU_CR_DBG_TIM6_STOP)\r
+#define LL_DBGMCU_APB1_GRP1_TIM6_STOP      DBGMCU_CR_DBG_TIM6_STOP          /*!< TIM6 counter stopped when core is halted */\r
+#endif /* DBGMCU_CR_DBG_TIM6_STOP */\r
+#if defined(DBGMCU_CR_DBG_TIM7_STOP)\r
+#define LL_DBGMCU_APB1_GRP1_TIM7_STOP      DBGMCU_CR_DBG_TIM7_STOP          /*!< TIM7 counter stopped when core is halted */\r
+#endif /* DBGMCU_CR_DBG_TIM7_STOP */\r
+#if defined(DBGMCU_CR_DBG_TIM12_STOP)\r
+#define LL_DBGMCU_APB1_GRP1_TIM12_STOP     DBGMCU_CR_DBG_TIM12_STOP         /*!< TIM12 counter stopped when core is halted */\r
+#endif /* DBGMCU_CR_DBG_TIM12_STOP */\r
+#if defined(DBGMCU_CR_DBG_TIM13_STOP)\r
+#define LL_DBGMCU_APB1_GRP1_TIM13_STOP     DBGMCU_CR_DBG_TIM13_STOP         /*!< TIM13 counter stopped when core is halted */\r
+#endif /* DBGMCU_CR_DBG_TIM13_STOP */\r
+#if defined(DBGMCU_CR_DBG_TIM14_STOP)\r
+#define LL_DBGMCU_APB1_GRP1_TIM14_STOP     DBGMCU_CR_DBG_TIM14_STOP         /*!< TIM14 counter stopped when core is halted */\r
+#endif /* DBGMCU_CR_DBG_TIM14_STOP */\r
+#define LL_DBGMCU_APB1_GRP1_WWDG_STOP      DBGMCU_CR_DBG_WWDG_STOP          /*!< Debug Window Watchdog stopped when Core is halted */\r
+#define LL_DBGMCU_APB1_GRP1_IWDG_STOP      DBGMCU_CR_DBG_IWDG_STOP          /*!< Debug Independent Watchdog stopped when Core is halted */\r
+#define LL_DBGMCU_APB1_GRP1_I2C1_STOP      DBGMCU_CR_DBG_I2C1_SMBUS_TIMEOUT /*!< I2C1 SMBUS timeout mode stopped when Core is halted */\r
+#if defined(DBGMCU_CR_DBG_I2C2_SMBUS_TIMEOUT)\r
+#define LL_DBGMCU_APB1_GRP1_I2C2_STOP      DBGMCU_CR_DBG_I2C2_SMBUS_TIMEOUT /*!< I2C2 SMBUS timeout mode stopped when Core is halted */\r
+#endif /* DBGMCU_CR_DBG_I2C2_SMBUS_TIMEOUT */\r
+#if defined(DBGMCU_CR_DBG_CAN1_STOP)\r
+#define LL_DBGMCU_APB1_GRP1_CAN1_STOP      DBGMCU_CR_DBG_CAN1_STOP          /*!< CAN1 debug stopped when Core is halted  */\r
+#endif /* DBGMCU_CR_DBG_CAN1_STOP */\r
+#if defined(DBGMCU_CR_DBG_CAN2_STOP)\r
+#define LL_DBGMCU_APB1_GRP1_CAN2_STOP      DBGMCU_CR_DBG_CAN2_STOP          /*!< CAN2 debug stopped when Core is halted  */\r
+#endif /* DBGMCU_CR_DBG_CAN2_STOP */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup SYSTEM_LL_EC_APB2_GRP1_STOP_IP DBGMCU APB2 GRP1 STOP IP\r
+  * @{\r
+  */\r
+#define LL_DBGMCU_APB2_GRP1_TIM1_STOP      DBGMCU_CR_DBG_TIM1_STOP   /*!< TIM1 counter stopped when core is halted */\r
+#if defined(DBGMCU_CR_DBG_TIM8_STOP)\r
+#define LL_DBGMCU_APB2_GRP1_TIM8_STOP      DBGMCU_CR_DBG_TIM8_STOP   /*!< TIM8 counter stopped when core is halted */\r
+#endif /* DBGMCU_CR_DBG_CAN1_STOP */\r
+#if defined(DBGMCU_CR_DBG_TIM9_STOP)\r
+#define LL_DBGMCU_APB2_GRP1_TIM9_STOP      DBGMCU_CR_DBG_TIM9_STOP   /*!< TIM9 counter stopped when core is halted */\r
+#endif /* DBGMCU_CR_DBG_TIM9_STOP */\r
+#if defined(DBGMCU_CR_DBG_TIM10_STOP)\r
+#define LL_DBGMCU_APB2_GRP1_TIM10_STOP     DBGMCU_CR_DBG_TIM10_STOP   /*!< TIM10 counter stopped when core is halted */\r
+#endif /* DBGMCU_CR_DBG_TIM10_STOP */\r
+#if defined(DBGMCU_CR_DBG_TIM11_STOP)\r
+#define LL_DBGMCU_APB2_GRP1_TIM11_STOP     DBGMCU_CR_DBG_TIM11_STOP   /*!< TIM11 counter stopped when core is halted */\r
+#endif /* DBGMCU_CR_DBG_TIM11_STOP */\r
+#if defined(DBGMCU_CR_DBG_TIM15_STOP)\r
+#define LL_DBGMCU_APB2_GRP1_TIM15_STOP     DBGMCU_CR_DBG_TIM15_STOP   /*!< TIM15 counter stopped when core is halted */\r
+#endif /* DBGMCU_CR_DBG_TIM15_STOP */\r
+#if defined(DBGMCU_CR_DBG_TIM16_STOP)\r
+#define LL_DBGMCU_APB2_GRP1_TIM16_STOP     DBGMCU_CR_DBG_TIM16_STOP   /*!< TIM16 counter stopped when core is halted */\r
+#endif /* DBGMCU_CR_DBG_TIM16_STOP */\r
+#if defined(DBGMCU_CR_DBG_TIM17_STOP)\r
+#define LL_DBGMCU_APB2_GRP1_TIM17_STOP     DBGMCU_CR_DBG_TIM17_STOP   /*!< TIM17 counter stopped when core is halted */\r
+#endif /* DBGMCU_CR_DBG_TIM17_STOP */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup SYSTEM_LL_EC_LATENCY FLASH LATENCY\r
+  * @{\r
+  */\r
+#if defined(FLASH_ACR_LATENCY)\r
+#define LL_FLASH_LATENCY_0                 0x00000000U             /*!< FLASH Zero Latency cycle */\r
+#define LL_FLASH_LATENCY_1                 FLASH_ACR_LATENCY_0     /*!< FLASH One Latency cycle */\r
+#define LL_FLASH_LATENCY_2                 FLASH_ACR_LATENCY_1     /*!< FLASH Two wait states */\r
+#else\r
+#endif /* FLASH_ACR_LATENCY */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Exported macro ------------------------------------------------------------*/\r
+\r
+/* Exported functions --------------------------------------------------------*/\r
+/** @defgroup SYSTEM_LL_Exported_Functions SYSTEM Exported Functions\r
+  * @{\r
+  */\r
+\r
+\r
+\r
+/** @defgroup SYSTEM_LL_EF_DBGMCU DBGMCU\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Return the device identifier\r
+  * @note For Low Density devices, the device ID is 0x412\r
+  * @note For Medium Density devices, the device ID is 0x410\r
+  * @note For High Density devices, the device ID is 0x414\r
+  * @note For XL Density devices, the device ID is 0x430\r
+  * @note For Connectivity Line devices, the device ID is 0x418\r
+  * @rmtoll DBGMCU_IDCODE DEV_ID        LL_DBGMCU_GetDeviceID\r
+  * @retval Values between Min_Data=0x00 and Max_Data=0xFFF\r
+  */\r
+__STATIC_INLINE uint32_t LL_DBGMCU_GetDeviceID(void)\r
+{\r
+  return (uint32_t)(READ_BIT(DBGMCU->IDCODE, DBGMCU_IDCODE_DEV_ID));\r
+}\r
+\r
+/**\r
+  * @brief  Return the device revision identifier\r
+  * @note This field indicates the revision of the device.\r
+          For example, it is read as revA -> 0x1000,for Low Density devices\r
+          For example, it is read as revA -> 0x0000, revB -> 0x2000, revZ -> 0x2001, rev1,2,3,X or Y -> 0x2003,for Medium Density devices\r
+          For example, it is read as revA or 1 -> 0x1000, revZ -> 0x1001,rev1,2,3,X or Y -> 0x1003,for Medium Density devices\r
+          For example, it is read as revA or 1 -> 0x1003,for XL Density devices\r
+          For example, it is read as revA -> 0x1000, revZ -> 0x1001 for  Connectivity line devices\r
+  * @rmtoll DBGMCU_IDCODE REV_ID        LL_DBGMCU_GetRevisionID\r
+  * @retval Values between Min_Data=0x00 and Max_Data=0xFFFF\r
+  */\r
+__STATIC_INLINE uint32_t LL_DBGMCU_GetRevisionID(void)\r
+{\r
+  return (uint32_t)(READ_BIT(DBGMCU->IDCODE, DBGMCU_IDCODE_REV_ID) >> DBGMCU_IDCODE_REV_ID_Pos);\r
+}\r
+\r
+/**\r
+  * @brief  Enable the Debug Module during SLEEP mode\r
+  * @rmtoll DBGMCU_CR    DBG_SLEEP     LL_DBGMCU_EnableDBGSleepMode\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DBGMCU_EnableDBGSleepMode(void)\r
+{\r
+  SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP);\r
+}\r
+\r
+/**\r
+  * @brief  Disable the Debug Module during SLEEP mode\r
+  * @rmtoll DBGMCU_CR    DBG_SLEEP     LL_DBGMCU_DisableDBGSleepMode\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DBGMCU_DisableDBGSleepMode(void)\r
+{\r
+  CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP);\r
+}\r
+\r
+/**\r
+  * @brief  Enable the Debug Module during STOP mode\r
+  * @rmtoll DBGMCU_CR    DBG_STOP      LL_DBGMCU_EnableDBGStopMode\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DBGMCU_EnableDBGStopMode(void)\r
+{\r
+  SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP);\r
+}\r
+\r
+/**\r
+  * @brief  Disable the Debug Module during STOP mode\r
+  * @rmtoll DBGMCU_CR    DBG_STOP      LL_DBGMCU_DisableDBGStopMode\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DBGMCU_DisableDBGStopMode(void)\r
+{\r
+  CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP);\r
+}\r
+\r
+/**\r
+  * @brief  Enable the Debug Module during STANDBY mode\r
+  * @rmtoll DBGMCU_CR    DBG_STANDBY   LL_DBGMCU_EnableDBGStandbyMode\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DBGMCU_EnableDBGStandbyMode(void)\r
+{\r
+  SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY);\r
+}\r
+\r
+/**\r
+  * @brief  Disable the Debug Module during STANDBY mode\r
+  * @rmtoll DBGMCU_CR    DBG_STANDBY   LL_DBGMCU_DisableDBGStandbyMode\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DBGMCU_DisableDBGStandbyMode(void)\r
+{\r
+  CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY);\r
+}\r
+\r
+/**\r
+  * @brief  Set Trace pin assignment control\r
+  * @rmtoll DBGMCU_CR    TRACE_IOEN    LL_DBGMCU_SetTracePinAssignment\n\r
+  *         DBGMCU_CR    TRACE_MODE    LL_DBGMCU_SetTracePinAssignment\r
+  * @param  PinAssignment This parameter can be one of the following values:\r
+  *         @arg @ref LL_DBGMCU_TRACE_NONE\r
+  *         @arg @ref LL_DBGMCU_TRACE_ASYNCH\r
+  *         @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE1\r
+  *         @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE2\r
+  *         @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE4\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DBGMCU_SetTracePinAssignment(uint32_t PinAssignment)\r
+{\r
+  MODIFY_REG(DBGMCU->CR, DBGMCU_CR_TRACE_IOEN | DBGMCU_CR_TRACE_MODE, PinAssignment);\r
+}\r
+\r
+/**\r
+  * @brief  Get Trace pin assignment control\r
+  * @rmtoll DBGMCU_CR    TRACE_IOEN    LL_DBGMCU_GetTracePinAssignment\n\r
+  *         DBGMCU_CR    TRACE_MODE    LL_DBGMCU_GetTracePinAssignment\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_DBGMCU_TRACE_NONE\r
+  *         @arg @ref LL_DBGMCU_TRACE_ASYNCH\r
+  *         @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE1\r
+  *         @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE2\r
+  *         @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE4\r
+  */\r
+__STATIC_INLINE uint32_t LL_DBGMCU_GetTracePinAssignment(void)\r
+{\r
+  return (uint32_t)(READ_BIT(DBGMCU->CR, DBGMCU_CR_TRACE_IOEN | DBGMCU_CR_TRACE_MODE));\r
+}\r
+\r
+/**\r
+  * @brief  Freeze APB1 peripherals (group1 peripherals)\r
+  * @rmtoll DBGMCU_CR_APB1      DBG_TIM2_STOP           LL_DBGMCU_APB1_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_TIM3_STOP           LL_DBGMCU_APB1_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_TIM4_STOP           LL_DBGMCU_APB1_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_TIM5_STOP           LL_DBGMCU_APB1_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_TIM6_STOP           LL_DBGMCU_APB1_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_TIM7_STOP           LL_DBGMCU_APB1_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_TIM12_STOP          LL_DBGMCU_APB1_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_TIM13_STOP          LL_DBGMCU_APB1_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_TIM14_STOP          LL_DBGMCU_APB1_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_RTC_STOP            LL_DBGMCU_APB1_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_WWDG_STOP           LL_DBGMCU_APB1_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_IWDG_STOP           LL_DBGMCU_APB1_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_I2C1_SMBUS_TIMEOUT  LL_DBGMCU_APB1_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_I2C2_SMBUS_TIMEOUT  LL_DBGMCU_APB1_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_CAN1_STOP           LL_DBGMCU_APB1_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_CAN2_STOP           LL_DBGMCU_APB1_GRP1_FreezePeriph\r
+  * @param  Periphs This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_TIM2_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_TIM3_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_TIM4_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_TIM5_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_TIM6_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_TIM7_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_TIM12_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_TIM13_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_TIM14_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_WWDG_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_IWDG_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_I2C1_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_I2C2_STOP (*)\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_CAN1_STOP (*)\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_CAN2_STOP (*)\r
+  *\r
+  *         (*) value not defined in all devices.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DBGMCU_APB1_GRP1_FreezePeriph(uint32_t Periphs)\r
+{\r
+  SET_BIT(DBGMCU->CR, Periphs);\r
+}\r
+\r
+/**\r
+  * @brief  Unfreeze APB1 peripherals (group1 peripherals)\r
+  * @rmtoll DBGMCU_CR_APB1      DBG_TIM2_STOP           LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_TIM3_STOP           LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_TIM4_STOP           LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_TIM5_STOP           LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_TIM6_STOP           LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_TIM7_STOP           LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_TIM12_STOP          LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_TIM13_STOP          LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_TIM14_STOP          LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_RTC_STOP            LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_WWDG_STOP           LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_IWDG_STOP           LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_I2C1_SMBUS_TIMEOUT  LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_I2C2_SMBUS_TIMEOUT  LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_CAN1_STOP           LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n\r
+  *         DBGMCU_CR_APB1      DBG_CAN2_STOP           LL_DBGMCU_APB1_GRP1_UnFreezePeriph\r
+  * @param  Periphs This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_TIM2_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_TIM3_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_TIM4_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_TIM5_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_TIM6_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_TIM7_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_TIM12_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_TIM13_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_TIM14_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_RTC_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_WWDG_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_IWDG_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_I2C1_STOP\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_I2C2_STOP (*)\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_CAN1_STOP (*)\r
+  *         @arg @ref LL_DBGMCU_APB1_GRP1_CAN2_STOP (*)\r
+  *\r
+  *         (*) value not defined in all devices.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DBGMCU_APB1_GRP1_UnFreezePeriph(uint32_t Periphs)\r
+{\r
+  CLEAR_BIT(DBGMCU->CR, Periphs);\r
+}\r
+\r
+/**\r
+  * @brief  Freeze APB2 peripherals\r
+  * @rmtoll DBGMCU_CR_APB2      DBG_TIM1_STOP    LL_DBGMCU_APB2_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB2      DBG_TIM8_STOP    LL_DBGMCU_APB2_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB2      DBG_TIM9_STOP    LL_DBGMCU_APB2_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB2      DBG_TIM10_STOP   LL_DBGMCU_APB2_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB2      DBG_TIM11_STOP   LL_DBGMCU_APB2_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB2      DBG_TIM15_STOP   LL_DBGMCU_APB2_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB2      DBG_TIM16_STOP   LL_DBGMCU_APB2_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB2      DBG_TIM17_STOP   LL_DBGMCU_APB2_GRP1_FreezePeriph\r
+  * @param  Periphs This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_DBGMCU_APB2_GRP1_TIM1_STOP\r
+  *         @arg @ref LL_DBGMCU_APB2_GRP1_TIM8_STOP (*)\r
+  *         @arg @ref LL_DBGMCU_APB2_GRP1_TIM9_STOP (*)\r
+  *         @arg @ref LL_DBGMCU_APB2_GRP1_TIM10_STOP (*)\r
+  *         @arg @ref LL_DBGMCU_APB2_GRP1_TIM11_STOP (*)\r
+  *         @arg @ref LL_DBGMCU_APB2_GRP1_TIM15_STOP (*)\r
+  *         @arg @ref LL_DBGMCU_APB2_GRP1_TIM16_STOP (*)\r
+  *         @arg @ref LL_DBGMCU_APB2_GRP1_TIM17_STOP (*)\r
+  *\r
+  *         (*) value not defined in all devices.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DBGMCU_APB2_GRP1_FreezePeriph(uint32_t Periphs)\r
+{\r
+  SET_BIT(DBGMCU->CR, Periphs);\r
+}\r
+\r
+/**\r
+  * @brief  Unfreeze APB2 peripherals\r
+  * @rmtoll DBGMCU_CR_APB2      DBG_TIM1_STOP    LL_DBGMCU_APB2_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB2      DBG_TIM8_STOP    LL_DBGMCU_APB2_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB2      DBG_TIM9_STOP    LL_DBGMCU_APB2_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB2      DBG_TIM10_STOP   LL_DBGMCU_APB2_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB2      DBG_TIM11_STOP   LL_DBGMCU_APB2_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB2      DBG_TIM15_STOP   LL_DBGMCU_APB2_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB2      DBG_TIM16_STOP   LL_DBGMCU_APB2_GRP1_FreezePeriph\n\r
+  *         DBGMCU_CR_APB2      DBG_TIM17_STOP   LL_DBGMCU_APB2_GRP1_FreezePeriph\r
+  * @param  Periphs This parameter can be a combination of the following values:\r
+  *         @arg @ref LL_DBGMCU_APB2_GRP1_TIM1_STOP\r
+  *         @arg @ref LL_DBGMCU_APB2_GRP1_TIM8_STOP (*)\r
+  *         @arg @ref LL_DBGMCU_APB2_GRP1_TIM9_STOP (*)\r
+  *         @arg @ref LL_DBGMCU_APB2_GRP1_TIM10_STOP (*)\r
+  *         @arg @ref LL_DBGMCU_APB2_GRP1_TIM11_STOP (*)\r
+  *         @arg @ref LL_DBGMCU_APB2_GRP1_TIM15_STOP (*)\r
+  *         @arg @ref LL_DBGMCU_APB2_GRP1_TIM16_STOP (*)\r
+  *         @arg @ref LL_DBGMCU_APB2_GRP1_TIM17_STOP (*)\r
+  *\r
+  *         (*) value not defined in all devices.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_DBGMCU_APB2_GRP1_UnFreezePeriph(uint32_t Periphs)\r
+{\r
+  CLEAR_BIT(DBGMCU->CR, Periphs);\r
+}\r
+/**\r
+  * @}\r
+  */\r
+\r
+#if defined(FLASH_ACR_LATENCY)\r
+/** @defgroup SYSTEM_LL_EF_FLASH FLASH\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Set FLASH Latency\r
+  * @rmtoll FLASH_ACR    LATENCY       LL_FLASH_SetLatency\r
+  * @param  Latency This parameter can be one of the following values:\r
+  *         @arg @ref LL_FLASH_LATENCY_0\r
+  *         @arg @ref LL_FLASH_LATENCY_1\r
+  *         @arg @ref LL_FLASH_LATENCY_2\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_FLASH_SetLatency(uint32_t Latency)\r
+{\r
+  MODIFY_REG(FLASH->ACR, FLASH_ACR_LATENCY, Latency);\r
+}\r
+\r
+/**\r
+  * @brief  Get FLASH Latency\r
+  * @rmtoll FLASH_ACR    LATENCY       LL_FLASH_GetLatency\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_FLASH_LATENCY_0\r
+  *         @arg @ref LL_FLASH_LATENCY_1\r
+  *         @arg @ref LL_FLASH_LATENCY_2\r
+  */\r
+__STATIC_INLINE uint32_t LL_FLASH_GetLatency(void)\r
+{\r
+  return (uint32_t)(READ_BIT(FLASH->ACR, FLASH_ACR_LATENCY));\r
+}\r
+\r
+/**\r
+  * @brief  Enable Prefetch\r
+  * @rmtoll FLASH_ACR    PRFTBE        LL_FLASH_EnablePrefetch\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_FLASH_EnablePrefetch(void)\r
+{\r
+  SET_BIT(FLASH->ACR, FLASH_ACR_PRFTBE);\r
+}\r
+\r
+/**\r
+  * @brief  Disable Prefetch\r
+  * @rmtoll FLASH_ACR    PRFTBE        LL_FLASH_DisablePrefetch\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_FLASH_DisablePrefetch(void)\r
+{\r
+  CLEAR_BIT(FLASH->ACR, FLASH_ACR_PRFTBE);\r
+}\r
+\r
+/**\r
+  * @brief  Check if Prefetch buffer is enabled\r
+  * @rmtoll FLASH_ACR    PRFTBS        LL_FLASH_IsPrefetchEnabled\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_FLASH_IsPrefetchEnabled(void)\r
+{\r
+  return (READ_BIT(FLASH->ACR, FLASH_ACR_PRFTBS) == (FLASH_ACR_PRFTBS));\r
+}\r
+\r
+#endif /* FLASH_ACR_LATENCY */\r
+/**\r
+  * @brief  Enable Flash Half Cycle Access\r
+  * @rmtoll FLASH_ACR    HLFCYA        LL_FLASH_EnableHalfCycleAccess\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_FLASH_EnableHalfCycleAccess(void)\r
+{\r
+  SET_BIT(FLASH->ACR, FLASH_ACR_HLFCYA);\r
+}\r
+\r
+/**\r
+  * @brief  Disable Flash Half Cycle Access\r
+  * @rmtoll FLASH_ACR    HLFCYA        LL_FLASH_DisableHalfCycleAccess\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_FLASH_DisableHalfCycleAccess(void)\r
+{\r
+  CLEAR_BIT(FLASH->ACR, FLASH_ACR_HLFCYA);\r
+}\r
+\r
+/**\r
+  * @brief  Check if  Flash Half Cycle Access is enabled or not\r
+  * @rmtoll FLASH_ACR    HLFCYA        LL_FLASH_IsHalfCycleAccessEnabled\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_FLASH_IsHalfCycleAccessEnabled(void)\r
+{\r
+  return (READ_BIT(FLASH->ACR, FLASH_ACR_HLFCYA) == (FLASH_ACR_HLFCYA));\r
+}\r
+\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* defined (FLASH) || defined (DBGMCU) */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __STM32F1xx_LL_SYSTEM_H */\r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usart.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usart.h
new file mode 100644 (file)
index 0000000..a8a4c23
--- /dev/null
@@ -0,0 +1,2569 @@
+/**\r
+  ******************************************************************************\r
+  * @file    stm32f1xx_ll_usart.h\r
+  * @author  MCD Application Team\r
+  * @brief   Header file of USART LL module.\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+\r
+/* Define to prevent recursive inclusion -------------------------------------*/\r
+#ifndef __STM32F1xx_LL_USART_H\r
+#define __STM32F1xx_LL_USART_H\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/* Includes ------------------------------------------------------------------*/\r
+#include "stm32f1xx.h"\r
+\r
+/** @addtogroup STM32F1xx_LL_Driver\r
+  * @{\r
+  */\r
+\r
+#if defined (USART1) || defined (USART2) || defined (USART3) || defined (UART4) || defined (UART5)\r
+\r
+/** @defgroup USART_LL USART\r
+  * @{\r
+  */\r
+\r
+/* Private types -------------------------------------------------------------*/\r
+/* Private variables ---------------------------------------------------------*/\r
+\r
+/* Private constants ---------------------------------------------------------*/\r
+/** @defgroup USART_LL_Private_Constants USART Private Constants\r
+  * @{\r
+  */\r
+\r
+/* Defines used for the bit position in the register and perform offsets*/\r
+#define USART_POSITION_GTPR_GT                  USART_GTPR_GT_Pos\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Private macros ------------------------------------------------------------*/\r
+#if defined(USE_FULL_LL_DRIVER)\r
+/** @defgroup USART_LL_Private_Macros USART Private Macros\r
+  * @{\r
+  */\r
+/**\r
+  * @}\r
+  */\r
+#endif /*USE_FULL_LL_DRIVER*/\r
+\r
+/* Exported types ------------------------------------------------------------*/\r
+#if defined(USE_FULL_LL_DRIVER)\r
+/** @defgroup USART_LL_ES_INIT USART Exported Init structures\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief LL USART Init Structure definition\r
+  */\r
+typedef struct\r
+{\r
+  uint32_t BaudRate;                  /*!< This field defines expected Usart communication baud rate.\r
+\r
+                                           This feature can be modified afterwards using unitary function @ref LL_USART_SetBaudRate().*/\r
+\r
+  uint32_t DataWidth;                 /*!< Specifies the number of data bits transmitted or received in a frame.\r
+                                           This parameter can be a value of @ref USART_LL_EC_DATAWIDTH.\r
+\r
+                                           This feature can be modified afterwards using unitary function @ref LL_USART_SetDataWidth().*/\r
+\r
+  uint32_t StopBits;                  /*!< Specifies the number of stop bits transmitted.\r
+                                           This parameter can be a value of @ref USART_LL_EC_STOPBITS.\r
+\r
+                                           This feature can be modified afterwards using unitary function @ref LL_USART_SetStopBitsLength().*/\r
+\r
+  uint32_t Parity;                    /*!< Specifies the parity mode.\r
+                                           This parameter can be a value of @ref USART_LL_EC_PARITY.\r
+\r
+                                           This feature can be modified afterwards using unitary function @ref LL_USART_SetParity().*/\r
+\r
+  uint32_t TransferDirection;         /*!< Specifies whether the Receive and/or Transmit mode is enabled or disabled.\r
+                                           This parameter can be a value of @ref USART_LL_EC_DIRECTION.\r
+\r
+                                           This feature can be modified afterwards using unitary function @ref LL_USART_SetTransferDirection().*/\r
+\r
+  uint32_t HardwareFlowControl;       /*!< Specifies whether the hardware flow control mode is enabled or disabled.\r
+                                           This parameter can be a value of @ref USART_LL_EC_HWCONTROL.\r
+\r
+                                           This feature can be modified afterwards using unitary function @ref LL_USART_SetHWFlowCtrl().*/\r
+\r
+  uint32_t OverSampling;              /*!< Specifies whether USART oversampling mode is 16 or 8.\r
+                                           This parameter can be a value of @ref USART_LL_EC_OVERSAMPLING.\r
+\r
+                                           This feature can be modified afterwards using unitary function @ref LL_USART_SetOverSampling().*/\r
+\r
+} LL_USART_InitTypeDef;\r
+\r
+/**\r
+  * @brief LL USART Clock Init Structure definition\r
+  */\r
+typedef struct\r
+{\r
+  uint32_t ClockOutput;               /*!< Specifies whether the USART clock is enabled or disabled.\r
+                                           This parameter can be a value of @ref USART_LL_EC_CLOCK.\r
+\r
+                                           USART HW configuration can be modified afterwards using unitary functions\r
+                                           @ref LL_USART_EnableSCLKOutput() or @ref LL_USART_DisableSCLKOutput().\r
+                                           For more details, refer to description of this function. */\r
+\r
+  uint32_t ClockPolarity;             /*!< Specifies the steady state of the serial clock.\r
+                                           This parameter can be a value of @ref USART_LL_EC_POLARITY.\r
+\r
+                                           USART HW configuration can be modified afterwards using unitary functions @ref LL_USART_SetClockPolarity().\r
+                                           For more details, refer to description of this function. */\r
+\r
+  uint32_t ClockPhase;                /*!< Specifies the clock transition on which the bit capture is made.\r
+                                           This parameter can be a value of @ref USART_LL_EC_PHASE.\r
+\r
+                                           USART HW configuration can be modified afterwards using unitary functions @ref LL_USART_SetClockPhase().\r
+                                           For more details, refer to description of this function. */\r
+\r
+  uint32_t LastBitClockPulse;         /*!< Specifies whether the clock pulse corresponding to the last transmitted\r
+                                           data bit (MSB) has to be output on the SCLK pin in synchronous mode.\r
+                                           This parameter can be a value of @ref USART_LL_EC_LASTCLKPULSE.\r
+\r
+                                           USART HW configuration can be modified afterwards using unitary functions @ref LL_USART_SetLastClkPulseOutput().\r
+                                           For more details, refer to description of this function. */\r
+\r
+} LL_USART_ClockInitTypeDef;\r
+\r
+/**\r
+  * @}\r
+  */\r
+#endif /* USE_FULL_LL_DRIVER */\r
+\r
+/* Exported constants --------------------------------------------------------*/\r
+/** @defgroup USART_LL_Exported_Constants USART Exported Constants\r
+  * @{\r
+  */\r
+\r
+/** @defgroup USART_LL_EC_GET_FLAG Get Flags Defines\r
+  * @brief    Flags defines which can be used with LL_USART_ReadReg function\r
+  * @{\r
+  */\r
+#define LL_USART_SR_PE                          USART_SR_PE                   /*!< Parity error flag */\r
+#define LL_USART_SR_FE                          USART_SR_FE                   /*!< Framing error flag */\r
+#define LL_USART_SR_NE                          USART_SR_NE                   /*!< Noise detected flag */\r
+#define LL_USART_SR_ORE                         USART_SR_ORE                  /*!< Overrun error flag */\r
+#define LL_USART_SR_IDLE                        USART_SR_IDLE                 /*!< Idle line detected flag */\r
+#define LL_USART_SR_RXNE                        USART_SR_RXNE                 /*!< Read data register not empty flag */\r
+#define LL_USART_SR_TC                          USART_SR_TC                   /*!< Transmission complete flag */\r
+#define LL_USART_SR_TXE                         USART_SR_TXE                  /*!< Transmit data register empty flag */\r
+#define LL_USART_SR_LBD                         USART_SR_LBD                  /*!< LIN break detection flag */\r
+#define LL_USART_SR_CTS                         USART_SR_CTS                  /*!< CTS flag */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup USART_LL_EC_IT IT Defines\r
+  * @brief    IT defines which can be used with LL_USART_ReadReg and  LL_USART_WriteReg functions\r
+  * @{\r
+  */\r
+#define LL_USART_CR1_IDLEIE                     USART_CR1_IDLEIE              /*!< IDLE interrupt enable */\r
+#define LL_USART_CR1_RXNEIE                     USART_CR1_RXNEIE              /*!< Read data register not empty interrupt enable */\r
+#define LL_USART_CR1_TCIE                       USART_CR1_TCIE                /*!< Transmission complete interrupt enable */\r
+#define LL_USART_CR1_TXEIE                      USART_CR1_TXEIE               /*!< Transmit data register empty interrupt enable */\r
+#define LL_USART_CR1_PEIE                       USART_CR1_PEIE                /*!< Parity error */\r
+#define LL_USART_CR2_LBDIE                      USART_CR2_LBDIE               /*!< LIN break detection interrupt enable */\r
+#define LL_USART_CR3_EIE                        USART_CR3_EIE                 /*!< Error interrupt enable */\r
+#define LL_USART_CR3_CTSIE                      USART_CR3_CTSIE               /*!< CTS interrupt enable */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup USART_LL_EC_DIRECTION Communication Direction\r
+  * @{\r
+  */\r
+#define LL_USART_DIRECTION_NONE                 0x00000000U                        /*!< Transmitter and Receiver are disabled */\r
+#define LL_USART_DIRECTION_RX                   USART_CR1_RE                       /*!< Transmitter is disabled and Receiver is enabled */\r
+#define LL_USART_DIRECTION_TX                   USART_CR1_TE                       /*!< Transmitter is enabled and Receiver is disabled */\r
+#define LL_USART_DIRECTION_TX_RX                (USART_CR1_TE |USART_CR1_RE)       /*!< Transmitter and Receiver are enabled */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup USART_LL_EC_PARITY Parity Control\r
+  * @{\r
+  */\r
+#define LL_USART_PARITY_NONE                    0x00000000U                          /*!< Parity control disabled */\r
+#define LL_USART_PARITY_EVEN                    USART_CR1_PCE                        /*!< Parity control enabled and Even Parity is selected */\r
+#define LL_USART_PARITY_ODD                     (USART_CR1_PCE | USART_CR1_PS)       /*!< Parity control enabled and Odd Parity is selected */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup USART_LL_EC_WAKEUP Wakeup\r
+  * @{\r
+  */\r
+#define LL_USART_WAKEUP_IDLELINE                0x00000000U           /*!<  USART wake up from Mute mode on Idle Line */\r
+#define LL_USART_WAKEUP_ADDRESSMARK             USART_CR1_WAKE        /*!<  USART wake up from Mute mode on Address Mark */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup USART_LL_EC_DATAWIDTH Datawidth\r
+  * @{\r
+  */\r
+#define LL_USART_DATAWIDTH_8B                   0x00000000U             /*!< 8 bits word length : Start bit, 8 data bits, n stop bits */\r
+#define LL_USART_DATAWIDTH_9B                   USART_CR1_M             /*!< 9 bits word length : Start bit, 9 data bits, n stop bits */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup USART_LL_EC_OVERSAMPLING Oversampling\r
+  * @{\r
+  */\r
+#define LL_USART_OVERSAMPLING_16                0x00000000U            /*!< Oversampling by 16 */\r
+#if  defined(USART_CR1_OVER8)\r
+#define LL_USART_OVERSAMPLING_8                 USART_CR1_OVER8        /*!< Oversampling by 8 */\r
+#endif /* USART_OverSampling_Feature */\r
+/**\r
+  * @}\r
+  */\r
+\r
+#if defined(USE_FULL_LL_DRIVER)\r
+/** @defgroup USART_LL_EC_CLOCK Clock Signal\r
+  * @{\r
+  */\r
+\r
+#define LL_USART_CLOCK_DISABLE                  0x00000000U            /*!< Clock signal not provided */\r
+#define LL_USART_CLOCK_ENABLE                   USART_CR2_CLKEN        /*!< Clock signal provided */\r
+/**\r
+  * @}\r
+  */\r
+#endif /*USE_FULL_LL_DRIVER*/\r
+\r
+/** @defgroup USART_LL_EC_LASTCLKPULSE Last Clock Pulse\r
+  * @{\r
+  */\r
+#define LL_USART_LASTCLKPULSE_NO_OUTPUT         0x00000000U           /*!< The clock pulse of the last data bit is not output to the SCLK pin */\r
+#define LL_USART_LASTCLKPULSE_OUTPUT            USART_CR2_LBCL        /*!< The clock pulse of the last data bit is output to the SCLK pin */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup USART_LL_EC_PHASE Clock Phase\r
+  * @{\r
+  */\r
+#define LL_USART_PHASE_1EDGE                    0x00000000U           /*!< The first clock transition is the first data capture edge */\r
+#define LL_USART_PHASE_2EDGE                    USART_CR2_CPHA        /*!< The second clock transition is the first data capture edge */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup USART_LL_EC_POLARITY Clock Polarity\r
+  * @{\r
+  */\r
+#define LL_USART_POLARITY_LOW                   0x00000000U           /*!< Steady low value on SCLK pin outside transmission window*/\r
+#define LL_USART_POLARITY_HIGH                  USART_CR2_CPOL        /*!< Steady high value on SCLK pin outside transmission window */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup USART_LL_EC_STOPBITS Stop Bits\r
+  * @{\r
+  */\r
+#define LL_USART_STOPBITS_0_5                   USART_CR2_STOP_0                           /*!< 0.5 stop bit */\r
+#define LL_USART_STOPBITS_1                     0x00000000U                                /*!< 1 stop bit */\r
+#define LL_USART_STOPBITS_1_5                   (USART_CR2_STOP_0 | USART_CR2_STOP_1)      /*!< 1.5 stop bits */\r
+#define LL_USART_STOPBITS_2                     USART_CR2_STOP_1                           /*!< 2 stop bits */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup USART_LL_EC_HWCONTROL Hardware Control\r
+  * @{\r
+  */\r
+#define LL_USART_HWCONTROL_NONE                 0x00000000U                          /*!< CTS and RTS hardware flow control disabled */\r
+#define LL_USART_HWCONTROL_RTS                  USART_CR3_RTSE                       /*!< RTS output enabled, data is only requested when there is space in the receive buffer */\r
+#define LL_USART_HWCONTROL_CTS                  USART_CR3_CTSE                       /*!< CTS mode enabled, data is only transmitted when the nCTS input is asserted (tied to 0) */\r
+#define LL_USART_HWCONTROL_RTS_CTS              (USART_CR3_RTSE | USART_CR3_CTSE)    /*!< CTS and RTS hardware flow control enabled */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup USART_LL_EC_IRDA_POWER IrDA Power\r
+  * @{\r
+  */\r
+#define LL_USART_IRDA_POWER_NORMAL              0x00000000U           /*!< IrDA normal power mode */\r
+#define LL_USART_IRDA_POWER_LOW                 USART_CR3_IRLP        /*!< IrDA low power mode */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup USART_LL_EC_LINBREAK_DETECT LIN Break Detection Length\r
+  * @{\r
+  */\r
+#define LL_USART_LINBREAK_DETECT_10B            0x00000000U           /*!< 10-bit break detection method selected */\r
+#define LL_USART_LINBREAK_DETECT_11B            USART_CR2_LBDL        /*!< 11-bit break detection method selected */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Exported macro ------------------------------------------------------------*/\r
+/** @defgroup USART_LL_Exported_Macros USART Exported Macros\r
+  * @{\r
+  */\r
+\r
+/** @defgroup USART_LL_EM_WRITE_READ Common Write and read registers Macros\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Write a value in USART register\r
+  * @param  __INSTANCE__ USART Instance\r
+  * @param  __REG__ Register to be written\r
+  * @param  __VALUE__ Value to be written in the register\r
+  * @retval None\r
+  */\r
+#define LL_USART_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))\r
+\r
+/**\r
+  * @brief  Read a value in USART register\r
+  * @param  __INSTANCE__ USART Instance\r
+  * @param  __REG__ Register to be read\r
+  * @retval Register value\r
+  */\r
+#define LL_USART_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup USART_LL_EM_Exported_Macros_Helper Exported_Macros_Helper\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Compute USARTDIV value according to Peripheral Clock and\r
+  *         expected Baud Rate in 8 bits sampling mode (32 bits value of USARTDIV is returned)\r
+  * @param  __PERIPHCLK__ Peripheral Clock frequency used for USART instance\r
+  * @param  __BAUDRATE__ Baud rate value to achieve\r
+  * @retval USARTDIV value to be used for BRR register filling in OverSampling_8 case\r
+  */\r
+#define __LL_USART_DIV_SAMPLING8_100(__PERIPHCLK__, __BAUDRATE__)      (((__PERIPHCLK__)*25)/(2*(__BAUDRATE__)))\r
+#define __LL_USART_DIVMANT_SAMPLING8(__PERIPHCLK__, __BAUDRATE__)      (__LL_USART_DIV_SAMPLING8_100((__PERIPHCLK__), (__BAUDRATE__))/100)\r
+#define __LL_USART_DIVFRAQ_SAMPLING8(__PERIPHCLK__, __BAUDRATE__)      (((__LL_USART_DIV_SAMPLING8_100((__PERIPHCLK__), (__BAUDRATE__)) - (__LL_USART_DIVMANT_SAMPLING8((__PERIPHCLK__), (__BAUDRATE__)) * 100)) * 8 + 50) / 100)\r
+/* UART BRR = mantissa + overflow + fraction\r
+            = (UART DIVMANT << 4) + ((UART DIVFRAQ & 0xF8) << 1) + (UART DIVFRAQ & 0x07) */\r
+#define __LL_USART_DIV_SAMPLING8(__PERIPHCLK__, __BAUDRATE__)             (((__LL_USART_DIVMANT_SAMPLING8((__PERIPHCLK__), (__BAUDRATE__)) << 4) + \\r
+                                                                           ((__LL_USART_DIVFRAQ_SAMPLING8((__PERIPHCLK__), (__BAUDRATE__)) & 0xF8) << 1)) + \\r
+                                                                           (__LL_USART_DIVFRAQ_SAMPLING8((__PERIPHCLK__), (__BAUDRATE__)) & 0x07))\r
+\r
+/**\r
+  * @brief  Compute USARTDIV value according to Peripheral Clock and\r
+  *         expected Baud Rate in 16 bits sampling mode (32 bits value of USARTDIV is returned)\r
+  * @param  __PERIPHCLK__ Peripheral Clock frequency used for USART instance\r
+  * @param  __BAUDRATE__ Baud rate value to achieve\r
+  * @retval USARTDIV value to be used for BRR register filling in OverSampling_16 case\r
+  */\r
+#define __LL_USART_DIV_SAMPLING16_100(__PERIPHCLK__, __BAUDRATE__)     (((__PERIPHCLK__)*25)/(4*(__BAUDRATE__)))\r
+#define __LL_USART_DIVMANT_SAMPLING16(__PERIPHCLK__, __BAUDRATE__)     (__LL_USART_DIV_SAMPLING16_100((__PERIPHCLK__), (__BAUDRATE__))/100)\r
+#define __LL_USART_DIVFRAQ_SAMPLING16(__PERIPHCLK__, __BAUDRATE__)     ((((__LL_USART_DIV_SAMPLING16_100((__PERIPHCLK__), (__BAUDRATE__)) - (__LL_USART_DIVMANT_SAMPLING16((__PERIPHCLK__), (__BAUDRATE__)) * 100)) * 16) + 50) / 100)\r
+/* USART BRR = mantissa + overflow + fraction\r
+            = (USART DIVMANT << 4) + (USART DIVFRAQ & 0xF0) + (USART DIVFRAQ & 0x0F) */\r
+#define __LL_USART_DIV_SAMPLING16(__PERIPHCLK__, __BAUDRATE__)            (((__LL_USART_DIVMANT_SAMPLING16((__PERIPHCLK__), (__BAUDRATE__)) << 4) + \\r
+                                                                           (__LL_USART_DIVFRAQ_SAMPLING16((__PERIPHCLK__), (__BAUDRATE__)) & 0xF0)) + \\r
+                                                                           (__LL_USART_DIVFRAQ_SAMPLING16((__PERIPHCLK__), (__BAUDRATE__)) & 0x0F))\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Exported functions --------------------------------------------------------*/\r
+\r
+/** @defgroup USART_LL_Exported_Functions USART Exported Functions\r
+  * @{\r
+  */\r
+\r
+/** @defgroup USART_LL_EF_Configuration Configuration functions\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  USART Enable\r
+  * @rmtoll CR1          UE            LL_USART_Enable\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_Enable(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR1, USART_CR1_UE);\r
+}\r
+\r
+/**\r
+  * @brief  USART Disable (all USART prescalers and outputs are disabled)\r
+  * @note   When USART is disabled, USART prescalers and outputs are stopped immediately,\r
+  *         and current operations are discarded. The configuration of the USART is kept, but all the status\r
+  *         flags, in the USARTx_SR are set to their default values.\r
+  * @rmtoll CR1          UE            LL_USART_Disable\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_Disable(USART_TypeDef *USARTx)\r
+{\r
+  CLEAR_BIT(USARTx->CR1, USART_CR1_UE);\r
+}\r
+\r
+/**\r
+  * @brief  Indicate if USART is enabled\r
+  * @rmtoll CR1          UE            LL_USART_IsEnabled\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsEnabled(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->CR1, USART_CR1_UE) == (USART_CR1_UE));\r
+}\r
+\r
+/**\r
+  * @brief  Receiver Enable (Receiver is enabled and begins searching for a start bit)\r
+  * @rmtoll CR1          RE            LL_USART_EnableDirectionRx\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_EnableDirectionRx(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR1, USART_CR1_RE);\r
+}\r
+\r
+/**\r
+  * @brief  Receiver Disable\r
+  * @rmtoll CR1          RE            LL_USART_DisableDirectionRx\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_DisableDirectionRx(USART_TypeDef *USARTx)\r
+{\r
+  CLEAR_BIT(USARTx->CR1, USART_CR1_RE);\r
+}\r
+\r
+/**\r
+  * @brief  Transmitter Enable\r
+  * @rmtoll CR1          TE            LL_USART_EnableDirectionTx\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_EnableDirectionTx(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR1, USART_CR1_TE);\r
+}\r
+\r
+/**\r
+  * @brief  Transmitter Disable\r
+  * @rmtoll CR1          TE            LL_USART_DisableDirectionTx\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_DisableDirectionTx(USART_TypeDef *USARTx)\r
+{\r
+  CLEAR_BIT(USARTx->CR1, USART_CR1_TE);\r
+}\r
+\r
+/**\r
+  * @brief  Configure simultaneously enabled/disabled states\r
+  *         of Transmitter and Receiver\r
+  * @rmtoll CR1          RE            LL_USART_SetTransferDirection\n\r
+  *         CR1          TE            LL_USART_SetTransferDirection\r
+  * @param  USARTx USART Instance\r
+  * @param  TransferDirection This parameter can be one of the following values:\r
+  *         @arg @ref LL_USART_DIRECTION_NONE\r
+  *         @arg @ref LL_USART_DIRECTION_RX\r
+  *         @arg @ref LL_USART_DIRECTION_TX\r
+  *         @arg @ref LL_USART_DIRECTION_TX_RX\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_SetTransferDirection(USART_TypeDef *USARTx, uint32_t TransferDirection)\r
+{\r
+  MODIFY_REG(USARTx->CR1, USART_CR1_RE | USART_CR1_TE, TransferDirection);\r
+}\r
+\r
+/**\r
+  * @brief  Return enabled/disabled states of Transmitter and Receiver\r
+  * @rmtoll CR1          RE            LL_USART_GetTransferDirection\n\r
+  *         CR1          TE            LL_USART_GetTransferDirection\r
+  * @param  USARTx USART Instance\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_USART_DIRECTION_NONE\r
+  *         @arg @ref LL_USART_DIRECTION_RX\r
+  *         @arg @ref LL_USART_DIRECTION_TX\r
+  *         @arg @ref LL_USART_DIRECTION_TX_RX\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_GetTransferDirection(USART_TypeDef *USARTx)\r
+{\r
+  return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_RE | USART_CR1_TE));\r
+}\r
+\r
+/**\r
+  * @brief  Configure Parity (enabled/disabled and parity mode if enabled).\r
+  * @note   This function selects if hardware parity control (generation and detection) is enabled or disabled.\r
+  *         When the parity control is enabled (Odd or Even), computed parity bit is inserted at the MSB position\r
+  *         (9th or 8th bit depending on data width) and parity is checked on the received data.\r
+  * @rmtoll CR1          PS            LL_USART_SetParity\n\r
+  *         CR1          PCE           LL_USART_SetParity\r
+  * @param  USARTx USART Instance\r
+  * @param  Parity This parameter can be one of the following values:\r
+  *         @arg @ref LL_USART_PARITY_NONE\r
+  *         @arg @ref LL_USART_PARITY_EVEN\r
+  *         @arg @ref LL_USART_PARITY_ODD\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_SetParity(USART_TypeDef *USARTx, uint32_t Parity)\r
+{\r
+  MODIFY_REG(USARTx->CR1, USART_CR1_PS | USART_CR1_PCE, Parity);\r
+}\r
+\r
+/**\r
+  * @brief  Return Parity configuration (enabled/disabled and parity mode if enabled)\r
+  * @rmtoll CR1          PS            LL_USART_GetParity\n\r
+  *         CR1          PCE           LL_USART_GetParity\r
+  * @param  USARTx USART Instance\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_USART_PARITY_NONE\r
+  *         @arg @ref LL_USART_PARITY_EVEN\r
+  *         @arg @ref LL_USART_PARITY_ODD\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_GetParity(USART_TypeDef *USARTx)\r
+{\r
+  return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_PS | USART_CR1_PCE));\r
+}\r
+\r
+/**\r
+  * @brief  Set Receiver Wake Up method from Mute mode.\r
+  * @rmtoll CR1          WAKE          LL_USART_SetWakeUpMethod\r
+  * @param  USARTx USART Instance\r
+  * @param  Method This parameter can be one of the following values:\r
+  *         @arg @ref LL_USART_WAKEUP_IDLELINE\r
+  *         @arg @ref LL_USART_WAKEUP_ADDRESSMARK\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_SetWakeUpMethod(USART_TypeDef *USARTx, uint32_t Method)\r
+{\r
+  MODIFY_REG(USARTx->CR1, USART_CR1_WAKE, Method);\r
+}\r
+\r
+/**\r
+  * @brief  Return Receiver Wake Up method from Mute mode\r
+  * @rmtoll CR1          WAKE          LL_USART_GetWakeUpMethod\r
+  * @param  USARTx USART Instance\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_USART_WAKEUP_IDLELINE\r
+  *         @arg @ref LL_USART_WAKEUP_ADDRESSMARK\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_GetWakeUpMethod(USART_TypeDef *USARTx)\r
+{\r
+  return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_WAKE));\r
+}\r
+\r
+/**\r
+  * @brief  Set Word length (i.e. nb of data bits, excluding start and stop bits)\r
+  * @rmtoll CR1          M             LL_USART_SetDataWidth\r
+  * @param  USARTx USART Instance\r
+  * @param  DataWidth This parameter can be one of the following values:\r
+  *         @arg @ref LL_USART_DATAWIDTH_8B\r
+  *         @arg @ref LL_USART_DATAWIDTH_9B\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_SetDataWidth(USART_TypeDef *USARTx, uint32_t DataWidth)\r
+{\r
+  MODIFY_REG(USARTx->CR1, USART_CR1_M, DataWidth);\r
+}\r
+\r
+/**\r
+  * @brief  Return Word length (i.e. nb of data bits, excluding start and stop bits)\r
+  * @rmtoll CR1          M             LL_USART_GetDataWidth\r
+  * @param  USARTx USART Instance\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_USART_DATAWIDTH_8B\r
+  *         @arg @ref LL_USART_DATAWIDTH_9B\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_GetDataWidth(USART_TypeDef *USARTx)\r
+{\r
+  return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_M));\r
+}\r
+\r
+#if defined(USART_CR1_OVER8)\r
+/**\r
+  * @brief  Set Oversampling to 8-bit or 16-bit mode\r
+  * @rmtoll CR1          OVER8         LL_USART_SetOverSampling\r
+  * @param  USARTx USART Instance\r
+  * @param  OverSampling This parameter can be one of the following values:\r
+  *         @arg @ref LL_USART_OVERSAMPLING_16\r
+  *         @arg @ref LL_USART_OVERSAMPLING_8\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_SetOverSampling(USART_TypeDef *USARTx, uint32_t OverSampling)\r
+{\r
+  MODIFY_REG(USARTx->CR1, USART_CR1_OVER8, OverSampling);\r
+}\r
+\r
+/**\r
+  * @brief  Return Oversampling mode\r
+  * @rmtoll CR1          OVER8         LL_USART_GetOverSampling\r
+  * @param  USARTx USART Instance\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_USART_OVERSAMPLING_16\r
+  *         @arg @ref LL_USART_OVERSAMPLING_8\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_GetOverSampling(USART_TypeDef *USARTx)\r
+{\r
+  return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_OVER8));\r
+}\r
+\r
+#endif /* USART_OverSampling_Feature */\r
+/**\r
+  * @brief  Configure if Clock pulse of the last data bit is output to the SCLK pin or not\r
+  * @note   Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Synchronous mode is supported by the USARTx instance.\r
+  * @rmtoll CR2          LBCL          LL_USART_SetLastClkPulseOutput\r
+  * @param  USARTx USART Instance\r
+  * @param  LastBitClockPulse This parameter can be one of the following values:\r
+  *         @arg @ref LL_USART_LASTCLKPULSE_NO_OUTPUT\r
+  *         @arg @ref LL_USART_LASTCLKPULSE_OUTPUT\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_SetLastClkPulseOutput(USART_TypeDef *USARTx, uint32_t LastBitClockPulse)\r
+{\r
+  MODIFY_REG(USARTx->CR2, USART_CR2_LBCL, LastBitClockPulse);\r
+}\r
+\r
+/**\r
+  * @brief  Retrieve Clock pulse of the last data bit output configuration\r
+  *         (Last bit Clock pulse output to the SCLK pin or not)\r
+  * @note   Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Synchronous mode is supported by the USARTx instance.\r
+  * @rmtoll CR2          LBCL          LL_USART_GetLastClkPulseOutput\r
+  * @param  USARTx USART Instance\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_USART_LASTCLKPULSE_NO_OUTPUT\r
+  *         @arg @ref LL_USART_LASTCLKPULSE_OUTPUT\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_GetLastClkPulseOutput(USART_TypeDef *USARTx)\r
+{\r
+  return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_LBCL));\r
+}\r
+\r
+/**\r
+  * @brief  Select the phase of the clock output on the SCLK pin in synchronous mode\r
+  * @note   Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Synchronous mode is supported by the USARTx instance.\r
+  * @rmtoll CR2          CPHA          LL_USART_SetClockPhase\r
+  * @param  USARTx USART Instance\r
+  * @param  ClockPhase This parameter can be one of the following values:\r
+  *         @arg @ref LL_USART_PHASE_1EDGE\r
+  *         @arg @ref LL_USART_PHASE_2EDGE\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_SetClockPhase(USART_TypeDef *USARTx, uint32_t ClockPhase)\r
+{\r
+  MODIFY_REG(USARTx->CR2, USART_CR2_CPHA, ClockPhase);\r
+}\r
+\r
+/**\r
+  * @brief  Return phase of the clock output on the SCLK pin in synchronous mode\r
+  * @note   Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Synchronous mode is supported by the USARTx instance.\r
+  * @rmtoll CR2          CPHA          LL_USART_GetClockPhase\r
+  * @param  USARTx USART Instance\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_USART_PHASE_1EDGE\r
+  *         @arg @ref LL_USART_PHASE_2EDGE\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_GetClockPhase(USART_TypeDef *USARTx)\r
+{\r
+  return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_CPHA));\r
+}\r
+\r
+/**\r
+  * @brief  Select the polarity of the clock output on the SCLK pin in synchronous mode\r
+  * @note   Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Synchronous mode is supported by the USARTx instance.\r
+  * @rmtoll CR2          CPOL          LL_USART_SetClockPolarity\r
+  * @param  USARTx USART Instance\r
+  * @param  ClockPolarity This parameter can be one of the following values:\r
+  *         @arg @ref LL_USART_POLARITY_LOW\r
+  *         @arg @ref LL_USART_POLARITY_HIGH\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_SetClockPolarity(USART_TypeDef *USARTx, uint32_t ClockPolarity)\r
+{\r
+  MODIFY_REG(USARTx->CR2, USART_CR2_CPOL, ClockPolarity);\r
+}\r
+\r
+/**\r
+  * @brief  Return polarity of the clock output on the SCLK pin in synchronous mode\r
+  * @note   Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Synchronous mode is supported by the USARTx instance.\r
+  * @rmtoll CR2          CPOL          LL_USART_GetClockPolarity\r
+  * @param  USARTx USART Instance\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_USART_POLARITY_LOW\r
+  *         @arg @ref LL_USART_POLARITY_HIGH\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_GetClockPolarity(USART_TypeDef *USARTx)\r
+{\r
+  return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_CPOL));\r
+}\r
+\r
+/**\r
+  * @brief  Configure Clock signal format (Phase Polarity and choice about output of last bit clock pulse)\r
+  * @note   Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Synchronous mode is supported by the USARTx instance.\r
+  * @note   Call of this function is equivalent to following function call sequence :\r
+  *         - Clock Phase configuration using @ref LL_USART_SetClockPhase() function\r
+  *         - Clock Polarity configuration using @ref LL_USART_SetClockPolarity() function\r
+  *         - Output of Last bit Clock pulse configuration using @ref LL_USART_SetLastClkPulseOutput() function\r
+  * @rmtoll CR2          CPHA          LL_USART_ConfigClock\n\r
+  *         CR2          CPOL          LL_USART_ConfigClock\n\r
+  *         CR2          LBCL          LL_USART_ConfigClock\r
+  * @param  USARTx USART Instance\r
+  * @param  Phase This parameter can be one of the following values:\r
+  *         @arg @ref LL_USART_PHASE_1EDGE\r
+  *         @arg @ref LL_USART_PHASE_2EDGE\r
+  * @param  Polarity This parameter can be one of the following values:\r
+  *         @arg @ref LL_USART_POLARITY_LOW\r
+  *         @arg @ref LL_USART_POLARITY_HIGH\r
+  * @param  LBCPOutput This parameter can be one of the following values:\r
+  *         @arg @ref LL_USART_LASTCLKPULSE_NO_OUTPUT\r
+  *         @arg @ref LL_USART_LASTCLKPULSE_OUTPUT\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_ConfigClock(USART_TypeDef *USARTx, uint32_t Phase, uint32_t Polarity, uint32_t LBCPOutput)\r
+{\r
+  MODIFY_REG(USARTx->CR2, USART_CR2_CPHA | USART_CR2_CPOL | USART_CR2_LBCL, Phase | Polarity | LBCPOutput);\r
+}\r
+\r
+/**\r
+  * @brief  Enable Clock output on SCLK pin\r
+  * @note   Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Synchronous mode is supported by the USARTx instance.\r
+  * @rmtoll CR2          CLKEN         LL_USART_EnableSCLKOutput\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_EnableSCLKOutput(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR2, USART_CR2_CLKEN);\r
+}\r
+\r
+/**\r
+  * @brief  Disable Clock output on SCLK pin\r
+  * @note   Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Synchronous mode is supported by the USARTx instance.\r
+  * @rmtoll CR2          CLKEN         LL_USART_DisableSCLKOutput\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_DisableSCLKOutput(USART_TypeDef *USARTx)\r
+{\r
+  CLEAR_BIT(USARTx->CR2, USART_CR2_CLKEN);\r
+}\r
+\r
+/**\r
+  * @brief  Indicate if Clock output on SCLK pin is enabled\r
+  * @note   Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Synchronous mode is supported by the USARTx instance.\r
+  * @rmtoll CR2          CLKEN         LL_USART_IsEnabledSCLKOutput\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsEnabledSCLKOutput(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->CR2, USART_CR2_CLKEN) == (USART_CR2_CLKEN));\r
+}\r
+\r
+/**\r
+  * @brief  Set the length of the stop bits\r
+  * @rmtoll CR2          STOP          LL_USART_SetStopBitsLength\r
+  * @param  USARTx USART Instance\r
+  * @param  StopBits This parameter can be one of the following values:\r
+  *         @arg @ref LL_USART_STOPBITS_0_5\r
+  *         @arg @ref LL_USART_STOPBITS_1\r
+  *         @arg @ref LL_USART_STOPBITS_1_5\r
+  *         @arg @ref LL_USART_STOPBITS_2\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_SetStopBitsLength(USART_TypeDef *USARTx, uint32_t StopBits)\r
+{\r
+  MODIFY_REG(USARTx->CR2, USART_CR2_STOP, StopBits);\r
+}\r
+\r
+/**\r
+  * @brief  Retrieve the length of the stop bits\r
+  * @rmtoll CR2          STOP          LL_USART_GetStopBitsLength\r
+  * @param  USARTx USART Instance\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_USART_STOPBITS_0_5\r
+  *         @arg @ref LL_USART_STOPBITS_1\r
+  *         @arg @ref LL_USART_STOPBITS_1_5\r
+  *         @arg @ref LL_USART_STOPBITS_2\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_GetStopBitsLength(USART_TypeDef *USARTx)\r
+{\r
+  return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_STOP));\r
+}\r
+\r
+/**\r
+  * @brief  Configure Character frame format (Datawidth, Parity control, Stop Bits)\r
+  * @note   Call of this function is equivalent to following function call sequence :\r
+  *         - Data Width configuration using @ref LL_USART_SetDataWidth() function\r
+  *         - Parity Control and mode configuration using @ref LL_USART_SetParity() function\r
+  *         - Stop bits configuration using @ref LL_USART_SetStopBitsLength() function\r
+  * @rmtoll CR1          PS            LL_USART_ConfigCharacter\n\r
+  *         CR1          PCE           LL_USART_ConfigCharacter\n\r
+  *         CR1          M             LL_USART_ConfigCharacter\n\r
+  *         CR2          STOP          LL_USART_ConfigCharacter\r
+  * @param  USARTx USART Instance\r
+  * @param  DataWidth This parameter can be one of the following values:\r
+  *         @arg @ref LL_USART_DATAWIDTH_8B\r
+  *         @arg @ref LL_USART_DATAWIDTH_9B\r
+  * @param  Parity This parameter can be one of the following values:\r
+  *         @arg @ref LL_USART_PARITY_NONE\r
+  *         @arg @ref LL_USART_PARITY_EVEN\r
+  *         @arg @ref LL_USART_PARITY_ODD\r
+  * @param  StopBits This parameter can be one of the following values:\r
+  *         @arg @ref LL_USART_STOPBITS_0_5\r
+  *         @arg @ref LL_USART_STOPBITS_1\r
+  *         @arg @ref LL_USART_STOPBITS_1_5\r
+  *         @arg @ref LL_USART_STOPBITS_2\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_ConfigCharacter(USART_TypeDef *USARTx, uint32_t DataWidth, uint32_t Parity,\r
+                                              uint32_t StopBits)\r
+{\r
+  MODIFY_REG(USARTx->CR1, USART_CR1_PS | USART_CR1_PCE | USART_CR1_M, Parity | DataWidth);\r
+  MODIFY_REG(USARTx->CR2, USART_CR2_STOP, StopBits);\r
+}\r
+\r
+/**\r
+  * @brief  Set Address of the USART node.\r
+  * @note   This is used in multiprocessor communication during Mute mode or Stop mode,\r
+  *         for wake up with address mark detection.\r
+  * @rmtoll CR2          ADD           LL_USART_SetNodeAddress\r
+  * @param  USARTx USART Instance\r
+  * @param  NodeAddress 4 bit Address of the USART node.\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_SetNodeAddress(USART_TypeDef *USARTx, uint32_t NodeAddress)\r
+{\r
+  MODIFY_REG(USARTx->CR2, USART_CR2_ADD, (NodeAddress & USART_CR2_ADD));\r
+}\r
+\r
+/**\r
+  * @brief  Return 4 bit Address of the USART node as set in ADD field of CR2.\r
+  * @note   only 4bits (b3-b0) of returned value are relevant (b31-b4 are not relevant)\r
+  * @rmtoll CR2          ADD           LL_USART_GetNodeAddress\r
+  * @param  USARTx USART Instance\r
+  * @retval Address of the USART node (Value between Min_Data=0 and Max_Data=255)\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_GetNodeAddress(USART_TypeDef *USARTx)\r
+{\r
+  return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_ADD));\r
+}\r
+\r
+/**\r
+  * @brief  Enable RTS HW Flow Control\r
+  * @note   Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Hardware Flow control feature is supported by the USARTx instance.\r
+  * @rmtoll CR3          RTSE          LL_USART_EnableRTSHWFlowCtrl\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_EnableRTSHWFlowCtrl(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR3, USART_CR3_RTSE);\r
+}\r
+\r
+/**\r
+  * @brief  Disable RTS HW Flow Control\r
+  * @note   Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Hardware Flow control feature is supported by the USARTx instance.\r
+  * @rmtoll CR3          RTSE          LL_USART_DisableRTSHWFlowCtrl\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_DisableRTSHWFlowCtrl(USART_TypeDef *USARTx)\r
+{\r
+  CLEAR_BIT(USARTx->CR3, USART_CR3_RTSE);\r
+}\r
+\r
+/**\r
+  * @brief  Enable CTS HW Flow Control\r
+  * @note   Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Hardware Flow control feature is supported by the USARTx instance.\r
+  * @rmtoll CR3          CTSE          LL_USART_EnableCTSHWFlowCtrl\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_EnableCTSHWFlowCtrl(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR3, USART_CR3_CTSE);\r
+}\r
+\r
+/**\r
+  * @brief  Disable CTS HW Flow Control\r
+  * @note   Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Hardware Flow control feature is supported by the USARTx instance.\r
+  * @rmtoll CR3          CTSE          LL_USART_DisableCTSHWFlowCtrl\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_DisableCTSHWFlowCtrl(USART_TypeDef *USARTx)\r
+{\r
+  CLEAR_BIT(USARTx->CR3, USART_CR3_CTSE);\r
+}\r
+\r
+/**\r
+  * @brief  Configure HW Flow Control mode (both CTS and RTS)\r
+  * @note   Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Hardware Flow control feature is supported by the USARTx instance.\r
+  * @rmtoll CR3          RTSE          LL_USART_SetHWFlowCtrl\n\r
+  *         CR3          CTSE          LL_USART_SetHWFlowCtrl\r
+  * @param  USARTx USART Instance\r
+  * @param  HardwareFlowControl This parameter can be one of the following values:\r
+  *         @arg @ref LL_USART_HWCONTROL_NONE\r
+  *         @arg @ref LL_USART_HWCONTROL_RTS\r
+  *         @arg @ref LL_USART_HWCONTROL_CTS\r
+  *         @arg @ref LL_USART_HWCONTROL_RTS_CTS\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_SetHWFlowCtrl(USART_TypeDef *USARTx, uint32_t HardwareFlowControl)\r
+{\r
+  MODIFY_REG(USARTx->CR3, USART_CR3_RTSE | USART_CR3_CTSE, HardwareFlowControl);\r
+}\r
+\r
+/**\r
+  * @brief  Return HW Flow Control configuration (both CTS and RTS)\r
+  * @note   Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Hardware Flow control feature is supported by the USARTx instance.\r
+  * @rmtoll CR3          RTSE          LL_USART_GetHWFlowCtrl\n\r
+  *         CR3          CTSE          LL_USART_GetHWFlowCtrl\r
+  * @param  USARTx USART Instance\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_USART_HWCONTROL_NONE\r
+  *         @arg @ref LL_USART_HWCONTROL_RTS\r
+  *         @arg @ref LL_USART_HWCONTROL_CTS\r
+  *         @arg @ref LL_USART_HWCONTROL_RTS_CTS\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_GetHWFlowCtrl(USART_TypeDef *USARTx)\r
+{\r
+  return (uint32_t)(READ_BIT(USARTx->CR3, USART_CR3_RTSE | USART_CR3_CTSE));\r
+}\r
+\r
+#if defined(USART_CR3_ONEBIT)\r
+/**\r
+  * @brief  Enable One bit sampling method\r
+  * @rmtoll CR3          ONEBIT        LL_USART_EnableOneBitSamp\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_EnableOneBitSamp(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR3, USART_CR3_ONEBIT);\r
+}\r
+\r
+/**\r
+  * @brief  Disable One bit sampling method\r
+  * @rmtoll CR3          ONEBIT        LL_USART_DisableOneBitSamp\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_DisableOneBitSamp(USART_TypeDef *USARTx)\r
+{\r
+  CLEAR_BIT(USARTx->CR3, USART_CR3_ONEBIT);\r
+}\r
+\r
+/**\r
+  * @brief  Indicate if One bit sampling method is enabled\r
+  * @rmtoll CR3          ONEBIT        LL_USART_IsEnabledOneBitSamp\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsEnabledOneBitSamp(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->CR3, USART_CR3_ONEBIT) == (USART_CR3_ONEBIT));\r
+}\r
+#endif /* USART_OneBitSampling_Feature */\r
+\r
+#if defined(USART_CR1_OVER8)\r
+/**\r
+  * @brief  Configure USART BRR register for achieving expected Baud Rate value.\r
+  * @note   Compute and set USARTDIV value in BRR Register (full BRR content)\r
+  *         according to used Peripheral Clock, Oversampling mode, and expected Baud Rate values\r
+  * @note   Peripheral clock and Baud rate values provided as function parameters should be valid\r
+  *         (Baud rate value != 0)\r
+  * @rmtoll BRR          BRR           LL_USART_SetBaudRate\r
+  * @param  USARTx USART Instance\r
+  * @param  PeriphClk Peripheral Clock\r
+  * @param  OverSampling This parameter can be one of the following values:\r
+  *         @arg @ref LL_USART_OVERSAMPLING_16\r
+  *         @arg @ref LL_USART_OVERSAMPLING_8\r
+  * @param  BaudRate Baud Rate\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_SetBaudRate(USART_TypeDef *USARTx, uint32_t PeriphClk, uint32_t OverSampling,\r
+                                          uint32_t BaudRate)\r
+{\r
+  if (OverSampling == LL_USART_OVERSAMPLING_8)\r
+  {\r
+    USARTx->BRR = (uint16_t)(__LL_USART_DIV_SAMPLING8(PeriphClk, BaudRate));\r
+  }\r
+  else\r
+  {\r
+    USARTx->BRR = (uint16_t)(__LL_USART_DIV_SAMPLING16(PeriphClk, BaudRate));\r
+  }\r
+}\r
+\r
+/**\r
+  * @brief  Return current Baud Rate value, according to USARTDIV present in BRR register\r
+  *         (full BRR content), and to used Peripheral Clock and Oversampling mode values\r
+  * @note   In case of non-initialized or invalid value stored in BRR register, value 0 will be returned.\r
+  * @rmtoll BRR          BRR           LL_USART_GetBaudRate\r
+  * @param  USARTx USART Instance\r
+  * @param  PeriphClk Peripheral Clock\r
+  * @param  OverSampling This parameter can be one of the following values:\r
+  *         @arg @ref LL_USART_OVERSAMPLING_16\r
+  *         @arg @ref LL_USART_OVERSAMPLING_8\r
+  * @retval Baud Rate\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_GetBaudRate(USART_TypeDef *USARTx, uint32_t PeriphClk, uint32_t OverSampling)\r
+{\r
+  uint32_t usartdiv = 0x0U;\r
+  uint32_t brrresult = 0x0U;\r
+\r
+  usartdiv = USARTx->BRR;\r
+\r
+  if (OverSampling == LL_USART_OVERSAMPLING_8)\r
+  {\r
+    if ((usartdiv & 0xFFF7U) != 0U)\r
+    {\r
+      usartdiv = (uint16_t)((usartdiv & 0xFFF0U) | ((usartdiv & 0x0007U) << 1U)) ;\r
+      brrresult = (PeriphClk * 2U) / usartdiv;\r
+    }\r
+  }\r
+  else\r
+  {\r
+    if ((usartdiv & 0xFFFFU) != 0U)\r
+    {\r
+      brrresult = PeriphClk / usartdiv;\r
+    }\r
+  }\r
+  return (brrresult);\r
+}\r
+#else\r
+/**\r
+  * @brief  Configure USART BRR register for achieving expected Baud Rate value.\r
+  * @note   Compute and set USARTDIV value in BRR Register (full BRR content)\r
+  *         according to used Peripheral Clock, Oversampling mode, and expected Baud Rate values\r
+  * @note   Peripheral clock and Baud rate values provided as function parameters should be valid\r
+  *         (Baud rate value != 0)\r
+  * @rmtoll BRR          BRR           LL_USART_SetBaudRate\r
+  * @param  USARTx USART Instance\r
+  * @param  PeriphClk Peripheral Clock\r
+  * @param  BaudRate Baud Rate\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_SetBaudRate(USART_TypeDef *USARTx, uint32_t PeriphClk, uint32_t BaudRate)\r
+{\r
+  USARTx->BRR = (uint16_t)(__LL_USART_DIV_SAMPLING16(PeriphClk, BaudRate));\r
+}\r
+\r
+/**\r
+  * @brief  Return current Baud Rate value, according to USARTDIV present in BRR register\r
+  *         (full BRR content), and to used Peripheral Clock and Oversampling mode values\r
+  * @note   In case of non-initialized or invalid value stored in BRR register, value 0 will be returned.\r
+  * @rmtoll BRR          BRR           LL_USART_GetBaudRate\r
+  * @param  USARTx USART Instance\r
+  * @param  PeriphClk Peripheral Clock\r
+  * @retval Baud Rate\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_GetBaudRate(USART_TypeDef *USARTx, uint32_t PeriphClk)\r
+{\r
+  uint32_t usartdiv = 0x0U;\r
+  uint32_t brrresult = 0x0U;\r
+\r
+  usartdiv = USARTx->BRR;\r
+\r
+  if ((usartdiv & 0xFFFFU) != 0U)\r
+  {\r
+    brrresult = PeriphClk / usartdiv;\r
+  }\r
+  return (brrresult);\r
+}\r
+#endif /* USART_OverSampling_Feature */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup USART_LL_EF_Configuration_IRDA Configuration functions related to Irda feature\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable IrDA mode\r
+  * @note   Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not\r
+  *         IrDA feature is supported by the USARTx instance.\r
+  * @rmtoll CR3          IREN          LL_USART_EnableIrda\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_EnableIrda(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR3, USART_CR3_IREN);\r
+}\r
+\r
+/**\r
+  * @brief  Disable IrDA mode\r
+  * @note   Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not\r
+  *         IrDA feature is supported by the USARTx instance.\r
+  * @rmtoll CR3          IREN          LL_USART_DisableIrda\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_DisableIrda(USART_TypeDef *USARTx)\r
+{\r
+  CLEAR_BIT(USARTx->CR3, USART_CR3_IREN);\r
+}\r
+\r
+/**\r
+  * @brief  Indicate if IrDA mode is enabled\r
+  * @note   Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not\r
+  *         IrDA feature is supported by the USARTx instance.\r
+  * @rmtoll CR3          IREN          LL_USART_IsEnabledIrda\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsEnabledIrda(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->CR3, USART_CR3_IREN) == (USART_CR3_IREN));\r
+}\r
+\r
+/**\r
+  * @brief  Configure IrDA Power Mode (Normal or Low Power)\r
+  * @note   Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not\r
+  *         IrDA feature is supported by the USARTx instance.\r
+  * @rmtoll CR3          IRLP          LL_USART_SetIrdaPowerMode\r
+  * @param  USARTx USART Instance\r
+  * @param  PowerMode This parameter can be one of the following values:\r
+  *         @arg @ref LL_USART_IRDA_POWER_NORMAL\r
+  *         @arg @ref LL_USART_IRDA_POWER_LOW\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_SetIrdaPowerMode(USART_TypeDef *USARTx, uint32_t PowerMode)\r
+{\r
+  MODIFY_REG(USARTx->CR3, USART_CR3_IRLP, PowerMode);\r
+}\r
+\r
+/**\r
+  * @brief  Retrieve IrDA Power Mode configuration (Normal or Low Power)\r
+  * @note   Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not\r
+  *         IrDA feature is supported by the USARTx instance.\r
+  * @rmtoll CR3          IRLP          LL_USART_GetIrdaPowerMode\r
+  * @param  USARTx USART Instance\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_USART_IRDA_POWER_NORMAL\r
+  *         @arg @ref LL_USART_PHASE_2EDGE\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_GetIrdaPowerMode(USART_TypeDef *USARTx)\r
+{\r
+  return (uint32_t)(READ_BIT(USARTx->CR3, USART_CR3_IRLP));\r
+}\r
+\r
+/**\r
+  * @brief  Set Irda prescaler value, used for dividing the USART clock source\r
+  *         to achieve the Irda Low Power frequency (8 bits value)\r
+  * @note   Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not\r
+  *         IrDA feature is supported by the USARTx instance.\r
+  * @rmtoll GTPR         PSC           LL_USART_SetIrdaPrescaler\r
+  * @param  USARTx USART Instance\r
+  * @param  PrescalerValue Value between Min_Data=0x00 and Max_Data=0xFF\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_SetIrdaPrescaler(USART_TypeDef *USARTx, uint32_t PrescalerValue)\r
+{\r
+  MODIFY_REG(USARTx->GTPR, USART_GTPR_PSC, PrescalerValue);\r
+}\r
+\r
+/**\r
+  * @brief  Return Irda prescaler value, used for dividing the USART clock source\r
+  *         to achieve the Irda Low Power frequency (8 bits value)\r
+  * @note   Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not\r
+  *         IrDA feature is supported by the USARTx instance.\r
+  * @rmtoll GTPR         PSC           LL_USART_GetIrdaPrescaler\r
+  * @param  USARTx USART Instance\r
+  * @retval Irda prescaler value (Value between Min_Data=0x00 and Max_Data=0xFF)\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_GetIrdaPrescaler(USART_TypeDef *USARTx)\r
+{\r
+  return (uint32_t)(READ_BIT(USARTx->GTPR, USART_GTPR_PSC));\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup USART_LL_EF_Configuration_Smartcard Configuration functions related to Smartcard feature\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable Smartcard NACK transmission\r
+  * @note   Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Smartcard feature is supported by the USARTx instance.\r
+  * @rmtoll CR3          NACK          LL_USART_EnableSmartcardNACK\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_EnableSmartcardNACK(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR3, USART_CR3_NACK);\r
+}\r
+\r
+/**\r
+  * @brief  Disable Smartcard NACK transmission\r
+  * @note   Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Smartcard feature is supported by the USARTx instance.\r
+  * @rmtoll CR3          NACK          LL_USART_DisableSmartcardNACK\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_DisableSmartcardNACK(USART_TypeDef *USARTx)\r
+{\r
+  CLEAR_BIT(USARTx->CR3, USART_CR3_NACK);\r
+}\r
+\r
+/**\r
+  * @brief  Indicate if Smartcard NACK transmission is enabled\r
+  * @note   Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Smartcard feature is supported by the USARTx instance.\r
+  * @rmtoll CR3          NACK          LL_USART_IsEnabledSmartcardNACK\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsEnabledSmartcardNACK(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->CR3, USART_CR3_NACK) == (USART_CR3_NACK));\r
+}\r
+\r
+/**\r
+  * @brief  Enable Smartcard mode\r
+  * @note   Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Smartcard feature is supported by the USARTx instance.\r
+  * @rmtoll CR3          SCEN          LL_USART_EnableSmartcard\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_EnableSmartcard(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR3, USART_CR3_SCEN);\r
+}\r
+\r
+/**\r
+  * @brief  Disable Smartcard mode\r
+  * @note   Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Smartcard feature is supported by the USARTx instance.\r
+  * @rmtoll CR3          SCEN          LL_USART_DisableSmartcard\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_DisableSmartcard(USART_TypeDef *USARTx)\r
+{\r
+  CLEAR_BIT(USARTx->CR3, USART_CR3_SCEN);\r
+}\r
+\r
+/**\r
+  * @brief  Indicate if Smartcard mode is enabled\r
+  * @note   Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Smartcard feature is supported by the USARTx instance.\r
+  * @rmtoll CR3          SCEN          LL_USART_IsEnabledSmartcard\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsEnabledSmartcard(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->CR3, USART_CR3_SCEN) == (USART_CR3_SCEN));\r
+}\r
+\r
+/**\r
+  * @brief  Set Smartcard prescaler value, used for dividing the USART clock\r
+  *         source to provide the SMARTCARD Clock (5 bits value)\r
+  * @note   Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Smartcard feature is supported by the USARTx instance.\r
+  * @rmtoll GTPR         PSC           LL_USART_SetSmartcardPrescaler\r
+  * @param  USARTx USART Instance\r
+  * @param  PrescalerValue Value between Min_Data=0 and Max_Data=31\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_SetSmartcardPrescaler(USART_TypeDef *USARTx, uint32_t PrescalerValue)\r
+{\r
+  MODIFY_REG(USARTx->GTPR, USART_GTPR_PSC, PrescalerValue);\r
+}\r
+\r
+/**\r
+  * @brief  Return Smartcard prescaler value, used for dividing the USART clock\r
+  *         source to provide the SMARTCARD Clock (5 bits value)\r
+  * @note   Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Smartcard feature is supported by the USARTx instance.\r
+  * @rmtoll GTPR         PSC           LL_USART_GetSmartcardPrescaler\r
+  * @param  USARTx USART Instance\r
+  * @retval Smartcard prescaler value (Value between Min_Data=0 and Max_Data=31)\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_GetSmartcardPrescaler(USART_TypeDef *USARTx)\r
+{\r
+  return (uint32_t)(READ_BIT(USARTx->GTPR, USART_GTPR_PSC));\r
+}\r
+\r
+/**\r
+  * @brief  Set Smartcard Guard time value, expressed in nb of baud clocks periods\r
+  *         (GT[7:0] bits : Guard time value)\r
+  * @note   Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Smartcard feature is supported by the USARTx instance.\r
+  * @rmtoll GTPR         GT            LL_USART_SetSmartcardGuardTime\r
+  * @param  USARTx USART Instance\r
+  * @param  GuardTime Value between Min_Data=0x00 and Max_Data=0xFF\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_SetSmartcardGuardTime(USART_TypeDef *USARTx, uint32_t GuardTime)\r
+{\r
+  MODIFY_REG(USARTx->GTPR, USART_GTPR_GT, GuardTime << USART_POSITION_GTPR_GT);\r
+}\r
+\r
+/**\r
+  * @brief  Return Smartcard Guard time value, expressed in nb of baud clocks periods\r
+  *         (GT[7:0] bits : Guard time value)\r
+  * @note   Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Smartcard feature is supported by the USARTx instance.\r
+  * @rmtoll GTPR         GT            LL_USART_GetSmartcardGuardTime\r
+  * @param  USARTx USART Instance\r
+  * @retval Smartcard Guard time value (Value between Min_Data=0x00 and Max_Data=0xFF)\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_GetSmartcardGuardTime(USART_TypeDef *USARTx)\r
+{\r
+  return (uint32_t)(READ_BIT(USARTx->GTPR, USART_GTPR_GT) >> USART_POSITION_GTPR_GT);\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup USART_LL_EF_Configuration_HalfDuplex Configuration functions related to Half Duplex feature\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable Single Wire Half-Duplex mode\r
+  * @note   Macro @ref IS_UART_HALFDUPLEX_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Half-Duplex mode is supported by the USARTx instance.\r
+  * @rmtoll CR3          HDSEL         LL_USART_EnableHalfDuplex\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_EnableHalfDuplex(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR3, USART_CR3_HDSEL);\r
+}\r
+\r
+/**\r
+  * @brief  Disable Single Wire Half-Duplex mode\r
+  * @note   Macro @ref IS_UART_HALFDUPLEX_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Half-Duplex mode is supported by the USARTx instance.\r
+  * @rmtoll CR3          HDSEL         LL_USART_DisableHalfDuplex\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_DisableHalfDuplex(USART_TypeDef *USARTx)\r
+{\r
+  CLEAR_BIT(USARTx->CR3, USART_CR3_HDSEL);\r
+}\r
+\r
+/**\r
+  * @brief  Indicate if Single Wire Half-Duplex mode is enabled\r
+  * @note   Macro @ref IS_UART_HALFDUPLEX_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Half-Duplex mode is supported by the USARTx instance.\r
+  * @rmtoll CR3          HDSEL         LL_USART_IsEnabledHalfDuplex\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsEnabledHalfDuplex(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->CR3, USART_CR3_HDSEL) == (USART_CR3_HDSEL));\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup USART_LL_EF_Configuration_LIN Configuration functions related to LIN feature\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Set LIN Break Detection Length\r
+  * @note   Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not\r
+  *         LIN feature is supported by the USARTx instance.\r
+  * @rmtoll CR2          LBDL          LL_USART_SetLINBrkDetectionLen\r
+  * @param  USARTx USART Instance\r
+  * @param  LINBDLength This parameter can be one of the following values:\r
+  *         @arg @ref LL_USART_LINBREAK_DETECT_10B\r
+  *         @arg @ref LL_USART_LINBREAK_DETECT_11B\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_SetLINBrkDetectionLen(USART_TypeDef *USARTx, uint32_t LINBDLength)\r
+{\r
+  MODIFY_REG(USARTx->CR2, USART_CR2_LBDL, LINBDLength);\r
+}\r
+\r
+/**\r
+  * @brief  Return LIN Break Detection Length\r
+  * @note   Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not\r
+  *         LIN feature is supported by the USARTx instance.\r
+  * @rmtoll CR2          LBDL          LL_USART_GetLINBrkDetectionLen\r
+  * @param  USARTx USART Instance\r
+  * @retval Returned value can be one of the following values:\r
+  *         @arg @ref LL_USART_LINBREAK_DETECT_10B\r
+  *         @arg @ref LL_USART_LINBREAK_DETECT_11B\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_GetLINBrkDetectionLen(USART_TypeDef *USARTx)\r
+{\r
+  return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_LBDL));\r
+}\r
+\r
+/**\r
+  * @brief  Enable LIN mode\r
+  * @note   Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not\r
+  *         LIN feature is supported by the USARTx instance.\r
+  * @rmtoll CR2          LINEN         LL_USART_EnableLIN\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_EnableLIN(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR2, USART_CR2_LINEN);\r
+}\r
+\r
+/**\r
+  * @brief  Disable LIN mode\r
+  * @note   Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not\r
+  *         LIN feature is supported by the USARTx instance.\r
+  * @rmtoll CR2          LINEN         LL_USART_DisableLIN\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_DisableLIN(USART_TypeDef *USARTx)\r
+{\r
+  CLEAR_BIT(USARTx->CR2, USART_CR2_LINEN);\r
+}\r
+\r
+/**\r
+  * @brief  Indicate if LIN mode is enabled\r
+  * @note   Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not\r
+  *         LIN feature is supported by the USARTx instance.\r
+  * @rmtoll CR2          LINEN         LL_USART_IsEnabledLIN\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsEnabledLIN(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->CR2, USART_CR2_LINEN) == (USART_CR2_LINEN));\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup USART_LL_EF_AdvancedConfiguration Advanced Configurations services\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Perform basic configuration of USART for enabling use in Asynchronous Mode (UART)\r
+  * @note   In UART mode, the following bits must be kept cleared:\r
+  *           - LINEN bit in the USART_CR2 register,\r
+  *           - CLKEN bit in the USART_CR2 register,\r
+  *           - SCEN bit in the USART_CR3 register,\r
+  *           - IREN bit in the USART_CR3 register,\r
+  *           - HDSEL bit in the USART_CR3 register.\r
+  * @note   Call of this function is equivalent to following function call sequence :\r
+  *         - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function\r
+  *         - Clear CLKEN in CR2 using @ref LL_USART_DisableSCLKOutput() function\r
+  *         - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function\r
+  *         - Clear IREN in CR3 using @ref LL_USART_DisableIrda() function\r
+  *         - Clear HDSEL in CR3 using @ref LL_USART_DisableHalfDuplex() function\r
+  * @note   Other remaining configurations items related to Asynchronous Mode\r
+  *         (as Baud Rate, Word length, Parity, ...) should be set using\r
+  *         dedicated functions\r
+  * @rmtoll CR2          LINEN         LL_USART_ConfigAsyncMode\n\r
+  *         CR2          CLKEN         LL_USART_ConfigAsyncMode\n\r
+  *         CR3          SCEN          LL_USART_ConfigAsyncMode\n\r
+  *         CR3          IREN          LL_USART_ConfigAsyncMode\n\r
+  *         CR3          HDSEL         LL_USART_ConfigAsyncMode\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_ConfigAsyncMode(USART_TypeDef *USARTx)\r
+{\r
+  /* In Asynchronous mode, the following bits must be kept cleared:\r
+  - LINEN, CLKEN bits in the USART_CR2 register,\r
+  - SCEN, IREN and HDSEL bits in the USART_CR3 register.*/\r
+  CLEAR_BIT(USARTx->CR2, (USART_CR2_LINEN | USART_CR2_CLKEN));\r
+  CLEAR_BIT(USARTx->CR3, (USART_CR3_SCEN | USART_CR3_IREN | USART_CR3_HDSEL));\r
+}\r
+\r
+/**\r
+  * @brief  Perform basic configuration of USART for enabling use in Synchronous Mode\r
+  * @note   In Synchronous mode, the following bits must be kept cleared:\r
+  *           - LINEN bit in the USART_CR2 register,\r
+  *           - SCEN bit in the USART_CR3 register,\r
+  *           - IREN bit in the USART_CR3 register,\r
+  *           - HDSEL bit in the USART_CR3 register.\r
+  *         This function also sets the USART in Synchronous mode.\r
+  * @note   Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Synchronous mode is supported by the USARTx instance.\r
+  * @note   Call of this function is equivalent to following function call sequence :\r
+  *         - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function\r
+  *         - Clear IREN in CR3 using @ref LL_USART_DisableIrda() function\r
+  *         - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function\r
+  *         - Clear HDSEL in CR3 using @ref LL_USART_DisableHalfDuplex() function\r
+  *         - Set CLKEN in CR2 using @ref LL_USART_EnableSCLKOutput() function\r
+  * @note   Other remaining configurations items related to Synchronous Mode\r
+  *         (as Baud Rate, Word length, Parity, Clock Polarity, ...) should be set using\r
+  *         dedicated functions\r
+  * @rmtoll CR2          LINEN         LL_USART_ConfigSyncMode\n\r
+  *         CR2          CLKEN         LL_USART_ConfigSyncMode\n\r
+  *         CR3          SCEN          LL_USART_ConfigSyncMode\n\r
+  *         CR3          IREN          LL_USART_ConfigSyncMode\n\r
+  *         CR3          HDSEL         LL_USART_ConfigSyncMode\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_ConfigSyncMode(USART_TypeDef *USARTx)\r
+{\r
+  /* In Synchronous mode, the following bits must be kept cleared:\r
+  - LINEN bit in the USART_CR2 register,\r
+  - SCEN, IREN and HDSEL bits in the USART_CR3 register.*/\r
+  CLEAR_BIT(USARTx->CR2, (USART_CR2_LINEN));\r
+  CLEAR_BIT(USARTx->CR3, (USART_CR3_SCEN | USART_CR3_IREN | USART_CR3_HDSEL));\r
+  /* set the UART/USART in Synchronous mode */\r
+  SET_BIT(USARTx->CR2, USART_CR2_CLKEN);\r
+}\r
+\r
+/**\r
+  * @brief  Perform basic configuration of USART for enabling use in LIN Mode\r
+  * @note   In LIN mode, the following bits must be kept cleared:\r
+  *           - STOP and CLKEN bits in the USART_CR2 register,\r
+  *           - SCEN bit in the USART_CR3 register,\r
+  *           - IREN bit in the USART_CR3 register,\r
+  *           - HDSEL bit in the USART_CR3 register.\r
+  *         This function also set the UART/USART in LIN mode.\r
+  * @note   Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not\r
+  *         LIN feature is supported by the USARTx instance.\r
+  * @note   Call of this function is equivalent to following function call sequence :\r
+  *         - Clear CLKEN in CR2 using @ref LL_USART_DisableSCLKOutput() function\r
+  *         - Clear STOP in CR2 using @ref LL_USART_SetStopBitsLength() function\r
+  *         - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function\r
+  *         - Clear IREN in CR3 using @ref LL_USART_DisableIrda() function\r
+  *         - Clear HDSEL in CR3 using @ref LL_USART_DisableHalfDuplex() function\r
+  *         - Set LINEN in CR2 using @ref LL_USART_EnableLIN() function\r
+  * @note   Other remaining configurations items related to LIN Mode\r
+  *         (as Baud Rate, Word length, LIN Break Detection Length, ...) should be set using\r
+  *         dedicated functions\r
+  * @rmtoll CR2          CLKEN         LL_USART_ConfigLINMode\n\r
+  *         CR2          STOP          LL_USART_ConfigLINMode\n\r
+  *         CR2          LINEN         LL_USART_ConfigLINMode\n\r
+  *         CR3          IREN          LL_USART_ConfigLINMode\n\r
+  *         CR3          SCEN          LL_USART_ConfigLINMode\n\r
+  *         CR3          HDSEL         LL_USART_ConfigLINMode\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_ConfigLINMode(USART_TypeDef *USARTx)\r
+{\r
+  /* In LIN mode, the following bits must be kept cleared:\r
+  - STOP and CLKEN bits in the USART_CR2 register,\r
+  - IREN, SCEN and HDSEL bits in the USART_CR3 register.*/\r
+  CLEAR_BIT(USARTx->CR2, (USART_CR2_CLKEN | USART_CR2_STOP));\r
+  CLEAR_BIT(USARTx->CR3, (USART_CR3_IREN | USART_CR3_SCEN | USART_CR3_HDSEL));\r
+  /* Set the UART/USART in LIN mode */\r
+  SET_BIT(USARTx->CR2, USART_CR2_LINEN);\r
+}\r
+\r
+/**\r
+  * @brief  Perform basic configuration of USART for enabling use in Half Duplex Mode\r
+  * @note   In Half Duplex mode, the following bits must be kept cleared:\r
+  *           - LINEN bit in the USART_CR2 register,\r
+  *           - CLKEN bit in the USART_CR2 register,\r
+  *           - SCEN bit in the USART_CR3 register,\r
+  *           - IREN bit in the USART_CR3 register,\r
+  *         This function also sets the UART/USART in Half Duplex mode.\r
+  * @note   Macro @ref IS_UART_HALFDUPLEX_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Half-Duplex mode is supported by the USARTx instance.\r
+  * @note   Call of this function is equivalent to following function call sequence :\r
+  *         - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function\r
+  *         - Clear CLKEN in CR2 using @ref LL_USART_DisableSCLKOutput() function\r
+  *         - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function\r
+  *         - Clear IREN in CR3 using @ref LL_USART_DisableIrda() function\r
+  *         - Set HDSEL in CR3 using @ref LL_USART_EnableHalfDuplex() function\r
+  * @note   Other remaining configurations items related to Half Duplex Mode\r
+  *         (as Baud Rate, Word length, Parity, ...) should be set using\r
+  *         dedicated functions\r
+  * @rmtoll CR2          LINEN         LL_USART_ConfigHalfDuplexMode\n\r
+  *         CR2          CLKEN         LL_USART_ConfigHalfDuplexMode\n\r
+  *         CR3          HDSEL         LL_USART_ConfigHalfDuplexMode\n\r
+  *         CR3          SCEN          LL_USART_ConfigHalfDuplexMode\n\r
+  *         CR3          IREN          LL_USART_ConfigHalfDuplexMode\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_ConfigHalfDuplexMode(USART_TypeDef *USARTx)\r
+{\r
+  /* In Half Duplex mode, the following bits must be kept cleared:\r
+  - LINEN and CLKEN bits in the USART_CR2 register,\r
+  - SCEN and IREN bits in the USART_CR3 register.*/\r
+  CLEAR_BIT(USARTx->CR2, (USART_CR2_LINEN | USART_CR2_CLKEN));\r
+  CLEAR_BIT(USARTx->CR3, (USART_CR3_SCEN | USART_CR3_IREN));\r
+  /* set the UART/USART in Half Duplex mode */\r
+  SET_BIT(USARTx->CR3, USART_CR3_HDSEL);\r
+}\r
+\r
+/**\r
+  * @brief  Perform basic configuration of USART for enabling use in Smartcard Mode\r
+  * @note   In Smartcard mode, the following bits must be kept cleared:\r
+  *           - LINEN bit in the USART_CR2 register,\r
+  *           - IREN bit in the USART_CR3 register,\r
+  *           - HDSEL bit in the USART_CR3 register.\r
+  *         This function also configures Stop bits to 1.5 bits and\r
+  *         sets the USART in Smartcard mode (SCEN bit).\r
+  *         Clock Output is also enabled (CLKEN).\r
+  * @note   Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Smartcard feature is supported by the USARTx instance.\r
+  * @note   Call of this function is equivalent to following function call sequence :\r
+  *         - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function\r
+  *         - Clear IREN in CR3 using @ref LL_USART_DisableIrda() function\r
+  *         - Clear HDSEL in CR3 using @ref LL_USART_DisableHalfDuplex() function\r
+  *         - Configure STOP in CR2 using @ref LL_USART_SetStopBitsLength() function\r
+  *         - Set CLKEN in CR2 using @ref LL_USART_EnableSCLKOutput() function\r
+  *         - Set SCEN in CR3 using @ref LL_USART_EnableSmartcard() function\r
+  * @note   Other remaining configurations items related to Smartcard Mode\r
+  *         (as Baud Rate, Word length, Parity, ...) should be set using\r
+  *         dedicated functions\r
+  * @rmtoll CR2          LINEN         LL_USART_ConfigSmartcardMode\n\r
+  *         CR2          STOP          LL_USART_ConfigSmartcardMode\n\r
+  *         CR2          CLKEN         LL_USART_ConfigSmartcardMode\n\r
+  *         CR3          HDSEL         LL_USART_ConfigSmartcardMode\n\r
+  *         CR3          SCEN          LL_USART_ConfigSmartcardMode\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_ConfigSmartcardMode(USART_TypeDef *USARTx)\r
+{\r
+  /* In Smartcard mode, the following bits must be kept cleared:\r
+  - LINEN bit in the USART_CR2 register,\r
+  - IREN and HDSEL bits in the USART_CR3 register.*/\r
+  CLEAR_BIT(USARTx->CR2, (USART_CR2_LINEN));\r
+  CLEAR_BIT(USARTx->CR3, (USART_CR3_IREN | USART_CR3_HDSEL));\r
+  /* Configure Stop bits to 1.5 bits */\r
+  /* Synchronous mode is activated by default */\r
+  SET_BIT(USARTx->CR2, (USART_CR2_STOP_0 | USART_CR2_STOP_1 | USART_CR2_CLKEN));\r
+  /* set the UART/USART in Smartcard mode */\r
+  SET_BIT(USARTx->CR3, USART_CR3_SCEN);\r
+}\r
+\r
+/**\r
+  * @brief  Perform basic configuration of USART for enabling use in Irda Mode\r
+  * @note   In IRDA mode, the following bits must be kept cleared:\r
+  *           - LINEN bit in the USART_CR2 register,\r
+  *           - STOP and CLKEN bits in the USART_CR2 register,\r
+  *           - SCEN bit in the USART_CR3 register,\r
+  *           - HDSEL bit in the USART_CR3 register.\r
+  *         This function also sets the UART/USART in IRDA mode (IREN bit).\r
+  * @note   Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not\r
+  *         IrDA feature is supported by the USARTx instance.\r
+  * @note   Call of this function is equivalent to following function call sequence :\r
+  *         - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function\r
+  *         - Clear CLKEN in CR2 using @ref LL_USART_DisableSCLKOutput() function\r
+  *         - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function\r
+  *         - Clear HDSEL in CR3 using @ref LL_USART_DisableHalfDuplex() function\r
+  *         - Configure STOP in CR2 using @ref LL_USART_SetStopBitsLength() function\r
+  *         - Set IREN in CR3 using @ref LL_USART_EnableIrda() function\r
+  * @note   Other remaining configurations items related to Irda Mode\r
+  *         (as Baud Rate, Word length, Power mode, ...) should be set using\r
+  *         dedicated functions\r
+  * @rmtoll CR2          LINEN         LL_USART_ConfigIrdaMode\n\r
+  *         CR2          CLKEN         LL_USART_ConfigIrdaMode\n\r
+  *         CR2          STOP          LL_USART_ConfigIrdaMode\n\r
+  *         CR3          SCEN          LL_USART_ConfigIrdaMode\n\r
+  *         CR3          HDSEL         LL_USART_ConfigIrdaMode\n\r
+  *         CR3          IREN          LL_USART_ConfigIrdaMode\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_ConfigIrdaMode(USART_TypeDef *USARTx)\r
+{\r
+  /* In IRDA mode, the following bits must be kept cleared:\r
+  - LINEN, STOP and CLKEN bits in the USART_CR2 register,\r
+  - SCEN and HDSEL bits in the USART_CR3 register.*/\r
+  CLEAR_BIT(USARTx->CR2, (USART_CR2_LINEN | USART_CR2_CLKEN | USART_CR2_STOP));\r
+  CLEAR_BIT(USARTx->CR3, (USART_CR3_SCEN | USART_CR3_HDSEL));\r
+  /* set the UART/USART in IRDA mode */\r
+  SET_BIT(USARTx->CR3, USART_CR3_IREN);\r
+}\r
+\r
+/**\r
+  * @brief  Perform basic configuration of USART for enabling use in Multi processor Mode\r
+  *         (several USARTs connected in a network, one of the USARTs can be the master,\r
+  *         its TX output connected to the RX inputs of the other slaves USARTs).\r
+  * @note   In MultiProcessor mode, the following bits must be kept cleared:\r
+  *           - LINEN bit in the USART_CR2 register,\r
+  *           - CLKEN bit in the USART_CR2 register,\r
+  *           - SCEN bit in the USART_CR3 register,\r
+  *           - IREN bit in the USART_CR3 register,\r
+  *           - HDSEL bit in the USART_CR3 register.\r
+  * @note   Call of this function is equivalent to following function call sequence :\r
+  *         - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function\r
+  *         - Clear CLKEN in CR2 using @ref LL_USART_DisableSCLKOutput() function\r
+  *         - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function\r
+  *         - Clear IREN in CR3 using @ref LL_USART_DisableIrda() function\r
+  *         - Clear HDSEL in CR3 using @ref LL_USART_DisableHalfDuplex() function\r
+  * @note   Other remaining configurations items related to Multi processor Mode\r
+  *         (as Baud Rate, Wake Up Method, Node address, ...) should be set using\r
+  *         dedicated functions\r
+  * @rmtoll CR2          LINEN         LL_USART_ConfigMultiProcessMode\n\r
+  *         CR2          CLKEN         LL_USART_ConfigMultiProcessMode\n\r
+  *         CR3          SCEN          LL_USART_ConfigMultiProcessMode\n\r
+  *         CR3          HDSEL         LL_USART_ConfigMultiProcessMode\n\r
+  *         CR3          IREN          LL_USART_ConfigMultiProcessMode\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_ConfigMultiProcessMode(USART_TypeDef *USARTx)\r
+{\r
+  /* In Multi Processor mode, the following bits must be kept cleared:\r
+  - LINEN and CLKEN bits in the USART_CR2 register,\r
+  - IREN, SCEN and HDSEL bits in the USART_CR3 register.*/\r
+  CLEAR_BIT(USARTx->CR2, (USART_CR2_LINEN | USART_CR2_CLKEN));\r
+  CLEAR_BIT(USARTx->CR3, (USART_CR3_SCEN | USART_CR3_HDSEL | USART_CR3_IREN));\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup USART_LL_EF_FLAG_Management FLAG_Management\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Check if the USART Parity Error Flag is set or not\r
+  * @rmtoll SR           PE            LL_USART_IsActiveFlag_PE\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_PE(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->SR, USART_SR_PE) == (USART_SR_PE));\r
+}\r
+\r
+/**\r
+  * @brief  Check if the USART Framing Error Flag is set or not\r
+  * @rmtoll SR           FE            LL_USART_IsActiveFlag_FE\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_FE(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->SR, USART_SR_FE) == (USART_SR_FE));\r
+}\r
+\r
+/**\r
+  * @brief  Check if the USART Noise error detected Flag is set or not\r
+  * @rmtoll SR           NF            LL_USART_IsActiveFlag_NE\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_NE(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->SR, USART_SR_NE) == (USART_SR_NE));\r
+}\r
+\r
+/**\r
+  * @brief  Check if the USART OverRun Error Flag is set or not\r
+  * @rmtoll SR           ORE           LL_USART_IsActiveFlag_ORE\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_ORE(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->SR, USART_SR_ORE) == (USART_SR_ORE));\r
+}\r
+\r
+/**\r
+  * @brief  Check if the USART IDLE line detected Flag is set or not\r
+  * @rmtoll SR           IDLE          LL_USART_IsActiveFlag_IDLE\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_IDLE(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->SR, USART_SR_IDLE) == (USART_SR_IDLE));\r
+}\r
+\r
+/**\r
+  * @brief  Check if the USART Read Data Register Not Empty Flag is set or not\r
+  * @rmtoll SR           RXNE          LL_USART_IsActiveFlag_RXNE\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_RXNE(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->SR, USART_SR_RXNE) == (USART_SR_RXNE));\r
+}\r
+\r
+/**\r
+  * @brief  Check if the USART Transmission Complete Flag is set or not\r
+  * @rmtoll SR           TC            LL_USART_IsActiveFlag_TC\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_TC(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->SR, USART_SR_TC) == (USART_SR_TC));\r
+}\r
+\r
+/**\r
+  * @brief  Check if the USART Transmit Data Register Empty Flag is set or not\r
+  * @rmtoll SR           TXE           LL_USART_IsActiveFlag_TXE\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_TXE(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->SR, USART_SR_TXE) == (USART_SR_TXE));\r
+}\r
+\r
+/**\r
+  * @brief  Check if the USART LIN Break Detection Flag is set or not\r
+  * @note   Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not\r
+  *         LIN feature is supported by the USARTx instance.\r
+  * @rmtoll SR           LBD           LL_USART_IsActiveFlag_LBD\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_LBD(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->SR, USART_SR_LBD) == (USART_SR_LBD));\r
+}\r
+\r
+/**\r
+  * @brief  Check if the USART CTS Flag is set or not\r
+  * @note   Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Hardware Flow control feature is supported by the USARTx instance.\r
+  * @rmtoll SR           CTS           LL_USART_IsActiveFlag_nCTS\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_nCTS(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->SR, USART_SR_CTS) == (USART_SR_CTS));\r
+}\r
+\r
+/**\r
+  * @brief  Check if the USART Send Break Flag is set or not\r
+  * @rmtoll CR1          SBK           LL_USART_IsActiveFlag_SBK\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_SBK(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->CR1, USART_CR1_SBK) == (USART_CR1_SBK));\r
+}\r
+\r
+/**\r
+  * @brief  Check if the USART Receive Wake Up from mute mode Flag is set or not\r
+  * @rmtoll CR1          RWU           LL_USART_IsActiveFlag_RWU\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_RWU(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->CR1, USART_CR1_RWU) == (USART_CR1_RWU));\r
+}\r
+\r
+/**\r
+  * @brief  Clear Parity Error Flag\r
+  * @note   Clearing this flag is done by a read access to the USARTx_SR\r
+  *         register followed by a read access to the USARTx_DR register.\r
+  * @note   Please also consider that when clearing this flag, other flags as\r
+  *         NE, FE, ORE, IDLE would also be cleared.\r
+  * @rmtoll SR           PE            LL_USART_ClearFlag_PE\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_ClearFlag_PE(USART_TypeDef *USARTx)\r
+{\r
+  __IO uint32_t tmpreg;\r
+  tmpreg = USARTx->SR;\r
+  (void) tmpreg;\r
+  tmpreg = USARTx->DR;\r
+  (void) tmpreg;\r
+}\r
+\r
+/**\r
+  * @brief  Clear Framing Error Flag\r
+  * @note   Clearing this flag is done by a read access to the USARTx_SR\r
+  *         register followed by a read access to the USARTx_DR register.\r
+  * @note   Please also consider that when clearing this flag, other flags as\r
+  *         PE, NE, ORE, IDLE would also be cleared.\r
+  * @rmtoll SR           FE            LL_USART_ClearFlag_FE\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_ClearFlag_FE(USART_TypeDef *USARTx)\r
+{\r
+  __IO uint32_t tmpreg;\r
+  tmpreg = USARTx->SR;\r
+  (void) tmpreg;\r
+  tmpreg = USARTx->DR;\r
+  (void) tmpreg;\r
+}\r
+\r
+/**\r
+  * @brief  Clear Noise detected Flag\r
+  * @note   Clearing this flag is done by a read access to the USARTx_SR\r
+  *         register followed by a read access to the USARTx_DR register.\r
+  * @note   Please also consider that when clearing this flag, other flags as\r
+  *         PE, FE, ORE, IDLE would also be cleared.\r
+  * @rmtoll SR           NF            LL_USART_ClearFlag_NE\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_ClearFlag_NE(USART_TypeDef *USARTx)\r
+{\r
+  __IO uint32_t tmpreg;\r
+  tmpreg = USARTx->SR;\r
+  (void) tmpreg;\r
+  tmpreg = USARTx->DR;\r
+  (void) tmpreg;\r
+}\r
+\r
+/**\r
+  * @brief  Clear OverRun Error Flag\r
+  * @note   Clearing this flag is done by a read access to the USARTx_SR\r
+  *         register followed by a read access to the USARTx_DR register.\r
+  * @note   Please also consider that when clearing this flag, other flags as\r
+  *         PE, NE, FE, IDLE would also be cleared.\r
+  * @rmtoll SR           ORE           LL_USART_ClearFlag_ORE\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_ClearFlag_ORE(USART_TypeDef *USARTx)\r
+{\r
+  __IO uint32_t tmpreg;\r
+  tmpreg = USARTx->SR;\r
+  (void) tmpreg;\r
+  tmpreg = USARTx->DR;\r
+  (void) tmpreg;\r
+}\r
+\r
+/**\r
+  * @brief  Clear IDLE line detected Flag\r
+  * @note   Clearing this flag is done by a read access to the USARTx_SR\r
+  *         register followed by a read access to the USARTx_DR register.\r
+  * @note   Please also consider that when clearing this flag, other flags as\r
+  *         PE, NE, FE, ORE would also be cleared.\r
+  * @rmtoll SR           IDLE          LL_USART_ClearFlag_IDLE\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_ClearFlag_IDLE(USART_TypeDef *USARTx)\r
+{\r
+  __IO uint32_t tmpreg;\r
+  tmpreg = USARTx->SR;\r
+  (void) tmpreg;\r
+  tmpreg = USARTx->DR;\r
+  (void) tmpreg;\r
+}\r
+\r
+/**\r
+  * @brief  Clear Transmission Complete Flag\r
+  * @rmtoll SR           TC            LL_USART_ClearFlag_TC\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_ClearFlag_TC(USART_TypeDef *USARTx)\r
+{\r
+  WRITE_REG(USARTx->SR, ~(USART_SR_TC));\r
+}\r
+\r
+/**\r
+  * @brief  Clear RX Not Empty Flag\r
+  * @rmtoll SR           RXNE          LL_USART_ClearFlag_RXNE\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_ClearFlag_RXNE(USART_TypeDef *USARTx)\r
+{\r
+  WRITE_REG(USARTx->SR, ~(USART_SR_RXNE));\r
+}\r
+\r
+/**\r
+  * @brief  Clear LIN Break Detection Flag\r
+  * @note   Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not\r
+  *         LIN feature is supported by the USARTx instance.\r
+  * @rmtoll SR           LBD           LL_USART_ClearFlag_LBD\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_ClearFlag_LBD(USART_TypeDef *USARTx)\r
+{\r
+  WRITE_REG(USARTx->SR, ~(USART_SR_LBD));\r
+}\r
+\r
+/**\r
+  * @brief  Clear CTS Interrupt Flag\r
+  * @note   Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Hardware Flow control feature is supported by the USARTx instance.\r
+  * @rmtoll SR           CTS           LL_USART_ClearFlag_nCTS\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_ClearFlag_nCTS(USART_TypeDef *USARTx)\r
+{\r
+  WRITE_REG(USARTx->SR, ~(USART_SR_CTS));\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup USART_LL_EF_IT_Management IT_Management\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable IDLE Interrupt\r
+  * @rmtoll CR1          IDLEIE        LL_USART_EnableIT_IDLE\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_EnableIT_IDLE(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR1, USART_CR1_IDLEIE);\r
+}\r
+\r
+/**\r
+  * @brief  Enable RX Not Empty Interrupt\r
+  * @rmtoll CR1          RXNEIE        LL_USART_EnableIT_RXNE\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_EnableIT_RXNE(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR1, USART_CR1_RXNEIE);\r
+}\r
+\r
+/**\r
+  * @brief  Enable Transmission Complete Interrupt\r
+  * @rmtoll CR1          TCIE          LL_USART_EnableIT_TC\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_EnableIT_TC(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR1, USART_CR1_TCIE);\r
+}\r
+\r
+/**\r
+  * @brief  Enable TX Empty Interrupt\r
+  * @rmtoll CR1          TXEIE         LL_USART_EnableIT_TXE\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_EnableIT_TXE(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR1, USART_CR1_TXEIE);\r
+}\r
+\r
+/**\r
+  * @brief  Enable Parity Error Interrupt\r
+  * @rmtoll CR1          PEIE          LL_USART_EnableIT_PE\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_EnableIT_PE(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR1, USART_CR1_PEIE);\r
+}\r
+\r
+/**\r
+  * @brief  Enable LIN Break Detection Interrupt\r
+  * @note   Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not\r
+  *         LIN feature is supported by the USARTx instance.\r
+  * @rmtoll CR2          LBDIE         LL_USART_EnableIT_LBD\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_EnableIT_LBD(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR2, USART_CR2_LBDIE);\r
+}\r
+\r
+/**\r
+  * @brief  Enable Error Interrupt\r
+  * @note   When set, Error Interrupt Enable Bit is enabling interrupt generation in case of a framing\r
+  *         error, overrun error or noise flag (FE=1 or ORE=1 or NF=1 in the USARTx_SR register).\r
+  *           0: Interrupt is inhibited\r
+  *           1: An interrupt is generated when FE=1 or ORE=1 or NF=1 in the USARTx_SR register.\r
+  * @rmtoll CR3          EIE           LL_USART_EnableIT_ERROR\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_EnableIT_ERROR(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR3, USART_CR3_EIE);\r
+}\r
+\r
+/**\r
+  * @brief  Enable CTS Interrupt\r
+  * @note   Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Hardware Flow control feature is supported by the USARTx instance.\r
+  * @rmtoll CR3          CTSIE         LL_USART_EnableIT_CTS\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_EnableIT_CTS(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR3, USART_CR3_CTSIE);\r
+}\r
+\r
+/**\r
+  * @brief  Disable IDLE Interrupt\r
+  * @rmtoll CR1          IDLEIE        LL_USART_DisableIT_IDLE\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_DisableIT_IDLE(USART_TypeDef *USARTx)\r
+{\r
+  CLEAR_BIT(USARTx->CR1, USART_CR1_IDLEIE);\r
+}\r
+\r
+/**\r
+  * @brief  Disable RX Not Empty Interrupt\r
+  * @rmtoll CR1          RXNEIE        LL_USART_DisableIT_RXNE\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_DisableIT_RXNE(USART_TypeDef *USARTx)\r
+{\r
+  CLEAR_BIT(USARTx->CR1, USART_CR1_RXNEIE);\r
+}\r
+\r
+/**\r
+  * @brief  Disable Transmission Complete Interrupt\r
+  * @rmtoll CR1          TCIE          LL_USART_DisableIT_TC\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_DisableIT_TC(USART_TypeDef *USARTx)\r
+{\r
+  CLEAR_BIT(USARTx->CR1, USART_CR1_TCIE);\r
+}\r
+\r
+/**\r
+  * @brief  Disable TX Empty Interrupt\r
+  * @rmtoll CR1          TXEIE         LL_USART_DisableIT_TXE\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_DisableIT_TXE(USART_TypeDef *USARTx)\r
+{\r
+  CLEAR_BIT(USARTx->CR1, USART_CR1_TXEIE);\r
+}\r
+\r
+/**\r
+  * @brief  Disable Parity Error Interrupt\r
+  * @rmtoll CR1          PEIE          LL_USART_DisableIT_PE\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_DisableIT_PE(USART_TypeDef *USARTx)\r
+{\r
+  CLEAR_BIT(USARTx->CR1, USART_CR1_PEIE);\r
+}\r
+\r
+/**\r
+  * @brief  Disable LIN Break Detection Interrupt\r
+  * @note   Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not\r
+  *         LIN feature is supported by the USARTx instance.\r
+  * @rmtoll CR2          LBDIE         LL_USART_DisableIT_LBD\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_DisableIT_LBD(USART_TypeDef *USARTx)\r
+{\r
+  CLEAR_BIT(USARTx->CR2, USART_CR2_LBDIE);\r
+}\r
+\r
+/**\r
+  * @brief  Disable Error Interrupt\r
+  * @note   When set, Error Interrupt Enable Bit is enabling interrupt generation in case of a framing\r
+  *         error, overrun error or noise flag (FE=1 or ORE=1 or NF=1 in the USARTx_SR register).\r
+  *           0: Interrupt is inhibited\r
+  *           1: An interrupt is generated when FE=1 or ORE=1 or NF=1 in the USARTx_SR register.\r
+  * @rmtoll CR3          EIE           LL_USART_DisableIT_ERROR\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_DisableIT_ERROR(USART_TypeDef *USARTx)\r
+{\r
+  CLEAR_BIT(USARTx->CR3, USART_CR3_EIE);\r
+}\r
+\r
+/**\r
+  * @brief  Disable CTS Interrupt\r
+  * @note   Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Hardware Flow control feature is supported by the USARTx instance.\r
+  * @rmtoll CR3          CTSIE         LL_USART_DisableIT_CTS\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_DisableIT_CTS(USART_TypeDef *USARTx)\r
+{\r
+  CLEAR_BIT(USARTx->CR3, USART_CR3_CTSIE);\r
+}\r
+\r
+/**\r
+  * @brief  Check if the USART IDLE Interrupt  source is enabled or disabled.\r
+  * @rmtoll CR1          IDLEIE        LL_USART_IsEnabledIT_IDLE\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsEnabledIT_IDLE(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->CR1, USART_CR1_IDLEIE) == (USART_CR1_IDLEIE));\r
+}\r
+\r
+/**\r
+  * @brief  Check if the USART RX Not Empty Interrupt is enabled or disabled.\r
+  * @rmtoll CR1          RXNEIE        LL_USART_IsEnabledIT_RXNE\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsEnabledIT_RXNE(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->CR1, USART_CR1_RXNEIE) == (USART_CR1_RXNEIE));\r
+}\r
+\r
+/**\r
+  * @brief  Check if the USART Transmission Complete Interrupt is enabled or disabled.\r
+  * @rmtoll CR1          TCIE          LL_USART_IsEnabledIT_TC\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsEnabledIT_TC(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->CR1, USART_CR1_TCIE) == (USART_CR1_TCIE));\r
+}\r
+\r
+/**\r
+  * @brief  Check if the USART TX Empty Interrupt is enabled or disabled.\r
+  * @rmtoll CR1          TXEIE         LL_USART_IsEnabledIT_TXE\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsEnabledIT_TXE(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->CR1, USART_CR1_TXEIE) == (USART_CR1_TXEIE));\r
+}\r
+\r
+/**\r
+  * @brief  Check if the USART Parity Error Interrupt is enabled or disabled.\r
+  * @rmtoll CR1          PEIE          LL_USART_IsEnabledIT_PE\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsEnabledIT_PE(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->CR1, USART_CR1_PEIE) == (USART_CR1_PEIE));\r
+}\r
+\r
+/**\r
+  * @brief  Check if the USART LIN Break Detection Interrupt is enabled or disabled.\r
+  * @note   Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not\r
+  *         LIN feature is supported by the USARTx instance.\r
+  * @rmtoll CR2          LBDIE         LL_USART_IsEnabledIT_LBD\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsEnabledIT_LBD(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->CR2, USART_CR2_LBDIE) == (USART_CR2_LBDIE));\r
+}\r
+\r
+/**\r
+  * @brief  Check if the USART Error Interrupt is enabled or disabled.\r
+  * @rmtoll CR3          EIE           LL_USART_IsEnabledIT_ERROR\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsEnabledIT_ERROR(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->CR3, USART_CR3_EIE) == (USART_CR3_EIE));\r
+}\r
+\r
+/**\r
+  * @brief  Check if the USART CTS Interrupt is enabled or disabled.\r
+  * @note   Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not\r
+  *         Hardware Flow control feature is supported by the USARTx instance.\r
+  * @rmtoll CR3          CTSIE         LL_USART_IsEnabledIT_CTS\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsEnabledIT_CTS(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->CR3, USART_CR3_CTSIE) == (USART_CR3_CTSIE));\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup USART_LL_EF_DMA_Management DMA_Management\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Enable DMA Mode for reception\r
+  * @rmtoll CR3          DMAR          LL_USART_EnableDMAReq_RX\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_EnableDMAReq_RX(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR3, USART_CR3_DMAR);\r
+}\r
+\r
+/**\r
+  * @brief  Disable DMA Mode for reception\r
+  * @rmtoll CR3          DMAR          LL_USART_DisableDMAReq_RX\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_DisableDMAReq_RX(USART_TypeDef *USARTx)\r
+{\r
+  CLEAR_BIT(USARTx->CR3, USART_CR3_DMAR);\r
+}\r
+\r
+/**\r
+  * @brief  Check if DMA Mode is enabled for reception\r
+  * @rmtoll CR3          DMAR          LL_USART_IsEnabledDMAReq_RX\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsEnabledDMAReq_RX(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->CR3, USART_CR3_DMAR) == (USART_CR3_DMAR));\r
+}\r
+\r
+/**\r
+  * @brief  Enable DMA Mode for transmission\r
+  * @rmtoll CR3          DMAT          LL_USART_EnableDMAReq_TX\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_EnableDMAReq_TX(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR3, USART_CR3_DMAT);\r
+}\r
+\r
+/**\r
+  * @brief  Disable DMA Mode for transmission\r
+  * @rmtoll CR3          DMAT          LL_USART_DisableDMAReq_TX\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_DisableDMAReq_TX(USART_TypeDef *USARTx)\r
+{\r
+  CLEAR_BIT(USARTx->CR3, USART_CR3_DMAT);\r
+}\r
+\r
+/**\r
+  * @brief  Check if DMA Mode is enabled for transmission\r
+  * @rmtoll CR3          DMAT          LL_USART_IsEnabledDMAReq_TX\r
+  * @param  USARTx USART Instance\r
+  * @retval State of bit (1 or 0).\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_IsEnabledDMAReq_TX(USART_TypeDef *USARTx)\r
+{\r
+  return (READ_BIT(USARTx->CR3, USART_CR3_DMAT) == (USART_CR3_DMAT));\r
+}\r
+\r
+/**\r
+  * @brief  Get the data register address used for DMA transfer\r
+  * @rmtoll DR           DR            LL_USART_DMA_GetRegAddr\r
+  * @note   Address of Data Register is valid for both Transmit and Receive transfers.\r
+  * @param  USARTx USART Instance\r
+  * @retval Address of data register\r
+  */\r
+__STATIC_INLINE uint32_t LL_USART_DMA_GetRegAddr(USART_TypeDef *USARTx)\r
+{\r
+  /* return address of DR register */\r
+  return ((uint32_t) & (USARTx->DR));\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup USART_LL_EF_Data_Management Data_Management\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Read Receiver Data register (Receive Data value, 8 bits)\r
+  * @rmtoll DR           DR            LL_USART_ReceiveData8\r
+  * @param  USARTx USART Instance\r
+  * @retval Value between Min_Data=0x00 and Max_Data=0xFF\r
+  */\r
+__STATIC_INLINE uint8_t LL_USART_ReceiveData8(USART_TypeDef *USARTx)\r
+{\r
+  return (uint8_t)(READ_BIT(USARTx->DR, USART_DR_DR));\r
+}\r
+\r
+/**\r
+  * @brief  Read Receiver Data register (Receive Data value, 9 bits)\r
+  * @rmtoll DR           DR            LL_USART_ReceiveData9\r
+  * @param  USARTx USART Instance\r
+  * @retval Value between Min_Data=0x00 and Max_Data=0x1FF\r
+  */\r
+__STATIC_INLINE uint16_t LL_USART_ReceiveData9(USART_TypeDef *USARTx)\r
+{\r
+  return (uint16_t)(READ_BIT(USARTx->DR, USART_DR_DR));\r
+}\r
+\r
+/**\r
+  * @brief  Write in Transmitter Data Register (Transmit Data value, 8 bits)\r
+  * @rmtoll DR           DR            LL_USART_TransmitData8\r
+  * @param  USARTx USART Instance\r
+  * @param  Value between Min_Data=0x00 and Max_Data=0xFF\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_TransmitData8(USART_TypeDef *USARTx, uint8_t Value)\r
+{\r
+  USARTx->DR = Value;\r
+}\r
+\r
+/**\r
+  * @brief  Write in Transmitter Data Register (Transmit Data value, 9 bits)\r
+  * @rmtoll DR           DR            LL_USART_TransmitData9\r
+  * @param  USARTx USART Instance\r
+  * @param  Value between Min_Data=0x00 and Max_Data=0x1FF\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_TransmitData9(USART_TypeDef *USARTx, uint16_t Value)\r
+{\r
+  USARTx->DR = Value & 0x1FFU;\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup USART_LL_EF_Execution Execution\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Request Break sending\r
+  * @rmtoll CR1          SBK           LL_USART_RequestBreakSending\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_RequestBreakSending(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR1, USART_CR1_SBK);\r
+}\r
+\r
+/**\r
+  * @brief  Put USART in Mute mode\r
+  * @rmtoll CR1          RWU           LL_USART_RequestEnterMuteMode\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_RequestEnterMuteMode(USART_TypeDef *USARTx)\r
+{\r
+  SET_BIT(USARTx->CR1, USART_CR1_RWU);\r
+}\r
+\r
+/**\r
+  * @brief  Put USART in Active mode\r
+  * @rmtoll CR1          RWU           LL_USART_RequestExitMuteMode\r
+  * @param  USARTx USART Instance\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_USART_RequestExitMuteMode(USART_TypeDef *USARTx)\r
+{\r
+  CLEAR_BIT(USARTx->CR1, USART_CR1_RWU);\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#if defined(USE_FULL_LL_DRIVER)\r
+/** @defgroup USART_LL_EF_Init Initialization and de-initialization functions\r
+  * @{\r
+  */\r
+ErrorStatus LL_USART_DeInit(USART_TypeDef *USARTx);\r
+ErrorStatus LL_USART_Init(USART_TypeDef *USARTx, LL_USART_InitTypeDef *USART_InitStruct);\r
+void        LL_USART_StructInit(LL_USART_InitTypeDef *USART_InitStruct);\r
+ErrorStatus LL_USART_ClockInit(USART_TypeDef *USARTx, LL_USART_ClockInitTypeDef *USART_ClockInitStruct);\r
+void        LL_USART_ClockStructInit(LL_USART_ClockInitTypeDef *USART_ClockInitStruct);\r
+/**\r
+  * @}\r
+  */\r
+#endif /* USE_FULL_LL_DRIVER */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* USART1 || USART2 || USART3 || UART4 || UART5 */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __STM32F1xx_LL_USART_H */\r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_utils.h b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_utils.h
new file mode 100644 (file)
index 0000000..56d1232
--- /dev/null
@@ -0,0 +1,269 @@
+/**\r
+  ******************************************************************************\r
+  * @file    stm32f1xx_ll_utils.h\r
+  * @author  MCD Application Team\r
+  * @brief   Header file of UTILS LL module.\r
+  @verbatim\r
+  ==============================================================================\r
+                     ##### How to use this driver #####\r
+  ==============================================================================\r
+    [..]\r
+    The LL UTILS driver contains a set of generic APIs that can be\r
+    used by user:\r
+      (+) Device electronic signature\r
+      (+) Timing functions\r
+      (+) PLL configuration functions\r
+\r
+  @endverbatim\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+\r
+/* Define to prevent recursive inclusion -------------------------------------*/\r
+#ifndef __STM32F1xx_LL_UTILS_H\r
+#define __STM32F1xx_LL_UTILS_H\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/* Includes ------------------------------------------------------------------*/\r
+#include "stm32f1xx.h"\r
+\r
+/** @addtogroup STM32F1xx_LL_Driver\r
+  * @{\r
+  */\r
+\r
+/** @defgroup UTILS_LL UTILS\r
+  * @{\r
+  */\r
+\r
+/* Private types -------------------------------------------------------------*/\r
+/* Private variables ---------------------------------------------------------*/\r
+\r
+/* Private constants ---------------------------------------------------------*/\r
+/** @defgroup UTILS_LL_Private_Constants UTILS Private Constants\r
+  * @{\r
+  */\r
+\r
+/* Max delay can be used in LL_mDelay */\r
+#define LL_MAX_DELAY                  0xFFFFFFFFU\r
+\r
+/**\r
+ * @brief Unique device ID register base address\r
+ */\r
+#define UID_BASE_ADDRESS              UID_BASE\r
+\r
+/**\r
+ * @brief Flash size data register base address\r
+ */\r
+#define FLASHSIZE_BASE_ADDRESS        FLASHSIZE_BASE\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Private macros ------------------------------------------------------------*/\r
+/** @defgroup UTILS_LL_Private_Macros UTILS Private Macros\r
+  * @{\r
+  */\r
+/**\r
+  * @}\r
+  */\r
+/* Exported types ------------------------------------------------------------*/\r
+/** @defgroup UTILS_LL_ES_INIT UTILS Exported structures\r
+  * @{\r
+  */\r
+/**\r
+  * @brief  UTILS PLL structure definition\r
+  */\r
+typedef struct\r
+{\r
+  uint32_t PLLMul;   /*!< Multiplication factor for PLL VCO input clock.\r
+                          This parameter can be a value of @ref RCC_LL_EC_PLL_MUL\r
+\r
+                          This feature can be modified afterwards using unitary function\r
+                          @ref LL_RCC_PLL_ConfigDomain_SYS(). */\r
+\r
+  uint32_t Prediv;   /*!< Division factor for HSE used as PLL clock source.\r
+                          This parameter can be a value of @ref RCC_LL_EC_PREDIV_DIV\r
+\r
+                          This feature can be modified afterwards using unitary function\r
+                          @ref LL_RCC_PLL_ConfigDomain_SYS(). */\r
+} LL_UTILS_PLLInitTypeDef;\r
+\r
+/**\r
+  * @brief  UTILS System, AHB and APB buses clock configuration structure definition\r
+  */\r
+typedef struct\r
+{\r
+  uint32_t AHBCLKDivider;         /*!< The AHB clock (HCLK) divider. This clock is derived from the system clock (SYSCLK).\r
+                                       This parameter can be a value of @ref RCC_LL_EC_SYSCLK_DIV\r
+\r
+                                       This feature can be modified afterwards using unitary function\r
+                                       @ref LL_RCC_SetAHBPrescaler(). */\r
+\r
+  uint32_t APB1CLKDivider;        /*!< The APB1 clock (PCLK1) divider. This clock is derived from the AHB clock (HCLK).\r
+                                       This parameter can be a value of @ref RCC_LL_EC_APB1_DIV\r
+\r
+                                       This feature can be modified afterwards using unitary function\r
+                                       @ref LL_RCC_SetAPB1Prescaler(). */\r
+\r
+  uint32_t APB2CLKDivider;        /*!< The APB2 clock (PCLK2) divider. This clock is derived from the AHB clock (HCLK).\r
+                                       This parameter can be a value of @ref RCC_LL_EC_APB2_DIV\r
+\r
+                                       This feature can be modified afterwards using unitary function\r
+                                       @ref LL_RCC_SetAPB2Prescaler(). */\r
+\r
+} LL_UTILS_ClkInitTypeDef;\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Exported constants --------------------------------------------------------*/\r
+/** @defgroup UTILS_LL_Exported_Constants UTILS Exported Constants\r
+  * @{\r
+  */\r
+\r
+/** @defgroup UTILS_EC_HSE_BYPASS HSE Bypass activation\r
+  * @{\r
+  */\r
+#define LL_UTILS_HSEBYPASS_OFF        0x00000000U       /*!< HSE Bypass is not enabled                */\r
+#define LL_UTILS_HSEBYPASS_ON         0x00000001U       /*!< HSE Bypass is enabled                    */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Exported macro ------------------------------------------------------------*/\r
+\r
+/* Exported functions --------------------------------------------------------*/\r
+/** @defgroup UTILS_LL_Exported_Functions UTILS Exported Functions\r
+  * @{\r
+  */\r
+\r
+/** @defgroup UTILS_EF_DEVICE_ELECTRONIC_SIGNATURE DEVICE ELECTRONIC SIGNATURE\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Get Word0 of the unique device identifier (UID based on 96 bits)\r
+  * @retval UID[31:0]\r
+  */\r
+__STATIC_INLINE uint32_t LL_GetUID_Word0(void)\r
+{\r
+  return (uint32_t)(READ_REG(*((uint32_t *)UID_BASE_ADDRESS)));\r
+}\r
+\r
+/**\r
+  * @brief  Get Word1 of the unique device identifier (UID based on 96 bits)\r
+  * @retval UID[63:32]\r
+  */\r
+__STATIC_INLINE uint32_t LL_GetUID_Word1(void)\r
+{\r
+  return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 4U))));\r
+}\r
+\r
+/**\r
+  * @brief  Get Word2 of the unique device identifier (UID based on 96 bits)\r
+  * @retval UID[95:64]\r
+  */\r
+__STATIC_INLINE uint32_t LL_GetUID_Word2(void)\r
+{\r
+  return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 8U))));\r
+}\r
+\r
+/**\r
+  * @brief  Get Flash memory size\r
+  * @note   This bitfield indicates the size of the device Flash memory expressed in\r
+  *         Kbytes. As an example, 0x040 corresponds to 64 Kbytes.\r
+  * @retval FLASH_SIZE[15:0]: Flash memory size\r
+  */\r
+__STATIC_INLINE uint32_t LL_GetFlashSize(void)\r
+{\r
+  return (uint16_t)(READ_REG(*((uint32_t *)FLASHSIZE_BASE_ADDRESS)));\r
+}\r
+\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup UTILS_LL_EF_DELAY DELAY\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  This function configures the Cortex-M SysTick source of the time base.\r
+  * @param  HCLKFrequency HCLK frequency in Hz (can be calculated thanks to RCC helper macro)\r
+  * @note   When a RTOS is used, it is recommended to avoid changing the SysTick\r
+  *         configuration by calling this function, for a delay use rather osDelay RTOS service.\r
+  * @param  Ticks Number of ticks\r
+  * @retval None\r
+  */\r
+__STATIC_INLINE void LL_InitTick(uint32_t HCLKFrequency, uint32_t Ticks)\r
+{\r
+  /* Configure the SysTick to have interrupt in 1ms time base */\r
+  SysTick->LOAD  = (uint32_t)((HCLKFrequency / Ticks) - 1UL);  /* set reload register */\r
+  SysTick->VAL   = 0UL;                                       /* Load the SysTick Counter Value */\r
+  SysTick->CTRL  = SysTick_CTRL_CLKSOURCE_Msk |\r
+                   SysTick_CTRL_ENABLE_Msk;                   /* Enable the Systick Timer */\r
+}\r
+\r
+void        LL_Init1msTick(uint32_t HCLKFrequency);\r
+void        LL_mDelay(uint32_t Delay);\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup UTILS_EF_SYSTEM SYSTEM\r
+  * @{\r
+  */\r
+\r
+void        LL_SetSystemCoreClock(uint32_t HCLKFrequency);\r
+#if defined(FLASH_ACR_LATENCY)\r
+ErrorStatus LL_SetFlashLatency(uint32_t Frequency);\r
+#endif /* FLASH_ACR_LATENCY */\r
+ErrorStatus LL_PLL_ConfigSystemClock_HSI(LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct,\r
+                                         LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct);\r
+ErrorStatus LL_PLL_ConfigSystemClock_HSE(uint32_t HSEFrequency, uint32_t HSEBypass,\r
+                                         LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct, LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct);\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __STM32F1xx_LL_UTILS_H */\r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.c b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.c
new file mode 100644 (file)
index 0000000..2b237fc
--- /dev/null
@@ -0,0 +1,314 @@
+/**\r
+  ******************************************************************************\r
+  * @file    stm32f1xx_ll_dma.c\r
+  * @author  MCD Application Team\r
+  * @brief   DMA LL module driver.\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+\r
+#if defined(USE_FULL_LL_DRIVER)\r
+\r
+/* Includes ------------------------------------------------------------------*/\r
+#include "stm32f1xx_ll_dma.h"\r
+#include "stm32f1xx_ll_bus.h"\r
+#ifdef  USE_FULL_ASSERT\r
+#include "stm32_assert.h"\r
+#else\r
+#define assert_param(expr) ((void)0U)\r
+#endif\r
+\r
+/** @addtogroup STM32F1xx_LL_Driver\r
+  * @{\r
+  */\r
+\r
+#if defined (DMA1) || defined (DMA2)\r
+\r
+/** @defgroup DMA_LL DMA\r
+  * @{\r
+  */\r
+\r
+/* Private types -------------------------------------------------------------*/\r
+/* Private variables ---------------------------------------------------------*/\r
+/* Private constants ---------------------------------------------------------*/\r
+/* Private macros ------------------------------------------------------------*/\r
+/** @addtogroup DMA_LL_Private_Macros\r
+  * @{\r
+  */\r
+#define IS_LL_DMA_DIRECTION(__VALUE__)          (((__VALUE__) == LL_DMA_DIRECTION_PERIPH_TO_MEMORY) || \\r
+                                                 ((__VALUE__) == LL_DMA_DIRECTION_MEMORY_TO_PERIPH) || \\r
+                                                 ((__VALUE__) == LL_DMA_DIRECTION_MEMORY_TO_MEMORY))\r
+\r
+#define IS_LL_DMA_MODE(__VALUE__)               (((__VALUE__) == LL_DMA_MODE_NORMAL) || \\r
+                                                 ((__VALUE__) == LL_DMA_MODE_CIRCULAR))\r
+\r
+#define IS_LL_DMA_PERIPHINCMODE(__VALUE__)      (((__VALUE__) == LL_DMA_PERIPH_INCREMENT) || \\r
+                                                 ((__VALUE__) == LL_DMA_PERIPH_NOINCREMENT))\r
+\r
+#define IS_LL_DMA_MEMORYINCMODE(__VALUE__)      (((__VALUE__) == LL_DMA_MEMORY_INCREMENT) || \\r
+                                                 ((__VALUE__) == LL_DMA_MEMORY_NOINCREMENT))\r
+\r
+#define IS_LL_DMA_PERIPHDATASIZE(__VALUE__)     (((__VALUE__) == LL_DMA_PDATAALIGN_BYTE)      || \\r
+                                                 ((__VALUE__) == LL_DMA_PDATAALIGN_HALFWORD)  || \\r
+                                                 ((__VALUE__) == LL_DMA_PDATAALIGN_WORD))\r
+\r
+#define IS_LL_DMA_MEMORYDATASIZE(__VALUE__)     (((__VALUE__) == LL_DMA_MDATAALIGN_BYTE)      || \\r
+                                                 ((__VALUE__) == LL_DMA_MDATAALIGN_HALFWORD)  || \\r
+                                                 ((__VALUE__) == LL_DMA_MDATAALIGN_WORD))\r
+\r
+#define IS_LL_DMA_NBDATA(__VALUE__)             ((__VALUE__)  <= 0x0000FFFFU)\r
+\r
+#define IS_LL_DMA_PRIORITY(__VALUE__)           (((__VALUE__) == LL_DMA_PRIORITY_LOW)    || \\r
+                                                 ((__VALUE__) == LL_DMA_PRIORITY_MEDIUM) || \\r
+                                                 ((__VALUE__) == LL_DMA_PRIORITY_HIGH)   || \\r
+                                                 ((__VALUE__) == LL_DMA_PRIORITY_VERYHIGH))\r
+\r
+#if defined (DMA2)\r
+#define IS_LL_DMA_ALL_CHANNEL_INSTANCE(INSTANCE, CHANNEL)  ((((INSTANCE) == DMA1) && \\r
+                                                            (((CHANNEL) == LL_DMA_CHANNEL_1) || \\r
+                                                             ((CHANNEL) == LL_DMA_CHANNEL_2) || \\r
+                                                             ((CHANNEL) == LL_DMA_CHANNEL_3) || \\r
+                                                             ((CHANNEL) == LL_DMA_CHANNEL_4) || \\r
+                                                             ((CHANNEL) == LL_DMA_CHANNEL_5) || \\r
+                                                             ((CHANNEL) == LL_DMA_CHANNEL_6) || \\r
+                                                             ((CHANNEL) == LL_DMA_CHANNEL_7))) || \\r
+                                                            (((INSTANCE) == DMA2) && \\r
+                                                            (((CHANNEL) == LL_DMA_CHANNEL_1) || \\r
+                                                             ((CHANNEL) == LL_DMA_CHANNEL_2) || \\r
+                                                             ((CHANNEL) == LL_DMA_CHANNEL_3) || \\r
+                                                             ((CHANNEL) == LL_DMA_CHANNEL_4) || \\r
+                                                             ((CHANNEL) == LL_DMA_CHANNEL_5))))\r
+#else\r
+#define IS_LL_DMA_ALL_CHANNEL_INSTANCE(INSTANCE, CHANNEL)  ((((INSTANCE) == DMA1) && \\r
+                                                            (((CHANNEL) == LL_DMA_CHANNEL_1) || \\r
+                                                             ((CHANNEL) == LL_DMA_CHANNEL_2) || \\r
+                                                             ((CHANNEL) == LL_DMA_CHANNEL_3) || \\r
+                                                             ((CHANNEL) == LL_DMA_CHANNEL_4) || \\r
+                                                             ((CHANNEL) == LL_DMA_CHANNEL_5) || \\r
+                                                             ((CHANNEL) == LL_DMA_CHANNEL_6) || \\r
+                                                             ((CHANNEL) == LL_DMA_CHANNEL_7))))\r
+#endif\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Private function prototypes -----------------------------------------------*/\r
+/* Exported functions --------------------------------------------------------*/\r
+/** @addtogroup DMA_LL_Exported_Functions\r
+  * @{\r
+  */\r
+\r
+/** @addtogroup DMA_LL_EF_Init\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  De-initialize the DMA registers to their default reset values.\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @retval An ErrorStatus enumeration value:\r
+  *          - SUCCESS: DMA registers are de-initialized\r
+  *          - ERROR: DMA registers are not de-initialized\r
+  */\r
+uint32_t LL_DMA_DeInit(DMA_TypeDef *DMAx, uint32_t Channel)\r
+{\r
+  DMA_Channel_TypeDef *tmp = (DMA_Channel_TypeDef *)DMA1_Channel1;\r
+  ErrorStatus status = SUCCESS;\r
+\r
+  /* Check the DMA Instance DMAx and Channel parameters*/\r
+  assert_param(IS_LL_DMA_ALL_CHANNEL_INSTANCE(DMAx, Channel));\r
+\r
+  tmp = (DMA_Channel_TypeDef *)(__LL_DMA_GET_CHANNEL_INSTANCE(DMAx, Channel));\r
+\r
+  /* Disable the selected DMAx_Channely */\r
+  CLEAR_BIT(tmp->CCR, DMA_CCR_EN);\r
+\r
+  /* Reset DMAx_Channely control register */\r
+  LL_DMA_WriteReg(tmp, CCR, 0U);\r
+\r
+  /* Reset DMAx_Channely remaining bytes register */\r
+  LL_DMA_WriteReg(tmp, CNDTR, 0U);\r
+\r
+  /* Reset DMAx_Channely peripheral address register */\r
+  LL_DMA_WriteReg(tmp, CPAR, 0U);\r
+\r
+  /* Reset DMAx_Channely memory address register */\r
+  LL_DMA_WriteReg(tmp, CMAR, 0U);\r
+\r
+  if (Channel == LL_DMA_CHANNEL_1)\r
+  {\r
+    /* Reset interrupt pending bits for DMAx Channel1 */\r
+    LL_DMA_ClearFlag_GI1(DMAx);\r
+  }\r
+  else if (Channel == LL_DMA_CHANNEL_2)\r
+  {\r
+    /* Reset interrupt pending bits for DMAx Channel2 */\r
+    LL_DMA_ClearFlag_GI2(DMAx);\r
+  }\r
+  else if (Channel == LL_DMA_CHANNEL_3)\r
+  {\r
+    /* Reset interrupt pending bits for DMAx Channel3 */\r
+    LL_DMA_ClearFlag_GI3(DMAx);\r
+  }\r
+  else if (Channel == LL_DMA_CHANNEL_4)\r
+  {\r
+    /* Reset interrupt pending bits for DMAx Channel4 */\r
+    LL_DMA_ClearFlag_GI4(DMAx);\r
+  }\r
+  else if (Channel == LL_DMA_CHANNEL_5)\r
+  {\r
+    /* Reset interrupt pending bits for DMAx Channel5 */\r
+    LL_DMA_ClearFlag_GI5(DMAx);\r
+  }\r
+\r
+  else if (Channel == LL_DMA_CHANNEL_6)\r
+  {\r
+    /* Reset interrupt pending bits for DMAx Channel6 */\r
+    LL_DMA_ClearFlag_GI6(DMAx);\r
+  }\r
+  else if (Channel == LL_DMA_CHANNEL_7)\r
+  {\r
+    /* Reset interrupt pending bits for DMAx Channel7 */\r
+    LL_DMA_ClearFlag_GI7(DMAx);\r
+  }\r
+  else\r
+  {\r
+    status = ERROR;\r
+  }\r
+\r
+  return status;\r
+}\r
+\r
+/**\r
+  * @brief  Initialize the DMA registers according to the specified parameters in DMA_InitStruct.\r
+  * @note   To convert DMAx_Channely Instance to DMAx Instance and Channely, use helper macros :\r
+  *         @arg @ref __LL_DMA_GET_INSTANCE\r
+  *         @arg @ref __LL_DMA_GET_CHANNEL\r
+  * @param  DMAx DMAx Instance\r
+  * @param  Channel This parameter can be one of the following values:\r
+  *         @arg @ref LL_DMA_CHANNEL_1\r
+  *         @arg @ref LL_DMA_CHANNEL_2\r
+  *         @arg @ref LL_DMA_CHANNEL_3\r
+  *         @arg @ref LL_DMA_CHANNEL_4\r
+  *         @arg @ref LL_DMA_CHANNEL_5\r
+  *         @arg @ref LL_DMA_CHANNEL_6\r
+  *         @arg @ref LL_DMA_CHANNEL_7\r
+  * @param  DMA_InitStruct pointer to a @ref LL_DMA_InitTypeDef structure.\r
+  * @retval An ErrorStatus enumeration value:\r
+  *          - SUCCESS: DMA registers are initialized\r
+  *          - ERROR: Not applicable\r
+  */\r
+uint32_t LL_DMA_Init(DMA_TypeDef *DMAx, uint32_t Channel, LL_DMA_InitTypeDef *DMA_InitStruct)\r
+{\r
+  /* Check the DMA Instance DMAx and Channel parameters*/\r
+  assert_param(IS_LL_DMA_ALL_CHANNEL_INSTANCE(DMAx, Channel));\r
+\r
+  /* Check the DMA parameters from DMA_InitStruct */\r
+  assert_param(IS_LL_DMA_DIRECTION(DMA_InitStruct->Direction));\r
+  assert_param(IS_LL_DMA_MODE(DMA_InitStruct->Mode));\r
+  assert_param(IS_LL_DMA_PERIPHINCMODE(DMA_InitStruct->PeriphOrM2MSrcIncMode));\r
+  assert_param(IS_LL_DMA_MEMORYINCMODE(DMA_InitStruct->MemoryOrM2MDstIncMode));\r
+  assert_param(IS_LL_DMA_PERIPHDATASIZE(DMA_InitStruct->PeriphOrM2MSrcDataSize));\r
+  assert_param(IS_LL_DMA_MEMORYDATASIZE(DMA_InitStruct->MemoryOrM2MDstDataSize));\r
+  assert_param(IS_LL_DMA_NBDATA(DMA_InitStruct->NbData));\r
+  assert_param(IS_LL_DMA_PRIORITY(DMA_InitStruct->Priority));\r
+\r
+  /*---------------------------- DMAx CCR Configuration ------------------------\r
+   * Configure DMAx_Channely: data transfer direction, data transfer mode,\r
+   *                          peripheral and memory increment mode,\r
+   *                          data size alignment and  priority level with parameters :\r
+   * - Direction:      DMA_CCR_DIR and DMA_CCR_MEM2MEM bits\r
+   * - Mode:           DMA_CCR_CIRC bit\r
+   * - PeriphOrM2MSrcIncMode:  DMA_CCR_PINC bit\r
+   * - MemoryOrM2MDstIncMode:  DMA_CCR_MINC bit\r
+   * - PeriphOrM2MSrcDataSize: DMA_CCR_PSIZE[1:0] bits\r
+   * - MemoryOrM2MDstDataSize: DMA_CCR_MSIZE[1:0] bits\r
+   * - Priority:               DMA_CCR_PL[1:0] bits\r
+   */\r
+  LL_DMA_ConfigTransfer(DMAx, Channel, DMA_InitStruct->Direction | \\r
+                        DMA_InitStruct->Mode                   | \\r
+                        DMA_InitStruct->PeriphOrM2MSrcIncMode  | \\r
+                        DMA_InitStruct->MemoryOrM2MDstIncMode  | \\r
+                        DMA_InitStruct->PeriphOrM2MSrcDataSize | \\r
+                        DMA_InitStruct->MemoryOrM2MDstDataSize | \\r
+                        DMA_InitStruct->Priority);\r
+\r
+  /*-------------------------- DMAx CMAR Configuration -------------------------\r
+   * Configure the memory or destination base address with parameter :\r
+   * - MemoryOrM2MDstAddress: DMA_CMAR_MA[31:0] bits\r
+   */\r
+  LL_DMA_SetMemoryAddress(DMAx, Channel, DMA_InitStruct->MemoryOrM2MDstAddress);\r
+\r
+  /*-------------------------- DMAx CPAR Configuration -------------------------\r
+   * Configure the peripheral or source base address with parameter :\r
+   * - PeriphOrM2MSrcAddress: DMA_CPAR_PA[31:0] bits\r
+   */\r
+  LL_DMA_SetPeriphAddress(DMAx, Channel, DMA_InitStruct->PeriphOrM2MSrcAddress);\r
+\r
+  /*--------------------------- DMAx CNDTR Configuration -----------------------\r
+   * Configure the peripheral base address with parameter :\r
+   * - NbData: DMA_CNDTR_NDT[15:0] bits\r
+   */\r
+  LL_DMA_SetDataLength(DMAx, Channel, DMA_InitStruct->NbData);\r
+\r
+  return SUCCESS;\r
+}\r
+\r
+/**\r
+  * @brief  Set each @ref LL_DMA_InitTypeDef field to default value.\r
+  * @param  DMA_InitStruct Pointer to a @ref LL_DMA_InitTypeDef structure.\r
+  * @retval None\r
+  */\r
+void LL_DMA_StructInit(LL_DMA_InitTypeDef *DMA_InitStruct)\r
+{\r
+  /* Set DMA_InitStruct fields to default values */\r
+  DMA_InitStruct->PeriphOrM2MSrcAddress  = 0x00000000U;\r
+  DMA_InitStruct->MemoryOrM2MDstAddress  = 0x00000000U;\r
+  DMA_InitStruct->Direction              = LL_DMA_DIRECTION_PERIPH_TO_MEMORY;\r
+  DMA_InitStruct->Mode                   = LL_DMA_MODE_NORMAL;\r
+  DMA_InitStruct->PeriphOrM2MSrcIncMode  = LL_DMA_PERIPH_NOINCREMENT;\r
+  DMA_InitStruct->MemoryOrM2MDstIncMode  = LL_DMA_MEMORY_NOINCREMENT;\r
+  DMA_InitStruct->PeriphOrM2MSrcDataSize = LL_DMA_PDATAALIGN_BYTE;\r
+  DMA_InitStruct->MemoryOrM2MDstDataSize = LL_DMA_MDATAALIGN_BYTE;\r
+  DMA_InitStruct->NbData                 = 0x00000000U;\r
+  DMA_InitStruct->Priority               = LL_DMA_PRIORITY_LOW;\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* DMA1 || DMA2 */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* USE_FULL_LL_DRIVER */\r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.c b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.c
new file mode 100644 (file)
index 0000000..1692ab1
--- /dev/null
@@ -0,0 +1,215 @@
+/**\r
+  ******************************************************************************\r
+  * @file    stm32f1xx_ll_exti.c\r
+  * @author  MCD Application Team\r
+  * @brief   EXTI LL module driver.\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+\r
+#if defined(USE_FULL_LL_DRIVER)\r
+\r
+/* Includes ------------------------------------------------------------------*/\r
+#include "stm32f1xx_ll_exti.h"\r
+#ifdef  USE_FULL_ASSERT\r
+#include "stm32_assert.h"\r
+#else\r
+#define assert_param(expr) ((void)0U)\r
+#endif\r
+\r
+/** @addtogroup STM32F1xx_LL_Driver\r
+  * @{\r
+  */\r
+\r
+#if defined (EXTI)\r
+\r
+/** @defgroup EXTI_LL EXTI\r
+  * @{\r
+  */\r
+\r
+/* Private types -------------------------------------------------------------*/\r
+/* Private variables ---------------------------------------------------------*/\r
+/* Private constants ---------------------------------------------------------*/\r
+/* Private macros ------------------------------------------------------------*/\r
+/** @addtogroup EXTI_LL_Private_Macros\r
+  * @{\r
+  */\r
+\r
+#define IS_LL_EXTI_LINE_0_31(__VALUE__)              (((__VALUE__) & ~LL_EXTI_LINE_ALL_0_31) == 0x00000000U)\r
+\r
+#define IS_LL_EXTI_MODE(__VALUE__)                   (((__VALUE__) == LL_EXTI_MODE_IT)            \\r
+                                                   || ((__VALUE__) == LL_EXTI_MODE_EVENT)         \\r
+                                                   || ((__VALUE__) == LL_EXTI_MODE_IT_EVENT))\r
+\r
+\r
+#define IS_LL_EXTI_TRIGGER(__VALUE__)                (((__VALUE__) == LL_EXTI_TRIGGER_NONE)       \\r
+                                                   || ((__VALUE__) == LL_EXTI_TRIGGER_RISING)     \\r
+                                                   || ((__VALUE__) == LL_EXTI_TRIGGER_FALLING)    \\r
+                                                   || ((__VALUE__) == LL_EXTI_TRIGGER_RISING_FALLING))\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Private function prototypes -----------------------------------------------*/\r
+\r
+/* Exported functions --------------------------------------------------------*/\r
+/** @addtogroup EXTI_LL_Exported_Functions\r
+  * @{\r
+  */\r
+\r
+/** @addtogroup EXTI_LL_EF_Init\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  De-initialize the EXTI registers to their default reset values.\r
+  * @retval An ErrorStatus enumeration value:\r
+  *          - SUCCESS: EXTI registers are de-initialized\r
+  *          - ERROR: not applicable\r
+  */\r
+uint32_t LL_EXTI_DeInit(void)\r
+{\r
+  /* Interrupt mask register set to default reset values */\r
+  LL_EXTI_WriteReg(IMR,   0x00000000U);\r
+  /* Event mask register set to default reset values */\r
+  LL_EXTI_WriteReg(EMR,   0x00000000U);\r
+  /* Rising Trigger selection register set to default reset values */\r
+  LL_EXTI_WriteReg(RTSR,  0x00000000U);\r
+  /* Falling Trigger selection register set to default reset values */\r
+  LL_EXTI_WriteReg(FTSR,  0x00000000U);\r
+  /* Software interrupt event register set to default reset values */\r
+  LL_EXTI_WriteReg(SWIER, 0x00000000U);\r
+  /* Pending register clear */\r
+  LL_EXTI_WriteReg(PR,    0x000FFFFFU);\r
+\r
+  return SUCCESS;\r
+}\r
+\r
+/**\r
+  * @brief  Initialize the EXTI registers according to the specified parameters in EXTI_InitStruct.\r
+  * @param  EXTI_InitStruct pointer to a @ref LL_EXTI_InitTypeDef structure.\r
+  * @retval An ErrorStatus enumeration value:\r
+  *          - SUCCESS: EXTI registers are initialized\r
+  *          - ERROR: not applicable\r
+  */\r
+uint32_t LL_EXTI_Init(LL_EXTI_InitTypeDef *EXTI_InitStruct)\r
+{\r
+  ErrorStatus status = SUCCESS;\r
+  /* Check the parameters */\r
+  assert_param(IS_LL_EXTI_LINE_0_31(EXTI_InitStruct->Line_0_31));\r
+  assert_param(IS_FUNCTIONAL_STATE(EXTI_InitStruct->LineCommand));\r
+  assert_param(IS_LL_EXTI_MODE(EXTI_InitStruct->Mode));\r
+\r
+  /* ENABLE LineCommand */\r
+  if (EXTI_InitStruct->LineCommand != DISABLE)\r
+  {\r
+    assert_param(IS_LL_EXTI_TRIGGER(EXTI_InitStruct->Trigger));\r
+\r
+    /* Configure EXTI Lines in range from 0 to 31 */\r
+    if (EXTI_InitStruct->Line_0_31 != LL_EXTI_LINE_NONE)\r
+    {\r
+      switch (EXTI_InitStruct->Mode)\r
+      {\r
+        case LL_EXTI_MODE_IT:\r
+          /* First Disable Event on provided Lines */\r
+          LL_EXTI_DisableEvent_0_31(EXTI_InitStruct->Line_0_31);\r
+          /* Then Enable IT on provided Lines */\r
+          LL_EXTI_EnableIT_0_31(EXTI_InitStruct->Line_0_31);\r
+          break;\r
+        case LL_EXTI_MODE_EVENT:\r
+          /* First Disable IT on provided Lines */\r
+          LL_EXTI_DisableIT_0_31(EXTI_InitStruct->Line_0_31);\r
+          /* Then Enable Event on provided Lines */\r
+          LL_EXTI_EnableEvent_0_31(EXTI_InitStruct->Line_0_31);\r
+          break;\r
+        case LL_EXTI_MODE_IT_EVENT:\r
+          /* Directly Enable IT & Event on provided Lines */\r
+          LL_EXTI_EnableIT_0_31(EXTI_InitStruct->Line_0_31);\r
+          LL_EXTI_EnableEvent_0_31(EXTI_InitStruct->Line_0_31);\r
+          break;\r
+        default:\r
+          status = ERROR;\r
+          break;\r
+      }\r
+      if (EXTI_InitStruct->Trigger != LL_EXTI_TRIGGER_NONE)\r
+      {\r
+        switch (EXTI_InitStruct->Trigger)\r
+        {\r
+          case LL_EXTI_TRIGGER_RISING:\r
+            /* First Disable Falling Trigger on provided Lines */\r
+            LL_EXTI_DisableFallingTrig_0_31(EXTI_InitStruct->Line_0_31);\r
+            /* Then Enable Rising Trigger on provided Lines */\r
+            LL_EXTI_EnableRisingTrig_0_31(EXTI_InitStruct->Line_0_31);\r
+            break;\r
+          case LL_EXTI_TRIGGER_FALLING:\r
+            /* First Disable Rising Trigger on provided Lines */\r
+            LL_EXTI_DisableRisingTrig_0_31(EXTI_InitStruct->Line_0_31);\r
+            /* Then Enable Falling Trigger on provided Lines */\r
+            LL_EXTI_EnableFallingTrig_0_31(EXTI_InitStruct->Line_0_31);\r
+            break;\r
+          case LL_EXTI_TRIGGER_RISING_FALLING:\r
+            LL_EXTI_EnableRisingTrig_0_31(EXTI_InitStruct->Line_0_31);\r
+            LL_EXTI_EnableFallingTrig_0_31(EXTI_InitStruct->Line_0_31);\r
+            break;\r
+          default:\r
+            status = ERROR;\r
+            break;\r
+        }\r
+      }\r
+    }\r
+  }\r
+  /* DISABLE LineCommand */\r
+  else\r
+  {\r
+    /* De-configure EXTI Lines in range from 0 to 31 */\r
+    LL_EXTI_DisableIT_0_31(EXTI_InitStruct->Line_0_31);\r
+    LL_EXTI_DisableEvent_0_31(EXTI_InitStruct->Line_0_31);\r
+  }\r
+  return status;\r
+}\r
+\r
+/**\r
+  * @brief  Set each @ref LL_EXTI_InitTypeDef field to default value.\r
+  * @param  EXTI_InitStruct Pointer to a @ref LL_EXTI_InitTypeDef structure.\r
+  * @retval None\r
+  */\r
+void LL_EXTI_StructInit(LL_EXTI_InitTypeDef *EXTI_InitStruct)\r
+{\r
+  EXTI_InitStruct->Line_0_31      = LL_EXTI_LINE_NONE;\r
+  EXTI_InitStruct->LineCommand    = DISABLE;\r
+  EXTI_InitStruct->Mode           = LL_EXTI_MODE_IT;\r
+  EXTI_InitStruct->Trigger        = LL_EXTI_TRIGGER_FALLING;\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* defined (EXTI) */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* USE_FULL_LL_DRIVER */\r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.c b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.c
new file mode 100644 (file)
index 0000000..2b44d83
--- /dev/null
@@ -0,0 +1,253 @@
+/**\r
+  ******************************************************************************\r
+  * @file    stm32f1xx_ll_gpio.c\r
+  * @author  MCD Application Team\r
+  * @brief   GPIO LL module driver.\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+\r
+#if defined(USE_FULL_LL_DRIVER)\r
+\r
+/* Includes ------------------------------------------------------------------*/\r
+#include "stm32f1xx_ll_gpio.h"\r
+#include "stm32f1xx_ll_bus.h"\r
+#ifdef  USE_FULL_ASSERT\r
+#include "stm32_assert.h"\r
+#else\r
+#define assert_param(expr) ((void)0U)\r
+#endif\r
+\r
+/** @addtogroup STM32F1xx_LL_Driver\r
+  * @{\r
+  */\r
+\r
+#if defined (GPIOA) || defined (GPIOB) || defined (GPIOC) || defined (GPIOD) || defined (GPIOE) || defined (GPIOF) || defined (GPIOG)\r
+\r
+/** @addtogroup GPIO_LL\r
+  * @{\r
+  */\r
+\r
+/* Private types -------------------------------------------------------------*/\r
+/* Private variables ---------------------------------------------------------*/\r
+/* Private constants ---------------------------------------------------------*/\r
+/* Private macros ------------------------------------------------------------*/\r
+/** @addtogroup GPIO_LL_Private_Macros\r
+  * @{\r
+  */\r
+\r
+#define IS_LL_GPIO_PIN(__VALUE__)          ((((__VALUE__) & LL_GPIO_PIN_ALL)!= 0u) &&\\r
+                                            (((__VALUE__) & (~LL_GPIO_PIN_ALL))== 0u))\r
+\r
+#define IS_LL_GPIO_MODE(__VALUE__)         (((__VALUE__) == LL_GPIO_MODE_ANALOG)       ||\\r
+                                            ((__VALUE__) == LL_GPIO_MODE_FLOATING)     ||\\r
+                                            ((__VALUE__) == LL_GPIO_MODE_INPUT)        ||\\r
+                                            ((__VALUE__) == LL_GPIO_MODE_OUTPUT)       ||\\r
+                                            ((__VALUE__) == LL_GPIO_MODE_ALTERNATE))\r
+\r
+#define IS_LL_GPIO_SPEED(__VALUE__)        (((__VALUE__) == LL_GPIO_SPEED_FREQ_LOW)       ||\\r
+                                            ((__VALUE__) == LL_GPIO_SPEED_FREQ_MEDIUM)    ||\\r
+                                            ((__VALUE__) == LL_GPIO_SPEED_FREQ_HIGH))\r
+\r
+#define IS_LL_GPIO_OUTPUT_TYPE(__VALUE__)  (((__VALUE__) == LL_GPIO_OUTPUT_PUSHPULL)  ||\\r
+                                            ((__VALUE__) == LL_GPIO_OUTPUT_OPENDRAIN))\r
+\r
+#define IS_LL_GPIO_PULL(__VALUE__)         (((__VALUE__) == LL_GPIO_PULL_DOWN)   ||\\r
+                                            ((__VALUE__) == LL_GPIO_PULL_UP))\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Private function prototypes -----------------------------------------------*/\r
+\r
+/* Exported functions --------------------------------------------------------*/\r
+/** @addtogroup GPIO_LL_Exported_Functions\r
+  * @{\r
+  */\r
+\r
+/** @addtogroup GPIO_LL_EF_Init\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  De-initialize GPIO registers (Registers restored to their default values).\r
+  * @param  GPIOx GPIO Port\r
+  * @retval An ErrorStatus enumeration value:\r
+  *          - SUCCESS: GPIO registers are de-initialized\r
+  *          - ERROR:   Wrong GPIO Port\r
+  */\r
+ErrorStatus LL_GPIO_DeInit(GPIO_TypeDef *GPIOx)\r
+{\r
+  ErrorStatus status = SUCCESS;\r
+\r
+  /* Check the parameters */\r
+  assert_param(IS_GPIO_ALL_INSTANCE(GPIOx));\r
+\r
+  /* Force and Release reset on clock of GPIOx Port */\r
+  if (GPIOx == GPIOA)\r
+  {\r
+    LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_GPIOA);\r
+    LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_GPIOA);\r
+  }\r
+  else if (GPIOx == GPIOB)\r
+  {\r
+    LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_GPIOB);\r
+    LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_GPIOB);\r
+  }\r
+  else if (GPIOx == GPIOC)\r
+  {\r
+    LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_GPIOC);\r
+    LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_GPIOC);\r
+  }\r
+  else if (GPIOx == GPIOD)\r
+  {\r
+    LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_GPIOD);\r
+    LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_GPIOD);\r
+  }\r
+#if defined(GPIOE)\r
+  else if (GPIOx == GPIOE)\r
+  {\r
+    LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_GPIOE);\r
+    LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_GPIOE);\r
+  }\r
+#endif\r
+#if defined(GPIOF)\r
+  else if (GPIOx == GPIOF)\r
+  {\r
+    LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_GPIOF);\r
+    LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_GPIOF);\r
+  }\r
+#endif\r
+#if defined(GPIOG)\r
+  else if (GPIOx == GPIOG)\r
+  {\r
+    LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_GPIOG);\r
+    LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_GPIOG);\r
+  }\r
+#endif\r
+  else\r
+  {\r
+    status = ERROR;\r
+  }\r
+\r
+  return (status);\r
+}\r
+\r
+/**\r
+  * @brief  Initialize GPIO registers according to the specified parameters in GPIO_InitStruct.\r
+  * @param  GPIOx GPIO Port\r
+  * @param  GPIO_InitStruct: pointer to a @ref LL_GPIO_InitTypeDef structure\r
+  *         that contains the configuration information for the specified GPIO peripheral.\r
+  * @retval An ErrorStatus enumeration value:\r
+  *          - SUCCESS: GPIO registers are initialized according to GPIO_InitStruct content\r
+  *          - ERROR:   Not applicable\r
+  */\r
+ErrorStatus LL_GPIO_Init(GPIO_TypeDef *GPIOx, LL_GPIO_InitTypeDef *GPIO_InitStruct)\r
+{\r
+  uint32_t pinmask;\r
+  uint32_t pinpos;\r
+  uint32_t currentpin;\r
+\r
+  /* Check the parameters */\r
+  assert_param(IS_GPIO_ALL_INSTANCE(GPIOx));\r
+  assert_param(IS_LL_GPIO_PIN(GPIO_InitStruct->Pin));\r
+\r
+  /* ------------------------- Configure the port pins ---------------- */\r
+  /* Initialize  pinpos on first pin set */\r
+\r
+  pinmask = ((GPIO_InitStruct->Pin) << GPIO_PIN_MASK_POS) >> GPIO_PIN_NB;\r
+  pinpos = POSITION_VAL(pinmask);\r
+\r
+  /* Configure the port pins */\r
+  while ((pinmask  >> pinpos) != 0u)\r
+  {\r
+    /* skip if bit is not set */\r
+    if ((pinmask & (1u << pinpos)) != 0u)\r
+    {\r
+      /* Get current io position */\r
+      if (pinpos < GPIO_PIN_MASK_POS)\r
+      {\r
+        currentpin = (0x00000101uL << pinpos);\r
+      }\r
+      else\r
+      {\r
+        currentpin = ((0x00010001u << (pinpos - GPIO_PIN_MASK_POS)) | 0x04000000u);\r
+      }\r
+\r
+      /* Check Pin Mode and Pin Pull parameters */\r
+      assert_param(IS_LL_GPIO_MODE(GPIO_InitStruct->Mode));\r
+      assert_param(IS_LL_GPIO_PULL(GPIO_InitStruct->Pull));\r
+\r
+      /* Pull-up Pull-down resistor configuration*/\r
+      LL_GPIO_SetPinPull(GPIOx, currentpin, GPIO_InitStruct->Pull);\r
+\r
+      /* Pin Mode configuration */\r
+      LL_GPIO_SetPinMode(GPIOx, currentpin, GPIO_InitStruct->Mode);\r
+\r
+      if ((GPIO_InitStruct->Mode == LL_GPIO_MODE_OUTPUT) || (GPIO_InitStruct->Mode == LL_GPIO_MODE_ALTERNATE))\r
+      {\r
+        /* Check speed and Output mode parameters */\r
+        assert_param(IS_LL_GPIO_SPEED(GPIO_InitStruct->Speed));\r
+        assert_param(IS_LL_GPIO_OUTPUT_TYPE(GPIO_InitStruct->OutputType));\r
+\r
+        /* Speed mode configuration */\r
+        LL_GPIO_SetPinSpeed(GPIOx, currentpin, GPIO_InitStruct->Speed);\r
+\r
+        /* Output mode configuration*/\r
+        LL_GPIO_SetPinOutputType(GPIOx, currentpin, GPIO_InitStruct->OutputType);\r
+      }\r
+    }\r
+    pinpos++;\r
+  }\r
+  return (SUCCESS);\r
+}\r
+\r
+/**\r
+  * @brief Set each @ref LL_GPIO_InitTypeDef field to default value.\r
+  * @param GPIO_InitStruct: pointer to a @ref LL_GPIO_InitTypeDef structure\r
+  *                          whose fields will be set to default values.\r
+  * @retval None\r
+  */\r
+\r
+void LL_GPIO_StructInit(LL_GPIO_InitTypeDef *GPIO_InitStruct)\r
+{\r
+  /* Reset GPIO init structure parameters values */\r
+  GPIO_InitStruct->Pin        = LL_GPIO_PIN_ALL;\r
+  GPIO_InitStruct->Mode       = LL_GPIO_MODE_FLOATING;\r
+  GPIO_InitStruct->Speed      = LL_GPIO_SPEED_FREQ_LOW;\r
+  GPIO_InitStruct->OutputType = LL_GPIO_OUTPUT_OPENDRAIN;\r
+  GPIO_InitStruct->Pull       = LL_GPIO_PULL_DOWN;\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* defined (GPIOA) || defined (GPIOB) || defined (GPIOC) || defined (GPIOD) || defined (GPIOE) || defined (GPIOF) || defined (GPIOG) */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* USE_FULL_LL_DRIVER */\r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.c b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.c
new file mode 100644 (file)
index 0000000..036adea
--- /dev/null
@@ -0,0 +1,86 @@
+/**\r
+  ******************************************************************************\r
+  * @file    stm32f1xx_ll_pwr.c\r
+  * @author  MCD Application Team\r
+  * @brief   PWR LL module driver.\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+\r
+#if defined(USE_FULL_LL_DRIVER)\r
+\r
+/* Includes ------------------------------------------------------------------*/\r
+#include "stm32f1xx_ll_pwr.h"\r
+#include "stm32f1xx_ll_bus.h"\r
+\r
+/** @addtogroup STM32F1xx_LL_Driver\r
+  * @{\r
+  */\r
+\r
+#if defined(PWR)\r
+\r
+/** @defgroup PWR_LL PWR\r
+  * @{\r
+  */\r
+\r
+/* Private types -------------------------------------------------------------*/\r
+/* Private variables ---------------------------------------------------------*/\r
+/* Private constants ---------------------------------------------------------*/\r
+/* Private macros ------------------------------------------------------------*/\r
+/* Private function prototypes -----------------------------------------------*/\r
+\r
+/* Exported functions --------------------------------------------------------*/\r
+/** @addtogroup PWR_LL_Exported_Functions\r
+  * @{\r
+  */\r
+\r
+/** @addtogroup PWR_LL_EF_Init\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  De-initialize the PWR registers to their default reset values.\r
+  * @retval An ErrorStatus enumeration value:\r
+  *          - SUCCESS: PWR registers are de-initialized\r
+  *          - ERROR: not applicable\r
+  */\r
+ErrorStatus LL_PWR_DeInit(void)\r
+{\r
+  /* Force reset of PWR clock */\r
+  LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_PWR);\r
+\r
+  /* Release reset of PWR clock */\r
+  LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_PWR);\r
+\r
+  return SUCCESS;\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+#endif /* defined(PWR) */\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* USE_FULL_LL_DRIVER */\r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.c b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.c
new file mode 100644 (file)
index 0000000..9ab07cf
--- /dev/null
@@ -0,0 +1,474 @@
+/**\r
+  ******************************************************************************\r
+  * @file    stm32f1xx_ll_rcc.c\r
+  * @author  MCD Application Team\r
+  * @brief   RCC LL module driver.\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+\r
+#if defined(USE_FULL_LL_DRIVER)\r
+\r
+/* Includes ------------------------------------------------------------------*/\r
+#include "stm32f1xx_ll_rcc.h"\r
+#ifdef  USE_FULL_ASSERT\r
+#include "stm32_assert.h"\r
+#else\r
+#define assert_param(expr) ((void)0U)\r
+#endif /* USE_FULL_ASSERT */\r
+/** @addtogroup STM32F1xx_LL_Driver\r
+  * @{\r
+  */\r
+\r
+#if defined(RCC)\r
+\r
+/** @defgroup RCC_LL RCC\r
+  * @{\r
+  */\r
+\r
+/* Private types -------------------------------------------------------------*/\r
+/* Private variables ---------------------------------------------------------*/\r
+/* Private constants ---------------------------------------------------------*/\r
+/* Private macros ------------------------------------------------------------*/\r
+/** @addtogroup RCC_LL_Private_Macros\r
+  * @{\r
+  */\r
+#if defined(RCC_PLLI2S_SUPPORT)\r
+#define IS_LL_RCC_I2S_CLKSOURCE(__VALUE__)     (((__VALUE__) == LL_RCC_I2S2_CLKSOURCE) \\r
+                                             || ((__VALUE__) == LL_RCC_I2S3_CLKSOURCE))\r
+#endif /* RCC_PLLI2S_SUPPORT */\r
+\r
+#if defined(USB) || defined(USB_OTG_FS)\r
+#define IS_LL_RCC_USB_CLKSOURCE(__VALUE__)    (((__VALUE__) == LL_RCC_USB_CLKSOURCE))\r
+#endif /* USB */\r
+\r
+#define IS_LL_RCC_ADC_CLKSOURCE(__VALUE__)    (((__VALUE__) == LL_RCC_ADC_CLKSOURCE))\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Private function prototypes -----------------------------------------------*/\r
+/** @defgroup RCC_LL_Private_Functions RCC Private functions\r
+  * @{\r
+  */\r
+uint32_t RCC_GetSystemClockFreq(void);\r
+uint32_t RCC_GetHCLKClockFreq(uint32_t SYSCLK_Frequency);\r
+uint32_t RCC_GetPCLK1ClockFreq(uint32_t HCLK_Frequency);\r
+uint32_t RCC_GetPCLK2ClockFreq(uint32_t HCLK_Frequency);\r
+uint32_t RCC_PLL_GetFreqDomain_SYS(void);\r
+#if defined(RCC_PLLI2S_SUPPORT)\r
+uint32_t RCC_PLLI2S_GetFreqDomain_I2S(void);\r
+#endif /* RCC_PLLI2S_SUPPORT */\r
+#if defined(RCC_PLL2_SUPPORT)\r
+uint32_t RCC_PLL2_GetFreqClockFreq(void);\r
+#endif /* RCC_PLL2_SUPPORT */\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Exported functions --------------------------------------------------------*/\r
+/** @addtogroup RCC_LL_Exported_Functions\r
+  * @{\r
+  */\r
+\r
+/** @addtogroup RCC_LL_EF_Init\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Reset the RCC clock configuration to the default reset state.\r
+  * @note   The default reset state of the clock configuration is given below:\r
+  *         - HSI ON and used as system clock source\r
+  *         - HSE PLL, PLL2 & PLL3 are OFF\r
+  *         - AHB, APB1 and APB2 prescaler set to 1.\r
+  *         - CSS, MCO OFF\r
+  *         - All interrupts disabled\r
+  * @note   This function doesn't modify the configuration of the\r
+  *         - Peripheral clocks\r
+  *         - LSI, LSE and RTC clocks\r
+  * @retval An ErrorStatus enumeration value:\r
+  *         - SUCCESS: RCC registers are de-initialized\r
+  *         - ERROR: not applicable\r
+  */\r
+ErrorStatus LL_RCC_DeInit(void)\r
+{\r
+  /* Set HSION bit */\r
+  LL_RCC_HSI_Enable();\r
+\r
+  /* Wait for HSI READY bit */\r
+  while (LL_RCC_HSI_IsReady() != 1U)\r
+  {}\r
+\r
+  /* Configure HSI as system clock source */\r
+  LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_HSI);\r
+\r
+  /* Wait till clock switch is ready */\r
+  while (LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_HSI)\r
+  {}\r
+\r
+  /* Reset PLLON bit */\r
+  CLEAR_BIT(RCC->CR, RCC_CR_PLLON);\r
+\r
+  /* Wait for PLL READY bit to be reset */\r
+  while (LL_RCC_PLL_IsReady() != 0U)\r
+  {}\r
+\r
+  /* Reset CFGR register */\r
+  LL_RCC_WriteReg(CFGR, 0x00000000U);\r
+\r
+  /* Reset HSEON, HSEBYP & CSSON bits */\r
+  CLEAR_BIT(RCC->CR, (RCC_CR_CSSON | RCC_CR_HSEON | RCC_CR_HSEBYP));\r
+\r
+#if defined(RCC_CR_PLL2ON)\r
+  /* Reset PLL2ON bit */\r
+  CLEAR_BIT(RCC->CR, RCC_CR_PLL2ON);\r
+#endif /* RCC_CR_PLL2ON */\r
+\r
+#if defined(RCC_CR_PLL3ON)\r
+  /* Reset PLL3ON bit */\r
+  CLEAR_BIT(RCC->CR, RCC_CR_PLL3ON);\r
+#endif /* RCC_CR_PLL3ON */\r
+\r
+  /* Set HSITRIM bits to the reset value */\r
+  LL_RCC_HSI_SetCalibTrimming(0x10U);\r
+\r
+#if defined(RCC_CFGR2_PREDIV1)\r
+  /* Reset CFGR2 register */\r
+  LL_RCC_WriteReg(CFGR2, 0x00000000U);\r
+#endif /* RCC_CFGR2_PREDIV1 */\r
+\r
+  /* Disable all interrupts */\r
+  LL_RCC_WriteReg(CIR, 0x00000000U);\r
+\r
+  /* Clear reset flags */\r
+  LL_RCC_ClearResetFlags();\r
+\r
+  return SUCCESS;\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @addtogroup RCC_LL_EF_Get_Freq\r
+  * @brief  Return the frequencies of different on chip clocks;  System, AHB, APB1 and APB2 buses clocks\r
+  *         and different peripheral clocks available on the device.\r
+  * @note   If SYSCLK source is HSI, function returns values based on HSI_VALUE(**)\r
+  * @note   If SYSCLK source is HSE, function returns values based on HSE_VALUE(***)\r
+  * @note   If SYSCLK source is PLL, function returns values based on\r
+  *         HSI_VALUE(**) or HSE_VALUE(***) multiplied/divided by the PLL factors.\r
+  * @note   (**) HSI_VALUE is a defined constant but the real value may vary\r
+  *              depending on the variations in voltage and temperature.\r
+  * @note   (***) HSE_VALUE is a defined constant, user has to ensure that\r
+  *               HSE_VALUE is same as the real frequency of the crystal used.\r
+  *               Otherwise, this function may have wrong result.\r
+  * @note   The result of this function could be incorrect when using fractional\r
+  *         value for HSE crystal.\r
+  * @note   This function can be used by the user application to compute the\r
+  *         baud-rate for the communication peripherals or configure other parameters.\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Return the frequencies of different on chip clocks;  System, AHB, APB1 and APB2 buses clocks\r
+  * @note   Each time SYSCLK, HCLK, PCLK1 and/or PCLK2 clock changes, this function\r
+  *         must be called to update structure fields. Otherwise, any\r
+  *         configuration based on this function will be incorrect.\r
+  * @param  RCC_Clocks pointer to a @ref LL_RCC_ClocksTypeDef structure which will hold the clocks frequencies\r
+  * @retval None\r
+  */\r
+void LL_RCC_GetSystemClocksFreq(LL_RCC_ClocksTypeDef *RCC_Clocks)\r
+{\r
+  /* Get SYSCLK frequency */\r
+  RCC_Clocks->SYSCLK_Frequency = RCC_GetSystemClockFreq();\r
+\r
+  /* HCLK clock frequency */\r
+  RCC_Clocks->HCLK_Frequency   = RCC_GetHCLKClockFreq(RCC_Clocks->SYSCLK_Frequency);\r
+\r
+  /* PCLK1 clock frequency */\r
+  RCC_Clocks->PCLK1_Frequency  = RCC_GetPCLK1ClockFreq(RCC_Clocks->HCLK_Frequency);\r
+\r
+  /* PCLK2 clock frequency */\r
+  RCC_Clocks->PCLK2_Frequency  = RCC_GetPCLK2ClockFreq(RCC_Clocks->HCLK_Frequency);\r
+}\r
+\r
+#if defined(RCC_CFGR2_I2S2SRC)\r
+/**\r
+  * @brief  Return I2Sx clock frequency\r
+  * @param  I2SxSource This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_I2S2_CLKSOURCE\r
+  *         @arg @ref LL_RCC_I2S3_CLKSOURCE\r
+  * @retval I2S clock frequency (in Hz)\r
+  */\r
+uint32_t LL_RCC_GetI2SClockFreq(uint32_t I2SxSource)\r
+{\r
+  uint32_t i2s_frequency = LL_RCC_PERIPH_FREQUENCY_NO;\r
+\r
+  /* Check parameter */\r
+  assert_param(IS_LL_RCC_I2S_CLKSOURCE(I2SxSource));\r
+\r
+  /* I2S1CLK clock frequency */\r
+  switch (LL_RCC_GetI2SClockSource(I2SxSource))\r
+  {\r
+    case LL_RCC_I2S2_CLKSOURCE_SYSCLK:        /*!< System clock selected as I2S clock source */\r
+    case LL_RCC_I2S3_CLKSOURCE_SYSCLK:\r
+      i2s_frequency = RCC_GetSystemClockFreq();\r
+      break;\r
+\r
+    case LL_RCC_I2S2_CLKSOURCE_PLLI2S_VCO:    /*!< PLLI2S oscillator clock selected as I2S clock source */\r
+    case LL_RCC_I2S3_CLKSOURCE_PLLI2S_VCO:\r
+    default:\r
+      i2s_frequency = RCC_PLLI2S_GetFreqDomain_I2S() * 2U;\r
+      break;\r
+  }\r
+\r
+  return i2s_frequency;\r
+}\r
+#endif /* RCC_CFGR2_I2S2SRC */\r
+\r
+#if defined(USB) || defined(USB_OTG_FS)\r
+/**\r
+  * @brief  Return USBx clock frequency\r
+  * @param  USBxSource This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_USB_CLKSOURCE\r
+  * @retval USB clock frequency (in Hz)\r
+  *         @arg @ref LL_RCC_PERIPH_FREQUENCY_NO indicates that oscillator (HSI), HSE or PLL is not ready\r
+  */\r
+uint32_t LL_RCC_GetUSBClockFreq(uint32_t USBxSource)\r
+{\r
+  uint32_t usb_frequency = LL_RCC_PERIPH_FREQUENCY_NO;\r
+\r
+  /* Check parameter */\r
+  assert_param(IS_LL_RCC_USB_CLKSOURCE(USBxSource));\r
+\r
+  /* USBCLK clock frequency */\r
+  switch (LL_RCC_GetUSBClockSource(USBxSource))\r
+  {\r
+#if defined(RCC_CFGR_USBPRE)\r
+    case LL_RCC_USB_CLKSOURCE_PLL:        /* PLL clock used as USB clock source */\r
+      if (LL_RCC_PLL_IsReady())\r
+      {\r
+        usb_frequency = RCC_PLL_GetFreqDomain_SYS();\r
+      }\r
+      break;\r
+\r
+    case LL_RCC_USB_CLKSOURCE_PLL_DIV_1_5:        /* PLL clock divided by 1.5 used as USB clock source */\r
+    default:\r
+      if (LL_RCC_PLL_IsReady())\r
+      {\r
+        usb_frequency = (RCC_PLL_GetFreqDomain_SYS() * 3U) / 2U;\r
+      }\r
+      break;\r
+#endif /* RCC_CFGR_USBPRE */\r
+#if defined(RCC_CFGR_OTGFSPRE)\r
+    /* USBCLK = PLLVCO/2\r
+              = (2 x PLLCLK) / 2\r
+              = PLLCLK */\r
+    case LL_RCC_USB_CLKSOURCE_PLL_DIV_2:        /* PLL clock used as USB clock source */\r
+      if (LL_RCC_PLL_IsReady())\r
+      {\r
+        usb_frequency = RCC_PLL_GetFreqDomain_SYS();\r
+      }\r
+      break;\r
+\r
+    /* USBCLK = PLLVCO/3\r
+              = (2 x PLLCLK) / 3 */\r
+    case LL_RCC_USB_CLKSOURCE_PLL_DIV_3:        /* PLL clock divided by 3 used as USB clock source */\r
+    default:\r
+      if (LL_RCC_PLL_IsReady())\r
+      {\r
+        usb_frequency = (RCC_PLL_GetFreqDomain_SYS() * 2U) / 3U;\r
+      }\r
+      break;\r
+#endif /* RCC_CFGR_OTGFSPRE */\r
+  }\r
+\r
+  return usb_frequency;\r
+}\r
+#endif /* USB */\r
+\r
+/**\r
+  * @brief  Return ADCx clock frequency\r
+  * @param  ADCxSource This parameter can be one of the following values:\r
+  *         @arg @ref LL_RCC_ADC_CLKSOURCE\r
+  * @retval ADC clock frequency (in Hz)\r
+  */\r
+uint32_t LL_RCC_GetADCClockFreq(uint32_t ADCxSource)\r
+{\r
+  uint32_t adc_prescaler = 0U;\r
+  uint32_t adc_frequency = 0U;\r
+\r
+  /* Check parameter */\r
+  assert_param(IS_LL_RCC_ADC_CLKSOURCE(ADCxSource));\r
+\r
+  /* Get ADC prescaler */\r
+  adc_prescaler = LL_RCC_GetADCClockSource(ADCxSource);\r
+\r
+  /* ADC frequency = PCLK2 frequency / ADC prescaler (2, 4, 6 or 8) */\r
+  adc_frequency = RCC_GetPCLK2ClockFreq(RCC_GetHCLKClockFreq(RCC_GetSystemClockFreq()))\r
+                  / (((adc_prescaler >> POSITION_VAL(ADCxSource)) + 1U) * 2U);\r
+\r
+  return adc_frequency;\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @addtogroup RCC_LL_Private_Functions\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  Return SYSTEM clock frequency\r
+  * @retval SYSTEM clock frequency (in Hz)\r
+  */\r
+uint32_t RCC_GetSystemClockFreq(void)\r
+{\r
+  uint32_t frequency = 0U;\r
+\r
+  /* Get SYSCLK source -------------------------------------------------------*/\r
+  switch (LL_RCC_GetSysClkSource())\r
+  {\r
+    case LL_RCC_SYS_CLKSOURCE_STATUS_HSI:  /* HSI used as system clock  source */\r
+      frequency = HSI_VALUE;\r
+      break;\r
+\r
+    case LL_RCC_SYS_CLKSOURCE_STATUS_HSE:  /* HSE used as system clock  source */\r
+      frequency = HSE_VALUE;\r
+      break;\r
+\r
+    case LL_RCC_SYS_CLKSOURCE_STATUS_PLL:  /* PLL used as system clock  source */\r
+      frequency = RCC_PLL_GetFreqDomain_SYS();\r
+      break;\r
+\r
+    default:\r
+      frequency = HSI_VALUE;\r
+      break;\r
+  }\r
+\r
+  return frequency;\r
+}\r
+\r
+/**\r
+  * @brief  Return HCLK clock frequency\r
+  * @param  SYSCLK_Frequency SYSCLK clock frequency\r
+  * @retval HCLK clock frequency (in Hz)\r
+  */\r
+uint32_t RCC_GetHCLKClockFreq(uint32_t SYSCLK_Frequency)\r
+{\r
+  /* HCLK clock frequency */\r
+  return __LL_RCC_CALC_HCLK_FREQ(SYSCLK_Frequency, LL_RCC_GetAHBPrescaler());\r
+}\r
+\r
+/**\r
+  * @brief  Return PCLK1 clock frequency\r
+  * @param  HCLK_Frequency HCLK clock frequency\r
+  * @retval PCLK1 clock frequency (in Hz)\r
+  */\r
+uint32_t RCC_GetPCLK1ClockFreq(uint32_t HCLK_Frequency)\r
+{\r
+  /* PCLK1 clock frequency */\r
+  return __LL_RCC_CALC_PCLK1_FREQ(HCLK_Frequency, LL_RCC_GetAPB1Prescaler());\r
+}\r
+\r
+/**\r
+  * @brief  Return PCLK2 clock frequency\r
+  * @param  HCLK_Frequency HCLK clock frequency\r
+  * @retval PCLK2 clock frequency (in Hz)\r
+  */\r
+uint32_t RCC_GetPCLK2ClockFreq(uint32_t HCLK_Frequency)\r
+{\r
+  /* PCLK2 clock frequency */\r
+  return __LL_RCC_CALC_PCLK2_FREQ(HCLK_Frequency, LL_RCC_GetAPB2Prescaler());\r
+}\r
+\r
+/**\r
+  * @brief  Return PLL clock frequency used for system domain\r
+  * @retval PLL clock frequency (in Hz)\r
+  */\r
+uint32_t RCC_PLL_GetFreqDomain_SYS(void)\r
+{\r
+  uint32_t pllinputfreq = 0U, pllsource = 0U;\r
+\r
+  /* PLL_VCO = (HSE_VALUE, HSI_VALUE or PLL2 / PLL Predivider) * PLL Multiplicator */\r
+\r
+  /* Get PLL source */\r
+  pllsource = LL_RCC_PLL_GetMainSource();\r
+\r
+  switch (pllsource)\r
+  {\r
+    case LL_RCC_PLLSOURCE_HSI_DIV_2: /* HSI used as PLL clock source */\r
+      pllinputfreq = HSI_VALUE / 2U;\r
+      break;\r
+\r
+    case LL_RCC_PLLSOURCE_HSE:       /* HSE used as PLL clock source */\r
+      pllinputfreq = HSE_VALUE / (LL_RCC_PLL_GetPrediv() + 1U);\r
+      break;\r
+\r
+#if defined(RCC_PLL2_SUPPORT)\r
+    case LL_RCC_PLLSOURCE_PLL2:       /* PLL2 used as PLL clock source */\r
+      pllinputfreq = RCC_PLL2_GetFreqClockFreq() / (LL_RCC_PLL_GetPrediv() + 1U);\r
+      break;\r
+#endif /* RCC_PLL2_SUPPORT */\r
+\r
+    default:\r
+      pllinputfreq = HSI_VALUE / 2U;\r
+      break;\r
+  }\r
+  return __LL_RCC_CALC_PLLCLK_FREQ(pllinputfreq, LL_RCC_PLL_GetMultiplicator());\r
+}\r
+\r
+#if defined(RCC_PLL2_SUPPORT)\r
+/**\r
+  * @brief  Return PLL clock frequency used for system domain\r
+  * @retval PLL clock frequency (in Hz)\r
+  */\r
+uint32_t RCC_PLL2_GetFreqClockFreq(void)\r
+{\r
+  return __LL_RCC_CALC_PLL2CLK_FREQ(HSE_VALUE, LL_RCC_PLL2_GetMultiplicator(), LL_RCC_HSE_GetPrediv2());\r
+}\r
+#endif /* RCC_PLL2_SUPPORT */\r
+\r
+#if defined(RCC_PLLI2S_SUPPORT)\r
+/**\r
+  * @brief  Return PLL clock frequency used for system domain\r
+  * @retval PLL clock frequency (in Hz)\r
+  */\r
+uint32_t RCC_PLLI2S_GetFreqDomain_I2S(void)\r
+{\r
+  return __LL_RCC_CALC_PLLI2SCLK_FREQ(HSE_VALUE, LL_RCC_PLLI2S_GetMultiplicator(), LL_RCC_HSE_GetPrediv2());\r
+}\r
+#endif /* RCC_PLLI2S_SUPPORT */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* defined(RCC) */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* USE_FULL_LL_DRIVER */\r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.c b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.c
new file mode 100644 (file)
index 0000000..3ee44a5
--- /dev/null
@@ -0,0 +1,446 @@
+/**\r
+  ******************************************************************************\r
+  * @file    stm32f1xx_ll_usart.c\r
+  * @author  MCD Application Team\r
+  * @brief   USART LL module driver.\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+\r
+#if defined(USE_FULL_LL_DRIVER)\r
+\r
+/* Includes ------------------------------------------------------------------*/\r
+#include "stm32f1xx_ll_usart.h"\r
+#include "stm32f1xx_ll_rcc.h"\r
+#include "stm32f1xx_ll_bus.h"\r
+#ifdef  USE_FULL_ASSERT\r
+#include "stm32_assert.h"\r
+#else\r
+#define assert_param(expr) ((void)0U)\r
+#endif\r
+\r
+/** @addtogroup STM32F1xx_LL_Driver\r
+  * @{\r
+  */\r
+\r
+#if defined (USART1) || defined (USART2) || defined (USART3) || defined (UART4) || defined (UART5)\r
+\r
+/** @addtogroup USART_LL\r
+  * @{\r
+  */\r
+\r
+/* Private types -------------------------------------------------------------*/\r
+/* Private variables ---------------------------------------------------------*/\r
+/* Private constants ---------------------------------------------------------*/\r
+/** @addtogroup USART_LL_Private_Constants\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+\r
+/* Private macros ------------------------------------------------------------*/\r
+/** @addtogroup USART_LL_Private_Macros\r
+  * @{\r
+  */\r
+\r
+/* __BAUDRATE__ The maximum Baud Rate is derived from the maximum clock available\r
+ *              divided by the smallest oversampling used on the USART (i.e. 8)    */\r
+#define IS_LL_USART_BAUDRATE(__BAUDRATE__) ((__BAUDRATE__) <= 4500000U)\r
+\r
+/* __VALUE__ In case of oversampling by 16 and 8, BRR content must be greater than or equal to 16d. */\r
+#define IS_LL_USART_BRR_MIN(__VALUE__) ((__VALUE__) >= 16U)\r
+\r
+/* __VALUE__ BRR content must be lower than or equal to 0xFFFF. */\r
+#define IS_LL_USART_BRR_MAX(__VALUE__) ((__VALUE__) <= 0x0000FFFFU)\r
+\r
+#define IS_LL_USART_DIRECTION(__VALUE__) (((__VALUE__) == LL_USART_DIRECTION_NONE) \\r
+                                       || ((__VALUE__) == LL_USART_DIRECTION_RX) \\r
+                                       || ((__VALUE__) == LL_USART_DIRECTION_TX) \\r
+                                       || ((__VALUE__) == LL_USART_DIRECTION_TX_RX))\r
+\r
+#define IS_LL_USART_PARITY(__VALUE__) (((__VALUE__) == LL_USART_PARITY_NONE) \\r
+                                    || ((__VALUE__) == LL_USART_PARITY_EVEN) \\r
+                                    || ((__VALUE__) == LL_USART_PARITY_ODD))\r
+\r
+#define IS_LL_USART_DATAWIDTH(__VALUE__) (((__VALUE__) == LL_USART_DATAWIDTH_8B) \\r
+                                       || ((__VALUE__) == LL_USART_DATAWIDTH_9B))\r
+\r
+#define IS_LL_USART_OVERSAMPLING(__VALUE__) (((__VALUE__) == LL_USART_OVERSAMPLING_16) \\r
+                                          || ((__VALUE__) == LL_USART_OVERSAMPLING_8))\r
+\r
+#define IS_LL_USART_LASTBITCLKOUTPUT(__VALUE__) (((__VALUE__) == LL_USART_LASTCLKPULSE_NO_OUTPUT) \\r
+                                              || ((__VALUE__) == LL_USART_LASTCLKPULSE_OUTPUT))\r
+\r
+#define IS_LL_USART_CLOCKPHASE(__VALUE__) (((__VALUE__) == LL_USART_PHASE_1EDGE) \\r
+                                        || ((__VALUE__) == LL_USART_PHASE_2EDGE))\r
+\r
+#define IS_LL_USART_CLOCKPOLARITY(__VALUE__) (((__VALUE__) == LL_USART_POLARITY_LOW) \\r
+                                           || ((__VALUE__) == LL_USART_POLARITY_HIGH))\r
+\r
+#define IS_LL_USART_CLOCKOUTPUT(__VALUE__) (((__VALUE__) == LL_USART_CLOCK_DISABLE) \\r
+                                         || ((__VALUE__) == LL_USART_CLOCK_ENABLE))\r
+\r
+#define IS_LL_USART_STOPBITS(__VALUE__) (((__VALUE__) == LL_USART_STOPBITS_0_5) \\r
+                                      || ((__VALUE__) == LL_USART_STOPBITS_1) \\r
+                                      || ((__VALUE__) == LL_USART_STOPBITS_1_5) \\r
+                                      || ((__VALUE__) == LL_USART_STOPBITS_2))\r
+\r
+#define IS_LL_USART_HWCONTROL(__VALUE__) (((__VALUE__) == LL_USART_HWCONTROL_NONE) \\r
+                                       || ((__VALUE__) == LL_USART_HWCONTROL_RTS) \\r
+                                       || ((__VALUE__) == LL_USART_HWCONTROL_CTS) \\r
+                                       || ((__VALUE__) == LL_USART_HWCONTROL_RTS_CTS))\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Private function prototypes -----------------------------------------------*/\r
+\r
+/* Exported functions --------------------------------------------------------*/\r
+/** @addtogroup USART_LL_Exported_Functions\r
+  * @{\r
+  */\r
+\r
+/** @addtogroup USART_LL_EF_Init\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  De-initialize USART registers (Registers restored to their default values).\r
+  * @param  USARTx USART Instance\r
+  * @retval An ErrorStatus enumeration value:\r
+  *          - SUCCESS: USART registers are de-initialized\r
+  *          - ERROR: USART registers are not de-initialized\r
+  */\r
+ErrorStatus LL_USART_DeInit(USART_TypeDef *USARTx)\r
+{\r
+  ErrorStatus status = SUCCESS;\r
+\r
+  /* Check the parameters */\r
+  assert_param(IS_UART_INSTANCE(USARTx));\r
+\r
+  if (USARTx == USART1)\r
+  {\r
+    /* Force reset of USART clock */\r
+    LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_USART1);\r
+\r
+    /* Release reset of USART clock */\r
+    LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_USART1);\r
+  }\r
+  else if (USARTx == USART2)\r
+  {\r
+    /* Force reset of USART clock */\r
+    LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_USART2);\r
+\r
+    /* Release reset of USART clock */\r
+    LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_USART2);\r
+  }\r
+#if defined(USART3)\r
+  else if (USARTx == USART3)\r
+  {\r
+    /* Force reset of USART clock */\r
+    LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_USART3);\r
+\r
+    /* Release reset of USART clock */\r
+    LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_USART3);\r
+  }\r
+#endif /* USART3 */\r
+#if defined(UART4)\r
+  else if (USARTx == UART4)\r
+  {\r
+    /* Force reset of UART clock */\r
+    LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_UART4);\r
+\r
+    /* Release reset of UART clock */\r
+    LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_UART4);\r
+  }\r
+#endif /* UART4 */\r
+#if defined(UART5)\r
+  else if (USARTx == UART5)\r
+  {\r
+    /* Force reset of UART clock */\r
+    LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_UART5);\r
+\r
+    /* Release reset of UART clock */\r
+    LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_UART5);\r
+  }\r
+#endif /* UART5 */\r
+  else\r
+  {\r
+    status = ERROR;\r
+  }\r
+\r
+  return (status);\r
+}\r
+\r
+/**\r
+  * @brief  Initialize USART registers according to the specified\r
+  *         parameters in USART_InitStruct.\r
+  * @note   As some bits in USART configuration registers can only be written when the USART is disabled (USART_CR1_UE bit =0),\r
+  *         USART IP should be in disabled state prior calling this function. Otherwise, ERROR result will be returned.\r
+  * @note   Baud rate value stored in USART_InitStruct BaudRate field, should be valid (different from 0).\r
+  * @param  USARTx USART Instance\r
+  * @param  USART_InitStruct pointer to a LL_USART_InitTypeDef structure\r
+  *         that contains the configuration information for the specified USART peripheral.\r
+  * @retval An ErrorStatus enumeration value:\r
+  *          - SUCCESS: USART registers are initialized according to USART_InitStruct content\r
+  *          - ERROR: Problem occurred during USART Registers initialization\r
+  */\r
+ErrorStatus LL_USART_Init(USART_TypeDef *USARTx, LL_USART_InitTypeDef *USART_InitStruct)\r
+{\r
+  ErrorStatus status = ERROR;\r
+  uint32_t periphclk = LL_RCC_PERIPH_FREQUENCY_NO;\r
+  LL_RCC_ClocksTypeDef rcc_clocks;\r
+\r
+  /* Check the parameters */\r
+  assert_param(IS_UART_INSTANCE(USARTx));\r
+  assert_param(IS_LL_USART_BAUDRATE(USART_InitStruct->BaudRate));\r
+  assert_param(IS_LL_USART_DATAWIDTH(USART_InitStruct->DataWidth));\r
+  assert_param(IS_LL_USART_STOPBITS(USART_InitStruct->StopBits));\r
+  assert_param(IS_LL_USART_PARITY(USART_InitStruct->Parity));\r
+  assert_param(IS_LL_USART_DIRECTION(USART_InitStruct->TransferDirection));\r
+  assert_param(IS_LL_USART_HWCONTROL(USART_InitStruct->HardwareFlowControl));\r
+#if defined(USART_CR1_OVER8)\r
+  assert_param(IS_LL_USART_OVERSAMPLING(USART_InitStruct->OverSampling));\r
+#endif /* USART_OverSampling_Feature */\r
+\r
+  /* USART needs to be in disabled state, in order to be able to configure some bits in\r
+     CRx registers */\r
+  if (LL_USART_IsEnabled(USARTx) == 0U)\r
+  {\r
+    /*---------------------------- USART CR1 Configuration -----------------------\r
+     * Configure USARTx CR1 (USART Word Length, Parity, Mode and Oversampling bits) with parameters:\r
+     * - DataWidth:          USART_CR1_M bits according to USART_InitStruct->DataWidth value\r
+     * - Parity:             USART_CR1_PCE, USART_CR1_PS bits according to USART_InitStruct->Parity value\r
+     * - TransferDirection:  USART_CR1_TE, USART_CR1_RE bits according to USART_InitStruct->TransferDirection value\r
+     * - Oversampling:       USART_CR1_OVER8 bit according to USART_InitStruct->OverSampling value.\r
+     */\r
+#if defined(USART_CR1_OVER8)\r
+    MODIFY_REG(USARTx->CR1,\r
+               (USART_CR1_M | USART_CR1_PCE | USART_CR1_PS |\r
+                USART_CR1_TE | USART_CR1_RE | USART_CR1_OVER8),\r
+               (USART_InitStruct->DataWidth | USART_InitStruct->Parity |\r
+                USART_InitStruct->TransferDirection | USART_InitStruct->OverSampling));\r
+#else\r
+    MODIFY_REG(USARTx->CR1,\r
+               (USART_CR1_M | USART_CR1_PCE | USART_CR1_PS |\r
+                USART_CR1_TE | USART_CR1_RE),\r
+               (USART_InitStruct->DataWidth | USART_InitStruct->Parity |\r
+                USART_InitStruct->TransferDirection));\r
+#endif /* USART_OverSampling_Feature */\r
+\r
+    /*---------------------------- USART CR2 Configuration -----------------------\r
+     * Configure USARTx CR2 (Stop bits) with parameters:\r
+     * - Stop Bits:          USART_CR2_STOP bits according to USART_InitStruct->StopBits value.\r
+     * - CLKEN, CPOL, CPHA and LBCL bits are to be configured using LL_USART_ClockInit().\r
+     */\r
+    LL_USART_SetStopBitsLength(USARTx, USART_InitStruct->StopBits);\r
+\r
+    /*---------------------------- USART CR3 Configuration -----------------------\r
+     * Configure USARTx CR3 (Hardware Flow Control) with parameters:\r
+     * - HardwareFlowControl: USART_CR3_RTSE, USART_CR3_CTSE bits according to USART_InitStruct->HardwareFlowControl value.\r
+     */\r
+    LL_USART_SetHWFlowCtrl(USARTx, USART_InitStruct->HardwareFlowControl);\r
+\r
+    /*---------------------------- USART BRR Configuration -----------------------\r
+     * Retrieve Clock frequency used for USART Peripheral\r
+     */\r
+    LL_RCC_GetSystemClocksFreq(&rcc_clocks);\r
+    if (USARTx == USART1)\r
+    {\r
+      periphclk = rcc_clocks.PCLK2_Frequency;\r
+    }\r
+    else if (USARTx == USART2)\r
+    {\r
+      periphclk = rcc_clocks.PCLK1_Frequency;\r
+    }\r
+#if defined(USART3)\r
+    else if (USARTx == USART3)\r
+    {\r
+      periphclk = rcc_clocks.PCLK1_Frequency;\r
+    }\r
+#endif /* USART3 */\r
+#if defined(UART4)\r
+    else if (USARTx == UART4)\r
+    {\r
+      periphclk = rcc_clocks.PCLK1_Frequency;\r
+    }\r
+#endif /* UART4 */\r
+#if defined(UART5)\r
+    else if (USARTx == UART5)\r
+    {\r
+      periphclk = rcc_clocks.PCLK1_Frequency;\r
+    }\r
+#endif /* UART5 */\r
+    else\r
+    {\r
+      /* Nothing to do, as error code is already assigned to ERROR value */\r
+    }\r
+\r
+    /* Configure the USART Baud Rate :\r
+       - valid baud rate value (different from 0) is required\r
+       - Peripheral clock as returned by RCC service, should be valid (different from 0).\r
+    */\r
+    if ((periphclk != LL_RCC_PERIPH_FREQUENCY_NO)\r
+        && (USART_InitStruct->BaudRate != 0U))\r
+    {\r
+      status = SUCCESS;\r
+#if defined(USART_CR1_OVER8)\r
+      LL_USART_SetBaudRate(USARTx,\r
+                           periphclk,\r
+                           USART_InitStruct->OverSampling,\r
+                           USART_InitStruct->BaudRate);\r
+#else\r
+      LL_USART_SetBaudRate(USARTx,\r
+                           periphclk,\r
+                           USART_InitStruct->BaudRate);\r
+#endif /* USART_OverSampling_Feature */\r
+\r
+      /* Check BRR is greater than or equal to 16d */\r
+      assert_param(IS_LL_USART_BRR_MIN(USARTx->BRR));\r
+\r
+      /* Check BRR is greater than or equal to 16d */\r
+      assert_param(IS_LL_USART_BRR_MAX(USARTx->BRR));\r
+    }\r
+  }\r
+  /* Endif (=> USART not in Disabled state => return ERROR) */\r
+\r
+  return (status);\r
+}\r
+\r
+/**\r
+  * @brief Set each @ref LL_USART_InitTypeDef field to default value.\r
+  * @param USART_InitStruct Pointer to a @ref LL_USART_InitTypeDef structure\r
+  *                         whose fields will be set to default values.\r
+  * @retval None\r
+  */\r
+\r
+void LL_USART_StructInit(LL_USART_InitTypeDef *USART_InitStruct)\r
+{\r
+  /* Set USART_InitStruct fields to default values */\r
+  USART_InitStruct->BaudRate            = 9600U;\r
+  USART_InitStruct->DataWidth           = LL_USART_DATAWIDTH_8B;\r
+  USART_InitStruct->StopBits            = LL_USART_STOPBITS_1;\r
+  USART_InitStruct->Parity              = LL_USART_PARITY_NONE ;\r
+  USART_InitStruct->TransferDirection   = LL_USART_DIRECTION_TX_RX;\r
+  USART_InitStruct->HardwareFlowControl = LL_USART_HWCONTROL_NONE;\r
+#if defined(USART_CR1_OVER8)\r
+  USART_InitStruct->OverSampling        = LL_USART_OVERSAMPLING_16;\r
+#endif /* USART_OverSampling_Feature */\r
+}\r
+\r
+/**\r
+  * @brief  Initialize USART Clock related settings according to the\r
+  *         specified parameters in the USART_ClockInitStruct.\r
+  * @note   As some bits in USART configuration registers can only be written when the USART is disabled (USART_CR1_UE bit =0),\r
+  *         USART IP should be in disabled state prior calling this function. Otherwise, ERROR result will be returned.\r
+  * @param  USARTx USART Instance\r
+  * @param  USART_ClockInitStruct Pointer to a @ref LL_USART_ClockInitTypeDef structure\r
+  *         that contains the Clock configuration information for the specified USART peripheral.\r
+  * @retval An ErrorStatus enumeration value:\r
+  *          - SUCCESS: USART registers related to Clock settings are initialized according to USART_ClockInitStruct content\r
+  *          - ERROR: Problem occurred during USART Registers initialization\r
+  */\r
+ErrorStatus LL_USART_ClockInit(USART_TypeDef *USARTx, LL_USART_ClockInitTypeDef *USART_ClockInitStruct)\r
+{\r
+  ErrorStatus status = SUCCESS;\r
+\r
+  /* Check USART Instance and Clock signal output parameters */\r
+  assert_param(IS_UART_INSTANCE(USARTx));\r
+  assert_param(IS_LL_USART_CLOCKOUTPUT(USART_ClockInitStruct->ClockOutput));\r
+\r
+  /* USART needs to be in disabled state, in order to be able to configure some bits in\r
+     CRx registers */\r
+  if (LL_USART_IsEnabled(USARTx) == 0U)\r
+  {\r
+    /*---------------------------- USART CR2 Configuration -----------------------*/\r
+    /* If Clock signal has to be output */\r
+    if (USART_ClockInitStruct->ClockOutput == LL_USART_CLOCK_DISABLE)\r
+    {\r
+      /* Deactivate Clock signal delivery :\r
+       * - Disable Clock Output:        USART_CR2_CLKEN cleared\r
+       */\r
+      LL_USART_DisableSCLKOutput(USARTx);\r
+    }\r
+    else\r
+    {\r
+      /* Ensure USART instance is USART capable */\r
+      assert_param(IS_USART_INSTANCE(USARTx));\r
+\r
+      /* Check clock related parameters */\r
+      assert_param(IS_LL_USART_CLOCKPOLARITY(USART_ClockInitStruct->ClockPolarity));\r
+      assert_param(IS_LL_USART_CLOCKPHASE(USART_ClockInitStruct->ClockPhase));\r
+      assert_param(IS_LL_USART_LASTBITCLKOUTPUT(USART_ClockInitStruct->LastBitClockPulse));\r
+\r
+      /*---------------------------- USART CR2 Configuration -----------------------\r
+       * Configure USARTx CR2 (Clock signal related bits) with parameters:\r
+       * - Enable Clock Output:         USART_CR2_CLKEN set\r
+       * - Clock Polarity:              USART_CR2_CPOL bit according to USART_ClockInitStruct->ClockPolarity value\r
+       * - Clock Phase:                 USART_CR2_CPHA bit according to USART_ClockInitStruct->ClockPhase value\r
+       * - Last Bit Clock Pulse Output: USART_CR2_LBCL bit according to USART_ClockInitStruct->LastBitClockPulse value.\r
+       */\r
+      MODIFY_REG(USARTx->CR2,\r
+                 USART_CR2_CLKEN | USART_CR2_CPHA | USART_CR2_CPOL | USART_CR2_LBCL,\r
+                 USART_CR2_CLKEN | USART_ClockInitStruct->ClockPolarity |\r
+                 USART_ClockInitStruct->ClockPhase | USART_ClockInitStruct->LastBitClockPulse);\r
+    }\r
+  }\r
+  /* Else (USART not in Disabled state => return ERROR */\r
+  else\r
+  {\r
+    status = ERROR;\r
+  }\r
+\r
+  return (status);\r
+}\r
+\r
+/**\r
+  * @brief Set each field of a @ref LL_USART_ClockInitTypeDef type structure to default value.\r
+  * @param USART_ClockInitStruct Pointer to a @ref LL_USART_ClockInitTypeDef structure\r
+  *                              whose fields will be set to default values.\r
+  * @retval None\r
+  */\r
+void LL_USART_ClockStructInit(LL_USART_ClockInitTypeDef *USART_ClockInitStruct)\r
+{\r
+  /* Set LL_USART_ClockInitStruct fields with default values */\r
+  USART_ClockInitStruct->ClockOutput       = LL_USART_CLOCK_DISABLE;\r
+  USART_ClockInitStruct->ClockPolarity     = LL_USART_POLARITY_LOW;            /* Not relevant when ClockOutput = LL_USART_CLOCK_DISABLE */\r
+  USART_ClockInitStruct->ClockPhase        = LL_USART_PHASE_1EDGE;             /* Not relevant when ClockOutput = LL_USART_CLOCK_DISABLE */\r
+  USART_ClockInitStruct->LastBitClockPulse = LL_USART_LASTCLKPULSE_NO_OUTPUT;  /* Not relevant when ClockOutput = LL_USART_CLOCK_DISABLE */\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* USART1 || USART2 || USART3 || UART4 || UART5 */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+#endif /* USE_FULL_LL_DRIVER */\r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
+\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.c b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.c
new file mode 100644 (file)
index 0000000..e1435b0
--- /dev/null
@@ -0,0 +1,624 @@
+/**\r
+  ******************************************************************************\r
+  * @file    stm32f1xx_ll_utils.c\r
+  * @author  MCD Application Team\r
+  * @brief   UTILS LL module driver.\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+\r
+/* Includes ------------------------------------------------------------------*/\r
+#include "stm32f1xx_ll_rcc.h"\r
+#include "stm32f1xx_ll_utils.h"\r
+#include "stm32f1xx_ll_system.h"\r
+#ifdef  USE_FULL_ASSERT\r
+#include "stm32_assert.h"\r
+#else\r
+#define assert_param(expr) ((void)0U)\r
+#endif\r
+\r
+/** @addtogroup STM32F1xx_LL_Driver\r
+  * @{\r
+  */\r
+\r
+/** @addtogroup UTILS_LL\r
+  * @{\r
+  */\r
+\r
+/* Private types -------------------------------------------------------------*/\r
+/* Private variables ---------------------------------------------------------*/\r
+/* Private constants ---------------------------------------------------------*/\r
+/** @addtogroup UTILS_LL_Private_Constants\r
+  * @{\r
+  */\r
+\r
+/* Defines used for PLL range */\r
+#define UTILS_PLL_OUTPUT_MAX        RCC_MAX_FREQUENCY    /*!< Frequency max for PLL output, in Hz  */\r
+\r
+/* Defines used for HSE range */\r
+#define UTILS_HSE_FREQUENCY_MIN     RCC_HSE_MIN       /*!< Frequency min for HSE frequency, in Hz   */\r
+#define UTILS_HSE_FREQUENCY_MAX     RCC_HSE_MAX       /*!< Frequency max for HSE frequency, in Hz   */\r
+\r
+/* Defines used for FLASH latency according to HCLK Frequency */\r
+#if defined(FLASH_ACR_LATENCY)\r
+#define UTILS_LATENCY1_FREQ         24000000U        /*!< SYSCLK frequency to set FLASH latency 1 */\r
+#define UTILS_LATENCY2_FREQ         48000000U        /*!< SYSCLK frequency to set FLASH latency 2 */\r
+#else\r
+/*!< No Latency Configuration in this device */\r
+#endif\r
+/**\r
+  * @}\r
+  */\r
+/* Private macros ------------------------------------------------------------*/\r
+/** @addtogroup UTILS_LL_Private_Macros\r
+  * @{\r
+  */\r
+#define IS_LL_UTILS_SYSCLK_DIV(__VALUE__) (((__VALUE__) == LL_RCC_SYSCLK_DIV_1)   \\r
+                                        || ((__VALUE__) == LL_RCC_SYSCLK_DIV_2)   \\r
+                                        || ((__VALUE__) == LL_RCC_SYSCLK_DIV_4)   \\r
+                                        || ((__VALUE__) == LL_RCC_SYSCLK_DIV_8)   \\r
+                                        || ((__VALUE__) == LL_RCC_SYSCLK_DIV_16)  \\r
+                                        || ((__VALUE__) == LL_RCC_SYSCLK_DIV_64)  \\r
+                                        || ((__VALUE__) == LL_RCC_SYSCLK_DIV_128) \\r
+                                        || ((__VALUE__) == LL_RCC_SYSCLK_DIV_256) \\r
+                                        || ((__VALUE__) == LL_RCC_SYSCLK_DIV_512))\r
+\r
+#define IS_LL_UTILS_APB1_DIV(__VALUE__) (((__VALUE__) == LL_RCC_APB1_DIV_1) \\r
+                                      || ((__VALUE__) == LL_RCC_APB1_DIV_2) \\r
+                                      || ((__VALUE__) == LL_RCC_APB1_DIV_4) \\r
+                                      || ((__VALUE__) == LL_RCC_APB1_DIV_8) \\r
+                                      || ((__VALUE__) == LL_RCC_APB1_DIV_16))\r
+\r
+#define IS_LL_UTILS_APB2_DIV(__VALUE__) (((__VALUE__) == LL_RCC_APB2_DIV_1) \\r
+                                      || ((__VALUE__) == LL_RCC_APB2_DIV_2) \\r
+                                      || ((__VALUE__) == LL_RCC_APB2_DIV_4) \\r
+                                      || ((__VALUE__) == LL_RCC_APB2_DIV_8) \\r
+                                      || ((__VALUE__) == LL_RCC_APB2_DIV_16))\r
+\r
+#if defined(RCC_CFGR_PLLMULL6_5)\r
+#define IS_LL_UTILS_PLLMUL_VALUE(__VALUE__) (((__VALUE__) == LL_RCC_PLL_MUL_4) \\r
+                                          || ((__VALUE__) == LL_RCC_PLL_MUL_5) \\r
+                                          || ((__VALUE__) == LL_RCC_PLL_MUL_6) \\r
+                                          || ((__VALUE__) == LL_RCC_PLL_MUL_7) \\r
+                                          || ((__VALUE__) == LL_RCC_PLL_MUL_8) \\r
+                                          || ((__VALUE__) == LL_RCC_PLL_MUL_9) \\r
+                                          || ((__VALUE__) == LL_RCC_PLL_MUL_6_5))\r
+#else\r
+#define IS_LL_UTILS_PLLMUL_VALUE(__VALUE__) (((__VALUE__) == LL_RCC_PLL_MUL_2) \\r
+                                          || ((__VALUE__) == LL_RCC_PLL_MUL_3) \\r
+                                          || ((__VALUE__) == LL_RCC_PLL_MUL_4) \\r
+                                          || ((__VALUE__) == LL_RCC_PLL_MUL_5) \\r
+                                          || ((__VALUE__) == LL_RCC_PLL_MUL_6) \\r
+                                          || ((__VALUE__) == LL_RCC_PLL_MUL_7) \\r
+                                          || ((__VALUE__) == LL_RCC_PLL_MUL_8) \\r
+                                          || ((__VALUE__) == LL_RCC_PLL_MUL_9) \\r
+                                          || ((__VALUE__) == LL_RCC_PLL_MUL_10) \\r
+                                          || ((__VALUE__) == LL_RCC_PLL_MUL_11) \\r
+                                          || ((__VALUE__) == LL_RCC_PLL_MUL_12) \\r
+                                          || ((__VALUE__) == LL_RCC_PLL_MUL_13) \\r
+                                          || ((__VALUE__) == LL_RCC_PLL_MUL_14) \\r
+                                          || ((__VALUE__) == LL_RCC_PLL_MUL_15) \\r
+                                          || ((__VALUE__) == LL_RCC_PLL_MUL_16))\r
+#endif /* RCC_CFGR_PLLMULL6_5 */\r
+\r
+#if defined(RCC_CFGR2_PREDIV1)\r
+#define IS_LL_UTILS_PREDIV_VALUE(__VALUE__) (((__VALUE__) == LL_RCC_PREDIV_DIV_1)  || ((__VALUE__) == LL_RCC_PREDIV_DIV_2)   || \\r
+                                             ((__VALUE__) == LL_RCC_PREDIV_DIV_3)  || ((__VALUE__) == LL_RCC_PREDIV_DIV_4)   || \\r
+                                             ((__VALUE__) == LL_RCC_PREDIV_DIV_5)  || ((__VALUE__) == LL_RCC_PREDIV_DIV_6)   || \\r
+                                             ((__VALUE__) == LL_RCC_PREDIV_DIV_7)  || ((__VALUE__) == LL_RCC_PREDIV_DIV_8)   || \\r
+                                             ((__VALUE__) == LL_RCC_PREDIV_DIV_9)  || ((__VALUE__) == LL_RCC_PREDIV_DIV_10)  || \\r
+                                             ((__VALUE__) == LL_RCC_PREDIV_DIV_11) || ((__VALUE__) == LL_RCC_PREDIV_DIV_12)  || \\r
+                                             ((__VALUE__) == LL_RCC_PREDIV_DIV_13) || ((__VALUE__) == LL_RCC_PREDIV_DIV_14)  || \\r
+                                             ((__VALUE__) == LL_RCC_PREDIV_DIV_15) || ((__VALUE__) == LL_RCC_PREDIV_DIV_16))\r
+#else\r
+#define IS_LL_UTILS_PREDIV_VALUE(__VALUE__) (((__VALUE__) == LL_RCC_PREDIV_DIV_1)  || ((__VALUE__) == LL_RCC_PREDIV_DIV_2))\r
+#endif /*RCC_PREDIV1_DIV_2_16_SUPPORT*/\r
+\r
+#define IS_LL_UTILS_PLL_FREQUENCY(__VALUE__) ((__VALUE__) <= UTILS_PLL_OUTPUT_MAX)\r
+\r
+\r
+#define IS_LL_UTILS_HSE_BYPASS(__STATE__) (((__STATE__) == LL_UTILS_HSEBYPASS_ON) \\r
+                                        || ((__STATE__) == LL_UTILS_HSEBYPASS_OFF))\r
+\r
+#define IS_LL_UTILS_HSE_FREQUENCY(__FREQUENCY__) (((__FREQUENCY__) >= UTILS_HSE_FREQUENCY_MIN) && ((__FREQUENCY__) <= UTILS_HSE_FREQUENCY_MAX))\r
+/**\r
+  * @}\r
+  */\r
+/* Private function prototypes -----------------------------------------------*/\r
+/** @defgroup UTILS_LL_Private_Functions UTILS Private functions\r
+  * @{\r
+  */\r
+static uint32_t    UTILS_GetPLLOutputFrequency(uint32_t PLL_InputFrequency,\r
+                                               LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct);\r
+static ErrorStatus UTILS_EnablePLLAndSwitchSystem(uint32_t SYSCLK_Frequency, LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct);\r
+static ErrorStatus UTILS_PLL_IsBusy(void);\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Exported functions --------------------------------------------------------*/\r
+/** @addtogroup UTILS_LL_Exported_Functions\r
+  * @{\r
+  */\r
+\r
+/** @addtogroup UTILS_LL_EF_DELAY\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  This function configures the Cortex-M SysTick source to have 1ms time base.\r
+  * @note   When a RTOS is used, it is recommended to avoid changing the Systick\r
+  *         configuration by calling this function, for a delay use rather osDelay RTOS service.\r
+  * @param  HCLKFrequency HCLK frequency in Hz\r
+  * @note   HCLK frequency can be calculated thanks to RCC helper macro or function @ref LL_RCC_GetSystemClocksFreq\r
+  * @retval None\r
+  */\r
+void LL_Init1msTick(uint32_t HCLKFrequency)\r
+{\r
+  /* Use frequency provided in argument */\r
+  LL_InitTick(HCLKFrequency, 1000U);\r
+}\r
+\r
+/**\r
+  * @brief  This function provides accurate delay (in milliseconds) based\r
+  *         on SysTick counter flag\r
+  * @note   When a RTOS is used, it is recommended to avoid using blocking delay\r
+  *         and use rather osDelay service.\r
+  * @note   To respect 1ms timebase, user should call @ref LL_Init1msTick function which\r
+  *         will configure Systick to 1ms\r
+  * @param  Delay specifies the delay time length, in milliseconds.\r
+  * @retval None\r
+  */\r
+void LL_mDelay(uint32_t Delay)\r
+{\r
+  __IO uint32_t  tmp = SysTick->CTRL;  /* Clear the COUNTFLAG first */\r
+  /* Add this code to indicate that local variable is not used */\r
+  ((void)tmp);\r
+\r
+  /* Add a period to guaranty minimum wait */\r
+  if (Delay < LL_MAX_DELAY)\r
+  {\r
+    Delay++;\r
+  }\r
+\r
+  while (Delay)\r
+  {\r
+    if ((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) != 0U)\r
+    {\r
+      Delay--;\r
+    }\r
+  }\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @addtogroup UTILS_EF_SYSTEM\r
+  *  @brief    System Configuration functions\r
+  *\r
+  @verbatim\r
+ ===============================================================================\r
+           ##### System Configuration functions #####\r
+ ===============================================================================\r
+    [..]\r
+         System, AHB and APB buses clocks configuration\r
+\r
+         (+) The maximum frequency of the SYSCLK, HCLK, PCLK1 and PCLK2 is RCC_MAX_FREQUENCY Hz.\r
+  @endverbatim\r
+  @internal\r
+             Depending on the SYSCLK frequency, the flash latency should be adapted accordingly:\r
+             (++) +-----------------------------------------------+\r
+             (++) | Latency       | SYSCLK clock frequency (MHz)  |\r
+             (++) |---------------|-------------------------------|\r
+             (++) |0WS(1CPU cycle)|       0 < SYSCLK <= 24        |\r
+             (++) |---------------|-------------------------------|\r
+             (++) |1WS(2CPU cycle)|      24 < SYSCLK <= 48        |\r
+             (++) |---------------|-------------------------------|\r
+             (++) |2WS(3CPU cycle)|      48 < SYSCLK <= 72        |\r
+             (++) +-----------------------------------------------+\r
+  @endinternal\r
+  * @{\r
+  */\r
+\r
+/**\r
+  * @brief  This function sets directly SystemCoreClock CMSIS variable.\r
+  * @note   Variable can be calculated also through SystemCoreClockUpdate function.\r
+  * @param  HCLKFrequency HCLK frequency in Hz (can be calculated thanks to RCC helper macro)\r
+  * @retval None\r
+  */\r
+void LL_SetSystemCoreClock(uint32_t HCLKFrequency)\r
+{\r
+  /* HCLK clock frequency */\r
+  SystemCoreClock = HCLKFrequency;\r
+}\r
+\r
+/**\r
+  * @brief  Update number of Flash wait states in line with new frequency and current\r
+            voltage range.\r
+  * @param  Frequency  SYSCLK frequency\r
+  * @retval An ErrorStatus enumeration value:\r
+  *          - SUCCESS: Latency has been modified\r
+  *          - ERROR: Latency cannot be modified\r
+  */\r
+#if defined(FLASH_ACR_LATENCY)\r
+ErrorStatus LL_SetFlashLatency(uint32_t Frequency)\r
+{\r
+  uint32_t timeout;\r
+  uint32_t getlatency;\r
+  uint32_t latency = LL_FLASH_LATENCY_0; /* default value 0WS */\r
+  ErrorStatus status = SUCCESS;\r
+\r
+  /* Frequency cannot be equal to 0 */\r
+  if (Frequency == 0U)\r
+  {\r
+    status = ERROR;\r
+  }\r
+  else\r
+  {\r
+    if (Frequency > UTILS_LATENCY2_FREQ)\r
+    {\r
+      /* 48 < SYSCLK <= 72 => 2WS (3 CPU cycles) */\r
+      latency = LL_FLASH_LATENCY_2;\r
+    }\r
+    else\r
+    {\r
+      if (Frequency > UTILS_LATENCY1_FREQ)\r
+      {\r
+        /* 24 < SYSCLK <= 48 => 1WS (2 CPU cycles) */\r
+        latency = LL_FLASH_LATENCY_1;\r
+      }\r
+      else\r
+      {\r
+        /* else SYSCLK < 24MHz default LL_FLASH_LATENCY_0 0WS */\r
+        latency = LL_FLASH_LATENCY_0;\r
+      }\r
+    }\r
+\r
+    if (status != ERROR)\r
+    {\r
+      LL_FLASH_SetLatency(latency);\r
+\r
+      /* Check that the new number of wait states is taken into account to access the Flash\r
+         memory by reading the FLASH_ACR register */\r
+      timeout = 2;\r
+      do\r
+      {\r
+      /* Wait for Flash latency to be updated */\r
+      getlatency = LL_FLASH_GetLatency();\r
+      timeout--;\r
+      } while ((getlatency != latency) && (timeout > 0));\r
+\r
+      if(getlatency != latency)\r
+      {\r
+        status = ERROR;\r
+      }\r
+      else\r
+      {\r
+        status = SUCCESS;\r
+      }\r
+    }\r
+  }\r
+\r
+  return status;\r
+}\r
+#endif /* FLASH_ACR_LATENCY */\r
+\r
+/**\r
+  * @brief  This function configures system clock with HSI as clock source of the PLL\r
+  * @note   The application need to ensure that PLL is disabled.\r
+  * @note   Function is based on the following formula:\r
+  *         - PLL output frequency = ((HSI frequency / PREDIV) * PLLMUL)\r
+  *         - PREDIV: Set to 2 for few devices\r
+  *         - PLLMUL: The application software must set correctly the PLL multiplication factor to\r
+  *                   not exceed 72MHz\r
+  * @note   FLASH latency can be modified through this function.\r
+  * @param  UTILS_PLLInitStruct pointer to a @ref LL_UTILS_PLLInitTypeDef structure that contains\r
+  *                             the configuration information for the PLL.\r
+  * @param  UTILS_ClkInitStruct pointer to a @ref LL_UTILS_ClkInitTypeDef structure that contains\r
+  *                             the configuration information for the BUS prescalers.\r
+  * @retval An ErrorStatus enumeration value:\r
+  *          - SUCCESS: Max frequency configuration done\r
+  *          - ERROR: Max frequency configuration not done\r
+  */\r
+ErrorStatus LL_PLL_ConfigSystemClock_HSI(LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct,\r
+                                         LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct)\r
+{\r
+  ErrorStatus status = SUCCESS;\r
+  uint32_t pllfreq = 0U;\r
+\r
+  /* Check if one of the PLL is enabled */\r
+  if (UTILS_PLL_IsBusy() == SUCCESS)\r
+  {\r
+#if defined(RCC_PLLSRC_PREDIV1_SUPPORT)\r
+    /* Check PREDIV value */\r
+    assert_param(IS_LL_UTILS_PREDIV_VALUE(UTILS_PLLInitStruct->PLLDiv));\r
+#else\r
+    /* Force PREDIV value to 2 */\r
+    UTILS_PLLInitStruct->Prediv = LL_RCC_PREDIV_DIV_2;\r
+#endif /*RCC_PLLSRC_PREDIV1_SUPPORT*/\r
+    /* Calculate the new PLL output frequency */\r
+    pllfreq = UTILS_GetPLLOutputFrequency(HSI_VALUE, UTILS_PLLInitStruct);\r
+\r
+    /* Enable HSI if not enabled */\r
+    if (LL_RCC_HSI_IsReady() != 1U)\r
+    {\r
+      LL_RCC_HSI_Enable();\r
+      while (LL_RCC_HSI_IsReady() != 1U)\r
+      {\r
+        /* Wait for HSI ready */\r
+      }\r
+    }\r
+\r
+    /* Configure PLL */\r
+    LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_HSI_DIV_2, UTILS_PLLInitStruct->PLLMul);\r
+\r
+    /* Enable PLL and switch system clock to PLL */\r
+    status = UTILS_EnablePLLAndSwitchSystem(pllfreq, UTILS_ClkInitStruct);\r
+  }\r
+  else\r
+  {\r
+    /* Current PLL configuration cannot be modified */\r
+    status = ERROR;\r
+  }\r
+\r
+  return status;\r
+}\r
+\r
+/**\r
+  * @brief  This function configures system clock with HSE as clock source of the PLL\r
+  * @note   The application need to ensure that PLL is disabled.\r
+  * @note   Function is based on the following formula:\r
+  *         - PLL output frequency = ((HSI frequency / PREDIV) * PLLMUL)\r
+  *         - PREDIV: Set to 2 for few devices\r
+  *         - PLLMUL: The application software must set correctly the PLL multiplication factor to\r
+  *                   not exceed @ref UTILS_PLL_OUTPUT_MAX\r
+  * @note   FLASH latency can be modified through this function.\r
+  * @param  HSEFrequency Value between Min_Data = RCC_HSE_MIN and Max_Data = RCC_HSE_MAX\r
+  * @param  HSEBypass This parameter can be one of the following values:\r
+  *         @arg @ref LL_UTILS_HSEBYPASS_ON\r
+  *         @arg @ref LL_UTILS_HSEBYPASS_OFF\r
+  * @param  UTILS_PLLInitStruct pointer to a @ref LL_UTILS_PLLInitTypeDef structure that contains\r
+  *                             the configuration information for the PLL.\r
+  * @param  UTILS_ClkInitStruct pointer to a @ref LL_UTILS_ClkInitTypeDef structure that contains\r
+  *                             the configuration information for the BUS prescalers.\r
+  * @retval An ErrorStatus enumeration value:\r
+  *          - SUCCESS: Max frequency configuration done\r
+  *          - ERROR: Max frequency configuration not done\r
+  */\r
+ErrorStatus LL_PLL_ConfigSystemClock_HSE(uint32_t HSEFrequency, uint32_t HSEBypass,\r
+                                         LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct, LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct)\r
+{\r
+  ErrorStatus status = SUCCESS;\r
+  uint32_t pllfreq = 0U;\r
+\r
+  /* Check the parameters */\r
+  assert_param(IS_LL_UTILS_HSE_FREQUENCY(HSEFrequency));\r
+  assert_param(IS_LL_UTILS_HSE_BYPASS(HSEBypass));\r
+\r
+  /* Check if one of the PLL is enabled */\r
+  if (UTILS_PLL_IsBusy() == SUCCESS)\r
+  {\r
+    assert_param(IS_LL_UTILS_PREDIV_VALUE(UTILS_PLLInitStruct->Prediv));\r
+\r
+    /* Calculate the new PLL output frequency */\r
+    pllfreq = UTILS_GetPLLOutputFrequency(HSEFrequency, UTILS_PLLInitStruct);\r
+\r
+    /* Enable HSE if not enabled */\r
+    if (LL_RCC_HSE_IsReady() != 1U)\r
+    {\r
+      /* Check if need to enable HSE bypass feature or not */\r
+      if (HSEBypass == LL_UTILS_HSEBYPASS_ON)\r
+      {\r
+        LL_RCC_HSE_EnableBypass();\r
+      }\r
+      else\r
+      {\r
+        LL_RCC_HSE_DisableBypass();\r
+      }\r
+\r
+      /* Enable HSE */\r
+      LL_RCC_HSE_Enable();\r
+      while (LL_RCC_HSE_IsReady() != 1U)\r
+      {\r
+        /* Wait for HSE ready */\r
+      }\r
+    }\r
+\r
+    /* Configure PLL */\r
+    LL_RCC_PLL_ConfigDomain_SYS((RCC_CFGR_PLLSRC | UTILS_PLLInitStruct->Prediv), UTILS_PLLInitStruct->PLLMul);\r
+\r
+    /* Enable PLL and switch system clock to PLL */\r
+    status = UTILS_EnablePLLAndSwitchSystem(pllfreq, UTILS_ClkInitStruct);\r
+  }\r
+  else\r
+  {\r
+    /* Current PLL configuration cannot be modified */\r
+    status = ERROR;\r
+  }\r
+\r
+  return status;\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @addtogroup UTILS_LL_Private_Functions\r
+  * @{\r
+  */\r
+/**\r
+  * @brief  Function to check that PLL can be modified\r
+  * @param  PLL_InputFrequency  PLL input frequency (in Hz)\r
+  * @param  UTILS_PLLInitStruct pointer to a @ref LL_UTILS_PLLInitTypeDef structure that contains\r
+  *                             the configuration information for the PLL.\r
+  * @retval PLL output frequency (in Hz)\r
+  */\r
+static uint32_t UTILS_GetPLLOutputFrequency(uint32_t PLL_InputFrequency, LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct)\r
+{\r
+  uint32_t pllfreq = 0U;\r
+\r
+  /* Check the parameters */\r
+  assert_param(IS_LL_UTILS_PLLMUL_VALUE(UTILS_PLLInitStruct->PLLMul));\r
+\r
+  /* Check different PLL parameters according to RM                          */\r
+#if defined (RCC_CFGR2_PREDIV1)\r
+  pllfreq = __LL_RCC_CALC_PLLCLK_FREQ(PLL_InputFrequency / (UTILS_PLLInitStruct->Prediv + 1U), UTILS_PLLInitStruct->PLLMul);\r
+#else\r
+  pllfreq = __LL_RCC_CALC_PLLCLK_FREQ(PLL_InputFrequency / ((UTILS_PLLInitStruct->Prediv >> RCC_CFGR_PLLXTPRE_Pos) + 1U), UTILS_PLLInitStruct->PLLMul);\r
+#endif /*RCC_CFGR2_PREDIV1SRC*/\r
+  assert_param(IS_LL_UTILS_PLL_FREQUENCY(pllfreq));\r
+\r
+  return pllfreq;\r
+}\r
+\r
+/**\r
+  * @brief  Function to check that PLL can be modified\r
+  * @retval An ErrorStatus enumeration value:\r
+  *          - SUCCESS: PLL modification can be done\r
+  *          - ERROR: PLL is busy\r
+  */\r
+static ErrorStatus UTILS_PLL_IsBusy(void)\r
+{\r
+  ErrorStatus status = SUCCESS;\r
+\r
+  /* Check if PLL is busy*/\r
+  if (LL_RCC_PLL_IsReady() != 0U)\r
+  {\r
+    /* PLL configuration cannot be modified */\r
+    status = ERROR;\r
+  }\r
+#if defined(RCC_PLL2_SUPPORT)\r
+  /* Check if PLL2 is busy*/\r
+  if (LL_RCC_PLL2_IsReady() != 0U)\r
+  {\r
+    /* PLL2 configuration cannot be modified */\r
+    status = ERROR;\r
+  }\r
+#endif /* RCC_PLL2_SUPPORT */\r
+\r
+#if defined(RCC_PLLI2S_SUPPORT)\r
+  /* Check if PLLI2S  is busy*/\r
+  if (LL_RCC_PLLI2S_IsReady() != 0U)\r
+  {\r
+    /* PLLI2S configuration cannot be modified */\r
+    status = ERROR;\r
+  }\r
+#endif /* RCC_PLLI2S_SUPPORT */\r
+\r
+  return status;\r
+}\r
+\r
+/**\r
+  * @brief  Function to enable PLL and switch system clock to PLL\r
+  * @param  SYSCLK_Frequency SYSCLK frequency\r
+  * @param  UTILS_ClkInitStruct pointer to a @ref LL_UTILS_ClkInitTypeDef structure that contains\r
+  *                             the configuration information for the BUS prescalers.\r
+  * @retval An ErrorStatus enumeration value:\r
+  *          - SUCCESS: No problem to switch system to PLL\r
+  *          - ERROR: Problem to switch system to PLL\r
+  */\r
+static ErrorStatus UTILS_EnablePLLAndSwitchSystem(uint32_t SYSCLK_Frequency, LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct)\r
+{\r
+  ErrorStatus status = SUCCESS;\r
+#if defined(FLASH_ACR_LATENCY)\r
+  uint32_t sysclk_frequency_current = 0U;\r
+#endif /* FLASH_ACR_LATENCY */\r
+\r
+  assert_param(IS_LL_UTILS_SYSCLK_DIV(UTILS_ClkInitStruct->AHBCLKDivider));\r
+  assert_param(IS_LL_UTILS_APB1_DIV(UTILS_ClkInitStruct->APB1CLKDivider));\r
+  assert_param(IS_LL_UTILS_APB2_DIV(UTILS_ClkInitStruct->APB2CLKDivider));\r
+\r
+#if defined(FLASH_ACR_LATENCY)\r
+  /* Calculate current SYSCLK frequency */\r
+  sysclk_frequency_current = (SystemCoreClock << AHBPrescTable[LL_RCC_GetAHBPrescaler() >> RCC_CFGR_HPRE_Pos]);\r
+#endif /* FLASH_ACR_LATENCY */\r
+\r
+  /* Increasing the number of wait states because of higher CPU frequency */\r
+#if defined (FLASH_ACR_LATENCY)\r
+  if (sysclk_frequency_current < SYSCLK_Frequency)\r
+  {\r
+    /* Set FLASH latency to highest latency */\r
+    status = LL_SetFlashLatency(SYSCLK_Frequency);\r
+  }\r
+#endif /* FLASH_ACR_LATENCY */\r
+\r
+  /* Update system clock configuration */\r
+  if (status == SUCCESS)\r
+  {\r
+#if defined(RCC_PLL2_SUPPORT)\r
+    if (LL_RCC_PLL_GetMainSource() != LL_RCC_PLLSOURCE_HSI_DIV_2)\r
+    {\r
+      /* Enable PLL2 */\r
+      LL_RCC_PLL2_Enable();\r
+      while (LL_RCC_PLL2_IsReady() != 1U)\r
+      {\r
+        /* Wait for PLL2 ready */\r
+      }\r
+    }\r
+#endif /* RCC_PLL2_SUPPORT */\r
+    /* Enable PLL */\r
+    LL_RCC_PLL_Enable();\r
+    while (LL_RCC_PLL_IsReady() != 1U)\r
+    {\r
+      /* Wait for PLL ready */\r
+    }\r
+\r
+    /* Sysclk activation on the main PLL */\r
+    LL_RCC_SetAHBPrescaler(UTILS_ClkInitStruct->AHBCLKDivider);\r
+    LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);\r
+    while (LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)\r
+    {\r
+      /* Wait for system clock switch to PLL */\r
+    }\r
+\r
+    /* Set APB1 & APB2 prescaler*/\r
+    LL_RCC_SetAPB1Prescaler(UTILS_ClkInitStruct->APB1CLKDivider);\r
+    LL_RCC_SetAPB2Prescaler(UTILS_ClkInitStruct->APB2CLKDivider);\r
+  }\r
+\r
+  /* Decreasing the number of wait states because of lower CPU frequency */\r
+#if defined (FLASH_ACR_LATENCY)\r
+  if (sysclk_frequency_current > SYSCLK_Frequency)\r
+  {\r
+    /* Set FLASH latency to lowest latency */\r
+    status = LL_SetFlashLatency(SYSCLK_Frequency);\r
+  }\r
+#endif /* FLASH_ACR_LATENCY */\r
+\r
+  /* Update SystemCoreClock variable */\r
+  if (status == SUCCESS)\r
+  {\r
+    LL_SetSystemCoreClock(__LL_RCC_CALC_HCLK_FREQ(SYSCLK_Frequency, UTILS_ClkInitStruct->AHBCLKDivider));\r
+  }\r
+\r
+  return status;\r
+}\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/STM32F103C8Tx_FLASH.ld b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/STM32F103C8Tx_FLASH.ld
new file mode 100644 (file)
index 0000000..89c27c0
--- /dev/null
@@ -0,0 +1,189 @@
+/*\r
+******************************************************************************\r
+**\r
+\r
+**  File        : LinkerScript.ld\r
+**\r
+**  Author             : Auto-generated by System Workbench for STM32\r
+**\r
+**  Abstract    : Linker script for STM32F103C8Tx series\r
+**                64Kbytes FLASH and 20Kbytes RAM\r
+**\r
+**                Set heap size, stack size and stack location according\r
+**                to application requirements.\r
+**\r
+**                Set memory bank area and size if external memory is used.\r
+**\r
+**  Target      : STMicroelectronics STM32\r
+**\r
+**  Distribution: The file is distributed “as is,” without any warranty\r
+**                of any kind.\r
+**\r
+*****************************************************************************\r
+** @attention\r
+**\r
+** <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>\r
+**\r
+** Redistribution and use in source and binary forms, with or without modification,\r
+** are permitted provided that the following conditions are met:\r
+**   1. Redistributions of source code must retain the above copyright notice,\r
+**      this list of conditions and the following disclaimer.\r
+**   2. Redistributions in binary form must reproduce the above copyright notice,\r
+**      this list of conditions and the following disclaimer in the documentation\r
+**      and/or other materials provided with the distribution.\r
+**   3. Neither the name of STMicroelectronics nor the names of its contributors\r
+**      may be used to endorse or promote products derived from this software\r
+**      without specific prior written permission.\r
+**\r
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
+** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r
+** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\r
+** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
+** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\r
+** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\r
+** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\r
+** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+**\r
+*****************************************************************************\r
+*/\r
+\r
+/* Entry Point */\r
+ENTRY(Reset_Handler)\r
+\r
+/* Highest address of the user mode stack */\r
+_estack = 0x20005000;    /* end of RAM */\r
+/* Generate a link error if heap and stack don't fit into RAM */\r
+_Min_Heap_Size = 0x200;      /* required amount of heap  */\r
+_Min_Stack_Size = 0x400; /* required amount of stack */\r
+\r
+/* Specify the memory areas */\r
+MEMORY\r
+{\r
+RAM (xrw)      : ORIGIN = 0x20000000, LENGTH = 20K\r
+FLASH (rx)      : ORIGIN = 0x8000000, LENGTH = 64K\r
+}\r
+\r
+/* Define output sections */\r
+SECTIONS\r
+{\r
+  /* The startup code goes first into FLASH */\r
+  .isr_vector :\r
+  {\r
+    . = ALIGN(4);\r
+    KEEP(*(.isr_vector)) /* Startup code */\r
+    . = ALIGN(4);\r
+  } >FLASH\r
+\r
+  /* The program code and other data goes into FLASH */\r
+  .text :\r
+  {\r
+    . = ALIGN(4);\r
+    *(.text)           /* .text sections (code) */\r
+    *(.text*)          /* .text* sections (code) */\r
+    *(.glue_7)         /* glue arm to thumb code */\r
+    *(.glue_7t)        /* glue thumb to arm code */\r
+    *(.eh_frame)\r
+\r
+    KEEP (*(.init))\r
+    KEEP (*(.fini))\r
+\r
+    . = ALIGN(4);\r
+    _etext = .;        /* define a global symbols at end of code */\r
+  } >FLASH\r
+\r
+  /* Constant data goes into FLASH */\r
+  .rodata :\r
+  {\r
+    . = ALIGN(4);\r
+    *(.rodata)         /* .rodata sections (constants, strings, etc.) */\r
+    *(.rodata*)        /* .rodata* sections (constants, strings, etc.) */\r
+    . = ALIGN(4);\r
+  } >FLASH\r
+\r
+  .ARM.extab   : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH\r
+  .ARM : {\r
+    __exidx_start = .;\r
+    *(.ARM.exidx*)\r
+    __exidx_end = .;\r
+  } >FLASH\r
+\r
+  .preinit_array     :\r
+  {\r
+    PROVIDE_HIDDEN (__preinit_array_start = .);\r
+    KEEP (*(.preinit_array*))\r
+    PROVIDE_HIDDEN (__preinit_array_end = .);\r
+  } >FLASH\r
+  .init_array :\r
+  {\r
+    PROVIDE_HIDDEN (__init_array_start = .);\r
+    KEEP (*(SORT(.init_array.*)))\r
+    KEEP (*(.init_array*))\r
+    PROVIDE_HIDDEN (__init_array_end = .);\r
+  } >FLASH\r
+  .fini_array :\r
+  {\r
+    PROVIDE_HIDDEN (__fini_array_start = .);\r
+    KEEP (*(SORT(.fini_array.*)))\r
+    KEEP (*(.fini_array*))\r
+    PROVIDE_HIDDEN (__fini_array_end = .);\r
+  } >FLASH\r
+\r
+  /* used by the startup to initialize data */\r
+  _sidata = LOADADDR(.data);\r
+\r
+  /* Initialized data sections goes into RAM, load LMA copy after code */\r
+  .data : \r
+  {\r
+    . = ALIGN(4);\r
+    _sdata = .;        /* create a global symbol at data start */\r
+    *(.data)           /* .data sections */\r
+    *(.data*)          /* .data* sections */\r
+\r
+    . = ALIGN(4);\r
+    _edata = .;        /* define a global symbol at data end */\r
+  } >RAM AT> FLASH\r
+\r
+  \r
+  /* Uninitialized data section */\r
+  . = ALIGN(4);\r
+  .bss :\r
+  {\r
+    /* This is used by the startup in order to initialize the .bss secion */\r
+    _sbss = .;         /* define a global symbol at bss start */\r
+    __bss_start__ = _sbss;\r
+    *(.bss)\r
+    *(.bss*)\r
+    *(COMMON)\r
+\r
+    . = ALIGN(4);\r
+    _ebss = .;         /* define a global symbol at bss end */\r
+    __bss_end__ = _ebss;\r
+  } >RAM\r
+\r
+  /* User_heap_stack section, used to check that there is enough RAM left */\r
+  ._user_heap_stack :\r
+  {\r
+    . = ALIGN(8);\r
+    PROVIDE ( end = . );\r
+    PROVIDE ( _end = . );\r
+    . = . + _Min_Heap_Size;\r
+    . = . + _Min_Stack_Size;\r
+    . = ALIGN(8);\r
+  } >RAM\r
+\r
+  \r
+\r
+  /* Remove information from the standard libraries */\r
+  /DISCARD/ :\r
+  {\r
+    libc.a ( * )\r
+    libm.a ( * )\r
+    libgcc.a ( * )\r
+  }\r
+\r
+  .ARM.attributes 0 : { *(.ARM.attributes) }\r
+}\r
+\r
+\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/ghidra_demo Run.cfg b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/ghidra_demo Run.cfg
new file mode 100644 (file)
index 0000000..13d5490
--- /dev/null
@@ -0,0 +1,35 @@
+# This is an ghidra_demo board with a single STM32F103C8Tx chip\r
+#\r
+# Generated by System Workbench for STM32\r
+# Take care that such file, as generated, may be overridden without any early notice. Please have a look to debug launch configuration setup(s)\r
+\r
+source [find interface/stlink.cfg]\r
+\r
+set WORKAREASIZE 0x5000\r
+\r
+transport select "hla_swd"\r
+\r
+set CHIPNAME STM32F103C8Tx\r
+set BOARDNAME ghidra_demo\r
+\r
+# CHIPNAMES state\r
+set CHIPNAME_CPU0_ACTIVATED 1\r
+\r
+# Enable debug when in low power modes\r
+set ENABLE_LOW_POWER 1\r
+\r
+# Stop Watchdog counters when halt\r
+set STOP_WATCHDOG 1\r
+\r
+# STlink Debug clock frequency\r
+set CLOCK_FREQ 8000\r
+\r
+# use software system reset\r
+reset_config none\r
+set CONNECT_UNDER_RESET 0\r
+\r
+# BCTM CPU variables\r
+\r
+\r
+\r
+source [find target/stm32f1x.cfg]\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/ghidra_demo.ioc b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/ghidra_demo.ioc
new file mode 100644 (file)
index 0000000..5c580ea
--- /dev/null
@@ -0,0 +1,113 @@
+#MicroXplorer Configuration settings - do not modify
+File.Version=6
+GPIO.groupedBy=
+KeepUserPlacement=false
+Mcu.Family=STM32F1
+Mcu.IP0=NVIC
+Mcu.IP1=RCC
+Mcu.IP2=SYS
+Mcu.IP3=USART1
+Mcu.IPNb=4
+Mcu.Name=STM32F103C(8-B)Tx
+Mcu.Package=LQFP48
+Mcu.Pin0=PC13-TAMPER-RTC
+Mcu.Pin1=PB2
+Mcu.Pin2=PA9
+Mcu.Pin3=PA10
+Mcu.Pin4=PA13
+Mcu.Pin5=PA14
+Mcu.Pin6=VP_SYS_VS_Systick
+Mcu.PinsNb=7
+Mcu.ThirdPartyNb=0
+Mcu.UserConstants=
+Mcu.UserName=STM32F103C8Tx
+MxCube.Version=6.2.0
+MxDb.Version=DB.6.0.20
+NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
+NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false
+NVIC.EXTI2_IRQn=true\:1\:0\:true\:false\:true\:true\:true
+NVIC.ForceEnableDMAVector=true
+NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
+NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false
+NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false
+NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false
+NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4
+NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false
+NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:false\:true
+NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
+PA10.Mode=Asynchronous
+PA10.Signal=USART1_RX
+PA13.Mode=Serial_Wire
+PA13.Signal=SYS_JTMS-SWDIO
+PA14.Mode=Serial_Wire
+PA14.Signal=SYS_JTCK-SWCLK
+PA9.Mode=Asynchronous
+PA9.Signal=USART1_TX
+PB2.GPIOParameters=GPIO_Label
+PB2.GPIO_Label=BUT
+PB2.Locked=true
+PB2.Signal=GPXTI2
+PC13-TAMPER-RTC.GPIOParameters=GPIO_Speed,GPIO_Label
+PC13-TAMPER-RTC.GPIO_Label=LED
+PC13-TAMPER-RTC.GPIO_Speed=GPIO_SPEED_FREQ_MEDIUM
+PC13-TAMPER-RTC.Locked=true
+PC13-TAMPER-RTC.Signal=GPIO_Output
+PinOutPanel.RotationAngle=0
+ProjectManager.AskForMigrate=true
+ProjectManager.BackupPrevious=false
+ProjectManager.CompilerOptimize=6
+ProjectManager.ComputerToolchain=false
+ProjectManager.CoupleFile=false
+ProjectManager.CustomerFirmwarePackage=
+ProjectManager.DefaultFWLocation=true
+ProjectManager.DeletePrevious=true
+ProjectManager.DeviceId=STM32F103C8Tx
+ProjectManager.FirmwarePackage=STM32Cube FW_F1 V1.8.3
+ProjectManager.FreePins=false
+ProjectManager.HalAssertFull=false
+ProjectManager.HeapSize=0x200
+ProjectManager.KeepUserCode=true
+ProjectManager.LastFirmware=true
+ProjectManager.LibraryCopy=1
+ProjectManager.MainLocation=Core/Src
+ProjectManager.NoMain=false
+ProjectManager.PreviousToolchain=SW4STM32
+ProjectManager.ProjectBuild=false
+ProjectManager.ProjectFileName=ghidra_demo.ioc
+ProjectManager.ProjectName=ghidra_demo
+ProjectManager.RegisterCallBack=
+ProjectManager.StackSize=0x400
+ProjectManager.TargetToolchain=SW4STM32
+ProjectManager.ToolChainLocation=
+ProjectManager.UnderRoot=true
+ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-LL-true,2-SystemClock_Config-RCC-false-LL-false,3-MX_USART1_UART_Init-USART1-false-LL-true
+RCC.ADCFreqValue=32000000
+RCC.AHBFreq_Value=64000000
+RCC.APB1CLKDivider=RCC_HCLK_DIV2
+RCC.APB1Freq_Value=32000000
+RCC.APB1TimFreq_Value=64000000
+RCC.APB2Freq_Value=64000000
+RCC.APB2TimFreq_Value=64000000
+RCC.FCLKCortexFreq_Value=64000000
+RCC.FamilyName=M
+RCC.HCLKFreq_Value=64000000
+RCC.IPParameters=ADCFreqValue,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,MCOFreq_Value,PLLCLKFreq_Value,PLLMCOFreq_Value,PLLMUL,SYSCLKFreq_VALUE,SYSCLKSource,TimSysFreq_Value,USBFreq_Value
+RCC.MCOFreq_Value=64000000
+RCC.PLLCLKFreq_Value=64000000
+RCC.PLLMCOFreq_Value=32000000
+RCC.PLLMUL=RCC_PLL_MUL16
+RCC.SYSCLKFreq_VALUE=64000000
+RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
+RCC.TimSysFreq_Value=64000000
+RCC.USBFreq_Value=64000000
+SH.GPXTI2.0=GPIO_EXTI2
+SH.GPXTI2.ConfNb=1
+USART1.BaudRate=2400
+USART1.IPParameters=VirtualMode,BaudRate,WordLength,Parity,Mode
+USART1.Mode=MODE_TX
+USART1.Parity=PARITY_EVEN
+USART1.VirtualMode=VM_ASYNC
+USART1.WordLength=WORDLENGTH_9B
+VP_SYS_VS_Systick.Mode=SysTick
+VP_SYS_VS_Systick.Signal=SYS_VS_Systick
+board=custom
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/ghidra_demo.xml b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/ghidra_demo.xml
new file mode 100644 (file)
index 0000000..759d3e4
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE targetDefinitions [\r
+<!ELEMENT targetDefinitions (board)>
+<!ELEMENT board (name,dbgIF+,dbgDEV,mcuId)>
+<!ELEMENT name (#PCDATA)>
+<!ELEMENT dbgIF (#PCDATA)>
+<!ELEMENT dbgDEV (#PCDATA)>
+<!ELEMENT mcuId (#PCDATA)>
+<!ATTLIST board id CDATA #REQUIRED>
+]>\r
+<targetDefinitions>\r
+  <board id="ghidra_demo">\r
+    <name>ghidra_demo</name>\r
+    <dbgIF>SWD</dbgIF>\r
+    <dbgDEV>ST-Link</dbgDEV>\r
+    <mcuId>stm32f103c8tx</mcuId>\r
+  </board>\r
+</targetDefinitions>\r
diff --git a/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/startup/startup_stm32f103xb.s b/Workshops/ghidra_demo_stm32f103/stm32f103_firmware/startup/startup_stm32f103xb.s
new file mode 100644 (file)
index 0000000..48cf447
--- /dev/null
@@ -0,0 +1,362 @@
+/**\r
+  *************** (C) COPYRIGHT 2017 STMicroelectronics ************************\r
+  * @file      startup_stm32f103xb.s\r
+  * @author    MCD Application Team\r
+  * @brief     STM32F103xB Devices vector table for Atollic toolchain.\r
+  *            This module performs:\r
+  *                - Set the initial SP\r
+  *                - Set the initial PC == Reset_Handler,\r
+  *                - Set the vector table entries with the exceptions ISR address\r
+  *                - Configure the clock system   \r
+  *                - Branches to main in the C library (which eventually\r
+  *                  calls main()).\r
+  *            After Reset the Cortex-M3 processor is in Thread mode,\r
+  *            priority is Privileged, and the Stack is set to Main.\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.\r
+  * All rights reserved.</center></h2>\r
+  *\r
+  * This software component is licensed by ST under BSD 3-Clause license,\r
+  * the "License"; You may not use this file except in compliance with the\r
+  * License. You may obtain a copy of the License at:\r
+  *                        opensource.org/licenses/BSD-3-Clause\r
+  *\r
+  ******************************************************************************\r
+  */\r
+\r
+  .syntax unified\r
+  .cpu cortex-m3\r
+  .fpu softvfp\r
+  .thumb\r
+\r
+.global g_pfnVectors\r
+.global Default_Handler\r
+\r
+/* start address for the initialization values of the .data section.\r
+defined in linker script */\r
+.word _sidata\r
+/* start address for the .data section. defined in linker script */\r
+.word _sdata\r
+/* end address for the .data section. defined in linker script */\r
+.word _edata\r
+/* start address for the .bss section. defined in linker script */\r
+.word _sbss\r
+/* end address for the .bss section. defined in linker script */\r
+.word _ebss\r
+\r
+.equ  BootRAM, 0xF108F85F\r
+/**\r
+ * @brief  This is the code that gets called when the processor first\r
+ *          starts execution following a reset event. Only the absolutely\r
+ *          necessary set is performed, after which the application\r
+ *          supplied main() routine is called.\r
+ * @param  None\r
+ * @retval : None\r
+*/\r
+\r
+  .section .text.Reset_Handler\r
+  .weak Reset_Handler\r
+  .type Reset_Handler, %function\r
+Reset_Handler:\r
+\r
+/* Copy the data segment initializers from flash to SRAM */\r
+  movs r1, #0\r
+  b LoopCopyDataInit\r
+\r
+CopyDataInit:\r
+  ldr r3, =_sidata\r
+  ldr r3, [r3, r1]\r
+  str r3, [r0, r1]\r
+  adds r1, r1, #4\r
+\r
+LoopCopyDataInit:\r
+  ldr r0, =_sdata\r
+  ldr r3, =_edata\r
+  adds r2, r0, r1\r
+  cmp r2, r3\r
+  bcc CopyDataInit\r
+  ldr r2, =_sbss\r
+  b LoopFillZerobss\r
+/* Zero fill the bss segment. */\r
+FillZerobss:\r
+  movs r3, #0\r
+  str r3, [r2], #4\r
+\r
+LoopFillZerobss:\r
+  ldr r3, = _ebss\r
+  cmp r2, r3\r
+  bcc FillZerobss\r
+\r
+/* Call the clock system intitialization function.*/\r
+    bl  SystemInit\r
+/* Call static constructors */\r
+    bl __libc_init_array\r
+/* Call the application's entry point.*/\r
+  bl main\r
+  bx lr\r
+.size Reset_Handler, .-Reset_Handler\r
+\r
+/**\r
+ * @brief  This is the code that gets called when the processor receives an\r
+ *         unexpected interrupt.  This simply enters an infinite loop, preserving\r
+ *         the system state for examination by a debugger.\r
+ *\r
+ * @param  None\r
+ * @retval : None\r
+*/\r
+    .section .text.Default_Handler,"ax",%progbits\r
+Default_Handler:\r
+Infinite_Loop:\r
+  b Infinite_Loop\r
+  .size Default_Handler, .-Default_Handler\r
+/******************************************************************************\r
+*\r
+* The minimal vector table for a Cortex M3.  Note that the proper constructs\r
+* must be placed on this to ensure that it ends up at physical address\r
+* 0x0000.0000.\r
+*\r
+******************************************************************************/\r
+  .section .isr_vector,"a",%progbits\r
+  .type g_pfnVectors, %object\r
+  .size g_pfnVectors, .-g_pfnVectors\r
+\r
+\r
+g_pfnVectors:\r
+\r
+  .word _estack\r
+  .word Reset_Handler\r
+  .word NMI_Handler\r
+  .word HardFault_Handler\r
+  .word MemManage_Handler\r
+  .word BusFault_Handler\r
+  .word UsageFault_Handler\r
+  .word 0\r
+  .word 0\r
+  .word 0\r
+  .word 0\r
+  .word SVC_Handler\r
+  .word DebugMon_Handler\r
+  .word 0\r
+  .word PendSV_Handler\r
+  .word SysTick_Handler\r
+  .word WWDG_IRQHandler\r
+  .word PVD_IRQHandler\r
+  .word TAMPER_IRQHandler\r
+  .word RTC_IRQHandler\r
+  .word FLASH_IRQHandler\r
+  .word RCC_IRQHandler\r
+  .word EXTI0_IRQHandler\r
+  .word EXTI1_IRQHandler\r
+  .word EXTI2_IRQHandler\r
+  .word EXTI3_IRQHandler\r
+  .word EXTI4_IRQHandler\r
+  .word DMA1_Channel1_IRQHandler\r
+  .word DMA1_Channel2_IRQHandler\r
+  .word DMA1_Channel3_IRQHandler\r
+  .word DMA1_Channel4_IRQHandler\r
+  .word DMA1_Channel5_IRQHandler\r
+  .word DMA1_Channel6_IRQHandler\r
+  .word DMA1_Channel7_IRQHandler\r
+  .word ADC1_2_IRQHandler\r
+  .word USB_HP_CAN1_TX_IRQHandler\r
+  .word USB_LP_CAN1_RX0_IRQHandler\r
+  .word CAN1_RX1_IRQHandler\r
+  .word CAN1_SCE_IRQHandler\r
+  .word EXTI9_5_IRQHandler\r
+  .word TIM1_BRK_IRQHandler\r
+  .word TIM1_UP_IRQHandler\r
+  .word TIM1_TRG_COM_IRQHandler\r
+  .word TIM1_CC_IRQHandler\r
+  .word TIM2_IRQHandler\r
+  .word TIM3_IRQHandler\r
+  .word TIM4_IRQHandler\r
+  .word I2C1_EV_IRQHandler\r
+  .word I2C1_ER_IRQHandler\r
+  .word I2C2_EV_IRQHandler\r
+  .word I2C2_ER_IRQHandler\r
+  .word SPI1_IRQHandler\r
+  .word SPI2_IRQHandler\r
+  .word USART1_IRQHandler\r
+  .word USART2_IRQHandler\r
+  .word USART3_IRQHandler\r
+  .word EXTI15_10_IRQHandler\r
+  .word RTC_Alarm_IRQHandler\r
+  .word USBWakeUp_IRQHandler\r
+  .word 0\r
+  .word 0\r
+  .word 0\r
+  .word 0\r
+  .word 0\r
+  .word 0\r
+  .word 0\r
+  .word BootRAM          /* @0x108. This is for boot in RAM mode for\r
+                            STM32F10x Medium Density devices. */\r
+\r
+/*******************************************************************************\r
+*\r
+* Provide weak aliases for each Exception handler to the Default_Handler.\r
+* As they are weak aliases, any function with the same name will override\r
+* this definition.\r
+*\r
+*******************************************************************************/\r
+\r
+  .weak NMI_Handler\r
+  .thumb_set NMI_Handler,Default_Handler\r
+\r
+  .weak HardFault_Handler\r
+  .thumb_set HardFault_Handler,Default_Handler\r
+\r
+  .weak MemManage_Handler\r
+  .thumb_set MemManage_Handler,Default_Handler\r
+\r
+  .weak BusFault_Handler\r
+  .thumb_set BusFault_Handler,Default_Handler\r
+\r
+  .weak UsageFault_Handler\r
+  .thumb_set UsageFault_Handler,Default_Handler\r
+\r
+  .weak SVC_Handler\r
+  .thumb_set SVC_Handler,Default_Handler\r
+\r
+  .weak DebugMon_Handler\r
+  .thumb_set DebugMon_Handler,Default_Handler\r
+\r
+  .weak PendSV_Handler\r
+  .thumb_set PendSV_Handler,Default_Handler\r
+\r
+  .weak SysTick_Handler\r
+  .thumb_set SysTick_Handler,Default_Handler\r
+\r
+  .weak WWDG_IRQHandler\r
+  .thumb_set WWDG_IRQHandler,Default_Handler\r
+\r
+  .weak PVD_IRQHandler\r
+  .thumb_set PVD_IRQHandler,Default_Handler\r
+\r
+  .weak TAMPER_IRQHandler\r
+  .thumb_set TAMPER_IRQHandler,Default_Handler\r
+\r
+  .weak RTC_IRQHandler\r
+  .thumb_set RTC_IRQHandler,Default_Handler\r
+\r
+  .weak FLASH_IRQHandler\r
+  .thumb_set FLASH_IRQHandler,Default_Handler\r
+\r
+  .weak RCC_IRQHandler\r
+  .thumb_set RCC_IRQHandler,Default_Handler\r
+\r
+  .weak EXTI0_IRQHandler\r
+  .thumb_set EXTI0_IRQHandler,Default_Handler\r
+\r
+  .weak EXTI1_IRQHandler\r
+  .thumb_set EXTI1_IRQHandler,Default_Handler\r
+\r
+  .weak EXTI2_IRQHandler\r
+  .thumb_set EXTI2_IRQHandler,Default_Handler\r
+\r
+  .weak EXTI3_IRQHandler\r
+  .thumb_set EXTI3_IRQHandler,Default_Handler\r
+\r
+  .weak EXTI4_IRQHandler\r
+  .thumb_set EXTI4_IRQHandler,Default_Handler\r
+\r
+  .weak DMA1_Channel1_IRQHandler\r
+  .thumb_set DMA1_Channel1_IRQHandler,Default_Handler\r
+\r
+  .weak DMA1_Channel2_IRQHandler\r
+  .thumb_set DMA1_Channel2_IRQHandler,Default_Handler\r
+\r
+  .weak DMA1_Channel3_IRQHandler\r
+  .thumb_set DMA1_Channel3_IRQHandler,Default_Handler\r
+\r
+  .weak DMA1_Channel4_IRQHandler\r
+  .thumb_set DMA1_Channel4_IRQHandler,Default_Handler\r
+\r
+  .weak DMA1_Channel5_IRQHandler\r
+  .thumb_set DMA1_Channel5_IRQHandler,Default_Handler\r
+\r
+  .weak DMA1_Channel6_IRQHandler\r
+  .thumb_set DMA1_Channel6_IRQHandler,Default_Handler\r
+\r
+  .weak DMA1_Channel7_IRQHandler\r
+  .thumb_set DMA1_Channel7_IRQHandler,Default_Handler\r
+\r
+  .weak ADC1_2_IRQHandler\r
+  .thumb_set ADC1_2_IRQHandler,Default_Handler\r
+\r
+  .weak USB_HP_CAN1_TX_IRQHandler\r
+  .thumb_set USB_HP_CAN1_TX_IRQHandler,Default_Handler\r
+\r
+  .weak USB_LP_CAN1_RX0_IRQHandler\r
+  .thumb_set USB_LP_CAN1_RX0_IRQHandler,Default_Handler\r
+\r
+  .weak CAN1_RX1_IRQHandler\r
+  .thumb_set CAN1_RX1_IRQHandler,Default_Handler\r
+\r
+  .weak CAN1_SCE_IRQHandler\r
+  .thumb_set CAN1_SCE_IRQHandler,Default_Handler\r
+\r
+  .weak EXTI9_5_IRQHandler\r
+  .thumb_set EXTI9_5_IRQHandler,Default_Handler\r
+\r
+  .weak TIM1_BRK_IRQHandler\r
+  .thumb_set TIM1_BRK_IRQHandler,Default_Handler\r
+\r
+  .weak TIM1_UP_IRQHandler\r
+  .thumb_set TIM1_UP_IRQHandler,Default_Handler\r
+\r
+  .weak TIM1_TRG_COM_IRQHandler\r
+  .thumb_set TIM1_TRG_COM_IRQHandler,Default_Handler\r
+\r
+  .weak TIM1_CC_IRQHandler\r
+  .thumb_set TIM1_CC_IRQHandler,Default_Handler\r
+\r
+  .weak TIM2_IRQHandler\r
+  .thumb_set TIM2_IRQHandler,Default_Handler\r
+\r
+  .weak TIM3_IRQHandler\r
+  .thumb_set TIM3_IRQHandler,Default_Handler\r
+\r
+  .weak TIM4_IRQHandler\r
+  .thumb_set TIM4_IRQHandler,Default_Handler\r
+\r
+  .weak I2C1_EV_IRQHandler\r
+  .thumb_set I2C1_EV_IRQHandler,Default_Handler\r
+\r
+  .weak I2C1_ER_IRQHandler\r
+  .thumb_set I2C1_ER_IRQHandler,Default_Handler\r
+\r
+  .weak I2C2_EV_IRQHandler\r
+  .thumb_set I2C2_EV_IRQHandler,Default_Handler\r
+\r
+  .weak I2C2_ER_IRQHandler\r
+  .thumb_set I2C2_ER_IRQHandler,Default_Handler\r
+\r
+  .weak SPI1_IRQHandler\r
+  .thumb_set SPI1_IRQHandler,Default_Handler\r
+\r
+  .weak SPI2_IRQHandler\r
+  .thumb_set SPI2_IRQHandler,Default_Handler\r
+\r
+  .weak USART1_IRQHandler\r
+  .thumb_set USART1_IRQHandler,Default_Handler\r
+\r
+  .weak USART2_IRQHandler\r
+  .thumb_set USART2_IRQHandler,Default_Handler\r
+\r
+  .weak USART3_IRQHandler\r
+  .thumb_set USART3_IRQHandler,Default_Handler\r
+\r
+  .weak EXTI15_10_IRQHandler\r
+  .thumb_set EXTI15_10_IRQHandler,Default_Handler\r
+\r
+  .weak RTC_Alarm_IRQHandler\r
+  .thumb_set RTC_Alarm_IRQHandler,Default_Handler\r
+\r
+  .weak USBWakeUp_IRQHandler\r
+  .thumb_set USBWakeUp_IRQHandler,Default_Handler\r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
+\r