ARM_Example.h 9.0 KB

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