1 /* 2 * Copyright 2021-2023 NXP 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef SIUL2_ICU_IP_IRQ_H 8 #define SIUL2_ICU_IP_IRQ_H 9 10 /** 11 * @file 12 * 13 * @addtogroup siul2_icu_ip SIUL2 IPL 14 * @{ 15 */ 16 17 #ifdef __cplusplus 18 extern "C"{ 19 #endif 20 21 /*================================================================================================== 22 * INCLUDE FILES 23 * 1) system and project includes 24 * 2) needed interfaces from external units 25 * 3) internal and external interfaces from this unit 26 ==================================================================================================*/ 27 #include "OsIf.h" 28 #include "Siul2_Icu_Ip_Cfg.h" 29 #include "Siul2_Icu_Ip_Types.h" 30 31 /*================================================================================================== 32 * SOURCE FILE VERSION INFORMATION 33 ==================================================================================================*/ 34 #define SIUL2_ICU_IP_IRQ_VENDOR_ID 43 35 #define SIUL2_ICU_IP_IRQ_AR_RELEASE_MAJOR_VERSION 4 36 #define SIUL2_ICU_IP_IRQ_AR_RELEASE_MINOR_VERSION 7 37 #define SIUL2_ICU_IP_IRQ_AR_RELEASE_REVISION_VERSION 0 38 #define SIUL2_ICU_IP_IRQ_SW_MAJOR_VERSION 1 39 #define SIUL2_ICU_IP_IRQ_SW_MINOR_VERSION 0 40 #define SIUL2_ICU_IP_IRQ_SW_PATCH_VERSION 0 41 42 /*================================================================================================== 43 * FILE VERSION CHECKS 44 ==================================================================================================*/ 45 #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK 46 /* Check if header file and OsIf.h file are of the same Autosar version */ 47 #if ((SIUL2_ICU_IP_IRQ_AR_RELEASE_MAJOR_VERSION != OSIF_AR_RELEASE_MAJOR_VERSION) || \ 48 (SIUL2_ICU_IP_IRQ_AR_RELEASE_MINOR_VERSION != OSIF_AR_RELEASE_MINOR_VERSION)) 49 #error "AutoSar Version Numbers of Siul2_Icu_Ip_Irq.h and OsIf.h are different" 50 #endif 51 #endif 52 53 /* Check if source file and ICU header file are of the same vendor */ 54 #if (SIUL2_ICU_IP_IRQ_VENDOR_ID != SIUL2_ICU_IP_TYPES_VENDOR_ID) 55 #error "Siul2_Icu_Ip_Irq.h and Siul2_Icu_Ip_Types.h have different vendor IDs" 56 #endif 57 /* Check if source file and ICU header file are of the same AutoSar version */ 58 #if ((SIUL2_ICU_IP_IRQ_AR_RELEASE_MAJOR_VERSION != SIUL2_ICU_IP_TYPES_AR_RELEASE_MAJOR_VERSION) || \ 59 (SIUL2_ICU_IP_IRQ_AR_RELEASE_MINOR_VERSION != SIUL2_ICU_IP_TYPES_AR_RELEASE_MINOR_VERSION) || \ 60 (SIUL2_ICU_IP_IRQ_AR_RELEASE_REVISION_VERSION != SIUL2_ICU_IP_TYPES_AR_RELEASE_REVISION_VERSION)) 61 #error "AutoSar Version Numbers of Siul2_Icu_Ip_Irq.h and Siul2_Icu_Ip_Types.h are different" 62 #endif 63 /* Check if source file and ICU header file are of the same Software version */ 64 #if ((SIUL2_ICU_IP_IRQ_SW_MAJOR_VERSION != SIUL2_ICU_IP_TYPES_SW_MAJOR_VERSION) || \ 65 (SIUL2_ICU_IP_IRQ_SW_MINOR_VERSION != SIUL2_ICU_IP_TYPES_SW_MINOR_VERSION) || \ 66 (SIUL2_ICU_IP_IRQ_SW_PATCH_VERSION != SIUL2_ICU_IP_TYPES_SW_PATCH_VERSION)) 67 #error "Software Version Numbers of Siul2_Icu_Ip_Irq.h and Siul2_Icu_Ip_Types.h are different" 68 #endif 69 70 /* Check if source file and ICU header file are of the same vendor */ 71 #if (SIUL2_ICU_IP_IRQ_VENDOR_ID != SIUL2_ICU_IP_CFG_VENDOR_ID) 72 #error "Siul2_Icu_Ip_Irq.h and Siul2_Icu_Ip_Cfg.h have different vendor IDs" 73 #endif 74 /* Check if source file and ICU header file are of the same AutoSar version */ 75 #if ((SIUL2_ICU_IP_IRQ_AR_RELEASE_MAJOR_VERSION != SIUL2_ICU_IP_CFG_AR_RELEASE_MAJOR_VERSION) || \ 76 (SIUL2_ICU_IP_IRQ_AR_RELEASE_MINOR_VERSION != SIUL2_ICU_IP_CFG_AR_RELEASE_MINOR_VERSION) || \ 77 (SIUL2_ICU_IP_IRQ_AR_RELEASE_REVISION_VERSION != SIUL2_ICU_IP_CFG_AR_RELEASE_REVISION_VERSION)) 78 #error "AutoSar Version Numbers of Siul2_Icu_Ip_Irq.h and Siul2_Icu_Ip_Cfg.h are different" 79 #endif 80 /* Check if source file and ICU header file are of the same Software version */ 81 #if ((SIUL2_ICU_IP_IRQ_SW_MAJOR_VERSION != SIUL2_ICU_IP_CFG_SW_MAJOR_VERSION) || \ 82 (SIUL2_ICU_IP_IRQ_SW_MINOR_VERSION != SIUL2_ICU_IP_CFG_SW_MINOR_VERSION) || \ 83 (SIUL2_ICU_IP_IRQ_SW_PATCH_VERSION != SIUL2_ICU_IP_CFG_SW_PATCH_VERSION)) 84 #error "Software Version Numbers of Siul2_Icu_Ip_Irq.h and Siul2_Icu_Ip_Cfg.h are different" 85 #endif 86 87 #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK 88 /* Check if this header file and OsIf.h file are of the same Autosar version */ 89 #if ((SIUL2_ICU_IP_IRQ_AR_RELEASE_MAJOR_VERSION != OSIF_AR_RELEASE_MAJOR_VERSION) || \ 90 (SIUL2_ICU_IP_IRQ_AR_RELEASE_MINOR_VERSION != OSIF_AR_RELEASE_MINOR_VERSION)) 91 #error "AutoSar Version Numbers of Siul2_Icu_Ip_Irq.h and OsIf.h are different" 92 #endif 93 #endif 94 95 /*================================================================================================== 96 * CONSTANTS 97 ==================================================================================================*/ 98 99 /*================================================================================================== 100 * DEFINES AND MACROS 101 ==================================================================================================*/ 102 #if (STD_ON == SIUL2_ICU_IP_USED) 103 104 /** @brief SIUL2 External Interrupt Channels defines. */ 105 #if ((defined SIUL2_ICU_IRQ_CH_0_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_1_ISR_USED) ||\ 106 (defined SIUL2_ICU_IRQ_CH_2_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_3_ISR_USED) ||\ 107 (defined SIUL2_ICU_IRQ_CH_4_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_5_ISR_USED) ||\ 108 (defined SIUL2_ICU_IRQ_CH_6_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_7_ISR_USED)) 109 110 #define SIUL2_ICU_IRQ_0 ((uint8) 0U) 111 112 #endif 113 114 #if ((defined SIUL2_ICU_IRQ_CH_8_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_9_ISR_USED) ||\ 115 (defined SIUL2_ICU_IRQ_CH_10_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_11_ISR_USED) ||\ 116 (defined SIUL2_ICU_IRQ_CH_12_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_13_ISR_USED) ||\ 117 (defined SIUL2_ICU_IRQ_CH_14_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_15_ISR_USED)) 118 119 #define SIUL2_ICU_IRQ_8 ((uint8) 8U) 120 121 #endif 122 123 #if ((defined SIUL2_ICU_IRQ_CH_16_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_17_ISR_USED) || \ 124 (defined SIUL2_ICU_IRQ_CH_18_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_19_ISR_USED) || \ 125 (defined SIUL2_ICU_IRQ_CH_20_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_21_ISR_USED) || \ 126 (defined SIUL2_ICU_IRQ_CH_22_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_23_ISR_USED)) 127 128 #define SIUL2_ICU_IRQ_16 ((uint8)16U) 129 130 #endif 131 132 #if ((defined SIUL2_ICU_IRQ_CH_24_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_25_ISR_USED) || \ 133 (defined SIUL2_ICU_IRQ_CH_26_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_27_ISR_USED) || \ 134 (defined SIUL2_ICU_IRQ_CH_28_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_29_ISR_USED) || \ 135 (defined SIUL2_ICU_IRQ_CH_30_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_31_ISR_USED)) 136 137 #define SIUL2_ICU_IRQ_24 ((uint8)24U) 138 139 #endif 140 141 /*================================================================================================== 142 * ENUMS 143 ==================================================================================================*/ 144 145 /*================================================================================================== 146 * STRUCTURES AND OTHER TYPEDEFS 147 ==================================================================================================*/ 148 149 /*================================================================================================== 150 * GLOBAL VARIABLE DECLARATIONS 151 ==================================================================================================*/ 152 153 /*================================================================================================== 154 * FUNCTION PROTOTYPES 155 ==================================================================================================*/ 156 #define ICU_START_SEC_CODE 157 #include "Icu_MemMap.h" 158 159 #if (defined(SIUL2_0_ICU_EIRQ_SINGLE_INT)) 160 /** 161 * @brief Interrupt handler for SIUL2 instance 0. 162 * @details Process the interrupt of SIUL2 instance 0. 163 * @isr 164 * @note This will be defined only if the single interrupt mode is configured. 165 */ 166 ISR(SIUL2_0_ICU_EIRQ_SINGLE_INT_HANDLER); 167 #endif /* SIUL2_0_ICU_EIRQ_SINGLE_INT */ 168 169 #if (defined(SIUL2_1_ICU_EIRQ_SINGLE_INT)) 170 /** 171 * @brief Interrupt handler for SIUL2 instance 1. 172 * @details Process the interrupt of SIUL2 instance 1. 173 * @isr 174 * @note This will be defined only if the single interrupt mode is configured. 175 */ 176 ISR(SIUL2_1_ICU_EIRQ_SINGLE_INT_HANDLER); 177 #endif /* SIUL2_1_ICU_EIRQ_SINGLE_INT */ 178 179 #if (defined(SIUL2_4_ICU_EIRQ_SINGLE_INT)) 180 /** 181 * @brief Interrupt handler for SIUL2 instance 4. 182 * @details Process the interrupt of SIUL2 instance 4. 183 * @isr 184 * @note This will be defined only if the single interrupt mode is configured. 185 */ 186 ISR(SIUL2_4_ICU_EIRQ_SINGLE_INT_HANDLER); 187 #endif /* SIUL2_4_ICU_EIRQ_SINGLE_INT */ 188 189 #if (defined(SIUL2_5_ICU_EIRQ_SINGLE_INT)) 190 /** 191 * @brief Interrupt handler for SIUL2 instance 5. 192 * @details Process the interrupt of SIUL2 instance 5. 193 * @isr 194 * @note This will be defined only if the single interrupt mode is configured. 195 */ 196 ISR(SIUL2_5_ICU_EIRQ_SINGLE_INT_HANDLER); 197 #endif /* SIUL2_5_ICU_EIRQ_SINGLE_INT */ 198 199 #if (defined(SIUL2_AE_ICU_EIRQ_SINGLE_INT)) 200 /** 201 * @brief Interrupt handler for SIUL2 instance AE. 202 * @details Process the interrupt of SIUL2 instance AE. 203 * @isr 204 * @note This will be defined only if the single interrupt mode is configured. 205 */ 206 ISR(SIUL2_AE_ICU_EIRQ_SINGLE_INT_HANDLER); 207 #endif /* SIUL2_AE_ICU_EIRQ_SINGLE_INT */ 208 209 #if ((defined SIUL2_ICU_IRQ_CH_0_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_1_ISR_USED) ||\ 210 (defined SIUL2_ICU_IRQ_CH_2_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_3_ISR_USED) ||\ 211 (defined SIUL2_ICU_IRQ_CH_4_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_5_ISR_USED) ||\ 212 (defined SIUL2_ICU_IRQ_CH_6_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_7_ISR_USED)) 213 /** 214 * @brief Interrupt handler for SIUL2 channels: 0 to 7 215 * @details Process the interrupt of SIUL2 channels: 0 to 7 216 * 217 * @note This will be defined only if any of SIUL2 channels 0 to 7 is configured. 218 */ 219 ISR(SIUL2_EXT_IRQ_0_7_ISR); 220 #endif 221 222 #if ((defined SIUL2_ICU_IRQ_CH_8_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_9_ISR_USED) ||\ 223 (defined SIUL2_ICU_IRQ_CH_10_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_11_ISR_USED) ||\ 224 (defined SIUL2_ICU_IRQ_CH_12_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_13_ISR_USED) ||\ 225 (defined SIUL2_ICU_IRQ_CH_14_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_15_ISR_USED)) 226 /** 227 * @brief Interrupt handler for SIUL2 channels: 8 to 15. 228 * @details Process the interrupt of SIUL2 channels 8 to 15. 229 * 230 * @note This will be defined only if any of SIUL channels 8 to 15 is configured. 231 */ 232 ISR(SIUL2_EXT_IRQ_8_15_ISR); 233 #endif 234 235 #if ((defined SIUL2_ICU_IRQ_CH_16_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_17_ISR_USED) || \ 236 (defined SIUL2_ICU_IRQ_CH_18_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_19_ISR_USED) || \ 237 (defined SIUL2_ICU_IRQ_CH_20_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_21_ISR_USED) || \ 238 (defined SIUL2_ICU_IRQ_CH_22_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_23_ISR_USED)) 239 /** 240 * @brief Interrupt handler for SIUL2 channels: 16 to 23. 241 * @details Process the interrupt of SIUL2 channels 16 to 23. 242 * 243 * @note This will be defined only if any of SIUL2 channels 16 to 23 was configured. 244 */ 245 ISR(SIUL2_EXT_IRQ_16_23_ISR); 246 #endif 247 248 #if ((defined SIUL2_ICU_IRQ_CH_24_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_25_ISR_USED) || \ 249 (defined SIUL2_ICU_IRQ_CH_26_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_27_ISR_USED) || \ 250 (defined SIUL2_ICU_IRQ_CH_28_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_29_ISR_USED) || \ 251 (defined SIUL2_ICU_IRQ_CH_30_ISR_USED) || (defined SIUL2_ICU_IRQ_CH_31_ISR_USED)) 252 /** 253 * @brief Interrupt handler for SIUL2 channels: 24 to 31. 254 * @details Process the interrupt of SIUL2 channels 24 to 31 255 * 256 * @note This will be defined only if any of SIUL2 channels 24 to 31 was configured. 257 */ 258 ISR(SIUL2_EXT_IRQ_24_31_ISR); 259 #endif 260 261 #define ICU_STOP_SEC_CODE 262 #include "Icu_MemMap.h" 263 264 #endif /* SIUL2_ICU_IP_USED */ 265 266 #ifdef __cplusplus 267 } 268 #endif 269 270 /** @} */ 271 272 #endif /* SIUL2_ICU_IP_H */ 273