cmsis.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. /*
  2. * @brief Basic CMSIS include file
  3. *
  4. * @note
  5. * Copyright(C) NXP Semiconductors, 2012
  6. * All rights reserved.
  7. *
  8. * @par
  9. * Software that is described herein is for illustrative purposes only
  10. * which provides customers with programming information regarding the
  11. * LPC products. This software is supplied "AS IS" without any warranties of
  12. * any kind, and NXP Semiconductors and its licensor disclaim any and
  13. * all warranties, express or implied, including all implied warranties of
  14. * merchantability, fitness for a particular purpose and non-infringement of
  15. * intellectual property rights. NXP Semiconductors assumes no responsibility
  16. * or liability for the use of the software, conveys no license or rights under any
  17. * patent, copyright, mask work right, or any other intellectual property rights in
  18. * or to any products. NXP Semiconductors reserves the right to make changes
  19. * in the software without notification. NXP Semiconductors also makes no
  20. * representation or warranty that such application will be suitable for the
  21. * specified use without further testing or modification.
  22. *
  23. * @par
  24. * Permission to use, copy, modify, and distribute this software and its
  25. * documentation is hereby granted, under NXP Semiconductors' and its
  26. * licensor's relevant copyrights in the software, without fee, provided that it
  27. * is used in conjunction with NXP Semiconductors microcontrollers. This
  28. * copyright, permission, and disclaimer notice must appear in all copies of
  29. * this code.
  30. */
  31. #ifndef __CMSIS_H_
  32. #define __CMSIS_H_
  33. #include "lpc_types.h"
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. /** @defgroup CMSIS_18XX_43XX CHIP: LPC18xx/43xx CMSIS include file
  38. * @ingroup CHIP_18XX_43XX_Drivers
  39. * @{
  40. */
  41. #if defined(__ARMCC_VERSION)
  42. // Kill warning "#pragma push with no matching #pragma pop"
  43. #pragma diag_suppress 2525
  44. #pragma push
  45. #pragma anon_unions
  46. #elif defined(__CWCC__)
  47. #pragma push
  48. #pragma cpp_extensions on
  49. #elif defined(__GNUC__)
  50. /* anonymous unions are enabled by default */
  51. #elif defined(__IAR_SYSTEMS_ICC__)
  52. // #pragma push // FIXME not usable for IAR
  53. #pragma language=extended
  54. #else
  55. #error Not supported compiler type
  56. #endif
  57. #if defined(CORE_M4)
  58. /** @defgroup CMSIS_43XX CHIP: LPC43xx Cortex CMSIS definitions
  59. * @{
  60. */
  61. #define __CM4_REV 0x0000 /*!< Cortex-M4 Core Revision */
  62. #define __MPU_PRESENT 1 /*!< MPU present or not */
  63. #define __NVIC_PRIO_BITS 3 /*!< Number of Bits used for Priority Levels */
  64. #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
  65. #ifdef CHIP_LPC43XX
  66. #define __FPU_PRESENT 1 /*!< FPU present or not */
  67. #else
  68. #define __FPU_PRESENT 0 /*!< FPU present or not */
  69. #endif
  70. /**
  71. * @}
  72. */
  73. /** @defgroup CMSIS_43XX_IRQ CHIP: LPC43xx peripheral interrupt numbers
  74. * @{
  75. */
  76. typedef enum {
  77. /* ------------------------- Cortex-M4 Processor Exceptions Numbers ----------------------------- */
  78. Reset_IRQn = -15,/*!< 1 Reset Vector, invoked on Power up and warm reset */
  79. NonMaskableInt_IRQn = -14,/*!< 2 Non maskable Interrupt, cannot be stopped or preempted */
  80. HardFault_IRQn = -13,/*!< 3 Hard Fault, all classes of Fault */
  81. MemoryManagement_IRQn = -12,/*!< 4 Memory Management, MPU mismatch, including Access Violation and No Match */
  82. BusFault_IRQn = -11,/*!< 5 Bus Fault, Pre-Fetch-, Memory Access Fault, other address/memory related Fault */
  83. UsageFault_IRQn = -10,/*!< 6 Usage Fault, i.e. Undef Instruction, Illegal State Transition */
  84. SVCall_IRQn = -5,/*!< 11 System Service Call via SVC instruction */
  85. DebugMonitor_IRQn = -4,/*!< 12 Debug Monitor */
  86. PendSV_IRQn = -2,/*!< 14 Pendable request for system service */
  87. SysTick_IRQn = -1,/*!< 15 System Tick Timer */
  88. /* --------------------------- LPC18xx/43xx Specific Interrupt Numbers ------------------------------- */
  89. DAC_IRQn = 0,/*!< 0 DAC */
  90. M0CORE_IRQn = 1,/*!< 1 M0a */
  91. DMA_IRQn = 2,/*!< 2 DMA */
  92. RESERVED1_IRQn = 3,/*!< 3 EZH/EDM */
  93. RESERVED2_IRQn = 4,
  94. ETHERNET_IRQn = 5,/*!< 5 ETHERNET */
  95. SDIO_IRQn = 6,/*!< 6 SDIO */
  96. LCD_IRQn = 7,/*!< 7 LCD */
  97. USB0_IRQn = 8,/*!< 8 USB0 */
  98. USB1_IRQn = 9,/*!< 9 USB1 */
  99. SCT_IRQn = 10,/*!< 10 SCT */
  100. RITIMER_IRQn = 11,/*!< 11 RITIMER */
  101. TIMER0_IRQn = 12,/*!< 12 TIMER0 */
  102. TIMER1_IRQn = 13,/*!< 13 TIMER1 */
  103. TIMER2_IRQn = 14,/*!< 14 TIMER2 */
  104. TIMER3_IRQn = 15,/*!< 15 TIMER3 */
  105. MCPWM_IRQn = 16,/*!< 16 MCPWM */
  106. ADC0_IRQn = 17,/*!< 17 ADC0 */
  107. I2C0_IRQn = 18,/*!< 18 I2C0 */
  108. I2C1_IRQn = 19,/*!< 19 I2C1 */
  109. SPI_INT_IRQn = 20,/*!< 20 SPI_INT */
  110. ADC1_IRQn = 21,/*!< 21 ADC1 */
  111. SSP0_IRQn = 22,/*!< 22 SSP0 */
  112. SSP1_IRQn = 23,/*!< 23 SSP1 */
  113. USART0_IRQn = 24,/*!< 24 USART0 */
  114. UART1_IRQn = 25,/*!< 25 UART1 */
  115. USART2_IRQn = 26,/*!< 26 USART2 */
  116. USART3_IRQn = 27,/*!< 27 USART3 */
  117. I2S0_IRQn = 28,/*!< 28 I2S0 */
  118. I2S1_IRQn = 29,/*!< 29 I2S1 */
  119. RESERVED4_IRQn = 30,
  120. SGPIO_INT_IRQn = 31,/*!< 31 SGPIO_IINT */
  121. PIN_INT0_IRQn = 32,/*!< 32 PIN_INT0 */
  122. PIN_INT1_IRQn = 33,/*!< 33 PIN_INT1 */
  123. PIN_INT2_IRQn = 34,/*!< 34 PIN_INT2 */
  124. PIN_INT3_IRQn = 35,/*!< 35 PIN_INT3 */
  125. PIN_INT4_IRQn = 36,/*!< 36 PIN_INT4 */
  126. PIN_INT5_IRQn = 37,/*!< 37 PIN_INT5 */
  127. PIN_INT6_IRQn = 38,/*!< 38 PIN_INT6 */
  128. PIN_INT7_IRQn = 39,/*!< 39 PIN_INT7 */
  129. GINT0_IRQn = 40,/*!< 40 GINT0 */
  130. GINT1_IRQn = 41,/*!< 41 GINT1 */
  131. EVENTROUTER_IRQn = 42,/*!< 42 EVENTROUTER */
  132. C_CAN1_IRQn = 43,/*!< 43 C_CAN1 */
  133. RESERVED6_IRQn = 44,
  134. RESERVED7_IRQn = 45,/*!< 45 VADC */
  135. ATIMER_IRQn = 46,/*!< 46 ATIMER */
  136. RTC_IRQn = 47,/*!< 47 RTC */
  137. RESERVED8_IRQn = 48,
  138. WWDT_IRQn = 49,/*!< 49 WWDT */
  139. RESERVED9_IRQn = 50,
  140. C_CAN0_IRQn = 51,/*!< 51 C_CAN0 */
  141. QEI_IRQn = 52,/*!< 52 QEI */
  142. } IRQn_Type;
  143. /**
  144. * @}
  145. */
  146. #include "core_cm4.h" /*!< Cortex-M4 processor and core peripherals */
  147. #elif defined(CORE_M3)
  148. /** @defgroup CMSIS_18XX CHIP: LPC18xx Cortex CMSIS definitions
  149. * @{
  150. */
  151. #define __MPU_PRESENT 1 /*!< MPU present or not */
  152. #define __NVIC_PRIO_BITS 3 /*!< Number of Bits used for Priority Levels */
  153. #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
  154. #define __FPU_PRESENT 0 /*!< FPU present or not */
  155. /**
  156. * @}
  157. */
  158. /** @defgroup CMSIS_18XX_IRQ CHIP: LPC18xx peripheral interrupt numbers
  159. * @{
  160. */
  161. typedef enum {
  162. /* ------------------------- Cortex-M3 Processor Exceptions Numbers ----------------------------- */
  163. Reset_IRQn = -15,/*!< 1 Reset Vector, invoked on Power up and warm reset */
  164. NonMaskableInt_IRQn = -14,/*!< 2 Non maskable Interrupt, cannot be stopped or preempted */
  165. HardFault_IRQn = -13,/*!< 3 Hard Fault, all classes of Fault */
  166. MemoryManagement_IRQn = -12,/*!< 4 Memory Management, MPU mismatch, including Access Violation and No Match */
  167. BusFault_IRQn = -11,/*!< 5 Bus Fault, Pre-Fetch-, Memory Access Fault, other address/memory related Fault */
  168. UsageFault_IRQn = -10,/*!< 6 Usage Fault, i.e. Undef Instruction, Illegal State Transition */
  169. SVCall_IRQn = -5, /*!< 11 System Service Call via SVC instruction */
  170. DebugMonitor_IRQn = -4, /*!< 12 Debug Monitor */
  171. PendSV_IRQn = -2, /*!< 14 Pendable request for system service */
  172. SysTick_IRQn = -1, /*!< 15 System Tick Timer */
  173. /* --------------------------- LPC18xx/43xx Specific Interrupt Numbers ------------------------------- */
  174. DAC_IRQn = 0,/*!< 0 DAC */
  175. RESERVED0_IRQn = 1,
  176. DMA_IRQn = 2,/*!< 2 DMA */
  177. RESERVED1_IRQn = 3,/*!< 3 EZH/EDM */
  178. RESERVED2_IRQn = 4,
  179. ETHERNET_IRQn = 5,/*!< 5 ETHERNET */
  180. SDIO_IRQn = 6,/*!< 6 SDIO */
  181. LCD_IRQn = 7,/*!< 7 LCD */
  182. USB0_IRQn = 8,/*!< 8 USB0 */
  183. USB1_IRQn = 9,/*!< 9 USB1 */
  184. SCT_IRQn = 10,/*!< 10 SCT */
  185. RITIMER_IRQn = 11,/*!< 11 RITIMER */
  186. TIMER0_IRQn = 12,/*!< 12 TIMER0 */
  187. TIMER1_IRQn = 13,/*!< 13 TIMER1 */
  188. TIMER2_IRQn = 14,/*!< 14 TIMER2 */
  189. TIMER3_IRQn = 15,/*!< 15 TIMER3 */
  190. MCPWM_IRQn = 16,/*!< 16 MCPWM */
  191. ADC0_IRQn = 17,/*!< 17 ADC0 */
  192. I2C0_IRQn = 18,/*!< 18 I2C0 */
  193. I2C1_IRQn = 19,/*!< 19 I2C1 */
  194. RESERVED3_IRQn = 20,
  195. ADC1_IRQn = 21,/*!< 21 ADC1 */
  196. SSP0_IRQn = 22,/*!< 22 SSP0 */
  197. SSP1_IRQn = 23,/*!< 23 SSP1 */
  198. USART0_IRQn = 24,/*!< 24 USART0 */
  199. UART1_IRQn = 25,/*!< 25 UART1 */
  200. USART2_IRQn = 26,/*!< 26 USART2 */
  201. USART3_IRQn = 27,/*!< 27 USART3 */
  202. I2S0_IRQn = 28,/*!< 28 I2S0 */
  203. I2S1_IRQn = 29,/*!< 29 I2S1 */
  204. RESERVED4_IRQn = 30,
  205. RESERVED5_IRQn = 31,
  206. PIN_INT0_IRQn = 32,/*!< 32 PIN_INT0 */
  207. PIN_INT1_IRQn = 33,/*!< 33 PIN_INT1 */
  208. PIN_INT2_IRQn = 34,/*!< 34 PIN_INT2 */
  209. PIN_INT3_IRQn = 35,/*!< 35 PIN_INT3 */
  210. PIN_INT4_IRQn = 36,/*!< 36 PIN_INT4 */
  211. PIN_INT5_IRQn = 37,/*!< 37 PIN_INT5 */
  212. PIN_INT6_IRQn = 38,/*!< 38 PIN_INT6 */
  213. PIN_INT7_IRQn = 39,/*!< 39 PIN_INT7 */
  214. GINT0_IRQn = 40,/*!< 40 GINT0 */
  215. GINT1_IRQn = 41,/*!< 41 GINT1 */
  216. EVENTROUTER_IRQn = 42,/*!< 42 EVENTROUTER */
  217. C_CAN1_IRQn = 43,/*!< 43 C_CAN1 */
  218. RESERVED6_IRQn = 44,
  219. RESERVED7_IRQn = 45,/*!< 45 VADC */
  220. ATIMER_IRQn = 46,/*!< 46 ATIMER */
  221. RTC_IRQn = 47,/*!< 47 RTC */
  222. RESERVED8_IRQn = 48,
  223. WWDT_IRQn = 49,/*!< 49 WWDT */
  224. RESERVED9_IRQn = 50,
  225. C_CAN0_IRQn = 51,/*!< 51 C_CAN0 */
  226. QEI_IRQn = 52,/*!< 52 QEI */
  227. } IRQn_Type;
  228. /**
  229. * @}
  230. */
  231. #include "core_cm3.h" /*!< Cortex-M3 processor and core peripherals */
  232. #elif defined(CORE_M0)
  233. /** @defgroup CMSIS_43XX_M0 CHIP: LPC43xx (M0 Core) Cortex CMSIS definitions
  234. * @{
  235. */
  236. #define __MPU_PRESENT 0 /*!< MPU present or not */
  237. #define __NVIC_PRIO_BITS 2 /*!< Number of Bits used for Priority Levels */
  238. #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
  239. #define __FPU_PRESENT 0 /*!< FPU present or not */
  240. /**
  241. * @}
  242. */
  243. /** @defgroup CMSIS_43XX_M0_IRQ CHIP: LPC43xx (M0 Core) peripheral interrupt numbers
  244. * @{
  245. */
  246. typedef enum {
  247. /* ------------------------- Cortex-M0 Processor Exceptions Numbers ----------------------------- */
  248. Reset_IRQn = -15,/*!< 1 Reset Vector, invoked on Power up and warm reset */
  249. NonMaskableInt_IRQn = -14,/*!< 2 Non maskable Interrupt, cannot be stopped or preempted */
  250. HardFault_IRQn = -13,/*!< 3 Hard Fault, all classes of Fault */
  251. SVCall_IRQn = -5, /*!< 11 System Service Call via SVC instruction */
  252. DebugMonitor_IRQn = -4, /*!< 12 Debug Monitor */
  253. PendSV_IRQn = -2, /*!< 14 Pendable request for system service */
  254. SysTick_IRQn = -1, /*!< 15 System Tick Timer */
  255. /* --------------------------- LPC18xx/43xx Specific Interrupt Numbers ------------------------------- */
  256. DAC_IRQn = 0,/*!< 0 DAC */
  257. M0_M4CORE_IRQn = 1,/*!< 1 M0a */
  258. DMA_IRQn = 2,/*!< 2 DMA */
  259. RESERVED1_IRQn = 3,/*!< 3 EZH/EDM */
  260. RESERVED2_IRQn = 4,
  261. ETHERNET_IRQn = 5,/*!< 5 ETHERNET */
  262. SDIO_IRQn = 6,/*!< 6 SDIO */
  263. LCD_IRQn = 7,/*!< 7 LCD */
  264. USB0_IRQn = 8,/*!< 8 USB0 */
  265. USB1_IRQn = 9,/*!< 9 USB1 */
  266. SCT_IRQn = 10,/*!< 10 SCT */
  267. RITIMER_IRQn = 11,/*!< 11 RITIMER */
  268. TIMER0_IRQn = 12,/*!< 12 TIMER0 */
  269. TIMER1_IRQn = 13,/*!< 13 TIMER1 */
  270. TIMER2_IRQn = 14,/*!< 14 TIMER2 */
  271. TIMER3_IRQn = 15,/*!< 15 TIMER3 */
  272. MCPWM_IRQn = 16,/*!< 16 MCPWM */
  273. ADC0_IRQn = 17,/*!< 17 ADC0 */
  274. I2C0_IRQn = 18,/*!< 18 I2C0 */
  275. I2C1_IRQn = 19,/*!< 19 I2C1 */
  276. SPI_INT_IRQn = 20,/*!< 20 SPI_INT */
  277. ADC1_IRQn = 21,/*!< 21 ADC1 */
  278. SSP0_IRQn = 22,/*!< 22 SSP0 */
  279. SSP1_IRQn = 23,/*!< 23 SSP1 */
  280. USART0_IRQn = 24,/*!< 24 USART0 */
  281. UART1_IRQn = 25,/*!< 25 UART1 */
  282. USART2_IRQn = 26,/*!< 26 USART2 */
  283. USART3_IRQn = 27,/*!< 27 USART3 */
  284. I2S0_IRQn = 28,/*!< 28 I2S0 */
  285. I2S1_IRQn = 29,/*!< 29 I2S1 */
  286. RESERVED4_IRQn = 30,
  287. SGPIO_INT_IRQn = 31,/*!< 31 SGPIO_IINT */
  288. PIN_INT0_IRQn = 32,/*!< 32 PIN_INT0 */
  289. PIN_INT1_IRQn = 33,/*!< 33 PIN_INT1 */
  290. PIN_INT2_IRQn = 34,/*!< 34 PIN_INT2 */
  291. PIN_INT3_IRQn = 35,/*!< 35 PIN_INT3 */
  292. PIN_INT4_IRQn = 36,/*!< 36 PIN_INT4 */
  293. PIN_INT5_IRQn = 37,/*!< 37 PIN_INT5 */
  294. PIN_INT6_IRQn = 38,/*!< 38 PIN_INT6 */
  295. PIN_INT7_IRQn = 39,/*!< 39 PIN_INT7 */
  296. GINT0_IRQn = 40,/*!< 40 GINT0 */
  297. GINT1_IRQn = 41,/*!< 41 GINT1 */
  298. EVENTROUTER_IRQn = 42,/*!< 42 EVENTROUTER */
  299. C_CAN1_IRQn = 43,/*!< 43 C_CAN1 */
  300. RESERVED6_IRQn = 44,
  301. RESERVED7_IRQn = 45,/*!< 45 VADC */
  302. ATIMER_IRQn = 46,/*!< 46 ATIMER */
  303. RTC_IRQn = 47,/*!< 47 RTC */
  304. RESERVED8_IRQn = 48,
  305. WWDT_IRQn = 49,/*!< 49 WWDT */
  306. RESERVED9_IRQn = 50,
  307. C_CAN0_IRQn = 51,/*!< 51 C_CAN0 */
  308. QEI_IRQn = 52,/*!< 52 QEI */
  309. } IRQn_Type;
  310. /**
  311. * @}
  312. */
  313. #include "core_cm0.h" /*!< Cortex-M4 processor and core peripherals */
  314. #else
  315. #error Please #define CORE_M0, CORE_M3, or CORE_M4
  316. #endif
  317. /**
  318. * @}
  319. */
  320. #ifdef __cplusplus
  321. }
  322. #endif
  323. #endif /* __CMSIS_H_ */