S32 SDK
flexcan_irq.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 - 2014, Freescale Semiconductor, Inc.
3  * Copyright 2016 NXP
4  * All rights reserved.
5  *
6  * THIS SOFTWARE IS PROVIDED BY NXP "AS IS" AND ANY EXPRESSED OR
7  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
8  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
9  * IN NO EVENT SHALL NXP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
10  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
11  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
12  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
13  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
14  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
15  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
16  * THE POSSIBILITY OF SUCH DAMAGE.
17  */
18 
34 #include "flexcan_driver.h"
35 
36 #if (defined(CPU_S32K144HFT0VLLT) || defined(CPU_S32K144LFT0MLLT))
37 
38 /*******************************************************************************
39  * Default interrupt handlers signatures
40  ******************************************************************************/
41 void CAN0_ORed_IRQHandler(void);
42 void CAN0_Error_IRQHandler(void);
43 void CAN0_Wake_Up_IRQHandler(void);
46 #if (CAN_INSTANCE_COUNT > 1U)
47 void CAN1_ORed_IRQHandler(void);
48 void CAN1_Error_IRQHandler(void);
49 void CAN1_Wake_Up_IRQHandler(void);
50 void CAN1_ORed_0_15_MB_IRQHandler(void);
51 void CAN1_ORed_16_31_MB_IRQHandler(void);
52 #endif
53 #if (CAN_INSTANCE_COUNT > 2U)
54 void CAN2_ORed_IRQHandler(void);
55 void CAN2_Error_IRQHandler(void);
56 void CAN2_Wake_Up_IRQHandler(void);
57 void CAN2_ORed_0_15_MB_IRQHandler(void);
58 void CAN2_ORed_16_31_MB_IRQHandler(void);
59 #endif
60 
61 /*******************************************************************************
62  * Code
63  ******************************************************************************/
64 #if (CAN_INSTANCE_COUNT > 0U)
65 /* Implementation of CAN0 IRQ handler for OR'ed interrupts (Bus Off,
66 Transmit Warning, Receive Warning). */
67 void CAN0_ORed_IRQHandler(void)
68 {
70 }
71 
72 /* Implementation of CAN0 IRQ handler for interrupts indicating that errors were
73 detected on the CAN bus. */
74 void CAN0_Error_IRQHandler(void)
75 {
77 }
78 
79 /* Implementation of CAN0 IRQ handler for interrupts indicating a wake up
80 event. */
81 void CAN0_Wake_Up_IRQHandler(void)
82 {
83  FLEXCAN_DRV_WakeUpHandler(0);
84 }
85 
86 /* Implementation of CAN0 IRQ handler for interrupts indicating a successful
87 transmission or reception for Message Buffers 0-15. */
89 {
91 }
92 
93 /* Implementation of CAN0 IRQ handler for interrupts indicating a successful
94 transmission or reception for Message Buffers 16-31. */
96 {
98 }
99 #endif /* (CAN_INSTANCE_COUNT > 0U) */
100 
101 #if (CAN_INSTANCE_COUNT > 1U)
102 /* Implementation of CAN1 IRQ handler for OR'ed interrupts (Bus Off,
103 Transmit Warning, Receive Warning). */
104 void CAN1_ORed_IRQHandler(void)
105 {
107 }
108 
109 /* Implementation of CAN1 IRQ handler for interrupts indicating that errors were
110 detected on the CAN bus. */
111 void CAN1_Error_IRQHandler(void)
112 {
114 }
115 
116 /* Implementation of CAN1 IRQ handler for interrupts indicating a wake up
117 event. */
118 void CAN1_Wake_Up_IRQHandler(void)
119 {
120  FLEXCAN_DRV_WakeUpHandler(1);
121 }
122 
123 /* Implementation of CAN1 IRQ handler for interrupts indicating a successful
124 transmission or reception for Message Buffers 0-15. */
125 void CAN1_ORed_0_15_MB_IRQHandler(void)
126 {
128 }
129 
130 /* Implementation of CAN1 IRQ handler for interrupts indicating a successful
131 transmission or reception for Message Buffers 16-31. */
132 void CAN1_ORed_16_31_MB_IRQHandler(void)
133 {
135 }
136 #endif /* (CAN_INSTANCE_COUNT > 1U) */
137 
138 #if (CAN_INSTANCE_COUNT > 2U)
139 /* Implementation of CAN2 IRQ handler for OR'ed interrupts (Bus Off,
140 Transmit Warning, Receive Warning). */
141 void CAN2_ORed_IRQHandler(void)
142 {
144 }
145 
146 /* Implementation of CAN2 IRQ handler for interrupts indicating that errors were
147 detected on the CAN bus. */
148 void CAN2_Error_IRQHandler(void)
149 {
151 }
152 
153 /* Implementation of CAN2 IRQ handler for interrupts indicating a wake up
154 event. */
155 void CAN2_Wake_Up_IRQHandler(void)
156 {
157  FLEXCAN_DRV_WakeUpHandler(2);
158 }
159 
160 /* Implementation of CAN2 IRQ handler for interrupts indicating a successful
161 transmission or reception for Message Buffers 0-15. */
162 void CAN2_ORed_0_15_MB_IRQHandler(void)
163 {
165 }
166 
167 /* Implementation of CAN2 IRQ handler for interrupts indicating a successful
168 transmission or reception for Message Buffers 16-31. */
169 void CAN2_ORed_16_31_MB_IRQHandler(void)
170 {
172 }
173 #endif /* (CAN_INSTANCE_COUNT > 2U) */
174 
175 #elif defined(CPU_S32V234)
176 
177 /*******************************************************************************
178  * Default interrupt handlers signatures
179  ******************************************************************************/
180 void CAN0_IRQHandler(void);
181 void CAN0_Buff_IRQHandler(void);
182 #if (CAN_INSTANCE_COUNT > 1U)
183 void CAN1_IRQHandler(void);
184 void CAN1_Buff_IRQHandler(void);
185 #endif
186 
187 /*******************************************************************************
188  * Code
189  ******************************************************************************/
190 #if (CAN_INSTANCE_COUNT > 0U)
191 /* Implementation of CAN0 handler named in startup code. */
192 void CAN0_IRQHandler(void)
193 {
195 }
196 
197 /* Implementation of CAN0 handler named in startup code. */
198 void CAN0_Buff_IRQHandler(void)
199 {
201 }
202 #endif /* (CAN_INSTANCE_COUNT > 0U) */
203 
204 #if (CAN_INSTANCE_COUNT > 1U)
205 /* Implementation of CAN1 handler named in startup code. */
206 void CAN1_IRQHandler(void)
207 {
209 }
210 
211 /* Implementation of CAN1 handler named in startup code. */
212 void CAN1_Buff_IRQHandler(void)
213 {
215 }
216 #endif /* (CAN_INSTANCE_COUNT > 1U) */
217 
218 #else
219  #error "No valid CPU defined!"
220 #endif
221 
222 /*******************************************************************************
223  * EOF
224  ******************************************************************************/
225 
void CAN0_Error_IRQHandler(void)
void CAN0_ORed_0_15_MB_IRQHandler(void)
void CAN0_ORed_16_31_MB_IRQHandler(void)
void CAN0_ORed_IRQHandler(void)
void CAN0_Wake_Up_IRQHandler(void)
void FLEXCAN_DRV_IRQHandler(uint8_t instance)
Interrupt handler for a FlexCAN instance.