core_armv8mbl.h 96 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918
  1. /**************************************************************************//**
  2. * @file core_armv8mbl.h
  3. * @brief CMSIS Armv8-M Baseline Core Peripheral Access Layer Header File
  4. * @version V5.0.7
  5. * @date 22. June 2018
  6. ******************************************************************************/
  7. /*
  8. * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
  9. *
  10. * SPDX-License-Identifier: Apache-2.0
  11. *
  12. * Licensed under the Apache License, Version 2.0 (the License); you may
  13. * not use this file except in compliance with the License.
  14. * You may obtain a copy of the License at
  15. *
  16. * www.apache.org/licenses/LICENSE-2.0
  17. *
  18. * Unless required by applicable law or agreed to in writing, software
  19. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  20. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  21. * See the License for the specific language governing permissions and
  22. * limitations under the License.
  23. */
  24. #if defined ( __ICCARM__ )
  25. #pragma system_include /* treat file as system include file for MISRA check */
  26. #elif defined (__clang__)
  27. #pragma clang system_header /* treat file as system include file */
  28. #endif
  29. #ifndef __CORE_ARMV8MBL_H_GENERIC
  30. #define __CORE_ARMV8MBL_H_GENERIC
  31. #include <stdint.h>
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35. /**
  36. \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions
  37. CMSIS violates the following MISRA-C:2004 rules:
  38. \li Required Rule 8.5, object/function definition in header file.<br>
  39. Function definitions in header files are used to allow 'inlining'.
  40. \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>
  41. Unions are used for effective representation of core registers.
  42. \li Advisory Rule 19.7, Function-like macro defined.<br>
  43. Function-like macros are used to allow more efficient code.
  44. */
  45. /*******************************************************************************
  46. * CMSIS definitions
  47. ******************************************************************************/
  48. /**
  49. \ingroup Cortex_ARMv8MBL
  50. @{
  51. */
  52. #include "cmsis_version.h"
  53. /* CMSIS definitions */
  54. #define __ARMv8MBL_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */
  55. #define __ARMv8MBL_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */
  56. #define __ARMv8MBL_CMSIS_VERSION ((__ARMv8MBL_CMSIS_VERSION_MAIN << 16U) | \
  57. __ARMv8MBL_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */
  58. #define __CORTEX_M ( 2U) /*!< Cortex-M Core */
  59. /** __FPU_USED indicates whether an FPU is used or not.
  60. This core does not support an FPU at all
  61. */
  62. #define __FPU_USED 0U
  63. #if defined ( __CC_ARM )
  64. #if defined __TARGET_FPU_VFP
  65. #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
  66. #endif
  67. #elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
  68. #if defined __ARM_PCS_VFP
  69. #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
  70. #endif
  71. #elif defined ( __GNUC__ )
  72. #if defined (__VFP_FP__) && !defined(__SOFTFP__)
  73. #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
  74. #endif
  75. #elif defined ( __ICCARM__ )
  76. #if defined __ARMVFP__
  77. #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
  78. #endif
  79. #elif defined ( __TI_ARM__ )
  80. #if defined __TI_VFP_SUPPORT__
  81. #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
  82. #endif
  83. #elif defined ( __TASKING__ )
  84. #if defined __FPU_VFP__
  85. #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
  86. #endif
  87. #elif defined ( __CSMC__ )
  88. #if ( __CSMC__ & 0x400U)
  89. #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
  90. #endif
  91. #endif
  92. #include "cmsis_compiler.h" /* CMSIS compiler specific defines */
  93. #ifdef __cplusplus
  94. }
  95. #endif
  96. #endif /* __CORE_ARMV8MBL_H_GENERIC */
  97. #ifndef __CMSIS_GENERIC
  98. #ifndef __CORE_ARMV8MBL_H_DEPENDANT
  99. #define __CORE_ARMV8MBL_H_DEPENDANT
  100. #ifdef __cplusplus
  101. extern "C" {
  102. #endif
  103. /* check device defines and use defaults */
  104. #if defined __CHECK_DEVICE_DEFINES
  105. #ifndef __ARMv8MBL_REV
  106. #define __ARMv8MBL_REV 0x0000U
  107. #warning "__ARMv8MBL_REV not defined in device header file; using default!"
  108. #endif
  109. #ifndef __FPU_PRESENT
  110. #define __FPU_PRESENT 0U
  111. #warning "__FPU_PRESENT not defined in device header file; using default!"
  112. #endif
  113. #ifndef __MPU_PRESENT
  114. #define __MPU_PRESENT 0U
  115. #warning "__MPU_PRESENT not defined in device header file; using default!"
  116. #endif
  117. #ifndef __SAUREGION_PRESENT
  118. #define __SAUREGION_PRESENT 0U
  119. #warning "__SAUREGION_PRESENT not defined in device header file; using default!"
  120. #endif
  121. #ifndef __VTOR_PRESENT
  122. #define __VTOR_PRESENT 0U
  123. #warning "__VTOR_PRESENT not defined in device header file; using default!"
  124. #endif
  125. #ifndef __NVIC_PRIO_BITS
  126. #define __NVIC_PRIO_BITS 2U
  127. #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"
  128. #endif
  129. #ifndef __Vendor_SysTickConfig
  130. #define __Vendor_SysTickConfig 0U
  131. #warning "__Vendor_SysTickConfig not defined in device header file; using default!"
  132. #endif
  133. #ifndef __ETM_PRESENT
  134. #define __ETM_PRESENT 0U
  135. #warning "__ETM_PRESENT not defined in device header file; using default!"
  136. #endif
  137. #ifndef __MTB_PRESENT
  138. #define __MTB_PRESENT 0U
  139. #warning "__MTB_PRESENT not defined in device header file; using default!"
  140. #endif
  141. #endif
  142. /* IO definitions (access restrictions to peripheral registers) */
  143. /**
  144. \defgroup CMSIS_glob_defs CMSIS Global Defines
  145. <strong>IO Type Qualifiers</strong> are used
  146. \li to specify the access to peripheral variables.
  147. \li for automatic generation of peripheral register debug information.
  148. */
  149. #ifdef __cplusplus
  150. #define __I volatile /*!< Defines 'read only' permissions */
  151. #else
  152. #define __I volatile const /*!< Defines 'read only' permissions */
  153. #endif
  154. #define __O volatile /*!< Defines 'write only' permissions */
  155. #define __IO volatile /*!< Defines 'read / write' permissions */
  156. /* following defines should be used for structure members */
  157. #define __IM volatile const /*! Defines 'read only' structure member permissions */
  158. #define __OM volatile /*! Defines 'write only' structure member permissions */
  159. #define __IOM volatile /*! Defines 'read / write' structure member permissions */
  160. /*@} end of group ARMv8MBL */
  161. /*******************************************************************************
  162. * Register Abstraction
  163. Core Register contain:
  164. - Core Register
  165. - Core NVIC Register
  166. - Core SCB Register
  167. - Core SysTick Register
  168. - Core Debug Register
  169. - Core MPU Register
  170. - Core SAU Register
  171. ******************************************************************************/
  172. /**
  173. \defgroup CMSIS_core_register Defines and Type Definitions
  174. \brief Type definitions and defines for Cortex-M processor based devices.
  175. */
  176. /**
  177. \ingroup CMSIS_core_register
  178. \defgroup CMSIS_CORE Status and Control Registers
  179. \brief Core Register type definitions.
  180. @{
  181. */
  182. /**
  183. \brief Union type to access the Application Program Status Register (APSR).
  184. */
  185. typedef union
  186. {
  187. struct
  188. {
  189. uint32_t _reserved0:28; /*!< bit: 0..27 Reserved */
  190. uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
  191. uint32_t C:1; /*!< bit: 29 Carry condition code flag */
  192. uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
  193. uint32_t N:1; /*!< bit: 31 Negative condition code flag */
  194. } b; /*!< Structure used for bit access */
  195. uint32_t w; /*!< Type used for word access */
  196. } APSR_Type;
  197. /* APSR Register Definitions */
  198. #define APSR_N_Pos 31U /*!< APSR: N Position */
  199. #define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */
  200. #define APSR_Z_Pos 30U /*!< APSR: Z Position */
  201. #define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */
  202. #define APSR_C_Pos 29U /*!< APSR: C Position */
  203. #define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */
  204. #define APSR_V_Pos 28U /*!< APSR: V Position */
  205. #define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */
  206. /**
  207. \brief Union type to access the Interrupt Program Status Register (IPSR).
  208. */
  209. typedef union
  210. {
  211. struct
  212. {
  213. uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
  214. uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */
  215. } b; /*!< Structure used for bit access */
  216. uint32_t w; /*!< Type used for word access */
  217. } IPSR_Type;
  218. /* IPSR Register Definitions */
  219. #define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */
  220. #define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */
  221. /**
  222. \brief Union type to access the Special-Purpose Program Status Registers (xPSR).
  223. */
  224. typedef union
  225. {
  226. struct
  227. {
  228. uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
  229. uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */
  230. uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */
  231. uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */
  232. uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
  233. uint32_t C:1; /*!< bit: 29 Carry condition code flag */
  234. uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
  235. uint32_t N:1; /*!< bit: 31 Negative condition code flag */
  236. } b; /*!< Structure used for bit access */
  237. uint32_t w; /*!< Type used for word access */
  238. } xPSR_Type;
  239. /* xPSR Register Definitions */
  240. #define xPSR_N_Pos 31U /*!< xPSR: N Position */
  241. #define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */
  242. #define xPSR_Z_Pos 30U /*!< xPSR: Z Position */
  243. #define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */
  244. #define xPSR_C_Pos 29U /*!< xPSR: C Position */
  245. #define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */
  246. #define xPSR_V_Pos 28U /*!< xPSR: V Position */
  247. #define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */
  248. #define xPSR_T_Pos 24U /*!< xPSR: T Position */
  249. #define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */
  250. #define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */
  251. #define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */
  252. /**
  253. \brief Union type to access the Control Registers (CONTROL).
  254. */
  255. typedef union
  256. {
  257. struct
  258. {
  259. uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */
  260. uint32_t SPSEL:1; /*!< bit: 1 Stack-pointer select */
  261. uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */
  262. } b; /*!< Structure used for bit access */
  263. uint32_t w; /*!< Type used for word access */
  264. } CONTROL_Type;
  265. /* CONTROL Register Definitions */
  266. #define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */
  267. #define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */
  268. #define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */
  269. #define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */
  270. /*@} end of group CMSIS_CORE */
  271. /**
  272. \ingroup CMSIS_core_register
  273. \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC)
  274. \brief Type definitions for the NVIC Registers
  275. @{
  276. */
  277. /**
  278. \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC).
  279. */
  280. typedef struct
  281. {
  282. __IOM uint32_t ISER[16U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */
  283. uint32_t RESERVED0[16U];
  284. __IOM uint32_t ICER[16U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */
  285. uint32_t RSERVED1[16U];
  286. __IOM uint32_t ISPR[16U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */
  287. uint32_t RESERVED2[16U];
  288. __IOM uint32_t ICPR[16U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */
  289. uint32_t RESERVED3[16U];
  290. __IOM uint32_t IABR[16U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */
  291. uint32_t RESERVED4[16U];
  292. __IOM uint32_t ITNS[16U]; /*!< Offset: 0x280 (R/W) Interrupt Non-Secure State Register */
  293. uint32_t RESERVED5[16U];
  294. __IOM uint32_t IPR[124U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */
  295. } NVIC_Type;
  296. /*@} end of group CMSIS_NVIC */
  297. /**
  298. \ingroup CMSIS_core_register
  299. \defgroup CMSIS_SCB System Control Block (SCB)
  300. \brief Type definitions for the System Control Block Registers
  301. @{
  302. */
  303. /**
  304. \brief Structure type to access the System Control Block (SCB).
  305. */
  306. typedef struct
  307. {
  308. __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */
  309. __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */
  310. #if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)
  311. __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */
  312. #else
  313. uint32_t RESERVED0;
  314. #endif
  315. __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */
  316. __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */
  317. __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */
  318. uint32_t RESERVED1;
  319. __IOM uint32_t SHPR[2U]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */
  320. __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */
  321. } SCB_Type;
  322. /* SCB CPUID Register Definitions */
  323. #define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */
  324. #define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */
  325. #define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */
  326. #define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */
  327. #define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */
  328. #define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */
  329. #define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */
  330. #define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */
  331. #define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */
  332. #define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */
  333. /* SCB Interrupt Control State Register Definitions */
  334. #define SCB_ICSR_PENDNMISET_Pos 31U /*!< SCB ICSR: PENDNMISET Position */
  335. #define SCB_ICSR_PENDNMISET_Msk (1UL << SCB_ICSR_PENDNMISET_Pos) /*!< SCB ICSR: PENDNMISET Mask */
  336. #define SCB_ICSR_NMIPENDSET_Pos SCB_ICSR_PENDNMISET_Pos /*!< SCB ICSR: NMIPENDSET Position, backward compatibility */
  337. #define SCB_ICSR_NMIPENDSET_Msk SCB_ICSR_PENDNMISET_Msk /*!< SCB ICSR: NMIPENDSET Mask, backward compatibility */
  338. #define SCB_ICSR_PENDNMICLR_Pos 30U /*!< SCB ICSR: PENDNMICLR Position */
  339. #define SCB_ICSR_PENDNMICLR_Msk (1UL << SCB_ICSR_PENDNMICLR_Pos) /*!< SCB ICSR: PENDNMICLR Mask */
  340. #define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */
  341. #define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */
  342. #define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */
  343. #define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */
  344. #define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */
  345. #define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */
  346. #define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */
  347. #define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */
  348. #define SCB_ICSR_STTNS_Pos 24U /*!< SCB ICSR: STTNS Position (Security Extension) */
  349. #define SCB_ICSR_STTNS_Msk (1UL << SCB_ICSR_STTNS_Pos) /*!< SCB ICSR: STTNS Mask (Security Extension) */
  350. #define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */
  351. #define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */
  352. #define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */
  353. #define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */
  354. #define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */
  355. #define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */
  356. #define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */
  357. #define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */
  358. #define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */
  359. #define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */
  360. #if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)
  361. /* SCB Vector Table Offset Register Definitions */
  362. #define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */
  363. #define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */
  364. #endif
  365. /* SCB Application Interrupt and Reset Control Register Definitions */
  366. #define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */
  367. #define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */
  368. #define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */
  369. #define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */
  370. #define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */
  371. #define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */
  372. #define SCB_AIRCR_PRIS_Pos 14U /*!< SCB AIRCR: PRIS Position */
  373. #define SCB_AIRCR_PRIS_Msk (1UL << SCB_AIRCR_PRIS_Pos) /*!< SCB AIRCR: PRIS Mask */
  374. #define SCB_AIRCR_BFHFNMINS_Pos 13U /*!< SCB AIRCR: BFHFNMINS Position */
  375. #define SCB_AIRCR_BFHFNMINS_Msk (1UL << SCB_AIRCR_BFHFNMINS_Pos) /*!< SCB AIRCR: BFHFNMINS Mask */
  376. #define SCB_AIRCR_SYSRESETREQS_Pos 3U /*!< SCB AIRCR: SYSRESETREQS Position */
  377. #define SCB_AIRCR_SYSRESETREQS_Msk (1UL << SCB_AIRCR_SYSRESETREQS_Pos) /*!< SCB AIRCR: SYSRESETREQS Mask */
  378. #define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */
  379. #define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */
  380. #define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */
  381. #define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */
  382. /* SCB System Control Register Definitions */
  383. #define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */
  384. #define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */
  385. #define SCB_SCR_SLEEPDEEPS_Pos 3U /*!< SCB SCR: SLEEPDEEPS Position */
  386. #define SCB_SCR_SLEEPDEEPS_Msk (1UL << SCB_SCR_SLEEPDEEPS_Pos) /*!< SCB SCR: SLEEPDEEPS Mask */
  387. #define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */
  388. #define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */
  389. #define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */
  390. #define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */
  391. /* SCB Configuration Control Register Definitions */
  392. #define SCB_CCR_BP_Pos 18U /*!< SCB CCR: BP Position */
  393. #define SCB_CCR_BP_Msk (1UL << SCB_CCR_BP_Pos) /*!< SCB CCR: BP Mask */
  394. #define SCB_CCR_IC_Pos 17U /*!< SCB CCR: IC Position */
  395. #define SCB_CCR_IC_Msk (1UL << SCB_CCR_IC_Pos) /*!< SCB CCR: IC Mask */
  396. #define SCB_CCR_DC_Pos 16U /*!< SCB CCR: DC Position */
  397. #define SCB_CCR_DC_Msk (1UL << SCB_CCR_DC_Pos) /*!< SCB CCR: DC Mask */
  398. #define SCB_CCR_STKOFHFNMIGN_Pos 10U /*!< SCB CCR: STKOFHFNMIGN Position */
  399. #define SCB_CCR_STKOFHFNMIGN_Msk (1UL << SCB_CCR_STKOFHFNMIGN_Pos) /*!< SCB CCR: STKOFHFNMIGN Mask */
  400. #define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */
  401. #define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */
  402. #define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */
  403. #define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */
  404. #define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */
  405. #define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */
  406. #define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */
  407. #define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */
  408. /* SCB System Handler Control and State Register Definitions */
  409. #define SCB_SHCSR_HARDFAULTPENDED_Pos 21U /*!< SCB SHCSR: HARDFAULTPENDED Position */
  410. #define SCB_SHCSR_HARDFAULTPENDED_Msk (1UL << SCB_SHCSR_HARDFAULTPENDED_Pos) /*!< SCB SHCSR: HARDFAULTPENDED Mask */
  411. #define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */
  412. #define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */
  413. #define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */
  414. #define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */
  415. #define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */
  416. #define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */
  417. #define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */
  418. #define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */
  419. #define SCB_SHCSR_NMIACT_Pos 5U /*!< SCB SHCSR: NMIACT Position */
  420. #define SCB_SHCSR_NMIACT_Msk (1UL << SCB_SHCSR_NMIACT_Pos) /*!< SCB SHCSR: NMIACT Mask */
  421. #define SCB_SHCSR_HARDFAULTACT_Pos 2U /*!< SCB SHCSR: HARDFAULTACT Position */
  422. #define SCB_SHCSR_HARDFAULTACT_Msk (1UL << SCB_SHCSR_HARDFAULTACT_Pos) /*!< SCB SHCSR: HARDFAULTACT Mask */
  423. /*@} end of group CMSIS_SCB */
  424. /**
  425. \ingroup CMSIS_core_register
  426. \defgroup CMSIS_SysTick System Tick Timer (SysTick)
  427. \brief Type definitions for the System Timer Registers.
  428. @{
  429. */
  430. /**
  431. \brief Structure type to access the System Timer (SysTick).
  432. */
  433. typedef struct
  434. {
  435. __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */
  436. __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */
  437. __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */
  438. __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */
  439. } SysTick_Type;
  440. /* SysTick Control / Status Register Definitions */
  441. #define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */
  442. #define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */
  443. #define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */
  444. #define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */
  445. #define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */
  446. #define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */
  447. #define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */
  448. #define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */
  449. /* SysTick Reload Register Definitions */
  450. #define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */
  451. #define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */
  452. /* SysTick Current Register Definitions */
  453. #define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */
  454. #define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */
  455. /* SysTick Calibration Register Definitions */
  456. #define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */
  457. #define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */
  458. #define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */
  459. #define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */
  460. #define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */
  461. #define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */
  462. /*@} end of group CMSIS_SysTick */
  463. /**
  464. \ingroup CMSIS_core_register
  465. \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT)
  466. \brief Type definitions for the Data Watchpoint and Trace (DWT)
  467. @{
  468. */
  469. /**
  470. \brief Structure type to access the Data Watchpoint and Trace Register (DWT).
  471. */
  472. typedef struct
  473. {
  474. __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */
  475. uint32_t RESERVED0[6U];
  476. __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */
  477. __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */
  478. uint32_t RESERVED1[1U];
  479. __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */
  480. uint32_t RESERVED2[1U];
  481. __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */
  482. uint32_t RESERVED3[1U];
  483. __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */
  484. uint32_t RESERVED4[1U];
  485. __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */
  486. uint32_t RESERVED5[1U];
  487. __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */
  488. uint32_t RESERVED6[1U];
  489. __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */
  490. uint32_t RESERVED7[1U];
  491. __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */
  492. uint32_t RESERVED8[1U];
  493. __IOM uint32_t COMP4; /*!< Offset: 0x060 (R/W) Comparator Register 4 */
  494. uint32_t RESERVED9[1U];
  495. __IOM uint32_t FUNCTION4; /*!< Offset: 0x068 (R/W) Function Register 4 */
  496. uint32_t RESERVED10[1U];
  497. __IOM uint32_t COMP5; /*!< Offset: 0x070 (R/W) Comparator Register 5 */
  498. uint32_t RESERVED11[1U];
  499. __IOM uint32_t FUNCTION5; /*!< Offset: 0x078 (R/W) Function Register 5 */
  500. uint32_t RESERVED12[1U];
  501. __IOM uint32_t COMP6; /*!< Offset: 0x080 (R/W) Comparator Register 6 */
  502. uint32_t RESERVED13[1U];
  503. __IOM uint32_t FUNCTION6; /*!< Offset: 0x088 (R/W) Function Register 6 */
  504. uint32_t RESERVED14[1U];
  505. __IOM uint32_t COMP7; /*!< Offset: 0x090 (R/W) Comparator Register 7 */
  506. uint32_t RESERVED15[1U];
  507. __IOM uint32_t FUNCTION7; /*!< Offset: 0x098 (R/W) Function Register 7 */
  508. uint32_t RESERVED16[1U];
  509. __IOM uint32_t COMP8; /*!< Offset: 0x0A0 (R/W) Comparator Register 8 */
  510. uint32_t RESERVED17[1U];
  511. __IOM uint32_t FUNCTION8; /*!< Offset: 0x0A8 (R/W) Function Register 8 */
  512. uint32_t RESERVED18[1U];
  513. __IOM uint32_t COMP9; /*!< Offset: 0x0B0 (R/W) Comparator Register 9 */
  514. uint32_t RESERVED19[1U];
  515. __IOM uint32_t FUNCTION9; /*!< Offset: 0x0B8 (R/W) Function Register 9 */
  516. uint32_t RESERVED20[1U];
  517. __IOM uint32_t COMP10; /*!< Offset: 0x0C0 (R/W) Comparator Register 10 */
  518. uint32_t RESERVED21[1U];
  519. __IOM uint32_t FUNCTION10; /*!< Offset: 0x0C8 (R/W) Function Register 10 */
  520. uint32_t RESERVED22[1U];
  521. __IOM uint32_t COMP11; /*!< Offset: 0x0D0 (R/W) Comparator Register 11 */
  522. uint32_t RESERVED23[1U];
  523. __IOM uint32_t FUNCTION11; /*!< Offset: 0x0D8 (R/W) Function Register 11 */
  524. uint32_t RESERVED24[1U];
  525. __IOM uint32_t COMP12; /*!< Offset: 0x0E0 (R/W) Comparator Register 12 */
  526. uint32_t RESERVED25[1U];
  527. __IOM uint32_t FUNCTION12; /*!< Offset: 0x0E8 (R/W) Function Register 12 */
  528. uint32_t RESERVED26[1U];
  529. __IOM uint32_t COMP13; /*!< Offset: 0x0F0 (R/W) Comparator Register 13 */
  530. uint32_t RESERVED27[1U];
  531. __IOM uint32_t FUNCTION13; /*!< Offset: 0x0F8 (R/W) Function Register 13 */
  532. uint32_t RESERVED28[1U];
  533. __IOM uint32_t COMP14; /*!< Offset: 0x100 (R/W) Comparator Register 14 */
  534. uint32_t RESERVED29[1U];
  535. __IOM uint32_t FUNCTION14; /*!< Offset: 0x108 (R/W) Function Register 14 */
  536. uint32_t RESERVED30[1U];
  537. __IOM uint32_t COMP15; /*!< Offset: 0x110 (R/W) Comparator Register 15 */
  538. uint32_t RESERVED31[1U];
  539. __IOM uint32_t FUNCTION15; /*!< Offset: 0x118 (R/W) Function Register 15 */
  540. } DWT_Type;
  541. /* DWT Control Register Definitions */
  542. #define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */
  543. #define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */
  544. #define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */
  545. #define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */
  546. #define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */
  547. #define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */
  548. #define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */
  549. #define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */
  550. #define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */
  551. #define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */
  552. /* DWT Comparator Function Register Definitions */
  553. #define DWT_FUNCTION_ID_Pos 27U /*!< DWT FUNCTION: ID Position */
  554. #define DWT_FUNCTION_ID_Msk (0x1FUL << DWT_FUNCTION_ID_Pos) /*!< DWT FUNCTION: ID Mask */
  555. #define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */
  556. #define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */
  557. #define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */
  558. #define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */
  559. #define DWT_FUNCTION_ACTION_Pos 4U /*!< DWT FUNCTION: ACTION Position */
  560. #define DWT_FUNCTION_ACTION_Msk (0x3UL << DWT_FUNCTION_ACTION_Pos) /*!< DWT FUNCTION: ACTION Mask */
  561. #define DWT_FUNCTION_MATCH_Pos 0U /*!< DWT FUNCTION: MATCH Position */
  562. #define DWT_FUNCTION_MATCH_Msk (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/) /*!< DWT FUNCTION: MATCH Mask */
  563. /*@}*/ /* end of group CMSIS_DWT */
  564. /**
  565. \ingroup CMSIS_core_register
  566. \defgroup CMSIS_TPI Trace Port Interface (TPI)
  567. \brief Type definitions for the Trace Port Interface (TPI)
  568. @{
  569. */
  570. /**
  571. \brief Structure type to access the Trace Port Interface Register (TPI).
  572. */
  573. typedef struct
  574. {
  575. __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Sizes Register */
  576. __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Sizes Register */
  577. uint32_t RESERVED0[2U];
  578. __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */
  579. uint32_t RESERVED1[55U];
  580. __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */
  581. uint32_t RESERVED2[131U];
  582. __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */
  583. __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */
  584. __IOM uint32_t PSCR; /*!< Offset: 0x308 (R/W) Periodic Synchronization Control Register */
  585. uint32_t RESERVED3[809U];
  586. __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) Software Lock Access Register */
  587. __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) Software Lock Status Register */
  588. uint32_t RESERVED4[4U];
  589. __IM uint32_t TYPE; /*!< Offset: 0xFC8 (R/ ) Device Identifier Register */
  590. __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) Device Type Register */
  591. } TPI_Type;
  592. /* TPI Asynchronous Clock Prescaler Register Definitions */
  593. #define TPI_ACPR_SWOSCALER_Pos 0U /*!< TPI ACPR: SWOSCALER Position */
  594. #define TPI_ACPR_SWOSCALER_Msk (0xFFFFUL /*<< TPI_ACPR_SWOSCALER_Pos*/) /*!< TPI ACPR: SWOSCALER Mask */
  595. /* TPI Selected Pin Protocol Register Definitions */
  596. #define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */
  597. #define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */
  598. /* TPI Formatter and Flush Status Register Definitions */
  599. #define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */
  600. #define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */
  601. #define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */
  602. #define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */
  603. #define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */
  604. #define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */
  605. #define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */
  606. #define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */
  607. /* TPI Formatter and Flush Control Register Definitions */
  608. #define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */
  609. #define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */
  610. #define TPI_FFCR_FOnMan_Pos 6U /*!< TPI FFCR: FOnMan Position */
  611. #define TPI_FFCR_FOnMan_Msk (0x1UL << TPI_FFCR_FOnMan_Pos) /*!< TPI FFCR: FOnMan Mask */
  612. #define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */
  613. #define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */
  614. /* TPI Periodic Synchronization Control Register Definitions */
  615. #define TPI_PSCR_PSCount_Pos 0U /*!< TPI PSCR: PSCount Position */
  616. #define TPI_PSCR_PSCount_Msk (0x1FUL /*<< TPI_PSCR_PSCount_Pos*/) /*!< TPI PSCR: TPSCount Mask */
  617. /* TPI Software Lock Status Register Definitions */
  618. #define TPI_LSR_nTT_Pos 1U /*!< TPI LSR: Not thirty-two bit. Position */
  619. #define TPI_LSR_nTT_Msk (0x1UL << TPI_LSR_nTT_Pos) /*!< TPI LSR: Not thirty-two bit. Mask */
  620. #define TPI_LSR_SLK_Pos 1U /*!< TPI LSR: Software Lock status Position */
  621. #define TPI_LSR_SLK_Msk (0x1UL << TPI_LSR_SLK_Pos) /*!< TPI LSR: Software Lock status Mask */
  622. #define TPI_LSR_SLI_Pos 0U /*!< TPI LSR: Software Lock implemented Position */
  623. #define TPI_LSR_SLI_Msk (0x1UL /*<< TPI_LSR_SLI_Pos*/) /*!< TPI LSR: Software Lock implemented Mask */
  624. /* TPI DEVID Register Definitions */
  625. #define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */
  626. #define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */
  627. #define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */
  628. #define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */
  629. #define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */
  630. #define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */
  631. #define TPI_DEVID_FIFOSZ_Pos 6U /*!< TPI DEVID: FIFO depth Position */
  632. #define TPI_DEVID_FIFOSZ_Msk (0x7UL << TPI_DEVID_FIFOSZ_Pos) /*!< TPI DEVID: FIFO depth Mask */
  633. /* TPI DEVTYPE Register Definitions */
  634. #define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */
  635. #define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */
  636. #define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */
  637. #define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */
  638. /*@}*/ /* end of group CMSIS_TPI */
  639. #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
  640. /**
  641. \ingroup CMSIS_core_register
  642. \defgroup CMSIS_MPU Memory Protection Unit (MPU)
  643. \brief Type definitions for the Memory Protection Unit (MPU)
  644. @{
  645. */
  646. /**
  647. \brief Structure type to access the Memory Protection Unit (MPU).
  648. */
  649. typedef struct
  650. {
  651. __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */
  652. __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */
  653. __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region Number Register */
  654. __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */
  655. __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) MPU Region Limit Address Register */
  656. uint32_t RESERVED0[7U];
  657. union {
  658. __IOM uint32_t MAIR[2];
  659. struct {
  660. __IOM uint32_t MAIR0; /*!< Offset: 0x030 (R/W) MPU Memory Attribute Indirection Register 0 */
  661. __IOM uint32_t MAIR1; /*!< Offset: 0x034 (R/W) MPU Memory Attribute Indirection Register 1 */
  662. };
  663. };
  664. } MPU_Type;
  665. #define MPU_TYPE_RALIASES 1U
  666. /* MPU Type Register Definitions */
  667. #define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */
  668. #define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */
  669. #define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */
  670. #define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */
  671. #define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */
  672. #define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */
  673. /* MPU Control Register Definitions */
  674. #define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */
  675. #define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */
  676. #define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */
  677. #define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */
  678. #define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */
  679. #define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */
  680. /* MPU Region Number Register Definitions */
  681. #define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */
  682. #define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */
  683. /* MPU Region Base Address Register Definitions */
  684. #define MPU_RBAR_BASE_Pos 5U /*!< MPU RBAR: BASE Position */
  685. #define MPU_RBAR_BASE_Msk (0x7FFFFFFUL << MPU_RBAR_BASE_Pos) /*!< MPU RBAR: BASE Mask */
  686. #define MPU_RBAR_SH_Pos 3U /*!< MPU RBAR: SH Position */
  687. #define MPU_RBAR_SH_Msk (0x3UL << MPU_RBAR_SH_Pos) /*!< MPU RBAR: SH Mask */
  688. #define MPU_RBAR_AP_Pos 1U /*!< MPU RBAR: AP Position */
  689. #define MPU_RBAR_AP_Msk (0x3UL << MPU_RBAR_AP_Pos) /*!< MPU RBAR: AP Mask */
  690. #define MPU_RBAR_XN_Pos 0U /*!< MPU RBAR: XN Position */
  691. #define MPU_RBAR_XN_Msk (01UL /*<< MPU_RBAR_XN_Pos*/) /*!< MPU RBAR: XN Mask */
  692. /* MPU Region Limit Address Register Definitions */
  693. #define MPU_RLAR_LIMIT_Pos 5U /*!< MPU RLAR: LIMIT Position */
  694. #define MPU_RLAR_LIMIT_Msk (0x7FFFFFFUL << MPU_RLAR_LIMIT_Pos) /*!< MPU RLAR: LIMIT Mask */
  695. #define MPU_RLAR_AttrIndx_Pos 1U /*!< MPU RLAR: AttrIndx Position */
  696. #define MPU_RLAR_AttrIndx_Msk (0x7UL << MPU_RLAR_AttrIndx_Pos) /*!< MPU RLAR: AttrIndx Mask */
  697. #define MPU_RLAR_EN_Pos 0U /*!< MPU RLAR: EN Position */
  698. #define MPU_RLAR_EN_Msk (1UL /*<< MPU_RLAR_EN_Pos*/) /*!< MPU RLAR: EN Mask */
  699. /* MPU Memory Attribute Indirection Register 0 Definitions */
  700. #define MPU_MAIR0_Attr3_Pos 24U /*!< MPU MAIR0: Attr3 Position */
  701. #define MPU_MAIR0_Attr3_Msk (0xFFUL << MPU_MAIR0_Attr3_Pos) /*!< MPU MAIR0: Attr3 Mask */
  702. #define MPU_MAIR0_Attr2_Pos 16U /*!< MPU MAIR0: Attr2 Position */
  703. #define MPU_MAIR0_Attr2_Msk (0xFFUL << MPU_MAIR0_Attr2_Pos) /*!< MPU MAIR0: Attr2 Mask */
  704. #define MPU_MAIR0_Attr1_Pos 8U /*!< MPU MAIR0: Attr1 Position */
  705. #define MPU_MAIR0_Attr1_Msk (0xFFUL << MPU_MAIR0_Attr1_Pos) /*!< MPU MAIR0: Attr1 Mask */
  706. #define MPU_MAIR0_Attr0_Pos 0U /*!< MPU MAIR0: Attr0 Position */
  707. #define MPU_MAIR0_Attr0_Msk (0xFFUL /*<< MPU_MAIR0_Attr0_Pos*/) /*!< MPU MAIR0: Attr0 Mask */
  708. /* MPU Memory Attribute Indirection Register 1 Definitions */
  709. #define MPU_MAIR1_Attr7_Pos 24U /*!< MPU MAIR1: Attr7 Position */
  710. #define MPU_MAIR1_Attr7_Msk (0xFFUL << MPU_MAIR1_Attr7_Pos) /*!< MPU MAIR1: Attr7 Mask */
  711. #define MPU_MAIR1_Attr6_Pos 16U /*!< MPU MAIR1: Attr6 Position */
  712. #define MPU_MAIR1_Attr6_Msk (0xFFUL << MPU_MAIR1_Attr6_Pos) /*!< MPU MAIR1: Attr6 Mask */
  713. #define MPU_MAIR1_Attr5_Pos 8U /*!< MPU MAIR1: Attr5 Position */
  714. #define MPU_MAIR1_Attr5_Msk (0xFFUL << MPU_MAIR1_Attr5_Pos) /*!< MPU MAIR1: Attr5 Mask */
  715. #define MPU_MAIR1_Attr4_Pos 0U /*!< MPU MAIR1: Attr4 Position */
  716. #define MPU_MAIR1_Attr4_Msk (0xFFUL /*<< MPU_MAIR1_Attr4_Pos*/) /*!< MPU MAIR1: Attr4 Mask */
  717. /*@} end of group CMSIS_MPU */
  718. #endif
  719. #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
  720. /**
  721. \ingroup CMSIS_core_register
  722. \defgroup CMSIS_SAU Security Attribution Unit (SAU)
  723. \brief Type definitions for the Security Attribution Unit (SAU)
  724. @{
  725. */
  726. /**
  727. \brief Structure type to access the Security Attribution Unit (SAU).
  728. */
  729. typedef struct
  730. {
  731. __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SAU Control Register */
  732. __IM uint32_t TYPE; /*!< Offset: 0x004 (R/ ) SAU Type Register */
  733. #if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U)
  734. __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) SAU Region Number Register */
  735. __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) SAU Region Base Address Register */
  736. __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) SAU Region Limit Address Register */
  737. #endif
  738. } SAU_Type;
  739. /* SAU Control Register Definitions */
  740. #define SAU_CTRL_ALLNS_Pos 1U /*!< SAU CTRL: ALLNS Position */
  741. #define SAU_CTRL_ALLNS_Msk (1UL << SAU_CTRL_ALLNS_Pos) /*!< SAU CTRL: ALLNS Mask */
  742. #define SAU_CTRL_ENABLE_Pos 0U /*!< SAU CTRL: ENABLE Position */
  743. #define SAU_CTRL_ENABLE_Msk (1UL /*<< SAU_CTRL_ENABLE_Pos*/) /*!< SAU CTRL: ENABLE Mask */
  744. /* SAU Type Register Definitions */
  745. #define SAU_TYPE_SREGION_Pos 0U /*!< SAU TYPE: SREGION Position */
  746. #define SAU_TYPE_SREGION_Msk (0xFFUL /*<< SAU_TYPE_SREGION_Pos*/) /*!< SAU TYPE: SREGION Mask */
  747. #if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U)
  748. /* SAU Region Number Register Definitions */
  749. #define SAU_RNR_REGION_Pos 0U /*!< SAU RNR: REGION Position */
  750. #define SAU_RNR_REGION_Msk (0xFFUL /*<< SAU_RNR_REGION_Pos*/) /*!< SAU RNR: REGION Mask */
  751. /* SAU Region Base Address Register Definitions */
  752. #define SAU_RBAR_BADDR_Pos 5U /*!< SAU RBAR: BADDR Position */
  753. #define SAU_RBAR_BADDR_Msk (0x7FFFFFFUL << SAU_RBAR_BADDR_Pos) /*!< SAU RBAR: BADDR Mask */
  754. /* SAU Region Limit Address Register Definitions */
  755. #define SAU_RLAR_LADDR_Pos 5U /*!< SAU RLAR: LADDR Position */
  756. #define SAU_RLAR_LADDR_Msk (0x7FFFFFFUL << SAU_RLAR_LADDR_Pos) /*!< SAU RLAR: LADDR Mask */
  757. #define SAU_RLAR_NSC_Pos 1U /*!< SAU RLAR: NSC Position */
  758. #define SAU_RLAR_NSC_Msk (1UL << SAU_RLAR_NSC_Pos) /*!< SAU RLAR: NSC Mask */
  759. #define SAU_RLAR_ENABLE_Pos 0U /*!< SAU RLAR: ENABLE Position */
  760. #define SAU_RLAR_ENABLE_Msk (1UL /*<< SAU_RLAR_ENABLE_Pos*/) /*!< SAU RLAR: ENABLE Mask */
  761. #endif /* defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) */
  762. /*@} end of group CMSIS_SAU */
  763. #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
  764. /**
  765. \ingroup CMSIS_core_register
  766. \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug)
  767. \brief Type definitions for the Core Debug Registers
  768. @{
  769. */
  770. /**
  771. \brief Structure type to access the Core Debug Register (CoreDebug).
  772. */
  773. typedef struct
  774. {
  775. __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */
  776. __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */
  777. __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */
  778. __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */
  779. uint32_t RESERVED4[1U];
  780. __IOM uint32_t DAUTHCTRL; /*!< Offset: 0x014 (R/W) Debug Authentication Control Register */
  781. __IOM uint32_t DSCSR; /*!< Offset: 0x018 (R/W) Debug Security Control and Status Register */
  782. } CoreDebug_Type;
  783. /* Debug Halting Control and Status Register Definitions */
  784. #define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */
  785. #define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */
  786. #define CoreDebug_DHCSR_S_RESTART_ST_Pos 26U /*!< CoreDebug DHCSR: S_RESTART_ST Position */
  787. #define CoreDebug_DHCSR_S_RESTART_ST_Msk (1UL << CoreDebug_DHCSR_S_RESTART_ST_Pos) /*!< CoreDebug DHCSR: S_RESTART_ST Mask */
  788. #define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */
  789. #define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */
  790. #define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */
  791. #define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */
  792. #define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */
  793. #define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */
  794. #define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */
  795. #define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */
  796. #define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */
  797. #define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */
  798. #define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */
  799. #define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */
  800. #define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */
  801. #define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */
  802. #define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */
  803. #define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */
  804. #define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */
  805. #define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */
  806. #define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */
  807. #define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */
  808. /* Debug Core Register Selector Register Definitions */
  809. #define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */
  810. #define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */
  811. #define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */
  812. #define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */
  813. /* Debug Exception and Monitor Control Register */
  814. #define CoreDebug_DEMCR_DWTENA_Pos 24U /*!< CoreDebug DEMCR: DWTENA Position */
  815. #define CoreDebug_DEMCR_DWTENA_Msk (1UL << CoreDebug_DEMCR_DWTENA_Pos) /*!< CoreDebug DEMCR: DWTENA Mask */
  816. #define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */
  817. #define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */
  818. #define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */
  819. #define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */
  820. /* Debug Authentication Control Register Definitions */
  821. #define CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos 3U /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Position */
  822. #define CoreDebug_DAUTHCTRL_INTSPNIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Mask */
  823. #define CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos 2U /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Position */
  824. #define CoreDebug_DAUTHCTRL_SPNIDENSEL_Msk (1UL << CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos) /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Mask */
  825. #define CoreDebug_DAUTHCTRL_INTSPIDEN_Pos 1U /*!< CoreDebug DAUTHCTRL: INTSPIDEN Position */
  826. #define CoreDebug_DAUTHCTRL_INTSPIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPIDEN Mask */
  827. #define CoreDebug_DAUTHCTRL_SPIDENSEL_Pos 0U /*!< CoreDebug DAUTHCTRL: SPIDENSEL Position */
  828. #define CoreDebug_DAUTHCTRL_SPIDENSEL_Msk (1UL /*<< CoreDebug_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< CoreDebug DAUTHCTRL: SPIDENSEL Mask */
  829. /* Debug Security Control and Status Register Definitions */
  830. #define CoreDebug_DSCSR_CDS_Pos 16U /*!< CoreDebug DSCSR: CDS Position */
  831. #define CoreDebug_DSCSR_CDS_Msk (1UL << CoreDebug_DSCSR_CDS_Pos) /*!< CoreDebug DSCSR: CDS Mask */
  832. #define CoreDebug_DSCSR_SBRSEL_Pos 1U /*!< CoreDebug DSCSR: SBRSEL Position */
  833. #define CoreDebug_DSCSR_SBRSEL_Msk (1UL << CoreDebug_DSCSR_SBRSEL_Pos) /*!< CoreDebug DSCSR: SBRSEL Mask */
  834. #define CoreDebug_DSCSR_SBRSELEN_Pos 0U /*!< CoreDebug DSCSR: SBRSELEN Position */
  835. #define CoreDebug_DSCSR_SBRSELEN_Msk (1UL /*<< CoreDebug_DSCSR_SBRSELEN_Pos*/) /*!< CoreDebug DSCSR: SBRSELEN Mask */
  836. /*@} end of group CMSIS_CoreDebug */
  837. /**
  838. \ingroup CMSIS_core_register
  839. \defgroup CMSIS_core_bitfield Core register bit field macros
  840. \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk).
  841. @{
  842. */
  843. /**
  844. \brief Mask and shift a bit field value for use in a register bit range.
  845. \param[in] field Name of the register bit field.
  846. \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type.
  847. \return Masked and shifted value.
  848. */
  849. #define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk)
  850. /**
  851. \brief Mask and shift a register value to extract a bit filed value.
  852. \param[in] field Name of the register bit field.
  853. \param[in] value Value of register. This parameter is interpreted as an uint32_t type.
  854. \return Masked and shifted bit field value.
  855. */
  856. #define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)
  857. /*@} end of group CMSIS_core_bitfield */
  858. /**
  859. \ingroup CMSIS_core_register
  860. \defgroup CMSIS_core_base Core Definitions
  861. \brief Definitions for base addresses, unions, and structures.
  862. @{
  863. */
  864. /* Memory mapping of Core Hardware */
  865. #define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */
  866. #define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */
  867. #define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */
  868. #define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */
  869. #define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */
  870. #define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */
  871. #define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */
  872. #define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */
  873. #define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */
  874. #define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */
  875. #define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */
  876. #define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */
  877. #define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE ) /*!< Core Debug configuration struct */
  878. #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
  879. #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */
  880. #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */
  881. #endif
  882. #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
  883. #define SAU_BASE (SCS_BASE + 0x0DD0UL) /*!< Security Attribution Unit */
  884. #define SAU ((SAU_Type *) SAU_BASE ) /*!< Security Attribution Unit */
  885. #endif
  886. #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
  887. #define SCS_BASE_NS (0xE002E000UL) /*!< System Control Space Base Address (non-secure address space) */
  888. #define CoreDebug_BASE_NS (0xE002EDF0UL) /*!< Core Debug Base Address (non-secure address space) */
  889. #define SysTick_BASE_NS (SCS_BASE_NS + 0x0010UL) /*!< SysTick Base Address (non-secure address space) */
  890. #define NVIC_BASE_NS (SCS_BASE_NS + 0x0100UL) /*!< NVIC Base Address (non-secure address space) */
  891. #define SCB_BASE_NS (SCS_BASE_NS + 0x0D00UL) /*!< System Control Block Base Address (non-secure address space) */
  892. #define SCB_NS ((SCB_Type *) SCB_BASE_NS ) /*!< SCB configuration struct (non-secure address space) */
  893. #define SysTick_NS ((SysTick_Type *) SysTick_BASE_NS ) /*!< SysTick configuration struct (non-secure address space) */
  894. #define NVIC_NS ((NVIC_Type *) NVIC_BASE_NS ) /*!< NVIC configuration struct (non-secure address space) */
  895. #define CoreDebug_NS ((CoreDebug_Type *) CoreDebug_BASE_NS) /*!< Core Debug configuration struct (non-secure address space) */
  896. #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
  897. #define MPU_BASE_NS (SCS_BASE_NS + 0x0D90UL) /*!< Memory Protection Unit (non-secure address space) */
  898. #define MPU_NS ((MPU_Type *) MPU_BASE_NS ) /*!< Memory Protection Unit (non-secure address space) */
  899. #endif
  900. #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
  901. /*@} */
  902. /*******************************************************************************
  903. * Hardware Abstraction Layer
  904. Core Function Interface contains:
  905. - Core NVIC Functions
  906. - Core SysTick Functions
  907. - Core Register Access Functions
  908. ******************************************************************************/
  909. /**
  910. \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference
  911. */
  912. /* ########################## NVIC functions #################################### */
  913. /**
  914. \ingroup CMSIS_Core_FunctionInterface
  915. \defgroup CMSIS_Core_NVICFunctions NVIC Functions
  916. \brief Functions that manage interrupts and exceptions via the NVIC.
  917. @{
  918. */
  919. #ifdef CMSIS_NVIC_VIRTUAL
  920. #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE
  921. #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"
  922. #endif
  923. #include CMSIS_NVIC_VIRTUAL_HEADER_FILE
  924. #else
  925. #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping
  926. #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping
  927. #define NVIC_EnableIRQ __NVIC_EnableIRQ
  928. #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ
  929. #define NVIC_DisableIRQ __NVIC_DisableIRQ
  930. #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ
  931. #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ
  932. #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ
  933. #define NVIC_GetActive __NVIC_GetActive
  934. #define NVIC_SetPriority __NVIC_SetPriority
  935. #define NVIC_GetPriority __NVIC_GetPriority
  936. #define NVIC_SystemReset __NVIC_SystemReset
  937. #endif /* CMSIS_NVIC_VIRTUAL */
  938. #ifdef CMSIS_VECTAB_VIRTUAL
  939. #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE
  940. #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"
  941. #endif
  942. #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE
  943. #else
  944. #define NVIC_SetVector __NVIC_SetVector
  945. #define NVIC_GetVector __NVIC_GetVector
  946. #endif /* (CMSIS_VECTAB_VIRTUAL) */
  947. #define NVIC_USER_IRQ_OFFSET 16
  948. /* Special LR values for Secure/Non-Secure call handling and exception handling */
  949. /* Function Return Payload (from ARMv8-M Architecture Reference Manual) LR value on entry from Secure BLXNS */
  950. #define FNC_RETURN (0xFEFFFFFFUL) /* bit [0] ignored when processing a branch */
  951. /* The following EXC_RETURN mask values are used to evaluate the LR on exception entry */
  952. #define EXC_RETURN_PREFIX (0xFF000000UL) /* bits [31:24] set to indicate an EXC_RETURN value */
  953. #define EXC_RETURN_S (0x00000040UL) /* bit [6] stack used to push registers: 0=Non-secure 1=Secure */
  954. #define EXC_RETURN_DCRS (0x00000020UL) /* bit [5] stacking rules for called registers: 0=skipped 1=saved */
  955. #define EXC_RETURN_FTYPE (0x00000010UL) /* bit [4] allocate stack for floating-point context: 0=done 1=skipped */
  956. #define EXC_RETURN_MODE (0x00000008UL) /* bit [3] processor mode for return: 0=Handler mode 1=Thread mode */
  957. #define EXC_RETURN_SPSEL (0x00000002UL) /* bit [1] stack pointer used to restore context: 0=MSP 1=PSP */
  958. #define EXC_RETURN_ES (0x00000001UL) /* bit [0] security state exception was taken to: 0=Non-secure 1=Secure */
  959. /* Integrity Signature (from ARMv8-M Architecture Reference Manual) for exception context stacking */
  960. #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) /* Value for processors with floating-point extension: */
  961. #define EXC_INTEGRITY_SIGNATURE (0xFEFA125AUL) /* bit [0] SFTC must match LR bit[4] EXC_RETURN_FTYPE */
  962. #else
  963. #define EXC_INTEGRITY_SIGNATURE (0xFEFA125BUL) /* Value for processors without floating-point extension */
  964. #endif
  965. /* Interrupt Priorities are WORD accessible only under Armv6-M */
  966. /* The following MACROS handle generation of the register offset and byte masks */
  967. #define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL)
  968. #define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) )
  969. #define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) )
  970. #define __NVIC_SetPriorityGrouping(X) (void)(X)
  971. #define __NVIC_GetPriorityGrouping() (0U)
  972. /**
  973. \brief Enable Interrupt
  974. \details Enables a device specific interrupt in the NVIC interrupt controller.
  975. \param [in] IRQn Device specific interrupt number.
  976. \note IRQn must not be negative.
  977. */
  978. __STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)
  979. {
  980. if ((int32_t)(IRQn) >= 0)
  981. {
  982. NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
  983. }
  984. }
  985. /**
  986. \brief Get Interrupt Enable status
  987. \details Returns a device specific interrupt enable status from the NVIC interrupt controller.
  988. \param [in] IRQn Device specific interrupt number.
  989. \return 0 Interrupt is not enabled.
  990. \return 1 Interrupt is enabled.
  991. \note IRQn must not be negative.
  992. */
  993. __STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)
  994. {
  995. if ((int32_t)(IRQn) >= 0)
  996. {
  997. return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
  998. }
  999. else
  1000. {
  1001. return(0U);
  1002. }
  1003. }
  1004. /**
  1005. \brief Disable Interrupt
  1006. \details Disables a device specific interrupt in the NVIC interrupt controller.
  1007. \param [in] IRQn Device specific interrupt number.
  1008. \note IRQn must not be negative.
  1009. */
  1010. __STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)
  1011. {
  1012. if ((int32_t)(IRQn) >= 0)
  1013. {
  1014. NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
  1015. __DSB();
  1016. __ISB();
  1017. }
  1018. }
  1019. /**
  1020. \brief Get Pending Interrupt
  1021. \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.
  1022. \param [in] IRQn Device specific interrupt number.
  1023. \return 0 Interrupt status is not pending.
  1024. \return 1 Interrupt status is pending.
  1025. \note IRQn must not be negative.
  1026. */
  1027. __STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)
  1028. {
  1029. if ((int32_t)(IRQn) >= 0)
  1030. {
  1031. return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
  1032. }
  1033. else
  1034. {
  1035. return(0U);
  1036. }
  1037. }
  1038. /**
  1039. \brief Set Pending Interrupt
  1040. \details Sets the pending bit of a device specific interrupt in the NVIC pending register.
  1041. \param [in] IRQn Device specific interrupt number.
  1042. \note IRQn must not be negative.
  1043. */
  1044. __STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)
  1045. {
  1046. if ((int32_t)(IRQn) >= 0)
  1047. {
  1048. NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
  1049. }
  1050. }
  1051. /**
  1052. \brief Clear Pending Interrupt
  1053. \details Clears the pending bit of a device specific interrupt in the NVIC pending register.
  1054. \param [in] IRQn Device specific interrupt number.
  1055. \note IRQn must not be negative.
  1056. */
  1057. __STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)
  1058. {
  1059. if ((int32_t)(IRQn) >= 0)
  1060. {
  1061. NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
  1062. }
  1063. }
  1064. /**
  1065. \brief Get Active Interrupt
  1066. \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt.
  1067. \param [in] IRQn Device specific interrupt number.
  1068. \return 0 Interrupt status is not active.
  1069. \return 1 Interrupt status is active.
  1070. \note IRQn must not be negative.
  1071. */
  1072. __STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn)
  1073. {
  1074. if ((int32_t)(IRQn) >= 0)
  1075. {
  1076. return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
  1077. }
  1078. else
  1079. {
  1080. return(0U);
  1081. }
  1082. }
  1083. #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
  1084. /**
  1085. \brief Get Interrupt Target State
  1086. \details Reads the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.
  1087. \param [in] IRQn Device specific interrupt number.
  1088. \return 0 if interrupt is assigned to Secure
  1089. \return 1 if interrupt is assigned to Non Secure
  1090. \note IRQn must not be negative.
  1091. */
  1092. __STATIC_INLINE uint32_t NVIC_GetTargetState(IRQn_Type IRQn)
  1093. {
  1094. if ((int32_t)(IRQn) >= 0)
  1095. {
  1096. return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
  1097. }
  1098. else
  1099. {
  1100. return(0U);
  1101. }
  1102. }
  1103. /**
  1104. \brief Set Interrupt Target State
  1105. \details Sets the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.
  1106. \param [in] IRQn Device specific interrupt number.
  1107. \return 0 if interrupt is assigned to Secure
  1108. 1 if interrupt is assigned to Non Secure
  1109. \note IRQn must not be negative.
  1110. */
  1111. __STATIC_INLINE uint32_t NVIC_SetTargetState(IRQn_Type IRQn)
  1112. {
  1113. if ((int32_t)(IRQn) >= 0)
  1114. {
  1115. NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)));
  1116. return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
  1117. }
  1118. else
  1119. {
  1120. return(0U);
  1121. }
  1122. }
  1123. /**
  1124. \brief Clear Interrupt Target State
  1125. \details Clears the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.
  1126. \param [in] IRQn Device specific interrupt number.
  1127. \return 0 if interrupt is assigned to Secure
  1128. 1 if interrupt is assigned to Non Secure
  1129. \note IRQn must not be negative.
  1130. */
  1131. __STATIC_INLINE uint32_t NVIC_ClearTargetState(IRQn_Type IRQn)
  1132. {
  1133. if ((int32_t)(IRQn) >= 0)
  1134. {
  1135. NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)));
  1136. return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
  1137. }
  1138. else
  1139. {
  1140. return(0U);
  1141. }
  1142. }
  1143. #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
  1144. /**
  1145. \brief Set Interrupt Priority
  1146. \details Sets the priority of a device specific interrupt or a processor exception.
  1147. The interrupt number can be positive to specify a device specific interrupt,
  1148. or negative to specify a processor exception.
  1149. \param [in] IRQn Interrupt number.
  1150. \param [in] priority Priority to set.
  1151. \note The priority cannot be set for every processor exception.
  1152. */
  1153. __STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
  1154. {
  1155. if ((int32_t)(IRQn) >= 0)
  1156. {
  1157. NVIC->IPR[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IPR[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |
  1158. (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));
  1159. }
  1160. else
  1161. {
  1162. SCB->SHPR[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHPR[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |
  1163. (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));
  1164. }
  1165. }
  1166. /**
  1167. \brief Get Interrupt Priority
  1168. \details Reads the priority of a device specific interrupt or a processor exception.
  1169. The interrupt number can be positive to specify a device specific interrupt,
  1170. or negative to specify a processor exception.
  1171. \param [in] IRQn Interrupt number.
  1172. \return Interrupt Priority.
  1173. Value is aligned automatically to the implemented priority bits of the microcontroller.
  1174. */
  1175. __STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)
  1176. {
  1177. if ((int32_t)(IRQn) >= 0)
  1178. {
  1179. return((uint32_t)(((NVIC->IPR[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));
  1180. }
  1181. else
  1182. {
  1183. return((uint32_t)(((SCB->SHPR[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));
  1184. }
  1185. }
  1186. /**
  1187. \brief Encode Priority
  1188. \details Encodes the priority for an interrupt with the given priority group,
  1189. preemptive priority value, and subpriority value.
  1190. In case of a conflict between priority grouping and available
  1191. priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.
  1192. \param [in] PriorityGroup Used priority group.
  1193. \param [in] PreemptPriority Preemptive priority value (starting from 0).
  1194. \param [in] SubPriority Subpriority value (starting from 0).
  1195. \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority().
  1196. */
  1197. __STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
  1198. {
  1199. uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
  1200. uint32_t PreemptPriorityBits;
  1201. uint32_t SubPriorityBits;
  1202. PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
  1203. SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
  1204. return (
  1205. ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |
  1206. ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL)))
  1207. );
  1208. }
  1209. /**
  1210. \brief Decode Priority
  1211. \details Decodes an interrupt priority value with a given priority group to
  1212. preemptive priority value and subpriority value.
  1213. In case of a conflict between priority grouping and available
  1214. priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.
  1215. \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority().
  1216. \param [in] PriorityGroup Used priority group.
  1217. \param [out] pPreemptPriority Preemptive priority value (starting from 0).
  1218. \param [out] pSubPriority Subpriority value (starting from 0).
  1219. */
  1220. __STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)
  1221. {
  1222. uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
  1223. uint32_t PreemptPriorityBits;
  1224. uint32_t SubPriorityBits;
  1225. PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
  1226. SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
  1227. *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);
  1228. *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL);
  1229. }
  1230. /**
  1231. \brief Set Interrupt Vector
  1232. \details Sets an interrupt vector in SRAM based interrupt vector table.
  1233. The interrupt number can be positive to specify a device specific interrupt,
  1234. or negative to specify a processor exception.
  1235. VTOR must been relocated to SRAM before.
  1236. If VTOR is not present address 0 must be mapped to SRAM.
  1237. \param [in] IRQn Interrupt number
  1238. \param [in] vector Address of interrupt handler function
  1239. */
  1240. __STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
  1241. {
  1242. #if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)
  1243. uint32_t *vectors = (uint32_t *)SCB->VTOR;
  1244. #else
  1245. uint32_t *vectors = (uint32_t *)0x0U;
  1246. #endif
  1247. vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;
  1248. }
  1249. /**
  1250. \brief Get Interrupt Vector
  1251. \details Reads an interrupt vector from interrupt vector table.
  1252. The interrupt number can be positive to specify a device specific interrupt,
  1253. or negative to specify a processor exception.
  1254. \param [in] IRQn Interrupt number.
  1255. \return Address of interrupt handler function
  1256. */
  1257. __STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)
  1258. {
  1259. #if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)
  1260. uint32_t *vectors = (uint32_t *)SCB->VTOR;
  1261. #else
  1262. uint32_t *vectors = (uint32_t *)0x0U;
  1263. #endif
  1264. return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];
  1265. }
  1266. /**
  1267. \brief System Reset
  1268. \details Initiates a system reset request to reset the MCU.
  1269. */
  1270. __NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)
  1271. {
  1272. __DSB(); /* Ensure all outstanding memory accesses included
  1273. buffered write are completed before reset */
  1274. SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
  1275. SCB_AIRCR_SYSRESETREQ_Msk);
  1276. __DSB(); /* Ensure completion of memory access */
  1277. for(;;) /* wait until reset */
  1278. {
  1279. __NOP();
  1280. }
  1281. }
  1282. #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
  1283. /**
  1284. \brief Enable Interrupt (non-secure)
  1285. \details Enables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state.
  1286. \param [in] IRQn Device specific interrupt number.
  1287. \note IRQn must not be negative.
  1288. */
  1289. __STATIC_INLINE void TZ_NVIC_EnableIRQ_NS(IRQn_Type IRQn)
  1290. {
  1291. if ((int32_t)(IRQn) >= 0)
  1292. {
  1293. NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
  1294. }
  1295. }
  1296. /**
  1297. \brief Get Interrupt Enable status (non-secure)
  1298. \details Returns a device specific interrupt enable status from the non-secure NVIC interrupt controller when in secure state.
  1299. \param [in] IRQn Device specific interrupt number.
  1300. \return 0 Interrupt is not enabled.
  1301. \return 1 Interrupt is enabled.
  1302. \note IRQn must not be negative.
  1303. */
  1304. __STATIC_INLINE uint32_t TZ_NVIC_GetEnableIRQ_NS(IRQn_Type IRQn)
  1305. {
  1306. if ((int32_t)(IRQn) >= 0)
  1307. {
  1308. return((uint32_t)(((NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
  1309. }
  1310. else
  1311. {
  1312. return(0U);
  1313. }
  1314. }
  1315. /**
  1316. \brief Disable Interrupt (non-secure)
  1317. \details Disables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state.
  1318. \param [in] IRQn Device specific interrupt number.
  1319. \note IRQn must not be negative.
  1320. */
  1321. __STATIC_INLINE void TZ_NVIC_DisableIRQ_NS(IRQn_Type IRQn)
  1322. {
  1323. if ((int32_t)(IRQn) >= 0)
  1324. {
  1325. NVIC_NS->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
  1326. }
  1327. }
  1328. /**
  1329. \brief Get Pending Interrupt (non-secure)
  1330. \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.
  1331. \param [in] IRQn Device specific interrupt number.
  1332. \return 0 Interrupt status is not pending.
  1333. \return 1 Interrupt status is pending.
  1334. \note IRQn must not be negative.
  1335. */
  1336. __STATIC_INLINE uint32_t TZ_NVIC_GetPendingIRQ_NS(IRQn_Type IRQn)
  1337. {
  1338. if ((int32_t)(IRQn) >= 0)
  1339. {
  1340. return((uint32_t)(((NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
  1341. }
  1342. else
  1343. {
  1344. return(0U);
  1345. }
  1346. }
  1347. /**
  1348. \brief Set Pending Interrupt (non-secure)
  1349. \details Sets the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state.
  1350. \param [in] IRQn Device specific interrupt number.
  1351. \note IRQn must not be negative.
  1352. */
  1353. __STATIC_INLINE void TZ_NVIC_SetPendingIRQ_NS(IRQn_Type IRQn)
  1354. {
  1355. if ((int32_t)(IRQn) >= 0)
  1356. {
  1357. NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
  1358. }
  1359. }
  1360. /**
  1361. \brief Clear Pending Interrupt (non-secure)
  1362. \details Clears the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state.
  1363. \param [in] IRQn Device specific interrupt number.
  1364. \note IRQn must not be negative.
  1365. */
  1366. __STATIC_INLINE void TZ_NVIC_ClearPendingIRQ_NS(IRQn_Type IRQn)
  1367. {
  1368. if ((int32_t)(IRQn) >= 0)
  1369. {
  1370. NVIC_NS->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
  1371. }
  1372. }
  1373. /**
  1374. \brief Get Active Interrupt (non-secure)
  1375. \details Reads the active register in non-secure NVIC when in secure state and returns the active bit for the device specific interrupt.
  1376. \param [in] IRQn Device specific interrupt number.
  1377. \return 0 Interrupt status is not active.
  1378. \return 1 Interrupt status is active.
  1379. \note IRQn must not be negative.
  1380. */
  1381. __STATIC_INLINE uint32_t TZ_NVIC_GetActive_NS(IRQn_Type IRQn)
  1382. {
  1383. if ((int32_t)(IRQn) >= 0)
  1384. {
  1385. return((uint32_t)(((NVIC_NS->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
  1386. }
  1387. else
  1388. {
  1389. return(0U);
  1390. }
  1391. }
  1392. /**
  1393. \brief Set Interrupt Priority (non-secure)
  1394. \details Sets the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state.
  1395. The interrupt number can be positive to specify a device specific interrupt,
  1396. or negative to specify a processor exception.
  1397. \param [in] IRQn Interrupt number.
  1398. \param [in] priority Priority to set.
  1399. \note The priority cannot be set for every non-secure processor exception.
  1400. */
  1401. __STATIC_INLINE void TZ_NVIC_SetPriority_NS(IRQn_Type IRQn, uint32_t priority)
  1402. {
  1403. if ((int32_t)(IRQn) >= 0)
  1404. {
  1405. NVIC_NS->IPR[_IP_IDX(IRQn)] = ((uint32_t)(NVIC_NS->IPR[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |
  1406. (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));
  1407. }
  1408. else
  1409. {
  1410. SCB_NS->SHPR[_SHP_IDX(IRQn)] = ((uint32_t)(SCB_NS->SHPR[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |
  1411. (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));
  1412. }
  1413. }
  1414. /**
  1415. \brief Get Interrupt Priority (non-secure)
  1416. \details Reads the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state.
  1417. The interrupt number can be positive to specify a device specific interrupt,
  1418. or negative to specify a processor exception.
  1419. \param [in] IRQn Interrupt number.
  1420. \return Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller.
  1421. */
  1422. __STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn)
  1423. {
  1424. if ((int32_t)(IRQn) >= 0)
  1425. {
  1426. return((uint32_t)(((NVIC_NS->IPR[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));
  1427. }
  1428. else
  1429. {
  1430. return((uint32_t)(((SCB_NS->SHPR[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));
  1431. }
  1432. }
  1433. #endif /* defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */
  1434. /*@} end of CMSIS_Core_NVICFunctions */
  1435. /* ########################## MPU functions #################################### */
  1436. #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
  1437. #include "mpu_armv8.h"
  1438. #endif
  1439. /* ########################## FPU functions #################################### */
  1440. /**
  1441. \ingroup CMSIS_Core_FunctionInterface
  1442. \defgroup CMSIS_Core_FpuFunctions FPU Functions
  1443. \brief Function that provides FPU type.
  1444. @{
  1445. */
  1446. /**
  1447. \brief get FPU type
  1448. \details returns the FPU type
  1449. \returns
  1450. - \b 0: No FPU
  1451. - \b 1: Single precision FPU
  1452. - \b 2: Double + Single precision FPU
  1453. */
  1454. __STATIC_INLINE uint32_t SCB_GetFPUType(void)
  1455. {
  1456. return 0U; /* No FPU */
  1457. }
  1458. /*@} end of CMSIS_Core_FpuFunctions */
  1459. /* ########################## SAU functions #################################### */
  1460. /**
  1461. \ingroup CMSIS_Core_FunctionInterface
  1462. \defgroup CMSIS_Core_SAUFunctions SAU Functions
  1463. \brief Functions that configure the SAU.
  1464. @{
  1465. */
  1466. #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
  1467. /**
  1468. \brief Enable SAU
  1469. \details Enables the Security Attribution Unit (SAU).
  1470. */
  1471. __STATIC_INLINE void TZ_SAU_Enable(void)
  1472. {
  1473. SAU->CTRL |= (SAU_CTRL_ENABLE_Msk);
  1474. }
  1475. /**
  1476. \brief Disable SAU
  1477. \details Disables the Security Attribution Unit (SAU).
  1478. */
  1479. __STATIC_INLINE void TZ_SAU_Disable(void)
  1480. {
  1481. SAU->CTRL &= ~(SAU_CTRL_ENABLE_Msk);
  1482. }
  1483. #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
  1484. /*@} end of CMSIS_Core_SAUFunctions */
  1485. /* ################################## SysTick function ############################################ */
  1486. /**
  1487. \ingroup CMSIS_Core_FunctionInterface
  1488. \defgroup CMSIS_Core_SysTickFunctions SysTick Functions
  1489. \brief Functions that configure the System.
  1490. @{
  1491. */
  1492. #if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)
  1493. /**
  1494. \brief System Tick Configuration
  1495. \details Initializes the System Timer and its interrupt, and starts the System Tick Timer.
  1496. Counter is in free running mode to generate periodic interrupts.
  1497. \param [in] ticks Number of ticks between two interrupts.
  1498. \return 0 Function succeeded.
  1499. \return 1 Function failed.
  1500. \note When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the
  1501. function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>
  1502. must contain a vendor-specific implementation of this function.
  1503. */
  1504. __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
  1505. {
  1506. if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)
  1507. {
  1508. return (1UL); /* Reload value impossible */
  1509. }
  1510. SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
  1511. NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
  1512. SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
  1513. SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
  1514. SysTick_CTRL_TICKINT_Msk |
  1515. SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
  1516. return (0UL); /* Function successful */
  1517. }
  1518. #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
  1519. /**
  1520. \brief System Tick Configuration (non-secure)
  1521. \details Initializes the non-secure System Timer and its interrupt when in secure state, and starts the System Tick Timer.
  1522. Counter is in free running mode to generate periodic interrupts.
  1523. \param [in] ticks Number of ticks between two interrupts.
  1524. \return 0 Function succeeded.
  1525. \return 1 Function failed.
  1526. \note When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the
  1527. function <b>TZ_SysTick_Config_NS</b> is not included. In this case, the file <b><i>device</i>.h</b>
  1528. must contain a vendor-specific implementation of this function.
  1529. */
  1530. __STATIC_INLINE uint32_t TZ_SysTick_Config_NS(uint32_t ticks)
  1531. {
  1532. if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)
  1533. {
  1534. return (1UL); /* Reload value impossible */
  1535. }
  1536. SysTick_NS->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
  1537. TZ_NVIC_SetPriority_NS (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
  1538. SysTick_NS->VAL = 0UL; /* Load the SysTick Counter Value */
  1539. SysTick_NS->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
  1540. SysTick_CTRL_TICKINT_Msk |
  1541. SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
  1542. return (0UL); /* Function successful */
  1543. }
  1544. #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
  1545. #endif
  1546. /*@} end of CMSIS_Core_SysTickFunctions */
  1547. #ifdef __cplusplus
  1548. }
  1549. #endif
  1550. #endif /* __CORE_ARMV8MBL_H_DEPENDANT */
  1551. #endif /* __CMSIS_GENERIC */