]> begriffs open source - cmsis/blob - CMSIS/DoxyGen/Core/src/Template.txt
DoxyGen: Enhanced documentation of CMSIS macros other missing stuff.
[cmsis] / CMSIS / DoxyGen / Core / src / Template.txt
1 /**
2 \page templates_pg CMSIS-Core Device Templates
3
4 \details
5
6 Arm supplies CMSIS-Core device template files for the all supported Cortex-M processors and various compiler vendors.
7 Refer to the list of \ref tested_tools_sec for compliance.
8
9
10 These CMSIS-Core device template files include the following:
11  - Register names of the Core Peripherals and names of the Core Exception Vectors.
12  - Functions to access core peripherals, special CPU instructions and SIMD instructions (for Cortex-M4 and Cortex-M7)
13  - Generic startup code and system configuration code.
14
15 The detailed file structure of the CMSIS-Core device templates is shown in the following picture.
16
17 \image html "CMSIS_CORE_Files.png" "CMSIS-Core File Structure"
18
19 \section CMSIS_Processor_files CMSIS-Core Processor Files
20
21 The CMSIS-Core processor files provided by Arm are in the directory .\\CMSIS\\Core\\Include. These header files define all processor specific attributes do not need any modifications.
22 The <b>core_&lt;cpu&gt;.h</b> defines the core peripherals and provides helper functions that access the core registers. One file is available for each supported Cortex-M processor:
23
24 Header File      | Processor
25 :----------------|:------------------------------
26 core_cm0.h       | for the Cortex-M0 processor
27 core_cm0plus.h   | for the Cortex-M0+ processor
28 core_cm3.h       | for the Cortex-M3 processor
29 core_cm4.h       | for the Cortex-M4 processor
30 core_cm7.h       | for the Cortex-M7 processor
31 \if ARMv8M
32 core_cm23.h      | for the Cortex-M23 processor
33 core_cm33.h      | for the Cortex-M33 processor
34 core_cm35p.h     | for the Cortex-M35P processor
35 core_cm55.h      | for the Cortex-M55 processor
36 \endif
37 \if ARMSC
38 core_sc000.h     | for the SecurCore SC000 processor
39 core_sc300.h     | for the SecurCore SC300 processor
40 \endif
41 \if ARMv8M
42 core_armv8mbl.h  | for the Armv8-M Baseline processor
43 core_armv8mml.h  | for the Armv8-M Mainline processor
44 core_armv81mml.h | for the Armv8.1-M Mainline processor
45 \endif
46 \section device_examples Device Examples
47
48 The CMSIS Software Pack defines several devices that are based on the various processors. The device related CMSIS-Core files are in the directory .\\Device\\ARM
49 and include CMSIS-Core processor file explained before. The following sample devices are defined in the CMSIS-Pack description file <b>ARM.CMSIS.pdsc</b>:
50
51 Family             | Device                  | Description
52 :------------------|:------------------------|:---------------------------------
53 ARM Cortex-M0      | ARMCM0                  | Cortex-M0 based device
54 ARM Cortex-M0 plus | ARMCM0P                 | Cortex-M0+ based device
55 ARM Cortex-M3      | ARMCM3                  | Cortex-M3 based device
56 ARM Cortex-M4      | ARMCM4                  | Cortex-M4 based device without floating-point hardware
57 ARM Cortex-M4      | ARMCM4_FP               | Cortex-M4 based device with floating-point hardware
58 ARM Cortex-M7      | ARMCM7                  | Cortex-M4 based device without floating-point hardware
59 ARM Cortex-M7      | ARMCM7_FP               | Cortex-M7 based device with single precision floating-point unit (FPU)
60 ARM Cortex-M7      | ARMCM7_DP               | Cortex-M7 based device with double precision floating-point unit
61 ARM Cortex-M7      | ARMCM7                  | Cortex-M7 based device without floating-point hardware
62 \if ARMv8M
63 ARM Cortex-M23     | ARMCM23                 | Cortex-M23 based device without TrustZone
64 ARM Cortex-M23     | ARMCM23_TZ              | Cortex-M23 based device with TrustZone
65 ARM Cortex-M33     | ARMCM33                 | Cortex-M33 based device without TrustZone, SIMD, FPU
66 ARM Cortex-M33     | ARMCM33_TZ              | Cortex-M33 based device with TrustZone, no SIMD, no FPU
67 ARM Cortex-M33     | ARMCM33_DSP_FP          | Cortex-M33 based device with SIMD, FPU, no TrustZone
68 ARM Cortex-M33     | ARMCM33_DSP_FP_TZ       | Cortex-M33 based device with TrustZone, SIMD, FPU
69 ARM Cortex-M35P    | ARMCM35P                | Cortex-M35P based device without TrustZone, SIMD, FPU
70 ARM Cortex-M35P    | ARMCM35P_TZ             | Cortex-M35P based device with TrustZone, no SIMD, no FPU
71 ARM Cortex-M35P    | ARMCM35P_DSP_FP         | Cortex-M35P based device with SIMD, FPU, no TrustZone
72 ARM Cortex-M35P    | ARMCM35P_DSP_FP_TZ      | Cortex-M35P based device with TrustZone, SIMD, FPU
73 ARM Cortex-M55     | ARMCM55                 | Cortex-M55 based device with TrustZone, SIMD, double precision FPU, and floating-point MVE
74 \endif
75 \if ARMSC
76 ARM SC000          | ARM SC000               | SC000 based device
77 ARM SC300          | ARM SC300               | SC300 based device
78 \endif
79 \if ARMv8M
80 ARMv8-M Baseline   | ARMv8MBL                | Armv8-M Baseline based device with TrustZone
81 ARMv8-M Mainline   | ARMv8MML                | Armv8-M Mainline based device with TrustZone
82 ARMv8-M Mainline   | ARMv8MML_DP             | Armv8-M Mainline based device with TrustZone and double precision FPU
83 ARMv8-M Mainline   | ARMv8MML_SP             | Armv8-M Mainline based device with TrustZone and single precision FPU
84 ARMv8-M Mainline   | ARMv8MML_DSP            | Armv8-M Mainline based device with TrustZone and SIMD
85 ARMv8-M Mainline   | ARMv8MML_DSP_DP         | Armv8-M Mainline based device with TrustZone, SIMD, and double precision FPU
86 ARMv8-M Mainline   | ARMv8MML_DSP_SP         | Armv8-M Mainline based device with TrustZone, SIMD, and single precision FPU
87 ARMv8.1-M Mainline | ARMv81MML_DSP_DP_MVE_FP | Armv8.1-M Mainline based device with TrustZone, SIMD, double precision FPU, and floating-point MVE
88 \endif
89
90 \section template_files_sec Template Files
91
92 To simplify the creation of CMSIS-Core device files, the following template files are provided that should be extended by the silicon vendor to reflect the actual device and device peripherals.
93 Silicon vendors add to these template files the following information:
94  - <b>Device Peripheral Access Layer</b> that provides definitions for device-specific peripherals.
95  - <b>Access Functions for Peripherals</b> (optional) that provides additional helper functions to access device-specific peripherals.
96  - <b>Interrupt vectors</b> in the startup file that are device specific.
97
98 <table class="cmtable">
99     <tr>
100       <th>Template File</th>
101       <th>Description</th>
102     </tr>
103     <tr>
104       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Source\\ARM\\startup_Device.s</td>
105       <td>Startup file template for Arm C/C++ Compiler.</td>
106     </tr>
107     <tr>
108       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Source\\GCC\\startup_Device.s</td>
109       <td>Startup file template for GNU GCC Arm Embedded Compiler.</td>
110     </tr>
111     <tr>
112       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Source\\IAR\\startup_Device.s</td>
113       <td>Startup file template for IAR C/C++ Compiler.</td>
114     </tr>
115     <tr>
116       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Source\\system_Device.c</td>
117       <td>Generic system_Device.c file for system configuration (i.e. processor clock and memory bus system).</td>
118     </tr>
119     <tr>
120       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Include\\Device.h</td>
121       <td>Generic device header file. Needs to be extended with the device-specific peripheral registers. Optionally functions that access the peripherals
122       can be part of that file.</td>
123     </tr>
124     <tr>
125       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Include\\system_Device.h</td>
126       <td>Generic system device configuration include file.</td>
127     </tr>
128 </table>
129
130
131 <b>Adapt Template Files to a Device</b>
132
133 The following steps describe how to adopt the template files to a specific device or device family.
134 Copy the complete all files in the template directory and replace:
135   - directory name 'Vendor' with the abbreviation for the device vendor  e.g.: NXP.
136   - directory name 'Device' with the specific device name e.g.: LPC17xx.
137   - in the file names 'Device' with the specific device name e.g.: LPC17xx.
138
139 Each template file contains comments that start with \b ToDo: that describe a required modification.
140 The template files contain place holders:
141
142 <table class="cmtable">
143     <tr>
144       <th>Placeholder</th>
145       <th>Replaced with</th>
146     </tr>
147     <tr>
148       <td>&lt;Device&gt;</td>
149       <td>the specific device name or device family name; i.e. LPC17xx.</td>
150     </tr>
151     <tr>
152       <td>&lt;DeviceInterrupt&gt;</td>
153       <td>a specific interrupt name of the device; i.e. TIM1 for Timer 1.</td>
154     <tr>
155       <td>&lt;DeviceAbbreviation&gt;</td>
156       <td>short name or abbreviation of the device family; i.e. LPC.</td>
157     </tr>
158     <tr>
159       <td>Cortex-M#</td>
160       <td>the specific Cortex-M processor name; i.e. Cortex-M3.</td>
161     </tr>
162 </table>
163
164
165 The device configuration of the template files is described in detail on the following pages:
166   - \subpage startup_c_pg
167   - \subpage startup_s_pg (deprecated)
168   - \subpage system_c_pg
169   - \subpage device_h_pg
170 \if ARMv8M
171   - \subpage partition_h_pg
172   - \subpage partition_gen_h_pg
173 \endif
174 */
175
176 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
177 /**
178 \page startup_c_pg Startup File startup_<device>.c
179
180 The \ref startup_c_pg contains:
181  - The reset handler which is executed after CPU reset and typically calls the \ref SystemInit function.
182  - The setup values for the Main Stack Pointer (MSP).
183  - Exception vectors of the Cortex-M Processor with weak functions that implement default routines.
184  - Interrupt vectors that are device specific with weak functions that implement default routines.
185
186 The file exists for each supported toolchain and is the only tool-chain specific CMSIS file.
187
188 To adapt the file to a new device only the interrupt vector table needs to be extended with
189 the device-specific interrupt handlers. The naming convention for the interrupt handler names are
190 &lt;interrupt_name&gt;_IRQHandler.  This table needs to be consistent with \ref IRQn_Type that defines all the
191 IRQ numbers for each interrupt.
192
193 \b Example:
194
195 The following example shows the extension of the interrupt vector table for the LPC1100 device family.
196
197 \code
198 /*----------------------------------------------------------------------------
199   Exception / Interrupt Handler
200  *----------------------------------------------------------------------------*/
201 /* Exceptions */
202 void WAKEUP0_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
203 void WAKEUP1_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
204 void WAKEUP2_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
205 // :
206 // :
207 void EINT1_IRQHandler       (void) __attribute__ ((weak, alias("Default_Handler")));
208 void EINT2_IRQHandler       (void) __attribute__ ((weak, alias("Default_Handler")));
209 // :
210 // :
211
212 /*----------------------------------------------------------------------------
213   Exception / Interrupt Vector table
214  *----------------------------------------------------------------------------*/
215 extern const pFunc __VECTOR_TABLE[240];
216        const pFunc __VECTOR_TABLE[240] __VECTOR_TABLE_ATTRIBUTE = {
217   (pFunc)(&__INITIAL_SP),                   /*     Initial Stack Pointer */
218   Reset_Handler,                            /*     Reset Handler */
219   NMI_Handler,                              /* -14 NMI Handler */
220   HardFault_Handler,                        /* -13 Hard Fault Handler */
221   MemManage_Handler,                        /* -12 MPU Fault Handler */
222   BusFault_Handler,                         /* -11 Bus Fault Handler */
223   UsageFault_Handler,                       /* -10 Usage Fault Handler */
224   0,                                        /*     Reserved */
225   0,                                        /*     Reserved */
226   0,                                        /*     Reserved */
227   0,                                        /*     Reserved */
228   SVC_Handler,                              /*  -5 SVCall Handler */
229   DebugMon_Handler,                         /*  -4 Debug Monitor Handler */
230   0,                                        /*     Reserved */
231   PendSV_Handler,                           /*  -2 PendSV Handler */
232   SysTick_Handler,                          /*  -1 SysTick Handler */
233
234   /* Interrupts */
235   WAKEUP0_IRQHandler,                       /*   0 Wakeup PIO0.0 */
236   WAKEUP1_IRQHandler,                       /*   1 Wakeup PIO0.1 */
237   WAKEUP2_IRQHandler,                       /*   2 Wakeup PIO0.2 */
238   // :
239   // :
240   EINT1_IRQHandler,                         /*  30 PIO INT1 */
241   EINT2_IRQHandler,                         /*  31 PIO INT2 */
242   // :
243   // :
244 };
245 \endcode
246
247 \section startup_c_sec startup_Device.c Template File
248
249 A compiler agnostic \ref startup_c_sec for an Armv7-M processor like Cortex-M3 is shown below.
250 The C startup file relys on certain compiler specific preprocessor defines specified in CMSIS compiler headers:
251  - \ref __INITIAL_SP
252  - \ref __STACK_LIMIT
253  - \ref __PROGRAM_START
254  - \ref __VECTOR_TABLE
255  - \ref __VECTOR_TABLE_ATTRIBUTE
256
257 \verbinclude "Source\startup_Device.c"
258 */
259
260 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
261 /**
262 \page startup_s_pg Startup File startup_<device>.s (deprecated)
263
264 The \ref startup_s_pg contains:
265  - The reset handler which is executed after CPU reset and typically calls the \ref SystemInit function.
266  - The setup values for the Main Stack Pointer (MSP).
267  - Exception vectors of the Cortex-M Processor with weak functions that implement default routines.
268  - Interrupt vectors that are device specific with weak functions that implement default routines.
269
270 The file exists for each supported toolchain and is the only tool-chain specific CMSIS file.
271
272 To adapt the file to a new device only the interrupt vector table needs to be extended with
273 the device-specific interrupt handlers. The naming convention for the interrupt handler names are
274 &lt;interrupt_name&gt;_IRQHandler.  This table needs to be consistent with \ref IRQn_Type that defines all the
275 IRQ numbers for each interrupt.
276
277 \b Example:
278
279 The following example shows the extension of the interrupt vector table for the LPC1100 device family.
280
281 \code
282                 ; External Interrupts
283                 DCD     WAKEUP0_IRQHandler       ; 16+ 0: Wakeup PIO0.0
284                 DCD     WAKEUP1_IRQHandler       ; 16+ 1: Wakeup PIO0.1
285                 DCD     WAKEUP2_IRQHandler       ; 16+ 2: Wakeup PIO0.2
286                  :       :
287                  :       :
288                 DCD     EINT1_IRQHandler         ; 16+30: PIO INT1
289                 DCD     EINT0_IRQHandler         ; 16+31: PIO INT0
290    :
291    :
292                 EXPORT  WAKEUP0_IRQHandler       [WEAK]
293                 EXPORT  WAKEUP1_IRQHandler       [WEAK]
294                 EXPORT  WAKEUP2_IRQHandler       [WEAK]
295                  :       :
296                  :       :
297                 EXPORT  EINT1_IRQHandler         [WEAK]
298                 EXPORT  EINT0_IRQHandler         [WEAK]
299
300 WAKEUP0_IRQHandler
301 WAKEUP1_IRQHandler
302 WAKEUP1_IRQHandler
303       :
304       :
305 EINT1_IRQHandler
306 EINT0_IRQHandler
307                 B       .
308
309 \endcode
310
311 \section startup_s_sec startup_Device.s Template File
312
313 An Arm Compiler \ref startup_s_sec for an Armv7-M processor like Cortex-M3 is shown below.
314 The files for other compiler vendors differ slightly in the syntax, but not in the overall structure.
315
316 \verbinclude "Source\ARM\startup_Device.s"
317 */
318
319 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
320 /**
321 \page system_c_pg System Configuration Files system_<device>.c and system_<device>.h
322
323 The \ref system_c_pg provides as a minimum the functions described under \ref system_init_gr.
324 These functions are device specific and need adaptations. In addition, the file might have
325 configuration settings for the device such as XTAL frequency or PLL prescaler settings.
326
327 For devices with external memory BUS the system_<device>.c also configures the BUS system.
328
329 The silicon vendor might expose other functions (i.e. for power configuration) in the system_<device>.c file.
330 In case of additional features the function prototypes need to be added to the system_<device>.h header file.
331
332 \section system_Device_sec system_Device.c Template File
333
334 The \ref system_Device_sec for the Cortex-M3 is shown below.
335
336 \verbinclude "Source\system_Device.c"
337
338 \section system_Device_h_sec system_Device.h Template File
339
340 The system_<device>.h header file contains prototypes to access the public functions in the system_<device>.c file.
341 The \ref system_Device_h_sec is shown below.
342
343 \verbinclude "Include\system_Device.h"
344
345 */
346
347 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
348 /**
349 \page device_h_pg Device Header File <device.h>
350
351 The \ref device_h_pg contains the following sections that are device specific:
352
353   - \ref interrupt_number_sec provides interrupt numbers (IRQn) for all exceptions and interrupts of the device.
354   - \ref core_config_sect reflect the features of the device.
355   - \ref device_access provides definitions for the \ref peripheral_gr to all device peripherals. It contains all data structures and the address mapping for device-specific peripherals.
356   - <b>Access Functions for Peripherals (optional)</b> provide additional helper functions for peripherals that are useful for programming of these peripherals. Access Functions may be provided as inline functions or can be extern references to a device-specific library provided by the silicon vendor.
357
358 <a href="Modules.html">\b Reference </a> describes the standard features and functions of the \ref device_h_pg in detail.
359
360 \section interrupt_number_sec Interrupt Number Definition
361
362 \ref device_h_pg contains the enumeration \ref IRQn_Type that defines all exceptions and interrupts of the device.
363   - Negative IRQn values represent processor core exceptions (internal interrupts).
364   - Positive IRQn values represent device-specific exceptions (external interrupts). The first device-specific interrupt has the IRQn value 0.
365     The IRQn values needs extension to reflect the device-specific interrupt vector table in the \ref startup_s_pg.
366
367 \b Example:
368
369 The following example shows the extension of the interrupt vector table for the LPC1100 device family.
370
371 \code
372 typedef enum IRQn
373 {
374 /******  Cortex-M0 Processor Exceptions Numbers ***************************************************/
375   NonMaskableInt_IRQn           = -14,      /*!< 2 Non Maskable Interrupt                         */
376   HardFault_IRQn                = -13,      /*!< 3 Cortex-M0 Hard Fault Interrupt                 */
377   SVCall_IRQn                   = -5,       /*!< 11 Cortex-M0 SV Call Interrupt                   */
378   PendSV_IRQn                   = -2,       /*!< 14 Cortex-M0 Pend SV Interrupt                   */
379   SysTick_IRQn                  = -1,       /*!< 15 Cortex-M0 System Tick Interrupt               */
380
381 /******  LPC11xx/LPC11Cxx Specific Interrupt Numbers **********************************************/
382   WAKEUP0_IRQn                  = 0,        /*!< All I/O pins can be used as wakeup source.       */
383   WAKEUP1_IRQn                  = 1,        /*!< There are 13 pins in total for LPC11xx           */
384   WAKEUP2_IRQn                  = 2,
385                  :       :
386                  :       :
387   EINT1_IRQn                    = 30,       /*!< External Interrupt 1 Interrupt                   */
388   EINT0_IRQn                    = 31,       /*!< External Interrupt 0 Interrupt                   */
389 } IRQn_Type;
390 \endcode
391
392 \section core_config_sect Configuration of the Processor and Core Peripherals
393
394 The \ref device_h_pg  configures the Cortex-M or SecurCore processor and the core peripherals with <i>\#defines</i>
395 that are set prior to including the file <b>core_<cpu>.h</b>.
396
397 The following tables list the <i>\#defines</i> along with the possible values for each processor core.
398 If these <i>\#defines</i> are missing default values are used.
399 \b core_cm0.h
400 <table class="cmtable">
401     <tr>
402       <th>\#define</th>
403       <th>Value Range</th>
404       <th>Default</th>
405       <th>Description</th>
406     </tr>
407     <tr>
408       <td>\ref __CM0_REV</td>
409       <td>0x0000</td>
410       <td>0x0000</td>
411       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
412     </tr>
413     <tr>
414       <td>\ref __NVIC_PRIO_BITS</td>
415       <td>2</td>
416       <td>2</td>
417       <td>Number of priority bits implemented in the NVIC (device specific)</td>
418     </tr>
419     <tr>
420       <td>\ref __Vendor_SysTickConfig</td>
421       <td>0 .. 1</td>
422       <td>0</td>
423       <td>Vendor defined <b>SysTick_Config</b> function.</td>
424     </tr>
425 </table>
426
427 \b core_cm0plus.h
428 <table class="cmtable">
429     <tr>
430       <th>\#define</th>
431       <th>Value Range</th>
432       <th>Default</th>
433       <th>Description</th>
434     </tr>
435     <tr>
436       <td>\ref __CM0PLUS_REV</td>
437       <td>0x0000</td>
438       <td>0x0000</td>
439       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
440     </tr>
441     <tr>
442       <td>\ref __VTOR_PRESENT</td>
443       <td>0 .. 1</td>
444       <td>0</td>
445       <td>Defines if a VTOR register is present or not</td>
446     </tr>
447     <tr>
448       <td>\ref __NVIC_PRIO_BITS</td>
449       <td>2</td>
450       <td>2</td>
451       <td>Number of priority bits implemented in the NVIC (device specific)</td>
452     </tr>
453     <tr>
454       <td>\ref __Vendor_SysTickConfig</td>
455       <td>0 .. 1</td>
456       <td>0</td>
457       <td>Vendor defined <b>SysTick_Config</b> function.</td>
458     </tr>
459 </table>
460
461 \b core_cm3.h
462 <table class="cmtable">
463     <tr>
464       <th>\#define</th>
465       <th>Value Range</th>
466       <th>Default</th>
467       <th>Description</th>
468     </tr>
469     <tr>
470       <td>\ref __CM3_REV</td>
471       <td>0x0101 | 0x0200</td>
472       <td>0x0200</td>
473       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
474     </tr>
475     <tr>
476       <td>\ref __VTOR_PRESENT</td>
477       <td>0 .. 1</td>
478       <td>1</td>
479       <td>Defines if a VTOR register is present or not</td>
480     </tr>
481     <tr>
482       <td>\ref __NVIC_PRIO_BITS</td>
483       <td>2 .. 8</td>
484       <td>4</td>
485       <td>Number of priority bits implemented in the NVIC (device specific)</td>
486     </tr>
487     <tr>
488       <td>\ref __MPU_PRESENT</td>
489       <td>0 .. 1</td>
490       <td>0</td>
491       <td>Defines if a MPU is present or not</td>
492     </tr>
493     <tr>
494       <td>\ref __Vendor_SysTickConfig</td>
495       <td>0 .. 1</td>
496       <td>0</td>
497       <td>Vendor defined <b>SysTick_Config</b> function.</td>
498     </tr>
499 </table>
500
501 \b core_cm4.h
502 <table class="cmtable">
503     <tr>
504       <th>\#define</th>
505       <th>Value Range</th>
506       <th>Default</th>
507       <th>Description</th>
508     </tr>
509     <tr>
510       <td>\ref __CM4_REV</td>
511       <td>0x0000</td>
512       <td>0x0000</td>
513       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
514     </tr>
515     <tr>
516       <td>\ref __VTOR_PRESENT</td>
517       <td>0 .. 1</td>
518       <td>1</td>
519       <td>Defines if a VTOR register is present or not</td>
520     </tr>
521     <tr>
522       <td>\ref __NVIC_PRIO_BITS</td>
523       <td>2 .. 8</td>
524       <td>4</td>
525       <td>Number of priority bits implemented in the NVIC (device specific)</td>
526     </tr>
527     <tr>
528       <td>\ref __MPU_PRESENT</td>
529       <td>0 .. 1</td>
530       <td>0</td>
531       <td>Defines if a MPU is present or not</td>
532     </tr>
533     <tr>
534       <td>\ref __FPU_PRESENT</td>
535       <td>0 .. 1</td>
536       <td>0</td>
537       <td>Defines if a FPU is present or not</td>
538     </tr>
539     <tr>
540       <td>\ref __Vendor_SysTickConfig</td>
541       <td>0 .. 1</td>
542       <td>0</td>
543       <td>Vendor defined <b>SysTick_Config</b> function.</td>
544     </tr>
545 </table>
546
547 \b core_cm7.h
548 <table class="cmtable" summary="">
549     <tr>
550       <th>\#define</th>
551       <th>Value Range</th>
552       <th>Default</th>
553       <th>Description</th>
554     </tr>
555     <tr>
556       <td>\ref __CM7_REV</td>
557       <td>0x0000</td>
558       <td>0x0000</td>
559       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
560     </tr>
561     <tr>
562       <td>\ref __MPU_PRESENT</td>
563       <td>0 .. 1</td>
564       <td>0</td>
565       <td>Defines if a MPU is present or not</td>
566     </tr>
567     <tr>
568       <td>\ref __VTOR_PRESENT</td>
569       <td>0 .. 1</td>
570       <td>1</td>
571       <td>Defines if a VTOR register is present or not</td>
572     </tr>
573     <tr>
574       <td>\ref __NVIC_PRIO_BITS</td>
575       <td>2 .. 8</td>
576       <td>4</td>
577       <td>Number of priority bits implemented in the NVIC (device specific)</td>
578     </tr>
579     <tr>
580       <td>\ref __Vendor_SysTickConfig</td>
581       <td>0 .. 1</td>
582       <td>0</td>
583       <td>
584         If this define is set to 1, then the default <b>SysTick_Config</b> function
585         is excluded. In this case, the file <i><b>device.h</b></i>
586         must contain a vendor specific implementation of this function.
587       </td>
588     </tr>
589     <tr>
590       <td>\ref __FPU_PRESENT</td>
591       <td>0 .. 1</td>
592       <td>0</td>
593       <td>Defines if a FPU is present or not.</td>
594     </tr>
595     <tr>
596       <td>\ref __FPU_DP</td>
597       <td>0 .. 1</td>
598       <td>0</td>
599       <td>
600         The combination of the defines \ref __FPU_PRESENT and \ref __FPU_DP
601        determine whether the FPU is with single or double precision.
602       </td>
603     </tr>
604     <tr>
605       <td>\ref __ICACHE_PRESENT</td>
606       <td>0 .. 1</td>
607       <td>1</td>
608       <td>Instruction Chache present or not</td>
609     </tr>
610     <tr>
611       <td>\ref __DCACHE_PRESENT</td>
612       <td>0 .. 1</td>
613       <td>1</td>
614       <td>Data Chache present or not</td>
615     </tr>
616     <tr>
617       <td>\ref __DTCM_PRESENT</td>
618       <td>0 .. 1</td>
619       <td>1</td>
620       <td>Data Tightly Coupled Memory is present or not</td>
621     </tr>
622 </table>
623
624 \if ARMSC
625 \b core_sc000.h
626 <table class="cmtable">
627     <tr>
628       <th>\#define</th>
629       <th>Value Range</th>
630       <th>Default</th>
631       <th>Description</th>
632     </tr>
633     <tr>
634       <td>\ref __SC000_REV</td>
635       <td>0x0000</td>
636       <td>0x0000</td>
637       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
638     </tr>
639     <tr>
640       <td>\ref __VTOR_PRESENT</td>
641       <td>0 .. 1</td>
642       <td>0</td>
643       <td>Defines if a VTOR register is present or not</td>
644     </tr>
645     <tr>
646       <td>\ref __NVIC_PRIO_BITS</td>
647       <td>2</td>
648       <td>2</td>
649       <td>Number of priority bits implemented in the NVIC (device specific)</td>
650     </tr>
651     <tr>
652       <td>\ref __MPU_PRESENT</td>
653       <td>0 .. 1</td>
654       <td>0</td>
655       <td>Defines if a MPU is present or not</td>
656     </tr>
657     <tr>
658       <td>\ref __Vendor_SysTickConfig</td>
659       <td>0 .. 1</td>
660       <td>0</td>
661       <td>Vendor defined <b>SysTick_Config</b> function.</td>
662     </tr>
663 </table>
664 \endif
665
666 \if ARMSC
667 \b core_sc300.h
668 <table class="cmtable">
669     <tr>
670       <th>\#define</th>
671       <th>Value Range</th>
672       <th>Default</th>
673       <th>Description</th>
674     </tr>
675     <tr>
676       <td>\ref __SC300_REV</td>
677       <td>0x0000</td>
678       <td>0x0000</td>
679       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
680     </tr>
681     <tr>
682       <td>\ref __VTOR_PRESENT</td>
683       <td>0 .. 1</td>
684       <td>1</td>
685       <td>Defines if a VTOR register is present or not</td>
686     </tr>
687     <tr>
688       <td>\ref __NVIC_PRIO_BITS</td>
689       <td>2 .. 8</td>
690       <td>4</td>
691       <td>Number of priority bits implemented in the NVIC (device specific)</td>
692     </tr>
693     <tr>
694       <td>\ref __MPU_PRESENT</td>
695       <td>0 .. 1</td>
696       <td>0</td>
697       <td>Defines if a MPU is present or not</td>
698     </tr>
699     <tr>
700       <td>\ref __Vendor_SysTickConfig</td>
701       <td>0 .. 1</td>
702       <td>0</td>
703       <td>Vendor defined <b>SysTick_Config</b> function.</td>
704     </tr>
705 </table>
706 \endif
707
708 \if ARMv8M
709 \b core_CM23.h or \b core_ARMv8MBL.h
710 <table class="cmtable">
711     <tr>
712       <th>\#define</th>
713       <th>Value Range</th>
714       <th>Default</th>
715       <th>Description</th>
716     </tr>
717     <tr>
718       <td>\ref __ARMv8MBL_REV or \ref __CM23_REV</td>
719       <td>0x0000</td>
720       <td>0x0000</td>
721       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
722     </tr>
723     <tr>
724       <td>\ref __MPU_PRESENT</td>
725       <td>0 .. 1</td>
726       <td>0</td>
727       <td>Defines if a MPU is present or not</td>
728     </tr>
729     <tr>
730       <td>\ref __SAUREGION_PRESENT</td>
731       <td>0 .. 1</td>
732       <td>0</td>
733       <td>Defines if SAU regions are present or not</td>
734     </tr>
735     <tr>
736       <td>\ref __VTOR_PRESENT</td>
737       <td>0 .. 1</td>
738       <td>0</td>
739       <td>Defines if a VTOR register is present or not</td>
740     </tr>
741     <tr>
742       <td>\ref __NVIC_PRIO_BITS</td>
743       <td>2</td>
744       <td>2</td>
745       <td>Number of priority bits implemented in the NVIC (device specific)</td>
746     </tr>
747     <tr>
748       <td>\ref __Vendor_SysTickConfig</td>
749       <td>0 .. 1</td>
750       <td>0</td>
751       <td>Vendor defined <b>SysTick_Config</b> function.</td>
752     </tr>
753 </table>
754 \endif
755
756 \if ARMv8M
757 \b core_CM33.h or \b core_cm35p.h or \b core_ARMv8MML.h
758 <table class="cmtable">
759     <tr>
760       <th>\#define</th>
761       <th>Value Range</th>
762       <th>Default</th>
763       <th>Description</th>
764     </tr>
765     <tr>
766       <td>\ref __ARMv8MML_REV or \ref __CM33_REV or \ref __CM35P_REV</td>
767       <td>0x0000</td>
768       <td>0x0000</td>
769       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
770     </tr>
771     <tr>
772       <td>\ref __MPU_PRESENT</td>
773       <td>0 .. 1</td>
774       <td>0</td>
775       <td>Defines if a MPU is present or not</td>
776     </tr>
777     <tr>
778       <td>\ref __SAUREGION_PRESENT</td>
779       <td>0 .. 1</td>
780       <td>0</td>
781       <td>Defines if SAU regions are present or not</td>
782     </tr>
783     <tr>
784       <td>\ref __FPU_PRESENT</td>
785       <td>0 .. 1</td>
786       <td>0</td>
787       <td>Defines if a FPU is present or not</td>
788     </tr>
789     <tr>
790       <td>\ref __VTOR_PRESENT</td>
791       <td>0 .. 1</td>
792       <td>1</td>
793       <td>Defines if a VTOR register is present or not</td>
794     </tr>
795     <tr>
796       <td>\ref __NVIC_PRIO_BITS</td>
797       <td>2 .. 8</td>
798       <td>3</td>
799       <td>Number of priority bits implemented in the NVIC (device specific)</td>
800     </tr>
801     <tr>
802       <td>\ref __Vendor_SysTickConfig</td>
803       <td>0 .. 1</td>
804       <td>0</td>
805       <td>Vendor defined <b>SysTick_Config</b> function.</td>
806     </tr>
807 </table>
808 \endif
809
810 \if ARMv8M
811 \b core_CM55.h or \b core_ARMv81MML.h
812 <table class="cmtable">
813     <tr>
814       <th>\#define</th>
815       <th>Value Range</th>
816       <th>Default</th>
817       <th>Description</th>
818     </tr>
819     <tr>
820       <td>\ref __ARMv81MML_REV or \ref __CM55_REV</td>
821       <td>0x0000</td>
822       <td>0x0000</td>
823       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
824     </tr>
825     <tr>
826       <td>\ref __MPU_PRESENT</td>
827       <td>0 .. 1</td>
828       <td>0</td>
829       <td>Defines if a MPU is present or not</td>
830     </tr>
831     <tr>
832       <td>\ref __SAUREGION_PRESENT</td>
833       <td>0 .. 1</td>
834       <td>0</td>
835       <td>Defines if SAU regions are present or not</td>
836     </tr>
837     <tr>
838       <td>\ref __FPU_PRESENT</td>
839       <td>0 .. 1</td>
840       <td>0</td>
841       <td>Defines if a FPU is present or not</td>
842     </tr>
843     <tr>
844       <td>\ref __FPU_DP</td>
845       <td>0 .. 1</td>
846       <td>0</td>
847       <td>
848         The combination of the defines \ref __FPU_PRESENT and \ref __FPU_DP determine 
849         whether the FPU is with single or double precision.
850       </td>
851     </tr>
852     <tr>
853       <td>\ref __ICACHE_PRESENT</td>
854       <td>0 .. 1</td>
855       <td>1</td>
856       <td>Instruction Chache present or not</td>
857     </tr>
858     <tr>
859       <td>\ref __DCACHE_PRESENT</td>
860       <td>0 .. 1</td>
861       <td>1</td>
862       <td>Data Chache present or not</td>
863     </tr>
864     <tr>
865       <td>\ref __VTOR_PRESENT</td>
866       <td>0 .. 1</td>
867       <td>1</td>
868       <td>Defines if a VTOR register is present or not</td>
869     </tr>
870     <tr>
871       <td>\ref __NVIC_PRIO_BITS</td>
872       <td>2 .. 8</td>
873       <td>3</td>
874       <td>Number of priority bits implemented in the NVIC (device specific)</td>
875     </tr>
876     <tr>
877       <td>\ref __Vendor_SysTickConfig</td>
878       <td>0 .. 1</td>
879       <td>0</td>
880       <td>Vendor defined <b>SysTick_Config</b> function.</td>
881     </tr>
882 </table>
883 \endif
884
885 \b Example
886
887 The following code exemplifies the configuration of the Cortex-M4 Processor and Core Peripherals.
888
889 \code
890 #define __CM4_REV                 0x0001U   /* Core revision r0p1                                 */
891 #define __MPU_PRESENT             1U        /* MPU present or not                                 */
892 #define __VTOR_PRESENT            1U        /* VTOR present */
893 #define __NVIC_PRIO_BITS          3U        /* Number of Bits used for Priority Levels            */
894 #define __Vendor_SysTickConfig    0U        /* Set to 1 if different SysTick Config is used       */
895 #define __FPU_PRESENT             1U        /* FPU present or not                                 */
896 .
897 .
898 #include <core_cm4.h>                       /* Cortex-M4 processor and core peripherals           */
899 #include "system_<device>.h"                /* Device System Header                               */
900 \endcode
901
902
903 \section core_version_sect   CMSIS Version and Processor Information
904
905 Defines in the core_<i>cpu</i>.h file identify the version of the CMSIS-Core (Cortex-M) and the processor used.
906 The following shows the defines in the various core_<i>cpu</i>.h files that may be used in the \ref device_h_pg
907 to verify a minimum version or ensure that the right processor core is used.
908
909 \b core_cm0.h
910 \code
911 #define __CM0_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                         /* [31:16] CMSIS HAL main version */
912 #define __CM0_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                          /* [15:0]  CMSIS HAL sub version */
913 #define __CM0_CMSIS_VERSION       ((__CM0_CMSIS_VERSION_MAIN << 16U) | \
914                                     __CM0_CMSIS_VERSION_SUB          )              /* CMSIS HAL version number */
915
916 #define __CORTEX_M                (0U)                                              /* Cortex-M Core */
917 \endcode
918
919
920 \b core_cm0plus.h
921 \code
922 #define __CM0PLUS_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                     /* [31:16] CMSIS HAL main version */
923 #define __CM0PLUS_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                      /* [15:0]  CMSIS HAL sub version */
924 #define __CM0PLUS_CMSIS_VERSION       ((__CM0P_CMSIS_VERSION_MAIN << 16U) | \
925                                         __CM0P_CMSIS_VERSION_SUB          )         /* CMSIS HAL version number */
926
927 #define __CORTEX_M                    (0U)                                          /* Cortex-M Core */
928 \endcode
929
930
931 \b core_cm1.h
932 \code
933 #define __CM1_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                         /*!< \deprecated [31:16] CMSIS HAL main version */
934 #define __CM1_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                          /*!< \deprecated [15:0]  CMSIS HAL sub version */
935 #define __CM1_CMSIS_VERSION       ((__CM1_CMSIS_VERSION_MAIN << 16U) | \
936                                     __CM1_CMSIS_VERSION_SUB           )             /*!< \deprecated CMSIS HAL version number */
937
938 #define __CORTEX_M                (1U)                                              /*!< Cortex-M Core */
939 \endcode
940
941 \b core_cm3.h
942 \code
943 #define __CM3_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                         /* [31:16] CMSIS HAL main version */
944 #define __CM3_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                          /* [15:0]  CMSIS HAL sub version */
945 #define __CM3_CMSIS_VERSION       ((__CM3_CMSIS_VERSION_MAIN << 16U) | \
946                                     __CM3_CMSIS_VERSION_SUB          )              /* CMSIS HAL version number */
947
948 #define __CORTEX_M                (3U)                                              /* Cortex-M Core */
949 \endcode
950
951 \b core_cm4.h
952 \code
953 #define __CM4_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                         /* [31:16] CMSIS HAL main version */
954 #define __CM4_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                          /* [15:0]  CMSIS HAL sub version */
955 #define __CM4_CMSIS_VERSION       ((__CM4_CMSIS_VERSION_MAIN << 16U) | \
956                                     __CM4_CMSIS_VERSION_SUB          )              /* CMSIS HAL version number */
957
958 #define __CORTEX_M                (4U)                                              /* Cortex-M Core */
959 \endcode
960
961 \b core_cm7.h
962 \code
963 #define __CM7_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN                          /* [31:16] CMSIS HAL main version */
964 #define __CM7_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                          /* [15:0]  CMSIS HAL sub version */
965 #define __CM7_CMSIS_VERSION       ((__CM7_CMSIS_VERSION_MAIN << 16U) | \
966                                     __CM7_CMSIS_VERSION_SUB          )              /* CMSIS HAL version number */
967
968 #define __CORTEX_M                (7U)                                              /* Cortex-M Core */
969 \endcode
970
971 \if ARMv8M
972 \b core_cm23.h
973 \code
974 #define __CM23_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                        /* [31:16] CMSIS HAL main version */
975 #define __CM23_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                         /* [15:0]  CMSIS HAL sub version */
976 #define __CM23_CMSIS_VERSION       ((__CM23_CMSIS_VERSION_MAIN << 16U) | \
977                                      __CM23_CMSIS_VERSION_SUB          )            /* CMSIS HAL version number */
978
979 #define __CORTEX_M                (23U)                                             /* Cortex-M Core */
980 \endcode
981
982 \b core_cm33.h
983 \code
984 #define __CM33_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                        /* [31:16] CMSIS HAL main version */
985 #define __CM33_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                         /* [15:0]  CMSIS HAL sub version */
986 #define __CM33_CMSIS_VERSION       ((__CM33_CMSIS_VERSION_MAIN << 16U) | \
987                                      __CM33_CMSIS_VERSION_SUB          )            /* CMSIS HAL version number */
988
989 #define __CORTEX_M                (33U)                                             /* Cortex-M Core */
990 \endcode
991
992 \b core_cm55.h
993 \code
994 #define __CM55_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                        /* [31:16] CMSIS HAL main version */
995 #define __CM55_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                         /* [15:0]  CMSIS HAL sub version */
996 #define __CM55_CMSIS_VERSION       ((__CM55_CMSIS_VERSION_MAIN << 16U) | \
997                                      __CM55_CMSIS_VERSION_SUB          )            /* CMSIS HAL version number */
998
999 #define __CORTEX_M                (7U)                                              /* Cortex-M Core */
1000 \endcode
1001 \endif
1002
1003 \if ARMSC
1004 \b core_sc000.h
1005 \code
1006 #define __SC000_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                       /* [31:16] CMSIS HAL main version */
1007 #define __SC000_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                        /* [15:0]  CMSIS HAL sub version */
1008 #define __SC000_CMSIS_VERSION       ((__SC000_CMSIS_VERSION_MAIN << 16U) | \
1009                                       __SC000_CMSIS_VERSION_SUB          )          /* CMSIS HAL version number */
1010
1011 #define __CORTEX_SC                 (0U)                                            /* Cortex secure core */
1012 \endcode
1013 \endif
1014
1015 \if ARMSC
1016 \b core_sc300.h
1017 \code
1018 #define __SC300_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                       /* [31:16] CMSIS HAL main version */
1019 #define __SC300_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                        /* [15:0]  CMSIS HAL sub version */
1020 #define __SC300_CMSIS_VERSION       ((__SC300_CMSIS_VERSION_MAIN << 16U) | \
1021                                       __SC300_CMSIS_VERSION_SUB          )          /* CMSIS HAL version number */
1022
1023 #define __CORTEX_SC                 (300U)                                          /* Cortex secure core */
1024 \endcode
1025 \endif
1026
1027 \if ARMv8M
1028 \if ARMSC
1029 \b core_cm35p.h
1030 \code
1031 #define __CM35P_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                       /* [31:16] CMSIS HAL main version */
1032 #define __CM35P_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                        /* [15:0]  CMSIS HAL sub version */
1033 #define __CM35P_CMSIS_VERSION       ((__CM35P_CMSIS_VERSION_MAIN << 16U) | \
1034                                       __CM35P_CMSIS_VERSION_SUB          )          /* CMSIS HAL version number */
1035
1036 #define __CORTEX_M                (35U)                                             /* Cortex-M Core */
1037 \endcode
1038 \endif
1039 \endif
1040
1041 \if ARMv8M
1042 \b core_ARMv8MBL.h
1043 \code
1044 #define __ARMv8MBL_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                    /* [31:16] CMSIS HAL main version */
1045 #define __ARMv8MBL_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                     /* [15:0]  CMSIS HAL sub version */
1046 #define __ARMv8MBL_CMSIS_VERSION       ((__ARMv8MBL_CMSIS_VERSION_MAIN << 16U) | \
1047                                          __ARMv8MBL_CMSIS_VERSION_SUB           )   /* CMSIS HAL version number */
1048
1049 #define __CORTEX_M                     (2U)                                         /* Cortex secure core */
1050 \endcode
1051 \endif
1052
1053 \if ARMv8M
1054 \b core_ARMv8MML.h
1055 \code
1056 #define __ARMv8MML_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                    /* [31:16] CMSIS HAL main version */
1057 #define __ARMv8MML_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                     /* [15:0]  CMSIS HAL sub version */
1058 #define __ARMv8MML_CMSIS_VERSION       ((__ARMv8MML_CMSIS_VERSION_MAIN << 16U) | \
1059                                          __ARMv8MML_CMSIS_VERSION_SUB           )   /* CMSIS HAL version number */
1060
1061 #define __CORTEX_M                     (80U)                                        /* Cortex secure core */
1062 \endcode
1063 \endif
1064
1065 \if ARMv81M
1066 \b core_ARMv81MML.h
1067 \code
1068 #define __ARMv81MML_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                   /* [31:16] CMSIS HAL main version */
1069 #define __ARMv81MML_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                    /* [15:0]  CMSIS HAL sub version */
1070 #define __ARMv81MML_CMSIS_VERSION       ((__ARMv81MML_CMSIS_VERSION_MAIN << 16U) | \
1071                                           __ARMv81MML_CMSIS_VERSION_SUB           ) /* CMSIS HAL version number */
1072
1073 #define __CORTEX_M                     (81U)                                        /* Cortex secure core */
1074 \endcode
1075 \endif
1076
1077 \section device_access Device Peripheral Access Layer
1078
1079 The \ref device_h_pg contains for each peripheral:
1080  - Register Layout Typedef
1081  - Base Address
1082  - Access Definitions
1083
1084 The section \ref peripheral_gr shows examples for peripheral definitions.
1085
1086 \section device_h_sec Device.h Template File
1087
1088 The silicon vendor needs to extend the Device.h template file with the CMSIS features described above.
1089 In addition the \ref device_h_pg may contain functions to access device-specific peripherals.
1090 The \ref system_Device_h_sec which is provided as part of the CMSIS specification is shown below.
1091
1092 \verbinclude "Include\Device.h"
1093
1094 */
1095
1096
1097
1098 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
1099 /**
1100 \if ARMv8M
1101
1102 \page partition_h_pg TrustZone setup: partition_<device>.h
1103
1104 The \ref partition_h_pg header file contains the initial setup of the TrustZone hardware in an Armv8-M system.
1105
1106 This file implements the function \ref TZ_SAU_Setup that is call from \ref SystemInit. It uses settings in these files:
1107
1108  - \ref partition_h_pg "partition_<device>.h" that defines the initial system configuration and during SystemInit in Secure state.
1109  - \ref partition_gen_h_pg "partition_gen.h" that contains SAU region and interrupt target assignments. This file may be generated using <a href="../../Zone/html/index.html"><b>CMSIS-Zone</b></a>.
1110
1111 \note
1112 \ref partition_gen_h_pg "partition_gen.h" is optional and can be generated using <a href="../../Zone/html/index.html"><b>CMSIS-Zone</b></a>.  In previous versions of CMSIS-Core(M) this settings were part of \ref partition_h_pg "partition_<device>.h".
1113
1114 &nbsp;
1115
1116
1117 The \ref partition_h_pg "partition_<device>.h" file contains the following configuration settings for:
1118   - \ref sau_ctrlregister_sec provides settings for the SAU CTRL register.
1119   - \ref sau_sleepexception_sec provides device-specific deep-sleep and exception settings.
1120   - \ref sau_fpu_sec defines the usage of the Floating Point Unit in secure and non-secure state.
1121
1122 The \ref partition_h_pg "partition_<device>.h" file includes the \ref partition_gen_h_pg "partition_gen.h" file with configuration settings for:
1123   - \ref sau_regions_sect provides configuration of the SAU Address Regions.
1124   - \ref sau_interrupttarget_sec provides device-specific interrupt target settings.
1125
1126 \section sau_ctrlregister_sec  SAU CTRL register settings
1127 <table class="cmtable">
1128     <tr>
1129       <th>\#define</th>
1130       <th>Value Range</th>
1131       <th>Default</th>
1132       <th>Description</th>
1133     </tr>
1134     <tr>
1135       <td>SAU_INIT_CTRL</td>
1136       <td>0 .. 1</td>
1137       <td>0</td>
1138       <td>Initialize SAU CTRL register or not
1139            - 0: do not initialize SAU CTRL register
1140            - 1: initialize SAU CTRL register</td>
1141     </tr>
1142     <tr>
1143       <td>SAU_INIT_CTRL_ENABLE</td>
1144       <td>0 .. 1</td>
1145       <td>0</td>
1146       <td>enable/disable the SAU
1147            - 0: disable SAU
1148            - 1: enable SAU</td>
1149     </tr>
1150     <tr>
1151       <td>SAU_INIT_CTRL_ALLNS</td>
1152       <td>0 .. 1</td>
1153       <td>0</td>
1154       <td>value for SAU_CTRL register bit ALLNS
1155            - 0: all Memory is Secure
1156            - 1: all Memory is Non-Secure</td>
1157     </tr>
1158 </table>
1159
1160
1161 \section sau_sleepexception_sec  Configuration of Sleep and Exception behaviour
1162 <table class="cmtable">
1163     <tr>
1164       <th>\#define</th>
1165       <th>Value Range</th>
1166       <th>Default</th>
1167       <th>Description</th>
1168     </tr>
1169     <tr>
1170       <td>SCB_CSR_AIRCR_INIT</td>
1171       <td>0 .. 1</td>
1172       <td>1</td>
1173       <td>Setup behaviour of Sleep and Exception Handling
1174            - 0: not setup of CSR and AIRCR registers; the values below are not relevant
1175            - 1: setup of CSR and AIRCR registers with values below</td>
1176     </tr>
1177     <tr>
1178       <td>CSR_INIT_DEEPSLEEPS_VAL</td>
1179       <td>0 .. 1</td>
1180       <td>1</td>
1181       <td>value for SCB_CSR register bit DEEPSLEEPS
1182            - 0: Deep Sleep can be enabled by Secure and Non-Secure state
1183            - 1: Deep Sleep can be enabled by Secure state only</td>
1184     </tr>
1185     <tr>
1186       <td>AIRCR_INIT_SYSRESETREQS_VAL</td>
1187       <td>0 .. 1</td>
1188       <td>1</td>
1189       <td>value for SCB_AIRCR register bit SYSRESETREQS
1190            - 0: System reset request accessible from Secure and Non-Secure state
1191            - 1: System reset request accessible from Secure state only</td>
1192     </tr>
1193     <tr>
1194       <td>AIRCR_INIT_PRIS_VAL</td>
1195       <td>0 .. 1</td>
1196       <td>1</td>
1197       <td>value for SCB_AIRCR register bit PRIS
1198            - 0: Priority of Non-Secure exceptions is Not altered
1199            - 1: Priority of Non-Secure exceptions is Lowered to 0x80-0xFF</td>
1200     </tr>
1201     <tr>
1202       <td>AIRCR_INIT_BFHFNMINS_VAL</td>
1203       <td>0 .. 1</td>
1204       <td>0</td>
1205       <td>value for SCB_AIRCR register bit BFHFNMINS
1206            - 0: BusFault, HardFault, and NMI target are Secure state
1207            - 1: BusFault, HardFault, and NMI target are Non-Secure state</td>
1208     </tr>
1209 </table>
1210
1211
1212 \section sau_fpu_sec  Configuration of Floating Point Unit
1213 <table class="cmtable">
1214     <tr>
1215       <th>\#define</th>
1216       <th>Value Range</th>
1217       <th>Default</th>
1218       <th>Description</th>
1219     </tr>
1220     <tr>
1221       <td>TZ_FPU_NS_USAGE</td>
1222       <td>0 .. 1</td>
1223       <td>1</td>
1224       <td>Setup behaviour of Floating Point Unit
1225            - 0: not setup of NSACR and FPCCR registers; the values below are not relevant
1226            - 1: setup of NSACR and FPCCR registers with values below</td>
1227     </tr>
1228     <tr>
1229       <td>SCB_NSACR_CP10_11_VAL</td>
1230       <td>0 or 3</td>
1231       <td>3</td>
1232       <td>Floating Point Unit usage (Value for SCB->NSACR register bits CP10, CP11)
1233            - 0: Secure state only
1234            - 3: Secure and Non-Secure state</td>
1235     </tr>
1236     <tr>
1237       <td>FPU_FPCCR_TS_VAL</td>
1238       <td>0 .. 1</td>
1239       <td>0</td>
1240       <td>Treat floating-point registers as Secure (value for FPU->FPCCR register bit TS)
1241            - 0: Disable
1242            - 1: Enabled</td>
1243     </tr>
1244     <tr>
1245       <td>FPU_FPCCR_CLRONRETS_VAL</td>
1246       <td>0 .. 1</td>
1247       <td>0</td>
1248       <td>Clear on return (CLRONRET) accessibility (Value for FPU->FPCCR register bit CLRONRETS)
1249            - 0: Secure and Non-Secure state
1250            - 1: Secure state only</td>
1251     </tr>
1252     <tr>
1253       <td>FPU_FPCCR_CLRONRET_VAL</td>
1254       <td>0 .. 1</td>
1255       <td>1</td>
1256       <td>Clear floating-point caller saved registers on exception return (Value for FPU->FPCCR register bit CLRONRET)
1257            - 0: Disabled
1258            - 1: Enabled</td>
1259     </tr>
1260 </table>
1261
1262 &nbsp;
1263
1264 ----
1265
1266 \section partition_gen_h_pg Region/ISR setup: partition_gen.h
1267
1268 The \ref partition_gen_h_pg "partition_gen.h" header file can be generated using <a href="../../Zone/html/index.html"><b>CMSIS-Zone</b></a>.
1269
1270 The \ref partition_h_pg "partition_<device>.h" file includes the \ref partition_h_pg "partition_gen.h" file with configuration settings for:
1271   - \ref sau_regions_sect provides configuration of the SAU Address Regions.
1272   - \ref sau_interrupttarget_sec provides device-specific interrupt target settings.
1273
1274 \note
1275 In previous versions of CMSIS-Core(M) the above settings were part of \ref partition_h_pg "partition_<device>.h"
1276
1277 \subsection sau_regions_sect  Configuration of the SAU Address Regions
1278 <table class="cmtable">
1279     <tr>
1280       <th>\#define</th>
1281       <th>Value Range</th>
1282       <th>Default</th>
1283       <th>Description</th>
1284     </tr>
1285     <tr>
1286       <td>SAU_REGIONS_MAX</td>
1287       <td>0 .. tbd</td>
1288       <td>8</td>
1289       <td>maximum number of SAU regions</td>
1290     </tr>
1291     <tr>
1292       <td>SAU_INIT_REGION<number></td>
1293       <td>0 .. 1</td>
1294       <td>0</td>
1295       <td>initialize SAU region or not
1296            - 0: do not initialize SAU region
1297            - 1: initialize SAU region</td>
1298     </tr>
1299     <tr>
1300       <td>SAU_INIT_START<number></td>
1301       <td>0x00000000 .. 0xFFFFFFE0\n
1302           [in steps of 32]</td>
1303       <td>0x00000000</td>
1304       <td>region start address</td>
1305     </tr>
1306     <tr>
1307       <td>SAU_INIT_END<number></td>
1308       <td>0x00000000 .. 0xFFFFFFE0\n
1309           [in steps of 32]</td>
1310       <td>0x00000000</td>
1311       <td>region start address</td>
1312     </tr>
1313     <tr>
1314       <td>SAU_INIT_NSC<number></td>
1315       <td>0 .. 1</td>
1316       <td>0</td>
1317       <td>SAU region attribute
1318            - 0: Non-Secure
1319            - 1: Secure, Non-Secure callable</td>
1320     </tr>
1321 </table>
1322
1323 The range of \<number\> is from 0 .. SAU_REGIONS_MAX.
1324 A set of these macros must exist for each \<number\>.
1325
1326 The following example shows a set of SAU region macros.
1327
1328 \code
1329 #define SAU_REGIONS_MAX   8                 /* Max. number of SAU regions */
1330
1331 #define SAU_INIT_REGION0    1
1332 #define SAU_INIT_START0     0x00000000      /* start address of SAU region 0 */
1333 #define SAU_INIT_END0       0x001FFFE0      /* end address of SAU region 0 */
1334 #define SAU_INIT_NSC0       1
1335
1336 #define SAU_INIT_REGION1    1
1337 #define SAU_INIT_START1     0x00200000      /* start address of SAU region 1 */
1338 #define SAU_INIT_END1       0x003FFFE0      /* end address of SAU region 1 */
1339 #define SAU_INIT_NSC1       0
1340
1341 #define SAU_INIT_REGION2    1
1342 #define SAU_INIT_START2     0x20200000      /* start address of SAU region 2 */
1343 #define SAU_INIT_END2       0x203FFFE0      /* end address of SAU region 2 */
1344 #define SAU_INIT_NSC2       0
1345
1346 #define SAU_INIT_REGION3    1
1347 #define SAU_INIT_START3     0x40000000      /* start address of SAU region 3 */
1348 #define SAU_INIT_END3       0x40040000      /* end address of SAU region 3 */
1349 #define SAU_INIT_NSC3       0
1350
1351 #define SAU_INIT_REGION4    0
1352 #define SAU_INIT_START4     0x00000000      /* start address of SAU region 4 */
1353 #define SAU_INIT_END4       0x00000000      /* end address of SAU region 4 */
1354 #define SAU_INIT_NSC4       0
1355
1356 #define SAU_INIT_REGION5    0
1357 #define SAU_INIT_START5     0x00000000      /* start address of SAU region 5 */
1358 #define SAU_INIT_END5       0x00000000      /* end address of SAU region 5 */
1359 #define SAU_INIT_NSC5       0
1360
1361 #define SAU_INIT_REGION6    0
1362 #define SAU_INIT_START6     0x00000000      /* start address of SAU region 6 */
1363 #define SAU_INIT_END6       0x00000000      /* end address of SAU region 6 */
1364 #define SAU_INIT_NSC6       0
1365
1366 #define SAU_INIT_REGION7    0
1367 #define SAU_INIT_START7     0x00000000      /* start address of SAU region 7 */
1368 #define SAU_INIT_END7       0x00000000      /* end address of SAU region 7 */
1369 #define SAU_INIT_NSC7       0
1370 \endcode
1371
1372
1373 \subsection sau_interrupttarget_sec Configuration of Interrupt Target settings
1374
1375 Each interrupt has a configuration bit that defines the execution
1376 in Secure or Non-secure state. The Non-Secure interrupts have a separate
1377 vector table.  Refer to \ref Model_TrustZone for more information.
1378
1379 <table class="cmtable">
1380     <tr>
1381       <th>\#define</th>
1382       <th>Value Range</th>
1383       <th>Default</th>
1384       <th>Description</th>
1385     </tr>
1386     <tr>
1387       <td>NVIC_INIT_ITNS<number></td>
1388       <td>0x00000000 .. 0xFFFFFFFF\n
1389           [each bit represents an interrupt]</td>
1390       <td>0x00000000</td>
1391       <td>Interrupt vector target
1392            - 0: Secure state
1393            - 1: Non-Secure state</td>
1394     </tr>
1395 </table>
1396
1397 The range of \<number\> is 0 .. (\<number of external interrupts\> + 31) / 32.
1398
1399 The following example shows the configuration for a maximum of 64 external interrupts.
1400
1401 \code
1402 #define NVIC_INIT_ITNS0      0x0000122B
1403 #define NVIC_INIT_ITNS1      0x0000003A
1404 \endcode
1405
1406 \endif
1407
1408 */
1409
1410 /**
1411 \defgroup device_config Device capabilitiy defines
1412 \brief Defines to configure and check device capabilities.
1413 \details
1414 These defines are used by the \ref device_h_pg in order to enable or disable
1415 functionality provided by CMSIS-Core(M) dependent on the device capabilities.
1416
1417 @{
1418 */
1419
1420 #define __CM0_REV                     /*!< \brief Cortex-M0 Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1421 #define __CM0PLUS_REV                 /*!< \brief Cortex-M0+ Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1422 #define __CM1_REV                     /*!< \brief Cortex-M1 Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1423 #define __CM3_REV                     /*!< \brief Cortex-M3 Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1424 #define __CM4_REV                     /*!< \brief Cortex-M4 Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1425 #define __CM7_REV                     /*!< \brief Cortex-M7 Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1426 #define __SC000_REV                   /*!< \brief SC000 Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1427 #define __SC300_REV                   /*!< \brief SC300 Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1428 #define __CM23_REV                    /*!< \brief Cortex-M23 Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1429 #define __CM33_REV                    /*!< \brief Cortex-M33 Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1430 #define __CM35P_REV                   /*!< \brief Cortex-M35P Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1431 #define __CM55_REV                    /*!< \brief Cortex-M55 Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1432 #define __ARMv8MBL_REV                /*!< \brief Armv8-M Baseline device Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1433 #define __ARMv8MML_REV                /*!< \brief Armv8-M Mainline device Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1434 #define __ARMv81MML_REV               /*!< \brief Armv8.1-M Baseline device Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1435 #define __NVIC_PRIO_BITS              /*!< \brief Number of Bits used for Priority Levels */
1436 #define __Vendor_SysTickConfig        /*!< \brief Set to 1 if a venor specfic SysTick configuration is used.
1437                                            \details If this define is set to 1, then the default \ref SysTick_Config function is excluded. In this
1438                                                     case, the file device.h must contain a vendor specific implementation of this function. */
1439 #define __VTOR_PRESENT                /*!< \brief VTOR present or not \details See \ref SCB_Type::VTOR */
1440 #define __MPU_PRESENT                 /*!< \brief MPU present or not */
1441
1442 /**
1443   \brief FPU present or not
1444   \details
1445   The combination of the defines \ref __FPU_PRESENT and \ref __FPU_DP
1446   determine the whether the FPU is with single or double precision as shown
1447   in the table below.
1448   <table class="cmtable" summary="">
1449     <tr bgcolor="cyan">
1450       <td>\ref __FPU_PRESENT</td>
1451       <td>\ref __FPU_DP</td>
1452       <td><b>Description</b></td>
1453     </tr>
1454     <tr>
1455       <td align="center">0</td>
1456       <td align="center"><i>ignored</i></td>
1457       <td>Processor has no FPU. The value set for \ref __FPU_DP.</td>
1458     </tr>
1459     <tr>
1460       <td align="center">1</td>
1461       <td align="center">0</td>
1462       <td>Processor with FPU with single precision.</td>
1463     </tr>
1464     <tr>
1465       <td align="center">1</td>
1466       <td align="center">1</td>
1467       <td>Processor with FPU with double precision.</td>
1468     </tr>
1469   </table>
1470 */
1471 #define __FPU_PRESENT               /*!< \brief FPU present \details The */
1472
1473 /**
1474   \brief Double precision FPU present
1475   \details
1476   The combination of the defines \ref __FPU_PRESENT and \ref __FPU_DP
1477   determine the whether the FPU is with single or double precision as shown
1478   in the table below.
1479   <table class="cmtable" summary="">
1480     <tr bgcolor="cyan">
1481       <td>\ref __FPU_PRESENT</td>
1482       <td>\ref __FPU_DP</td>
1483       <td><b>Description</b></td>
1484     </tr>
1485     <tr>
1486       <td align="center">0</td>
1487       <td align="center"><i>ignored</i></td>
1488       <td>Processor has no FPU. The value set for \ref __FPU_DP. </td>
1489     </tr>
1490     <tr>
1491       <td align="center">1</td>
1492       <td align="center">0</td>
1493       <td>Processor with FPU with single precision.</td>
1494     </tr>
1495     <tr>
1496       <td align="center">1</td>
1497       <td align="center">1</td>
1498       <td>Processor with FPU with double precision.</td>
1499     </tr>
1500   </table>
1501 */
1502 #define __FPU_DP                  
1503
1504 #define __DSP_PRESENT               /*!< \brief DSP extension present or not */
1505 #define __SAUREGION_PRESENT         /*!< \brief SAU regions present or not */
1506 #define __PMU_PRESENT               /*!< \brief PMU present or not */
1507 #define __PMU_NUM_EVENTCNT          /*!< \brief PMU Event Counters \details The number of Event counters if PMU is present (see \ref __PMU_PRESENT) */
1508 #define __ICACHE_PRESENT            /*!< \brief Instruction Cache present or not */
1509 #define __DCACHE_PRESENT            /*!< \brief Data Cache present or not */
1510 #define __DTCM_PRESENT              /*!< \brief Data Tightly Coupled Memory is present or not */
1511 /** @} */