1 /*
2  * Copyright 2021-2024 NXP
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 /**
7 *   @file       Clock_Ip_Irq.c
8 *   @version    2.0.0
9 *
10 *   @brief   CLOCK driver implementations.
11 *   @details CLOCK driver implementations.
12 *
13 *   @addtogroup CLOCK_DRIVER Clock Ip Driver
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 "Clock_Ip_Private.h"
29 
30 /*==================================================================================================
31                                SOURCE FILE VERSION INFORMATION
32 ==================================================================================================*/
33 #define CLOCK_IP_IRQ_VENDOR_ID_C                      43
34 #define CLOCK_IP_IRQ_AR_RELEASE_MAJOR_VERSION_C       4
35 #define CLOCK_IP_IRQ_AR_RELEASE_MINOR_VERSION_C       7
36 #define CLOCK_IP_IRQ_AR_RELEASE_REVISION_VERSION_C    0
37 #define CLOCK_IP_IRQ_SW_MAJOR_VERSION_C               2
38 #define CLOCK_IP_IRQ_SW_MINOR_VERSION_C               0
39 #define CLOCK_IP_IRQ_SW_PATCH_VERSION_C               0
40 
41 /*==================================================================================================
42 *                                     FILE VERSION CHECKS
43 ==================================================================================================*/
44 /* Check if Clock_Ip_Irq.c file and Clock_Ip_Private.h file are of the same vendor */
45 #if (CLOCK_IP_IRQ_VENDOR_ID_C != CLOCK_IP_PRIVATE_VENDOR_ID)
46     #error "Clock_Ip_Irq.c and Clock_Ip_Private.h have different vendor ids"
47 #endif
48 
49 /* Check if Clock_Ip_Irq.c file and Clock_Ip_Private.h file are of the same Autosar version */
50 #if ((CLOCK_IP_IRQ_AR_RELEASE_MAJOR_VERSION_C != CLOCK_IP_PRIVATE_AR_RELEASE_MAJOR_VERSION) || \
51      (CLOCK_IP_IRQ_AR_RELEASE_MINOR_VERSION_C != CLOCK_IP_PRIVATE_AR_RELEASE_MINOR_VERSION) || \
52      (CLOCK_IP_IRQ_AR_RELEASE_REVISION_VERSION_C != CLOCK_IP_PRIVATE_AR_RELEASE_REVISION_VERSION) \
53     )
54     #error "AutoSar Version Numbers of Clock_Ip_Irq.c and Clock_Ip_Private.h are different"
55 #endif
56 
57 /* Check if Clock_Ip_Irq.c file and Clock_Ip_Private.h file are of the same Software version */
58 #if ((CLOCK_IP_IRQ_SW_MAJOR_VERSION_C != CLOCK_IP_PRIVATE_SW_MAJOR_VERSION) || \
59      (CLOCK_IP_IRQ_SW_MINOR_VERSION_C != CLOCK_IP_PRIVATE_SW_MINOR_VERSION) || \
60      (CLOCK_IP_IRQ_SW_PATCH_VERSION_C != CLOCK_IP_PRIVATE_SW_PATCH_VERSION) \
61     )
62     #error "Software Version Numbers of Clock_Ip_Irq.c and Clock_Ip_Private.h are different"
63 #endif
64 /*==================================================================================================
65 *                           LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)
66 ==================================================================================================*/
67 
68 /*==================================================================================================
69 *                                          LOCAL MACROS
70 ==================================================================================================*/
71 
72 /*==================================================================================================
73 *                                         LOCAL CONSTANTS
74 ==================================================================================================*/
75 
76 /*==================================================================================================
77 *                                         LOCAL VARIABLES
78 ==================================================================================================*/
79 
80 /*==================================================================================================
81 *                                    LOCAL FUNCTION PROTOTYPES
82 ==================================================================================================*/
83 
84 /*==================================================================================================
85 *                                        GLOBAL CONSTANTS
86 ==================================================================================================*/
87 
88 /*==================================================================================================
89 *                                        GLOBAL VARIABLES
90 ==================================================================================================*/
91 
92 /*==================================================================================================
93 *                                    GLOBAL FUNCTION PROTOTYPES
94 ==================================================================================================*/
95 #define MCU_START_SEC_CODE
96 
97 #include "Mcu_MemMap.h"
98 
99 #if CLOCK_IP_CMU_INSTANCES_ARRAY_SIZE > 0U
100 
101 ISR(Mcu_Cmu_ClockFail_IRQHandler);
102 
103 #endif
104 
105 #define MCU_STOP_SEC_CODE
106 
107 #include "Mcu_MemMap.h"
108 
109 /*==================================================================================================
110 *                                         LOCAL FUNCTIONS
111 ==================================================================================================*/
112 
113 /*==================================================================================================
114 *                                        GLOBAL FUNCTIONS
115 ==================================================================================================*/
116 #define MCU_START_SEC_CODE
117 
118 #include "Mcu_MemMap.h"
119 #if CLOCK_IP_CMU_INSTANCES_ARRAY_SIZE > 0U
120 
121 /**
122 * @brief        This function clear the CMU interrupt flag from CMU module.
123 * @details      Called by RGM ISR routine when a user notification for CMU FCCU events is configured
124 *
125 * @return       void
126 *
127 */
ISR(Mcu_Cmu_ClockFail_IRQHandler)128 ISR(Mcu_Cmu_ClockFail_IRQHandler)
129 {
130     Clock_Ip_CMU_ClockFailInt();
131     EXIT_INTERRUPT();
132 }
133 #endif
134 
135 #define MCU_STOP_SEC_CODE
136 
137 #include "Mcu_MemMap.h"
138 
139 #ifdef __cplusplus
140 }
141 #endif
142 
143 /** @} */
144