DSP2803x_PieVect.c 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. //###########################################################################
  2. //
  3. // FILE: DSP2803x_PieVect.c
  4. //
  5. // TITLE: DSP2803x Devices PIE Vector Table Initialization Functions.
  6. //
  7. //###########################################################################
  8. // $TI Release: F2803x C/C++ Header Files and Peripheral Examples V130 $
  9. // $Release Date: May 8, 2015 $
  10. // $Copyright: Copyright (C) 2009-2015 Texas Instruments Incorporated -
  11. // http://www.ti.com/ ALL RIGHTS RESERVED $
  12. //###########################################################################
  13. #include "DSP2803x_Device.h" // DSP2803x Headerfile Include File
  14. #include "DSP2803x_Examples.h" // DSP2803x Examples Include File
  15. const struct PIE_VECT_TABLE PieVectTableInit = {
  16. PIE_RESERVED, // 0 Reserved space
  17. PIE_RESERVED, // 1 Reserved space
  18. PIE_RESERVED, // 2 Reserved space
  19. PIE_RESERVED, // 3 Reserved space
  20. PIE_RESERVED, // 4 Reserved space
  21. PIE_RESERVED, // 5 Reserved space
  22. PIE_RESERVED, // 6 Reserved space
  23. PIE_RESERVED, // 7 Reserved space
  24. PIE_RESERVED, // 8 Reserved space
  25. PIE_RESERVED, // 9 Reserved space
  26. PIE_RESERVED, // 10 Reserved space
  27. PIE_RESERVED, // 11 Reserved space
  28. PIE_RESERVED, // 12 Reserved space
  29. // Non-Peripheral Interrupts
  30. INT13_ISR, // CPU-Timer 1
  31. INT14_ISR, // CPU-Timer2
  32. DATALOG_ISR, // Datalogging interrupt
  33. RTOSINT_ISR, // RTOS interrupt
  34. EMUINT_ISR, // Emulation interrupt
  35. NMI_ISR, // Non-maskable interrupt
  36. ILLEGAL_ISR, // Illegal operation TRAP
  37. USER1_ISR, // User Defined trap 1
  38. USER2_ISR, // User Defined trap 2
  39. USER3_ISR, // User Defined trap 3
  40. USER4_ISR, // User Defined trap 4
  41. USER5_ISR, // User Defined trap 5
  42. USER6_ISR, // User Defined trap 6
  43. USER7_ISR, // User Defined trap 7
  44. USER8_ISR, // User Defined trap 8
  45. USER9_ISR, // User Defined trap 9
  46. USER10_ISR, // User Defined trap 10
  47. USER11_ISR, // User Defined trap 11
  48. USER12_ISR, // User Defined trap 12
  49. // Group 1 PIE Vectors
  50. ADCINT1_ISR, // 1.1 ADC // if this is rsvd_ISR, then INT10.1 should be defined as ADCINT1_ISR
  51. ADCINT2_ISR, // 1.2 ADC // if this is rsvd_ISR, then INT10.2 should be defined as ADCINT2_ISR
  52. rsvd_ISR, // 1.3
  53. XINT1_ISR, // 1.4 External Interrupt
  54. XINT2_ISR, // 1.5 External Interrupt
  55. ADCINT9_ISR, // 1.6 ADC
  56. TINT0_ISR, // 1.7 Timer 0
  57. WAKEINT_ISR, // 1.8 WD, Low Power
  58. // Group 2 PIE Vectors
  59. EPWM1_TZINT_ISR, // 2.1 EPWM-1 Trip Zone
  60. EPWM2_TZINT_ISR, // 2.2 EPWM-2 Trip Zone
  61. EPWM3_TZINT_ISR, // 2.3 EPWM-3 Trip Zone
  62. EPWM4_TZINT_ISR, // 2.4 EPWM-4 Trip Zone
  63. EPWM5_TZINT_ISR, // 2.4 EPWM-4 Trip Zone
  64. EPWM6_TZINT_ISR, // 2.4 EPWM-4 Trip Zone
  65. EPWM7_TZINT_ISR, // 2.4 EPWM-4 Trip Zone
  66. rsvd_ISR, // 2.8
  67. // Group 3 PIE Vectors
  68. EPWM1_INT_ISR, // 3.1 EPWM-1 Interrupt
  69. EPWM2_INT_ISR, // 3.2 EPWM-2 Interrupt
  70. EPWM3_INT_ISR, // 3.3 EPWM-3 Interrupt
  71. EPWM4_INT_ISR, // 3.4 EPWM-4 Interrupt
  72. EPWM5_INT_ISR, // 3.5 EPWM-5 Interrupt
  73. EPWM6_INT_ISR, // 3.6 EPWM-6 Interrupt
  74. EPWM7_INT_ISR, // 3.7 EPWM-7 Interrupt
  75. rsvd_ISR, // 3.8
  76. // Group 4 PIE Vectors
  77. ECAP1_INT_ISR, // 4.1 ECAP-1
  78. rsvd_ISR, // 4.2
  79. rsvd_ISR, // 4.3
  80. rsvd_ISR, // 4.4
  81. rsvd_ISR, // 4.5
  82. rsvd_ISR, // 4.6
  83. HRCAP1_INT_ISR, // 4.7 HRCAP-1
  84. HRCAP2_INT_ISR, // 4.8 HRCAP-2
  85. // Group 5 PIE Vectors
  86. EQEP1_INT_ISR, // 5.1 EQEP-1
  87. rsvd_ISR, // 5.2
  88. rsvd_ISR, // 5.3
  89. rsvd_ISR, // 5.4
  90. rsvd_ISR, // 5.5
  91. rsvd_ISR, // 5.6
  92. rsvd_ISR, // 5.7
  93. rsvd_ISR, // 5.8
  94. // Group 6 PIE Vectors
  95. SPIRXINTA_ISR, // 6.1 SPI-A
  96. SPITXINTA_ISR, // 6.2 SPI-A
  97. SPIRXINTB_ISR, // 6.3 SPI-B
  98. SPITXINTB_ISR, // 6.4 SPI-B
  99. rsvd_ISR, // 6.5
  100. rsvd_ISR, // 6.6
  101. rsvd_ISR, // 6.7
  102. rsvd_ISR, // 6.8
  103. // Group 7 PIE Vectors
  104. rsvd_ISR, // 7.1
  105. rsvd_ISR, // 7.2
  106. rsvd_ISR, // 7.3
  107. rsvd_ISR, // 7.4
  108. rsvd_ISR, // 7.5
  109. rsvd_ISR, // 7.6
  110. rsvd_ISR, // 7.7
  111. rsvd_ISR, // 7.8
  112. // Group 8 PIE Vectors
  113. I2CINT1A_ISR, // 8.1 I2C
  114. I2CINT2A_ISR, // 8.2 I2C
  115. rsvd_ISR, // 8.3
  116. rsvd_ISR, // 8.4
  117. rsvd_ISR, // 8.5
  118. rsvd_ISR, // 8.6
  119. rsvd_ISR, // 8.7
  120. rsvd_ISR, // 8.8
  121. // Group 9 PIE Vectors
  122. SCIRXINTA_ISR, // 9.1 SCI-A
  123. SCITXINTA_ISR, // 9.2 SCI-A
  124. LIN0INTA_ISR, // 9.3 LIN-A
  125. LIN1INTA_ISR, // 9.4 LIN-A
  126. ECAN0INTA_ISR, // 9.5 eCAN-A
  127. ECAN1INTA_ISR, // 9.6 eCAN-A
  128. rsvd_ISR, // 9.7
  129. rsvd_ISR, // 9.8
  130. // Group 10 PIE Vectors
  131. rsvd_ISR, // 10.1 If this is ADCINT1_ISR, then INT1.1 should be defined as rsvd_ISR
  132. rsvd_ISR, // 10.2 If this is ADCINT2_ISR, then INT1.2 should be defined as rsvd_ISR
  133. ADCINT3_ISR, // 10.3 ADC
  134. ADCINT4_ISR, // 10.4 ADC
  135. ADCINT5_ISR, // 10.5 ADC
  136. ADCINT6_ISR, // 10.6 ADC
  137. ADCINT7_ISR, // 10.7 ADC
  138. ADCINT8_ISR, // 10.8 ADC
  139. // Group 11 PIE Vectors
  140. CLA1_INT1_ISR, // 11.1 CLA1
  141. CLA1_INT2_ISR, // 11.2 CLA1
  142. CLA1_INT3_ISR, // 11.3 CLA1
  143. CLA1_INT4_ISR, // 11.4 CLA1
  144. CLA1_INT5_ISR, // 11.5 CLA1
  145. CLA1_INT6_ISR, // 11.6 CLA1
  146. CLA1_INT7_ISR, // 11.7 CLA1
  147. CLA1_INT8_ISR, // 11.8 CLA1
  148. // Group 12 PIE Vectors
  149. XINT3_ISR, // 12.1 External Interrupt
  150. rsvd_ISR, // 12.2
  151. rsvd_ISR, // 12.3
  152. rsvd_ISR, // 12.4
  153. rsvd_ISR, // 12.5
  154. rsvd_ISR, // 12.6
  155. LVF_ISR, // 12.7 CLA1
  156. LUF_ISR // 12.8 CLA1
  157. };
  158. //---------------------------------------------------------------------------
  159. // InitPieVectTable:
  160. //---------------------------------------------------------------------------
  161. // This function initializes the PIE vector table to a known state.
  162. // This function must be executed after boot time.
  163. //
  164. void InitPieVectTable(void)
  165. {
  166. int16 i;
  167. Uint32 *Source = (void *) &PieVectTableInit;
  168. volatile Uint32 *Dest = (void *) &PieVectTable;
  169. // Do not write over first 3 32-bit locations (these locations are
  170. // initialized by Boot ROM with boot variables)
  171. Source = Source + 3;
  172. Dest = Dest + 3;
  173. EALLOW;
  174. for(i=0; i < 125; i++)
  175. *Dest++ = *Source++;
  176. EDIS;
  177. // Enable the PIE Vector Table
  178. PieCtrlRegs.PIECTRL.bit.ENPIE = 1;
  179. }
  180. //===========================================================================
  181. // End of file.
  182. //===========================================================================