1 /*
2  * Copyright 2020-2023 NXP
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef POWER_IP_MC_RGM_H
8 #define POWER_IP_MC_RGM_H
9 
10 /**
11 *   @file       Power_Ip_MC_RGM.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_MC_RGM_VENDOR_ID                       43
41 #define POWER_IP_MC_RGM_AR_RELEASE_MAJOR_VERSION        4
42 #define POWER_IP_MC_RGM_AR_RELEASE_MINOR_VERSION        7
43 #define POWER_IP_MC_RGM_AR_RELEASE_REVISION_VERSION     0
44 #define POWER_IP_MC_RGM_SW_MAJOR_VERSION                3
45 #define POWER_IP_MC_RGM_SW_MINOR_VERSION                0
46 #define POWER_IP_MC_RGM_SW_PATCH_VERSION                0
47 
48 /*==================================================================================================
49                                       FILE VERSION CHECKS
50 ==================================================================================================*/
51 #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
52 /* Check if Power_Ip_MC_RGM.h file and StandardTypes.h file are of the same Autosar version */
53 #if ((POWER_IP_MC_RGM_AR_RELEASE_MAJOR_VERSION    != STD_AR_RELEASE_MAJOR_VERSION) || \
54      (POWER_IP_MC_RGM_AR_RELEASE_MINOR_VERSION    != STD_AR_RELEASE_MINOR_VERSION))
55     #error "AutoSar Version Numbers of Power_Ip_MC_RGM.h and StandardTypes.h are different"
56 #endif
57 
58 /* Check if Power_Ip_MC_RGM.h file and Mcal.h file are of the same Autosar version */
59 #if ((POWER_IP_MC_RGM_AR_RELEASE_MAJOR_VERSION    != MCAL_AR_RELEASE_MAJOR_VERSION) || \
60      (POWER_IP_MC_RGM_AR_RELEASE_MINOR_VERSION    != MCAL_AR_RELEASE_MINOR_VERSION))
61     #error "AutoSar Version Numbers of Power_Ip_MC_RGM.h and Mcal.h are different"
62 #endif
63 #endif
64 
65 /* Check if Power_Ip_MC_RGM.h file and Power_Ip_Types.h file have same versions */
66 #if (POWER_IP_MC_RGM_VENDOR_ID  != POWER_IP_TYPES_VENDOR_ID)
67     #error "Power_Ip_MC_RGM.h and Power_Ip_Types.h have different vendor IDs"
68 #endif
69 
70 /* Check if Power_Ip_MC_RGM.h file and Power_Ip_Types.h file are of the same Autosar version */
71 #if ((POWER_IP_MC_RGM_AR_RELEASE_MAJOR_VERSION    != POWER_IP_TYPES_AR_RELEASE_MAJOR_VERSION) || \
72      (POWER_IP_MC_RGM_AR_RELEASE_MINOR_VERSION    != POWER_IP_TYPES_AR_RELEASE_MINOR_VERSION) || \
73      (POWER_IP_MC_RGM_AR_RELEASE_REVISION_VERSION != POWER_IP_TYPES_AR_RELEASE_REVISION_VERSION))
74     #error "AutoSar Version Numbers of Power_Ip_MC_RGM.h and Power_Ip_Types.h are different"
75 #endif
76 
77 /* Check if Power_Ip_MC_RGM.h file and Power_Ip_Types.h file are of the same Software version */
78 #if ((POWER_IP_MC_RGM_SW_MAJOR_VERSION != POWER_IP_TYPES_SW_MAJOR_VERSION) || \
79      (POWER_IP_MC_RGM_SW_MINOR_VERSION != POWER_IP_TYPES_SW_MINOR_VERSION) || \
80      (POWER_IP_MC_RGM_SW_PATCH_VERSION != POWER_IP_TYPES_SW_PATCH_VERSION))
81     #error "Software Version Numbers of Power_Ip_MC_RGM.h and Power_Ip_Types.h are different"
82 #endif
83 /*==================================================================================================
84 *                                          CONSTANTS
85 ==================================================================================================*/
86 
87 
88 /*==================================================================================================
89                                        DEFINES AND MACROS
90 ==================================================================================================*/
91 
92 /*==================================================================================================
93 *                                             ENUMS
94 ==================================================================================================*/
95 
96 
97 /*==================================================================================================
98 *                                STRUCTURES AND OTHER TYPEDEFS
99 ==================================================================================================*/
100 
101 
102 /*==================================================================================================
103 *                                GLOBAL VARIABLE DECLARATIONS
104 ==================================================================================================*/
105 
106 
107 /*==================================================================================================
108 *                                    FUNCTION PROTOTYPES
109 ==================================================================================================*/
110 #define MCU_START_SEC_CODE
111 
112 #include "Mcu_MemMap.h"
113 
114 
115 #if (defined(POWER_IP_ENABLE_USER_MODE_SUPPORT))
116   #if (STD_ON == POWER_IP_ENABLE_USER_MODE_SUPPORT)
117     #if (defined(MCAL_MC_RGM_REG_PROT_AVAILABLE))
118       #if (STD_ON == MCAL_MC_RGM_REG_PROT_AVAILABLE)
119 void Power_Ip_MC_RGM_SetUserAccessAllowed(void);
120       #endif /* (STD_ON == MCAL_MC_RGM_REG_PROT_AVAILABLE) */
121     #endif
122     #if (defined(MCAL_RDC_REG_PROT_AVAILABLE))
123       #if (STD_ON == MCAL_RDC_REG_PROT_AVAILABLE)
124 void Power_Ip_RDC_SetUserAccessAllowed(void);
125       #endif /* (STD_ON == MCAL_RDC_REG_PROT_AVAILABLE) */
126     #endif
127   #endif
128 #endif /* (STD_ON == POWER_IP_ENABLE_USER_MODE_SUPPORT) */
129 
130 
131 #ifdef POWER_IP_ENABLE_USER_MODE_SUPPORT
132   #if (STD_ON == POWER_IP_ENABLE_USER_MODE_SUPPORT)
133 
134 #define  Call_Power_Ip_MC_RGM_ResetInit(MC_RGM_pConfigPtr) \
135     OsIf_Trusted_Call1param(Power_Ip_MC_RGM_ResetInit,(MC_RGM_pConfigPtr))
136   #else
137 
138 #define  Call_Power_Ip_MC_RGM_ResetInit(MC_RGM_pConfigPtr) \
139     Power_Ip_MC_RGM_ResetInit(MC_RGM_pConfigPtr)
140   #endif
141 #endif
142 
143 #ifdef POWER_IP_ENABLE_USER_MODE_SUPPORT
144   #if (STD_ON == POWER_IP_ENABLE_USER_MODE_SUPPORT)
145 
146 #define  Call_Power_Ip_MC_RGM_PerformReset(MC_RGM_pConfigPtr) \
147     OsIf_Trusted_Call1param(Power_Ip_MC_RGM_PerformReset,(MC_RGM_pConfigPtr))
148   #else
149 
150 #define  Call_Power_Ip_MC_RGM_PerformReset(MC_RGM_pConfigPtr) \
151     Power_Ip_MC_RGM_PerformReset(MC_RGM_pConfigPtr)
152   #endif
153 #endif /* POWER_IP_ENABLE_USER_MODE_SUPPORT */
154 
155 
156 #ifdef POWER_IP_ENABLE_USER_MODE_SUPPORT
157   #if (STD_ON == POWER_IP_ENABLE_USER_MODE_SUPPORT)
158 
159 #define  Call_Power_Ip_MC_RGM_GetResetReason() \
160     OsIf_Trusted_Call_Return((uint32)Power_Ip_MC_RGM_GetResetReason)
161   #else
162 
163 #define  Call_Power_Ip_MC_RGM_GetResetReason() \
164     Power_Ip_MC_RGM_GetResetReason()
165   #endif
166 #endif /* POWER_IP_ENABLE_USER_MODE_SUPPORT */
167 
168 
169 #ifdef POWER_IP_ENABLE_USER_MODE_SUPPORT
170   #if (STD_ON == POWER_IP_ENABLE_USER_MODE_SUPPORT)
171 
172 #define  Call_Power_Ip_MC_RGM_GetResetRawValue() \
173     OsIf_Trusted_Call_Return(Power_Ip_MC_RGM_GetResetRawValue)
174   #else
175 
176 #define  Call_Power_Ip_MC_RGM_GetResetRawValue() \
177     Power_Ip_MC_RGM_GetResetRawValue()
178   #endif
179 #endif
180 
181 #if (defined(POWER_IP_RESET_DURING_STANDBY_SUPPORTED))
182   #if (POWER_IP_RESET_DURING_STANDBY_SUPPORTED == STD_ON)
183     #if (defined(POWER_IP_ENTER_LOW_POWER_MODE))
184       #if (POWER_IP_ENTER_LOW_POWER_MODE == STD_ON)
185         #ifdef POWER_IP_ENABLE_USER_MODE_SUPPORT
186           #if (STD_ON == POWER_IP_ENABLE_USER_MODE_SUPPORT)
187 
188 #define  Call_Power_Ip_MC_RGM_ResetDuringStandby() \
189     OsIf_Trusted_Call_Return(Power_Ip_MC_RGM_ResetDuringStandby)
190           #else
191 
192 #define  Call_Power_Ip_MC_RGM_ResetDuringStandby() \
193     Power_Ip_MC_RGM_ResetDuringStandby()
194           #endif
195         #endif /* POWER_IP_ENABLE_USER_MODE_SUPPORT */
196       #endif /*(POWER_IP_ENTER_LOW_POWER_MODE == STD_ON) */
197     #endif
198   #endif
199 #endif /* (POWER_IP_RESET_DURING_STANDBY_SUPPORTED == STD_ON) */
200 
201 
202 void Power_Ip_MC_RGM_ResetInit(const Power_Ip_MC_RGM_ConfigType * ConfigPtr);
203 
204 Power_Ip_ResetType Power_Ip_MC_RGM_GetResetReason(void);
205 Power_Ip_RawResetType Power_Ip_MC_RGM_GetResetRawValue(void);
206 
207 
208 #if (defined(POWER_IP_RESET_DURING_STANDBY_SUPPORTED))
209   #if (POWER_IP_RESET_DURING_STANDBY_SUPPORTED == STD_ON)
210     #if (defined(POWER_IP_ENTER_LOW_POWER_MODE))
211       #if (POWER_IP_ENTER_LOW_POWER_MODE == STD_ON)
212 uint8 Power_Ip_MC_RGM_ResetDuringStandby(void);
213       #endif /*(POWER_IP_ENTER_LOW_POWER_MODE == STD_ON) */
214     #endif
215   #endif
216 #endif /* (POWER_IP_RESET_DURING_STANDBY_SUPPORTED == STD_ON) */
217 
218 #if (defined(POWER_IP_PERFORM_RESET_API))
219   #if (POWER_IP_PERFORM_RESET_API == STD_ON)
220 void Power_Ip_MC_RGM_PerformReset(const Power_Ip_MC_RGM_ConfigType * ConfigPtr);
221   #endif /* (POWER_IP_PERFORM_RESET_API == STD_ON) */
222 #endif
223 
224 #if (defined(POWER_IP_RESET_ALTERNATE_ISR_USED))
225   #if (POWER_IP_RESET_ALTERNATE_ISR_USED == STD_ON)
226 void Power_Ip_MC_RGM_ResetAltInt(void);
227 #endif /* (POWER_IP_RESET_ALTERNATE_ISR_USED == STD_ON) */
228 #endif
229 
230 
231 #define MCU_STOP_SEC_CODE
232 
233 #include "Mcu_MemMap.h"
234 
235 
236 #ifdef __cplusplus
237 }
238 #endif
239 
240 /** @} */
241 #endif /* POWER_IP_MC_RGM_H */
242 
243