Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 1 | /* |
| 2 | * ARM Limited (ARM) is supplying this software for use with Cortex-M |
| 3 | * processor based microcontroller, but can be equally used for other |
| 4 | * suitable processor architectures. This file can be freely distributed. |
| 5 | * Modifications to this file shall be clearly marked. |
| 6 | * |
| 7 | * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED |
| 8 | * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF |
| 9 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. |
| 10 | * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR |
| 11 | * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. |
| 12 | * |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 13 | * @file ARM_Example.h |
Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 14 | * @brief CMSIS HeaderFile |
| 15 | * @version 1.2 |
| 16 | * @date 20. July 2018 |
| 17 | * @note Generated by SVDConv V3.3.21 on Friday, 20.07.2018 15:12:22 |
| 18 | * from File 'ARM_Example.svd', |
| 19 | * last modified on Friday, 20.07.2018 13:11:38 |
| 20 | */ |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 21 | |
| 22 | |
| 23 | |
| 24 | /** @addtogroup ARM Ltd. |
| 25 | * @{ |
| 26 | */ |
| 27 | |
Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 28 | |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 29 | /** @addtogroup ARM_Example |
| 30 | * @{ |
| 31 | */ |
| 32 | |
Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 33 | |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 34 | #ifndef ARM_EXAMPLE_H |
| 35 | #define ARM_EXAMPLE_H |
| 36 | |
| 37 | #ifdef __cplusplus |
| 38 | extern "C" { |
| 39 | #endif |
| 40 | |
| 41 | |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 42 | /** @addtogroup Configuration_of_CMSIS |
| 43 | * @{ |
| 44 | */ |
| 45 | |
| 46 | |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 47 | |
Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 48 | /* =========================================================================================================================== */ |
| 49 | /* ================ Interrupt Number Definition ================ */ |
| 50 | /* =========================================================================================================================== */ |
| 51 | |
| 52 | typedef enum { |
| 53 | /* ======================================= ARM Cortex-M3 Specific Interrupt Numbers ======================================== */ |
| 54 | Reset_IRQn = -15, /*!< -15 Reset Vector, invoked on Power up and warm reset */ |
| 55 | NonMaskableInt_IRQn = -14, /*!< -14 Non maskable Interrupt, cannot be stopped or preempted */ |
| 56 | HardFault_IRQn = -13, /*!< -13 Hard Fault, all classes of Fault */ |
| 57 | MemoryManagement_IRQn = -12, /*!< -12 Memory Management, MPU mismatch, including Access Violation |
| 58 | and No Match */ |
| 59 | BusFault_IRQn = -11, /*!< -11 Bus Fault, Pre-Fetch-, Memory Access Fault, other address/memory |
| 60 | related Fault */ |
| 61 | UsageFault_IRQn = -10, /*!< -10 Usage Fault, i.e. Undef Instruction, Illegal State Transition */ |
| 62 | SVCall_IRQn = -5, /*!< -5 System Service Call via SVC instruction */ |
| 63 | DebugMonitor_IRQn = -4, /*!< -4 Debug Monitor */ |
| 64 | PendSV_IRQn = -2, /*!< -2 Pendable request for system service */ |
| 65 | SysTick_IRQn = -1, /*!< -1 System Tick Timer */ |
| 66 | /* ======================================== ARM_Example Specific Interrupt Numbers ========================================= */ |
| 67 | TIMER0_IRQn = 0, /*!< 0 Timer 0 interrupt */ |
| 68 | TIMER1_IRQn = 4, /*!< 4 Timer 2 interrupt */ |
| 69 | TIMER2_IRQn = 6 /*!< 6 Timer 2 interrupt */ |
| 70 | } IRQn_Type; |
| 71 | |
| 72 | |
| 73 | |
| 74 | /* =========================================================================================================================== */ |
| 75 | /* ================ Processor and Core Peripheral Section ================ */ |
| 76 | /* =========================================================================================================================== */ |
| 77 | |
| 78 | /* =========================== Configuration of the ARM Cortex-M3 Processor and Core Peripherals =========================== */ |
| 79 | #define __CM3_REV 0x0100U /*!< CM3 Core Revision */ |
| 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 | #define __MPU_PRESENT 1 /*!< MPU present or not */ |
| 83 | #define __FPU_PRESENT 0 /*!< FPU present or not */ |
| 84 | |
| 85 | |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 86 | /** @} */ /* End of group Configuration_of_CMSIS */ |
| 87 | |
Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 88 | #include "core_cm3.h" /*!< ARM Cortex-M3 processor and core peripherals */ |
| 89 | #include "system_ARM_Example.h" /*!< ARM_Example System */ |
| 90 | |
| 91 | #ifndef __IM /*!< Fallback for older CMSIS versions */ |
| 92 | #define __IM __I |
| 93 | #endif |
| 94 | #ifndef __OM /*!< Fallback for older CMSIS versions */ |
| 95 | #define __OM __O |
| 96 | #endif |
| 97 | #ifndef __IOM /*!< Fallback for older CMSIS versions */ |
| 98 | #define __IOM __IO |
| 99 | #endif |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 100 | |
| 101 | |
Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 102 | /* ======================================== Start of section using anonymous unions ======================================== */ |
| 103 | #if defined (__CC_ARM) |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 104 | #pragma push |
| 105 | #pragma anon_unions |
Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 106 | #elif defined (__ICCARM__) |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 107 | #pragma language=extended |
Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 108 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) |
| 109 | #pragma clang diagnostic push |
| 110 | #pragma clang diagnostic ignored "-Wc11-extensions" |
| 111 | #pragma clang diagnostic ignored "-Wreserved-id-macro" |
| 112 | #pragma clang diagnostic ignored "-Wgnu-anonymous-struct" |
| 113 | #pragma clang diagnostic ignored "-Wnested-anon-types" |
| 114 | #elif defined (__GNUC__) |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 115 | /* anonymous unions are enabled by default */ |
Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 116 | #elif defined (__TMS470__) |
| 117 | /* anonymous unions are enabled by default */ |
| 118 | #elif defined (__TASKING__) |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 119 | #pragma warning 586 |
Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 120 | #elif defined (__CSMC__) |
| 121 | /* anonymous unions are enabled by default */ |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 122 | #else |
| 123 | #warning Not supported compiler type |
| 124 | #endif |
| 125 | |
| 126 | |
Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 127 | /* =========================================================================================================================== */ |
| 128 | /* ================ Device Specific Peripheral Section ================ */ |
| 129 | /* =========================================================================================================================== */ |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 130 | |
Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 131 | |
| 132 | /** @addtogroup Device_Peripheral_peripherals |
| 133 | * @{ |
| 134 | */ |
| 135 | |
| 136 | |
| 137 | |
| 138 | /* =========================================================================================================================== */ |
| 139 | /* ================ TIMER0 ================ */ |
| 140 | /* =========================================================================================================================== */ |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 141 | |
| 142 | |
| 143 | /** |
| 144 | * @brief 32 Timer / Counter, counting up or down from different sources (TIMER0) |
| 145 | */ |
| 146 | |
Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 147 | typedef struct { /*!< (@ 0x40010000) TIMER0 Structure */ |
| 148 | __IOM uint32_t CR; /*!< (@ 0x00000000) Control Register */ |
| 149 | __IOM uint16_t SR; /*!< (@ 0x00000004) Status Register */ |
| 150 | __IM uint16_t RESERVED; |
| 151 | __IM uint32_t RESERVED1[2]; |
| 152 | __IOM uint16_t INT; /*!< (@ 0x00000010) Interrupt Register */ |
| 153 | __IM uint16_t RESERVED2; |
| 154 | __IM uint32_t RESERVED3[3]; |
| 155 | __IOM uint32_t COUNT; /*!< (@ 0x00000020) The Counter Register reflects the actual Value |
| 156 | of the Timer/Counter */ |
| 157 | __IOM uint32_t MATCH; /*!< (@ 0x00000024) The Match Register stores the compare Value for |
| 158 | the MATCH condition */ |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 159 | |
| 160 | union { |
Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 161 | __IM uint32_t PRESCALE_RD; /*!< (@ 0x00000028) The Prescale Register stores the Value for the |
| 162 | prescaler. The cont event gets divided by |
| 163 | this value */ |
| 164 | __OM uint32_t PRESCALE_WR; /*!< (@ 0x00000028) The Prescale Register stores the Value for the |
| 165 | prescaler. The cont event gets divided by |
| 166 | this value */ |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 167 | }; |
Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 168 | __IM uint32_t RESERVED4[9]; |
| 169 | __IOM uint32_t RELOAD[4]; /*!< (@ 0x00000050) The Reload Register stores the Value the COUNT |
| 170 | Register gets reloaded on a when a condition |
| 171 | was met. */ |
| 172 | } TIMER0_Type; /*!< Size = 96 (0x60) */ |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 173 | |
| 174 | |
Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 175 | /** @} */ /* End of group Device_Peripheral_peripherals */ |
| 176 | |
| 177 | |
| 178 | /* =========================================================================================================================== */ |
| 179 | /* ================ Device Specific Peripheral Address Map ================ */ |
| 180 | /* =========================================================================================================================== */ |
| 181 | |
| 182 | |
| 183 | /** @addtogroup Device_Peripheral_peripheralAddr |
| 184 | * @{ |
| 185 | */ |
| 186 | |
| 187 | #define TIMER0_BASE 0x40010000UL |
| 188 | #define TIMER1_BASE 0x40010100UL |
| 189 | #define TIMER2_BASE 0x40010200UL |
| 190 | |
| 191 | /** @} */ /* End of group Device_Peripheral_peripheralAddr */ |
| 192 | |
| 193 | |
| 194 | /* =========================================================================================================================== */ |
| 195 | /* ================ Peripheral declaration ================ */ |
| 196 | /* =========================================================================================================================== */ |
| 197 | |
| 198 | |
| 199 | /** @addtogroup Device_Peripheral_declaration |
| 200 | * @{ |
| 201 | */ |
| 202 | |
| 203 | #define TIMER0 ((TIMER0_Type*) TIMER0_BASE) |
| 204 | #define TIMER1 ((TIMER0_Type*) TIMER1_BASE) |
| 205 | #define TIMER2 ((TIMER0_Type*) TIMER2_BASE) |
| 206 | |
| 207 | /** @} */ /* End of group Device_Peripheral_declaration */ |
| 208 | |
| 209 | |
| 210 | /* ========================================= End of section using anonymous unions ========================================= */ |
| 211 | #if defined (__CC_ARM) |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 212 | #pragma pop |
Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 213 | #elif defined (__ICCARM__) |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 214 | /* leave anonymous unions enabled */ |
Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 215 | #elif (__ARMCC_VERSION >= 6010050) |
| 216 | #pragma clang diagnostic pop |
| 217 | #elif defined (__GNUC__) |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 218 | /* anonymous unions are enabled by default */ |
Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 219 | #elif defined (__TMS470__) |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 220 | /* anonymous unions are enabled by default */ |
Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 221 | #elif defined (__TASKING__) |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 222 | #pragma warning restore |
Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 223 | #elif defined (__CSMC__) |
| 224 | /* anonymous unions are enabled by default */ |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 225 | #endif |
| 226 | |
| 227 | |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 228 | #ifdef __cplusplus |
| 229 | } |
| 230 | #endif |
| 231 | |
Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 232 | #endif /* ARM_EXAMPLE_H */ |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 233 | |
Robert Rostohar | ba96a2c | 2016-07-01 22:42:12 +0200 | [diff] [blame] | 234 | |
Joachim Krech | bec65e2 | 2018-07-20 15:16:37 +0200 | [diff] [blame] | 235 | /** @} */ /* End of group ARM_Example */ |
| 236 | |
| 237 | /** @} */ /* End of group ARM Ltd. */ |