1 /*
2  * Copyright 2020-2023 NXP
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef POWER_IP_MC_RGM_TYPES_H
8 #define POWER_IP_MC_RGM_TYPES_H
9 
10 /**
11 *   @file       Power_Ip_MC_RGM_Types.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 /*==================================================================================================
29                                          INCLUDE FILES
30  1) system and project includes
31  2) needed interfaces from external units
32  3) internal and external interfaces from this unit
33 ==================================================================================================*/
34 #include "Power_Ip_Specific.h"
35 
36 /*==================================================================================================
37                                SOURCE FILE VERSION INFORMATION
38 ==================================================================================================*/
39 #define POWER_IP_MC_RGM_TYPES_VENDOR_ID                       43
40 #define POWER_IP_MC_RGM_TYPES_AR_RELEASE_MAJOR_VERSION        4
41 #define POWER_IP_MC_RGM_TYPES_AR_RELEASE_MINOR_VERSION        7
42 #define POWER_IP_MC_RGM_TYPES_AR_RELEASE_REVISION_VERSION     0
43 #define POWER_IP_MC_RGM_TYPES_SW_MAJOR_VERSION                3
44 #define POWER_IP_MC_RGM_TYPES_SW_MINOR_VERSION                0
45 #define POWER_IP_MC_RGM_TYPES_SW_PATCH_VERSION                0
46 
47 /*==================================================================================================
48                                       FILE VERSION CHECKS
49 ==================================================================================================*/
50 /* Check if Power_Ip_MC_RGM_Types.h file and Power_Ip_Specific.h file have same versions */
51 #if (POWER_IP_MC_RGM_TYPES_VENDOR_ID  != POWER_IP_SPECIFIC_VENDOR_ID)
52     #error "Power_Ip_MC_RGM_Types.h and Power_Ip_Specific.h have different vendor IDs"
53 #endif
54 
55 /* Check if Power_Ip_MC_RGM_Types.h file and Power_Ip_Specific.h file are of the same Autosar version */
56 #if ((POWER_IP_MC_RGM_TYPES_AR_RELEASE_MAJOR_VERSION    != POWER_IP_SPECIFIC_AR_RELEASE_MAJOR_VERSION) || \
57      (POWER_IP_MC_RGM_TYPES_AR_RELEASE_MINOR_VERSION    != POWER_IP_SPECIFIC_AR_RELEASE_MINOR_VERSION) || \
58      (POWER_IP_MC_RGM_TYPES_AR_RELEASE_REVISION_VERSION != POWER_IP_SPECIFIC_AR_RELEASE_REVISION_VERSION))
59     #error "AutoSar Version Numbers of Power_Ip_MC_RGM_Types.h and Power_Ip_Specific.h are different"
60 #endif
61 
62 /* Check if Power_Ip_MC_RGM_Types.h file and Power_Ip_Specific.h file are of the same Software version */
63 #if ((POWER_IP_MC_RGM_TYPES_SW_MAJOR_VERSION != POWER_IP_SPECIFIC_SW_MAJOR_VERSION) || \
64      (POWER_IP_MC_RGM_TYPES_SW_MINOR_VERSION != POWER_IP_SPECIFIC_SW_MINOR_VERSION) || \
65      (POWER_IP_MC_RGM_TYPES_SW_PATCH_VERSION != POWER_IP_SPECIFIC_SW_PATCH_VERSION))
66     #error "Software Version Numbers of Power_Ip_MC_RGM_Types.h and Power_Ip_Specific.h are different"
67 #endif
68 
69 /*==================================================================================================
70 *                                          CONSTANTS
71 ==================================================================================================*/
72 
73 
74 /*==================================================================================================
75                                        DEFINES AND MACROS
76 ==================================================================================================*/
77 
78 
79 /*==================================================================================================
80 *                                             ENUMS
81 ==================================================================================================*/
82 
83 #if (POWER_IP_PERFORM_RESET_API == STD_ON)
84 /**
85 * @brief            Reset type to be performed through the Mcu_PerformReset() API.
86 * @details          Destructive Reset:
87 *                       - Flash is always reset, so an updated value of the option bits is reloaded
88 *                         in volatile registers outside of the Flash array.
89 *                       - Trimming is lost.
90 *                       - STCU is reset and configured BISTs are executed
91 *                   Functional Reset:
92 *                       - Starts the reset sequence from PHASE1 or from PHASE3.
93 *                       - The volatile registers are not reset; in case of a reset event, the
94 *                         trimming is maintained.
95 *                       - No BISTs shall be executed after functional resets.
96 */
97 typedef enum
98 {
99     MCU_FUNC_RESET = 0x5AU,     /**< @brief Functional Reset type. */
100     MCU_DEST_RESET = 0x3CU      /**< @brief Destructive Reset type. */
101 
102 } Power_Ip_MC_RGM_ResetType;
103 #endif /* (POWER_IP_PERFORM_RESET_API == STD_ON) */
104 
105 
106 /*==================================================================================================
107 *                                STRUCTURES AND OTHER TYPEDEFS
108 ==================================================================================================*/
109 
110 /**
111 * @brief            Configuration of MC_RGM hardware IP.
112 * @details          This data configuration is set at module initialization phase.
113 */
114 typedef struct
115 {
116 #if (POWER_IP_PERFORM_RESET_API == STD_ON)
117     /** @brief RESET type: Functional vs Destructive. */
118     Power_Ip_MC_RGM_ResetType ResetType;
119 #endif /* (POWER_IP_PERFORM_RESET_API == STD_ON) */
120 
121 #if (defined(POWER_IP_FUNCTIONAL_RESET_DISABLE_SUPPORT))
122   #if (POWER_IP_FUNCTIONAL_RESET_DISABLE_SUPPORT == STD_ON)
123     /** @brief Enable/Disable functional reset sources (RGM_FERD register). */
124     uint32 FuncResetOpt;
125   #endif
126 #endif /* POWER_IP_FUNCTIONAL_RESET_DISABLE_SUPPORT */
127 
128     /** @brief Functional Reset Escalation Threshold (RGM_FRET register). */
129     uint32 FesThresholdReset;
130 
131     /** @brief Destructive Reset Escalation Threshold (RGM_DRET register). */
132     uint32 DesThresholdReset;
133 
134 #if defined(POWER_IP_FUNCTIONAL_RESET_ENTRY_TIMEOUT_SUPPORT)
135   #if (POWER_IP_FUNCTIONAL_RESET_ENTRY_TIMEOUT_SUPPORT == STD_ON)
136     uint32 ResetEntryTimeout;
137   #endif
138 #endif
139 
140 } Power_Ip_MC_RGM_ConfigType;
141 
142 
143 #if (defined(POWER_IP_RESET_ALTERNATE_ISR_USED))
144   #if (POWER_IP_RESET_ALTERNATE_ISR_USED == STD_ON)
145 typedef enum
146 {
147     POWER_MC_RGM_UNINIT = 0,  /**< @brief The MC_RGM driver is uninitialized. */
148     POWER_MC_RGM_INIT = 1     /**< @brief The MC_RGM driver is initialized. */
149 } Power_MC_RGM_StatusType;
150   #endif
151 #endif
152 /*==================================================================================================
153 *                                GLOBAL VARIABLE DECLARATIONS
154 ==================================================================================================*/
155 
156 
157 /*==================================================================================================
158 *                                    FUNCTION PROTOTYPES
159 ==================================================================================================*/
160 
161 
162 #ifdef __cplusplus
163 }
164 #endif
165 
166 /** @} */
167 #endif /* POWER_IP_MC_RGM_TYPES_H */
168 
169