annotate Common/Drivers/CMSIS_v210/core_cm4.h @ 66:90ceb2402d94

language updates
author heinrichsweikamp
date Wed, 15 Aug 2018 12:16:23 +0200
parents 5f11787b4f42
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1 /**************************************************************************//**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2 * @file core_cm4.h
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3 * @brief CMSIS Cortex-M4 Core Peripheral Access Layer Header File
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4 * @version V2.10
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 * @date 19. July 2011
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7 * @note
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 * Copyright (C) 2009-2011 ARM Limited. All rights reserved.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 * @par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 * ARM Limited (ARM) is supplying this software for use with Cortex-M
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 * processor based microcontrollers. This file can be freely distributed
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 * within development tools that are supporting such ARM based processors.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 * @par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 ******************************************************************************/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 #if defined ( __ICCARM__ )
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 #pragma system_include /* treat file as system include file for MISRA check */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 #ifdef __cplusplus
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28 extern "C" {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31 #ifndef __CORE_CM4_H_GENERIC
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32 #define __CORE_CM4_H_GENERIC
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35 /** \mainpage CMSIS Cortex-M4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37 This documentation describes the CMSIS Cortex-M Core Peripheral Access Layer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 It consists of:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40 - Cortex-M Core Register Definitions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41 - Cortex-M functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 - Cortex-M instructions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43 - Cortex-M SIMD instructions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45 The CMSIS Cortex-M4 Core Peripheral Access Layer contains C and assembly functions that ease
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46 access to the Cortex-M Core
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 /** \defgroup CMSIS_MISRA_Exceptions CMSIS MISRA-C:2004 Compliance Exceptions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 CMSIS violates following MISRA-C2004 Rules:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52 - Violates MISRA 2004 Required Rule 8.5, object/function definition in header file.<br>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53 Function definitions in header files are used to allow 'inlining'.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 - Violates MISRA 2004 Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56 Unions are used for effective representation of core registers.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58 - Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined.<br>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 Function-like macros are used to allow more efficient code.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 /*******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 * CMSIS definitions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 ******************************************************************************/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 /** \defgroup CMSIS_core_definitions CMSIS Core Definitions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68 This file defines all structures and symbols for CMSIS core:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69 - CMSIS version number
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70 - Cortex-M core
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 - Cortex-M core Revision Number
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72 @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75 /* CMSIS CM4 definitions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76 #define __CM4_CMSIS_VERSION_MAIN (0x02) /*!< [31:16] CMSIS HAL main version */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 #define __CM4_CMSIS_VERSION_SUB (0x10) /*!< [15:0] CMSIS HAL sub version */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78 #define __CM4_CMSIS_VERSION ((__CM4_CMSIS_VERSION_MAIN << 16) | __CM4_CMSIS_VERSION_SUB) /*!< CMSIS HAL version number */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80 #define __CORTEX_M (0x04) /*!< Cortex core */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 #if defined ( __CC_ARM )
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84 #define __ASM __asm /*!< asm keyword for ARM Compiler */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85 #define __INLINE __inline /*!< inline keyword for ARM Compiler */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87 #elif defined ( __ICCARM__ )
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88 #define __ASM __asm /*!< asm keyword for IAR Compiler */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89 #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
90
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91 #elif defined ( __GNUC__ )
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92 #define __ASM __asm /*!< asm keyword for GNU Compiler */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93 #define __INLINE inline /*!< inline keyword for GNU Compiler */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95 #elif defined ( __TASKING__ )
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96 #define __ASM __asm /*!< asm keyword for TASKING Compiler */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97 #define __INLINE inline /*!< inline keyword for TASKING Compiler */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101 /*!< __FPU_USED to be checked prior to making use of FPU specific registers and functions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 #if defined ( __CC_ARM )
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103 #if defined __TARGET_FPU_VFP
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 #if (__FPU_PRESENT == 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105 #define __FPU_USED 1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106 #else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 #define __FPU_USED 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110 #else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111 #define __FPU_USED 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114 #elif defined ( __ICCARM__ )
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 #if defined __ARMVFP__
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116 #if (__FPU_PRESENT == 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 #define __FPU_USED 1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 #else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 #define __FPU_USED 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 #else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 #define __FPU_USED 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126 #elif defined ( __GNUC__ )
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127 #if defined (__VFP_FP__) && !defined(__SOFTFP__)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 #if (__FPU_PRESENT == 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 #define __FPU_USED 1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130 #else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132 #define __FPU_USED 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134 #else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 #define __FPU_USED 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138 #elif defined ( __TASKING__ )
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 /* add preprocessor checks to define __FPU_USED */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 #define __FPU_USED 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 #include <stdint.h> /*!< standard types definitions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144 #include <core_cmInstr.h> /*!< Core Instruction Access */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 #include <core_cmFunc.h> /*!< Core Function Access */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 #include <core_cm4_simd.h> /*!< Compiler specific SIMD Intrinsics */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148 #endif /* __CORE_CM4_H_GENERIC */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150 #ifndef __CMSIS_GENERIC
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 #ifndef __CORE_CM4_H_DEPENDANT
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 #define __CORE_CM4_H_DEPENDANT
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 /* check device defines and use defaults */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156 #if defined __CHECK_DEVICE_DEFINES
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157 #ifndef __CM4_REV
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 #define __CM4_REV 0x0000
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 #warning "__CM4_REV not defined in device header file; using default!"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 #ifndef __FPU_PRESENT
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163 #define __FPU_PRESENT 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164 #warning "__FPU_PRESENT not defined in device header file; using default!"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 #ifndef __MPU_PRESENT
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168 #define __MPU_PRESENT 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169 #warning "__MPU_PRESENT not defined in device header file; using default!"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172 #ifndef __NVIC_PRIO_BITS
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173 #define __NVIC_PRIO_BITS 4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174 #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 #ifndef __Vendor_SysTickConfig
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178 #define __Vendor_SysTickConfig 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179 #warning "__Vendor_SysTickConfig not defined in device header file; using default!"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183 /* IO definitions (access restrictions to peripheral registers) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184 #ifdef __cplusplus
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 #define __I volatile /*!< defines 'read only' permissions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186 #else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187 #define __I volatile const /*!< defines 'read only' permissions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
189 #define __O volatile /*!< defines 'write only' permissions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
190 #define __IO volatile /*!< defines 'read / write' permissions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 /*@} end of group CMSIS_core_definitions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196 /*******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197 * Register Abstraction
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 ******************************************************************************/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 /** \defgroup CMSIS_core_register CMSIS Core Register
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200 Core Register contain:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201 - Core Register
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202 - Core NVIC Register
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203 - Core SCB Register
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204 - Core SysTick Register
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205 - Core Debug Register
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 - Core MPU Register
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 - Core FPU Register
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210 /** \ingroup CMSIS_core_register
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 \defgroup CMSIS_CORE CMSIS Core
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 Type definitions for the Cortex-M Core Registers
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 /** \brief Union type to access the Application Program Status Register (APSR).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 typedef union
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 #if (__CORTEX_M != 0x04)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 uint32_t _reserved0:27; /*!< bit: 0..26 Reserved */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224 #else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 uint32_t Q:1; /*!< bit: 27 Saturation condition flag */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 uint32_t C:1; /*!< bit: 29 Carry condition code flag */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 uint32_t N:1; /*!< bit: 31 Negative condition code flag */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 } b; /*!< Structure used for bit access */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 uint32_t w; /*!< Type used for word access */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236 } APSR_Type;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 /** \brief Union type to access the Interrupt Program Status Register (IPSR).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 typedef union
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243 struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247 } b; /*!< Structure used for bit access */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 uint32_t w; /*!< Type used for word access */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249 } IPSR_Type;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 /** \brief Union type to access the Special-Purpose Program Status Registers (xPSR).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254 typedef union
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256 struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
258 uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259 #if (__CORTEX_M != 0x04)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260 uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261 #else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262 uint32_t _reserved0:7; /*!< bit: 9..15 Reserved */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263 uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264 uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266 uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267 uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268 uint32_t Q:1; /*!< bit: 27 Saturation condition flag */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270 uint32_t C:1; /*!< bit: 29 Carry condition code flag */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272 uint32_t N:1; /*!< bit: 31 Negative condition code flag */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273 } b; /*!< Structure used for bit access */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274 uint32_t w; /*!< Type used for word access */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275 } xPSR_Type;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278 /** \brief Union type to access the Control Registers (CONTROL).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280 typedef union
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282 struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284 uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285 uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286 uint32_t FPCA:1; /*!< bit: 2 FP extension active flag */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 uint32_t _reserved0:29; /*!< bit: 3..31 Reserved */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288 } b; /*!< Structure used for bit access */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289 uint32_t w; /*!< Type used for word access */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
290 } CONTROL_Type;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292 /*@} end of group CMSIS_CORE */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295 /** \ingroup CMSIS_core_register
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
296 \defgroup CMSIS_NVIC CMSIS NVIC
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297 Type definitions for the Cortex-M NVIC Registers
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 /** \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305 __IO uint32_t ISER[8]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306 uint32_t RESERVED0[24];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 __IO uint32_t ICER[8]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308 uint32_t RSERVED1[24];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309 __IO uint32_t ISPR[8]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310 uint32_t RESERVED2[24];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
311 __IO uint32_t ICPR[8]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
312 uint32_t RESERVED3[24];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313 __IO uint32_t IABR[8]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314 uint32_t RESERVED4[56];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315 __IO uint8_t IP[240]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
316 uint32_t RESERVED5[644];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
317 __O uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318 } NVIC_Type;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
319
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
320 /* Software Triggered Interrupt Register Definitions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
321 #define NVIC_STIR_INTID_Pos 0 /*!< STIR: INTLINESNUM Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
322 #define NVIC_STIR_INTID_Msk (0x1FFUL << NVIC_STIR_INTID_Pos) /*!< STIR: INTLINESNUM Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
323
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
324 /*@} end of group CMSIS_NVIC */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
325
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
326
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
327 /** \ingroup CMSIS_core_register
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
328 \defgroup CMSIS_SCB CMSIS SCB
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
329 Type definitions for the Cortex-M System Control Block Registers
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
330 @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
331 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
332
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
333 /** \brief Structure type to access the System Control Block (SCB).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
334 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
335 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
336 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
337 __I uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
338 __IO uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
339 __IO uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
340 __IO uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
341 __IO uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
342 __IO uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
343 __IO uint8_t SHP[12]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
344 __IO uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
345 __IO uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
346 __IO uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
347 __IO uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
348 __IO uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
349 __IO uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
350 __IO uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
351 __I uint32_t PFR[2]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
352 __I uint32_t DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
353 __I uint32_t ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
354 __I uint32_t MMFR[4]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
355 __I uint32_t ISAR[5]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
356 uint32_t RESERVED0[5];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
357 __IO uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
358 } SCB_Type;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
359
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
360 /* SCB CPUID Register Definitions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
361 #define SCB_CPUID_IMPLEMENTER_Pos 24 /*!< SCB CPUID: IMPLEMENTER Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
362 #define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
363
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
364 #define SCB_CPUID_VARIANT_Pos 20 /*!< SCB CPUID: VARIANT Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
365 #define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
366
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
367 #define SCB_CPUID_ARCHITECTURE_Pos 16 /*!< SCB CPUID: ARCHITECTURE Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
368 #define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
369
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
370 #define SCB_CPUID_PARTNO_Pos 4 /*!< SCB CPUID: PARTNO Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
371 #define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
372
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
373 #define SCB_CPUID_REVISION_Pos 0 /*!< SCB CPUID: REVISION Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
374 #define SCB_CPUID_REVISION_Msk (0xFUL << SCB_CPUID_REVISION_Pos) /*!< SCB CPUID: REVISION Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
375
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
376 /* SCB Interrupt Control State Register Definitions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
377 #define SCB_ICSR_NMIPENDSET_Pos 31 /*!< SCB ICSR: NMIPENDSET Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
378 #define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
379
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
380 #define SCB_ICSR_PENDSVSET_Pos 28 /*!< SCB ICSR: PENDSVSET Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
381 #define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
382
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
383 #define SCB_ICSR_PENDSVCLR_Pos 27 /*!< SCB ICSR: PENDSVCLR Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
384 #define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
385
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
386 #define SCB_ICSR_PENDSTSET_Pos 26 /*!< SCB ICSR: PENDSTSET Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
387 #define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
388
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
389 #define SCB_ICSR_PENDSTCLR_Pos 25 /*!< SCB ICSR: PENDSTCLR Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
390 #define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
391
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
392 #define SCB_ICSR_ISRPREEMPT_Pos 23 /*!< SCB ICSR: ISRPREEMPT Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
393 #define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
394
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
395 #define SCB_ICSR_ISRPENDING_Pos 22 /*!< SCB ICSR: ISRPENDING Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
396 #define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
397
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
398 #define SCB_ICSR_VECTPENDING_Pos 12 /*!< SCB ICSR: VECTPENDING Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
399 #define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
400
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
401 #define SCB_ICSR_RETTOBASE_Pos 11 /*!< SCB ICSR: RETTOBASE Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
402 #define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
403
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
404 #define SCB_ICSR_VECTACTIVE_Pos 0 /*!< SCB ICSR: VECTACTIVE Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
405 #define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL << SCB_ICSR_VECTACTIVE_Pos) /*!< SCB ICSR: VECTACTIVE Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
406
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
407 /* SCB Vector Table Offset Register Definitions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
408 #define SCB_VTOR_TBLOFF_Pos 7 /*!< SCB VTOR: TBLOFF Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
409 #define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
410
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
411 /* SCB Application Interrupt and Reset Control Register Definitions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
412 #define SCB_AIRCR_VECTKEY_Pos 16 /*!< SCB AIRCR: VECTKEY Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
413 #define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
414
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
415 #define SCB_AIRCR_VECTKEYSTAT_Pos 16 /*!< SCB AIRCR: VECTKEYSTAT Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
416 #define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
417
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
418 #define SCB_AIRCR_ENDIANESS_Pos 15 /*!< SCB AIRCR: ENDIANESS Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
419 #define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
420
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
421 #define SCB_AIRCR_PRIGROUP_Pos 8 /*!< SCB AIRCR: PRIGROUP Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
422 #define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
423
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
424 #define SCB_AIRCR_SYSRESETREQ_Pos 2 /*!< SCB AIRCR: SYSRESETREQ Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
425 #define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
426
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
427 #define SCB_AIRCR_VECTCLRACTIVE_Pos 1 /*!< SCB AIRCR: VECTCLRACTIVE Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
428 #define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
429
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
430 #define SCB_AIRCR_VECTRESET_Pos 0 /*!< SCB AIRCR: VECTRESET Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
431 #define SCB_AIRCR_VECTRESET_Msk (1UL << SCB_AIRCR_VECTRESET_Pos) /*!< SCB AIRCR: VECTRESET Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
432
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
433 /* SCB System Control Register Definitions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
434 #define SCB_SCR_SEVONPEND_Pos 4 /*!< SCB SCR: SEVONPEND Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
435 #define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
436
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
437 #define SCB_SCR_SLEEPDEEP_Pos 2 /*!< SCB SCR: SLEEPDEEP Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
438 #define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
439
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
440 #define SCB_SCR_SLEEPONEXIT_Pos 1 /*!< SCB SCR: SLEEPONEXIT Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
441 #define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
442
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
443 /* SCB Configuration Control Register Definitions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
444 #define SCB_CCR_STKALIGN_Pos 9 /*!< SCB CCR: STKALIGN Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
445 #define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
446
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
447 #define SCB_CCR_BFHFNMIGN_Pos 8 /*!< SCB CCR: BFHFNMIGN Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
448 #define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
449
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
450 #define SCB_CCR_DIV_0_TRP_Pos 4 /*!< SCB CCR: DIV_0_TRP Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
451 #define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
452
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
453 #define SCB_CCR_UNALIGN_TRP_Pos 3 /*!< SCB CCR: UNALIGN_TRP Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
454 #define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
455
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
456 #define SCB_CCR_USERSETMPEND_Pos 1 /*!< SCB CCR: USERSETMPEND Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
457 #define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
458
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
459 #define SCB_CCR_NONBASETHRDENA_Pos 0 /*!< SCB CCR: NONBASETHRDENA Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
460 #define SCB_CCR_NONBASETHRDENA_Msk (1UL << SCB_CCR_NONBASETHRDENA_Pos) /*!< SCB CCR: NONBASETHRDENA Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
461
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
462 /* SCB System Handler Control and State Register Definitions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
463 #define SCB_SHCSR_USGFAULTENA_Pos 18 /*!< SCB SHCSR: USGFAULTENA Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
464 #define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
465
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
466 #define SCB_SHCSR_BUSFAULTENA_Pos 17 /*!< SCB SHCSR: BUSFAULTENA Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
467 #define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
468
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
469 #define SCB_SHCSR_MEMFAULTENA_Pos 16 /*!< SCB SHCSR: MEMFAULTENA Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
470 #define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
471
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
472 #define SCB_SHCSR_SVCALLPENDED_Pos 15 /*!< SCB SHCSR: SVCALLPENDED Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
473 #define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
474
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
475 #define SCB_SHCSR_BUSFAULTPENDED_Pos 14 /*!< SCB SHCSR: BUSFAULTPENDED Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
476 #define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
477
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
478 #define SCB_SHCSR_MEMFAULTPENDED_Pos 13 /*!< SCB SHCSR: MEMFAULTPENDED Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
479 #define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
480
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
481 #define SCB_SHCSR_USGFAULTPENDED_Pos 12 /*!< SCB SHCSR: USGFAULTPENDED Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
482 #define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
483
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
484 #define SCB_SHCSR_SYSTICKACT_Pos 11 /*!< SCB SHCSR: SYSTICKACT Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
485 #define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
486
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
487 #define SCB_SHCSR_PENDSVACT_Pos 10 /*!< SCB SHCSR: PENDSVACT Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
488 #define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
489
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
490 #define SCB_SHCSR_MONITORACT_Pos 8 /*!< SCB SHCSR: MONITORACT Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
491 #define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
492
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
493 #define SCB_SHCSR_SVCALLACT_Pos 7 /*!< SCB SHCSR: SVCALLACT Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
494 #define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
495
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
496 #define SCB_SHCSR_USGFAULTACT_Pos 3 /*!< SCB SHCSR: USGFAULTACT Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
497 #define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
498
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
499 #define SCB_SHCSR_BUSFAULTACT_Pos 1 /*!< SCB SHCSR: BUSFAULTACT Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
500 #define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
501
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
502 #define SCB_SHCSR_MEMFAULTACT_Pos 0 /*!< SCB SHCSR: MEMFAULTACT Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
503 #define SCB_SHCSR_MEMFAULTACT_Msk (1UL << SCB_SHCSR_MEMFAULTACT_Pos) /*!< SCB SHCSR: MEMFAULTACT Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
504
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
505 /* SCB Configurable Fault Status Registers Definitions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
506 #define SCB_CFSR_USGFAULTSR_Pos 16 /*!< SCB CFSR: Usage Fault Status Register Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
507 #define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
508
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
509 #define SCB_CFSR_BUSFAULTSR_Pos 8 /*!< SCB CFSR: Bus Fault Status Register Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
510 #define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
511
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
512 #define SCB_CFSR_MEMFAULTSR_Pos 0 /*!< SCB CFSR: Memory Manage Fault Status Register Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
513 #define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL << SCB_CFSR_MEMFAULTSR_Pos) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
514
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
515 /* SCB Hard Fault Status Registers Definitions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
516 #define SCB_HFSR_DEBUGEVT_Pos 31 /*!< SCB HFSR: DEBUGEVT Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
517 #define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
518
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
519 #define SCB_HFSR_FORCED_Pos 30 /*!< SCB HFSR: FORCED Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
520 #define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
521
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
522 #define SCB_HFSR_VECTTBL_Pos 1 /*!< SCB HFSR: VECTTBL Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
523 #define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
524
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
525 /* SCB Debug Fault Status Register Definitions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
526 #define SCB_DFSR_EXTERNAL_Pos 4 /*!< SCB DFSR: EXTERNAL Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
527 #define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
528
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
529 #define SCB_DFSR_VCATCH_Pos 3 /*!< SCB DFSR: VCATCH Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
530 #define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
531
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
532 #define SCB_DFSR_DWTTRAP_Pos 2 /*!< SCB DFSR: DWTTRAP Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
533 #define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
534
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
535 #define SCB_DFSR_BKPT_Pos 1 /*!< SCB DFSR: BKPT Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
536 #define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
537
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
538 #define SCB_DFSR_HALTED_Pos 0 /*!< SCB DFSR: HALTED Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
539 #define SCB_DFSR_HALTED_Msk (1UL << SCB_DFSR_HALTED_Pos) /*!< SCB DFSR: HALTED Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
540
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
541 /*@} end of group CMSIS_SCB */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
542
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
543
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
544 /** \ingroup CMSIS_core_register
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
545 \defgroup CMSIS_SCnSCB CMSIS System Control and ID Register not in the SCB
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
546 Type definitions for the Cortex-M System Control and ID Register not in the SCB
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
547 @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
548 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
549
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
550 /** \brief Structure type to access the System Control and ID Register not in the SCB.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
551 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
552 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
553 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
554 uint32_t RESERVED0[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
555 __I uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
556 __IO uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
557 } SCnSCB_Type;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
558
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
559 /* Interrupt Controller Type Register Definitions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
560 #define SCnSCB_ICTR_INTLINESNUM_Pos 0 /*!< ICTR: INTLINESNUM Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
561 #define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL << SCnSCB_ICTR_INTLINESNUM_Pos) /*!< ICTR: INTLINESNUM Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
562
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
563 /* Auxiliary Control Register Definitions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
564 #define SCnSCB_ACTLR_DISOOFP_Pos 9 /*!< ACTLR: DISOOFP Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
565 #define SCnSCB_ACTLR_DISOOFP_Msk (1UL << SCnSCB_ACTLR_DISOOFP_Pos) /*!< ACTLR: DISOOFP Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
566
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
567 #define SCnSCB_ACTLR_DISFPCA_Pos 8 /*!< ACTLR: DISFPCA Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
568 #define SCnSCB_ACTLR_DISFPCA_Msk (1UL << SCnSCB_ACTLR_DISFPCA_Pos) /*!< ACTLR: DISFPCA Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
569
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
570 #define SCnSCB_ACTLR_DISFOLD_Pos 2 /*!< ACTLR: DISFOLD Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
571 #define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) /*!< ACTLR: DISFOLD Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
572
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
573 #define SCnSCB_ACTLR_DISDEFWBUF_Pos 1 /*!< ACTLR: DISDEFWBUF Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
574 #define SCnSCB_ACTLR_DISDEFWBUF_Msk (1UL << SCnSCB_ACTLR_DISDEFWBUF_Pos) /*!< ACTLR: DISDEFWBUF Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
575
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
576 #define SCnSCB_ACTLR_DISMCYCINT_Pos 0 /*!< ACTLR: DISMCYCINT Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
577 #define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL << SCnSCB_ACTLR_DISMCYCINT_Pos) /*!< ACTLR: DISMCYCINT Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
578
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
579 /*@} end of group CMSIS_SCnotSCB */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
580
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
581
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
582 /** \ingroup CMSIS_core_register
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
583 \defgroup CMSIS_SysTick CMSIS SysTick
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
584 Type definitions for the Cortex-M System Timer Registers
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
585 @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
586 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
587
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
588 /** \brief Structure type to access the System Timer (SysTick).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
589 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
590 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
591 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
592 __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
593 __IO uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
594 __IO uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
595 __I uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
596 } SysTick_Type;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
597
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
598 /* SysTick Control / Status Register Definitions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
599 #define SysTick_CTRL_COUNTFLAG_Pos 16 /*!< SysTick CTRL: COUNTFLAG Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
600 #define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
601
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
602 #define SysTick_CTRL_CLKSOURCE_Pos 2 /*!< SysTick CTRL: CLKSOURCE Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
603 #define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
604
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
605 #define SysTick_CTRL_TICKINT_Pos 1 /*!< SysTick CTRL: TICKINT Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
606 #define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
607
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
608 #define SysTick_CTRL_ENABLE_Pos 0 /*!< SysTick CTRL: ENABLE Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
609 #define SysTick_CTRL_ENABLE_Msk (1UL << SysTick_CTRL_ENABLE_Pos) /*!< SysTick CTRL: ENABLE Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
610
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
611 /* SysTick Reload Register Definitions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
612 #define SysTick_LOAD_RELOAD_Pos 0 /*!< SysTick LOAD: RELOAD Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
613 #define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL << SysTick_LOAD_RELOAD_Pos) /*!< SysTick LOAD: RELOAD Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
614
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
615 /* SysTick Current Register Definitions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
616 #define SysTick_VAL_CURRENT_Pos 0 /*!< SysTick VAL: CURRENT Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
617 #define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos) /*!< SysTick VAL: CURRENT Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
618
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
619 /* SysTick Calibration Register Definitions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
620 #define SysTick_CALIB_NOREF_Pos 31 /*!< SysTick CALIB: NOREF Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
621 #define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
622
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
623 #define SysTick_CALIB_SKEW_Pos 30 /*!< SysTick CALIB: SKEW Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
624 #define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
625
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
626 #define SysTick_CALIB_TENMS_Pos 0 /*!< SysTick CALIB: TENMS Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
627 #define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos) /*!< SysTick CALIB: TENMS Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
628
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
629 /*@} end of group CMSIS_SysTick */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
630
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
631
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
632 /** \ingroup CMSIS_core_register
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
633 \defgroup CMSIS_ITM CMSIS ITM
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
634 Type definitions for the Cortex-M Instrumentation Trace Macrocell (ITM)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
635 @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
636 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
637
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
638 /** \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
639 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
640 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
641 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
642 __O union
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
643 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
644 __O uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
645 __O uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
646 __O uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
647 } PORT [32]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
648 uint32_t RESERVED0[864];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
649 __IO uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
650 uint32_t RESERVED1[15];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
651 __IO uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
652 uint32_t RESERVED2[15];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
653 __IO uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
654 } ITM_Type;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
655
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
656 /* ITM Trace Privilege Register Definitions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
657 #define ITM_TPR_PRIVMASK_Pos 0 /*!< ITM TPR: PRIVMASK Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
658 #define ITM_TPR_PRIVMASK_Msk (0xFUL << ITM_TPR_PRIVMASK_Pos) /*!< ITM TPR: PRIVMASK Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
659
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
660 /* ITM Trace Control Register Definitions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
661 #define ITM_TCR_BUSY_Pos 23 /*!< ITM TCR: BUSY Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
662 #define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
663
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
664 #define ITM_TCR_TraceBusID_Pos 16 /*!< ITM TCR: ATBID Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
665 #define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) /*!< ITM TCR: ATBID Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
666
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
667 #define ITM_TCR_GTSFREQ_Pos 10 /*!< ITM TCR: Global timestamp frequency Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
668 #define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
669
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
670 #define ITM_TCR_TSPrescale_Pos 8 /*!< ITM TCR: TSPrescale Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
671 #define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
672
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
673 #define ITM_TCR_SWOENA_Pos 4 /*!< ITM TCR: SWOENA Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
674 #define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
675
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
676 #define ITM_TCR_TXENA_Pos 3 /*!< ITM TCR: TXENA Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
677 #define ITM_TCR_TXENA_Msk (1UL << ITM_TCR_TXENA_Pos) /*!< ITM TCR: TXENA Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
678
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
679 #define ITM_TCR_SYNCENA_Pos 2 /*!< ITM TCR: SYNCENA Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
680 #define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
681
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
682 #define ITM_TCR_TSENA_Pos 1 /*!< ITM TCR: TSENA Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
683 #define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
684
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
685 #define ITM_TCR_ITMENA_Pos 0 /*!< ITM TCR: ITM Enable bit Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
686 #define ITM_TCR_ITMENA_Msk (1UL << ITM_TCR_ITMENA_Pos) /*!< ITM TCR: ITM Enable bit Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
687
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
688 /*@}*/ /* end of group CMSIS_ITM */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
689
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
690
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
691 #if (__MPU_PRESENT == 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
692 /** \ingroup CMSIS_core_register
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
693 \defgroup CMSIS_MPU CMSIS MPU
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
694 Type definitions for the Cortex-M Memory Protection Unit (MPU)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
695 @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
696 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
697
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
698 /** \brief Structure type to access the Memory Protection Unit (MPU).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
699 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
700 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
701 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
702 __I uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
703 __IO uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
704 __IO uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
705 __IO uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
706 __IO uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
707 __IO uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Alias 1 Region Base Address Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
708 __IO uint32_t RASR_A1; /*!< Offset: 0x018 (R/W) MPU Alias 1 Region Attribute and Size Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
709 __IO uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Alias 2 Region Base Address Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
710 __IO uint32_t RASR_A2; /*!< Offset: 0x020 (R/W) MPU Alias 2 Region Attribute and Size Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
711 __IO uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Alias 3 Region Base Address Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
712 __IO uint32_t RASR_A3; /*!< Offset: 0x028 (R/W) MPU Alias 3 Region Attribute and Size Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
713 } MPU_Type;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
714
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
715 /* MPU Type Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
716 #define MPU_TYPE_IREGION_Pos 16 /*!< MPU TYPE: IREGION Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
717 #define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
718
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
719 #define MPU_TYPE_DREGION_Pos 8 /*!< MPU TYPE: DREGION Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
720 #define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
721
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
722 #define MPU_TYPE_SEPARATE_Pos 0 /*!< MPU TYPE: SEPARATE Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
723 #define MPU_TYPE_SEPARATE_Msk (1UL << MPU_TYPE_SEPARATE_Pos) /*!< MPU TYPE: SEPARATE Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
724
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
725 /* MPU Control Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
726 #define MPU_CTRL_PRIVDEFENA_Pos 2 /*!< MPU CTRL: PRIVDEFENA Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
727 #define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
728
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
729 #define MPU_CTRL_HFNMIENA_Pos 1 /*!< MPU CTRL: HFNMIENA Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
730 #define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
731
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
732 #define MPU_CTRL_ENABLE_Pos 0 /*!< MPU CTRL: ENABLE Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
733 #define MPU_CTRL_ENABLE_Msk (1UL << MPU_CTRL_ENABLE_Pos) /*!< MPU CTRL: ENABLE Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
734
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
735 /* MPU Region Number Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
736 #define MPU_RNR_REGION_Pos 0 /*!< MPU RNR: REGION Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
737 #define MPU_RNR_REGION_Msk (0xFFUL << MPU_RNR_REGION_Pos) /*!< MPU RNR: REGION Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
738
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
739 /* MPU Region Base Address Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
740 #define MPU_RBAR_ADDR_Pos 5 /*!< MPU RBAR: ADDR Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
741 #define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
742
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
743 #define MPU_RBAR_VALID_Pos 4 /*!< MPU RBAR: VALID Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
744 #define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
745
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
746 #define MPU_RBAR_REGION_Pos 0 /*!< MPU RBAR: REGION Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
747 #define MPU_RBAR_REGION_Msk (0xFUL << MPU_RBAR_REGION_Pos) /*!< MPU RBAR: REGION Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
748
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
749 /* MPU Region Attribute and Size Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
750 #define MPU_RASR_ATTRS_Pos 16 /*!< MPU RASR: MPU Region Attribute field Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
751 #define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
752
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
753 #define MPU_RASR_SRD_Pos 8 /*!< MPU RASR: Sub-Region Disable Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
754 #define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
755
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
756 #define MPU_RASR_SIZE_Pos 1 /*!< MPU RASR: Region Size Field Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
757 #define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
758
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
759 #define MPU_RASR_ENABLE_Pos 0 /*!< MPU RASR: Region enable bit Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
760 #define MPU_RASR_ENABLE_Msk (1UL << MPU_RASR_ENABLE_Pos) /*!< MPU RASR: Region enable bit Disable Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
761
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
762 /*@} end of group CMSIS_MPU */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
763 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
764
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
765
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
766 #if (__FPU_PRESENT == 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
767 /** \ingroup CMSIS_core_register
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
768 \defgroup CMSIS_FPU CMSIS FPU
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
769 Type definitions for the Cortex-M Floating Point Unit (FPU)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
770 @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
771 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
772
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
773 /** \brief Structure type to access the Floating Point Unit (FPU).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
774 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
775 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
776 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
777 uint32_t RESERVED0[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
778 __IO uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
779 __IO uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
780 __IO uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
781 __I uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and FP Feature Register 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
782 __I uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and FP Feature Register 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
783 } FPU_Type;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
784
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
785 /* Floating-Point Context Control Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
786 #define FPU_FPCCR_ASPEN_Pos 31 /*!< FPCCR: ASPEN bit Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
787 #define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
788
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
789 #define FPU_FPCCR_LSPEN_Pos 30 /*!< FPCCR: LSPEN Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
790 #define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
791
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
792 #define FPU_FPCCR_MONRDY_Pos 8 /*!< FPCCR: MONRDY Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
793 #define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
794
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
795 #define FPU_FPCCR_BFRDY_Pos 6 /*!< FPCCR: BFRDY Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
796 #define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
797
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
798 #define FPU_FPCCR_MMRDY_Pos 5 /*!< FPCCR: MMRDY Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
799 #define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
800
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
801 #define FPU_FPCCR_HFRDY_Pos 4 /*!< FPCCR: HFRDY Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
802 #define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
803
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
804 #define FPU_FPCCR_THREAD_Pos 3 /*!< FPCCR: processor mode bit Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
805 #define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
806
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
807 #define FPU_FPCCR_USER_Pos 1 /*!< FPCCR: privilege level bit Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
808 #define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
809
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
810 #define FPU_FPCCR_LSPACT_Pos 0 /*!< FPCCR: Lazy state preservation active bit Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
811 #define FPU_FPCCR_LSPACT_Msk (1UL << FPU_FPCCR_LSPACT_Pos) /*!< FPCCR: Lazy state preservation active bit Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
812
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
813 /* Floating-Point Context Address Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
814 #define FPU_FPCAR_ADDRESS_Pos 3 /*!< FPCAR: ADDRESS bit Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
815 #define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
816
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
817 /* Floating-Point Default Status Control Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
818 #define FPU_FPDSCR_AHP_Pos 26 /*!< FPDSCR: AHP bit Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
819 #define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
820
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
821 #define FPU_FPDSCR_DN_Pos 25 /*!< FPDSCR: DN bit Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
822 #define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
823
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
824 #define FPU_FPDSCR_FZ_Pos 24 /*!< FPDSCR: FZ bit Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
825 #define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
826
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
827 #define FPU_FPDSCR_RMode_Pos 22 /*!< FPDSCR: RMode bit Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
828 #define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
829
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
830 /* Media and FP Feature Register 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
831 #define FPU_MVFR0_FP_rounding_modes_Pos 28 /*!< MVFR0: FP rounding modes bits Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
832 #define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) /*!< MVFR0: FP rounding modes bits Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
833
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
834 #define FPU_MVFR0_Short_vectors_Pos 24 /*!< MVFR0: Short vectors bits Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
835 #define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) /*!< MVFR0: Short vectors bits Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
836
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
837 #define FPU_MVFR0_Square_root_Pos 20 /*!< MVFR0: Square root bits Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
838 #define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) /*!< MVFR0: Square root bits Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
839
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
840 #define FPU_MVFR0_Divide_Pos 16 /*!< MVFR0: Divide bits Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
841 #define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) /*!< MVFR0: Divide bits Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
842
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
843 #define FPU_MVFR0_FP_excep_trapping_Pos 12 /*!< MVFR0: FP exception trapping bits Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
844 #define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) /*!< MVFR0: FP exception trapping bits Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
845
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
846 #define FPU_MVFR0_Double_precision_Pos 8 /*!< MVFR0: Double-precision bits Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
847 #define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) /*!< MVFR0: Double-precision bits Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
848
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
849 #define FPU_MVFR0_Single_precision_Pos 4 /*!< MVFR0: Single-precision bits Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
850 #define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) /*!< MVFR0: Single-precision bits Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
851
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
852 #define FPU_MVFR0_A_SIMD_registers_Pos 0 /*!< MVFR0: A_SIMD registers bits Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
853 #define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL << FPU_MVFR0_A_SIMD_registers_Pos) /*!< MVFR0: A_SIMD registers bits Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
854
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
855 /* Media and FP Feature Register 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
856 #define FPU_MVFR1_FP_fused_MAC_Pos 28 /*!< MVFR1: FP fused MAC bits Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
857 #define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) /*!< MVFR1: FP fused MAC bits Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
858
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
859 #define FPU_MVFR1_FP_HPFP_Pos 24 /*!< MVFR1: FP HPFP bits Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
860 #define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) /*!< MVFR1: FP HPFP bits Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
861
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
862 #define FPU_MVFR1_D_NaN_mode_Pos 4 /*!< MVFR1: D_NaN mode bits Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
863 #define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) /*!< MVFR1: D_NaN mode bits Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
864
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
865 #define FPU_MVFR1_FtZ_mode_Pos 0 /*!< MVFR1: FtZ mode bits Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
866 #define FPU_MVFR1_FtZ_mode_Msk (0xFUL << FPU_MVFR1_FtZ_mode_Pos) /*!< MVFR1: FtZ mode bits Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
867
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
868 /*@} end of group CMSIS_FPU */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
869 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
870
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
871
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
872 /** \ingroup CMSIS_core_register
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
873 \defgroup CMSIS_CoreDebug CMSIS Core Debug
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
874 Type definitions for the Cortex-M Core Debug Registers
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
875 @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
876 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
877
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
878 /** \brief Structure type to access the Core Debug Register (CoreDebug).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
879 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
880 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
881 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
882 __IO uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
883 __O uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
884 __IO uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
885 __IO uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
886 } CoreDebug_Type;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
887
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
888 /* Debug Halting Control and Status Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
889 #define CoreDebug_DHCSR_DBGKEY_Pos 16 /*!< CoreDebug DHCSR: DBGKEY Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
890 #define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
891
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
892 #define CoreDebug_DHCSR_S_RESET_ST_Pos 25 /*!< CoreDebug DHCSR: S_RESET_ST Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
893 #define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
894
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
895 #define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24 /*!< CoreDebug DHCSR: S_RETIRE_ST Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
896 #define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
897
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
898 #define CoreDebug_DHCSR_S_LOCKUP_Pos 19 /*!< CoreDebug DHCSR: S_LOCKUP Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
899 #define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
900
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
901 #define CoreDebug_DHCSR_S_SLEEP_Pos 18 /*!< CoreDebug DHCSR: S_SLEEP Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
902 #define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
903
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
904 #define CoreDebug_DHCSR_S_HALT_Pos 17 /*!< CoreDebug DHCSR: S_HALT Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
905 #define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
906
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
907 #define CoreDebug_DHCSR_S_REGRDY_Pos 16 /*!< CoreDebug DHCSR: S_REGRDY Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
908 #define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
909
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
910 #define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5 /*!< CoreDebug DHCSR: C_SNAPSTALL Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
911 #define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
912
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
913 #define CoreDebug_DHCSR_C_MASKINTS_Pos 3 /*!< CoreDebug DHCSR: C_MASKINTS Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
914 #define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
915
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
916 #define CoreDebug_DHCSR_C_STEP_Pos 2 /*!< CoreDebug DHCSR: C_STEP Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
917 #define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
918
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
919 #define CoreDebug_DHCSR_C_HALT_Pos 1 /*!< CoreDebug DHCSR: C_HALT Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
920 #define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
921
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
922 #define CoreDebug_DHCSR_C_DEBUGEN_Pos 0 /*!< CoreDebug DHCSR: C_DEBUGEN Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
923 #define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL << CoreDebug_DHCSR_C_DEBUGEN_Pos) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
924
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
925 /* Debug Core Register Selector Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
926 #define CoreDebug_DCRSR_REGWnR_Pos 16 /*!< CoreDebug DCRSR: REGWnR Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
927 #define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
928
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
929 #define CoreDebug_DCRSR_REGSEL_Pos 0 /*!< CoreDebug DCRSR: REGSEL Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
930 #define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL << CoreDebug_DCRSR_REGSEL_Pos) /*!< CoreDebug DCRSR: REGSEL Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
931
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
932 /* Debug Exception and Monitor Control Register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
933 #define CoreDebug_DEMCR_TRCENA_Pos 24 /*!< CoreDebug DEMCR: TRCENA Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
934 #define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
935
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
936 #define CoreDebug_DEMCR_MON_REQ_Pos 19 /*!< CoreDebug DEMCR: MON_REQ Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
937 #define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
938
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
939 #define CoreDebug_DEMCR_MON_STEP_Pos 18 /*!< CoreDebug DEMCR: MON_STEP Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
940 #define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
941
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
942 #define CoreDebug_DEMCR_MON_PEND_Pos 17 /*!< CoreDebug DEMCR: MON_PEND Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
943 #define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
944
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
945 #define CoreDebug_DEMCR_MON_EN_Pos 16 /*!< CoreDebug DEMCR: MON_EN Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
946 #define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
947
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
948 #define CoreDebug_DEMCR_VC_HARDERR_Pos 10 /*!< CoreDebug DEMCR: VC_HARDERR Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
949 #define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
950
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
951 #define CoreDebug_DEMCR_VC_INTERR_Pos 9 /*!< CoreDebug DEMCR: VC_INTERR Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
952 #define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
953
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
954 #define CoreDebug_DEMCR_VC_BUSERR_Pos 8 /*!< CoreDebug DEMCR: VC_BUSERR Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
955 #define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
956
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
957 #define CoreDebug_DEMCR_VC_STATERR_Pos 7 /*!< CoreDebug DEMCR: VC_STATERR Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
958 #define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
959
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
960 #define CoreDebug_DEMCR_VC_CHKERR_Pos 6 /*!< CoreDebug DEMCR: VC_CHKERR Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
961 #define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
962
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
963 #define CoreDebug_DEMCR_VC_NOCPERR_Pos 5 /*!< CoreDebug DEMCR: VC_NOCPERR Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
964 #define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
965
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
966 #define CoreDebug_DEMCR_VC_MMERR_Pos 4 /*!< CoreDebug DEMCR: VC_MMERR Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
967 #define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
968
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
969 #define CoreDebug_DEMCR_VC_CORERESET_Pos 0 /*!< CoreDebug DEMCR: VC_CORERESET Position */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
970 #define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL << CoreDebug_DEMCR_VC_CORERESET_Pos) /*!< CoreDebug DEMCR: VC_CORERESET Mask */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
971
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
972 /*@} end of group CMSIS_CoreDebug */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
973
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
974
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
975 /** \ingroup CMSIS_core_register
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
976 @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
977 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
978
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
979 /* Memory mapping of Cortex-M4 Hardware */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
980 #define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
981 #define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
982 #define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
983 #define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
984 #define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
985 #define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
986
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
987 #define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
988 #define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
989 #define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
990 #define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
991 #define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
992 #define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
993
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
994 #if (__MPU_PRESENT == 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
995 #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
996 #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
997 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
998
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
999 #if (__FPU_PRESENT == 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1000 #define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1001 #define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point Unit */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1002 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1003
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1004 /*@} */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1005
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1006
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1007
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1008 /*******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1009 * Hardware Abstraction Layer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1010 ******************************************************************************/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1011 /** \defgroup CMSIS_Core_FunctionInterface CMSIS Core Function Interface
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1012 Core Function Interface contains:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1013 - Core NVIC Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1014 - Core SysTick Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1015 - Core Debug Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1016 - Core Register Access Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1017 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1018
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1019
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1020
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1021 /* ########################## NVIC functions #################################### */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1022 /** \ingroup CMSIS_Core_FunctionInterface
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1023 \defgroup CMSIS_Core_NVICFunctions CMSIS Core NVIC Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1024 @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1025 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1026
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1027 /** \brief Set Priority Grouping
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1028
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1029 This function sets the priority grouping field using the required unlock sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1030 The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1031 Only values from 0..7 are used.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1032 In case of a conflict between priority grouping and available
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1033 priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1034
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1035 \param [in] PriorityGroup Priority grouping field
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1036 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1037 static __INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1038 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1039 uint32_t reg_value;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1040 uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07); /* only values 0..7 are used */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1041
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1042 reg_value = SCB->AIRCR; /* read old register configuration */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1043 reg_value &= ~(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk); /* clear bits to change */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1044 reg_value = (reg_value |
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1045 ((uint32_t)0x5FA << SCB_AIRCR_VECTKEY_Pos) |
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1046 (PriorityGroupTmp << 8)); /* Insert write key and priorty group */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1047 SCB->AIRCR = reg_value;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1048 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1049
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1050
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1051 /** \brief Get Priority Grouping
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1052
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1053 This function gets the priority grouping from NVIC Interrupt Controller.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1054 Priority grouping is SCB->AIRCR [10:8] PRIGROUP field.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1055
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1056 \return Priority grouping field
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1057 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1058 static __INLINE uint32_t NVIC_GetPriorityGrouping(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1059 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1060 return ((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos); /* read priority grouping field */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1061 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1062
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1063
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1064 /** \brief Enable External Interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1065
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1066 This function enables a device specific interrupt in the NVIC interrupt controller.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1067 The interrupt number cannot be a negative value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1068
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1069 \param [in] IRQn Number of the external interrupt to enable
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1070 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1071 static __INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1072 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1073 /* NVIC->ISER[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); enable interrupt */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1074 NVIC->ISER[(uint32_t)((int32_t)IRQn) >> 5] = (uint32_t)(1 << ((uint32_t)((int32_t)IRQn) & (uint32_t)0x1F)); /* enable interrupt */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1075 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1076
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1077
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1078 /** \brief Disable External Interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1079
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1080 This function disables a device specific interrupt in the NVIC interrupt controller.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1081 The interrupt number cannot be a negative value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1082
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1083 \param [in] IRQn Number of the external interrupt to disable
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1084 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1085 static __INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1086 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1087 NVIC->ICER[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* disable interrupt */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1088 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1089
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1090
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1091 /** \brief Get Pending Interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1092
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1093 This function reads the pending register in the NVIC and returns the pending bit
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1094 for the specified interrupt.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1095
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1096 \param [in] IRQn Number of the interrupt for get pending
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1097 \return 0 Interrupt status is not pending
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1098 \return 1 Interrupt status is pending
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1099 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1100 static __INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1101 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1102 return((uint32_t) ((NVIC->ISPR[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0)); /* Return 1 if pending else 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1103 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1104
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1105
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1106 /** \brief Set Pending Interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1107
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1108 This function sets the pending bit for the specified interrupt.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1109 The interrupt number cannot be a negative value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1110
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1111 \param [in] IRQn Number of the interrupt for set pending
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1112 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1113 static __INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1114 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1115 NVIC->ISPR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* set interrupt pending */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1116 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1117
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1118
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1119 /** \brief Clear Pending Interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1120
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1121 This function clears the pending bit for the specified interrupt.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1122 The interrupt number cannot be a negative value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1123
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1124 \param [in] IRQn Number of the interrupt for clear pending
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1125 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1126 static __INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1127 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1128 NVIC->ICPR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* Clear pending interrupt */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1129 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1130
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1131
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1132 /** \brief Get Active Interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1133
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1134 This function reads the active register in NVIC and returns the active bit.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1135 \param [in] IRQn Number of the interrupt for get active
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1136 \return 0 Interrupt status is not active
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1137 \return 1 Interrupt status is active
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1138 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1139 static __INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1140 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1141 return((uint32_t)((NVIC->IABR[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0)); /* Return 1 if active else 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1142 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1143
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1144
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1145 /** \brief Set Interrupt Priority
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1146
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1147 This function sets the priority for the specified interrupt. The interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1148 number can be positive to specify an external (device specific)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1149 interrupt, or negative to specify an internal (core) interrupt.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1150
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1151 Note: The priority cannot be set for every core interrupt.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1152
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1153 \param [in] IRQn Number of the interrupt for set priority
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1154 \param [in] priority Priority to set
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1155 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1156 static __INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1157 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1158 if(IRQn < 0) {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1159 SCB->SHP[((uint32_t)(IRQn) & 0xF)-4] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for Cortex-M System Interrupts */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1160 else {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1161 NVIC->IP[(uint32_t)(IRQn)] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for device specific Interrupts */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1162 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1163
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1164
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1165 /** \brief Get Interrupt Priority
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1166
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1167 This function reads the priority for the specified interrupt. The interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1168 number can be positive to specify an external (device specific)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1169 interrupt, or negative to specify an internal (core) interrupt.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1170
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1171 The returned priority value is automatically aligned to the implemented
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1172 priority bits of the microcontroller.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1173
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1174 \param [in] IRQn Number of the interrupt for get priority
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1175 \return Interrupt Priority
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1176 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1177 static __INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1178 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1179
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1180 if(IRQn < 0) {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1181 return((uint32_t)(SCB->SHP[((uint32_t)(IRQn) & 0xF)-4] >> (8 - __NVIC_PRIO_BITS))); } /* get priority for Cortex-M system interrupts */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1182 else {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1183 return((uint32_t)(NVIC->IP[(uint32_t)(IRQn)] >> (8 - __NVIC_PRIO_BITS))); } /* get priority for device specific interrupts */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1184 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1185
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1186
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1187 /** \brief Encode Priority
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1188
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1189 This function encodes the priority for an interrupt with the given priority group,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1190 preemptive priority value and sub priority value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1191 In case of a conflict between priority grouping and available
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1192 priority bits (__NVIC_PRIO_BITS) the samllest possible priority group is set.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1193
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1194 The returned priority value can be used for NVIC_SetPriority(...) function
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1195
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1196 \param [in] PriorityGroup Used priority group
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1197 \param [in] PreemptPriority Preemptive priority value (starting from 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1198 \param [in] SubPriority Sub priority value (starting from 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1199 \return Encoded priority for the interrupt
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1200 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1201 static __INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1202 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1203 uint32_t PriorityGroupTmp = (PriorityGroup & 0x07); /* only values 0..7 are used */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1204 uint32_t PreemptPriorityBits;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1205 uint32_t SubPriorityBits;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1206
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1207 PreemptPriorityBits = ((7 - PriorityGroupTmp) > __NVIC_PRIO_BITS) ? __NVIC_PRIO_BITS : 7 - PriorityGroupTmp;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1208 SubPriorityBits = ((PriorityGroupTmp + __NVIC_PRIO_BITS) < 7) ? 0 : PriorityGroupTmp - 7 + __NVIC_PRIO_BITS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1209
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1210 return (
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1211 ((PreemptPriority & ((1 << (PreemptPriorityBits)) - 1)) << SubPriorityBits) |
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1212 ((SubPriority & ((1 << (SubPriorityBits )) - 1)))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1213 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1214 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1215
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1216
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1217 /** \brief Decode Priority
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1218
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1219 This function decodes an interrupt priority value with the given priority group to
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1220 preemptive priority value and sub priority value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1221 In case of a conflict between priority grouping and available
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1222 priority bits (__NVIC_PRIO_BITS) the samllest possible priority group is set.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1223
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1224 The priority value can be retrieved with NVIC_GetPriority(...) function
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1225
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1226 \param [in] Priority Priority value
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1227 \param [in] PriorityGroup Used priority group
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1228 \param [out] pPreemptPriority Preemptive priority value (starting from 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1229 \param [out] pSubPriority Sub priority value (starting from 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1230 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1231 static __INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* pPreemptPriority, uint32_t* pSubPriority)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1232 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1233 uint32_t PriorityGroupTmp = (PriorityGroup & 0x07); /* only values 0..7 are used */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1234 uint32_t PreemptPriorityBits;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1235 uint32_t SubPriorityBits;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1236
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1237 PreemptPriorityBits = ((7 - PriorityGroupTmp) > __NVIC_PRIO_BITS) ? __NVIC_PRIO_BITS : 7 - PriorityGroupTmp;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1238 SubPriorityBits = ((PriorityGroupTmp + __NVIC_PRIO_BITS) < 7) ? 0 : PriorityGroupTmp - 7 + __NVIC_PRIO_BITS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1239
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1240 *pPreemptPriority = (Priority >> SubPriorityBits) & ((1 << (PreemptPriorityBits)) - 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1241 *pSubPriority = (Priority ) & ((1 << (SubPriorityBits )) - 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1242 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1243
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1244
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1245 /** \brief System Reset
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1246
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1247 This function initiate a system reset request to reset the MCU.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1248 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1249 static __INLINE void NVIC_SystemReset(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1250 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1251 __DSB(); /* Ensure all outstanding memory accesses included
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1252 buffered write are completed before reset */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1253 SCB->AIRCR = ((0x5FA << SCB_AIRCR_VECTKEY_Pos) |
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1254 (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1255 SCB_AIRCR_SYSRESETREQ_Msk); /* Keep priority group unchanged */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1256 __DSB(); /* Ensure completion of memory access */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1257 while(1); /* wait until reset */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1258 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1259
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1260 /*@} end of CMSIS_Core_NVICFunctions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1261
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1262
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1263
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1264 /* ################################## SysTick function ############################################ */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1265 /** \ingroup CMSIS_Core_FunctionInterface
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1266 \defgroup CMSIS_Core_SysTickFunctions CMSIS Core SysTick Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1267 @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1268 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1269
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1270 #if (__Vendor_SysTickConfig == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1271
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1272 /** \brief System Tick Configuration
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1273
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1274 This function initialises the system tick timer and its interrupt and start the system tick timer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1275 Counter is in free running mode to generate periodical interrupts.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1276
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1277 \param [in] ticks Number of ticks between two interrupts
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1278 \return 0 Function succeeded
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1279 \return 1 Function failed
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1280 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1281 static __INLINE uint32_t SysTick_Config(uint32_t ticks)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1282 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1283 if (ticks > SysTick_LOAD_RELOAD_Msk) return (1); /* Reload value impossible */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1284
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1285 SysTick->LOAD = (ticks & SysTick_LOAD_RELOAD_Msk) - 1; /* set reload register */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1286 NVIC_SetPriority (SysTick_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority for Cortex-M0 System Interrupts */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1287 SysTick->VAL = 0; /* Load the SysTick Counter Value */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1288 SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1289 SysTick_CTRL_TICKINT_Msk |
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1290 SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1291 return (0); /* Function successful */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1292 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1293
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1294 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1295
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1296 /*@} end of CMSIS_Core_SysTickFunctions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1297
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1298
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1299
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1300 /* ##################################### Debug In/Output function ########################################### */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1301 /** \ingroup CMSIS_Core_FunctionInterface
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1302 \defgroup CMSIS_core_DebugFunctions CMSIS Core Debug Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1303 @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1304 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1305
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1306 extern volatile int32_t ITM_RxBuffer; /*!< external variable to receive characters */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1307 #define ITM_RXBUFFER_EMPTY 0x5AA55AA5 /*!< value identifying ITM_RxBuffer is ready for next character */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1308
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1309
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1310 /** \brief ITM Send Character
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1311
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1312 This function transmits a character via the ITM channel 0.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1313 It just returns when no debugger is connected that has booked the output.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1314 It is blocking when a debugger is connected, but the previous character send is not transmitted.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1315
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1316 \param [in] ch Character to transmit
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1317 \return Character to transmit
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1318 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1319 static __INLINE uint32_t ITM_SendChar (uint32_t ch)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1320 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1321 if ((CoreDebug->DEMCR & CoreDebug_DEMCR_TRCENA_Msk) && /* Trace enabled */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1322 (ITM->TCR & ITM_TCR_ITMENA_Msk) && /* ITM enabled */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1323 (ITM->TER & (1UL << 0) ) ) /* ITM Port #0 enabled */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1324 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1325 while (ITM->PORT[0].u32 == 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1326 ITM->PORT[0].u8 = (uint8_t) ch;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1327 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1328 return (ch);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1329 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1330
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1331
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1332 /** \brief ITM Receive Character
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1333
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1334 This function inputs a character via external variable ITM_RxBuffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1335 It just returns when no debugger is connected that has booked the output.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1336 It is blocking when a debugger is connected, but the previous character send is not transmitted.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1337
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1338 \return Received character
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1339 \return -1 No character received
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1340 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1341 static __INLINE int32_t ITM_ReceiveChar (void) {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1342 int32_t ch = -1; /* no character available */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1343
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1344 if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1345 ch = ITM_RxBuffer;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1346 ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1347 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1348
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1349 return (ch);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1350 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1351
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1352
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1353 /** \brief ITM Check Character
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1354
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1355 This function checks external variable ITM_RxBuffer whether a character is available or not.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1356 It returns '1' if a character is available and '0' if no character is available.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1357
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1358 \return 0 No character available
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1359 \return 1 Character available
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1360 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1361 static __INLINE int32_t ITM_CheckChar (void) {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1362
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1363 if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1364 return (0); /* no character available */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1365 } else {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1366 return (1); /* character available */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1367 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1368 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1369
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1370 /*@} end of CMSIS_core_DebugFunctions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1371
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1372 #endif /* __CORE_CM4_H_DEPENDANT */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1373
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1374 #endif /* __CMSIS_GENERIC */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1375
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1376 #ifdef __cplusplus
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1377 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1378 #endif