1 /* 2 * Copyright 2020-2023 NXP 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef POWER_IP_PMC_H 8 #define POWER_IP_PMC_H 9 10 /** 11 * @file Power_Ip_PMC.h 12 * @version 3.0.0 13 * 14 * @brief POWER IP driver header file. 15 * @details POWER IP driver header file. 16 * 17 * @addtogroup POWER_DRIVER Power Ip Driver 18 * @{ 19 */ 20 21 #ifdef __cplusplus 22 extern "C"{ 23 #endif 24 25 26 27 /*================================================================================================== 28 INCLUDE FILES 29 1) system and project includes 30 2) needed interfaces from external units 31 3) internal and external interfaces from this unit 32 ==================================================================================================*/ 33 #include "Power_Ip_Types.h" 34 #include "StandardTypes.h" 35 #include "Mcal.h" 36 37 /*================================================================================================== 38 SOURCE FILE VERSION INFORMATION 39 ==================================================================================================*/ 40 #define POWER_IP_PMC_VENDOR_ID 43 41 #define POWER_IP_PMC_AR_RELEASE_MAJOR_VERSION 4 42 #define POWER_IP_PMC_AR_RELEASE_MINOR_VERSION 7 43 #define POWER_IP_PMC_AR_RELEASE_REVISION_VERSION 0 44 #define POWER_IP_PMC_SW_MAJOR_VERSION 3 45 #define POWER_IP_PMC_SW_MINOR_VERSION 0 46 #define POWER_IP_PMC_SW_PATCH_VERSION 0 47 48 /*================================================================================================== 49 FILE VERSION CHECKS 50 ==================================================================================================*/ 51 #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK 52 /* Check if Power_Ip_PMC.h file and StandardTypes.h file are of the same Autosar version */ 53 #if ((POWER_IP_PMC_AR_RELEASE_MAJOR_VERSION != STD_AR_RELEASE_MAJOR_VERSION) || \ 54 (POWER_IP_PMC_AR_RELEASE_MINOR_VERSION != STD_AR_RELEASE_MINOR_VERSION)) 55 #error "AutoSar Version Numbers of Power_Ip_PMC.h and StandardTypes.h are different" 56 #endif 57 58 /* Check if Power_Ip_PMC.h file and Mcal.h file are of the same Autosar version */ 59 #if ((POWER_IP_PMC_AR_RELEASE_MAJOR_VERSION != MCAL_AR_RELEASE_MAJOR_VERSION) || \ 60 (POWER_IP_PMC_AR_RELEASE_MINOR_VERSION != MCAL_AR_RELEASE_MINOR_VERSION)) 61 #error "AutoSar Version Numbers of Power_Ip_PMC.h and Mcal.h are different" 62 #endif 63 #endif /* #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK */ 64 65 /* Check if Power_Ip_PMC.h file and Power_Ip_Types.h file have same versions */ 66 #if (POWER_IP_PMC_VENDOR_ID != POWER_IP_TYPES_VENDOR_ID) 67 #error "Power_Ip_PMC.h and Power_Ip_Types.h have different vendor IDs" 68 #endif 69 70 /* Check if Power_Ip_PMC.h file and Power_Ip_Types.h file are of the same Autosar version */ 71 #if ((POWER_IP_PMC_AR_RELEASE_MAJOR_VERSION != POWER_IP_TYPES_AR_RELEASE_MAJOR_VERSION) || \ 72 (POWER_IP_PMC_AR_RELEASE_MINOR_VERSION != POWER_IP_TYPES_AR_RELEASE_MINOR_VERSION) || \ 73 (POWER_IP_PMC_AR_RELEASE_REVISION_VERSION != POWER_IP_TYPES_AR_RELEASE_REVISION_VERSION)) 74 #error "AutoSar Version Numbers of Power_Ip_PMC.h and Power_Ip_Types.h are different" 75 #endif 76 77 /* Check if Power_Ip_PMC.h file and Power_Ip_Types.h file are of the same Software version */ 78 #if ((POWER_IP_PMC_SW_MAJOR_VERSION != POWER_IP_TYPES_SW_MAJOR_VERSION) || \ 79 (POWER_IP_PMC_SW_MINOR_VERSION != POWER_IP_TYPES_SW_MINOR_VERSION) || \ 80 (POWER_IP_PMC_SW_PATCH_VERSION != POWER_IP_TYPES_SW_PATCH_VERSION)) 81 #error "Software Version Numbers of Power_Ip_PMC.h and Power_Ip_Types.h are different" 82 #endif 83 84 /*================================================================================================== 85 * CONSTANTS 86 ==================================================================================================*/ 87 88 89 /*================================================================================================== 90 DEFINES AND MACROS 91 ==================================================================================================*/ 92 93 /*================================================================================================== 94 * ENUMS 95 ==================================================================================================*/ 96 97 98 /*================================================================================================== 99 * STRUCTURES AND OTHER TYPEDEFS 100 ==================================================================================================*/ 101 102 103 104 /*================================================================================================== 105 * GLOBAL VARIABLE DECLARATIONS 106 ==================================================================================================*/ 107 108 109 /*================================================================================================== 110 * FUNCTION PROTOTYPES 111 ==================================================================================================*/ 112 #define MCU_START_SEC_CODE 113 #include "Mcu_MemMap.h" 114 115 116 #if (defined(POWER_IP_ENABLE_USER_MODE_SUPPORT)) 117 #if (STD_ON == POWER_IP_ENABLE_USER_MODE_SUPPORT) 118 #if (defined(MCAL_PMC_REG_PROT_AVAILABLE)) 119 #if (STD_ON == MCAL_PMC_REG_PROT_AVAILABLE) 120 void Power_Ip_PMC_SetUserAccessAllowed(void); 121 #endif /* (STD_ON == MCAL_PMC_REG_PROT_AVAILABLE) */ 122 #endif 123 #endif /* (STD_ON == POWER_IP_ENABLE_USER_MODE_SUPPORT) */ 124 #endif 125 126 void Power_Ip_PMC_PowerInit(const Power_Ip_PMC_ConfigType * ConfigPtr); 127 128 #if (defined(POWER_IP_PMCAECONFIG_API) && (STD_ON == POWER_IP_PMCAECONFIG_API)) 129 void Power_Ip_PMC_AE_PowerInit(const Power_Ip_PMC_ConfigType * ConfigPtr); 130 #endif 131 132 #if (defined(POWER_IP_ENTER_LOW_POWER_MODE)) 133 #if (POWER_IP_ENTER_LOW_POWER_MODE == STD_ON) 134 135 #ifdef POWER_IP_ENABLE_USER_MODE_SUPPORT 136 #if (STD_ON == POWER_IP_ENABLE_USER_MODE_SUPPORT) 137 138 #define Call_Power_Ip_PMC_PrepareLowPowerEntry() \ 139 OsIf_Trusted_Call(Power_Ip_PMC_PrepareLowPowerEntry) 140 #else 141 142 #define Call_Power_Ip_PMC_PrepareLowPowerEntry() \ 143 Power_Ip_PMC_PrepareLowPowerEntry() 144 #endif /* (STD_ON == POWER_IP_ENABLE_USER_MODE_SUPPORT) */ 145 #endif /* #ifdef POWER_IP_ENABLE_USER_MODE_SUPPORT */ 146 147 148 void Power_Ip_PMC_PrepareLowPowerEntry(void); 149 150 #endif /* (POWER_IP_ENTER_LOW_POWER_MODE == STD_ON) */ 151 #endif 152 153 #if (defined(POWER_IP_VOLTAGE_ERROR_ISR_USED)) 154 #if(POWER_IP_VOLTAGE_ERROR_ISR_USED == STD_ON) 155 void Power_Ip_PMC_VoltageErrorIsr(void); 156 157 #if (defined(POWER_IP_PMCAECONFIG_API) && (STD_ON == POWER_IP_PMCAECONFIG_API)) 158 void Power_Ip_PMC_AE_VoltageDetectHvdOnVddintVdd15Isr(void); 159 void Power_Ip_PMC_AE_VoltageDetectHvdOnVddIsr(void); 160 void Power_Ip_PMC_AE_VoltageDetectLvdOnVddcIsr(void); 161 void Power_Ip_PMC_AE_VoltageDetectLvdOnVlsIsr(void); 162 #endif 163 164 #endif 165 #endif /* (POWER_IP_VOLTAGE_ERROR_ISR_USED == STD_ON) */ 166 167 #define MCU_STOP_SEC_CODE 168 #include "Mcu_MemMap.h" 169 170 171 #ifdef __cplusplus 172 } 173 #endif 174 175 /** @} */ 176 #endif /* POWER_IP_PMC_H */ 177 178