]> begriffs open source - cmsis/blob - CMSIS/DoxyGen/Core_A/src/Template.txt
Added template and using pages to Core-A documentation.
[cmsis] / CMSIS / DoxyGen / Core_A / 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-A processors and various compiler vendors.
7 Refer to the list of \ref tested_tools_sec for compliance.
8
9 These CMSIS-Core device template files include the following:
10  - Register names of the Core Peripherals and names of the Core Exception Vectors.
11  - Functions to access core peripherals, cache, MMU and special CPU instructions 
12  - Generic startup code and system configuration code.
13
14 The detailed file structure of the CMSIS-Core device templates is shown in the following picture.
15
16 <!-- \image html "CMSIS_CORE_Files.png" "CMSIS-Core File Structure" -->
17
18 \section CMSIS_Processor_files CMSIS-Core Processor Files 
19
20 The CMSIS-Core processor files provided by ARM are in the directory .\\CMSIS\\Core_A\\Include. These header files define all processor specific attributes do not need any modifications.
21 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-A processor:
22
23 Header File      | Processor
24 :----------------|:------------------------------
25 core_ca.h        | generics for all supportet Cortex-A processors
26
27 \section device_examples Device Examples
28
29 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
30 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>:
31
32 Family             | Device            | Description
33 :------------------|:------------------|:---------------------------------
34 ARM Cortex-A7      | ARMCA7            | Cortex-A7 based device
35 ARM Cortex-A9      | ARMCA9            | Cortex-A9 based device
36
37
38
39 \section template_files_sec Template Files
40
41 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.
42 Silicon vendors add to these template files the following information:
43  - <b>Device Peripheral Access Layer</b> that provides definitions for device-specific peripherals.
44  - <b>Access Functions for Peripherals</b> (optional) that provides additional helper functions to access device-specific peripherals.
45  - <b>Interrupt vectors</b> in the startup file that are device specific.
46
47 <table class="cmtable">
48     <tr>
49       <th>Template File</th>
50       <th>Description</th>
51     </tr>
52     <tr>
53       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Source\\ARM\\startup_Device.c</td>
54       <td>Startup file template for ARM C/C++ Compiler.</td>
55     </tr>
56     <tr>
57       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Source\\GCC\\startup_Device.c</td>
58       <td>Startup file template for GNU GCC ARM Embedded Compiler.</td>
59     </tr>
60     <tr>
61       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Source\\IAR\\startup_Device.c</td>
62       <td>Startup file template for IAR C/C++ Compiler.</td>
63     </tr>
64     <tr>
65       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Source\\system_Device.c</td>
66       <td>Generic system_Device.c file for system configuration (i.e. processor clock and memory bus system).</td>
67     </tr>
68     <tr>
69       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Include\\Device.h</td>
70       <td>Generic device header file. Needs to be extended with the device-specific peripheral registers. Optionally functions that access the peripherals
71       can be part of that file.</td>
72     </tr>
73     <tr>
74       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Include\\system_Device.h</td>
75       <td>Generic system device configuration include file.</td>
76     </tr>
77 </table>
78
79
80 <b>Adapt Template Files to a Device</b>
81
82 The following steps describe how to adopt the template files to a specific device or device family.
83 Copy the complete all files in the template directory and replace:
84   - directory name 'Vendor' with the abbreviation for the device vendor  e.g.: NXP.
85   - directory name 'Device' with the specific device name e.g.: LPC17xx.
86   - in the file names 'Device' with the specific device name e.g.: LPC17xx.
87
88 Each template file contains comments that start with \b ToDo: that describe a required modification.
89 The template files contain place holders:
90
91 <table class="cmtable">
92     <tr>
93       <th>Placeholder</th>
94       <th>Replaced with</th>
95     </tr>
96     <tr>
97       <td>&lt;Device&gt;</td>
98       <td>the specific device name or device family name; i.e. LPC17xx.</td>
99     </tr>
100     <tr>
101       <td>&lt;DeviceInterrupt&gt;</td>
102       <td>a specific interrupt name of the device; i.e. TIM1 for Timer 1.</td>
103     <tr>
104       <td>&lt;DeviceAbbreviation&gt;</td>
105       <td>short name or abbreviation of the device family; i.e. LPC.</td>
106     </tr>
107     <tr>
108       <td>Cortex-M#</td>
109       <td>the specific Cortex-M processor name; i.e. Cortex-M3.</td>
110     </tr>
111 </table>
112
113
114 The device configuration of the template files is described in detail on the following pages:
115   - \subpage startup_c_pg
116   - \subpage system_c_pg
117   - \subpage device_h_pg
118   - \subpage mmu_c_pg
119 */
120
121 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
122 /**
123 \page startup_c_pg Startup File startup_<device>.c
124
125 The \ref startup_c_pg contains:
126  - The reset handler which is executed after CPU reset and typically calls the \ref SystemInit function.
127  - The setup values for the Main Stack Pointer (MSP).
128  - Exception vectors of the Cortex-M Processor with weak functions that implement default routines.
129  - Interrupt vectors that are device specific with weak functions that implement default routines.
130
131 The file exists for each supported toolchain and is the only tool-chain specific CMSIS file.
132
133 To adapt the file to a new device only the interrupt vector table needs to be extended with
134 the device-specific interrupt handlers. The naming convention for the interrupt handler names are
135 &lt;interrupt_name&gt;_IRQHandler.  This table needs to be consistent with \ref IRQn_Type that defines all the
136 IRQ numbers for each interrupt.
137
138 \b Example:
139
140 The following example shows the extension of the interrupt vector table for the LPC1100 device family.
141
142 \code
143                 ; External Interrupts
144                 DCD     WAKEUP0_IRQHandler       ; 16+ 0: Wakeup PIO0.0
145                 DCD     WAKEUP1_IRQHandler       ; 16+ 1: Wakeup PIO0.1
146                 DCD     WAKEUP2_IRQHandler       ; 16+ 2: Wakeup PIO0.2
147                  :       :
148                  :       :
149                 DCD     EINT1_IRQHandler         ; 16+30: PIO INT1
150                 DCD     EINT0_IRQHandler         ; 16+31: PIO INT0
151          :
152          :
153                 EXPORT  WAKEUP0_IRQHandler       [WEAK]
154                 EXPORT  WAKEUP1_IRQHandler       [WEAK]
155                 EXPORT  WAKEUP2_IRQHandler       [WEAK]
156                  :       :
157                  :       :
158                 EXPORT  EINT1_IRQHandler         [WEAK]
159                 EXPORT  EINT0_IRQHandler         [WEAK]
160
161 WAKEUP0_IRQHandler
162 WAKEUP1_IRQHandler
163 WAKEUP1_IRQHandler
164       :
165       :
166 EINT1_IRQHandler
167 EINT0_IRQHandler
168                 B       .
169
170 \endcode
171
172 \section startup_s_sec startup_Device.s Template File
173
174 An ARM Compiler \ref startup_s_sec for an ARMv7-M processor like Cortex-M3 is shown below.
175 The files for other compiler vendors differ slightly in the syntax, but not in the overall structure.
176
177 \verbinclude "Source\ARM\startup_Device.s"
178 */
179
180 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
181 /**
182 \page system_c_pg System Configuration Files system_<device>.c and system_<device>.h
183
184 The \ref system_c_pg provides as a minimum the functions described under \ref system_init_gr.
185 These functions are device specific and need adaptations. In addition, the file might have
186 configuration settings for the device such as XTAL frequency or PLL prescaler settings.
187
188 For devices with external memory BUS the system_<device>.c also configures the BUS system.
189
190 The silicon vendor might expose other functions (i.e. for power configuration) in the system_<device>.c file.
191 In case of additional features the function prototypes need to be added to the system_<device>.h header file.
192
193 \section system_Device_sec system_Device.c Template File
194
195 The \ref system_Device_sec for the Cortex-M3 is shown below.
196
197 \verbinclude "Source\system_Device.c"
198
199 \section system_Device_h_sec system_Device.h Template File
200
201 The system_<device>.h header file contains prototypes to access the public functions in the system_<device>.c file.
202 The \ref system_Device_h_sec is shown below.
203
204 \verbinclude "Include\system_Device.h"
205
206 */
207
208 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
209 /**
210 \page device_h_pg Device Header File \<device.h>
211
212 The \ref device_h_pg contains the following sections that are device specific:
213  - \ref irqn_defs provides interrupt numbers (IRQn) for all exceptions and interrupts of the device.
214  - \ref config_perifs reflect the features of the device.
215  - \ref access_perifs definitions for the \ref peripheral_gr to all device peripherals. It contains all data structures and the address mapping for device-specific peripherals.
216  - <b>Access Functions for Peripherals (optioal)</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.
217
218 <a href="Modules.html">\b Reference </a> describes the standard features and functions of the \ref device_h_pg in detail.
219
220 \section interrupt_number_sec Interrupt Number Definition
221
222 \ref device_h_pg contains the enumeration \ref IRQn_Type that defines all exceptions and interrupts of the device.
223   - Negative IRQn values represent processor core exceptions (internal interrupts).
224   - Positive IRQn values represent device-specific exceptions (external interrupts). The first device-specific interrupt has the IRQn value 0.
225     The IRQn values needs extension to reflect the device-specific interrupt vector table in the \ref startup_s_pg.
226
227 \b Example:
228
229 The following example shows the extension of the interrupt vector table for the LPC1100 device family.
230
231 \code
232 typedef enum IRQn
233 {
234 /******  Cortex-M0 Processor Exceptions Numbers ***************************************************/
235   NonMaskableInt_IRQn           = -14,      /*!< 2 Non Maskable Interrupt                         */
236   HardFault_IRQn                = -13,      /*!< 3 Cortex-M0 Hard Fault Interrupt                 */
237   SVCall_IRQn                   = -5,       /*!< 11 Cortex-M0 SV Call Interrupt                   */
238   PendSV_IRQn                   = -2,       /*!< 14 Cortex-M0 Pend SV Interrupt                   */
239   SysTick_IRQn                  = -1,       /*!< 15 Cortex-M0 System Tick Interrupt               */
240
241 /******  LPC11xx/LPC11Cxx Specific Interrupt Numbers **********************************************/
242   WAKEUP0_IRQn                  = 0,        /*!< All I/O pins can be used as wakeup source.       */
243   WAKEUP1_IRQn                  = 1,        /*!< There are 13 pins in total for LPC11xx           */
244   WAKEUP2_IRQn                  = 2,
245                  :       :
246                  :       :
247   EINT1_IRQn                    = 30,       /*!< External Interrupt 1 Interrupt                   */
248   EINT0_IRQn                    = 31,       /*!< External Interrupt 0 Interrupt                   */
249 } IRQn_Type;
250 \endcode
251
252 \section core_config_sect Configuration of the Processor and Core Peripherals
253
254 The \ref device_h_pg  configures the Cortex-M or SecurCore processor and the core peripherals with <i>\#defines</i>
255 that are set prior to including the file <b>core_<cpu>.h</b>.
256
257 The following tables list the <i>\#defines</i> along with the possible values for each processor core.
258 If these <i>\#defines</i> are missing default values are used.
259
260 \b core_cm0.h
261 <table class="cmtable">
262     <tr>
263       <th>\#define</th>
264       <th>Value Range</th>
265       <th>Default</th>
266       <th>Description</th>
267     </tr>
268     <tr>
269       <td>__CM0_REV</td>
270       <td>0x0000</td>
271       <td>0x0000</td>
272       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
273     </tr>
274     <tr>
275       <td>__NVIC_PRIO_BITS</td>
276       <td>2</td>
277       <td>2</td>
278       <td>Number of priority bits implemented in the NVIC (device specific)</td>
279     </tr>
280     <tr>
281       <td>__Vendor_SysTickConfig</td>
282       <td>0 .. 1</td>
283       <td>0</td>
284       <td>If this define is set to 1, then the default <b>SysTick_Config</b> function
285                 is excluded. In this case, the file <i><b>device.h</b></i>
286                 must contain a vendor specific implementation of this function.</td>
287     </tr>
288 </table>
289
290 \b core_cm0plus.h
291 <table class="cmtable">
292     <tr>
293       <th>\#define</th>
294       <th>Value Range</th>
295       <th>Default</th>
296       <th>Description</th>
297     </tr>
298     <tr>
299       <td>__CM0PLUS_REV</td>
300       <td>0x0000</td>
301       <td>0x0000</td>
302       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
303     </tr>
304     <tr>
305       <td>__NVIC_PRIO_BITS</td>
306       <td>2</td>
307       <td>2</td>
308       <td>Number of priority bits implemented in the NVIC (device specific)</td>
309     </tr>
310     <tr>
311       <td>__Vendor_SysTickConfig</td>
312       <td>0 .. 1</td>
313       <td>0</td>
314       <td>If this define is set to 1, then the default <b>SysTick_Config</b> function
315                 is excluded. In this case, the file <i><b>device.h</b></i>
316                 must contain a vendor specific implementation of this function.</td>
317     </tr>
318 </table>
319
320 \b core_cm3.h
321 <table class="cmtable">
322     <tr>
323       <th>\#define</th>
324       <th>Value Range</th>
325       <th>Default</th>
326       <th>Description</th>
327     </tr>
328     <tr>
329       <td>__CM3_REV</td>
330       <td>0x0101 | 0x0200</td>
331       <td>0x0200</td>
332       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
333     </tr>
334     <tr>
335       <td>__NVIC_PRIO_BITS</td>
336       <td>2 .. 8</td>
337       <td>4</td>
338       <td>Number of priority bits implemented in the NVIC (device specific)</td>
339     </tr>
340     <tr>
341       <td>__MPU_PRESENT</td>
342       <td>0 .. 1</td>
343       <td>0</td>
344       <td>Defines if a MPU is present or not</td>
345     </tr>
346     <tr>
347       <td>__Vendor_SysTickConfig</td>
348       <td>0 .. 1</td>
349       <td>0</td>
350       <td>If this define is set to 1, then the default <b>SysTick_Config</b> function
351                 is excluded. In this case, the file <i><b>device.h</b></i>
352                 must contain a vendor specific implementation of this function.</td>
353     </tr>
354 </table>
355
356 \b core_cm4.h
357 <table class="cmtable">
358     <tr>
359       <th>\#define</th>
360       <th>Value Range</th>
361       <th>Default</th>
362       <th>Description</th>
363     </tr>
364     <tr>
365       <td>__CM4_REV</td>
366       <td>0x0000</td>
367       <td>0x0000</td>
368       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
369     </tr>
370     <tr>
371       <td>__NVIC_PRIO_BITS</td>
372       <td>2 .. 8</td>
373       <td>4</td>
374       <td>Number of priority bits implemented in the NVIC (device specific)</td>
375     </tr>
376     <tr>
377       <td>__MPU_PRESENT</td>
378       <td>0 .. 1</td>
379       <td>0</td>
380       <td>Defines if a MPU is present or not</td>
381     </tr>
382     <tr>
383       <td>__FPU_PRESENT</td>
384       <td>0 .. 1</td>
385       <td>0</td>
386       <td>Defines if a FPU is present or not</td>
387     </tr>
388     <tr>
389       <td>__Vendor_SysTickConfig</td>
390       <td>0 .. 1</td>
391       <td>0</td>
392       <td>If this define is set to 1, then the default <b>SysTick_Config</b> function
393                 is excluded. In this case, the file <i><b>device.h</b></i>
394                 must contain a vendor specific implementation of this function.</td>
395     </tr>
396 </table>
397
398 \b core_cm7.h
399 <table class="cmtable" summary="">
400     <tr>
401       <th>\#define</th>
402       <th>Value Range</th>
403       <th>Default</th>
404       <th>Description</th>
405     </tr>
406     <tr>
407       <td>__CM7_REV</td>
408       <td>0x0000</td>
409       <td>0x0000</td>
410       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
411     </tr>
412     <tr>
413       <td>__MPU_PRESENT</td>
414       <td>0 .. 1</td>
415       <td>0</td>
416       <td>Defines if a MPU is present or not</td>
417     </tr>
418     <tr>
419       <td>__NVIC_PRIO_BITS</td>
420       <td>2 .. 8</td>
421       <td>4</td>
422       <td>Number of priority bits implemented in the NVIC (device specific)</td>
423     </tr>
424     <tr>
425       <td>__Vendor_SysTickConfig</td>
426       <td>0 .. 1</td>
427       <td>0</td>
428       <td>If this define is set to 1, then the default <b>SysTick_Config</b> function
429                 is excluded. In this case, the file <i><b>device.h</b></i>
430                 must contain a vendor specific implementation of this function.</td>
431     </tr>
432     <tr>
433       <td>__FPU_PRESENT</td>
434       <td>0 .. 1</td>
435       <td>0</td>
436       <td>Defines if a FPU is present or not. See <b>__FPU_DP</b> description below.</td>
437     </tr>
438     <tr>
439       <td>__FPU_DP</td>
440       <td>0 .. 1</td>
441       <td>0</td>
442       <td>The combination of the defines <b>__FPU_PRESENT</b> and <b>__FPU_DP</b>
443          determine the whether the FPU is with single or double precision as shown in the table below.
444              \n\n
445              <table class="cmtable" summary="">
446                  <tr  bgcolor="cyan">
447            <td><b>__FPU_PRESENT</b></td>
448                    <td><b>__FPU_DP</b></td>
449                    <td><b>Description</b></td>
450                  </tr>
451                  <tr>
452                    <td align="center">0</td>
453                    <td align="center"><i>ignored</i></td>
454                    <td>Processor has no FPU. The value set for <b>__FPU_DP</b> has no influence. </td>
455                  </tr>
456                  <tr>
457                    <td align="center">1</td>
458                    <td align="center">0</td>
459                    <td>Processor with FPU with single precision. The file <b>ARMCM7_SP.h</b> has preconfigured settings for this combination.</td>
460                  </tr>
461                  <tr>
462                    <td align="center">1</td>
463                    <td align="center">1</td>
464            <td>Processor with FPU with double precision. The file <b>ARMCM7_DP.h</b> has preconfigured settings for this combination.</td>
465                  </tr>
466                  </table>
467           </td>
468     </tr>
469     <tr>
470       <td>__ICACHE_PRESENT</td>
471       <td>0 .. 1</td>
472       <td>1</td>
473       <td>Instruction Chache present or not</td>
474     </tr>
475     <tr>
476       <td>__DCACHE_PRESENT</td>
477       <td>0 .. 1</td>
478       <td>1</td>
479       <td>Data Chache present or not</td>
480     </tr>
481     <tr>
482       <td>__DTCM_PRESENT</td>
483       <td>0 .. 1</td>
484       <td>1</td>
485       <td>Data Tightly Coupled Memory is present or not</td>
486     </tr>
487 </table>
488
489 \b core_sc000.h
490 <table class="cmtable">
491     <tr>
492       <th>\#define</th>
493       <th>Value Range</th>
494       <th>Default</th>
495       <th>Description</th>
496     </tr>
497     <tr>
498       <td>__SC000_REV</td>
499       <td>0x0000</td>
500       <td>0x0000</td>
501       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
502     </tr>
503     <tr>
504       <td>__NVIC_PRIO_BITS</td>
505       <td>2</td>
506       <td>2</td>
507       <td>Number of priority bits implemented in the NVIC (device specific)</td>
508     </tr>
509     <tr>
510       <td>__MPU_PRESENT</td>
511       <td>0 .. 1</td>
512       <td>0</td>
513       <td>Defines if a MPU is present or not</td>
514     </tr>
515     <tr>
516       <td>__Vendor_SysTickConfig</td>
517       <td>0 .. 1</td>
518       <td>0</td>
519       <td>If this define is set to 1, then the default <b>SysTick_Config</b> function
520                 is excluded. In this case, the file <i><b>device.h</b></i>
521                 must contain a vendor specific implementation of this function.</td>
522     </tr>
523 </table>
524
525 \b core_sc300.h
526 <table class="cmtable">
527     <tr>
528       <th>\#define</th>
529       <th>Value Range</th>
530       <th>Default</th>
531       <th>Description</th>
532     </tr>
533     <tr>
534       <td>__SC300_REV</td>
535       <td>0x0000</td>
536       <td>0x0000</td>
537       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
538     </tr>
539     <tr>
540       <td>__NVIC_PRIO_BITS</td>
541       <td>2 .. 8</td>
542       <td>4</td>
543       <td>Number of priority bits implemented in the NVIC (device specific)</td>
544     </tr>
545     <tr>
546       <td>__MPU_PRESENT</td>
547       <td>0 .. 1</td>
548       <td>0</td>
549       <td>Defines if a MPU is present or not</td>
550     </tr>
551     <tr>
552       <td>__Vendor_SysTickConfig</td>
553       <td>0 .. 1</td>
554       <td>0</td>
555       <td>If this define is set to 1, then the default <b>SysTick_Config</b> function
556                 is excluded. In this case, the file <i><b>device.h</b></i>
557                 must contain a vendor specific implementation of this function.</td>
558     </tr>
559 </table>
560
561 \b core_CM23.h or \b core_ARMv8MBL.h
562 <table class="cmtable">
563     <tr>
564       <th>\#define</th>
565       <th>Value Range</th>
566       <th>Default</th>
567       <th>Description</th>
568     </tr>
569     <tr>
570       <td>__ARMv8MBL_REV</td>
571       <td>0x0000</td>
572       <td>0x0000</td>
573       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
574     </tr>
575     <tr>
576       <td>__MPU_PRESENT</td>
577       <td>0 .. 1</td>
578       <td>0</td>
579       <td>Defines if a MPU is present or not</td>
580     </tr>
581     <tr>
582       <td>__SAUREGION_PRESENT</td>
583       <td>0 .. 1</td>
584       <td>0</td>
585       <td>Defines if SAU regions are present or not</td>
586     </tr>
587     <tr>
588       <td>__VTOR_PRESENT</td>
589       <td>0 .. 1</td>
590       <td>0</td>
591       <td>Defines if a VTOR register is present or not</td>
592     </tr>
593     <tr>
594       <td>__NVIC_PRIO_BITS</td>
595       <td>2</td>
596       <td>2</td>
597       <td>Number of priority bits implemented in the NVIC (device specific)</td>
598     </tr>
599     <tr>
600       <td>__Vendor_SysTickConfig</td>
601       <td>0 .. 1</td>
602       <td>0</td>
603       <td>If this define is set to 1, then the default <b>SysTick_Config</b> function
604                 is excluded. In this case, the file <i><b>device.h</b></i>
605                 must contain a vendor specific implementation of this function.</td>
606     </tr>
607 </table>
608
609 \b core_CM33.h or \b core_ARMv8MML.h
610 <table class="cmtable">
611     <tr>
612       <th>\#define</th>
613       <th>Value Range</th>
614       <th>Default</th>
615       <th>Description</th>
616     </tr>
617     <tr>
618       <td>__ARMv8MML_REV</td>
619       <td>0x0000</td>
620       <td>0x0000</td>
621       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
622     </tr>
623     <tr>
624       <td>__MPU_PRESENT</td>
625       <td>0 .. 1</td>
626       <td>0</td>
627       <td>Defines if a MPU is present or not</td>
628     </tr>
629     <tr>
630       <td>__SAUREGION_PRESENT</td>
631       <td>0 .. 1</td>
632       <td>0</td>
633       <td>Defines if SAU regions are present or not</td>
634     </tr>
635     <tr>
636       <td>__FPU_PRESENT</td>
637       <td>0 .. 1</td>
638       <td>0</td>
639       <td>Defines if a FPU is present or not</td>
640     </tr>
641     <tr>
642       <td>__NVIC_PRIO_BITS</td>
643       <td>2 .. 8</td>
644       <td>3</td>
645       <td>Number of priority bits implemented in the NVIC (device specific)</td>
646     </tr>
647     <tr>
648       <td>__Vendor_SysTickConfig</td>
649       <td>0 .. 1</td>
650       <td>0</td>
651       <td>If this define is set to 1, then the default <b>SysTick_Config</b> function
652                 is excluded. In this case, the file <i><b>device.h</b></i>
653                 must contain a vendor specific implementation of this function.</td>
654     </tr>
655 </table>
656
657 \b Example
658
659 The following code exemplifies the configuration of the Cortex-M4 Processor and Core Peripherals.
660
661 \code
662 #define __CM4_REV                 0x0001    /* Core revision r0p1                                 */
663 #define __MPU_PRESENT             1         /* MPU present or not                                 */
664 #define __NVIC_PRIO_BITS          3         /* Number of Bits used for Priority Levels            */
665 #define __Vendor_SysTickConfig    0         /* Set to 1 if different SysTick Config is used       */
666 #define __FPU_PRESENT             1         /* FPU present or not                                 */
667 .
668 .
669 #include <core_cm4.h>                       /* Cortex-M4 processor and core peripherals           */
670 \endcode
671
672
673 \section core_version_sect   CMSIS Version and Processor Information
674
675 Defines in the core_<i>cpu</i>.h file identify the version of the CMSIS-Core-M and the processor used.
676 The following shows the defines in the various core_<i>cpu</i>.h files that may be used in the \ref device_h_pg
677 to verify a minimum version or ensure that the right processor core is used.
678
679 \b core_cm0.h
680 \code
681 #define __CM0_CMSIS_VERSION_MAIN  (5U)                                 /* [31:16] CMSIS HAL main version */
682 #define __CM0_CMSIS_VERSION_SUB   (0U)                                 /* [15:0]  CMSIS HAL sub version */
683 #define __CM0_CMSIS_VERSION       ((__CM0_CMSIS_VERSION_MAIN << 16U) | \
684                                     __CM0_CMSIS_VERSION_SUB          ) /* CMSIS HAL version number */
685  
686 #define __CORTEX_M                (0U)                                 /* Cortex-M Core */
687 \endcode
688
689
690 \b core_cm0plus.h
691 \code
692 #define __CM0PLUS_CMSIS_VERSION_MAIN  (5U)                                  /* [31:16] CMSIS HAL main version */
693 #define __CM0PLUS_CMSIS_VERSION_SUB   (0U)                                  /* [15:0]  CMSIS HAL sub version */
694 #define __CM0PLUS_CMSIS_VERSION       ((__CM0P_CMSIS_VERSION_MAIN << 16U) | \
695                                         __CM0P_CMSIS_VERSION_SUB          ) /* CMSIS HAL version number */
696  
697 #define __CORTEX_M                    (0U)                                  /* Cortex-M Core */
698 \endcode
699
700
701 \b core_cm3.h
702 \code
703 #define __CM3_CMSIS_VERSION_MAIN  (5U)                                 /* [31:16] CMSIS HAL main version */
704 #define __CM3_CMSIS_VERSION_SUB   (0U)                                 /* [15:0]  CMSIS HAL sub version */
705 #define __CM3_CMSIS_VERSION       ((__CM3_CMSIS_VERSION_MAIN << 16U) | \
706                                     __CM3_CMSIS_VERSION_SUB          ) /* CMSIS HAL version number */
707  
708 #define __CORTEX_M                (3U)                                 /* Cortex-M Core */
709 \endcode
710
711 \b core_cm4.h
712 \code
713 #define __CM4_CMSIS_VERSION_MAIN  (5U)                                 /* [31:16] CMSIS HAL main version */
714 #define __CM4_CMSIS_VERSION_SUB   (0U)                                 /* [15:0]  CMSIS HAL sub version */
715 #define __CM4_CMSIS_VERSION       ((__CM4_CMSIS_VERSION_MAIN << 16U) | \
716                                     __CM4_CMSIS_VERSION_SUB          ) /* CMSIS HAL version number */
717  
718 #define __CORTEX_M                (4U)                                 /* Cortex-M Core */
719 \endcode
720
721 \b core_cm7.h
722 \code
723 #define __CM7_CMSIS_VERSION_MAIN  (5U)                                 /* [31:16] CMSIS HAL main version */
724 #define __CM7_CMSIS_VERSION_SUB   (0U)                                 /* [15:0]  CMSIS HAL sub version */
725 #define __CM7_CMSIS_VERSION       ((__CM7_CMSIS_VERSION_MAIN << 16U) | \
726                                     __CM7_CMSIS_VERSION_SUB          ) /* CMSIS HAL version number */
727  
728 #define __CORTEX_M                (7U)                                 /* Cortex-M Core */
729 \endcode
730
731 \b core_sc000.h
732 \code
733 #define __SC000_CMSIS_VERSION_MAIN  (5U)                                   /* [31:16] CMSIS HAL main version */
734 #define __SC000_CMSIS_VERSION_SUB   (0U)                                   /* [15:0]  CMSIS HAL sub version */
735 #define __SC000_CMSIS_VERSION       ((__SC000_CMSIS_VERSION_MAIN << 16U) | \
736                                       __SC000_CMSIS_VERSION_SUB          ) /* CMSIS HAL version number */
737  
738 #define __CORTEX_SC                 (0U)                                   /* Cortex secure core */
739 \endcode
740
741 \b core_sc300.h
742 \code
743 #define __SC300_CMSIS_VERSION_MAIN  (5U)                                   /* [31:16] CMSIS HAL main version */
744 #define __SC300_CMSIS_VERSION_SUB   (0U)                                   /* [15:0]  CMSIS HAL sub version */
745 #define __SC300_CMSIS_VERSION       ((__SC300_CMSIS_VERSION_MAIN << 16U) | \
746                                       __SC300_CMSIS_VERSION_SUB          ) /* CMSIS HAL version number */
747  
748 #define __CORTEX_SC                 (300U)                                 /* Cortex secure core */
749 \endcode
750
751 \b core_ARMv8MBL.h
752 \code
753 #define __ARMv8MBL_CMSIS_VERSION_MAIN  (5U)                                       /* [31:16] CMSIS HAL main version */
754 #define __ARMv8MBL_CMSIS_VERSION_SUB   (0U)                                       /* [15:0]  CMSIS HAL sub version */
755 #define __ARMv8MBL_CMSIS_VERSION       ((__ARMv8MBL_CMSIS_VERSION_MAIN << 16U) | \
756                                          __ARMv8MBL_CMSIS_VERSION_SUB           ) /* CMSIS HAL version number */
757  
758 #define __CORTEX_M                     (tbd)                                      /* Cortex secure core */
759 \endcode
760
761 \b core_ARMv8MML.h
762 \code
763 #define __ARMv8MML_CMSIS_VERSION_MAIN  (5U)                                       /* [31:16] CMSIS HAL main version */
764 #define __ARMv8MML_CMSIS_VERSION_SUB   (0U)                                       /* [15:0]  CMSIS HAL sub version */
765 #define __ARMv8MML_CMSIS_VERSION       ((__ARMv8MML_CMSIS_VERSION_MAIN << 16U) | \
766                                          __ARMv8MML_CMSIS_VERSION_SUB           ) /* CMSIS HAL version number */
767  
768 #define __CORTEX_M                     (tbd)                                      /* Cortex secure core */
769 \endcode
770
771
772 \section device_access Device Peripheral Access Layer
773
774 The \ref device_h_pg contains for each peripheral:
775  - Register Layout Typedef
776  - Base Address
777  - Access Definitions
778
779 The section \ref peripheral_gr shows examples for peripheral definitions.
780
781 \section device_h_sec Device.h Template File
782
783 The silicon vendor needs to extend the Device.h template file with the CMSIS features described above.
784 In addition the \ref device_h_pg may contain functions to access device-specific peripherals.
785 The \ref system_Device_h_sec which is provided as part of the CMSIS specification is shown below.
786
787 \verbinclude "Include\Device.h"
788
789 */