1 /*
2  * Copyright 2020-2023 NXP
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef CLOCK_IP_TRUSTEDFUNCTIONS_H
8 #define CLOCK_IP_TRUSTEDFUNCTIONS_H
9 
10 /**
11 *   @file    Clock_Ip_TrustedFunctions.h
12 *   @version    3.0.0
13 *
14 *   @brief   CLOCK IP type header file.
15 *   @details CLOCK IP type header file.
16 
17 *   @addtogroup CLOCK_DRIVER Clock Ip Driver
18 *   @{
19 */
20 
21 #if defined(__cplusplus)
22 extern "C"{
23 #endif
24 /*==================================================================================================
25 *                                          INCLUDE FILES
26 * 1) system and project includes
27 * 2) needed interfaces from external units
28 * 3) internal and external interfaces from this unit
29 ==================================================================================================*/
30 #include "StandardTypes.h"
31 #include "Clock_Ip_Cfg.h"
32 #include "Clock_Ip_Specific.h"
33 /*==================================================================================================
34                                SOURCE FILE VERSION INFORMATION
35 ==================================================================================================*/
36 #define CLOCK_IP_TRUSTEDFUNCTIONS_VENDOR_ID                       43
37 #define CLOCK_IP_TRUSTEDFUNCTIONS_AR_RELEASE_MAJOR_VERSION        4
38 #define CLOCK_IP_TRUSTEDFUNCTIONS_AR_RELEASE_MINOR_VERSION        7
39 #define CLOCK_IP_TRUSTEDFUNCTIONS_AR_RELEASE_REVISION_VERSION     0
40 #define CLOCK_IP_TRUSTEDFUNCTIONS_SW_MAJOR_VERSION                3
41 #define CLOCK_IP_TRUSTEDFUNCTIONS_SW_MINOR_VERSION                0
42 #define CLOCK_IP_TRUSTEDFUNCTIONS_SW_PATCH_VERSION                0
43 
44 /*==================================================================================================
45                                       FILE VERSION CHECKS
46 ==================================================================================================*/
47 #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
48 /* Check if Clock_Ip_TrustedFunctions.h file and StandardTypes.h file are of the same Autosar version */
49 #if ((CLOCK_IP_TRUSTEDFUNCTIONS_AR_RELEASE_MAJOR_VERSION    != STD_AR_RELEASE_MAJOR_VERSION) || \
50      (CLOCK_IP_TRUSTEDFUNCTIONS_AR_RELEASE_MINOR_VERSION    != STD_AR_RELEASE_MINOR_VERSION))
51     #error "AutoSar Version Numbers of Clock_Ip_TrustedFunctions.h and StandardTypes.h are different"
52 #endif
53 #endif
54 
55 /* Check if Clock_Ip_TrustedFunctions.h file and Clock_Ip_Cfg.h file have same versions */
56 #if (CLOCK_IP_TRUSTEDFUNCTIONS_VENDOR_ID  != CLOCK_IP_CFG_VENDOR_ID)
57     #error "Clock_Ip_TrustedFunctions.h and Clock_Ip_Cfg.h have different vendor IDs"
58 #endif
59 
60 /* Check if Clock_Ip_TrustedFunctions.h file and Clock_Ip_Cfg.h file are of the same Autosar version */
61 #if ((CLOCK_IP_TRUSTEDFUNCTIONS_AR_RELEASE_MAJOR_VERSION    != CLOCK_IP_CFG_AR_RELEASE_MAJOR_VERSION) || \
62      (CLOCK_IP_TRUSTEDFUNCTIONS_AR_RELEASE_MINOR_VERSION    != CLOCK_IP_CFG_AR_RELEASE_MINOR_VERSION) || \
63      (CLOCK_IP_TRUSTEDFUNCTIONS_AR_RELEASE_REVISION_VERSION != CLOCK_IP_CFG_AR_RELEASE_REVISION_VERSION))
64     #error "AutoSar Version Numbers of Clock_Ip_TrustedFunctions.h and Clock_Ip_Cfg.h are different"
65 #endif
66 
67 /* Check if Clock_Ip_TrustedFunctions.h file and Clock_Ip_Cfg.h file are of the same Software version */
68 #if ((CLOCK_IP_TRUSTEDFUNCTIONS_SW_MAJOR_VERSION != CLOCK_IP_CFG_SW_MAJOR_VERSION) || \
69      (CLOCK_IP_TRUSTEDFUNCTIONS_SW_MINOR_VERSION != CLOCK_IP_CFG_SW_MINOR_VERSION) || \
70      (CLOCK_IP_TRUSTEDFUNCTIONS_SW_PATCH_VERSION != CLOCK_IP_CFG_SW_PATCH_VERSION))
71     #error "Software Version Numbers of Clock_Ip_TrustedFunctions.h and Clock_Ip_Cfg.h are different"
72 #endif
73 
74 /* Check if Clock_Ip_TrustedFunctions.h file and Clock_Ip_Specific.h file have same versions */
75 #if (CLOCK_IP_TRUSTEDFUNCTIONS_VENDOR_ID  != CLOCK_IP_SPECIFIC_VENDOR_ID)
76     #error "Clock_Ip_TrustedFunctions.h and Clock_Ip_Specific.h have different vendor IDs"
77 #endif
78 
79 /* Check if Clock_Ip_TrustedFunctions.h file and Clock_Ip_Specific.h file are of the same Autosar version */
80 #if ((CLOCK_IP_TRUSTEDFUNCTIONS_AR_RELEASE_MAJOR_VERSION    != CLOCK_IP_SPECIFIC_AR_RELEASE_MAJOR_VERSION) || \
81      (CLOCK_IP_TRUSTEDFUNCTIONS_AR_RELEASE_MINOR_VERSION    != CLOCK_IP_SPECIFIC_AR_RELEASE_MINOR_VERSION) || \
82      (CLOCK_IP_TRUSTEDFUNCTIONS_AR_RELEASE_REVISION_VERSION != CLOCK_IP_SPECIFIC_AR_RELEASE_REVISION_VERSION))
83     #error "AutoSar Version Numbers of Clock_Ip_TrustedFunctions.h and Clock_Ip_Specific.h are different"
84 #endif
85 
86 /* Check if Clock_Ip_TrustedFunctions.h file and Clock_Ip_Specific.h file are of the same Software version */
87 #if ((CLOCK_IP_TRUSTEDFUNCTIONS_SW_MAJOR_VERSION != CLOCK_IP_SPECIFIC_SW_MAJOR_VERSION) || \
88      (CLOCK_IP_TRUSTEDFUNCTIONS_SW_MINOR_VERSION != CLOCK_IP_SPECIFIC_SW_MINOR_VERSION) || \
89      (CLOCK_IP_TRUSTEDFUNCTIONS_SW_PATCH_VERSION != CLOCK_IP_SPECIFIC_SW_PATCH_VERSION))
90     #error "Software Version Numbers of Clock_Ip_TrustedFunctions.h and Clock_Ip_Specific.h are different"
91 #endif
92 
93 /*==================================================================================================
94 *                                            CONSTANTS
95 ==================================================================================================*/
96 
97 /*==================================================================================================
98 *                                       DEFINES AND MACROS
99 ==================================================================================================*/
100 
101 /*==================================================================================================
102 *                                              ENUMS
103 ==================================================================================================*/
104 
105 /*==================================================================================================
106 *                                  STRUCTURES AND OTHER TYPEDEFS
107 ==================================================================================================*/
108 
109 /*==================================================================================================
110 *                                  GLOBAL VARIABLE DECLARATIONS
111 ==================================================================================================*/
112 
113 /*==================================================================================================
114 *                                       FUNCTION PROTOTYPES
115 ==================================================================================================*/
116 
117 
118 #if (defined(CLOCK_IP_ENABLE_USER_MODE_SUPPORT))
119   #if (STD_ON == CLOCK_IP_ENABLE_USER_MODE_SUPPORT)
120 
121 /* Clock start section code */
122 #define MCU_START_SEC_CODE
123 #include "Mcu_MemMap.h"
124 
125 /**
126  * @brief        Set user access allowed for some clock register
127  *
128  * @param        None
129  * @return       None
130  *
131  */
132 extern void Clock_Ip_SpecificSetUserAccessAllowed(void);
133 
134 #ifdef CLOCK_IP_RTC_RTCC_CLKSELECT
135 /**
136  * @brief        Write Config RTCCLKSEL to register
137  *
138  * @param        Config - pointer to configuration of RTC selector
139  * @return       None
140  *
141  */
142 extern void Clock_Ip_SetRtcRtccClksel_TrustedCall(Clock_Ip_SelectorConfigType const *Config);
143 #endif
144 
145 
146 #ifdef CLOCK_IP_GET_FREQUENCY_API
147 #if (CLOCK_IP_GET_FREQUENCY_API == STD_ON)
148 /**
149  * @brief        Return the frequency of RTC_CLK clock
150  *
151  * @param        None
152  * @return       uint32
153  *
154  */
155 extern uint32 Clock_Ip_Get_RTC_CLK_Frequency_TrustedCall(void);
156 #endif
157 #endif
158 
159 /**
160  * @brief        Set user access allowed for some clock register
161  *
162  * @param        None
163  * @return       None
164  *
165  */
166 extern void Clock_Ip_PowerClockIpModules(void);
167 
168 /* Clock stop section code */
169 #define MCU_STOP_SEC_CODE
170 #include "Mcu_MemMap.h"
171 
172 /* Clock start rom section code */
173 #define MCU_START_SEC_CODE_AC
174 #include "Mcu_MemMap.h"
175 
176 #ifdef CLOCK_IP_HAS_RAM_WAIT_STATES
177 /**
178  * @brief        Set Ram waitstate value base on core_clk
179  *
180  * @param        None
181  * @return       None
182  *
183  */
184 extern void Clock_Ip_PRAMCSetRamIWS(void);
185 #endif
186 /* Clock stop rom section code */
187 #define MCU_STOP_SEC_CODE_AC
188 #include "Mcu_MemMap.h"
189 
190   #endif
191 #endif /* CLOCK_IP_ENABLE_USER_MODE_SUPPORT */
192 
193 
194 
195 
196 
197 #if defined(__cplusplus)
198 }
199 #endif /* __cplusplus*/
200 
201 /*! @}*/
202 
203 #endif /* CLOCK_IP_TRUSTEDFUNCTIONS_H */
204 
205 
206