1 /* 2 * Copyright 2020-2023 NXP 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 /** 7 * @file Power_Ip_PMC_Irq.c 8 * @version 3.0.0 9 * 10 * @brief 11 * @brief POWER driver implementations. 12 * @details POWER driver implementations. 13 * 14 * @addtogroup POWER_DRIVER Power Ip Driver 15 * @{ 16 */ 17 18 19 #ifdef __cplusplus 20 extern "C"{ 21 #endif 22 23 24 25 /*================================================================================================== 26 * INCLUDE FILES 27 * 1) system and project includes 28 * 2) needed interfaces from external units 29 * 3) internal and external interfaces from this unit 30 ==================================================================================================*/ 31 #include "Power_Ip_Cfg.h" 32 #include "Power_Ip_PMC.h" 33 34 /*================================================================================================== 35 SOURCE FILE VERSION INFORMATION 36 ==================================================================================================*/ 37 #define POWER_IP_PMC_IRQ_VENDOR_ID_C 43 38 #define POWER_IP_PMC_IRQ_AR_RELEASE_MAJOR_VERSION_C 4 39 #define POWER_IP_PMC_IRQ_AR_RELEASE_MINOR_VERSION_C 7 40 #define POWER_IP_PMC_IRQ_AR_RELEASE_REVISION_VERSION_C 0 41 #define POWER_IP_PMC_IRQ_SW_MAJOR_VERSION_C 3 42 #define POWER_IP_PMC_IRQ_SW_MINOR_VERSION_C 0 43 #define POWER_IP_PMC_IRQ_SW_PATCH_VERSION_C 0 44 45 /*================================================================================================== 46 * FILE VERSION CHECKS 47 ==================================================================================================*/ 48 /* Check if Power_Ip_PMC_Irq.c file and Power_Ip_Cfg.h file are of the same vendor */ 49 #if (POWER_IP_PMC_IRQ_VENDOR_ID_C != POWER_IP_CFG_VENDOR_ID) 50 #error "Power_Ip_PMC_Irq.c and Power_Ip_Cfg.h have different vendor ids" 51 #endif 52 53 /* Check if Power_Ip_PMC_Irq.c file and Power_Ip_Cfg.h file are of the same Autosar version */ 54 #if ((POWER_IP_PMC_IRQ_AR_RELEASE_MAJOR_VERSION_C != POWER_IP_CFG_AR_RELEASE_MAJOR_VERSION) || \ 55 (POWER_IP_PMC_IRQ_AR_RELEASE_MINOR_VERSION_C != POWER_IP_CFG_AR_RELEASE_MINOR_VERSION) || \ 56 (POWER_IP_PMC_IRQ_AR_RELEASE_REVISION_VERSION_C != POWER_IP_CFG_AR_RELEASE_REVISION_VERSION) \ 57 ) 58 #error "AutoSar Version Numbers of Power_Ip_PMC_Irq.c and Power_Ip_Cfg.h are different" 59 #endif 60 61 /* Check if Power_Ip_PMC_Irq.c file and Power_Ip_Cfg.h file are of the same Software version */ 62 #if ((POWER_IP_PMC_IRQ_SW_MAJOR_VERSION_C != POWER_IP_CFG_SW_MAJOR_VERSION) || \ 63 (POWER_IP_PMC_IRQ_SW_MINOR_VERSION_C != POWER_IP_CFG_SW_MINOR_VERSION) || \ 64 (POWER_IP_PMC_IRQ_SW_PATCH_VERSION_C != POWER_IP_CFG_SW_PATCH_VERSION) \ 65 ) 66 #error "Software Version Numbers of Power_Ip_PMC_Irq.c and Power_Ip_Cfg.h are different" 67 #endif 68 69 /* Check if Power_Ip_PMC_Irq.c file and Power_Ip_PMC.h file are of the same vendor */ 70 #if (POWER_IP_PMC_IRQ_VENDOR_ID_C != POWER_IP_PMC_VENDOR_ID) 71 #error "Power_Ip_PMC_Irq.c and Power_Ip_PMC.h have different vendor ids" 72 #endif 73 74 /* Check if Power_Ip_PMC_Irq.c file and Power_Ip_PMC.h file are of the same Autosar version */ 75 #if ((POWER_IP_PMC_IRQ_AR_RELEASE_MAJOR_VERSION_C != POWER_IP_PMC_AR_RELEASE_MAJOR_VERSION) || \ 76 (POWER_IP_PMC_IRQ_AR_RELEASE_MINOR_VERSION_C != POWER_IP_PMC_AR_RELEASE_MINOR_VERSION) || \ 77 (POWER_IP_PMC_IRQ_AR_RELEASE_REVISION_VERSION_C != POWER_IP_PMC_AR_RELEASE_REVISION_VERSION) \ 78 ) 79 #error "AutoSar Version Numbers of Power_Ip_PMC_Irq.c and Power_Ip_PMC.h are different" 80 #endif 81 82 /* Check if Power_Ip_PMC_Irq.c file and Power_Ip_PMC.h file are of the same Software version */ 83 #if ((POWER_IP_PMC_IRQ_SW_MAJOR_VERSION_C != POWER_IP_PMC_SW_MAJOR_VERSION) || \ 84 (POWER_IP_PMC_IRQ_SW_MINOR_VERSION_C != POWER_IP_PMC_SW_MINOR_VERSION) || \ 85 (POWER_IP_PMC_IRQ_SW_PATCH_VERSION_C != POWER_IP_PMC_SW_PATCH_VERSION) \ 86 ) 87 #error "Software Version Numbers of Power_Ip_PMC_Irq.c and Power_Ip_PMC.h are different" 88 #endif 89 /*================================================================================================== 90 LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS) 91 ==================================================================================================*/ 92 93 94 /*================================================================================================== 95 LOCAL MACROS 96 ==================================================================================================*/ 97 98 99 /*================================================================================================== 100 LOCAL CONSTANTS 101 ==================================================================================================*/ 102 103 104 /*================================================================================================== 105 LOCAL VARIABLES 106 ==================================================================================================*/ 107 108 /*================================================================================================== 109 GLOBAL CONSTANTS 110 ==================================================================================================*/ 111 112 113 /*================================================================================================== 114 GLOBAL VARIABLES 115 ==================================================================================================*/ 116 117 118 /*================================================================================================== 119 LOCAL FUNCTION PROTOTYPES 120 ==================================================================================================*/ 121 #define MCU_START_SEC_CODE 122 #include "Mcu_MemMap.h" 123 124 #ifdef POWER_IP_VOLTAGE_ERROR_ISR_USED 125 #if (POWER_IP_VOLTAGE_ERROR_ISR_USED == STD_ON) 126 127 ISR(PMC_VoltageError_IRQHandler); 128 #if (defined(POWER_IP_PMCAECONFIG_API) && (STD_ON == POWER_IP_PMCAECONFIG_API)) 129 ISR(Power_Ip_PMC_AE_VoltageDetectHvdOnVddintVdd15_ISR); 130 ISR(Power_Ip_PMC_AE_VoltageDetectHvdOnVdd_ISR); 131 ISR(Power_Ip_PMC_AE_VoltageDetectLvdOnVddc_ISR); 132 ISR(Power_Ip_PMC_AE_VoltageDetectLvdOnVls_ISR); 133 #endif 134 /*================================================================================================== 135 LOCAL FUNCTIONS 136 ==================================================================================================*/ 137 138 139 /*================================================================================================== 140 GLOBAL FUNCTIONS 141 ==================================================================================================*/ 142 143 /** 144 * @brief This function handles the voltage error detection. 145 * 146 */ ISR(PMC_VoltageError_IRQHandler)147ISR(PMC_VoltageError_IRQHandler) 148 { 149 Power_Ip_PMC_VoltageErrorIsr(); 150 EXIT_INTERRUPT(); 151 } 152 153 #if (defined(POWER_IP_PMCAECONFIG_API) && (STD_ON == POWER_IP_PMCAECONFIG_API)) 154 /** 155 * @brief This function represents the ISR handler for PMC_AE related events. 156 * @details This interrupt is triggered if one of the enabled PMC_AE's detect an out of range clock. 157 * 158 * 159 * @isr 160 * 161 */ ISR(Power_Ip_PMC_AE_VoltageDetectHvdOnVddintVdd15_ISR)162ISR(Power_Ip_PMC_AE_VoltageDetectHvdOnVddintVdd15_ISR) 163 { 164 Power_Ip_PMC_AE_VoltageDetectHvdOnVddintVdd15Isr(); 165 EXIT_INTERRUPT(); 166 } 167 ISR(Power_Ip_PMC_AE_VoltageDetectHvdOnVdd_ISR)168ISR(Power_Ip_PMC_AE_VoltageDetectHvdOnVdd_ISR) 169 { 170 Power_Ip_PMC_AE_VoltageDetectHvdOnVddIsr(); 171 EXIT_INTERRUPT(); 172 } 173 ISR(Power_Ip_PMC_AE_VoltageDetectLvdOnVddc_ISR)174ISR(Power_Ip_PMC_AE_VoltageDetectLvdOnVddc_ISR) 175 { 176 Power_Ip_PMC_AE_VoltageDetectLvdOnVddcIsr(); 177 EXIT_INTERRUPT(); 178 } 179 ISR(Power_Ip_PMC_AE_VoltageDetectLvdOnVls_ISR)180ISR(Power_Ip_PMC_AE_VoltageDetectLvdOnVls_ISR) 181 { 182 Power_Ip_PMC_AE_VoltageDetectLvdOnVlsIsr(); 183 EXIT_INTERRUPT(); 184 } 185 #endif 186 187 #endif /* (POWER_IP_VOLTAGE_ERROR_ISR_USED == STD_ON) */ 188 #endif /* POWER_IP_VOLTAGE_ERROR_ISR_USED */ 189 190 #define MCU_STOP_SEC_CODE 191 #include "Mcu_MemMap.h" 192 193 194 #ifdef __cplusplus 195 } 196 #endif 197 198 /** @} */ 199 200