PIC24_DOG
interrupts.c
gehe zur Dokumentation dieser Datei
1 /******************************************************************************/
2 /* Files to Include */
3 /******************************************************************************/
4 
5 /* Device header file */
6 #if defined(__XC16__)
7  #include <xc.h>
8 #elif defined(__C30__)
9  #if defined(__PIC24E__)
10  #include <p24Exxxx.h>
11  #elif defined (__PIC24F__)||defined (__PIC24FK__)
12  #include <p24Fxxxx.h>
13  #elif defined(__PIC24H__)
14  #include <p24Hxxxx.h>
15  #endif
16 #endif
17 
18 #include <stdint.h> /* Includes uint16_t definition */
19 #include <stdbool.h> /* Includes true/false definition */
20 
21 /******************************************************************************/
22 /* Interrupt Vector Options */
23 /******************************************************************************/
24 /* */
25 /* Refer to the C30 (MPLAB C Compiler for PIC24F MCUs and dsPIC33F DSCs) User */
26 /* Guide for an up to date list of the available interrupt options. */
27 /* Alternately these names can be pulled from the device linker scripts. */
28 /* */
29 /* PIC24F Primary Interrupt Vector Names: */
30 /* */
31 /* _INT0Interrupt _IC4Interrupt */
32 /* _IC1Interrupt _IC5Interrupt */
33 /* _OC1Interrupt _IC6Interrupt */
34 /* _T1Interrupt _OC5Interrupt */
35 /* _Interrupt4 _OC6Interrupt */
36 /* _IC2Interrupt _OC7Interrupt */
37 /* _OC2Interrupt _OC8Interrupt */
38 /* _T2Interrupt _PMPInterrupt */
39 /* _T3Interrupt _SI2C2Interrupt */
40 /* _SPI1ErrInterrupt _MI2C2Interrupt */
41 /* _SPI1Interrupt _INT3Interrupt */
42 /* _U1RXInterrupt _INT4Interrupt */
43 /* _U1TXInterrupt _RTCCInterrupt */
44 /* _ADC1Interrupt _U1ErrInterrupt */
45 /* _SI2C1Interrupt _U2ErrInterrupt */
46 /* _MI2C1Interrupt _CRCInterrupt */
47 /* _CompInterrupt _LVDInterrupt */
48 /* _CNInterrupt _CTMUInterrupt */
49 /* _INT1Interrupt _U3ErrInterrupt */
50 /* _IC7Interrupt _U3RXInterrupt */
51 /* _IC8Interrupt _U3TXInterrupt */
52 /* _OC3Interrupt _SI2C3Interrupt */
53 /* _OC4Interrupt _MI2C3Interrupt */
54 /* _T4Interrupt _U4ErrInterrupt */
55 /* _T5Interrupt _U4RXInterrupt */
56 /* _INT2Interrupt _U4TXInterrupt */
57 /* _U2RXInterrupt _SPI3ErrInterrupt */
58 /* _U2TXInterrupt _SPI3Interrupt */
59 /* _SPI2ErrInterrupt _OC9Interrupt */
60 /* _SPI2Interrupt _IC9Interrupt */
61 /* _IC3Interrupt */
62 /* */
63 /* PIC24H Primary Interrupt Vector Names: */
64 /* */
65 /* _INT0Interrupt _SPI2Interrupt */
66 /* _IC1Interrupt _C1RxRdyInterrupt */
67 /* _OC1Interrupt _C1Interrupt */
68 /* _T1Interrupt _DMA3Interrupt */
69 /* _DMA0Interrupt _IC3Interrupt */
70 /* _IC2Interrupt _IC4Interrupt */
71 /* _OC2Interrupt _IC5Interrupt */
72 /* _T2Interrupt _IC6Interrupt */
73 /* _T3Interrupt _OC5Interrupt */
74 /* _SPI1ErrInterrupt _OC6Interrupt */
75 /* _SPI1Interrupt _OC7Interrupt */
76 /* _U1RXInterrupt _OC8Interrupt */
77 /* _U1TXInterrupt _DMA4Interrupt */
78 /* _ADC1Interrupt _T6Interrupt */
79 /* _DMA1Interrupt _T7Interrupt */
80 /* _SI2C1Interrupt _SI2C2Interrupt */
81 /* _MI2C1Interrupt _MI2C2Interrupt */
82 /* _CNInterrupt _T8Interrupt */
83 /* _INT1Interrupt _T9Interrupt */
84 /* _ADC2Interrupt _INT3Interrupt */
85 /* _IC7Interrupt _INT4Interrupt */
86 /* _IC8Interrupt _C2RxRdyInterrupt */
87 /* _DMA2Interrupt _C2Interrupt */
88 /* _OC3Interrupt _DCIErrInterrupt */
89 /* _OC4Interrupt _DCIInterrupt */
90 /* _T4Interrupt _U1ErrInterrupt */
91 /* _T5Interrupt _U2ErrInterrupt */
92 /* _INT2Interrupt _DMA6Interrupt */
93 /* _U2RXInterrupt _DMA7Interrupt */
94 /* _U2TXInterrupt _C1TxReqInterrupt */
95 /* _SPI2ErrInterrupt _C2TxReqInterrupt */
96 /* */
97 /* PIC24E Primary Interrupt Vector Names: */
98 /* */
99 /* __INT0Interrupt __C1RxRdyInterrupt __U3TXInterrupt */
100 /* __IC1Interrupt __C1Interrupt __USB1Interrupt */
101 /* __OC1Interrupt __DMA3Interrupt __U4ErrInterrupt */
102 /* __T1Interrupt __IC3Interrupt __U4RXInterrupt */
103 /* __DMA0Interrupt __IC4Interrupt __U4TXInterrupt */
104 /* __IC2Interrupt __IC5Interrupt __SPI3ErrInterrupt */
105 /* __OC2Interrupt __IC6Interrupt __SPI3Interrupt */
106 /* __T2Interrupt __OC5Interrupt __OC9Interrupt */
107 /* __T3Interrupt __OC6Interrupt __IC9Interrupt */
108 /* __SPI1ErrInterrupt __OC7Interrupt __DMA8Interrupt */
109 /* __SPI1Interrupt __OC8Interrupt __DMA9Interrupt */
110 /* __U1RXInterrupt __PMPInterrupt __DMA10Interrupt */
111 /* __U1TXInterrupt __DMA4Interrupt __DMA11Interrupt */
112 /* __AD1Interrupt __T6Interrupt __SPI4ErrInterrupt */
113 /* __DMA1Interrupt __T7Interrupt __SPI4Interrupt */
114 /* __NVMInterrupt __SI2C2Interrupt __OC10Interrupt */
115 /* __SI2C1Interrupt __MI2C2Interrupt __IC10Interrupt */
116 /* __MI2C1Interrupt __T8Interrupt __OC11Interrupt */
117 /* __CM1Interrupt __T9Interrupt __IC11Interrupt */
118 /* __CNInterrupt __INT3Interrupt __OC12Interrupt */
119 /* __INT1Interrupt __INT4Interrupt __IC12Interrupt */
120 /* __AD2Interrupt __C2RxRdyInterrupt __DMA12Interrupt */
121 /* __IC7Interrupt __C2Interrupt __DMA13Interrupt */
122 /* __IC8Interrupt __DMA5Interrupt __DMA14Interrupt */
123 /* __DMA2Interrupt __RTCCInterrupt __OC13Interrupt */
124 /* __OC3Interrupt __U1ErrInterrupt __IC13Interrupt */
125 /* __OC4Interrupt __U2ErrInterrupt __OC14Interrupt */
126 /* __T4Interrupt __CRCInterrupt __IC14Interrupt */
127 /* __T5Interrupt __DMA6Interrupt __OC15Interrupt */
128 /* __INT2Interrupt __DMA7Interrupt __IC15Interrupt */
129 /* __U2RXInterrupt __C1TxReqInterrupt __OC16Interrupt */
130 /* __U2TXInterrupt __C2TxReqInterrupt __IC16Interrupt */
131 /* __SPI2ErrInterrupt __U3ErrInterrupt __ICDInterrupt */
132 /* __SPI2Interrupt __U3RXInterrupt */
133 /* */
134 /* */
135 /* For alternate interrupt vector naming, simply add 'Alt' between the prim. */
136 /* interrupt vector name '_' and the first character of the primary interrupt */
137 /* vector name. There are no Alternate or 'Alt' vectors for the 24E family. */
138 /* */
139 /* For example, the vector name _ADC2Interrupt becomes _AltADC2Interrupt in */
140 /* the alternate vector table. */
141 /* */
142 /* Example Syntax: */
143 /* */
144 /* void __attribute__((interrupt,auto_psv)) <Vector Name>(void) */
145 /* { */
146 /* <Clear Interrupt Flag> */
147 /* } */
148 /* */
149 /* For more comprehensive interrupt examples refer to the C30 (MPLAB C */
150 /* Compiler for PIC24 MCUs and dsPIC DSCs) User Guide in the */
151 /* <compiler installation directory>/doc directory for the latest compiler */
152 /* release. */
153 /* */
154 /******************************************************************************/
155 /* Interrupt Routines */
156 /******************************************************************************/
157 
158 /* TODO Add interrupt routine code here. */