]> begriffs open source - cmsis/blob - CMSIS/Core/Include/core_cm23.h
Fix CodeQL issues
[cmsis] / CMSIS / Core / Include / core_cm23.h
1 /**************************************************************************//**
2  * @file     core_cm23.h
3  * @brief    CMSIS Cortex-M23 Core Peripheral Access Layer Header File
4  * @version  V5.2.0
5  * @date     04. April 2023
6  ******************************************************************************/
7 /*
8  * Copyright (c) 2009-2023 Arm Limited. All rights reserved.
9  *
10  * SPDX-License-Identifier: Apache-2.0
11  *
12  * Licensed under the Apache License, Version 2.0 (the License); you may
13  * not use this file except in compliance with the License.
14  * You may obtain a copy of the License at
15  *
16  * www.apache.org/licenses/LICENSE-2.0
17  *
18  * Unless required by applicable law or agreed to in writing, software
19  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
20  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  * See the License for the specific language governing permissions and
22  * limitations under the License.
23  */
24
25 #if   defined ( __ICCARM__ )
26   #pragma system_include                        /* treat file as system include file for MISRA check */
27 #elif defined (__clang__)
28   #pragma clang system_header                   /* treat file as system include file */
29 #elif defined ( __GNUC__ )
30   #pragma GCC diagnostic ignored "-Wpedantic"   /* disable pedantic warning due to unnamed structs/unions */
31 #endif
32
33 #ifndef __CORE_CM23_H_GENERIC
34 #define __CORE_CM23_H_GENERIC
35
36 #include <stdint.h>
37
38 #ifdef __cplusplus
39  extern "C" {
40 #endif
41
42 /**
43   \page CMSIS_MISRA_Exceptions  MISRA-C:2004 Compliance Exceptions
44   CMSIS violates the following MISRA-C:2004 rules:
45
46    \li Required Rule 8.5, object/function definition in header file.<br>
47      Function definitions in header files are used to allow 'inlining'.
48
49    \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>
50      Unions are used for effective representation of core registers.
51
52    \li Advisory Rule 19.7, Function-like macro defined.<br>
53      Function-like macros are used to allow more efficient code.
54  */
55
56
57 /*******************************************************************************
58  *                 CMSIS definitions
59  ******************************************************************************/
60 /**
61   \ingroup Cortex_M23
62   @{
63  */
64
65 #include "cmsis_version.h"
66
67 /* CMSIS CM23 definitions */
68
69 #define __CORTEX_M                 (23U)                                       /*!< Cortex-M Core */
70
71 /** __FPU_USED indicates whether an FPU is used or not.
72     This core does not support an FPU at all
73 */
74 #define __FPU_USED       0U
75
76 #if defined ( __CC_ARM )
77   #if defined __TARGET_FPU_VFP
78     #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
79   #endif
80
81 #elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
82   #if defined __ARM_FP
83     #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
84   #endif
85
86 #elif defined (__ti__)
87   #if defined __ARM_FP
88     #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
89   #endif
90
91 #elif defined ( __GNUC__ )
92   #if defined (__VFP_FP__) && !defined(__SOFTFP__)
93     #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
94   #endif
95
96 #elif defined ( __ICCARM__ )
97   #if defined __ARMVFP__
98     #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
99   #endif
100
101 #elif defined ( __TI_ARM__ )
102   #if defined __TI_VFP_SUPPORT__
103     #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
104   #endif
105
106 #elif defined ( __TASKING__ )
107   #if defined __FPU_VFP__
108     #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
109   #endif
110
111 #elif defined ( __CSMC__ )
112   #if ( __CSMC__ & 0x400U)
113     #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
114   #endif
115
116 #endif
117
118 #include "cmsis_compiler.h"               /* CMSIS compiler specific defines */
119
120
121 #ifdef __cplusplus
122 }
123 #endif
124
125 #endif /* __CORE_CM23_H_GENERIC */
126
127 #ifndef __CMSIS_GENERIC
128
129 #ifndef __CORE_CM23_H_DEPENDANT
130 #define __CORE_CM23_H_DEPENDANT
131
132 #ifdef __cplusplus
133  extern "C" {
134 #endif
135
136 /* check device defines and use defaults */
137 #if defined __CHECK_DEVICE_DEFINES
138   #ifndef __CM23_REV
139     #define __CM23_REV                0x0000U
140     #warning "__CM23_REV not defined in device header file; using default!"
141   #endif
142
143   #ifndef __FPU_PRESENT
144     #define __FPU_PRESENT             0U
145     #warning "__FPU_PRESENT not defined in device header file; using default!"
146   #endif
147
148   #ifndef __MPU_PRESENT
149     #define __MPU_PRESENT             0U
150     #warning "__MPU_PRESENT not defined in device header file; using default!"
151   #endif
152
153   #ifndef __SAUREGION_PRESENT
154     #define __SAUREGION_PRESENT       0U
155     #warning "__SAUREGION_PRESENT not defined in device header file; using default!"
156   #endif
157
158   #ifndef __VTOR_PRESENT
159     #define __VTOR_PRESENT            0U
160     #warning "__VTOR_PRESENT not defined in device header file; using default!"
161   #endif
162
163   #ifndef __NVIC_PRIO_BITS
164     #define __NVIC_PRIO_BITS          2U
165     #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"
166   #endif
167
168   #ifndef __Vendor_SysTickConfig
169     #define __Vendor_SysTickConfig    0U
170     #warning "__Vendor_SysTickConfig not defined in device header file; using default!"
171   #endif
172
173   #ifndef __ETM_PRESENT
174     #define __ETM_PRESENT             0U
175     #warning "__ETM_PRESENT not defined in device header file; using default!"
176   #endif
177
178   #ifndef __MTB_PRESENT
179     #define __MTB_PRESENT             0U
180     #warning "__MTB_PRESENT not defined in device header file; using default!"
181   #endif
182
183 #endif
184
185 /* IO definitions (access restrictions to peripheral registers) */
186 /**
187     \defgroup CMSIS_glob_defs CMSIS Global Defines
188
189     <strong>IO Type Qualifiers</strong> are used
190     \li to specify the access to peripheral variables.
191     \li for automatic generation of peripheral register debug information.
192 */
193 #ifdef __cplusplus
194   #define   __I     volatile             /*!< Defines 'read only' permissions */
195 #else
196   #define   __I     volatile const       /*!< Defines 'read only' permissions */
197 #endif
198 #define     __O     volatile             /*!< Defines 'write only' permissions */
199 #define     __IO    volatile             /*!< Defines 'read / write' permissions */
200
201 /* following defines should be used for structure members */
202 #define     __IM     volatile const      /*! Defines 'read only' structure member permissions */
203 #define     __OM     volatile            /*! Defines 'write only' structure member permissions */
204 #define     __IOM    volatile            /*! Defines 'read / write' structure member permissions */
205
206 /*@} end of group Cortex_M23 */
207
208
209
210 /*******************************************************************************
211  *                 Register Abstraction
212   Core Register contain:
213   - Core Register
214   - Core NVIC Register
215   - Core SCB Register
216   - Core SysTick Register
217   - Core Debug Register
218   - Core MPU Register
219   - Core SAU Register
220  ******************************************************************************/
221 /**
222   \defgroup CMSIS_core_register Defines and Type Definitions
223   \brief Type definitions and defines for Cortex-M processor based devices.
224 */
225
226 /**
227   \ingroup    CMSIS_core_register
228   \defgroup   CMSIS_CORE  Status and Control Registers
229   \brief      Core Register type definitions.
230   @{
231  */
232
233 /**
234   \brief  Union type to access the Application Program Status Register (APSR).
235  */
236 typedef union
237 {
238   struct
239   {
240     uint32_t _reserved0:28;              /*!< bit:  0..27  Reserved */
241     uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */
242     uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */
243     uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */
244     uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */
245   } b;                                   /*!< Structure used for bit  access */
246   uint32_t w;                            /*!< Type      used for word access */
247 } APSR_Type;
248
249 /* APSR Register Definitions */
250 #define APSR_N_Pos                         31U                                            /*!< APSR: N Position */
251 #define APSR_N_Msk                         (1UL << APSR_N_Pos)                            /*!< APSR: N Mask */
252
253 #define APSR_Z_Pos                         30U                                            /*!< APSR: Z Position */
254 #define APSR_Z_Msk                         (1UL << APSR_Z_Pos)                            /*!< APSR: Z Mask */
255
256 #define APSR_C_Pos                         29U                                            /*!< APSR: C Position */
257 #define APSR_C_Msk                         (1UL << APSR_C_Pos)                            /*!< APSR: C Mask */
258
259 #define APSR_V_Pos                         28U                                            /*!< APSR: V Position */
260 #define APSR_V_Msk                         (1UL << APSR_V_Pos)                            /*!< APSR: V Mask */
261
262
263 /**
264   \brief  Union type to access the Interrupt Program Status Register (IPSR).
265  */
266 typedef union
267 {
268   struct
269   {
270     uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */
271     uint32_t _reserved0:23;              /*!< bit:  9..31  Reserved */
272   } b;                                   /*!< Structure used for bit  access */
273   uint32_t w;                            /*!< Type      used for word access */
274 } IPSR_Type;
275
276 /* IPSR Register Definitions */
277 #define IPSR_ISR_Pos                        0U                                            /*!< IPSR: ISR Position */
278 #define IPSR_ISR_Msk                       (0x1FFUL /*<< IPSR_ISR_Pos*/)                  /*!< IPSR: ISR Mask */
279
280
281 /**
282   \brief  Union type to access the Special-Purpose Program Status Registers (xPSR).
283  */
284 typedef union
285 {
286   struct
287   {
288     uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */
289     uint32_t _reserved0:15;              /*!< bit:  9..23  Reserved */
290     uint32_t T:1;                        /*!< bit:     24  Thumb bit        (read 0) */
291     uint32_t _reserved1:3;               /*!< bit: 25..27  Reserved */
292     uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */
293     uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */
294     uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */
295     uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */
296   } b;                                   /*!< Structure used for bit  access */
297   uint32_t w;                            /*!< Type      used for word access */
298 } xPSR_Type;
299
300 /* xPSR Register Definitions */
301 #define xPSR_N_Pos                         31U                                            /*!< xPSR: N Position */
302 #define xPSR_N_Msk                         (1UL << xPSR_N_Pos)                            /*!< xPSR: N Mask */
303
304 #define xPSR_Z_Pos                         30U                                            /*!< xPSR: Z Position */
305 #define xPSR_Z_Msk                         (1UL << xPSR_Z_Pos)                            /*!< xPSR: Z Mask */
306
307 #define xPSR_C_Pos                         29U                                            /*!< xPSR: C Position */
308 #define xPSR_C_Msk                         (1UL << xPSR_C_Pos)                            /*!< xPSR: C Mask */
309
310 #define xPSR_V_Pos                         28U                                            /*!< xPSR: V Position */
311 #define xPSR_V_Msk                         (1UL << xPSR_V_Pos)                            /*!< xPSR: V Mask */
312
313 #define xPSR_T_Pos                         24U                                            /*!< xPSR: T Position */
314 #define xPSR_T_Msk                         (1UL << xPSR_T_Pos)                            /*!< xPSR: T Mask */
315
316 #define xPSR_ISR_Pos                        0U                                            /*!< xPSR: ISR Position */
317 #define xPSR_ISR_Msk                       (0x1FFUL /*<< xPSR_ISR_Pos*/)                  /*!< xPSR: ISR Mask */
318
319
320 /**
321   \brief  Union type to access the Control Registers (CONTROL).
322  */
323 typedef union
324 {
325   struct
326   {
327     uint32_t nPRIV:1;                    /*!< bit:      0  Execution privilege in Thread mode */
328     uint32_t SPSEL:1;                    /*!< bit:      1  Stack-pointer select */
329     uint32_t _reserved1:30;              /*!< bit:  2..31  Reserved */
330   } b;                                   /*!< Structure used for bit  access */
331   uint32_t w;                            /*!< Type      used for word access */
332 } CONTROL_Type;
333
334 /* CONTROL Register Definitions */
335 #define CONTROL_SPSEL_Pos                   1U                                            /*!< CONTROL: SPSEL Position */
336 #define CONTROL_SPSEL_Msk                  (1UL << CONTROL_SPSEL_Pos)                     /*!< CONTROL: SPSEL Mask */
337
338 #define CONTROL_nPRIV_Pos                   0U                                            /*!< CONTROL: nPRIV Position */
339 #define CONTROL_nPRIV_Msk                  (1UL /*<< CONTROL_nPRIV_Pos*/)                 /*!< CONTROL: nPRIV Mask */
340
341 /*@} end of group CMSIS_CORE */
342
343
344 /**
345   \ingroup    CMSIS_core_register
346   \defgroup   CMSIS_NVIC  Nested Vectored Interrupt Controller (NVIC)
347   \brief      Type definitions for the NVIC Registers
348   @{
349  */
350
351 /**
352   \brief  Structure type to access the Nested Vectored Interrupt Controller (NVIC).
353  */
354 typedef struct
355 {
356   __IOM uint32_t ISER[16U];              /*!< Offset: 0x000 (R/W)  Interrupt Set Enable Register */
357         uint32_t RESERVED0[16U];
358   __IOM uint32_t ICER[16U];              /*!< Offset: 0x080 (R/W)  Interrupt Clear Enable Register */
359         uint32_t RSERVED1[16U];
360   __IOM uint32_t ISPR[16U];              /*!< Offset: 0x100 (R/W)  Interrupt Set Pending Register */
361         uint32_t RESERVED2[16U];
362   __IOM uint32_t ICPR[16U];              /*!< Offset: 0x180 (R/W)  Interrupt Clear Pending Register */
363         uint32_t RESERVED3[16U];
364   __IOM uint32_t IABR[16U];              /*!< Offset: 0x200 (R/W)  Interrupt Active bit Register */
365         uint32_t RESERVED4[16U];
366   __IOM uint32_t ITNS[16U];              /*!< Offset: 0x280 (R/W)  Interrupt Non-Secure State Register */
367         uint32_t RESERVED5[16U];
368   __IOM uint32_t IPR[124U];              /*!< Offset: 0x300 (R/W)  Interrupt Priority Register */
369 }  NVIC_Type;
370
371 /*@} end of group CMSIS_NVIC */
372
373
374 /**
375   \ingroup  CMSIS_core_register
376   \defgroup CMSIS_SCB     System Control Block (SCB)
377   \brief    Type definitions for the System Control Block Registers
378   @{
379  */
380
381 /**
382   \brief  Structure type to access the System Control Block (SCB).
383  */
384 typedef struct
385 {
386   __IM  uint32_t CPUID;                  /*!< Offset: 0x000 (R/ )  CPUID Base Register */
387   __IOM uint32_t ICSR;                   /*!< Offset: 0x004 (R/W)  Interrupt Control and State Register */
388 #if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)
389   __IOM uint32_t VTOR;                   /*!< Offset: 0x008 (R/W)  Vector Table Offset Register */
390 #else
391         uint32_t RESERVED0;
392 #endif
393   __IOM uint32_t AIRCR;                  /*!< Offset: 0x00C (R/W)  Application Interrupt and Reset Control Register */
394   __IOM uint32_t SCR;                    /*!< Offset: 0x010 (R/W)  System Control Register */
395   __IOM uint32_t CCR;                    /*!< Offset: 0x014 (R/W)  Configuration Control Register */
396         uint32_t RESERVED1;
397   __IOM uint32_t SHPR[2U];               /*!< Offset: 0x01C (R/W)  System Handlers Priority Registers. [0] is RESERVED */
398   __IOM uint32_t SHCSR;                  /*!< Offset: 0x024 (R/W)  System Handler Control and State Register */
399 } SCB_Type;
400
401 /* SCB CPUID Register Definitions */
402 #define SCB_CPUID_IMPLEMENTER_Pos          24U                                            /*!< SCB CPUID: IMPLEMENTER Position */
403 #define SCB_CPUID_IMPLEMENTER_Msk          (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos)          /*!< SCB CPUID: IMPLEMENTER Mask */
404
405 #define SCB_CPUID_VARIANT_Pos              20U                                            /*!< SCB CPUID: VARIANT Position */
406 #define SCB_CPUID_VARIANT_Msk              (0xFUL << SCB_CPUID_VARIANT_Pos)               /*!< SCB CPUID: VARIANT Mask */
407
408 #define SCB_CPUID_ARCHITECTURE_Pos         16U                                            /*!< SCB CPUID: ARCHITECTURE Position */
409 #define SCB_CPUID_ARCHITECTURE_Msk         (0xFUL << SCB_CPUID_ARCHITECTURE_Pos)          /*!< SCB CPUID: ARCHITECTURE Mask */
410
411 #define SCB_CPUID_PARTNO_Pos                4U                                            /*!< SCB CPUID: PARTNO Position */
412 #define SCB_CPUID_PARTNO_Msk               (0xFFFUL << SCB_CPUID_PARTNO_Pos)              /*!< SCB CPUID: PARTNO Mask */
413
414 #define SCB_CPUID_REVISION_Pos              0U                                            /*!< SCB CPUID: REVISION Position */
415 #define SCB_CPUID_REVISION_Msk             (0xFUL /*<< SCB_CPUID_REVISION_Pos*/)          /*!< SCB CPUID: REVISION Mask */
416
417 /* SCB Interrupt Control State Register Definitions */
418 #define SCB_ICSR_PENDNMISET_Pos            31U                                            /*!< SCB ICSR: PENDNMISET Position */
419 #define SCB_ICSR_PENDNMISET_Msk            (1UL << SCB_ICSR_PENDNMISET_Pos)               /*!< SCB ICSR: PENDNMISET Mask */
420
421 #define SCB_ICSR_NMIPENDSET_Pos            SCB_ICSR_PENDNMISET_Pos                        /*!< SCB ICSR: NMIPENDSET Position, backward compatibility */
422 #define SCB_ICSR_NMIPENDSET_Msk            SCB_ICSR_PENDNMISET_Msk                        /*!< SCB ICSR: NMIPENDSET Mask, backward compatibility */
423
424 #define SCB_ICSR_PENDNMICLR_Pos            30U                                            /*!< SCB ICSR: PENDNMICLR Position */
425 #define SCB_ICSR_PENDNMICLR_Msk            (1UL << SCB_ICSR_PENDNMICLR_Pos)               /*!< SCB ICSR: PENDNMICLR Mask */
426
427 #define SCB_ICSR_PENDSVSET_Pos             28U                                            /*!< SCB ICSR: PENDSVSET Position */
428 #define SCB_ICSR_PENDSVSET_Msk             (1UL << SCB_ICSR_PENDSVSET_Pos)                /*!< SCB ICSR: PENDSVSET Mask */
429
430 #define SCB_ICSR_PENDSVCLR_Pos             27U                                            /*!< SCB ICSR: PENDSVCLR Position */
431 #define SCB_ICSR_PENDSVCLR_Msk             (1UL << SCB_ICSR_PENDSVCLR_Pos)                /*!< SCB ICSR: PENDSVCLR Mask */
432
433 #define SCB_ICSR_PENDSTSET_Pos             26U                                            /*!< SCB ICSR: PENDSTSET Position */
434 #define SCB_ICSR_PENDSTSET_Msk             (1UL << SCB_ICSR_PENDSTSET_Pos)                /*!< SCB ICSR: PENDSTSET Mask */
435
436 #define SCB_ICSR_PENDSTCLR_Pos             25U                                            /*!< SCB ICSR: PENDSTCLR Position */
437 #define SCB_ICSR_PENDSTCLR_Msk             (1UL << SCB_ICSR_PENDSTCLR_Pos)                /*!< SCB ICSR: PENDSTCLR Mask */
438
439 #define SCB_ICSR_STTNS_Pos                 24U                                            /*!< SCB ICSR: STTNS Position (Security Extension) */
440 #define SCB_ICSR_STTNS_Msk                 (1UL << SCB_ICSR_STTNS_Pos)                    /*!< SCB ICSR: STTNS Mask (Security Extension) */
441
442 #define SCB_ICSR_ISRPREEMPT_Pos            23U                                            /*!< SCB ICSR: ISRPREEMPT Position */
443 #define SCB_ICSR_ISRPREEMPT_Msk            (1UL << SCB_ICSR_ISRPREEMPT_Pos)               /*!< SCB ICSR: ISRPREEMPT Mask */
444
445 #define SCB_ICSR_ISRPENDING_Pos            22U                                            /*!< SCB ICSR: ISRPENDING Position */
446 #define SCB_ICSR_ISRPENDING_Msk            (1UL << SCB_ICSR_ISRPENDING_Pos)               /*!< SCB ICSR: ISRPENDING Mask */
447
448 #define SCB_ICSR_VECTPENDING_Pos           12U                                            /*!< SCB ICSR: VECTPENDING Position */
449 #define SCB_ICSR_VECTPENDING_Msk           (0x1FFUL << SCB_ICSR_VECTPENDING_Pos)          /*!< SCB ICSR: VECTPENDING Mask */
450
451 #define SCB_ICSR_RETTOBASE_Pos             11U                                            /*!< SCB ICSR: RETTOBASE Position */
452 #define SCB_ICSR_RETTOBASE_Msk             (1UL << SCB_ICSR_RETTOBASE_Pos)                /*!< SCB ICSR: RETTOBASE Mask */
453
454 #define SCB_ICSR_VECTACTIVE_Pos             0U                                            /*!< SCB ICSR: VECTACTIVE Position */
455 #define SCB_ICSR_VECTACTIVE_Msk            (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/)       /*!< SCB ICSR: VECTACTIVE Mask */
456
457 #if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)
458 /* SCB Vector Table Offset Register Definitions */
459 #define SCB_VTOR_TBLOFF_Pos                 7U                                            /*!< SCB VTOR: TBLOFF Position */
460 #define SCB_VTOR_TBLOFF_Msk                (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos)           /*!< SCB VTOR: TBLOFF Mask */
461 #endif
462
463 /* SCB Application Interrupt and Reset Control Register Definitions */
464 #define SCB_AIRCR_VECTKEY_Pos              16U                                            /*!< SCB AIRCR: VECTKEY Position */
465 #define SCB_AIRCR_VECTKEY_Msk              (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos)            /*!< SCB AIRCR: VECTKEY Mask */
466
467 #define SCB_AIRCR_VECTKEYSTAT_Pos          16U                                            /*!< SCB AIRCR: VECTKEYSTAT Position */
468 #define SCB_AIRCR_VECTKEYSTAT_Msk          (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos)        /*!< SCB AIRCR: VECTKEYSTAT Mask */
469
470 #define SCB_AIRCR_ENDIANESS_Pos            15U                                            /*!< SCB AIRCR: ENDIANESS Position */
471 #define SCB_AIRCR_ENDIANESS_Msk            (1UL << SCB_AIRCR_ENDIANESS_Pos)               /*!< SCB AIRCR: ENDIANESS Mask */
472
473 #define SCB_AIRCR_PRIS_Pos                 14U                                            /*!< SCB AIRCR: PRIS Position */
474 #define SCB_AIRCR_PRIS_Msk                 (1UL << SCB_AIRCR_PRIS_Pos)                    /*!< SCB AIRCR: PRIS Mask */
475
476 #define SCB_AIRCR_BFHFNMINS_Pos            13U                                            /*!< SCB AIRCR: BFHFNMINS Position */
477 #define SCB_AIRCR_BFHFNMINS_Msk            (1UL << SCB_AIRCR_BFHFNMINS_Pos)               /*!< SCB AIRCR: BFHFNMINS Mask */
478
479 #define SCB_AIRCR_SYSRESETREQS_Pos          3U                                            /*!< SCB AIRCR: SYSRESETREQS Position */
480 #define SCB_AIRCR_SYSRESETREQS_Msk         (1UL << SCB_AIRCR_SYSRESETREQS_Pos)            /*!< SCB AIRCR: SYSRESETREQS Mask */
481
482 #define SCB_AIRCR_SYSRESETREQ_Pos           2U                                            /*!< SCB AIRCR: SYSRESETREQ Position */
483 #define SCB_AIRCR_SYSRESETREQ_Msk          (1UL << SCB_AIRCR_SYSRESETREQ_Pos)             /*!< SCB AIRCR: SYSRESETREQ Mask */
484
485 #define SCB_AIRCR_VECTCLRACTIVE_Pos         1U                                            /*!< SCB AIRCR: VECTCLRACTIVE Position */
486 #define SCB_AIRCR_VECTCLRACTIVE_Msk        (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos)           /*!< SCB AIRCR: VECTCLRACTIVE Mask */
487
488 /* SCB System Control Register Definitions */
489 #define SCB_SCR_SEVONPEND_Pos               4U                                            /*!< SCB SCR: SEVONPEND Position */
490 #define SCB_SCR_SEVONPEND_Msk              (1UL << SCB_SCR_SEVONPEND_Pos)                 /*!< SCB SCR: SEVONPEND Mask */
491
492 #define SCB_SCR_SLEEPDEEPS_Pos              3U                                            /*!< SCB SCR: SLEEPDEEPS Position */
493 #define SCB_SCR_SLEEPDEEPS_Msk             (1UL << SCB_SCR_SLEEPDEEPS_Pos)                /*!< SCB SCR: SLEEPDEEPS Mask */
494
495 #define SCB_SCR_SLEEPDEEP_Pos               2U                                            /*!< SCB SCR: SLEEPDEEP Position */
496 #define SCB_SCR_SLEEPDEEP_Msk              (1UL << SCB_SCR_SLEEPDEEP_Pos)                 /*!< SCB SCR: SLEEPDEEP Mask */
497
498 #define SCB_SCR_SLEEPONEXIT_Pos             1U                                            /*!< SCB SCR: SLEEPONEXIT Position */
499 #define SCB_SCR_SLEEPONEXIT_Msk            (1UL << SCB_SCR_SLEEPONEXIT_Pos)               /*!< SCB SCR: SLEEPONEXIT Mask */
500
501 /* SCB Configuration Control Register Definitions */
502 #define SCB_CCR_BP_Pos                     18U                                            /*!< SCB CCR: BP Position */
503 #define SCB_CCR_BP_Msk                     (1UL << SCB_CCR_BP_Pos)                        /*!< SCB CCR: BP Mask */
504
505 #define SCB_CCR_IC_Pos                     17U                                            /*!< SCB CCR: IC Position */
506 #define SCB_CCR_IC_Msk                     (1UL << SCB_CCR_IC_Pos)                        /*!< SCB CCR: IC Mask */
507
508 #define SCB_CCR_DC_Pos                     16U                                            /*!< SCB CCR: DC Position */
509 #define SCB_CCR_DC_Msk                     (1UL << SCB_CCR_DC_Pos)                        /*!< SCB CCR: DC Mask */
510
511 #define SCB_CCR_STKOFHFNMIGN_Pos           10U                                            /*!< SCB CCR: STKOFHFNMIGN Position */
512 #define SCB_CCR_STKOFHFNMIGN_Msk           (1UL << SCB_CCR_STKOFHFNMIGN_Pos)              /*!< SCB CCR: STKOFHFNMIGN Mask */
513
514 #define SCB_CCR_BFHFNMIGN_Pos               8U                                            /*!< SCB CCR: BFHFNMIGN Position */
515 #define SCB_CCR_BFHFNMIGN_Msk              (1UL << SCB_CCR_BFHFNMIGN_Pos)                 /*!< SCB CCR: BFHFNMIGN Mask */
516
517 #define SCB_CCR_DIV_0_TRP_Pos               4U                                            /*!< SCB CCR: DIV_0_TRP Position */
518 #define SCB_CCR_DIV_0_TRP_Msk              (1UL << SCB_CCR_DIV_0_TRP_Pos)                 /*!< SCB CCR: DIV_0_TRP Mask */
519
520 #define SCB_CCR_UNALIGN_TRP_Pos             3U                                            /*!< SCB CCR: UNALIGN_TRP Position */
521 #define SCB_CCR_UNALIGN_TRP_Msk            (1UL << SCB_CCR_UNALIGN_TRP_Pos)               /*!< SCB CCR: UNALIGN_TRP Mask */
522
523 #define SCB_CCR_USERSETMPEND_Pos            1U                                            /*!< SCB CCR: USERSETMPEND Position */
524 #define SCB_CCR_USERSETMPEND_Msk           (1UL << SCB_CCR_USERSETMPEND_Pos)              /*!< SCB CCR: USERSETMPEND Mask */
525
526 /* SCB System Handler Control and State Register Definitions */
527 #define SCB_SHCSR_HARDFAULTPENDED_Pos      21U                                            /*!< SCB SHCSR: HARDFAULTPENDED Position */
528 #define SCB_SHCSR_HARDFAULTPENDED_Msk      (1UL << SCB_SHCSR_HARDFAULTPENDED_Pos)         /*!< SCB SHCSR: HARDFAULTPENDED Mask */
529
530 #define SCB_SHCSR_SVCALLPENDED_Pos         15U                                            /*!< SCB SHCSR: SVCALLPENDED Position */
531 #define SCB_SHCSR_SVCALLPENDED_Msk         (1UL << SCB_SHCSR_SVCALLPENDED_Pos)            /*!< SCB SHCSR: SVCALLPENDED Mask */
532
533 #define SCB_SHCSR_SYSTICKACT_Pos           11U                                            /*!< SCB SHCSR: SYSTICKACT Position */
534 #define SCB_SHCSR_SYSTICKACT_Msk           (1UL << SCB_SHCSR_SYSTICKACT_Pos)              /*!< SCB SHCSR: SYSTICKACT Mask */
535
536 #define SCB_SHCSR_PENDSVACT_Pos            10U                                            /*!< SCB SHCSR: PENDSVACT Position */
537 #define SCB_SHCSR_PENDSVACT_Msk            (1UL << SCB_SHCSR_PENDSVACT_Pos)               /*!< SCB SHCSR: PENDSVACT Mask */
538
539 #define SCB_SHCSR_SVCALLACT_Pos             7U                                            /*!< SCB SHCSR: SVCALLACT Position */
540 #define SCB_SHCSR_SVCALLACT_Msk            (1UL << SCB_SHCSR_SVCALLACT_Pos)               /*!< SCB SHCSR: SVCALLACT Mask */
541
542 #define SCB_SHCSR_NMIACT_Pos                5U                                            /*!< SCB SHCSR: NMIACT Position */
543 #define SCB_SHCSR_NMIACT_Msk               (1UL << SCB_SHCSR_NMIACT_Pos)                  /*!< SCB SHCSR: NMIACT Mask */
544
545 #define SCB_SHCSR_HARDFAULTACT_Pos          2U                                            /*!< SCB SHCSR: HARDFAULTACT Position */
546 #define SCB_SHCSR_HARDFAULTACT_Msk         (1UL << SCB_SHCSR_HARDFAULTACT_Pos)            /*!< SCB SHCSR: HARDFAULTACT Mask */
547
548 /*@} end of group CMSIS_SCB */
549
550
551 /**
552   \ingroup  CMSIS_core_register
553   \defgroup CMSIS_SysTick     System Tick Timer (SysTick)
554   \brief    Type definitions for the System Timer Registers.
555   @{
556  */
557
558 /**
559   \brief  Structure type to access the System Timer (SysTick).
560  */
561 typedef struct
562 {
563   __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  SysTick Control and Status Register */
564   __IOM uint32_t LOAD;                   /*!< Offset: 0x004 (R/W)  SysTick Reload Value Register */
565   __IOM uint32_t VAL;                    /*!< Offset: 0x008 (R/W)  SysTick Current Value Register */
566   __IM  uint32_t CALIB;                  /*!< Offset: 0x00C (R/ )  SysTick Calibration Register */
567 } SysTick_Type;
568
569 /* SysTick Control / Status Register Definitions */
570 #define SysTick_CTRL_COUNTFLAG_Pos         16U                                            /*!< SysTick CTRL: COUNTFLAG Position */
571 #define SysTick_CTRL_COUNTFLAG_Msk         (1UL << SysTick_CTRL_COUNTFLAG_Pos)            /*!< SysTick CTRL: COUNTFLAG Mask */
572
573 #define SysTick_CTRL_CLKSOURCE_Pos          2U                                            /*!< SysTick CTRL: CLKSOURCE Position */
574 #define SysTick_CTRL_CLKSOURCE_Msk         (1UL << SysTick_CTRL_CLKSOURCE_Pos)            /*!< SysTick CTRL: CLKSOURCE Mask */
575
576 #define SysTick_CTRL_TICKINT_Pos            1U                                            /*!< SysTick CTRL: TICKINT Position */
577 #define SysTick_CTRL_TICKINT_Msk           (1UL << SysTick_CTRL_TICKINT_Pos)              /*!< SysTick CTRL: TICKINT Mask */
578
579 #define SysTick_CTRL_ENABLE_Pos             0U                                            /*!< SysTick CTRL: ENABLE Position */
580 #define SysTick_CTRL_ENABLE_Msk            (1UL /*<< SysTick_CTRL_ENABLE_Pos*/)           /*!< SysTick CTRL: ENABLE Mask */
581
582 /* SysTick Reload Register Definitions */
583 #define SysTick_LOAD_RELOAD_Pos             0U                                            /*!< SysTick LOAD: RELOAD Position */
584 #define SysTick_LOAD_RELOAD_Msk            (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/)    /*!< SysTick LOAD: RELOAD Mask */
585
586 /* SysTick Current Register Definitions */
587 #define SysTick_VAL_CURRENT_Pos             0U                                            /*!< SysTick VAL: CURRENT Position */
588 #define SysTick_VAL_CURRENT_Msk            (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/)    /*!< SysTick VAL: CURRENT Mask */
589
590 /* SysTick Calibration Register Definitions */
591 #define SysTick_CALIB_NOREF_Pos            31U                                            /*!< SysTick CALIB: NOREF Position */
592 #define SysTick_CALIB_NOREF_Msk            (1UL << SysTick_CALIB_NOREF_Pos)               /*!< SysTick CALIB: NOREF Mask */
593
594 #define SysTick_CALIB_SKEW_Pos             30U                                            /*!< SysTick CALIB: SKEW Position */
595 #define SysTick_CALIB_SKEW_Msk             (1UL << SysTick_CALIB_SKEW_Pos)                /*!< SysTick CALIB: SKEW Mask */
596
597 #define SysTick_CALIB_TENMS_Pos             0U                                            /*!< SysTick CALIB: TENMS Position */
598 #define SysTick_CALIB_TENMS_Msk            (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/)    /*!< SysTick CALIB: TENMS Mask */
599
600 /*@} end of group CMSIS_SysTick */
601
602
603 /**
604   \ingroup  CMSIS_core_register
605   \defgroup CMSIS_DWT     Data Watchpoint and Trace (DWT)
606   \brief    Type definitions for the Data Watchpoint and Trace (DWT)
607   @{
608  */
609
610 /**
611   \brief  Structure type to access the Data Watchpoint and Trace Register (DWT).
612  */
613 typedef struct
614 {
615   __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  Control Register */
616         uint32_t RESERVED0[6U];
617   __IM  uint32_t PCSR;                   /*!< Offset: 0x01C (R/ )  Program Counter Sample Register */
618   __IOM uint32_t COMP0;                  /*!< Offset: 0x020 (R/W)  Comparator Register 0 */
619         uint32_t RESERVED1[1U];
620   __IOM uint32_t FUNCTION0;              /*!< Offset: 0x028 (R/W)  Function Register 0 */
621         uint32_t RESERVED2[1U];
622   __IOM uint32_t COMP1;                  /*!< Offset: 0x030 (R/W)  Comparator Register 1 */
623         uint32_t RESERVED3[1U];
624   __IOM uint32_t FUNCTION1;              /*!< Offset: 0x038 (R/W)  Function Register 1 */
625         uint32_t RESERVED4[1U];
626   __IOM uint32_t COMP2;                  /*!< Offset: 0x040 (R/W)  Comparator Register 2 */
627         uint32_t RESERVED5[1U];
628   __IOM uint32_t FUNCTION2;              /*!< Offset: 0x048 (R/W)  Function Register 2 */
629         uint32_t RESERVED6[1U];
630   __IOM uint32_t COMP3;                  /*!< Offset: 0x050 (R/W)  Comparator Register 3 */
631         uint32_t RESERVED7[1U];
632   __IOM uint32_t FUNCTION3;              /*!< Offset: 0x058 (R/W)  Function Register 3 */
633         uint32_t RESERVED8[1U];
634   __IOM uint32_t COMP4;                  /*!< Offset: 0x060 (R/W)  Comparator Register 4 */
635         uint32_t RESERVED9[1U];
636   __IOM uint32_t FUNCTION4;              /*!< Offset: 0x068 (R/W)  Function Register 4 */
637         uint32_t RESERVED10[1U];
638   __IOM uint32_t COMP5;                  /*!< Offset: 0x070 (R/W)  Comparator Register 5 */
639         uint32_t RESERVED11[1U];
640   __IOM uint32_t FUNCTION5;              /*!< Offset: 0x078 (R/W)  Function Register 5 */
641         uint32_t RESERVED12[1U];
642   __IOM uint32_t COMP6;                  /*!< Offset: 0x080 (R/W)  Comparator Register 6 */
643         uint32_t RESERVED13[1U];
644   __IOM uint32_t FUNCTION6;              /*!< Offset: 0x088 (R/W)  Function Register 6 */
645         uint32_t RESERVED14[1U];
646   __IOM uint32_t COMP7;                  /*!< Offset: 0x090 (R/W)  Comparator Register 7 */
647         uint32_t RESERVED15[1U];
648   __IOM uint32_t FUNCTION7;              /*!< Offset: 0x098 (R/W)  Function Register 7 */
649         uint32_t RESERVED16[1U];
650   __IOM uint32_t COMP8;                  /*!< Offset: 0x0A0 (R/W)  Comparator Register 8 */
651         uint32_t RESERVED17[1U];
652   __IOM uint32_t FUNCTION8;              /*!< Offset: 0x0A8 (R/W)  Function Register 8 */
653         uint32_t RESERVED18[1U];
654   __IOM uint32_t COMP9;                  /*!< Offset: 0x0B0 (R/W)  Comparator Register 9 */
655         uint32_t RESERVED19[1U];
656   __IOM uint32_t FUNCTION9;              /*!< Offset: 0x0B8 (R/W)  Function Register 9 */
657         uint32_t RESERVED20[1U];
658   __IOM uint32_t COMP10;                 /*!< Offset: 0x0C0 (R/W)  Comparator Register 10 */
659         uint32_t RESERVED21[1U];
660   __IOM uint32_t FUNCTION10;             /*!< Offset: 0x0C8 (R/W)  Function Register 10 */
661         uint32_t RESERVED22[1U];
662   __IOM uint32_t COMP11;                 /*!< Offset: 0x0D0 (R/W)  Comparator Register 11 */
663         uint32_t RESERVED23[1U];
664   __IOM uint32_t FUNCTION11;             /*!< Offset: 0x0D8 (R/W)  Function Register 11 */
665         uint32_t RESERVED24[1U];
666   __IOM uint32_t COMP12;                 /*!< Offset: 0x0E0 (R/W)  Comparator Register 12 */
667         uint32_t RESERVED25[1U];
668   __IOM uint32_t FUNCTION12;             /*!< Offset: 0x0E8 (R/W)  Function Register 12 */
669         uint32_t RESERVED26[1U];
670   __IOM uint32_t COMP13;                 /*!< Offset: 0x0F0 (R/W)  Comparator Register 13 */
671         uint32_t RESERVED27[1U];
672   __IOM uint32_t FUNCTION13;             /*!< Offset: 0x0F8 (R/W)  Function Register 13 */
673         uint32_t RESERVED28[1U];
674   __IOM uint32_t COMP14;                 /*!< Offset: 0x100 (R/W)  Comparator Register 14 */
675         uint32_t RESERVED29[1U];
676   __IOM uint32_t FUNCTION14;             /*!< Offset: 0x108 (R/W)  Function Register 14 */
677         uint32_t RESERVED30[1U];
678   __IOM uint32_t COMP15;                 /*!< Offset: 0x110 (R/W)  Comparator Register 15 */
679         uint32_t RESERVED31[1U];
680   __IOM uint32_t FUNCTION15;             /*!< Offset: 0x118 (R/W)  Function Register 15 */
681 } DWT_Type;
682
683 /* DWT Control Register Definitions */
684 #define DWT_CTRL_NUMCOMP_Pos               28U                                         /*!< DWT CTRL: NUMCOMP Position */
685 #define DWT_CTRL_NUMCOMP_Msk               (0xFUL << DWT_CTRL_NUMCOMP_Pos)             /*!< DWT CTRL: NUMCOMP Mask */
686
687 #define DWT_CTRL_NOTRCPKT_Pos              27U                                         /*!< DWT CTRL: NOTRCPKT Position */
688 #define DWT_CTRL_NOTRCPKT_Msk              (0x1UL << DWT_CTRL_NOTRCPKT_Pos)            /*!< DWT CTRL: NOTRCPKT Mask */
689
690 #define DWT_CTRL_NOEXTTRIG_Pos             26U                                         /*!< DWT CTRL: NOEXTTRIG Position */
691 #define DWT_CTRL_NOEXTTRIG_Msk             (0x1UL << DWT_CTRL_NOEXTTRIG_Pos)           /*!< DWT CTRL: NOEXTTRIG Mask */
692
693 #define DWT_CTRL_NOCYCCNT_Pos              25U                                         /*!< DWT CTRL: NOCYCCNT Position */
694 #define DWT_CTRL_NOCYCCNT_Msk              (0x1UL << DWT_CTRL_NOCYCCNT_Pos)            /*!< DWT CTRL: NOCYCCNT Mask */
695
696 #define DWT_CTRL_NOPRFCNT_Pos              24U                                         /*!< DWT CTRL: NOPRFCNT Position */
697 #define DWT_CTRL_NOPRFCNT_Msk              (0x1UL << DWT_CTRL_NOPRFCNT_Pos)            /*!< DWT CTRL: NOPRFCNT Mask */
698
699 /* DWT Comparator Function Register Definitions */
700 #define DWT_FUNCTION_ID_Pos                27U                                         /*!< DWT FUNCTION: ID Position */
701 #define DWT_FUNCTION_ID_Msk                (0x1FUL << DWT_FUNCTION_ID_Pos)             /*!< DWT FUNCTION: ID Mask */
702
703 #define DWT_FUNCTION_MATCHED_Pos           24U                                         /*!< DWT FUNCTION: MATCHED Position */
704 #define DWT_FUNCTION_MATCHED_Msk           (0x1UL << DWT_FUNCTION_MATCHED_Pos)         /*!< DWT FUNCTION: MATCHED Mask */
705
706 #define DWT_FUNCTION_DATAVSIZE_Pos         10U                                         /*!< DWT FUNCTION: DATAVSIZE Position */
707 #define DWT_FUNCTION_DATAVSIZE_Msk         (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos)       /*!< DWT FUNCTION: DATAVSIZE Mask */
708
709 #define DWT_FUNCTION_ACTION_Pos             4U                                         /*!< DWT FUNCTION: ACTION Position */
710 #define DWT_FUNCTION_ACTION_Msk            (0x3UL << DWT_FUNCTION_ACTION_Pos)          /*!< DWT FUNCTION: ACTION Mask */
711
712 #define DWT_FUNCTION_MATCH_Pos              0U                                         /*!< DWT FUNCTION: MATCH Position */
713 #define DWT_FUNCTION_MATCH_Msk             (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/)       /*!< DWT FUNCTION: MATCH Mask */
714
715 /*@}*/ /* end of group CMSIS_DWT */
716
717
718 /**
719   \ingroup  CMSIS_core_register
720   \defgroup CMSIS_TPI     Trace Port Interface (TPI)
721   \brief    Type definitions for the Trace Port Interface (TPI)
722   @{
723  */
724
725 /**
726   \brief  Structure type to access the Trace Port Interface Register (TPI).
727  */
728 typedef struct
729 {
730   __IM  uint32_t SSPSR;                  /*!< Offset: 0x000 (R/ )  Supported Parallel Port Size Register */
731   __IOM uint32_t CSPSR;                  /*!< Offset: 0x004 (R/W)  Current Parallel Port Size Register */
732         uint32_t RESERVED0[2U];
733   __IOM uint32_t ACPR;                   /*!< Offset: 0x010 (R/W)  Asynchronous Clock Prescaler Register */
734         uint32_t RESERVED1[55U];
735   __IOM uint32_t SPPR;                   /*!< Offset: 0x0F0 (R/W)  Selected Pin Protocol Register */
736         uint32_t RESERVED2[131U];
737   __IM  uint32_t FFSR;                   /*!< Offset: 0x300 (R/ )  Formatter and Flush Status Register */
738   __IOM uint32_t FFCR;                   /*!< Offset: 0x304 (R/W)  Formatter and Flush Control Register */
739   __IOM uint32_t PSCR;                   /*!< Offset: 0x308 (R/W)  Periodic Synchronization Control Register */
740         uint32_t RESERVED3[759U];
741   __IM  uint32_t TRIGGER;                /*!< Offset: 0xEE8 (R/ )  TRIGGER Register */
742   __IM  uint32_t ITFTTD0;                /*!< Offset: 0xEEC (R/ )  Integration Test FIFO Test Data 0 Register */
743   __IOM uint32_t ITATBCTR2;              /*!< Offset: 0xEF0 (R/W)  Integration Test ATB Control Register 2 */
744         uint32_t RESERVED4[1U];
745   __IM  uint32_t ITATBCTR0;              /*!< Offset: 0xEF8 (R/ )  Integration Test ATB Control Register 0 */
746   __IM  uint32_t ITFTTD1;                /*!< Offset: 0xEFC (R/ )  Integration Test FIFO Test Data 1 Register */
747   __IOM uint32_t ITCTRL;                 /*!< Offset: 0xF00 (R/W)  Integration Mode Control */
748         uint32_t RESERVED5[39U];
749   __IOM uint32_t CLAIMSET;               /*!< Offset: 0xFA0 (R/W)  Claim tag set */
750   __IOM uint32_t CLAIMCLR;               /*!< Offset: 0xFA4 (R/W)  Claim tag clear */
751         uint32_t RESERVED7[8U];
752   __IM  uint32_t DEVID;                  /*!< Offset: 0xFC8 (R/ )  Device Configuration Register */
753   __IM  uint32_t DEVTYPE;                /*!< Offset: 0xFCC (R/ )  Device Type Identifier Register */
754 } TPI_Type;
755
756 /* TPI Asynchronous Clock Prescaler Register Definitions */
757 #define TPI_ACPR_PRESCALER_Pos              0U                                         /*!< TPI ACPR: PRESCALER Position */
758 #define TPI_ACPR_PRESCALER_Msk             (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/)    /*!< TPI ACPR: PRESCALER Mask */
759
760 /* TPI Selected Pin Protocol Register Definitions */
761 #define TPI_SPPR_TXMODE_Pos                 0U                                         /*!< TPI SPPR: TXMODE Position */
762 #define TPI_SPPR_TXMODE_Msk                (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/)          /*!< TPI SPPR: TXMODE Mask */
763
764 /* TPI Formatter and Flush Status Register Definitions */
765 #define TPI_FFSR_FtNonStop_Pos              3U                                         /*!< TPI FFSR: FtNonStop Position */
766 #define TPI_FFSR_FtNonStop_Msk             (0x1UL << TPI_FFSR_FtNonStop_Pos)           /*!< TPI FFSR: FtNonStop Mask */
767
768 #define TPI_FFSR_TCPresent_Pos              2U                                         /*!< TPI FFSR: TCPresent Position */
769 #define TPI_FFSR_TCPresent_Msk             (0x1UL << TPI_FFSR_TCPresent_Pos)           /*!< TPI FFSR: TCPresent Mask */
770
771 #define TPI_FFSR_FtStopped_Pos              1U                                         /*!< TPI FFSR: FtStopped Position */
772 #define TPI_FFSR_FtStopped_Msk             (0x1UL << TPI_FFSR_FtStopped_Pos)           /*!< TPI FFSR: FtStopped Mask */
773
774 #define TPI_FFSR_FlInProg_Pos               0U                                         /*!< TPI FFSR: FlInProg Position */
775 #define TPI_FFSR_FlInProg_Msk              (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/)        /*!< TPI FFSR: FlInProg Mask */
776
777 /* TPI Formatter and Flush Control Register Definitions */
778 #define TPI_FFCR_TrigIn_Pos                 8U                                         /*!< TPI FFCR: TrigIn Position */
779 #define TPI_FFCR_TrigIn_Msk                (0x1UL << TPI_FFCR_TrigIn_Pos)              /*!< TPI FFCR: TrigIn Mask */
780
781 #define TPI_FFCR_FOnMan_Pos                 6U                                         /*!< TPI FFCR: FOnMan Position */
782 #define TPI_FFCR_FOnMan_Msk                (0x1UL << TPI_FFCR_FOnMan_Pos)              /*!< TPI FFCR: FOnMan Mask */
783
784 #define TPI_FFCR_EnFCont_Pos                1U                                         /*!< TPI FFCR: EnFCont Position */
785 #define TPI_FFCR_EnFCont_Msk               (0x1UL << TPI_FFCR_EnFCont_Pos)             /*!< TPI FFCR: EnFCont Mask */
786
787 /* TPI TRIGGER Register Definitions */
788 #define TPI_TRIGGER_TRIGGER_Pos             0U                                         /*!< TPI TRIGGER: TRIGGER Position */
789 #define TPI_TRIGGER_TRIGGER_Msk            (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/)      /*!< TPI TRIGGER: TRIGGER Mask */
790
791 /* TPI Integration Test FIFO Test Data 0 Register Definitions */
792 #define TPI_ITFTTD0_ATB_IF2_ATVALID_Pos    29U                                         /*!< TPI ITFTTD0: ATB Interface 2 ATVALIDPosition */
793 #define TPI_ITFTTD0_ATB_IF2_ATVALID_Msk    (0x3UL << TPI_ITFTTD0_ATB_IF2_ATVALID_Pos)  /*!< TPI ITFTTD0: ATB Interface 2 ATVALID Mask */
794
795 #define TPI_ITFTTD0_ATB_IF2_bytecount_Pos  27U                                         /*!< TPI ITFTTD0: ATB Interface 2 byte count Position */
796 #define TPI_ITFTTD0_ATB_IF2_bytecount_Msk  (0x3UL << TPI_ITFTTD0_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 2 byte count Mask */
797
798 #define TPI_ITFTTD0_ATB_IF1_ATVALID_Pos    26U                                         /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Position */
799 #define TPI_ITFTTD0_ATB_IF1_ATVALID_Msk    (0x3UL << TPI_ITFTTD0_ATB_IF1_ATVALID_Pos)  /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Mask */
800
801 #define TPI_ITFTTD0_ATB_IF1_bytecount_Pos  24U                                         /*!< TPI ITFTTD0: ATB Interface 1 byte count Position */
802 #define TPI_ITFTTD0_ATB_IF1_bytecount_Msk  (0x3UL << TPI_ITFTTD0_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 1 byte countt Mask */
803
804 #define TPI_ITFTTD0_ATB_IF1_data2_Pos      16U                                         /*!< TPI ITFTTD0: ATB Interface 1 data2 Position */
805 #define TPI_ITFTTD0_ATB_IF1_data2_Msk      (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos)   /*!< TPI ITFTTD0: ATB Interface 1 data2 Mask */
806
807 #define TPI_ITFTTD0_ATB_IF1_data1_Pos       8U                                         /*!< TPI ITFTTD0: ATB Interface 1 data1 Position */
808 #define TPI_ITFTTD0_ATB_IF1_data1_Msk      (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos)   /*!< TPI ITFTTD0: ATB Interface 1 data1 Mask */
809
810 #define TPI_ITFTTD0_ATB_IF1_data0_Pos       0U                                          /*!< TPI ITFTTD0: ATB Interface 1 data0 Position */
811 #define TPI_ITFTTD0_ATB_IF1_data0_Msk      (0xFFUL /*<< TPI_ITFTTD0_ATB_IF1_data0_Pos*/) /*!< TPI ITFTTD0: ATB Interface 1 data0 Mask */
812
813 /* TPI Integration Test ATB Control Register 2 Register Definitions */
814 #define TPI_ITATBCTR2_AFVALID2S_Pos         1U                                         /*!< TPI ITATBCTR2: AFVALID2S Position */
815 #define TPI_ITATBCTR2_AFVALID2S_Msk        (0x1UL << TPI_ITATBCTR2_AFVALID2S_Pos)      /*!< TPI ITATBCTR2: AFVALID2SS Mask */
816
817 #define TPI_ITATBCTR2_AFVALID1S_Pos         1U                                         /*!< TPI ITATBCTR2: AFVALID1S Position */
818 #define TPI_ITATBCTR2_AFVALID1S_Msk        (0x1UL << TPI_ITATBCTR2_AFVALID1S_Pos)      /*!< TPI ITATBCTR2: AFVALID1SS Mask */
819
820 #define TPI_ITATBCTR2_ATREADY2S_Pos         0U                                         /*!< TPI ITATBCTR2: ATREADY2S Position */
821 #define TPI_ITATBCTR2_ATREADY2S_Msk        (0x1UL /*<< TPI_ITATBCTR2_ATREADY2S_Pos*/)  /*!< TPI ITATBCTR2: ATREADY2S Mask */
822
823 #define TPI_ITATBCTR2_ATREADY1S_Pos         0U                                         /*!< TPI ITATBCTR2: ATREADY1S Position */
824 #define TPI_ITATBCTR2_ATREADY1S_Msk        (0x1UL /*<< TPI_ITATBCTR2_ATREADY1S_Pos*/)  /*!< TPI ITATBCTR2: ATREADY1S Mask */
825
826 /* TPI Integration Test FIFO Test Data 1 Register Definitions */
827 #define TPI_ITFTTD1_ATB_IF2_ATVALID_Pos    29U                                         /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Position */
828 #define TPI_ITFTTD1_ATB_IF2_ATVALID_Msk    (0x3UL << TPI_ITFTTD1_ATB_IF2_ATVALID_Pos)  /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Mask */
829
830 #define TPI_ITFTTD1_ATB_IF2_bytecount_Pos  27U                                         /*!< TPI ITFTTD1: ATB Interface 2 byte count Position */
831 #define TPI_ITFTTD1_ATB_IF2_bytecount_Msk  (0x3UL << TPI_ITFTTD1_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 2 byte count Mask */
832
833 #define TPI_ITFTTD1_ATB_IF1_ATVALID_Pos    26U                                         /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Position */
834 #define TPI_ITFTTD1_ATB_IF1_ATVALID_Msk    (0x3UL << TPI_ITFTTD1_ATB_IF1_ATVALID_Pos)  /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Mask */
835
836 #define TPI_ITFTTD1_ATB_IF1_bytecount_Pos  24U                                         /*!< TPI ITFTTD1: ATB Interface 1 byte count Position */
837 #define TPI_ITFTTD1_ATB_IF1_bytecount_Msk  (0x3UL << TPI_ITFTTD1_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 1 byte countt Mask */
838
839 #define TPI_ITFTTD1_ATB_IF2_data2_Pos      16U                                         /*!< TPI ITFTTD1: ATB Interface 2 data2 Position */
840 #define TPI_ITFTTD1_ATB_IF2_data2_Msk      (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos)   /*!< TPI ITFTTD1: ATB Interface 2 data2 Mask */
841
842 #define TPI_ITFTTD1_ATB_IF2_data1_Pos       8U                                         /*!< TPI ITFTTD1: ATB Interface 2 data1 Position */
843 #define TPI_ITFTTD1_ATB_IF2_data1_Msk      (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos)   /*!< TPI ITFTTD1: ATB Interface 2 data1 Mask */
844
845 #define TPI_ITFTTD1_ATB_IF2_data0_Pos       0U                                          /*!< TPI ITFTTD1: ATB Interface 2 data0 Position */
846 #define TPI_ITFTTD1_ATB_IF2_data0_Msk      (0xFFUL /*<< TPI_ITFTTD1_ATB_IF2_data0_Pos*/) /*!< TPI ITFTTD1: ATB Interface 2 data0 Mask */
847
848 /* TPI Integration Test ATB Control Register 0 Definitions */
849 #define TPI_ITATBCTR0_AFVALID2S_Pos         1U                                         /*!< TPI ITATBCTR0: AFVALID2S Position */
850 #define TPI_ITATBCTR0_AFVALID2S_Msk        (0x1UL << TPI_ITATBCTR0_AFVALID2S_Pos)      /*!< TPI ITATBCTR0: AFVALID2SS Mask */
851
852 #define TPI_ITATBCTR0_AFVALID1S_Pos         1U                                         /*!< TPI ITATBCTR0: AFVALID1S Position */
853 #define TPI_ITATBCTR0_AFVALID1S_Msk        (0x1UL << TPI_ITATBCTR0_AFVALID1S_Pos)      /*!< TPI ITATBCTR0: AFVALID1SS Mask */
854
855 #define TPI_ITATBCTR0_ATREADY2S_Pos         0U                                         /*!< TPI ITATBCTR0: ATREADY2S Position */
856 #define TPI_ITATBCTR0_ATREADY2S_Msk        (0x1UL /*<< TPI_ITATBCTR0_ATREADY2S_Pos*/)  /*!< TPI ITATBCTR0: ATREADY2S Mask */
857
858 #define TPI_ITATBCTR0_ATREADY1S_Pos         0U                                         /*!< TPI ITATBCTR0: ATREADY1S Position */
859 #define TPI_ITATBCTR0_ATREADY1S_Msk        (0x1UL /*<< TPI_ITATBCTR0_ATREADY1S_Pos*/)  /*!< TPI ITATBCTR0: ATREADY1S Mask */
860
861 /* TPI Integration Mode Control Register Definitions */
862 #define TPI_ITCTRL_Mode_Pos                 0U                                         /*!< TPI ITCTRL: Mode Position */
863 #define TPI_ITCTRL_Mode_Msk                (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/)          /*!< TPI ITCTRL: Mode Mask */
864
865 /* TPI DEVID Register Definitions */
866 #define TPI_DEVID_NRZVALID_Pos             11U                                         /*!< TPI DEVID: NRZVALID Position */
867 #define TPI_DEVID_NRZVALID_Msk             (0x1UL << TPI_DEVID_NRZVALID_Pos)           /*!< TPI DEVID: NRZVALID Mask */
868
869 #define TPI_DEVID_MANCVALID_Pos            10U                                         /*!< TPI DEVID: MANCVALID Position */
870 #define TPI_DEVID_MANCVALID_Msk            (0x1UL << TPI_DEVID_MANCVALID_Pos)          /*!< TPI DEVID: MANCVALID Mask */
871
872 #define TPI_DEVID_PTINVALID_Pos             9U                                         /*!< TPI DEVID: PTINVALID Position */
873 #define TPI_DEVID_PTINVALID_Msk            (0x1UL << TPI_DEVID_PTINVALID_Pos)          /*!< TPI DEVID: PTINVALID Mask */
874
875 #define TPI_DEVID_FIFOSZ_Pos                6U                                         /*!< TPI DEVID: FIFOSZ Position */
876 #define TPI_DEVID_FIFOSZ_Msk               (0x7UL << TPI_DEVID_FIFOSZ_Pos)             /*!< TPI DEVID: FIFOSZ Mask */
877
878 #define TPI_DEVID_NrTraceInput_Pos          0U                                         /*!< TPI DEVID: NrTraceInput Position */
879 #define TPI_DEVID_NrTraceInput_Msk         (0x3FUL /*<< TPI_DEVID_NrTraceInput_Pos*/)  /*!< TPI DEVID: NrTraceInput Mask */
880
881 /* TPI DEVTYPE Register Definitions */
882 #define TPI_DEVTYPE_SubType_Pos             4U                                         /*!< TPI DEVTYPE: SubType Position */
883 #define TPI_DEVTYPE_SubType_Msk            (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/)      /*!< TPI DEVTYPE: SubType Mask */
884
885 #define TPI_DEVTYPE_MajorType_Pos           0U                                         /*!< TPI DEVTYPE: MajorType Position */
886 #define TPI_DEVTYPE_MajorType_Msk          (0xFUL << TPI_DEVTYPE_MajorType_Pos)        /*!< TPI DEVTYPE: MajorType Mask */
887
888 /*@}*/ /* end of group CMSIS_TPI */
889
890
891 #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
892 /**
893   \ingroup  CMSIS_core_register
894   \defgroup CMSIS_MPU     Memory Protection Unit (MPU)
895   \brief    Type definitions for the Memory Protection Unit (MPU)
896   @{
897  */
898
899 /**
900   \brief  Structure type to access the Memory Protection Unit (MPU).
901  */
902 typedef struct
903 {
904   __IM  uint32_t TYPE;                   /*!< Offset: 0x000 (R/ )  MPU Type Register */
905   __IOM uint32_t CTRL;                   /*!< Offset: 0x004 (R/W)  MPU Control Register */
906   __IOM uint32_t RNR;                    /*!< Offset: 0x008 (R/W)  MPU Region Number Register */
907   __IOM uint32_t RBAR;                   /*!< Offset: 0x00C (R/W)  MPU Region Base Address Register */
908   __IOM uint32_t RLAR;                   /*!< Offset: 0x010 (R/W)  MPU Region Limit Address Register */
909         uint32_t RESERVED0[7U];
910   union {
911   __IOM uint32_t MAIR[2];
912   struct {
913   __IOM uint32_t MAIR0;                  /*!< Offset: 0x030 (R/W)  MPU Memory Attribute Indirection Register 0 */
914   __IOM uint32_t MAIR1;                  /*!< Offset: 0x034 (R/W)  MPU Memory Attribute Indirection Register 1 */
915   };
916   };
917 } MPU_Type;
918
919 #define MPU_TYPE_RALIASES                  1U
920
921 /* MPU Type Register Definitions */
922 #define MPU_TYPE_IREGION_Pos               16U                                            /*!< MPU TYPE: IREGION Position */
923 #define MPU_TYPE_IREGION_Msk               (0xFFUL << MPU_TYPE_IREGION_Pos)               /*!< MPU TYPE: IREGION Mask */
924
925 #define MPU_TYPE_DREGION_Pos                8U                                            /*!< MPU TYPE: DREGION Position */
926 #define MPU_TYPE_DREGION_Msk               (0xFFUL << MPU_TYPE_DREGION_Pos)               /*!< MPU TYPE: DREGION Mask */
927
928 #define MPU_TYPE_SEPARATE_Pos               0U                                            /*!< MPU TYPE: SEPARATE Position */
929 #define MPU_TYPE_SEPARATE_Msk              (1UL /*<< MPU_TYPE_SEPARATE_Pos*/)             /*!< MPU TYPE: SEPARATE Mask */
930
931 /* MPU Control Register Definitions */
932 #define MPU_CTRL_PRIVDEFENA_Pos             2U                                            /*!< MPU CTRL: PRIVDEFENA Position */
933 #define MPU_CTRL_PRIVDEFENA_Msk            (1UL << MPU_CTRL_PRIVDEFENA_Pos)               /*!< MPU CTRL: PRIVDEFENA Mask */
934
935 #define MPU_CTRL_HFNMIENA_Pos               1U                                            /*!< MPU CTRL: HFNMIENA Position */
936 #define MPU_CTRL_HFNMIENA_Msk              (1UL << MPU_CTRL_HFNMIENA_Pos)                 /*!< MPU CTRL: HFNMIENA Mask */
937
938 #define MPU_CTRL_ENABLE_Pos                 0U                                            /*!< MPU CTRL: ENABLE Position */
939 #define MPU_CTRL_ENABLE_Msk                (1UL /*<< MPU_CTRL_ENABLE_Pos*/)               /*!< MPU CTRL: ENABLE Mask */
940
941 /* MPU Region Number Register Definitions */
942 #define MPU_RNR_REGION_Pos                  0U                                            /*!< MPU RNR: REGION Position */
943 #define MPU_RNR_REGION_Msk                 (0xFFUL /*<< MPU_RNR_REGION_Pos*/)             /*!< MPU RNR: REGION Mask */
944
945 /* MPU Region Base Address Register Definitions */
946 #define MPU_RBAR_BASE_Pos                   5U                                            /*!< MPU RBAR: BASE Position */
947 #define MPU_RBAR_BASE_Msk                  (0x7FFFFFFUL << MPU_RBAR_BASE_Pos)             /*!< MPU RBAR: BASE Mask */
948
949 #define MPU_RBAR_SH_Pos                     3U                                            /*!< MPU RBAR: SH Position */
950 #define MPU_RBAR_SH_Msk                    (0x3UL << MPU_RBAR_SH_Pos)                     /*!< MPU RBAR: SH Mask */
951
952 #define MPU_RBAR_AP_Pos                     1U                                            /*!< MPU RBAR: AP Position */
953 #define MPU_RBAR_AP_Msk                    (0x3UL << MPU_RBAR_AP_Pos)                     /*!< MPU RBAR: AP Mask */
954
955 #define MPU_RBAR_XN_Pos                     0U                                            /*!< MPU RBAR: XN Position */
956 #define MPU_RBAR_XN_Msk                    (01UL /*<< MPU_RBAR_XN_Pos*/)                  /*!< MPU RBAR: XN Mask */
957
958 /* MPU Region Limit Address Register Definitions */
959 #define MPU_RLAR_LIMIT_Pos                  5U                                            /*!< MPU RLAR: LIMIT Position */
960 #define MPU_RLAR_LIMIT_Msk                 (0x7FFFFFFUL << MPU_RLAR_LIMIT_Pos)            /*!< MPU RLAR: LIMIT Mask */
961
962 #define MPU_RLAR_AttrIndx_Pos               1U                                            /*!< MPU RLAR: AttrIndx Position */
963 #define MPU_RLAR_AttrIndx_Msk              (0x7UL << MPU_RLAR_AttrIndx_Pos)               /*!< MPU RLAR: AttrIndx Mask */
964
965 #define MPU_RLAR_EN_Pos                     0U                                            /*!< MPU RLAR: EN Position */
966 #define MPU_RLAR_EN_Msk                    (1UL /*<< MPU_RLAR_EN_Pos*/)                   /*!< MPU RLAR: EN Mask */
967
968 /* MPU Memory Attribute Indirection Register 0 Definitions */
969 #define MPU_MAIR0_Attr3_Pos                24U                                            /*!< MPU MAIR0: Attr3 Position */
970 #define MPU_MAIR0_Attr3_Msk                (0xFFUL << MPU_MAIR0_Attr3_Pos)                /*!< MPU MAIR0: Attr3 Mask */
971
972 #define MPU_MAIR0_Attr2_Pos                16U                                            /*!< MPU MAIR0: Attr2 Position */
973 #define MPU_MAIR0_Attr2_Msk                (0xFFUL << MPU_MAIR0_Attr2_Pos)                /*!< MPU MAIR0: Attr2 Mask */
974
975 #define MPU_MAIR0_Attr1_Pos                 8U                                            /*!< MPU MAIR0: Attr1 Position */
976 #define MPU_MAIR0_Attr1_Msk                (0xFFUL << MPU_MAIR0_Attr1_Pos)                /*!< MPU MAIR0: Attr1 Mask */
977
978 #define MPU_MAIR0_Attr0_Pos                 0U                                            /*!< MPU MAIR0: Attr0 Position */
979 #define MPU_MAIR0_Attr0_Msk                (0xFFUL /*<< MPU_MAIR0_Attr0_Pos*/)            /*!< MPU MAIR0: Attr0 Mask */
980
981 /* MPU Memory Attribute Indirection Register 1 Definitions */
982 #define MPU_MAIR1_Attr7_Pos                24U                                            /*!< MPU MAIR1: Attr7 Position */
983 #define MPU_MAIR1_Attr7_Msk                (0xFFUL << MPU_MAIR1_Attr7_Pos)                /*!< MPU MAIR1: Attr7 Mask */
984
985 #define MPU_MAIR1_Attr6_Pos                16U                                            /*!< MPU MAIR1: Attr6 Position */
986 #define MPU_MAIR1_Attr6_Msk                (0xFFUL << MPU_MAIR1_Attr6_Pos)                /*!< MPU MAIR1: Attr6 Mask */
987
988 #define MPU_MAIR1_Attr5_Pos                 8U                                            /*!< MPU MAIR1: Attr5 Position */
989 #define MPU_MAIR1_Attr5_Msk                (0xFFUL << MPU_MAIR1_Attr5_Pos)                /*!< MPU MAIR1: Attr5 Mask */
990
991 #define MPU_MAIR1_Attr4_Pos                 0U                                            /*!< MPU MAIR1: Attr4 Position */
992 #define MPU_MAIR1_Attr4_Msk                (0xFFUL /*<< MPU_MAIR1_Attr4_Pos*/)            /*!< MPU MAIR1: Attr4 Mask */
993
994 /*@} end of group CMSIS_MPU */
995 #endif
996
997
998 #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
999 /**
1000   \ingroup  CMSIS_core_register
1001   \defgroup CMSIS_SAU     Security Attribution Unit (SAU)
1002   \brief    Type definitions for the Security Attribution Unit (SAU)
1003   @{
1004  */
1005
1006 /**
1007   \brief  Structure type to access the Security Attribution Unit (SAU).
1008  */
1009 typedef struct
1010 {
1011   __IOM uint32_t CTRL;                   /*!< Offset: 0x000 (R/W)  SAU Control Register */
1012   __IM  uint32_t TYPE;                   /*!< Offset: 0x004 (R/ )  SAU Type Register */
1013 #if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U)
1014   __IOM uint32_t RNR;                    /*!< Offset: 0x008 (R/W)  SAU Region Number Register */
1015   __IOM uint32_t RBAR;                   /*!< Offset: 0x00C (R/W)  SAU Region Base Address Register */
1016   __IOM uint32_t RLAR;                   /*!< Offset: 0x010 (R/W)  SAU Region Limit Address Register */
1017 #endif
1018 } SAU_Type;
1019
1020 /* SAU Control Register Definitions */
1021 #define SAU_CTRL_ALLNS_Pos                  1U                                            /*!< SAU CTRL: ALLNS Position */
1022 #define SAU_CTRL_ALLNS_Msk                 (1UL << SAU_CTRL_ALLNS_Pos)                    /*!< SAU CTRL: ALLNS Mask */
1023
1024 #define SAU_CTRL_ENABLE_Pos                 0U                                            /*!< SAU CTRL: ENABLE Position */
1025 #define SAU_CTRL_ENABLE_Msk                (1UL /*<< SAU_CTRL_ENABLE_Pos*/)               /*!< SAU CTRL: ENABLE Mask */
1026
1027 /* SAU Type Register Definitions */
1028 #define SAU_TYPE_SREGION_Pos                0U                                            /*!< SAU TYPE: SREGION Position */
1029 #define SAU_TYPE_SREGION_Msk               (0xFFUL /*<< SAU_TYPE_SREGION_Pos*/)           /*!< SAU TYPE: SREGION Mask */
1030
1031 #if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U)
1032 /* SAU Region Number Register Definitions */
1033 #define SAU_RNR_REGION_Pos                  0U                                            /*!< SAU RNR: REGION Position */
1034 #define SAU_RNR_REGION_Msk                 (0xFFUL /*<< SAU_RNR_REGION_Pos*/)             /*!< SAU RNR: REGION Mask */
1035
1036 /* SAU Region Base Address Register Definitions */
1037 #define SAU_RBAR_BADDR_Pos                  5U                                            /*!< SAU RBAR: BADDR Position */
1038 #define SAU_RBAR_BADDR_Msk                 (0x7FFFFFFUL << SAU_RBAR_BADDR_Pos)            /*!< SAU RBAR: BADDR Mask */
1039
1040 /* SAU Region Limit Address Register Definitions */
1041 #define SAU_RLAR_LADDR_Pos                  5U                                            /*!< SAU RLAR: LADDR Position */
1042 #define SAU_RLAR_LADDR_Msk                 (0x7FFFFFFUL << SAU_RLAR_LADDR_Pos)            /*!< SAU RLAR: LADDR Mask */
1043
1044 #define SAU_RLAR_NSC_Pos                    1U                                            /*!< SAU RLAR: NSC Position */
1045 #define SAU_RLAR_NSC_Msk                   (1UL << SAU_RLAR_NSC_Pos)                      /*!< SAU RLAR: NSC Mask */
1046
1047 #define SAU_RLAR_ENABLE_Pos                 0U                                            /*!< SAU RLAR: ENABLE Position */
1048 #define SAU_RLAR_ENABLE_Msk                (1UL /*<< SAU_RLAR_ENABLE_Pos*/)               /*!< SAU RLAR: ENABLE Mask */
1049
1050 #endif /* defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) */
1051
1052 /*@} end of group CMSIS_SAU */
1053 #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
1054
1055
1056 /* CoreDebug is deprecated. replaced by DCB (Debug Control Block) */
1057 /**
1058   \ingroup  CMSIS_core_register
1059   \defgroup CMSIS_CoreDebug       Core Debug Registers (CoreDebug)
1060   \brief    Type definitions for the Core Debug Registers
1061   @{
1062  */
1063
1064 /**
1065   \brief  \deprecated Structure type to access the Core Debug Register (CoreDebug).
1066  */
1067 typedef struct
1068 {
1069   __IOM uint32_t DHCSR;                  /*!< Offset: 0x000 (R/W)  Debug Halting Control and Status Register */
1070   __OM  uint32_t DCRSR;                  /*!< Offset: 0x004 ( /W)  Debug Core Register Selector Register */
1071   __IOM uint32_t DCRDR;                  /*!< Offset: 0x008 (R/W)  Debug Core Register Data Register */
1072   __IOM uint32_t DEMCR;                  /*!< Offset: 0x00C (R/W)  Debug Exception and Monitor Control Register */
1073         uint32_t RESERVED0[1U];
1074   __IOM uint32_t DAUTHCTRL;              /*!< Offset: 0x014 (R/W)  Debug Authentication Control Register */
1075   __IOM uint32_t DSCSR;                  /*!< Offset: 0x018 (R/W)  Debug Security Control and Status Register */
1076 } CoreDebug_Type;
1077
1078 /* Debug Halting Control and Status Register Definitions */
1079 #define CoreDebug_DHCSR_DBGKEY_Pos         16U                                            /*!< \deprecated CoreDebug DHCSR: DBGKEY Position */
1080 #define CoreDebug_DHCSR_DBGKEY_Msk         (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos)       /*!< \deprecated CoreDebug DHCSR: DBGKEY Mask */
1081
1082 #define CoreDebug_DHCSR_S_RESTART_ST_Pos   26U                                            /*!< \deprecated CoreDebug DHCSR: S_RESTART_ST Position */
1083 #define CoreDebug_DHCSR_S_RESTART_ST_Msk   (1UL << CoreDebug_DHCSR_S_RESTART_ST_Pos)      /*!< \deprecated CoreDebug DHCSR: S_RESTART_ST Mask */
1084
1085 #define CoreDebug_DHCSR_S_RESET_ST_Pos     25U                                            /*!< \deprecated CoreDebug DHCSR: S_RESET_ST Position */
1086 #define CoreDebug_DHCSR_S_RESET_ST_Msk     (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos)        /*!< \deprecated CoreDebug DHCSR: S_RESET_ST Mask */
1087
1088 #define CoreDebug_DHCSR_S_RETIRE_ST_Pos    24U                                            /*!< \deprecated CoreDebug DHCSR: S_RETIRE_ST Position */
1089 #define CoreDebug_DHCSR_S_RETIRE_ST_Msk    (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos)       /*!< \deprecated CoreDebug DHCSR: S_RETIRE_ST Mask */
1090
1091 #define CoreDebug_DHCSR_S_LOCKUP_Pos       19U                                            /*!< \deprecated CoreDebug DHCSR: S_LOCKUP Position */
1092 #define CoreDebug_DHCSR_S_LOCKUP_Msk       (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos)          /*!< \deprecated CoreDebug DHCSR: S_LOCKUP Mask */
1093
1094 #define CoreDebug_DHCSR_S_SLEEP_Pos        18U                                            /*!< \deprecated CoreDebug DHCSR: S_SLEEP Position */
1095 #define CoreDebug_DHCSR_S_SLEEP_Msk        (1UL << CoreDebug_DHCSR_S_SLEEP_Pos)           /*!< \deprecated CoreDebug DHCSR: S_SLEEP Mask */
1096
1097 #define CoreDebug_DHCSR_S_HALT_Pos         17U                                            /*!< \deprecated CoreDebug DHCSR: S_HALT Position */
1098 #define CoreDebug_DHCSR_S_HALT_Msk         (1UL << CoreDebug_DHCSR_S_HALT_Pos)            /*!< \deprecated CoreDebug DHCSR: S_HALT Mask */
1099
1100 #define CoreDebug_DHCSR_S_REGRDY_Pos       16U                                            /*!< \deprecated CoreDebug DHCSR: S_REGRDY Position */
1101 #define CoreDebug_DHCSR_S_REGRDY_Msk       (1UL << CoreDebug_DHCSR_S_REGRDY_Pos)          /*!< \deprecated CoreDebug DHCSR: S_REGRDY Mask */
1102
1103 #define CoreDebug_DHCSR_C_MASKINTS_Pos      3U                                            /*!< \deprecated CoreDebug DHCSR: C_MASKINTS Position */
1104 #define CoreDebug_DHCSR_C_MASKINTS_Msk     (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos)        /*!< \deprecated CoreDebug DHCSR: C_MASKINTS Mask */
1105
1106 #define CoreDebug_DHCSR_C_STEP_Pos          2U                                            /*!< \deprecated CoreDebug DHCSR: C_STEP Position */
1107 #define CoreDebug_DHCSR_C_STEP_Msk         (1UL << CoreDebug_DHCSR_C_STEP_Pos)            /*!< \deprecated CoreDebug DHCSR: C_STEP Mask */
1108
1109 #define CoreDebug_DHCSR_C_HALT_Pos          1U                                            /*!< \deprecated CoreDebug DHCSR: C_HALT Position */
1110 #define CoreDebug_DHCSR_C_HALT_Msk         (1UL << CoreDebug_DHCSR_C_HALT_Pos)            /*!< \deprecated CoreDebug DHCSR: C_HALT Mask */
1111
1112 #define CoreDebug_DHCSR_C_DEBUGEN_Pos       0U                                            /*!< \deprecated CoreDebug DHCSR: C_DEBUGEN Position */
1113 #define CoreDebug_DHCSR_C_DEBUGEN_Msk      (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/)     /*!< \deprecated CoreDebug DHCSR: C_DEBUGEN Mask */
1114
1115 /* Debug Core Register Selector Register Definitions */
1116 #define CoreDebug_DCRSR_REGWnR_Pos         16U                                            /*!< \deprecated CoreDebug DCRSR: REGWnR Position */
1117 #define CoreDebug_DCRSR_REGWnR_Msk         (1UL << CoreDebug_DCRSR_REGWnR_Pos)            /*!< \deprecated CoreDebug DCRSR: REGWnR Mask */
1118
1119 #define CoreDebug_DCRSR_REGSEL_Pos          0U                                            /*!< \deprecated CoreDebug DCRSR: REGSEL Position */
1120 #define CoreDebug_DCRSR_REGSEL_Msk         (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/)     /*!< \deprecated CoreDebug DCRSR: REGSEL Mask */
1121
1122 /* Debug Exception and Monitor Control Register */
1123 #define CoreDebug_DEMCR_DWTENA_Pos         24U                                            /*!< \deprecated CoreDebug DEMCR: DWTENA Position */
1124 #define CoreDebug_DEMCR_DWTENA_Msk         (1UL << CoreDebug_DEMCR_DWTENA_Pos)            /*!< \deprecated CoreDebug DEMCR: DWTENA Mask */
1125
1126 #define CoreDebug_DEMCR_VC_HARDERR_Pos     10U                                            /*!< \deprecated CoreDebug DEMCR: VC_HARDERR Position */
1127 #define CoreDebug_DEMCR_VC_HARDERR_Msk     (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos)        /*!< \deprecated CoreDebug DEMCR: VC_HARDERR Mask */
1128
1129 #define CoreDebug_DEMCR_VC_CORERESET_Pos    0U                                            /*!< \deprecated CoreDebug DEMCR: VC_CORERESET Position */
1130 #define CoreDebug_DEMCR_VC_CORERESET_Msk   (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/)  /*!< \deprecated CoreDebug DEMCR: VC_CORERESET Mask */
1131
1132 /* Debug Authentication Control Register Definitions */
1133 #define CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos  3U                                            /*!< \deprecated CoreDebug DAUTHCTRL: INTSPNIDEN, Position */
1134 #define CoreDebug_DAUTHCTRL_INTSPNIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos)    /*!< \deprecated CoreDebug DAUTHCTRL: INTSPNIDEN, Mask */
1135
1136 #define CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos  2U                                            /*!< \deprecated CoreDebug DAUTHCTRL: SPNIDENSEL Position */
1137 #define CoreDebug_DAUTHCTRL_SPNIDENSEL_Msk (1UL << CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos)    /*!< \deprecated CoreDebug DAUTHCTRL: SPNIDENSEL Mask */
1138
1139 #define CoreDebug_DAUTHCTRL_INTSPIDEN_Pos   1U                                            /*!< \deprecated CoreDebug DAUTHCTRL: INTSPIDEN Position */
1140 #define CoreDebug_DAUTHCTRL_INTSPIDEN_Msk  (1UL << CoreDebug_DAUTHCTRL_INTSPIDEN_Pos)     /*!< \deprecated CoreDebug DAUTHCTRL: INTSPIDEN Mask */
1141
1142 #define CoreDebug_DAUTHCTRL_SPIDENSEL_Pos   0U                                            /*!< \deprecated CoreDebug DAUTHCTRL: SPIDENSEL Position */
1143 #define CoreDebug_DAUTHCTRL_SPIDENSEL_Msk  (1UL /*<< CoreDebug_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< \deprecated CoreDebug DAUTHCTRL: SPIDENSEL Mask */
1144
1145 /* Debug Security Control and Status Register Definitions */
1146 #define CoreDebug_DSCSR_CDS_Pos            16U                                            /*!< \deprecated CoreDebug DSCSR: CDS Position */
1147 #define CoreDebug_DSCSR_CDS_Msk            (1UL << CoreDebug_DSCSR_CDS_Pos)               /*!< \deprecated CoreDebug DSCSR: CDS Mask */
1148
1149 #define CoreDebug_DSCSR_SBRSEL_Pos          1U                                            /*!< \deprecated CoreDebug DSCSR: SBRSEL Position */
1150 #define CoreDebug_DSCSR_SBRSEL_Msk         (1UL << CoreDebug_DSCSR_SBRSEL_Pos)            /*!< \deprecated CoreDebug DSCSR: SBRSEL Mask */
1151
1152 #define CoreDebug_DSCSR_SBRSELEN_Pos        0U                                            /*!< \deprecated CoreDebug DSCSR: SBRSELEN Position */
1153 #define CoreDebug_DSCSR_SBRSELEN_Msk       (1UL /*<< CoreDebug_DSCSR_SBRSELEN_Pos*/)      /*!< \deprecated CoreDebug DSCSR: SBRSELEN Mask */
1154
1155 /*@} end of group CMSIS_CoreDebug */
1156
1157
1158 /**
1159   \ingroup    CMSIS_core_register
1160   \defgroup CMSIS_DCB       Debug Control Block
1161   \brief    Type definitions for the Debug Control Block Registers
1162   @{
1163  */
1164
1165 /**
1166   \brief  Structure type to access the Debug Control Block Registers (DCB).
1167  */
1168 typedef struct
1169 {
1170   __IOM uint32_t DHCSR;                  /*!< Offset: 0x000 (R/W)  Debug Halting Control and Status Register */
1171   __OM  uint32_t DCRSR;                  /*!< Offset: 0x004 ( /W)  Debug Core Register Selector Register */
1172   __IOM uint32_t DCRDR;                  /*!< Offset: 0x008 (R/W)  Debug Core Register Data Register */
1173   __IOM uint32_t DEMCR;                  /*!< Offset: 0x00C (R/W)  Debug Exception and Monitor Control Register */
1174         uint32_t RESERVED0[1U];
1175   __IOM uint32_t DAUTHCTRL;              /*!< Offset: 0x014 (R/W)  Debug Authentication Control Register */
1176   __IOM uint32_t DSCSR;                  /*!< Offset: 0x018 (R/W)  Debug Security Control and Status Register */
1177 } DCB_Type;
1178
1179 /* DHCSR, Debug Halting Control and Status Register Definitions */
1180 #define DCB_DHCSR_DBGKEY_Pos               16U                                            /*!< DCB DHCSR: Debug key Position */
1181 #define DCB_DHCSR_DBGKEY_Msk               (0xFFFFUL << DCB_DHCSR_DBGKEY_Pos)             /*!< DCB DHCSR: Debug key Mask */
1182
1183 #define DCB_DHCSR_S_RESTART_ST_Pos         26U                                            /*!< DCB DHCSR: Restart sticky status Position */
1184 #define DCB_DHCSR_S_RESTART_ST_Msk         (0x1UL << DCB_DHCSR_S_RESTART_ST_Pos)          /*!< DCB DHCSR: Restart sticky status Mask */
1185
1186 #define DCB_DHCSR_S_RESET_ST_Pos           25U                                            /*!< DCB DHCSR: Reset sticky status Position */
1187 #define DCB_DHCSR_S_RESET_ST_Msk           (0x1UL << DCB_DHCSR_S_RESET_ST_Pos)            /*!< DCB DHCSR: Reset sticky status Mask */
1188
1189 #define DCB_DHCSR_S_RETIRE_ST_Pos          24U                                            /*!< DCB DHCSR: Retire sticky status Position */
1190 #define DCB_DHCSR_S_RETIRE_ST_Msk          (0x1UL << DCB_DHCSR_S_RETIRE_ST_Pos)           /*!< DCB DHCSR: Retire sticky status Mask */
1191
1192 #define DCB_DHCSR_S_SDE_Pos                20U                                            /*!< DCB DHCSR: Secure debug enabled Position */
1193 #define DCB_DHCSR_S_SDE_Msk                (0x1UL << DCB_DHCSR_S_SDE_Pos)                 /*!< DCB DHCSR: Secure debug enabled Mask */
1194
1195 #define DCB_DHCSR_S_LOCKUP_Pos             19U                                            /*!< DCB DHCSR: Lockup status Position */
1196 #define DCB_DHCSR_S_LOCKUP_Msk             (0x1UL << DCB_DHCSR_S_LOCKUP_Pos)              /*!< DCB DHCSR: Lockup status Mask */
1197
1198 #define DCB_DHCSR_S_SLEEP_Pos              18U                                            /*!< DCB DHCSR: Sleeping status Position */
1199 #define DCB_DHCSR_S_SLEEP_Msk              (0x1UL << DCB_DHCSR_S_SLEEP_Pos)               /*!< DCB DHCSR: Sleeping status Mask */
1200
1201 #define DCB_DHCSR_S_HALT_Pos               17U                                            /*!< DCB DHCSR: Halted status Position */
1202 #define DCB_DHCSR_S_HALT_Msk               (0x1UL << DCB_DHCSR_S_HALT_Pos)                /*!< DCB DHCSR: Halted status Mask */
1203
1204 #define DCB_DHCSR_S_REGRDY_Pos             16U                                            /*!< DCB DHCSR: Register ready status Position */
1205 #define DCB_DHCSR_S_REGRDY_Msk             (0x1UL << DCB_DHCSR_S_REGRDY_Pos)              /*!< DCB DHCSR: Register ready status Mask */
1206
1207 #define DCB_DHCSR_C_MASKINTS_Pos            3U                                            /*!< DCB DHCSR: Mask interrupts control Position */
1208 #define DCB_DHCSR_C_MASKINTS_Msk           (0x1UL << DCB_DHCSR_C_MASKINTS_Pos)            /*!< DCB DHCSR: Mask interrupts control Mask */
1209
1210 #define DCB_DHCSR_C_STEP_Pos                2U                                            /*!< DCB DHCSR: Step control Position */
1211 #define DCB_DHCSR_C_STEP_Msk               (0x1UL << DCB_DHCSR_C_STEP_Pos)                /*!< DCB DHCSR: Step control Mask */
1212
1213 #define DCB_DHCSR_C_HALT_Pos                1U                                            /*!< DCB DHCSR: Halt control Position */
1214 #define DCB_DHCSR_C_HALT_Msk               (0x1UL << DCB_DHCSR_C_HALT_Pos)                /*!< DCB DHCSR: Halt control Mask */
1215
1216 #define DCB_DHCSR_C_DEBUGEN_Pos             0U                                            /*!< DCB DHCSR: Debug enable control Position */
1217 #define DCB_DHCSR_C_DEBUGEN_Msk            (0x1UL /*<< DCB_DHCSR_C_DEBUGEN_Pos*/)         /*!< DCB DHCSR: Debug enable control Mask */
1218
1219 /* DCRSR, Debug Core Register Select Register Definitions */
1220 #define DCB_DCRSR_REGWnR_Pos               16U                                            /*!< DCB DCRSR: Register write/not-read Position */
1221 #define DCB_DCRSR_REGWnR_Msk               (0x1UL << DCB_DCRSR_REGWnR_Pos)                /*!< DCB DCRSR: Register write/not-read Mask */
1222
1223 #define DCB_DCRSR_REGSEL_Pos                0U                                            /*!< DCB DCRSR: Register selector Position */
1224 #define DCB_DCRSR_REGSEL_Msk               (0x7FUL /*<< DCB_DCRSR_REGSEL_Pos*/)           /*!< DCB DCRSR: Register selector Mask */
1225
1226 /* DCRDR, Debug Core Register Data Register Definitions */
1227 #define DCB_DCRDR_DBGTMP_Pos                0U                                            /*!< DCB DCRDR: Data temporary buffer Position */
1228 #define DCB_DCRDR_DBGTMP_Msk               (0xFFFFFFFFUL /*<< DCB_DCRDR_DBGTMP_Pos*/)     /*!< DCB DCRDR: Data temporary buffer Mask */
1229
1230 /* DEMCR, Debug Exception and Monitor Control Register Definitions */
1231 #define DCB_DEMCR_TRCENA_Pos               24U                                            /*!< DCB DEMCR: Trace enable Position */
1232 #define DCB_DEMCR_TRCENA_Msk               (0x1UL << DCB_DEMCR_TRCENA_Pos)                /*!< DCB DEMCR: Trace enable Mask */
1233
1234 #define DCB_DEMCR_VC_HARDERR_Pos           10U                                            /*!< DCB DEMCR: Vector Catch HardFault errors Position */
1235 #define DCB_DEMCR_VC_HARDERR_Msk           (0x1UL << DCB_DEMCR_VC_HARDERR_Pos)            /*!< DCB DEMCR: Vector Catch HardFault errors Mask */
1236
1237 #define DCB_DEMCR_VC_CORERESET_Pos          0U                                            /*!< DCB DEMCR: Vector Catch Core reset Position */
1238 #define DCB_DEMCR_VC_CORERESET_Msk         (0x1UL /*<< DCB_DEMCR_VC_CORERESET_Pos*/)      /*!< DCB DEMCR: Vector Catch Core reset Mask */
1239
1240 /* DAUTHCTRL, Debug Authentication Control Register Definitions */
1241 #define DCB_DAUTHCTRL_INTSPNIDEN_Pos        3U                                            /*!< DCB DAUTHCTRL: Internal Secure non-invasive debug enable Position */
1242 #define DCB_DAUTHCTRL_INTSPNIDEN_Msk       (0x1UL << DCB_DAUTHCTRL_INTSPNIDEN_Pos)        /*!< DCB DAUTHCTRL: Internal Secure non-invasive debug enable Mask */
1243
1244 #define DCB_DAUTHCTRL_SPNIDENSEL_Pos        2U                                            /*!< DCB DAUTHCTRL: Secure non-invasive debug enable select Position */
1245 #define DCB_DAUTHCTRL_SPNIDENSEL_Msk       (0x1UL << DCB_DAUTHCTRL_SPNIDENSEL_Pos)        /*!< DCB DAUTHCTRL: Secure non-invasive debug enable select Mask */
1246
1247 #define DCB_DAUTHCTRL_INTSPIDEN_Pos         1U                                            /*!< DCB DAUTHCTRL: Internal Secure invasive debug enable Position */
1248 #define DCB_DAUTHCTRL_INTSPIDEN_Msk        (0x1UL << DCB_DAUTHCTRL_INTSPIDEN_Pos)         /*!< DCB DAUTHCTRL: Internal Secure invasive debug enable Mask */
1249
1250 #define DCB_DAUTHCTRL_SPIDENSEL_Pos         0U                                            /*!< DCB DAUTHCTRL: Secure invasive debug enable select Position */
1251 #define DCB_DAUTHCTRL_SPIDENSEL_Msk        (0x1UL /*<< DCB_DAUTHCTRL_SPIDENSEL_Pos*/)     /*!< DCB DAUTHCTRL: Secure invasive debug enable select Mask */
1252
1253 /* DSCSR, Debug Security Control and Status Register Definitions */
1254 #define DCB_DSCSR_CDSKEY_Pos               17U                                            /*!< DCB DSCSR: CDS write-enable key Position */
1255 #define DCB_DSCSR_CDSKEY_Msk               (0x1UL << DCB_DSCSR_CDSKEY_Pos)                /*!< DCB DSCSR: CDS write-enable key Mask */
1256
1257 #define DCB_DSCSR_CDS_Pos                  16U                                            /*!< DCB DSCSR: Current domain Secure Position */
1258 #define DCB_DSCSR_CDS_Msk                  (0x1UL << DCB_DSCSR_CDS_Pos)                   /*!< DCB DSCSR: Current domain Secure Mask */
1259
1260 #define DCB_DSCSR_SBRSEL_Pos                1U                                            /*!< DCB DSCSR: Secure banked register select Position */
1261 #define DCB_DSCSR_SBRSEL_Msk               (0x1UL << DCB_DSCSR_SBRSEL_Pos)                /*!< DCB DSCSR: Secure banked register select Mask */
1262
1263 #define DCB_DSCSR_SBRSELEN_Pos              0U                                            /*!< DCB DSCSR: Secure banked register select enable Position */
1264 #define DCB_DSCSR_SBRSELEN_Msk             (0x1UL /*<< DCB_DSCSR_SBRSELEN_Pos*/)          /*!< DCB DSCSR: Secure banked register select enable Mask */
1265
1266 /*@} end of group CMSIS_DCB */
1267
1268
1269
1270 /**
1271   \ingroup  CMSIS_core_register
1272   \defgroup CMSIS_DIB       Debug Identification Block
1273   \brief    Type definitions for the Debug Identification Block Registers
1274   @{
1275  */
1276
1277 /**
1278   \brief  Structure type to access the Debug Identification Block Registers (DIB).
1279  */
1280 typedef struct
1281 {
1282   __OM  uint32_t DLAR;                   /*!< Offset: 0x000 ( /W)  SCS Software Lock Access Register */
1283   __IM  uint32_t DLSR;                   /*!< Offset: 0x004 (R/ )  SCS Software Lock Status Register */
1284   __IM  uint32_t DAUTHSTATUS;            /*!< Offset: 0x008 (R/ )  Debug Authentication Status Register */
1285   __IM  uint32_t DDEVARCH;               /*!< Offset: 0x00C (R/ )  SCS Device Architecture Register */
1286   __IM  uint32_t DDEVTYPE;               /*!< Offset: 0x010 (R/ )  SCS Device Type Register */
1287 } DIB_Type;
1288
1289 /* DLAR, SCS Software Lock Access Register Definitions */
1290 #define DIB_DLAR_KEY_Pos                    0U                                            /*!< DIB DLAR: KEY Position */
1291 #define DIB_DLAR_KEY_Msk                   (0xFFFFFFFFUL /*<< DIB_DLAR_KEY_Pos */)        /*!< DIB DLAR: KEY Mask */
1292
1293 /* DLSR, SCS Software Lock Status Register Definitions */
1294 #define DIB_DLSR_nTT_Pos                    2U                                            /*!< DIB DLSR: Not thirty-two bit Position */
1295 #define DIB_DLSR_nTT_Msk                   (0x1UL << DIB_DLSR_nTT_Pos )                   /*!< DIB DLSR: Not thirty-two bit Mask */
1296
1297 #define DIB_DLSR_SLK_Pos                    1U                                            /*!< DIB DLSR: Software Lock status Position */
1298 #define DIB_DLSR_SLK_Msk                   (0x1UL << DIB_DLSR_SLK_Pos )                   /*!< DIB DLSR: Software Lock status Mask */
1299
1300 #define DIB_DLSR_SLI_Pos                    0U                                            /*!< DIB DLSR: Software Lock implemented Position */
1301 #define DIB_DLSR_SLI_Msk                   (0x1UL /*<< DIB_DLSR_SLI_Pos*/)                /*!< DIB DLSR: Software Lock implemented Mask */
1302
1303 /* DAUTHSTATUS, Debug Authentication Status Register Definitions */
1304 #define DIB_DAUTHSTATUS_SNID_Pos            6U                                            /*!< DIB DAUTHSTATUS: Secure Non-invasive Debug Position */
1305 #define DIB_DAUTHSTATUS_SNID_Msk           (0x3UL << DIB_DAUTHSTATUS_SNID_Pos )           /*!< DIB DAUTHSTATUS: Secure Non-invasive Debug Mask */
1306
1307 #define DIB_DAUTHSTATUS_SID_Pos             4U                                            /*!< DIB DAUTHSTATUS: Secure Invasive Debug Position */
1308 #define DIB_DAUTHSTATUS_SID_Msk            (0x3UL << DIB_DAUTHSTATUS_SID_Pos )            /*!< DIB DAUTHSTATUS: Secure Invasive Debug Mask */
1309
1310 #define DIB_DAUTHSTATUS_NSNID_Pos           2U                                            /*!< DIB DAUTHSTATUS: Non-secure Non-invasive Debug Position */
1311 #define DIB_DAUTHSTATUS_NSNID_Msk          (0x3UL << DIB_DAUTHSTATUS_NSNID_Pos )          /*!< DIB DAUTHSTATUS: Non-secure Non-invasive Debug Mask */
1312
1313 #define DIB_DAUTHSTATUS_NSID_Pos            0U                                            /*!< DIB DAUTHSTATUS: Non-secure Invasive Debug Position */
1314 #define DIB_DAUTHSTATUS_NSID_Msk           (0x3UL /*<< DIB_DAUTHSTATUS_NSID_Pos*/)        /*!< DIB DAUTHSTATUS: Non-secure Invasive Debug Mask */
1315
1316 /* DDEVARCH, SCS Device Architecture Register Definitions */
1317 #define DIB_DDEVARCH_ARCHITECT_Pos         21U                                            /*!< DIB DDEVARCH: Architect Position */
1318 #define DIB_DDEVARCH_ARCHITECT_Msk         (0x7FFUL << DIB_DDEVARCH_ARCHITECT_Pos )       /*!< DIB DDEVARCH: Architect Mask */
1319
1320 #define DIB_DDEVARCH_PRESENT_Pos           20U                                            /*!< DIB DDEVARCH: DEVARCH Present Position */
1321 #define DIB_DDEVARCH_PRESENT_Msk           (0x1FUL << DIB_DDEVARCH_PRESENT_Pos )          /*!< DIB DDEVARCH: DEVARCH Present Mask */
1322
1323 #define DIB_DDEVARCH_REVISION_Pos          16U                                            /*!< DIB DDEVARCH: Revision Position */
1324 #define DIB_DDEVARCH_REVISION_Msk          (0xFUL << DIB_DDEVARCH_REVISION_Pos )          /*!< DIB DDEVARCH: Revision Mask */
1325
1326 #define DIB_DDEVARCH_ARCHVER_Pos           12U                                            /*!< DIB DDEVARCH: Architecture Version Position */
1327 #define DIB_DDEVARCH_ARCHVER_Msk           (0xFUL << DIB_DDEVARCH_ARCHVER_Pos )           /*!< DIB DDEVARCH: Architecture Version Mask */
1328
1329 #define DIB_DDEVARCH_ARCHPART_Pos           0U                                            /*!< DIB DDEVARCH: Architecture Part Position */
1330 #define DIB_DDEVARCH_ARCHPART_Msk          (0xFFFUL /*<< DIB_DDEVARCH_ARCHPART_Pos*/)     /*!< DIB DDEVARCH: Architecture Part Mask */
1331
1332 /* DDEVTYPE, SCS Device Type Register Definitions */
1333 #define DIB_DDEVTYPE_SUB_Pos                4U                                            /*!< DIB DDEVTYPE: Sub-type Position */
1334 #define DIB_DDEVTYPE_SUB_Msk               (0xFUL << DIB_DDEVTYPE_SUB_Pos )               /*!< DIB DDEVTYPE: Sub-type Mask */
1335
1336 #define DIB_DDEVTYPE_MAJOR_Pos              0U                                            /*!< DIB DDEVTYPE: Major type Position */
1337 #define DIB_DDEVTYPE_MAJOR_Msk             (0xFUL /*<< DIB_DDEVTYPE_MAJOR_Pos*/)          /*!< DIB DDEVTYPE: Major type Mask */
1338
1339
1340 /*@} end of group CMSIS_DIB */
1341
1342
1343 /**
1344   \ingroup    CMSIS_core_register
1345   \defgroup   CMSIS_core_bitfield     Core register bit field macros
1346   \brief      Macros for use with bit field definitions (xxx_Pos, xxx_Msk).
1347   @{
1348  */
1349
1350 /**
1351   \brief   Mask and shift a bit field value for use in a register bit range.
1352   \param[in] field  Name of the register bit field.
1353   \param[in] value  Value of the bit field. This parameter is interpreted as an uint32_t type.
1354   \return           Masked and shifted value.
1355 */
1356 #define _VAL2FLD(field, value)    (((uint32_t)(value) << field ## _Pos) & field ## _Msk)
1357
1358 /**
1359   \brief     Mask and shift a register value to extract a bit filed value.
1360   \param[in] field  Name of the register bit field.
1361   \param[in] value  Value of register. This parameter is interpreted as an uint32_t type.
1362   \return           Masked and shifted bit field value.
1363 */
1364 #define _FLD2VAL(field, value)    (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)
1365
1366 /*@} end of group CMSIS_core_bitfield */
1367
1368
1369 /**
1370   \ingroup    CMSIS_core_register
1371   \defgroup   CMSIS_core_base     Core Definitions
1372   \brief      Definitions for base addresses, unions, and structures.
1373   @{
1374  */
1375
1376 /* Memory mapping of Core Hardware */
1377   #define SCS_BASE            (0xE000E000UL)                             /*!< System Control Space Base Address */
1378   #define DWT_BASE            (0xE0001000UL)                             /*!< DWT Base Address */
1379   #define TPI_BASE            (0xE0040000UL)                             /*!< TPI Base Address */
1380   #define CoreDebug_BASE      (0xE000EDF0UL)                             /*!< \deprecated Core Debug Base Address */
1381   #define DCB_BASE            (0xE000EDF0UL)                             /*!< DCB Base Address */
1382   #define DIB_BASE            (0xE000EFB0UL)                             /*!< DIB Base Address */
1383   #define SysTick_BASE        (SCS_BASE +  0x0010UL)                     /*!< SysTick Base Address */
1384   #define NVIC_BASE           (SCS_BASE +  0x0100UL)                     /*!< NVIC Base Address */
1385   #define SCB_BASE            (SCS_BASE +  0x0D00UL)                     /*!< System Control Block Base Address */
1386
1387
1388   #define SCB                 ((SCB_Type       *)     SCB_BASE         ) /*!< SCB configuration struct */
1389   #define SysTick             ((SysTick_Type   *)     SysTick_BASE     ) /*!< SysTick configuration struct */
1390   #define NVIC                ((NVIC_Type      *)     NVIC_BASE        ) /*!< NVIC configuration struct */
1391   #define DWT                 ((DWT_Type       *)     DWT_BASE         ) /*!< DWT configuration struct */
1392   #define TPI                 ((TPI_Type       *)     TPI_BASE         ) /*!< TPI configuration struct */
1393   #define CoreDebug           ((CoreDebug_Type *)     CoreDebug_BASE   ) /*!< \deprecated Core Debug configuration struct */
1394   #define DCB                 ((DCB_Type       *)     DCB_BASE         ) /*!< DCB configuration struct */
1395   #define DIB                 ((DIB_Type       *)     DIB_BASE         ) /*!< DIB configuration struct */
1396
1397   #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
1398     #define MPU_BASE          (SCS_BASE +  0x0D90UL)                     /*!< Memory Protection Unit */
1399     #define MPU               ((MPU_Type       *)     MPU_BASE         ) /*!< Memory Protection Unit */
1400   #endif
1401
1402   #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
1403     #define SAU_BASE          (SCS_BASE +  0x0DD0UL)                     /*!< Security Attribution Unit */
1404     #define SAU               ((SAU_Type       *)     SAU_BASE         ) /*!< Security Attribution Unit */
1405   #endif
1406
1407 #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
1408   #define SCS_BASE_NS         (0xE002E000UL)                             /*!< System Control Space Base Address (non-secure address space) */
1409   #define CoreDebug_BASE_NS   (0xE002EDF0UL)                             /*!< \deprecated Core Debug Base Address           (non-secure address space) */
1410   #define DCB_BASE_NS         (0xE002EDF0UL)                             /*!< DCB Base Address                  (non-secure address space) */
1411   #define DIB_BASE_NS         (0xE002EFB0UL)                             /*!< DIB Base Address                  (non-secure address space) */
1412   #define SysTick_BASE_NS     (SCS_BASE_NS +  0x0010UL)                  /*!< SysTick Base Address              (non-secure address space) */
1413   #define NVIC_BASE_NS        (SCS_BASE_NS +  0x0100UL)                  /*!< NVIC Base Address                 (non-secure address space) */
1414   #define SCB_BASE_NS         (SCS_BASE_NS +  0x0D00UL)                  /*!< System Control Block Base Address (non-secure address space) */
1415
1416   #define SCB_NS              ((SCB_Type       *)     SCB_BASE_NS      ) /*!< SCB configuration struct          (non-secure address space) */
1417   #define SysTick_NS          ((SysTick_Type   *)     SysTick_BASE_NS  ) /*!< SysTick configuration struct      (non-secure address space) */
1418   #define NVIC_NS             ((NVIC_Type      *)     NVIC_BASE_NS     ) /*!< NVIC configuration struct         (non-secure address space) */
1419   #define CoreDebug_NS        ((CoreDebug_Type *)     CoreDebug_BASE_NS) /*!< \deprecated Core Debug configuration struct   (non-secure address space) */
1420   #define DCB_NS              ((DCB_Type       *)     DCB_BASE_NS      ) /*!< DCB configuration struct          (non-secure address space) */
1421   #define DIB_NS              ((DIB_Type       *)     DIB_BASE_NS      ) /*!< DIB configuration struct          (non-secure address space) */
1422
1423   #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
1424     #define MPU_BASE_NS       (SCS_BASE_NS +  0x0D90UL)                  /*!< Memory Protection Unit            (non-secure address space) */
1425     #define MPU_NS            ((MPU_Type       *)     MPU_BASE_NS      ) /*!< Memory Protection Unit            (non-secure address space) */
1426   #endif
1427
1428 #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
1429 /*@} */
1430
1431
1432
1433 /*******************************************************************************
1434  *                Hardware Abstraction Layer
1435   Core Function Interface contains:
1436   - Core NVIC Functions
1437   - Core SysTick Functions
1438   - Core Debug Functions
1439   - Core Register Access Functions
1440  ******************************************************************************/
1441 /**
1442   \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference
1443 */
1444
1445
1446
1447 /* ##########################   NVIC functions  #################################### */
1448 /**
1449   \ingroup  CMSIS_Core_FunctionInterface
1450   \defgroup CMSIS_Core_NVICFunctions NVIC Functions
1451   \brief    Functions that manage interrupts and exceptions via the NVIC.
1452   @{
1453  */
1454
1455 #ifdef CMSIS_NVIC_VIRTUAL
1456   #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE
1457     #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"
1458   #endif
1459   #include CMSIS_NVIC_VIRTUAL_HEADER_FILE
1460 #else
1461 /*        NVIC_SetPriorityGrouping    not available for Cortex-M23 */
1462 /*        NVIC_GetPriorityGrouping    not available for Cortex-M23 */
1463   #define NVIC_EnableIRQ              __NVIC_EnableIRQ
1464   #define NVIC_GetEnableIRQ           __NVIC_GetEnableIRQ
1465   #define NVIC_DisableIRQ             __NVIC_DisableIRQ
1466   #define NVIC_GetPendingIRQ          __NVIC_GetPendingIRQ
1467   #define NVIC_SetPendingIRQ          __NVIC_SetPendingIRQ
1468   #define NVIC_ClearPendingIRQ        __NVIC_ClearPendingIRQ
1469   #define NVIC_GetActive              __NVIC_GetActive
1470   #define NVIC_SetPriority            __NVIC_SetPriority
1471   #define NVIC_GetPriority            __NVIC_GetPriority
1472   #define NVIC_SystemReset            __NVIC_SystemReset
1473 #endif /* CMSIS_NVIC_VIRTUAL */
1474
1475 #ifdef CMSIS_VECTAB_VIRTUAL
1476   #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE
1477     #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"
1478   #endif
1479   #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE
1480 #else
1481   #define NVIC_SetVector              __NVIC_SetVector
1482   #define NVIC_GetVector              __NVIC_GetVector
1483 #endif  /* (CMSIS_VECTAB_VIRTUAL) */
1484
1485 #define NVIC_USER_IRQ_OFFSET          16
1486
1487
1488 /* Special LR values for Secure/Non-Secure call handling and exception handling                                               */
1489
1490 /* Function Return Payload (from ARMv8-M Architecture Reference Manual) LR value on entry from Secure BLXNS                   */ 
1491 #define FNC_RETURN                 (0xFEFFFFFFUL)     /* bit [0] ignored when processing a branch                             */
1492
1493 /* The following EXC_RETURN mask values are used to evaluate the LR on exception entry */
1494 #define EXC_RETURN_PREFIX          (0xFF000000UL)     /* bits [31:24] set to indicate an EXC_RETURN value                     */
1495 #define EXC_RETURN_S               (0x00000040UL)     /* bit [6] stack used to push registers: 0=Non-secure 1=Secure          */
1496 #define EXC_RETURN_DCRS            (0x00000020UL)     /* bit [5] stacking rules for called registers: 0=skipped 1=saved       */
1497 #define EXC_RETURN_FTYPE           (0x00000010UL)     /* bit [4] allocate stack for floating-point context: 0=done 1=skipped  */
1498 #define EXC_RETURN_MODE            (0x00000008UL)     /* bit [3] processor mode for return: 0=Handler mode 1=Thread mode      */
1499 #define EXC_RETURN_SPSEL           (0x00000004UL)     /* bit [2] stack pointer used to restore context: 0=MSP 1=PSP           */
1500 #define EXC_RETURN_ES              (0x00000001UL)     /* bit [0] security state exception was taken to: 0=Non-secure 1=Secure */
1501
1502 /* Integrity Signature (from ARMv8-M Architecture Reference Manual) for exception context stacking                            */
1503 #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)  /* Value for processors with floating-point extension:                  */
1504 #define EXC_INTEGRITY_SIGNATURE     (0xFEFA125AUL)     /* bit [0] SFTC must match LR bit[4] EXC_RETURN_FTYPE                   */
1505 #else
1506 #define EXC_INTEGRITY_SIGNATURE     (0xFEFA125BUL)     /* Value for processors without floating-point extension                */
1507 #endif
1508
1509
1510 /* Interrupt Priorities are WORD accessible only under Armv6-M                  */
1511 /* The following MACROS handle generation of the register offset and byte masks */
1512 #define _BIT_SHIFT(IRQn)         (  ((((uint32_t)(int32_t)(IRQn))         )      &  0x03UL) * 8UL)
1513 #define _SHP_IDX(IRQn)           ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >>    2UL)      )
1514 #define _IP_IDX(IRQn)            (   (((uint32_t)(int32_t)(IRQn))                >>    2UL)      )
1515
1516 #define __NVIC_SetPriorityGrouping(X) (void)(X)
1517 #define __NVIC_GetPriorityGrouping()  (0U)
1518
1519 /**
1520   \brief   Enable Interrupt
1521   \details Enables a device specific interrupt in the NVIC interrupt controller.
1522   \param [in]      IRQn  Device specific interrupt number.
1523   \note    IRQn must not be negative.
1524  */
1525 __STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)
1526 {
1527   if ((int32_t)(IRQn) >= 0)
1528   {
1529     __COMPILER_BARRIER();
1530     NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
1531     __COMPILER_BARRIER();
1532   }
1533 }
1534
1535
1536 /**
1537   \brief   Get Interrupt Enable status
1538   \details Returns a device specific interrupt enable status from the NVIC interrupt controller.
1539   \param [in]      IRQn  Device specific interrupt number.
1540   \return             0  Interrupt is not enabled.
1541   \return             1  Interrupt is enabled.
1542   \note    IRQn must not be negative.
1543  */
1544 __STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)
1545 {
1546   if ((int32_t)(IRQn) >= 0)
1547   {
1548     return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
1549   }
1550   else
1551   {
1552     return(0U);
1553   }
1554 }
1555
1556
1557 /**
1558   \brief   Disable Interrupt
1559   \details Disables a device specific interrupt in the NVIC interrupt controller.
1560   \param [in]      IRQn  Device specific interrupt number.
1561   \note    IRQn must not be negative.
1562  */
1563 __STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)
1564 {
1565   if ((int32_t)(IRQn) >= 0)
1566   {
1567     NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
1568     __DSB();
1569     __ISB();
1570   }
1571 }
1572
1573
1574 /**
1575   \brief   Get Pending Interrupt
1576   \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.
1577   \param [in]      IRQn  Device specific interrupt number.
1578   \return             0  Interrupt status is not pending.
1579   \return             1  Interrupt status is pending.
1580   \note    IRQn must not be negative.
1581  */
1582 __STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)
1583 {
1584   if ((int32_t)(IRQn) >= 0)
1585   {
1586     return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
1587   }
1588   else
1589   {
1590     return(0U);
1591   }
1592 }
1593
1594
1595 /**
1596   \brief   Set Pending Interrupt
1597   \details Sets the pending bit of a device specific interrupt in the NVIC pending register.
1598   \param [in]      IRQn  Device specific interrupt number.
1599   \note    IRQn must not be negative.
1600  */
1601 __STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)
1602 {
1603   if ((int32_t)(IRQn) >= 0)
1604   {
1605     NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
1606   }
1607 }
1608
1609
1610 /**
1611   \brief   Clear Pending Interrupt
1612   \details Clears the pending bit of a device specific interrupt in the NVIC pending register.
1613   \param [in]      IRQn  Device specific interrupt number.
1614   \note    IRQn must not be negative.
1615  */
1616 __STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)
1617 {
1618   if ((int32_t)(IRQn) >= 0)
1619   {
1620     NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
1621   }
1622 }
1623
1624
1625 /**
1626   \brief   Get Active Interrupt
1627   \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt.
1628   \param [in]      IRQn  Device specific interrupt number.
1629   \return             0  Interrupt status is not active.
1630   \return             1  Interrupt status is active.
1631   \note    IRQn must not be negative.
1632  */
1633 __STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn)
1634 {
1635   if ((int32_t)(IRQn) >= 0)
1636   {
1637     return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
1638   }
1639   else
1640   {
1641     return(0U);
1642   }
1643 }
1644
1645
1646 #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
1647 /**
1648   \brief   Get Interrupt Target State
1649   \details Reads the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.
1650   \param [in]      IRQn  Device specific interrupt number.
1651   \return             0  if interrupt is assigned to Secure
1652   \return             1  if interrupt is assigned to Non Secure
1653   \note    IRQn must not be negative.
1654  */
1655 __STATIC_INLINE uint32_t NVIC_GetTargetState(IRQn_Type IRQn)
1656 {
1657   if ((int32_t)(IRQn) >= 0)
1658   {
1659     return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
1660   }
1661   else
1662   {
1663     return(0U);
1664   }
1665 }
1666
1667
1668 /**
1669   \brief   Set Interrupt Target State
1670   \details Sets the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.
1671   \param [in]      IRQn  Device specific interrupt number.
1672   \return             0  if interrupt is assigned to Secure
1673                       1  if interrupt is assigned to Non Secure
1674   \note    IRQn must not be negative.
1675  */
1676 __STATIC_INLINE uint32_t NVIC_SetTargetState(IRQn_Type IRQn)
1677 {
1678   if ((int32_t)(IRQn) >= 0)
1679   {
1680     NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] |=  ((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)));
1681     return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
1682   }
1683   else
1684   {
1685     return(0U);
1686   }
1687 }
1688
1689
1690 /**
1691   \brief   Clear Interrupt Target State
1692   \details Clears the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.
1693   \param [in]      IRQn  Device specific interrupt number.
1694   \return             0  if interrupt is assigned to Secure
1695                       1  if interrupt is assigned to Non Secure
1696   \note    IRQn must not be negative.
1697  */
1698 __STATIC_INLINE uint32_t NVIC_ClearTargetState(IRQn_Type IRQn)
1699 {
1700   if ((int32_t)(IRQn) >= 0)
1701   {
1702     NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)));
1703     return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
1704   }
1705   else
1706   {
1707     return(0U);
1708   }
1709 }
1710 #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
1711
1712
1713 /**
1714   \brief   Set Interrupt Priority
1715   \details Sets the priority of a device specific interrupt or a processor exception.
1716            The interrupt number can be positive to specify a device specific interrupt,
1717            or negative to specify a processor exception.
1718   \param [in]      IRQn  Interrupt number.
1719   \param [in]  priority  Priority to set.
1720   \note    The priority cannot be set for every processor exception.
1721  */
1722 __STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
1723 {
1724   if ((int32_t)(IRQn) >= 0)
1725   {
1726     NVIC->IPR[_IP_IDX(IRQn)]  = ((uint32_t)(NVIC->IPR[_IP_IDX(IRQn)]  & ~(0xFFUL << _BIT_SHIFT(IRQn))) |
1727        (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));
1728   }
1729   else
1730   {
1731     SCB->SHPR[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHPR[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |
1732        (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));
1733   }
1734 }
1735
1736
1737 /**
1738   \brief   Get Interrupt Priority
1739   \details Reads the priority of a device specific interrupt or a processor exception.
1740            The interrupt number can be positive to specify a device specific interrupt,
1741            or negative to specify a processor exception.
1742   \param [in]   IRQn  Interrupt number.
1743   \return             Interrupt Priority.
1744                       Value is aligned automatically to the implemented priority bits of the microcontroller.
1745  */
1746 __STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)
1747 {
1748
1749   if ((int32_t)(IRQn) >= 0)
1750   {
1751     return((uint32_t)(((NVIC->IPR[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));
1752   }
1753   else
1754   {
1755     return((uint32_t)(((SCB->SHPR[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));
1756   }
1757 }
1758
1759
1760 /**
1761   \brief   Encode Priority
1762   \details Encodes the priority for an interrupt with the given priority group,
1763            preemptive priority value, and subpriority value.
1764            In case of a conflict between priority grouping and available
1765            priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.
1766   \param [in]     PriorityGroup  Used priority group.
1767   \param [in]   PreemptPriority  Preemptive priority value (starting from 0).
1768   \param [in]       SubPriority  Subpriority value (starting from 0).
1769   \return                        Encoded priority. Value can be used in the function \ref NVIC_SetPriority().
1770  */
1771 __STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
1772 {
1773   uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */
1774   uint32_t PreemptPriorityBits;
1775   uint32_t SubPriorityBits;
1776
1777   PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
1778   SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
1779
1780   return (
1781            ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |
1782            ((SubPriority     & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL)))
1783          );
1784 }
1785
1786
1787 /**
1788   \brief   Decode Priority
1789   \details Decodes an interrupt priority value with a given priority group to
1790            preemptive priority value and subpriority value.
1791            In case of a conflict between priority grouping and available
1792            priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.
1793   \param [in]         Priority   Priority value, which can be retrieved with the function \ref NVIC_GetPriority().
1794   \param [in]     PriorityGroup  Used priority group.
1795   \param [out] pPreemptPriority  Preemptive priority value (starting from 0).
1796   \param [out]     pSubPriority  Subpriority value (starting from 0).
1797  */
1798 __STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)
1799 {
1800   uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);   /* only values 0..7 are used          */
1801   uint32_t PreemptPriorityBits;
1802   uint32_t SubPriorityBits;
1803
1804   PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
1805   SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
1806
1807   *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);
1808   *pSubPriority     = (Priority                   ) & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL);
1809 }
1810
1811
1812 /**
1813   \brief   Set Interrupt Vector
1814   \details Sets an interrupt vector in SRAM based interrupt vector table.
1815            The interrupt number can be positive to specify a device specific interrupt,
1816            or negative to specify a processor exception.
1817            VTOR must been relocated to SRAM before.
1818            If VTOR is not present address 0 must be mapped to SRAM.
1819   \param [in]   IRQn      Interrupt number
1820   \param [in]   vector    Address of interrupt handler function
1821  */
1822 __STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
1823 {
1824 #if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)
1825   uint32_t *vectors = (uint32_t *) ((uintptr_t) SCB->VTOR);
1826 #else
1827   uint32_t *vectors = (uint32_t *)0x0U;
1828 #endif
1829   vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;
1830   __DSB();
1831 }
1832
1833
1834 /**
1835   \brief   Get Interrupt Vector
1836   \details Reads an interrupt vector from interrupt vector table.
1837            The interrupt number can be positive to specify a device specific interrupt,
1838            or negative to specify a processor exception.
1839   \param [in]   IRQn      Interrupt number.
1840   \return                 Address of interrupt handler function
1841  */
1842 __STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)
1843 {
1844 #if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)
1845   uint32_t *vectors = (uint32_t *) ((uintptr_t) SCB->VTOR);
1846 #else
1847   uint32_t *vectors = (uint32_t *)0x0U;
1848 #endif
1849   return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];
1850 }
1851
1852
1853 /**
1854   \brief   System Reset
1855   \details Initiates a system reset request to reset the MCU.
1856  */
1857 __NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)
1858 {
1859   __DSB();                                                          /* Ensure all outstanding memory accesses included
1860                                                                        buffered write are completed before reset */
1861   SCB->AIRCR  = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
1862                  SCB_AIRCR_SYSRESETREQ_Msk);
1863   __DSB();                                                          /* Ensure completion of memory access */
1864
1865   for(;;)                                                           /* wait until reset */
1866   {
1867     __NOP();
1868   }
1869 }
1870
1871 #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
1872 /**
1873   \brief   Enable Interrupt (non-secure)
1874   \details Enables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state.
1875   \param [in]      IRQn  Device specific interrupt number.
1876   \note    IRQn must not be negative.
1877  */
1878 __STATIC_INLINE void TZ_NVIC_EnableIRQ_NS(IRQn_Type IRQn)
1879 {
1880   if ((int32_t)(IRQn) >= 0)
1881   {
1882     NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
1883   }
1884 }
1885
1886
1887 /**
1888   \brief   Get Interrupt Enable status (non-secure)
1889   \details Returns a device specific interrupt enable status from the non-secure NVIC interrupt controller when in secure state.
1890   \param [in]      IRQn  Device specific interrupt number.
1891   \return             0  Interrupt is not enabled.
1892   \return             1  Interrupt is enabled.
1893   \note    IRQn must not be negative.
1894  */
1895 __STATIC_INLINE uint32_t TZ_NVIC_GetEnableIRQ_NS(IRQn_Type IRQn)
1896 {
1897   if ((int32_t)(IRQn) >= 0)
1898   {
1899     return((uint32_t)(((NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
1900   }
1901   else
1902   {
1903     return(0U);
1904   }
1905 }
1906
1907
1908 /**
1909   \brief   Disable Interrupt (non-secure)
1910   \details Disables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state.
1911   \param [in]      IRQn  Device specific interrupt number.
1912   \note    IRQn must not be negative.
1913  */
1914 __STATIC_INLINE void TZ_NVIC_DisableIRQ_NS(IRQn_Type IRQn)
1915 {
1916   if ((int32_t)(IRQn) >= 0)
1917   {
1918     NVIC_NS->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
1919   }
1920 }
1921
1922
1923 /**
1924   \brief   Get Pending Interrupt (non-secure)
1925   \details Reads the NVIC pending register in the non-secure NVIC when in secure state and returns the pending bit for the specified device specific interrupt.
1926   \param [in]      IRQn  Device specific interrupt number.
1927   \return             0  Interrupt status is not pending.
1928   \return             1  Interrupt status is pending.
1929   \note    IRQn must not be negative.
1930  */
1931 __STATIC_INLINE uint32_t TZ_NVIC_GetPendingIRQ_NS(IRQn_Type IRQn)
1932 {
1933   if ((int32_t)(IRQn) >= 0)
1934   {
1935     return((uint32_t)(((NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
1936   }
1937   else
1938   {
1939     return(0U);
1940   }
1941 }
1942
1943
1944 /**
1945   \brief   Set Pending Interrupt (non-secure)
1946   \details Sets the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state.
1947   \param [in]      IRQn  Device specific interrupt number.
1948   \note    IRQn must not be negative.
1949  */
1950 __STATIC_INLINE void TZ_NVIC_SetPendingIRQ_NS(IRQn_Type IRQn)
1951 {
1952   if ((int32_t)(IRQn) >= 0)
1953   {
1954     NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
1955   }
1956 }
1957
1958
1959 /**
1960   \brief   Clear Pending Interrupt (non-secure)
1961   \details Clears the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state.
1962   \param [in]      IRQn  Device specific interrupt number.
1963   \note    IRQn must not be negative.
1964  */
1965 __STATIC_INLINE void TZ_NVIC_ClearPendingIRQ_NS(IRQn_Type IRQn)
1966 {
1967   if ((int32_t)(IRQn) >= 0)
1968   {
1969     NVIC_NS->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
1970   }
1971 }
1972
1973
1974 /**
1975   \brief   Get Active Interrupt (non-secure)
1976   \details Reads the active register in non-secure NVIC when in secure state and returns the active bit for the device specific interrupt.
1977   \param [in]      IRQn  Device specific interrupt number.
1978   \return             0  Interrupt status is not active.
1979   \return             1  Interrupt status is active.
1980   \note    IRQn must not be negative.
1981  */
1982 __STATIC_INLINE uint32_t TZ_NVIC_GetActive_NS(IRQn_Type IRQn)
1983 {
1984   if ((int32_t)(IRQn) >= 0)
1985   {
1986     return((uint32_t)(((NVIC_NS->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
1987   }
1988   else
1989   {
1990     return(0U);
1991   }
1992 }
1993
1994
1995 /**
1996   \brief   Set Interrupt Priority (non-secure)
1997   \details Sets the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state.
1998            The interrupt number can be positive to specify a device specific interrupt,
1999            or negative to specify a processor exception.
2000   \param [in]      IRQn  Interrupt number.
2001   \param [in]  priority  Priority to set.
2002   \note    The priority cannot be set for every non-secure processor exception.
2003  */
2004 __STATIC_INLINE void TZ_NVIC_SetPriority_NS(IRQn_Type IRQn, uint32_t priority)
2005 {
2006   if ((int32_t)(IRQn) >= 0)
2007   {
2008     NVIC_NS->IPR[_IP_IDX(IRQn)]  = ((uint32_t)(NVIC_NS->IPR[_IP_IDX(IRQn)]  & ~(0xFFUL << _BIT_SHIFT(IRQn))) |
2009        (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));
2010   }
2011   else
2012   {
2013     SCB_NS->SHPR[_SHP_IDX(IRQn)] = ((uint32_t)(SCB_NS->SHPR[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |
2014        (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));
2015   }
2016 }
2017
2018
2019 /**
2020   \brief   Get Interrupt Priority (non-secure)
2021   \details Reads the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state.
2022            The interrupt number can be positive to specify a device specific interrupt,
2023            or negative to specify a processor exception.
2024   \param [in]   IRQn  Interrupt number.
2025   \return             Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller.
2026  */
2027 __STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn)
2028 {
2029
2030   if ((int32_t)(IRQn) >= 0)
2031   {
2032     return((uint32_t)(((NVIC_NS->IPR[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));
2033   }
2034   else
2035   {
2036     return((uint32_t)(((SCB_NS->SHPR[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));
2037   }
2038 }
2039 #endif /*  defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */
2040
2041 /*@} end of CMSIS_Core_NVICFunctions */
2042
2043 /* ##########################  MPU functions  #################################### */
2044
2045 #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
2046
2047   #include "m-profile/armv8m_mpu.h"
2048
2049 #endif
2050
2051 /* ##########################  FPU functions  #################################### */
2052 /**
2053   \ingroup  CMSIS_Core_FunctionInterface
2054   \defgroup CMSIS_Core_FpuFunctions FPU Functions
2055   \brief    Function that provides FPU type.
2056   @{
2057  */
2058
2059 /**
2060   \brief   get FPU type
2061   \details returns the FPU type
2062   \returns
2063    - \b  0: No FPU
2064    - \b  1: Single precision FPU
2065    - \b  2: Double + Single precision FPU
2066  */
2067 __STATIC_INLINE uint32_t SCB_GetFPUType(void)
2068 {
2069     return 0U;           /* No FPU */
2070 }
2071
2072
2073 /*@} end of CMSIS_Core_FpuFunctions */
2074
2075
2076
2077 /* ##########################   SAU functions  #################################### */
2078 /**
2079   \ingroup  CMSIS_Core_FunctionInterface
2080   \defgroup CMSIS_Core_SAUFunctions SAU Functions
2081   \brief    Functions that configure the SAU.
2082   @{
2083  */
2084
2085 #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
2086
2087 /**
2088   \brief   Enable SAU
2089   \details Enables the Security Attribution Unit (SAU).
2090  */
2091 __STATIC_INLINE void TZ_SAU_Enable(void)
2092 {
2093     SAU->CTRL |=  (SAU_CTRL_ENABLE_Msk);
2094 }
2095
2096
2097
2098 /**
2099   \brief   Disable SAU
2100   \details Disables the Security Attribution Unit (SAU).
2101  */
2102 __STATIC_INLINE void TZ_SAU_Disable(void)
2103 {
2104     SAU->CTRL &= ~(SAU_CTRL_ENABLE_Msk);
2105 }
2106
2107 #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
2108
2109 /*@} end of CMSIS_Core_SAUFunctions */
2110
2111
2112
2113
2114 /* ##################################    Debug Control function  ############################################ */
2115 /**
2116   \ingroup  CMSIS_Core_FunctionInterface
2117   \defgroup CMSIS_Core_DCBFunctions Debug Control Functions
2118   \brief    Functions that access the Debug Control Block.
2119   @{
2120  */
2121
2122  
2123 /**
2124   \brief   Set Debug Authentication Control Register
2125   \details writes to Debug Authentication Control register.
2126   \param [in]  value  value to be writen.
2127  */
2128 __STATIC_INLINE void DCB_SetAuthCtrl(uint32_t value)
2129 {
2130     __DSB();
2131     __ISB();
2132     DCB->DAUTHCTRL = value;
2133     __DSB();
2134     __ISB();
2135 }
2136
2137
2138 /**
2139   \brief   Get Debug Authentication Control Register
2140   \details Reads Debug Authentication Control register.
2141   \return             Debug Authentication Control Register.
2142  */
2143 __STATIC_INLINE uint32_t DCB_GetAuthCtrl(void)
2144 {
2145     return (DCB->DAUTHCTRL);
2146 }
2147
2148
2149 #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
2150 /**
2151   \brief   Set Debug Authentication Control Register (non-secure)
2152   \details writes to non-secure Debug Authentication Control register when in secure state.
2153   \param [in]  value  value to be writen
2154  */
2155 __STATIC_INLINE void TZ_DCB_SetAuthCtrl_NS(uint32_t value)
2156 {
2157     __DSB();
2158     __ISB();
2159     DCB_NS->DAUTHCTRL = value;
2160     __DSB();
2161     __ISB();
2162 }
2163
2164
2165 /**
2166   \brief   Get Debug Authentication Control Register (non-secure)
2167   \details Reads non-secure Debug Authentication Control register when in secure state.
2168   \return             Debug Authentication Control Register.
2169  */
2170 __STATIC_INLINE uint32_t TZ_DCB_GetAuthCtrl_NS(void)
2171 {
2172     return (DCB_NS->DAUTHCTRL);
2173 }
2174 #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
2175
2176 /*@} end of CMSIS_Core_DCBFunctions */
2177
2178
2179
2180
2181 /* ##################################    Debug Identification function  ############################################ */
2182 /**
2183   \ingroup  CMSIS_Core_FunctionInterface
2184   \defgroup CMSIS_Core_DIBFunctions Debug Identification Functions
2185   \brief    Functions that access the Debug Identification Block.
2186   @{
2187  */
2188
2189  
2190 /**
2191   \brief   Get Debug Authentication Status Register
2192   \details Reads Debug Authentication Status register.
2193   \return             Debug Authentication Status Register.
2194  */
2195 __STATIC_INLINE uint32_t DIB_GetAuthStatus(void)
2196 {
2197     return (DIB->DAUTHSTATUS);
2198 }
2199
2200
2201 #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
2202 /**
2203   \brief   Get Debug Authentication Status Register (non-secure)
2204   \details Reads non-secure Debug Authentication Status register when in secure state.
2205   \return             Debug Authentication Status Register.
2206  */
2207 __STATIC_INLINE uint32_t TZ_DIB_GetAuthStatus_NS(void)
2208 {
2209     return (DIB_NS->DAUTHSTATUS);
2210 }
2211 #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
2212
2213 /*@} end of CMSIS_Core_DCBFunctions */
2214
2215
2216
2217
2218 /* ##################################    SysTick function  ############################################ */
2219 /**
2220   \ingroup  CMSIS_Core_FunctionInterface
2221   \defgroup CMSIS_Core_SysTickFunctions SysTick Functions
2222   \brief    Functions that configure the System.
2223   @{
2224  */
2225
2226 #if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)
2227
2228 /**
2229   \brief   System Tick Configuration
2230   \details Initializes the System Timer and its interrupt, and starts the System Tick Timer.
2231            Counter is in free running mode to generate periodic interrupts.
2232   \param [in]  ticks  Number of ticks between two interrupts.
2233   \return          0  Function succeeded.
2234   \return          1  Function failed.
2235   \note    When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the
2236            function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>
2237            must contain a vendor-specific implementation of this function.
2238  */
2239 __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
2240 {
2241   if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)
2242   {
2243     return (1UL);                                                   /* Reload value impossible */
2244   }
2245
2246   SysTick->LOAD  = (uint32_t)(ticks - 1UL);                         /* set reload register */
2247   NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
2248   SysTick->VAL   = 0UL;                                             /* Load the SysTick Counter Value */
2249   SysTick->CTRL  = SysTick_CTRL_CLKSOURCE_Msk |
2250                    SysTick_CTRL_TICKINT_Msk   |
2251                    SysTick_CTRL_ENABLE_Msk;                         /* Enable SysTick IRQ and SysTick Timer */
2252   return (0UL);                                                     /* Function successful */
2253 }
2254
2255 #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
2256 /**
2257   \brief   System Tick Configuration (non-secure)
2258   \details Initializes the non-secure System Timer and its interrupt when in secure state, and starts the System Tick Timer.
2259            Counter is in free running mode to generate periodic interrupts.
2260   \param [in]  ticks  Number of ticks between two interrupts.
2261   \return          0  Function succeeded.
2262   \return          1  Function failed.
2263   \note    When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the
2264            function <b>TZ_SysTick_Config_NS</b> is not included. In this case, the file <b><i>device</i>.h</b>
2265            must contain a vendor-specific implementation of this function.
2266
2267  */
2268 __STATIC_INLINE uint32_t TZ_SysTick_Config_NS(uint32_t ticks)
2269 {
2270   if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)
2271   {
2272     return (1UL);                                                         /* Reload value impossible */
2273   }
2274
2275   SysTick_NS->LOAD  = (uint32_t)(ticks - 1UL);                            /* set reload register */
2276   TZ_NVIC_SetPriority_NS (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
2277   SysTick_NS->VAL   = 0UL;                                                /* Load the SysTick Counter Value */
2278   SysTick_NS->CTRL  = SysTick_CTRL_CLKSOURCE_Msk |
2279                       SysTick_CTRL_TICKINT_Msk   |
2280                       SysTick_CTRL_ENABLE_Msk;                            /* Enable SysTick IRQ and SysTick Timer */
2281   return (0UL);                                                           /* Function successful */
2282 }
2283 #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
2284
2285 #endif
2286
2287 /*@} end of CMSIS_Core_SysTickFunctions */
2288
2289
2290
2291
2292 #ifdef __cplusplus
2293 }
2294 #endif
2295
2296 #endif /* __CORE_CM23_H_DEPENDANT */
2297
2298 #endif /* __CMSIS_GENERIC */