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