1 /*
2  * Copyright 2021-2024 NXP
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 /**
8 *   @file CanEXCEL_Ip_Irq.c
9 *
10 *   @addtogroup CanEXCEL
11 *   @{
12 */
13 
14 #ifdef __cplusplus
15 extern "C"{
16 #endif
17 
18 /*==================================================================================================
19 *                                        INCLUDE FILES
20 * 1) system and project includes
21 * 2) needed interfaces from external units
22 * 3) internal and external interfaces from this unit
23 ==================================================================================================*/
24 #include "CanEXCEL_Ip_Irq.h"
25 #include "CanEXCEL_Ip_HwAccess.h"
26 /*==================================================================================================
27 *                              SOURCE FILE VERSION INFORMATION
28 ==================================================================================================*/
29 #define CANEXCEL_IP_IRQ_VENDOR_ID_C                      43
30 #define CANEXCEL_IP_IRQ_AR_RELEASE_MAJOR_VERSION_C       4
31 #define CANEXCEL_IP_IRQ_AR_RELEASE_MINOR_VERSION_C       7
32 #define CANEXCEL_IP_IRQ_AR_RELEASE_REVISION_VERSION_C    0
33 #define CANEXCEL_IP_IRQ_SW_MAJOR_VERSION_C               2
34 #define CANEXCEL_IP_IRQ_SW_MINOR_VERSION_C               0
35 #define CANEXCEL_IP_IRQ_SW_PATCH_VERSION_C               0
36 /*==================================================================================================
37 *                                     FILE VERSION CHECKS
38 ==================================================================================================*/
39 /* Check if current file and CanEXCEL_Ip_Irq.h are of the same vendor */
40 #if (CANEXCEL_IP_IRQ_VENDOR_ID_C != CANEXCEL_IP_IRQ_VENDOR_ID_H)
41     #error "CanEXCEL_Ip_Irq.c and CanEXCEL_Ip_Irq.h have different vendor ids"
42 #endif
43 /* Check if current file and CanEXCEL_Ip_Irq.h are of the same Autosar version */
44 #if ((CANEXCEL_IP_IRQ_AR_RELEASE_MAJOR_VERSION_C    != CANEXCEL_IP_IRQ_AR_RELEASE_MAJOR_VERSION_H) || \
45      (CANEXCEL_IP_IRQ_AR_RELEASE_MINOR_VERSION_C    != CANEXCEL_IP_IRQ_AR_RELEASE_MINOR_VERSION_H) || \
46      (CANEXCEL_IP_IRQ_AR_RELEASE_REVISION_VERSION_C != CANEXCEL_IP_IRQ_AR_RELEASE_REVISION_VERSION_H) \
47 )
48     #error "AutoSar Version Numbers of CanEXCEL_Ip_Irq.c and CanEXCEL_Ip_Irq.h are different"
49 #endif
50 /* Check if current file and CanEXCEL_Ip_Irq.h are of the same Software version */
51 #if ((CANEXCEL_IP_IRQ_SW_MAJOR_VERSION_C != CANEXCEL_IP_IRQ_SW_MAJOR_VERSION_H) || \
52      (CANEXCEL_IP_IRQ_SW_MINOR_VERSION_C != CANEXCEL_IP_IRQ_SW_MINOR_VERSION_H) || \
53      (CANEXCEL_IP_IRQ_SW_PATCH_VERSION_C != CANEXCEL_IP_IRQ_SW_PATCH_VERSION_H) \
54 )
55     #error "Software Version Numbers of CanEXCEL_Ip_Irq.c and CanEXCEL_Ip_Irq.h are different"
56 #endif
57 
58 /* Check if current file and CanEXCEL_Ip_HwAccess.h are of the same vendor */
59 #if (CANEXCEL_IP_IRQ_VENDOR_ID_C != CANEXCEL_IP_HWACCESS_VENDOR_ID_H)
60     #error "CanEXCEL_Ip_Irq.c and CanEXCEL_Ip_HwAccess.h have different vendor ids"
61 #endif
62 /* Check if current file and CanEXCEL_Ip_HwAccess.h are of the same Autosar version */
63 #if ((CANEXCEL_IP_IRQ_AR_RELEASE_MAJOR_VERSION_C    != CANEXCEL_IP_HWACCESS_AR_RELEASE_MAJOR_VERSION_H) || \
64      (CANEXCEL_IP_IRQ_AR_RELEASE_MINOR_VERSION_C    != CANEXCEL_IP_HWACCESS_AR_RELEASE_MINOR_VERSION_H) || \
65      (CANEXCEL_IP_IRQ_AR_RELEASE_REVISION_VERSION_C != CANEXCEL_IP_HWACCESS_AR_RELEASE_REVISION_VERSION_H) \
66 )
67     #error "AutoSar Version Numbers of CanEXCEL_Ip_Irq.c and CanEXCEL_Ip_HwAccess.h are different"
68 #endif
69 /* Check if current file and CanEXCEL_Ip_HwAccess.h are of the same Software version */
70 #if ((CANEXCEL_IP_IRQ_SW_MAJOR_VERSION_C != CANEXCEL_IP_HWACCESS_SW_MAJOR_VERSION_H) || \
71      (CANEXCEL_IP_IRQ_SW_MINOR_VERSION_C != CANEXCEL_IP_HWACCESS_SW_MINOR_VERSION_H) || \
72      (CANEXCEL_IP_IRQ_SW_PATCH_VERSION_C != CANEXCEL_IP_HWACCESS_SW_PATCH_VERSION_H) \
73 )
74     #error "Software Version Numbers of CanEXCEL_Ip_Irq.c and CanEXCEL_Ip_HwAccess.h are different"
75 #endif
76 
77 /*==================================================================================================
78 *                                      DEFINES AND MACROS
79 ==================================================================================================*/
80 
81 #define CAN_43_CANEXCEL_START_SEC_CODE
82 #include "Can_43_CANEXCEL_MemMap.h"
83 
84 /* Implementation of CANEXCEL0 handler for Rx\Tx and RxFIFO and MRU */
ISR(CANXL0_RX_TX_DATA_IRQHandler)85 ISR(CANXL0_RX_TX_DATA_IRQHandler)
86 {
87     Canexcel_Ip_RxTxIRQHandler(0U);
88     if (CANXL_MRU_CH_CFG0_CHE_MASK == (IP_CANXL_0__MRU->CHXCONFIG[0u].CH_CFG0 & CANXL_MRU_CH_CFG0_CHE_MASK))
89     {
90         Canexcel_Ip_MruIRQHandler(0U);
91     }
92 }
93 /* Implementation of CANEXCEL0 Error Hw Handler*/
ISR(CANXL0_INT_ERROR_IRQHandler)94 ISR(CANXL0_INT_ERROR_IRQHandler)
95 {
96     Canexcel_Ip_ErrIRQHandler(0U);
97 }
98 
99 #if (CANXL_SIC_INSTANCE_COUNT > 1U)
100 /* Implementation of CANEXCEL1 handler for Rx\Tx and RxFIFO and MRU */
ISR(CANXL1_RX_TX_DATA_IRQHandler)101 ISR(CANXL1_RX_TX_DATA_IRQHandler)
102 {
103     Canexcel_Ip_RxTxIRQHandler(1U);
104     if (CANXL_MRU_CH_CFG0_CHE_MASK == (IP_CANXL_1__MRU->CHXCONFIG[0u].CH_CFG0 & CANXL_MRU_CH_CFG0_CHE_MASK))
105     {
106         Canexcel_Ip_MruIRQHandler(1U);
107     }
108 }
109 /* Implementation of CANEXCEL1 Error Hw Handler*/
ISR(CANXL1_INT_ERROR_IRQHandler)110 ISR(CANXL1_INT_ERROR_IRQHandler)
111 {
112     Canexcel_Ip_ErrIRQHandler(1U);
113 }
114 #endif /* (CANXL_SIC_INSTANCE_COUNT > 1U) */
115 
116 #if (CANXL_SIC_INSTANCE_COUNT > 2U)
117 /* Implementation of CANEXCEL1 handler for Rx\Tx and RxFIFO and MRU */
ISR(CANXL2_RX_TX_DATA_IRQHandler)118 ISR(CANXL2_RX_TX_DATA_IRQHandler)
119 {
120     Canexcel_Ip_RxTxIRQHandler(2U);
121     if ((IP_CANXL_2__MRU->CHXCONFIG[0u].CH_CFG0 & CANXL_MRU_CH_CFG0_CHE_MASK) == CANXL_MRU_CH_CFG0_CHE_MASK)
122     {
123         Canexcel_Ip_MruIRQHandler(2U);
124     }
125 }
126 /* Implementation of CANEXCEL1 Error Hw Handler*/
ISR(CANXL2_INT_ERROR_IRQHandler)127 ISR(CANXL2_INT_ERROR_IRQHandler)
128 {
129     Canexcel_Ip_ErrIRQHandler(2U);
130 }
131 #endif /* (CANXL_SIC_INSTANCE_COUNT > 2U) */
132 
133 #if (CANXL_SIC_INSTANCE_COUNT > 3U)
134 /* Implementation of CANEXCEL1 handler for Rx\Tx and RxFIFO and MRU */
ISR(CANXL3_RX_TX_DATA_IRQHandler)135 ISR(CANXL3_RX_TX_DATA_IRQHandler)
136 {
137     Canexcel_Ip_RxTxIRQHandler(3U);
138     if ((IP_CANXL_3__MRU->CHXCONFIG[0u].CH_CFG0 & CANXL_MRU_CH_CFG0_CHE_MASK) == CANXL_MRU_CH_CFG0_CHE_MASK)
139     {
140         Canexcel_Ip_MruIRQHandler(3U);
141     }
142 }
143 /* Implementation of CANEXCEL1 Error Hw Handler*/
ISR(CANXL3_INT_ERROR_IRQHandler)144 ISR(CANXL3_INT_ERROR_IRQHandler)
145 {
146     Canexcel_Ip_ErrIRQHandler(3U);
147 }
148 #endif /* (CANXL_SIC_INSTANCE_COUNT > 3U) */
149 
150 #define CAN_43_CANEXCEL_STOP_SEC_CODE
151 #include "Can_43_CANEXCEL_MemMap.h"
152 
153 #ifdef __cplusplus
154 }
155 #endif
156 
157 /** @} */
158