interrupt.h 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. /**
  2. * \file interrupt.h
  3. *
  4. * \brief Contains DSP interrupt related API declarations and system interrupt
  5. * event numbers. (Note: event numbers are device-specific.)
  6. */
  7. /*
  8. * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. *
  14. * Redistributions of source code must retain the above copyright
  15. * notice, this list of conditions and the following disclaimer.
  16. *
  17. * Redistributions in binary form must reproduce the above copyright
  18. * notice, this list of conditions and the following disclaimer in the
  19. * documentation and/or other materials provided with the
  20. * distribution.
  21. *
  22. * Neither the name of Texas Instruments Incorporated nor the names of
  23. * its contributors may be used to endorse or promote products derived
  24. * from this software without specific prior written permission.
  25. *
  26. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  27. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  28. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  29. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  30. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  31. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  32. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  33. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  34. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  35. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  36. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  37. */
  38. #ifndef INTERRUPT_H_
  39. #define INTERRUPT_H_
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43. /******************************************************************************
  44. ** INTERNAL TYPE DEFINITIONS
  45. ******************************************************************************/
  46. typedef void (*c674xISR)(void);
  47. /******************************************************************************
  48. ** EXTERNAL MACRO DEFINITIONS
  49. ******************************************************************************/
  50. /* API Parameter: cpuINT, ecmINTx
  51. *
  52. * Brief: Used to select DSP CPU maskable interrupt.
  53. *
  54. * Functions:
  55. * IntRegister
  56. * IntUnRegister
  57. * IntEventMap
  58. * IntEventCombineInit
  59. * IntEnable
  60. * IntDisable */
  61. #define C674X_MASK_INT4 4
  62. #define C674X_MASK_INT5 5
  63. #define C674X_MASK_INT6 6
  64. #define C674X_MASK_INT7 7
  65. #define C674X_MASK_INT8 8
  66. #define C674X_MASK_INT9 9
  67. #define C674X_MASK_INT10 10
  68. #define C674X_MASK_INT11 11
  69. #define C674X_MASK_INT12 12
  70. #define C674X_MASK_INT13 13
  71. #define C674X_MASK_INT14 14
  72. #define C674X_MASK_INT15 15
  73. /* Functions:
  74. * IntRegister
  75. * IntUnRegister */
  76. #define C674X_MASK_NMI 1
  77. #define C674X_MASK_EXC 1
  78. #define C674X_MASK_RSV2 2
  79. #define C674X_MASK_RSV3 3
  80. /* API Parameter: ecmINTx ONLY
  81. *
  82. * Brief: Used to specify unused Event Combiner system events
  83. *
  84. * Functions:
  85. * IntEventCombineInit */
  86. #define ECM0_UNUSED -1
  87. #define ECM1_UNUSED -1
  88. #define ECM2_UNUSED -1
  89. #define ECM3_UNUSED -1
  90. /* API Parameter: sysINT
  91. *
  92. * Brief: Used to select system interrupts.
  93. *
  94. * Functions:
  95. * IntEventMap
  96. * IntEventSet
  97. * IntEventClear
  98. * IntEventCombineAdd
  99. * IntEventCombineRemove
  100. * IntEventCombineRegister
  101. * ExcCombineAdd
  102. * ExcCombineRemove */
  103. /* Event Combiners */
  104. #define SYS_INT_EVT0 0
  105. #define SYS_INT_EVT1 1
  106. #define SYS_INT_EVT2 2
  107. #define SYS_INT_EVT3 3
  108. /* Timer Interrupts */
  109. #define SYS_INT_T64P0_TINT12 4
  110. #define SYS_INT_T64P0_TINT34 64
  111. #define SYS_INT_T64P1_TINT12 40
  112. #define SYS_INT_T64P1_TINT34 48
  113. #define SYS_INT_T64P2_TINTALL 25
  114. #define SYS_INT_T64P3_TINTALL 86
  115. #define SYS_INT_T64P2_CMPINT0 78
  116. #define SYS_INT_T64P2_CMPINT1 79
  117. #define SYS_INT_T64P2_CMPINT2 80
  118. #define SYS_INT_T64P2_CMPINT3 81
  119. #define SYS_INT_T64P2_CMPINT4 82
  120. #define SYS_INT_T64P2_CMPINT5 83
  121. #define SYS_INT_T64P2_CMPINT6 84
  122. #define SYS_INT_T64P2_CMPINT7 85
  123. /* Syscfg Interrupts */
  124. #define SYS_INT_SYSCFG_CHIPINT2 5
  125. #define SYS_INT_SYSCFG_CHIPINT3 67
  126. #define SYS_INT_PROTERR 74
  127. /* PRU Interrupts */
  128. #define SYS_INT_PRU_EVTOUT0 6
  129. #define SYS_INT_PRU_EVTOUT1 17
  130. #define SYS_INT_PRU_EVTOUT2 22
  131. #define SYS_INT_PRU_EVTOUT3 35
  132. #define SYS_INT_PRU_EVTOUT4 66
  133. #define SYS_INT_PRU_EVTOUT5 39
  134. #define SYS_INT_PRU_EVTOUT6 44
  135. #define SYS_INT_PRU_EVTOUT7 50
  136. /* EHRPWM Interrupts */
  137. #define SYS_INT_EHRPWM0 7
  138. #define SYS_INT_EHRPWM0TZ 10
  139. #define SYS_INT_EHRPWM1 18
  140. #define SYS_INT_EHRPWM1TZ 23
  141. /* EDMA Interrupts */
  142. #define SYS_INT_EDMA3_0_CC0_INT1 8
  143. #define SYS_INT_EDMA3_0_CC0_ERRINT 56
  144. #define SYS_INT_EDMA3_0_TC0_ERRINT 57
  145. #define SYS_INT_EDMA3_0_TC1_ERRINT 58
  146. #define SYS_INT_EDMA3_1_CC0_INT1 91
  147. #define SYS_INT_EDMA3_1_CC0_ERRINT 92
  148. #define SYS_INT_EDMA3_1_TC0_ERRINT 93
  149. /* EMU Interrupts */
  150. #define SYS_INT_EMU_DTDMA 9
  151. #define SYS_INT_EMU_RTDXRX 11
  152. #define SYS_INT_EMU_RTDXTX 12
  153. /* IDMA Interrupts */
  154. #define SYS_INT_IDMAINT0 13
  155. #define SYS_INT_IDMAINT1 14
  156. /* MMCSD Interrupts */
  157. #define SYS_INT_MMCSD0_INT0 15
  158. #define SYS_INT_MMCSD0_INT1 16
  159. #define SYS_INT_MMCSD1_INT0 68
  160. #define SYS_INT_MMCSD1_INT1 53
  161. /* USB Interrupts */
  162. #define SYS_INT_USB0 19
  163. #define SYS_INT_USB1_HCINT 20
  164. #define SYS_INT_USB1_RWAKEUP 21
  165. /* SATA Interrupts */
  166. #define SYS_INT_SATA_INT 24
  167. /* EMAC Interrupts */
  168. #define SYS_INT_EMAC_C0RXTHRESH 26
  169. #define SYS_INT_EMAC_C0RX 27
  170. #define SYS_INT_EMAC_C0TX 28
  171. #define SYS_INT_EMAC_C0MISC 29
  172. #define SYS_INT_EMAC_C1RXTHRESH 30
  173. #define SYS_INT_EMAC_C1RX 31
  174. #define SYS_INT_EMAC_C1TX 32
  175. #define SYS_INT_EMAC_C1MISC 33
  176. /* HPI Interrupts */
  177. #define SYS_INT_UHPI_DSPINT 34
  178. /* I2C Interrupts */
  179. #define SYS_INT_I2C0_INT 36
  180. #define SYS_INT_I2C1_INT 42
  181. /* SPI Interrupts */
  182. #define SYS_INT_SPI0_INT 37
  183. #define SYS_INT_SPI1_INT 43
  184. /* UART Interrupts */
  185. #define SYS_INT_UART0_INT 38
  186. #define SYS_INT_UART1_INT 46
  187. #define SYS_INT_UART2_INT 69
  188. /* GPIO Interrupts */
  189. #define SYS_INT_GPIO_B0INT 65
  190. #define SYS_INT_GPIO_B1INT 41
  191. #define SYS_INT_GPIO_B2INT 49
  192. #define SYS_INT_GPIO_B3INT 52
  193. #define SYS_INT_GPIO_B4INT 54
  194. #define SYS_INT_GPIO_B5INT 59
  195. #define SYS_INT_GPIO_B6INT 62
  196. #define SYS_INT_GPIO_B7INT 72
  197. #define SYS_INT_GPIO_B8INT 75
  198. /* ECAP Interrupts */
  199. #define SYS_INT_ECAP0 45
  200. #define SYS_INT_ECAP1 47
  201. #define SYS_INT_ECAP2 51
  202. /* EMIF Interrupts */
  203. #define SYS_INT_EMIFA_INT 55
  204. /* DDR Interrupts */
  205. #define SYS_INT_DDR2_MEMERR 60
  206. /* MCASP Interrupts */
  207. #define SYS_INT_MCASP0_INT 61
  208. /* RTC Interrupts */
  209. #define SYS_INT_RTC_IRQS 63
  210. /* PSC Interrupts */
  211. #define SYS_INT_PSC0_ALLINT 70
  212. #define SYS_INT_PSC1_ALLINT 71
  213. /* LCD Interrupts */
  214. #define SYS_INT_LCDC_INT 73
  215. /* MCBSP Interrupts */
  216. #define SYS_INT_MCBSP0_RINT 87
  217. #define SYS_INT_MCBSP0_XINT 88
  218. #define SYS_INT_MCBSP1_RINT 89
  219. #define SYS_INT_MCBSP1_XINT 90
  220. /* UPP Interrupts */
  221. #define SYS_INT_UPP_INT 94
  222. /* VPIF Interrupts */
  223. #define SYS_INT_VPIF_INT 95
  224. /* INTC Interrupts */
  225. #define SYS_INT_INTERR 96
  226. /* EMC Interrupts */
  227. #define SYS_INT_EMC_IDMAERR 97
  228. #define SYS_INT_EMC_CMPA 126
  229. #define SYS_INT_EMC_BUSERR 127
  230. /* PMC Interrupts */
  231. #define SYS_INT_PMC_ED 113
  232. #define SYS_INT_PMC_CMPA 120
  233. #define SYS_INT_PMC_DMPA 121
  234. /* UMC Interrupts */
  235. #define SYS_INT_UMC_ED1 116
  236. #define SYS_INT_UMC_ED2 117
  237. #define SYS_INT_UMC_CMPA 124
  238. #define SYS_INT_UMC_DMPA 125
  239. /* PDC Interrupts */
  240. #define SYS_INT_PDC_INT 118
  241. /* SYS Interrupts */
  242. #define SYS_INT_SYS_CMPA 119
  243. /* DMC Interrupts */
  244. #define SYS_INT_DMC_CMPA 122
  245. #define SYS_INT_DMC_DMPA 123
  246. #ifndef SYS_INT_USBSSINT
  247. #define SYS_INT_USBSSINT 255
  248. #endif
  249. /******************************************************************************
  250. ** FUNCTION DEFINITIONS
  251. ******************************************************************************/
  252. extern void IntDSPINTCInit (void);
  253. extern void IntRegister (unsigned int cpuINT, void (*userISR)(void));
  254. extern void IntUnRegister (unsigned int cpuINT);
  255. extern void IntEventMap (unsigned int cpuINT, unsigned int sysINT);
  256. extern void IntEventSet (unsigned int sysINT);
  257. extern void IntEventClear(unsigned int sysINT);
  258. extern void IntEventCombineInit(int ecmINT0, int ecmINT1, int ecmINT2, int ecmINT3);
  259. extern void IntEventCombineAdd(unsigned int sysINT);
  260. extern void IntEventCombineRemove(unsigned int sysINT);
  261. extern void IntEventCombineRegister(unsigned int sysINT, void (*userISR)(void));
  262. extern void IntEnable (unsigned int cpuINT);
  263. extern void IntDisable (unsigned int cpuINT);
  264. extern void IntReset (void);
  265. extern void IntGlobalEnable (void);
  266. extern unsigned int IntGlobalDisable (void);
  267. extern void IntGlobalRestore (unsigned int restoreValue);
  268. extern void ExcGlobalEnable (void);
  269. extern void ExcCombineAdd(unsigned int sysINT);
  270. extern void ExcCombineRemove(unsigned int sysINT);
  271. #ifdef __cplusplus
  272. }
  273. #endif
  274. #endif /* INTERRUPT_H_ */