1 /*
2  * Copyright 2020-2023 NXP
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef WKPU_IP_IRQ_H
8 #define WKPU_IP_IRQ_H
9 
10 /**
11  *     @file
12  *
13  *     @addtogroup wkpu_icu_ip WKPU IPL
14  *     @{
15  */
16 
17 #ifdef __cplusplus
18 extern "C"{
19 #endif
20 
21 
22 /*==================================================================================================
23 *                                          INCLUDE FILES
24 *  1) system and project includes
25 *  2) needed interfaces from external units
26 *  3) internal and external interfaces from this unit
27 ==================================================================================================*/
28 #include "OsIf.h"
29 #include "Wkpu_Ip_Cfg.h"
30 #include "Wkpu_Ip_Types.h"
31 
32 /*==================================================================================================
33 *                                SOURCE FILE VERSION INFORMATION
34 ==================================================================================================*/
35 
36 #define WKPU_IP_IRQ_VENDOR_ID                      43
37 
38 #define WKPU_IP_IRQ_AR_RELEASE_MAJOR_VERSION       4
39 #define WKPU_IP_IRQ_AR_RELEASE_MINOR_VERSION       7
40 #define WKPU_IP_IRQ_AR_RELEASE_REVISION_VERSION    0
41 
42 #define WKPU_IP_IRQ_SW_MAJOR_VERSION               3
43 #define WKPU_IP_IRQ_SW_MINOR_VERSION               0
44 #define WKPU_IP_IRQ_SW_PATCH_VERSION               0
45 
46 /*==================================================================================================
47 *                                       FILE VERSION CHECKS
48 ==================================================================================================*/
49 /* TO DO Check if header file and OsIf.h file are of the same Autosar version */
50 
51 /* Check if source file and ICU header file are of the same vendor */
52 #if (WKPU_IP_IRQ_VENDOR_ID != WKPU_IP_CFG_VENDOR_ID)
53     #error "Wkpu_Ip_Irq.h and Wkpu_Ip_Cfg.h have different vendor IDs"
54 #endif
55 /* Check if source file and ICU header file are of the same AutoSar version */
56 #if ((WKPU_IP_IRQ_AR_RELEASE_MAJOR_VERSION  != WKPU_IP_CFG_AR_RELEASE_MAJOR_VERSION) || \
57      (WKPU_IP_IRQ_AR_RELEASE_MINOR_VERSION  != WKPU_IP_CFG_AR_RELEASE_MINOR_VERSION) || \
58      (WKPU_IP_IRQ_AR_RELEASE_REVISION_VERSION   != WKPU_IP_CFG_AR_RELEASE_REVISION_VERSION))
59     #error "AutoSar Version Numbers of Wkpu_Ip_Irq.h and Wkpu_Ip_Cfg.h are different"
60 #endif
61 /* Check if source file and ICU header file are of the same Software version */
62 #if ((WKPU_IP_IRQ_SW_MAJOR_VERSION  != WKPU_IP_CFG_SW_MAJOR_VERSION) || \
63      (WKPU_IP_IRQ_SW_MINOR_VERSION  != WKPU_IP_CFG_SW_MINOR_VERSION) || \
64      (WKPU_IP_IRQ_SW_PATCH_VERSION  != WKPU_IP_CFG_SW_PATCH_VERSION))
65 #error "Software Version Numbers of Wkpu_Ip_Irq.h and Wkpu_Ip_Cfg.h are different"
66 #endif
67 
68 /* Check if source file and ICU header file are of the same vendor */
69 #if (WKPU_IP_IRQ_VENDOR_ID != WKPU_IP_TYPES_VENDOR_ID)
70     #error "Wkpu_Ip_Irq.h and Wkpu_Ip_Types.h have different vendor IDs"
71 #endif
72 /* Check if source file and ICU header file are of the same AutoSar version */
73 #if ((WKPU_IP_IRQ_AR_RELEASE_MAJOR_VERSION  != WKPU_IP_TYPES_AR_RELEASE_MAJOR_VERSION) || \
74      (WKPU_IP_IRQ_AR_RELEASE_MINOR_VERSION  != WKPU_IP_TYPES_AR_RELEASE_MINOR_VERSION) || \
75      (WKPU_IP_IRQ_AR_RELEASE_REVISION_VERSION   != WKPU_IP_TYPES_AR_RELEASE_REVISION_VERSION))
76     #error "AutoSar Version Numbers of Wkpu_Ip_Irq.h and Wkpu_Ip_Types.h are different"
77 #endif
78 /* Check if source file and ICU header file are of the same Software version */
79 #if ((WKPU_IP_IRQ_SW_MAJOR_VERSION  != WKPU_IP_TYPES_SW_MAJOR_VERSION) || \
80      (WKPU_IP_IRQ_SW_MINOR_VERSION  != WKPU_IP_TYPES_SW_MINOR_VERSION) || \
81      (WKPU_IP_IRQ_SW_PATCH_VERSION  != WKPU_IP_TYPES_SW_PATCH_VERSION))
82 #error "Software Version Numbers of Wkpu_Ip_Irq.h and Wkpu_Ip_Types.h are different"
83 #endif
84 
85 #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
86     /* Check if this header file and OsIf.h file are of the same Autosar version */
87     #if ((WKPU_IP_IRQ_AR_RELEASE_MAJOR_VERSION != OSIF_AR_RELEASE_MAJOR_VERSION) || \
88         (WKPU_IP_IRQ_AR_RELEASE_MINOR_VERSION != OSIF_AR_RELEASE_MINOR_VERSION))
89         #error "AutoSar Version Numbers of Wkpu_Ip_Irq.h and OsIf.h are different"
90     #endif
91 #endif
92 /*==================================================================================================
93 *                                            CONSTANTS
94 ==================================================================================================*/
95 
96 /*==================================================================================================
97 *                                        DEFINES AND MACROS
98 ==================================================================================================*/
99 
100 /*==================================================================================================
101 *                                              ENUMS
102 ==================================================================================================*/
103 
104 /*==================================================================================================
105 *                                  STRUCTURES AND OTHER TYPEDEFS
106 ==================================================================================================*/
107 
108 /*==================================================================================================
109 *                                  GLOBAL VARIABLE DECLARATIONS
110 ==================================================================================================*/
111 
112 
113 /*==================================================================================================
114 *                                      FUNCTION PROTOTYPES
115 ==================================================================================================*/
116 #if (STD_ON == WKPU_IP_USED)
117 
118 #define ICU_START_SEC_CODE
119 #include "Icu_MemMap.h"
120 
121 #ifdef WKPU_IP_SUPPORT_INTERRUPT_REQUEST
122 
123 #if (defined(WKPU_ICU_SINGLE_INTERRUPT) && (WKPU_ICU_SINGLE_INTERRUPT == STD_ON))
124 
125 /**
126  * @brief     Interrupt handler for WKPU channels: 0 to 31.
127  * @details   Process the interrupt of WKPU channels 0 to 31 for platforms with only one interrupt line.
128  *
129  * @remarks   This will be defined only if any of WKPU channels 0 to 31 are configured.
130  */
131 ISR(WKPU_EXT_IRQ_SINGLE_ISR);
132 #endif /*defined WKPU_ICU_SINGLE_INTERRUPT*/
133 
134 #endif /* #ifdef WKPU_IP_SUPPORT_INTERRUPT_REQUEST */
135 
136 #define ICU_STOP_SEC_CODE
137 #include "Icu_MemMap.h"
138 
139 #endif /* WKPU_IP_USED */
140 
141 #ifdef __cplusplus
142 }
143 #endif
144 
145 /**@}*/
146 
147 #endif  /* WKPU_IP_IRQ_H */
148