blob: ef79a220de87fd350bd45a4206cc4c503d39ea26 [file] [log] [blame]
Robert Rostoharba96a2c2016-07-01 22:42:12 +02001
2/****************************************************************************************************//**
3 * @file ARM_Example.h
4 *
5 * @brief CMSIS Cortex-M3 Peripheral Access Layer Header File for
6 * ARM_Example from ARM Ltd..
7 *
8 * @version V1.2
9 * @date 16. April 2014
10 *
11 * @note Generated with SVDConv V2.81e
12 * from CMSIS SVD File 'ARM_Example.svd' Version 1.2,
13 *
14 * @par ARM Limited (ARM) is supplying this software for use with Cortex-M
15 * processor based microcontroller, but can be equally used for other
16 * suitable processor architectures. This file can be freely distributed.
17 * Modifications to this file shall be clearly marked.
18 *
19 * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
20 * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
21 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
22 * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
23 * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
24 *
25 *******************************************************************************************************/
26
27
28
29/** @addtogroup ARM Ltd.
30 * @{
31 */
32
33/** @addtogroup ARM_Example
34 * @{
35 */
36
37#ifndef ARM_EXAMPLE_H
38#define ARM_EXAMPLE_H
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44
45/* ------------------------- Interrupt Number Definition ------------------------ */
46
47typedef enum {
48/* ------------------- Cortex-M3 Processor Exceptions Numbers ------------------- */
49 Reset_IRQn = -15, /*!< 1 Reset Vector, invoked on Power up and warm reset */
50 NonMaskableInt_IRQn = -14, /*!< 2 Non maskable Interrupt, cannot be stopped or preempted */
51 HardFault_IRQn = -13, /*!< 3 Hard Fault, all classes of Fault */
52 MemoryManagement_IRQn = -12, /*!< 4 Memory Management, MPU mismatch, including Access Violation
53 and No Match */
54 BusFault_IRQn = -11, /*!< 5 Bus Fault, Pre-Fetch-, Memory Access Fault, other address/memory
55 related Fault */
56 UsageFault_IRQn = -10, /*!< 6 Usage Fault, i.e. Undef Instruction, Illegal State Transition */
57 SVCall_IRQn = -5, /*!< 11 System Service Call via SVC instruction */
58 DebugMonitor_IRQn = -4, /*!< 12 Debug Monitor */
59 PendSV_IRQn = -2, /*!< 14 Pendable request for system service */
60 SysTick_IRQn = -1, /*!< 15 System Tick Timer */
61/* ------------------- ARM_Example Specific Interrupt Numbers ------------------- */
62 TIMER0_IRQn = 0, /*!< 0 TIMER0 */
63 TIMER1_IRQn = 4, /*!< 4 TIMER1 */
64 TIMER2_IRQn = 6 /*!< 6 TIMER2 */
65} IRQn_Type;
66
67
68/** @addtogroup Configuration_of_CMSIS
69 * @{
70 */
71
72
73/* ================================================================================ */
74/* ================ Processor and Core Peripheral Section ================ */
75/* ================================================================================ */
76
77/* ----------------Configuration of the Cortex-M3 Processor and Core Peripherals---------------- */
78#define __CM3_REV 0x0100 /*!< Cortex-M3 Core Revision */
79#define __MPU_PRESENT 1 /*!< MPU present or not */
80#define __NVIC_PRIO_BITS 3 /*!< Number of Bits used for Priority Levels */
81#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
82/** @} */ /* End of group Configuration_of_CMSIS */
83
84#include "core_cm3.h" /*!< Cortex-M3 processor and core peripherals */
85#include "system_ARMCM3.h" /*!< ARM_Example System */
86
87
88/* ================================================================================ */
89/* ================ Device Specific Peripheral Section ================ */
90/* ================================================================================ */
91
92
93/** @addtogroup Device_Peripheral_Registers
94 * @{
95 */
96
97
98/* ------------------- Start of section using anonymous unions ------------------ */
99#if defined(__CC_ARM)
100 #pragma push
101 #pragma anon_unions
102#elif defined(__ICCARM__)
103 #pragma language=extended
104#elif defined(__GNUC__)
105 /* anonymous unions are enabled by default */
106#elif defined(__TMS470__)
107/* anonymous unions are enabled by default */
108#elif defined(__TASKING__)
109 #pragma warning 586
110#else
111 #warning Not supported compiler type
112#endif
113
114
115
116/* ================================================================================ */
117/* ================ TIMER0 ================ */
118/* ================================================================================ */
119
120
121/**
122 * @brief 32 Timer / Counter, counting up or down from different sources (TIMER0)
123 */
124
125typedef struct { /*!< TIMER0 Structure */
126 __IO uint32_t CR; /*!< Control Register */
127 __IO uint16_t SR; /*!< Status Register */
128 __I uint16_t RESERVED0[5];
129 __IO uint16_t INT; /*!< Interrupt Register */
130 __I uint16_t RESERVED1[7];
131 __IO uint32_t COUNT; /*!< The Counter Register reflects the actual Value of the Timer/Counter */
132 __IO uint32_t MATCH; /*!< The Match Register stores the compare Value for the MATCH condition */
133
134 union {
135 __O uint32_t PRESCALE_WR; /*!< The Prescale Register stores the Value for the prescaler. The
136 cont event gets divided by this value */
137 __I uint32_t PRESCALE_RD; /*!< The Prescale Register stores the Value for the prescaler. The
138 cont event gets divided by this value */
139 };
140 __I uint32_t RESERVED2[9];
141 __IO uint32_t RELOAD[4]; /*!< The Reload Register stores the Value the COUNT Register gets
142 reloaded on a when a condition was met. */
143} TIMER0_Type;
144
145
146/* -------------------- End of section using anonymous unions ------------------- */
147#if defined(__CC_ARM)
148 #pragma pop
149#elif defined(__ICCARM__)
150 /* leave anonymous unions enabled */
151#elif defined(__GNUC__)
152 /* anonymous unions are enabled by default */
153#elif defined(__TMS470__)
154 /* anonymous unions are enabled by default */
155#elif defined(__TASKING__)
156 #pragma warning restore
157#else
158 #warning Not supported compiler type
159#endif
160
161
162
163
164/* ================================================================================ */
165/* ================ Peripheral memory map ================ */
166/* ================================================================================ */
167
168#define TIMER0_BASE 0x40010000UL
169#define TIMER1_BASE 0x40010100UL
170#define TIMER2_BASE 0x40010200UL
171
172
173/* ================================================================================ */
174/* ================ Peripheral declaration ================ */
175/* ================================================================================ */
176
177#define TIMER0 ((TIMER0_Type *) TIMER0_BASE)
178#define TIMER1 ((TIMER0_Type *) TIMER1_BASE)
179#define TIMER2 ((TIMER0_Type *) TIMER2_BASE)
180
181
182/** @} */ /* End of group Device_Peripheral_Registers */
183/** @} */ /* End of group ARM_Example */
184/** @} */ /* End of group ARM Ltd. */
185
186#ifdef __cplusplus
187}
188#endif
189
190
191#endif /* ARM_Example_H */
192