ARM_Example.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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. *
  13. * @file ARM_Example.h
  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. */
  21. /** @addtogroup ARM Ltd.
  22. * @{
  23. */
  24. /** @addtogroup ARM_Example
  25. * @{
  26. */
  27. #ifndef ARM_EXAMPLE_H
  28. #define ARM_EXAMPLE_H
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. /** @addtogroup Configuration_of_CMSIS
  33. * @{
  34. */
  35. /* =========================================================================================================================== */
  36. /* ================ Interrupt Number Definition ================ */
  37. /* =========================================================================================================================== */
  38. typedef enum {
  39. /* ======================================= ARM Cortex-M3 Specific Interrupt Numbers ======================================== */
  40. Reset_IRQn = -15, /*!< -15 Reset Vector, invoked on Power up and warm reset */
  41. NonMaskableInt_IRQn = -14, /*!< -14 Non maskable Interrupt, cannot be stopped or preempted */
  42. HardFault_IRQn = -13, /*!< -13 Hard Fault, all classes of Fault */
  43. MemoryManagement_IRQn = -12, /*!< -12 Memory Management, MPU mismatch, including Access Violation
  44. and No Match */
  45. BusFault_IRQn = -11, /*!< -11 Bus Fault, Pre-Fetch-, Memory Access Fault, other address/memory
  46. related Fault */
  47. UsageFault_IRQn = -10, /*!< -10 Usage Fault, i.e. Undef Instruction, Illegal State Transition */
  48. SVCall_IRQn = -5, /*!< -5 System Service Call via SVC instruction */
  49. DebugMonitor_IRQn = -4, /*!< -4 Debug Monitor */
  50. PendSV_IRQn = -2, /*!< -2 Pendable request for system service */
  51. SysTick_IRQn = -1, /*!< -1 System Tick Timer */
  52. /* ======================================== ARM_Example Specific Interrupt Numbers ========================================= */
  53. TIMER0_IRQn = 0, /*!< 0 Timer 0 interrupt */
  54. TIMER1_IRQn = 4, /*!< 4 Timer 2 interrupt */
  55. TIMER2_IRQn = 6 /*!< 6 Timer 2 interrupt */
  56. } IRQn_Type;
  57. /* =========================================================================================================================== */
  58. /* ================ Processor and Core Peripheral Section ================ */
  59. /* =========================================================================================================================== */
  60. /* =========================== Configuration of the ARM Cortex-M3 Processor and Core Peripherals =========================== */
  61. #define __CM3_REV 0x0100U /*!< CM3 Core Revision */
  62. #define __NVIC_PRIO_BITS 3 /*!< Number of Bits used for Priority Levels */
  63. #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
  64. #define __MPU_PRESENT 1 /*!< MPU present or not */
  65. #define __FPU_PRESENT 0 /*!< FPU present or not */
  66. /** @} */ /* End of group Configuration_of_CMSIS */
  67. #include "core_cm3.h" /*!< ARM Cortex-M3 processor and core peripherals */
  68. #include "system_ARM_Example.h" /*!< ARM_Example System */
  69. #ifndef __IM /*!< Fallback for older CMSIS versions */
  70. #define __IM __I
  71. #endif
  72. #ifndef __OM /*!< Fallback for older CMSIS versions */
  73. #define __OM __O
  74. #endif
  75. #ifndef __IOM /*!< Fallback for older CMSIS versions */
  76. #define __IOM __IO
  77. #endif
  78. /* ======================================== Start of section using anonymous unions ======================================== */
  79. #if defined (__CC_ARM)
  80. #pragma push
  81. #pragma anon_unions
  82. #elif defined (__ICCARM__)
  83. #pragma language=extended
  84. #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
  85. #pragma clang diagnostic push
  86. #pragma clang diagnostic ignored "-Wc11-extensions"
  87. #pragma clang diagnostic ignored "-Wreserved-id-macro"
  88. #pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
  89. #pragma clang diagnostic ignored "-Wnested-anon-types"
  90. #elif defined (__GNUC__)
  91. /* anonymous unions are enabled by default */
  92. #elif defined (__TMS470__)
  93. /* anonymous unions are enabled by default */
  94. #elif defined (__TASKING__)
  95. #pragma warning 586
  96. #elif defined (__CSMC__)
  97. /* anonymous unions are enabled by default */
  98. #else
  99. #warning Not supported compiler type
  100. #endif
  101. /* =========================================================================================================================== */
  102. /* ================ Device Specific Peripheral Section ================ */
  103. /* =========================================================================================================================== */
  104. /** @addtogroup Device_Peripheral_peripherals
  105. * @{
  106. */
  107. /* =========================================================================================================================== */
  108. /* ================ TIMER0 ================ */
  109. /* =========================================================================================================================== */
  110. /**
  111. * @brief 32 Timer / Counter, counting up or down from different sources (TIMER0)
  112. */
  113. typedef struct { /*!< (@ 0x40010000) TIMER0 Structure */
  114. __IOM uint32_t CR; /*!< (@ 0x00000000) Control Register */
  115. __IOM uint16_t SR; /*!< (@ 0x00000004) Status Register */
  116. __IM uint16_t RESERVED;
  117. __IM uint32_t RESERVED1[2];
  118. __IOM uint16_t INT; /*!< (@ 0x00000010) Interrupt Register */
  119. __IM uint16_t RESERVED2;
  120. __IM uint32_t RESERVED3[3];
  121. __IOM uint32_t COUNT; /*!< (@ 0x00000020) The Counter Register reflects the actual Value
  122. of the Timer/Counter */
  123. __IOM uint32_t MATCH; /*!< (@ 0x00000024) The Match Register stores the compare Value for
  124. the MATCH condition */
  125. union {
  126. __IM uint32_t PRESCALE_RD; /*!< (@ 0x00000028) The Prescale Register stores the Value for the
  127. prescaler. The cont event gets divided by
  128. this value */
  129. __OM uint32_t PRESCALE_WR; /*!< (@ 0x00000028) The Prescale Register stores the Value for the
  130. prescaler. The cont event gets divided by
  131. this value */
  132. };
  133. __IM uint32_t RESERVED4[9];
  134. __IOM uint32_t RELOAD[4]; /*!< (@ 0x00000050) The Reload Register stores the Value the COUNT
  135. Register gets reloaded on a when a condition
  136. was met. */
  137. } TIMER0_Type; /*!< Size = 96 (0x60) */
  138. /** @} */ /* End of group Device_Peripheral_peripherals */
  139. /* =========================================================================================================================== */
  140. /* ================ Device Specific Peripheral Address Map ================ */
  141. /* =========================================================================================================================== */
  142. /** @addtogroup Device_Peripheral_peripheralAddr
  143. * @{
  144. */
  145. #define TIMER0_BASE 0x40010000UL
  146. #define TIMER1_BASE 0x40010100UL
  147. #define TIMER2_BASE 0x40010200UL
  148. /** @} */ /* End of group Device_Peripheral_peripheralAddr */
  149. /* =========================================================================================================================== */
  150. /* ================ Peripheral declaration ================ */
  151. /* =========================================================================================================================== */
  152. /** @addtogroup Device_Peripheral_declaration
  153. * @{
  154. */
  155. #define TIMER0 ((TIMER0_Type*) TIMER0_BASE)
  156. #define TIMER1 ((TIMER0_Type*) TIMER1_BASE)
  157. #define TIMER2 ((TIMER0_Type*) TIMER2_BASE)
  158. /** @} */ /* End of group Device_Peripheral_declaration */
  159. /* ========================================= End of section using anonymous unions ========================================= */
  160. #if defined (__CC_ARM)
  161. #pragma pop
  162. #elif defined (__ICCARM__)
  163. /* leave anonymous unions enabled */
  164. #elif (__ARMCC_VERSION >= 6010050)
  165. #pragma clang diagnostic pop
  166. #elif defined (__GNUC__)
  167. /* anonymous unions are enabled by default */
  168. #elif defined (__TMS470__)
  169. /* anonymous unions are enabled by default */
  170. #elif defined (__TASKING__)
  171. #pragma warning restore
  172. #elif defined (__CSMC__)
  173. /* anonymous unions are enabled by default */
  174. #endif
  175. #ifdef __cplusplus
  176. }
  177. #endif
  178. #endif /* ARM_EXAMPLE_H */
  179. /** @} */ /* End of group ARM_Example */
  180. /** @} */ /* End of group ARM Ltd. */