]> begriffs open source - cmsis/blob - CMSIS/DoxyGen/Core/src/Ref_DataStructs.txt
Updated cmsis_compiler.h to fix IAR CMSIS macro problem.
[cmsis] / CMSIS / DoxyGen / Core / src / Ref_DataStructs.txt
1 /****************************    Data Structures    ***********************************************/
2 /** \brief  Union type to access the Application Program Status Register (APSR).
3  */
4 typedef union
5 {
6   struct
7   {
8 #if (__CORTEX_M != 0x04)
9     uint32_t _reserved0:27;              ///< bit:  0..26  Reserved
10 #else
11     uint32_t _reserved0:16;              ///< bit:  0..15  Reserved
12     uint32_t GE:4;                       ///< bit: 16..19  Greater than or Equal flags
13     uint32_t _reserved1:7;               ///< bit: 20..26  Reserved
14 #endif
15     uint32_t Q:1;                        ///< bit:     27  Saturation condition flag
16     uint32_t V:1;                        ///< bit:     28  Overflow condition code flag
17     uint32_t C:1;                        ///< bit:     29  Carry condition code flag
18     uint32_t Z:1;                        ///< bit:     30  Zero condition code flag
19     uint32_t N:1;                        ///< bit:     31  Negative condition code flag
20   } b;                                   ///< Structure used for bit  access
21   uint32_t w;                            ///< Type      used for word access
22 } APSR_Type;
23
24
25 /**************************************************************************************************/
26 /** \brief  Union type to access the Interrupt Program Status Register (IPSR).
27  */
28 typedef union
29 {
30   struct
31   {
32     uint32_t ISR:9;                      ///< bit:  0.. 8  Exception number
33     uint32_t _reserved0:23;              ///< bit:  9..31  Reserved
34   } b;                                   ///< Structure used for bit  access
35   uint32_t w;                            ///< Type      used for word access
36 } IPSR_Type;
37
38
39 /**************************************************************************************************/
40 /** \brief  Union type to access the Special-Purpose Program Status Registers (xPSR).
41  */
42 typedef union
43 {
44   struct
45   {
46     uint32_t ISR:9;                      ///< bit:  0.. 8  Exception number
47 #if (__CORTEX_M != 0x04)
48     uint32_t _reserved0:15;              ///< bit:  9..23  Reserved
49 #else
50     uint32_t _reserved0:7;               ///< bit:  9..15  Reserved
51     uint32_t GE:4;                       ///< bit: 16..19  Greater than or Equal flags
52     uint32_t _reserved1:4;               ///< bit: 20..23  Reserved
53 #endif
54     uint32_t T:1;                        ///< bit:     24  Thumb bit        (read 0)
55     uint32_t IT:2;                       ///< bit: 25..26  saved IT state   (read 0)
56     uint32_t Q:1;                        ///< bit:     27  Saturation condition flag
57     uint32_t V:1;                        ///< bit:     28  Overflow condition code flag
58     uint32_t C:1;                        ///< bit:     29  Carry condition code flag
59     uint32_t Z:1;                        ///< bit:     30  Zero condition code flag
60     uint32_t N:1;                        ///< bit:     31  Negative condition code flag
61   } b;                                   ///< Structure used for bit  access
62   uint32_t w;                            ///< Type      used for word access
63 } xPSR_Type;
64
65
66 /**************************************************************************************************/
67 /** \brief  Union type to access the Control Registers (CONTROL).
68  */
69 typedef union
70 {
71   struct
72   {
73     uint32_t nPRIV:1;                    ///< bit:      0  Execution privilege in Thread mode
74     uint32_t SPSEL:1;                    ///< bit:      1  Stack to be used
75     uint32_t FPCA:1;                     ///< bit:      2  FP extension active flag
76     uint32_t _reserved0:29;              ///< bit:  3..31  Reserved
77   } b;                                   ///< Structure used for bit  access
78   uint32_t w;                            ///< Type      used for word access
79 } CONTROL_Type;
80
81
82 /**************************************************************************************************/
83 /** \brief  Structure type to access the Nested Vectored Interrupt Controller (NVIC).
84  */
85 typedef struct
86 {
87   __IOM uint32_t ISER[8];                ///< Offset: 0x000 (R/W)  Interrupt Set Enable Register
88         uint32_t RESERVED0[24];          ///< Reserved
89   __IOM uint32_t ICER[8];                ///< Offset: 0x080 (R/W)  Interrupt Clear Enable Register
90         uint32_t RSERVED1[24];           ///< Reserved
91   __IOM uint32_t ISPR[8];                ///< Offset: 0x100 (R/W)  Interrupt Set Pending Register
92         uint32_t RESERVED2[24];          ///< Reserved
93   __IOM uint32_t ICPR[8];                ///< Offset: 0x180 (R/W)  Interrupt Clear Pending Register
94         uint32_t RESERVED3[24];          ///< Reserved
95   __IOM uint32_t IABR[8];                ///< Offset: 0x200 (R/W)  Interrupt Active bit Register
96         uint32_t RESERVED4[56];          ///< Reserved
97   __IOM uint8_t  IP[240];                ///< Offset: 0x300 (R/W)  Interrupt Priority Register (8Bit wide)
98         uint32_t RESERVED5[644];         ///< Reserved
99   __OM  uint32_t STIR;                   ///< Offset: 0xE00 ( /W)  Software Trigger Interrupt Register
100 }  NVIC_Type;
101
102
103 /**************************************************************************************************/
104 /** \brief  Structure type to access the System Control Block (SCB).
105  */
106 typedef struct
107 {
108   __IM  uint32_t CPUID;                  ///< Offset: 0x000 (R/ )  CPUID Base Register
109   __IOM uint32_t ICSR;                   ///< Offset: 0x004 (R/W)  Interrupt Control and State Register
110   __IOM uint32_t VTOR;                   ///< Offset: 0x008 (R/W)  Vector Table Offset Register
111   __IOM uint32_t AIRCR;                  ///< Offset: 0x00C (R/W)  Application Interrupt and Reset Control Register
112   __IOM uint32_t SCR;                    ///< Offset: 0x010 (R/W)  System Control Register
113   __IOM uint32_t CCR;                    ///< Offset: 0x014 (R/W)  Configuration Control Register
114   __IOM uint8_t  SHP[12];                ///< Offset: 0x018 (R/W)  System Handlers Priority Registers (4-7, 8-11, 12-15)
115   __IOM uint32_t SHCSR;                  ///< Offset: 0x024 (R/W)  System Handler Control and State Register
116   __IOM uint32_t CFSR;                   ///< Offset: 0x028 (R/W)  Configurable Fault Status Register
117   __IOM uint32_t HFSR;                   ///< Offset: 0x02C (R/W)  HardFault Status Register
118   __IOM uint32_t DFSR;                   ///< Offset: 0x030 (R/W)  Debug Fault Status Register
119   __IOM uint32_t MMFAR;                  ///< Offset: 0x034 (R/W)  MemManage Fault Address Register
120   __IOM uint32_t BFAR;                   ///< Offset: 0x038 (R/W)  BusFault Address Register
121   __IOM uint32_t AFSR;                   ///< Offset: 0x03C (R/W)  Auxiliary Fault Status Register
122   __IM  uint32_t PFR[2];                 ///< Offset: 0x040 (R/ )  Processor Feature Register
123   __IM  uint32_t DFR;                    ///< Offset: 0x048 (R/ )  Debug Feature Register
124   __IM  uint32_t ADR;                    ///< Offset: 0x04C (R/ )  Auxiliary Feature Register
125   __IM  uint32_t MMFR[4];                ///< Offset: 0x050 (R/ )  Memory Model Feature Register
126   __IM  uint32_t ISAR[5];                ///< Offset: 0x060 (R/ )  Instruction Set Attributes Register
127         uint32_t RESERVED0[5];           ///< Reserved
128   __IOM uint32_t CPACR;                  ///< Offset: 0x088 (R/W)  Coprocessor Access Control Register
129 } SCB_Type;
130
131
132 /**************************************************************************************************/
133 /** \brief  Structure type to access the System Control and ID Register not in the SCB.
134  */
135 typedef struct
136 {
137         uint32_t RESERVED0[1];           ///< Reserved
138   __IM  uint32_t ICTR;                   ///< Offset: 0x004 (R/ )  Interrupt Controller Type Register
139   __IOM uint32_t ACTLR;                  ///< Offset: 0x008 (R/W)  Auxiliary Control Register
140 } SCnSCB_Type;
141
142
143 /**************************************************************************************************/
144 /** \brief  Structure type to access the System Timer (SysTick).
145  */
146 typedef struct
147 {
148   __IOM uint32_t CTRL;                   ///< Offset: 0x000 (R/W)  SysTick Control and Status Register
149   __IOM uint32_t LOAD;                   ///< Offset: 0x004 (R/W)  SysTick Reload Value Register
150   __IOM uint32_t VAL;                    ///< Offset: 0x008 (R/W)  SysTick Current Value Register
151   __IM  uint32_t CALIB;                  ///< Offset: 0x00C (R/ )  SysTick Calibration Register
152 } SysTick_Type;
153
154
155 /**************************************************************************************************/
156 /** \brief  Structure type to access the Instrumentation Trace Macrocell Register (ITM).
157  */
158 typedef struct
159 {
160   __OM  union
161   {
162     __OM  uint8_t    u8;                 ///< Offset: 0x000 ( /W)  ITM Stimulus Port 8-bit
163     __OM  uint16_t   u16;                ///< Offset: 0x000 ( /W)  ITM Stimulus Port 16-bit
164     __OM  uint32_t   u32;                ///< Offset: 0x000 ( /W)  ITM Stimulus Port 32-bit
165   }  PORT [32];                          ///< Offset: 0x000 ( /W)  ITM Stimulus Port Registers
166         uint32_t RESERVED0[864];         ///< Reserved
167   __IOM uint32_t TER;                    ///< Offset: 0xE00 (R/W)  ITM Trace Enable Register
168         uint32_t RESERVED1[15];          ///< Reserved
169   __IOM uint32_t TPR;                    ///< Offset: 0xE40 (R/W)  ITM Trace Privilege Register
170         uint32_t RESERVED2[15];          ///< Reserved
171   __IOM uint32_t TCR;                    ///< Offset: 0xE80 (R/W)  ITM Trace Control Register
172 } ITM_Type;
173
174
175 /**************************************************************************************************/
176 /** \brief  Structure type to access the Memory Protection Unit (MPU).
177  */
178 typedef struct
179 {
180   __IM  uint32_t TYPE;                   ///< Offset: 0x000 (R/ )  MPU Type Register
181   __IOM uint32_t CTRL;                   ///< Offset: 0x004 (R/W)  MPU Control Register
182   __IOM uint32_t RNR;                    ///< Offset: 0x008 (R/W)  MPU Region RNRber Register
183   __IOM uint32_t RBAR;                   ///< Offset: 0x00C (R/W)  MPU Region Base Address Register
184   __IOM uint32_t RASR;                   ///< Offset: 0x010 (R/W)  MPU Region Attribute and Size Register
185   __IOM uint32_t RBAR_A1;                ///< Offset: 0x014 (R/W)  MPU Alias 1 Region Base Address Register
186   __IOM uint32_t RASR_A1;                ///< Offset: 0x018 (R/W)  MPU Alias 1 Region Attribute and Size Register
187   __IOM uint32_t RBAR_A2;                ///< Offset: 0x01C (R/W)  MPU Alias 2 Region Base Address Register
188   __IOM uint32_t RASR_A2;                ///< Offset: 0x020 (R/W)  MPU Alias 2 Region Attribute and Size Register
189   __IOM uint32_t RBAR_A3;                ///< Offset: 0x024 (R/W)  MPU Alias 3 Region Base Address Register
190   __IOM uint32_t RASR_A3;                ///< Offset: 0x028 (R/W)  MPU Alias 3 Region Attribute and Size Register
191 } MPU_Type;
192
193
194 /**************************************************************************************************/
195 /** \brief  Structure type to access the Floating Point Unit (FPU).
196  */
197 typedef struct
198 {
199         uint32_t RESERVED0[1];           ///< Reserved
200   __IOM uint32_t FPCCR;                  ///< Offset: 0x004 (R/W)  Floating-Point Context Control Register
201   __IOM uint32_t FPCAR;                  ///< Offset: 0x008 (R/W)  Floating-Point Context Address Register
202   __IOM uint32_t FPDSCR;                 ///< Offset: 0x00C (R/W)  Floating-Point Default Status Control Register
203   __IM  uint32_t MVFR0;                  ///< Offset: 0x010 (R/ )  Media and FP Feature Register 0
204   __IM  uint32_t MVFR1;                  ///< Offset: 0x014 (R/ )  Media and FP Feature Register 1
205 } FPU_Type;
206
207
208 /**************************************************************************************************/
209 /** \brief  Structure type to access the Core Debug Register (CoreDebug).
210  */
211 typedef struct
212 {
213   __IOM uint32_t DHCSR;                  ///< Offset: 0x000 (R/W)  Debug Halting Control and Status Register
214   __OM  uint32_t DCRSR;                  ///< Offset: 0x004 ( /W)  Debug Core Register Selector Register
215   __IOM uint32_t DCRDR;                  ///< Offset: 0x008 (R/W)  Debug Core Register Data Register
216   __IOM uint32_t DEMCR;                  ///< Offset: 0x00C (R/W)  Debug Exception and Monitor Control Register
217 } CoreDebug_Type;
218
219
220 /**************************************************************************************************/
221 /** \brief  Structure type to access the Data Watchpoint and Trace Register (DWT).
222  */
223 typedef struct
224 {
225   __IOM uint32_t CTRL;                   ///< Offset: 0x000 (R/W)  Control Register
226   __IOM uint32_t CYCCNT;                 ///< Offset: 0x004 (R/W)  Cycle Count Register
227   __IOM uint32_t CPICNT;                 ///< Offset: 0x008 (R/W)  CPI Count Register
228   __IOM uint32_t EXCCNT;                 ///< Offset: 0x00C (R/W)  Exception Overhead Count Register
229   __IOM uint32_t SLEEPCNT;               ///< Offset: 0x010 (R/W)  Sleep Count Register
230   __IOM uint32_t LSUCNT;                 ///< Offset: 0x014 (R/W)  LSU Count Register
231   __IOM uint32_t FOLDCNT;                ///< Offset: 0x018 (R/W)  Folded-instruction Count Register
232   __IM  uint32_t PCSR;                   ///< Offset: 0x01C (R/ )  Program Counter Sample Register
233   __IOM uint32_t COMP0;                  ///< Offset: 0x020 (R/W)  Comparator Register 0
234   __IOM uint32_t MASK0;                  ///< Offset: 0x024 (R/W)  Mask Register 0
235   __IOM uint32_t FUNCTION0;              ///< Offset: 0x028 (R/W)  Function Register 0
236         uint32_t RESERVED0[1];           ///< Reserved
237   __IOM uint32_t COMP1;                  ///< Offset: 0x030 (R/W)  Comparator Register 1
238   __IOM uint32_t MASK1;                  ///< Offset: 0x034 (R/W)  Mask Register 1
239   __IOM uint32_t FUNCTION1;              ///< Offset: 0x038 (R/W)  Function Register 1
240         uint32_t RESERVED1[1];           ///< Reserved
241   __IOM uint32_t COMP2;                  ///< Offset: 0x040 (R/W)  Comparator Register 2
242   __IOM uint32_t MASK2;                  ///< Offset: 0x044 (R/W)  Mask Register 2
243   __IOM uint32_t FUNCTION2;              ///< Offset: 0x048 (R/W)  Function Register 2
244         uint32_t RESERVED2[1];           ///< Reserved
245   __IOM uint32_t COMP3;                  ///< Offset: 0x050 (R/W)  Comparator Register 3
246   __IOM uint32_t MASK3;                  ///< Offset: 0x054 (R/W)  Mask Register 3
247   __IOM uint32_t FUNCTION3;              ///< Offset: 0x058 (R/W)  Function Register 3
248 } DWT_Type;
249
250
251 /**************************************************************************************************/
252 /** \brief  Structure type to access the Trace Port Interface Register (TPI).
253  */
254 typedef struct
255 {
256   __IOM uint32_t SSPSR;                  ///< Offset: 0x000 (R/ )  Supported Parallel Port Size Register
257   __IOM uint32_t CSPSR;                  ///< Offset: 0x004 (R/W)  Current Parallel Port Size Register
258         uint32_t RESERVED0[2];           ///< Reserved
259   __IOM uint32_t ACPR;                   ///< Offset: 0x010 (R/W)  Asynchronous Clock Prescaler Register
260         uint32_t RESERVED1[55];          ///< Reserved
261   __IOM uint32_t SPPR;                   ///< Offset: 0x0F0 (R/W)  Selected Pin Protocol Register
262         uint32_t RESERVED2[131];         ///< Reserved
263   __IM  uint32_t FFSR;                   ///< Offset: 0x300 (R/ )  Formatter and Flush Status Register
264   __IOM uint32_t FFCR;                   ///< Offset: 0x304 (R/W)  Formatter and Flush Control Register
265   __IM  uint32_t FSCR;                   ///< Offset: 0x308 (R/ )  Formatter Synchronization Counter Register
266         uint32_t RESERVED3[759];         ///< Reserved
267   __IM  uint32_t TRIGGER;                ///< Offset: 0xEE8 (R/ )  TRIGGER
268   __IM  uint32_t FIFO0;                  ///< Offset: 0xEEC (R/ )  Integration ETM Data
269   __IM  uint32_t ITATBCTR2;              ///< Offset: 0xEF0 (R/ )  ITATBCTR2
270         uint32_t RESERVED4[1];           ///< Reserved
271   __IM  uint32_t ITATBCTR0;              ///< Offset: 0xEF8 (R/ )  ITATBCTR0
272   __IM  uint32_t FIFO1;                  ///< Offset: 0xEFC (R/ )  Integration ITM Data
273   __IOM uint32_t ITCTRL;                 ///< Offset: 0xF00 (R/W)  Integration Mode Control
274         uint32_t RESERVED5[39];          ///< Reserved
275   __IOM uint32_t CLAIMSET;               ///< Offset: 0xFA0 (R/W)  Claim tag set
276   __IOM uint32_t CLAIMCLR;               ///< Offset: 0xFA4 (R/W)  Claim tag clear
277         uint32_t RESERVED7[8];           ///< Reserved
278   __IM  uint32_t DEVID;                  ///< Offset: 0xFC8 (R/ )  TPIU_DEVID
279   __IM  uint32_t DEVTYPE;                ///< Offset: 0xFCC (R/ )  TPIU_DEVTYPE
280 } TPI_Type;